/* Start - FSN Part 2 - ButtonToTab Conversion for Book Flight and Redeem miles*/

if (typeof DASwitch == "undefined"){
	var DASwitch = true;
}

function showVacationsPB() {

    if (countrysiteId == "261") { //do different if uk site
        $('#dateContainer').siblings().andSelf().hide();
        //document.location.href = "http://www.unitedvacations.co.uk/index.asp?Referrer=UVUK0015&cmpid=AFC-UAUK";
		document.location.href = "http://www.unitedairlines.co.uk/local/english/SI/ukvacations.html";
    } else if (countrysiteId == "171" && affLang == "jp") { //special JP-ja
        $('#dateContainer').siblings().andSelf().hide();
        document.location.href = "http://www.unitedvacations.co.jp/index.php";
    } else if (countrysiteId == "161") { //special HK
        $('#dateContainer').siblings().andSelf().hide();
        document.location.href = "http://www.unitedvacations.com.hk";
	//} else if (countrysiteId == "71") { //special AU
      //  $('#dateContainer').siblings().andSelf().hide();
     //   document.location.href = "http://www.unitedvacations.com.au/";
    } else {

        var shopFrom0Val = document.getElementById("shop_from0").value;
        var shopTo0Val = document.getElementById("shop_to0").value;
        shopFrom0Val = shopFrom0Val.replace("(", "");
        shopTo0Val = shopTo0Val.replace("(", "");
        document.getElementById("shop_from0").value = shopFrom0Val;
        document.getElementById("shop_to0").value = shopTo0Val;
        document.getElementById('vacationO').value = document.getElementById("shop_from0").value;
        document.getElementById('vacationD').value = document.getElementById("shop_to0").value;

        document.getElementById("ff29pane1").style.display = "none";
        document.getElementById("ff29pane1sub1a").style.display = "none";
        document.getElementById("ff29pane1sub1b").style.display = "none";
        document.getElementById("ff29pane1sub2a").style.display = "block";
        document.getElementById("ff29pane1sub2b").style.display = "block";
        document.getElementById("showVacations").style.display = "none";
        document.getElementById("flights1").style.display = "block";
        document.getElementById("cars1").style.display = "block";
        document.getElementById("hotels1").style.display = "block";
        document.getElementById("cars2").style.display = "none";
        document.getElementById("hotels2").style.display = "none";
        document.getElementById("advancedSearch").style.display = "none";
        document.getElementById("moreSearchOption").style.display = "block";
        document.getElementById("shop_departtime").style.display = "none";
        document.getElementById("shop_arrivetime").style.display = "none";
    }
}

function showVacations() {
    if (countrysiteId == "261") { //do different if uk site
        $('#dateContainer').siblings().andSelf().hide();
        document.getElementById("ff29search").style.display = "none";
        document.getElementById("tabbedHeader").style.display = "none";
        //document.getElementById("manageItin").style.display="none";
        //document.location.href = "http://www.unitedvacations.co.uk/index.asp?Referrer=UVUK0015&cmpid=AFC-UAUK";
		document.location.href = "http://www.unitedairlines.co.uk/local/english/SI/ukvacations.html";
    } else if (countrysiteId == "171" && affLang == "jp") { //special JP-ja
        $('#dateContainer').siblings().andSelf().hide();
        document.getElementById("ff29search").style.display = "none";
        document.getElementById("tabbedHeader").style.display = "none";
        //document.getElementById("manageItin").style.display="none";
        document.location.href = "http://www.unitedvacations.co.jp/index.php";
    } else if (countrysiteId == "161") { //special HK
        $('#dateContainer').siblings().andSelf().hide();
        document.getElementById("ff29search").style.display = "none";
        document.getElementById("tabbedHeader").style.display = "none";
        //document.getElementById("manageItin").style.display="none";
        document.location.href = "http://www.unitedvacations.com.hk";
	//} else if (countrysiteId == "71") { //special AU
       // $('#dateContainer').siblings().andSelf().hide();
      //  document.getElementById("ff29search").style.display = "none";
       // document.getElementById("tabbedHeader").style.display = "none";
        //document.getElementById("manageItin").style.display="none";
      //  document.location.href = "http://www.unitedvacations.com.au/";

    } else {
        var shopFrom0Val = document.getElementById("shop_from0").value;
        var shopTo0Val = document.getElementById("shop_to0").value;
        shopFrom0Val = shopFrom0Val.replace("(", "");
        shopTo0Val = shopTo0Val.replace("(", "");
        document.getElementById("shop_from0").value = shopFrom0Val;
        document.getElementById("shop_to0").value = shopTo0Val;
        document.getElementById('vacationO').value = document.getElementById("shop_from0").value;
        document.getElementById('vacationD').value = document.getElementById("shop_to0").value;

        document.getElementById("ff29pane1sub1a").style.display = "none";
        document.getElementById("ff29pane1sub1b").style.display = "none";
        document.getElementById("ff29pane1sub2a").style.display = "block";
        document.getElementById("ff29pane1sub2b").style.display = "block";
        document.getElementById("showVacations").style.display = "none";
        document.getElementById("flights1").style.display = "block";
        document.getElementById("cars1").style.display = "block";
        document.getElementById("hotels1").style.display = "block";
        document.getElementById("cars2").style.display = "none";
        document.getElementById("hotels2").style.display = "none";
        document.getElementById("ff29pane1controller").style.display = "none";
        document.getElementById("advancedSearch").style.display = "none";
        document.getElementById("moreSearchOption").style.display = "block";
        document.getElementById("shop_departtime").style.display = "none";
        document.getElementById("shop_arrivetime").style.display = "none";
    }

}

function hideVacationsPB() {
    document.getElementById("ff29pane1").style.display = "block";
    document.getElementById("ff29pane1sub1a").style.display = "block";
    document.getElementById("ff29pane1sub1b").style.display = "block";
    document.getElementById("ff29pane1sub2a").style.display = "none";
    document.getElementById("ff29pane1sub2b").style.display = "none";
    document.getElementById("showVacations").style.display = "block";
    document.getElementById("flights1").style.display = "none";
    document.getElementById("cars1").style.display = "none";
    document.getElementById("hotels1").style.display = "none";
    document.getElementById("cars2").style.display = "block";
    document.getElementById("hotels2").style.display = "block";
    document.getElementById("advancedSearch").style.display = "block";
    document.getElementById("moreSearchOption").style.display = "none";
    document.getElementById("shop_departtime").style.display = "block";
    document.getElementById("shop_arrivetime").style.display = "block";
}

function hideVacations() {
    document.getElementById("ff29pane1controller").style.display = "block";
    document.getElementById("ff29pane1sub1a").style.display = "block";
    document.getElementById("ff29pane1sub1b").style.display = "block";
    document.getElementById("ff29pane1sub2a").style.display = "none";
    document.getElementById("ff29pane1sub2b").style.display = "none";
    document.getElementById("showVacations").style.display = "block";
    document.getElementById("flights1").style.display = "none";
    document.getElementById("cars1").style.display = "none";
    document.getElementById("hotels1").style.display = "none";
    document.getElementById("cars2").style.display = "block";
    document.getElementById("hotels2").style.display = "block";
    document.getElementById("advancedSearch").style.display = "block";
    document.getElementById("moreSearchOption").style.display = "none";
    document.getElementById("shop_departtime").style.display = "block";
    document.getElementById("shop_arrivetime").style.display = "block";
    document.getElementById("ff29search").style.display = "block";
    document.getElementById("tabbedHeader").style.display = "block";
    //document.getElementById("manageItin").style.display="block";
}

function showFlights() {
    document.getElementById('flightADTmain').selectedIndex = 0;
    if (document.getElementById('wayOne').checked) {
        ff29ToggleReturn('wayOne');
    }
    if (document.getElementById('wayRound').checked) {
        ff29ToggleReturn('wayRound');
    }

    if ((document.getElementById('SearchBySCHEDULE').checked == false) && (document.getElementById('SearchByPRICE').checked == false) && (document.getElementById('SearchByFLEXDATE').checked == false)) {
        document.getElementById('SearchByPRICE').checked = true;
    }
    hideVacations();
}

function showFlightsPB() {
    document.getElementById('flightADTmain').selectedIndex = 0;
    if (document.getElementById('wayOne').checked) {
        ff29ToggleReturn('wayOne');
    }
    if (document.getElementById('wayRound').checked) {
        ff29ToggleReturn('wayRound');
    }

    if ((document.getElementById('SearchBySCHEDULE').checked == false) && (document.getElementById('SearchByPRICE').checked == false) && (document.getElementById('SearchByFLEXDATE').checked == false)) {
        document.getElementById('SearchByPRICE').checked = true;
    }
    hideVacationsPB();
}

