		
function checkRadio(formname, radioname, displaytext) {
  var localerror = '';
  var rad_val    = '';
  for (var i=0; i < eval('document.'+formname+'.'+radioname+'.length'); i++) { //check every radio button by that name
    if (eval('document.'+formname+'.'+radioname+'[i].checked'))  { //if it is checked
      rad_val += '-';
      }	else rad_val += '';
      }
    if (rad_val=='') {
      localerror =  '- '+displaytext+' is Required.\n';
    }
  return localerror;
}	
		
	function form_validation(){
		var hh = document.formcustomers;
		
	if(hh.emailid.value==""){
			alert("Please enter your email address.");
			hh.emailid.focus();
			return false;
	}
	if (echeck(hh.emailid.value)==false){
			alert("Invalid email address.");
			hh.emailid.focus();
			return false
		}
		
		if(hh.emailid2.value==""){
			alert("Please Re-enter Email Address.");
			hh.emailid2.focus();
			return false;
		}
		
		
		if(hh.emailid.value!=hh.emailid2.value){
			alert("Email does not matches. Please confirm your Email Address.");
			hh.emailid2.focus();
			return false;
		}
		
		
		if(hh.pwd.value==""){
			alert("Please enter password.");
			hh.pwd.focus();
			return false;
		}
		if(hh.pwd.value.length < 6){
			alert("Password must be atleast 6 characters.");
			hh.pwd.focus();
			return false;
		}
		if(hh.pwd.value!=hh.confirm_pwd.value){
			alert("Password does not matches. Please confirm your password.");
			hh.confirm_pwd.focus();
			return false;
		}
		
		
		if(hh.name.value==""){
			alert("Please enter your name.");
			hh.name.focus();
			return false;
	}
		if(hh.state.value=="" ){
			alert("Please enter your state.");
			hh.state.focus();
			return false;
		}
		
		if(hh.city.value==""){
			alert("Please enter your city.");
			hh.city.focus();
			return false;
		}
		
		

	return true;
	}
		
		
