/* common begin */
var defaultSearchText2 = 'Enter Cities, Counties, ZIP Code(s), or MLS number';
var defaultSearchText3 = 'Enter a Town or County to Search';
function removeIds(element){
    for(var i=0;i<element.childNodes.length;i++){
        if(element.childNodes[i].nodeType === 1){
            element.childNodes[i].id = "";
            removeIds(element.childNodes[i]);
        } 
    }
}

var defaultSearchText = 'Ex: Waterfront, Street Address, Pool, Ranch';
function removeIds(element){
    for(var i=0;i<element.childNodes.length;i++){
        if(element.childNodes[i].nodeType === 1){
            element.childNodes[i].id = "";
            removeIds(element.childNodes[i]);
        } 
    }
}


function relinkIds(element, suffix){
    for(var i=0;i<element.childNodes.length;i++){
        if(element.childNodes[i].nodeType === 1){
            if(element.childNodes[i].id && element.childNodes[i].id !== null && "" !== element.childNodes[i].id){
                element.childNodes[i].id = element.childNodes[i].id + suffix;
            }
            relinkIds(element.childNodes[i], suffix);
        } 
    }
}

function trimAll(sString) 
  {
        while (sString.substring(0,1) == ' ')
        {
             sString = sString.substring(1, sString.length);
        }
        while (sString.substring(sString.length-1, sString.length) == ' ')
        {
             sString = sString.substring(0,sString.length-1);
        }
        return sString;
   }

function clearInput(action, input)	{
	var inputId = document.getElementById(input);
	switch(input)	{
		case 'look-neighborhood':
		case 'tab-look-neighborhood':
			text = 'Enter City & State or ZIP';
        break;
		case 'ctl00_main_homeValCity':
			text = 'City, State and ZIP';
		break;
		case 'szQuickValue':
			text = defaultSearchText2;
		break;
		case 'SearchQuickValue':
			text = defaultSearchText3;
		break;
		case 'szQuickDescription':
			text = defaultSearchText;
		break;
		case 'ctl00_main_homeValAddress':
			text = 'Street Address';
		break;
		case 'ctl00_main_txtLocation':
			text = 'Enter City & State or ZIP';
	    break;
		case 'ctl00_main_txtFirst':
			text = 'First name';
	    break;
		case 'ctl00_main_txtLast':
			text = 'Last name';
	    break;
		case 'ctl00_main_txtOfficeName':
			text = 'Broker Office Name';
	    break;	    
	}
	if (action == 'focus')	{
		if (trimAll(inputId.value) == trimAll(text)){
			inputId.value = '';
		}
	}
	else if (inputId.value == '')	{
		inputId.value = text;
	}
}

function buildNav(element) {
	nbar = document.getElementById(element).getElementsByTagName("li");
	for (a = 0; a < nbar.length; a++){
		nbar[a].onmouseover = function() { this.className += " over"; }
		nbar[a].onmouseout = function() { this.className = this.className.replace(/\s*over/g,""); }
	}
}
function formatNumber(amount)
{
    var delimiter = ","; // replace comma if desired
    var i = amount;
    if(isNaN(i)) { return ''; }
    var minus = '';
    if(i < 0) { minus = '-'; }
    i = Math.abs(i);
    var n = new String(i);
    var a = [];
    while(n.length > 3)
    {
        var nn = n.substr(n.length-3);
        a.unshift(nn);
        n = n.substr(0,n.length-3);
    }
    if(n.length > 0) { a.unshift(n); }
    n = a.join(delimiter);
    amount = n;
    amount = minus + amount;
    return amount;
}
/*  common end  */
/* header begin */

/*  header end  */

/* footer begin */

/*  footer end  */