//Button2Tab Conversion
ff29modes = 1; // global var of what mode the book travel mode is in (1,2,3)
ff29hptabs = new Array();
//english
ff29hptabs[0] = new Image(122, 33);
ff29hptabs[0].src = "/core/images/09/hpff_bookflight_on_state_124x31_us.gif";
ff29hptabs[1] = new Image(122, 28);
ff29hptabs[1].src = "/core/images/09/hpff_bookflight_off_state_124x31_us.gif";
ff29hptabs[2] = new Image(122, 28);
ff29hptabs[2].src = "/core/images/09/hpff_bookflight_over_state_124x31_us.gif";
ff29hptabs[3] = new Image(121, 33);
ff29hptabs[3].src = "/core/images/09/hpff_redeemmiles_on_state_124x31_us.gif";
ff29hptabs[4] = new Image(121, 28);
ff29hptabs[4].src = "/core/images/09/hpff_redeemmiles_off_state_124x31_us.gif";
ff29hptabs[5] = new Image(121, 28);
ff29hptabs[5].src = "/core/images/09/hpff_redeemmiles_over_state_124x31_us.gif";
//chinese
ff29hptabs[6] = new Image(122, 33);
ff29hptabs[6].src = "/core/images/09/hpff_bookflight_on_state_124x31_cn.gif";
ff29hptabs[7] = new Image(122, 28);
ff29hptabs[7].src = "/core/images/09/hpff_bookflight_off_state_124x31_cn.gif";
ff29hptabs[8] = new Image(122, 28);
ff29hptabs[8].src = "/core/images/09/hpff_bookflight_over_state_124x31_cn.gif";
ff29hptabs[9] = new Image(121, 33);
ff29hptabs[9].src = "/core/images/09/hpff_redeemmiles_on_state_124x31_cn.gif";
ff29hptabs[10] = new Image(121, 28);
ff29hptabs[10].src = "/core/images/09/hpff_redeemmiles_off_state_124x31_cn.gif";
ff29hptabs[11] = new Image(121, 28);
ff29hptabs[11].src = "/core/images/09/hpff_redeemmiles_over_state_124x31_cn.gif";
//germany
ff29hptabs[12] = new Image(122, 33);
ff29hptabs[12].src = "/core/images/09/hpff_bookflight_on_state_124x31_de.gif";
ff29hptabs[13] = new Image(122, 28);
ff29hptabs[13].src = "/core/images/09/hpff_bookflight_off_state_124x31_de.gif";
ff29hptabs[14] = new Image(122, 28);
ff29hptabs[14].src = "/core/images/09/hpff_bookflight_over_state_124x31_de.gif";
ff29hptabs[15] = new Image(121, 33);
ff29hptabs[15].src = "/core/images/09/hpff_redeemmiles_on_state_124x31_de.gif";
ff29hptabs[16] = new Image(121, 28);
ff29hptabs[16].src = "/core/images/09/hpff_redeemmiles_off_state_124x31_de.gif";
ff29hptabs[17] = new Image(121, 28);
ff29hptabs[17].src = "/core/images/09/hpff_redeemmiles_over_state_124x31_de.gif";
//espanol
ff29hptabs[18] = new Image(122, 33);
ff29hptabs[18].src = "/core/images/09/hpff_bookflight_on_state_124x31_es.gif";
ff29hptabs[19] = new Image(122, 28);
ff29hptabs[19].src = "/core/images/09/hpff_bookflight_off_state_124x31_es.gif";
ff29hptabs[20] = new Image(122, 28);
ff29hptabs[20].src = "/core/images/09/hpff_bookflight_over_state_124x31_es.gif";
ff29hptabs[21] = new Image(121, 33);
ff29hptabs[21].src = "/core/images/09/hpff_redeemmiles_on_state_124x31_es.gif";
ff29hptabs[22] = new Image(121, 28);
ff29hptabs[22].src = "/core/images/09/hpff_redeemmiles_off_state_124x31_es.gif";
ff29hptabs[23] = new Image(121, 28);
ff29hptabs[23].src = "/core/images/09/hpff_redeemmiles_over_state_124x31_es.gif";
//french
ff29hptabs[24] = new Image(122, 33);
ff29hptabs[24].src = "/core/images/09/hpff_bookflight_on_state_124x31_fr.gif";
ff29hptabs[25] = new Image(122, 28);
ff29hptabs[25].src = "/core/images/09/hpff_bookflight_off_state_124x31_fr.gif";
ff29hptabs[26] = new Image(122, 28);
ff29hptabs[26].src = "/core/images/09/hpff_bookflight_over_state_124x31_fr.gif";
ff29hptabs[27] = new Image(121, 33);
ff29hptabs[27].src = "/core/images/09/hpff_redeemmiles_on_state_124x31_fr.gif";
ff29hptabs[28] = new Image(121, 28);
ff29hptabs[28].src = "/core/images/09/hpff_redeemmiles_off_state_124x31_fr.gif";
ff29hptabs[29] = new Image(121, 28);
ff29hptabs[29].src = "/core/images/09/hpff_redeemmiles_over_state_124x31_fr.gif";
//japanese
ff29hptabs[30] = new Image(122, 33);
ff29hptabs[30].src = "/core/images/09/hpff_bookflight_on_state_124x31_jp.gif";
ff29hptabs[31] = new Image(122, 28);
ff29hptabs[31].src = "/core/images/09/hpff_bookflight_off_state_124x31_jp.gif";
ff29hptabs[32] = new Image(122, 28);
ff29hptabs[32].src = "/core/images/09/hpff_bookflight_over_state_124x31_jp.gif";
ff29hptabs[33] = new Image(121, 33);
ff29hptabs[33].src = "/core/images/09/hpff_redeemmiles_on_state_124x31_jp.gif";
ff29hptabs[34] = new Image(121, 28);
ff29hptabs[34].src = "/core/images/09/hpff_redeemmiles_off_state_124x31_jp.gif";
ff29hptabs[35] = new Image(121, 28);
ff29hptabs[35].src = "/core/images/09/hpff_redeemmiles_over_state_124x31_jp.gif";
//portugues
ff29hptabs[36] = new Image(122, 33);
ff29hptabs[36].src = "/core/images/09/hpff_bookflight_on_state_124x31_po.gif";
ff29hptabs[37] = new Image(122, 28);
ff29hptabs[37].src = "/core/images/09/hpff_bookflight_off_state_124x31_po.gif";
ff29hptabs[38] = new Image(122, 28);
ff29hptabs[38].src = "/core/images/09/hpff_bookflight_over_state_124x31_po.gif";
ff29hptabs[39] = new Image(121, 33);
ff29hptabs[39].src = "/core/images/09/hpff_redeemmiles_on_state_124x31_po.gif";
ff29hptabs[40] = new Image(121, 28);
ff29hptabs[40].src = "/core/images/09/hpff_redeemmiles_off_state_124x31_po.gif";
ff29hptabs[41] = new Image(121, 28);
ff29hptabs[41].src = "/core/images/09/hpff_redeemmiles_over_state_124x31_po.gif";
//korean
ff29hptabs[42] = new Image(122, 33);
ff29hptabs[42].src = "/core/images/09/hpff_bookflight_on_state_124x31_ko.gif";
ff29hptabs[43] = new Image(122, 28);
ff29hptabs[43].src = "/core/images/09/hpff_bookflight_off_state_124x31_ko.gif";
ff29hptabs[44] = new Image(122, 28);
ff29hptabs[44].src = "/core/images/09/hpff_bookflight_over_state_124x31_ko.gif";
ff29hptabs[45] = new Image(121, 33);
ff29hptabs[45].src = "/core/images/09/hpff_redeemmiles_on_state_124x31_ko.gif";
ff29hptabs[46] = new Image(121, 28);
ff29hptabs[46].src = "/core/images/09/hpff_redeemmiles_off_state_124x31_ko.gif";
ff29hptabs[47] = new Image(121, 28);
ff29hptabs[47].src = "/core/images/09/hpff_redeemmiles_over_state_124x31_ko.gif";
//tradtitional chinese
ff29hptabs[48] = new Image(122, 33);
ff29hptabs[48].src = "/core/images/09/hpff_bookflight_on_state_124x31_tc.gif";
ff29hptabs[49] = new Image(122, 28);
ff29hptabs[49].src = "/core/images/09/hpff_bookflight_off_state_124x31_tc.gif";
ff29hptabs[50] = new Image(122, 28);
ff29hptabs[50].src = "/core/images/09/hpff_bookflight_over_state_124x31_tc.gif";
ff29hptabs[51] = new Image(121, 33);
ff29hptabs[51].src = "/core/images/09/hpff_redeemmiles_on_state_124x31_tc.gif";
ff29hptabs[52] = new Image(121, 28);
ff29hptabs[52].src = "/core/images/09/hpff_redeemmiles_off_state_124x31_tc.gif";
ff29hptabs[53] = new Image(121, 28);
ff29hptabs[53].src = "/core/images/09/hpff_redeemmiles_over_state_124x31_tc.gif";
//italian
ff29hptabs[54] = new Image(122, 33);
ff29hptabs[54].src = "/core/images/09/hpff_bookflight_on_state_124x31_it.gif";
ff29hptabs[55] = new Image(122, 28);
ff29hptabs[55].src = "/core/images/09/hpff_bookflight_off_state_124x31_it.gif";
ff29hptabs[56] = new Image(122, 28);
ff29hptabs[56].src = "/core/images/09/hpff_bookflight_over_state_124x31_it.gif";
ff29hptabs[57] = new Image(121, 33);
ff29hptabs[57].src = "/core/images/09/hpff_redeemmiles_on_state_124x31_it.gif";
ff29hptabs[58] = new Image(121, 28);
ff29hptabs[58].src = "/core/images/09/hpff_redeemmiles_off_state_124x31_it.gif";
ff29hptabs[59] = new Image(121, 28);
ff29hptabs[59].src = "/core/images/09/hpff_redeemmiles_over_state_124x31_it.gif";
//dutch
ff29hptabs[60] = new Image(122, 33);
ff29hptabs[60].src = "/core/images/09/hpff_bookflight_on_state_124x31_nl.gif";
ff29hptabs[61] = new Image(122, 28);
ff29hptabs[61].src = "/core/images/09/hpff_bookflight_off_state_124x31_nl.gif";
ff29hptabs[62] = new Image(122, 28);
ff29hptabs[62].src = "/core/images/09/hpff_bookflight_over_state_124x31_nl.gif";
ff29hptabs[63] = new Image(121, 33);
ff29hptabs[63].src = "/core/images/09/hpff_redeemmiles_on_state_124x31_nl.gif";
ff29hptabs[64] = new Image(121, 28);
ff29hptabs[64].src = "/core/images/09/hpff_redeemmiles_off_state_124x31_nl.gif";
ff29hptabs[65] = new Image(121, 28);
ff29hptabs[65].src = "/core/images/09/hpff_redeemmiles_over_state_124x31_nl.gif";
//thai
ff29hptabs[66] = new Image(122, 33);
ff29hptabs[66].src = "/core/images/09/hpff_bookflight_on_state_124x31_th.gif";
ff29hptabs[67] = new Image(122, 28);
ff29hptabs[67].src = "/core/images/09/hpff_bookflight_off_state_124x31_th.gif";
ff29hptabs[68] = new Image(122, 28);
ff29hptabs[68].src = "/core/images/09/hpff_bookflight_over_state_124x31_th.gif";
ff29hptabs[69] = new Image(121, 33);
ff29hptabs[69].src = "/core/images/09/hpff_redeemmiles_on_state_124x31_th.gif";
ff29hptabs[70] = new Image(121, 28);
ff29hptabs[70].src = "/core/images/09/hpff_redeemmiles_off_state_124x31_th.gif";
ff29hptabs[71] = new Image(121, 28);
ff29hptabs[71].src = "/core/images/09/hpff_redeemmiles_over_state_124x31_th.gif"; /*End - FSN Part 2*/

