/* Select all area checkboxes on our search form */
function selectSrchChk() {
	for (i=1; i<11; i++) {
		document.getElementById('area' + i).checked = true;
	}
}

/* Unselect checkboxes on our search form */
function unselectSrchChk() {
	for (i=1; i<11; i++) {
		document.getElementById('area' + i).checked = false;
	}
}

/* Determine the url for the quicksearch form submit */
function chkDestination() {
	if (document.getElementById('urlSales').checked == true) {
		url = document.getElementById('urlSales').value;
	} else {
		url = document.getElementById('urlLettings').value;
	}
	document.getElementById('qkSrchForm').action = url;
} 

/* Open our google maps popup window */
function showMap(url) {
	mapwin = window.open(url.href,'gmap','width=620,height=530');
	mapwin.focus();
	return false;
}

/* Open our large floorplan popup window */
function showFloorPlan(url) {
	floorp = window.open(url.href,'floorplan','width=790,height=600,scrollbars=1,resizable=1');
	floorp.focus();
	return false;
}

/* Open our slideshow popup window */
function showSlideshow(url) {
	sshow = window.open(url.href,'sshow','width=490,height=470');
	sshow.focus();
	return false;
}

/* Open our email a friend popup window */
function emailFriend(url) {
	email = window.open(url.href,'email','width=350,height=450');
	email.focus();
	return false;
}

function showAd(url,dim) {
        ad = window.open(url.href,'ad',dim);
        ad.focus();
        return false;
}

/* Check to see if the user wants to register */
function noReg(url) {
	if(confirm("You need to register with Godrey & Barr to view this page.\nClick OK to register, or Cancel to return to the current page")) {
		location.href = url;
	}
	return false;	
}

/* Show/hide our home page quick search buy/let price dropdowns */
function showBuySelect() {
        document.getElementById('pmin').style.display = 'inline';
	        document.getElementById('rmin').style.display = 'none';
		        document.getElementById('pmax').style.display = 'inline';
			        document.getElementById('rmax').style.display = 'none';
				}

				function showLetSelect() {
				        document.getElementById('pmin').style.display = 'none';
					        document.getElementById('rmin').style.display = 'inline';
						        document.getElementById('pmax').style.display = 'none';
							        document.getElementById('rmax').style.display = 'inline';
								}

/* Registration form stuff */
function regForm(select) {
	var w = select.selectedIndex;
	if (w == 1) {
		document.getElementById('SELECT_price').style.display = 'inline';
		document.getElementById('SELECT_rprice').style.display = 'none';
	} else if (w ==2) {
		document.getElementById('SELECT_price').style.display = 'none';
		document.getElementById('SELECT_rprice').style.display = 'inline';
	}
}