/* search begin */
function setError(type)	{
    var theList = document.getElementById('search-error');
    if(errorOpen !== null && errorClose !== null){
        if(theList.innerHTML === ''){
	        errorOpen.attributes.height = { to: 1 };
        } else {
	        errorOpen.attributes.height = { to: 66 };
        }
	    if (type == 'show')	{
		    document.getElementById('icon-mag').style.display = 'none';
		    document.getElementById('icon-error').style.display = 'block';
		    errorOpen.animate();
	    }
	    else if (type == 'hide')	{
		    document.getElementById('icon-mag').style.display = 'block';
		    document.getElementById('icon-error').style.display = 'none';
		    errorClose.animate();
	    }
	} else {
	    // alert('this shouldn't be happening');
	}
}
function clickCheck(element)	{
    if(waitForSearch === false){
	    var liClass = ('check-' + element);
	    if (document.getElementById(element).checked)	{
		    document.getElementById(liClass).className = 'checked';
	    }
	    else	{
		    document.getElementById(liClass).className = 'unchecked';
	    }
	    syncAndSubmit();
	}
}
bedCount = 0;
bathCount = 0;
function setSlider(action, set, value)	{
    if(waitForSearch === false){
	    elementId = 'slider-' + set + '-';
	    var bedMax = 5;
	    var bathMax = 3; 
	    switch(set)	{
		    case 'bed':
			    maxNum = bedMax;
			    currentNum = bedCount;
		    break;
		    case 'bath':
			    maxNum = bathMax;
			    currentNum = bathCount;
		    break;
	    }

	    spanID = set + '-count-disp';

	    if (action == 'roll')	{
		    for (var x = value; x <= maxNum; x++)	{
			    document.getElementById(elementId + x).className = 'unchecked';
		    }
		    for (var x = 0; x <= currentNum; x++)	{
			    document.getElementById(elementId + x).className = 'checked';
		    }
		    for (var x = 0; x <= value; x++)	{
			    document.getElementById(elementId + x).className = 'checkedtemp';
		    }
		    document.getElementById(spanID).innerHTML = value === 0 ? "All" : value + "+";
	    }
	    else if (action == 'out')	{
		    for (var x = 0; x <= maxNum; x++)	{
			    document.getElementById(elementId + x).className = 'unchecked';
		    }
		    for (var x = 0; x <= currentNum; x++)	{
			    document.getElementById(elementId + x).className = 'checked';
		    }
		    document.getElementById(spanID).innerHTML = currentNum === 0 ? "All" : currentNum + "+";
	    } 
	    else if (action == 'set')	{
		    for (var x = 0; x <= maxNum; x++)	{
			    document.getElementById(elementId + x).className = 'unchecked';
		    }
		    for (var x = 0; x <= value; x++)	{
			    document.getElementById(elementId + x).className = 'checked';
		    }
		    document.getElementById(set + '-count').value = value > 0 ? value : "";
		    document.getElementById(spanID).innerHTML = value === 0 ? "All" : value + "+";
    		
		    switch(set)	{
			    case 'bed':
				    bedCount = value;
			    break;
			    case 'bath':
				    bathCount = value;
			    break;
		    }
		    syncAndSubmit();
	    }
    }
}
theText = '';
function setCheckbox(set, element)	{
    
	if(waitForSearch === false){
	    //alert(element);
		var liIdent = ('check-' + element);
	    var inputIdent = (set + '-' + element);
		
	   
		if (document.getElementById(inputIdent).value == '')	{
		    document.getElementById(liIdent).className = 'checked';
		    document.getElementById(inputIdent).value = 1;
			
			if (element=="single"){
				theText = theText + "Single Family,"; //alert(theText);
			}
			
			if (element=="multi"){
				theText = theText + "Multi Family,"; //alert(theText);
			}
			
			if (element=="mobile"){
				theText = theText + "Mobile Home,"; //alert(theText);
			}
			
			if (element=="condo"){
				theText = theText + "Condo/Coop,"; //alert(theText);
			}
			
			if (element=="commercial"){
				theText = theText + "Commercial,"; //alert(theText);
			}
			
			if (element=="land"){
				theText = theText + "Land,"; //alert(theText);
			}
			
			if (element=="rental"){
				theText = theText + "Rental,"; //alert(theText);
			}
			
			
	    }
	    else	{
		    document.getElementById(liIdent).className = 'unchecked';
		    document.getElementById(inputIdent).value = '';
			
			if (element=="single"){
				
				theText = theText.replace('Single Family,',""); //alert(theText);
			}
			
			if (element=="multi"){
				theText = theText.replace('Multi Family,',""); //alert(theText);
			}
			
			if (element=="mobile"){
				theText = theText.replace('Mobile Home,',""); //alert(theText);
			}
			
			if (element=="condo"){
				theText = theText.replace('Condo/Coop,',""); //alert(theText);
			}
			
			if (element=="commercial"){
				theText = theText.replace('Commercial,',""); //alert(theText);
			}
			
			if (element=="land"){
				theText = theText.replace('Land,',""); //alert(theText);
			}
			
			if (element=="rental"){
				theText = theText.replace('Rental,',""); //alert(theText);
			}
			
	    }
		
		document.getElementById('szPropertyType').value = theText;
	    syncAndSubmit();
    }
}
function unCheckCheckbox(set, element)	{
    if(waitForSearch === false){
	    var liIdent = ('check-' + element);
	    var inputIdent = (set + '-' + element);
	    document.getElementById(liIdent).className = 'unchecked';
	    document.getElementById(inputIdent).value = '';
    }
}
function setMenu(menu, item, formval)	{
    
	if(waitForSearch === false){
	    var value = "";
	    switch(menu)	{
		    case 'home-age':
			    switch(item)	{
				    case 0:
					    //alert("case 0");
						value = 'All';
	                    document.getElementById('form-' + menu + '-min').value = item;
					    document.getElementById('form-' + menu + '-max').value = "";
				        break;
				    case 1:
					     //alert("case 1");
						value = '0-1';
	                    document.getElementById('form-' + menu + '-min').value = "";
					    document.getElementById('form-' + menu + '-max').value = item;
				        break;
				    case 5:
					     //alert("case 5");
						value = '1-5';
	                    document.getElementById('form-' + menu + '-min').value = "";
					    document.getElementById('form-' + menu + '-max').value = item;
				        break;
				    case 10:
					     //alert("case 10");
						value = '10';
	                    document.getElementById('form-' + menu + '-min').value = "";
					    document.getElementById('form-' + menu + '-max').value = item;
				        //alert(document.getElementById('search-min-lot').value);
						//alert(document.getElementById('search-max-lot').value);
						break;
				    case 50:
					     //alert("case 50");
						value = '10-50';
	                    document.getElementById('form-' + menu + '-min').value = "";
					    document.getElementById('form-' + menu + '-max').value = item;
				        break;
				    case 51:
					     //alert("case 51");
						value = '50+';
	                    document.getElementById('form-' + menu + '-min').value = "";
					    document.getElementById('form-' + menu + '-max').value = item;
				     break;
				    
			    }
            document.getElementById('homeagelist').style.display = 'none';
            syncAndSubmit();
		    break;

		    case 'enlist-language':
                value = item;
                document.getElementById('enlist-language-list').style.display = 'none';
		    break;
	    }
        document.getElementById(menu).innerHTML = value;
    }
}
var priceMin = 0;
var priceMax = 0;
var lotMin = 0;
var lotMax = 0;
var priceInc = 50000;
var lotInc = 125;
var sqft = " sqft.";
var currencyCode = "$";
function getNumberFromValue(ele){
    if(ele.value){
        var val = ele.value.replace(/(\D+)/g, "");
        var z = /(\d+)/;
        var result = z.exec(val);
        return result ? (result[0]*1.0) : null;
    }
    return null;
}
function nonNumber(v){
    return ((v == null) || (v.length == 0)) || (isNaN(v) || /^\s+$/.test(v));
}
function checkNumber(input, type){
    var val = getNumberFromValue(input)*1.0;
    var id = input.id;
    var min;
    var max;
    var inc; 
    if(type === "price"){
        min = priceMin;
        max = priceMax;
        inc = priceInc;
    } else if(type === "lot"){
        min = lotMin;
        max = lotMax;
        inc = lotInc;
    }
    if(nonNumber(val)){
        if(id.match("min")){
            val = 0;
            min = val;
        } else if(id.match("max")){
            if(min > 0){
                var div = min/inc;
                val = Math.ceil(div)*inc;
            } else {
                val = inc;
            }
            max = val;
        }
    } else {
        if(id.match("min")){
            if (val > max){
                max = 0;
            }
            min = val;
        } else if (id.match("max")){
            if (val < min){
                min = 0;
            }
            max = val;
        }
    }
    if(type === "price"){
		input.value = val > 0 ? (currencyCode + formatNumber(val)) : "None";
        if(id.match("min") && max === 0){
            document.getElementById('price-max').value = "None"
        } else if (id.match("max") && min === 0){
            document.getElementById('price-min').value = "None"
        }        
        priceMin = min;
        priceMax = max;
    } else if(type === "lot"){
        input.value = val > 0 ? (formatNumber(val) + sqft) : "None";
        if(id.match("min") && max === 0){
            document.getElementById('lot-max').value = "None"
        } else if (id.match("max") && min === 0){
            document.getElementById('lot-min').value = "None"
        }        
        lotMin = min;
        lotMax = max;
    }
    packIncrementedValues();
}
function minUp(minInput, type){
    if(waitForSearch === false){
        var id = minInput.id;
        var min;
        var max;
        var inc; 
        if(type === "price"){
            min = priceMin;
            max = priceMax;
            inc = priceInc;
        } else if(type === "lot"){
            min = lotMin;
            max = lotMax;
            inc = lotInc;
        }
        var val = getNumberFromValue(minInput);
        val = val ? val*1.0 : 0;
        var div = Math.floor(val/inc);
        val = (div*inc)+inc;
        if(val > max){
            max = 0; 
        }
        min = val;
        if(type === "price"){
            minInput.value= (currencyCode + formatNumber(val));
            if(max === 0){
                document.getElementById('price-max').value = "None"
            }       
            priceMin = min;
        } else if(type === "lot"){
            minInput.value = (formatNumber(val) + sqft);
            if(max === 0){
                document.getElementById('lot-max').value = "None"
            }       
            lotMin = min;
        }
        packIncrementedValues();
    }
}
function minDown(minInput, type){
	if(waitForSearch === false){
        var min;
        var max;
        var inc;
       
		if(type === "price"){
			min = priceMin;
            max = priceMax;
            inc = priceInc;
        } else if(type === "lot"){
            min = lotMin;
            max = lotMax;
            inc = lotInc;
        }
        var val = getNumberFromValue(minInput);
        val = val ? val*1.0 : 0;
        var div = Math.floor(val/inc);
        val = (div === 0) ? 0 : (div*inc)-inc;
        min = val;
        if(type === "price"){
            minInput.value= val > 0 ? (currencyCode + formatNumber(val)) : "None";
            priceMin = min;
        } else if(type === "lot"){
            minInput.value = val > 0 ? (formatNumber(val) + sqft) : "None";
            lotMin = min;
        }
        packIncrementedValues();
    }
}
function maxUp(maxInput, type){
    if(waitForSearch === false){
        var min;
        var max;
        var inc; 
		if(type === "price"){
            min = priceMin;
            if(priceMax < priceMin){
              max = priceMin;
              maxInput.value = max;  
            } else {
                max = priceMax;
            }
            max = (priceMax < priceMin) ? priceMin : priceMax;
            inc = priceInc;
        } else if(type === "lot"){
            min = lotMin;
            if(lotMax < lotMin){
               max = lotMin;
               maxInput.value = max;
            } else {
                max = lotMax;
            }
            inc = lotInc;
        }
        var val = getNumberFromValue(maxInput);
        val = val ? val*1.0 : 0;
        var div = Math.floor(val/inc);
        val = (div*inc)+inc;
        if(val < min){
            min = 0;
        }  
        max = val;
        if(type === "price"){
            maxInput.value= val > 0 ? (currencyCode + formatNumber(val)) : "None";
            if(min === 0){
                document.getElementById('price-min').value = "None"
            }        
            priceMax = max;
        } else if(type === "lot"){
            maxInput.value = val > 0 ? (formatNumber(val) + sqft) : "None";
            if(min === 0){
                document.getElementById('lot-min').value = "None"
            }       
            lotMax = max;
        }
        packIncrementedValues();
    }
}
function maxDown(maxInput, type){
    if(waitForSearch === false){
        var min;
        var max;
        var inc; 
        if(type === "price"){
            min = priceMin;
            max = priceMax;
            inc = priceInc;
        } else if(type === "lot"){
            min = lotMin;
            max = lotMax;
            inc = lotInc;
        }
        var val = getNumberFromValue(maxInput);
        val = val ? val*1.0 : 0;
        var div = Math.floor(val/inc);
        val = (div*inc)-inc;
        if(val < min){
            min = 0; 
        }
        max = val;
        if(type === "price"){
            maxInput.value= val > 0 ? (currencyCode + formatNumber(val)) : "None";
            if(min === 0){
                document.getElementById('price-min').value = "None"
            }        
            priceMax = max;
        } else if(type === "lot"){
            maxInput.value = val > 0 ? (formatNumber(val) + sqft) : "None";
            if(min === 0){
                document.getElementById('lot-min').value = "None"
            }       
            lotMax = max;
        }
        packIncrementedValues();
    }
}
function packIncrementedValues(){
	//alert('min: '+priceMin);
	//alert('max: '+priceMax);
	document.getElementById("cMinPrice").value = priceMin;
    document.getElementById("cMaxPrice").value = priceMax > 0 ? priceMax : "";
    document.getElementById("search-min-lot").value = lotMin;
    document.getElementById("search-max-lot").value = lotMax > 0 ? lotMax : "";
    syncAndSubmit();
}

