<!--
/********************************************************
 * Purpose: Generic Function Repository 
 ********************************************************/
// Browser sniffing variables
var agt=navigator.userAgent.toLowerCase();
var ver=navigator.appVersion.toLowerCase();
var isIE=(agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1);
var isIE500=(isIE) && (ver.indexOf("5.00") != -1);
var isIE501=(isIE) && (ver.indexOf("5.01") != -1);
var isAol=(agt.indexOf('aol') != -1);

function selectPopup(select, win_width, win_height) {
return true;
}

/* New popup controller for listing popups, reconfigure this function to take parameters at some point 
   IMPORTANT - IE does not support spaces in the window title, so using Slide Show or Virtual Tour would cause
   the popup to trigger an undectable error in the window.open function.  Firefox does support spaces, but to
   cater to the IE crowd do not use spaces
*/

//Accepts a form element(input or select) and returns the objects string value with removed alpha-chars
function stripCharacters(theObject) {
var refString = "0123456789";
var checkStr = theObject.value;
theObject = "";
for(i = 0; i < checkStr.length; i++) {
ch = checkStr.charAt(i);
if (refString.indexOf(ch, 0) != -1) {
theObject = theObject + ch;
}
}
return theObject;
}

//Comma function that takes a integer and adds commas and decimals
function commaSplit(srcNumber) {
var txtNumber = '' + srcNumber;
if (isNaN(txtNumber) || txtNumber == "") {
alert("Oops!  That does not appear to be a valid number.  Please try again.");

}
else {
var rxSplit = new RegExp('([0-9])([0-9][0-9][0-9][,.])');
var arrNumber = txtNumber.split('.');
arrNumber[0] += '.';
do {
arrNumber[0] = arrNumber[0].replace(rxSplit, '$1,$2');
} while (rxSplit.test(arrNumber[0]));
if (arrNumber.length > 1) {
return arrNumber.join('');
}
else {
return arrNumber[0].split('.')[0];
      }
   }
}



function isPhoneNumber(theObject) {
var refString = "0123456789+()-.[]ext ";
var checkStr = theObject.value;
var allValid = true;
for (i = 0; i < checkStr.length; i++) {
ch = checkStr.charAt(i);
if (refString.indexOf(ch, 0) == -1) { return (false); }
}
return (true);
}

function isNumericDecimal(theObject) {
var refString = "0123456789.";
var checkStr = theObject.value;
var allValid = true;
for (i = 0; i < checkStr.length; i++) {
ch = checkStr.charAt(i);
if (refString.indexOf(ch, 0) == -1) { return (false); }
}
return (true);
}

function isNumeric(theObject) {
var refString = "0123456789";
var checkStr = theObject.value;
var allValid = true;
for (i = 0; i < checkStr.length; i++) {
ch = checkStr.charAt(i);
if (refString.indexOf(ch, 0) == -1) { return (false); }
}
return (true);
}

function isValidBathroom(num) {
var input = String(num * 2);
return isInteger(input);
}

function isDigit(num) {
if (num.length>1){return false;}
var string="1234567890";
if (string.indexOf(num)!=-1){return true;}
return false;
}

function isInteger(val){
if (isBlank(val)){return false;}
for(var i=0;i<val.length;i++){
if(!isDigit(val.charAt(i))){return false;}
}
return true;
}

function isBlank (theObject) {
if (theObject == null)     { return true; }
if (theObject.value == "") { return true; }
return false;
}

