﻿// JScript File
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;
}

function stateChanged() 
{ 
//if (xmlHttp.readyState==1)
//{
//document.getElementById("loading").style.display='block';
//document.getElementById("center_list").innerHTML='Loading';
//}
if (xmlHttp.readyState==4)
{ 
//if(xmlHttp.status==200)
//{
//document.getElementById("loading").style.display='none';

if (document.getElementById("ctl01_Leftcol1_QuickLinks")) {
    document.getElementById("ctl01_Leftcol1_QuickLinks").innerHTML=xmlHttp.responseText;

}

try
{

document.getElementById("Leftcol1_QuickLinks").innerHTML=xmlHttp.responseText;
}
catch (e)
{
document.getElementById("ctl02_Leftcol1_QuickLinks").innerHTML=xmlHttp.responseText;
}
//}
//}
}
}

var xmlHttp;

function LoadQuickLinks()
{

var country;
var colours;
var grapes;
var priceRange;


country = document.getElementById("country").value;
colour = document.getElementById("colour").value;
grape = document.getElementById("grape").value;
range = document.getElementById("price").value;
   
str = '?country=' + country;
str = str + '&colour=' + colour;
str = str + '&grape=' + grape;
str = str + '&range=' + range;

if (str.length==0)
  { 
  document.getElementById("txtHint").innerHTML="";
  return;
  }
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url = "/handlers/quickLinks.ashx";
url = url + str;


xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
} 
