// JScript source code
/**
 * SWFObject v1.4.1: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
 *   legal reasons.
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){
if(!document.createElement||!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion(this.getAttribute("version"),_7);
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){_16.push(key+"="+_18[key]);}
return _16;
},getSWFHTML:function(){
var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}
_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}
return _19;},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();return true;
}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};
deconcept.SWFObjectUtil.getPlayerVersion=function(_23,_24){
var _25=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_25=new deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
for(var i=3;axo!=null;i++){axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);_25=new deconcept.PlayerVersion([i,0,0]);}}
catch(e){}
if(_23&&_25.major>_23.major){return _25;}
if(!_23||((_23.minor!=0||_23.rev!=0)&&_25.major==_23.major)||_25.major!=6||_24){
try{_25=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}
catch(e){}}}return _25;};
deconcept.PlayerVersion=function(_29){
this.major=parseInt(_29[0])!=null?parseInt(_29[0]):0;
this.minor=parseInt(_29[1])||0;
this.rev=parseInt(_29[2])||0;};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){return false;}return true;};
deconcept.util={getRequestParameter:function(_2b){
var q=document.location.search||document.location.hash;
if(q){var _2d=q.indexOf(_2b+"=");
var _2e=(q.indexOf("&",_2d)>-1)?q.indexOf("&",_2d):q.length;
if(q.length>1&&_2d>-1){return q.substring(q.indexOf("=",_2d)+1,_2e);}}
return "";}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){
var _2f=document.getElementsByTagName("OBJECT");
for(var i=0;i<_2f.length;i++){
for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=null;}}}};
if(typeof window.onunload=="function"){
var oldunload=window.onunload;
window.onunload=function(){deconcept.SWFObjectUtil.cleanupSWFs();oldunload();};
}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}
if(Array.prototype.push==null){
Array.prototype.push=function(_32){
this[this.length]=_32;
return this.length;};}

var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; // for backwards compatibility
var SWFObject = deconcept.SWFObject;

function addLoadEvent(func) {	
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;		
	} 
	else {
		window.onload = function() {
		oldonload();
		func();
		}
	}
}

/* Navigation */
addLoadEvent(function(){
	// applying the settings	
	$('#mainnav').Accordion({
		active: 'h3#selected',
		header: 'h3.head',
		alwaysOpen: false,
		animated: true,
		showSpeed: 200,
		hideSpeed: 500
	});
});	

// Macromedia Functions
// JScript source code
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0	
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// Postcode Validation
function checkPostCode (toCheck) {

  // Permitted letters depend upon their position in the postcode.
  var alpha1 = "[abcdefghijklmnoprstuwyz]";                       // Character 1
  var alpha2 = "[abcdefghklmnopqrstuvwxy]";                       // Character 2
  var alpha3 = "[abcdefghjkstuw]";                                // Character 3
  var alpha4 = "[abehmnprvwxy]";                                  // Character 4
  var alpha5 = "[abdefghjlnpqrstuwxyz]";                          // Character 5
  
  // Array holds the regular expressions for the valid postcodes
  var pcexp = new Array ();

  // Expression for postcodes: AN NAA, ANN NAA, AAN NAA, and AANN NAA
  pcexp.push (new RegExp ("^(" + alpha1 + "{1}" + alpha2 + "?[0-9]{1,2})(\\s*)([0-9]{1}" + alpha5 + "{2})$","i"));
  
  // Expression for postcodes: ANA NAA
  pcexp.push (new RegExp ("^(" + alpha1 + "{1}[0-9]{1}" + alpha3 + "{1})(\\s*)([0-9]{1}" + alpha5 + "{2})$","i"));

  // Expression for postcodes: AANA  NAA
  pcexp.push (new RegExp ("^(" + alpha1 + "{1}" + alpha2 + "?[0-9]{1}" + alpha4 +"{1})(\\s*)([0-9]{1}" + alpha5 + "{2})$","i"));
  
  // Exception for the special postcode GIR 0AA
  pcexp.push (/^(GIR)(\s*)(0AA)$/i);
  
  // Standard BFPO numbers
  pcexp.push (/^(bfpo)(\s*)([0-9]{1,4})$/i);
  
  // c/o BFPO numbers
  pcexp.push (/^(bfpo)(\s*)(c\/o\s*[0-9]{1,3})$/i);
  
  // Overseas Territories
  pcexp.push (/^([A-Z]{4})(\s*)(1ZZ)$/i);

  // Load up the string to check
  var postCode = toCheck;

  // Assume we're not going to find a valid postcode
  var valid = false;
  
  // Check the string against the types of post codes
  for ( var i=0; i<pcexp.length; i++) {
    if (pcexp[i].test(postCode)) {
    
      // The post code is valid - split the post code into component parts
      pcexp[i].exec(postCode);
      
      // Copy it back into the original string, converting it to uppercase and
      // inserting a space between the inward and outward codes
      postCode = RegExp.$1.toUpperCase() + " " + RegExp.$3.toUpperCase();
      
      // If it is a BFPO c/o type postcode, tidy up the "c/o" part
      postCode = postCode.replace (/C\/O\s*/,"c/o ");
      
      // Load new postcode back into the form element
      valid = true;
      
      // Remember that we have found that the code is valid and break from loop
      break;
    }
  }
  
  // Return with either the reformatted valid postcode or the original invalid 
  // postcode
  if (valid) {return postCode;} else return false;
}