function validate (theForm) {
// set var radio_choice to false
if ((theForm.iAccountNumber != undefined && theForm.iAccountNumber.length != undefined)
    || (theForm.iAccountNumber2 != undefined && theForm.iAccountNumber2.length != undefined)) {
  var iAccountNumberExists = false;
  var iAccountFormOption   = theForm.iAccountNumber;
  // Check if a regular package chosen
  if (theForm.iAccountNumber != undefined && theForm.iAccountNumber.length != undefined) {
    for (counter = 0; counter < theForm.iAccountNumber.length; counter++) {
      if (theForm.iAccountNumber[counter].checked) {
        iAccountNumberExists = true;
      }
    }
  }
  if (!iAccountNumberExists
      && (theForm.iAccountNumber2 != undefined && theForm.iAccountNumber2.length != undefined)) {
    // Check if a publisher package chosen
    for (counter = 0; counter < theForm.iAccountNumber2.length; counter++) {
      if (theForm.iAccountNumber2[counter].checked) {
        iAccountNumberExists = true;
      }
    }
    if (iAccountFormOption == undefined) {
      iAccountFormOption = theForm.iAccountNumber2;
    }
  }
  if (iAccountNumberExists == false) {
    iAccountFormOption[0].focus();
    iAccountFormOption[0].click();
    alert ("Please select a package type.  I have selected the first option for you.");
    return false;
  }
}
if (isBlank(theForm.szFirstName)) {
theForm.szFirstName.focus();
alert ("Please enter the homeowner's first name.");
return false;
}
if (isBlank(theForm.szLastName)) {
theForm.szLastName.focus();
alert ("Please enter the homeowner's last name.");
return false;
}
if (isBlank(theForm.szOwnerName)) {
theForm.szOwnerName.focus();
alert ("Please enter the Display Name.");
return false;
}
if(isBlank(theForm.szPhone1)){
theForm.szPhone1.focus();
alert ("Please enter a contact phone number.");
return false;
}
if (!isBlank(theForm.szEmailAddress) && !isEmail(theForm.szEmailAddress.value)) {
theForm.szEmailAddress.focus();
theForm.szEmailAddress.select();
alert ("I'm sorry, it appears that the email address you entered is not valid.  Please try again.")
return false;
}
if(theForm.confEmailAddress != undefined) {
if (theForm.szEmailAddress.value != theForm.confEmailAddress.value) {
theForm.confEmailAddress.focus();
theForm.confEmailAddress.select();
alert ("Please enter matching Email Addresses.");
return false;
}
}
if (isBlank(theForm.szAddress)) {
theForm.szAddress.focus();
alert ("Please enter the property address.");
return false;
}
if (isBlank(theForm.szCity)) {
theForm.szCity.focus();
alert ("Please enter the city that this property is in.");
return false;
}
if (theForm.szStateCode.value == "" || theForm.szStateCode.value == "ZZ") {
theForm.szStateCode.focus();
alert ("Please select the state/province for this property.");
return false;
}

if (theForm.szCountryCode && theForm.szCountryCode.type != 'hidden') {
if (theForm.szCountryCode.value == "" || theForm.szCountryCode.value == "ZZ") {
theForm.szCountryCode.focus();
alert ("Please select the country for this property.");
return false;
 }
}
if (isBlank(theForm.szPostalCode)) {
theForm.szPostalCode.focus();
if (theForm.szStateCode.value == 0) {
	alert ("Please enter the postal code for this property.\nIf the property address does not include a postal code, enter NONE in this field.");
} else {
	alert ("Please enter the postal code for this property.");
}
return false;
}
if (theForm.iPropTypeCode.selectedIndex == 0) {
theForm.iPropTypeCode.focus();
alert ("Please select the type of property for sale.");
return false;
}
//Attempt to strip all characters associated with the asking price, then check if blank
stripCharacters(theForm.iAskingPrice);
if (isBlank(theForm.iAskingPrice)) {
theForm.iAskingPrice.focus();
alert ("Please enter the asking price for this property.");
return false;
}
//theForm.szPassword is undefined in myListing edit page
if (isBlank(theForm.szPassword) && theForm.szPassword != undefined) {
if (theForm.iAdmin == undefined || theForm.iAdmin.value == "") {
//non-admin attempting to create an account, alert
theForm.szPassword.focus(); 
alert("Please select a password for this ad.");
return false;
}
}
if (theForm.szPassword != undefined) {
if (theForm.szPassword.value != theForm.szConfPassword.value) {
theForm.szConfPassword.focus();
theForm.szConfPassword.select();
alert ("Please enter matching passwords.");
return false;
}
}
if (!isNumeric(theForm.iNumBedrooms)) {
theForm.iNumBedrooms.focus();
theForm.iNumBedrooms.select();
alert ("Number of bedrooms should be a whole number.");
return false;
}
if(!isValidBathroom(theForm.fNumBathrooms.value)) {
theForm.fNumBathrooms.focus();
alert("Please enter the valid bathroom number, such as 1, 1.5, 2.5");
return false;
}
if (!isNumericDecimal(theForm.fNumFloors)) {
theForm.fNumFloors.focus();
theForm.fNumFloors.select();
alert ("Number of floors should be a whole number.");
return false;
}
//disregard lot size / acres
if (!isNumeric(theForm.iBuilt)) {
theForm.iBuilt.focus();
alert ("Please use only the digits 0-9 to enter the year built.");
return false;
}
if (theForm.iBuilt.value != 0 && (theForm.iBuilt.value < 1050 || theForm.iBuilt.value > 2010) ) {
theForm.iBuilt.focus();
alert ("Please enter 0 or a year between 1050 and 2010.");
return false;
}
var filter = /^[\d\,\.]*$/;
if (!filter.test(theForm.iSqFootage.value)) {
theForm.iSqFootage.focus();
theForm.iSqFootage.select();
alert ("Please use only digits and commas to enter the square footage.");
return false;
}
if (theForm.dEndRun) {
if (!formatDate(theForm.dEndRun.value)) {
theForm.dEndRun.focus();
theForm.dEndRun.select();
alert('Date must be in format YYYY-MM-DD');
return false;
}
}
return true;
}