function ff29AdvSearch()

{

    var telescopeQuery = "";

    telescopeQuery += "http://travel.united.com/ube/core/" + countryTel + "/shop.do?lang=" + langUA2GO + "&Log=1&";


    telescopeQuery += "&shop_departmonth0=" + document.getElementById("shop_departmonth").value;

    telescopeQuery += "&shop_departday0=" + document.getElementById("shop_departday").value;

    telescopeQuery += "&shop_departtime0=" + document.getElementById("shop_departtime").value;

    var shopFrom0Val = document.getElementById("shop_from0").value;
    var shopTo0Val = document.getElementById("shop_to0").value;
    shopFrom0Val = shopFrom0Val.replace("(", "");
    shopTo0Val = shopTo0Val.replace("(", "");

    document.getElementById("shop_from0").value = shopFrom0Val;
    document.getElementById("shop_to0").value = shopTo0Val;
    telescopeQuery += "&shop_from0=" + document.getElementById("shop_from0").value;


    if (document.getElementById("wayRound")) {
        if (document.getElementById("wayRound").checked == true) {
            telescopeQuery += "&shop_to0=" + document.getElementById("shop_to0").value;
            telescopeQuery += "&shop_triptype=roundtrip";
            telescopeQuery += "&shop_arrivemonth0=" + document.getElementById("shop_arrivemonth").value;
            telescopeQuery += "&shop_arriveday0=" + document.getElementById("shop_arriveday").value;
            telescopeQuery += "&shop_arrivetime0=" + document.getElementById("shop_arrivetime").value;
        }
        else if (document.getElementById("wayOne").checked == true) {
            telescopeQuery += "&shop_triptype=oneway";
        }

    }





    if (document.getElementById("SearchBySCHEDULE").checked == true) {
        telescopeQuery += "&shop_viewresults=SCHEDULE";
    }

    if (document.getElementById("SearchByPRICE").checked == true) {
        telescopeQuery += "&shop_viewresults=PRICE";
    }

    if (document.getElementById("SearchByFLEXDATE").checked == true) {
        telescopeQuery += "&shop_viewresults=PRICE";
    }



    if (flightschildandseniorvisible != true)

    {

        telescopeQuery += "&shop_passenger0=" + document.getElementById("flightADTmain").value;

        telescopeQuery += "&shop_passenger1=0-SRC";

        telescopeQuery += "&shop_passenger2=0-CNN";

    }

    else

    {

        telescopeQuery += "&shop_passenger0=" + document.getElementById("flightADT").value;

        telescopeQuery += "&shop_passenger1=" + document.getElementById("flightSRC").value;

        telescopeQuery += "&shop_passenger2=" + document.getElementById("flightCNN").value;

    }
    var isRefundable = "off";
    var tempServiceVal = document.getElementById("serviceclass").value;
    if (document.getElementById("refundable").checked) {
        isRefundable = "on";
        var tempServiceVal = document.getElementById("serviceclass").value + "-REFUNDABLE";
        document.getElementById("serviceclass").value = tempServiceVal;
    } else {
        isRefundable = "off";
        var tempServiceVal = document.getElementById("serviceclass").value + "-NON-REFUNDABLE";
        document.getElementById("serviceclass").value = tempServiceVal;
    }

    telescopeQuery += "&shop_serviceclass=" + tempServiceVal;
    telescopeQuery += "&shop_cabinrefundable=" + isRefundable;
    telescopeQuery += "&shop_cabinclass=" + document.getElementById("serviceclass").value;
    telescopeQuery += "&shop_promotioncode=" + document.getElementById("flightPromocode").value;


    window.location = telescopeQuery;

}

//code added for advanced search link - fsne part 2- ends
var isFltTypesOn = true;

