function getQueryVariable(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
      return pair[1];
    }
  }
  //alert('Query Variable ' + variable + ' not found');
} 
function propertyId(){
	var query = window.location.search.substring(1);
	temp = query.split('=');
	temp2 = temp[2].split('&');
	temp3 = temp2[0];
	return temp3;
} 



$(document).ready(function() {	

$("#dnn_ctr482_H2O_ctl00_lblTelephone").next().addClass("communication");
$("#dnn_ctr482_H2O_ctl00_lblIwouldliketorecievecommunicationsformCrestNicho").next().addClass("brochure");

$("#dnn_ctr482_H2O_ctl00_lblIwouldliketorecievecommunicationsformCrestNicho").html("");
$("#dnn_ctr482_H2O_ctl00_lblIwouldlikeHarboursideBrochuretobesenttothisaddr").css("color","white");


savebutton = $("#dnn_ctr482_H2O_ctl00_pnlMain2").html();
$("#dnn_ctr482_H2O_ctl00_pnlMain2").remove();


$("#dnn_ctr482_H2O_ctl00_h2oCell_0_0").append(savebutton);
$("#dnn_ctr482_H2O_ctl00_btnSave").html("");



brochure = getQueryVariable("brochure") ;
propText = getQueryVariable("propText") ;
propText = propText.replace(/%20/g, " ");

if (propText != null){
	
	message = "I am interested in this property:\n\n"+propText+"\n\n";

	$('#dnn_ctr482_H2O_ctl00_Comments').append(message);
	$('#dnn_ctr482_H2O_ctl00_Interest_0').attr("checked","checked");

}
if (brochure != null){
	$('#dnn_ctr482_H2O_ctl00_IwouldlikeHarboursideBrochuretobesenttothisaddress').attr("checked","checked");
}
}); 