function waitloadPage() { //DOM
if (document.getElementById){
parent.document.getElementById('pre_shuttle').style.visibility = 'hidden';
}else{
if (document.layers){ //NS4
parent.document.pre_shuttle.visibility = 'hidden';
}
else { //IE4
parent.document.all.pre_shuttle.style.visibility = 'hidden';
}
}
}
function checkData2 (){
										if (document.front_login.email.value == "") {
                                         alert("Please enter your registered e-mail address or contact number.")
                                        document.front_login.email.focus()
                                        return false}
										if (document.front_login.pass.value == "") {
                                         alert("Please enter your password.")
                                        document.front_login.pass.focus()
                                        return false}
										
                        }
function checkData3 (){
										if (document.fares.pc1.value == "") {
                                         alert("Please enter the full or first part of the postcode.")
                                        document.fares.pc1.focus()
                                        return false}
										var space  = " ";
										fieldname   = document.fares.pc1; 
										fieldvalue  = fieldname.value; 
										fieldlength = fieldvalue.length; 
										if (!(fieldvalue.match(/\d/))) {
                                         alert("The pick up postcode must contain a number.")
                                        document.fares.pc1.focus()
										return false}

										if (document.fares.pc2.value == "") {
                                         alert("Please enter the full or first part of the postcode.")
                                        document.fares.pc2.focus()
                                        return false}
										var space  = " ";
										fieldname   = document.fares.pc2; 
										fieldvalue  = fieldname.value; 
										fieldlength = fieldvalue.length; 
										if (!(fieldvalue.match(/\d/))) {
                                         alert("The destination postcode must contain a number.")
                                        document.fares.pc2.focus()
										return false}
										
                        }
						
function checkData4 (){
										if (document.quick.pick_pc.value == "") {
                                         alert("Please enter the full or first part of the postcode.")
                                        document.quick.pick_pc.focus()
                                        return false}
										var space  = " ";
										fieldname   = document.quick.pick_pc; 
										fieldvalue  = fieldname.value; 
										fieldlength = fieldvalue.length; 
										if (!(fieldvalue.match(/\d/))) {
                                         alert("The pick up postcode must contain a number.")
                                        document.quick.pick_pc.focus()
										return false}

										if (document.quick.dest_pc.value == "") {
                                         alert("Please enter the full or first part of the postcode.")
                                        document.quick.dest_pc.focus()
                                        return false}
										var space  = " ";
										fieldname   = document.quick.dest_pc; 
										fieldvalue  = fieldname.value; 
										fieldlength = fieldvalue.length; 
										if (!(fieldvalue.match(/\d/))) {
                                         alert("The destination postcode must contain a number.")
                                        document.quick.dest_pc.focus()
										return false}
                        }
						var newWindow = null;