var waitForSearch = false;
var refinable = false;
function syncAndSubmit(){
    if(refinable === true){
    /*
    This is the magic that submits after every criteria/filter change
        waitForSearch = true;
        syncFormToCommand(search);
        makeAndPackSearchString();
    */    
        //document.getElementById('update-search-button').disabled = false;
        document.getElementById('filter-update').className = "btn-filter-update";
    }
}

/*  search end  */
function getPropertyType(l){
    if (l.Condo === true)
    {
        return "Condominium";
    }
    else if (l.SingleFamily === true)
    {
        return "Single-Family Home";
    }
    else if (l.MultiFamily === true)
    {
        return "Multi-Family Home";
    }
    else if (l.Coop === true)
    {
        return "Co-Opportunity";
    }
    else if (l.Farm === true)
    {
        return "Farm";
    }
    else if (l.Land === true)
    {
        return "Land";
    }
    else if (l.Townhouse === true)
    {
        return "Townhouse";
    }
}
function showDiv(homeagelist) {
  
  var theElementStyle = document.getElementById(homeagelist);
     
  if(theElementStyle.style.display == "none" || theElementStyle.style.display == "") {
    theElementStyle.style.display = "block";
    YAHOO.util.Dom.setStyle(['search-options'], 'overflow', 'visible');
  }
  else  {
    theElementStyle.style.display = "none";
  }
}
function swapPasswordBox(parent, hide)	{	
	show = parent + hide;	
    YAHOO.util.Dom.setStyle([show], 'display', 'block');
    YAHOO.util.Dom.setStyle([hide], 'display', 'none');
	document.getElementById(show).focus();
}

