

var trip = "F";

function resetTrip(tripset) {
        if (tripset == "F"){
        trip="F";}
}


function getAddressv1(ctrlFrom,ctrlTo,ctrlTxt,ctrlTxtHid,ctrlLbl,myid) {
        var xmlHttpReq;
        var strUrl,results,freetext,rst,cnt;
        var organ,line1,line2,line3,line4,town,county,postcode,pcode;
        var organ_nd,line1_nd,line2_nd,line3_nd,line4_nd,town_nd,county_nd,postcode_nd;
        var adid,addesc,adlist,ctrlHidPostcode;
        var lblBno,ctrlBno,strt,searchbox,adoid,addid,adcombid,adcombidval;
        var adoid_nd,addid_nd;
        
        ctrlHidPostcode=document.frm_booking.hdPostcodeFrom;
        lblBno = "lblBnoFrom";
		ctrlBno = "txtBnoFrom";
		strt = "ftfhid";
		searchbox="ftf";
		ctrladoid="hidadoidFrom"
		ctrladdid="hidaddidFrom"

        if (ctrlTxt == "txtDestination"){trip="T";}
 
		if (myid==0) {
        freetext=ctrlFrom.value;
        adid="0";
        adoid="0";
        addid="0";
		}
		else {
		adlist = document.frm_Journey.slcAdrec;
		adcombidval = adlist.options[adlist.selectedIndex].value;
		freetext = adlist.options[adlist.selectedIndex].text; 
		
		adcombid = adcombidval.split("|");
		adid = adcombid[0];
		adoid = adcombid[1];
		addid = adcombid[2];
		//adid=parseInt(adid);
		//adoid=parseInt(adoid);
		//addid=parseInt(addid);
		//myid = adid;
		//freetext="0"
		}
        
        
        strUrl = "getaddress.asp?adid=" + adid + "&adoid=" + adoid + "&addid=" + addid + "&ft=" + freetext
        myRand = parseInt(Math.random()*99999999999999);
        strUrl = strUrl +"&mr="+myRand;

		//alert(strUrl);

        if (window.XMLHttpRequest) {
        	
        	try {
			xmlHttpReq = new XMLHttpRequest();
			xmlHttpReq.overrideMimeType('text/xml');
		    }
			catch(err1)
		    {
		    	try {
		    	    xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
		    	    }
		    	catch(err2) {
		    	    xmlHttpReq = new ActiveXObject("Msml2.XMLHTTP");
		    	    }
		    }
                
        }
        // IE
        else if (window.ActiveXObject) {
                xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
        }
		
		xmlHttpReq.open('GET', strUrl, true);
       
        xmlHttpReq.onreadystatechange = function() {
			if (xmlHttpReq.readyState == 4) {
			//alert("here");
				if (xmlHttpReq.status == 200) {
				rst = xmlHttpReq.responseXML.getElementsByTagName("rst")[0].childNodes[0].nodeValue;
				
					if (rst == 1) {
				
					organ_nd = xmlHttpReq.responseXML.getElementsByTagName("organ")[0];
					line1_nd = xmlHttpReq.responseXML.getElementsByTagName("line1")[0];
					line2_nd = xmlHttpReq.responseXML.getElementsByTagName("line2")[0];
					line3_nd = xmlHttpReq.responseXML.getElementsByTagName("line3")[0];
					line4_nd = xmlHttpReq.responseXML.getElementsByTagName("line4")[0];
					town_nd = xmlHttpReq.responseXML.getElementsByTagName("town")[0];
					county_nd = xmlHttpReq.responseXML.getElementsByTagName("county")[0];
					postcode_nd = xmlHttpReq.responseXML.getElementsByTagName("postcode")[0];
					adoid_nd = xmlHttpReq.responseXML.getElementsByTagName("adoid")[0];
					addid_nd = xmlHttpReq.responseXML.getElementsByTagName("addid")[0];
					//alert("rst" + rst);
			
					//rstval=rst.childNodes[0].nodeValue;
					if (organ_nd.childNodes[0]){organ=organ_nd.childNodes[0].nodeValue;}else{organ="";}
					if (line1_nd.childNodes[0]){line1=line1_nd.childNodes[0].nodeValue;}else{line1="";}
					if (line2_nd.childNodes[0]){line2=line2_nd.childNodes[0].nodeValue;}else{line2="";}
					if (line3_nd.childNodes[0]){line3=line3_nd.childNodes[0].nodeValue;}else{line3="";}
					if (line4_nd.childNodes[0]){line4=line4_nd.childNodes[0].nodeValue;}else{line4="";}
					if (town_nd.childNodes[0]){town=town_nd.childNodes[0].nodeValue;}else{town="";}
					if (county_nd.childNodes[0]){county=county_nd.childNodes[0].nodeValue;}else{county="";}
					if (postcode_nd.childNodes[0]){postcode=postcode_nd.childNodes[0].nodeValue;}else{postcode="";}
					if (adoid_nd.childNodes[0]){adoid=adoid_nd.childNodes[0].nodeValue;}else{adoid=0;}
					if (addid_nd.childNodes[0]){addid=addid_nd.childNodes[0].nodeValue;}else{addid=0;}
					
					//alert(line1);
					
					cnt=""
					if (organ != ""){cnt=organ + ", ";}
					if (line1 != ""){cnt=cnt + line1 + ", ";}
					if (line2 != ""){cnt=cnt + line2 + ", ";}
					if (line3 != ""){cnt=cnt + line3 + ", ";}
					if (line4 != ""){cnt=cnt + line4 + ", ";}
					if (town != ""){cnt=cnt + town + ", ";}
					if (county != ""){cnt=cnt + county + ", ";}
					//if (postcode != ""){cnt=cnt + postcode;}
					if (postcode != "") {
					pcode = postcode.substring(0,(postcode.indexOf(" ")))
					}
					else{
					pcode="0"
					}
					
					if (trip == "T") {
					ctrlLbl="lblDestination";
					ctrlTo=document.frm_Journey.hdpcodeto;
					ctrlTxtHid=document.frm_booking.hidDestinationDesc;
					ctrlTxt="txtDestination";
					ctrlHidPostcode=document.frm_booking.hdPostcodeTo;
					lblBno = "lblBnoTo";
					ctrlBno = "txtBnoTo";
					strt = "ftthid";
					searchbox="ftt";
					ctrladoid="hidadoidTo"
					ctrladdid="hidaddidTo"
					}
					
					//alert(lblBno);
				
					dom = findDOM(ctrlLbl,1);
					dom.visibility='visible';
					
					//alert(ctrlLbl);
					
					ctrlTo.value=pcode;
					ctrlHidPostcode.value=postcode;
					ctrlTxtHid.value=cnt;
					document.getElementById(ctrlTxt).innerHTML=cnt;
					document.getElementById(strt).value=cnt;
					document.getElementById(searchbox).value=cnt;
					document.getElementById(ctrladoid).value=adoid;
					document.getElementById(ctrladdid).value=addid;
					
					
					dom = findDOM(lblBno,1);
					dom.visibility='visible';
					
					
					if (cnt.indexOf("irport") > 0 || cnt.indexOf("IRPORT") > 0) {
					//alert(cnt.indexOf("irport"));
					document.getElementById(lblBno).innerHTML="Terminal";
					}
					else {
					document.getElementById(lblBno).innerHTML="House No";
					}
					
					dom = findDOM(ctrlBno,1);
					dom.visibility='visible';
					
					//alert(dom);
					
					dom = findDOM("slcAdrec",1);
					dom.visibility='hidden';
					
					dom = findDOM("lblPickAdrec",1);
					dom.visibility='hidden';
					
					if (trip=="F") {
					flightCheckAd(cnt);
					getPostcodeLatLong(postcode,1);
					}
					else {
					getPostcodeLatLong(postcode,2);
					}
					
					
				
					//alert(document.frmQ.hdpcode.value);
				
					}
					else if (rst==2) {
					
					dom = findDOM("slcAdrec",1);
					dom.visibility='visible';
					
					dom = findDOM("lblPickAdrec",1);
					dom.visibility='visible';
					
					document.frm_Journey.slcAdrec.options.length=0;
					
					var adidnodes,i,newad,slcctrl,adoidnodes,addidnodes;
					
					adidnodes = xmlHttpReq.responseXML.getElementsByTagName("adid");
					addescnodes = xmlHttpReq.responseXML.getElementsByTagName("addesc");
					adoidnodes = xmlHttpReq.responseXML.getElementsByTagName("adoid");
					addidnodes = xmlHttpReq.responseXML.getElementsByTagName("addid");
					

						for(i=0;i<adidnodes.length;i++)
						{
						adid = adidnodes[i].childNodes[0].nodeValue;
						addesc = addescnodes[i].childNodes[0].nodeValue;
						adoid=adoidnodes[i].childNodes[0].nodeValue;
						addid=addidnodes[i].childNodes[0].nodeValue;
						
						adcombid=adid + "|" + adoid + "|" + addid
						
						newad=new Option(addesc,adcombid,false,false)
						
						slcctrl=document.frm_Journey.slcAdrec;
						slcctrl.options[slcctrl.options.length]=newad;
						
						}
						
					}
						
					else {
					document.getElementById(ctrlTxt).innerHTML="Not Found";
					}
				}
			}
		}
        xmlHttpReq.send(null);


}

