function isempty(Formfield,Label)
{
	var result = false;
	if (Formfield.value =="")
	{
		alert('Please enter '+ Label);
		Formfield.focus();
		result = true;
	}
return result; 
}

function isemptydate(Formfield,Label)
{
	var result = false;
	if (Formfield.value =="")
	{
		alert('Please select '+ Label);
		Formfield.focus();
		result = true;
	}
return result; 
}

function otherValues(Formfield,Label,values,alertString)
{

var result = false;
var strValue = Formfield.value;
strValue="Formfield.value.match(/[^"+values+"]/)"
condition = eval(strValue)

if (condition)
	{
	alert('Please use only '+ alertString+" in "+Label);
	Formfield.focus();
	result = true;
	}
	
return result;

}

function isValidLength(Formfield,Label,min,max)
{
	var result = false;
	if ( (Formfield.value.length < min )|| (Formfield.value.length > max) )
	{
		alert(Label+' should be of minimum '+min+' characters and should not exceed '+max+' characters')
		Formfield.focus();
		result = true;
	} 
return result; 
	
}

function isemptylength(Formfield,Label)
{
	var result = false;
	if (Formfield.value.length==0)
	{
		alert('Please enter valid '+ Label);
		Formfield.focus();
		result = true;
	}
return result; 
	
}

function isvalid(Formfield,Label)
{
	var result = false;
	if (Formfield.value ==0)
	{
		alert('Please select any '+ Label);
		Formfield.focus();
		result = true;
	}
return result; 
	
}


function isequal(Formfield1,Formfield2,Label1,Label2)
{
	var result = false;
	if (Formfield1.value != Formfield2.value)
	{
		alert(Label1+' and '+Label2+' are not equal');
		Formfield1.focus();
		result = true;
	}
return result; 
	
}


function islarger(Formfield1,Formfield2,Label1,Label2)
{
	var result = false;
	if (parseInt(Formfield1.value) >= parseInt(Formfield2.value))
	{
		alert(Label2+' must be greater than '+Label1);
		Formfield1.focus();
		result = true;
	}
return result; 
	
}


/*email check*/
function isNotvalidemail(Formfield,Label)
{
	var result =  false;
	eml=Formfield.value
	if(!eml.match(/^([a-z0-9])((\.?|(_|\-)?)([a-z0-9])+)*@([a-z0-9])+\.(([a-z0-9])+(\.?|(_|\-)?))*[a-z]{2}$/i))
	{
		alert("Please enter valid "+ Label)
		Formfield.focus();
		result =  true;
	}
	return result;
}
function ConvertDate(TheDate)
{
	TheDate1=TheDate.split("/")
	dt1=new Date()
	dt1.setDate(TheDate1[1])
	dt1.setMonth(parseInt(TheDate1[0])-1)
	dt1.setYear(TheDate1[2])
	return dt1
}