var initialized = false;
var xMousePos = 0; 
var yMousePos = 0; 

if(document.layers) 
  { 
  document.captureEvents(Event.MOUSEMOVE);
  document.onmousemove = captureMousePosition;
  }
else 
  { 
  document.onmousemove = captureMousePosition;
  } 

function captureMousePosition(e) {
  
  if(document.all) 
    {
    var mm = document.getElementById('myMap');

    xMousePos = event.x + mm.offsetLeft; 
    yMousePos = event.y + mm.offsetTop;
    } 
  else 
    {
    xMousePos = e.pageX;
    yMousePos = e.pageY;
    }
}

function ResetCounty() {

	if(!initialized)
	  return;

    var myFrame    = count;
	var f_county   = document.home_search.selcounty;
    var t_county   = myFrame.document.getcount.county;
	t_county.value = f_county.value;

	if(t_county.value != "na")
	  UpdateCount();
}

function UpdateCount() {

	if(!initialized)
	  return;

    var myFrame        = count;
	var f_cord_n       = document.home_search.cord_n;
    var t_cord_n       = myFrame.document.getcount.cord_n;
	var f_cord_s       = document.home_search.cord_s;
    var t_cord_s       = myFrame.document.getcount.cord_s;
	var f_cord_e       = document.home_search.cord_e;
    var t_cord_e       = myFrame.document.getcount.cord_e;
	var f_cord_w       = document.home_search.cord_w;
    var t_cord_w       = myFrame.document.getcount.cord_w;
	var f_zoom_lvl     = document.home_search.zoom_lvl;
    var t_zoom_lvl     = myFrame.document.getcount.zoom_lvl;
    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_bgcolor      = myFrame.document.getcount.bgcolor;

	myFrame.document.getcount.cities.value   = "";

	LoadCords();
      
	t_cord_n.value      = f_cord_n.value;
	t_cord_s.value      = f_cord_s.value;
	t_cord_e.value      = f_cord_e.value;
	t_cord_w.value      = f_cord_w.value;
	t_zoom_lvl.value    = f_zoom_lvl.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_bgcolor.value     = countBG;

	myFrame.document.getcount.submit();
}