function updAddBno(ctrlBno,strt,ctrlTxt,ctrlTxtHid) {
var bno,ctxt,ctxthid,ctxtval,street;

bno=ctrlBno.value;
street=strt.value;
ctxt = document.getElementById(ctrlTxt);
ctxtval=ctxt.innerHTML;

ctxt.innerHTML = bno + " " + street;  // ctxtval
ctrlTxtHid.value = bno + " " + street;
}



function bdu() {

var mntctrl,dayctrl,yearmonth;
var selyear,selmonth,selday; 
var thismonth, whichmonth,thisdate;
var newoption,newval,newtext,tbd,tbdctrl;

//mntctrl = findDOM('slcmonth',1);
//dayctrl = findDOM('slcday',1);
mntctrl = document.getElementById("slcmonth");
dayctrl = document.getElementById("slcday");

yearmonth = mntctrl.options[mntctrl.selectedIndex].value;
selday = dayctrl.options[dayctrl.selectedIndex].value;
//yearmonth = mntctrl.selectedIndex;
//alert(yearmonth);

selyear = yearmonth.substring(0,4);
selmonth = yearmonth.substring(4);
//selmonth = Number(yearmonth.substring(4));
tbdctrl=document.getElementById("txtBD");
tbd=tbdctrl.value;

tbd=selday + "-" + selmonth + "-" + selyear;
tbdctrl.value=tbd;

txaUpd(document.frm_bDate.txtBD,'txtDate',document.frm_booking.hidDate);
showLabel('lblDate');
}