function verifyInfo(theForm) {
if (isBlank(theForm.szName)){
alert ("Please enter your name so that we may contact you.");
return false;
} else if (!isBlank(theForm.szEmail) && !isEmail(theForm.szEmail.value)) {
alert ("Please enter a valid email address where you can be reached, then try again.");
return false;
} else if (isBlank(theForm.szEmail)&&(isBlank(theForm.szPhone))&&(isBlank(theForm.szPhone2))&&(isBlank(theForm.szPhoneEve))){
alert ("Please enter either a phone numnber or email address where you can be reached, then try again.");
return false;
}
return true;
}

function isEmail(email) {
invalidChars = " ~\'^\`\"*+=\\|][(){}$!#%/:,;";
// Remove leading and trailing whitespace
email = email.replace(/^\s+/,"");
email = email.replace(/\s+$/,""); 
// Check for null
if (email == "") {
return false;
}
// Check for invalid characters as defined above
for (i=0; i<invalidChars.length; i++) {
badChar = invalidChars.charAt(i);
if (email.indexOf(badChar,0) > -1) {
return false;
}
}
lengthOfEmail = email.length;
if ((email.charAt(lengthOfEmail - 1) == ".") || (email.charAt(lengthOfEmail - 2) == ".")) {
return false;
}
Pos = email.indexOf("@",1);
if (email.charAt(Pos + 1) == ".") {
return false;
}
while ((Pos < lengthOfEmail) && ( Pos != -1)) {
Pos = email.indexOf(".",Pos);
if (email.charAt(Pos + 1) == ".") {
return false;
}
if (Pos != -1) {
Pos++;
}
}
// There must be at least one @ symbol
atPos = email.indexOf("@",1);
if (atPos == -1) {
return false;
}
// But only ONE @ symbol
if (email.indexOf("@",atPos+1) != -1) {
return false;
}
// Also check for at least one period after the @ symbol
periodPos = email.indexOf(".",atPos);
if (periodPos == -1) {
return false;
}
if (periodPos+3 > email.length) {
return false;
}
return true;
}

function checkEmail(val) {
// Remove all whitespace
val = val.replace(/^\s+/,"");
val = val.replace(/\s+$/,"");
if (isEmail(val)==false) {
if (val.length == 0 || val == null) {
var notValid =  "Please enter a valid email address";
} else {
var notValid =  "I'm sorry, " + val + " is not a valid email address";
}
alert(notValid);
return false;
}
return true;
}

function formatDate(date) {
var spot = date.indexOf('-',0)
if ((spot != 4) || (date.length != 10)) {
return false;
}				
spot = date.indexOf('-',5)
if (spot != 7) {
return false;
}
return true;
}

//functions for slideshow
//written by: scott bice 6/15/02
var timer = null;
function playpauseShow(option) {
if (option == "play") {
if (currentImage == imageList.length-1) {
currentImage=0;
} else {
currentImage++;
}
document.slideimage.src = imageList[currentImage];
timer = setTimeout("playpauseShow('play')", 3000);
} else {
clearTimeout(timer);
}
}

