// JavaScript Document
function popup(mylink, windowname, esteW, esteH)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else

 var w = 0, h = 0;

if (document.all) {
   /* the following is only available after onLoad */
   w = document.body.clientWidth;
   h = document.body.clientHeight;
}
else if (document.layers) {
   w = window.innerWidth;
   h = window.innerHeight;
}

var popW = esteW, popH = esteH;

var leftPos = (w-popW)/2, topPos = (h-popH)/2;

href=mylink.href;

window.open(href, windowname, 'width='+popW+', height='+popH+',top=100, left='+leftPos+', toolbar=0, location=0, directories=0, menuBar=0, scrollbars=0, resizable=0');
return false;
}


var win=null;
function newWindow(mypage,myname,w,h,pos,infocus){
if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";win=window.open(mypage,myname,settings);
win.focus();
}

<!--
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_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_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_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];}
}
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}
var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		NJMap = newImage("NJMap/sussex.jpg");
		preloadFlag = true;
	}
}
function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('Please fill the following field(s):\n'+errors);
  document.MM_returnValue = (errors == '');
}

function validemailaddress(url) {

 if (url != null && url != "") {
 a = url.lastIndexOf("@");
 b = url.lastIndexOf(".");
 c = url.indexOf(":");
 d = url.indexOf("/");
 e = url.substring(0,a);
 f = e.indexOf("@");
 g = url.substring(a+1,url.length);
 h = g.indexOf("[");
 i = g.indexOf("]");
 j = g.indexOf("<");
 k = g.indexOf(">");
 l = url.substring(a+1,b);
 m = url.substring(b+1,url.length);
 n = url.substring(0,a);
 o = 0;
 if (a > b) {o++};
 if (c != -1) {o++};
 if (d != -1) {o++};
 if (f != -1) {o++};
 if (h != -1) {o++};
 if (i != -1) {o++};
 if (j != -1) {o++};
 if (k != -1) {o++};
 if (l.length < 1) {o++};
 if (m.length < 2) {o++};
 if (n.length < 1) {o++};
 if (o == 0) { return true};
}
else { return false;}
} 

function CallBackRequestSubmit() 
{

if (document.InteractForm.FirstName.value=="")
	{
	alert("Please ensure that you have entered in your first name.");
	document.InteractForm.FirstName.focus();
	return false;
	}
if (document.InteractForm.LastName.value=="")
	{
	alert("Please ensure that you have entered in your last name.");
	document.InteractForm.LastName.focus();
	return false;
	}
if (document.InteractForm.MLSNo.value=="")
	{
	alert("To help us serve you better, please enter the MLS No of the property.");
	document.InteractForm.MLSNo.focus();
	return false;
	}

if (document.InteractForm.PhoneAreaCode.value=="" )
	{
	alert("Please ensure that you have entered in your phone number.");
	document.InteractForm.PhoneAreaCode.focus();
	return false;
	}

if ( document.InteractForm.PhonePrefix.value=="" )
	{
	alert("Please ensure that you have entered in your phone number.");
	document.InteractForm.PhonePrefix.focus();
	return false;
	}
	
if (document.InteractForm.PhoneSuffix.value=="")
	{
	alert("Please ensure that you have entered in your phone number.");
	document.InteractForm.PhoneSuffix.focus();
	return false;
	}		
	
	
if (document.InteractForm.EMail.value=="")
	{
	alert("Please ensure that you have entered in a valid email address.");
	document.InteractForm.EMail.focus();
	return false;
	}
	
if (document.InteractForm.CheckBoxMon.checked==false && document.InteractForm.CheckBoxTue.checked==false && document.InteractForm.CheckBoxWed.checked==false && document.InteractForm.CheckBoxThu.checked==false && document.InteractForm.CheckBoxFri.checked==false  && document.InteractForm.CheckBoxSat.checked==false  && document.InteractForm.CheckBoxSun.checked==false    )	
	{
	alert("Please choose at least one day when we call.");
	return false;
	}
	
var fullname=document.InteractForm.LastName.value+","+document.InteractForm.FirstName.value;
var ph=document.InteractForm.PhoneAreaCode.value+document.InteractForm.PhonePrefix.value+document.InteractForm.PhoneSuffix.value


return document.InteractForm.submit(); 
} 

function ShowingRequestSubmit() 
{

if (document.frmRequestShowing.FirstName.value=="")
	{
	alert("Please ensure that you have entered in your first name.");
	document.frmRequestShowing.FirstName.focus();
	return false;
	}
if (document.frmRequestShowing.LastName.value=="")
	{
	alert("Please ensure that you have entered in your last name.");
	document.frmRequestShowing.LastName.focus();
	return false;
	}
if (document.frmRequestShowing.MLSNo.value=="")
	{
	alert("To help us serve you better, please enter the MLS No of the property.");
	document.frmRequestShowing.MLSNo.focus();
	return false;
	}

if (document.frmRequestShowing.PhoneAreaCode.value=="" )
	{
	alert("Please ensure that you have entered in your phone number.");
	document.frmRequestShowing.PhoneAreaCode.focus();
	return false;
	}

if ( document.frmRequestShowing.PhonePrefix.value=="" )
	{
	alert("Please ensure that you have entered in your phone number.");
	document.frmRequestShowing.PhonePrefix.focus();
	return false;
	}
	
if (document.frmRequestShowing.PhoneSuffix.value=="")
	{
	alert("Please ensure that you have entered in your phone number.");
	document.frmRequestShowing.PhoneSuffix.focus();
	return false;
	}		
if (document.frmRequestShowing.EMail.value=="" )
	{
	alert("Please enter a valid email address.");
	document.frmRequestShowing.EMail.focus();
	return false;
	}
if (document.frmRequestShowing.Dateshow.value=="")
	{
	alert("Please enter the date you will be free to view the property")
	document.frmRequestShowing.Dateshow.focus();
	return false;
	}
return document.frmRequestShowing.submit(); 
}
function init(){
window.onload="MM_preloadImages('images/Featured_On.jpg','images/SearchMLS_on.jpg')";
}
//-->