function updateDefaultLocationTextBoxes(location) {
    var sn = document.getElementById("search-neighborhood");
    if (sn && sn != null)
    {
        sn.value = location;
    }
    
    var smain = document.getElementById("search-main")
    if (smain && smain != null)
    {
        smain.value = location;
    }   
 }

function checkAlpha( strValue)
{
    var objRegExp  = /^[a-zA-Z]+$/; 
    return objRegExp.test(strValue);
}

function checkAlphaSpace( strValue)
{
    var objRegExp  = /^[a-zA-Z\s]+$/; 
    return objRegExp.test(strValue);
}

/************************************************
DESCRIPTION: Validates that a string a United
  States zip code in 5 digit format or zip+4
  format. 99999 or 99999-9999
    
PARAMETERS:
   strValue - String to be tested for validity
   
RETURNS:
   True if valid, otherwise false.

*************************************************/
function validateUSZip( strValue ) 
{
    var objRegExp  = /(^\d{5}$)|(^\d{5}-\d{4}$)/; 
    return objRegExp.test(strValue);
}


/************************************************
    DESCRIPTION: Validates that a string contains a 
      valid email pattern. 
      
     PARAMETERS:
       strValue - String to be tested for validity
       
    RETURNS:
       True if valid, otherwise false.
       
    REMARKS: Accounts for email with country appended
      does not validate that email contains valid URL
      type (.com, .gov, etc.) and optionally,
      a valid country suffix.  Since email has many
      forms this expression only tests for near valid
      address.  Some additional validation may be
      required.
    *************************************************/