function ff29AffSubmit(typeOfsearch, linkName) {
    var ff29tsMode = 1;
    //Code added for flight and vacation search - FSNE Part 2 - start
    if (document.getElementById("moreSearchOption").style.display == "none") {
        ff29tsMode = 1;
    }
    if (document.getElementById("moreSearchOption").style.display == "block") {
        ff29tsMode = 4;
    }


    if (ff29tsMode == 1) {
        if (typeOfsearch == "normal") {
            if (document.getElementById("shop_from0").value == "" && affType != 3) {
                alert("Departing location (From) is a required field.")
                return false;
            }
            if (document.getElementById("shop_to0").value == "" && affType != 3) {
                alert("Destination location (To) is a required field")
                return false;
            }

            if (!checkForDate()) {
                return false;
            }
            // query flights and ping site metrics (insight first)
            var telescopeQuery = "";
            if (affType == 1) {
                telescopeQuery += "http://travel.united.com/ube/core/" + affCtryCode + "/compactSearch.do?lang=" + langUA2GO + "&Log=0&switch=true&";
            }
            if (affType == 2) {
                if (affCtryCode == "in" || affCtryCode == "dk" || affCtryCode == "se" || affCtryCode == "nz" || affCtryCode == "it" || affCtryCode == "tw" || affCtryCode == "th" || affCtryCode == "vn" || affCtryCode == "es" || affCtryCode == "ru" || affCtryCode == "kw" || affCtryCode == "ae" || affCtryCode == "bh") {
                    if (DASwitch) {
                        telescopeQuery += "https://www.mileageplus.com/awardbooking/award/us/compactSearch.do?lang=en&Log=0&switch=true&";
                    } else {
                        telescopeQuery += "http://travel.united.com/ube/award/us/compactSearch.do?Log=0&switch=true&";
                    }
                } else {
                    telescopeQuery += "http://travel.united.com/ube/award/" + affCtryCode + "/compactSearch.do?lang=" + langUA2GO + "&Log=0&switch=true&";
                }
            }
            if (affType == 3) {
                telescopeQuery += "http://travel.united.com/ube/award/" + affCtryCode + "/awardShop.do?lang=" + langUA2GO + "&Log=0&switch=true&";
            } /*Code added for MP login - FSNE Part 2 - Starts */
            var isMpLogin = false;
            if (document.getElementById("bestPricing").style.display == "block" && (affType == 2 || affType == 3)) {
                if ((document.shopInputForm.userId && document.shopInputForm.userId.value != "") || (document.shopInputForm.password && document.shopInputForm.password.value != "")) {
                    var mpNum = document.shopInputForm.userId.value;
                    var pwd = document.shopInputForm.password.value;
                    if (ValidateUserId3(mpNum, pwd)) {
                        isMpLogin = true;
                        if (affCtryCode == "in" || affCtryCode == "dk" || affCtryCode == "se" || affCtryCode == "nz" || affCtryCode == "it" || affCtryCode == "tw" || affCtryCode == "th" || affCtryCode == "vn" || affCtryCode == "es" || affCtryCode == "ru" || affCtryCode == "kw" || affCtryCode == "ae" || affCtryCode == "bh") {
                            if (DASwitch) {
                                telescopeQuery = "https://www.ua2go.com/ci/DoLogin.jsp?return_to=mp_award_ibe_bridge&fwdPath=compactSearch&Log=1&switch=true&";
                            } else {
                                telescopeQuery = "https://www.ua2go.com/ci/DoLogin.jsp?&return_to=ibe_bridge&fwdPath=compactSearch&Log=1&switch=true&stamp=/" + countryUA2GO + "&lang=" + langUA2GO + "&";
                            }
                        } else {
                            telescopeQuery = "https://www.ua2go.com/ci/DoLogin.jsp?&return_to=ibe_bridge&fwdPath=compactSearch&Log=1&switch=true&stamp=/" + countryUA2GO + "&lang=" + langUA2GO + "&";
                        }


                        if (document.getElementById('remMP1') && document.getElementById('remMP1').checked == true) {
                            if (isEmail(mpNum)) {
                                remEMAIL(mpNum);
                                rememberME('E');
                            } else {
                                remMP(mpNum);
                                rememberME('M');
                            }

                        } else if (document.getElementById('remMP1') && document.getElementById('remMP1').checked == false) {

                            deleteCookie("getMP");
                            deleteCookie('rememberME');
                            deleteCookie('rememberEMAIL');
                        }
                    } else {
                        return false;
                    }
                }

            } /*Code added for MP login - FSNE Part 2 - Ends */
            telescopeQuery += "submitingShopInputForm=true";
            telescopeQuery += "&shop_flightCount=2";
            telescopeQuery += "&changeLanguage=false";
            if (affType == 2 || affType == 3) {
                telescopeQuery += "&languageRedisplayPage=%2Fjsp%2Fshop%2FAward.jsp";
            }
            else {
                telescopeQuery += "&languageRedisplayPage=%2Fjsp%2Fshop%2FShop.jsp";
            }
            telescopeQuery += "&actionType=search";
            telescopeQuery += "&waiting=true";
            if (affType == 2 || affType == 3) {
                if (document.getElementById('Saver').checked == true) {
                    var awardAffVal = 'Saver';
                }
                else {
                    var awardAffVal = 'Standard';
                }
                telescopeQuery += "&award_type=" + awardAffVal;
            }
            if (document.getElementById("wayRound")) {

                if (!isFltTypesOn) {

                    if (document.getElementById("wayRound").checked == true) {
                        telescopeQuery += "&shop_triptype=roundtrip";
                    }

                    else if (document.getElementById("wayOne").checked == true) {
                        telescopeQuery += "&shop_triptype=oneway";
                    }

                } else {

                    if (document.getElementById("wayRound").checked == true) {
                        telescopeQuery += "&shop_triptype=roundtrip";
                    }

                    else if (document.getElementById("wayOne").checked == true) {
                        telescopeQuery += "&shop_triptype=oneway";
                    }

                }
            }
            else {
                //mp fare-finder
                telescopeQuery += "&shop_triptype=roundtrip";
            }

            var shopFrom0Val = document.getElementById("shop_from0").value;
            var shopTo0Val = document.getElementById("shop_to0").value;
            shopFrom0Val = shopFrom0Val.replace("(", "");
            shopTo0Val = shopTo0Val.replace("(", "");
            telescopeQuery += "&shop_from0=" + shopFrom0Val;
            telescopeQuery += "&shop_to0=" + shopTo0Val;

            if (document.getElementById("fromnearby1")) {
                if (document.getElementById("fromnearby1").checked == true) {
                    telescopeQuery += "&shop_fromnearbyairport0=on";
                }
                if (document.getElementById("tonearby1").checked == true) {
                    telescopeQuery += "&shop_tonearbyairport0=on";
                }
            }
            telescopeQuery += "&shop_departtime0=" + document.getElementById("shop_departtime").value;
            telescopeQuery += "&shop_arrivetime0=" + document.getElementById("shop_arrivetime").value;

            if (!isMpLogin) {
                telescopeQuery += "&shop_arriveday0=" + document.getElementById("shop_arriveday").value;
                telescopeQuery += "&shop_departmonth0=" + document.getElementById("shop_departmonth").value;
                telescopeQuery += "&shop_departday0=" + document.getElementById("shop_departday").value;
                telescopeQuery += "&shop_arrivemonth0=" + document.getElementById("shop_arrivemonth").value;
            }


            if (affType == 1) // revenue
            {
                if (document.getElementById("SearchBySCHEDULE")) {
                    if (document.getElementById("SearchBySCHEDULE").checked == true) {
                        telescopeQuery += "&shop_viewresults=SCHEDULE";
                    }
                }
                if (document.getElementById("SearchByPRICE")) {
                    if (document.getElementById("SearchByPRICE").checked == true) {
                        telescopeQuery += "&shop_viewresults=PRICE";
                    }
                }
                if (document.getElementById("SearchByFLEXDATE")) {
                    if (document.getElementById("SearchByFLEXDATE").checked == true) {
                        telescopeQuery += "&shop_viewresults=FLEXDATE";
                    }
                }
            }
            if (affType == 2 || affType == 3) // award search or award more search options
            {
                if (!isMpLogin) {
                    telescopeQuery += "&shop_viewresults=SCHEDULE";
                }

            }

            if (typeof flightschildandseniorvisible == 'boolean') {
                if (flightschildandseniorvisible != true) {
                    telescopeQuery += "&shop_passenger0=" + document.getElementById("flightADTmain").value;
                    telescopeQuery += "&shop_passenger1=0-SRC";
                    telescopeQuery += "&shop_passenger2=0-CNN";
                }
                else {
                    telescopeQuery += "&shop_passenger0=" + document.getElementById("flightADT").value;
                    telescopeQuery += "&shop_passenger1=" + document.getElementById("flightSRC").value;
                    telescopeQuery += "&shop_passenger2=" + document.getElementById("flightCNN").value;
                }
            }
            else {
                //mp fare-finder
                telescopeQuery += "&shop_passenger0=" + document.getElementById("flightADTmain").value;
                telescopeQuery += "&shop_passenger1=0-SRC";
                telescopeQuery += "&shop_passenger2=0-CNN";
            }

            //Code added for FSNE Part 2 - starts
            var isRefundable = "off";
            var tempServiceVal = document.getElementById("serviceclass").value;
            if (document.getElementById("refundable").checked) {
                isRefundable = "on";
                var tempServiceVal = document.getElementById("serviceclass").value + "-REFUNDABLE";
            }
            else {
                isRefundable = "off";
                var tempServiceVal = document.getElementById("serviceclass").value + "-NON-REFUNDABLE";
            }

            if (affType == 2 || affType == 3) {
                telescopeQuery += "&shop_serviceclass=" + document.getElementById("affserviceclass").value;
                telescopeQuery += "&shop_stops=" + document.getElementById("affstops").value;
            }
            else {
                telescopeQuery += "&shop_serviceclass=" + tempServiceVal;
                telescopeQuery += "&shop_cabinrefundable=" + isRefundable;
            }
            telescopeQuery += "&shop_cabinclass=" + document.getElementById("serviceclass").value;
            if (affType == 1) {
                telescopeQuery += "&shop_promotioncode=" + document.getElementById("flightPromocode").value;
            }

            //Code added for FSNE Part 2 - ends
            if (isMpLogin) {
                document.shopInputForm.action = telescopeQuery;
                return true;
            }
            else {
                window.location = telescopeQuery; //window.location=IF_Flight+telescopeQuery;
                return false;
            }
        }
    }
    if (ff29tsMode == 2) {
        if (typeOfsearch == "normal") {
            if (document.getElementById("hotelD").value == "") {
                alert("A city or airport code is required to search for a hotel.")
                return false;
            }
        }
        // query hotels
        var hotelD = document.getElementById("shop_departmonth").value;
        var hotelDsplit = new Array();
        hotelDsplit = hotelD.split('-');
        var hotelR = document.getElementById("shop_arrivemonth").value;
        var hotelRsplit = new Array();
        hotelRsplit = hotelR.split('-');
        var hotelQueryStr = "";
        hotelQueryStr += "united.wwte1.com/pubspec/scripts/eap.asp?eapid=11378-30001&GOTO=HOTSEARCH&lang=1033&ovrd=3&rfrr=-34980";
        if ((typeOfsearch == "options") || (typeOfsearch == "nearanattraction") || (typeOfsearch == "nearanaddress")) {
            hotelQueryStr = ""; //reset hotel query
            hotelQueryStr += "united.wwte1.com/pub/agent.dll?qscr=htwv&from=m&eapi=11378-30001";
            if (typeOfsearch == "options") {
                hotelQueryStr += "&khst=1"
            }
            if (typeOfsearch == "nearanattraction") {
                hotelQueryStr += "&khst=3"
            }
            if (typeOfsearch == "nearanaddress") {
                hotelQueryStr += "&khst=4"
            }
            hotelQueryStr += "&date1=" + hotelDsplit[1] + "%2F" + document.getElementById("shop_departday").value + "%2F" + hotelDsplit[0];
            hotelQueryStr += "&date2=" + hotelRsplit[1] + "%2F" + document.getElementById("shop_arriveday").value + "%2F" + hotelRsplit[0];
            hotelQueryStr += "&cadu1=" + document.getElementById('hotelAdults').value;
            if ((document.getElementById('hotelD').value.length > 0) && (typeOfsearch == "options")) {
                hotelQueryStr += "&loid=-1";
                hotelQueryStr += "&locn=" + document.getElementById('hotelD').value;
            }
            vsCustomItems[vsCustomItems.length] = new Array("v_pc", "HP07");
            vsCustomItems[vsCustomItems.length] = new Array("v_ln", linkName);
            window.location = "http://" + hotelQueryStr;
            return false;
        }
        hotelQueryStr += "&olid=&mdpcid=11378-30001.13.";
        hotelQueryStr += "&CityName=" + document.getElementById('hotelD').value;
        hotelQueryStr += "&InDate=" + hotelDsplit[1] + "/" + document.getElementById("shop_departday").value + "/" + hotelDsplit[0];
        hotelQueryStr += "&OutDate=" + hotelRsplit[1] + "/" + document.getElementById("shop_arriveday").value + "/" + hotelRsplit[0];
        hotelQueryStr += "&NumRoom=1";
        hotelQueryStr += "&NumAdult=" + document.getElementById('hotelAdults').value + "&NumChild=0";
        window.location = "http://" + hotelQueryStr;
        return false;
    }
    if (ff29tsMode == 3) {
        //do nothing, this is the car rental section
        //if necessary a car-quote HTTP GET could be formulated here
    }
    if (ff29tsMode == 4) {
        if (typeOfsearch == "normal") {
            if (document.getElementById('vacationO').value == "") {
                alert("Departing location (From) is a required field.");
                return false;
            }
            if (document.getElementById('vacationD').value == "") {
                alert("Destination location (To) is a required field");
                return false;
            }
        }
        // query vacations (united vacations)
        var vacationsD = document.getElementById("shop_departmonth").value;
        var vacationsDsplit = new Array();
        vacationsDsplit = vacationsD.split('-');
        var vacationsR = document.getElementById("shop_arrivemonth").value;
        var vacationsRsplit = new Array();
        vacationsRsplit = vacationsR.split('-');
        var VacationsQueryStr = "";

        //VacationsQueryStr+="reservations.unitedvacations.com/search/search.aspx?"; updated 01/21/2009 SHD
        VacationsQueryStr += "res.unitedvacations.com/search/ExternalFormPost.aspx?";
        VacationsQueryStr += "&gsVendor=UAT&cartid=&customerid=&plcode="; // irrelevant at the moment, but must be in the search string..
        if (document.getElementById("vacAHC").checked == true) {
            VacationsQueryStr += "&gsvacationtype=AHC01"
        };
        if (document.getElementById("vacAH").checked == true) {
            VacationsQueryStr += "&gsvacationtype=AH01"
        };
        if (document.getElementById("vacAC").checked == true) {
            VacationsQueryStr += "&gsvacationtype=AC01"
        };
        if (document.getElementById("vacHC").checked == true) {
            VacationsQueryStr += "&gsvacationtype=HC01"
        };
        if (typeOfsearch == "options") {
            //window.location = "http://res.unitedvacations.com/search/Default.aspx?Referrer=Z24"; updated 01/21/2009 SHD
            window.location = "http://res.unitedvacations.com/search/Default.aspx?Referrer=Z24";
        }
        VacationsQueryStr += "&gsOrigin=" + document.getElementById('vacationO').value; // orig 
        VacationsQueryStr += "&gsDestination=" + document.getElementById('vacationD').value; // dest
        VacationsQueryStr += "&gsNumberOfTravelers=" + document.getElementById('vacationsAdults').value; // number of travelers
        var qpfdepartMonth = document.getElementById('shop_departmonth').value;
        var qpfarriveMonth = document.getElementById('shop_arrivemonth').value;
        VacationsQueryStr += "&gsDepartureDate=" + qpfdepartMonth.substr(5, 2) + "/" + document.getElementById('shop_departday').value + "/" + qpfdepartMonth.substr(2, 2); // ret
        VacationsQueryStr += "&gslengthofstay="; // irrelevant at the moment, but must be in the search string..
        VacationsQueryStr += "&gsReturnDate=" + qpfarriveMonth.substr(5, 2) + "/" + document.getElementById('shop_arriveday').value + "/" + qpfarriveMonth.substr(2, 2); // dep
        VacationsQueryStr += "&Referrer=Z24"; // this is really important to have in the string..
        window.location = "http://" + VacationsQueryStr;
        return false;
    }
}

