// JavaScript Document

	function validate()
	{
		var doc=document.frm
		if(doc.accept.checked ){
			if(!(charcheck(doc.txtf_name.value,"Name") && charcheck(doc.txtf_userid.value,"Userid") && charcheck(doc.txtf_email.value,"Email")&& compare(doc.txtf_pass1.value,doc.txtf_pass2.value)))	{
				event.returnValue=false
			}
		}else{
			alert("You should Accept the Terms and Conditions of SpellFinder Dictionary");
			event.returnValue=false
		}			
	}
	
	function validate1()
	{
		var doc=document.frm
		if(!(charcheck(doc.txtf_name.value,"Name") && charcheck(doc.txtf_userid.value,"Userid") && charcheck(doc.txtf_email.value,"Email"))){
			event.returnValue=false
		}		
	}
	
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////
///Functio Name   :  charcheck()
////This function allows only characters to be entered in a field
////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////	
	
	

	
	function charcheck(value,name) {
		txt = value;
		switch(name){
				case "Userid":
					var invalids = "`!@#$%^&*[]{}\"()+-~,'<.>/?;:\|";
					break;
				case "Email":
					var invalids = "`!#$%^&*[]{}\"()+-~,'<>/?;:\|";
					break;
				default :
					var invalids = "`!@#$%^&*[]{}\"()+-~,'<.>/?;:\|1234567890";
		}		
		for(i=0; i<invalids.length; i++) {
			if(txt.indexOf(invalids.charAt(i)) >= 0 || txt==false) {
				alert("Enter Your "+name)				
				 return false;
			}
        }
		return true;
	}		
	
		
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////
////This function checks that the password and repassword are same or not
////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////	
	
	
function compare(value1,value2){	
	if(value1==false || value1!=value2){
		alert("Enter a valid Password");		
		return false;
		}
	else
		return true;
}



