// JavaScript Document
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=400');");
}

function contactcheck(){
	
	inputpass1=document.form.password1.value;
	inputpass2=document.form.password2.value;
	inputcode=document.form.security_code.value;
	inputconphoto= document.form.conphoto.value;
	inputwebsite= document.form.website.value;
	
	inputphoto1 = document.form.photo1.value;
	minLength=6;
	maxLength=12;
	 reWhiteSpace = new RegExp(/^\s+$/);
	if (inputpass1!="" && inputpass1.length < minLength) {
		document.form.password1.focus();
		alert('Your password must be at least ' + minLength + ' characters long. Try again.');
		return false;
	}
	else if (inputpass1!="" && inputpass1.length > maxLength) {
		document.form.password1.focus();
		alert('Your password must be no more than ' + maxLength + ' characters long. Try again.');
		return false;
	}
	// check for spaces
	else if (inputpass1!="" && inputpass1.indexOf(' ')>-1) {
          document.form.password1.focus();
		  alert('No spaces please');
          return false;
     }
	else if (inputpass1!="" && inputpass2!="" && inputpass1!=inputpass2){
					document.form.password2.focus();
					alert("Please confirm password");
					return false;
	}
	
	else if (inputconphoto=="" && inputwebsite==""){
					document.form.conphoto.focus();
					alert("Please upload a confirmation photo of you holding a card with 'Girl Directory' on it OR a copy of some photo ID (you may cover personal information material)This is for our use only and will make sure visitors can rely on our site. ");
					return false;
	}
	
	else if (inputconphoto!="" && inputconphoto==inputphoto1){
					document.form.conphoto.focus();
					alert("This must be a different photo of you holding a card with 'Girl Directory' on it. This is for our use only and will make sure visitors can rely on our site. WE will NOT place your advert online without it.");
					return false;
	}
	
	else{
	return true;
	}

}