/*Added for Book flight button change - FSN Part 2 - starts*/

function ff29tabhover(currTab, polarity) {

    if (currTab == 1 && currTab != ff29modes) {

        if (polarity == "over") {
            document.images['ff29bttab1'].src = ff29hptabs[2].src;
        }
        if (polarity == "out") {
            document.images['ff29bttab1'].src = ff29hptabs[1].src;
        }
    }

    else if (currTab == 2 && currTab != ff29modes) {
        if (ff29modes == 1) {
            if (polarity == "over") {
                document.images['ff29bttab2'].src = ff29hptabs[5].src;
            }
            if (polarity == "out") {
                document.images['ff29bttab2'].src = ff29hptabs[4].src;
            }
        }
    }
    //chinese
    else if (currTab == 3 && currTab != ff29modes) {
        if (ff29modes == 2) {
            if (polarity == "over") {
                document.images['ff29bttab1'].src = ff29hptabs[8].src;
            }
            if (polarity == "out") {
                document.images['ff29bttab1'].src = ff29hptabs[7].src;
            }
        }
    }
    else if (currTab == 4 && currTab != ff29modes) {
        if (ff29modes == 1) {
            if (polarity == "over") {
                document.images['ff29bttab2'].src = ff29hptabs[11].src;
            }
            if (polarity == "out") {
                document.images['ff29bttab2'].src = ff29hptabs[10].src;
            }
        }
    }
    //german
    else if (currTab == 5 && currTab != ff29modes) {
        if (ff29modes == 2) {
            if (polarity == "over") {
                document.images['ff29bttab1'].src = ff29hptabs[14].src;
            }
            if (polarity == "out") {
                document.images['ff29bttab1'].src = ff29hptabs[13].src;
            }
        }
    }
    else if (currTab == 6 && currTab != ff29modes) {
        if (ff29modes == 1) {
            if (polarity == "over") {
                document.images['ff29bttab2'].src = ff29hptabs[17].src;
            }
            if (polarity == "out") {
                document.images['ff29bttab2'].src = ff29hptabs[16].src;
            }
        }
    }
    //espanol
    else if (currTab == 7 && currTab != ff29modes) {
        if (ff29modes == 2) {
            if (polarity == "over") {
                document.images['ff29bttab1'].src = ff29hptabs[20].src;
            }
            if (polarity == "out") {
                document.images['ff29bttab1'].src = ff29hptabs[19].src;
            }
        }
    }
    else if (currTab == 8 && currTab != ff29modes) {
        if (ff29modes == 1) {
            if (polarity == "over") {
                document.images['ff29bttab2'].src = ff29hptabs[23].src;
            }
            if (polarity == "out") {
                document.images['ff29bttab2'].src = ff29hptabs[22].src;
            }
        }
    }
    //french
    else if (currTab == 9 && currTab != ff29modes) {
        if (ff29modes == 2) {
            if (polarity == "over") {
                document.images['ff29bttab1'].src = ff29hptabs[26].src;
            }
            if (polarity == "out") {
                document.images['ff29bttab1'].src = ff29hptabs[25].src;
            }
        }
    }
    else if (currTab == 10 && currTab != ff29modes) {
        if (ff29modes == 1) {
            if (polarity == "over") {
                document.images['ff29bttab2'].src = ff29hptabs[29].src;
            }
            if (polarity == "out") {
                document.images['ff29bttab2'].src = ff29hptabs[28].src;
            }
        }
    }
    //japanese
    else if (currTab == 11 && currTab != ff29modes) {
        if (ff29modes == 2) {
            if (polarity == "over") {
                document.images['ff29bttab1'].src = ff29hptabs[32].src;
            }
            if (polarity == "out") {
                document.images['ff29bttab1'].src = ff29hptabs[31].src;
            }
        }
    }
    else if (currTab == 12 && currTab != ff29modes) {
        if (ff29modes == 1) {
            if (polarity == "over") {
                document.images['ff29bttab2'].src = ff29hptabs[35].src;
            }
            if (polarity == "out") {
                document.images['ff29bttab2'].src = ff29hptabs[34].src;
            }
        }
    }
    //portugues
    else if (currTab == 13 && currTab != ff29modes) {
        if (ff29modes == 2) {
            if (polarity == "over") {
                document.images['ff29bttab1'].src = ff29hptabs[38].src;
            }
            if (polarity == "out") {
                document.images['ff29bttab1'].src = ff29hptabs[37].src;
            }
        }
    }
    else if (currTab == 14 && currTab != ff29modes) {
        if (ff29modes == 1) {
            if (polarity == "over") {
                document.images['ff29bttab2'].src = ff29hptabs[41].src;
            }
            if (polarity == "out") {
                document.images['ff29bttab2'].src = ff29hptabs[40].src;
            }
        }
    }
    //korean
    else if (currTab == 15 && currTab != ff29modes) {
        if (ff29modes == 2) {
            if (polarity == "over") {
                document.images['ff29bttab1'].src = ff29hptabs[44].src;
            }
            if (polarity == "out") {
                document.images['ff29bttab1'].src = ff29hptabs[43].src;
            }
        }
    }
    else if (currTab == 16 && currTab != ff29modes) {
        if (ff29modes == 1) {
            if (polarity == "over") {
                document.images['ff29bttab2'].src = ff29hptabs[47].src;
            }
            if (polarity == "out") {
                document.images['ff29bttab2'].src = ff29hptabs[46].src;
            }
        }
    }
    //traditional chinese
    else if (currTab == 17 && currTab != ff29modes) {
        if (ff29modes == 2) {
            if (polarity == "over") {
                document.images['ff29bttab1'].src = ff29hptabs[50].src;
            }
            if (polarity == "out") {
                document.images['ff29bttab1'].src = ff29hptabs[49].src;
            }
        }
    }
    else if (currTab == 18 && currTab != ff29modes) {
        if (ff29modes == 1) {
            if (polarity == "over") {
                document.images['ff29bttab2'].src = ff29hptabs[53].src;
            }
            if (polarity == "out") {
                document.images['ff29bttab2'].src = ff29hptabs[52].src;
            }
        }
    }
    //Italian
    else if (currTab == 19 && currTab != ff29modes) {
        if (ff29modes == 2) {
            if (polarity == "over") {
                document.images['ff29bttab1'].src = ff29hptabs[56].src;
            }
            if (polarity == "out") {
                document.images['ff29bttab1'].src = ff29hptabs[55].src;
            }
        }
    }
    else if (currTab == 20 && currTab != ff29modes) {
        if (ff29modes == 1) {
            if (polarity == "over") {
                document.images['ff29bttab2'].src = ff29hptabs[59].src;
            }
            if (polarity == "out") {
                document.images['ff29bttab2'].src = ff29hptabs[58].src;
            }
        }
    }
    //Dutch
    else if (currTab == 21 && currTab != ff29modes) {
        if (ff29modes == 2) {
            if (polarity == "over") {
                document.images['ff29bttab1'].src = ff29hptabs[62].src;
            }
            if (polarity == "out") {
                document.images['ff29bttab1'].src = ff29hptabs[61].src;
            }
        }
    }
    else if (currTab == 22 && currTab != ff29modes) {
        if (ff29modes == 1) {
            if (polarity == "over") {
                document.images['ff29bttab2'].src = ff29hptabs[65].src;
            }
            if (polarity == "out") {
                document.images['ff29bttab2'].src = ff29hptabs[64].src;
            }
        }
    }
    //Thai
    else if (currTab == 23 && currTab != ff29modes) {
        if (ff29modes == 2) {
            if (polarity == "over") {
                document.images['ff29bttab1'].src = ff29hptabs[68].src;
            }
            if (polarity == "out") {
                document.images['ff29bttab1'].src = ff29hptabs[67].src;
            }
        }
    }
    else if (currTab == 24 && currTab != ff29modes) {
        if (ff29modes == 1) {
            if (polarity == "over") {
                document.images['ff29bttab2'].src = ff29hptabs[71].src;
            }
            if (polarity == "out") {
                document.images['ff29bttab2'].src = ff29hptabs[70].src;
            }
        }
    }
}

