



function openPrintDialog() {
	if (typeof(window.print) != 'undefined') { window.print(); }
}

function showContactMap() {
  if (GBrowserIsCompatible()) {
	var map = new GMap2(document.getElementById("map2"));
	map.addControl(new GSmallMapControl());



	startX = '-6.263172626495361';
	startY = '53.33669671767716';

	map.setCenter(new GLatLng(startY, startX),15);


	myPoint = new GPoint(startX, startY);
	myMarker = new GMarker(myPoint);
	map.addOverlay(myMarker);

  

  }
}





function loadGoogleMapFront(startX, startY) {
  if (GBrowserIsCompatible()) {
	var map = new GMap2(document.getElementById("map"));
	map.addControl(new GSmallMapControl());
//	map.addControl(new GMapTypeControl());


	
	

	

	if ((startX != '') && (startY != '')) {
		map.setCenter(new GLatLng(startY, startX),13);

		myPoint = new GPoint(startX, startY);
		myMarker = new GMarker(myPoint);
		map.addOverlay(myMarker);
	} else {
		map.setCenter(new GLatLng(53.34440281405261, -6.266326904296875),12);
	}
  

  }
}








// variables


var sectionArr;




// functions


// This function controls the catalogue page

function fixPropertyResult() {
	var h1_a = document.getElementById("leftDetailsContainer").offsetHeight;
	var h2_a = document.getElementById("detailsContainer").offsetHeight;
	var max = h1_a;
	if(h2_a > max) max = h2_a;
	document.getElementById("leftDetailsContainer").style.height = max + "px";
	document.getElementById("detailsContainer").style.height = max + "px";
}

function fixContact() {
	var h1_b = document.getElementById("leftcontentContainer").offsetHeight;
	var h2_b = document.getElementById("rightcontentContainer").offsetHeight;
	var max = h1_b;
	if(h2_b > max) max = h2_b;
	document.getElementById("leftcontentContainer").style.height = max + "px";
	document.getElementById("rightcontentContainer").style.height = max + "px";
}



function addToOptionList(OptionList, OptionValue, OptionText) {
   // Add option to the bottom of the list
   OptionList[OptionList.length] = new Option(OptionText, OptionValue);
}

function clearOptions(OptionList) {

   for (x = OptionList.length; x > 0; x--) {
      OptionList[x] = null;
   }
}



function repopulatePriceRange(objPropertyCat) {

	clearOptions(document.searchForm.searchForm__property__sbv__MinPrice);
	clearOptions(document.searchForm.searchForm__property__sbv__MaxPrice);
	
	if (objPropertyCat.value == 1) {					// sales
		for (i=0;i<salesPriceCaptionArr.length;i++) {
			addToOptionList(document.searchForm.searchForm__property__sbv__MinPrice, salesPriceValueArr[i],salesPriceCaptionArr[i]);
			addToOptionList(document.searchForm.searchForm__property__sbv__MaxPrice, salesPriceValueArr[i],salesPriceCaptionArr[i]);
		}
	} else {											// lettings
		for (i=0;i<lettingsPriceCaptionArr.length;i++) {
			addToOptionList(document.searchForm.searchForm__property__sbv__MinPrice, lettingsPriceValueArr[i],lettingsPriceCaptionArr[i]);
			addToOptionList(document.searchForm.searchForm__property__sbv__MaxPrice, lettingsPriceValueArr[i],lettingsPriceCaptionArr[i]);
		}
	}
}



function propertyCatModify(objPropertyCat) {

	if (objPropertyCat.value == 1) {
		section = 'sales';
		document.getElementById('minPrice').innerHTML="Minimum Price:";
		document.getElementById('maxPrice').innerHTML="Maximum Price:";
	} else {
		section = 'lettings';
		document.getElementById('minPrice').innerHTML="Minimum Rent:";
		document.getElementById('maxPrice').innerHTML="Maximum Rent:";
	}
	document.searchForm.action = phpSelf+'?section='+section;

	// modify price range select lists
	repopulatePriceRange(objPropertyCat);
}



function clearText(thisItem, itemValue) {
	if (thisItem.value == itemValue) {
		thisItem.value = '';
	}
}

function showText(thisItem, itemValue) {
	if (thisItem.value == '') {
		thisItem.value = itemValue;
	}
}