function nextImage() {
if (currentImage == imageList.length-1) {
currentImage = 0;
} else {
currentImage++;
}
document.slideimage.src = imageList[currentImage];
}

function prevImage() {
if (currentImage == 0) {
currentImage = imageList.length-1;
} else {
currentImage--;
}
document.slideimage.src = imageList[currentImage];
}
//end of functions for slideshow

var browser = navigator.appName;
var version = navigator.appVersion.substring(0,1);
function redirectTopNav(dest) {
window.location=dest;
}

function changeFontColor(loc, color) {
if (browser == "Microsoft Internet Explorer") {
window[loc].style.color=color;
} 
}

function changeBGColor(loc, color) {
if (browser == "Microsoft Internet Explorer") {
window[loc].style.backgroundColor=color;
} 
}

function changeImage(loc, image) {
if (browser == "Microsoft Internet Explorer") {
window[loc].src = image;
} else if (browser == "Netscape" && version>=5) {
document.getElementById(loc).src = image;
}
}

function formatCurrency(num) {
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num)) num = "0";
cents = Math.floor((num * 100 + 0.5) % 100);
num = Math.floor((num * 100 + 0.5) / 100).toString();
if(cents < 10) cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++)
num = num.substring(0,num.length - (4 * i + 3))+','+num.substring(num.length-(4 * i + 3));
return ("$" + num + "." + cents);
}

// Savings Calculation: Used in What Will I Save sections
// Need more input as to when this is used with prior calculations
function checkChoice(whichbox) {
with (whichbox.form) {
var p = price.value;
var prior = priorval.value;
var savings = "$0.00";
// Make sure value is a number and no decimal is entered, or reset to prior	
if (isNaN(whichbox.value)) { 
whichbox.value = prior;
whichbox.focus();
}
whichbox.value = Math.abs(whichbox.value);
var dec = whichbox.value.indexOf('.', 1)
if (dec > 0) { 
alert('No decimal places allowed for \"' +whichbox.name +'\" !');
whichbox.value = prior;
whichbox.focus();
}
hiddentotal.value = eval(hiddentotal.value) - eval(p * prior);
prior = whichbox.value;
hiddentotal.value = eval(p * whichbox.value);
savings = formatCurrency(hiddentotal.value);
return(savings.substring(0,(savings.length)-3));
}
}

function popupform(myform, windowname, h, w) {
if (! window.focus) { return true; }
window.open(myform, windowname, 'height='+h+',width='+w+',scrollbars=no');
myform.target=windowname;
return true;
}

function popupform_withtb(myform, windowname, h, w) {
if (! window.focus) { return true; }
window.open('', windowname, 'height='+h+',width='+w+',scrollbars=no,toolbar=yes');
myform.target=windowname;
return true;
}

function popupform_withtbmb(myform, windowname, h, w) {
if (! window.focus) { return true; }
window.open('', windowname, 'height='+h+',width='+w+',scrollbars=yes,toolbar=no,menubar=yes');
myform.target=windowname;
return true;
}

function popup(mypage, windowname, h, w) {
if (! window.focus) { return true; }
window.open(mypage, windowname, 'height='+h+',width='+w+',scrollbars=no');
return true;
}