function monthdays() {

var mntctrl,dayctrl,yearmonth,seldate,seldw;
var selyear,selmonth,selwdname; 
var selday = 1;
var thismonth, whichmonth,thisdate;
var newoption,newval,newtext,tbd,tbdctrl;

//mntctrl = findDOM('slcmonth',1);
//dayctrl = findDOM('slcday',1);
mntctrl = document.getElementById("slcmonth");
dayctrl = document.getElementById("slcday");

yearmonth = mntctrl.options[mntctrl.selectedIndex].value;
//yearmonth = mntctrl.selectedIndex;
//alert(yearmonth);

selyear = Number(yearmonth.substring(0,4));
selmonth = Number(yearmonth.substring(4))-1;
//selmonth = Number(yearmonth.substring(4));


//alert(selmonth);

thisdate = new Date();
thismonth = thisdate.getMonth();


if (thismonth == selmonth) {
selday = thisdate.getDate();
}

whichmonth = selmonth;
//alert(selyear);
//alert(selmonth);

seldate = new Date();
//alert(seldate);
seldate.setFullYear(selyear);
seldate.setMonth(selmonth,selday);


dayctrl.options.length = 0;
//start loop
while (selmonth == whichmonth) {

//alert(seldate);

selday = seldate.getDate();
selwd= seldate.getDay();
//alert(selwd);

switch (selwd) {
	case 0 :
		selwdname = "Sun";
		break;
	case 1 :
		selwdname = "Mon";
		break;
	case 2 :
		selwdname = "Tue";
		break;
	case 3 :
		selwdname = "Wed";
		break;
	case 4 :
		selwdname = "Thu";
		break;
	case 5 :
		selwdname = "Fri";
		break;
	case 6 :
		selwdname = "Sat";
	}


//dayctrl.options[0].value = selday;
//dayctrl.options[0].text = selwdname + " " + selday;

newval = selday;
if (newval<10) {newval="0"+newval}
//newtext = selwdname + " " + selday;
newtext = selday;
newoption = new Option(newtext,newval,false,false);
dayctrl.options[dayctrl.options.length]= newoption;

selday++ ;// = selday + 1
seldate.setDate(selday);
whichmonth = seldate.getMonth();
//alert(selday);
//alert(whichmonth);
} 
//end loop

}


