// JavaScript Document
	function moreDetails(propertyid) {
		document.forms["frmSearch"].hidPropertyId.value=propertyid;
		document.forms["frmSearch"].hidOriginatorPage.value="index.php";
		document.forms["frmSearch"].action="property_details.php";
		document.forms["frmSearch"].method="post";
		document.forms["frmSearch"].submit();
	}
	
	function selectPreviousValue(lstDropdown,strValue) {
		var listbox = document.forms[0].elements[lstDropdown]
		for(i = 0;i<listbox.length;i++){
			if (listbox.options[i].value == strValue) {
				listbox.options[i].selected = true;
			}
		}
	}

	function openPhotos(propertyid)
	{
		window.open('property_photos.php?hidPropertyId='+propertyid,'photoswin','width=700,height=600,top=30,left=30,menubar=0,toolbar=0,location=0,directories=0,scrollbars=0,status=1,resizable=1');
	}
	
	function popUp(URL) 
	{
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width=600,height=500,left = 212,top = 134');");
	}
	
	function requestBrochure(address) {
		document.forms["contact"].hidAddress.value = address;
		document.forms["contact"].action = "property_brochure.php";
		document.forms["contact"].method = "post";
		document.forms["contact"].submit();
	}
	
	function loancalc ()
	{
	  //var gross2 = document.loanform.gross.value
	  //var rate2 = document.loanform.rate.options[document.loanform.rate.selectedIndex].value
	  //document.loanform.result1.value = (Math.round (((gross2 * (rate2 / 100)) / 12) * 100)) / 100; 
	  
	  var gross2 = document.forms[0].gross.value
	  var rate2 = document.forms[0].rate.options[document.forms[0].rate.selectedIndex].value
	  document.forms[0].result1.value = (Math.round (((gross2 * (rate2 / 100)) / 12) * 100)) / 100; 
	}

	function jointcalc ()
	{
	  //var gross1 = document.loanform.house_price.value - document.loanform.deposit.value;
	  //document.loanform.gross1.value = gross1;
	  //var monthly1 = document.loanform.monthly1.value
	  //var rate1 = document.loanform.rate1.options[document.loanform.rate1.selectedIndex].value 
	  //document.loanform.result.value = (Math.round (((gross1 * ( (Math.pow((1 + (rate1 / 100)), monthly1)) / ((Math.pow((1 + (rate1 / 100)), monthly1) - 1))  ) * (rate1 / 100)) / 12) * 100)) / 100; 
	  var gross1 = document.forms[0].house_price.value - document.forms[0].deposit.value;
	  document.forms[0].gross1.value = gross1;
	  var monthly1 = document.forms[0].monthly1.value
	  var rate1 = document.forms[0].rate1.options[document.forms[0].rate1.selectedIndex].value 
	  document.forms[0].result.value = (Math.round (((gross1 * ( (Math.pow((1 + (rate1 / 100)), monthly1)) / ((Math.pow((1 + (rate1 / 100)), monthly1) - 1))  ) * (rate1 / 100)) / 12) * 100)) / 100; 
	
	  
	}
	
	function bt_RequestBrochure() {
		var frm = new Object;
		frm=document.forms["frmMain"];
		if (frm.txtName.value=="") {
			alert("Please enter your name.");
			return false;
		}
		if (frm.txtSubject.value=="") {
			alert("Please enter a subject.");
			return false;
		}
		if (frm.txtEmail.value=="") {
			alert("Please enter your email address.");
			return false;
		}
		frm.hidFunction.value = "send";
		frm.action = "property_brochure.php";
		frm.method = "post";
		frm.submit();
	}

	function checkNumber()
	{
	  var monthly1 = document.loanform.monthly1.value
	  if (monthly1 > "25") {
		alert("\nPlease Enter a Figure of 25 Years or Less.")
	  }
	}