/* Added for Book flight button change - FSN Part 2 - ends */

function chgAff(fltT) { /* Added to change the mode of the tab from book flights to redeem miles - FSN Part 2 - Starts*/
    ff29modes = fltT; /* Added to change the mode of the tab from book flights to redeem miles - FSN Part 2 - ends */
    vsAffSwitch = 'T';

    clrErrMsgs();
    var localLanguage = langLocal.substring(langLocal.indexOf("/") + 1, langLocal.lastIndexOf("/"));
    var ua2goCountry = countryUA2GO.substring(2);

    if (fltT == 1) { /* Added for tab image and radio button to be checked by default - FSN Part 2 - Start*/
        document.images['ff29bttab1'].src = ff29hptabs[0].src;
        document.images['ff29bttab2'].src = ff29hptabs[4].src;
        if (localLanguage == "chinese") {
            document.images['ff29bttab1'].src = ff29hptabs[6].src;
            document.images['ff29bttab2'].src = ff29hptabs[10].src;
        }
        else if (localLanguage == "deutsch") {
            document.images['ff29bttab1'].src = ff29hptabs[12].src;
            document.images['ff29bttab2'].src = ff29hptabs[16].src;
        }
        else if (localLanguage == "espanol") {
            document.images['ff29bttab1'].src = ff29hptabs[18].src;
            document.images['ff29bttab2'].src = ff29hptabs[22].src;
        }
        else if (localLanguage == "french") {
            document.images['ff29bttab1'].src = ff29hptabs[24].src;
            document.images['ff29bttab2'].src = ff29hptabs[28].src;
        }
        else if (localLanguage == "japanese") {
            document.images['ff29bttab1'].src = ff29hptabs[30].src;
            document.images['ff29bttab2'].src = ff29hptabs[34].src;
        }
        else if (localLanguage == "portugues") {
            document.images['ff29bttab1'].src = ff29hptabs[36].src;
            document.images['ff29bttab2'].src = ff29hptabs[40].src;
        }
        else if (localLanguage == "korean") {
            document.images['ff29bttab1'].src = ff29hptabs[42].src;
            document.images['ff29bttab2'].src = ff29hptabs[46].src;
        }
        else if (localLanguage == "trchinese") {
            document.images['ff29bttab1'].src = ff29hptabs[48].src;
            document.images['ff29bttab2'].src = ff29hptabs[52].src;
        }
        else if (localLanguage == "italian") {
            document.images['ff29bttab1'].src = ff29hptabs[54].src;
            document.images['ff29bttab2'].src = ff29hptabs[58].src;
        }
        else if (localLanguage == "dutch") {
            document.images['ff29bttab1'].src = ff29hptabs[60].src;
            document.images['ff29bttab2'].src = ff29hptabs[64].src;
        }
        else if (localLanguage == "dutch") {
            document.images['ff29bttab1'].src = ff29hptabs[66].src;
            document.images['ff29bttab2'].src = ff29hptabs[70].src;
        } /* Added for tab image and radio button to be checked by default - FSN Part 2 - End */
        //search flts
        affType = 1;
        flightschildandseniorvisible = false;
        if (affTripType == 1) {
            ff29ToggleReturn('wayOne');
        }
        else {
            ff29ToggleReturn('wayRound');
        }

        if (!isFltTypesOn) {
            document.getElementById('fltTypes').style.display = 'block';
            document.getElementById("ff29Rlabel").style.display = "block";
            document.getElementById("ff29Ritem").style.display = "block";
        }
        document.getElementById('fltTypes').style.display = 'block'; /*Added new div in HTML for cabin and login - FSN Part 2 -  Start*/
        document.getElementById('lbl-pass-adlt').style.display = 'block';
        document.getElementById('affAwdSrchOptsNew').style.display = 'none';
        document.getElementById('loginNowblock').style.display = 'none';

        document.getElementById('mpLogin').style.display = 'none';
        document.getElementById('advancedSearch').style.display = 'block';
        document.getElementById('arrow_multicity').style.display = 'block';
        document.getElementById('newSubscript').style.display = 'none'; /* Added new div in HTML for cabin and login - FSN Part 2 - End */

        //TM - Removed as part of radio button hide
        //document.getElementById('affFltSrch').style.display='block';
        document.getElementById('affAwdSrch').style.display = 'none';
        document.getElementById('affFltSrch').style.display = 'block';
        document.getElementById('affChldSen').style.display = 'block';
        var check10Alert = 0;
        if (document.getElementById('flightSRC').selectedIndex > 0 || document.getElementById('flightCNN').selectedIndex > 0) {
            document.getElementById('childseniorcompact').style.display = 'none';
            document.getElementById('childseniorfull').style.display = 'block';
            if (document.getElementById('flightADT').selectedIndex + document.getElementById('flightSRC').selectedIndex + document.getElementById('flightCNN').selectedIndex - 1 > 8) {
                document.getElementById('flightADTmain').selectedIndex = 8;
                var check10Alert = 1;
            }
            else {
                document.getElementById('flightADTmain').selectedIndex = (document.getElementById('flightADT').selectedIndex + document.getElementById('flightSRC').selectedIndex + document.getElementById('flightCNN').selectedIndex) - 1;
            }
        }
        else {
            document.getElementById('childseniorcompact').style.display = 'block';
            document.getElementById('childseniorfull').style.display = 'none';
            if (document.getElementById('childseniorfull').style.display == 'block') {
                if (document.getElementById('flightADTmain').selectedIndex > 0) // 31
                {
                    document.getElementById('flightADTmain').selectedIndex = document.getElementById('flightADT').selectedIndex - 1;
                }
            }
            else {
                if ((document.getElementById('flightSRC').selectedIndex == 0 && document.getElementById('flightCNN').selectedIndex == 0) && document.getElementById('flightADTmain').selectedIndex == 0 && document.getElementById('flightADT').selectedIndex != 0) {
                    document.getElementById('flightADTmain').selectedIndex = document.getElementById('flightADT').selectedIndex - 1;
                }
            }
        }
        if (document.getElementById('childseniorfull').style.display == 'block') {
            flightschildandseniorvisible = true; // 229
            if (document.getElementById('flightSRC').selectedIndex > 0 || document.getElementById('flightCNN').selectedIndex > 0) {
                if (((document.getElementById('flightADTmain').selectedIndex + 1) - (document.getElementById('flightSRC').selectedIndex + document.getElementById('flightCNN').selectedIndex)) > 0) {
                    document.getElementById('flightADT').selectedIndex = ((document.getElementById('flightADTmain').selectedIndex + 1) - (document.getElementById('flightSRC').selectedIndex + document.getElementById('flightCNN').selectedIndex));
                }
                else {
                    document.getElementById('flightADT').selectedIndex = 0;

                    if (document.getElementById('srvErr0')) {

                        document.getElementById('srvErr0').style.display = 'block';

                    }
                    if (document.getElementById('srvErr0')) {
                        errVal = document.getElementById('srvErr0');
                        errVal.style.display = 'block';
                        errVal.innerHTML = affPass0Msg;
                        errVal.className = 'err';
                    }
                    if (document.getElementById('lbl-pass0')) {
                        document.getElementById('lbl-pass0').className = 'err';
                    }
                }
            }
            else {
                flightschildandseniorvisible = false; // 229
                if (document.getElementById('flightSRC').selectedIndex > 0 || document.getElementById('flightCNN').selectedIndex > 0) {
                    //alert('popopen');
                    document.getElementById('flightADTmain').selectedIndex = document.getElementById('flightADT').selectedIndex + 1;
                }
            }
        }

        if (document.getElementById('affMoreText')) {
            document.getElementById('affMoreText').innerHTML = affMore1;
        }

        document.getElementById('affFltSrchOpts').style.display = 'block';

        if (document.getElementById('affAwdSrchOpts')) {
            document.getElementById('affAwdSrchOpts').style.display = 'none';
        }
        //document.getElementById('affAwdFee').style.display='none'; Commented as there is no element with this id in home page and PB landing page
        if (document.getElementById('stops')) {
            document.getElementById('stops').selectedIndex = document.getElementById('affstops').selectedIndex;
        }

        if (document.getElementById('childseniorfull').style.display == 'block') {
            if (document.getElementById('flightADTmain').selectedIndex > 0) {
                document.getElementById('flightADTmain').selectedIndex = document.getElementById('flightADT').selectedIndex - 1;
            }
        }
        if (document.getElementById('flightADTmain').selectedIndex == -1) {
            document.getElementById('flightADTmain').selectedIndex = 0;
        }
        if (document.getElementById('affserviceclass') && document.getElementById('serviceclass')) {
            document.getElementById('serviceclass').selectedIndex = document.getElementById('affserviceclass').selectedIndex;
        }
    }
    else {
        //book miles
        /* Added for tab image, and radio button - Start - FSN Part 2 -*/
        if (isFltTypesOn) {

            document.getElementById('fltTypes').style.display = 'block';

            if (document.getElementById("wayOne")) {

                if (document.getElementById("wayOne").checked == true) {

                    document.getElementById("ff29Rlabel").style.display = "none";

                    document.getElementById("ff29Ritem").style.display = "none";
                } else {

                    document.getElementById("ff29Ritem").style.display = "block";

                    document.getElementById("ff29Rlabel").style.display = "block";
                }
            }
        } else {

            if (document.getElementById("wayOne")) {

                if (document.getElementById("wayOne").checked == true) {
                    document.getElementById("wayRound").checked = true;
                    document.getElementById("ff29Rlabel").style.display = "block";
                    document.getElementById("ff29Ritem").style.display = "block";
                }
            }

            document.getElementById('fltTypes').style.display = 'none';
        }
        document.images['ff29bttab1'].src = ff29hptabs[1].src;
        document.images['ff29bttab2'].src = ff29hptabs[3].src;
        if (localLanguage == "chinese") {
            document.images['ff29bttab1'].src = ff29hptabs[7].src;
            document.images['ff29bttab2'].src = ff29hptabs[9].src;
        }
        else if (localLanguage == "deutsch") {
            document.images['ff29bttab1'].src = ff29hptabs[13].src;
            document.images['ff29bttab2'].src = ff29hptabs[15].src;
        }
        else if (localLanguage == "espanol") {
            document.images['ff29bttab1'].src = ff29hptabs[19].src;
            document.images['ff29bttab2'].src = ff29hptabs[21].src;
        }
        else if (localLanguage == "french") {
            document.images['ff29bttab1'].src = ff29hptabs[25].src;
            document.images['ff29bttab2'].src = ff29hptabs[27].src;
        }
        else if (localLanguage == "japanese") {
            document.images['ff29bttab1'].src = ff29hptabs[31].src;
            document.images['ff29bttab2'].src = ff29hptabs[33].src;
        }
        else if (localLanguage == "portugues") {
            document.images['ff29bttab1'].src = ff29hptabs[37].src;
            document.images['ff29bttab2'].src = ff29hptabs[39].src;
        }
        else if (localLanguage == "korean") {
            document.images['ff29bttab1'].src = ff29hptabs[43].src;
            document.images['ff29bttab2'].src = ff29hptabs[45].src;
        }
        else if (localLanguage == "trchinese") {
            document.images['ff29bttab1'].src = ff29hptabs[49].src;
            document.images['ff29bttab2'].src = ff29hptabs[51].src;
        }
        else if (localLanguage == "italian") {
            document.images['ff29bttab1'].src = ff29hptabs[55].src;
            document.images['ff29bttab2'].src = ff29hptabs[57].src;
        }
        else if (localLanguage == "dutch") {
            document.images['ff29bttab1'].src = ff29hptabs[61].src;
            document.images['ff29bttab2'].src = ff29hptabs[63].src;
        }
        else if (localLanguage == "thai") {
            document.images['ff29bttab1'].src = ff29hptabs[67].src;
            document.images['ff29bttab2'].src = ff29hptabs[69].src;
        } /* Added for tab image, and radio button - End - FSN Part 2 */

        affType = 2;
        flightschildandseniorvisible = false; // 229
        /* Start - FSN Part 2 Added new div in HTML for cabin and login*/

        document.getElementById('affAwdSrchOptsNew').style.display = 'block';
        document.getElementById('arrow_multicity').style.display = 'none';
        document.getElementById('newSubscript').style.display = 'block';
        document.getElementById('advancedSearch').style.display = 'none';
        document.getElementById('lbl-pass-adlt').style.display = 'block';

        if (getCookie("rememberProfile") == null) {
            document.getElementById('loginNowblock').style.display = 'block';
            if (document.getElementById('bestPricing').style.display == 'none') {
                document.getElementById('mpLogin').style.display = 'block';
            }
        } /* End - FSN Part 2 Added new div in HTML for cabin and login*/

        document.getElementById('affFltSrch').style.display = 'none';
        document.getElementById('affAwdSrch').style.display = 'block';


        var check10Alert = 0;
        if (document.getElementById('flightSRC').selectedIndex > 0 || document.getElementById('flightCNN').selectedIndex > 0) {
            document.getElementById('childseniorcompact').style.display = 'none';
            document.getElementById('childseniorfull').style.display = 'block';

            if (document.getElementById('flightADT').selectedIndex + document.getElementById('flightSRC').selectedIndex + document.getElementById('flightCNN').selectedIndex - 1 > 8) {

                document.getElementById('flightADTmain').selectedIndex = 8;
                var check10Alert = 1;

            }
            else {
                document.getElementById('flightADTmain').selectedIndex = (document.getElementById('flightADT').selectedIndex + document.getElementById('flightSRC').selectedIndex + document.getElementById('flightCNN').selectedIndex) - 1;
            }
        }
        else {
            document.getElementById('childseniorcompact').style.display = 'block';
            document.getElementById('childseniorfull').style.display = 'none';

            if (document.getElementById('childseniorfull').style.display == 'block') {
                if (document.getElementById('flightADTmain').selectedIndex > 0) // 31
                { // 31
                    document.getElementById('flightADTmain').selectedIndex = document.getElementById('flightADT').selectedIndex - 1;
                } // 31
            }
            else {
                if ((document.getElementById('flightSRC').selectedIndex == 0 && document.getElementById('flightCNN').selectedIndex == 0) && document.getElementById('flightADTmain').selectedIndex == 0 && document.getElementById('flightADT').selectedIndex != 0) {
                    document.getElementById('flightADTmain').selectedIndex = document.getElementById('flightADT').selectedIndex - 1;
                }
            }
        }

        if (document.getElementById('childseniorfull').style.display == 'block') {
            flightschildandseniorvisible = true; // 229
            if (document.getElementById('flightSRC').selectedIndex > 0 || document.getElementById('flightCNN').selectedIndex > 0) {
                if (((document.getElementById('flightADTmain').selectedIndex + 1) - (document.getElementById('flightSRC').selectedIndex + document.getElementById('flightCNN').selectedIndex)) > 0) {
                    document.getElementById('flightADT').selectedIndex = ((document.getElementById('flightADTmain').selectedIndex + 1) - (document.getElementById('flightSRC').selectedIndex + document.getElementById('flightCNN').selectedIndex));
                }
                else {
                    document.getElementById('flightADT').selectedIndex = 0;
                    if (document.getElementById('srvErr0')) {
                        document.getElementById('srvErr0').style.display = 'block';
                    }
                    if (document.getElementById('srvErr0')) {
                        errVal = document.getElementById('srvErr0');
                        errVal.style.display = 'block';
                        errVal.innerHTML = affPass0Msg;
                        errVal.className = 'err';
                    }
                    if (document.getElementById('lbl-pass0')) {
                        document.getElementById('lbl-pass0').className = 'err';
                    }
                }
            }
            else {
                flightschildandseniorvisible = false; // 229
                if (document.getElementById('flightSRC').selectedIndex > 0 || document.getElementById('flightCNN').selectedIndex > 0) {
                    //alert('popopen');
                    document.getElementById('flightADTmain').selectedIndex = document.getElementById('flightADT').selectedIndex + 1;
                }
            }
        }
        if (document.getElementById('affMoreText')) {
            document.getElementById('affMoreText').innerHTML = affMore2;
        }

        document.getElementById('affFltSrchOpts').style.display = 'none';
        if (document.getElementById('affAwdSrchOpts')) {
            document.getElementById('affAwdSrchOpts').style.display = 'block';
        }

        //document.getElementById('affAwdFee').style.display='block';Commented as there is no element with this id in home page and PB landing page
        if (document.getElementById('stops')) {
            document.getElementById('affstops').selectedIndex = document.getElementById('stops').selectedIndex;
        }

        if (check10Alert == 1) {
            //alert(affPass10Msg);
            if (document.getElementById('lbl-pass-adlt')) {
                document.getElementById('lbl-pass-adlt').className = 'err';
            }
            if (document.getElementById('srvErr0')) {
                document.getElementById('srvErr0').style.display = 'block';
            }
            if (document.getElementById('srvErr0')) {
                errVal = document.getElementById('srvErr0');
                errVal.innerHTML = affPass10Msg;
                errVal.className = 'err';
                errVal.style.marginBottom = '5px';
            }

        }
        if (document.getElementById('childseniorfull').style.display == 'block') {
            if (document.getElementById('flightADTmain').selectedIndex > 0) {
                document.getElementById('flightADTmain').selectedIndex = document.getElementById('flightADT').selectedIndex - 1;
            }
        }
        if (document.getElementById('flightADTmain').selectedIndex == -1) {
            document.getElementById('flightADTmain').selectedIndex = 0;
        }

        if (document.getElementById('affserviceclass') && document.getElementById('serviceclass')) {
            document.getElementById('affserviceclass').selectedIndex = document.getElementById('serviceclass').selectedIndex;
        }
    }
}

