// *****************************************************************************
// This code will select the style sheet to load based on the width of the page.

var v_css = document.createElement('link');
v_css.rel = 'stylesheet';
v_css.type = 'text/css';

if(r_width == 700) {

  v_css.href = 'http://www.ProAgentWebsites.com/search_narrow.css';  

} else {

  v_css.href = 'http://www.ProAgentWebsites.com/search.css';  

}

document.getElementsByTagName('head')[0].appendChild(v_css);

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

var initialized   = false;

function setFocus() {
}

function UpdateCount() {

	if(!initialized)
	  return;

    var myFrame        = count;
	var f_cities       = document.home_search.allcities;
    var t_cities       = myFrame.document.getcount.allcities;
	var f_county       = document.home_search.allcounty;
    var t_county       = myFrame.document.getcount.county;
    var f_htype        = document.home_search.htype;
    var t_htype        = myFrame.document.getcount.htype;
    var f_price_lo     = document.home_search.price_lo;
    var t_price_lo     = myFrame.document.getcount.price_lo;
    var f_price_hi     = document.home_search.price_hi;
    var t_price_hi     = myFrame.document.getcount.price_hi;
    var f_year         = document.home_search.year;
    var t_year         = myFrame.document.getcount.year;
    var f_acres_lo     = document.home_search.acres_lo;
    var t_acres_lo     = myFrame.document.getcount.acres_lo;
    var f_style        = document.home_search.style;
    var t_style        = myFrame.document.getcount.style;
    var f_tot_bed_lo   = document.home_search.tot_bed_lo;
    var t_tot_bed_lo   = myFrame.document.getcount.tot_bed_lo;
    var f_tot_bath_lo  = document.home_search.tot_bath_lo;
    var t_tot_bath_lo  = myFrame.document.getcount.tot_bath_lo;
    var f_tot_sqft_lo  = document.home_search.tot_sqft_lo;
    var t_tot_sqft_lo  = myFrame.document.getcount.tot_sqft_lo;
    var f_garage       = document.home_search.garage;
    var t_garage       = myFrame.document.getcount.garage;
    var f_ele_school   = document.home_search.ele_school;
    var t_ele_school   = myFrame.document.getcount.ele_school;
    var f_jr_school    = document.home_search.jr_school;
    var t_jr_school    = myFrame.document.getcount.jr_school;
    var f_high_school  = document.home_search.high_school;
    var t_high_school  = myFrame.document.getcount.high_school;
    var t_saletype     = myFrame.document.getcount.saletype;
    var f_mastermain   = document.home_search.mastermain;
    var t_mastermain   = myFrame.document.getcount.mastermain;
    var f_golf         = document.home_search.golf;
    var t_golf         = myFrame.document.getcount.golf;
    var f_horse        = document.home_search.horse;
    var t_horse        = myFrame.document.getcount.horse;
    var f_sortby       = document.home_search.sortby;
    var t_sortby       = myFrame.document.getcount.sortby;
    var f_view         = document.home_search.view;
    var t_view         = myFrame.document.getcount.view;
    var f_water        = document.home_search.water;
    var t_water        = myFrame.document.getcount.water;
    var f_oncoast      = document.home_search.oncoast;
    var t_oncoast      = myFrame.document.getcount.oncoast;

	myFrame.document.getcount.cord_n.value   = "";
	myFrame.document.getcount.cord_s.value   = "";
	myFrame.document.getcount.cord_e.value   = "";
	myFrame.document.getcount.cord_w.value   = "";
	myFrame.document.getcount.zoom_lvl.value = "";

	t_oncoast.value     = f_oncoast.value;
	t_view.value        = f_view.value;
	t_water.value       = f_water.value;
    t_sortby.value      = f_sortby.value;
	t_cities.value      = f_cities.value;
	t_htype.value       = f_htype.value;
    t_price_lo.value    = f_price_lo.value;
    t_price_hi.value    = f_price_hi.value;
    t_year.value        = f_year.value;
    t_acres_lo.value    = f_acres_lo.value;
    t_style.value       = f_style.value;
    t_tot_bed_lo.value  = f_tot_bed_lo.value;
    t_tot_bath_lo.value = f_tot_bath_lo.value;
    t_tot_sqft_lo.value = f_tot_sqft_lo.value;
    t_garage.value      = f_garage.value;
    t_ele_school.value  = f_ele_school.value;
    t_jr_school.value   = f_jr_school.value;
    t_high_school.value = f_high_school.value;
    t_county.value      = f_county.value;

    t_saletype.value   = 'A';
    t_mastermain.value = 'F';
    t_golf.value       = 'F';
    t_horse.value      = 'F';
    t_view.value       = 'F';
    t_water.value      = 'F';
    t_oncoast.value    = 'F';

    if(document.home_search.saletype[1].checked)
      t_saletype.value = 'P';
    else if(document.home_search.saletype[2].checked)
      t_saletype.value = 'N';
    else if(document.home_search.saletype[3].checked)
      t_saletype.value = 'F';
    else if(document.home_search.saletype[4].checked)
      t_saletype.value = 'H';
      
    if(f_mastermain.checked)
      t_mastermain.value = 'T';

	if(f_golf.checked)
	  t_golf.value = 'T';
	  
	if(f_horse.checked)
	  t_horse.value = 'T';

	if(f_view.checked)
	  t_view.value = 'T';

	if(f_water.checked)
	  t_water.value = 'T';

	if(f_oncoast.checked)
	  t_oncoast.value = 'T';
	  
	myFrame.document.getcount.submit();
}

