// JavaScript Document - error checking for standard PP search screen
<!--
function ppcheck() {
	var errorMessage = "";
	var minPrice = "";
	var maxPrice = "";
	
	minPrice = document.getElementById('sch_minprice').value
	maxPrice = document.getElementById('sch_maxprice').value
	if ((minPrice != "NS")&&(maxPrice != "NS")) {
		minPrice = parseInt(minPrice);
		maxPrice = parseInt(maxPrice);
		if (minPrice > maxPrice)  {
			errorMessage = "The maximum price has to be greater than the minimum price.\r"
		}
	}
	if (errorMessage) {
		errorMessage = errorMessage;
		alert(errorMessage)
		return false;
	}
	else {
		return true;
	}
}
function ppLcheck() {
	var errorMessage = "";
	var minPrice = "";
	var maxPrice = "";
	
	minRent = document.getElementById('let_minrent').value
	maxRent = document.getElementById('let_maxrent').value
	if ((minRent != "NS")&&(maxRent != "NS")) {
		minRent = parseInt(minRent);
		maxRent = parseInt(maxRent);
		if (minRent > maxRent)  {
			errorMessage = "The maximum rent has to be greater than the minimum rent.\r"
		}
	}
	if (errorMessage) {
		errorMessage = errorMessage;
		alert(errorMessage)
		return false;
	}
	else {
		return true;
	}
}
function 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=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 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 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=FindObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function SwapImage() { //v3.0
  var i,j=0,x,a=SwapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=FindObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->