function updDate() {

var dtval,dayval,ymval,i,ctrlday,ctrlym;
//alert("Hello");
//alert(document.forms.booking.txtBD.value);

dtval=document.forms.frm_bDate.txtBD.value;

dayval=dtval.substr(0,2);
//alert(dayval);

ymval=dtval.substr(6,4) + dtval.substr(3,2)
//alert(ymval);

ctrlym=document.forms.frm_bDate.slcmonth
ctrlday=document.forms.frm_bDate.slcday

for(i=0;i<ctrlym.options.length;i++) {
if (ctrlym.options[i].value == ymval) {
	ctrlym.options[i].selected = "selected";
	monthdays();
	}
}

//alert(ctrlday.options.length);

for(i=0;i<ctrlday.options.length;i++) {
if (ctrlday.options[i].value == dayval) {
	ctrlday.options[i].selected = "selected";
	}
//else {alert(ctrlday.options[i].value);}
}

txaUpd(document.frm_bDate.txtBD,'txtDate',document.frm_booking.hidDate);
showLabel('lblDate');

}


function cntrlFill(ctrlFrom,ctrlTo,ctrlTxt,ctrlHid,ctrlTxtHid,ctrlLbl) {

var cval,dom,va,i,j,ig,txthidTo,hidTo;

i = ctrlFrom.options[ctrlFrom.selectedIndex].value;
cval = ctrlFrom.options[ctrlFrom.selectedIndex].text; 

ctrlTo.value=cval;

txtTo = document.getElementById(ctrlTxt);
txtTo.innerHTML=cval;

txthidTo = document.getElementById(ctrlTxtHid);
txthidTo.value=cval;

dom = findDOM(ctrlLbl,1);
dom.visibility='visible';

hidTo = document.getElementById(ctrlHid);

hidTo.value=i;

}


function cntrlFillSlc(ctrlFrom,ctrlTxt,ctrlHid,ctrlTxtHid,ctrlLbl) {

var cval,dom,va,i,j,ig,txtTo,hidTo,txthidTo;

i = ctrlFrom.options[ctrlFrom.selectedIndex].value;
cval = ctrlFrom.options[ctrlFrom.selectedIndex].text; 

hidTo = document.getElementById(ctrlHid);
hidTo.value=i;

txtTo = document.getElementById(ctrlTxt);
txtTo.innerHTML=cval;

txthidTo = document.getElementById(ctrlTxtHid);
txthidTo.value=cval;

dom = findDOM(ctrlLbl,1);
dom.visibility='visible';

if (ctrlTxt == "txtVehicle") {
txtTo.innerHTML=cval + " ( <a target='Vehicle' width='500' class='link1' href='vehiclepage.asp?vid=" + i + "'>Check the vehicle</a> )";
}

}