function termsWindow() {
window.open ('/terms.html', 'TermsAndConditions', 'height=350, width=640, scrollbars=1, resizable=1');
return false;
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
//add event function from http://www.dynarch.com/projects/calendar/
function addAnEvent(el, evname, func) {
if (el.attachEvent) { // IE
el.attachEvent("on" + evname, func);
} else if (el.addEventListener) { // Gecko / W3C
el.addEventListener(evname, func, true);
} else {
el["on" + evname] = func;
}
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	Javascript to handle AJAX / XMLHTTPRequest
	author/contact - Alan Nouri - July 2005
**************************************************************************/
// test the browsers XMLHTTPRequest support so we can return errors properly later
var AJAX_SUPPORT = test_ajax();

function test_ajax() {
// ie 5.01 doesn't support xmlhttprequest but thinks it does...
// it also thinks it supports the DOM
// so, death to ie 5.01

if (!createXmlObj(null) || !document.getElementById || isIE501 || isIE500 || isAol) {
return false;
}
return true;
}


/* Performs a HTTP GET request on 'url' and sends responseText to 'callback'
    callback and fallback are optional
    fallback is called and HTTPGet returns false when the browser does not support XMLHTTPRequest
    callback should take two parameters: the responseText and the entire XMLHTTPRequest object
    fallback is called when the request times out
    
    when the response to the request is not recieved after the timeout, then the request is made again   >>> not implemented yet
    if the retry limit is reached, fallback is called and HTTPGet returns false                                     >>> not implemented yet
    
    i.e. HTTPGet('messageHandler.php?foo=1', function(response, obj) {alert(response);}, function() {alert('Request Failed');})
    or  HTTPGet('messageHandler.php?foo=1', function(response, obj) { alert(response); })
    or  HTTPGet('messageHandler.php?foo=1');
*/
var timeout = 5; // seconds
var retryAmount = 5; // # of times to retry
var HTTPRequests = new Array; // keep track of requests by storing the timeout in here
function HTTPGet(url, callback, fallback) {
// no ajax support
if (!AJAX_SUPPORT) {
if (fallback) {
fallback();
}
return false;
}
// XMLHttpRequest obj not re-usable?
var xmlhttp = createXmlObj(callback);
try {
xmlhttp.open("GET", url, "true");
xmlhttp.setRequestHeader('If-Modified-Since', 'Wed, 15 Nov 1995 00:00:00 GMT');	// safari fix
xmlhttp.send(null);
}
catch(e) {
return false;
}
}

function HTTPPost(url, callback, fallback) {
  // no ajax support
  if (!AJAX_SUPPORT) {
    if (fallback) {fallback();}
    return false;
  }
  // XMLHttpRequest obj not re-usable?
  var xmlhttp = createXmlObj(callback);
  try {
  xmlhttp.open("POST", url, "true");
  xmlhttp.setRequestHeader('If-Modified-Since', 'Wed, 15 Nov 1995 00:00:00 GMT');	// safari fix
  xmlhttp.send(null);
  }
  catch(e) {
  return false;
  }
}





// Creates the XMLHttpRequest object and resets any variables
// needed to restart the application
function createXmlObj(callback) {
var XMLObj;
//if (exp) create xmlHttpObject for Mozzila based browsers and IE7
//else if (exp) create ActiveXObjects for IE 6
if (!XMLObj && typeof XMLHttpRequest != 'undefined') {
XMLObj = new XMLHttpRequest();
} else if(window.ActiveXObject){
	XMLObj = new ActiveXObject("Microsoft.XMLHTTP");
	if(!XMLObj){
		XMLObj = new ActiveXObject("Msxml2.XMLHTTP");
	}
}

// browser not supported
if (!XMLObj) {
return false;
}

if (callback) {
XMLObj.onreadystatechange = function() {
try {
if (XMLObj.readyState == 4) {
callback(XMLObj.responseText, XMLObj);
}
}
catch(e) { }
}
}

return XMLObj;
}

// Uses XMLHTTPRequest to attempt to cache a page
// optional delay on request in seconds
function HTTPCache(url, delay) {
if (!AJAX_SUPPORT) {
return false;
}
if (delay) {
setTimeout("HTTPCache('"+url+"', null)", delay*1000);
} else {
var xmlhttp = createXmlObj(null);
try {
xmlhttp.open("GET", url, "true");
xmlhttp.send(null);
}
catch(e) {
return false;
}
}
}
/***********  END AJAX / XMLHTTPREQUEST FUNCTIONS  *************
/* Image Functions (taken from image.js) */
function preloadImages() { 
var d=document; if(d.images){ if(!d.p) d.p=new Array();
var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

function swapImgRestore() { 
var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function findObj(n, d) { 
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);
}
return x;
}

function swapImage() { 
var i,j=0,x,a=swapImage.arguments;
document.sr=new Array;
for(i=0;i<(a.length-2);i+=3) {
if ((x=findObj(a[i]))!=null) {
document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];
}
}
}

Array.prototype.in_array = function ( obj ) {
	var len = this.length;
	for ( var x = 0 ; x <= len ; x++ ) {
		if ( this[x] == obj ) return true;
	}
	return false;
}

// Controls Text Limit on <textfield> and filters words from list (Array)

function len(f, le_name, t, maxL) {
	var ml = f.elements[le_name];
	var v = new String();
	var s = t.value.split('');
	for(i=0;i<maxL;i++) {
		v += s[i];
	}
	
//	for(i = 0; i < list.length; i++) {
//		if(v.toString().indexOf(list[i]) != -1) {
//			alert(list[i] + " is an inappropriate word!");		
//			t.value = v.toString().replace(list[i], "***");
//			t.blur();
//		}
//	}
	
	if(s.length >= maxL) {
		t.value = v;
		ml.value = 0;
	} else {
		ml.value = maxL-s.length;
	}
}

// Pop-up Window

function pop(u,n,f){
	var d = "default";
	var sf = "directories,location,menubar,resizable,scrollbars,status,toolbar";
	if (!n){n = d}
	if (!f){f = sf}
	pw = window.open(u,n,f);
	pw.focus();
}

// Checks if Input is Numeric

function isNumericKey(e) {
	var k;
	document.all ? k = e.keyCode : k = e.which;
	return ((k > 47 && k < 58) || k == 8);
}

function extractNumeric(str) {
	return str.replace(/\D/g,"");
}

// Phone Number Filter

function res(t,v) {
	var phone = "()- 0123456789";
//	var numb = "0123456789";
//	var alpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";

	var w = "";
	
	for (i=0; i < t.value.length; i++) {
		x = t.value.charAt(i);
		if (phone.indexOf(x,0) != -1)
			w += x;
	}
	
	t.value = w;
}
function ress(t,v) {
	var phones = ".0123456789";
//	var numb = "0123456789";
//	var alpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";

	var w = "";
	
	for (i=0; i < t.value.length; i++) {
		x = t.value.charAt(i);
		if (phones.indexOf(x,0) != -1)
			w += x;
	}
	
	t.value = w;
}

// Listing Info Validation + Word Filter

var swear_alert_arr = new Array;
var swear_alert_count = 0;

function reset_alert_count() {
	swear_alert_count = 0;
}

function validate_user_text(myform) {
	reset_alert_count();
	var compare_text = myform.l_desc.value;
	
	for(var i=0; i<swear_words_arr.length; i++) {
		for(var j=0; j<(compare_text.length); j++) {
			if(swear_words_arr[i]==compare_text.substring(j,(j+swear_words_arr[i].length)).toLowerCase()) {
				swear_alert_arr[swear_alert_count]=compare_text.substring(j,(j+swear_words_arr[i].length));
				swear_alert_count++;
			}
		}
	}
	
	var alert_text="";
	
	for(var k=1; k<=swear_alert_count; k++) {
		alert_text += "\n" + "(" + k + ")  " + swear_alert_arr[k-1];
	}
	
	if(swear_alert_count>0) {
		alert("Please revise description.\nThe following word(s) are universally considered inappropriate content:\n_______________________________\n" + alert_text + "\n_______________________________");
		myform.l_desc.select();
		return false;
	} else {
	
	    if(myform.l_price.value == "")
	      {
	      alert("Please enter the Price!");
	      myform.l_price.focus();
	      return false;
	      }
	    else if(myform.l_address.value == "")
	      {
	      alert("Please enter the Address!");
	      myform.l_address.focus();
	      return false;
	      }
	    else if(myform.l_city.value == "")
	      {
	      alert("Please enter the City!");
	      myform.l_city.focus();
	      return false;
	      }
	    else if(myform.l_county.value == "")
	      {
	      alert("Please enter the County!");
	      myform.l_county.focus();
	      return false;
	      }
	    else if(myform.l_state.value == "")
	      {
	      alert("Please select the State!");
	      myform.l_state.focus();
	      return false;
	      }
	    else if(myform.l_zip.value == "")
	      {
	      alert("Please enter the Zip Code!");
	      myform.l_zip.focus();
	      return false;
	      }
		else
		  {
		  myform.submit();
		  }
	}
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