function closeWin(){
	if (newWindow != null){
		if(!newWindow.closed)
			newWindow.close();
	}
}
						function searchnow1(url, state) {
										if (document.fares.search1.value == "") {
                                        alert("Please enter a place name, postcode or county.")
                                        document.fares.search1.focus()
                                        return false}
										else {
										closeWin();
										popupWin = window.open(url + '?search=' + state + '&action=pick','newWin','resizable=yes,scrollbars=yes,width=400,height=200');
										popupWin.focus();
										}
										}
						function searchnow2(url, state) {
										if (document.fares.search2.value == "") {
                                        alert("Please enter a place name, postcode or county.")
                                        document.fares.search2.focus()
                                        return false}
										else {
										closeWin();
										popupWin = window.open(url + '?search=' + state + '&action=dest','newWin','resizable=yes,scrollbars=yes,width=400,height=200');
										popupWin.focus();
										}
										}
						function searchnow3(url, state) {
										if (document.web_book.pick_city.value == "") {
                                        alert("Please enter a place name, postcode or county.")
										document.getElementById('pick_city').style.background='FFCCCC';
                                        document.web_book.pick_city.focus()
                                        return false}
										else {
										closeWin();
										popupWin = window.open(url + '?search=' + state + '&action=pick','newWin','resizable=yes,scrollbars=yes,width=400,height=200');
										popupWin.focus();
										}
										}
						function searchnow4(url, state) {
										if (document.web_book.dest_city.value == "") {
                                        alert("Please enter a place name, postcode or county.")
										document.getElementById('dest_city').style.background='FFCCCC';
                                        document.web_book.dest_city.focus()
                                        return false}
										else {
										closeWin();
										popupWin = window.open(url + '?search=' + state + '&action=dest','newWin','resizable=yes,scrollbars=yes,width=400,height=200');
										popupWin.focus();
										}
										}
						function searchnow5(url, state, state2, state3) {
										closeWin();
										popupWin = window.open(url + '?pick_add1=' + state + '&pick_city=' + state2 + '&pick_postcode=' + state3 + '&action=a','newWin','resizable=yes,scrollbars=yes,width=375,height=350');
										popupWin.focus();
										}
						function searchnow6(url, state, state2, state3) {
										closeWin();
										popupWin = window.open(url + '?pick_add1=' + state + '&pick_city=' + state2 + '&pick_postcode=' + state3 + '&action=b','newWin','resizable=yes,scrollbars=yes,width=375,height=350');
										popupWin.focus();
										}
										function checkData5 (){
										if (document.user_login.email.value == "") {
                                         alert("Please enter your registered e-mail address or contact number.")
                                        document.user_login.email.focus()
                                        return false}
										if (document.user_login.pass.value == "") {
                                         alert("Please enter your password.")
                                        document.user_login.pass.focus()
                                        return false}
                        }
										function checkData6 (){
										if (document.taxi_login.email.value == "") {
                                         alert("Please enter your registered e-mail address.")
                                        document.taxi_login.email.focus()
                                        return false}
										if (document.taxi_login.pass.value == "") {
                                         alert("Please enter your password.")
                                        document.taxi_login.pass.focus()
                                        return false}
                        }
										function checkPremierData (){
										if (document.premier_login.hotel_user.value == "") {
                                         alert("Please enter your username.")
                                        document.premier_login.hotel_user.focus()
                                        return false}
										if (document.premier_login.hotel_pass.value == "") {
                                         alert("Please enter your password.")
                                        document.premier_login.hotel_pass.focus()
                                        return false}
                        }
function checkData7 (){
										if (document.quickquote.pick_pc.value == "") {
                                         alert("Please enter the full or first part of the postcode.")
                                        document.quickquote.pick_pc.focus()
                                        return false}
										var space  = " ";
										fieldname   = document.quickquote.pick_pc; 
										fieldvalue  = fieldname.value; 
										fieldlength = fieldvalue.length; 
										if (!(fieldvalue.match(/\d/))) {
                                         alert("The pick up postcode must contain a number.")
                                        document.quickquote.pick_pc.focus()
										return false}

										if (document.quickquote.dest_pc.value == "") {
                                         alert("Please enter the full or first part of the postcode.")
                                        document.quickquote.dest_pc.focus()
                                        return false}
										var space  = " ";
										fieldname   = document.quickquote.dest_pc; 
										fieldvalue  = fieldname.value; 
										fieldlength = fieldvalue.length; 
										if (!(fieldvalue.match(/\d/))) {
                                         alert("The destination postcode must contain a number.")
                                        document.quickquote.dest_pc.focus()
										return false}
                        }
function checkAcc (){
										if (document.prem_reg.co_name.value == "") {
                                         alert("Please enter your company name.")
                                        document.prem_reg.co_name.focus()
                                        return false}
										if (document.prem_reg.co_email.value == "") {
                                         alert("Please enter your email address.")
                                        document.prem_reg.co_email.focus()
                                        return false}
										if (document.prem_reg.co_contact.value == "") {
                                         alert("Please enter your contact name.")
                                        document.prem_reg.co_contact.focus()
                                        return false}
										if (document.prem_reg.co_phone.value == "") {
                                         alert("Please enter your phone number.")
                                        document.prem_reg.co_phone.focus()
                                        return false}
										if (document.prem_reg.co_add1.value == "") {
                                         alert("Please enter your address.")
                                        document.prem_reg.co_add1.focus()
                                        return false}
										if (document.prem_reg.co_city.value == "") {
                                         alert("Please enter your town or city.")
                                        document.prem_reg.co_city.focus()
                                        return false}
										if (document.prem_reg.pseudo.value == "") {
                                         alert("Please enter your pseudo city code or license number.")
                                        document.prem_reg.pseudo.focus()
                                        return false}
										if (document.prem_reg.corp_terms.checked == false) {
                                        alert("Please read and accept our terms and conditions.")
                                        document.prem_reg.corp_terms.focus()
                                        return false}
                        }
