var gbl_HomePageURLHash="#p=home";gblIsEvent=false;var gblIsDetailsDisplayed=false;var gblMainURL,gblIsRedirectFromSearchBox=false;var gblABDisplayed=true;var gbl_isItemDraged=false;var gbl_LandingPageURLHash="#p=landing";var gbl_ReadPageURLHash="#p=read";var gbl_ExplorePageURLHash="#p=explore";var gbl_BudgetPageURLHash="#p=budget";var gbl_MyTripsPageURLHash="#p=mytrips";var gbl_MyBidPageURLHash="#p=mybid";var gbl_BudgetPageCityHash="",gbl_BudgetPageCountryHash="";var gbl_BudgetCityClick=false,gblEdiBudgetCity=false;var gbl_DirectLoadLandingPage=false;var gbl_DirectLoadAttrInfo=false;var gbl_isReportPageCall=false;var gbl_ShowMPPForLandingCall=false;var gbl_DirectLoadArticlePage=false;var gbl_DirectLoadBlogPage=false;var gbl_DirectLoadBudgetPage=false;var gbl_DirectLoadMyTripsPage=false;var gbl_DirectLoadMyBidPage=false;var gbl_DirectLoadBidCommentsPage=false;var gbl_itineraryClicked=false;var gbl_myTripsRequestFlag=false;var gbl_myBidRequestFlag=false;var gbl_myBidListReqFlag=false;var gbl_myBidLoadPageFlag=false;var gbl_checkPlanNowClicked=false;var gbl_LoadBudgetBidReq=false;var gbl_DirectUpdateAttractionLoad=false;var gbl_DirectLoadNBCPage=false;var gbl_DirectLoadBiddingListPage=false;var gbl_SlideNBC=false;var gbl_blogNameStr="";var gbl_articleNameStr="";var global_PreviousURL=document.location.href;var global_PreviousURLCity="";var global_CurrentURLCity="";function customReplaceSpecialChar(strValue){if(strValue){strValue=strValue.replace(regXForSpace,'_');strValue=strValue.replace(/'/g,"rsquo;");strValue=strValue.replace(/"/g,"quot;");}return strValue;}function revertCustomSpecialChar(customStrValue){if(customStrValue){customStrValue=customStrValue.replace(/_/g," ");customStrValue=customStrValue.replace(/rsquo;/g,"'");customStrValue=customStrValue.replace(/quot;/g,'"');}return customStrValue;}function getLogisticalHashURL(logiticalInfoURI){if(global_CityAirportInfoObj.StartType==0){var airIndex=searchAirportItem(gbl_AirportList,global_CityAirportInfoObj.Name);if(airIndex!=-1){aName=gbl_AirportList[airIndex].AirportName;}else{aName=global_CityAirportInfoObj.Name;}tmpCurrentLogisticalURI=gbl_LandingPageURLHash+"&a="+customReplaceSpecialChar(aName);}else{tmpCurrentLogisticalURI=gbl_LandingPageURLHash+"&c="+customReplaceSpecialChar(global_CityAirportInfoObj.Name);}tmpCurrentLogisticalURI=tmpCurrentLogisticalURI+"&i="+customReplaceSpecialChar(logiticalInfoURI);return tmpCurrentLogisticalURI;}function getLogisticalNBCHashURL(logiticalInfoURI,cityName){if(global_start_location==0||(global_start_location==3&&global_CityAirportInfoObj.StartType==0)){tmpCurrentLogisticalURI=gbl_LandingPageURLHash+"&c="+customReplaceSpecialChar(cityName);}else{tmpCurrentLogisticalURI=gbl_LandingPageURLHash+"&c="+customReplaceSpecialChar(cityName);}tmpCurrentLogisticalURI=tmpCurrentLogisticalURI+"&i="+customReplaceSpecialChar(logiticalInfoURI);return tmpCurrentLogisticalURI;}function getArticleBlogsHashURL(headline,isBlogHeadline){var tmpCurrentArticleURI="";if(isBlogHeadline){tmpCurrentArticleURI=gbl_ReadPageURLHash+"&bl="+customReplaceSpecialChar(headline);}else{tmpCurrentArticleURI=gbl_ExplorePageURLHash+"&ar="+customReplaceSpecialChar(headline);}return tmpCurrentArticleURI;}function getBudgetCityHashURL(budgetCityName){var tmpBudgetHashURL="";tmpBudgetHashURL=gbl_BudgetPageURLHash+"&ci="+customReplaceSpecialChar(budgetCityName);return tmpBudgetHashURL;}function getBudgetCountryHashURL(budgetCountryName){var tmpBudgetHashURL="";tmpBudgetHashURL=gbl_BudgetPageURLHash+"&ct="+customReplaceSpecialChar(budgetCountryName);return tmpBudgetHashURL;}function getMyTripsHashURL(itineraryName){var tmpMyTripsHashURL="";tmpMyTripsHashURL=gbl_MyTripsPageURLHash+"&it="+customReplaceSpecialChar(itineraryName);return tmpMyTripsHashURL;}function getMyBidHashURL(itineraryName){var tmpMyBidHashURL="";var HashLocationName=document.location.href;if(itineraryName){tmpMyBidHashURL=gbl_MyBidPageURLHash+"&itiname="+customReplaceSpecialChar(itineraryName)+"&pref=itinerary";}else{var cityName=HashLocationName.split("ci=")[1];cityName=customReplaceSpecialChar(cityName);tmpMyBidHashURL=gbl_MyBidPageURLHash+"&city="+cityName+"&pref=budget";}return tmpMyBidHashURL;}function getBidSPListHashURL(hashURL){var tmpBidSPListHashURL="";tmpBidSPListHashURL=hashURL+"&list=splist";return tmpBidSPListHashURL;}function getBidSPCommentsHashURL(hashURL){var tmpBidSPCommentsHashURL="";tmpBidSPCommentsHashURL=hashURL+"&bidpage=spcomments";return tmpBidSPCommentsHashURL;}function getMyCommentsURL(itineraryName){var tmpMyTripsHashURL="";tmpMyCommentsHashURL=gbl_MyTripsPageURLHash+"&it="+customReplaceSpecialChar(itineraryName)+"&comments=true";return tmpMyCommentsHashURL;}function changeBudgetCityURL(){var w=document.budgetPlannerfrm.City.selectedIndex;var budgetCityId=document.budgetPlannerfrm.City.value;var Region=document.budgetPlannerfrm.Region.value;if(Region==0){alert('Please select country.');return false;}if(w==-1){alert('Please select city.');return false;}var budgetCityObj=getCityLocationIdByName(budgetCityId);var budgetCityHashURL=getBudgetCityHashURL(budgetCityObj.CityName);RedirectURLLocation(budgetCityHashURL);var tmpBudgetIframeRHS=document.getElementById("budgetGoogleAdsIframeRHS");tmpBudgetIframeRHS.src=DIRECTORYSTRUCTUREPATH+"ShowGAds-BudgetPlannerAds.php?city="+budgetCityObj.CityName;}function SerachCityHotels(ShowListFlag){if(document.budgetPlannerfrm){var budgetCityId=document.budgetPlannerfrm.City.value;if(budgetCityId){var budgetCityObj=getCityLocationIdByName(budgetCityId);var CityName=budgetCityObj.CityName;var NumRooms=document.getElementById("rooms").value;var NumTravelers=0,ChkInDate,NumNights;if(document.getElementById("no_travelers")){NumTravelers=document.getElementById("no_travelers").value;}if(document.getElementById("arival_date")){ChkInDate=document.getElementById("arival_date").value;}if(document.getElementById("stay_for")){NumNights=document.getElementById("stay_for").value;}if(-1!=CityName.indexOf(" ")){while(-1!=CityName.indexOf(" ")){CityName=CityName.replace(" ","_");}}var dateObject=new Date(ChkInDate);var datePart=dateObject.getDate();var monthPart=dateObject.getMonth()+1;var yearPart=dateObject.getFullYear();if(monthPart<10)monthPart='0'+monthPart;var ChkInDateNew=yearPart+"-"+monthPart+"-"+datePart;dateObject.setDate(dateObject.getDate()+parseInt(NumNights));datePart=dateObject.getDate();monthPart=dateObject.getMonth()+1;yearPart=dateObject.getFullYear();if(monthPart<10)monthPart='0'+monthPart;if(parseInt(NumRooms)==0||isNaN(parseInt(NumRooms))){NumRooms=1;}var ChkOutDateNew=yearPart+"-"+monthPart+"-"+datePart;document.getElementById("selectedFileName").value=CityName;document.getElementById("checkinValue").value=ChkInDateNew;document.getElementById("checkoutValue").value=ChkOutDateNew;document.getElementById("guestValue").value=NumTravelers;document.getElementById("roomValue").value=NumRooms;document.getElementById("hotelCheckin").value=ChkInDateNew;document.getElementById("hotelCheckout").value=ChkOutDateNew;document.getElementById("guests").value=NumTravelers;document.getElementById("rooms").value=NumRooms;if(ShowListFlag==1){DoSearch('EN','_blank','14118',CityName,'www.hotelscombined.com','','');}}else{if(ShowListFlag==1){alert("Please select city");}return;}}}function showSearchHotelsLink(ShowListFlag){var CityName=global_CityAirportInfoObj.Name;var NumRooms=global_CityAirportInfoObj.Group;var NumTravelers=global_CityAirportInfoObj.TravelerCount;var ChkInDate=global_CityAirportInfoObj.Startdate;var ChkOutDate=global_CityAirportInfoObj.Enddate;if(parseInt(NumRooms)==0||isNaN(parseInt(NumRooms))){NumRooms=1;}if(-1!=CityName.indexOf(" ")){while(-1!=CityName.indexOf(" ")){CityName=CityName.replace(" ","_");}}var dateObject=new Date(ChkInDate);var datePart=dateObject.getDate();var monthPart=dateObject.getMonth()+1;var yearPart=dateObject.getFullYear();if(monthPart<10)monthPart='0'+monthPart;var ChkInDateNew=yearPart+"-"+monthPart+"-"+datePart;var dateObject1=new Date(ChkOutDate);datePart=dateObject1.getDate();monthPart=dateObject1.getMonth()+1;yearPart=dateObject1.getFullYear();if(monthPart<10)monthPart='0'+monthPart;var ChkOutDateNew=yearPart+"-"+monthPart+"-"+datePart;if(isIE){document.getElementById("SearchABCityHotelsLink").onclick=function anonymous(){showSearchHotelsLink(1);TrackExternalLinksForHotelCombined('Hotels Combined','hotelscombined.com');}}else{document.getElementById("SearchABCityHotelsLink").setAttribute('onClick','javascript:showSearchHotelsLink(1); TrackExternalLinksForHotelCombined(\'Hotels Combined\',\'hotelscombined.com\');');}document.getElementById("selectedFileName").value=CityName;document.getElementById("checkinValue").value=ChkInDateNew;document.getElementById("checkoutValue").value=ChkOutDateNew;document.getElementById("guestValue").value=NumTravelers;document.getElementById("roomValue").value=NumRooms;document.getElementById("hotelCheckin").value=ChkInDateNew;document.getElementById("hotelCheckout").value=ChkOutDateNew;document.getElementById("guests").value=NumTravelers;document.getElementById("rooms").value=NumRooms;if(ShowListFlag==1)DoSearch('EN','_blank','14118',CityName,'www.hotelscombined.com','','');}function changeBudgetCountryURL(){var w=document.budgetPlannerfrm.Region.selectedIndex;var budgetCountryId=document.budgetPlannerfrm.Region.value;if(budgetCountryId==0){alert('Please select country.');return false;}if(w==-1){alert('Please select country.');return false;}CountryName=document.budgetPlannerfrm.Region.options[w].text;var budgetCountryHashURL=getBudgetCountryHashURL(CountryName);gbl_BudgetPageCountryHash="";RedirectURLLocation(budgetCountryHashURL);}function CheckForPageURLHash(){var HashLocationName=null;var tmpHashCenterLocationName="";HashLocationName=document.location.href;if(global_PreviousURL!=HashLocationName||gbl_DirectLoadAttrInfo||gbl_ShowMPPForLandingCall||gbl_DirectLoadArticlePage||gbl_DirectLoadBlogPage||gbl_DirectLoadMyTripsPage||gbl_DirectLoadMyBidPage||gbl_DirectLoadBudgetPage||gbl_DirectLoadNBCPage||gbl_DirectUpdateAttractionLoad){if(HashLocationName.indexOf("#p=countryplanner")!=-1){global_PreviousURL=HashLocationName;global_start_location=4;getMultiCityPlannerPage();}else if(HashLocationName.indexOf("#p=cityplanner")!=-1){global_PreviousURL=HashLocationName;global_start_location=3;if(gblIsFromMC){fillMCityDetails(true);}else{getMultiCityPlannerPage();}}else if(HashLocationName.indexOf("#viewItinerary=")!=-1||HashLocationName.indexOf("#viewBudget=")!=-1){global_PreviousURL=HashLocationName;AppLoad_fn();}else if(HashLocationName.indexOf("#myprofile=spprofile")!=-1){global_PreviousURL=HashLocationName;SendRequest('MyProfile.php','get','serviceproviderprofile');}else if(HashLocationName.indexOf("#p=UpdateAttraction")!=-1){global_PreviousURL=HashLocationName;gbl_DirectUpdateAttractionLoad=false;attId=HashLocationName.substr(HashLocationName.indexOf("AttrID=")+7,HashLocationName.length);getUpdateAttractionPage(attId);}else if(HashLocationName.indexOf("#p=landing")!=-1){var tmpIsPreviousPageLanding=global_PreviousURL.indexOf("#p=landing");setWebPageTitle(HashLocationName);if(tmpIsPreviousPageLanding!=-1||global_start_location==4||(global_start_location==3&&gblIsFromMC==true)){var prevCity=extractCityName(global_PreviousURL);var currCity=extractCityName(HashLocationName);var isNBCcity=false;if(prevCity!=currCity){if(global_CityAirportInfoObj.Name.match(currCity)){gbl_inURLArchNBC=false;gbl_inNBC=false;gbl_isItemDraged=false;}else{if(global_start_location!=4){if(!gbl_inNBC){gbl_isItemDraged=false;}gbl_inNBC=true;gbl_inURLArchNBC=true;}}}if(gbl_DirectLoadNBCPage&&gbl_isMPPReceived&&gbl_isPartnerMPPReceived&&gbl_isNBCMPPReceived){if(HashLocationName.indexOf("&i=")!=-1){var logisticalName=getFormatLocationName(HashLocationName);getLocationId(logisticalName,false,'cityid',true);}gbl_inNBC=true;global_PreviousURL=HashLocationName;gbl_DirectLoadAttrInfo=false;gbl_ShowMPPForLandingCall=false;gbl_isMPPReceived=false;gbl_isPartnerMPPReceived=false;gbl_isNBCMPPReceived=false;var currCityName=getCityNameFromURL();var cityArr=getCityLocationIdByName(currCityName);var currCityID=cityArr.CityId;global_location_uri='cities/'+currCityID;if(gbl_arrAllNearByCities.length==0){getCityDetail();}getNearByCities(currCityName);gbl_SlideNBC=true;CheckForURLHash();document.getElementById("btnNBCities").style.display="none";gbl_DirectLoadNBCPage=false;}else if(gbl_inNBC){if(gbl_NBCPrevCityName!=global_CityAirportInfoObj.Name){gbl_NBCPrevCityName=global_CityAirportInfoObj.Name;gbl_NBCPrevCityId=global_CityAirportInfoObj.CityID;gbl_inURLArchNBC=true;}CheckForURLHash();}else if(!gbl_DirectLoadNBCPage){if(gbl_arrAllNearByCities.length>0&&global_start_location!=3){for(var cityCnt=0;cityCnt<gbl_arrAllNearByCities.length;cityCnt++){if(gbl_arrAllNearByCities[cityCnt].name==prevCity){isNBCcity=true;break;}}}if(prevCity!=currCity&&!isNBCcity&&global_start_location!=3&&global_start_location!=4){var iCnt=searchItem(global_List_CityName,prevCity,true,"cityName");if(iCnt!=-1){loadCurrentURLAttractionDetails();}}CheckForURLHash();}}else{global_PreviousURL=HashLocationName;if(!gbl_checkPlanNowClicked){gbl_ShowMPPForLandingCall=true;if(global_start_location==4||(global_start_location==3&&gblIsFromMC)){global_start_location=4;gbl_ShowMPPForLandingCall=false;handleEvent("landingPage_sketchnow");}else{if(!gbl_isPlanNowRequested){gbl_isPlanNowRequested=true;if(gbl_isLandingPageRequested){gbl_isLandingPageRequested=false;}handleEvent("homepage_ibtnsketchnow");}}}else{gbl_checkPlanNowClicked=false;}}}else if(HashLocationName.indexOf("#p=read")!=-1&&HashLocationName.indexOf("#p=read&bl=")==-1){global_PreviousURL=HashLocationName;gbl_DirectLoadBlogPage=false;if(gbl_HomePageBlogs.length<=0){SendRequest("/homepage/blogs","get","bloglist");}handleEvent("loadReadPage");}else if(HashLocationName.indexOf("#p=read&bl=")!=-1){var nameStrArr=HashLocationName.split("#p=read&bl=")[1];var nameStr=revertCustomSpecialChar(nameStrArr);global_PreviousURL=HashLocationName;if(gbl_DirectLoadBlogPage){gbl_DirectLoadBlogPage=false;fillBlogsDetailPage(gbl_currentBlogid,gbl_currentBlogType);}else{var blogID=null;blogID=getIdFromName(nameStr,"blogs");fillBlogsDetailPage(gbl_currentBlogid,gbl_currentBlogType);}setWebPageTitle(HashLocationName);}else if(HashLocationName.indexOf("#p=explore")!=-1&&HashLocationName.indexOf("#p=explore&ar=")==-1){global_PreviousURL=HashLocationName;gbl_DirectLoadArticlePage=false;if(gbl_HomePageArticles.length<=0){SendRequest("/homepage/articles","get","articlelist");}handleEvent("loadExplorePage");}else if(HashLocationName.indexOf("#p=explore&ar=")!=-1){var tmpIsPreviousPageExplore=global_PreviousURL.indexOf("#p=explore");global_PreviousURL=HashLocationName;if(gbl_DirectLoadArticlePage){gbl_DirectLoadArticlePage=false;_fillArticleDetailPage(gbl_articleid);}else{var nameStrArr=HashLocationName.split("#p=explore&ar=")[1];var nameStr=revertCustomSpecialChar(nameStrArr);var articleID=null;articleID=getIdFromName(nameStr,"articles");_fillArticleDetailPage(gbl_articleid);}setWebPageTitle(HashLocationName);}else if(HashLocationName.indexOf("#p=budget")!=-1&&HashLocationName.indexOf("#p=budget&ct=")==-1&&HashLocationName.indexOf("#p=budget&ci=")==-1){global_PreviousURL=HashLocationName;gblEdiBudgetCity=false;gbl_DirectLoadBudgetPage=false;if(gbl_CityList.length<=0){SendRequest("/cities","get","cityList");}if(gbl_userBudgetDetail.length<=0){SendRequest("/budget/0/getBudgetDetails","get","getBudgetDetails");}handleEvent("loadBudgetPage");setWebPageTitle(HashLocationName);}else if(HashLocationName.indexOf("#p=budget&ct=")!=-1){var tmpIsPreviousPageBudget=global_PreviousURL.indexOf("#p=budget");gblEdiBudgetCity=false;if(global_PreviousURL.indexOf("#p=mybid&city=")!=-1){SendRequest("budgetPlanner.php","get","budgetPlannerLoad");}global_PreviousURL=HashLocationName;if(tmpIsPreviousPageBudget==-1){var nameStrArr=HashLocationName.split("#p=budget&ct=")[1];var nameStr=revertCustomSpecialChar(nameStrArr);gbl_DirectLoadBudgetPage=false;handleEvent("loadBudgetPage");}else{var nameStrArr=HashLocationName.split("#p=budget&ct=")[1];var nameStr=revertCustomSpecialChar(nameStrArr);if(gbl_BudgetCityClick){gbl_BudgetCityClick=false;resetallBudgetItems();FillBudgetDetailsForCountry(0);}else{gbl_BudgetPageCountryHash=nameStr;if(gblEditBudgetFrmMyBudgetsCityID==-1){setSelectObjValue(document.budgetPlannerfrm.Region,nameStr);getSelectedRegionCity();}gbl_BudgetPageCityHash="";}}gbl_DirectLoadBudgetPage=false;setWebPageTitle(HashLocationName);}else if(HashLocationName.indexOf("#p=budget&ci=")!=-1){var tmpIsPreviousPageBudget=global_PreviousURL.indexOf("#p=budget");gblEdiBudgetCity=false;if(global_PreviousURL.indexOf("#p=mybid&city=")!=-1){SendRequest("budgetPlanner.php","get","budgetPlannerLoad");}global_PreviousURL=HashLocationName;if(tmpIsPreviousPageBudget==-1){var nameStrArr=HashLocationName.split("#p=budget&ci=")[1];var nameStr=revertCustomSpecialChar(nameStrArr);var budgetCityObj=getCityLocationIdByName(nameStr);if(budgetCityObj.CityName){global_CityAirportInfoObj.CityID=budgetCityObj.CityId;global_CityAirportInfoObj.Name=budgetCityObj.CityName;global_CityAirportInfoObj.Country=budgetCityObj.CityCountry;global_CityAirportInfoObj.DefaultTransportCost=budgetCityObj.TransportCost;gbl_DirectLoadBudgetPage=false;handleEvent("loadBudgetPage");}}else{var nameStrArr=HashLocationName.split("#p=budget&ci=")[1];var nameStr=revertCustomSpecialChar(nameStrArr);var budgetCityObj=getCityLocationIdByName(nameStr);if(gbl_BudgetCityClick){gbl_BudgetCityClick=false;resetallBudgetItems();FillBudgetDetailsForCity(0,"City");}else{if(gblEditBudgetFrmMyBudgetsCityID==-1){setSelectObjValue(document.budgetPlannerfrm.Region,budgetCityObj.CityCountry);getSelectedRegionCity();}gbl_BudgetPageCityHash=budgetCityObj.CityName;gbl_BudgetPageCountryHash="";}}gbl_DirectLoadBudgetPage=false;setWebPageTitle(HashLocationName);}else if(HashLocationName.indexOf("#p=mytrips")!=-1&&HashLocationName.indexOf("#p=mytrips&it=")==-1){global_PreviousURL=HashLocationName;setWebPageTitle(global_PreviousURL);gblItineraryName="";gblUserEventType=1;gbl_showComments=false;gblItineraryBidFrmLanding=false;gbl_DirectLoadMyTripsPage=false;handleEvent("loadMytripsPage");}else if(HashLocationName.indexOf("#p=mytrips&it=")!=-1&&HashLocationName.indexOf("&comments=true")==-1){if(gbl_isUserSignedId){loadScript();global_PreviousURL=HashLocationName;gblUserEventType=1;gblUserEvent='';gbl_showComments=false;setHeaderTabClass('My Trips');if(gbl_DirectLoadMyTripsPage||gbl_arrMyItinerary.length<=0){SendRequest("TripList.php","get","triplist");gbl_DirectLoadMyTripsPage=false;}else{gblItineraryName=HashLocationName.split("&it=")[1];gblItineraryName=revertCustomSpecialChar(gblItineraryName);var currItineraryObj=getItineraryIDByName(gblItineraryName);gbl_myTripsRequestFlag=true;gbl_ItineraryId=currItineraryObj.id;if(currItineraryObj.itineraryDetailObj&&currItineraryObj.itineraryDetailObj.length>0){getItineraryBudget(gbl_ItineraryId);SendRequest('itenaryDetails.php?itineraryID='+gbl_ItineraryId,'get','showItenaryDetails');}else{getItineraryBudget(gbl_ItineraryId);SendRequest(global_itinerary_uri+'/'+gbl_ItineraryId,'get','myItineraryDetails');}}setWebPageTitle(global_PreviousURL);}else{global_PreviousURL=HashLocationName;gbl_DirectLoadMyTripsPage=false;showSignInPage();}}else if(HashLocationName.indexOf("&comments=true")!=-1){global_PreviousURL=HashLocationName;SendRequest('itineraryCommentsList.php?itineraryId='+gbl_ItineraryId,'get','myItineraryCommentsList')}else if(HashLocationName.indexOf("&itiname=")!=-1&&HashLocationName.indexOf("&list=")==-1){global_PreviousURL=HashLocationName;gblUserEventType=1;gblUserEvent='';gbl_DirectLoadMyBidPage=false;if(gbl_isUserSignedId){setHeaderTabClass('My Trips');if(gbl_ItineraryId!=0){showLoadingImages();SendRequest('BidRequest.php?itineraryId='+gbl_ItineraryId,'get','displayBidPreference');}else if(gbl_arrMyItinerary.length<=0){SendRequest("TripList.php","get","triplist");}else{gbl_myBidLoadPageFlag=false;}setWebPageTitle(HashLocationName);}else{showSignInPage();}}else if(HashLocationName.indexOf("&pref=budget")!=-1&&HashLocationName.indexOf("&list=")==-1){global_PreviousURL=HashLocationName;gblUserEventType=1;gblUserEvent='';gbl_DirectLoadBudgetPage=false;if(!gbl_isUserSignedId){gbl_DirectLoadMyBidPage=false;gbl_LoadBudgetBidReq=true;showSignInPage();}else{if(gbl_BudgetId!=-1){SendRequest('BidRequest.php?bId='+gbl_BudgetId,'get','displayBidPreference');}else{if(gbl_userBudgetDetail.length<=0){SendRequest("/budget/0/getBudgetDetails","get","getBudgetDetails");}var CityNameArr=HashLocationName.split("&city=")[1];var CityName=CityNameArr.split("&pref=")[0];CityName=revertCustomSpecialChar(CityName);gbl_BudgetId=getBudgetId(CityName);if(gbl_BudgetId){SendRequest('BidRequest.php?bId='+gbl_BudgetId,'get','displayBidPreference');}}gbl_DirectLoadMyBidPage=false;}}else if(HashLocationName.indexOf("&list")!=-1&&HashLocationName.indexOf("&bidpage=")==-1){global_PreviousURL=HashLocationName;gblUserEventType=1;gblUserEvent='';gbl_DirectLoadMyBidPage=false;gbl_DirectLoadBiddingListPage=true;if(gbl_isUserSignedId){if(HashLocationName.indexOf("&pref=itinerary")!=-1){gblBidRequestFrm="Itinerary";setHeaderTabClass('My Trips');if(gbl_ItineraryId!=0){if(!gblDirectViewSPComment){getNextList(gbl_userAction);}else{gblDirectViewSPComment=false;viewSPList(gbl_ItineraryId);}}else{if(!gbl_arrMyItinerary||(gbl_arrMyItinerary&&gbl_arrMyItinerary.length<=0)){SendRequest("TripList.php","get","triplist");}else{var ItineraryNameArr=HashLocationName.split("&itiname=")[1];gblItineraryName=ItineraryNameArr.split("&pref=")[0];gblItineraryName=revertCustomSpecialChar(gblItineraryName);var currItineraryObj=getItineraryIDByName(gblItineraryName);viewSPList(currItineraryObj.id);gbl_myBidListReqFlag=false;}}}else{gblBidRequestFrm="Budget";setHeaderTabClass('Budget');if(gbl_BudgetId!=-1){getNextList(gbl_userAction);}else{if(gbl_userBudgetDetail.length<=0){SendRequest("/budget/0/getBudgetDetails","get","getBudgetDetails");}var CityNameArr=HashLocationName.split("&city=")[1];var CityName=CityNameArr.split("&pref=")[0];CityName=revertCustomSpecialChar(CityName);gbl_BudgetId=getBudgetId(CityName);if(gbl_BudgetId&&gbl_BudgetId!=-1){SendRequest("BidItinerary.php",'get','BidItineraryDetails');SendRequest("/budget/"+gbl_BudgetId+"/SPList","get","BudgetSPList");}}gbl_DirectLoadMyBidPage=false;}}else{showSignInPage();}}else if(HashLocationName.indexOf("&bidpage=")!=-1&&HashLocationName.indexOf("&sID=")==-1){global_PreviousURL=HashLocationName;gblUserEventType=1;gblUserEvent='';gbl_DirectLoadMyBidPage=false;if(gbl_isUserSignedId){if(gblBidRequestFrm=='Itinerary'&&!gblItineraryBidFrmLanding){SendRequest('itenaryDetails.php?itineraryID='+gbl_ItineraryId+'&SPID='+gbl_spId,'get','showItenaryDetails');}else if(gblBidRequestFrm=='Itinerary'&&gblItineraryBidFrmLanding){dispBidTrips(gbl_spId);}else if(gblBidRequestFrm=='Budget'){SendRequest('ViewBudgetDetails.php?budgetID='+gbl_BudgetId+'&SPID='+gbl_spId,'get','showBudgetDetails');}else{SendRequest('itenaryDetails.php?itineraryID='+gbl_ItineraryId+'&SPID='+gbl_spId+'&action=ViewDelete','get','showItenaryDetails');}setWebPageTitle(HashLocationName);}else{global_PreviousURL=HashLocationName;showSignInPage();}}else if(HashLocationName.indexOf("&bidpage=")!=-1&&HashLocationName.indexOf("&sID=")!=-1){global_PreviousURL=HashLocationName;gbl_DirectLoadMyBidPage=false;if(gbl_isUserSignedId){gblUserEventType=1;gblUserEvent='';gbl_showComments=true;if(HashLocationName.indexOf("&itiname=")!=-1){setHeaderTabClass('My Trips');var ItineraryNameArr=HashLocationName.split("&itiname=")[1];gblItineraryName=ItineraryNameArr.split("&pref=")[0];gblItineraryName=revertCustomSpecialChar(gblItineraryName);var currItineraryObj=getItineraryIDByName(gblItineraryName);gbl_spId=HashLocationName.split("&sID=")[1];gblBiddingSPID=gbl_spId;if(gbl_DirectLoadMyTripsPage||gbl_arrMyItinerary.length==0||!currItineraryObj){if(!currItineraryObj){gbl_myBidListReqFlag=true;}SendRequest("TripList.php","get","triplist");gbl_DirectLoadMyTripsPage=false;gbl_DirectLoadBidCommentsPage=true;}else{var currItineraryObj=getItineraryIDByName(gblItineraryName);if(currItineraryObj){gbl_myTripsRequestFlag=true;gbl_ItineraryId=currItineraryObj.id;if(currItineraryObj.itineraryDetailObj!=""&&currItineraryObj.itineraryDetailObj.length>0){gblUserEventType=1;gblUserEvent='';if(gblBidRequestFrm=='Itinerary'&&!gblItineraryBidFrmLanding){SendRequest('itenaryDetails.php?itineraryID='+gbl_ItineraryId+'&SPID='+gbl_spId,'get','showItenaryDetails');}else if(gblBidRequestFrm=='Itinerary'&&gblItineraryBidFrmLanding){dispBidTrips(gbl_spId);}}else{getItineraryBudget(gbl_ItineraryId);SendRequest(global_itinerary_uri+'/'+gbl_ItineraryId,'get','myItineraryDetails');}}else{getItineraryBudget(gbl_ItineraryId);SendRequest(global_itinerary_uri+'/'+gbl_ItineraryId,'get','myItineraryDetails');}}}else{gblBidRequestFrm="Budget";setHeaderTabClass('Budget');if(gbl_BudgetId!=-1){SendRequest('ViewBudgetDetails.php?budgetID='+gbl_BudgetId+'&SPID='+gbl_spId,'get','showBudgetDetails');}else{gbl_showComments=true;if(gbl_userBudgetDetail.length<=0){SendRequest("/budget/0/getBudgetDetails","get","getBudgetDetails");}var CityNameArr=HashLocationName.split("&city=")[1];var CityName=CityNameArr.split("&pref=")[0];CityName=revertCustomSpecialChar(CityName);gbl_spId=HashLocationName.split("&sID=")[1];if(gbl_spId.match("&")){gbl_spId=gbl_spId.split("&")[0];}gblBiddingSPID=gbl_spId;gbl_BudgetId=getBudgetId(CityName);if(gbl_BudgetId){SendRequest('ViewBudgetDetails.php?budgetID='+gbl_BudgetId+'&SPID='+gbl_spId,'get','showBudgetDetails');}}}setWebPageTitle(HashLocationName);}else{global_PreviousURL=HashLocationName;showSignInPage();}}else if(HashLocationName.indexOf("#p=home")!=-1||HashLocationName.indexOf("#")){handleEvent("loadHomePage");global_PreviousURL=HashLocationName;setWebPageTitle(HashLocationName);}loadScript();}else{if(gbl_BudgetCityClick){gbl_BudgetCityClick=false;}}}function CheckForURLHash(){var HashLocationName=null;var tmpHashCenterLocationName="";HashLocationName=document.location.href;if(global_PreviousURL!=HashLocationName||gbl_DirectLoadAttrInfo||gbl_ShowMPPForLandingCall||gbl_DirectLoadNBCPage){setWebPageTitle(HashLocationName);var tempflag=false;if(HashLocationName.indexOf("&c=")!=-1&&global_PreviousURL.indexOf("&c=")!=-1){var PrevCityStrArr=global_PreviousURL.split("&c=")[1];var CurrCityStrArr=HashLocationName.split("&c=")[1];tempflag=true;}else if((HashLocationName.indexOf("&c=")!=-1&&global_PreviousURL.indexOf("&a=")!=-1)){var PrevCityStrArr=global_PreviousURL.split("&a=")[1];var CurrCityStrArr=HashLocationName.split("&c=")[1];tempflag=true;}else if(HashLocationName.indexOf("&a=")!=-1&&global_PreviousURL.indexOf("&c=")!=-1){var PrevCityStrArr=global_PreviousURL.split("&c=")[1];var CurrCityStrArr=HashLocationName.split("&a=")[1];tempflag=true;}if(tempflag){tempflag=false;if(PrevCityStrArr.indexOf("&i=")!=-1){PrevCityStrArr=PrevCityStrArr.split("&i=")[0];}if(CurrCityStrArr.indexOf("&i=")!=-1){CurrCityStrArr=CurrCityStrArr.split("&i=")[0];}if(PrevCityStrArr!=CurrCityStrArr){global_PreviousURLCity=revertCustomSpecialChar(PrevCityStrArr);}global_CurrentURLCity=revertCustomSpecialChar(CurrCityStrArr);if(!gbl_DirectLoadNBCPage){global_PreviousURLCity=revertCustomSpecialChar(PrevCityStrArr);}else{PrevCityStrArr=global_PreviousURLCity;}global_CurrentURLCity=revertCustomSpecialChar(CurrCityStrArr);var tempFlag=false;var tempNBCID=-1;var intCnt=searchItem(global_List_CityName,global_CurrentURLCity,true,"cityName");if(intCnt==-1){for(var tempCnt=0;tempCnt<gbl_arrAllNearByCities.length;tempCnt++){if(global_CurrentURLCity==gbl_arrAllNearByCities[tempCnt].name){tempNBCID=gbl_arrAllNearByCities[tempCnt].id;break;}}gbl_ABNBCId=tempNBCID;}}global_PreviousURL=HashLocationName;if(HashLocationName.indexOf("#")!=-1){if(HashLocationName.indexOf("&a=")!=-1){tmpHashCenterLocationName=HashLocationName.substring(HashLocationName.indexOf("&a=")+3,HashLocationName.indexOf("&l="));}else if(HashLocationName.indexOf("&ct=")!=-1){tmpHashCenterLocationName=HashLocationName.substring(HashLocationName.indexOf("&ct=")+4,HashLocationName.indexOf("&c="));}else if(HashLocationName.indexOf("&c=")!=-1){tmpHashCenterLocationName=HashLocationName.substring(HashLocationName.indexOf("&c=")+3,HashLocationName.indexOf("&l="));}if(HashLocationName.indexOf("&i=")!=-1){if(HashLocationName.indexOf("&Event=")==-1){HashLocationName=HashLocationName.substring(HashLocationName.indexOf("&i=")+3,HashLocationName.length);}else{HashLocationName=HashLocationName.substring(HashLocationName.indexOf("&i=")+3,HashLocationName.indexOf("&Event="));}if(HashLocationName!=tmpHashCenterLocationName){var tmpHashLocationName="";tmpHashLocationName=HashLocationName;if(HashLocationName.indexOf("%E2%84%A2")==-1){tmpHashLocationName=encodeURIComponent(HashLocationName);}if(tmpHashLocationName.indexOf("%E2%84%A2")!=-1){HashLocationName=tmpHashLocationName.replace(/%E2%84%A2/g,"&trade;");}if(!isIE){if(tmpHashLocationName.indexOf("&trade;")==-1){HashLocationName=decodeURIComponent(HashLocationName);}}HashLocationName=revertCustomSpecialChar(HashLocationName);if(gbl_DirectLoadLandingPage||gbl_SlideNBC){slideABItemFromMapMode=true;gbl_SlideNBC=false;}if(gbl_inNBC){displayNBCMap(global_CurrentURLCity);}getURILogistical(HashLocationName);if(!gbl_isItemDraged){if(!gblABDisplayed){objLogistical=getLogisticalIdByName(HashLocationName);if(objLogistical){logType=objLogistical.type;var displayType=objLogistical.displayType;if(displayType){if(displayType.charAt(0)==0&&displayType.charAt(1)==0&&displayType.charAt(2)==1){logType="Restaurant";}}if(logType=="Restaurant"){if(!gbl_objAirportLocation){displayDetailsWithNoPriority();}gbl_locationBase=new CLSLocationBase(gbl_objAirportLocation,gbl_objTimeLocation,gbl_objArrBudget,gbl_popularObj,gbl_interestsObj);gbl_arrLocationObj=gbl_locationBase.airportLocationsObj.arrLocation;if(gblIsRedirectFromSearchBox){if(gblRestaurantTripPriority=3){gblRestaurantSubTripPriority=0;document.getElementById('RestaurantPricefilter').value=0;gbl_restaurantsPriceRangeVal=-1;gblIsRedirectFromSearchBox=false;}}if(document.getElementById('divRestaurant')&&document.getElementById('divRestaurant').style.display=="none"){renderRestaurants(0);showRestaurant();}}else if(logType=="ViatorPass"||logType=="ViatorTours"){if(document.getElementById('divViatorTours').style.display=="none"){showViatorTours();renderTours();}}else if(logType=="Shopping"||objLogistical.parentType=="TSShopping"){if(document.getElementById('divShopping').style.display=="none"){showShopping();renderShopping();}}else if(logType=="Event"){if(document.getElementById('divEvents')&&document.getElementById('divEvents').style.display=="none"){showEvents();renderEvents();}}else if(logType=="Hotel"){if(gblSelectedType!="Hotel"){showHotels();renderAttractions();}}else if(logType=="Attraction"){if(document.getElementById('attraction-list').style.display=="none"){showAttractions();}}gblIsRedirectFromSearchBox=false;slideABItemFromMapMode=true;expandItemFromABList(HashLocationName,logType);}}else{objLogistical=getLogisticalIdByName(HashLocationName);if(global_start_location!=4){if(objLogistical){logType=objLogistical.type;var displayType=objLogistical.displayType;if(displayType){if(displayType.charAt(0)==0&&displayType.charAt(1)==0&&displayType.charAt(2)==1){logType="Restaurant";}}if(logType=="Restaurant"){if(!gbl_inNBC&&gbl_DirectLoadNBCPage){renderLocations();if(!gbl_objAirportLocation){displayDetailsWithNoPriority();}gbl_locationBase=new CLSLocationBase(gbl_objAirportLocation,gbl_objTimeLocation,gbl_objArrBudget,gbl_popularObj,gbl_interestsObj);gbl_arrLocationObj=gbl_locationBase.airportLocationsObj.arrLocation;if(gblIsRedirectFromSearchBox){if(gblRestaurantTripPriority=3){gblRestaurantSubTripPriority=0;gbl_restaurantsPriceRangeVal=-1;document.getElementById('RestaurantPricefilter').value=0;gblIsRedirectFromSearchBox=false;}}}if(document.getElementById('divRestaurant')&&document.getElementById('divRestaurant').style.display=="none"){showRestaurant();renderRestaurants(0);}}else if(logType=="ViatorPass"||logType=="ViatorTours"){if(document.getElementById('divViatorTours').style.display=="none"){showViatorTours();renderTours();}}else if(logType=="Shopping"||objLogistical.parentType=="TSShopping"){if(document.getElementById('divShopping').style.display=="none"){showShopping();renderShopping();}}else if(logType=="Hotel"){if(gblSelectedType!="Hotel"){showHotels();renderAttractions();}}else if(logType=="Event"){if(document.getElementById('divEvents')&&document.getElementById('divEvents').style.display=="none"){showEvents();}renderEvents();}else if(logType=="Attraction"||logType=="Service"){if((document.getElementById('divRestaurant')&&(document.getElementById('divRestaurant').style.display==""||document.getElementById('divRestaurant').style.display=="block")&&(objLogistical.interests.match("11")||objLogistical.flagRest=="Restaurant"))){}else{if(gbl_inNBC){gbl_ShowMPPForLandingCall=false;gbl_DirectLoadAttrInfo=false;updateMainURL(global_CurrentURLCity);}else if(global_CurrentURLCity!=global_PreviousURLCity&&global_PreviousURLCity!=""){var cityArr=getCityLocationIdByName(global_CurrentURLCity);var currCityID=cityArr.CityId;if(global_CurrentURLCity!=global_CityAirportInfoObj.Name){gbl_inNBC=true;getNearByCities(global_CurrentURLCity);}else{renderThisCity(currCityID,global_CurrentURLCity,false);}}else{showAttractions();renderAttractions();}}}gblIsRedirectFromSearchBox=false;slideABItemFromMapMode=true;expandItemFromABList(HashLocationName,logType);}}else{expandItemFromABList(HashLocationName,'');}try{showMapInfoWindow(HashLocationName);showTransportMapInfoWindow(HashLocationName);}catch(err){}}}else{try{showMapInfoWindow(HashLocationName);showTransportMapInfoWindow(HashLocationName);}catch(err){}}if(!gblIsDetailsDisplayed){getURILogistical(HashLocationName);}if(gblSelectedType=='Restaurant'){if(document.getElementById("divRestaurant")){document.getElementById("divRestaurant").style.height="515";}}if(gbl_isDataRendered){gbl_ShowMPPForLandingCall=false;}}}else{if(HashLocationName.indexOf("&a=")!=-1||HashLocationName.indexOf("&c=")!=-1||HashLocationName.indexOf("&ct=")!=-1){var cityName="",countryName="";if(HashLocationName.indexOf("&ct=")!=-1&&HashLocationName.indexOf("&c=")==-1){countryName=revertCustomSpecialChar(HashLocationName.substring(HashLocationName.indexOf("&ct=")+4,HashLocationName.length));}if(HashLocationName.indexOf("&ct=")!=-1&&HashLocationName.indexOf("&c=")!=-1&&HashLocationName.indexOf("&i=")==-1){cityName=revertCustomSpecialChar(HashLocationName.substring(HashLocationName.indexOf("&c=")+3,HashLocationName.length));countryName=revertCustomSpecialChar(HashLocationName.substring(HashLocationName.indexOf("&ct=")+4,HashLocationName.length));}else if(HashLocationName.indexOf("&ct=")!=-1&&HashLocationName.indexOf("&c=")!=-1){cityName=revertCustomSpecialChar(HashLocationName.substring(HashLocationName.indexOf("&c=")+3,HashLocationName.indexOf("&i=")));countryName=revertCustomSpecialChar(HashLocationName.substring(HashLocationName.indexOf("&ct=")+4,HashLocationName.length));}if(countryName!=""&&cityName==""){if(gbl_CountryList.length<=0){SendRequest("/countries","get","countrylist");}global_start_location=4;fillMCntryDetails(countryName);DisplayCountryRegionDetails("Country",'');displaySelectedCountry();}else if(cityName!=""){if(cityName.match("&view")){cityName=cityName.split("&view")[0];}if(global_start_location==4){if(HashLocationName.indexOf("&view=")!=-1){viewType=HashLocationName.substring(HashLocationName.indexOf("&view=")+6,HashLocationName.length);showLoadingImages();var iCnt=searchItem(gbl_CityList,cityName,true,"cityDetails");var CityId=gbl_CityList[iCnt].CityId;gblSelectedType=viewType;if(viewType=="MyList"){if(iCnt!=-1){SendRequest("AttractionList.php?CityId="+CityId+"&t="+viewType,'get','attractionList');}}else{if(iCnt!=-1){if(viewType=="nbcPopAttractions"||viewType=="nbcAttractions"){for(var tempCnt=0;tempCnt<gbl_arrAllCities.length;tempCnt++){if(gbl_arrAllCities[tempCnt].id==CityId){nbCityarr=gbl_arrAllCities[tempCnt].nbCities;break}}var cityIdList="";for(var tempCnt=0;tempCnt<nbCityarr.length;tempCnt++){cityIdList=(cityIdList=="")?nbCityarr[tempCnt].id:(cityIdList+","+nbCityarr[tempCnt].id);}var CityList={'City':cityIdList};formData=ued_encode(CityList);SendRequest("AttractionList.php?CityId="+CityId+"&t="+viewType,'post','attractionList');}else{SendRequest("AttractionList.php?CityId="+CityId+"&t="+viewType,'get','attractionList');}}else{DisplayCurrentLocationDetails(cityName);}}}else{DisplayCurrentLocationDetails(cityName);}}else{DisplayCurrentLocationDetails(cityName);}}else{if(HashLocationName.indexOf("&c=")!=-1){cityName=revertCustomSpecialChar(HashLocationName.substring(HashLocationName.indexOf("&c=")+3,HashLocationName.length));}else{cityName=revertCustomSpecialChar(HashLocationName.substring(HashLocationName.indexOf("&a=")+3,HashLocationName.length));}if(gbl_inURLArchNBC){gbl_mapFlag=0;if(gbl_fromNBC){gbl_inNBC=false;}enlargeAttractionBrowserMap("true");getNearByCities(cityName);gbl_inURLArchNBC=false;updateMainURL(global_CurrentURLCity);if(isIE){if(document.getElementById("enlargeMapDiv").style.display==""||document.getElementById("enlargeMapDiv").style.display=="block"){setTimeout("document.getElementById('lblSwitchToPic').style.display=\"\";document.getElementById('lblSwitchToMap').style.display=\"none\";",1000);}}}else if(global_CurrentURLCity!=global_PreviousURLCity&&global_PreviousURLCity!=""){currCityID=global_CityAirportInfoObj.CityID;if(global_CurrentURLCity!=global_CityAirportInfoObj.Name&&global_start_location!=0){var isCityFound=false;if(global_start_location==3){for(var lmcCnt=0;lmcCnt<gbl_VacationCityPlanner.length;lmcCnt++){if(gbl_VacationCityPlanner[lmcCnt].CityName==global_CurrentURLCity){isCityFound=true;if(lmcCnt<gbl_VacationCityPlannerIndex)switchDay(-1);else switchDay(1);break;}}}if(!isCityFound){for(var aCnt=0;aCnt<gbl_arrAllNearByCities.length;aCnt++){if(gbl_arrAllNearByCities[aCnt].name==global_CurrentURLCity&&gbl_arrAllNearByCities[aCnt].locationCnt==1){gbl_inNBC=true;gbl_fromNBC=false;gbl_arrAllLogisticals=new Array();gbl_arrAllNearByCities[aCnt].logisticalsObj="";getNearByCities(global_CurrentURLCity);DisplayCurrentLocationDetails(global_CurrentURLCity);break;}}}}else if(global_CurrentURLCity!=global_CityAirportInfoObj.Name&&global_CityAirportInfoObj.StartType==0){for(var aCnt=0;aCnt<gbl_arrAllNearByCities.length;aCnt++){if(gbl_arrAllNearByCities[aCnt].name==global_CurrentURLCity&&gbl_arrAllNearByCities[aCnt].locationCnt==1){gbl_inNBC=true;getNearByCities(global_CurrentURLCity);DisplayCurrentLocationDetails(global_CurrentURLCity);}}}else{if(gbl_inNBC){renderThisCity(currCityID,global_CurrentURLCity,true,false);}else{renderThisCity(currCityID,global_CurrentURLCity,false,false);}}}else{if(global_start_location!=0){if(gbl_arrAllNearByCities.length>0||(gbl_arrAllCities&&gbl_arrAllCities.length>0)){DisplayCurrentLocationDetails(cityName);displaySelectedFilter(global_travellerpriority_org);}}else if(global_start_location==0){if(gbl_arrAllNearByCities.length>0||(gbl_arrAllLocations&&gbl_arrAllLocations.length>0)){DisplayCurrentLocationDetails(cityName);}}else{if(gbl_inNBC){var iCnt=searchItem(gbl_CityList,cityName,true,"cityDetails");if(iCnt!=-1){var tempCityId=gbl_CityList[iCnt].CityId;defaultLocationId=tempCityId;}}if(gbl_isNBCMPPReceived){DisplayCurrentLocationDetails(cityName);}}}}if(mapObjects.length>0){if(HashLocationName.indexOf("&a=")!=-1){}else if(HashLocationName.indexOf("&ct=")!=-1){}else{}}}}}}}function RedirectURLLocation(URLHashName){if(gblIsURLImplemented){gblIsURLImplemented=false;global_PreviousURL="";}if(document.getElementById("CurrentLocationAnchor")){document.getElementById("CurrentLocationAnchor").name=URLHashName;}if(isIE){document.location.href=URLHashName;}else{document.location.href=URLHashName;}if(isIE){addHistoryEvent(URLHashName,URLHashName);}CheckForPageURLHash();}function setWebPageTitle(URLHashName){if(hideRouteRank){return;}if(document.title){var tmpTitleBarTextStr="TripSketch";var tmpURLHashWithSpace="",HashLocationName="";tmpURLHashWithSpace=URLHashName.replace(/_/g," ");if(URLHashName.indexOf("&i=")!=-1){if(URLHashName.indexOf("&Event=")==-1){HashLocationName=URLHashName.substring(URLHashName.indexOf("&i=")+3,URLHashName.length);}else{HashLocationName=URLHashName.substring(URLHashName.indexOf("&i=")+3,URLHashName.indexOf("&Event="));}HashLocationName=HashLocationName.replace(/_/g," ");tmpTitleBarTextStr=tmpTitleBarTextStr+": "+HashLocationName;}if(tmpURLHashWithSpace.indexOf("&a=")!=-1){if(tmpURLHashWithSpace.indexOf("&i=")!=-1){if(gblAirportCityName&&gblAirportCityName!=""){tmpTitleBarTextStr=tmpTitleBarTextStr+", "+gblAirportCityName;try{pageTracker._trackPageview(tmpURLHashWithSpace.substring(tmpURLHashWithSpace.indexOf("&i=")+3,tmpURLHashWithSpace.length)+", "+gblAirportCityName);}catch(err){}}else{tmpTitleBarTextStr=tmpTitleBarTextStr+", "+tmpURLHashWithSpace.substring(tmpURLHashWithSpace.indexOf("&a=")+3,tmpURLHashWithSpace.indexOf("&i="));try{pageTracker._trackPageview(tmpURLHashWithSpace.substring(tmpURLHashWithSpace.indexOf("&i=")+3,tmpURLHashWithSpace.length)+", "+tmpURLHashWithSpace.substring(tmpURLHashWithSpace.indexOf("&a=")+3,tmpURLHashWithSpace.indexOf("&i=")));}catch(err){}}}else{tmpTitleBarTextStr=tmpTitleBarTextStr+": "+tmpURLHashWithSpace.substring(tmpURLHashWithSpace.indexOf("&a=")+3,tmpURLHashWithSpace.length);try{pageTracker._trackPageview(tmpURLHashWithSpace.substring(tmpURLHashWithSpace.indexOf("&a=")+3,tmpURLHashWithSpace.length));}catch(err){}}}else if(tmpURLHashWithSpace.indexOf("&ct=")!=-1){if(tmpURLHashWithSpace.indexOf("&i=")!=-1){tmpTitleBarTextStr=tmpTitleBarTextStr+", "+tmpURLHashWithSpace.substring(tmpURLHashWithSpace.indexOf("&c=")+3,tmpURLHashWithSpace.indexOf("&i="));try{pageTracker._trackPageview(tmpURLHashWithSpace.substring(tmpURLHashWithSpace.indexOf("&c=")+3,tmpURLHashWithSpace.indexOf("&i=")));}catch(err){}}else if(tmpURLHashWithSpace.indexOf("&c=")!=-1){tmpTitleBarTextStr=tmpTitleBarTextStr+", "+tmpURLHashWithSpace.substring(tmpURLHashWithSpace.indexOf("&ct=")+4,tmpURLHashWithSpace.indexOf("&c="));try{pageTracker._trackPageview(tmpURLHashWithSpace.substring(tmpURLHashWithSpace.substring(tmpURLHashWithSpace.indexOf("&ct=")+4,tmpURLHashWithSpace.indexOf("&c="))));}catch(err){}}else{tmpTitleBarTextStr=tmpTitleBarTextStr+": "+tmpURLHashWithSpace.substring(tmpURLHashWithSpace.indexOf("&ct=")+4,tmpURLHashWithSpace.length);try{pageTracker._trackPageview(tmpURLHashWithSpace.substring(tmpURLHashWithSpace.indexOf("&ct=")+4,tmpURLHashWithSpace.length));}catch(err){}}}else if(tmpURLHashWithSpace.indexOf("&c=")!=-1){if(tmpURLHashWithSpace.indexOf("&i=")!=-1){tmpTitleBarTextStr=tmpTitleBarTextStr+", "+tmpURLHashWithSpace.substring(tmpURLHashWithSpace.indexOf("&c=")+3,tmpURLHashWithSpace.indexOf("&i="));try{pageTracker._trackPageview(tmpURLHashWithSpace.substring(tmpURLHashWithSpace.indexOf("&i=")+3,tmpURLHashWithSpace.length)+", "+tmpURLHashWithSpace.substring(tmpURLHashWithSpace.substring(tmpURLHashWithSpace.indexOf("&c=")+3,tmpURLHashWithSpace.indexOf("&i="))));}catch(err){}}else{tmpTitleBarTextStr=tmpTitleBarTextStr+": "+tmpURLHashWithSpace.substring(tmpURLHashWithSpace.indexOf("&c=")+3,tmpURLHashWithSpace.length);try{pageTracker._trackPageview(tmpURLHashWithSpace.substring(tmpURLHashWithSpace.indexOf("&c=")+3,tmpURLHashWithSpace.length));}catch(err){}}}else if(tmpURLHashWithSpace.indexOf("&bl=")!=-1){tmpTitleBarTextStr=tmpTitleBarTextStr+": "+tmpURLHashWithSpace.substring(tmpURLHashWithSpace.indexOf("&bl=")+4,tmpURLHashWithSpace.length);try{pageTracker._trackPageview("Blog: "+tmpURLHashWithSpace.substring(tmpURLHashWithSpace.indexOf("&bl=")+4,tmpURLHashWithSpace.length));}catch(err){}}else if(tmpURLHashWithSpace.indexOf("&ar=")!=-1){tmpTitleBarTextStr=tmpTitleBarTextStr+": "+tmpURLHashWithSpace.substring(tmpURLHashWithSpace.indexOf("&ar=")+4,tmpURLHashWithSpace.length);try{pageTracker._trackPageview("Articles: "+tmpURLHashWithSpace.substring(tmpURLHashWithSpace.indexOf("&ar=")+4,tmpURLHashWithSpace.length));}catch(err){}}else if(tmpURLHashWithSpace.indexOf("=budget")!=-1&&tmpURLHashWithSpace.indexOf("&ci=")==-1){tmpTitleBarTextStr=tmpTitleBarTextStr+": Budget";}else if(tmpURLHashWithSpace.indexOf("&ci=")!=-1){tmpTitleBarTextStr=tmpTitleBarTextStr+": Budget-"+tmpURLHashWithSpace.substring(tmpURLHashWithSpace.indexOf("&ci=")+4,tmpURLHashWithSpace.length);try{pageTracker._trackPageview(tmpURLHashWithSpace.substring(tmpURLHashWithSpace.indexOf("&ci=")+4,tmpURLHashWithSpace.length)+" Budget");}catch(err){}}else if(tmpURLHashWithSpace.indexOf("=mytrips")!=-1&&tmpURLHashWithSpace.indexOf("&it=")==-1){tmpTitleBarTextStr=tmpTitleBarTextStr+": MyTrips";}else if(tmpURLHashWithSpace.indexOf("&it=")!=-1){tmpTitleBarTextStr=tmpTitleBarTextStr+": MyTrips-"+tmpURLHashWithSpace.substring(tmpURLHashWithSpace.indexOf("&it=")+4,tmpURLHashWithSpace.length);}else if(tmpURLHashWithSpace.indexOf("&itiname=")!=-1){tmpTitleBarTextStr=tmpTitleBarTextStr+": MyBid-"+tmpURLHashWithSpace.substring(tmpURLHashWithSpace.indexOf("&itiname=")+9,tmpURLHashWithSpace.length);}if(tmpTitleBarTextStr&&tmpTitleBarTextStr!=""){document.title=tmpTitleBarTextStr;}}}function getIdFromName(name,type){var id;if(type=="articles"){if(!gbl_DirectLoadArticlePage){for(var cntr=0;cntr<gbl_HomePageArticles.length;cntr++){if(gbl_HomePageArticles[cntr].headline==name){id=gbl_HomePageArticles[cntr].articleId;gbl_articleid=id;break;}}}else{for(var cntr=0;cntr<gbl_DetailedPageArticles.length;cntr++){if(name==gbl_DetailedPageArticles[cntr].headline){id=gbl_DetailedPageArticles[cntr].articleId;gbl_articleid=id;break;}}}}else if(type=="blogs"){var blogCntr=0;for(blogCntr=0;blogCntr<gbl_AllBlogsDetailsArr.length;blogCntr++){if(gbl_AllBlogsDetailsArr[blogCntr].headline==name){id=gbl_AllBlogsDetailsArr[blogCntr].blogId;gbl_currentBlogid=gbl_AllBlogsDetailsArr[blogCntr].blogId;gbl_currentBlogType=gbl_AllBlogsDetailsArr[blogCntr].blogTypeId;break;}}}return id;}function getArticleBlogsNameFromId(Id,type){var Name;if(type=="articles"){for(var cntr=0;cntr<gbl_HomePageArticles.length;cntr++){if(gbl_HomePageArticles[cntr].articleId==Id){Name=gbl_HomePageArticles[cntr].headline;break;}}}else if(type=="blogs"){var blogCntr=0;for(blogCntr=0;blogCntr<gbl_AllBlogsDetailsArr.length;blogCntr++){if(gbl_AllBlogsDetailsArr[blogCntr].blogId==Id){Name=gbl_AllBlogsDetailsArr[blogCntr].headline;break;}}}return Name}function htmlentities(s){var div=document.createElement('div');var text=document.createTextNode(s);div.appendChild(text);return div.innerHTML;}function getURILogistical(logisticalID){var isDataFound=false;gblIsDetailsDisplayed=false;if(logisticalID&&typeof(gbl_arrAllLogisticals)&&gbl_arrAllLogisticals.length>0){for(var tempCntr=0;tempCntr<gbl_arrAllLogisticals.length;tempCntr++){var tmpDecodedLogisticalName=decodeURIComponent(logisticalID);if(gbl_arrAllLogisticals[tempCntr].id==logisticalID||gbl_arrAllLogisticals[tempCntr].name==logisticalID||gbl_arrAllLogisticals[tempCntr].name==tmpDecodedLogisticalName||htmlentities(gbl_arrAllLogisticals[tempCntr].name)==logisticalID){isDataFound=true;gblIsDetailsDisplayed=true;displayLogisticalsDetails(gbl_arrAllLogisticals[tempCntr].uri);break;}}}if(!isDataFound){if(gblABDisplayed){getLocationId(logisticalID,false);}else{getLocationId(logisticalID,true);}}}function getPageHashURL(pageHash){var tmpCurrentURLString=document.location.href;if(tmpCurrentURLString.indexOf("#p")!=-1){tmpCurrentURLString=tmpCurrentURLString.substring(0,tmpCurrentURLString.indexOf("#"))+pageHash;}return tmpCurrentURLString;}function getLogisticalNameById(logisticalAttrId,logisticalAttrType,logisticalAttrURI){var tmpLogisticalAttrName=null;var tmpLogisticalNameCounter=0;if(logisticalAttrId){for(tmpLogisticalNameCounter=0;tmpLogisticalNameCounter<gbl_arrAllLogisticals.length;tmpLogisticalNameCounter++){if((gbl_arrAllLogisticals[tmpLogisticalNameCounter].id==logisticalAttrId&&gbl_arrAllLogisticals[tmpLogisticalNameCounter].type==logisticalAttrType)||gbl_arrAllLogisticals[tmpLogisticalNameCounter].uri==logisticalAttrURI){tmpLogisticalAttrName=gbl_arrAllLogisticals[tmpLogisticalNameCounter].name;break;}}}return tmpLogisticalAttrName;}function getLogisticalIdByName(logisticalAttrName){var tmpLogisticalAttrName=null;var tmpLogisticalNameCounter=0;if(logisticalAttrName){for(tmpLogisticalNameCounter=0;tmpLogisticalNameCounter<gbl_arrAllLogisticals.length;tmpLogisticalNameCounter++){if(gbl_arrAllLogisticals[tmpLogisticalNameCounter].name==logisticalAttrName){tmpLogisticalAttrName=gbl_arrAllLogisticals[tmpLogisticalNameCounter];return tmpLogisticalAttrName;break;}}for(tmpLogisticalNameCounter=0;tmpLogisticalNameCounter<gbl_arrAllLogisticalName.length;tmpLogisticalNameCounter++){if(gbl_arrAllLogisticalName[tmpLogisticalNameCounter].name==logisticalAttrName){tmpLogisticalAttrName=gbl_arrAllLogisticalName[tmpLogisticalNameCounter];break;}}}return tmpLogisticalAttrName;}function getLocationNameById(currentLocationId){var tmpCurrentLocationName=null;var tmpLocationCounter=0;if(currentLocationId){for(tmpLocationCounter=0;tmpLocationCounter<gbl_arrAllLocations.length;tmpLocationCounter++){if(gbl_arrAllLocations[tmpLocationCounter].id==currentLocationId){tmpCurrentLocationName=gbl_arrAllLocations[tmpLocationCounter].name;break;}}}return tmpCurrentLocationName;}function getLogisticalURIByName(logisticalObjName){var tmpLogisticalAttrUri=null;var tmpLogisticalURICounter=0;if(logisticalObjName){var tmpDecodedLogisticalName=decodeURIComponent(logisticalObjName);for(tmpLogisticalURICounter=0;tmpLogisticalURICounter<gbl_arrAllLogisticals.length;tmpLogisticalURICounter++){if(gbl_arrAllLogisticals[tmpLogisticalURICounter].name==logisticalObjName||gbl_arrAllLogisticals[tmpLogisticalURICounter].name==tmpDecodedLogisticalName||htmlentities(gbl_arrAllLogisticals[tmpLogisticalURICounter].name)==logisticalObjName){tmpLogisticalAttrUri=gbl_arrAllLogisticals[tmpLogisticalURICounter].uri;break;}}}return tmpLogisticalAttrUri;}function getAirportLocationIdByName(urlAirportName){var tmpAirportLocationId=-1;var tmpAirportCounter=0;if(urlAirportName){airportvalue=urlAirportName.replace("(","");airportvalue=airportvalue.replace(")","").toLowerCase();for(tmpAirportCounter=0;tmpAirportCounter<gbl_AirportList.length;tmpAirportCounter++){dbAirportName=gbl_AirportList[tmpAirportCounter].AirportName.toLowerCase().replace("(","");dbAirportName=dbAirportName.toLowerCase().replace(")","");if(airportvalue==dbAirportName){tmpAirportLocationId=gbl_AirportList[tmpAirportCounter];break;}}}return tmpAirportLocationId;}function getCityLocationIdByName(urlCityName){var tmpCityLocationId=-1;var tmpCityCounter=0;if(urlCityName){for(tmpCityCounter=0;tmpCityCounter<gbl_CityList.length;tmpCityCounter++){if(gbl_CityList[tmpCityCounter].CityName==urlCityName||gbl_CityList[tmpCityCounter].CityId==urlCityName){tmpCityLocationId=gbl_CityList[tmpCityCounter];break;}}}return tmpCityLocationId;}function getCountryLocationIdByName(urlCityName){var tmpCityLocationId=-1;var tmpCityCounter=0;if(urlCityName){for(tmpCityCounter=0;tmpCityCounter<gbl_CountryList.length;tmpCityCounter++){if(gbl_CountryList[tmpCityCounter].Name==urlCityName||gbl_CountryList[tmpCityCounter].Id==urlCityName){tmpCityLocationId=gbl_CountryList[tmpCityCounter];break;}}}return tmpCityLocationId;}function getItineraryIdFromName(nameStr){var itineraryId=null;for(var itiCntr=0;itiCntr<gbl_arrMyItinerary.length;itiCntr++){if(gbl_arrMyItinerary[itiCntr].name==nameStr){itineraryId=gbl_arrMyItinerary[itiCntr].id;break;}}return itineraryId;}function getItineraryNameFromId(Id){var itineraryName=null;for(var itiCntr=0;itiCntr<gbl_arrMyItinerary.length;itiCntr++){if(Id==gbl_arrMyItinerary[itiCntr].id){itineraryName=gbl_arrMyItinerary[itiCntr].name;break;}}return itineraryName;}function getBudgetId(cityName){var budgetId=null;for(var cntr=0;cntr<gbl_userBudgetDetail.length;cntr++){if(cityName==gbl_userBudgetDetail[cntr].cityname){budgetId=gbl_userBudgetDetail[cntr].BudgetId;break;}}return budgetId;}function loadCurrentURLAttractionDetails(){var global_slotEventStartDateTime;var global_slotEventEndDateTime;var tmpCurrentURL="";var tmpCurrentShowMPPURI="";if(document.location.hash){tmpCurrentURL=document.location.href;if(tmpCurrentURL.indexOf("&arrdate=")==-1){globalStartDate=new Date();globalStartDate.setHours(9);globalStartDate.setMinutes(0);globalStartDate.setSeconds(0);var ONE_DAY=1000*60*60*24;globalStartDate=new Date(globalStartDate.getTime()+ONE_DAY);globalEndDate=new Date(globalStartDate.getTime()+ONE_DAY);global_starttime="09:00:00";global_endtime="09:00:00";}else{if(tmpCurrentURL.indexOf("&Event=")!=-1){gblIsEvent=true;globalStartDate=new Date(tmpCurrentURL.substring(tmpCurrentURL.indexOf("&arrdate=")+9,tmpCurrentURL.indexOf("&arrtime=")).replace(/-/g,"/"));global_starttime=tmpCurrentURL.substring(tmpCurrentURL.indexOf("&arrtime=")+9,tmpCurrentURL.indexOf("&depdate="));globalStartDate.setHours(global_starttime.split(":")[0]);globalStartDate.setMinutes(global_starttime.split(":")[1]);global_VisitStartDateTime=new Date(globalStartDate.getTime());globalEndDate=new Date(tmpCurrentURL.substring(tmpCurrentURL.indexOf("&depdate=")+9,tmpCurrentURL.indexOf("&deptime=")).replace(/-/g,"/"));global_endtime=tmpCurrentURL.substring(tmpCurrentURL.indexOf("&deptime=")+9,tmpCurrentURL.length);globalEndDate.setHours(global_endtime.split(":")[0]);globalEndDate.setMinutes(global_endtime.split(":")[1]);globalStartDate=new Date(globalStartDate.getTime()-(1000*60*60*6));globalEndDate=new Date(globalEndDate.getTime()+(1000*60*60*6));global_starttime=(globalStartDate.getHours()<10)?"0"+globalStartDate.getHours():globalStartDate.getHours();var startMin=(globalStartDate.getMinutes()<10)?"0"+globalStartDate.getMinutes():globalStartDate.getMinutes();global_starttime=global_starttime+":"+startMin+":00";global_endtime=(globalEndDate.getHours()<10)?"0"+globalEndDate.getHours():globalEndDate.getHours();var endMin=(globalEndDate.getMinutes()<10)?"0"+globalEndDate.getMinutes():globalEndDate.getMinutes();global_endtime=global_endtime+":"+endMin+":00";globalStartDate.setHours(0);globalStartDate.setMinutes(0);globalEndDate.setHours(0);globalEndDate.setMinutes(0);}else{if(hideRouteRank==true){globalStartDate=new Date(tmpCurrentURL.substring(tmpCurrentURL.indexOf("&arrdate=")+9,tmpCurrentURL.indexOf("&depdate=")).replace(/-/g,"/"));globalEndDate=new Date(tmpCurrentURL.substring(tmpCurrentURL.indexOf("&depdate=")+9,tmpCurrentURL.indexOf("&proxypage=")).replace(/-/g,"/"));global_starttime='09:00:00';global_endtime='09:00:00';gblFairquoteReturnURL=tmpCurrentURL.substring(tmpCurrentURL.indexOf("&proxypage=")+11);}else{globalStartDate=new Date(tmpCurrentURL.substring(tmpCurrentURL.indexOf("&arrdate=")+9,tmpCurrentURL.indexOf("&arrtime=")).replace(/-/g,"/"));global_starttime=tmpCurrentURL.substring(tmpCurrentURL.indexOf("&arrtime=")+9,tmpCurrentURL.indexOf("&depdate="));globalEndDate=new Date(tmpCurrentURL.substring(tmpCurrentURL.indexOf("&depdate=")+9,tmpCurrentURL.indexOf("&deptime=")).replace(/-/g,"/"));global_endtime=tmpCurrentURL.substring(tmpCurrentURL.indexOf("&deptime=")+9,tmpCurrentURL.length);}}}global_slotStartDateTime=globalStartDate;global_slotStartDateTime.setHours(global_starttime.split(":")[0]);global_slotStartDateTime.setMinutes(global_starttime.split(":")[1]);global_slotEndDateTime=globalEndDate;global_slotEndDateTime.setHours(global_endtime.split(":")[0]);global_slotEndDateTime.setMinutes(global_endtime.split(":")[1]);var monthStr=(parseInt(globalStartDate.getMonth())+1<10)?"0"+(parseInt(globalStartDate.getMonth())+1):parseInt(globalStartDate.getMonth())+1;var dateStr=(parseInt(globalStartDate.getDate())<10)?"0"+(parseInt(globalStartDate.getDate())):parseInt(globalStartDate.getDate());var arrivalDate=(monthStr)+"/"+dateStr+"/"+globalStartDate.getFullYear();monthStr=(parseInt(globalEndDate.getMonth())+1<10)?"0"+(parseInt(globalEndDate.getMonth())+1):parseInt(globalEndDate.getMonth())+1;dateStr=(parseInt(globalEndDate.getDate())<10)?"0"+(parseInt(globalEndDate.getDate())):parseInt(globalEndDate.getDate());var departureDate=(monthStr)+"/"+dateStr+"/"+globalEndDate.getFullYear();try{global_TotalNumSlots=createItineraryTimeSlots(global_slotStartDateTime,global_slotEndDateTime);}catch(err){}showLoadingImages();if(tmpCurrentURL.indexOf("&a=")!=-1){if(tmpCurrentURL.indexOf("&i=")!=-1){tmpCurrentShowMPPURI=tmpCurrentURL.substring(tmpCurrentURL.indexOf("&a=")+3,tmpCurrentURL.indexOf("&i="));}else if(tmpCurrentURL.indexOf("&arrdate=")!=-1){tmpCurrentShowMPPURI=tmpCurrentURL.substring(tmpCurrentURL.indexOf("&a=")+3,tmpCurrentURL.indexOf("&arrdate="));}else{tmpCurrentShowMPPURI=tmpCurrentURL.substring(tmpCurrentURL.indexOf("&a=")+3,tmpCurrentURL.length);}tmpCurrentShowMPPURI=tmpCurrentShowMPPURI.replace(/_/g," ");tmpCurrentShowMPPURI=getAirportLocationIdByName(tmpCurrentShowMPPURI);if(tmpCurrentShowMPPURI!=-1){var AirportId=tmpCurrentShowMPPURI.AirportId;var AirportCode=tmpCurrentShowMPPURI.AirportCode;var AirportName=tmpCurrentShowMPPURI.AirportName;var AirportLocationId=tmpCurrentShowMPPURI.AirportLocationId;var AirportCityName=tmpCurrentShowMPPURI.AirportCityName;var AirportCountry=tmpCurrentShowMPPURI.AirportCountry;var AirportTransportCost=tmpCurrentShowMPPURI.TransportCost;var AirportCityId=tmpCurrentShowMPPURI.AirportCityId;sendCityReqeust("/cities/"+AirportCityId,AirportCityName);gbl_isPlanNowRequested=true;global_CityAirportInfoObj=new CLSCityAirportInfo(global_starttime,global_endtime,1,AirportId,AirportName,arrivalDate,departureDate,0,AirportLocationId,AirportCityId,AirportCountry,AirportTransportCost,149,0,'');setpagevalues(0,AirportName,global_starttime,global_endtime,1,1,arrivalDate,departureDate,0,"International","International",AirportName,"No Priority",AirportLocationId,0,"");if(global_CityAirportInfoObj&&global_CityAirportInfoObj.CityID){gblAirportCityName=getAirportCityNameByAirportId(global_CityAirportInfoObj.CityID);}global_location=AirportLocationId;defaultLocationId=AirportLocationId;gblABlocationId=AirportLocationId;var cookieUri="CookieStorageController.php?startLocation="+0;cookieUri+="&ArrivalTime="+global_starttime;cookieUri+="&DepartTime="+global_endtime;cookieUri+="&TravelerCount="+1;cookieUri+="&ID="+AirportCityId;cookieUri+="&Name="+encodeURI(AirportName)+" - "+AirportCode+" near "+AirportCityName;cookieUri+="&Startdate="+arrivalDate;cookieUri+="&Enddate="+departureDate;cookieUri+="&Room="+0;cookieUri+="&LocationID="+AirportLocationId;cookieUri+="&TripCurrency="+149;cookieUri+="&RequestType="+COOKIE_STORE;SendRequest(cookieUri,"post","cookieInfoStorage");}}else if(tmpCurrentURL.indexOf("&ct=")!=-1){if(tmpCurrentURL.indexOf("&c=")!=-1&&tmpCurrentURL.indexOf("&i=")==-1){tmpCurrentShowMPPURI=tmpCurrentURL.substring(tmpCurrentURL.indexOf("&ct=")+4,tmpCurrentURL.indexOf("&c="));}else if(tmpCurrentURL.indexOf("&i=")!=-1){tmpCurrentShowMPPURI=tmpCurrentURL.substring(tmpCurrentURL.indexOf("&c=")+3,tmpCurrentURL.indexOf("&i="));}else{tmpCurrentShowMPPURI=tmpCurrentURL.substring(tmpCurrentURL.indexOf("&ct=")+4,tmpCurrentURL.length);}tmpCurrentShowMPPURI=tmpCurrentShowMPPURI.replace(/_/g," ");tmpCurrentShowMPPURI=getCountryLocationIdByName(tmpCurrentShowMPPURI);if(tmpCurrentShowMPPURI!=-1){var CountryId=tmpCurrentShowMPPURI.Id;var CountryName=tmpCurrentShowMPPURI.Name;global_location_uri=tmpCurrentShowMPPURI.URI;global_airportorcity_uri=tmpCurrentShowMPPURI.Id;SendRequest("Countries/"+CountryId,"get","showCountryDetails");flag_vacation_country_executed=1;global_CountryInfoObj=new CLSCountryInfo(global_starttime,global_endtime,1,global_airportorcity,CountryName,arrivalDate,departureDate,0,0,"No Priority","",-1);setpagevalues(4,CountryId,global_starttime,global_endtime,1,1,arrivalDate,departureDate,0,'','',CountryName,"No Priority",global_location,0,"");}}else if(tmpCurrentURL.indexOf("&c=")!=-1){if(tmpCurrentURL.indexOf("&i=")!=-1){tmpCurrentShowMPPURI=tmpCurrentURL.substring(tmpCurrentURL.indexOf("&c=")+3,tmpCurrentURL.indexOf("&i="));}else if(tmpCurrentURL.indexOf("&arrdate=")!=-1){tmpCurrentShowMPPURI=tmpCurrentURL.substring(tmpCurrentURL.indexOf("&c=")+3,tmpCurrentURL.indexOf("&arrdate="));}else{tmpCurrentShowMPPURI=tmpCurrentURL.substring(tmpCurrentURL.indexOf("&c=")+3,tmpCurrentURL.length);}tmpCurrentShowMPPURI=tmpCurrentShowMPPURI.replace(/_/g," ");tmpCurrentShowMPPURI=getCityLocationIdByName(tmpCurrentShowMPPURI);if(tmpCurrentShowMPPURI!=-1){var CityId=tmpCurrentShowMPPURI.CityId;var CityName=tmpCurrentShowMPPURI.CityName;var CityURI=tmpCurrentShowMPPURI.CityURI;var CityLocationId=tmpCurrentShowMPPURI.CityLocationId;var CityCountry=tmpCurrentShowMPPURI.CityCountry;var CityTransportCost=tmpCurrentShowMPPURI.TransportCost;var isDestination=tmpCurrentShowMPPURI.Destination;if(isDestination){gbl_DirectLoadNBCPage=false;}global_location=CityLocationId;defaultLocationId=CityLocationId;global_airportorcity=CityId;global_location_uri=CityURI;gbl_isPlanNowRequested=true;if(isDestination){var destCityName=CityName;var destId=CityId;global_CityAirportInfoObj=new CLSCityAirportInfo(global_starttime,global_endtime,1,CityId,CityName,arrivalDate,departureDate,0,CityLocationId,CityId,CityCountry,CityTransportCost,149,1,'');}else{var destCity=getCityLocationIdByName(CityURI.split("/")[2]);global_PreviousURLCity=destCity.CityName;var destCityName=destCity.CityName;var destId=CityURI.split("/")[2];gbl_inNBC=true;global_CityAirportInfoObj=new CLSCityAirportInfo(global_starttime,global_endtime,1,destId,destCityName,arrivalDate,departureDate,0,CityLocationId,destId,CityCountry,CityTransportCost,149,1,'');}checkcontents(destCityName);flag_city_executed=1;setpagevalues(1,destId,global_starttime,global_endtime,1,1,arrivalDate,departureDate,0,'','',destCityName,"No Priority",CityLocationId,0,"");var cookieUri="CookieStorageController.php?startLocation="+1;cookieUri+="&ArrivalTime="+global_starttime;cookieUri+="&DepartTime="+global_endtime;cookieUri+="&TravelerCount="+1;cookieUri+="&ID="+destId;cookieUri+="&Name="+destCityName;cookieUri+="&Startdate="+arrivalDate;cookieUri+="&Enddate="+departureDate;cookieUri+="&Room="+0;cookieUri+="&LocationID="+global_location;cookieUri+="&TripCurrency="+149;cookieUri+="&RequestType="+COOKIE_STORE;SendRequest(cookieUri,"get","cookieInfoStorage");}}loadScript();gbl_isPlanNowRequested=true;if(global_start_location!=4){attractionpage_load_fn();}else{landingPage_load_fn();}if(gbl_CountryList.length<=0){if(hideRouteRank!=true){SendRequest("/countries","get","countrylist");}}}}window.dhtmlHistory={isIE:false,isOpera:false,isSafari:false,isKonquerer:false,isGecko:false,isSupported:false,create:function(options){var that=this;var UA=navigator.userAgent.toLowerCase();var platform=navigator.platform.toLowerCase();var vendor=navigator.vendor||"";if(vendor==="KDE"){this.isKonqueror=true;this.isSupported=false;}else if(typeof window.opera!="undefined"){this.isOpera=true;this.isSupported=true;}else if(typeof document.all!="undefined"){this.isIE=true;this.isSupported=true;}else if(vendor.indexOf("Apple Computer, Inc.")>-1){this.isSafari=true;this.isSupported=(platform.indexOf("mac")>-1);}else if(UA.indexOf("gecko")!=-1){this.isGecko=true;this.isSupported=true;}window.historyStorage.setup(options);if(this.isSafari){this.createSafari();}else if(this.isOpera){this.createOpera();}var initialHash=this.getCurrentLocation();this.currentLocation=initialHash;if(this.isIE){this.createIE(initialHash);}var unloadHandler=function(){that.firstLoad=null;};this.addEventListener(window,'unload',unloadHandler);if(this.isIE){this.ignoreLocationChange=true;}else{if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.ignoreLocationChange=true;this.firstLoad=true;historyStorage.put(this.PAGELOADEDSTRING,true);}else{this.ignoreLocationChange=false;this.fireOnNewListener=true;}}var locationHandler=function(){that.checkLocation();};setInterval(locationHandler,500);},initialize:function(){if(this.isIE){if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.fireOnNewListener=false;this.firstLoad=true;historyStorage.put(this.PAGELOADEDSTRING,true);}else{this.fireOnNewListener=true;this.firstLoad=false;}}},addListener:function(listener){this.listener=listener;if(this.fireOnNewListener){this.fireHistoryEvent(this.currentLocation);this.fireOnNewListener=false;}},addEventListener:function(o,e,l){if(o.addEventListener){o.addEventListener(e,l,false);}else if(o.attachEvent){o.attachEvent('on'+e,function(){l(window.event);});}},add:function(newLocation,historyData){if(this.isSafari){newLocation=this.removeHash(newLocation);historyStorage.put(newLocation,historyData);this.currentLocation=newLocation;window.location.hash=newLocation;this.putSafariState(newLocation);}else{var that=this;var addImpl=function(){if(that.currentWaitTime>0){that.currentWaitTime=that.currentWaitTime-that.waitTime;}newLocation=that.removeHash(newLocation);if(document.getElementById(newLocation)&&that.debugMode){var e="Exception: History locations can not have the same value as _any_ IDs that might be in the document,"+" due to a bug in IE; please ask the developer to choose a history location that does not match any HTML"+" IDs in this document. The following ID is already taken and cannot be a location: "+newLocation;throw new Error(e);}historyStorage.put(newLocation,historyData);that.ignoreLocationChange=true;that.ieAtomicLocationChange=true;that.currentLocation=newLocation;window.location.hash=newLocation;if(that.isIE){that.iframe.src="blank.html?"+newLocation;}that.ieAtomicLocationChange=false;};window.setTimeout(addImpl,this.currentWaitTime);this.currentWaitTime=this.currentWaitTime+this.waitTime;}},isFirstLoad:function(){return this.firstLoad;},getVersion:function(){return"0.6";},getCurrentLocation:function(){var r=(this.isSafari?this.getSafariState():this.getCurrentHash());return r;},getCurrentHash:function(){var r=window.location.href;var i=r.indexOf("#");return(i>=0?r.substr(i+1):"");},PAGELOADEDSTRING:"DhtmlHistory_pageLoaded",listener:null,waitTime:200,currentWaitTime:0,currentLocation:null,iframe:null,safariHistoryStartPoint:null,safariStack:null,safariLength:null,ignoreLocationChange:null,fireOnNewListener:null,firstLoad:null,ieAtomicLocationChange:null,createIE:function(initialHash){this.waitTime=400;var styles=(historyStorage.debugMode?'width: 800px;height:80px;border:1px solid black;':historyStorage.hideStyles);var iframeID="rshHistoryFrame";var iframeHTML='<iframe frameborder="0" id="'+iframeID+'" style="'+styles+'" src="blank.html?'+initialHash+'"></iframe>';document.write(iframeHTML);this.iframe=document.getElementById(iframeID);},createOpera:function(){this.waitTime=400;var imgHTML='<img src="javascript:location.href=\'javascript:dhtmlHistory.checkLocation();\';" style="'+historyStorage.hideStyles+'" />';document.write(imgHTML);},createSafari:function(){var formID="rshSafariForm";var stackID="rshSafariStack";var lengthID="rshSafariLength";var formStyles=historyStorage.debugMode?historyStorage.showStyles:historyStorage.hideStyles;var inputStyles=(historyStorage.debugMode?'width:800px;height:20px;border:1px solid black;margin:0;padding:0;':historyStorage.hideStyles);var safariHTML='<form id="'+formID+'" style="'+formStyles+'">'+'<input type="text" style="'+inputStyles+'" id="'+stackID+'" value="[]"/>'+'<input type="text" style="'+inputStyles+'" id="'+lengthID+'" value=""/>'+'</form>';document.write(safariHTML);this.safariStack=document.getElementById(stackID);this.safariLength=document.getElementById(lengthID);if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.safariHistoryStartPoint=history.length;this.safariLength.value=this.safariHistoryStartPoint;}else{this.safariHistoryStartPoint=this.safariLength.value;}},getSafariStack:function(){var r=this.safariStack.value;return historyStorage.fromJSON(r);},getSafariState:function(){var stack=this.getSafariStack();var state=stack[history.length-this.safariHistoryStartPoint-1];return state;},putSafariState:function(newLocation){var stack=this.getSafariStack();stack[history.length-this.safariHistoryStartPoint]=newLocation;this.safariStack.value=historyStorage.toJSON(stack);},fireHistoryEvent:function(newHash){var historyData=historyStorage.get(newHash);if(this.listener){this.listener.call(null,newHash,historyData);}},checkLocation:function(){setTimeout('CheckForPageURLHash();',100);if(!this.isIE&&this.ignoreLocationChange){this.ignoreLocationChange=false;return;}if(!this.isIE&&this.ieAtomicLocationChange){return;}var hash=this.getCurrentLocation();if(hash==this.currentLocation){return;}this.ieAtomicLocationChange=true;if(this.isIE&&this.getIframeHash()!=hash){this.iframe.src="blank.html?"+hash;}else if(this.isIE){return;}this.currentLocation=hash;this.ieAtomicLocationChange=false;this.fireHistoryEvent(hash);},getIframeHash:function(){var doc=this.iframe.contentWindow.document;var hash=String(doc.location.search);if(hash.length==1&&hash.charAt(0)=="?"){hash="";}else if(hash.length>=2&&hash.charAt(0)=="?"){hash=hash.substring(1);}return hash;},removeHash:function(hashValue){var r;if(hashValue===null||hashValue===undefined){r=null;}else if(hashValue===""){r="";}else if(hashValue.length==1&&hashValue.charAt(0)=="#"){r="";}else if(hashValue.length>1&&hashValue.charAt(0)=="#"){r=hashValue.substring(1);}else{r=hashValue;}return r;},iframeLoaded:function(newLocation){if(this.ignoreLocationChange){this.ignoreLocationChange=false;return;}var hash=String(newLocation.search);if(hash.length==1&&hash.charAt(0)=="?"){hash="";}else if(hash.length>=2&&hash.charAt(0)=="?"){hash=hash.substring(1);}window.location.hash=hash;this.fireHistoryEvent(hash);}};window.historyStorage={setup:function(options){if(typeof options!="undefined"){if(options.debugMode){this.debugMode=options.debugMode;}if(options.toJSON){this.toJSON=options.toJSON;}if(options.fromJSON){this.fromJSON=options.fromJSON;}}var formID="rshStorageForm";var textareaID="rshStorageField";var formStyles=this.debugMode?historyStorage.showStyles:historyStorage.hideStyles;var textareaStyles=(historyStorage.debugMode?'width: 800px;height:80px;border:1px solid black;':historyStorage.hideStyles);var textareaHTML='<form id="'+formID+'" style="'+formStyles+'">'+'<textarea id="'+textareaID+'" style="'+textareaStyles+'"></textarea>'+'</form>';document.write(textareaHTML);this.storageField=document.getElementById(textareaID);if(typeof window.opera!="undefined"){this.storageField.focus();}},put:function(key,value){this.assertValidKey(key);if(this.hasKey(key)){this.remove(key);}this.storageHash[key]=value;this.saveHashTable();},get:function(key){this.assertValidKey(key);this.loadHashTable();var value=this.storageHash[key];if(value===undefined){value=null;}return value;},remove:function(key){this.assertValidKey(key);this.loadHashTable();delete this.storageHash[key];this.saveHashTable();},reset:function(){this.storageField.value="";this.storageHash={};},hasKey:function(key){this.assertValidKey(key);this.loadHashTable();return(typeof this.storageHash[key]!="undefined");},isValidKey:function(key){return(typeof key==="string");},showStyles:'border:0;margin:0;padding:0;',hideStyles:'left:-1000px;top:-1000px;width:1px;height:1px;border:0;position:absolute;',debugMode:false,storageHash:{},hashLoaded:false,storageField:null,assertValidKey:function(key){var isValid=this.isValidKey(key);if(!isValid&&this.debugMode){throw new Error("Please provide a valid key for window.historyStorage. Invalid key = "+key+".");}},loadHashTable:function(){if(!this.hashLoaded){if(this.storageField&&this.storageField.value){var serializedHashTable=this.storageField.value;if(serializedHashTable!=""&&serializedHashTable!=null){this.storageHash=this.fromJSON(serializedHashTable);this.hashLoaded=true;}}}},saveHashTable:function(){this.loadHashTable();var serializedHashTable=this.toJSON(this.storageHash);this.storageField.value=serializedHashTable;},toJSON:function(o){return o.toJSONString();},fromJSON:function(s){return s.parseJSON();}};function clearLog(msg){var logNode=document.getElementById("logWin");logNode.innerHTML="";}var rawIndex=0;var rawMaterial=new Array();function callHSTest(hash,val){historyStorage.put(hash,val);}function testHistoryStorage(){callHSTest("pageLoaded",true);callHSTest("removeMe1","remove me 1");callHSTest("message","Hello World");callHSTest("removeMe2","remove me 2");callHSTest("field","Watson, come quick!");callHSTest("removeMe3","remove me 3");callHSTest("complexObject",{value1:"value1",value2:"value2",value3:["array[0]","array[1]"]});historyStorage.remove("removeMe1");historyStorage.remove("removeMe2");historyStorage.remove("removeMe3");if(historyStorage.hasKey("removeMe1")||historyStorage.hasKey("removeMe2")||historyStorage.hasKey("removeMe3")){}else{}var pageLoaded=historyStorage.get("pageLoaded");var message=historyStorage.get("message");var field=historyStorage.get("field");var complexObject=historyStorage.get("complexObject");var bad=historyStorage.get("bad");if(bad!=null){}}function testComplexXML(){loadTopSubscriptions();}function historyChange(newLocation,historyData){var historyMsg=(typeof historyData=="object"&&historyData!=null?historyStorage.toJSON(historyData):historyData);var msg="<b>A history change has occured:</b> | newLocation="+newLocation+" | historyData="+historyMsg+" |";};addHistoryEvent=function(newLocation,historyData){if(!rawMaterial[rawIndex]){rawIndex=0;}rawMaterial[rawIndex]=new Array(2);rawMaterial[rawIndex][0]=newLocation;rawMaterial[rawIndex][1]=historyData;var a=rawMaterial[rawIndex];dhtmlHistory.add(a[0],a[1]);if(typeof a[1]=="object"){a[1]=historyStorage.toJSON(a[1]);}var msg="<b>A history event has been added:</b> [newLocation="+a[0]+" | historyData="+a[1]+"]";rawIndex++;};function getXHR(){if(window.XMLHttpRequest){return new XMLHttpRequest();}else if(window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP");}}function prettyPrintXml(content){if(content==null){return null;}content=content.replace(/</g,"&lt;");content=content.replace(/>/g,"&gt;<br />");return content;}function logTopSubscriptions(){}function loadTopSubscriptions(){var url="rshTestPageTop100.opml";var request=getXHR();var processRequest=function(){if(request.readyState==4){if(request.status==200){historyStorage.put("mySubscriptions",request.responseText);topLoaded=true;}else{var message="There was a problem retrieving the subscription list: "+request.statusText}}};request.onreadystatechange=processRequest;request.open("GET",url,true);request.send("");}function toggleInstructions(){var node=document.getElementById('instructions');var state=node.style.display||"none";node.style.display=(state=="none"?"block":"none");}function viewObjectState(){for(var key in dhtmlHistory){var val=dhtmlHistory[key];if(typeof val!='function'&&(typeof val!='object'||val===null)){}}for(var key in historyStorage){var val=historyStorage[key];if(typeof val!='function'&&typeof val!='object'){}}}if(!Object.prototype.toJSONString){Array.prototype.toJSONString=function(wVal){var aPartText=[],iCnt,objLen=this.length,vStrVal;for(iCnt=0;iCnt<objLen;iCnt+=1){vStrVal=this[iCnt];switch(typeof vStrVal){case'object':if(vStrVal){if(typeof vStrVal.toJSONString==='function'){aPartText.push(vStrVal.toJSONString(wVal));}}else{aPartText.push('null');}break;case'string':case'number':case'boolean':aPartText.push(vStrVal.toJSONString());}}return'['+aPartText.join(',')+']';};Boolean.prototype.toJSONString=function(){return String(this);};Date.prototype.toJSONString=function(){function formatInt(nIntVal){return nIntVal<10?'0'+nIntVal:nIntVal;}return'"'+this.getUTCFullYear()+'-'+formatInt(this.getUTCMonth()+1)+'-'+formatInt(this.getUTCDate())+'T'+formatInt(this.getUTCHours())+':'+formatInt(this.getUTCMinutes())+':'+formatInt(this.getUTCSeconds())+'Z"';};Number.prototype.toJSONString=function(){return isFinite(this)?String(this):'null';};(function(sVar){var mVar={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};sVar.parseJSON=function(filter){var jVal;function walk(kCurrKey,vStrVal){var iCnt;if(vStrVal&&typeof vStrVal==='object'){for(iCnt in vStrVal){if(Object.prototype.hasOwnProperty.apply(vStrVal,[iCnt])){vStrVal[iCnt]=walk(iCnt,vStrVal[iCnt]);}}}return filter(kCurrKey,vStrVal);}if(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/.test(this.replace(/\\./g,'@').replace(/"[^"\\\n\r]*"/g,''))){jVal=eval('('+this+')');return typeof filter==='function'?walk('',jVal):jVal;}throw new SyntaxError('parseJSON');};sVar.toJSONString=function(){if(/["\\\x00-\x1f]/.test(this)){return'"'+this.replace(/[\x00-\x1f\\"]/g,function(aVar){var cVar=mVar[aVar];if(cVar){return cVar;}cVar=aVar.charCodeAt();return'\\u00'+Math.floor(cVar/16).toString(16)+(cVar%16).toString(16);})+'"';}return'"'+this+'"';};})(String.prototype);}function updateMainURL(currCityName){var mainURLStr1="";var mainURLStr2="";try{if(gblMainURL.indexOf("&c=")!=-1){var urlArr=gblMainURL.split("&c=")[1];mainURLStr1=gblMainURL.split("&c=")[0];if(urlArr.indexOf("&i=")!=-1){urlArr=urlArr.split("&i=")[0];mainURLStr2=gblMainURL.split("&i=")[1];}var cityNameStr=revertCustomSpecialChar(urlArr);if(cityNameStr!=currCityName){currCityName=customReplaceSpecialChar(currCityName);if(urlArr.indexOf("&i=")!=-1){gblMainURL=mainURLStr1+"&c="+currCityName+"&i="+mainURLStr2;}else{gblMainURL=mainURLStr1+"&c="+currCityName;}}}}catch(err){}}function getCityNameFromURL(){var HashCityURL=document.location.href;var cityNameStr="";if(HashCityURL.indexOf("&c=")!=-1){var urlArr=HashCityURL.split("&c=")[1];if(urlArr.indexOf("&i=")!=-1){urlArr=urlArr.split("&i=")[0];}cityNameStr=revertCustomSpecialChar(urlArr);}return cityNameStr;}function getCityNameFromId(cityId){var cityNameStr="";for(var tempCnt=0;tempCnt<gbl_CityList.length;tempCnt++){if(gbl_CityList[tempCnt].CityId==cityId){cityNameStr=gbl_CityList[tempCnt].CityName;}}return cityNameStr;}function getFormatLocationName(locationName){if(locationName.indexOf("&i=")!=-1){if(locationName.indexOf("&Event=")==-1){locationName=locationName.substring(locationName.indexOf("&i=")+3,locationName.length);}else{locationName=locationName.substring(locationName.indexOf("&i=")+3,locationName.indexOf("&Event="));}}if(locationName.indexOf("%E2%84%A2")==-1){locationName=encodeURIComponent(locationName);}if(locationName.indexOf("%E2%84%A2")!=-1){locationName=locationName.replace(/%E2%84%A2/g,"&trade;");}if(!isIE){if(locationName.indexOf("&trade;")==-1){locationName=decodeURIComponent(locationName);}}locationName=revertCustomSpecialChar(locationName);return locationName;}function extractCityName(locationStr){var dest="";if(locationStr.indexOf("&c=")!=-1){dest="c";}else if(locationStr.indexOf("&a=")!=-1){dest="a";}if(locationStr.indexOf("&i=")==-1){var cityName=locationStr.substring(locationStr.indexOf("&"+dest+"=")+3,locationStr.length);}else{var cityName=locationStr.substring(locationStr.indexOf("&"+dest+"=")+3,locationStr.indexOf("&i="));}return getFormatLocationName(cityName);}function getNextPage(cityId,Type,page,cityIdList){var CityList={'City':cityIdList};formData=ued_encode(CityList);SendRequest("AttractionList.php?CityId="+cityId+"&t="+Type+"&page="+page,"post","attractionList");}