function clrErrMsgs() {
    if (document.getElementById('lbl-pass-adlt')) {
        document.getElementById('lbl-pass-adlt').className = '';
    }
    if (document.getElementById('srvErr0')) {
        document.getElementById('srvErr0').innerHTML = '';
        document.getElementById('srvErr0').style.display = 'none';
    }
    if (document.getElementById('lbl-pass0')) {
        document.getElementById('lbl-pass0').className = 'ff29generic';
    }
} 

function ValidateUserId3(mpNum, pwd) {

    var searchValue = mpNum.replace(/^\s*|\s*$/g, '');

    var msg = '';
    if (searchValue.length == 0) {
        msg = 'MileagePlus # or email address is a required field.\n';
    }

    else if (/^\d{1,11}$/.test(searchValue)) {
        while (searchValue.length < 11) {
            searchValue = "0" + searchValue
        }; //pad left with 0 until length 11
        mpNum = searchValue;

        if (validateMP(searchValue)) {
            //f.authType.value="mp"; 
        } else {
            msg = 'The MileagePlus number you have entered is invalid. Please check the number and resubmit.\n';
        } //end testing for mpno
        //try to validate for email now
    } else if (validateEml(searchValue)) {
        //f.authType.value="ea";
    } else {
        msg = 'The MileagePlus number or the email address you have entered is invalid. Please check the number or email address and resubmit.\n';
    }

    if (pwd.length == 0) {
        msg += 'Password is a required field.\n';
    }
    if (msg) {
        msg = 'Please Supply the Following:\n\n' + msg;
        alert(msg);
        return false;
    }

    return true;
}

