';
document.getElementById("ff29pane1controller").innerHTML = ff29controllerstring;*/
for(j=0;j<4;j++)
{
document.getElementById("tabbedHeaderUL").childNodes[j].id = "not";
}
document.getElementById("tabbedHeaderUL").childNodes[tsMode-1].id = "current";
ff29mode = tsMode;
}
var flightschildandseniorvisible = false;
function showChildandSenior()
{
flightschildandseniorvisible = true;
document.getElementById("childseniorcompact").style.display = "none";
document.getElementById("childseniorfull").style.display = "block";
document.getElementById("flightADT").selectedIndex = document.getElementById("flightADTmain").selectedIndex+1;
}
function showMoreSearch()
{
if (document.getElementById("ff29upprclnoarrowa").style.display != "none")
{
document.getElementById("ff29upprclnoarrowa").style.display = "none";
document.getElementById("ff29upprclnoarrowb").style.display = "inline";
document.getElementById("ff29upprclnolink").style.display = "none";
document.getElementById("ff29upprclno").style.display = "block";
}
else
{
document.getElementById("ff29upprclnoarrowa").style.display = "inline";
document.getElementById("ff29upprclnoarrowb").style.display = "none";
document.getElementById("ff29upprclnolink").style.display = "inline";
document.getElementById("ff29upprclno").style.display = "none";
}
}
function openAiportLookupWin(url)
{
var tempurl = document.location.href;
if (tempurl.indexOf('www.united.com')!=-1)
{
document.domain = "united.com";
}
popWin = window.open(url,'popDoc','width=539,height=500,scrollbars=yes,status=yes,resizable=yes,toolbar=no,dependent=yes','AirportLookup');
}
function ff29ToggleReturn(tempId)
{
if (tempId == "wayOne")
{
document.getElementById("ff29Ritem").style.display="none";
document.getElementById("ff29Rlabel").style.display="none";
if (document.getElementById('SearchByFLEXDATE').checked==true)
{
document.getElementById('SearchByPRICE').checked=true;
}
document.getElementById("SearchByFLEXDATE").checked=false;
document.getElementById("SearchByFLEXDATE").disabled=true;
document.getElementById("SearchByFLEXDATE").style.display="none"; // from rel night
document.getElementById("SearchByFLEXDATElabel").style.display="none"; // from rel night
}
else
{
document.getElementById("ff29Ritem").style.display="block";
document.getElementById("ff29Rlabel").style.display="block";
if( document.getElementById("SearchByFLEXDATE").checked==true && document.getElementById("SearchByFLEXDATE").disabled==true)
{
document.getElementById("SearchByPRICE").checked=true;
}
document.getElementById("SearchByFLEXDATE").disabled=false;
document.getElementById("SearchByFLEXDATE").style.display="inline"; // from rel night
document.getElementById("SearchByFLEXDATElabel").style.display="inline"; // from rel night
}
}
function ff29searchByUpdate(tempId)
{
if (document.getElementById("SearchByFLEXDATE").disabled==false)
{
if (tempId == "SearchByFLEXDATE")
{
document.getElementById("wayOne").disabled=true;
ff29ToggleReturn('wayRound');
}
else
{
document.getElementById("wayOne").disabled=false;
}
}
}
function ff29updateOthers()
{
currOrig = document.getElementById("shop_from0").value;
currDest = document.getElementById("shop_to0").value;
document.getElementById("hotelD").value = currDest;
document.getElementById("vacationO").value = currOrig;
document.getElementById("vacationD").value = currDest;
}
function ff29multiCity()
{
var telescopeQuery="";
telescopeQuery+=multicityURL;
telescopeQuery+="&shop_from0="+document.getElementById("shop_from0").value;
telescopeQuery+="&shop_to0="+document.getElementById("shop_to0").value;
if (document.getElementById("fromnearby1").checked==true) {telescopeQuery+="&shop_fromnearbyairport0=on";}
if (document.getElementById("tonearby1").checked==true) {telescopeQuery+="&shop_tonearbyairport0=on";}
telescopeQuery+="&shop_departmonth0="+document.getElementById("shop_departmonth").value;
telescopeQuery+="&shop_departday0="+document.getElementById("shop_departday").value;
telescopeQuery+="&shop_departtime0="+document.getElementById("shop_departtime").value;
telescopeQuery+="&shop_departmonth1="+document.getElementById("shop_arrivemonth").value;
telescopeQuery+="&shop_departday1="+document.getElementById("shop_arriveday").value;
telescopeQuery+="&shop_departtime1="+document.getElementById("shop_arrivetime").value;
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;
}
if(document.getElementById("ff29upprclno").style.display != "none") // if flight "more search options is expanded
{
telescopeQuery+="&shop_serviceclass="+document.getElementById("serviceclass").value;
telescopeQuery+="&shop_upgrade="+document.getElementById("upgrade").value;
telescopeQuery+="&shop_stops="+document.getElementById("stops").value;
telescopeQuery+="&shop_promotioncode="+document.getElementById("flightPromocode").value;
if (document.getElementById("flightIncludeSA").checked==true) {telescopeQuery+="&carrierPref=on";}
}
else // default settings
{
telescopeQuery+="&shop_serviceclass=ECONOMY-NON-REFUNDABLE";
telescopeQuery+="&shop_upgrade=";
telescopeQuery+="&shop_stops=1";
telescopeQuery+="&shop_promotioncode=";
telescopeQuery+="&carrierPref=off";
}
window.location=telescopeQuery;
}
function ff29Submit(typeOfsearch)
{
if (ff29mode==1)
{
if (typeOfsearch=="normal")
{
if (document.getElementById("shop_from0").value == "")
{
alert("Departing location (From) is a required field.")
return false;
}
if (document.getElementById("shop_to0").value == "")
{
alert("Destination location (To) is a required field")
return false;
}
// query flights and ping site metrics (insight first)
var telescopeQuery="";
telescopeQuery+="http://";
telescopeQuery+="travel.united.com/ube/core/";
telescopeQuery+=countryTel;
telescopeQuery+="/compactSearch.do?";
telescopeQuery+="submitingShopInputForm=true";
telescopeQuery+="&shop_flightCount=2";
telescopeQuery+="&changeLanguage=false";
telescopeQuery+="&languageRedisplayPage=%2Fjsp%2Fshop%2FShop.jsp";
telescopeQuery+="&actionType=search";
telescopeQuery+="&lang="+langUA2GO;
telescopeQuery+="&waiting=true";
if (document.getElementById("wayRound").checked==true) {telescopeQuery+="&shop_triptype=roundtrip";}
if (document.getElementById("wayOne").checked==true) {telescopeQuery+="&shop_triptype=oneway";}
telescopeQuery+="&shop_from0="+document.getElementById("shop_from0").value;
telescopeQuery+="&shop_to0="+document.getElementById("shop_to0").value;
if (document.getElementById("fromnearby1").checked==true) {telescopeQuery+="&shop_fromnearbyairport0=on";}
if (document.getElementById("tonearby1").checked==true) {telescopeQuery+="&shop_tonearbyairport0=on";}
telescopeQuery+="&shop_departmonth0="+document.getElementById("shop_departmonth").value;
telescopeQuery+="&shop_departday0="+document.getElementById("shop_departday").value;
telescopeQuery+="&shop_departtime0="+document.getElementById("shop_departtime").value;
telescopeQuery+="&shop_arrivemonth0="+document.getElementById("shop_arrivemonth").value;
telescopeQuery+="&shop_arriveday0="+document.getElementById("shop_arriveday").value;
telescopeQuery+="&shop_arrivetime0="+document.getElementById("shop_arrivetime").value;
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=FLEXDATE";}
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;
}
if(document.getElementById("ff29upprclno").style.display != "none") // if flight "more search options is expanded
{
telescopeQuery+="&shop_serviceclass="+document.getElementById("serviceclass").value;
telescopeQuery+="&shop_upgrade="+document.getElementById("upgrade").value;
telescopeQuery+="&shop_stops="+document.getElementById("stops").value;
telescopeQuery+="&shop_promotioncode="+document.getElementById("flightPromocode").value;
if (document.getElementById("flightIncludeSA").checked==true) {telescopeQuery+="&carrierPref=on";}
}
else // if flight "more search options is NOT expanded", set variables to defaults
{
telescopeQuery+="&shop_serviceclass=ECONOMY-NON-REFUNDABLE"; // reset values from award search patch | begin
telescopeQuery+="&shop_upgrade=";
telescopeQuery+="&shop_stops=1";
telescopeQuery+="&shop_promotioncode=";
}
// insightfirst flight tracking | begin
// insightfirst flight tracking | begin
// insightfirst flight tracking | begin
// insightfirst flight tracking | begin
var IF_Flight="http://unitedCollect.insightfirst.com/data/?tax0_SiteID=3&if_pv=tax_only";
// FLIGHTTYPE
if (document.getElementById("wayRound").checked==true) {IF_Flight+="&if_nt_TELHPFF-FLIGHTTYPE=ROUNDTRIP"; var tempFlightType = "ROUNDTRIP";}
if (document.getElementById("wayOne").checked==true) {IF_Flight+="&if_nt_TELHPFF-FLIGHTTYPE=ONEWAY"; var tempFlightType = "ONEWAY";}
// ORIGIN
IF_Flight+="&if_nt_TELHPFF-ORIGIN="+document.getElementById("shop_from0").value.toUpperCase();
// ORIGIN
IF_Flight+="&if_nt_TELHPFF-DESTINATION="+document.getElementById("shop_to0").value.toUpperCase();
// ALTERNATEAIRPORT
if (document.getElementById("fromnearby1").checked==true && document.getElementById("tonearby1").checked==true) {IF_Flight+="&if_nt_TELHPFF-ALTERNATEAIRPORT=BOTH";} //both
if (document.getElementById("fromnearby1").checked==false && document.getElementById("tonearby1").checked==false) {IF_Flight+="&if_nt_TELHPFF-ALTERNATEAIRPORT=NONE";} //none
if (document.getElementById("fromnearby1").checked==true && document.getElementById("tonearby1").checked==false) {IF_Flight+="&if_nt_TELHPFF-ALTERNATEAIRPORT=ORIG";} //orig
if (document.getElementById("fromnearby1").checked==false && document.getElementById("tonearby1").checked==true) {IF_Flight+="&if_nt_TELHPFF-ALTERNATEAIRPORT=DEST";} //dest
//DEPARTDATE
IF_Flight+="&if_nt_TELHPFF-DEPARTDATE="+document.getElementById("shop_departmonth").value+"-"+document.getElementById("shop_departday").value;
//RETURNDATE
IF_Flight+="&if_nt_TELHPFF-RETURNDATE="+document.getElementById("shop_arrivemonth").value+"-"+document.getElementById("shop_arriveday").value;
//SEARCHBY
if (document.getElementById("SearchBySCHEDULE").checked==true) {IF_Flight+="&if_nt_TELHPFF-SEARCHBY=SCHEDULE"; var tempSearchby="SCHEDULE";}
if (document.getElementById("SearchByPRICE").checked==true) {IF_Flight+="&if_nt_TELHPFF-SEARCHBY=PRICE"; var tempSearchby="PRICE";}
if (document.getElementById("SearchByFLEXDATE").checked==true) {IF_Flight+="&if_nt_TELHPFF-SEARCHBY=FLEXDATES"; var tempSearchby="FLEXDATES";}
// get passenger counts
if (flightschildandseniorvisible!=true)
{
//ADULTS ONLY (dhtml portion NOT expanded)
IF_Flight+="&if_nt_TELHPFF-ADULTCOUNT="+document.getElementById("flightADTmain").value;
}
else
{
//ADULTS+SENIOR+CHILD (dhtml portion IS expanded)
IF_Flight+="&if_nt_TELHPFF-ADULT="+document.getElementById("flightADT").value;
IF_Flight+="&if_nt_TELHPFF-SENIOR="+document.getElementById("flightSRC").value;
IF_Flight+="&if_nt_TELHPFF-CHILD="+document.getElementById("flightCNN").value;
}
// IF MORE MORE SEARCH OPTIONS IS OPEN (get data)
if(document.getElementById("ff29upprclno").style.display != "none") // if flight "more search options is expanded (Open, as in MoreSearchOpen, hence "MSO")
{
// SERVICECLASS
IF_Flight+="&if_nt_TELHPFF-SERVICECLASS_MSO="+document.getElementById("serviceclass").value; var tempSVCclass = document.getElementById("serviceclass").value; // this var is used for ORIG+SERVICECLASS and DEST+SERVICECLASS
// UPGRADE
if (document.getElementById("upgrade").value != "")
{IF_Flight+="&if_nt_TELHPFF-UPGRADE_MSO="+document.getElementById("upgrade").value;}
else {IF_Flight+="&if_nt_TELHPFF-UPGRADE_MSO=NO UPGRADE";}
// MAXSTOPS
IF_Flight+="&if_nt_TELHPFF-MAXSTOPS_MSO="+document.getElementById("stops").value;
// PROMOCODE (Y OR N)
if (document.getElementById("flightPromocode").value!="") // if a promo code is used, embed Y, conversely embed N
{IF_Flight+="&if_nt_TELHPFF-PROMOCODE_MSO=Y";}
else {IF_Flight+="&if_nt_TELHPFF-PROMOCODE_MSO=N";}
// STARALLIANCE (Y OR N)
if (document.getElementById("flightIncludeSA").checked==true)
{IF_Flight+="&if_nt_TELHPFF-STARALLIANCE_MSO=Y";}
else {IF_Flight+="&if_nt_TELHPFF-STARALLIANCE_MSO=N";}
}
else // IF MORE MORE SEARCH OPTIONS IS CLOSED (use default data)
{
// SERVICECLASS, UPGRADE, MAXSTOPS, PROMOCODE, STARALLIANCE all set to DEFAULTS
IF_Flight+="&if_nt_TELHPFF-SERVICECLASS_MSC=ECONOMY-NON-REFUNDABLE"; var tempSVCclass = "ECONOMY-NON-REFUNDABLE"; // this var is used for ORIG+SERVICECLASS and DEST+SERVICECLASS
IF_Flight+="&if_nt_TELHPFF-UPGRADE_MSC=NO UPGRADE";
IF_Flight+="&if_nt_TELHPFF-MAXSTOPS_MSC=1";
IF_Flight+="&if_nt_TELHPFF-PROMOCODE_MSC=N";
IF_Flight+="&if_nt_TELHPFF-STARALLIANCE_MSC=N";
}
//ORIG+DEST+DEPARTDATE
IF_Flight+="&if_nt_TELHPFF-ORIG_DEST_DEPARTDATE="+document.getElementById("shop_from0").value.toUpperCase()+"_"+document.getElementById("shop_to0").value.toUpperCase()+"_"+document.getElementById("shop_departmonth").value+"-"+document.getElementById("shop_departday").value;
// DEST+DEPARTDATE
IF_Flight+="&if_nt_TELHPFF-DEST_DEPARTDATE="+document.getElementById("shop_to0").value.toUpperCase()+"_"+document.getElementById("shop_departmonth").value+"-"+document.getElementById("shop_departday").value;
// FLIGHTTYPE+SEARCHBY
IF_Flight+="&if_nt_TELHPFF-FLIGHTTYPE_SEARCHBY="+tempFlightType+"_"+tempSearchby;
// ORIG+SERVICECLASS
IF_Flight+="&if_nt_TELHPFF-ORIG_SERVICECLASS="+document.getElementById("shop_from0").value.toUpperCase()+"_"+tempSVCclass;
// DEST+SERVICECLASS
IF_Flight+="&if_nt_TELHPFF-DEST_SERVICECLASS="+document.getElementById("shop_to0").value.toUpperCase()+"_"+tempSVCclass;
// ORIG+DEPART+DEPARTDATE
// this might be a duplicate
// MARKET (ORIG+DEST)
IF_Flight+="&if_nt_TELHPFF-MARKET="+document.getElementById("shop_from0").value.toUpperCase()+"_"+document.getElementById("shop_to0").value.toUpperCase();
IF_Flight+="¤tpage=HPTELFF&if_RedirUrl=";
// insightfirst flight tracking | end
// insightfirst flight tracking | end
// insightfirst flight tracking | end
// insightfirst flight tracking | end
//telescopeQuery=encodeURIComponent(telescopeQuery);
//alert("This will be removed before launch.\nComplete search string: "+IF_Flight+telescopeQuery)
window.location=telescopeQuery;//window.location=IF_Flight+telescopeQuery;
return false;
}
}
if (ff29mode==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+="http://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+="http://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;
}
window.location=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=hotelQueryStr;
return false;
}
if (ff29mode==3)
{
//do nothing, this is the car rental section
//if necessary a car-quote HTTP GET could be formulated here
}
if (ff29mode==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?";
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://reservations.unitedvacations.com/search/search.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;
}
}
function ff29popup(wURL)
{
window.open(wURL,"ff29","width=550,height=400,top=20,left=20,menubar=no,status=no,toolbar=no,resizable=yes,scrollbars=yes")
}