function IsEmailValid(checkThisEmail)
{	
  var myEMailIsValid = true;
  var myAtSymbolAt = checkThisEmail.indexOf('@');
  var myLastDotAt = checkThisEmail.lastIndexOf('.');
  var mySpaceAt = checkThisEmail.indexOf(' ');
  var myLength = checkThisEmail.length;

  if (myAtSymbolAt < 1 ) {myEMailIsValid = false;}
  if (myLastDotAt < myAtSymbolAt) {myEMailIsValid = false;}
  if (myLength - myLastDotAt <= 2) {myEMailIsValid = false;}
  if (mySpaceAt != -1) {myEMailIsValid = false;}
  
  if (!myEMailIsValid)
    	return false;
  else 
	  	return true;
}

function sameWord(pass1, pass2)
{ 
	if(pass1 == pass2) return true;
   	else   	return false;   
}

function checkPhoneFormat(e)
{
		if(e.value=="")
		{
			return true;
		}else 
		{
			if(e.value.length > 0)
			{
				$val=parseInt(e.value);
				if($val < 1000000000)
				{	alert("Mobile phone format incorrect. Please enter 10 digit # or leave it blank.");
					e.focus();
					e.select();
				}else if(isnan($val))
				{
					alert("Mobile phone format incorrect. Please enter 10 digit # or leave it blank.");
					e.focus();
					e.select();
				}
			}			
		}
}