function shared_Form(what,count) {
    selected = what.mySelect.selectedIndex;

    value = what.mySelect.options[selected].value;

    for (var i = 0, oldpos = -1; i<count-1; i++) {
        pos = value.indexOf('&',oldpos+1);
        data = value.substring(oldpos+1,pos);
        what.elements['text' + i].value = value.substring(oldpos+1,pos);
        oldpos = pos;
    }
    what.elements['text' + i].value = value.substring(oldpos+1,value.length)
}
function shared_calc(){ 
share_book.pick_add1.value=share_book.text0.value;
share_book.pick_add2.value=share_book.text1.value;
share_book.pick_city.value=share_book.text2.value;
share_book.pick_postcode.value=share_book.text3.value;
share_book.ap_pick.value=share_book.text4.value;
share_book.ap_pick_code.value=share_book.text5.value;
}
		
		function share_checkData (){
										if (document.share_book.dest_city.value == "") {
                                        alert("Please enter the pick up point.")
                                        document.share_book.mySelect.focus()
                                        return false}
										if (document.share_book.bk_passengers.value == 0) {
                                        alert("Please enter the number of passengers.")
                                        document.share_book.bk_passengers.focus()
                                        return false}

}
function shared_Form2(what,count) {
    selected = what.mySelect2.selectedIndex;

    value = what.mySelect2.options[selected].value;

    for (var i = 0, oldpos = -1; i<count-1; i++) {
        pos = value.indexOf('&',oldpos+1);
        data = value.substring(oldpos+1,pos);
        what.elements['text' + i].value = value.substring(oldpos+1,pos);
        oldpos = pos;
    }
    what.elements['text' + i].value = value.substring(oldpos+1,value.length)
}
function shared_calc2(){ 
book_taxi.dest_add2.value=book_taxi.text0.value;
book_taxi.dest_postcode.value=book_taxi.text1.value;
}
						function airport1(url, state) {
										popupWin = window.open(url + '?city=' + state,'newWin','resizable=yes,scrollbars=yes,width=750,height=500');
										popupWin.focus();
										}
function applyLogin1(value)
{
 document.getElementById("login1").style.display = value;
}
function applyLogin2(value)
{
 document.getElementById("login2").style.display = value;
}
function applyLogin3(value)
{
 document.getElementById("login3").style.display = value;
}
function applyLogin4(value)
{
 document.getElementById("login4").style.display = value;
}
function applyLogin5(value)
{
 document.getElementById("login5").style.display = value;
}
function applyDisplay1(value)
{
 document.getElementById("foo1").style.display = value;
 document.getElementById("foo2").style.display = 'block';
}
function applyDisplay2(value)
{
 document.getElementById("foo1").style.display = 'block';
 document.getElementById("foo2").style.display = 'none';
}
function applyDisplay3(value)
{
 document.getElementById("foo3").style.display = value;
}
function applyDisplay4(value)
{
 document.getElementById("foo4").style.display = value;
}
function applyDisplay5(value)
{
 document.getElementById("foo5").style.display = value;
}
function applyDisplay6(value)
{
document.getElementById("foo1").style.display = 'none';
document.getElementById("PnAdd2").style.display = 'none';
document.getElementById("pickAddressContent").style.display = value;
document.getElementById("PnAdd").style.display = value;
document.getElementById("foo6").style.display = value;
}
function applyDisplay7(value)
{
document.getElementById("foo2").style.display = 'none';
document.getElementById("DnAdd2").style.display = 'none';
document.getElementById("destAddressContent").style.display = value;
document.getElementById("DnAdd").style.display = value;
document.getElementById("foo7").style.display = value;
}
function train1(url, state) {
popupWin = window.open(url + '?trip=' + state,'newWin','resizable=yes,scrollbars=yes,width=375,height=425');
popupWin.focus();
}
						function searchcity1(url, state) {
										if (document.web_book.pick_city.value == "") {
                                        alert("Please enter a place name, postcode, county, airport, airport code or train station.")
										document.getElementById('pick_city').style.background='FFCCCC';
                                        document.web_book.pick_city.focus()
                                        return false}
										else {
										closeWin();
										popupWin = window.open(url + '?search=' + state + '&action=pick','newWin','resizable=yes,scrollbars=yes,width=400,height=200');
										popupWin.focus();
										}
										}
						function searchcity2(url, state) {
										if (document.web_book.dest_city.value == "") {
                                        alert("Please enter a place name, postcode, county, airport, airport code or train station.")
										document.getElementById('dest_city').style.background='FFCCCC';
                                        document.web_book.dest_city.focus()
                                        return false}
										else {
										closeWin();
										popupWin = window.open(url + '?search=' + state + '&action=dest','newWin','resizable=yes,scrollbars=yes,width=400,height=200');
										popupWin.focus();
										}
										}
