
// Display search panel on page //

function displayPropertySearch(str) {
	
	if (str=="") {
		document.getElementById("propertySearch").innerHTML="";
		return;
	}

	if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	} else {// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && xmlhttp.status==200) {
			document.getElementById("propertySearch").innerHTML=xmlhttp.responseText;
		}
	}

	xmlhttp.open("GET","http://www.jackson-stops.co.uk/cgi-bin/properties/property-search-panel.pl?panel="+str,true);
	xmlhttp.send();
	
}

window.onload = displayPropertySearch;




// UK Sales County Selection //

function UKsalesSearch(str) {
	if (str=="") {
		document.getElementById("UKsalesCountyResult").innerHTML="";
		return;
	} 

	if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp2=new XMLHttpRequest();
	} else {// code for IE6, IE5
		xmlhttp2=new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	xmlhttp2.onreadystatechange=function() {
	
		if (xmlhttp2.readyState==4 && xmlhttp2.status==200) {
			document.getElementById("UKsalesCountyResult").innerHTML=xmlhttp2.responseText;
		}
	}

	xmlhttp2.open("GET","http://www.jackson-stops.co.uk/cgi-bin/properties/uk-sales-county-result.pl?area="+str,true);
	xmlhttp2.send();
}


// UK Sales Area Validation //

function validateUKsalesSearch() {
	var form=document.ukSalesSearch, msg="", status=true;
	if (form.area.value == "") {
		msg += "\nPlease select an Area";
		form.area.focus();
		status=false;
	}
	if (status) {
		return true;
	} else {
		if (msg != "") alert (msg);
		return false;
	}
}




// UK Rental County Selection //

function UKrentalSearch(str) {
	if (str=="") {
		document.getElementById("UKrentalCountyResult").innerHTML="";
		return;
	} 

	if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp3=new XMLHttpRequest();
	} else {// code for IE6, IE5
		xmlhttp3=new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	xmlhttp3.onreadystatechange=function() {
	
		if (xmlhttp3.readyState==4 && xmlhttp3.status==200) {
			document.getElementById("UKrentalCountyResult").innerHTML=xmlhttp3.responseText;
		}
	}

	xmlhttp3.open("GET","http://www.jackson-stops.co.uk/cgi-bin/properties/uk-rental-county-result.pl?area="+str,true);
	xmlhttp3.send();
}


// UK Rental Area Validation //

function validateUKrentalSearch() {
	var form=document.ukRentalSearch, msg="", status=true;
	if (form.area.value == "") {
		msg += "\nPlease select an Area";
		form.area.focus();
		status=false;
	}
	if (status) {
		return true;
	} else {
		if (msg != "") alert (msg);
		return false;
	}
}




// London Sales Postcode Selection //

function LondonSalesSearch(str) {
	if (str=="") {
		document.getElementById("LonsonSalesPostcodeResult").innerHTML="";
		return;
	} 

	if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp4=new XMLHttpRequest();
	} else {// code for IE6, IE5
		xmlhttp4=new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	xmlhttp4.onreadystatechange=function() {
	
		if (xmlhttp4.readyState==4 && xmlhttp4.status==200) {
			document.getElementById("LonsonSalesPostcodeResult").innerHTML=xmlhttp4.responseText;
		}
	}

	xmlhttp4.open("GET","http://www.jackson-stops.co.uk/cgi-bin/properties/london-sales-postcode-result.pl?office="+str,true);
	xmlhttp4.send();
}


// London Sales Office Validation //

function validateLondonSalesSearch() {
	var form=document.londonSalesSearch, msg="", status=true;
	if (form.office.value == "") {
		msg += "\nPlease select an Office";
		form.office.focus();
		status=false;
	}
	if (status) {
		return true;
	} else {
		if (msg != "") alert (msg);
		return false;
	}
}




// London Rental Postcode Selection //

function LondonRentalSearch(str) {
	if (str=="") {
		document.getElementById("LondonRentalPostcodeResult").innerHTML="";
		return;
	} 

	if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp5=new XMLHttpRequest();
	} else {// code for IE6, IE5
		xmlhttp5=new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	xmlhttp5.onreadystatechange=function() {
	
		if (xmlhttp5.readyState==4 && xmlhttp5.status==200) {
			document.getElementById("LondonRentalPostcodeResult").innerHTML=xmlhttp5.responseText;
		}
	}

	xmlhttp5.open("GET","http://www.jackson-stops.co.uk/cgi-bin/properties/london-rental-postcode-result.pl?office="+str,true);
	xmlhttp5.send();
}


// London Sales Office Validation //

function validateLondonRentalSearch() {
	var form=document.londonRentalSearch, msg="", status=true;
	if (form.office.value == "") {
		msg += "\nPlease select an Office";
		form.office.focus();
		status=false;
	}
	if (status) {
		return true;
	} else {
		if (msg != "") alert (msg);
		return false;
	}
}


// London Rental Type Selection //

function LondonRentalType(str) {
	if (str=="") {
		document.getElementById("LondonRentalTypeResult").innerHTML="";
		return;
	} 

	if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp7=new XMLHttpRequest();
	} else {// code for IE6, IE5
		xmlhttp7=new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	xmlhttp7.onreadystatechange=function() {
	
		if (xmlhttp7.readyState==4 && xmlhttp7.status==200) {
			document.getElementById("LondonRentalTypeResult").innerHTML=xmlhttp7.responseText;
		}
	}

	xmlhttp7.open("GET","http://www.jackson-stops.co.uk/cgi-bin/properties/london-rental-type-result.pl?office="+str,true);
	xmlhttp7.send();
}




// New Homes County Selection //

function NewHomesSearch(str) {
	if (str=="") {
		document.getElementById("NewHomesCountyResult").innerHTML="";
		return;
	} 

	if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp6=new XMLHttpRequest();
	} else {// code for IE6, IE5
		xmlhttp6=new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	xmlhttp6.onreadystatechange=function() {
	
		if (xmlhttp6.readyState==4 && xmlhttp6.status==200) {
			document.getElementById("NewHomesCountyResult").innerHTML=xmlhttp6.responseText;
		}
	}

	xmlhttp6.open("GET","http://www.jackson-stops.co.uk/cgi-bin/properties/new-homes-county-result.pl?area="+str,true);
	xmlhttp6.send();
}


// New Homes Area Validation //

function validatNewHomesSearch() {
	var form=document.newHomesSearch, msg="", status=true;
	if (form.area.value == "") {
		msg += "\nPlease select an Area";
		form.area.focus();
		status=false;
	}
	if (status) {
		return true;
	} else {
		if (msg != "") alert (msg);
		return false;
	}
}




// International Country Validation //

function validateInternationalSearch() {
	var form=document.internationalSearch, msg="", status=true;
	if (form.country.value == "") {
		msg += "\nPlease select an Country";
		form.country.focus();
		status=false;
	}
	if (status) {
		return true;
	} else {
		if (msg != "") alert (msg);
		return false;
	}
}