// Form Validation Functions
function checkpropertylogin(){
	var ftxt = "";
	
	if (document.propertysearchlogin.Username.value==''){
		ftxt += '\n- Please enter your Username.';
	}
	
	if (document.propertysearchlogin.Password.value==''){
		ftxt += '\n- Please enter your Password.';
	}
	
	if (ftxt!==''){
		alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
		return false;
	}
	else{
		return true;
	}
}

function isValidEmail(str) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(str)){
		return true;
	}
	else {
		return false;
	}
}

var pcrex = new RegExp("^([A-PR-UWYZ0-9][A-HK-Y0-9][AEHMNPRTVXY0-9]?[ABEHMNPRVWXY0-9]? {1,2}[0-9][ABD-HJLN-UW-Z]{2}|GIR 0AA)$","i");

function checkfeedbackform(){
	var ftxt = "";
	
	if (document.feedbackform.Name.value==''){
		ftxt += '\n- Please enter your Name.';
	}
	
	if (isValidEmail(document.feedbackform.email.value)==false){
		ftxt += '\n- Please enter your Email Address.';
	}
	
	if (document.feedbackform.Comments.value==''){
		ftxt += '\n- Please enter your Comments.';
	}

	if (ftxt!==''){
		alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
		return false;
	}
	else{
		return true;
	}
}

function PrintThisPage() 
{ 
   var sOption="toolbar=yes,location=no,directories=yes,menubar=yes,scrollbars=yes,width=750,height=600,left=100,top=25";    
   var winprint=window.open('/print.asp','Print',sOption);  
   winprint.focus(); 
}

function EmailThisPage(){	  
	var LeftPosition = (screen.width) ? (screen.width-320)/2 : 0;
	var TopPosition = (screen.height) ? (screen.height-240)/2 : 0;	
	var winprint=window.open('/emailpage.asp','Email','resizable=yes,scrollbars=no,width=420,height=560,left='+ LeftPosition +',top=' + TopPosition);  
	winprint.focus(); 
}

function checkpropertyregister(){
	var ftxt = '';
	
	/*
	if (document.registerform.Username.value==''){
		ftxt += '\n- Please enter a chosen Username.';
	}
	
	if (document.registerform.Password.value==''){
		ftxt += '\n- Please enter a chosen Password.';
	}
	*/
	
	if (document.registerform.FullName.value==''){
		ftxt += '\n- Please enter your Full Name.';
	}
	
	if (document.registerform.TelNo.value==''){
		ftxt += '\n- Please enter a Telephone Number.';
	}	
		
	if (isValidEmail(document.registerform.email.value)==false){
		ftxt += '\n- Please enter your Email Address.';
	}
	
	
	if (document.registerform.DetailsFrom.value==''){
		ftxt += '\n- Please select where you got our Details From.';
	}
	
	if (document.registerform.reason.value==''){
		ftxt += '\n- Please select the reason for registering and performing your search.';
	}
	
	if (document.registerform.REGION1.value==''){
		ftxt += '\n- Please specify your Present Location.';
	}
	else if (document.registerform.AreaChoice.value==''){
		ftxt += '\n- Please specify an Area.'
	}

	if (pcrex.test(document.registerform.postcode.value)==false){
		ftxt += '\n- Please enter your Postcode.';
	}	

	if (ftxt!==''){
		alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
		return false;
	}
	else{
		return true;
	}
}