function manageMyItinerary() {
    //langLocal="local/chinese/";
    //countryUA2GO="uachina";
    //countrysiteId= 211;
    var localLanguage = langLocal.substring(langLocal.indexOf("/") + 1, langLocal.lastIndexOf("/"));
    var ua2goCountry = countryUA2GO.substring(2);
    if (localLanguage == "english" && ua2goCountry == "dubai" && countrysiteId == 531) {
        window.location = "http://ae.united.com/core/english/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "english" && ua2goCountry == "argentina" && countrysiteId == 61) {
        window.location = "http://www.united.com.ar/core/english/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "espanol" && ua2goCountry == "argentina" && countrysiteId == 61) {
        window.location = "http://www.united.com.ar/core/espanol/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "english" && ua2goCountry == "australia" && countrysiteId == 71) {
        window.location = "http://www.unitedairlines.com.au/core/english/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "english" && ua2goCountry == "bahrain" && countrysiteId == 701) {
        window.location = "http://bh.united.com/core/english/IC/login/index.html";
    }
    else if (localLanguage == "english" && ua2goCountry == "belgium" && countrysiteId == 81) {
        window.location = "http://www.unitedairlines.be/core/english/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "french" && ua2goCountry == "belgium" && countrysiteId == 81) {
        window.location = "http://www.unitedairlines.be/core/french/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "english" && ua2goCountry == "brazil" && countrysiteId == 91) {
        window.location = "http://www.united.com.br/core/english/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "portugues" && ua2goCountry == "brazil" && countrysiteId == 91) {
        window.location = "http://www.united.com.br/core/portugues/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "english" && ua2goCountry == "canada" && countrysiteId == 101) {
        window.location = "http://www.united.ca/core/english/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "french" && ua2goCountry == "canada" && countrysiteId == 101) {
        window.location = "http://www.united.ca/core/french/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "english" && ua2goCountry == "france" && countrysiteId == 131) {
        window.location = "http://www.united.fr/core/english/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "french" && ua2goCountry == "france" && countrysiteId == 131) {
        window.location = "http://www.united.fr/core/french/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "english" && ua2goCountry == "germany" && countrysiteId == 141) {
        window.location = "http://www.unitedairlines.de/core/english/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "deutsch" && ua2goCountry == "germany" && countrysiteId == 141) {
        window.location = "http://www.unitedairlines.de/core/deutsch/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "english" && ua2goCountry == "hongkong" && countrysiteId == 161) {
        window.location = "http://www.unitedairlines.com.hk/core/english/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "trchinese" && ua2goCountry == "hongkong" && countrysiteId == 161) {
        window.location = "http://www.unitedairlines.com.hk/core/trchinese/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "english" && ua2goCountry == "italy" && countrysiteId == 471) {
        window.location = "http://it.united.com/core/english/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "italian" && ua2goCountry == "italy" && countrysiteId == 471) {
        window.location = "http://it.united.com/core/italian/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "english" && ua2goCountry == "japan" && countrysiteId == 171) {
        window.location = "http://www.unitedairlines.co.jp/core/english/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "japanese" && ua2goCountry == "japan" && countrysiteId == 171) {
        window.location = "http://www.unitedairlines.co.jp/core/japanese/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "english" && ua2goCountry == "korea" && countrysiteId == 181) {
        window.location = "http://www.kr.united.com/core/english/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "korean" && ua2goCountry == "korea" && countrysiteId == 181) {
        window.location = "http://www.kr.united.com/core/korean/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "english" && ua2goCountry == "kuwait" && countrysiteId == 111) {
        window.location = "http://www.kw.united.com/core/english/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "english" && ua2goCountry == "mexico" && countrysiteId == 191) {
        window.location = "http://www.united.com.mx/core/english/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "espanol" && ua2goCountry == "mexico" && countrysiteId == 191) {
        window.location = "http://www.united.com.mx/core/espanol/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "english" && ua2goCountry == "netherlands" && countrysiteId == 201) {
        window.location = "http://www.unitedairlines.nl/core/english/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "english" && ua2goCountry == "china" && countrysiteId == 211) {
        window.location = "http://www.cn.united.com/core/english/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "chinese" && ua2goCountry == "china" && countrysiteId == 211) {
        window.location = "http://www.cn.united.com/core/chinese/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "english" && ua2goCountry == "russia" && countrysiteId == 501) {
        window.location = "http://ru.united.com/core/english/IC/login/index.html";
    }
    else if (localLanguage == "english" && ua2goCountry == "singapore" && countrysiteId == 221) {
        window.location = "http://www.unitedairlines.com.sg/core/english/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "english" && ua2goCountry == "spain" && countrysiteId == 511) {
        window.location = "http://es.united.com/core/english/IC/login/index.html";
    }
    else if (localLanguage == "english" && ua2goCountry == "switzerland" && countrysiteId == 231) {
        window.location = "http://www.unitedairlines.ch/core/english/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "deutsch" && ua2goCountry == "switzerland" && countrysiteId == 231) {
        window.location = "http://www.unitedairlines.ch/core/deutsch/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "english" && ua2goCountry == "taiwan" && countrysiteId == 241) {
        window.location = "http://www.tw.united.com/core/english/IC/login/index.html";
    }
    else if (localLanguage == "trchinese" && ua2goCountry == "taiwan" && countrysiteId == 241) {
        window.location = "http://www.tw.united.com/core/trchinese/IC/login/index.html";
    }
    else if (localLanguage == "english" && ua2goCountry == "thailand" && countrysiteId == 251) {
        window.location = "http://www.unitedairlines.co.th/core/english/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "english" && ua2goCountry == "uk" && countrysiteId == 261) {
        window.location = "http://www.unitedairlines.co.uk/core/english/IC/login/index.html?navSource=Dropdown07&linkTitle=itineraries";
    }
    else if (localLanguage == "english" && ua2goCountry == "vietnam" && countrysiteId == 261) {
        window.location = "http://www.unitedairlines.com.vn/core/english/IC/login/index.html";
    }
}



function rememberME(mpEmail) {
    var today = new Date();
    var expires = new Date();
    expires.setTime(today.getTime() + 1000 * 60 * 60 * 24 * 365 * 2)
    setCookie("rememberME", mpEmail, expires);
}


