function Minlen(txtbox,l,fld)
{
	var val = document.all.item(txtbox).value
	if((val.length!=0)&&(val.length < l))
	{
		alert(fld+" length should be more than "+l+" characters.");
		document.all.item(txtbox).focus();
	}
}
			
function Maxlen(txtbox,l,fld)
{
	var val = document.all.item(txtbox).value
	if(val.length > l)
	{
		alert(fld+" length should be less than "+l+" characters.");
		document.all.item(txtbox).focus();
	}
}

function MinMaxlen(txtbox,mnl,mxl,fld)
{
	var val = document.all.item(txtbox).value
	if(val.length > mxl)
	{
		alert(fld+" length should be less than "+mxl+" characters.");
		document.all.item(txtbox).focus();
	}
	else if((val.length!=0)&&(val.length < mnl))
	{
		alert(fld+" length should be more than "+mnl+" characters.");
		document.all.item(txtbox).focus();
	}
}


function ClearText(txtbox)
{
	document.getElementById(txtbox).value = "";
}

function check(txtbox1,txtbox2)
{
	var val1 = document.all.item(txtbox1).value
	var val2 = document.all.item(txtbox2).value
	if((val1.length == 0)||(val2.length == 0))
	{
		alert("User ID and Password cannot be empty")
		document.all.item("txtUserId").focus();
	}
}

function Num(txtbox,fld)
{
	var val = document.all.item(txtbox).value
	if((val <= 0)&&(val.length != 0))
	{
		alert(fld+" should be valid");
	}
}

function Compnumber(txtbox1,txtbox2,min,max)
{
	var val1 = document.all.item(txtbox1).value
	var val2 = document.all.item(txtbox2).value
	
	if(parseFloat(val1) > parseFloat(val2))
	{
		alert(min+" cannot be more than "+max);
		document.all.item(txtbox2).focus();
	}
}

function Clearfields()
{
	document.Form1.reset();
}