<!-- Hide From the old browsers
//	Copy right Bosco Infotech 2002 :: Author : Loganathan N , logudotcom@yahoo.com  
// 						 All rights are reserved . 

function TextValidate(txtCtrl,val) {
	var ctrName = val;		
	Remove_Spaces(txtCtrl);		
	if (txtCtrl.value == "") {		
		alert("Please enter " + ctrName + ".");		
		txtCtrl.focus();   	
		return false;		
	}
	if(txtCtrl.value.indexOf("'") > -1){		
		alert("Please Don't enter ' in " + ctrName + ".");		
		txtCtrl.focus();   	
		return false;		
	}			
}


//-----------------------------------------------------------
function NumberValidate(txtCtrl, val) {
	var ctrName = val;
	Remove_Spaces(txtCtrl);
	if (txtCtrl.value == "" || isNaN(txtCtrl.value)) {
		alert("Please enter " + ctrName + ".");
		txtCtrl.focus();	   	
		return false;
	}		
}

//-----------------------------------------
// Req field
function EmailValidate(txtCtrl, val) {
	var ctrName = val;
	Remove_Spaces(txtCtrl);
	txtCtrl.value=txtCtrl.value.replace(/ \*/g,"");

	if (txtCtrl.value.indexOf("@") < 2 ||txtCtrl.value.indexOf(".") < 0) {
		alert("Please enter valid email Id");
		txtCtrl.focus();	   	
		txtCtrl.select();
		return false;
	}		
	if(txtCtrl.value.indexOf("'") > -1){		
		alert("Please Don't enter ' in " + ctrName + ".");		
		txtCtrl.focus();   	
		return false;		
	}			

}
// Not req, but check format - use onblur
function EmailValidateCheck(txtCtrl) {
	var xlogus = txtCtrl.value.length;
	Remove_Spaces(txtCtrl);
	txtCtrl.value=txtCtrl.value.replace(/ \*/g,"");

	if (xlogus == 0) {
 		return false;
	}
	if (txtCtrl.value.indexOf("@") < 2 ||txtCtrl.value.indexOf(".") < 0) {
		alert("Please enter a valid email id.");
		txtCtrl.focus();	   	
		txtCtrl.focus();
		return false;
	}		
	if(txtCtrl.value.indexOf("'") > -1){		
		alert("Please Don't enter ' ." );		
		txtCtrl.focus();   	
		return false;		
	}			
}

// Req
function SelValidate(selCtrl) {
	if (selCtrl.value == "" || selCtrl.value == "0" || selCtrl.value== "Please select") {
		alert("Please select an option in the list.");
		selCtrl.focus();	   	
		return false;
	}		
}

function Remove_Spaces(txtCtrl){
  txtCtrl.value = txtCtrl.value.replace(/\r/g, " ");

  txtCtrl.value = txtCtrl.value.replace(/[^ A-Za-z0-9`~!@#\$%\^&\*\(\)-_=\+\\\|\]\[\}\{'";:\?\/\.>,<]/g, "");

  txtCtrl.value = txtCtrl.value.replace(/'/g, "");

  txtCtrl.value = txtCtrl.value.replace(/ +/g, " ");

  txtCtrl.value = txtCtrl.value.replace(/^\s/g, "");

  txtCtrl.value = txtCtrl.value.replace(/\s$/g, "");
  
  if (txtCtrl.value == ' '){	
	 txtCtrl.value = '';
   }
 
 }
//-->

// Function for Compare Two passwords
function Comparetextboxes(txtCtrl1, txtCtrl2) {
if(txtCtrl1.value.indexOf("'") > -1){		
		alert("Please Don't enter '.");		
		txtCtrl1.focus();   	
		return false;		
	}			

if(txtCtrl2.value.indexOf("'") > -1){		
		alert("Please Don't enter '.");		
		txtCtrl2.focus();   	
		return false;		
	}			
	if (txtCtrl1.value != txtCtrl2.value) {
		alert("Confirm Password does not match with New Password!");
		txtCtrl1.focus();	   	
		return false;
	}
}

function chkFile(frmName)	{
	if(frmName.file.value != "")	{		
						var strarr = frmName.file.value.split(".");
						var len = strarr.length;
						if(len != 2){
							alert("Please check your file name !");
							frmName.file.focus();
							frmName.file.select();
							return false;
						}
						var type = strarr[1];						
						if (type < 3) {							
							alert("Please check your file format !");
							frmName.file.select();
							return 1;
						}						
					}		
		}
// ----------------------Logu inserted on Feb 06, 2003, 11:21 GMT HRS 				
<!-- Begin
function checkLength(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
countfield.value = maxlimit - field.value.length;
}
// End -->