document.write("<script src='PhotoShuffle.js' type='text/javascript'></script>");

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("Invalid E-mail Address");
		   return false;
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail Address");
		   return false;
		}
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail Address");
		    return false;
		}
		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail Address");
		    return false;
		 }
		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail Address");
		    return false;
		 }
		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail Address");
		    return false;
		 }
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail Address");
		    return false;
		 }
 		 return true;					
	}
		
function formValidation(){

	var emailID = document.getElementById("email");

	if(document.relocationForm.movingToNewCity2.checked){
		document.getElementById("movingToNewCity").value = "Moving to a new city";
	}
	else{
		document.getElementById("movingToNewCity").value = "";
	}
	if(document.relocationForm.interestedInvestment2.checked){
		document.getElementById("interestedInvestment").value = "Interested in an investment property";
	}
	else{
		document.getElementById("interestedInvestment").value = "";
	}
	if(document.relocationForm.interestedVacation2.checked){
		document.getElementById("interestedVacation").value = "Interested in a vacation property ";
	}
	else{
		document.getElementById("interestedVacation").value = "";
	}
	if(document.relocationForm.assistSellHome2.checked){
		document.getElementById("assistSellHome").value = "Assistance selling a home";
	}
	else{
		document.getElementById("assistSellHome").value = "";
	}
	if(document.relocationForm.cityCities2.checked){
		document.getElementById("cityCities").value = "City or Cities";
	}
	else{
		document.getElementById("cityCities").value = "";
	}
	if(document.relocationForm.countryCounties2.checked){
		document.getElementById("countryCounties").value = "Country or Counties";
	}
	else{
		document.getElementById("countryCounties").value = "";
	}
	if (echeck(emailID.value)==false){
		document.relocationForm.email.focus();
		return false;
	}
		
	return true;
	
}