function checkpropertyeditregistration(){
	var ftxt = '';
		
	if (document.editregistration.password1.value!==''||document.editregistration.password2.value!==''){
		if (document.editregistration.password1.value!==document.editregistration.password2.value){
			ftxt += '\n- Please ensure both passwords match.';
		}
	}
	
	if (document.editregistration.FullName.value==''){
		ftxt += '\n- Please enter your Full Name.';
	}
	
	if (document.editregistration.TelNo.value==''){
		ftxt += '\n- Please enter a Telephone Number.';
	}
		
	if (isValidEmail(document.editregistration.email.value)==false){
		ftxt += '\n- Please enter your Email Address.';
	}
	
	if (document.editregistration.reason.value==''){
		ftxt += '\n- Please select the reason for registering and performing your search.';
	}
	
	if (document.editregistration.REGION1.value==''){
		ftxt += '\n- Please specify your Present Location.';
	}
	else if (document.editregistration.AreaChoice.value==''){
		ftxt += '\n- Please specify an Area.'
	}

	if (pcrex.test(document.editregistration.postcode.value)==false){
		ftxt += '\n- Please enter your Postcode.';
	}

	if (ftxt!==''){
		alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
		return false;
	}
	else{
		return true;
	}
}

function checkpropertyforgotten(){
	var ftxt = '';
	
	if (document.propertyforgotten.Username.value==''){
		ftxt += '\n- Please enter your Username.';
	}
	
	if (isValidEmail(document.propertyforgotten.EmailAddress.value)==false){
		ftxt += '\n- Please enter your Email Address.';
	}

	if (ftxt!==''){
		alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
		return false;
	}
	else{
		return true;
	}
}

var pcodedefault = 'e.g. ST16 2AJ';
function checkpropertyform(){
	var ftxt = '';
	var sitecode = document.propertyselection.SiteCode.value;
	
	if (document.propertyselection.type.value==''){
		ftxt += '\n- Please select a Property Type.';
	}
	
	if (document.propertyselection.SizeBreaks.value==''){
		ftxt += '\n- Please select a Size Area.';
	}
		
	if (document.propertyselection.ViewType[0].checked){
		if (checkPostCode(document.propertyselection.Postcode.value)==false){
		    var blocation = false;
		    for (var i=0;i<document.propertyselection.NumPropOptions.value;i++){			
			    if (document.propertyselection.LocationsArr[i].checked){
				    blocation = true;
			    }
		    }
		    if (blocation==false){
			    ftxt += '\n- Please select at least one Location.';
		    }
		}
	}
	else {
		if (sitecode=='instaffs'){		
		    document.propertyselection.chk10.checked=false;
		}
		
		if (checkPostCode(document.propertyselection.Postcode.value)){
		    // loop through the locations and untick them all!
		    var maplocarr = document.propertyselection.MapLocArr.value;
		    
		    var maparr = maplocarr.split(",");
		    
		    for (var i=0;i<maparr.length;i++){
		        //document.propertyselection.chk10
		        eval('document.propertyselection.'+maparr[i]+'.checked=false');
		    }
		}
		else {
		    ftxt += '\n- Please enter a valid Postcode.';
		}
		
		/*
		var icount = 0;
		for (var i=0;i<document.propertyselection.NumPropOptions.value;i++){			
			if (document.propertyselection.LocationsArr[i].checked){
				icount += 1;
			}
		}		
		if (icount > 1){
			ftxt += '\n- You can only select one Location when selecting to view by map.';
		}
		
		if (checkPostCode(document.propertyselection.Postcode.value)&&document.propertyselection.PostcodeDistance.value>5){
		    ftxt += '\n- You must specify a Maximum of a 5 Mile Search Radius.';
		}
		*/
	}
	
	// Postcode Validation
	if (document.propertyselection.Postcode.value!==pcodedefault&&document.propertyselection.Postcode.value!==''){
	    if (checkPostCode(document.propertyselection.Postcode.value)==false){
	        ftxt += '\n- Please enter a valid Search Postcode.';
	    }
	}
	
	if (ftxt!==''){
		alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
		return false;
	}
	else{
		return true;
	}
}

function clearPostcode(fvalue){
   if (fvalue==pcodedefault){
      document.propertyselection.Postcode.value='';
   } 
}

