// JScript source code
function chkValues(str1, str2 , strMsg)
{
	if (str1!=str2)
	{
		alert(strMsg);
		return false; 
	}
	return;
}
//used for the scrolling purpose
function OnScroll(sc)
{		
	alert(document.body.scrollTop);
	document.getElementById("txtscrollbarval").value = document.body.scrollTop;
}	
function setScrollValue()
{
	alert(document.getElementById("txtscrollbarval").value);
	document.body.scrollTop = document.getElementById("txtscrollbarval").value;
}

function OpenWindow(strPath)
{
	window.open(strPath, "", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,directories=no,location=no,width=600,height=495,left=300,top=200" );
}

function isEmpty(ControlToValidate, alertMsg)
{
	if (ControlToValidate.value=="")
	{
		alert(alertMsg);
		ControlToValidate.focus();
		return false;
	}
	return true;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~Chks the Entered value is Number or not..~~~~~~~~~~
//CREATED BY: Bhavin
//Version: 1.0
//Created Date: 15-01-2003
//Modified Date:
//Modified By:
function validateNumber(ControlToChk)
{
	if (isNaN(ControlToChk.value))
	{
		alert("Enter a numeric value!!");
		ControlToChk.focus();
		return false;	
	}
return true;
}

function checkDecimal(ControlToChk)
{
	var TaxPercent = ControlToChk.value;
	if(TaxPercent.length == 0)
	return true;
		
	rx = /^(\d{1,3}(\,\d{3})*|(\d+))(\.\d{1,2})?$/
	if(!rx.test(TaxPercent))
	{
		alert("Please enter the valid format");
		ControlToChk.focus();
	}
}
function validateText(ControlToChk,strMessage)
{
	if(isEmpty(ControlToChk))
	{alert(strMessage);
		ControlToChk.focus();
		return false;	
	}
return true;
}


