<!--
function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Please use a valid email")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Please use a valid email")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Please use a valid email")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Please use a valid email")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Please use a valid email")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Please use a valid email")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Please use a valid email")
		    return false
		 }

 		 return true					
	}

function validate_form ( )
{ 
    valid = true;

    if ( document.reg.password.value == ""  || document.reg.password.value == ""  || document.reg.fname.value == "0"  ||document.reg.day.value == "0" || document.reg.month.value == "0" || document.reg.year.value == "0") 
		
    {
        alert ( "Please fill in all the given fields." );
        valid = false;
    }
	
	else if ( document.reg.terms.checked == false ) 
		
    {
        alert ( "You have to accept the terms and conditions of use!" );
        valid = false;
    }
	
	else if (echeck(document.reg.userid.value)==false){
		document.reg.userid.value=""
		document.reg.userid.focus()
		valid= false;
    }
    return valid;
}

//-->