function flightCheck(ctrlFrom) {

var cval,dom,i,x,y,ctrlTo;

i = ctrlFrom.options[ctrlFrom.selectedIndex].value;
cval = ctrlFrom.options[ctrlFrom.selectedIndex].text; 

x=cval.indexOf("irport")
y=cval.indexOf("IRPORT")

if (x>-1 || y>-1) {
ctrlTo = findDOM("flight",1);
ctrlTo.display='inline';
}
else {
ctrlTo = findDOM("flight",1);
ctrlTo.display='none';
}
}

function flightCheckAd(cval) {

var dom,x,y,ctrlTo;

//cval = ctrlFrom.value; 

x=cval.indexOf("irport")
y=cval.indexOf("IRPORT")

if (x>-1 || y>-1) {
ctrlTo = findDOM("flight",1);
ctrlTo.display='inline';
}
else {
ctrlTo = findDOM("flight",1);
ctrlTo.display='none';
}
}


function txaUpd(ctrlFrom,ctrlTxt,ctrlHid) {

var cval,dom,va,i,j,ig,txtTo,hidTo;
cval = ctrlFrom.value; 
txtTo = document.getElementById(ctrlTxt);
txtTo.innerHTML=cval;
ctrlHid.value=cval;

}


function flightDetails(ctrlFrom,ctrlTxt,ctrlHid,lblInfo) {

var cval,exval,updval,dom,txtTo;

cval = ctrlFrom.value; 
txtTo = document.getElementById('ctrlTxt');
updval="<b>" + lblInfo + "</b>: " + cval;
//alert(updval);
txtTo.innerHTML=updval;
ctrlHid.value=cval;

}

function txaFlight (ctrlFrom,ctrlTxt,ctrlHid,lblInfo) {

var cval,exval,updval,dom,txtTo;

cval = ctrlFrom.value; 
txtTo = document.getElementById(ctrlTxt);
exval=txtTo.innerHTML;
updval="<b>" + lblInfo + "</b>: " + cval;
txtTo.innerHTML=updval;
exval=txtTo.innerHTML;
ctrlHid.value=cval;

}

function getFlight() {
var myf
myf = document.getElementById('tdFlight');
//alert(myf.innerHTML);
}

function timeUpd() {

var cval,ctime,campm,dom,ctrlFrom,va,i,j,ig,txtTo,hidTo;

ctrlFrom = document.frm_bDate.slcAmpm;
ctime = document.frm_bDate.txtTime.value; 
campm = ctrlFrom.options[ctrlFrom.selectedIndex].text;
cval = ctime + ' ' + campm
txtTo = document.getElementById("strTime");
txtTo.innerHTML= 'at ' + cval;

document.frm_booking.hidTime.value=cval;

}

function timeUpdSl() {

var cval,cHr,cMin,campm,dom,ctrlFromHr,ctrlFromMin,va,i,j,ig,txtTo,hidTo;

ctrlFromHr = document.frm_bDate.slcHour;
ctrlFromMin = document.frm_bDate.slcMinute;
cHr = ctrlFromHr.options[ctrlFromHr.selectedIndex].text;
cMin = ctrlFromMin.options[ctrlFromMin.selectedIndex].text;
cval = cHr + ':' + cMin
txtTo = document.getElementById("strTime");
txtTo.innerHTML= 'at ' + cval;

cval=cval+':00'

document.frm_booking.hidHour.value=cHr;
document.frm_booking.hidMinute.value=cMin;
document.frm_booking.hidTime.value=cval;

}



function xmlhttpPost(strURL, strSubmit, strResultFunc) {

        var xmlHttpReq = false;
        
        // Mozilla/Safari
        if (window.XMLHttpRequest) {
                xmlHttpReq = new XMLHttpRequest();
                xmlHttpReq.overrideMimeType('text/xml');
        }
        // IE
        else if (window.ActiveXObject) {
                xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
        }
		
		xmlHttpReq.open('POST', strURL, true);
        xmlHttpReq.setRequestHeader('Content-Type', 
		     'application/x-www-form-urlencoded');
        xmlHttpReq.onreadystatechange = function() {
                if (xmlHttpReq.readyState == 4) {
                        eval(strResultFunc + '(xmlHttpReq.responseText;);');
                }
        }
        xmlHttpReq.send(strSubmit);
}


