var basePath = "http://www.seasidehomes.com.au/";
var thePath  = "";
function doSearch() {
	var theTown     = document.searchForm.locationSel.options[document.searchForm.locationSel.selectedIndex].value;
	var theSleeps   = document.searchForm.sleepSel.options[document.searchForm.sleepSel.selectedIndex].value;
	var theFeatures = document.searchForm.featuresSel.options[document.searchForm.featuresSel.selectedIndex].value;
 	if (theFeatures=="Features") theFeatures="";

	if (theTown=="outside") {
		alert('Please select a location');
	} else {

		if (document.searchForm.locationSel.selectedIndex == 0) theTown="Any";
		if (document.searchForm.sleepSel.selectedIndex == 0) theSleeps="-";

		thePath = basePath + "accommodation/"+theTown+"/"+theSleeps+"/"+theFeatures;
		self.location.href=thePath;		
	}
}

function theyGoToTheHouse() {
	var theHouse  = document.searchForm.propertySel.options[document.searchForm.propertySel.selectedIndex].value;
	thePath = basePath+"accommodation/"+theHouse;
	self.location.href=thePath;	
}

function pop(url)
{
	scrolling = 'yes'; // Scrolling Yes/No/Auto
	pagename = 'view'; // popup height
	popht = 600; // popup height
	popwth = 770; // popup width
	scrleft = (screen.width / 2) - (popwth /2); //centres horizontal
	scrtop = ((screen.height / 2) - (popht /2)) - 40; //centres vertical
	window.open(url,'YBI','top=' + scrtop + ',left=' + scrleft + ',height=' + popht + ',width=' + popwth + ',scrollbars=yes,resizable=no');
}




// ***** MAP CODE *****


var lMap;
var sMap;

function init() {
	lMap = document.getElementById('map1');
	sMap = document.getElementById('map2');
}

function showSmallMap() {
	if (!lMap || !sMap) init();
	lMap.style.display = "none";
	sMap.style.display = "block";
}

function showLargeMap() {
	if (!lMap || !sMap) init();
	sMap.style.display = "none";
	lMap.style.display = "block";
}
