var puLat,puLng,drLat,drLng,tblvclfcs;var vw=new Array;puLat=0;drLat=0;puLng=0;drLng=0;tblvclfcs=0;function odClick(u,odt,wuu){var uvw,vwwu,vwww,vuvu,wvv,wuv,vuvw,vuvv,vwuu;toggleTblprice(0);if(u==1){vwwu="tdorigctrl";vvvv="tblorigctrl";uvw="tblorigadr";vwww="origComment";vuvu="origInstruct";vuvw="tblorigQ";hidODType="hidOrigType";uvvw="origAdrTxtPc";ctrlhidAdrTxt="hidOrigAdress";vvw="tbladlist";}else{vwwu="tddestctrl";vvvv="tbldestctrl";uvw="tbldestadr";vwww="destComment";vuvu="destInstruct";vuvw="tbldestQ";hidODType="hidDestType";uvvw="destAdrTxtPc";ctrlhidAdrTxt="hidDestAdress";vvw="tbladlistDest";}dom=findDOM(vuvw,1);dom.display="none";document.getElementById(uvvw).innerHTML="";document.getElementById(ctrlhidAdrTxt).value="";document.getElementById(hidODType).value=odt;if(odt==-1){var wuw;document.getElementById("txtOrigPostcode").display="none";document.getElementById("btnTxtFrom").display="inline";document.getElementById("txtFrom").display="inline";document.getElementById(vwww).innerHTML="Please enter the street name and/or any part of postcode and click submit.";dom=findDOM(vvvv,1);dom.display="none";dom=findDOM(uvw,1);dom.display="inline";if(u==1){dom=findDOM("rdDstType15",1);dom.display="inline";dom=findDOM("rdDstType16",1);dom.display="inline";dom=findDOM("rdDstType3",1);dom.display="inline";dom=findDOM("rdDstType-1",1);dom.display="inline";}else{dom=findDOM("rdOrgType15",1);dom.display="inline";dom=findDOM("rdOrgType16",1);dom.display="inline";dom=findDOM("rdOrgType3",1);dom.display="inline";dom=findDOM("rdOrgType-1",1);dom.display="inline";}}else if(odt==3){dom=findDOM(vvvv,1);if(dom.display=="none"){dom.display="inline";dom=findDOM(uvw,1);dom.display="none";dom=findDOM(vvw,1);dom.display="none";}if(u==1){wvv="txtOrigPostcode";wuv="txtOrigPostcode";vwuu="btnTxtFrom";vuvv="txtFrom";}else{wvv="txtDestPostcode";wuv="txtDestPostcode";vwuu="btnTxtDestination";vuvv="txtDestination";}document.getElementById(vwwu).innerHTML="<input type='text' name='"+wvv+"' id='"+wuv+"' onblur='getAddressPC("+u+")'>";document.getElementById(wvv).display="inline";document.getElementById(vwuu).display="none";document.getElementById(vuvv).display="none";document.getElementById(vwww).innerHTML="Please enter the full postcode including spaces.<br>Examples; (SW1 9SJ) (N1 9PU).";document.getElementById(vuvu).innerHTML="Enter Postcode";if(u==1){dom=findDOM("rdDstType15",1);dom.display="inline";dom=findDOM("rdDstType16",1);dom.display="inline";dom=findDOM("rdDstType3",1);dom.display="inline";dom=findDOM("rdDstType-1",1);dom.display="inline";}else{dom=findDOM("rdOrgType15",1);dom.display="inline";dom=findDOM("rdOrgType16",1);dom.display="inline";dom=findDOM("rdOrgType3",1);dom.display="inline";dom=findDOM("rdOrgType-1",1);dom.display="inline";}}else{dom=findDOM(vvvv,1);if(dom.display=="none"){dom.display="inline";dom=findDOM(uvw,1);dom.display="none";dom=findDOM(vvw,1);dom.display="none";}if(u==1){wvv="origList";wuv="origList";if(odt==1){dom=findDOM("rdDstType15",1);dom.display="none";dom=findDOM("rdDstType16",1);dom.display="none";dom=findDOM("rdDstType3",1);dom.display="none";dom=findDOM("rdDstType-1",1);dom.display="none";}else{dom=findDOM("rdDstType15",1);dom.display="inline";dom=findDOM("rdDstType16",1);dom.display="inline";dom=findDOM("rdDstType3",1);dom.display="inline";dom=findDOM("rdDstType-1",1);dom.display="inline";}}else{wvv="destList";wuv="destList";if(odt==1){dom=findDOM("rdOrgType15",1);dom.display="none";dom=findDOM("rdOrgType16",1);dom.display="none";dom=findDOM("rdOrgType3",1);dom.display="none";dom=findDOM("rdOrgType-1",1);dom.display="none";}else{dom=findDOM("rdOrgType15",1);dom.display="inline";dom=findDOM("rdOrgType16",1);dom.display="inline";dom=findDOM("rdOrgType3",1);dom.display="inline";dom=findDOM("rdOrgType-1",1);dom.display="inline";}}document.getElementById(vwwu).innerHTML="<select id='"+wuv+"' name='"+wvv+"' style='width:250px; font-size:11px;' onchange='getPostcode("+u+")'><option value='-1'></option></select>";populateCtrl(u,odt,wuu);}}function populateCtrl(u,odt,wuu){var bi,uvvu,wuuu,uvvv,wuuw,odid,uuw,wuuv,i,vuuv,wvvw,odslc;bi=118;w="xmlGetOdList.asp?bi="+bi+"&odt="+odt;vu=parseInt(Math.random()*99999999999999);w=w+"&mr="+vu;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");}}}else if(window.ActiveXObject){xmlHttpReq=new ActiveXObject("Microsoft.XMLHTTP");}xmlHttpReq.open("GET",w,true);xmlHttpReq.onreadystatechange=function(){if(xmlHttpReq.readyState==4){if(xmlHttpReq.status==200){if(u==1){document.getElementById("origList").options.length=0;vuuv="origComment";wvvw="origInstruct";}else if(u==2){document.getElementById("destList").options.length=0;vuuv="destComment";wvvw="destInstruct";}document.getElementById(vuuv).innerHTML="Please select the "+wuu+" from the list below.<br>If your "+wuu+" is not on the list, click on postcode<br> and enter the full postcode of the "+wuu+".";document.getElementById(wvvw).innerHTML=wuu;wuuw=xmlHttpReq.responseXML.getElementsByTagName("odloc");uvvu=xmlHttpReq.responseXML.getElementsByTagName("odid");wuuu=xmlHttpReq.responseXML.getElementsByTagName("oddesc");uvvv=xmlHttpReq.responseXML.getElementsByTagName("odpostcode");if(u==1){document.getElementById("origList").options[0]=new Option("Please select",0,false,false);}else if(u==2){document.getElementById("destList").options[0]=new Option("Please select",0,false,false);}for(i=0;i<wuuw.length;i++){odid=uvvu[i].childNodes[0].nodeValue;uuw=wuuu[i].childNodes[0].nodeValue;wuuv=uvvv[i].childNodes[0].nodeValue;if(odt==15){uuw=uuw+" - "+wuuv;}if(u==1){document.getElementById("origList").options[i+1]=new Option(uuw,odid,false,false);}else if(u==2){document.getElementById("destList").options[i+1]=new Option(uuw,odid,false,false);}}}}};xmlHttpReq.send(null);}function getFullAddress(wuwv,vww,myid){var xmlHttpReq;var w,results,vuwu,wvuv,vv;var vwvv,vwvw,vvuu,vvuv,vvwu,vvuw,vvww,wu,wuwu;var wvwu,wvuw,wvww,wvvu,vuuu,vuuw,wvvv,wwv;var adid,wuww,uvv,uwwu,uwww,vwv,vvw;var uuv,uwv,uvu,uwu,wvu,wvw,www,uvwv;var wwvv,wvuu,wv,ctrlhidAdrTxt,wwvw;toggleTblprice(0);uuv="lblBnoFrom";uwv="txtBnoFrom";uvu="ftfhid";uwu="ftf";vvwv="hidadoidFrom";vvvu="hidaddidFrom";vwv="origAdrTxt";vvw="tbladlist";ctrlhidAdrTxt="hidOrigAdress";wwu=document.frmBooking.slcAdrec;wwvw="hidOrigPc";wv="F";if(vww=="txtDestination"){wv="T";vww="txtDestination";uuv="lblBnoTo";uwv="txtBnoTo";uvu="ftthid";uwu="ftt";vvwv="hidadoidTo";vvvu="hidaddidTo";vwv="destAdrTxt";vvw="tbladlistDest";wwu=document.frmBooking.slcAdrecDest;}if(vww=="txtVia"){wv="V";uuv="lblBnoVia";uwv="txtBnoVia";uvu="ftvhid";uwu="ftv";vvwv="hidadoidVia";vvvu="hidaddidVia";vwv="ViaAdrTxt";vvw="tbladlistVia";wwu=document.frmBooking.slcAdrecVia;}if(myid==0){vuwu=wuwv.value;adid="0";wvu="0";wvw="0";}else{uvv=wwu;uvwv=uvv.options[uvv.selectedIndex].value;vuwu=uvv.options[uvv.selectedIndex].text;www=uvwv.split("|");adid=www[0];wvu=www[1];wvw=www[2];}w="getaddressPC.asp?adid="+adid+"&adoid="+wvu+"&addid="+wvw+"&ft="+vuwu;vu=parseInt(Math.random()*99999999999999);w=w+"&mr="+vu;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");}}}else if(window.ActiveXObject){xmlHttpReq=new ActiveXObject("Microsoft.XMLHTTP");}xmlHttpReq.open("GET",w,true);xmlHttpReq.onreadystatechange=function(){if(xmlHttpReq.readyState==4){if(xmlHttpReq.status==200){wvuv=xmlHttpReq.responseXML.getElementsByTagName("rst")[0].childNodes[0].nodeValue;if(wvuv==1){wvwu=xmlHttpReq.responseXML.getElementsByTagName("organ")[0];wvuw=xmlHttpReq.responseXML.getElementsByTagName("line1")[0];wvww=xmlHttpReq.responseXML.getElementsByTagName("line2")[0];wvvu=xmlHttpReq.responseXML.getElementsByTagName("line3")[0];vuuu=xmlHttpReq.responseXML.getElementsByTagName("line4")[0];vuuw=xmlHttpReq.responseXML.getElementsByTagName("town")[0];wvvv=xmlHttpReq.responseXML.getElementsByTagName("county")[0];wwv=xmlHttpReq.responseXML.getElementsByTagName("postcode")[0];wwvv=xmlHttpReq.responseXML.getElementsByTagName("adoid")[0];wvuu=xmlHttpReq.responseXML.getElementsByTagName("addid")[0];if(wvwu.childNodes[0]){vwvv=wvwu.childNodes[0].nodeValue;}else{vwvv="";}if(wvuw.childNodes[0]){vwvw=wvuw.childNodes[0].nodeValue;}else{vwvw="";}if(wvww.childNodes[0]){vvuu=wvww.childNodes[0].nodeValue;}else{vvuu="";}if(wvvu.childNodes[0]){vvuv=wvvu.childNodes[0].nodeValue;}else{vvuv="";}if(vuuu.childNodes[0]){vvwu=vuuu.childNodes[0].nodeValue;}else{vvwu="";}if(vuuw.childNodes[0]){vvuw=vuuw.childNodes[0].nodeValue;}else{vvuw="";}if(wvvv.childNodes[0]){vvww=wvvv.childNodes[0].nodeValue;}else{vvww="";}if(wwv.childNodes[0]){wu=wwv.childNodes[0].nodeValue;}else{wu="";}if(wwvv.childNodes[0]){wvu=wwvv.childNodes[0].nodeValue;}else{wvu=0;}if(wvuu.childNodes[0]){wvw=wvuu.childNodes[0].nodeValue;}else{wvw=0;}vv="";if(vwvv!=""){vv=vwvv+", ";}if(vwvw!=""){vv=vv+vwvw+", ";}if(vvuu!=""){vv=vv+vvuu+", ";}if(vvuv!=""){vv=vv+vvuv+", ";}if(vvwu!=""){vv=vv+vvwu+", ";}if(vvuw!=""){vv=vv+vvuw+", ";}if(vvww!=""){vv=vv+vvww+", ";}if(wu!=""){wuwu=wu.substring(0,wu.indexOf(" "));}else{wuwu="0";}if(wv=="T"){vww="txtDestination";uuv="lblBnoTo";uwv="txtBnoTo";uvu="ftthid";uwu="ftt";vvwv="hidadoidTo";vvvu="hidaddidTo";vwv="destAdrTxt";vvw="tbladlistDest";ctrlhidAdrTxt="hidDestAdress";wwu=document.frmBooking.slcAdrecDest;wwvw="hidDestPc";}if(wv=="V"){vww="txtVia";uuv="lblBnoVia";uwv="txtBnoVia";uvu="ftvhid";uwu="ftv";vvwv="hidadoidVia";vvvu="hidaddidVia";vwv="ViaAdrTxt";vvw="tbladlistVia";ctrlhidAdrTxt="hidViaAdress";wwu=document.frmBooking.slcAdrecVia;var tblViaList,newRow,newCell,uwuv,vn;tblViaList=document.getElementById("tblviaList");vn=tblViaList.rows.length-3;newRow=tblViaList.insertRow(tblViaList.rows.length);newCell=newRow.insertCell(0);newCell.innerHTML=vn+1;newCell.className="txt4";newCell=newRow.insertCell(1);newCell.innerHTML=vv;newCell.className="txt4";newCell=newRow.insertCell(2);newCell.innerHTML="<a href=\"javascript:removeVia("+vn+");\">Remove</a>";newCell.className="link1";}if(wv=="T"||wv=="F"){document.getElementById(vww).value=wu;document.getElementById(wwvw).value=wu;document.getElementById(vwv).innerHTML=vv;document.getElementById(ctrlhidAdrTxt).value=vv;}else{document.getElementById(vww).value=wu;document.getElementById(ctrlhidAdrTxt).value=vv;}dom=findDOM(vvw,1);dom.display="none";if(wv=="F"){getPostcodeLatLong(wu,1);}else if(wv=="T"){getPostcodeLatLong(wu,2);}else{getPostcodeLatLong(wu,3);}}else if(wvuv==2){dom=findDOM(vvw,1);dom.display="inline";if(wv=="T"){document.frmBooking.slcAdrecDest.options.length=0;}else if(wv=="F"){document.frmBooking.slcAdrec.options.length=0;}else{document.frmBooking.slcAdrecVia.options.length=0;}var wwvu,i,vvvw,wwu,wuvu,addidnodes;wwvu=xmlHttpReq.responseXML.getElementsByTagName("adid");addescnodes=xmlHttpReq.responseXML.getElementsByTagName("addesc");wuvu=xmlHttpReq.responseXML.getElementsByTagName("adoid");addidnodes=xmlHttpReq.responseXML.getElementsByTagName("addid");for(i=0;i<wwvu.length;i++){adid=wwvu[i].childNodes[0].nodeValue;wuww=addescnodes[i].childNodes[0].nodeValue;wvu=wuvu[i].childNodes[0].nodeValue;wvw=addidnodes[i].childNodes[0].nodeValue;www=adid+"|"+wvu+"|"+wvw;vvvw=new Option(wuww,www,false,false);if(wv=="T"){document.frmBooking.slcAdrecDest.options[document.frmBooking.slcAdrecDest.options.length]=vvvw;}else if(wv=="F"){document.frmBooking.slcAdrec.options[document.frmBooking.slcAdrec.options.length]=vvvw;}else{document.frmBooking.slcAdrecVia.options[document.frmBooking.slcAdrecVia.options.length]=vvvw;}}}else{document.getElementById(vww).value="Not Found";}}}};xmlHttpReq.send(null);}function removeVia(vn){toggleTblprice(0);var tblViaList,rn,i,vwuw;vw.splice(vn,1);tblViaList=document.getElementById("tblviaList");tblViaList.deleteRow(vn+3);rn=tblViaList.rows.length;if(rn>3){for(var i=1;i<rn-2;i++){vwuw=tblViaList.rows[i+2].cells;vwuw[0].innerText=i;vwuw[2].innerHTML="<a href=\"javascript:removeVia("+(i-1)+");\">Remove</a>";}}assignLatLng(0,0,3);}function showVehicle(vvv){if(vvv>0){var bi,w,vu,wuw;var uvuv,results,vvv,uvuw,vuww,uvwu,uwvv,uwwv;bi=118;w="xmlGetVehicle.asp?bi="+bi+"&vi="+vvv;vu=parseInt(Math.random()*99999999999999);w=w+"&mr="+vu;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");}}}else if(window.ActiveXObject){xmlHttpReq=new ActiveXObject("Microsoft.XMLHTTP");}xmlHttpReq.open("GET",w,true);xmlHttpReq.onreadystatechange=function(){if(xmlHttpReq.readyState==4){if(xmlHttpReq.status==200){wuw=xmlHttpReq.responseText;document.getElementById("tdVclDetails").innerHTML=wuw;}}};xmlHttpReq.send(null);}else if(vvv==0){document.getElementById("tdVclDetails").innerHTML="";}else{}if(vvv==0){showVehicleStatic();}}function showVehicleStatic(){var vvv,bi;bi=118;for(var i=0;i<frmBooking.rdVclType.length;i++){if(frmBooking.rdVclType[i].checked){vi=document.frmBooking.rdVclType[i].value;break;}else{vi=0;}}vvv=vi;if(vvv>0){var w,vu,wuw;var uvuv,results,vvv,uvuw,vuww,uvwu,uwvv,uwwv;w="xmlGetVehicle.asp?bi="+bi+"&vi="+vvv;vu=parseInt(Math.random()*99999999999999);w=w+"&mr="+vu;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");}}}else if(window.ActiveXObject){xmlHttpReq=new ActiveXObject("Microsoft.XMLHTTP");}xmlHttpReq.open("GET",w,true);xmlHttpReq.onreadystatechange=function(){if(xmlHttpReq.readyState==4){if(xmlHttpReq.status==200){wuw=xmlHttpReq.responseText;document.getElementById("tdVclDetails").innerHTML=wuw;}}};xmlHttpReq.send(null);}else if(vvv==0){document.getElementById("tdVclDetails").innerHTML="";}else{}}function showGT(showyn){if(showyn==0){dom=findDOM("tblgt",1);dom.display="none";dom=findDOM("btnQuote",1);dom.display="inline";dom=findDOM("btnQuery",1);dom.display="none";document.frmBooking.action="bookd2.asp";}else{if(document.getElementById("rdVclType-1").checked){dom=findDOM("tblgt",1);dom.display="inline";dom=findDOM("btnQuote",1);dom.display="none";dom=findDOM("btnQuery",1);dom.display="inline";document.frmBooking.action="bookquery.asp";}else{dom=findDOM("tblgt",1);dom.display="none";dom=findDOM("btnQuery",1);dom.display="none";dom=findDOM("btnQuote",1);dom.display="inline";document.frmBooking.action="bookd2.asp";}}}function showVia(){toggleTblprice(0);if(document.getElementById("chkVia").checked){dom=findDOM("tblvia",1);dom.display="inline";}else{dom=findDOM("tblvia",1);dom.display="none";}}function regvchk(){if(tblvclfcs==0){document.getElementById("tdVclDetails").innerHTML="";}}function setval(){document.frmBooking.hidDistance.value=0;document.frmBooking.hidPrice.value=0;document.frmBooking.hidPriceRtn.value=0;document.frmBooking.hidOrigPc.value="";document.frmBooking.hidDestPc.value="";}function getPrice(){var xmlHttpReq,w,results,wuvw,vuww,uv,vvu,vwu;var uwvu,bi,vi,oi,di,wuwv,bp,vuw,vuu,d;var uwuw,uuvw,uuvv,uwuu;var odt,u,dAdr,oAdr,rdbt,cs,ww;document.getElementById("txtPrice").innerHTML=" ";ww=document.getElementById("txaVia").value;bi=document.frmBooking.hidb.value;hot=document.frmBooking.hidOrigType.value;uuu=document.frmBooking.hidDestType.value;d=document.frmBooking.hidDistance.value;for(var i=0;i<frmBooking.rdVclType.length;i++){if(frmBooking.rdVclType[i].checked){vi=document.frmBooking.rdVclType[i].value;break;}else{vi=0;}}if(vi==0){alert("Please select a vehicle type");}for(var i=0;i<frmBooking.rdbt.length;i++){if(frmBooking.rdbt[i].checked){rdbt=document.frmBooking.rdbt[i].value;}}cs=document.frmBooking.slcCs.value;if(hot==-1){vuw=document.frmBooking.txtFrom.value;oAdr=document.getElementById("origAdrTxt").innerHTML;}else{vuw="0";}if(hot==3){vuw=document.getElementById("txtOrigPostcode").value;}else{if(hot!=-1){vuw="0";}}if(hot!=-1&&hot!=3){u=document.getElementById("origList");oi=u.options[u.selectedIndex].value;vuw=document.getElementById("hidOrigPc").value;}else{oi=0;}if(ww!=""){vuw=document.getElementById("hidOrigPc").value;oi=0;}if(uuu==-1){vuu=document.frmBooking.txtDestination.value;}else{vuu="0";}if(uuu==3){vuu=document.getElementById("txtDestPostcode").value;}else{if(uuu!=-1){vuu="0";}}if(uuu!=-1&&uuu!=3){u=document.getElementById("destList");di=u.options[u.selectedIndex].value;vuu=document.getElementById("hidDestPc").value;}else{di=0;}if(ww!=""){vuu=document.getElementById("hidDestPc").value;di=0;}w="xmlGetPrice.asp?bi="+bi+"&vi="+vi+"&op="+vuw+"&dp="+vuu+"&oi="+oi+"&di="+di+"&bt="+rdbt+"&cs="+cs+"&d="+d;vu=parseInt(Math.random()*99999999999999);w=w+"&mr="+vu;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");}}}else if(window.ActiveXObject){xmlHttpReq=new ActiveXObject("Microsoft.XMLHTTP");}xmlHttpReq.open("GET",w,true);xmlHttpReq.onreadystatechange=function(){if(xmlHttpReq.readyState==4){if(xmlHttpReq.status==200){wuvw=xmlHttpReq.responseText;results=wuvw.split("|");uwvu=results[0];vuww=results[1];uv=results[2];vwu=results[3];vvu=results[4];uv=parseFloat(uv)+parseFloat(vw.length*3);if(rdbt=="R"){vwu=parseFloat(vwu)+parseFloat(vw.length*3);vvu=parseFloat(vvu)+parseFloat(vw.length*6);}uv=parseFloat(uv);uv=uv.toFixed(2);vwu=parseFloat(vwu);vwu=vwu.toFixed(2);vvu=parseFloat(vvu);vvu=vvu.toFixed(2);if(uv>-1){if(uv==0){uv="Call";}if(vvu==0){document.getElementById("txtPrice").innerHTML="\xA3"+uv;document.getElementById("txtPrice1st").innerHTML="";document.getElementById("lblPrice1st").innerHTML="";document.getElementById("txtPrice2nd").innerHTML="";document.getElementById("lblPrice2nd").innerHTML="";document.getElementById("hidPrice").value=uv;}else{document.getElementById("txtPrice").innerHTML="\xA3"+vvu;document.getElementById("txtPrice1st").innerHTML="\xA3"+uv;document.getElementById("lblPrice1st").innerHTML="1st Journey";document.getElementById("txtPrice2nd").innerHTML="\xA3"+vwu;document.getElementById("lblPrice2nd").innerHTML="2nd Journey";document.getElementById("hidPrice").value=vvu;}dom=findDOM("tblPrice",1);dom.display="inline";}else{alert("Unfortunately we are unable to provide an online price for your journey. Please contact us for a favourable quote.");}}}};xmlHttpReq.send(null);}function getAddressPC(u){var pc,w,vuwv,vwvu;toggleTblprice(0);if(u==1){pc=document.getElementById("txtOrigPostcode").value;document.getElementById("hidOrigPc").value=pc;vwv="origAdrTxtPc";ctrlhidAdrTxt="hidOrigAdress";}else{pc=document.getElementById("txtDestPostcode").value;document.getElementById("hidDestPc").value=pc;vwv="destAdrTxtPc";ctrlhidAdrTxt="hidDestAdress";}getPostcodeLatLong(pc,u);w="xmlGetPaf.asp?pc="+pc;vu=parseInt(Math.random()*99999999999999);w=w+"&mr="+vu;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");}}}else if(window.ActiveXObject){xmlHttpReq=new ActiveXObject("Microsoft.XMLHTTP");}xmlHttpReq.open("GET",w,true);xmlHttpReq.onreadystatechange=function(){if(xmlHttpReq.readyState==4){if(xmlHttpReq.status==200){vuwv=xmlHttpReq.responseXML.getElementsByTagName("address")[0];if(vuwv.childNodes[0]){vwvu=vuwv.childNodes[0].nodeValue;}else{vwvu="";}document.getElementById(vwv).innerHTML=vwvu;document.getElementById(ctrlhidAdrTxt).value=vwvu;}}};xmlHttpReq.send(null);}function showLgn(ct){if(ct=="e"){uw=findDOM("tblcustexist",1);uw.display="inline";uw=findDOM("tblcustnew",1);uw.display="none";uw=findDOM("qupgr",1);uw.display="inline";}else if(ct=="n"){uw=findDOM("tblcustexist",1);uw.display="none";uw=findDOM("tblcustnew",1);uw.display="inline";uw=findDOM("qupgr",1);uw.display="inline";}}function showBkPgr(yn){var vwwv;if(yn==1){vwwv=findDOM("tblBkPgrDtl",1);vwwv.display="inline";}else{vwwv=findDOM("tblBkPgrDtl",1);vwwv.display="none";}}function getUser(uwvw){var xmlHttpReq;var w,results,us,ps,sn,vwuv,bi,ad,wwuw,vv,phn,wwuv,mbl,wwwu,em,wwuu;bi=document.frmBooking.hidb.value;us=document.frmBooking.txtUser.value;ps=document.frmBooking.txtPass.value;w="xmlhtgetuser.asp?bi="+bi+"&us="+us+"&ps="+ps;vu=parseInt(Math.random()*99999999999999);w=w+"&mr="+vu;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");}}}else if(window.ActiveXObject){xmlHttpReq=new ActiveXObject("Microsoft.XMLHTTP");}xmlHttpReq.open("GET",w,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];vwuv=sn.childNodes[0].nodeValue;wwuw=ad.childNodes[0].nodeValue;wwuv=phn.childNodes[0].nodeValue;wwwu=mbl.childNodes[0].nodeValue;wwuu=em.childNodes[0].nodeValue;vv=vwuv+"<br>"+wwuw+"<br><br>"+"<b>Tel: </b>"+wwuv+"<br><b>Tel: </b>"+wwwu+"<br><b>Email: </b>"+wwuu+"<br><br>";document.getElementById("txtContact").innerHTML=vv;uw=findDOM("tdBookname",1);uw.display="block";dom=findDOM("submitbp",1);dom.visibility="visible";var bn="<b>Booking Name: </b>"+vwuv;document.getElementById("tdBookname").innerHTML=bn;if(uwvw==2){dom=findDOM("tblpmin",1);dom.display="inline";}}else{}}};xmlHttpReq.send(null);}function getPostcodeLatLong(wu,uww){var uu;localSearch.setSearchCompleteCallback(null,function(){if(localSearch.results[0]){var wwww=localSearch.results[0].lat;var wwwv=localSearch.results[0].lng;var point=new GLatLng(wwww,wwwv);assignLatLng(wwww,wwwv,uww);}else{}});localSearch.execute(wu+", UK");}function assignLatLng(lat,lng,uww){var uu,vuv,ww;ww="";if(uww=="1"){puLat=lat;puLng=lng;vuv=document.getElementById("txaVia");if(vuv.value==""){vw.splice(0);}else{uu="";for(var i=0;i<vw.length;i++){ww=ww+" to "+vw[i].lat+","+vw[i].lng;}}if(puLat!=0&&drLat!=0){uu=puLat+","+puLng+ww+" to "+drLat+","+drLng;getDistance(uu);}}else if(uww=="2"){drLat=lat;drLng=lng;vuv=document.getElementById("txaVia");if(vuv.value==""){vw.splice(0);}else{uu="";for(var i=0;i<vw.length;i++){ww=ww+" to: "+vw[i].lat+","+vw[i].lng;}}if(puLat!=0&&drLat!=0){uu="from: "+puLat+","+puLng+ww+" to: "+drLat+","+drLng;getDistance(uu);}}else if(uww=="3"){var addVia=0;var wvwv=lat;var wuvv=lng;var vv,viaListVal;vv=document.getElementById("hidViaAdress").value;vuv=document.getElementById("txaVia");viaListVal="";var n,uuwv,uuvu;n=vw.length;if(wvwv!=0&&wuvv!=0){vw[n]={lat:wvwv,lng:wuvv,adr:vv};}n=vw.length;if(n>0||wvwv==0){uu="";ww="";vuv.value="";for(var i=0;i<vw.length;i++){ww=ww+" to: "+vw[i].lat+","+vw[i].lng;vuv.value=viaListVal+"|"+vw[i].adr;viaListVal=vuv.value;}uu="from: "+puLat+","+puLng+ww+" to: "+drLat+","+drLng;getDistance(uu);}}}function getDistance(uu){var totalDistance,totalTime;if(GBrowserIsCompatible()){map=new GMap2(document.getElementById("map"));directionsPanel=document.getElementById("dirdiv");map.setCenter(new GLatLng(puLat,puLng),3);directions=new GDirections(map,directionsPanel);GEvent.addListener(directions,"load",function(){uvuu=directions.getDuration();uvww=directions.getDistance();document.getElementById("hidDistance").value=uvww.meters;document.getElementById("hidDuration").value=uvuu.seconds;});directions.load(uu);}}function getPostcode(wv){var pc,w,wwv,wu,u,cid,ctrlhidAdrPc,ctrlhidList,ctrlhidAdr,adr,adr_nd;toggleTblprice(0);if(wv==1){u=document.getElementById("origList");cid=u.options[u.selectedIndex].value;ctrlhidAdrPc="hidOrigPc";ctrlhidList="hidorigList";ctrlhidAdr="hidOrigAdress";}else{u=document.getElementById("destList");cid=u.options[u.selectedIndex].value;ctrlhidAdrPc="hidDestPc";ctrlhidList="hiddestList";ctrlhidAdr="hidDestAdress";}document.getElementById(ctrlhidList).value=cid;w="xmlGetPostcode.asp?cid="+cid;vu=parseInt(Math.random()*99999999999999);w=w+"&mr="+vu;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");}}}else if(window.ActiveXObject){xmlHttpReq=new ActiveXObject("Microsoft.XMLHTTP");}xmlHttpReq.open("GET",w,true);xmlHttpReq.onreadystatechange=function(){if(xmlHttpReq.readyState==4){if(xmlHttpReq.status==200){wwv=xmlHttpReq.responseXML.getElementsByTagName("postcode")[0];adr_nd=xmlHttpReq.responseXML.getElementsByTagName("adr")[0];if(wwv.childNodes[0]){pc=wwv.childNodes[0].nodeValue;}else{pc="";}if(adr_nd.childNodes[0]){adr=adr_nd.childNodes[0].nodeValue;}else{adr="";}document.getElementById(ctrlhidAdrPc).value=pc;document.getElementById(ctrlhidAdr).value=adr;if(pc!=""){getPostcodeLatLong(pc,wv);}}}};xmlHttpReq.send(null);}function toggleTblprice(st){dom=findDOM("tblPrice",1);if(st==1){dom.display="inline";}else{if(dom.display=="inline"){dom.display="none";}}}function validate(form){var s,a,e,IError,incomplete,showerror,rdval,k,p;p=0;for(var k=0;k<frmBooking.rdcustype.length;k++){if(frmBooking.rdcustype[k].checked){rdval=document.frmBooking.rdcustype[k].value;p=1;}}if(p==0){dom=findDOM("rdcustypeEr",1);dom.visibility="visible";alert("Please let us know if you are an existing or a new customer.");return false;}else{dom=findDOM("rdcustypeEr",1);dom.visibility="hidden";}if(rdval=="e"){document.getElementById("nuName").optional="true";document.getElementById("nuMobile").optional="true";if(document.getElementById("txtContact").innerHTML==""){alert("Please enter your email and password and then press Login button");return false;}}else{document.getElementById("nuName").optional="false";document.getElementById("nuMobile").optional="false";document.getElementById("nuEmail").optional="false";if(document.getElementById("nuName").value==""){alert("Please enter your name.");dom=findDOM("nuNameEr",1);dom.visibility="visible";return false;}else{dom=findDOM("nuNameEr",1);dom.visibility="hidden";}if(document.getElementById("nuMobile").value==""){alert("Please enter your phone or mobile number.");dom=findDOM("nuMobileEr",1);dom.visibility="visible";return false;}else{dom=findDOM("nuMobileEr",1);dom.visibility="hidden";}if(document.getElementById("nuEmail").value==""){alert("Please enter your Email.");dom=findDOM("nuEmailEr",1);dom.visibility="visible";return false;}else{dom=findDOM("nuEmailEr",1);dom.visibility="hidden";}}p=0;for(var k=0;k<frmBooking.rdbkpgr.length;k++){if(frmBooking.rdbkpgr[k].checked){rdval=document.frmBooking.rdbkpgr[k].value;p=1;}}if(p==0){dom=findDOM("rdbkpgrEr",1);dom.visibility="visible";alert("Please let us know if you are the passenger.");return false;}else{dom=findDOM("rdbkpgrEr",1);dom.visibility="hidden";}if(rdval=="y"){document.getElementById("txtPgrName").optional="true";document.getElementById("txtPgrPhone").optional="true";}else{document.getElementById("txtPgrName").optional="false";document.getElementById("txtPgrPhone").optional="false";if(document.getElementById("txtPgrName").value==""){alert("Please enter passenger name.");dom=findDOM("txtPgrNameEr",1);dom.visibility="visible";return false;}else{dom=findDOM("txtPgrNameEr",1);dom.visibility="hidden";}if(document.getElementById("txtPgrPhone").value==""){alert("Please enter passenger's phone.");dom=findDOM("txtPgrPhoneEr",1);dom.visibility="visible";return false;}else{dom=findDOM("txtPgrPhoneEr",1);dom.visibility="hidden";}}p=0;for(var k=0;k<frmBooking.rdpm.length;k++){if(frmBooking.rdpm[k].checked){rdval=document.frmBooking.rdpm[k].value;p=1;}}if(p==0){dom=findDOM("rdpmEr",1);dom.visibility="visible";alert("Please select payment type.");return false;}else{dom=findDOM("rdpmEr",1);dom.visibility="hidden";}for(var j=0;j<form.length;j++){e=form.elements[j];if(e.optional||e.type=="submit"||e.type=="hidden"||e.type=="button"||e.type=="radio"){continue;}s=form.elements[j].value;a=form.elements[j].id;IError=a+"Er";showerror=false;if(s.length<1){incomplete=true;showerror=true;}else{for(var i=0;i<s.length;i++){var c=s.charAt(i);if(i==0&&c==" "){s=s.substring(1,s.length);if(s.length<1){incomplete=true;showerror=true;}i=-1;continue;}if(c!=" "){break;}else{incomplete=true;showerror=true;}}}if(showerror==true){dom=findDOM(IError,1);dom.visibility="visible";}else{dom=findDOM(IError,1);dom.visibility="hidden";}}if(incomplete==true){alert("you must complete all required fields");return false;}if(document.getElementById("chktc").checked==false){dom=findDOM("chktcEr",1);dom.visibility="visible";alert("Please tick the terms and conditions to confirm your acceptance of our terms before you proceed.");return false;}else{dom=findDOM("chktcEr",1);dom.visibility="hidden";}}