    HelpWin =0;
    function openHelpWin( winLocation) {
      screen_height        = 0;     screen_width      = 0;
      win_top              = 0;     win_left          = 0;

      if (arguments[1]) {
        var helpWinWidth   = arguments[1];
      } else {
        var helpWinWidth   = 225;
      }

      if (arguments[2]) {
        var helpWinHeight  = arguments[2];
      } else {
        var helpWinHeight  = 320;
      }
      if (arguments[3]) {
        if (arguments[3]==1) {
         scrll=1;
        } else {
         scrll=0;
        }
      } else {
        scrll = 0;
      }

      if (arguments[4]) {
         helpWinName = arguments[4];
      } else {
        helpWinName = 'HordeHelpWin';
      }
       HelpWin  = window.open(winLocation,helpWinName,'width=' + helpWinWidth + ',height=' + helpWinHeight + ',resizable=yes,scrollbars=' + scrll);
    }
    function mOver(navTD, caption){if (!navTD.contains(event.fromElement)) {navTD.style.backgroundColor='#99cc99';window.status=caption;}}
    function mOut(navTD, caption){if (!navTD.contains(event.toElement)) {navTD.style.backgroundColor=arguments[2];window.status=caption;}}

    function init()
    {
      countycodeSelected = document.form_search.countycode.selectedIndex;
      loadCities();
    }

    function killCities()
    {
      var obj = eval('document.form_search.elements["' + "c[]" + '"]');
      var cnt = obj.length;
      var j;

      for (j=cnt; j > -1; j--)
      {
        obj.options[j] = null;
      }
    }

function trs(){
	 for(i=1; i <= 10; i++)
        { document.write("<tr><td>mytext</td></tr>");

         // obj.options[i] = new Option(whichArray[i-1], parseInt(whichArray[i-1]));
        }
	}

function show_feature(){

if(document.getElementById('feature_div').style.display=="block")
{
	document.getElementById('feature_div').style.display="none";
	document.getElementById('price-hi').style.display="Block";
	document.getElementById('tot-bath-lo').style.display="Block";
	
	try
	{
		document.getElementById('home-style').style.display="Block";
		document.getElementById('garage-cap-lo').style.display="Block";
	}
	catch(ex)
	{
	}
	//document.getElementById('price_from').style.visibility="visible";
	//document.getElementById('price_to').style.visibility="visible";
	
	
	}
else	

{
document.getElementById('feature_div').style.display="Block";
document.getElementById('price-hi').style.display="none";
document.getElementById('tot-bath-lo').style.display="none";


	try
	{
			
		document.getElementById('home-style').style.display="none";
		document.getElementById('garage-cap-lo').style.display="none";
	}
	catch(ex)
	{
	}
//document.getElementById('price_to').style.visibility="hidden";
//document.getElementById('price_from').style.visibility="hidden";
}


change_combo_image();


}

function select_zip_codes_2()
{
	limit=500;

	var name="";
	var zip_codes="";
	var zip_length=document.getElementsByName("cities[]").length;
	
	for(i=1;i<limit;i++)
	{
		name="chk_"+(i)+"";
		
        try
		{
			if(document.getElementById(name).checked==true)
			{
			
				
				var values=document.getElementById(name).value;
				
				zip_codes+="zip[]="+values+"&";
			}
		}catch( ex)
		{
			//break;
		}
	}
	
	return zip_codes;

}
function change_combo_image()
{
	
	
	var is_checked=select_zip_codes_2();
	

	if(is_checked=="")
	{
		document.getElementById("img_combobox").src="images/combobox.jpg";
	}
	else
	{
		document.getElementById("img_combobox").src="images/combobox.jpg";
		document.getElementById("img_combobox").src="images/combobox_selected.jpg";
	}
	
}


function over_1(tr_id){
	//document.getElementById(td_id).style.background-color = '#0000FF';
	
	
	var el = document.getElementById(tr_id); 
 var chk = document.getElementById("chk_" + tr_id); 
 var a_href = document.getElementById("a_" + tr_id); 

if(chk.checked==false ) {
  el.style.backgroundColor = "#316AC5"; 
 el.style.color = "#ffffff";
 a_href.style.color = "#ffffff";
 }
	
	}
function out_1(tr_id)
{ 
	//document.getElementById(td_id).style.background-color = '#000000';
	
	var el = document.getElementById(tr_id); 
var chk = document.getElementById("chk_" + tr_id); 
 var a_href = document.getElementById("a_" + tr_id); 

if(chk.checked==false ) {
  el.style.backgroundColor = "#ffffff"; 
   el.style.color = "#737373";
   a_href.style.color ="#737373";
   } 

	}
	
	
	
function select_city(link_id){
	
	
	var el = document.getElementById("row_"+ link_id); 
	var chk = document.getElementById("chk_" + link_id); 
	
	
	if(chk.checked==false ) 
{chk.checked=true;
	el.style.backgroundColor = "#E2C15D";
 //el.style.color = "#737373"; 
}else if(chk.checked==true ) 
{chk.checked=false;
	el.style.backgroundColor = "#FFFFFF";
 //el.style.color = "#737373"; 
}
	
	}
	
	
		