function validateEmail( strValue) 
{   
    var objRegExp  = /(\w{1,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}[\s*,]?)+$/;      
    return objRegExp.test(strValue);
}

function resetInputText(action, input, message)	
{   
	var inputId = document.getElementById(input);
		
	if (action == 'focus')	
	{
		if (trimAll(inputId.value) == trimAll(message))
		{
			inputId.value = '';
		}
	}
	else if (inputId.value == '')	
	{
		inputId.value = message;
	}
}

function resetInputText(action, input, message, validate)	
{   
	var inputId = document.getElementById(input);
		
	if (action == 'focus')	
	{
		if (trimAll(inputId.value) == trimAll(message))		
			inputId.value = '';		
	}
	else if (inputId.value == '' || inputId.value == message)	
	{
		inputId.value = message;
		if(validate)
		{		    
		    YAHOO.util.Dom.removeClass([input],'validation-passed');
		    YAHOO.util.Dom.removeClass([input],'validation-failed');
		    YAHOO.util.Dom.addClass([input],'validation-failed');
		}
	}
}

function resetPasswordBox(hide, show)	
{	
	
    if(trimAll(document.getElementById(hide).value) == "")
    {        
        YAHOO.util.Dom.setStyle([show], 'display', 'block');
        YAHOO.util.Dom.setStyle([hide], 'display', 'none');	
        YAHOO.util.Dom.addClass([show],'validation-failed');
    }
}

