<!--
//E-mail check
function emailCheck(Email,Place){
    // get the value from the form.
    var VEmail ="1234567890abcdefghijklmnopqrstuvwxyz@.-_"
	//check for available characters
	for(var i=0; i<Email.length ; i++){
	  var chk = Email.charAt(i)
	  if(VEmail.indexOf(chk)== -1){   
	    alert("Please enter letters, numbers. Other characters(!#$%^&*()?:;+etc,) are not allowed");
		return afterCheck(Place);
	  }
    }
	 //check for an @ sign
	if(Email.indexOf("@") == -1){
	    alert("Please enter the '@' sign")
		return afterCheck(Place);
    }
	//check if @ is in the first position
    if(Email.charAt(0) =="@"){
	    alert("@ shound not be put in the first character in the email address")
		return afterCheck(Place);
	}		
	//check for existence of dot
	if(Email.indexOf(".") == -1){
	    alert("You must have a dot in your email address")
		return afterCheck(Place);
	}	
   //check for a dot after the @ sign
    var e = Email.split("@")
	if (e[1].indexOf(".") == -1){
	     alert("You need a dot after the @ sign in your email address")
		return afterCheck(Place);
    }
	
	// check for an @ sign and dot together ex.@.
	if (e[1].charAt(0) == ".") {
		alert("The @ and dot '.' can not be together in your email address.") 
		return afterCheck(Place);
	  }
	
	if(Email.indexOf(" ")!= -1){
	    alert("Spaces are not allowed in an email address!")
		return afterCheck(Place);
	  }	
	
	//alerting period at last position
    if(Email.charAt(Email.length-1) =="."){
	    alert("Period should not be at the very end!");
		return afterCheck(Place);
    }
	
	return true;
}

//to focus in error text box
function afterCheck(i){
	document.form.elements[i].focus();
	document.form.elements[i].select();
	return false;
}
//-->