function getCar() {

        var xmlHttpReq,strUrl,results,carDtl,pgrs,fare;
        var carnm,bi,vi,oi,di,ctrlFrom,bp,opostcode,dpostcode,d;
        var adoidFrom,addidFrom,adoidTo,addidTo;
        
        document.getElementById('txtPrice').innerHTML = " ";
        
        bi=document.frm_booking.hidb.value;
        oi=document.frm_booking.hidOrigin.value;
        di=document.frm_booking.hidDestination.value;
        opostcode=document.frm_booking.hdPostcodeFrom.value;
        dpostcode=document.frm_booking.hdPostcodeTo.value;
        d=document.frm_booking.hidDistance.value;
        adoidFrom=document.frm_booking.hidadoidFrom.value;
        addidFrom=document.frm_booking.hidaddidFrom.value;
        adoidTo=document.frm_booking.hidadoidTo.value;
        addidTo=document.frm_booking.hidaddidTo.value;
        
        //alert(d);
        //alert(oi);
        //alert(di);
        //alert(adoidFrom);
        //alert(addidFrom);
        //alert(adoidTo);
        //alert(addidTo);
        //alert(opostcode);
        //alert(dpostcode);
        
        
        ctrlFrom = document.frm_vehicle.slcVehicle;
        vi = ctrlFrom.options[ctrlFrom.selectedIndex].value;
        //alert(vi);
        
        strUrl = "xmlhtgetcarad.asp?bi=" + bi + "&vi=" + vi + "&op=" + opostcode + "&dp=" + dpostcode + "&di=" + di + "&d=" + d
        strUrl = strUrl +"&foid=" + adoidFrom + "&fdid=" + addidFrom + "&toid=" + adoidTo + "&tdid=" + addidTo
        
        myRand = parseInt(Math.random()*99999999999999);
        strUrl = strUrl +"&mr="+myRand;
        // Mozilla/Safari
        //alert(strUrl);
        
        if (window.XMLHttpRequest) {
               	try {
					xmlHttpReq = new XMLHttpRequest();
					xmlHttpReq.overrideMimeType('text/xml');
				    }
				catch(err1)
				    {
				    	try {
				    	    xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
				    	    }
				    	catch(err2) {
				    	    xmlHttpReq = new ActiveXObject("Msml2.XMLHTTP");
				    	    }
		    }
        }
        // IE
        else if (window.ActiveXObject) {
                xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
        }
	
		
		xmlHttpReq.open('GET', strUrl, true);
       
        xmlHttpReq.onreadystatechange = function() {
			if (xmlHttpReq.readyState == 4) {
			
			
				if (xmlHttpReq.status == 200) {
				carDtl = xmlHttpReq.responseText;
				
				//alert(carDtl);
				
				results = carDtl.split("|");
				carnm = results[0];
				pgrs = results[1];
				fare = results[2];
				
				//alert(carnm);
				//alert(pgrs);
				//alert(fare);
				
				fare=parseFloat(fare);
				fare=fare.toFixed(2);
				
				//alert(fare);
				
				document.getElementById('txtVehicle').innerHTML = carnm + " (Max " + pgrs + " passengers)<br>( <a target='Vehicle' width='500' class='link1' href='vehiclepage.asp?vid=" + vi + "'>Check the vehicle</a> )";
				document.getElementById('txtPassengers').value = pgrs;
					
					if (fare>-1) {
						
						if (fare==0) { 
						fare = "Call"; 
						}
					
						document.getElementById('txtPrice').innerHTML = "£"+fare;
						dom = findDOM('lblPrice',1);
						dom.visibility='visible';
						document.getElementById('hidPrice').value = fare;
						dom = findDOM('lblPriceNote',1);
						dom.visibility='visible';
					}
						
					else {
						alert("Unfortunately we can not accept your booking as it is outside the area of our operation. You may wish to visit www.CabBookers.com to find a cab service closer to you.")
						document.frm_booking.hidOrigin.value=0;
						document.frm_booking.hdPostcodeFrom.value="";
						document.frm_Journey.ftf.value="";
						document.frm_Journey.ftt.value="";
					}
					
				}
				
			}
		}
        xmlHttpReq.send(null);
}



