

 var req;

  var which;
var id;
var loc;
var go;
go = 0; 
  function retrieveURL(url) {
  
 // alert ("before deciding browser");
 // req=null
// code for Mozilla, etc.
if (window.XMLHttpRequest)
  {
  req=new XMLHttpRequest();
 // alert (" browser is mozilla");
  }
// code for IE
else if (window.ActiveXObject)
  {
  req = new ActiveXObject("Microsoft.XMLHTTP");  
 // alert (" browser is I.E");
 }

  

var temprentmin;
var temprentmax;
var tempbeds;
var tempactype;
var tempcotype;
var tempelec;
var tempgas;
var tempwater;
var temptelephone;
var tempownres;
var tempmeal;
var tempdist;
var tempsd;
var tempdg;
var temppdg;
var tempch;
var tempba;
var tempsh;
var tempwm;
var temptd;
var tempwd;
var tempdw;
var tempff;
var tempmi;
var temptv;
var tempvi;
var tempte;
var tempina;
var templo;
var tempdr;
var tempgd;
var tempga;
var locat;


temprentmin= document.form1.rentmin.options[document.form1.rentmin.options.selectedIndex].value;
temprentmax= document.form1.rentmax.options[document.form1.rentmax.options.selectedIndex].value;
tempbeds   = document.form1.beds.options[document.form1.beds.options.selectedIndex].value;
tempactype = document.form1.actype.options[document.form1.actype.options.selectedIndex].value;
tempcotype = document.form1.cotype.options[document.form1.cotype.options.selectedIndex].value;
tempelec   = document.form1.elec.options[document.form1.elec.options.selectedIndex].value;
tempgas    = document.form1.gas.options[document.form1.gas.options.selectedIndex].value;
tempwater  = document.form1.water.options[document.form1.water.options.selectedIndex].value;
temptelephone = document.form1.telephone.options[document.form1.telephone.options.selectedIndex].value;
tempownres= document.form1.ownres.options[document.form1.ownres.options.selectedIndex].value;
tempmeal   = document.form1.meal.options[document.form1.meal.options.selectedIndex].value;
tempdist   = document.form1.dist.options[document.form1.dist.options.selectedIndex].value;
tempsd = document.form1.sd.options[document.form1.sd.options.selectedIndex].value;
tempdg = document.form1.dg.options[document.form1.dg.options.selectedIndex].value;
temppdg= document.form1.pdg.options[document.form1.pdg.options.selectedIndex].value;
tempch = document.form1.ch.options[document.form1.ch.options.selectedIndex].value;
tempba = document.form1.ba.options[document.form1.ba.options.selectedIndex].value;
tempsh = document.form1.sh.options[document.form1.sh.options.selectedIndex].value;
tempwm = document.form1.wm.options[document.form1.wm.options.selectedIndex].value;
temptd = document.form1.td.options[document.form1.td.options.selectedIndex].value;
tempwd = document.form1.wd.options[document.form1.wd.options.selectedIndex].value;
tempdw = document.form1.dw.options[document.form1.dw.options.selectedIndex].value;
tempff = document.form1.ff.options[document.form1.ff.options.selectedIndex].value;
tempmi = document.form1.mi.options[document.form1.mi.options.selectedIndex].value;
temptv = document.form1.tv.options[document.form1.tv.options.selectedIndex].value;
tempvi = document.form1.vi.options[document.form1.vi.options.selectedIndex].value;
tempte = document.form1.te.options[document.form1.te.options.selectedIndex].value;
tempina = document.form1.ina.options[document.form1.ina.options.selectedIndex].value;
templo = document.form1.lo.options[document.form1.lo.options.selectedIndex].value;
tempdr = document.form1.dr.options[document.form1.dr.options.selectedIndex].value;
tempgd = document.form1.gd.options[document.form1.gd.options.selectedIndex].value;
tempga = document.form1.ga.options[document.form1.ga.options.selectedIndex].value;
locat = document.form1.location.options[document.form1.location.options.selectedIndex].value;


     

  //alert(document.form1.season.selectedIndex);
  
loc = url+ "?min="+ temprentmin + "&max=" + temprentmax  +"&bed=" + tempbeds  +"&actype=" + tempactype  +""  ;
loc = loc+ "&cot="+ tempcotype +"" ;
loc = loc+ "&elec="+ tempelec +"" ;
loc = loc+ "&gas="+ tempgas +"" ;
loc = loc+ "&water="+ tempwater +"" ;
loc = loc+ "&telephone="+ temptelephone +"" ;
loc = loc+ "&ownres="+ tempownres +"" ;
loc = loc+ "&meal="+ tempmeal +"" ;
loc = loc+ "&dist="+ tempdist +"" ;
loc = loc+ "&sd="+ tempsd +"" ;
loc = loc+ "&dg="+ tempdg +"" ;
loc = loc+ "&pdg="+ temppdg +"" ;
loc = loc+ "&ch="+ tempch +"" ;
loc = loc+ "&ba="+ tempba +"" ;
loc = loc+ "&sh="+ tempsh +"" ;
loc = loc+ "&wm="+ tempwm +"" ;
loc = loc+ "&td="+ temptd +"" ;
loc = loc+ "&wd="+ tempwd +"" ;
loc = loc+ "&dw="+ tempdw +"" ;
loc = loc+ "&ff="+ tempff +"" ;
loc = loc+ "&mi="+ tempmi +"" ;
loc = loc+ "&tv="+ temptv +"" ;
loc = loc+ "&vi="+ tempvi +"" ;
loc = loc+ "&te="+ tempte +"" ;
loc = loc+ "&ina="+ tempina +"" ;
loc = loc+ "&lo="+ templo +"" ;
loc = loc+ "&dr="+ tempdr +"" ;
loc = loc+ "&gd="+ tempgd +"" ;
loc = loc+ "&ga="+ tempga +"" ; 
loc = loc+ "&la="+ locat +"" ; 
 
// alert(loc);
 req.onreadystatechange = pChange;

        req.open("GET", loc, true);
 
        req.send(null);
   

    

  }

 

  function pChange() {
  //alert("im in the pchange");
  
  if (req.readyState == 1) { 
  parent.document.getElementById('main').innerHTML = "<center><table width=100% border=0 align=center valign=middle><tr><td height=300><center><img src='main_files/ajax-loader.gif'>... Loading ... this could take a few mins !</td></tr></table></center>";


}
   if (req.readyState == 4) { // Complete

      if (req.status == 200) { // OK response


     parent.document.getElementById('main').innerHTML = req.responseText ; 

      } else {
alert ( " timed out");
           }

    }

  }