/************************************************
DESCRIPTION: Validates that a string contains valid
  US phone pattern. 
  Ex. (999) 999-9999 , 999 999 9999, 999-999-9999
  
PARAMETERS:
   strValue - String to be tested for validity
   
RETURNS:
   True if valid, otherwise false.
*************************************************/
function validateUSPhone( strValue ) 
{
 //^\([1-10]\d{3}\)\s?\d{3}\-\d{4}$
  var objRegExp  = /^[01]?[- .]?(\([2-9]\d{2}\)|[2-9]\d{2})[- .]?\d{3}[- .]?\d{4}$/;
  //check for valid us phone with or without space between 
  //area code
  return objRegExp.test(strValue); 
}

function ParsePhoneNumber(phonenumber)
{
   if (phonenumber.length == 10)
   {
      phonenumber =  phonenumber.substring(0,3) + "." + phonenumber.substring(3,6) + "." + phonenumber.substring(6,10);
   }
	  return phonenumber;
}

/*Stars*/

function setStar(node)
{
    
    var ID = ''+node.id;
    
    var re = new RegExp('G');
    if (re.test(ID)) {
    
       ID = ID.replace('starG', '');
       
       var posG = parseInt(ID);  
    }
    
    var re = new RegExp('Y');
    if (re.test(ID)) {
    
       ID = ID.replace('starY', '');
       
       var posY = parseInt(ID);  
    }
    
    for (i=posG; i>0; i--) {
       
       if (document.getElementById('starG'+i)) {
            document.getElementById('starG'+i).src = '../../Images/icon_saved_star_yellow.gif'; 
       } 
    }
    
    for (i=(posY+1); i<6; i++) {
       
       if (document.getElementById('starY'+i)) {
            document.getElementById('starY'+i).src = '../../Images/icon_saved_star_gray.gif'; 
       } 
    }
}

function resetStars()
{
    for (i=1; i<=2; i++) {
    
        var status = (i==1) ? 'Y' : 'G';
    
        for (j=1; j<=5; j++) {
        
            if (document.getElementById('star'+status+j)) {        
                document.getElementById('star'+status+j).src = (status=='Y') ? '../../Images/icon_saved_star_yellow.gif' : '../../Images/icon_saved_star_gray.gif';
            }
        }    
    }
}
function readMediaArticle(id, action)   {
    if (action == 'show')   {
        document.getElementById('article' + id + 'intro').style.display = 'none';
        document.getElementById('article' + id + 'full').style.display = 'block';
        document.getElementById('readArticle' + id).style.display = 'none';
        document.getElementById('hideArticle' + id).style.display = 'block';
    }
    else    {
        document.getElementById('article' + id + 'full').style.display = 'none';
        document.getElementById('article' + id + 'intro').style.display = 'block';
        document.getElementById('hideArticle' + id).style.display = 'none';
        document.getElementById('readArticle' + id).style.display = 'block';
    }
}


function submit() {
				
		if (document.getElementById('szQuickValue').value === "Enter Cities, Counties, ZIP Code(s), or MLS number"){
			
			document.getElementById('szQuickValue').value = "";
		}
		
		if (document.getElementById('szQuickDescription').value === "Ex: Waterfront, Street Address, Pool, Ranch"){
			
			document.getElementById('szQuickDescription').value = "";
		}
		
		document.searchListingForm.submit();
}



	function openWin(URL,x,y) {

	var newWindow = window.open(URL, 'popupnav', 'width=' + x + ',height='+ y+',resizable=1,scrollbars=1');
	
		newWindow.focus()
	}