function select_city_bycheck(link_id){
	
	var el = document.getElementById("row_"+ link_id); 
	var chk = document.getElementById("chk_" + link_id); 
	
	
	
	if(chk.checked==true ) 
{
	el.style.backgroundColor = "#E2C15D";
 //el.style.color = "#737373"; 
}else if(chk.checked==false ) 
{
	el.style.backgroundColor = "#FFFFFF";
 //el.style.color = "#737373"; 
}
	
	}
	
	
	function show_hide_combobox()
	{
		
			//document.getElementById('feature_div').style.display="none";
			//document.getElementById('price-hi').style.display="block";
			//document.getElementById('tot-bath-lo').style.display="block";
			
			try
			{
				//document.getElementById('home-style').style.display="Block";
				//document.getElementById('garage-cap-lo').style.display="Block";
			}
			catch(ex)
			{
			}
	
	}
	
	
	 function loadCities_new()
    { 

		 //show_hide_combobox();
   		deleteRow("table_items");
		
      //setup the form object to get the cities
	  var selected_index=document.form_search.countycode.options[document.form_search.countycode.selectedIndex].value;
	  
    	whichArray = eval('city' +selected_index ); //find the array to insert
    
	// var inrhtml=new Array();
var inrhtml;
inrhtml="";
       //create_first_row();
 // document.getElementById("feature_div").innerHTML="<table style='width:200px;'><tr><td>Hellow wrold</td></tr>";
	        for(i=1; i <= whichArray.length; i++){
				var  city_name = whichArray[i-1];

		var  city_zip = parseInt(whichArray[i-1]);
		
		add_city(city_zip,city_name,i);
         
	
	   } 
  
  document.form_search.zip[0].selected = "1";
  
	
	//change_combo_image();

}
	
	
	



    function launchMap()
    {
      obj = document.form_search.countycode;
      whch = obj.options[obj.selectedIndex].value;
      st   = document.form_search.state.value;
      openHelpWin('/maps/'+ st +'/' + whch + '00.wfr',450,550,1,'map');
    }

    function setThis(setWhat)
    {
      dafield = document.form_search.elements['c[]'];

      dafield.options[0].selected = false;
      for (i =0; i < dafield.options.length; i++)
      {
        if (dafield.options[i].value == setWhat)
          dafield.options[i].selected = true;
      }
      //window.alert(dafield.options.length);
    }

    function unsetThis()
    {
      dafield = document.form_search.elements['c[]'];
      for (i =0; i < dafield.options.length; i++)
      {
        dafield.options[i].selected = false;
      }
    }
	
	
	 function add_city(city_zip,city_name,row_id) {
		 zip_combo = document.form_search.zip;
		
      	//var newOpt =document.createElement('option');
    //	newOpt.text = city_name;
		//newOpt.value =city_zip;
		//zip_combo.appendChild(newOpt);
		
			 var opt = zip_combo.options;
			 opt[0] = new Option("No Preference","0");
			 var opt = zip_combo.options;
			for(var i=1;i<opt.length;i++){
			if(opt[i].value==city_zip){
			return;
			}
			}
			opt[opt.length] = new Option(city_name, city_zip);

            
			
    }


function remove_cities(table_id)
{
	
	 var Node1 = document.getElementById(table_id); 
      var len = Node1.childNodes.length;
      
       for(var i = 0; i < len; i++)
       {     
	   			
                	Node1.removeChild(Node1.childNodes[i]);
				
	   }		
	   
		
}





  function deleteRow(tableID) 
  {   		zip_combo = document.form_search.zip;
			var opt = zip_combo.options;
			for(var i=0;i<opt.length;i++)
			{
			zip_combo.remove(0); 
			}
  
  }  
		
function show_hide_row(row_id)
{
	if(document.getElementById(row_id).style.display=="")
	{
		document.getElementById(row_id).style.display="none";
	}
	else
	{
		document.getElementById(row_id).style.display="";
	}
}
		
function loadCities_new_2()
    { 

		 //show_hide_combobox();
		
   		deleteRow_2();
		
      //setup the form object to get the cities
	  var selected_index=document.idx_deatail_search_form.countycode.options[document.idx_deatail_search_form.countycode.selectedIndex].value;
	  
    	whichArray = eval('city' +selected_index ); //find the array to insert
    
	// var inrhtml=new Array();
var inrhtml;
inrhtml="";
       //create_first_row();
 // document.getElementById("feature_div").innerHTML="<table style='width:200px;'><tr><td>Hellow wrold</td></tr>";
	        for(i=1; i <= whichArray.length; i++){
				var  city_name = whichArray[i-1];

		var  city_zip = parseInt(whichArray[i-1]);
		
		add_city_2(city_zip,city_name,i);
         
	
	   } 
  
  document.idx_deatail_search_form.zip[0].selected = "1";
  
	
	//change_combo_image();

}

function deleteRow_2() 
  {   		
  
  zip_combo = document.idx_deatail_search_form.zip;
			var opt = zip_combo.options;
		
			for(var i=0;i<opt.length;i++)
			{
			zip_combo.remove(0); 
			
			}
  
  }  
  
   function add_city_2(city_zip,city_name,row_id) {
		 zip_combo = document.idx_deatail_search_form.zip;
		
      	//var newOpt =document.createElement('option');
    //	newOpt.text = city_name;
		//newOpt.value =city_zip;
		//zip_combo.appendChild(newOpt);
		
			 var opt = zip_combo.options;
			 opt[0] = new Option("No Preference","0");
			 var opt = zip_combo.options;
			for(var i=1;i<opt.length;i++){
			if(opt[i].value==city_zip){
			return;
			}
			}
			opt[opt.length] = new Option(city_name, city_zip);

            
			
    }
