function toggleDisplay(display) { if( document.getElementById(display).style.display == "none" ) {     document.getElementById(display).style.display = "";   } else {     document.getElementById(display).style.display = "none"; } }initDHTMLAPI();function echeck(email) {		var str = email.value;		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 enter a valid email address.");			email.focus();		   return false;		}		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){	   		alert("Please enter a valid email address.");			email.focus();			return false;		}		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){    		alert("Please enter a valid email address.");			email.focus();		    return false;		}		 if (str.indexOf(at,(lat+1))!=-1){		    alert("Please enter a valid email address.");			email.focus();			return false;		 }		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){			alert("Please enter a valid email address.");			email.focus();			return false;		 }		 if (str.indexOf(dot,(lat+2))==-1){    		alert("Please enter a valid email address.");			email.focus();		    return false;		 }				 if (str.indexOf(" ")!=-1){	 		alert("Please enter a valid email address.");		    return false;		 } 		 return true;					}function validateForm(){		var email=document.street_value_login.email;		if ((email.value==null)||(email.value=="")){		alert("Please enter an email address to login.");		email.focus();		return false	}	if (!echeck(email)){		email.focus();		return false	}	str = document.street_value_login.email.value +	document.street_value_login.password.value + document.street_value_login.random5.value;	document.street_value_login.password_hash.value = hex_md5(str);	document.street_value_login.password.value = "";	document.street_value_login.random5.value = "";	document.street_value_login.submit();}function toggleField(){		var section_checkbox=document.filter_sales.section_on;	var floor_checkbox=document.filter_sales.floor_on;	if (floor_checkbox.checked === true){		document.filter_sales.custom_floor_area.style.color= 'black';	}else{		document.filter_sales.custom_floor_area.style.color = '#cccccc';	}	if (section_checkbox.checked === true){		document.filter_sales.custom_area.style.color= 'black';	}else{		document.filter_sales.custom_area.style.color = '#cccccc';	}}function toggleField_CurrentMarket(){		var section_checkbox=document.filter_sales.section_on;	var room_checkbox=document.filter_sales.room_on;	if (room_checkbox.checked === true){		document.filter_sales.custom_room.style.color= 'black';	}else{		document.filter_sales.custom_room.style.color = '#cccccc';	}	if (section_checkbox.checked === true){		document.filter_sales.custom_area.style.color= 'black';	}else{		document.filter_sales.custom_area.style.color = '#cccccc';	}}function requestValidateForm(){	if (document.reportRequest.ad_id.value.length == 0){		alert("Try entering the first few letters  like '23 Alfri' and wait for a suggestion.\n\nPlease type the address in the format below:\n2/56 Glenfield Avenue, Herne Bay.\n\nAs you type we will suggest the property, you must choose one of our suggestions.");		document.reportRequest.dyn_address.focus();		return false	}	if (document.reportRequest.buysell.value == ""){		alert("Please specify your interest in the property.");		document.reportRequest.buysell.focus();		return false	}	if (document.reportRequest.bedrooms.value == ""){		alert("Please specify the Floor Area.");		document.reportRequest.bedrooms.focus();		return false	}		/*document.reportRequest.password_hash.value = hex_md5(str);	document.reportRequest.password.value = "";	document.reportRequest.random5.value = "";*/	document.reportRequest.submit();}function regisValidateForm(){	var email=document.street_value_register.email;	if(!echeck(email)){		return false;	}	if(document.street_value_register.email2.value != document.street_value_register.email.value ){		alert("Please ensure your emails are both correct");		return false;	}if(document.street_value_register.first_name.value.length  < 2){		alert("Please enter your first name");		return false;	}if(document.street_value_register.last_name.value.length  < 2){		alert("Please enter your last name");		return false;	}if(document.street_value_register.phone.value.length < 6){		alert("Please enter your phone number");		return false;	}if(document.street_value_register.tc_agree.checked == false){		alert("Please read and agree to the Terms and Conditions before registering");		return false;	}if(document.street_value_register.password1.value.length == 0){		alert("Please enter a password");		return false;	}if(document.street_value_register.password1.value != document.street_value_register.password2.value){		alert("Please ensure your passwords are the same");		return false;	}if(document.street_value_register.email2.value.length == 0){		alert("Please confirm your email address");		return false;	}		if (document.street_value_register.phone_area.value == ""){		alert("Please choose an area code.");		document.street_value_register.phone_area.focus();		return false;	}else{		document.street_value_register.phone.value =  document.street_value_register.phone_area.value + '-' + document.street_value_register.phone.value;	}	document.street_value_register.submit();}function correctValidateForm(){	if(document.street_value_register.first_name.value.length < 2){		alert("Please enter your first name");		return false;	}if(document.street_value_register.last_name.value.length < 2){		alert("Please enter your last name");		return false;	}if(document.street_value_register.phone.value.length <= 6){		alert("Please enter your phone number");		return false;	}	document.street_value_correct.submit();}function removeValidateForm(){	if(document.disable_user.disable.checked == false){		alert("If you wish to disable your account, please tick the box.");		return false;	}	document.disable_user.submit();}function updateValidateForm(){	/*var email=document.update_user.email;	if(!echeck(email)){		return false;	}*/	if(document.update_user.first_name.value.length == 0){		alert("Please enter your first name");		return false;	}if(document.update_user.last_name.value.length == 0){		alert("Please enter your last name");		return false;	}if(document.update_user.phone.value.length < 6){		alert("Please enter your phone number");		return false;	}	document.update_user.submit();}function friendValidateForm(){	var email=document.notify_email.email;	if(!echeck(email)){		return false;	}	if(document.notify_email.first_name.value.length == 0){		alert("Please enter your friend's first name");		return false;	}if(document.notify_email.last_name.value.length == 0){		alert("Please enter your friend's last name");		return false;	}	document.notify_email.submit();}function focusField(target){	// The form elements that will be tested. Anything with a dot indicates the "type" attribute of the element	var formElements = ["input.text", "input.checkbox", "input.radio", "select", "textarea"];	var selectedNode = null;	// IE's selection method	if (typeof document.selection != "undefined" && document.selection != null && typeof window.opera == "undefined"){		var theSelection = document.selection;		var textRange = document.selection.createRange();		selectedNode = textRange.parentElement();	}	// W3 selection method. Currently only Mozilla & Safari support it. However, neither of them support ranges inside form objects, so this part is redundant. Merely included in case they decide to include support in the future	else if (typeof window.getSelection != "undefined"){		var theSelection = window.getSelection();		// The Safari way to get the node that a selection starts in		if (typeof theSelection.baseNode != "undefined"){			selectedNode = theSelection.baseNode;		}		// The Mozilla way to get the node that a selection starts in		else if (typeof theSelection.getRangeAt != "undefined" && theSelection.rangeCount > 0){			selectedNode = theSelection.getRangeAt(0).startContainer;		}	}	// If a selected node was found above, check whether it's a selection inside one of the specified form element types	if (selectedNode != null){		for (var i = 0; i < formElements.length; i++){			if (selectedNode.nodeName.toLowerCase() == formElements[i].replace(/([^.]*)\..*/, "$1")){				return false;			}		}	}	var forms = document.forms;	// Do a check of each form element on the page. If one of them has a value, do not focus	for (var i = 0; i < forms.length; i++){		var formElements = forms[i];		for (var j = 0; j < formElements.length; j++){			if (formElements[j].getAttribute("type") == "checkbox" || formElements[j].getAttribute("type") == "radio"){				if (formElements[j].checked != formElements[j].defaultChecked){					return false;				}			}else{				if (typeof formElements[j].defaultValue != "undefined" && formElements[j].value != formElements[j].defaultValue){					return false;				}			}		}	}	// If no form elements were found to be focused -- or with values -- go ahead and focus	target.focus();	return false;}numdivs=17IE5=NN4=NN6=falseif(document.all)IE5=trueelse if(document.layers)NN4=trueelse if(document.getElementById)NN6=truefunction unhideDiv ( which ){	//alert ( which );	//alert (NN6);	if(NN4){		eval("document.div"+which+".visibility='visible'");		eval("document.div"+which+".style.zIndex=100");	}	if(IE5){ 		eval("document.all.div"+which+".style.visibility='visible'");		eval("document.all.div"+which+".style.zIndex=100");		eval("document.all.com"+which+".className='communityUp'");	}	if(NN6){		eval("document.getElementById('div"+which+"').style.visibility='visible'");		eval("document.getElementById('div"+which+"').style.zIndex=100");		eval("document.getElementById('com"+which+"').className='communityUp'");		alert 	}}function showDiv( which ) {	for(i=6;i<numdivs;i++) {		if(NN4){ 			eval("document.div"+i+".visibility='hidden'");			eval("document.div"+i+".style.zIndex=1");		}		if(IE5){ 			eval("document.all.div"+i+".style.visibility='hidden'");			eval("document.all.div"+i+".style.zIndex=1");			eval("document.all.com"+i+".className='community'");		}		if(NN6){ 			eval("document.getElementById('div"+i+"').style.visibility='hidden'");			eval("document.getElementById('div"+i+"').style.zIndex=1");			eval("document.getElementById('com"+i+"').className='community'");		}	}	unhideDiv( which );	//close community div if not community graph	if (which < 5)	{		if(NN4){		eval("document.div30.visibility='hidden'");		eval("document.div30.style.zIndex=1");	}	if(IE5){ 		eval("document.all.div30.style.visibility='hidden'");		eval("document.all.div30.style.zIndex=1");	}	if(NN6){		eval("document.getElementById('div30').style.visibility='hidden'");		eval("document.getElementById('div30').style.zIndex=1");	}	}}