function updateForm7(what,count) {
    selected = what.mySelect7.selectedIndex;

    value = what.mySelect7.options[selected].value;

    for (var i = 0, oldpos = -1; i<count-1; i++) {
        pos = value.indexOf('&',oldpos+1);
        data = value.substring(oldpos+1,pos);
        what.elements['citypicktext' + i].value = value.substring(oldpos+1,pos);
        oldpos = pos;
    }
    what.elements['citypicktext' + i].value = value.substring(oldpos+1,value.length)
}
function calc7(){
web_book.pick_add1.value="";
web_book.pick_add2.value="";
web_book.pick_city.value=web_book.citypicktext0.value;
web_book.pick_postcode.value=web_book.citypicktext1.value;
web_book.ap_pick.value=web_book.citypicktext2.value;
web_book.city_pick.value=1;
web_book.st_pick.value=0;
web_book.ap_pick_code.value="";
document.getElementById('picktown').value=web_book.citypicktext0.value;
document.getElementById('pickpc').value=web_book.citypicktext1.value;
}
function updateForm8(what,count) {
    selected = what.mySelect8.selectedIndex;

    value = what.mySelect8.options[selected].value;

    for (var i = 0, oldpos = -1; i<count-1; i++) {
        pos = value.indexOf('&',oldpos+1);
        data = value.substring(oldpos+1,pos);
        what.elements['citydesttext' + i].value = value.substring(oldpos+1,pos);
        oldpos = pos;
    }
    what.elements['citydesttext' + i].value = value.substring(oldpos+1,value.length)
}
function calc8(){
web_book.dest_add1.value="";
web_book.dest_add2.value="";
web_book.dest_city.value=web_book.citydesttext0.value;
web_book.dest_postcode.value=web_book.citydesttext1.value;
web_book.ap_dest.value=web_book.citydesttext2.value;
web_book.city_dest.value=1;
web_book.st_dest.value=0;
web_book.ap_dest_code.value="";
document.getElementById('desttown').value=web_book.citydesttext0.value;
document.getElementById('destpc').value=web_book.citydesttext1.value;
}
function htxAll() {
var new_select = document.quickquoteform.airportgroupid;
var htx1=new_select.options[new_select.selectedIndex].text;
var htx2=new_select.options[new_select.selectedIndex].value;
if (htx2==0) {
if(document.location.href==('https://www.where2guv.com/user_booking.php')) {
location.href = 'https://www.where2guv.com/user_booking.php';
} else if(!location.href.toLowerCase().indexOf('https://www.where2guv.com/user_booking.php?page=getAll')==1) {
location.href = 'https://www.where2guv.com/user_booking.php';
} else {
window.location.href = ('index.php');
}
} else {
window.location.href = ('?page=getAll&airportGroupId=' + htx2 + '&AirportGroupName=' + htx1 + '&htx_search=1');
}
}
function htxAll2() {
var new_select = document.quickquoteform.airportgroupid;
var htx1=new_select.options[new_select.selectedIndex].text;
var htx2=new_select.options[new_select.selectedIndex].value;
if (htx2==0) {
if(document.location.href==('http://world.where2guv.com/')) {
location.href = 'http://www.where2guv.com';
} else if(document.location.href==('http://world.where2guv.com/index.php')) {
location.href = 'http://www.where2guv.com';
} else if(!location.href.toLowerCase().indexOf('https://www.where2guv.com/user_booking.php')==1) {
location.href = 'https://www.where2guv.com/user_booking.php';
} else {
window.location.href = ('index.php');
}
}
}