function getUser() {

        var xmlHttpReq;
        var strUrl,results,us,ps,sn,snval,bi,ad,adval,cnt,phn,phnval,mbl,mblval,em,emval;
        
       
        bi=document.frm_booking.hidb.value;
        us=document.frm_login.txtUser.value;
        ps=document.frm_login.txtPass.value;
       
        
        strUrl = "xmlhtgetuser.asp?bi=" + bi + "&us=" + us + "&ps=" + ps
        
        myRand = parseInt(Math.random()*99999999999999);
        strUrl = strUrl +"&mr="+myRand;
        
        //alert(strUrl);
        
        if (window.XMLHttpRequest) {
		try {
			xmlHttpReq = new XMLHttpRequest();
			xmlHttpReq.overrideMimeType('text/xml');
		    }
		catch(err1)
		    {
		    	try {
		    	    xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
		    	    }
		    	catch(err2) {
		    	    xmlHttpReq = new ActiveXObject("Msml2.XMLHTTP");
		    	    }
		    };
        }
        // IE
        else if (window.ActiveXObject) {
                xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
        }
		
		xmlHttpReq.open('GET', strUrl, true);
       
        xmlHttpReq.onreadystatechange = function() {
			if (xmlHttpReq.readyState == 4) {
		
				if (xmlHttpReq.status == 200) {
				sn = xmlHttpReq.responseXML.getElementsByTagName("sname")[0];
				ad = xmlHttpReq.responseXML.getElementsByTagName("adr")[0];
				phn = xmlHttpReq.responseXML.getElementsByTagName("phn")[0];
				mbl = xmlHttpReq.responseXML.getElementsByTagName("mbl")[0];
				em = xmlHttpReq.responseXML.getElementsByTagName("em")[0];
				
				
			
				snval=sn.childNodes[0].nodeValue;
				adval=ad.childNodes[0].nodeValue;
				phnval=phn.childNodes[0].nodeValue;
				mblval=mbl.childNodes[0].nodeValue;
				emval=em.childNodes[0].nodeValue;
				
				cnt=snval + "<br>" + adval + "<br><br>" + "<b>Tel: </b>" + phnval + "<br><b>Tel: </b>" + mblval + "<br><b>Email: </b>" + emval +"<br><br>"
				
				document.getElementById('txtContact').innerHTML = cnt;
				
				bookName = findDOM("bookname",1);
				bookName.display='block';
				
				document.frm_login.txtBookname.value=snval;
				document.frm_booking.hidBookname.value=snval;
				//document.frm_booking.submitbp.visibility='visible';
				
				dom = findDOM('submitbp',1);
				dom.visibility='visible';
				
				var bn="<b>Booking Name: </b>" + snval
				document.getElementById('tdBookname').innerHTML=bn;
				
				showLabel('lblContact')
				}
				else {
				}
			}
		}
        xmlHttpReq.send(null);
}


function usehttpresponse() {
	if (xmlHttpReq.readyState == 4) {
		if (xmlHttpReq.status == 200) {
		 var timeValue = xmlHttpReq.responseText;
		 //alert(timeValue);
		}
	}
}


function opwindow(url,wtyp) {
	window.open(url,0,'toolbar=0,directories=0,status=0, menubar=0,scrollbars=0,resizable=1,width=400,height=150,left=250,top=450');
	}
	
function showLabel(ctrlLbl) {
dom = findDOM(ctrlLbl,1);
dom.visibility='visible';
}


function newUser() {
document.frm_booking.action = 'bookingpnu.asp';
document.frm_booking.submit();
}


function changePage(newLoc)
 {
   nextPage = newLoc.options[newLoc.selectedIndex].text
		
   if (nextPage != "")
   {
      //document.location.href = nextPage
      //alert(nextPage);
   }
 }
 