function changeLocationOptions(locoption){
	var allstaffs = document.getElementById("allstaffs");
	var allstaffschk = document.propertyselection.chk10;
	
	var sitecode = document.propertyselection.SiteCode.value;
	
	if (sitecode=='instaffs'){	
	    if (document.propertyselection.ViewType[0].checked){
		    allstaffs.style.display='';
		    allstaffschk.checked=false;
	    }
	    else {
		    allstaffs.style.display='none';
		    allstaffschk.checked=true;
	    }
	    
	    calculateTotal();
	}
	
	var locpanel = document.getElementById("panelLocations");
	
	if (locoption=='List'){
	    locpanel.style.display='';
	}
	else {
	    locpanel.style.display='none';
	}
}

function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

function calculateTotal(){		
	var qstring = "?type=" + document.propertyselection.type.value + '&OptTwo=' + getCheckedValue(document.propertyselection.opttwo) + '&SizeBreaks=' + document.propertyselection.SizeBreaks.value + '&ViewType=' + getCheckedValue(document.propertyselection.ViewType) + '&SelectDate=' + getCheckedValue(document.propertyselection.SelectDate) + '&SortOptions=' + document.propertyselection.SortOptions.value
	var locstring = '';
	for (var i=0;i<document.propertyselection.NumPropOptions.value;i++){		
		if (document.propertyselection.LocationsArr[i].checked){	
			qstring += '&LocationsArr=' + getCheckedValue(document.propertyselection.LocationsArr[i])
		}
	}
		
	if(document.layers && document.layers['datadiv'].load){				
		document.layers['datadiv'].load('Scripts/GetPropertyCount.asp' + qstring,0);		
	}
	else if(window.frames && window.frames.length){				
		window.frames['dataframe'].window.location.replace('Scripts/GetPropertyCount.asp' + qstring);				
	}	
	//alert('Scripts/GetPropertyCount.asp' + qstring);		
}

function dataCatch(propertiesfoundnum){     
	document.getElementById("propertiesfoundnum").innerHTML = propertiesfoundnum
}

function centrewindow(file,windowname,controls){	
	var LeftPosition = (screen.width) ? (screen.width-320)/2 : 0;
	var TopPosition = (screen.height) ? (screen.height-240)/2 : 0;	
	var winprint=window.open(file,windowname,controls +'left='+ LeftPosition +',top=' + TopPosition);  
	winprint.focus(); 
}

function removereportproperty(submitString){
	if (confirm('Are you sure you want to remove this property?')){
		location.href=submitString;
	}
}

// Property Reports AJAX
function calculateProperties(){	
	if(document.layers && document.layers['reportcountdiv'].load){				
		document.layers['reportcountdiv'].load('Scripts/GetPropertyReportCount.asp',0);		
	}
	else if(window.frames && window.frames.length){				
		window.frames['datareportframe'].window.location.replace('Scripts/GetPropertyReportCount.asp');				
	}	
	//alert('Scripts/GetPropertyReportCount.asp');		
}

function dataCatchProperties(propertiesreport){   
	document.getElementById("reportfoundnum").innerHTML = propertiesreport
}

// AJAX LOAD URL
function loadurl(dest,destid) {	
	try {
		// Moz supports XMLHttpRequest. IE uses ActiveX.
		// browser detction is bad. object detection works for any browser
		xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");
	} catch (e) {
		// browser doesn't support ajax. handle however you want		
	}
	// the xmlhttp object triggers an event everytime the status changes
	// triggered() function handles the events
	//xmlhttp.onreadystatechange = triggered;	
	
	xmlhttp.onreadystatechange=function() {
		if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
			//alert(xmlhttp.responseText)
			document.getElementById("property" + destid).innerHTML = xmlhttp.responseText;
		}
	}
	
	// open takes in the HTTP method and url.
	xmlhttp.open("GET", dest);
	// send the request. if this is a POST request we would have
	// sent post variables: send("name=aleem&gender=male)
	// Moz is fine with just send(); but
	// IE expects a value here, hence we do send(null);
	xmlhttp.send(null);
	
	calculateProperties();
}

function checkreportextended(){
	
}

function confirmPreferencesReset(){
    if (confirm('Are you sure you want to reset your search preferences?')){
        location.href='Scripts/ResetUserPropertySearch.asp';
    }
}