function changeview()
{
var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }
  xmlHttp.onreadystatechange=function()
    {
    if(xmlHttp.readyState==4)
      {
        document.searchpro.suggestion.options.length=0;
        
        var aftersplit = xmlHttp.responseText.split("&&");
        var thequery = aftersplit[1].split("|");
        for(i = 0;i <= aftersplit[0];i++){
            var viewid = thequery[i].split("_");
            document.searchpro.suggestion.options[i] = new Option(viewid[1], viewid[0]);
        }        
        
      } else {
        document.searchpro.suggestion.options.length=0;
        document.searchpro.suggestion.options[0] = new Option('Loading', '');
      }
    }
  
  var id = document.searchpro.view.options[document.searchpro.view.selectedIndex].value;
  xmlHttp.open("GET","http://www.justpure.co.za/php/changeview.php?id=" + id,true);
  xmlHttp.send(null);
  
}
