function chkblank(strValue,b,fld)
{
	var objRegExp = /^(\s*)$/;
	if(objRegExp.test(strValue)) 
	{
        strValue = strValue.replace(objRegExp, '');
	}
    if(strValue.length == 0)
	{
		alert(b+ " field is blank");
		fld.focus( ); 
		return true;
	}
}

function chkNaN(strValue,b,fld)
{
	if (isNaN(strValue))
	{ 	
		alert("Please enter numeric value for " + b);
		fld.focus();
   		return true;  
	}
}

function chkcmb(strValue,b,fld)
{
	var objRegExp = /^(\s*)$/;
	if(objRegExp.test(strValue)) 
	{
        strValue = strValue.replace(objRegExp, '');
	}
    if(strValue.length == 0)
	{
		alert("Please Select " + b);
		fld.focus( ); 
		return true;
	}
}

function chkNZ(strValue,b,fld)
{
	if (chkblank(strValue,b,fld)) return true;
	if (chkNaN(strValue,b,fld)) return true;
	if (parseInt(strValue)<=0)
	{
		alert(b+ " can not be less then equal to Zero");
		fld.focus( ); 
		return true;
	}
}


function chkbox(msg,chk,fld,ctr)
{
	if(chk.checked==true)
	{
		flgchecked=0
		for(i=0;i<parseInt(ctr);i++)
		{
			
			if(fld[i].checked==true)
			{
				flgchecked=1
			}
		}
		
		if(flgchecked==0)
		{
			alert("Atleast Select One " +msg);
			fld[0].focus();
			return true;
		}
	}
}

function chkdate(date1,date2,dmsg1,dmsg2,time1,time2,fld)
{
	if (date1>date2)
	{
		alert(dmsg1 +" Date Cannot be greater than " +  dmsg2 + "Date");
		fld.focus();
		return true;
	}
	else if (date1<date2)
	{}
	else
	{
		if (parseInt(time1.value) >= parseInt(time2.value))
		{
			alert(dmsg1 + " Time Cannot be greater than or same as "+ dmsg2 +" Time on Same Date");
			time2.focus();
			return true;

		}
	}	
}
