var isDOM=document.getElementById?1:0;
var isIE=document.all?1:0;
var isNS4=navigator.appName=='Netscape'&&!isDOM?1:0;
var isIE4=isIE&&!isDOM?1:0;
var patrn = new RegExp("MSIE 5.");
var isIE50 = patrn.test(navigator.userAgent) ? true : false;
function BrwsrChk () {
 if ((isNS4) || (isIE4) || (isIE50)) {
  alert('The sign up pages require Internet Explorer 6.0 or higher OR Netscape 6.0 or higher. Please upgrade your browser.');
  return false;
 }
 return true;
}

<!--Begin
var submitcountsu = 0;
function SubmitChkSignUp (formobj) {
 if (submitcountsu == 0) {
  submitcountsu++;
  return true;
 } else {
  alert('This form has already been submitted. Please wait...');
  return false;
 }
}
//--End-->
<!--Begin 
var popwin = null;
function NewWindow(page,w,h) {
 self.name = "main";
 NewWindowClose();
 options = "toolbar=1,status=0,menubar=0,scrollbars=1,resizable=1,location=0,width=" + w + ",height=" + h + ",screenX=1,screenY=1,top=1,left=1";
 popwin = window.open(page,'',options);
 popwin.document.close();
}
function NewWindowClose() {
 if (popwin != null && !popwin.closed) popwin.close();
}
//--End-->
<!--Begin
var bccvalu = '';
function BccArea(bccwho) {
 bccvalu = bccwho.options[bccwho.selectedIndex].value;
}
//--End-->
<!--Begin
var imgwin = null;
function NewWindowImg(img,w,h) {
 NewWindowImgClose();
 contents = '<HTML>\n<BODY bgcolor="#FFFFFF" text="#000000">\n' +
            '<DIV align="center">\n <IMG src="' + img + '" border="0">\n' +
            '<BR><BR>\n <FONT face="arial" size="2"><A href="javascript:window.close()">\n' +
            'Close window<\/A><\/FONT>\n <\/DIV>\n<\/BODY>\n<\/HTML>';
 options = "toolbar=0,status=0,menubar=0,scrollbars=1,resizable=0,location=0,width=" + w + ",height=" + h + ",screenX=1,screenY=1,top=1,left=1";
 imgwin = window.open("","",options);
 imgwin.document.write(contents);
 imgwin.document.close();
}
function NewWindowImgClose() {
 if (imgwin != null && !imgwin.closed) imgwin.close();
}
//--End-->

<!--Begin
function FillOfficeArray () {
 var liofficearray = new Array();
 var lioobj = document.forms[0].elements['listinoffice']
 var liofficecount = lioobj.length;
 for (var i = 0; i < liofficecount; i++) {
  if (lioobj[i].checked) {
	if (liofficearray.length <= 2) {
		if (lioobj[i].value != '') {
			liofficearray.push(lioobj[i].value);
		}
	}
	else
	{
		alert('Please select up to 3 offices only.');
		lioobj[i].checked = false;
		break;
	}
  }
 }
 document.forms[0].elements['liofficearrayfield'].value = liofficearray;
}
//--End-->
<!--Begin
function AmPm (hourobj) {
 var am_pm = '';
 var am_pmobj = document.getElementById(hourobj.name+'am_pm');
 am_pmobj.innerHTML = '<BR>';
 if (hourobj.value != '') {
  am_pm = hourobj.value >= 12 ? 'PM' : 'AM';
  am_pmobj.innerHTML = am_pm;
 }
}
//--End-->
<!--Begin
function CancelFillArray (formobj) {
 var cohobj = formobj.elements['cancelohtimeid'];
 if (cohobj) {
  var coharray = new Array();
  if (cohobj[0]) { // only more than one checkbox is an array
   var cohcount = cohobj.length;
   for (var i = 0; i < cohcount; i++) {
    if (cohobj[i].checked) {
     if (cohobj[i].value != '') {
      coharray.push(cohobj[i].value);
     }
    }
   }
  } else {
   if (cohobj.checked) {
    if (cohobj.value != '') {
     coharray.push(cohobj.value);
    }
   }
  }
  if (coharray.length < 1) {
   alert('Select at least one open house to cancel!');
   return false;
  } else {
   formobj.elements['timeidarrayfield'].value = coharray;
   return true;
  }
 }
}
//--End-->

<!--Begin
var submitchgpass = 0;
function SubmitChkChgPass (formobj) {
 if (submitchgpass == 0) {
  var rqrd = new Array();

  rqrd[0] = new Array();
  rqrd[0][0] = "Password";
  rqrd[0][1] = "password";

  rqrd[1] = new Array();
  rqrd[1][0] = "Confirm password";
  rqrd[1][1] = "cpassword";

//
// for (var i = 0; i < rqrd.length; i++) {
//  var eleobj = formobj.elements['q'+rqrd[i]];
//  if (eleobj[0].type == 'radio') {
//   for (var j = 0; j < eleobj.length; j++) {
//    if (eleobj[j].checked) {
//     radchkd = 1;
//     break;
//


  for (var i = 0; i < rqrd.length; i++) {
   var eleobj = formobj.elements[rqrd[i][1]];
   var item = eleobj.value;
   if ((item.length < 4) || (item.length > 10)) {
    alert("' " + rqrd[i][0] + " ' must have a minimum of 4 and maximum of 10 characters.\n\nPlease check your value for this field.");
    return false;
    break;
   }
   if (i == 0) {
    var eleobj1 = formobj.elements[rqrd[i+1][1]];
    var item1 = eleobj1.value;
    if (item != item1) {
     alert("' " + rqrd[i][0] + " ' does not match ' " + rqrd[i+1][0] + " '.\n\nPlease check and/or re-type the values for these fields.");
     return false;
     break;
    }
   }
  }
  submitchgpass++;
  return true;
 } else {
  alert('This form has already been submitted. Please wait...');
  return false;
 }
}
//--End-->

<!--Begin
var submitcnt = 0;
function SubmitChk() {
 var formobj = document.forms['massemail'];
 if (submitcnt == "0") {
//  if (formobj.elements['bcc']) {
//   var bccarray = new Array();
//   var bccareacnt = formobj.elements['bcc'].length;
//   for (var i = 0; i < bccareacnt; i++) {
//    if (formobj.elements['bcc'].options[i].selected) {
//     if (formobj.elements['bcc'].options[i].value != '') {
//      bccarray.push(formobj.elements['bcc'].options[i].value);
//     }
//    }
//   }
//   formobj.elements['bccarrayfld'].value = bccarray;
//  }
//
//  if (bccvalu == '') {
//   alert('You MUST select a person from the Bcc list to send your message.');
//   return false;
//  }
  if (formobj.elements['subject'].value == '') {
   alert('You MUST enter a subject for your message.');
   return false;
  }
//  if (formobj.elements['message1'].value == '') {
//   alert('You have NOT entered a message for your e-mail.');
//   return false;
//  }
  submitcnt++;
  return true;
 } else {
  alert('This form has already been submitted. Please wait...');
  return false;
 }
}
//--End-->

