function custWindow(doc,w,h,align,valign,scroll) {
	if (custWindow.arguments.length < 6) {
			var scroll = 'no'
	}
	if (custWindow.arguments.length < 4) {
			var align = 'c'
			var valign = 'm'
	}
	topPos=0
	leftPos=0
	if (screen) {
		if (align == 'c') {
			leftPos = screen.width/2 - w/2
		} else {
			if (align == 'r') {
				leftPos = screen.width - w - 12
			}
		}
		if (valign == 'm') {
			topPos = screen.height/2 - h/2
			} else {
			if (valign == 'b') {
				topPos = screen.height - h - 5
			}
		}
	}
	custWin = window.open (doc,'custWin','toolbar=no,location=no,scrollbars='+scroll+',resizable=yes,width='+w+',height='+h+',left='+leftPos+',top='+topPos+'')
	custWin.document.close()
	custWin.focus()
}

function setMsg(msg) {
	window.status = msg
	return true
}

function validateContact(form) {
  if (form.email.value == "") {
    alert( "Please provide your email address." );
    form.email.focus();
    return false ;
  }
  if (form.subject.value == "") {
    alert( "Please specify the subject of this message." );
    form.email.focus();
    return false ;
  }
  if (form.message.value == "") {
    alert( "Please complete your message." );
    form.email.focus();
    return false ;
  }
  return true ;
}

function validateSendFax(form) {
  if (form.email.value == "") {
    alert( "Please provide your email address." );
    form.email.focus();
    return false ;
  }
  if (form.name.value == "") {
    alert( "Please provide your name." );
    form.email.focus();
    return false ;
  }
  if (form.phone.value == "") {
    alert( "Please provide your phone number." );
    form.email.focus();
    return false ;
  }
  if (form.subject.value == "") {
    alert( "Please specify the subject of this message." );
    form.email.focus();
    return false ;
  }
  if (form.message.value == "") {
    alert( "Please complete your message." );
    form.email.focus();
    return false ;
  }
  return true ;
}

function isNumeric(strString) {
   var strValidChars = "0123456789.";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return true;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++) {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1) {
         blnResult = false;
       }
    }
   return blnResult;
}

function validateListing(form) {
  if (!isNumeric(form.Deposit.value)) {
    alert( "Deposit price must be a number!\r(The digits 1-9 and a decimal point are allowed.)");
    form.Deposit.focus();
    return false;
  }
  if (!isNumeric(form.PriceStudio.value)) {
    alert( "Studio price must be a number!\r(The digits 1-9 and a decimal point are allowed.)");
    form.PriceStudio.focus();
    return false;
  }
  if (!isNumeric(form.Price1BR.value)) {
    alert( "1BR price must be a number!\r(The digits 1-9 and a decimal point are allowed.)");
    form.Price1BR.focus();
    return false;
  }
  if (!isNumeric(form.Price2BR.value)) {
    alert( "2BR price must be a number!\r(The digits 1-9 and a decimal point are allowed.)");
    form.Price2BR.focus();
    return false;
  }
  if (!isNumeric(form.Price3BR.value)) {
    alert( "3BR price must be a number!\r(The digits 1-9 and a decimal point are allowed.)");
    form.Price3BR.focus();
    return false;
  }
  if (!isNumeric(form.Price4BR.value)) {
    alert( "4BR price must be a number!\r(The digits 1-9 and a decimal point are allowed.)");
    form.Price4BR.focus();
    return false;
  }
  if (!isNumeric(form.Other_Price.value)) {
    alert( "Other price must be a number!\r(The digits 1-9 and a decimal point are allowed.)");
    form.Other_Price.focus();
    return false;
  }
  return true ;
}
