var xmlHttp

function winecounter(totalw)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="wine-count.asp";
url=url+"?winetype="+document.forms['adv_search'].winetype.options[document.forms['adv_search'].winetype.selectedIndex].value;
url=url+"&totalw="+totalw;
url=url+"&country="+document.forms['adv_search'].country.options[document.forms['adv_search'].country.selectedIndex].value;
url=url+"&grape="+document.forms['adv_search'].grape.options[document.forms['adv_search'].grape.selectedIndex].value;
url=url+"&pricerange="+document.forms['adv_search'].pricerange.options[document.forms['adv_search'].pricerange.selectedIndex].value;

//alert(url);

xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("winecountertxt").innerHTML=xmlHttp.responseText;
}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}



sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

