var gbl_isAdmin=false,gbl_isClearCache=false;var gbl_isLandingPageRequested=false;var gbl_MultiCityPlannerUpdate=false;var vacationCitySuggestionObj,gblIsFromMC=false;var gblPageBeforeRegister="",gblActionBeforeRegister;var gbl_LeavingFromCityInfo;var isFromIP=false,gblBidRequeted=false,gbl_prevFormHTML="";var gblIsSaveBeforeMyTrip=false,gblIsMyTripRequested=false,gblIsHomeRequested=false,gblIsBudgetRequested=false;var gbl_viatorDetails=false;var gbl_arrMyItinerary=new Array();var gbl_arrItineraryDetail=new Array();var gblIsOverwriteBudget=false,gblAlreadyScheduled=false,gblIsStartedWithCountry=false;var regXForSpace=/\s+/g;var gblIsPlanBeforeBudget=false;var gblSelectedType="Attraction";var gbl_longitude=0;var gblBudgetSavedCurrencyRate=0;var gblLodgingComments="";var gblIsCurrencyCalledFrmBudget=false;var chkRememberMe=false,gbl_isUserSignedId=false;var gbl_lattitude=0;var gbl_isDataRendered=false;var gbl_isPlanNowRequested=false;var gblPasswordChanged=false;var ListCount=5;var startServiceCount=0;var nodeServiceList=new Array();var totalDisplayedServiceCount=0;var gbl_range=0;var gbl_more=0;var gbl_UserId=0;var gblIsAirportExists=false;var gblIsCityExists=false;var gblIsAirportPresent=false;var gblIsCityPresent=false;var gblEditBudgetFrmMyBudgetsCityID=-1;var gblIsTravelerRegistrationStarted=false;var flag_executed=0;var flag_city_executed=0;var flag_vacation_city_executed=0;var flag_vacation_country_executed=0;var global_uriformat="/locations/{locid}/priority/{priid}/planningpriority/{plaid}";var send_uri="";var formData="";var global_holidaydivid=0;var global_index=0;var global_delvisible=0;var global_delrangevisible=0;var global_deldiscountvisible=0;var global_holidayrangedivid=0;var global_discountdivid=0;var global_pixelTop=0;var global_discountdivid=1;var gbl_isItineraryAffected=false;var global_CustomHotel_Id=0;var defaultLocationId=0;var defaultStartLocation="";var counterForLogin;var gbl_isItineraryCreated=false;var gbl_arrAllCustomHotels=new Array();var gbl_arrAllAppointment=new Array();var gbl_arrAllLodging=new Array();var isCreateItinerary;var attractions_RegExp=/attractions/;var hotels_RegExp=/hotels/;var nearbyattractions_RegExp=/nearbyattractions/;var showall_RegExp=/showall/;var Stayatairport_RegExp=/stayatairport/;var editserviceprovider_RegExp=/EditServiceProvider/;var editservices_RegExp=/EditServices/;var editarticles_RegExp=/EditArticle/;var viewserviceprovider_RegExp=/ViewServiceProvider/;var viewservices_RegExp=/ViewServices/;var registerservice_RegExp=/RegisterService/;var registerserviceprovider_RegExp=/RegisterServiceProvider/;var registeruser_RegExp=/userregistration/;var edituser_RegExp=/Edituser/;var viewuser_RegExp=/Viewuser/;var saveserviceprovider_RegExp=/saveInformation/;var charities_RegExp=/charities/;var services_RegExp=/services/;var filterservices_RegExp=/services/;var filtercharities_RegExp=/charities/;var CookieStorage_RegExp=/CookieStorageController.php/;var MyProfile_RegExp=/MyProfile/;var ServiceProviderList_RegExp=/ServiceProviderList.php/;var ArticleBlogs_RegExp=/ArticleBlogsRegistration.php/;var ArticleBlogsEdit_RegExp=/EditArticleBlog.php/;var ArticleBlogList_RegExp=/ArticleBlogList.php/;var ViewArticleBlog_RegExp=/ViewArticleBlog.php/;var TravelExpertRegistration_RegExp=/TravelExpertRegistration.php/;var TravelExpertList_RegExp=/TravelExpertList.php/;var EditTravelExpert_RegExp=/EditTravelExpertDetails.php/;var ViewTravelExpert_RegExp=/ViewTravelExpert.php/;var CityList_RegExp=/findCityList.php/;var CityList_RegExp=/findCityList.php/;var TripList_RegExp=/TripList.php/;var ViewItineraryDetails_RegExp=/ViewItineraryDetails.php/;var checkUser_RegExp=/CheckUser.php/;var global_user_uri="/user/";var SessionListener_RegExp=/SessionListener.php/;var sign_out_RegExp=/Signout.php/;var LoginList_RegExp=/LoginPage.php/;var city_RegExp=/getCountryCity.php/;var travelEditor_RegExp=/RegisterTravelEditor.php/;var saveTravelEditor_RegExp=/TravelEditor.php/;var TravelEditorProfile_RegExp=/TravelEditorProfile.php/;var travelEditorList_RegExp=/TravelEditorList.php/;var travelExpert_RegExp=/TravelExpertProfile.php/;var approveUser_RegExp=/ApproveUserList.php/;var traveler_RegExp=/RegisterTraveler.php/;var registeradvertise_RegExp=/RegisterAdvertise/;var init_RegExp=/Init.php/;var traveler_RegExp=/TravelerProfile.php/;var editTraveler_RegExp=/RegisterTraveler.php/;var itenararyDetails_RegExp=/itinenaryDetails.php/;var saveTraveler_RegExp=/saveInformation.php/;var gbl_loggedInUser='';var gbl_currentBudgetSource=null;var isCommingFromBudgetPage=false;var isCommingFromHomePage=false;var defaultCityImageSrc=null;var defaultCityImageCre=null;var gbl_ItBudgetId=parseInt(0);var gbl_isBudgetCreated;var global_budgetrequest_uri;var parent_window;var gbl_xmlobj_budgetDetails;var gbl_currency_xml;var global_budgetrequest_uri="/budget/";var global_budgetCurrency_uri="/currency/exrate/usd/";var global_NewAttraction_uri="/NewAttraction/";var budgetCurrentDate=new Date();budgetCurrentDate=budgetCurrentDate.getTime()+1000*60*60*24;budgetCurrentDate=new Date(budgetCurrentDate);var budge_RegExp=/budgetPlanner.php/;var budgeItems_RegExp=/addbudgetItems.php/;var savebudgeItems_RegExp=/savebudgeItems/;var editbudgeItems_RegExp=/editbudgeItems/;var saveUserBudget_RegExp=/savebudgeItems/;var newattractionlist_RegExp=/newattractionlist.php/;var updateAttraction_RegExp=/add_attraction.php/;var articlesAndBlog_RegExp=/manageArticlesAndBlog.php/;var global_articalblog_xml;var ArtcleAndBlogReaderArr=new Array();var interestList="";var global_startingLocationName="";var global_arrival_airporttype;var global_departure_airporttype;var COOKIE_READ=2;var COOKIE_STORE=1;var Global_AirportObj;var global_airport_image;var RenderObjects=new Array();var renderObjectsMC=new Array();var gblItineraryName="";var gblUserEmail="";var gblItineraryAction="";var gbl_xmlobj;var gbl_xmlobj_locations;var gbl_xmlobj_statyAirport;var gbl_xmlobj_airport;var gbl_xmlobj_all;var gbl_xmlobj_attractions;var gbl_xmlobj_hotels;var gbl_xmlobj_services;var gbl_xmlobj_charities;var gbl_xmlobj_all_locations;var gbl_xmlobj_attractions_locations;var gbl_xmlobj_airportattractions_loactions;var gbl_xmlobj_hotels_loactions;var gbl_xmlobj_myItineraryXML;var gbl_xmlobj_advertisement;var gbl_xmlobj_multiCountries;var gbl_ItineraryId=0;var gbl_CenterlocationID=0;var globalItineraryListData;var gbl_xmlobj_services;var gbl_xmlobj_charites;var globalItineraryListData;var gbl_interest;var global_airportid;var global_start_location=-1,global_prev_start_location=-1;var global_starttime,gblPreviousStartLocationName='';var global_endtime;var global_nooftravellers;var global_travellerpriority;var global_arrivaldate;var global_departuredate;var global_groupid;var global_attractionDisplayFilter=-1;var global_airporttype;var global_transportOption="";var gblTravelPriorityIndex=0;var global_request_uri;var global_travel_priority="";var global_location_uri;var global_airportorcity_uri;var global_location;var global_airportorcity;var global_request_uri_reform;var gbl_startingLocationType;var gbl_startingType="quicktrip";var global_arrival_date_day;var globalStartDate;var globalEndDate;var itineraryItemsArrGlobal=new Array();itineraryItemsArrGlobal[-1]=0;var global_itinerary_uri="/itinerary";var global_travellerpriority_hardcoded;var global_serviceproviderurl="http://www.rediffmail.com";var t,t1;var global_attractiondetailpage;var global_hoteldetailpage;var globalformobj;var displayattractionflag=1;var oTextbox,oTextbox1,oTextbox2,oTextbox3,oTextbox4;var StateSuggestionObj;var logisticalSuggestionObj,logisticalPartnerSuggestionObj;var global_List_ArrID;var global_List_ArrName;var global_List_ArrURI;var global_List_ArrLocationURI;global_List_ArrID=new Array();global_List_ArrName=new Array();global_List_ArrURI=new Array();global_List_ArrLocationURI=new Array();var global_List_CityID;var global_List_CityName;var global_List_CityURI;global_List_CityID=new Array();global_List_CityName=new Array();global_List_CityURI=new Array();global_public_transportList=new Array();global_private_transportList=new Array();var arrAttractionNames=new Array();var arrAttractionIndexes=new Array();var mapObjects=new Array();var detailMap;var firstTimeMapLoaded=true;var global_cookieInfo='';var gblArr_userLocalCurrencyDetails=new Array();var gblArr_userPrefCurrencyDetails=new Array();var gblArr_allCurrencyExRates=new Array();var gbl_userLocalCurrencyDetails=null;var gbl_userPrefCurrencyDetails=null;var gbl_currentCurrencyDetails=null;var gbl_CurrentBlogSource=null;var gbl_HomePageArticles=new Array();var gbl_HomePageBlogs=new Array();var gbl_AllBlogsDetailsArr=new Array();var gbl_DetailPageArticles=new Array();var gbl_DetailPageBlogs=new Array();var gbl_ArticlesWithKeywords=new Array();var gbl_ArticlesWithIntrests=new Array();var gbl_BlogsWithKeywords=new Array();var gbl_DetailedPageArticles=new Array();var gbl_DetailPageBlogs=new Array();var gbl_ReadPageArticles=new Array();var gbl_ReadPageBlogs=new Array();var gbl_blogid=null;var gbl_currentBlogType=null;var gbl_currentBlogid=null;var gbl_articleid=null;var gbl_DetailPageOtherBlogs=new Array();var isReadIndexPage=0;var gbl_AirPortCityId;var isItineraryBudgetDisplayed=1;var gbl_AirPortCityId;var gbl_budgetcurrencycode;var gbl_currentBudgetSourceCopy=null;var isItineraryBudgetEdit=false;var displayPannelVisibility=0;var gbl_adminComments=new Array();var gbl_BudgetCurrencyFlag=false;var gbl_BudgetCurrencyVal="";var gblBidRequestFrm='',gblIsRequestProposal=false,gblRedirectAfterSignIn='',gblItineraryBidFrmLanding=false,gblBiddingSPID=-1;var finalize_flag=false;var gbl_couponChkBox=new Array();var gblFinalizeFlag=false;var gbl_BackBtnFlag=false;var gbl_isCouponsSaved=false;var gbl_restaurantsPriceRangeVal=-1;var THIRTY=parseFloat("30.00");var FIFTY=parseFloat("50.00");var gbl_foodTypeSelected="";var gbl_mapFlag=0;var gbl_restLocFlag=false;var gbl_restLocId="";var gbl_curCityPostCode="";var gbl_lodgeID=-1;var isEuropeanCntry=false;var gbl_xmlobj_allNearByCities;var gbl_isMPPReceived=false;var gbl_isPartnerMPPReceived=false;var gbl_isNBCMPPReceived=false;var gbl_dispAttrFlag=false;var gbl_clickedFrmMap=false;var gbl_arrMCountries=new Array();var gblIsTSDataReceived=false;var gbl_tempCityId="";var gbl_nbcAttrCnt=new Array();var gbl_isMapOn=false;var gbl_isCntryChanged=false;var gbl_forMC=false;var gbl_isFromFW=false;var gbl_isAvailable=false;var gbl_isOpenAlert=false;function CLSMultiCountries(Id,Name){this.Id=Id;this.Name=Name;}function CLSAirportInfo(AirportArrivalTime,AirportArrivalType,AirportDepartTime,AirportDepartureType,AirportTravelerCount,AirportID,AirportName,AirportStartdate,AirportEnddate,AirportGroup,AirportTripPriority,AirportTransportation,AirportSpecialInterests,AirportLocationID,AirportCountry,CityDefaultTransportCost,AirPortTripCurrency,AirportCityId){this.AirportArrivalTime=AirportArrivalTime;this.AirportArrivalType=AirportArrivalType;this.AirportDepartTime=AirportDepartTime;this.AirportDepartureType=AirportDepartureType;this.AirportTravelerCount=AirportTravelerCount;this.AirportID=AirportID;this.AirportName=AirportName;this.AirportStartdate=AirportStartdate;this.AirportEnddate=AirportEnddate;this.AirportGroup=AirportGroup;this.AirportTripPriority=AirportTripPriority;this.AirportTransportation=AirportTransportation;this.AirportSpecialInterests=AirportSpecialInterests;this.AirportLocationID=AirportLocationID;this.AirportCountry=AirportCountry;this.CityDefaultTransportCost=CityDefaultTransportCost;this.AirPortTripCurrency=AirPortTripCurrency;this.AirPortCityId=AirportCityId;}function CLSCityInfo(CityArrivalTime,CityDepartTime,CityTravelerCount,CityID,CityName,CityStartdate,CityEnddate,CityGroup,CityTripPriority,CityTransportation,CitySpecialInterests,CityLocationID,CityCountry,CityDefaultTransportCost,CityTripCurrency,CityStartType){this.CityTripPriority=CityTripPriority;this.CityArrivalTime=CityArrivalTime;this.CityDepartTime=CityDepartTime;this.CityTravelerCount=CityTravelerCount;this.CityID=CityID;this.CityName=CityName;this.CityStartdate=CityStartdate;this.CityEnddate=CityEnddate;this.CityGroup=CityGroup;this.CityTransportation=CityTransportation;this.CitySpecialInterests=CitySpecialInterests;this.CityLocationID=CityLocationID;this.CityCountry=CityCountry;this.CityDefaultTransportCost=CityDefaultTransportCost;this.CityTripCurrency=CityTripCurrency;this.CityStartType=CityStartType;}function CLSCityAirportInfo(ArrivalTime,DepartTime,TravelerCount,ID,Name,Startdate,Enddate,Group,LocationID,CityID,Country,DefaultTransportCost,TripCurrency,StartType,noOfDays){this.ArrivalTime=ArrivalTime;this.DepartTime=DepartTime;this.TravelerCount=TravelerCount;this.ID=ID;this.Name=Name;this.Startdate=Startdate;this.Enddate=Enddate;this.Group=Group;this.LocationID=LocationID;this.CityID=CityID;this.Country=Country;this.DefaultTransportCost=DefaultTransportCost;this.TripCurrency=TripCurrency;this.StartType=StartType;this.noOfDays=noOfDays;}function CLSCountryInfo(CountryArrivalTime,CountryDepartTime,CountryTravelerCount,CountryID,CountryName,CountryStartdate,CountryEnddate,CountryGroup,CountryTripPriority,CountryTransportation,CountrySpecialInterests,CountryTripCurrency){this.CountryTripPriority=CountryTripPriority;this.CountryArrivalTime=CountryArrivalTime;this.CountryDepartTime=CountryDepartTime;this.CountryTravelerCount=CountryTravelerCount;this.CountryID=CountryID;this.CountryName=CountryName;this.CountryStartdate=CountryStartdate;this.CountryEnddate=CountryEnddate;this.CountryGroup=CountryGroup;this.CountryTransportation=CountryTransportation;this.CountrySpecialInterests=CountrySpecialInterests;this.CountryTripCurrency=CountryTripCurrency;}var global_AirportInfoObj=new CLSAirportInfo('','','','','','','','','','','','','','','','','','','');var global_CityInfoObj=new CLSCityInfo('','','','','','','','','','','','','','','','');var global_CityAirportInfoObj=new CLSCityAirportInfo('','','','','','','','','','','','','','','');var global_CountryInfoObj=new CLSCountryInfo('','','','','','','','','','','','');var gbl_VacationCityPlanner=new Array();var gbl_VacationCityPlannerOrg=new Array();var gbl_VacationCityPlannerIndex=0;var gblVacationDateTimeAdjusted=false;var gblVacationTravelerCountChanged=false,gblVacationRoomCountChanged=false;var gblVacationCurrencyChanged=false,gblPrevVacationCurrency="USD";var gbl_vaccationCityItemArr=new Array();function loadScript(){if(typeof GMap2=='undefined'){var script=document.createElement("script");script.type="text/javascript";script.src="http://maps.google.com/maps?file=api&v=2.x&key="+googleMapKey+"&async=2";document.body.appendChild(script);}}function init(){RESIZE_IMAGE(HOMEIMGWIDTH,HOMEIMGHEIGHT,'homepageMainAttrImg');displayCaption('homepageMainAttrImg');var tmpCurrentURLString=document.location.href;if(tmpCurrentURLString.indexOf("?p")==-1){StateSuggestionObj=new AirportSuggestions();CitySuggestionObj=new StateSuggestions();vacationCitySuggestionObj=new StateSuggestions();CountrySuggestionObj=new StateSuggestions();logisticalSuggestionObj=new StateSuggestions();logisticalPartnerSuggestionObj=new StateSuggestions();}if(tmpCurrentURLString.indexOf("#")!=-1){if(gblArr_allCurrencyExRates.length<=0){SendRequest("/getallexrates/","get","getallexrates");}}if(tmpCurrentURLString.indexOf("&a=")!=-1||tmpCurrentURLString.indexOf("&c=")!=-1||(tmpCurrentURLString.indexOf("&ct=")!=-1&&tmpCurrentURLString.indexOf("p=budget")==-1)){gbl_DirectLoadLandingPage=true;gbl_DirectLoadAttrInfo=true;gbl_ShowMPPForLandingCall=true;gblIsRedirectFromSearchBox=true;if(tmpCurrentURLString.indexOf("&a=")!=-1){SendRequest("/airports","get","airportList");}else if(tmpCurrentURLString.indexOf("&c=")!=-1&&tmpCurrentURLString.indexOf("&ct=")==-1){SendRequest("/cities","get","cityList");}else{SendRequest("/countries","get","countrylist");}}else if(tmpCurrentURLString.indexOf("#p=read")!=-1){gbl_DirectLoadBlogPage=true;var tmpCurrentBlogArticleHashURL=document.location.href;var nameStrArr=tmpCurrentBlogArticleHashURL.split("#p=read&bl=")[1];var nameStr=revertCustomSpecialChar(nameStrArr);gbl_blogNameStr=nameStr;if(gbl_HomePageBlogs.length<=0){SendRequest("/homepage/blogs","get","bloglist");}}else if(tmpCurrentURLString.indexOf("#p=explore")!=-1){gbl_DirectLoadArticlePage=true;var tmpCurrentBlogArticleHashURL=document.location.href;var nameStrArr=tmpCurrentBlogArticleHashURL.split("#p=explore&ar=")[1];var nameStr=revertCustomSpecialChar(nameStrArr);gbl_articleNameStr=nameStr;if(gbl_HomePageArticles.length<=0){SendRequest("/homepage/articles","get","articlelist");}}else if(tmpCurrentURLString.indexOf("#p=budget")!=-1){SendRequest("/cities","get","cityList");gbl_DirectLoadBudgetPage=true;}else if(tmpCurrentURLString.indexOf("#p=mytrips")!=-1&&tmpCurrentURLString.indexOf("&it=")==-1){gbl_DirectLoadMyTripsPage=true;gblUserEventType=0;gblIsMyTripRequested=true;finalize_flag=false;isBidUser=false;isSaveAsItineary=false;isTraveler=false;}else if(tmpCurrentURLString.indexOf("&it=")!=-1){gbl_DirectLoadMyTripsPage=true;gbl_myTripsRequestFlag=true;gblUserEventType=0;gblIsMyTripRequested=true;finalize_flag=false;isBidUser=false;isSaveAsItineary=false;isTraveler=false;gblItineraryName=tmpCurrentURLString.split("&it=")[1];gblItineraryName=revertCustomSpecialChar(gblItineraryName);}else if(tmpCurrentURLString.indexOf("#p=mybid&itiname=")!=-1&&tmpCurrentURLString.indexOf("&list=")==-1&&tmpCurrentURLString.indexOf("&bidpage=")==-1){gbl_DirectLoadMyBidPage=true;gbl_myBidLoadPageFlag=true;var ItineraryNameArr=tmpCurrentURLString.split("&itiname=")[1];gblItineraryName=ItineraryNameArr.split("&")[0];gblItineraryName=revertCustomSpecialChar(gblItineraryName);}else if(tmpCurrentURLString.indexOf("&list=")!=-1){gbl_DirectLoadMyBidPage=true;gbl_isLoginUser=false;gbl_myBidListReqFlag=true;if(tmpCurrentURLString.indexOf("&pref=itinerary")!=-1){var ItineraryNameArr=tmpCurrentURLString.split("&itiname=")[1];gblItineraryName=ItineraryNameArr.split("&")[0];gblItineraryName=revertCustomSpecialChar(gblItineraryName);}}else if(tmpCurrentURLString.indexOf("&city=")!=-1){gbl_DirectLoadMyBidPage=true;gbl_myBidRequestFlag=true;gbl_myBidListReqFlag=true;}else if(tmpCurrentURLString.indexOf("p=UpdateAttraction")!=-1){gbl_DirectUpdateAttractionLoad=true;}else{handleEvent("AppLoad");}if(!isIE){var _timer=setInterval(function(){if(CheckForPageURLHash){CheckForPageURLHash()}},500);}}function displaySelectedFilter(tripPriority){var isStringFound=false;if(!isStringFound){var locationDetails=new Array();isRestaurantWise=false;gbl_arrLogisticalIndexes.length=0;gbl_arrLogisticalIdentity.length=0;if(mapObjects){for(var index=0;index<mapObjects.length;index++){mapObjects[index].clearOverlays();}}if(typeof(tripPriority)=="undefined"){tripPriority="-1";}global_travellerpriority=tripPriority;selectFilter(tripPriority);gblABInputId='',gblRestaurantInputId='',gblPassInputId='',gblTourInputId='';if(tripPriority==5){isInterestWise="true";renderInterests();}else{isInterestWise="false";renderLocations();}var isTourRendered=false;if(isEditItinerary){for(itemCntr=0;itemCntr<itineraryItemsArrGlobal.length;itemCntr++){var itiLocId=itineraryItemsArrGlobal[itemCntr].currentLocationId;var itiCityId=itineraryItemsArrGlobal[itemCntr].cityId;var itiType=itineraryItemsArrGlobal[itemCntr].Type;for(var itemCnt=0;itemCnt<gbl_arrAllLogisticals.length;itemCnt++){var logLocId=gbl_arrAllLogisticals[itemCnt].uri.split("/")[2];if(logLocId!=itiLocId){if(itiType=="TSAttraction"){getLogisticalDetails("Attraction",itiLocId,itiCityId);}if(itiType=="OTRestaurant"){getRestaurantDetails(itiLocId,'',itiCityId);}}}if(itiType=="Viator"&&!isTourRendered){getPartnerDetails("ViatorTours");isTourRendered=true;}}}var newArray=gbl_arrLogisticalIndexes.slice();var idenArray=gbl_arrLogisticalIdentity.slice();}if(global_start_location==3&&gbl_arrAllVacationCity.length==0){gbl_arrAllVacationCity[gbl_arrAllVacationCity.length]=new CLSVacationCityBase(global_airportorcity,global_startingLocationName,gbl_arrAllCities,gbl_arrAllLocations,gbl_arrAllAttractions,gbl_arrAllHotels,gbl_arrAllServices,gbl_arrAllLogisticals,gbl_arrAllTravelDetails,gbl_arrAllImages,gbl_arrAllHotels,gbl_arrAllHolidays,gbl_arrAllAdvertisement,gblLocationDurationArray,gbl_arrRestaurants,gbl_arrViatorTours,gbl_arrViatorPass,gblObjArrLocation,global_location,'',gbl_arrAllNearByCities);}if(document.getElementById("btnRestaurant")){document.getElementById("btnRestaurant").style.display="";document.getElementById("btnRestaurantDisable").style.display="none";}}function displayRestaurantSelectedFilter(tripPriority){gblRestaurantTripPriority=tripPriority;switch(parseInt(tripPriority)){case 2:gblRestaurantSubTripPriority=0;if(document.getElementById("MyPPRestPrice")){document.getElementById("MyPPRestPrice").style.display="none";gbl_restaurantsPriceRangeVal=-1;gbl_foodTypeSelected="";}if(document.getElementById("MyPPFoodType")){document.getElementById("MyPPFoodType").style.display="none";}if(document.getElementById("loadingImageRest")){document.getElementById("loadingImageRest").style.display="";}break;case 3:if(document.getElementById("MyPPRestPrice")){document.getElementById("MyPPRestPrice").style.display="";gbl_foodTypeSelected="";gblRestaurantSubTripPriority=document.getElementById("RestaurantPricefilter").value;}if(document.getElementById("MyPPFoodType")){document.getElementById("MyPPFoodType").style.display="none";}break;case 4:if(document.getElementById("MyPPFoodType")){document.getElementById("MyPPFoodType").style.display="";gbl_foodTypeSelected=document.getElementById("FoodTypefilter").value;}if(document.getElementById("MyPPRestPrice")){document.getElementById("MyPPRestPrice").style.display="none";gbl_restaurantsPriceRangeVal=-1;}if(document.getElementById("loadingImageRest")){document.getElementById("loadingImageRest").style.display="";}break;default:if(document.getElementById("MyPPRestPrice")){document.getElementById("MyPPRestPrice").style.display="none";gbl_restaurantsPriceRangeVal=-1;gbl_foodTypeSelected="";if(gbl_restLocId!=""){gbl_restLocId="";}}if(document.getElementById("MyPPFoodType")){document.getElementById("MyPPFoodType").style.display="none";}gblRestaurantSubTripPriority=0;break;}gbl_arrRestaurantIndexes=new Array();gbl_arrRestaurantIdentity=new Array();isRestaurantWise=false;}function displayRestaurantSelectedPriceFilter(priceRanges){gblRestaurantSubTripPriority=priceRanges;switch(parseInt(priceRanges)){case 0:gbl_restaurantsPriceRangeVal=-1;break;case 1:gbl_restaurantsPriceRangeVal=1;break;case 2:gbl_restaurantsPriceRangeVal=2;break;case 3:gbl_restaurantsPriceRangeVal=3;break;default:gbl_restaurantsPriceRangeVal=-1;break;}isRestaurantWise=false;if(document.getElementById("loadingImageRest")){document.getElementById("loadingImageRest").style.display="";}gbl_arrRestaurantIndexes=new Array();gbl_arrRestaurantIdentity=new Array();renderRestaurants(0);}function displayFoodTypeSelectedFilter(foodType){gbl_foodTypeSelected=foodType;gblRestaurantSubTripPriority=foodType;isRestaurantWise=false;if(document.getElementById("loadingImageRest")){document.getElementById("loadingImageRest").style.display="";}gbl_arrRestaurantIndexes=new Array();gbl_arrRestaurantIdentity=new Array();renderRestaurants(0);}function getCityCentralLocation(){var lcCnt=0;var isLocFound=false;var locationDetails=new Array();if(gbl_arrAllLocations.length==1){locationDetails[lcCnt]=new Array(2);locationDetails[lcCnt][0]=gbl_arrAllLocations[0].name;locationDetails[lcCnt][1]=gbl_arrAllLocations[0].id;lcCnt++;}else{for(var loopCnt=0;loopCnt<gbl_arrAllLocations.length;loopCnt++){if(gbl_arrAllLocations[loopCnt].cityid==global_airportorcity){if((gbl_arrAllCities[0].centralLocation==gbl_arrAllLocations[loopCnt].id||gbl_arrAllCities[0].centralLocation==gbl_arrAllLocations[loopCnt].name)&&gbl_arrAllLocations[loopCnt].dataType.charAt(0)!=0){locationDetails[lcCnt]=new Array(2);locationDetails[lcCnt][0]=gbl_arrAllLocations[loopCnt].name;locationDetails[lcCnt][1]=gbl_arrAllLocations[loopCnt].id;isLocFound=true;lcCnt++;break;}}}if(!isLocFound){for(var loopCnt=0;loopCnt<gbl_arrAllLocations.length;loopCnt++){if(gbl_arrAllLocations[loopCnt].cityid==global_airportorcity&&lcCnt==0&&gbl_arrAllLocations[loopCnt].dataType.charAt(0)!=0){if(gbl_arrAllLocations[loopCnt].name.toLowerCase().match("downtown")){locationDetails[lcCnt]=new Array(2);locationDetails[lcCnt][0]=gbl_arrAllLocations[loopCnt].name;locationDetails[lcCnt][1]=gbl_arrAllLocations[loopCnt].id;isLocFound=true;lcCnt++;break;}}}}if(!isLocFound){for(var loopCnt=0;loopCnt<gbl_arrAllLocations.length;loopCnt++){if(gbl_arrAllLocations[loopCnt].cityid==global_airportorcity&&lcCnt==0&&gbl_arrAllLocations[loopCnt].dataType.charAt(0)!=0){locationDetails[lcCnt]=new Array(2);locationDetails[lcCnt][0]=gbl_arrAllLocations[loopCnt].name;locationDetails[lcCnt][1]=gbl_arrAllLocations[loopCnt].id;isLocFound=true;lcCnt++;break;}}}gbl_arrAllLocations=gbl_arrAllLocations.sort(sortByName);if(!isLocFound){for(var loopCnt=0;loopCnt<gbl_arrAllLocations.length;loopCnt++){locationDetails[lcCnt]=new Array(2);locationDetails[lcCnt][0]=gbl_arrAllLocations[loopCnt].name;locationDetails[lcCnt][1]=gbl_arrAllLocations[loopCnt].id;lcCnt++;}}}if(locationDetails.length>0){defaultLocationId=locationDetails[0][1];defaultStartLocation=locationDetails[0][0];global_location=locationDetails[0][1];if(!gbl_ShowMPPForLandingCall||(gbl_ShowMPPForLandingCall&&document.location.href.indexOf("&i")==-1)){gblABlocationId=defaultLocationId;}}return locationDetails;}function GetDOMObject(responseXML){var xmlDoc;var parser;responseXML=responseXML.replace('<!-- Copyright 2007, 2008, 2009 TripSketch Corp, All Rights Reserved -->','');var R=trim(responseXML);if(window.ActiveXObject){xmlDoc=new ActiveXObject("Microsoft.XMLDOM");xmlDoc.async="false";xmlDoc.loadXML(R);}else{parser=new DOMParser();xmlDoc=parser.parseFromString(R,"text/xml");}return xmlDoc;}function checkcontents(AirportName){if(typeof document.forms['frmdisplaypanel']!="undefined"&&!AirportName){frmobj=document.frmdisplaypanel;AirportName=frmobj.drpCityAirport.value;}gblIsAirportPresent=false;var arr=new Array();if(AirportName!=""){if(document.getElementById('city-list')&&global_start_location==4){var airIndex=-1;}else{var airIndex=searchAirportItem(gbl_AirportList,AirportName);}if(airIndex==-1){if(document.getElementById('city-list')&&global_start_location==4){var airIndex=-1;}else{AirportName=findCityName(AirportName);airIndex=searchItem(global_List_CityName,AirportName,true,"cityName");global_start_location=1;}}else{global_start_location=0;}if(airIndex!=-1&&global_start_location!=4){if(global_start_location==1){global_location_uri=global_List_CityURI[airIndex];global_airportorcity_uri=global_List_CityURI[airIndex];gblIsAirportPresent=true;arr=global_location_uri.split("/");global_airportorcity=arr[2];}else{global_location_uri="/cities/"+gbl_AirportList[airIndex].AirportCityId;global_location=gbl_AirportList[airIndex].AirportLocationURI.split("/")[2];global_airportorcity_uri="/cities/"+gbl_AirportList[airIndex].AirportCityId;defaultLocationId=gbl_AirportList[airIndex].AirportLocationId;gblIsAirportPresent=true;global_airportorcity=gbl_AirportList[airIndex].AirportCityId;}if(document.getElementById("prevnext_article_section")){document.getElementById("prevnext_article_section").style.display="block";}if(document.getElementById("prevnext_blog_section")){document.getElementById("prevnext_blog_section").style.display="block";}gbl_objArrBudget=null;gbl_popularObj=null;gbl_interestsObj=null;gbl_objLocationLogisticals=new Array();gbl_objTimeLocation=null;gbl_objAirportLocation=null;gblAttractionAvailabilityChecked=false;var acID;if(global_start_location==0){global_startingLocationName=gbl_AirportList[airIndex].AirportName;acID=gbl_AirportList[airIndex].AirportCityId;}else{global_startingLocationName=global_List_CityName[airIndex];acID=global_airportorcity;}var isCityExists=false;for(var vacationCnt=0;vacationCnt<gbl_arrAllVacationCity.length;vacationCnt++){if(gbl_arrAllVacationCity[vacationCnt].id==acID){isCityExists=true;gbl_arrAllCities=gbl_arrAllVacationCity[vacationCnt].cityObj;gbl_arrAllLocations=gbl_arrAllVacationCity[vacationCnt].locationsObj;gbl_arrAllLogisticals=gbl_arrAllVacationCity[vacationCnt].logisticalsObj;gbl_arrAllAttractions=gbl_arrAllVacationCity[vacationCnt].attractionsObj;gbl_arrAllHotels=gbl_arrAllVacationCity[vacationCnt].hotelsObj;gbl_arrAllServices=gbl_arrAllVacationCity[vacationCnt].servicesObj;gbl_arrAllTravelDetails=gbl_arrAllVacationCity[vacationCnt].travelDetailsObj;gbl_arrAllImages=gbl_arrAllVacationCity[vacationCnt].imagesObj;gbl_arrHotelServices=gbl_arrAllVacationCity[vacationCnt].hotelServicesObj;gbl_arrAttractionServices=gbl_arrAllVacationCity[vacationCnt].attractionServicesObj;gbl_arrAllHolidays=gbl_arrAllVacationCity[vacationCnt].holidaysObj;gbl_arrAllAdvertisement=gbl_arrAllVacationCity[vacationCnt].advertisementObj;gblLocationDurationArray=gbl_arrAllVacationCity[vacationCnt].locationDurationObj;gbl_arrRestaurants=gbl_arrAllVacationCity[vacationCnt].restaurantsObj;gbl_arrViatorTours=gbl_arrAllVacationCity[vacationCnt].viatorToursObj;gbl_arrViatorPass=gbl_arrAllVacationCity[vacationCnt].viatorPassObj;gblObjArrLocation=gbl_arrAllVacationCity[vacationCnt].LocationOrderObj;gbl_isDataRendered=true;break;}}for(var vacationCnt=0;vacationCnt<gbl_arrAllXMLData.length;vacationCnt++){if(gbl_arrAllXMLData[vacationCnt].id==acID){gbl_xmlobj_allNearByCities=gbl_arrAllXMLData[vacationCnt].nbcXML;gbl_xmlobj_allPartner=gbl_arrAllXMLData[vacationCnt].partnerXML;gbl_xmlobj_all=gbl_arrAllXMLData[vacationCnt].cityXML;gbl_isDataRendered=false;isCityExists=true;logisticalSuggestionObj=new StateSuggestions();setTimeout('generateSearchList()',100);setTimeout('generatePartnerSearchList()',200);setTimeout('generateNearBySearchList()',300);break;}}if(!isCityExists){if(flag_executed==0){gbl_isDataRendered=false;var mppURL="/cities/"+acID;sendCityReqeust(mppURL,global_startingLocationName);flag_executed=1;}}gblIsAirportExists=true;}else{if(airIndex!=-1){global_location_uri=gbl_CountryList[airIndex].URI;global_airportorcity_uri="/Countries/"+gbl_CountryList[airIndex].URI;gblIsAirportPresent=true;arr=global_location_uri.split("/");global_airportorcity=gbl_CountryList[airIndex].Id;var acID=gbl_CountryList[airIndex].Id;var countryExists=false;for(var vacationCnt=0;vacationCnt<gbl_arrAllXMLData.length;vacationCnt++){if(gbl_arrAllXMLData[vacationCnt].id==acID){gbl_xmlobj_multiCountries=gbl_arrAllXMLData[vacationCnt].cityXML;gbl_isDataRendered=false;countryExists=true;global_startingLocationName=AirportName;if(gbl_isCntryChanged){populateCountryData();DisplayCountryRegionDetails("Country",'');displaySelectedCountry();hideLoadingImages();}break;}}if(!countryExists){SendRequest("Countries/"+gbl_CountryList[airIndex].Id,"get","showCountryDetails");}gblIsAirportExists=true;global_startingLocationName=AirportName;}}if(!gblIsAirportExists)gbl_xmlobj_all="";}}function checkCityContents(CityName){if(typeof document.forms['frmdisplaypanel']!="undefined"&&!CityName){gblIsCityPresent=false;gbl_checkPlanNowClicked=true;var arr=new Array();var frmobj=document.frmdisplaypanel;var cityValue;gblIsCityExists=false,isCityExists=false;hideNBCLoading();if(document.getElementById('drpCity')){if(frmobj.drpCity.value!=""){currentCityNameArr=findCityName(currentCityNameArr);var iCnt=searchItem(global_List_CityName,currentCityName,true,"cityName");if(iCnt!=-1){global_location_uri=global_List_CityURI[iCnt];global_airportorcity_uri=global_List_CityURI[iCnt];gblIsCityPresent=true;arr=global_location_uri.split("/");arr=global_airportorcity_uri.split("/");global_airportorcity=arr[2];if(document.getElementById("prevnext_article_section")){document.getElementById("prevnext_article_section").style.display="block";}if(document.getElementById("prevnext_blog_section")){document.getElementById("prevnext_blog_section").style.display="block";}if((currentCityName.toLowerCase()!=global_startingLocationName.toLowerCase())||(flag_city_executed==0)){gbl_objArrBudget=null;gbl_popularObj=null;gbl_interestsObj=null;gbl_objLocationLogisticals=new Array();gbl_objTimeLocation=null;gbl_objAirportLocation=null;gblAttractionAvailabilityChecked=false;global_startingLocationName=currentCityName;if(global_start_location!=0){for(var vacationCnt=0;vacationCnt<gbl_arrAllVacationCity.length;vacationCnt++){if(gbl_arrAllVacationCity[vacationCnt].id==global_airportorcity){isCityExists=true;gbl_arrAllCities=gbl_arrAllVacationCity[vacationCnt].cityObj;gbl_arrAllLocations=gbl_arrAllVacationCity[vacationCnt].locationsObj;gbl_arrAllLogisticals=gbl_arrAllVacationCity[vacationCnt].logisticalsObj;gbl_arrAllAttractions=gbl_arrAllVacationCity[vacationCnt].attractionsObj;gbl_arrAllHotels=gbl_arrAllVacationCity[vacationCnt].hotelsObj;gbl_arrAllServices=gbl_arrAllVacationCity[vacationCnt].servicesObj;gbl_arrAllTravelDetails=gbl_arrAllVacationCity[vacationCnt].travelDetailsObj;gbl_arrAllImages=gbl_arrAllVacationCity[vacationCnt].imagesObj;gbl_arrHotelServices=gbl_arrAllVacationCity[vacationCnt].hotelServicesObj;gbl_arrAttractionServices=gbl_arrAllVacationCity[vacationCnt].attractionServicesObj;gbl_arrAllHolidays=gbl_arrAllVacationCity[vacationCnt].holidaysObj;gbl_arrAllAdvertisement=gbl_arrAllVacationCity[vacationCnt].advertisementObj;gblLocationDurationArray=gbl_arrAllVacationCity[vacationCnt].locationDurationObj;gbl_arrRestaurants=gbl_arrAllVacationCity[vacationCnt].restaurantsObj;gbl_arrViatorTours=gbl_arrAllVacationCity[vacationCnt].viatorToursObj;gbl_arrViatorPass=gbl_arrAllVacationCity[vacationCnt].viatorPassObj;gblObjArrLocation=gbl_arrAllVacationCity[vacationCnt].LocationOrderObj;gbl_isDataRendered=true;break;}}for(var vacationCnt=0;vacationCnt<gbl_arrAllXMLData.length;vacationCnt++){if(gbl_arrAllXMLData[vacationCnt].id==global_airportorcity){gbl_xmlobj_allNearByCities=gbl_arrAllXMLData[vacationCnt].nbcXML;gbl_xmlobj_allPartner=gbl_arrAllXMLData[vacationCnt].partnerXML;gbl_xmlobj_all=gbl_arrAllXMLData[vacationCnt].cityXML;gbl_isDataRendered=false;isCityExists=true;break;}}if(!isCityExists){gbl_isDataRendered=false;sendCityReqeust(global_List_CityURI[iCnt],currentCityName);}}flag_city_executed=1;gblIsCityExists=true;}}}}}else if(CityName){CityName=findCityName(CityName);var iCnt=searchItem(global_List_CityName,CityName,true,"cityName");if(iCnt!=-1){global_location_uri=global_List_CityURI[iCnt];global_airportorcity_uri=global_List_CityURI[iCnt];gblIsCityPresent=true;arr=global_location_uri.split("/");arr=global_airportorcity_uri.split("/");global_airportorcity=arr[2];if(document.getElementById("prevnext_article_section")){document.getElementById("prevnext_article_section").style.display="block";}if(document.getElementById("prevnext_blog_section")){document.getElementById("prevnext_blog_section").style.display="block";}if((CityName.toLowerCase()!=global_startingLocationName.toLowerCase())||(flag_city_executed==0)){gbl_objArrBudget=null;gbl_arrLocationObj=null;gbl_popularObj=null;gbl_interestsObj=null;gbl_objLocationLogisticals=new Array();gblABstringCache=new Array();gbl_objTimeLocation=null;gbl_objAirportLocation=null;gblAttractionAvailabilityChecked=false;global_startingLocationName=CityName;if(global_start_location!=0){var isCityExists=false;for(var vacationCnt=0;vacationCnt<gbl_arrAllVacationCity.length;vacationCnt++){if(gbl_arrAllVacationCity[vacationCnt].id==global_airportorcity){isCityExists=true;gbl_arrAllCities=gbl_arrAllVacationCity[vacationCnt].cityObj;gbl_arrAllLocations=gbl_arrAllVacationCity[vacationCnt].locationsObj;gbl_arrAllLogisticals=gbl_arrAllVacationCity[vacationCnt].logisticalsObj;gbl_arrAllAttractions=gbl_arrAllVacationCity[vacationCnt].attractionsObj;gbl_arrAllHotels=gbl_arrAllVacationCity[vacationCnt].hotelsObj;gbl_arrAllServices=gbl_arrAllVacationCity[vacationCnt].servicesObj;gbl_arrAllTravelDetails=gbl_arrAllVacationCity[vacationCnt].travelDetailsObj;gbl_arrAllImages=gbl_arrAllVacationCity[vacationCnt].imagesObj;gbl_arrHotelServices=gbl_arrAllVacationCity[vacationCnt].hotelServicesObj;gbl_arrAttractionServices=gbl_arrAllVacationCity[vacationCnt].attractionServicesObj;gbl_arrAllHolidays=gbl_arrAllVacationCity[vacationCnt].holidaysObj;gbl_arrAllAdvertisement=gbl_arrAllVacationCity[vacationCnt].advertisementObj;gblLocationDurationArray=gbl_arrAllVacationCity[vacationCnt].locationDurationObj;gbl_arrRestaurants=gbl_arrAllVacationCity[vacationCnt].restaurantsObj;gbl_arrViatorTours=gbl_arrAllVacationCity[vacationCnt].viatorToursObj;gbl_arrViatorPass=gbl_arrAllVacationCity[vacationCnt].viatorPassObj;gblObjArrLocation=gbl_arrAllVacationCity[vacationCnt].LocationOrderObj;gbl_isDataRendered=true;break;}}for(var vacationCnt=0;vacationCnt<gbl_arrAllXMLData.length;vacationCnt++){if(gbl_arrAllXMLData[vacationCnt].id==global_airportorcity){gbl_xmlobj_allNearByCities=gbl_arrAllXMLData[vacationCnt].nbcXML;gbl_xmlobj_allPartner=gbl_arrAllXMLData[vacationCnt].partnerXML;gbl_xmlobj_all=gbl_arrAllXMLData[vacationCnt].cityXML;gbl_isDataRendered=false;isCityExists=true;break;}}if(!isCityExists){gbl_isDataRendered=false;sendCityReqeust(global_List_CityURI[iCnt],CityName);}}flag_city_executed=1;gblIsCityExists=true;}}}}function checkCountryContents(){alert(" in fun checkCountryContents");var arr=new Array();gbl_arrMCountries=new Array();gblIsCountryPresent=false;gblIsCountryExists=false;gbl_checkPlanNowClicked=true;var isCountryExists=false;var countryNameStr="";var cntryId="";var cntryName="";var cntryObj=document.frmMultiCityPlanner.CountryName;var roomCount=document.getElementById("txtRoomCount").value;var travelerCount=document.getElementById("txtTravelerCount").value;var tripCurrency=document.getElementById("TripCurrency").value;for(var cnCnt=0;cnCnt<cntryObj.length;cnCnt++){if(cntryObj[cnCnt].checked==true){countryNameStr=document.getElementById("ChkBoxCountry"+cnCnt).value;cntryId=countryNameStr.split("~")[0];cntryName=countryNameStr.split("~")[1];gbl_arrMCountries[gbl_arrMCountries.length]=new CLSMultiCountries(cntryId,cntryName);}}if(gbl_arrMCountries.length==0){alert("Please select countries.");return false;}countryValue=gbl_arrMCountries[0].Name;if(gbl_arrMCountries.length){fillMCntryDetails(countryValue);}}function selectFilter(filtervalue){if(!filtervalue)filtervalue=1;if((filtervalue!="")||(filtervalue!="null")){if(document.getElementById('interests')){document.getElementById('interests').style.display="none";}if(document.getElementById('attraction-list')){document.getElementById('attraction-list').scrollTop="0px";}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(parseInt(filtervalue)!=5){isInterestWise="false";}else{isInterestWise="true";document.getElementById('interests').style.display="";if(!gbl_splInterestGroupChosen){gbl_splInterestGroupChosen="Outdoor/Active";}}}}function applyInterestFilter(filtervalue){gbl_splInterestGroupChosen=filtervalue;}function displaydiv(divname,data){var displaydivelement;var closediv_str="<p><a onclick=\"javascript:displaydiv('articleblogdetailsdisplay','sdfsd');\" href=\"javascript:void(0);\">close</a></p>";displaydivelement=document.getElementById(divname);document.getElementById("contents").innerHTML=data+closediv_str;displaydivelement.style.visibility=(displaydivelement.style.visibility=="visible")?"hidden":"visible";}function displaypopup(ArticleBlogFlag,Data){displaydiv('articleblogdetailsdisplay',Data);}function displaypopupserviceproviderurl(url){windowhandler=window.open(url);windowhandler.moveTo(0,0);windowhandler.To(screen.availWidth,screen.availHeight);}function addOption(selectbox,text,value){var optn=document.createElement("OPTION");optn.text=text;optn.value=value;selectbox.options.add(optn);}function removeAllOptions(selectbox){var i;if(selectbox){if(selectbox.options.length){for(i=selectbox.options.length-1;i>=0;i--){selectbox.remove(i);}}}}function display(id){var frmObj;if(document.getElementById(id)){document.getElementById(id).style.display="";}global_transportOption="";if(id=="layer1"){flag_city_executed=0;global_start_location=0;}if(id=="layer2"){flag_executed=0;global_start_location=1;}if(id=="layer4"){var arrivalDate='';var startTime='';global_start_location=4;fillCountryVPDetails(global_startingLocationName);removeAllOptions(document.getElementById("countryList"));for(var cityCnt=0;cityCnt<gbl_arrAllVacationCountry.length;cityCnt++){addOption(document.getElementById("countryList"),gbl_arrAllVacationCountry[cityCnt].countryName);if(gbl_arrAllVacationCountry[cityCnt].countryName==global_startingLocationName){document.getElementById("countryList").options[cityCnt].selected=true;}document.getElementById("countryListSpan").style.display="";}if(gbl_arrAllVacationCountry.length){if(isIE){var cityListObj=document.frmdisplaypanel4.countryList;for(var i=0;i<cityListObj.options.length;i++){if(cityListObj.options[i].value==global_startingLocationName){cityListObj.options[i].selected=true;break;}}}else{document.getElementById("countryList").value=global_startingLocationName;}}}return true;}function hidePanel(id){global_transportOption="";if(document.getElementById(id)){document.getElementById(id).style.display="none";}return true;}function ShowHideDiv(chkBoxObj,divName){if(chkBoxObj.checked){document.getElementById(divName).style.display="";if(divName=='divContactDetails'){if(document.frmBidRequest.rdoContactType[0].checked){document.getElementById('divContactText').innerHTML="Enter "+document.frmBidRequest.rdoContactType[0].value+" details:";document.getElementById('divContactPhone').style.display="none";document.getElementById('divContactEmail').style.display="";}else{document.getElementById('divContactText').innerHTML="Enter "+document.frmBidRequest.rdoContactType[1].value+" details:";document.getElementById('divContactPhone').style.display="";document.getElementById('divContactEmail').style.display="none";}}}else{document.getElementById(divName).style.display="none";if(divName=='divContactPreference'){document.getElementById('divContactDetails').style.display="none";}}}function Delete_Me(id,uri){var answer=confirm("Are you sure you want to delete this record?");if(answer){if(uri=="ViewTravelExpert"){SendRequest(uri+'.php?id='+id+'&Delete=Yes','get','deletetravelexpert');}if(uri=="ViewServiceProvider"){SendRequest(uri+'.php?id='+id+'&Delete=Yes','get','deleteserviceprovider');}else if(uri=="ViewArticleBlog"){SendRequest(uri+'.php?id='+id+'&Delete=Yes','get','deletearticleblog');}else if(uri=="Viewuser"){SendRequest(uri+'.php?id='+id+'&Delete=Yes','get','deleteuserdetails');}else{SendRequest(uri+'.php?id='+id+'&Delete=Yes','get','deleteservices');}}else{}}function Delete_MeNew(id,spId,uri,CountryId){if(uri=="ViewServiceProvider"){var answer=confirm("Do you want to delete the Service Provider?");}else if(uri=="ViewEvents"){var answer=confirm("Do you want to delete this Event?");}else{var answer=confirm("Do you want to delete this Service?");}if(answer){if(uri=="ViewServiceProvider"){uri="RegisterServiceProvider.php?action=Delete&id="+id;SendRequest(uri,'get','deleteserviceprovider');}else if(uri=="ViewServices"||uri=="ViewEvents"){uri="RegisterService.php?action=Delete&id="+id+"&chkItineraryFlag=0&userid="+spId+"&CountryId="+CountryId;SendRequest(uri,'get','deleteserviceChk');}}else{}}function closepopup(){window.close();}function val_1Form(userObj,passObj,value,Itinerary){var mname=userObj.value;var mpass=passObj.value;if(mname==''&&mpass==''){if(window.frames["itineraryFrame"]){mname=window.frames["itineraryFrame"].document.frmUserDatail.User.value;mpass=window.frames["itineraryFrame"].document.frmUserDatail.pass.value;}else if(window.frames["itineraryLoginFrame"]){mname=window.frames["itineraryLoginFrame"].document.frmUserDatail.User.value;mpass=window.frames["itineraryLoginFrame"].document.frmUserDatail.pass.value;}}if(bValidate(userObj,"Email","True","Email address")==false){return(false);}else if(mpass==''){alert("Password cannot be blank");return;}showloadingForFeedBackPopup();if(value.checked==true){chkRememberMe=true;}var userDetails={'name':mname,'password':mpass,'value':Itinerary,'chkRememberMe':chkRememberMe};formData=ued_encode(userDetails);SendRequest(global_user_uri,"post","Log");}function CheckUser(userObj,passObj){var userName=userObj.value;var userPass=passObj.value;var userDetails={'name':userName,'password':userPass};formData=ued_encode(userDetails);SendRequest("CheckUser.php","post","User");}function checkSession(){SendRequest("SessionListener.php","get","SessionListener");}function getMultiCityPlannerPage(){gbl_prevFormHTML=document.getElementById('loadpage').innerHTML;SendRequest("MultiCityPlanner.php?type="+global_start_location,"get","multiCityPlanner");}function Sign_out(){SendRequest("Signout.php","get","sign_out");}function showSignInPage(){var sign_out=document.getElementById("SignUp");gblIsTravelerRegistrationStarted=false;if(sign_out.innerHTML.toLowerCase()=="sign out"){SendRequest('Signout.php','get','sign_out');}else{var objOverlay,iframeObj;if(isMacOS){if(document.getElementById('attraction-list')){document.getElementById('attraction-list').style.overflow="hidden";document.getElementById('divItnerary').style.overflow="hidden";document.getElementById('divAttractionDetails').style.overflow="hidden";document.getElementById('divAttractionDesc').style.overflow="hidden";}}objOverlay=document.getElementById("overlay");objOverlay.style.visibility=(objOverlay.style.visibility=="visible")?"hidden":"visible";if(objOverlay.style.visibility=="hidden"){objOverlay.style.height="90%";objOverlay.style.width="95%";}if(objOverlay.style.visibility=="visible"){document.getElementById('overlayInner').style.display="";if(isIE){var leftCo=((document.body.offsetWidth/2.5-document.getElementById("overlayInner").offsetWidth/2)+150)+"px";var topCo=((document.body.offsetHeight/2.9-document.getElementById("overlayInner").offsetHeight/2)+100)+"px";document.getElementById('overlayInner').style.left=leftCo;document.getElementById('overlayInner').style.top=topCo;}else{document.getElementById('overlayInner').style.left=((document.width/2.5-document.getElementById("overlayInner").offsetWidth/2)+150)+"px";document.getElementById('overlayInner').style.top=((document.height/2.9-document.getElementById("overlayInner").offsetHeight/2+100))+"px";}objOverlay.style.height=document.body.scrollHeight;objOverlay.style.width=document.body.scrollWidth-2;}iframeObj=document.getElementById("itineraryFrame");if(document.getElementById("plan_now")){iframeObj.style.display='';iframeObj.src=DIRECTORYSTRUCTUREPATH+"Signout.php?itinerary=2";}else{iframeObj.src=DIRECTORYSTRUCTUREPATH+"Signout.php";}}}function cancelFPWindow(){var objOverlay,iframeObj;objOverlay=document.getElementById("overlay");if(gblIsSaveRequested==true){objOverlay.style.visibility="hidden";objOverlay.style.height="90%";objOverlay.style.width="95%";objOverlay=document.getElementById("AB_overlay");if(document.getElementById("attraction-list")){iframeObj=document.getElementById("itineraryLoginFrame");iframeObj.src=DIRECTORYSTRUCTUREPATH+"LoginPage.php?Itinerary=1";}else{iframeObj=document.getElementById("itineraryLoginFrame");iframeObj.src=DIRECTORYSTRUCTUREPATH+"LoginPage.php?Itinerary=3";}}else{if(document.getElementById("AB_overlay")&&document.getElementById("AB_overlay").style.visibility=="visible"){document.getElementById("AB_overlay").style.visibility="hidden";}if(document.getElementById("attraction-list")){iframeObj=document.getElementById("itineraryFrame");iframeObj.src=DIRECTORYSTRUCTUREPATH+"LoginPage.php?Itinerary=1";}else{iframeObj=document.getElementById("itineraryFrame");iframeObj.src=DIRECTORYSTRUCTUREPATH+"LoginPage.php?Itinerary=3";}}gblIsMyTripRequested=false;gblIsSaveBeforeMyTrip=false;gblIsHomeRequested=false;gblIsBudgetRequested=false;}function deleteholidaydaterangesection(Index){var tdid=document.getElementById("rangemorefunctionalityid");var aid=document.getElementById(Index);tdid.removeChild(aid);}function deleteholidaydatesection(Index){var tdid=document.getElementById("morefunctionalityid");var aid=document.getElementById(Index);tdid.removeChild(aid);}function getSelectedCountry(type){var arr=new Array();var index=0;var cntIdList="";var cntCityList="";var conID=document.getElementById("ServicesCountry").length;for(i=0;i<conID;i++){if(document.getElementById("ServicesCountry").options[i].selected){if(cntIdList!=""){cntIdList=cntIdList+","+document.getElementById("ServicesCountry").options[i].value;}else{cntIdList=document.getElementById("ServicesCountry").options[i].value;}}}var selCityLen=document.getElementById("ServicesCity").length;for(i=0;i<selCityLen;i++){if(document.getElementById("ServicesCity").options[i].selected){if(cntCityList!=""){cntCityList=cntCityList+","+document.getElementById("ServicesCity").options[i].value;}else{cntCityList=document.getElementById("ServicesCity").options[i].value;}}}var array={'countries':cntIdList,'conID':conID,'cities':cntCityList};formData=ued_encode(array);if(typeof(type)!="undefined"&&type=="CityAttraction"){SendRequest("getCountryCity.php?type=attractionprovider",'post','citycontrol');}else{SendRequest("getCountryCity.php?type=spservices",'post','citycontrol');}}function getSelectedCity(isSelectOptionNeeded){var country=document.getElementById("Country").value;var array={'con':country,'SelectOption':isSelectOptionNeeded};formData=ued_encode(array);SendRequest("getCountryCity.php?type=spservices",'post','citycontrol');}function Registration(value,ItineraryValue){var objOverlay;objOverlay=document.getElementById("AB_overlay");objOverlay.style.visibility="hidden";objOverlay.style.height="90%";objOverlay.style.width="95%";objOverlay=document.getElementById("overlay");objOverlay.style.visibility="hidden";objOverlay.style.height="90%";objOverlay.style.width="95%";if(value=="budgetPlanner"){var countryName=document.budgetPlannerfrm.Region.options[document.budgetPlannerfrm.Region.selectedIndex].text;var countryId=document.budgetPlannerfrm.Region.value;var cityId=document.budgetPlannerfrm.City.value;var cityName=document.budgetPlannerfrm.City.options[document.budgetPlannerfrm.City.selectedIndex].text;var arival_date=document.budgetPlannerfrm.arival_date.value;var transport=document.budgetPlannerfrm.transport.value;var currency=document.budgetPlannerfrm.currency.value;var no_travelers=document.budgetPlannerfrm.no_travelers.value;var rooms=document.budgetPlannerfrm.rooms.value;var stay_for=document.budgetPlannerfrm.stay_for.value;var LodgingcostType=document.budgetPlannerfrm.lodging.value;var DiningcostType=document.budgetPlannerfrm.dining.value;var lodging=document.budgetPlannerfrm.lodging_dc.value;var dining=document.budgetPlannerfrm.dining_dc.value;var shopping=document.budgetPlannerfrm.shopping_dc.value;var garound=document.budgetPlannerfrm.garound_dc.value;var sight=document.budgetPlannerfrm.sight_dc.value;var ement=document.budgetPlannerfrm.ement_dc.value;var misce=document.budgetPlannerfrm.misce_dc.value;var getting=document.budgetPlannerfrm.getting_tc.value;gblBudgetPreferece=new CLSBudgetPreference(countryId,countryName,cityId,cityName,arival_date,stay_for,no_travelers,rooms,LodgingcostType,DiningcostType,transport,currency,lodging,dining,shopping,garound,sight,ement,misce,getting);}SendRequest("RegisterTraveler.php","get","traveler");gblPageBeforeRegister=value;}function cancel(){hidePopupIframe();hideLoadingImages();var objOverlay;var isLoginUser=false;isShareItinerary=false;gblIsMyTripRequested=false;gblIsSaveBeforeMyTrip=false;gblIsHomeRequested=false;gblIsBudgetRequested=false;if(isMacOS){if(document.getElementById('attraction-list')!=null){document.getElementById('attraction-list').style.overflow="auto";document.getElementById('divItnerary').style.overflow="auto";document.getElementById('divAttractionDetails').style.overflow="auto";document.getElementById('divAttractionDesc').style.overflow="auto";}}sign_out=document.getElementById("SignUp");if(sign_out.innerHTML.toLowerCase()=="sign out"){isLoginUser=true;}if(document.getElementById('budget_now')){if(gbl_BudgetId==0||gbl_BudgetId==-1||!isLoginUser){document.getElementById("iteneraryRegistrationDiv").style.display='none';if(parseFloat(document.budgetPlannerfrm.costperday.value)>0&&parseFloat(document.budgetPlannerfrm.tripcost.value)>0){alert("Please save your budget information.");}return false;}}else if(gbl_isItineraryCreated==true&&!isLoginUser){alert("Please register to save your itinerary");}gbl_isItineraryCreated=false;objOverlay=document.getElementById("overlay");if(typeof(objOverlay)=="object"&&objOverlay!=null){objOverlay.style.visibility="hidden";objOverlay.style.height="90%";objOverlay.style.width="95%";}objOverlay=document.getElementById("AB_overlay");if(typeof(objOverlay)=="object"&&objOverlay!=null){objOverlay.style.visibility="hidden";objOverlay.style.height="90%";objOverlay.style.width="95%";}}var global_exchange_rate=parseFloat(1.00);var global_currency_symbol='$';var global_currency_code='USD';var	global_currency_update='';var gbl_BudgetId=0;var gbl_TransportFlagDc=0;var gbl_usdDropDownValue=149;var	gbl_budgetObj=new Array();var gbl_TransportFlagTc=0;var gbl_sortBy='asc';var globaBudgetCityID_=-1,globaBudgetCountryID_="";var gbl_budgetfrmValidate=true;var budgetOprationMode='saveUserBudget';var globaBudgetCityID=0,globaBudgetCountryID="";var transportCost=parseFloat(0.00);var lodgingActive=true;var diningActive=true;var garoundActive=true;var sightActive=true;var ementActive=true;var shoppingActive=true;var gettingActive=true;var misceActive=true;var arr_pidDcTc=new Array();try{arr_pidDcTc[0]=-1;}catch(err){}var thousand_sep=",";var decimal_point=".";var default_precision=2;function extractQuamas(Num){var strNum=""+Num+"";var newStr=strNum.replace(',',"");if(newStr.match(',')){extractQuamas(newStr);}else{return newStr;}}function formatFloat(aFloat,aPrecision){try{precision=default_precision;if(!isNaN(aPrecision))if(Math.abs(aPrecision)<=10)precision=aPrecision;}catch(e){precision=default_precision;}try{number=parseFloat(aFloat+'');if(isNaN(number))return"NaN";}catch(e){return"NaN";}number=Math.round(number*Math.pow(10,precision))/Math.pow(10,precision);integerpart=''+((number<0)?Math.ceil(number):Math.floor(number));decimalpart=Math.abs(Math.round((number-integerpart)*(Math.pow(10,precision))));if(decimalpart<10){decimalpart="0"+decimalpart;}if(decimalpart==0){decimalpart="00";}var buff="";for(j=-1,i=integerpart.length;i>=0;i--,j++){if((j%3)==0&&j>1){buff=thousand_sep+buff;}buff=integerpart.charAt(i)+buff;}if(precision>0){return buff+decimal_point+decimalpart;}return buff;}function formatInt(aInt){return formatFloat(aInt,0);}function getExchangeRate(currid){if(currid!=-1){global_budgetCurrency_uri='/currency/exrate/usd/'+currid;str_request_type="getExchangeRate";SendRequest(global_budgetCurrency_uri,"GET",str_request_type);}else{gbl_currentCurrencyDetails=null;gbl_userPrefCurrencyDetails=null;}}function trim(str,chars){if(str){return ltrim(rtrim(str,chars),chars);}else{return null;}}function ltrim(str,chars){if(str){chars=chars||"\\s";return str.replace(new RegExp("^["+chars+"]+","g"),"");}else{return null;}}function rtrim(str,chars){if(str){chars=chars||"\\s";return str.replace(new RegExp("["+chars+"]+$","g"),"");}else{return null;}}function getSelectedRegionCity(){var region=document.getElementById("Region").value;var array={'Budget':region};formData=ued_encode(array);SendRequest("getCountryCity.php",'post','citycontrol');global_budgetrequest_uri='/budget/'+region;str_request_type="showCityBudget_Details";SendRequest(global_budgetrequest_uri,"GET",str_request_type);if(globaBudgetCityID==0){resetallBudgetItems();}}function getCityForReports(){gbl_isReportPageCall=true;var region=document.getElementById("Country_SearchBox").value;var array={'Budget':region};formData=ued_encode(array);SendRequest("getCountryCity.php",'post','citycontrol');}function setUserBudget(){if(gbl_userBudgetDetail.length==0){alert('You have not planned budget for any city yet.');return false;}setBudgetTabs();if(gbl_sortBy=='asc'){gbl_sortBy='desc';gbl_userBudgetDetail=gbl_userBudgetDetail.sort(sortByBudgetCity);}else{gbl_sortBy='asc';gbl_userBudgetDetail=gbl_userBudgetDetail.reverse();}DisplayUserBudgetDetails();}function getItemCostType(CostTypeIndex){switch(CostTypeIndex){case'1':costType='Budget';break;case'2':costType='Moderate';break;case'3':costType='Expensive';break;default:costType='Moderate';break;}return costType;}function resetBudget(BudgetId,OprationMode){gbl_BudgetId=BudgetId;budgetOprationMode=OprationMode;return;}var gbl_displayMessgae=0;function getBudgetDetailsForCity(cityId,Country){var CountryList=document.budgetPlannerfrm.Region;var selectedOption="";var Currency=document.budgetPlannerfrm.currency.value;for(var countryCnt=0;countryCnt<CountryList.length;countryCnt++){selectedOption=CountryList[countryCnt];if(Country==selectedOption.firstChild.nodeValue){gblEditBudgetFrmMyBudgetsCityID=cityId;gbl_BudgetPageCountryHash=Country.toUpperCase();CountryId=CountryList[countryCnt].value;CountryList[countryCnt].selected=true;document.budgetPlannerfrm.lodging_dc_display.disabled="";document.budgetPlannerfrm.lodging_tc.disabled="";document.budgetPlannerfrm.dining_dc_display.disabled="";document.budgetPlannerfrm.dining_tc.disabled="";document.budgetPlannerfrm.shopping_dc_display.disabled="";document.budgetPlannerfrm.shopping_tc.disabled="";document.budgetPlannerfrm.garound_dc_display.disabled="";document.budgetPlannerfrm.garound_tc.disabled="";document.budgetPlannerfrm.sight_dc_display.disabled="";document.budgetPlannerfrm.sight_tc.disabled="";document.budgetPlannerfrm.ement_dc_display.disabled="";document.budgetPlannerfrm.ement_tc.disabled="";document.budgetPlannerfrm.getting_tc_display.disabled="";document.budgetPlannerfrm.misce_dc_display.disabled="";document.budgetPlannerfrm.misce_tc.disabled="";getSelectedRegionCity();break;}}if(parseInt(Currency)!=149){getExchangeRate(Currency);}}function FillBudgetDetailsForCountry(budgetNowFlag){var w=document.budgetPlannerfrm.Region.selectedIndex;var RegionId=document.budgetPlannerfrm.Region.value;if(RegionId==0){alert('Please select country.');return false;}document.getElementById('cityHeader').style.display="block";var gbl_countryExist=0;var regionname=document.budgetPlannerfrm.Region.options[w].text;document.getElementById('cityName').innerHTML=regionname;for(k=0;k<gbl_userBudgetDetail.length;k++){if(gbl_userBudgetDetail[k].country.toLowerCase()==regionname.toLowerCase()&&gbl_userBudgetDetail[k].cityid<1){globaBudgetCountryID=RegionId;gbl_countryExist=1;if(globaBudgetCountryID!=0&&globaBudgetCountryID_!=globaBudgetCountryID){globaBudgetCountryID_=globaBudgetCountryID;}resetBudget(gbl_userBudgetDetail[k].BudgetId,'updateUserBudget');}if(gbl_countryExist==1){break;}}if(gbl_countryExist==1){if(budgetNowFlag==1||budgetNowFlag==2||budgetNowFlag==3||budgetNowFlag==4||budgetNowFlag==10){getCityParticulars(regionname,budgetNowFlag,"Country");}else{fillCityParticulars(regionname,"Country");}}else{resetBudget(-1,'saveUserBudget');if(budgetNowFlag==0){resetallBudgetItems();}if(parseInt(budgetNowFlag)==11){budgetNowFlag='0';}if(budgetNowFlag==10){budgetNowFlag=0;}getCityParticulars(regionname,budgetNowFlag,"Country");}}function FillBudgetDetails(budgetNowFlag){var Region=document.budgetPlannerfrm.Region.value;if(Region==0){alert('Please select country.');return false;}var w=document.budgetPlannerfrm.City.selectedIndex;if(w!=-1){FillBudgetDetailsForCity(budgetNowFlag);}else{FillBudgetDetailsForCountry(budgetNowFlag);}}function FillBudgetDetailsForCity(budgetNowFlag){var w=document.budgetPlannerfrm.City.selectedIndex;var Region=document.budgetPlannerfrm.Region.value;if(Region==0){alert('Please select country.');return false;}if(w==-1&&!gblEdiBudgetCity){alert('Please select city');return false;}gblEdiBudgetCity=false;document.getElementById('cityHeader').style.display="block";var gbl_cityExist=0;var cityId=document.budgetPlannerfrm.City.value;var cityname=document.budgetPlannerfrm.City.options[w].text;document.getElementById('cityName').innerHTML=cityname;for(k=0;k<gbl_userBudgetDetail.length;k++){if(gbl_userBudgetDetail[k].cityid==cityId){globaBudgetCityID=gbl_userBudgetDetail[k].cityid;gbl_cityExist=1;if(globaBudgetCityID!=0&&globaBudgetCityID_!=globaBudgetCityID){globaBudgetCityID_=globaBudgetCityID;}resetBudget(gbl_userBudgetDetail[k].BudgetId,'updateUserBudget');}if(gbl_cityExist==1){break;}}if(gbl_cityExist==1){if(budgetNowFlag==1||budgetNowFlag==2||budgetNowFlag==3||budgetNowFlag==4||budgetNowFlag==10){getCityParticulars(cityId,budgetNowFlag,"City");}else{fillCityParticulars(cityId,"City");}}else{resetBudget(-1,'saveUserBudget');if(budgetNowFlag==0){resetallBudgetItems();}if(parseInt(budgetNowFlag)==11){budgetNowFlag='0';}if(budgetNowFlag==10){budgetNowFlag=0;}getCityParticulars(cityId,budgetNowFlag,"City");}if(globaBudgetCityID||gblAdCityID!=globaBudgetCityID){gblAdCityID=globaBudgetCityID;}}function deleteUserSavedBudget(budgetId){gblIsOverwriteBudget=false;var ans=confirm("Are you sure, do you want to delete this budget?");if(ans){gbl_deletedBudgetId=budgetId;showLoadingImages();deleteBudget(budgetId);}}function deleteBudget(budgetId){var array={'action':'deleteUserBudget','budgetId':budgetId};formData=ued_encode(array);SendRequest("saveBudgetItems.php",'post','saveUserBudget');return;}function chkCostFormat(Num,id){var strNum=""+Num+"";strNum=strNum.replace(/,/,"");var strNumlen=strNum.length;var cond=(strNum.indexOf('.')==-1);if(cond&&strNumlen>6){alert('The daily cost can be six digit long with two decimal points.');document.getElementById(id).value='0.00';return false;}else if(!cond){strNum=strNum.replace(/,/,"");strNum=strNum.split(".")[0];strNumlen=strNum.length;if(strNumlen>6){alert('The daily cost can be six digit long with two decimal points.');document.getElementById(id).value='0.00';return false;}}}function addToMyTrip(sessionUser){var arival_date=document.budgetPlannerfrm.arival_date.value;var isLoginUser=false;var sign_out=document.getElementById("SignUp");if(sign_out.innerHTML.toLowerCase()=="sign out"){isLoginUser=true;}if(arival_date=='mm/dd/yy'){alert('Please select date of arival.');document.budgetPlannerfrm.arival_date.focus();return false;}recalculate('addToMyTrip');document.budgetPlannerfrm.lodging_dc.value=document.budgetPlannerfrm.lodging_dc_display.value;document.budgetPlannerfrm.dining_dc.value=document.budgetPlannerfrm.dining_dc_display.value;document.budgetPlannerfrm.shopping_dc.value=document.budgetPlannerfrm.shopping_dc_display.value;document.budgetPlannerfrm.garound_dc.value=document.budgetPlannerfrm.garound_dc_display.value;document.budgetPlannerfrm.sight_dc.value=document.budgetPlannerfrm.sight_dc_display.value;document.budgetPlannerfrm.ement_dc.value=document.budgetPlannerfrm.ement_dc_display.value;document.budgetPlannerfrm.misce_dc.value=document.budgetPlannerfrm.misce_dc_display.value;document.budgetPlannerfrm.getting_tc.value=document.budgetPlannerfrm.getting_tc_display.value;var isLoginUser=false;sign_out=document.getElementById("SignUp");if(sign_out.innerHTML.toLowerCase()=="sign out"){isLoginUser=true;}if(!isLoginUser){gblActionBeforeRegister="BudgetSave";itineraryModal();}else{saveBudgeDetails();}}function saveBudgeDetails(){showLoadingImages();var regionId=document.budgetPlannerfrm.Region.value;var countryId=document.budgetPlannerfrm.Region.value;var cityId=document.budgetPlannerfrm.City.value;var cityName="";var arival_date=document.budgetPlannerfrm.arival_date.value;var transport=document.budgetPlannerfrm.transport.value;var currency=document.budgetPlannerfrm.currency.value;var no_travelers=document.budgetPlannerfrm.no_travelers.value;var rooms=document.budgetPlannerfrm.rooms.value;var stay_for=document.budgetPlannerfrm.stay_for.value;var LodgingcostType=document.budgetPlannerfrm.lodging.value;var DiningcostType=document.budgetPlannerfrm.dining.value;if(!global_currency_code){global_currency_code="USD";}if(gbl_deletedBudgetId==gbl_BudgetId){gbl_BudgetId=-1;budgetOprationMode='saveUserBudget';}var action=budgetOprationMode;var array={'currencySymbol':global_currency_symbol,'currencyExRate':global_exchange_rate,'currencyCode':global_currency_code,'transportCost':transportCost,'action':action,'BudgetId':gbl_BudgetId,'regionId':regionId,'countryId':countryId,'cityId':cityId,'arivalDate':arival_date,'stay_for':stay_for,'noOfTravelers':no_travelers,'noOfRooms':rooms,'lodgingPreference':LodgingcostType,'dinningPreference':DiningcostType,'currency':currency,'transport':transport,'budgetParticulars':[arr_pidDcTc]};formData=ued_encode(array);SendRequest("saveBudgetItems.php",'post','saveUserBudget');}function validateBudgeDetails(){alert("in fun validateBudgeDetails");var gbl_cityExist=0;var cityId=document.budgetPlannerfrm.City.value;var w=document.budgetPlannerfrm.City.selectedIndex;var cityname=document.budgetPlannerfrm.City.options[w].text;for(var k=0;k<gbl_userBudgetDetail.length;k++){if(gbl_userBudgetDetail[k].cityid==cityId){globaBudgetCityID=globaBudgetCityID_=cityId;gbl_cityExist=1;gbl_BudgetId=gbl_userBudgetDetail[k].BudgetId;break;}}if(gbl_cityExist==1){document.getElementById('AB_overlay').style.visibility='';var cfrm=confirm('Budget details are already planned for '+cityname+' city.\n To update and override existing budget with current preferences click OK, to view previous budget for '+cityname+' city click Cancel.');if(!cfrm){resetBudget(gbl_BudgetId,'updateUserBudget');fillCityParticulars(cityId,"City");}else{gblIsOverwriteBudget=true;deleteBudget(gbl_BudgetId);saveBudgeDetails();}}else{saveBudgeDetails();resetBudget(gbl_BudgetId,'updateUserBudget');}}function editBudgetItem(cityId,countryID){document.BudgetItemsList.cityId.value=cityId;SendRequest("addbudgetItems.php?action=updateBudgetItems&city="+cityId+"&CountryID="+countryID,'post','editbudgeItems');}function deleteBudgetItems(cityId,CountryID,action){var array={'cityID':cityId,'CountryID':CountryID,'action':action};formData=ued_encode(array);SendRequest("saveBudgetItems.php",'post','saveUserBudget');}function ChkDateValidity(oriDate,endDate){var sysDate;var arrivalDate=new Date(oriDate.split("/")[2],parseInt(extractNumber(oriDate.split("/")[0]))-1,extractNumber(oriDate.split("/")[1]));var currentDate=new Date();if(endDate==""){sysDate=new Date(currentDate.getFullYear(),currentDate.getMonth(),currentDate.getDate());}else{sysDate=new Date(endDate.split("/")[2],parseInt(extractNumber(endDate.split("/")[0]))-1,extractNumber(endDate.split("/")[1]));}var sysDateTime=sysDate.getTime();var arrivalDateTime=arrivalDate.getTime();if(oriDate==""||arrivalDateTime<sysDateTime){return(false);}return(true);}function validateDailyCost(ItemId){gbl_budgetfrmValidate=true;var val=document.getElementById(ItemId).value;var err=vd_(extractQuamas(val));if(!err){gbl_budgetfrmValidate=false;switch(ItemId){case'lodging_dc':alert('Daily cost for Lodging should be numeric or zero.');break;case'dining_dc':alert('Daily cost for Dining should be numeric or zero.');break;case'shopping_dc':alert('Daily cost for Shopping should be numeric or zero.');break;case'garound_dc':alert('Daily cost for Getting Around should be numeric or zero.');break;case'sight_dc':alert('Daily cost for Sightseeing  should be numeric or zero.');break;case'ement_dc':alert('Daily cost for Entertainment should be numeric or zero.');break;case'getting_tc':alert('Trip cost for Getting There should be numeric or zero.');break;case'misce_dc':alert('Daily cost for Miscellaneous should be numeric or zero.');break;}document.getElementById(ItemId).value='0.00';document.getElementById(ItemId).focus();return(false);}return(true);}function vd(cost){var lenfactor=10;var err=true;var modiCost=""+cost+"";costLength=modiCost.length;if(modiCost.indexOf('.')==-1&&costLength<6){lenfactor=6;}if(isNaN(cost)==true||cost==''){err=false;}else if(cost<0){err=false;}if(costLength>lenfactor){err=false;}return(err);}function vd_(cost){var err=true;if(isNaN(cost)==true||cost==''){err=false;}return(err);}function planNow(){gbl_BudgetCurrencyVal=document.budgetPlannerfrm.currency.value;cityID=document.budgetPlannerfrm.City.value;setCurrencyDetails();if(cityID==''){alert("Please select city.");return false;}recalculate();if(gbl_BudgetId==0||gbl_BudgetId==-1){var ans=confirm('Would you like to save your budget?');if(ans){gblIsPlanBeforeBudget=true;addToMyTrip('recalculate');}else{gblIsPlanBeforeBudget=false;planFromBudget();}}else{gblIsPlanBeforeBudget=false;planFromBudget();}gbl_BudgetCurrencyFlag=true;}function startABCallback(){return true;}function completeABCallback(response){return true;}function hidePopupIframe(){var objOverlay;objOverlay=document.getElementById("overlay");if(typeof(objOverlay)=="object"&&objOverlay!=null){objOverlay.style.visibility="hidden";objOverlay.style.height="90%";objOverlay.style.width="95%";}objOverlay=document.getElementById("AB_overlay");if(typeof(objOverlay)=="object"&&objOverlay!=null){objOverlay.style.visibility="hidden";objOverlay.style.height="90%";objOverlay.style.width="95%";}if(isMacOS){if(document.getElementById('attraction-list')!=null){document.getElementById('attraction-list').style.overflow="auto";document.getElementById('divItnerary').style.overflow="auto";}}}function popupDemoFlash(){var params='width='+screen.width;params+=', height='+screen.height;params+=', top=0, left=0';params+=', resizable=yes';newwin=window.open('TripsketchDemo.php',null,params);if(window.focus){newwin.focus();};return false;}var ImageWidth;var ImageHeight;var showVerticalDesFlag=true;function RESIZE_MYTRIPIMAGE(imageToBeResize){var ImageWidth=0;var ImageHeight=0;var imgNew=new Image();imgNew.src=document.getElementById(imageToBeResize).src;var imgWidth=imgNew.width;var imgHeight=imgNew.height;ImageWidth=imgWidth;ImageHeight=imgHeight;var iwidth=0;var iheight=0;var ratio=0;var tmpDifference=0;var XByYRatio=ImageHeight/ImageWidth;if(XByYRatio==1.8){iwidth=MYTRIPSVERTICALIMAGEWIDTH;iheight=MYTRIPSVERTICALIMAGEHEIGHT;}else{iwidth=MYTRIPSIMAGEWIDTH;iheight=MYTRIPSIMAGEHEIGHT;}document.images[imageToBeResize].width=iwidth;document.images[imageToBeResize].height=iheight;}function replaceSingleQuote(str){if(typeof(str)=="string"){if(typeof(str.replace)!="undefined"){str=str.replace("?","'");str=str.replace("' ","? ");str=str.replace("''","'");}}return str;}function replaceCopyrightSymbol(str){if(typeof(str)=="string"){if(typeof(str.replace)!="undefined"){while(str.indexOf("?")!=-1){str=str.replace(" ?"," &#169;");str=str.replace("?","");}}}return str;}function sendPassword(userEmailId){if(userEmailId.value==""){alert("Please enter an email address");return false;}else{userEmailId.value=userEmailId.value.replace(/\n/g,'');if(userEmailId.value.indexOf(",")==-1){if(bValidate(userEmailId,"Email","True","Email Address")==false){return false;}}else{alert('Multiple email addresses are not allowed');return false;}}var array={'type':'forgotPassword','emailTo':userEmailId.value};formData=ued_encode(array);SendRequest("sendEmail.php",'post','forgotPassword');}function extractNumber(actualNumber){if(actualNumber==""||actualNumber=="null"||!actualNumber||actualNumber=="NA"||actualNumber=="NaN"||isNaN(actualNumber)){return 0;}if(actualNumber){var strNumber=actualNumber;if(strNumber.substr(0,1)=="0"){strNumber=strNumber.substr(1);}return strNumber;}}function getItineraryBudget(itineraryId){SendRequest("/budget/"+itineraryId+"/getIitneraryBudget","get","getItineraryBudgetDetails");}function setPosition(elementID){if(document.getElementById(elementID)){document.getElementById(elementID).style.left=(screen.width-document.getElementById(elementID).offsetWidth)/2+"px";document.getElementById(elementID).style.top=(screen.height/2-document.getElementById(elementID).offsetHeight)+"px";}}function setFWColumnsHeight(){var attrFWColumnObj=document.getElementById("tblAttractionFW");var tdFWColumnObj=document.getElementById("tdFWColumn");var itinerary_TdObj=document.getElementById("itinerary_id");var attrBrowserColumnObj=document.getElementById("attractionbrowser_td");var itineraryDivObj=document.getElementById("divItnerary");var attractionListDivObj=document.getElementById("attraction-list");var divRestaurantDivObj=document.getElementById("divRestaurant");var divShortListDivObj=document.getElementById("divShortList");var FWminusABHeight;var attrFWDetailsHeight=0;if(attrFWColumnObj){attrFWDetailsHeight=attrFWColumnObj.offsetHeight;}if(itineraryDivObj){FWminusABHeight=attrFWDetailsHeight-attractionListDivObj.offsetHeight-100;if(itineraryDivObj.style.height>700){itineraryDivObj.style.height=attrFWDetailsHeight-350;}if(FWminusABHeight>250){divRestaurantDivObj.style.height=FWminusABHeight;divShortListDivObj.style.height=FWminusABHeight;}}}function displayCaption(img){var divHomePageCaption=document.getElementById('divHomePageCaption');var imgHomePageImage=document.getElementById('homepageMainAttrImg');var divDisplayPanel=document.getElementById('displaypanel');divHomePageCaption.style.height=10;if(isIE){divHomePageCaption.style.width=imgHomePageImage.width*0.90;divHomePageCaption.style.left=imgHomePageImage.width*0.05;divHomePageCaption.style.top=imgHomePageImage.height-divHomePageCaption.offsetHeight-10;}else{divHomePageCaption.style.width=imgHomePageImage.width*0.90;divHomePageCaption.style.left=imgHomePageImage.width*0.05;divHomePageCaption.style.top=divHomePageCaption.offsetHeight-25;}divHomePageCaption.style.display="";}x=20;y=70;function setVisible(txtMessage,parentDiv){obj=document.getElementById('PopUpDiv');objParentDiv=document.getElementById(parentDiv);if(txtMessage!=''){obj.innerHTML=txtMessage;obj.style.visibility='visible';}else{obj.style.visibility='hidden';}obj.style.left=findBudgetPosX(objParentDiv)+'px';obj.style.top=findBudgetPosY(objParentDiv)+20+'px';}function StringBuffer(){this.buffer=[];}StringBuffer.prototype.append=function append(string){this.buffer.push(string);return this;};StringBuffer.prototype.toString=function toString(){return this.buffer.join("");};function showNBCLoading(){var spanLoadImg=document.getElementById("nbcLoading");if(spanLoadImg){spanLoadImg.style.display="";}}function hideNBCLoading(){var spanLoadImg=document.getElementById("nbcLoading");if(spanLoadImg){spanLoadImg.style.display="none";}}function showLoadingImages(){document.body.scrollTop=0;var divLoadImg=document.getElementById("divLoadingImg");if(isSafari){divLoadImg.style.left=screen.width/2+"px";divLoadImg.style.top=screen.height/2+"px";}else{divLoadImg.style.left=(screen.width-document.getElementById("divLoadingImg").offsetWidth)/2+"px";divLoadImg.style.top=(screen.height/2-document.getElementById("divLoadingImg").offsetHeight)-200+"px";}divLoadImg.style.display="";return;}function hideLoadingImages(){var divLoadImg=document.getElementById("divLoadingImg");divLoadImg.style.display="none";}function showProcessingImages(){document.body.scrollTop=0;var divLoadImg=document.getElementById("divProcessingImg");if(divLoadImg){if(isSafari){divLoadImg.style.left=(screen.width/2)+"px";divLoadImg.style.top=screen.height/2+"px";}else{divLoadImg.style.left=(screen.width/2)-100+"px";divLoadImg.style.top=(screen.height/2-document.getElementById("divProcessingImg").offsetHeight)-200+"px";}divLoadImg.style.display="";}return;}function hideProcessingImages(){var divLoadImg=document.getElementById("divProcessingImg");divLoadImg.style.display="none";}function showloadingForPopup(){if(document.getElementById("AB_overlay")){var divLoadImg=document.getElementById("divABOverlayLoadingImg");}else{var divLoadImg=document.getElementById("divOverlayLoadingImg");}divLoadImg.style.display="";return;}function hideloadingForPopup(){if(document.getElementById("AB_overlay")){var divLoadImg=document.getElementById("divABOverlayLoadingImg");}else{var divLoadImg=document.getElementById("divOverlayLoadingImg");}divLoadImg.style.display="none";return;}function showloadingForFeedBackPopup(){var divLoadImg=document.getElementById("divOverlayLoadingImg");divLoadImg.style.display="";return;}function hideloadingForFeedBackPopup(){var divLoadImg=document.getElementById("divOverlayLoadingImg");divLoadImg.style.display="none";return;}function showloadingForPopupItinerary(){var divLoadImg=document.getElementById("divABOverlayLoadingImg");divLoadImg.style.display="";return;}function hideloadingForPopupItinerary(){var divLoadImg=document.getElementById("divABOverlayLoadingImg");divLoadImg.style.display="none";return;}function setpagevalues(startLocation,id,starttime,endtime,travellercount,travellerpriority,arrivaldate,departuredate,transportationid,arrival_airporttype,departure_airportType,airportname,transportationstr,global_location,groupid,splInterestList,isFromCookie){if(gbl_startingType=="quicktrip"){}else{}if(isFromCookie!=0){gblPreviousStartLocationName=airportname;}global_start_location=startLocation;global_airportid=id;global_starttime=starttime;global_endtime=endtime;global_nooftravellers=travellercount;global_travellerpriority=travellerpriority;global_arrivaldate=arrivaldate;global_departuredate=departuredate;global_travel_priority=transportationid;global_arrival_airporttype=arrival_airporttype;global_departure_airporttype=departure_airportType;gbl_attractionFromLocationId=global_location;gbl_attractionCurrentLocationId=global_location;if(startLocation==0){global_startingLocationName=airportname;gbl_startingLocationType="airport";gbl_startingType="quicktrip";gblIsStartedWithCountry=false;}else if(startLocation==1){global_startingLocationName=airportname;global_arrival_airporttype="";global_departure_airporttype="";gbl_startingLocationType="city";gbl_startingType="quicktrip";}else if(startLocation==3){global_startingLocationName=airportname;global_arrival_airporttype="";global_departure_airporttype="";gbl_startingLocationType="country";gbl_startingLocationType="city";gbl_startingType="vacation";}else if(startLocation==4){global_startingLocationName=airportname;global_arrival_airporttype="";global_departure_airporttype="";gbl_startingLocationType="country";gbl_startingType="vacation";}global_groupid=groupid;global_splInterestList=splInterestList;var yyyy=global_arrivaldate.split("/")[2];var mm=global_arrivaldate.split("/")[0];var dd=global_arrivaldate.split("/")[1];var arrivalDate=new Date(parseInt(yyyy),parseInt(extractNumber(mm))-1,parseInt(extractNumber(dd)));global_arrival_date_day=parseInt(arrivalDate.getDay())+1;var timeFragment=starttime.split(":")[0];if(timeFragment!=""){if(timeFragment.substring(0,1)=="0"){timeFragment=timeFragment.substring(1);}var startTimeHr=parseInt(timeFragment);timeFragment=starttime.split(":")[1];if(timeFragment.substring(0,1)=="0"){timeFragment=timeFragment.substring(1);}var startTimeMn=parseInt(timeFragment);timeFragment=endtime.split(":")[0];if(timeFragment.substring(0,1)=="0"){timeFragment=timeFragment.substring(1);}var endTimeHr=parseInt(timeFragment);timeFragment=endtime.split(":")[1];if(timeFragment.substring(0,1)=="0"){timeFragment=timeFragment.substring(1);}}var endTimeMn=parseInt(timeFragment);globalStartDate=new Date(parseInt(yyyy),parseInt(extractNumber(mm))-1,parseInt(extractNumber(dd)));globalStartDate.setHours(startTimeHr);globalStartDate.setMinutes(startTimeMn);globalStartDate.setSeconds(0);var yyyy=global_departuredate.split("/")[2];var mm=global_departuredate.split("/")[0];var dd=global_departuredate.split("/")[1];globalEndDate=new Date(parseInt(yyyy),parseInt(extractNumber(mm))-1,parseInt(extractNumber(dd)));globalEndDate.setHours(endTimeHr);globalEndDate.setMinutes(endTimeMn);globalEndDate.setSeconds(0);global_slotStartDateTime=globalStartDate;global_slotEndDateTime=globalEndDate;try{global_TotalNumSlots=createItineraryTimeSlots(global_slotStartDateTime,global_slotEndDateTime);}catch(err){}var one_hour=1000*60*60;global_actual_num_ipSlots=Math.ceil((globalEndDate.getTime()-globalStartDate.getTime())/(one_hour));global_num_ipSlots=global_actual_num_ipSlots;globalIncomingTransitDelayInMin=0;globalOutgoingTransitDelayInMin=0;try{setDurationDates();}catch(err){}}function checkItineraryItems(prevStartDateTime,currentStartDateTime,prevEndDateTime,currentEndDateTime,CityID,arrivaltype_value,departuretype_value){alert("in fun checkItineraryItems");var frmobj=document.frmdisplaypanel3;if(global_CityInfoObj.CityStartdate){var prevStartDate=global_CityInfoObj.CityStartdate;var prevEndDate=global_CityInfoObj.CityEnddate;var prevStartTime=global_CityInfoObj.CityArrivalTime;var prevEndTime=global_CityInfoObj.CityDepartTime;var currStartDateTime=new Date(frmobj.arrivaldate.value);currStartDateTime.setHours(frmobj.starttime.value.split(":")[0]);currStartDateTime.setMinutes(frmobj.starttime.value.split(":")[1]);currStartDateTime.setSeconds(0);currStartDateTime=currStartDateTime.getTime();var currEndDateTime=new Date(frmobj.departuredate.value);currEndDateTime.setHours(frmobj.endtime.value.split(":")[0]);currEndDateTime.setMinutes(frmobj.endtime.value.split(":")[1]);currEndDateTime.setSeconds(0);currEndDateTime=currEndDateTime.getTime();var prevStartDateTime=new Date(prevStartDate);prevStartDateTime.setHours(prevStartTime.split(":")[0]);prevStartDateTime.setMinutes(prevStartTime.split(":")[1]);prevStartDateTime.setSeconds(0);prevStartDateTime=prevStartDateTime.getTime();var prevEndDateTime=new Date(prevEndDate);prevEndDateTime.setHours(prevEndTime.split(":")[0]);prevEndDateTime.setMinutes(prevEndTime.split(":")[1]);prevEndDateTime.setSeconds(0);prevEndDateTime=prevEndDateTime.getTime();for(var pCnt=0;pCnt<gbl_VacationCityPlanner.length;pCnt++){var plannerStartDateTime=new Date(gbl_VacationCityPlanner[pCnt].CityStartdate);plannerStartDateTime.setHours(gbl_VacationCityPlanner[pCnt].CityArrivalTime.split(":")[0]);plannerStartDateTime.setMinutes(gbl_VacationCityPlanner[pCnt].CityArrivalTime.split(":")[1]);plannerStartDateTime.setSeconds(0);var plannerEndDateTime=new Date(gbl_VacationCityPlanner[pCnt].CityEnddate);plannerEndDateTime.setHours(gbl_VacationCityPlanner[pCnt].CityDepartTime.split(":")[0]);plannerEndDateTime.setMinutes(gbl_VacationCityPlanner[pCnt].CityDepartTime.split(":")[1]);plannerEndDateTime.setSeconds(0);if(currStartDateTime==plannerStartDateTime.getTime()&&currEndDateTime==plannerEndDateTime.getTime()&&frmobj.drpCity_vacation.value==gbl_VacationCityPlanner[pCnt].CityName){return true;}}if((currEndDateTime<=prevEndDateTime||currStartDateTime<=prevEndDateTime)){return serachInItineraryItemsArr(currStartDateTime,currEndDateTime,false);}}return true;}function searchMultiCityItineraryItems(currStartDateTime,currEndDateTime,alertFlag,cityID){for(var itineraryCnt=0;itineraryCnt<itineraryItemsArrGlobal.length;itineraryCnt++){if(itineraryItemsArrGlobal[itineraryCnt].itemSaveFlag!=ITEM_DEL){currentItineraryItemStartDate=itineraryItemsArrGlobal[itineraryCnt].slotStartDateTime.getTime();currentItineraryItemEndDate=itineraryItemsArrGlobal[itineraryCnt].slotEndDateTime.getTime();if(isEditItinerary){if(currentItineraryItemStartDate>=currStartDateTime&&currentItineraryItemEndDate<=currEndDateTime&&itineraryItemsArrGlobal[itineraryCnt].cityId!=cityID){if(!alertFlag){alert("Changing the city for this period may affect planned activities, please review and make any required adjustments.");}return false;}}else{if(global_start_location==3&&currentItineraryItemStartDate<currStartDateTime&&itineraryItemsArrGlobal[itineraryCnt].cityId==cityID){if(!alertFlag){alert("Changing the time period spent in this city may affect planned activities, please review and make any required adjustments.");}return false;}else if(global_start_location==3&&currentItineraryItemEndDate>currEndDateTime&&itineraryItemsArrGlobal[itineraryCnt].cityId==cityID){if(!alertFlag){alert("Changing the time period spent in this city may affect planned activities, please review and make any required adjustments.");}return false;}}}}return true;}function serachInItineraryItemsArr(currStartDateTime,currEndDateTime,alertFlag,cityID){for(var itineraryCnt=0;itineraryCnt<itineraryItemsArrGlobal.length;itineraryCnt++){if(itineraryItemsArrGlobal[itineraryCnt].itemSaveFlag!=ITEM_DEL){currentItineraryItemStartDate=itineraryItemsArrGlobal[itineraryCnt].slotStartDateTime.getTime();currentItineraryItemEndDate=itineraryItemsArrGlobal[itineraryCnt].slotEndDateTime.getTime();if(((currentItineraryItemStartDate>currStartDateTime.getTime()&&currentItineraryItemEndDate<currStartDateTime.getTime())||(currentItineraryItemEndDate>=currEndDateTime.getTime()&&currentItineraryItemEndDate>currStartDateTime.getTime()))){if(!alertFlag){alert("Changing the time period spent in this city may affect planned activities, please review and make any required adjustments.");}return false;}else if(currentItineraryItemEndDate<currStartDateTime.getTime()&&currentItineraryItemEndDate>currEndDateTime.getTime()){if(!alertFlag){alert("Changing the time period spent in this city may affect planned activities, please review and make any required adjustments.");}return false;}else if(currentItineraryItemEndDate<currStartDateTime.getTime()){if(!alertFlag){alert("Changing the time period spent in this city may affect planned activities, please review and make any required adjustments.");}return false;}}}return true;}function checkCityFormValues(displayPanelFormId){gbl_mapFlag=0;var CityTripCurrency,CityCountry;var frmobj=document.forms[displayPanelFormId];var currentCityName="";gbl_arrAllLocationsNBC=new Array();gbl_arrLocationsNBC=new Array();gbl_arrAllTravelDetailsNBC=new Array();gbl_arrTransportPricesNBC=new Array();arrTravelDetailsNBC=new Array();gbl_arrAllNearByCities=new Array();addressDetailObjNBC=new Array();gbl_renderNBC=false;gbl_isNBCclicked=false;gblObjLocationRestaurantNBC=new Array();gbl_fromNBC=false;gblObjLocationRestaurant=new Array();gbl_checkPlanNowClicked=true;if((frmobj.drpCityAirport.value==""||frmobj.drpCityAirport.value=="Airport/City/Country")){alert("Please select airport/city/Country");frmobj.drpCityAirport.value="";frmobj.drpCityAirport.focus();return(false);}currentCityName=frmobj.drpCityAirport.value;currentCityName=findCityName(currentCityName);CityTripCurrency=frmobj.currency.value;if(frmobj.arrivaldate.value==""){alert("Please select the date of arrival");frmobj.arrivaldate.focus();return(false);}if(frmobj.departuredate.value==""){alert("Please select the date of departure");frmobj.departuredate.focus();return(false);}if(frmobj.txtTravelerCount.value==""){alert("Please enter traverler count");frmobj.txtTravelerCount.focus();return(false);}if(frmobj.starttime.value==""){alert("Please select start time");frmobj.starttime.focus();return(false);}if(frmobj.endtime.value==""){alert("Please select end time");frmobj.endtime.focus();return(false);}var arrivalDate=new Date(frmobj.arrivaldate.value.split("/")[2],parseInt(extractNumber(frmobj.arrivaldate.value.split("/")[0]))-1,extractNumber(frmobj.arrivaldate.value.split("/")[1]));var departureDate=new Date(frmobj.departuredate.value.split("/")[2],parseInt(extractNumber(frmobj.departuredate.value.split("/")[0]))-1,extractNumber(frmobj.departuredate.value.split("/")[1]));var currentDate=new Date();var sysDate=new Date(currentDate.getFullYear(),currentDate.getMonth(),currentDate.getDate());if((frmobj.arrivaldate.value==""||arrivalDate<sysDate)&&gbl_ItineraryId==0){alert("Arrival date should be equal to or greater than todays date");return(false);}if((frmobj.departuredate.value==""||departureDate<sysDate)&&gbl_ItineraryId==0){alert("Deparature date should be equal to or greater than todays date");return(false);}if(arrivalDate>departureDate){alert("Your departure must occur after your arrival, please check your dates");return(false);}var arrivalHR=frmobj.starttime.value.substring(0,2);var arrivalMM=frmobj.starttime.value.substring(3,5);if((!(arrivalDate<sysDate)&&!(arrivalDate>sysDate)&&((arrivalHR<currentDate.getHours())||((arrivalHR==currentDate.getHours())&&arrivalMM<=currentDate.getMinutes())))&&gbl_ItineraryId==0){alert("Arrival time should be equal to or greater than the current time");return(false);}var departureHR=frmobj.endtime.value.substring(0,2);var departureMM=frmobj.endtime.value.substring(3,5);if((!(arrivalDate<departureDate)&&!(arrivalDate>departureDate)&&((arrivalHR>departureHR)||((arrivalHR==departureHR)&&arrivalMM>=departureMM)))&&gbl_ItineraryId==0){alert("Your departure must occur after your arrival, please check your times");return(false);}else{var PlannerTripCurrency=frmobj.currency.value;getExchangeRate(PlannerTripCurrency);if(frmobj){if(PlannerTripCurrency==-1){gbl_userPrefCurrencyDetails=null;gbl_currentCurrencyDetails=null;}}var transportationstr="";var trippriority=frmobj.itemFilter.value;var splInterestList=frmobj.InterestFilter.value;gbl_splInterestGroupChosen=splInterestList;var startLocation="";gblTravelPriorityIndex=0;if(global_airportorcity_uri&&global_airportorcity_uri!=""){global_airportorcity=global_airportorcity_uri.split("/")[2];if(global_airportorcity=="undefined"){global_airportorcity=global_airportid;}}else{global_airportorcity=0;}var selectedCityName="";checkcontents();startLocation=global_start_location;if(startLocation!=4){var destName=frmobj.drpCityAirport.value.split(",")[0];if(frmobj.arrivaldate.value!=global_CityAirportInfoObj["Startdate"]||frmobj.departuredate.value!=global_CityAirportInfoObj["Enddate"]||frmobj.starttime.value!=global_CityAirportInfoObj["ArrivalTime"]||frmobj.endtime.value!=global_CityAirportInfoObj["DepartTime"]||!destName.match(global_CityAirportInfoObj["Name"])||gblPreviousStartLocationName!=destName){currStartDateTime=new Date(frmobj.arrivaldate.value);currStartDateTime.setHours(frmobj.starttime.value.split(":")[0]);currStartDateTime.setMinutes(frmobj.starttime.value.split(":")[1]);currEndDateTime=new Date(frmobj.departuredate.value);currEndDateTime.setHours(frmobj.endtime.value.split(":")[0]);currEndDateTime.setMinutes(frmobj.endtime.value.split(":")[1]);var prevStartDateTime=new Date(global_CityAirportInfoObj["Startdate"]);prevStartDateTime.setHours(global_CityAirportInfoObj["ArrivalTime"].split(":")[0]);prevStartDateTime.setMinutes(global_CityAirportInfoObj["ArrivalTime"].split(":")[1]);var prevEndDateTime=new Date(global_CityAirportInfoObj["Enddate"]);prevEndDateTime.setHours(global_CityAirportInfoObj["DepartTime"].split(":")[0]);prevEndDateTime.setMinutes(global_CityAirportInfoObj["DepartTime"].split(":")[1]);if((currStartDateTime.getTime()>=prevEndDateTime.getTime()||currEndDateTime.getTime()<=prevStartDateTime.getTime())&&itineraryItemsArrGlobal.length>0){var searchRes=false;}else{var searchRes=serachInItineraryItemsArr(currStartDateTime,currEndDateTime,true);}if(!searchRes||!frmobj.drpCityAirport.value.match(global_CityAirportInfoObj["Name"])||frmobj.drpCityAirport.value.match(gblPreviousDestination.name)){var itiResult=checkItinerarySaved('');if(!itiResult){gblUserActionBeforeSave="Airport";return;}itineraryItemsArrGlobal=new Array();shortListItemsArrGlobal=new Array();gbl_arrAllCustomHotels=new Array();gbl_arrAllAppointment=new Array();gblItineraryName="";gblUserEmail="";gblItineraryAction="";gbl_ItineraryId=0;global_itinraryID=0;try{itineraryItemsArrGlobal[-1]=0;}catch(err){}}}}executePlanNowReqeust();}}function executePlanNowReqeust(){var frmobj=document.forms['frmdisplaypanel'];var currentCityName=frmobj.drpCityAirport.value;var transportationstr="";var trippriority=frmobj.itemFilter.value;var splInterestList=frmobj.InterestFilter.value;var PlannerTripCurrency=frmobj.currency.value;currentCityName=findCityName(currentCityName);var arrivaltype_value=rdo_arrival_airporttype_value="Domestic",departuretype_value=rdo_departure_airporttype_value="Domestic";global_arrival_airporttype=rdo_arrival_airporttype_value;global_departure_airporttype=rdo_departure_airporttype_value;if(frmobj.starttime.value!=global_starttime||frmobj.endtime.value!=global_endtime||frmobj.departuredate.value!=global_departuredate||frmobj.arrivaldate.value!=global_arrivaldate){gbl_objAirportLocation=null;gbl_objTimeLocation=null;gbl_objArrBudget=null;gbl_popularObj=null;gbl_interestsObj=null;gbl_objLocationLogisticals=new Array();gblAttractionAvailabilityChecked=false;}if(global_airportorcity=="undefined"){global_airportorcity=global_airportid;}if(!gblIsAirportExists){checkcontents();}startLocation=global_start_location;var airportCountry="";var dafaultTransportCost=AirportCityId=0;var airportId;var aName="",tripStartType;var airIndex=searchAirportItem(gbl_AirportList,frmobj.drpCityAirport.value);if(airIndex!=-1){tripStartType=0;selectedCityName=frmobj.drpCityAirport.value;airportCountry=gbl_AirportList[airIndex].AirportCountry;airportId=gbl_AirportList[airIndex].AirportId;AirportCityId=gbl_AirportList[airIndex].AirportCityId;dafaultTransportCost=gbl_AirportList[airIndex].TransportCost;}else if(airIndex==-1){tripStartType=1;selectedCityName=currentCityName;airIndex=searchItem(gbl_CityList,selectedCityName,true,"cityDetails");if(airIndex!=-1){airportCountry=gbl_CityList[airIndex].CityCountry;AirportCityId=gbl_CityList[airIndex].CityId;airportId=gbl_CityList[airIndex].CityId;defaultCityTransportCost=gbl_CityList[airIndex].TransportCost;}if(airIndex==-1){tripStartType=2;if(airIndex!=-1){gbl_arrMCountries[gbl_arrMCountries.length]=new CLSMultiCountries(gbl_CountryList[airIndex].Id,gbl_CountryList[airIndex].Name);for(var vacationCnt=0;vacationCnt<gbl_arrAllVacationCountry.length;vacationCnt++){if(gbl_arrAllVacationCountry[vacationCnt].countryName==gbl_CountryList[airIndex].Name&&gbl_arrAllVacationCountry[vacationCnt].dataFetched==true){isCountryExists=true;gbl_arrCountries=gbl_arrAllVacationCountry[vacationCnt].countryObj;gbl_arrAllCities=gbl_arrAllVacationCountry[vacationCnt].cityObj;gbl_arrRegions=gbl_arrAllVacationCountry[vacationCnt].regionObj;gbl_arrAllAttractions=gbl_arrAllVacationCountry[vacationCnt].attractionsObj;gbl_arrAllHotels=gbl_arrAllVacationCountry[vacationCnt].hotelsObj;gbl_arrAllLogisticals=gbl_arrAllVacationCountry[vacationCnt].logisticalsObj;gbl_arrAllImages=gbl_arrAllVacationCountry[vacationCnt].imagesObj;gbl_arrHotelServices=gbl_arrAllVacationCountry[vacationCnt].hotelServicesObj;break;}}global_airportorcity=gbl_CountryList[airIndex].Id;}}}if(!gblIsAirportPresent){alert("'"+frmobj.drpCityAirport.value+"' is not a destination we cover at this time, please choose another destination");gblIsAirportExists=false;gblIsAirportPresent=false;return false;}else{showLoadingImages();if(tripStartType!=2){global_CityAirportInfoObj=new CLSCityAirportInfo(frmobj.starttime.value,frmobj.endtime.value,frmobj.txtTravelerCount.value,airportId,selectedCityName,frmobj.arrivaldate.value,frmobj.departuredate.value,frmobj.Group.value,global_location,AirportCityId,airportCountry,dafaultTransportCost,PlannerTripCurrency,tripStartType,'');}else{global_CountryInfoObj=new CLSCountryInfo(frmobj.starttime.value,frmobj.endtime.value,frmobj.txtTravelerCount.value,gbl_CountryList[airIndex].Id,gbl_CountryList[airIndex].Name,frmobj.arrivaldate.value,frmobj.departuredate.value,frmobj.Group.value,'','','',PlannerTripCurrency);}TAXI_RATE_LOW=dafaultTransportCost;if(global_CityAirportInfoObj&&global_CityAirportInfoObj["CityID"]){gblAirportCityName=getAirportCityNameByAirportId(global_CityAirportInfoObj["CityID"]);}setpagevalues(startLocation,airportId,frmobj.starttime.value,frmobj.endtime.value,frmobj.txtTravelerCount.value,frmobj.itemFilter.value,frmobj.arrivaldate.value,frmobj.departuredate.value,global_travel_priority,arrivaltype_value,departuretype_value,selectedCityName,transportationstr,global_location,frmobj.Group.value,splInterestList,1);var cookieUri="CookieStorageController.php?startLocation="+startLocation;cookieUri+="&ArrivalTime="+frmobj.starttime.value;cookieUri+="&DepartTime="+frmobj.endtime.value;cookieUri+="&TravelerCount="+frmobj.txtTravelerCount.value;cookieUri+="&ID="+AirportCityId;cookieUri+="&Name="+encodeURI(selectedCityName);cookieUri+="&Startdate="+frmobj.arrivaldate.value;cookieUri+="&Enddate="+frmobj.departuredate.value;cookieUri+="&Room="+frmobj.Group.value;cookieUri+="&LocationID="+global_location;cookieUri+="&TripCurrency="+PlannerTripCurrency;cookieUri+="&RequestType="+COOKIE_STORE;SendRequest(cookieUri,"post","cookieInfoStorage");tmpArrivalDate=frmobj.arrivaldate.value;tmpDepartureDate=frmobj.departuredate.value;tmpArrivalDate=frmobj.arrivaldate.value.split("/")[2]+"-"+frmobj.arrivaldate.value.split("/")[0]+"-"+frmobj.arrivaldate.value.split("/")[1];tmpDepartureDate=frmobj.departuredate.value.split("/")[2]+"-"+frmobj.departuredate.value.split("/")[0]+"-"+frmobj.departuredate.value.split("/")[1];gblIsAirportExists=false;gblIsAirportPresent=false;if(startLocation!=4){handleEvent("homepage_ibtnsketchnow");}else{handleEvent("landingPage_sketchnow");}}return;}function resetallBudgetItems(){gbl_budgetfrmValidate=true;var defaultdate=getFormatedDate(budgetCurrentDate);document.budgetPlannerfrm.currency.value=gbl_usdDropDownValue;if(global_CityAirportInfoObj["CityID"]!=''){if(global_CityAirportInfoObj["TravelerCount"]&&global_CityAirportInfoObj["TravelerCount"]!=""){document.budgetPlannerfrm.no_travelers.value=global_CityAirportInfoObj["TravelerCount"];}if(global_CityAirportInfoObj["Startdate"]&&global_CityAirportInfoObj["Startdate"]!=""){var budgetDt=new Date(document.budgetPlannerfrm.arival_date.value);var savedDt=new Date(global_CityAirportInfoObj["Startdate"]);if(budgetDt<savedDt){document.budgetPlannerfrm.arival_date.value=global_CityAirportInfoObj["Startdate"];}}if(global_CityAirportInfoObj["Enddate"]&&global_CityAirportInfoObj["Enddate"]!=""){var ONE_DAY=1000*60*60*24;var noOFDays=((new Date(global_CityAirportInfoObj["Enddate"])).getTime()-(new Date(global_CityAirportInfoObj["Startdate"])).getTime())/ONE_DAY;noOFDays=noOFDays+1;document.budgetPlannerfrm.stay_for.value=noOFDays;}if(gblTravelPriorityIndex==1){document.budgetPlannerfrm.transport.value=8;}else{document.budgetPlannerfrm.transport.value=7;}document.budgetPlannerfrm.rooms.value=global_CityAirportInfoObj["Group"];for(var cCnt=0;cCnt<gblArr_allCurrencyExRates.length;cCnt++){if(gblArr_allCurrencyExRates[cCnt].currencyId==global_CityAirportInfoObj["TripCurrency"]){global_currency_symbol=gblArr_allCurrencyExRates[cCnt].currencysymbol;global_exchange_rate=gblArr_allCurrencyExRates[cCnt].exchangerate;global_currency_code=gblArr_allCurrencyExRates[cCnt].currencycode;if(!global_currency_symbol){global_currency_symbol=global_currency_code;}break;}}document.budgetPlannerfrm.currency.value=global_CityAirportInfoObj["TripCurrency"];}else{var defaultdate=defaultdate.split("-")[1]+'/'+defaultdate.split("-")[2]+'/'+defaultdate.split("-")[0];document.budgetPlannerfrm.no_travelers.value=1;document.budgetPlannerfrm.stay_for.value=1;document.budgetPlannerfrm.arival_date.value=defaultdate;document.budgetPlannerfrm.rooms.value=1;document.budgetPlannerfrm.transport.value=PublicTransport_pid;global_currency_symbol='$';global_currency_code="USD";global_exchange_rate=parseFloat(1.00);}document.budgetPlannerfrm.lodging.value='2';document.budgetPlannerfrm.dining.value='2';lodgingActive=true;document.budgetPlannerfrm.lodging_checkbox.checked='true';document.budgetPlannerfrm.lodging_dc.disabled="";document.budgetPlannerfrm.lodging_tc.disabled="";document.getElementById('lodgingComments').innerHTML="";document.budgetPlannerfrm.txtLodgingComments.value="";diningActive=true;document.budgetPlannerfrm.dining_checkbox.checked='true';document.budgetPlannerfrm.dining_dc.disabled="";document.budgetPlannerfrm.dining_tc.disabled="";document.getElementById('dinningComments').innerHTML="";document.budgetPlannerfrm.txtDinningComments.value="";shoppingActive=true;document.budgetPlannerfrm.shopping_checkbox.checked='true';document.budgetPlannerfrm.shopping_dc.disabled="";document.budgetPlannerfrm.shopping_tc.disabled="";document.getElementById('shoppingComments').innerHTML="";document.budgetPlannerfrm.txtShoppingComments.value="";garoundActive=true;document.budgetPlannerfrm.garound_checkbox.checked='true';document.budgetPlannerfrm.garound_dc.disabled="";document.budgetPlannerfrm.garound_tc.disabled="";document.getElementById('TransportComments').innerHTML="";document.budgetPlannerfrm.txtTransportComments.value="";sightActive=true;document.budgetPlannerfrm.sight_checkbox.checked='true';document.budgetPlannerfrm.sight_dc.disabled="";document.budgetPlannerfrm.sight_tc.disabled="";document.getElementById('sightseeingComments').innerHTML="";document.budgetPlannerfrm.txtSightseeingComments.value="";ementActive=true;document.budgetPlannerfrm.ement_checkbox.checked='true';document.budgetPlannerfrm.ement_dc.disabled="";document.budgetPlannerfrm.ement_tc.disabled="";document.getElementById('enterainmentComments').innerHTML="";document.budgetPlannerfrm.txtEnterainmentComments.value="";gettingActive=true;document.budgetPlannerfrm.getting_checkbox.checked='true';document.budgetPlannerfrm.getting_tc.disabled="";misceActive=true;document.budgetPlannerfrm.misce_checkbox.checked='true';document.budgetPlannerfrm.misce_dc.disabled="";document.budgetPlannerfrm.misce_tc.disabled="";document.budgetPlannerfrm.lodging_dc.value='0.00';document.budgetPlannerfrm.lodging_dc_display.value='0.00';document.budgetPlannerfrm.dining_dc.value='0.00';document.budgetPlannerfrm.dining_dc_display.value='0.00';document.budgetPlannerfrm.shopping_dc.value='0.00';document.budgetPlannerfrm.shopping_dc_display.value='0.00';document.budgetPlannerfrm.garound_dc.value='0.00';document.budgetPlannerfrm.garound_dc_display.value='0.00';document.budgetPlannerfrm.sight_dc.value='0.00';document.budgetPlannerfrm.sight_dc_display.value='0.00';document.budgetPlannerfrm.ement_dc.value='0.00';document.budgetPlannerfrm.ement_dc_display.value='0.00';document.budgetPlannerfrm.misce_dc.value='0.00';document.budgetPlannerfrm.misce_dc_display.value='0.00';document.getElementById('cpd').innerHTML='0.00';document.budgetPlannerfrm.lodging_tc.value='0.00';document.budgetPlannerfrm.dining_tc.value='0.00';document.budgetPlannerfrm.shopping_tc.value='0.00';document.budgetPlannerfrm.garound_tc.value='0.00';document.budgetPlannerfrm.sight_tc.value='0.00';document.budgetPlannerfrm.ement_tc.value='0.00';document.budgetPlannerfrm.getting_tc.value='0.00';document.budgetPlannerfrm.getting_tc_display.value='0.00';document.budgetPlannerfrm.misce_tc.value='0.00';document.getElementById('tc').innerHTML='0.00';document.getElementById('displayCurrencyRate').innerHTML='';document.getElementById('displayTransportCost').innerHTML='';}function getItemCost(itemCostType,cityPartcularsIndex,ItemIndex){if(cityPartcularsIndex==1){var cost,frmdate,todate,arivalDate,LLS_frmdate,LLS_todate,LLS_frmdateTime,LLS_todateTime,arivalDateTime,cond1,cond2;var firstCond=new Boolean(false);var secondCond=new Boolean(false);gblLodgingComments="";arivalDate=document.budgetPlannerfrm.arival_date.value;var arrivalYear=arivalDate.split("/")[2];arivalDate=new Date(arivalDate.split("/")[2],parseInt(extractNumber(arivalDate.split("/")[0]))-1,extractNumber(arivalDate.split("/")[1]));arivalDateTime=arivalDate.getTime();LLS_frmdate=arrCityBudgetParticulars[ItemIndex].cityParticulars[cityPartcularsIndex].frmdate;LLS_todate=arrCityBudgetParticulars[ItemIndex].cityParticulars[cityPartcularsIndex].todate;LLS_frmdate=new Date(arrivalYear,parseInt(extractNumber(LLS_frmdate.split("-")[1]))-1,extractNumber(LLS_frmdate.split("-")[2]));LLS_todate=new Date(arrivalYear,parseInt(extractNumber(LLS_todate.split("-")[1]))-1,extractNumber(LLS_todate.split("-")[2]));LLS_frmdateTime=LLS_frmdate.getTime();LLS_todateTime=LLS_todate.getTime();cond1=(arivalDateTime>=LLS_frmdateTime&&arivalDateTime<=LLS_todateTime);var cond3=(LLS_todateTime<LLS_frmdateTime&&(arivalDateTime<LLS_todateTime||arivalDateTime>LLS_frmdateTime));if(cond1||cond3){firstCond=true;}if(firstCond==false){LLS_frmdate=arrCityBudgetParticulars[ItemIndex].cityParticulars[8].frmdate;LLS_todate=arrCityBudgetParticulars[ItemIndex].cityParticulars[8].todate;LLS_frmdate=new Date(arrivalYear,parseInt(extractNumber(LLS_frmdate.split("-")[1]))-1,extractNumber(LLS_frmdate.split("-")[2]));LLS_todate=new Date(arrivalYear,parseInt(extractNumber(LLS_todate.split("-")[1]))-1,extractNumber(LLS_todate.split("-")[2]));LLS_frmdateTime=LLS_frmdate.getTime();LLS_todateTime=LLS_todate.getTime();cond2=(arivalDateTime>=LLS_frmdateTime&&arivalDateTime<=LLS_todateTime);var cond4=(LLS_todateTime<LLS_frmdateTime&&(arivalDateTime<LLS_todateTime||arivalDateTime>LLS_frmdateTime));if(cond2||cond4){secondCond=true;}}switch(itemCostType){case'Budget':if(firstCond===true){cost=arrCityBudgetParticulars[ItemIndex].cityParticulars[cityPartcularsIndex].budgetCost;gblLodgingComments=arrCityBudgetParticulars[ItemIndex].cityParticulars[cityPartcularsIndex].Comments;}else if(secondCond===true){cost=arrCityBudgetParticulars[ItemIndex].cityParticulars[8].budgetCost;gblLodgingComments=arrCityBudgetParticulars[ItemIndex].cityParticulars[8].Comments;}else{cost=0.00;}break;case'Expensive':if(firstCond===true){cost=arrCityBudgetParticulars[ItemIndex].cityParticulars[cityPartcularsIndex].expensiveCost;gblLodgingComments=arrCityBudgetParticulars[ItemIndex].cityParticulars[cityPartcularsIndex].Comments;}else if(secondCond===true){cost=arrCityBudgetParticulars[ItemIndex].cityParticulars[8].expensiveCost;gblLodgingComments=arrCityBudgetParticulars[ItemIndex].cityParticulars[8].Comments;}else{cost=0.00;}break;case'Moderate':if(firstCond===true){cost=arrCityBudgetParticulars[ItemIndex].cityParticulars[cityPartcularsIndex].moderateCost;gblLodgingComments=arrCityBudgetParticulars[ItemIndex].cityParticulars[cityPartcularsIndex].Comments;}else if(secondCond===true){cost=arrCityBudgetParticulars[ItemIndex].cityParticulars[8].moderateCost;gblLodgingComments=arrCityBudgetParticulars[ItemIndex].cityParticulars[8].Comments;}else{cost='0.00';}break;}}else{switch(itemCostType){case'Budget':cost=arrCityBudgetParticulars[ItemIndex].cityParticulars[cityPartcularsIndex].budgetCost;break;case'Expensive':cost=arrCityBudgetParticulars[ItemIndex].cityParticulars[cityPartcularsIndex].expensiveCost;break;case'Moderate':cost=arrCityBudgetParticulars[ItemIndex].cityParticulars[cityPartcularsIndex].moderateCost;break;}}return cost;}function fillCityParticulars(cityId,type){var cityParticularsObj="";var transportType='';var perticularDetails=new Array();gbl_budgetObj=new Array();var arival_date;var perticularId;var total_dc=0.00;var total_tc=0.00;var dc=0.00;var tc=0.00;transportCost=parseFloat(1.00);arr_pidDcTc=new Array();arr_pidDcTc[0]=-1;for(var lCnt=0;lCnt<arrCityBudgetParticulars.length;lCnt++){if((type=="City"&&arrCityBudgetParticulars[lCnt].cityId==cityId)||arrCityBudgetParticulars[lCnt].country.toLowerCase()==cityId.toLowerCase()){cityParticularsObj=arrCityBudgetParticulars[lCnt].cityParticulars;break;}}for(var k=0;k<gbl_userBudgetDetail.length;k++){if((type=="City"&&gbl_userBudgetDetail[k].cityid==cityId)||gbl_userBudgetDetail[k].country.toLowerCase()==cityId.toLowerCase()){var BudgetId=gbl_userBudgetDetail[k].BudgetId;var stayFor=gbl_userBudgetDetail[k].stayFor;var region=gbl_userBudgetDetail[k].region;var cityname=gbl_userBudgetDetail[k].cityname;var country=gbl_userBudgetDetail[k].country;var startDate=gbl_userBudgetDetail[k].startDate;var noOfTraveler=gbl_userBudgetDetail[k].noOfTraveler;var noOfRooms=gbl_userBudgetDetail[k].noOfRooms;var lodgingPref=gbl_userBudgetDetail[k].lodgingPref;var dinningPref=gbl_userBudgetDetail[k].dinningPref;var transport=parseInt(gbl_userBudgetDetail[k].transport);var Currency=gbl_userBudgetDetail[k].Currency;var currencySymbol=gbl_userBudgetDetail[k].currencySymbol;transportCost=gbl_userBudgetDetail[k].transportCost;perticularDetails=gbl_userBudgetDetail[k].perticularDetailsObj;var w=document.budgetPlannerfrm.currency.selectedIndex;global_currency_symbol=gbl_userBudgetDetail[k].currencySymbol;global_exchange_rate=gbl_userBudgetDetail[k].currencyExRate;global_currency_code=gbl_userBudgetDetail[k].currencyCode;if(!global_currency_symbol){global_currency_symbol=global_currency_code;}if(!global_currency_code){global_currency_code="USD";}var tempcode,oricode;for(var cnt=0;cnt<gblArr_allCurrencyExRates.length;cnt++){oricode=global_currency_code.toLowerCase();tempcode=gblArr_allCurrencyExRates[cnt].currencycode;tempcode=tempcode.toLowerCase();if(oricode==tempcode){gbl_userPrefCurrencyDetails=new CLSCurrencyDetails(gblArr_allCurrencyExRates[cnt].currencycode,gblArr_allCurrencyExRates[cnt].currencysymbol,gblArr_allCurrencyExRates[cnt].exchangerate,gblArr_allCurrencyExRates[cnt].lastupdate);break;}}if(Currency!=gbl_usdDropDownValue){document.getElementById('displayCurrencyRate').style.display='block';document.getElementById('displayCurrencyRate').innerHTML='';if(global_currency_update){document.getElementById('displayCurrencyRate').innerHTML='US Dollar Exchange Rate  $1 =  '+global_currency_symbol+(1/global_exchange_rate).toFixed(2)+' as of '+global_currency_update+' - Powered by <a href="http://www.timegenie.com/" target="_blank" title="foreign exchange rates courtesy of timegenie.com">timegenie.com</a></span>';}else{document.getElementById('displayCurrencyRate').innerHTML='US Dollar Exchange Rate  $1 =  '+global_currency_symbol+(1/global_exchange_rate).toFixed(2)+'- Powered by <a href="http://www.timegenie.com/" title="foreign exchange rates courtesy of timegenie.com" target="_blank">timegenie.com</a></span>';}}document.getElementById('cityHeader').style.display="block";var con=document.budgetPlannerfrm.Region.selectedIndex;var countryName=document.budgetPlannerfrm.Region.options[con].text;var yy=startDate.substr(0,4);var dd=startDate.substr(5,2);var mm=startDate.substr(8,2);var startDate=mm+'/'+dd+'/'+yy;global_currency_update=startDate;document.budgetPlannerfrm.arival_date.value=startDate;document.budgetPlannerfrm.stay_for.value=stayFor;document.budgetPlannerfrm.rooms.value=noOfRooms;document.budgetPlannerfrm.no_travelers.value=noOfTraveler;document.budgetPlannerfrm.lodging.value=lodgingPref;document.budgetPlannerfrm.dining.value=dinningPref;document.budgetPlannerfrm.transport.value=transport;document.budgetPlannerfrm.currency.value=Currency;var cityImageSrc=gbl_userBudgetDetail[k].imageSrc;var cityImageCre=gbl_userBudgetDetail[k].imageCre;for(c=1;c<=17;c++){document.getElementById('currencySymbol_'+c).innerHTML=global_currency_symbol;}var comments="";for(k=0;k<perticularDetails.length;k++){perticularId=perticularDetails[k].perticularId;dc=parseFloat(perticularDetails[k].dailyCost);tc=parseFloat(perticularDetails[k].tripCost);if(cityParticularsObj){for(var pCnt=1;pCnt<cityParticularsObj.length;pCnt++){comments="";if(perticularId==cityParticularsObj[pCnt].particularNodeId||(perticularId==GettingAround_pid&&transport==cityParticularsObj[pCnt].particularNodeId)){comments=cityParticularsObj[pCnt].Comments;break;}}}switch(parseInt(perticularId)){case Lodging_pid:document.budgetPlannerfrm.lodging_dc.className='budgetPlannerfrmInput';document.budgetPlannerfrm.lodging_dc.value=formatFloat(dc);document.budgetPlannerfrm.lodging_dc_display.value=formatFloat(dc);total_dc=parseFloat(total_dc+dc);total_tc=parseFloat(total_tc+tc);document.budgetPlannerfrm.lodging_tc.value=formatFloat(tc);if(comments&&comments!="null"){document.budgetPlannerfrm.txtLodgingComments.value=comments;document.getElementById('lodgingComments').innerHTML='<img id="budgetPerticularComment'+k+'" src="../Images/Theme-1/Budget/CommentIcon.png" onmouseout="setVisible(\'\',\'budgetPerticularComment'+k+'\')" onmouseover="setVisible(\''+comments+'\',\'budgetPerticularComment'+k+'\')"/>';}else{document.budgetPlannerfrm.txtLodgingComments.value=comments;document.getElementById('lodgingComments').innerHTML='';}arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Lodging_pid,gbl_perticularList[0],dc,tc,comments);break;case Dining_pid:document.budgetPlannerfrm.dining_dc.className='budgetPlannerfrmInput';document.budgetPlannerfrm.dining_dc.value=formatFloat(dc);document.budgetPlannerfrm.dining_dc_display.value=formatFloat(dc);total_dc=parseFloat(total_dc+dc);total_tc=parseFloat(total_tc+tc);document.budgetPlannerfrm.dining_tc.value=formatFloat(tc);if(comments&&comments!="null"){document.budgetPlannerfrm.txtDinningComments.value=comments;document.getElementById('dinningComments').innerHTML='<img id="budgetPerticularComment'+k+'" src="../Images/Theme-1/Budget/CommentIcon.png" onmouseout="setVisible(\'\',\'budgetPerticularComment'+k+'\')" onmouseover="setVisible(\''+comments+'\',\'budgetPerticularComment'+k+'\')"/>';}else{document.budgetPlannerfrm.txtDinningComments.value=comments;document.getElementById('dinningComments').innerHTML='';}arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Dining_pid,gbl_perticularList[1],dc,tc,comments);break;case Sightseeing_pid:document.budgetPlannerfrm.sight_dc.className='budgetPlannerfrmInput';document.budgetPlannerfrm.sight_dc.value=formatFloat(dc);document.budgetPlannerfrm.sight_dc_display.value=formatFloat(dc);total_dc=parseFloat(total_dc+dc);total_tc=parseFloat(total_tc+tc);document.budgetPlannerfrm.sight_tc.value=formatFloat(tc);if(comments&&comments!="null"){document.budgetPlannerfrm.txtSightseeingComments.value=comments;document.getElementById('sightseeingComments').innerHTML='<img id="budgetPerticularComment'+k+'" src="../Images/Theme-1/Budget/CommentIcon.png" onmouseout="setVisible(\'\',\'budgetPerticularComment'+k+'\')" onmouseover="setVisible(\''+comments+'\',\'budgetPerticularComment'+k+'\')"/>';}else{document.budgetPlannerfrm.txtSightseeingComments.value=comments;document.getElementById('sightseeingComments').innerHTML='';}arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Sightseeing_pid,gbl_perticularList[3],dc,tc,comments);break;case Entertainment_pid:document.budgetPlannerfrm.ement_dc.className='budgetPlannerfrmInput';document.budgetPlannerfrm.ement_dc.value=formatFloat(dc);document.budgetPlannerfrm.ement_dc_display.value=formatFloat(dc);total_dc=parseFloat(total_dc+dc);total_tc=parseFloat(total_tc+tc);document.budgetPlannerfrm.ement_tc.value=formatFloat(tc);if(comments&&comments!="null"){document.budgetPlannerfrm.txtEnterainmentComments.value=comments;document.getElementById('enterainmentComments').innerHTML='<img id="budgetPerticularComment'+k+'" src="../Images/Theme-1/Budget/CommentIcon.png" onmouseout="setVisible(\'\',\'budgetPerticularComment'+k+'\')" onmouseover="setVisible(\''+comments+'\',\'budgetPerticularComment'+k+'\')"/>';}else{document.budgetPlannerfrm.txtEnterainmentComments.value=comments;document.getElementById('enterainmentComments').innerHTML='';}arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Entertainment_pid,gbl_perticularList[5],dc,tc,comments);break;case GettingAround_pid:document.budgetPlannerfrm.garound_dc.className='budgetPlannerfrmInput';document.budgetPlannerfrm.garound_dc.value=formatFloat(dc);document.budgetPlannerfrm.garound_dc_display.value=formatFloat(dc);total_dc=parseFloat(total_dc+dc);switch(transport){case PublicTransport_pid:transportType='Public Transport';break;case PrivateTransport_pid:transportType='Private Transport';break;}if(comments&&comments!="null"){document.budgetPlannerfrm.txtTransportComments.value=comments;document.getElementById('TransportComments').innerHTML='<img id="budgetPerticularComment'+k+'" src="../Images/Theme-1/Budget/CommentIcon.png" onmouseout="setVisible(\'\',\'budgetPerticularComment'+k+'\')" onmouseover="setVisible(\''+comments+'\',\'budgetPerticularComment'+k+'\')"/>';}else{document.budgetPlannerfrm.txtTransportComments.value=comments;document.getElementById('TransportComments').innerHTML='';}total_tc=parseFloat(total_tc+tc);document.budgetPlannerfrm.garound_tc.value=formatFloat(tc);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(GettingAround_pid,gbl_perticularList[4],dc,tc,'');break;case Shopping_pid:document.budgetPlannerfrm.shopping_dc.className='budgetPlannerfrmInput';document.budgetPlannerfrm.shopping_dc.value=formatFloat(dc);document.budgetPlannerfrm.shopping_dc_display.value=formatFloat(dc);total_dc=parseFloat(total_dc+dc);total_tc=parseFloat(total_tc+tc);document.budgetPlannerfrm.shopping_tc.value=formatFloat(tc);if(comments&&comments!="null"){document.budgetPlannerfrm.txtShoppingComments.value=comments;document.getElementById('shoppingComments').innerHTML='<img id="budgetPerticularComment'+k+'" src="../Images/Theme-1/Budget/CommentIcon.png" onmouseout="setVisible(\'\',\'budgetPerticularComment'+k+'\')" onmouseover="setVisible(\''+comments+'\',\'budgetPerticularComment'+k+'\')"/>';}else{document.budgetPlannerfrm.txtShoppingComments.value=comments;document.getElementById('shoppingComments').innerHTML='';}arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Shopping_pid,gbl_perticularList[2],dc,tc,comments);break;case GettingThere_pid:document.budgetPlannerfrm.getting_tc.className='budgetPlannerfrmInput';total_dc=parseFloat(total_dc+dc);total_tc=parseFloat(total_tc+tc);document.budgetPlannerfrm.getting_tc.value=formatFloat(tc);document.budgetPlannerfrm.getting_tc_display.value=formatFloat(tc);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(GettingThere_pid,gbl_perticularList[8],dc,tc,'');break;case Miscellaneous_pid:document.budgetPlannerfrm.misce_dc.className='budgetPlannerfrmInput';document.budgetPlannerfrm.misce_dc.value=formatFloat(dc);document.budgetPlannerfrm.misce_dc_display.value=formatFloat(dc);total_dc=parseFloat(total_dc+dc);total_tc=parseFloat(total_tc+tc);document.budgetPlannerfrm.misce_tc.value=formatFloat(tc);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Miscellaneous_pid,gbl_perticularList[9],dc,tc,'');break;}}if(cityImageSrc!=null){document.getElementById('budgetCityImage').src=imagepath+cityImageSrc;document.getElementById('budgetCityImage').style.display="";document.getElementById('budCityImageCreadit').innerHTML=cityImageCre;document.getElementById('budCityImageCreadit').style.display="";}else{document.getElementById('budgetCityImage').style.display="none";document.getElementById('budCityImageCreadit').style.display="none";}var cpd=parseFloat(total_dc).toFixed(2);var tripcost=parseFloat(total_tc).toFixed(2);document.getElementById('cpd').innerHTML=formatFloat(cpd);document.getElementById('costperday').value=cpd;document.getElementById('tc').innerHTML=formatFloat(tripcost);document.getElementById('tripcost').value=tripcost;gbl_budgetObj[gbl_budgetObj.length]=new CLSUserBudgetPreference(cityId,region,country,cityname,startDate,stayFor,noOfTraveler,noOfRooms,global_exchange_rate,transportCost,lodgingPref,dinningPref,transport,Currency,global_currency_symbol,cityImageSrc,cityImageCre,arr_pidDcTc,BudgetId,cpd,tripcost,countryName,global_currency_code);break;}}}function getValueFromAdminBudget(cityId,userPreference,Type,BudgetType){for(var adminBidgetCnt=0;adminBidgetCnt<arrCityBudgetParticulars.length;adminBidgetCnt++){if((BudgetType=="City"&&arrCityBudgetParticulars[adminBidgetCnt].cityId==cityId)||(arrCityBudgetParticulars[adminBidgetCnt].country.toLowerCase()==cityId.toLowerCase()&&arrCityBudgetParticulars[adminBidgetCnt].cityId<1)){if("Lodging"==Type){return parseFloat(getItemCost(userPreference,1,adminBidgetCnt));}else if("Transport"==Type){return parseFloat(arrCityBudgetParticulars[adminBidgetCnt].cityParticulars[userPreference-1].moderateCost);}else{return parseFloat(getItemCost(userPreference,2,adminBidgetCnt));}break;}}}function getCityParticulars(cityId,budgetNowFlag,type){var lodging_dc_value;var dining_dc;var shopping_dc_value;var garound_dc;var sight_dc;var ement_dc;var misce_dc;var misce_dc_value;var misce_tc;var getting_tc;var total_dc=parseFloat(0.00);var cityImageSrc=defaultCityImageSrc;var cityImageCre=defaultCityImageCre;var lodging_tc;var dining_tc;var shopping_tc;var garound_tc;var sight_tc;var ement_tc;var total_tc=parseFloat(0.00);var tripcost=parseFloat(0.00);var cpd=parseFloat(0.00);gbl_budgetObj=new Array();var transportType='Public Transport';var cityExist=0;gbl_TransportFlagTc=0;gbl_TransportFlagDc=0;arr_pidDcTc=new Array();arr_pidDcTc[0]=-1;var cityImageSrc=null;var cityImageCre=null;var regionname="";var Region=country=document.budgetPlannerfrm.Region.value;var transport=document.budgetPlannerfrm.transport.value;var currency=document.budgetPlannerfrm.currency.value;var no_travelers=parseInt(document.budgetPlannerfrm.no_travelers.value);var rooms=parseInt(document.budgetPlannerfrm.rooms.value);var stay_for=parseInt(document.budgetPlannerfrm.stay_for.value);var arival_date=document.budgetPlannerfrm.arival_date.value;if(type=="City"){var w=document.budgetPlannerfrm.City.selectedIndex;var cityname=document.budgetPlannerfrm.City.options[w].text;}else{var w=document.budgetPlannerfrm.Region.selectedIndex;regionname=document.budgetPlannerfrm.Region.options[w].text;cityname=regionname;}var LodgingcostType=getItemCostType(document.budgetPlannerfrm.lodging.value);var DiningcostType=getItemCostType(document.budgetPlannerfrm.dining.value);var ShoppingcostType=getItemCostType(0);var GaroundcostType=getItemCostType(0);var SightseeingcostType=getItemCostType(0);var EntertainmentcostType=getItemCostType(0);document.getElementById('cityHeader').style.display="block";var con=document.budgetPlannerfrm.Region.selectedIndex;var countryName=document.budgetPlannerfrm.Region.options[con].text;document.getElementById('cityName').innerHTML=cityname;document.getElementById('displayCurrencyRate').style.display='block';if(type=="City"){globaBudgetCityID=(cityId>0)?cityId:globaBudgetCityID;}else{globaBudgetCountryID=(regionname!="")?regionname:globaBudgetCountryID;}if(Region==0){alert('Please select country.');return false;}if(globaBudgetCityID==0&&type=="City"){alert('Please select city.');return false;}document.getElementById('displayCurrencyRate').innerHTML='Figures below are in USD.';if(budgetNowFlag!=0){var arrivalDate=new Date(arival_date.split("/")[2],parseInt(extractNumber(arival_date.split("/")[0]))-1,extractNumber(arival_date.split("/")[1]));var currentDate=new Date();var sysDate=new Date(currentDate.getFullYear(),currentDate.getMonth(),currentDate.getDate());if(arrivalDate==""||arrivalDate<sysDate){var monthStr=(parseInt(currentDate.getMonth()+1)<10)?"0"+(parseInt(currentDate.getMonth())+1):parseInt(currentDate.getMonth())+1;var dateStr=(currentDate.getDate()+1<10)?"0"+currentDate.getDate():currentDate.getDate();document.budgetPlannerfrm.arival_date.value=monthStr+"/"+dateStr+"/"+currentDate.getFullYear();}if(global_exchange_rate==0){global_exchange_rate=parseFloat(1.00);}var d=Date.parse(arival_date);if(!parseInt(d)){alert('Please select date of arrival');document.budgetPlannerfrm.arival_date.focus();return false;}if(currency!='149'){document.getElementById('displayCurrencyRate').innerHTML='';if(global_currency_update){document.getElementById('displayCurrencyRate').innerHTML='US Dollar Exchange Rate  $1 = '+global_currency_symbol+(1/global_exchange_rate).toFixed(2)+' as of '+global_currency_update+' - Powered by <a href="http://www.timegenie.com/" title="foreign exchange rates courtesy of timegenie.com" target="_blank">timegenie.com</a>';}else{document.getElementById('displayCurrencyRate').innerHTML='US Dollar Exchange Rate  $1 = '+global_currency_symbol+(1/global_exchange_rate).toFixed(2)+' - Powered by <a href="http://www.timegenie.com/" title="foreign exchange rates courtesy of timegenie.com" target="_blank">timegenie.com</a>';}}}for(var c=1;c<=17;c++){document.getElementById('currencySymbol_'+c).innerHTML=global_currency_symbol;}var cityParticularsObj="";for(var lCnt=0;lCnt<arrCityBudgetParticulars.length;lCnt++){if((type=="City"&&arrCityBudgetParticulars[lCnt].cityId==cityId)||arrCityBudgetParticulars[lCnt].country.toLowerCase()==cityId.toLowerCase()){cityParticularsObj=arrCityBudgetParticulars[lCnt].cityParticulars;break;}}var comments="";for(var k=0;k<gbl_userBudgetDetail.length;k++){if((type=="City"&&gbl_userBudgetDetail[k].cityid==cityId)||(gbl_userBudgetDetail[k].country.toLowerCase()==regionname.toLowerCase()&&gbl_userBudgetDetail[k].cityid<1)){cityExist=1;var	cityImageSrc=gbl_userBudgetDetail[k].imageSrc;var	cityImageCre=gbl_userBudgetDetail[k].imageCre;var userCurrency=gbl_userBudgetDetail[k].currencyCode;gblBudgetSavedCurrencyRate=gbl_userBudgetDetail[k].currencyExRate;for(var i=0;i<gbl_userBudgetDetail[k].perticularDetailsObj.length;i++){var particularNodeId=parseInt(gbl_userBudgetDetail[k].perticularDetailsObj[i].perticularId);if(isNaN(particularNodeId)){document.getElementById('lodgingComments').innerHTML="";document.budgetPlannerfrm.txtLodgingComments.value="";document.getElementById('dinningComments').innerHTML="";document.budgetPlannerfrm.txtDinningComments.value="";document.getElementById('sightseeingComments').innerHTML="";document.budgetPlannerfrm.txtSightseeingComments.value="";document.getElementById('enterainmentComments').innerHTML="";document.budgetPlannerfrm.txtEnterainmentComments.value="";document.getElementById('TransportComments').innerHTML="";document.budgetPlannerfrm.txtTransportComments.value="";document.getElementById('shoppingComments').innerHTML="";document.budgetPlannerfrm.txtShoppingComments.value="";continue;}if(cityParticularsObj){for(var pCnt=1;pCnt<cityParticularsObj.length;pCnt++){comments="";if(particularNodeId==cityParticularsObj[pCnt].particularNodeId||(particularNodeId==GettingAround_pid&&transport==cityParticularsObj[pCnt].particularNodeId)){comments=cityParticularsObj[pCnt].Comments;break;}}}switch(particularNodeId){case Lodging_pid:document.budgetPlannerfrm.lodging_dc.className='budgetPlannerfrmInput';if(lodgingActive){if(budgetNowFlag==0||budgetNowFlag==2){if(gbl_userBudgetDetail[k].lodgingPref==LodgingcostType){lodging_dc_value=parseFloat(gbl_userBudgetDetail[k].perticularDetailsObj[i].dailyCost);}else{lodging_dc_value=getValueFromAdminBudget(cityId,LodgingcostType,"Lodging",type);lodging_dc_value=parseFloat((lodging_dc_value/gblBudgetSavedCurrencyRate).toFixed(2));}document.budgetPlannerfrm.lodging_dc.value=formatFloat(lodging_dc_value);if(budgetNowFlag==0){lodging_dc_value=parseFloat((lodging_dc_value/global_exchange_rate).toFixed(2));document.budgetPlannerfrm.lodging_dc_display.value=formatFloat(lodging_dc_value);}else{budgetNowFlag=1;}}else{lodging_dc_value=document.budgetPlannerfrm.lodging_dc.value.replace(",","");}if((gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments&&gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments!="null")||comments!=""){if(gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments==""){comments=gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments;}document.getElementById('lodgingComments').innerHTML='<img src="../Images/Theme-1/Budget/CommentIcon.png" onmouseout="setVisible(\'\',\'lodgingComments\')" onmouseover="setVisible(\''+comments+'\',\'lodgingComments\')"/>';document.budgetPlannerfrm.txtLodgingComments.value=comments;}else{document.getElementById('lodgingComments').innerHTML="";document.budgetPlannerfrm.txtLodgingComments.value="";}if(budgetNowFlag==1){lodging_dc_value=parseFloat((lodging_dc_value*gblBudgetSavedCurrencyRate).toFixed(2));lodging_dc_value=parseFloat((lodging_dc_value/global_exchange_rate).toFixed(2));if(rooms){lodging_tc=parseFloat((lodging_dc_value*rooms*stay_for).toFixed(2));}else{lodging_tc=parseFloat((lodging_dc_value*stay_for).toFixed(2));}total_tc=parseFloat(total_tc+lodging_tc);document.budgetPlannerfrm.lodging_tc.value=formatFloat(lodging_tc);document.budgetPlannerfrm.lodging_dc_display.value=formatFloat(lodging_dc_value);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Lodging_pid,gbl_perticularList[0],lodging_dc_value,lodging_tc,gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments);}else{arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Lodging_pid,gbl_perticularList[0],lodging_dc_value,0.00,gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments);}}break;case Dining_pid:document.budgetPlannerfrm.dining_dc.className='budgetPlannerfrmInput';if(diningActive){if(budgetNowFlag==0||budgetNowFlag==3){if(gbl_userBudgetDetail[k].dinningPref==DiningcostType){dining_dc=parseFloat(gbl_userBudgetDetail[k].perticularDetailsObj[i].dailyCost);}else{dining_dc=getValueFromAdminBudget(cityId,DiningcostType,"Dinning",type);dining_dc=parseFloat((dining_dc/gblBudgetSavedCurrencyRate).toFixed(2));}document.budgetPlannerfrm.dining_dc.value=formatFloat(dining_dc);if(budgetNowFlag==0){dining_dc=parseFloat((dining_dc/global_exchange_rate).toFixed(2));document.budgetPlannerfrm.dining_dc_display.value=formatFloat(dining_dc);}else{budgetNowFlag=1;}}else{dining_dc=document.budgetPlannerfrm.dining_dc.value.replace(",","");}if((gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments&&gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments!="null")||comments!=""){if(gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments==""){comments=gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments;}document.getElementById('dinningComments').innerHTML='<img src="../Images/Theme-1/Budget/CommentIcon.png" onmouseout="setVisible(\'\',\'dinningComments\')" onmouseover="setVisible(\''+comments+'\',\'dinningComments\')"/>';document.budgetPlannerfrm.txtDinningComments.value=comments;}else{document.getElementById('dinningComments').innerHTML="";document.budgetPlannerfrm.txtDinningComments.value="";}if(budgetNowFlag==1){dining_dc=parseFloat((dining_dc*gblBudgetSavedCurrencyRate).toFixed(2));dining_dc=parseFloat((dining_dc/global_exchange_rate).toFixed(2));dining_tc=parseFloat((dining_dc*no_travelers*stay_for));total_tc=parseFloat(total_tc+dining_tc);document.budgetPlannerfrm.dining_tc.value=formatFloat(dining_tc);document.budgetPlannerfrm.dining_dc_display.value=formatFloat(dining_dc);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Dining_pid,gbl_perticularList[1],dining_dc,dining_tc,gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments);}else{arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Dining_pid,gbl_perticularList[1],dining_dc,0.00,gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments);}}break;case Sightseeing_pid:document.budgetPlannerfrm.sight_dc.className='budgetPlannerfrmInput';if(sightActive){if(budgetNowFlag==0){sight_dc=parseFloat(gbl_userBudgetDetail[k].perticularDetailsObj[i].dailyCost);document.budgetPlannerfrm.sight_dc.value=formatFloat(sight_dc);sight_dc=parseFloat((sight_dc/global_exchange_rate).toFixed(2));document.budgetPlannerfrm.sight_dc_display.value=formatFloat(sight_dc);}else{sight_dc=document.budgetPlannerfrm.sight_dc.value.replace(",","");}if((gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments&&gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments!="null")||comments!=""){if(gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments==""){comments=gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments;}document.getElementById('sightseeingComments').innerHTML='<img src="../Images/Theme-1/Budget/CommentIcon.png" onmouseout="setVisible(\'\',\'sightseeingComments\')" onmouseover="setVisible(\''+comments+'\',\'sightseeingComments\')"/>';document.budgetPlannerfrm.txtSightseeingComments.value=comments;}else{document.getElementById('sightseeingComments').innerHTML="";document.budgetPlannerfrm.txtSightseeingComments.value="";}if(budgetNowFlag==1){sight_dc=parseFloat((sight_dc*gblBudgetSavedCurrencyRate).toFixed(2));sight_dc=parseFloat((sight_dc/global_exchange_rate).toFixed(2));sight_tc=parseFloat((sight_dc*no_travelers*stay_for));total_tc=parseFloat(parseFloat(total_tc)+parseFloat(sight_tc));document.budgetPlannerfrm.sight_tc.value=formatFloat(sight_tc);document.budgetPlannerfrm.sight_dc_display.value=formatFloat(sight_dc);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Sightseeing_pid,gbl_perticularList[3],sight_dc,sight_tc,gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments);}else{arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Sightseeing_pid,gbl_perticularList[3],sight_dc,0.00,gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments);}}break;case Entertainment_pid:document.budgetPlannerfrm.ement_dc.className='budgetPlannerfrmInput';if(ementActive){if(budgetNowFlag==0){ement_dc=parseFloat(gbl_userBudgetDetail[k].perticularDetailsObj[i].dailyCost);document.budgetPlannerfrm.ement_dc.value=formatFloat(ement_dc);ement_dc=parseFloat((ement_dc/global_exchange_rate).toFixed(2));document.budgetPlannerfrm.ement_dc_display.value=formatFloat(ement_dc);}else{ement_dc=document.budgetPlannerfrm.ement_dc.value.replace(",","");}if((gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments&&gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments!="null")||comments!=""){if(gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments==""){comments=gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments;}document.getElementById('enterainmentComments').innerHTML='<img src="../Images/Theme-1/Budget/CommentIcon.png" onmouseout="setVisible(\'\',\'enterainmentComments\')" onmouseover="setVisible(\''+comments+'\',\'enterainmentComments\')"/>';document.budgetPlannerfrm.txtEnterainmentComments.value=comments;}else{document.getElementById('enterainmentComments').innerHTML="";document.budgetPlannerfrm.txtEnterainmentComments.value="";}if(budgetNowFlag==1){ement_dc=parseFloat((ement_dc*gblBudgetSavedCurrencyRate).toFixed(2));ement_dc=parseFloat((ement_dc/global_exchange_rate).toFixed(2));ement_tc=parseFloat((ement_dc*no_travelers*stay_for).toFixed(2));total_tc=parseFloat(parseFloat(total_tc)+parseFloat(ement_tc));document.budgetPlannerfrm.ement_tc.value=formatFloat(ement_tc);document.budgetPlannerfrm.ement_dc_display.value=formatFloat(ement_dc);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Entertainment_pid,gbl_perticularList[5],ement_dc,ement_tc,gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments);}else{arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Entertainment_pid,gbl_perticularList[5],ement_dc,0.00,gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments);}}break;case GettingAround_pid:document.budgetPlannerfrm.garound_dc.className='budgetPlannerfrmInput';if(garoundActive){if(gbl_userBudgetDetail[k].perticularDetailsObj[5].comments!=""){comments=gbl_userBudgetDetail[k].perticularDetailsObj[5].comments;}if(budgetNowFlag==0||budgetNowFlag==4){if(gbl_userBudgetDetail[k].transport==transport){garound_dc=parseFloat(gbl_userBudgetDetail[k].perticularDetailsObj[i].dailyCost);}else{garound_dc=getValueFromAdminBudget(cityId,transport,"Transport",type);garound_dc=parseFloat((garound_dc/gblBudgetSavedCurrencyRate).toFixed(2));}document.budgetPlannerfrm.garound_dc.value=formatFloat(garound_dc);if(budgetNowFlag==0){garound_dc=parseFloat((garound_dc/global_exchange_rate).toFixed(2));document.budgetPlannerfrm.garound_dc_display.value=formatFloat(garound_dc);}else{budgetNowFlag=1;}}else{garound_dc=document.budgetPlannerfrm.garound_dc.value.replace(",","");}if(comments&&comments!="null"){document.getElementById('TransportComments').innerHTML='<img src="../Images/Theme-1/Budget/CommentIcon.png" onmouseout="setVisible(\'\',\'TransportComments\')" onmouseover="setVisible(\''+comments+'\',\'TransportComments\')"/>';document.budgetPlannerfrm.txtTransportComments.value=comments;}else{document.getElementById('TransportComments').innerHTML="";document.budgetPlannerfrm.txtTransportComments.value="";}if(budgetNowFlag==1){garound_dc=parseFloat((garound_dc*gblBudgetSavedCurrencyRate).toFixed(2));garound_dc=(garound_dc/global_exchange_rate).toFixed(2);if(transport==PrivateTransport_pid){var noOfTravelers=parseInt(no_travelers/4);var noOfTravelersDeno=no_travelers%4;if(noOfTravelersDeno!=0){noOfTravelers++;}}else{var noOfTravelers=no_travelers;}garound_tc=parseFloat((garound_dc*noOfTravelers*stay_for).toFixed(2));total_tc=parseFloat(parseFloat(total_tc)+parseFloat(garound_tc));document.budgetPlannerfrm.garound_tc.value=formatFloat(garound_tc);document.budgetPlannerfrm.garound_dc_display.value=formatFloat(garound_dc);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(GettingAround_pid,gbl_perticularList[4],garound_dc,garound_tc,gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments);}else{arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(GettingAround_pid,gbl_perticularList[4],garound_dc,0.00,gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments);}}break;case Shopping_pid:document.budgetPlannerfrm.shopping_dc.className='budgetPlannerfrmInput';if(shoppingActive){if(budgetNowFlag==0){shopping_dc_value=parseFloat(gbl_userBudgetDetail[k].perticularDetailsObj[i].dailyCost);document.budgetPlannerfrm.shopping_dc.value=formatFloat(shopping_dc_value);shopping_dc_value=parseFloat((parseFloat(shopping_dc_value)/global_exchange_rate).toFixed(2));document.budgetPlannerfrm.shopping_dc_display.value=formatFloat(shopping_dc_value);}else{shopping_dc_value=document.budgetPlannerfrm.shopping_dc.value.replace(",","");}if((gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments&&gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments!="null")||comments!=""){if(gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments==""){comments=gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments;}document.getElementById('shoppingComments').innerHTML='<img src="../Images/Theme-1/Budget/CommentIcon.png" onmouseout="setVisible(\'\',\'shoppingComments\')" onmouseover="setVisible(\''+comments+'\',\'shoppingComments\')"/>';document.budgetPlannerfrm.txtShoppingComments.value=comments;}else{document.getElementById('shoppingComments').innerHTML="";document.budgetPlannerfrm.txtShoppingComments.value="";}if(budgetNowFlag==1){shopping_dc_value=parseFloat((shopping_dc_value*gblBudgetSavedCurrencyRate).toFixed(2));shopping_dc_value=parseFloat((shopping_dc_value/global_exchange_rate).toFixed(2));shopping_tc=parseFloat((shopping_dc_value*no_travelers*stay_for).toFixed(2));total_tc=parseFloat(parseFloat(total_tc)+parseFloat(shopping_tc));document.budgetPlannerfrm.shopping_tc.value=formatFloat(shopping_tc);document.budgetPlannerfrm.shopping_dc_display.value=formatFloat(shopping_dc_value);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Shopping_pid,gbl_perticularList[2],shopping_dc_value,shopping_tc,gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments);}else{arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Shopping_pid,gbl_perticularList[2],shopping_dc_value,0.00,gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments);}}break;case GettingThere_pid:if(budgetNowFlag==0){getting_tc_value=parseFloat(gbl_userBudgetDetail[k].perticularDetailsObj[i].dailyCost);document.budgetPlannerfrm.getting_tc.value=formatFloat(getting_tc_value);getting_tc_value=parseFloat((parseFloat(getting_tc_value)/global_exchange_rate).toFixed(2));document.budgetPlannerfrm.getting_tc_display.value=formatFloat(getting_tc_value);}else{getting_tc_value=document.budgetPlannerfrm.getting_tc.value.replace(",","");}if((gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments&&gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments!="null")||comments!=""){if(gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments==""){comments=gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments;}document.getElementById('shoppingComments').innerHTML='<img src="../Images/Theme-1/Budget/CommentIcon.png" onmouseout="setVisible(\'\',\'shoppingComments\')" onmouseover="setVisible(\''+comments+'\',\'shoppingComments\')"/>';document.budgetPlannerfrm.txtShoppingComments.value=comments;}else{document.getElementById('shoppingComments').innerHTML="";document.budgetPlannerfrm.txtShoppingComments.value="";}if(budgetNowFlag==1){getting_tc_value=parseFloat((getting_tc_value*gblBudgetSavedCurrencyRate).toFixed(2));getting_tc_value=parseFloat((getting_tc_value/global_exchange_rate).toFixed(2));document.budgetPlannerfrm.getting_tc_display.value=formatFloat(getting_tc_value);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(GettingThere_pid,gbl_perticularList[8],0.00,getting_tc_value,gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments);}else{arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(GettingThere_pid,gbl_perticularList[8],0.00,0.00,gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments);}break;case Miscellaneous_pid:document.budgetPlannerfrm.misce_dc.className='budgetPlannerfrmInput';if(budgetNowFlag==0){misce_dc_value=parseFloat(gbl_userBudgetDetail[k].perticularDetailsObj[i].dailyCost);document.budgetPlannerfrm.misce_dc.value=formatFloat(misce_dc_value);misce_dc_value=parseFloat((parseFloat(misce_dc_value)/global_exchange_rate).toFixed(2));document.budgetPlannerfrm.misce_dc_display.value=formatFloat(misce_dc_value);document.budgetPlannerfrm.misce_tc.value=formatFloat(misce_dc_value);}else{misce_dc_value=document.budgetPlannerfrm.misce_dc.value.replace(",","");}if(budgetNowFlag==1){misce_dc_value=parseFloat((misce_dc_value*gblBudgetSavedCurrencyRate).toFixed(2));misce_dc_value=parseFloat((misce_dc_value/global_exchange_rate).toFixed(2));misce_tc_value=(misce_dc_value*no_travelers*stay_for).toFixed(2);document.budgetPlannerfrm.misce_dc_display.value=formatFloat(misce_dc_value);document.budgetPlannerfrm.misce_tc.value=formatFloat(misce_tc_value);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Miscellaneous_pid,gbl_perticularList[9],misce_dc_value,misce_tc_value,gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments);}else{arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Miscellaneous_pid,gbl_perticularList[9],misce_dc_value,0.00,gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments);}if((gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments&&gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments!="null")||comments!=""){if(gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments==""){comments=gbl_userBudgetDetail[k].perticularDetailsObj[i].Comments;}document.getElementById('shoppingComments').innerHTML='<img src="../Images/Theme-1/Budget/CommentIcon.png" onmouseout="setVisible(\'\',\'shoppingComments\')" onmouseover="setVisible(\''+comments+'\',\'shoppingComments\')"/>';document.budgetPlannerfrm.txtShoppingComments.value=comments;}else{document.getElementById('shoppingComments').innerHTML="";document.budgetPlannerfrm.txtShoppingComments.value="";}break;}}}}if(cityExist!=1){var isCityFound=false;for(var k=0;k<arrCityBudgetParticulars.length;k++){if(type=="City"&&arrCityBudgetParticulars[k].cityId==cityId){isCityFound=true;break;}}for(var k=0;k<arrCityBudgetParticulars.length;k++){if((type=="City"&&arrCityBudgetParticulars[k].cityId==cityId)||(arrCityBudgetParticulars[k].country.toLowerCase()==regionname.toLowerCase()&&arrCityBudgetParticulars[k].cityId<1)||(arrCityBudgetParticulars[k].cityId==-1&&!isCityFound)){cityExist=1;var	cityImageSrc=arrCityBudgetParticulars[k].cityImageSrc;var	cityImageCre=arrCityBudgetParticulars[k].cityImageCre;if(arrCityBudgetParticulars[k].cityParticulars.length){for(var i=1;i<arrCityBudgetParticulars[k].cityParticulars.length;i++){var particularNodeId=parseInt(arrCityBudgetParticulars[k].cityParticulars[i].particularNodeId);if(isNaN(particularNodeId)){document.getElementById('lodgingComments').innerHTML="";document.budgetPlannerfrm.txtLodgingComments.value="";document.getElementById('dinningComments').innerHTML="";document.budgetPlannerfrm.txtDinningComments.value="";document.getElementById('sightseeingComments').innerHTML="";document.budgetPlannerfrm.txtSightseeingComments.value="";document.getElementById('enterainmentComments').innerHTML="";document.budgetPlannerfrm.txtEnterainmentComments.value="";document.getElementById('TransportComments').innerHTML="";document.budgetPlannerfrm.txtTransportComments.value="";document.getElementById('shoppingComments').innerHTML="";document.budgetPlannerfrm.txtShoppingComments.value="";continue;}switch(particularNodeId){case Lodging_pid:document.budgetPlannerfrm.lodging_dc.className='budgetPlannerfrmInput';if(lodgingActive){if(budgetNowFlag==0||budgetNowFlag==2){lodging_dc_value=parseFloat(getItemCost(LodgingcostType,i,k));document.budgetPlannerfrm.lodging_dc.value=formatFloat(lodging_dc_value);if(budgetNowFlag==0){lodging_dc_value=parseFloat((lodging_dc_value/global_exchange_rate).toFixed(2));document.budgetPlannerfrm.lodging_dc_display.value=formatFloat(lodging_dc_value);}else{budgetNowFlag=1;}}else{lodging_dc_value=document.budgetPlannerfrm.lodging_dc.value.replace(",","");}if(gblLodgingComments&&gblLodgingComments!="null"){document.getElementById('lodgingComments').innerHTML='<img src="../Images/Theme-1/Budget/CommentIcon.png" onmouseout="setVisible(\'\',\'lodgingComments\')" onmouseover="setVisible(\''+gblLodgingComments+'\',\'lodgingComments\')"/>';document.budgetPlannerfrm.txtLodgingComments.value=gblLodgingComments;}else{document.getElementById('lodgingComments').innerHTML="";document.budgetPlannerfrm.txtLodgingComments.value="";}if(budgetNowFlag==1){lodging_dc_value=parseFloat((lodging_dc_value/global_exchange_rate).toFixed(2));if(rooms){lodging_tc=parseFloat((lodging_dc_value*rooms*stay_for).toFixed(2));}else{lodging_tc=parseFloat((lodging_dc_value*stay_for).toFixed(2));}total_tc=parseFloat(total_tc+lodging_tc);document.budgetPlannerfrm.lodging_tc.value=formatFloat(lodging_tc);document.budgetPlannerfrm.lodging_dc_display.value=formatFloat(lodging_dc_value);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Lodging_pid,gbl_perticularList[0],lodging_dc_value,lodging_tc,gblLodgingComments);}else{arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Lodging_pid,gbl_perticularList[0],lodging_dc_value,0.00,gblLodgingComments);}}break;case Dining_pid:document.budgetPlannerfrm.dining_dc.className='budgetPlannerfrmInput';if(diningActive){if(budgetNowFlag==0||budgetNowFlag==3){dining_dc=parseFloat(getItemCost(DiningcostType,i,k));document.budgetPlannerfrm.dining_dc.value=formatFloat(dining_dc);if(budgetNowFlag==0){dining_dc=parseFloat((dining_dc/global_exchange_rate).toFixed(2));document.budgetPlannerfrm.dining_dc_display.value=formatFloat(dining_dc);}else{budgetNowFlag=1;}}else{dining_dc=document.budgetPlannerfrm.dining_dc.value.replace(",","");}if(arrCityBudgetParticulars[k].cityParticulars[i].Comments&&arrCityBudgetParticulars[k].cityParticulars[i].Comments!="null"){document.getElementById('dinningComments').innerHTML='<img src="../Images/Theme-1/Budget/CommentIcon.png" onmouseout="setVisible(\'\',\'dinningComments\')" onmouseover="setVisible(\''+arrCityBudgetParticulars[k].cityParticulars[i].Comments+'\',\'dinningComments\')"/>';document.budgetPlannerfrm.txtDinningComments.value=arrCityBudgetParticulars[k].cityParticulars[i].Comments;}else{document.getElementById('dinningComments').innerHTML="";document.budgetPlannerfrm.txtDinningComments.value="";}if(budgetNowFlag==1){dining_dc=parseFloat((dining_dc/global_exchange_rate).toFixed(2));dining_tc=parseFloat((dining_dc*no_travelers*stay_for));total_tc=parseFloat(total_tc+dining_tc);document.budgetPlannerfrm.dining_tc.value=formatFloat(dining_tc);document.budgetPlannerfrm.dining_dc_display.value=formatFloat(dining_dc);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Dining_pid,gbl_perticularList[1],dining_dc,dining_tc,arrCityBudgetParticulars[k].cityParticulars[i].Comments);}else{arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Dining_pid,gbl_perticularList[1],dining_dc,0.00,arrCityBudgetParticulars[k].cityParticulars[i].Comments);}}break;case Sightseeing_pid:document.budgetPlannerfrm.sight_dc.className='budgetPlannerfrmInput';if(sightActive){if(budgetNowFlag==0){sight_dc=parseFloat(getItemCost(SightseeingcostType,i,k));document.budgetPlannerfrm.sight_dc.value=formatFloat(sight_dc);sight_dc=parseFloat((sight_dc/global_exchange_rate).toFixed(2));document.budgetPlannerfrm.sight_dc_display.value=formatFloat(sight_dc);}else{sight_dc=document.budgetPlannerfrm.sight_dc.value.replace(",","");}if(arrCityBudgetParticulars[k].cityParticulars[i].Comments&&arrCityBudgetParticulars[k].cityParticulars[i].Comments!="null"){document.getElementById('sightseeingComments').innerHTML='<img src="../Images/Theme-1/Budget/CommentIcon.png" onmouseout="setVisible(\'\',\'sightseeingComments\')" onmouseover="setVisible(\''+arrCityBudgetParticulars[k].cityParticulars[i].Comments+'\',\'sightseeingComments\')"/>';document.budgetPlannerfrm.txtSightseeingComments.value=arrCityBudgetParticulars[k].cityParticulars[i].Comments;}else{document.getElementById('sightseeingComments').innerHTML="";document.budgetPlannerfrm.txtSightseeingComments.value="";}if(budgetNowFlag==1){sight_dc=parseFloat((sight_dc/global_exchange_rate).toFixed(2));sight_tc=parseFloat((sight_dc*no_travelers*stay_for));total_tc=parseFloat(parseFloat(total_tc)+parseFloat(sight_tc));document.budgetPlannerfrm.sight_tc.value=formatFloat(sight_tc);document.budgetPlannerfrm.sight_dc_display.value=formatFloat(sight_dc);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Sightseeing_pid,gbl_perticularList[3],sight_dc,sight_tc,arrCityBudgetParticulars[k].cityParticulars[i].Comments);}else{arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Sightseeing_pid,gbl_perticularList[3],sight_dc,0.00,arrCityBudgetParticulars[k].cityParticulars[i].Comments);}}break;case Entertainment_pid:document.budgetPlannerfrm.ement_dc.className='budgetPlannerfrmInput';if(ementActive){if(budgetNowFlag==0){ement_dc=parseFloat(getItemCost(EntertainmentcostType,i,k));document.budgetPlannerfrm.ement_dc.value=formatFloat(ement_dc);ement_dc=parseFloat((ement_dc/global_exchange_rate).toFixed(2));document.budgetPlannerfrm.ement_dc_display.value=formatFloat(ement_dc);}else{ement_dc=document.budgetPlannerfrm.ement_dc.value.replace(",","");}if(arrCityBudgetParticulars[k].cityParticulars[i].Comments&&arrCityBudgetParticulars[k].cityParticulars[i].Comments!="null"){document.getElementById('enterainmentComments').innerHTML='<img src="../Images/Theme-1/Budget/CommentIcon.png" onmouseout="setVisible(\'\',\'enterainmentComments\')" onmouseover="setVisible(\''+arrCityBudgetParticulars[k].cityParticulars[i].Comments+'\',\'enterainmentComments\')"/>';document.budgetPlannerfrm.txtEnterainmentComments.value=arrCityBudgetParticulars[k].cityParticulars[i].Comments;}else{document.getElementById('enterainmentComments').innerHTML="";document.budgetPlannerfrm.txtEnterainmentComments.value="";}if(budgetNowFlag==1){ement_dc=parseFloat((ement_dc/global_exchange_rate).toFixed(2));ement_tc=parseFloat((ement_dc*no_travelers*stay_for).toFixed(2));total_tc=parseFloat(parseFloat(total_tc)+parseFloat(ement_tc));document.budgetPlannerfrm.ement_tc.value=formatFloat(ement_tc);document.budgetPlannerfrm.ement_dc_display.value=formatFloat(ement_dc);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Entertainment_pid,gbl_perticularList[5],ement_dc,ement_tc,arrCityBudgetParticulars[k].cityParticulars[i].Comments);}else{arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Entertainment_pid,gbl_perticularList[5],ement_dc,0.00,arrCityBudgetParticulars[k].cityParticulars[i].Comments);}}break;case PublicTransport_pid:case PrivateTransport_pid:var comments="";document.budgetPlannerfrm.garound_dc.className='budgetPlannerfrmInput';if(garoundActive){garound_dc=arrCityBudgetParticulars[k].cityParticulars[i].moderateCost;switch(parseInt(transport)){case PublicTransport_pid:garound_dc=arrCityBudgetParticulars[k].cityParticulars[6].moderateCost;comments=arrCityBudgetParticulars[k].cityParticulars[6].Comments;break;case PrivateTransport_pid:garound_dc=arrCityBudgetParticulars[k].cityParticulars[7].moderateCost;comments=arrCityBudgetParticulars[k].cityParticulars[7].Comments;break;}if(gbl_TransportFlagDc==0){if(budgetNowFlag==0||budgetNowFlag==4){document.budgetPlannerfrm.garound_dc.value=formatFloat(garound_dc);if(budgetNowFlag==0){garound_dc=parseFloat((garound_dc/global_exchange_rate).toFixed(2));document.budgetPlannerfrm.garound_dc_display.value=formatFloat(garound_dc);}else{budgetNowFlag=1;}}else{garound_dc=document.budgetPlannerfrm.garound_dc.value.replace(",","");}gbl_TransportFlagDc=1;}transportCost=parseFloat(1.00);if(comments&&comments!="null"){document.getElementById('TransportComments').innerHTML='<img src="../Images/Theme-1/Budget/CommentIcon.png" onmouseout="setVisible(\'\',\'TransportComments\')" onmouseover="setVisible(\''+comments+'\',\'TransportComments\')"/>';document.budgetPlannerfrm.txtTransportComments.value=comments;}else{document.getElementById('TransportComments').innerHTML="";document.budgetPlannerfrm.txtTransportComments.value="";}if(budgetNowFlag==1){switch(parseInt(transport)){case PublicTransport_pid:transportCost=arrCityBudgetParticulars[k].cityParticulars[6].moderateCost;transportType='Public Transport';break;case PrivateTransport_pid:transportCost=arrCityBudgetParticulars[k].cityParticulars[7].moderateCost;transportType='Private Transport';break;}if(gbl_TransportFlagTc==0){transportCost=(transportCost/global_exchange_rate).toFixed(2);transportCost=parseFloat(transportCost);garound_dc=(garound_dc/global_exchange_rate).toFixed(2);if(transport==PrivateTransport_pid){var noOfTravelers=parseInt(no_travelers/4);var noOfTravelersDeno=no_travelers%4;if(noOfTravelersDeno!=0){noOfTravelers++;}}else{var noOfTravelers=no_travelers;}garound_tc=parseFloat((garound_dc*noOfTravelers*stay_for).toFixed(2));total_tc=parseFloat(parseFloat(total_tc)+parseFloat(garound_tc));document.budgetPlannerfrm.garound_tc.value=formatFloat(garound_tc);document.budgetPlannerfrm.garound_dc_display.value=formatFloat(garound_dc);gbl_TransportFlagTc=1;arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(GettingAround_pid,gbl_perticularList[4],garound_dc,garound_tc,arrCityBudgetParticulars[k].cityParticulars[i].Comments);}else{arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(GettingAround_pid,gbl_perticularList[4],garound_dc,0.00,arrCityBudgetParticulars[k].cityParticulars[i].Comments);}}}break;case Shopping_pid:document.budgetPlannerfrm.shopping_dc.className='budgetPlannerfrmInput';if(shoppingActive){if(budgetNowFlag==0){shopping_dc_value=parseFloat(getItemCost(ShoppingcostType,i,k));document.budgetPlannerfrm.shopping_dc.value=formatFloat(shopping_dc_value);shopping_dc_value=parseFloat((parseFloat(shopping_dc_value)/global_exchange_rate).toFixed(2));document.budgetPlannerfrm.shopping_dc_display.value=formatFloat(shopping_dc_value);}else{shopping_dc_value=document.budgetPlannerfrm.shopping_dc.value.replace(",","");}if(arrCityBudgetParticulars[k].cityParticulars[i].Comments&&arrCityBudgetParticulars[k].cityParticulars[i].Comments!="null"){document.getElementById('shoppingComments').innerHTML='<img src="../Images/Theme-1/Budget/CommentIcon.png" onmouseout="setVisible(\'\',\'shoppingComments\')" onmouseover="setVisible(\''+arrCityBudgetParticulars[k].cityParticulars[i].Comments+'\',\'shoppingComments\')"/>';document.budgetPlannerfrm.txtShoppingComments.value=arrCityBudgetParticulars[k].cityParticulars[i].Comments;}else{document.getElementById('shoppingComments').innerHTML="";document.budgetPlannerfrm.txtShoppingComments.value="";}if(budgetNowFlag==1){shopping_dc_value=parseFloat((shopping_dc_value/global_exchange_rate).toFixed(2));shopping_tc=parseFloat((shopping_dc_value*no_travelers*stay_for).toFixed(2));total_tc=parseFloat(parseFloat(total_tc)+parseFloat(shopping_tc));document.budgetPlannerfrm.shopping_tc.value=formatFloat(shopping_tc);document.budgetPlannerfrm.shopping_dc_display.value=formatFloat(shopping_dc_value);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Shopping_pid,gbl_perticularList[2],shopping_dc_value,shopping_tc,arrCityBudgetParticulars[k].cityParticulars[i].Comments);}else{arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Shopping_pid,gbl_perticularList[2],shopping_dc_value,0.00,arrCityBudgetParticulars[k].cityParticulars[i].Comments);}}break;}}getting_tc_value=document.budgetPlannerfrm.getting_tc.value.replace(",","");getting_tc_value=parseFloat((getting_tc_value/global_exchange_rate).toFixed(2));document.budgetPlannerfrm.getting_tc_display.value=formatFloat(getting_tc_value);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(GettingThere_pid,gbl_perticularList[8],0.00,getting_tc_value,'');misce_dc_value=document.budgetPlannerfrm.misce_dc.value.replace(",","");misce_dc_value=parseFloat((misce_dc_value/global_exchange_rate).toFixed(2));misce_tc_value=(misce_dc_value*no_travelers*stay_for).toFixed(2);document.budgetPlannerfrm.misce_dc_display.value=formatFloat(misce_dc_value);document.budgetPlannerfrm.misce_tc.value=formatFloat(misce_tc_value);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Miscellaneous_pid,gbl_perticularList[9],misce_dc_value,misce_tc_value,'');}else{document.getElementById('lodgingComments').innerHTML="";document.budgetPlannerfrm.txtLodgingComments.value="";document.budgetPlannerfrm.lodging_dc_display.value='00.00';document.budgetPlannerfrm.lodging_dc.value='00.00';document.budgetPlannerfrm.lodging_tc.value='00.00';arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Lodging_pid,gbl_perticularList[0],'00.00','00.00','');document.getElementById('dinningComments').innerHTML="";document.budgetPlannerfrm.dining_dc_display.value='00.00';document.budgetPlannerfrm.dining_dc.value='00.00';document.budgetPlannerfrm.dining_tc.value='00.00';document.budgetPlannerfrm.txtDinningComments.value="";arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Dining_pid,gbl_perticularList[1],'00.00','00.00','');document.getElementById('sightseeingComments').innerHTML="";document.budgetPlannerfrm.txtSightseeingComments.value="";document.budgetPlannerfrm.sight_dc_display.value='00.00';document.budgetPlannerfrm.sight_dc.value='00.00';document.budgetPlannerfrm.sight_tc.value='00.00';arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Sightseeing_pid,gbl_perticularList[3],'00.00','00.00','');document.getElementById('enterainmentComments').innerHTML="";document.budgetPlannerfrm.txtEnterainmentComments.value="";document.budgetPlannerfrm.ement_dc_display.value='00.00';document.budgetPlannerfrm.ement_dc.value='00.00';document.budgetPlannerfrm.ement_tc.value='00.00';arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Entertainment_pid,gbl_perticularList[5],'00.00','00.00','');document.getElementById('TransportComments').innerHTML="";document.budgetPlannerfrm.txtTransportComments.value="";document.budgetPlannerfrm.garound_dc_display.value='00.00';document.budgetPlannerfrm.garound_dc.value='00.00';document.budgetPlannerfrm.garound_tc.value='00.00';arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(GettingAround_pid,gbl_perticularList[4],'00.00','00.00','');document.getElementById('shoppingComments').innerHTML="";document.budgetPlannerfrm.txtShoppingComments.value="";document.budgetPlannerfrm.shopping_dc_display.value='00.00';document.budgetPlannerfrm.shopping_dc.value='00.00';document.budgetPlannerfrm.shopping_tc.value='00.00';arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Shopping_pid,gbl_perticularList[2],'00.00','00.00','');document.budgetPlannerfrm.misce_dc_display.value='00.00';document.budgetPlannerfrm.misce_tc.value='00.00';document.budgetPlannerfrm.misce_dc.value='00.00';arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(GettingThere_pid,gbl_perticularList[8],'00.00','00.00','');document.budgetPlannerfrm.getting_tc.value='00.00';document.budgetPlannerfrm.getting_tc_display='00.00';arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Miscellaneous_pid,gbl_perticularList[9],'00.00','00.00','');}break;}}}if(cityExist!=1){arr_pidDcTc=new Array();arr_pidDcTc[0]=-1;lodging_dc_value=document.budgetPlannerfrm.lodging_dc.value.replace(",","");lodging_dc_value=parseFloat((lodging_dc_value/global_exchange_rate).toFixed(2));if(rooms){lodging_tc=parseFloat((lodging_dc_value*rooms*stay_for).toFixed(2));}else{lodging_tc=parseFloat((lodging_dc_value*stay_for).toFixed(2));}total_dc=parseFloat(parseFloat(total_dc)+parseFloat(lodging_dc_value));total_tc=parseFloat(total_tc+lodging_tc);document.budgetPlannerfrm.lodging_tc.value=formatFloat(lodging_tc);document.budgetPlannerfrm.lodging_dc_display.value=formatFloat(lodging_dc_value);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Lodging_pid,gbl_perticularList[0],lodging_dc_value,lodging_tc,'');dining_dc=document.budgetPlannerfrm.dining_dc.value.replace(",","");dining_dc=parseFloat((dining_dc/global_exchange_rate).toFixed(2));dining_tc=parseFloat((dining_dc*no_travelers*stay_for));total_dc=parseFloat(parseFloat(total_dc)+parseFloat(dining_dc));total_tc=parseFloat(total_tc+dining_tc);document.budgetPlannerfrm.dining_tc.value=formatFloat(dining_tc);document.budgetPlannerfrm.dining_dc_display.value=formatFloat(dining_dc);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Dining_pid,gbl_perticularList[1],dining_dc,dining_tc,'');shopping_dc_value=document.budgetPlannerfrm.shopping_dc.value.replace(",","");shopping_dc_value=parseFloat((shopping_dc_value/global_exchange_rate).toFixed(2));shopping_tc=parseFloat((shopping_dc_value*no_travelers*stay_for).toFixed(2));total_dc=parseFloat(parseFloat(total_dc)+parseFloat(shopping_dc_value));total_tc=parseFloat(parseFloat(total_tc)+parseFloat(shopping_tc));document.budgetPlannerfrm.shopping_tc.value=formatFloat(shopping_tc);document.budgetPlannerfrm.shopping_dc_display.value=formatFloat(shopping_dc_value);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Shopping_pid,gbl_perticularList[2],shopping_dc_value,shopping_tc,'');garound_dc=document.budgetPlannerfrm.garound_dc.value.replace(",","");garound_dc=(garound_dc/global_exchange_rate).toFixed(2);if(transport==PrivateTransport_pid){var noOfTravelers=parseInt(no_travelers/4);var noOfTravelersDeno=no_travelers%4;if(noOfTravelersDeno!=0){noOfTravelers++;}}else{var noOfTravelers=no_travelers;}garound_tc=parseFloat((garound_dc*noOfTravelers*stay_for).toFixed(2));total_dc=parseFloat(parseFloat(total_dc)+parseFloat(garound_dc));total_tc=parseFloat(parseFloat(total_tc)+parseFloat(garound_tc));document.budgetPlannerfrm.garound_tc.value=formatFloat(garound_tc);document.budgetPlannerfrm.garound_dc_display.value=formatFloat(garound_dc);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(GettingAround_pid,gbl_perticularList[4],garound_dc,garound_tc,'');sight_dc=document.budgetPlannerfrm.sight_dc.value.replace(",","");sight_dc=parseFloat((sight_dc/global_exchange_rate).toFixed(2));sight_tc=parseFloat((sight_dc*no_travelers*stay_for));total_dc=parseFloat(parseFloat(total_dc)+parseFloat(sight_dc));total_tc=parseFloat(parseFloat(total_tc)+parseFloat(sight_tc));document.budgetPlannerfrm.sight_tc.value=formatFloat(sight_tc);document.budgetPlannerfrm.sight_dc_display.value=formatFloat(sight_dc);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Sightseeing_pid,gbl_perticularList[3],sight_dc,sight_tc,'');ement_dc=document.budgetPlannerfrm.ement_dc.value.replace(",","");ement_dc=parseFloat((ement_dc/global_exchange_rate).toFixed(2));ement_tc=parseFloat((ement_dc*no_travelers*stay_for).toFixed(2));total_dc=parseFloat(parseFloat(total_dc)+parseFloat(ement_dc));total_tc=parseFloat(parseFloat(total_tc)+parseFloat(ement_tc));document.budgetPlannerfrm.ement_tc.value=formatFloat(ement_tc);document.budgetPlannerfrm.ement_dc_display.value=formatFloat(ement_dc);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Entertainment_pid,gbl_perticularList[5],ement_dc,ement_tc,'');getting_tc_value=document.budgetPlannerfrm.getting_tc.value.replace(",","");getting_tc_value=parseFloat((getting_tc_value/global_exchange_rate).toFixed(2));total_tc=parseFloat(parseFloat(total_tc)+parseFloat(getting_tc_value));document.budgetPlannerfrm.getting_tc_display.value=formatFloat(getting_tc_value);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(GettingThere_pid,gbl_perticularList[8],0.00,getting_tc_value,'');misce_dc_value=document.budgetPlannerfrm.misce_dc.value.replace(",","");misce_dc_value=parseFloat((misce_dc_value/global_exchange_rate).toFixed(2));misce_tc_value=(misce_dc_value*no_travelers*stay_for).toFixed(2);total_dc=parseFloat(parseFloat(total_dc)+parseFloat(misce_dc_value));total_tc=parseFloat(parseFloat(total_tc)+parseFloat(misce_tc_value));document.budgetPlannerfrm.misce_dc_display.value=formatFloat(misce_dc_value);document.budgetPlannerfrm.misce_tc.value=formatFloat(misce_dc_value);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Miscellaneous_pid,gbl_perticularList[9],misce_dc_value,misce_tc_value,'');}document.budgetPlannerfrm.misce_dc.className='budgetPlannerfrmInput';document.budgetPlannerfrm.getting_tc.className='budgetPlannerfrmInput';if(budgetOprationMode=='updateUserBudget'){misce_dc=parseFloat(extractQuamas(document.budgetPlannerfrm.misce_dc.value));total_dc=parseFloat(total_dc+misce_dc);misce_tc=parseFloat(extractQuamas(document.budgetPlannerfrm.misce_tc.value));total_tc=parseFloat(total_tc+misce_tc);getting_tc=parseFloat(extractQuamas(document.budgetPlannerfrm.getting_tc.value));total_tc=parseFloat(total_tc+getting_tc);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(GettingThere_pid,gbl_perticularList[8],0.00,getting_tc,'');arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Miscellaneous_pid,gbl_perticularList[9],misce_dc,misce_tc,'');}if(cityImageSrc!=null){document.getElementById('budgetCityImage').src=imagepath+cityImageSrc;document.getElementById('budCityImageCreadit').innerHTML=cityImageCre;document.getElementById('budgetCityImage').style.display="";document.getElementById('budCityImageCreadit').style.display="";}else{document.getElementById('budgetCityImage').style.display="none";document.getElementById('budCityImageCreadit').style.display="none";}var cpd=parseFloat(total_dc).toFixed(2);document.getElementById('cpd').innerHTML=formatFloat(cpd);document.getElementById('costperday').value=cpd;if(budgetNowFlag==1){if(lodgingActive){var i_lodging_dc=document.budgetPlannerfrm.lodging_dc_display.value.replace(",","");var i_lodging_tc=parseFloat(document.budgetPlannerfrm.lodging_tc.value.replace(",",""));}else{var i_lodging_dc=0;var i_lodging_tc=0;}if(diningActive){var i_dining_dc=document.budgetPlannerfrm.dining_dc_display.value.replace(",","");var i_dining_tc=parseFloat(document.budgetPlannerfrm.dining_tc.value.replace(",",""));}else{var i_dining_dc=0;var i_dining_tc=0;}if(shoppingActive){var i_shopping_dc=document.budgetPlannerfrm.shopping_dc_display.value.replace(",","");var i_shopping_tc=parseFloat(document.budgetPlannerfrm.shopping_tc.value.replace(",",""));}else{var i_shopping_dc=0;var i_shopping_tc=0;}if(garoundActive){var i_garound_dc=document.budgetPlannerfrm.garound_dc_display.value.replace(",","");var i_garound_tc=parseFloat(document.budgetPlannerfrm.garound_tc.value.replace(",",""));}else{var i_garound_dc=0;var i_garound_tc=0;}if(sightActive){var i_sight_dc=document.budgetPlannerfrm.sight_dc_display.value.replace(",","");var i_sight_tc=parseFloat(document.budgetPlannerfrm.sight_tc.value.replace(",",""));}else{var i_sight_dc=0;var i_sight_tc=0;}if(ementActive){var i_ement_dc=document.budgetPlannerfrm.ement_dc_display.value.replace(",","");var i_ement_tc=parseFloat(document.budgetPlannerfrm.ement_tc.value.replace(",",""));}else{var i_ement_dc=0;var i_ement_tc=0;}if(misceActive){var i_misce_dc=document.budgetPlannerfrm.misce_dc_display.value.replace(",","");var i_misce_tc=parseFloat(document.budgetPlannerfrm.misce_tc.value.replace(",",""));}else{var i_misce_dc=0;var i_misce_tc=0;}if(gettingActive){var i_getting_tc=parseFloat(document.budgetPlannerfrm.getting_tc_display.value.replace(",",""));}else{var i_getting_tc=0;}cpd=parseFloat(parseFloat(i_lodging_dc)+parseFloat(i_shopping_dc)+parseFloat(i_dining_dc)+parseFloat(i_garound_dc)+parseFloat(i_sight_dc)+parseFloat(i_ement_dc)+parseFloat(i_misce_dc)).toFixed(2);document.getElementById('cpd').innerHTML=formatFloat(cpd);document.getElementById('costperday').value=cpd;tripcost=parseFloat(parseFloat(i_lodging_tc)+parseFloat(i_shopping_tc)+parseFloat(i_dining_tc)+parseFloat(i_garound_tc)+parseFloat(i_sight_tc)+parseFloat(i_ement_tc)+parseFloat(i_getting_tc)+parseFloat(i_misce_tc)).toFixed(2);document.getElementById('tc').innerHTML=formatFloat(tripcost);document.getElementById('tripcost').value=tripcost;}else if(budgetNowFlag==0){if(type=="City"){FillBudgetDetailsForCity('1');}else{FillBudgetDetailsForCountry('1');}}gbl_budgetObj[gbl_budgetObj.length]=new CLSUserBudgetPreference(globaBudgetCityID,Region,Region,cityname,arival_date,stay_for,no_travelers,rooms,global_exchange_rate,transportCost,LodgingcostType,DiningcostType,transportType,currency,global_currency_symbol,cityImageSrc,cityImageCre,arr_pidDcTc,gbl_BudgetId,cpd,tripcost,countryName,global_currency_code);}function recalculate(parentAction){if(gbl_budgetfrmValidate){if(globaBudgetCityID==0&&globaBudgetCountryID==""){alert('Please select city or country');return false;}arr_pidDcTc=new Array();arr_pidDcTc[0]=-1;var total_tc=0.00;var total_dc=0.00;var default_tc=0.00;var default_dc=0.00;var transport=document.budgetPlannerfrm.transport.value;var currency=document.budgetPlannerfrm.currency.value;var no_travelers=parseInt(document.budgetPlannerfrm.no_travelers.value);var rooms=parseInt(document.budgetPlannerfrm.rooms.value);var stay_for=parseInt(document.budgetPlannerfrm.stay_for.value);if(lodgingActive){lodging_dc=parseFloat(extractQuamas(document.budgetPlannerfrm.lodging_dc_display.value));if(rooms){lodging_tc=parseFloat((lodging_dc*rooms*stay_for).toFixed(2));}else{lodging_tc=parseFloat((lodging_dc*stay_for).toFixed(2));}total_dc=parseFloat(total_dc+lodging_dc);total_tc=parseFloat((total_tc+lodging_tc).toFixed(2));document.budgetPlannerfrm.lodging_tc.value=formatFloat(lodging_tc);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Lodging_pid,gbl_perticularList[0],lodging_dc,lodging_tc,document.budgetPlannerfrm.txtLodgingComments.value);}else{arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Lodging_pid,gbl_perticularList[0],default_dc,default_tc,'');}if(diningActive){dining_dc=parseFloat(extractQuamas(document.budgetPlannerfrm.dining_dc_display.value));dining_tc=parseFloat((dining_dc*no_travelers*stay_for).toFixed(2));total_dc=parseFloat(total_dc+dining_dc);total_tc=parseFloat((total_tc+dining_tc).toFixed(2));document.budgetPlannerfrm.dining_tc.value=formatFloat(dining_tc);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Dining_pid,gbl_perticularList[1],dining_dc,dining_tc,document.budgetPlannerfrm.txtDinningComments.value);}else{arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Dining_pid,gbl_perticularList[1],default_dc,default_tc,'');}if(sightActive){sight_dc=parseFloat(extractQuamas(document.budgetPlannerfrm.sight_dc_display.value));sight_tc=parseFloat((sight_dc*no_travelers*stay_for).toFixed(2));total_dc=parseFloat(total_dc+sight_dc);total_tc=parseFloat((total_tc+sight_tc).toFixed(2));document.budgetPlannerfrm.sight_tc.value=formatFloat(sight_tc);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Sightseeing_pid,gbl_perticularList[3],sight_dc,sight_tc,document.budgetPlannerfrm.txtSightseeingComments.value);}else{arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Sightseeing_pid,gbl_perticularList[3],default_dc,default_tc,'');}if(ementActive){ement_dc=parseFloat(extractQuamas(document.budgetPlannerfrm.ement_dc_display.value));ement_tc=parseFloat((ement_dc*no_travelers*stay_for).toFixed(2));total_dc=parseFloat(total_dc+ement_dc);total_tc=parseFloat((total_tc+ement_tc).toFixed(2));document.budgetPlannerfrm.ement_tc.value=formatFloat(ement_tc);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Entertainment_pid,gbl_perticularList[5],ement_dc,ement_tc,document.budgetPlannerfrm.txtEnterainmentComments.value);}else{arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Entertainment_pid,gbl_perticularList[5],default_dc,default_tc,'');}if(garoundActive){garound_dc=parseFloat(extractQuamas(document.budgetPlannerfrm.garound_dc_display.value));if(transport==PrivateTransport_pid){var noOfTravelers=parseInt(no_travelers/4);var noOfTravelersDeno=no_travelers%4;if(noOfTravelersDeno!=0){noOfTravelers++;}}else{var noOfTravelers=no_travelers;}garound_tc=parseFloat((garound_dc*noOfTravelers*stay_for).toFixed(2));total_dc=parseFloat(total_dc+garound_dc);total_tc=parseFloat((total_tc+garound_tc).toFixed(2));document.budgetPlannerfrm.garound_tc.value=formatFloat(garound_tc);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(GettingAround_pid,gbl_perticularList[4],garound_dc,garound_tc,document.budgetPlannerfrm.txtTransportComments.value);}else{arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(GettingAround_pid,gbl_perticularList[4],default_dc,default_tc,'');}if(shoppingActive){shopping_dc=parseFloat(extractQuamas(document.budgetPlannerfrm.shopping_dc_display.value));shopping_tc=parseFloat((shopping_dc*no_travelers*stay_for).toFixed(2));total_dc=parseFloat(total_dc+shopping_dc);total_tc=parseFloat((total_tc+shopping_tc).toFixed(2));document.budgetPlannerfrm.shopping_tc.value=formatFloat(shopping_tc);arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Shopping_pid,gbl_perticularList[2],shopping_dc,shopping_tc,document.budgetPlannerfrm.txtShoppingComments.value);}else{arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Shopping_pid,gbl_perticularList[2],default_dc,default_tc,'');}if(gettingActive){getting_tc=parseFloat(extractQuamas(document.budgetPlannerfrm.getting_tc_display.value));total_tc=parseFloat((total_tc+getting_tc).toFixed(2));arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(GettingThere_pid,gbl_perticularList[8],default_dc,getting_tc,'');}else{arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(GettingThere_pid,gbl_perticularList[8],default_dc,default_tc,'');}if(misceActive){misce_dc=parseFloat(extractQuamas(document.budgetPlannerfrm.misce_dc_display.value));misce_tc=parseFloat((misce_dc*no_travelers*stay_for).toFixed(2));total_dc=parseFloat(total_dc+misce_dc);total_tc=parseFloat((total_tc+misce_tc).toFixed(2));document.budgetPlannerfrm.misce_tc.value=formatFloat(misce_tc.toFixed(2));arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Miscellaneous_pid,gbl_perticularList[9],misce_dc,misce_tc,'');}else{arr_pidDcTc[arr_pidDcTc.length]=new CLSBudgetPerticularPreference(Miscellaneous_pid,gbl_perticularList[9],default_dc,default_tc,'');}if(lodgingActive){var i_lodging_dc=document.budgetPlannerfrm.lodging_dc_display.value.replace(",","");var i_lodging_tc=parseFloat(document.budgetPlannerfrm.lodging_tc.value.replace(",",""));}else{var i_lodging_dc=0;var i_lodging_tc=0;}if(diningActive){var i_dining_dc=document.budgetPlannerfrm.dining_dc_display.value.replace(",","");var i_dining_tc=parseFloat(document.budgetPlannerfrm.dining_tc.value.replace(",",""));}else{var i_dining_dc=0;var i_dining_tc=0;}if(shoppingActive){var i_shopping_dc=document.budgetPlannerfrm.shopping_dc_display.value.replace(",","");var i_shopping_tc=parseFloat(document.budgetPlannerfrm.shopping_tc.value.replace(",",""));}else{var i_shopping_dc=0;var i_shopping_tc=0;}if(garoundActive){var i_garound_dc=document.budgetPlannerfrm.garound_dc_display.value.replace(",","");var i_garound_tc=parseFloat(document.budgetPlannerfrm.garound_tc.value.replace(",",""));}else{var i_garound_dc=0;var i_garound_tc=0;}if(sightActive){var i_sight_dc=document.budgetPlannerfrm.sight_dc_display.value.replace(",","");var i_sight_tc=parseFloat(document.budgetPlannerfrm.sight_tc.value.replace(",",""));}else{var i_sight_dc=0;var i_sight_tc=0;}if(ementActive){var i_ement_dc=document.budgetPlannerfrm.ement_dc_display.value.replace(",","");var i_ement_tc=parseFloat(document.budgetPlannerfrm.ement_tc.value.replace(",",""));}else{var i_ement_dc=0;var i_ement_tc=0;}if(misceActive){var i_misce_dc=document.budgetPlannerfrm.misce_dc_display.value.replace(",","");var i_misce_tc=parseFloat(document.budgetPlannerfrm.misce_tc.value.replace(",",""));}else{var i_misce_dc=0;var i_misce_tc=0;}if(gettingActive){var i_getting_tc=parseFloat(document.budgetPlannerfrm.getting_tc_display.value.replace(",",""));}else{var i_getting_tc=0;}total_dc=parseFloat(parseFloat(i_lodging_dc)+parseFloat(i_dining_dc)+parseFloat(i_shopping_dc)+parseFloat(i_garound_dc)+parseFloat(i_sight_dc)+parseFloat(i_ement_dc)+parseFloat(i_misce_dc)).toFixed(2);total_tc=parseFloat(parseFloat(i_lodging_tc)+parseFloat(i_shopping_tc)+parseFloat(i_dining_tc)+parseFloat(i_garound_tc)+parseFloat(i_sight_tc)+parseFloat(i_ement_tc)+parseFloat(i_getting_tc)+parseFloat(i_misce_tc)).toFixed(2);if(document.getElementById('costperday')){document.getElementById('costperday').value=total_dc;}if(document.getElementById('tripcost')){document.getElementById('tripcost').value=total_tc;}if(document.getElementById('cpd')){document.getElementById('cpd').innerHTML=formatFloat(total_dc);}if(document.getElementById('tc')){document.getElementById('tc').innerHTML=formatFloat(total_tc);}for(var cnt=0;cnt<gbl_budgetObj.length;cnt++){if(gbl_budgetObj[cnt].cityid==globaBudgetCityID){gbl_budgetObj[cnt].perticularDetailsObj=arr_pidDcTc;gbl_budgetObj[cnt].costPerDay=total_dc;gbl_budgetObj[cnt].tripCost=total_tc;break;}}if(!lodgingActive&&!diningActive&&!sightActive&&!ementActive&&!lodgingActive&&!garoundActive&&!shoppingActive&&!gettingActive&&!misceActive){for(var cnt=0;cnt<gbl_budgetObj.length;cnt++){if(gbl_budgetObj[cnt].cityid==globaBudgetCityID){gbl_budgetObj[cnt].costPerDay=default_dc;gbl_budgetObj[cnt].tripCost=default_tc;break;}}if(document.getElementById('costperday')){document.getElementById('costperday').value='0.00';}if(document.getElementById('tripcost')){document.getElementById('tripcost').value='0.00';}if(document.getElementById('cpd')){document.getElementById('cpd').innerHTML='0.00';}if(document.getElementById('tc')){document.getElementById('tc').innerHTML='0.00';}}if(parentAction&&parentAction!='addToMyTrip'){addToMyTrip('recalculate');}else{gbl_currentBudgetSourceCopy=null;}}}function validateBudgetItems(mode,action,UserID){var cond1,cond2;if(action=='saveBudgetItems'){cityID=document.frmManageBudgetItems.City.value;countryID=document.frmManageBudgetItems.Country.value;}else{cityID=document.frmManageBudgetItems.city_id.value;countryID=document.frmManageBudgetItems.CountryID.value;}if(action=='saveBudgetItems'&&countryID=='-1'){alert('Please select country.');return(false);}Lodging_budget=document.frmManageBudgetItems.Lodging_Budget.value;Lodging_moderate=document.frmManageBudgetItems.Lodging_Moderate.value;Lodging_expensive=document.frmManageBudgetItems.Lodging_Expensive.value;Lodging_comments=document.frmManageBudgetItems.LodgingComment.value;if(bValidate(document.frmManageBudgetItems.LodgingComment,"BudgetComments","False","Comments for Lodging Low Season")==false){return(false);}if(Lodging_budget==''||Lodging_moderate==''||Lodging_expensive==''){alert('Please enter all cost for Lodging Low Season.');if(Lodging_budget==''){document.frmManageBudgetItems.Lodging_Budget.focus();return false;}if(Lodging_moderate==''){document.frmManageBudgetItems.Lodging_Moderate.focus();return false;}if(Lodging_expensive==''){document.frmManageBudgetItems.Lodging_Expensive.focus();return false;}return(false);}else if(!vd(Lodging_budget)||!vd(Lodging_moderate)||!vd(Lodging_expensive)){alert('All cost for Lodging Low Season should be numeric or zero.');if(!vd(Lodging_budget)){document.frmManageBudgetItems.Lodging_Budget.focus();return false;}if(!vd(Lodging_moderate)){document.frmManageBudgetItems.Lodging_Moderate.focus();return false;}if(!vd(Lodging_expensive)){document.frmManageBudgetItems.Lodging_Expensive.focus();return false;}return(false);}cond1=(parseFloat(Lodging_moderate)>parseFloat(Lodging_budget));cond2=(parseFloat(Lodging_expensive)>parseFloat(Lodging_budget)&&parseFloat(Lodging_expensive)>parseFloat(Lodging_moderate));if(!cond1&&parseFloat(Lodging_budget)>0&&parseFloat(Lodging_moderate)!=0){alert('Moderate cost for Lodging Low Season should be greater than Budget cost.');return(false);}else if(!cond2){if(parseFloat(Lodging_budget)>0&&parseFloat(Lodging_moderate)>0&&parseFloat(Lodging_expensive)>0){alert('Expensive cost for Lodging Low Season should be greather than Budget and Moderate costs.');return(false);}else if(parseFloat(Lodging_budget)>0&&parseFloat(Lodging_expensive)>0){alert('Expensive cost for Lodging Low Season should be greather than Budget cost.');return(false);}else if(parseFloat(Lodging_moderate)>0&&parseFloat(Lodging_expensive)>0){alert('Expensive cost for Lodging Low Season should be greather than Moderate cost.');return(false);}}LodgingHighSeason_budget=document.frmManageBudgetItems.LodgingHighSeason_Budget.value;LodgingHighSeason_moderate=document.frmManageBudgetItems.LodgingHighSeason_Moderate.value;LodgingHighSeason_expensive=document.frmManageBudgetItems.LodgingHighSeason_Expensive.value;if(LodgingHighSeason_budget==''||LodgingHighSeason_moderate==''||LodgingHighSeason_expensive==''){alert('Please enter all cost for Lodging High Season.');if(LodgingHighSeason_budget==''){document.frmManageBudgetItems.LodgingHighSeason_Budget.focus();return false;}if(LodgingHighSeason_moderate==''){document.frmManageBudgetItems.LodgingHighSeason_Moderate.focus();return false;}if(LodgingHighSeason_expensive==''){document.frmManageBudgetItems.LodgingHighSeason_Expensive.focus();return false;}return(false);}LodgingHighSeason_comments=document.frmManageBudgetItems.LodgingHighSeasonComment.value;if(bValidate(document.frmManageBudgetItems.LodgingHighSeasonComment,"BudgetComments","False","Comments for Lodging High Season")==false){return(false);}else if(!vd(LodgingHighSeason_budget)||!vd(LodgingHighSeason_moderate)||!vd(LodgingHighSeason_expensive)){alert('All cost for Lodging High Season should be numeric or zero.');if(!vd(LodgingHighSeason_budget)){document.frmManageBudgetItems.LodgingHighSeason_Budget.focus();return false;}if(!vd(LodgingHighSeason_moderate)){document.frmManageBudgetItems.LodgingHighSeason_Moderate.focus();return false;}if(!vd(LodgingHighSeason_expensive)){document.frmManageBudgetItems.LodgingHighSeason_Expensive.focus();return false;}return(false);}cond1=(parseFloat(LodgingHighSeason_moderate)>parseFloat(LodgingHighSeason_budget));cond2=(parseFloat(LodgingHighSeason_expensive)>parseFloat(LodgingHighSeason_budget)&&parseFloat(LodgingHighSeason_expensive)>parseFloat(LodgingHighSeason_moderate));if(!cond1&&parseFloat(LodgingHighSeason_budget)>0&&parseFloat(LodgingHighSeason_moderate)!=0){alert('Moderate cost for Lodging High Season should be greater than Budget cost.');return(false);}else if(!cond2){if(parseFloat(LodgingHighSeason_budget)>0&&parseFloat(LodgingHighSeason_moderate)>0&&parseFloat(LodgingHighSeason_expensive)>0){alert('Expensive cost for Lodging High Season should be greather than Budget and Moderate costs.');return(false);}else if(parseFloat(LodgingHighSeason_budget)>0&&parseFloat(LodgingHighSeason_expensive)>0){alert('Expensive cost for Lodging High Season should be greather than Budget cost.');return(false);}else if(parseFloat(LodgingHighSeason_moderate)>0&&parseFloat(LodgingHighSeason_expensive)>0){alert('Expensive cost for Lodging High Season should be greather than Moderate cost.');return(false);}}Dining_budget=document.frmManageBudgetItems.Dining_Budget.value;Dining_moderate=document.frmManageBudgetItems.Dining_Moderate.value;Dining_expensive=document.frmManageBudgetItems.Dining_Expensive.value;if(Dining_budget==''||Dining_moderate==''||Dining_expensive==''){alert('Please enter all cost for Dining.');if(Dining_budget==''){document.frmManageBudgetItems.Dining_Budget.focus();return false;}if(Dining_moderate==''){document.frmManageBudgetItems.Dining_Moderate.focus();return false;}if(Dining_expensive==''){document.frmManageBudgetItems.Dining_Expensive.focus();return false;}return(false);}Dining_comments=document.frmManageBudgetItems.DiningComment.value;if(bValidate(document.frmManageBudgetItems.DiningComment,"BudgetComments","False","Comments for Dinning")==false){return(false);}else if(!vd(Dining_budget)||!vd(Dining_moderate)||!vd(Dining_expensive)){alert('All cost for Dining should be numeric or zero.');if(!vd(Dining_budget)){document.frmManageBudgetItems.Dining_Budget.focus();return false;}if(!vd(Dining_moderate)){document.frmManageBudgetItems.Dining_Moderate.focus();return false;}if(!vd(Dining_expensive)){document.frmManageBudgetItems.Dining_Expensive.focus();return false;}return(false);}cond1=(parseFloat(Dining_moderate)>parseFloat(Dining_budget));cond2=(parseFloat(Dining_expensive)>parseFloat(Dining_budget)&&parseFloat(Dining_expensive)>parseFloat(Dining_moderate));if(!cond1&&parseFloat(Dining_budget)>0&&parseFloat(Dining_moderate)!=0){alert('Moderate cost for Dining should be greater than Budget cost.');return(false);}else if(!cond2){if(parseFloat(Dining_budget)>0&&parseFloat(Dining_moderate)>0&&parseFloat(Dining_expensive)>0){alert('Expensive cost for Dining should be greather than Budget and Moderate costs.');return(false);}else if(parseFloat(Dining_budget)>0&&parseFloat(Dining_expensive)>0){alert('Expensive cost for Dining should be greather than Budget cost.');return(false);}else if(parseFloat(Dining_moderate)>0&&parseFloat(Dining_expensive)>0){alert('Expensive cost for Dining should be greather than Moderate cost.');return(false);}}Sightseeing_budget=document.frmManageBudgetItems.Sightseeing_Budget.value;Sightseeing_moderate=document.frmManageBudgetItems.Sightseeing_Moderate.value;Sightseeing_expensive=document.frmManageBudgetItems.Sightseeing_Expensive.value;if(Sightseeing_budget==''||Sightseeing_moderate==''||Sightseeing_expensive==''){alert('Please enter all cost for Sightseeing.');if(Sightseeing_budget==''){document.frmManageBudgetItems.Sightseeing_Budget.focus();return false;}if(Sightseeing_moderate==''){document.frmManageBudgetItems.Sightseeing_Moderate.focus();return false;}if(Sightseeing_expensive==''){document.frmManageBudgetItems.Sightseeing_Expensive.focus();return false;}return(false);}Sightseeing_comments=document.frmManageBudgetItems.SightseeingComment.value;if(bValidate(document.frmManageBudgetItems.SightseeingComment,"BudgetComments","False","Comments for Sightseeing")==false){return(false);}else if(!vd(Sightseeing_budget)||!vd(Sightseeing_moderate)||!vd(Sightseeing_expensive)){alert('All cost for Sightseeing should be numeric or zero.');if(!vd(Sightseeing_budget)){document.frmManageBudgetItems.Sightseeing_Budget.focus();return false;}if(!vd(Sightseeing_moderate)){document.frmManageBudgetItems.Sightseeing_Moderate.focus();return false;}if(!vd(Sightseeing_expensive)){document.frmManageBudgetItems.Sightseeing_Expensive.focus();return false;}document.frmManageBudgetItems.Sightseeing_Budget.focus();return(false);}cond1=(parseFloat(Sightseeing_moderate)>parseFloat(Sightseeing_budget));cond2=(parseFloat(Sightseeing_expensive)>parseFloat(Sightseeing_budget)&&parseFloat(Sightseeing_expensive)>parseFloat(Sightseeing_moderate));if(!cond1&&parseFloat(Sightseeing_budget)>0&&parseFloat(Sightseeing_moderate)!=0){alert('Moderate cost for Sightseeing should be greater than Budget cost.');return(false);}else if(!cond2){if(parseFloat(Sightseeing_budget)>0&&parseFloat(Sightseeing_moderate)>0&&parseFloat(Sightseeing_expensive)>0){alert('Expensive cost for Sightseeing should be greather than Budget and Moderate costs.');return(false);}else if(parseFloat(Sightseeing_budget)>0&&parseFloat(Sightseeing_expensive)>0){alert('Expensive cost for Sightseeing should be greather than Budget cost.');return(false);}else if(parseFloat(Sightseeing_moderate)>0&&parseFloat(Sightseeing_expensive)>0){alert('Expensive cost for Sightseeing should be greather than Moderate cost.');return(false);}}Entretainment_budget=document.frmManageBudgetItems.Entertainment_Budget.value;Entretainment_moderate=document.frmManageBudgetItems.Entertainment_Moderate.value;Entretainment_expensive=document.frmManageBudgetItems.Entertainment_Expensive.value;Entertainment_comments=document.frmManageBudgetItems.EntertainmentComment.value;if(Entretainment_budget==''||Entretainment_moderate==''||Entretainment_expensive==''){alert('Please enter all cost for Entretainment.');if(Entretainment_budget==''){document.frmManageBudgetItems.Entertainment_Budget.focus();return false;}if(Entretainment_moderate==''){document.frmManageBudgetItems.Entertainment_Moderate.focus();return false;}if(Entretainment_expensive==''){document.frmManageBudgetItems.Entertainment_Expensive.focus();return false;}return(false);}else if(bValidate(document.frmManageBudgetItems.EntertainmentComment,"BudgetComments","False","Comments for Entertainment")==false){return(false);}else if(!vd(Entretainment_budget)||!vd(Entretainment_moderate)||!vd(Entretainment_expensive)){alert('All cost for Entretainment should be numeric or zero.');if(!vd(Entretainment_budget)){document.frmManageBudgetItems.Entertainment_Budget.focus();return false;}if(!vd(Entretainment_moderate)){document.frmManageBudgetItems.Entertainment_Moderate.focus();return false;}if(!vd(Entretainment_expensive)){document.frmManageBudgetItems.Entertainment_Expensive.focus();return false;}return(false);}cond1=(parseFloat(Entretainment_moderate)>parseFloat(Entretainment_budget));cond2=(parseFloat(Entretainment_expensive)>parseFloat(Entretainment_budget)&&parseFloat(Entretainment_expensive)>parseFloat(Entretainment_moderate));if(!cond1&&parseFloat(Entretainment_budget)>0&&parseFloat(Entretainment_moderate)!=0){alert('Moderate cost for Entretainment should be greater than Budget cost.');return(false);}else if(!cond2){if(parseFloat(Entretainment_budget)>0&&parseFloat(Entretainment_moderate)>0&&parseFloat(Entretainment_expensive)>0){alert('Expensive cost for Entretainment should be greather than Budget and Moderate costs.');return(false);}else if(parseFloat(Entretainment_budget)>0&&parseFloat(Entretainment_expensive)>0){alert('Expensive cost for Entretainment should be greather than Budget cost.');return(false);}else if(parseFloat(Entretainment_moderate)>0&&parseFloat(Entretainment_expensive)>0){alert('Expensive cost for Entretainment should be greather than Moderate cost.');return(false);}}Shopping_budget=document.frmManageBudgetItems.Shopping_Budget.value;Shopping_moderate=document.frmManageBudgetItems.Shopping_Moderate.value;Shopping_expensive=document.frmManageBudgetItems.Shopping_Expensive.value;if(Shopping_budget==''||Shopping_moderate==''||Shopping_expensive==''){alert('Please enter all cost for Shopping.');if(Shopping_budget==''){document.frmManageBudgetItems.Shopping_Budget.focus();return false;}if(Shopping_moderate==''){document.frmManageBudgetItems.Shopping_Moderate.focus();return false;}if(Shopping_expensive==''){document.frmManageBudgetItems.Shopping_Expensive.focus();return false;}return(false);}Shopping_comments=document.frmManageBudgetItems.ShoppingComment.value;if(bValidate(document.frmManageBudgetItems.ShoppingComment,"BudgetComments","False","Comments for Shopping")==false){return(false);}else if(!vd(Shopping_budget)||!vd(Shopping_moderate)||!vd(Shopping_expensive)){alert('All cost for Shopping should be numeric or zero.');document.frmManageBudgetItems.Shopping_Budget.focus();if(!vd(Shopping_budget)){document.frmManageBudgetItems.Shopping_Budget.focus();return false;}if(!vd(Shopping_moderate)){document.frmManageBudgetItems.Shopping_Moderate.focus();return false;}if(!vd(Shopping_expensive)){document.frmManageBudgetItems.Shopping_Expensive.focus();return false;}return(false);}cond1=(parseFloat(Shopping_moderate)>parseFloat(Shopping_budget));cond2=(parseFloat(Shopping_expensive)>parseFloat(Shopping_budget)&&parseFloat(Shopping_expensive)>parseFloat(Shopping_moderate));if(!cond1&&parseFloat(Shopping_budget)>0&&parseFloat(Shopping_moderate)>0){alert('Moderate cost for Shopping should be greater than Budget cost.');return(false);}else if(!cond2){if(parseFloat(Shopping_budget)>0&&parseFloat(Shopping_moderate)>0&&parseFloat(Shopping_expensive)>0){alert('Expensive cost for Shopping should be greather than Budget and Moderate costs.');return(false);}else if(parseFloat(Shopping_budget)>0&&parseFloat(Shopping_expensive)>0){alert('Expensive cost for Shopping should be greather than Budget cost.');return(false);}else if(parseFloat(Shopping_moderate)>0&&parseFloat(Shopping_expensive)>0){alert('Expensive cost for Shopping should be greather than Moderate cost.');return(false);}}PublicTransport_budget=document.frmManageBudgetItems.PublicTransport_Budget.value;PublicTransport_moderate=document.frmManageBudgetItems.PublicTransport_Moderate.value;PublicTransport_expensive=document.frmManageBudgetItems.PublicTransport_Expensive.value;if(PublicTransport_budget==''||PublicTransport_moderate==''||PublicTransport_expensive==''){alert('Please enter all cost for  Public Transport.');if(PublicTransport_budget==''){document.frmManageBudgetItems.PublicTransport_Budget.focus();return false;}if(PublicTransport_moderate==''){document.frmManageBudgetItems.PublicTransport_Moderate.focus();return false;}if(PublicTransport_expensive==''){document.frmManageBudgetItems.PublicTransport_Expensive.focus();return false;}return(false);}PublicTransport_comments=document.frmManageBudgetItems.PublicTransportComment.value;if(bValidate(document.frmManageBudgetItems.PublicTransportComment,"BudgetComments","False","Comments for Public Transport")==false){return(false);}else if(!vd(PublicTransport_budget)||!vd(PublicTransport_moderate)||!vd(PublicTransport_expensive)){alert('All cost for Public Transport should be numeric or zero.');if(!vd(PublicTransport_budget)){document.frmManageBudgetItems.PublicTransport_Budget.focus();return false;}if(!vd(PublicTransport_moderate)){document.frmManageBudgetItems.PublicTransport_Moderate.focus();return false;}if(!vd(PublicTransport_expensive)){document.frmManageBudgetItems.PublicTransport_Expensive.focus();return false;}return(false);}cond1=(parseFloat(PublicTransport_moderate)>parseFloat(PublicTransport_budget));cond2=(parseFloat(PublicTransport_expensive)>parseFloat(PublicTransport_budget)&&parseFloat(PublicTransport_expensive)>parseFloat(PublicTransport_moderate));if(!cond1&&parseFloat(PublicTransport_budget)>0&&parseFloat(PublicTransport_moderate)>0){alert('Moderate cost for Public Transport should be greater than Budget cost.');return(false);}else if(!cond2){if(parseFloat(PublicTransport_budget)>0&&parseFloat(PublicTransport_moderate)>0&&parseFloat(PublicTransport_expensive)>0){alert('Expensive cost for Public Transport should be greather than Budget and Moderate costs.');return(false);}else if(parseFloat(PublicTransport_budget)>0&&parseFloat(PublicTransport_expensive)>0){alert('Expensive cost for Public Transport should be greather than Budget cost.');return(false);}else if(parseFloat(PublicTransport_moderate)>0&&parseFloat(PublicTransport_expensive)>0){alert('Expensive cost for Public Transport should be greather than Moderate cost.');return(false);}}PrivateTransport_budget=document.frmManageBudgetItems.PrivateTransport_Budget.value;PrivateTransport_moderate=document.frmManageBudgetItems.PrivateTransport_Moderate.value;PrivateTransport_expensive=document.frmManageBudgetItems.PrivateTransport_Expensive.value;if(PrivateTransport_budget==''||PrivateTransport_moderate==''||PrivateTransport_expensive==''){alert('Please enter all cost for Private Transport.');if(PrivateTransport_budget==''){document.frmManageBudgetItems.PrivateTransport_Budget.focus();return false;}if(PrivateTransport_moderate==''){document.frmManageBudgetItems.PrivateTransport_Moderate.focus();return false;}if(PrivateTransport_expensive==''){document.frmManageBudgetItems.PrivateTransport_Expensive.focus();return false;}return(false);}PrivateTransport_comments=document.frmManageBudgetItems.PrivateTransportComment.value;if(bValidate(document.frmManageBudgetItems.PrivateTransportComment,"BudgetComments","False","Comments for Private Transport")==false){return(false);}else if(!vd(PrivateTransport_budget)||!vd(PrivateTransport_moderate)||!vd(PrivateTransport_expensive)){alert('All cost for Private Transport should be numeric or zero.');if(!vd(PrivateTransport_budget)){document.frmManageBudgetItems.PrivateTransport_Budget.focus();return false;}if(!vd(PrivateTransport_moderate)){document.frmManageBudgetItems.PrivateTransport_Moderate.focus();return false;}if(!vd(PrivateTransport_expensive)){document.frmManageBudgetItems.PrivateTransport_Expensive.focus();return false;}return(false);}cond1=(parseFloat(PrivateTransport_moderate)>parseFloat(PrivateTransport_budget));cond2=(parseFloat(PrivateTransport_expensive)>parseFloat(PrivateTransport_budget)&&parseFloat(PrivateTransport_expensive)>parseFloat(PrivateTransport_moderate));if(!cond1&&parseFloat(PrivateTransport_budget)>0&&parseFloat(PrivateTransport_moderate)>0){alert('Moderate cost for Private Transport should be greater than Budget cost.');return(false);}else if(!cond2){if(parseFloat(PrivateTransport_budget)>0&&parseFloat(PrivateTransport_moderate)>0&&parseFloat(PrivateTransport_expensive)>0){alert('Expensive cost for Private Transport should be greather than Budget and Moderate costs.');return(false);}else if(parseFloat(PrivateTransport_budget)>0&&parseFloat(PrivateTransport_expensive)>0){alert('Expensive cost for Private Transport should be greather than Budget costs.');return(false);}else if(parseFloat(PrivateTransport_moderate)>0&&parseFloat(PrivateTransport_expensive)>0){alert('Expensive cost for Private Transport should be greather than Moderate costs.');return(false);}}LLS_frmdate=document.frmManageBudgetItems.LLS_frmdate.value;LLS_todate=document.frmManageBudgetItems.LLS_todate.value;LHS_frmdate=document.frmManageBudgetItems.LHS_frmdate.value;LHS_todate=document.frmManageBudgetItems.LHS_todate.value;var result=CkeckDateOverLapping(LLS_frmdate,LLS_todate,LHS_frmdate,LHS_todate);if(!result){return(false);}LodgingHighSeason=LodgingHighSeason_budget+'-'+LodgingHighSeason_moderate+'-'+LodgingHighSeason_expensive;Lodging=Lodging_budget+'-'+Lodging_moderate+'-'+Lodging_expensive;Dining=Dining_budget+'-'+Dining_moderate+'-'+Dining_expensive;Sightseeing=Sightseeing_budget+'-'+Sightseeing_moderate+'-'+Sightseeing_expensive;Entretainment=Entretainment_budget+'-'+Entretainment_moderate+'-'+Entretainment_expensive;Shopping=Shopping_budget+'-'+Shopping_moderate+'-'+Shopping_expensive;PublicTransport=PublicTransport_budget+'-'+PublicTransport_moderate+'-'+PublicTransport_expensive;PrivateTransport=PrivateTransport_budget+'-'+PrivateTransport_moderate+'-'+PrivateTransport_expensive;var array={'countryID':countryID,'cityID':cityID,'action':action,'Type':mode,'TravelExpert_UserID':UserID,'LLS_frmdate':LLS_frmdate,'LLS_todate':LLS_todate,'LHS_frmdate':LHS_frmdate,'LHS_todate':LHS_todate,'Lodging':Lodging,'LodgingComments':Lodging_comments,'LodgingHighSeason':LodgingHighSeason,'LodgingHighSeasonComments':LodgingHighSeason_comments,'Dining':Dining,'DiningComments':Dining_comments,'Sightseeing':Sightseeing,'SightseeingComments':Sightseeing_comments,'Entretainment':Entretainment,'EntretainmentComments':Entertainment_comments,'Shopping':Shopping,'ShoppingComments':Shopping_comments,'PublicTransport':PublicTransport,'PublicTransportComments':PublicTransport_comments,'PrivateTransport':PrivateTransport,'PrivateTransportComments':PrivateTransport_comments};formData=ued_encode(array);SendRequest("saveBudgetItems.php",'post','savebudgeItems');}function planFromBudget(){recalculate('addToMyTrip');displayPannelVisibility=0;isCommingFromHomePage=true;isCommingFromBudgetPage=true;isItineraryBudgetEdit=false;var startDate=document.budgetPlannerfrm.arival_date.value;var currentDate=new Date();var sysDate=new Date(currentDate.getFullYear(),currentDate.getMonth(),currentDate.getDate());var arrivalDate=new Date(startDate.split("/")[2],parseInt(extractNumber(startDate.split("/")[0]))-1,extractNumber(startDate.split("/")[1]));if(arrivalDate.getTime()<sysDate.getTime()){alert("Your arrival time is in the past, please adjust your arrival.");return false;}if(global_start_location==0){global_start_location=1;}gbl_startingLocationType="city";gblAttractionAvailabilityChecked=false;for(var cnt=0;cnt<gbl_budgetObj.length;cnt++){if(gbl_budgetObj[cnt].cityid==globaBudgetCityID){var CityTravelerCount=gbl_budgetObj[cnt].noOfTraveler;var CityID=gbl_budgetObj[cnt].cityid;var CityName=gbl_budgetObj[cnt].cityname;var CityCountry=gbl_budgetObj[cnt].country;var CityCurrency=gbl_budgetObj[cnt].Currency;var currencyCode=gbl_budgetObj[cnt].currencyCode;break;}}if(CityCurrency==149){gbl_userPrefCurrencyDetails=new CLSCurrencyDetails('USD','$',1,'0000-00-00');}var dayOfStay=parseInt(document.budgetPlannerfrm.stay_for.value);var endDate=new Date(startDate.split("/")[2],parseInt(extractNumber(startDate.split("/")[0]))-1,extractNumber(startDate.split("/")[1]));var endDateTime=endDate.getTime();endDateTime=endDateTime+((dayOfStay-1)*ONE_DAY);endDate=getFormatedDate(new Date(endDateTime));endDate=endDate.split("-")[1]+'/'+endDate.split("-")[2]+'/'+endDate.split("-")[0];if(startDate==""||arrivalDate<sysDate){alert("Arrival date should be equal to or greater than todays date");return(false);}var	tripEndTime='21:00:00';tripEndTime=(global_CityAirportInfoObj["DepartTime"]=="")?'21:00:00':global_CityAirportInfoObj["DepartTime"];var starttime=(global_CityAirportInfoObj["ArrivalTime"]!='')?global_CityAirportInfoObj["ArrivalTime"]:'09:00:00';var CityStartdate=(startDate!='')?startDate:global_CityAirportInfoObj["StartDate"];var CityEnddate=(endDate!='')?endDate:global_CityAirportInfoObj["EndDate"];if(CityStartdate==CityEnddate&&starttime==tripEndTime){tripEndTime='21:00:00';}var CityArrivalTime=starttime;var CityDepartTime=tripEndTime;var CityGroup=document.budgetPlannerfrm.rooms.value;var CityLocationID=(global_CityAirportInfoObj["LocationID"]!='')?global_CityAirportInfoObj["LocationID"]:"";var CityTravelerCount=(CityTravelerCount!='')?CityTravelerCount:global_CityAirportInfoObj["TravelerCount"];var CityCurrency=document.budgetPlannerfrm.currency.value;if(global_prev_start_location==1&&(global_CityAirportInfoObj["Startdate"]!=CityStartdate||global_CityAirportInfoObj["Enddate"]!=CityEnddate||global_CityAirportInfoObj["Name"]!=CityName)){var itiResult=checkItinerarySaved('MyTrips');if(!itiResult){gblUserActionBeforeSave="Budget";return;}}var departure_airportType='';var id=CityID;var airportname='';var transportationstr='';var global_location='';var groupid=CityGroup;var splInterestList='';var travellerpriority=1;var transportationid=0;var arrival_airporttype='';var arrivaldate=CityStartdate;var departuredate=CityEnddate;var travellercount=CityTravelerCount;var defaultTransportCost="1";global_travellerpriority_org="1";global_location_uri='cities/'+CityID;var tempcity;var countryCnt=searchItem(gbl_CityList,CityName,true,"cityDetails");if(countryCnt!=-1){CityCountry=gbl_CityList[countryCnt].CityCountry;global_airportorcity=gbl_CityList[countryCnt].CityId;defaultCityTransportCost=gbl_CityList[countryCnt].TransportCost;}gbl_isPlanNowRequested=false;gbl_Show_Budget=true;global_airportorcity=CityID;global_CityAirportInfoObj=new CLSCityAirportInfo(CityArrivalTime,CityDepartTime,CityTravelerCount,CityID,CityName,CityStartdate,CityEnddate,CityGroup,CityLocationID,CityID,CityCountry,defaultTransportCost,CityCurrency,1,'');var mppURL="/cities/"+CityID;var cookieUri="CookieStorageController.php?startLocation="+global_start_location;cookieUri+="&ArrivalTime="+CityArrivalTime;cookieUri+="&DepartTime="+CityDepartTime;cookieUri+="&TravelerCount="+CityTravelerCount;cookieUri+="&ID="+CityID;cookieUri+="&Name="+CityName;cookieUri+="&Startdate="+CityStartdate;cookieUri+="&Enddate="+CityEnddate;cookieUri+="&Room="+CityGroup;cookieUri+="&LocationID="+CityLocationID;cookieUri+="&TripCurrency="+global_CityAirportInfoObj["TripCurrency"];cookieUri+="&RequestType="+COOKIE_STORE;showLoadingImages();SendRequest(cookieUri,"get","cookieInfoStorage");setpagevalues(global_start_location,id,starttime,tripEndTime,travellercount,travellerpriority,arrivaldate,departuredate,transportationid,arrival_airporttype,departure_airportType,airportname,transportationstr,'',groupid,splInterestList,1);flag_city_executed=1;gblIsCityExists=true;if(gbl_inNBC){gbl_inNBC=false;}sendCityReqeust(mppURL,CityName);}function RESIZE_IMAGE(maxwidth,maxheight,imageToBeResize){var ImageWidth=0;var ImageHeight=0;if(typeof(document.images["attractionimage"])=='object'){var imgNew=new Image();imgNew.src=document.getElementById('attractionimage').src;var imgWidth=imgNew.width;var imgHeight=imgNew.height;ImageWidth=imgWidth;ImageHeight=imgHeight;}else if(typeof(document.images[imageToBeResize])=='object'){if(imageToBeResize=="homepageMainAttrImg"){if(!isMacOS){if(DOCWIDTH<=1024){if(typeof(document.images[imageToBeResize])=='object'){document.images[imageToBeResize].style.display="";}return;}}}var imgNew=new Image();imgNew.src=document.getElementById(imageToBeResize).src;var imgWidth=imgNew.width;var imgHeight=imgNew.height;ImageWidth=imgWidth;ImageHeight=imgHeight;}var iwidth=0;var iheight=0;var ratio=0;var tmpDifference=0;var XByYRatio=ImageHeight/ImageWidth;if(XByYRatio==1.8){document.images[imageToBeResize].style.display="";if(imageToBeResize=="attractionimage"){ImageWidth=240;ImageHeight=432;document.images[imageToBeResize].width=ImageWidth;document.images[imageToBeResize].height=ImageHeight;}else{if(imageToBeResize.match("myTripsImage")){document.images[imageToBeResize].width=MYTRIPSVERTICALIMAGEWIDTH;document.images[imageToBeResize].height=MYTRIPSVERTICALIMAGEHEIGHT;}}showVerticalDesFlag=true;FWVerticalPanelShow=true;if(imageToBeResize=="attractionimage"){if(document.getElementById("attractionimageDiv")){if(document.getElementById("attractionimageDiv").style.display!="none"){displayVerticalDesc(showVerticalDesFlag,imgNew.src);}}}}else if(XByYRatio>=1.5&&XByYRatio!=1.8){if(ImageWidth>ImageHeight){iwidth=maxwidth;ratio=(ImageWidth/iwidth);iheight=parseInt(ImageHeight/ratio);}else{iheight=maxheight;ratio=(ImageHeight/iheight);iwidth=parseInt(ImageWidth/ratio);}if(iwidth>maxwidth){tmpDifference=iwidth-maxwidth;iwidth=maxwidth;iheight=parseInt(iheight-(tmpDifference/ratio));}if(iheight>maxheight){tmpDifference=iheight-maxheight;iheight=maxheight;iwidth=parseInt(iwidth-(tmpDifference/ratio));}if(iwidth>0){document.images[imageToBeResize].width=iwidth;}if(iheight>0){document.images[imageToBeResize].height=iheight;}if(typeof(document.images[imageToBeResize])=='object'){document.images[imageToBeResize].style.display="";}showVerticalDesFlag=true;FWVerticalPanelShow=true;if(imageToBeResize=="attractionimage"){if(document.getElementById("attractionimageDiv")){if(document.getElementById("attractionimageDiv").style.display!="none"){displayVerticalDesc(showVerticalDesFlag);}}}}else{FWVerticalPanelShow=false;showVerticalDesFlag=true;if(imageToBeResize=="attractionimage"){displayVerticalDesc(true);}if(ImageWidth>ImageHeight){iwidth=maxwidth;ratio=(ImageWidth/iwidth);iheight=parseInt(ImageHeight/ratio);}else{iheight=maxheight;ratio=(ImageHeight/iheight);iwidth=parseInt(ImageWidth/ratio);}if(iwidth>maxwidth){tmpDifference=iwidth-maxwidth;iwidth=maxwidth;iheight=parseInt(iheight-(tmpDifference/ratio));}if(iheight>maxheight){tmpDifference=iheight-maxheight;iheight=maxheight;iwidth=parseInt(iwidth-(tmpDifference/ratio));}if(imageToBeResize.match("myTrips")){if(iwidth>0){document.images[imageToBeResize].width=iwidth;}if(iheight>0){document.images[imageToBeResize].height=iheight;}}else{if(imageToBeResize=="homepageMainAttrImg"){if(isMacOS){if(iwidth>0){iwidth=710;document.images[imageToBeResize].width=iwidth;}if(iheight>0){iheight=340;document.images[imageToBeResize].height=iheight;}}}else{if(iwidth>0){iwidth=398;document.images[imageToBeResize].width=iwidth;}if(iheight>0){iheight=265;document.images[imageToBeResize].height=iheight;}}}if(typeof(document.images[imageToBeResize])=='object'){document.images[imageToBeResize].style.display="";}}if(document.getElementById("attractionimageDiv")){if(isIE){document.getElementById("attractionimageDiv").style.height=iheight+" px";}else{if(document.getElementById("attractionimageDiv").style.display!="none"){document.getElementById("attractionimageDiv").setAttribute("style","height: "+iheight+" px; width:100%;");}}}if(document.getElementById("attractionimageDiv")){setFWColumnsHeight();}if(imageToBeResize=="homepageMainAttrImg"){var tblDisplayPanelContentObj=document.getElementById("tblDisplayPanelContent");if(tblDisplayPanelContentObj){if(iheight>200){tblDisplayPanelContentObj.height=iheight;HomePageImgHeight=iheight;}}}}function setBudgetItem(flag,Item){switch(Item){case'lodging':if(flag==false){lodgingActive=false;document.budgetPlannerfrm.lodging_dc_display.disabled="disabled";document.budgetPlannerfrm.lodging_tc.disabled="disabled";}else{lodgingActive=true;document.budgetPlannerfrm.lodging_dc_display.disabled="";document.budgetPlannerfrm.lodging_tc.disabled="";}break;case'dining':if(flag==false){diningActive=false;document.budgetPlannerfrm.dining_dc_display.disabled="disabled";document.budgetPlannerfrm.dining_tc.disabled="disabled";}else{diningActive=true;document.budgetPlannerfrm.dining_dc_display.disabled="";document.budgetPlannerfrm.dining_tc.disabled="";}break;case'shopping':if(flag==false){shoppingActive=false;document.budgetPlannerfrm.shopping_dc_display.disabled="disabled";document.budgetPlannerfrm.shopping_tc.disabled="disabled";}else{shoppingActive=true;document.budgetPlannerfrm.shopping_dc_display.disabled="";document.budgetPlannerfrm.shopping_tc.disabled="";}break;case'garound':if(flag==false){garoundActive=false;document.budgetPlannerfrm.garound_dc_display.disabled="disabled";document.budgetPlannerfrm.garound_tc.disabled="disabled";}else{garoundActive=true;document.budgetPlannerfrm.garound_dc_display.disabled="";document.budgetPlannerfrm.garound_tc.disabled="";}break;case'sight':if(flag==false){sightActive=false;document.budgetPlannerfrm.sight_dc_display.disabled="disabled";document.budgetPlannerfrm.sight_tc.disabled="disabled";}else{sightActive=true;document.budgetPlannerfrm.sight_dc_display.disabled="";document.budgetPlannerfrm.sight_tc.disabled="";}break;case'ement':if(flag==false){ementActive=false;document.budgetPlannerfrm.ement_dc_display.disabled="disabled";document.budgetPlannerfrm.ement_tc.disabled="disabled";}else{ementActive=true;document.budgetPlannerfrm.ement_dc_display.disabled="";document.budgetPlannerfrm.ement_tc.disabled="";}break;case'getting':if(flag==false){gettingActive=false;document.budgetPlannerfrm.getting_tc_display.disabled="disabled";}else{gettingActive=true;document.budgetPlannerfrm.getting_tc_display.disabled="";}break;case'misce':if(flag==false){misceActive=false;document.budgetPlannerfrm.misce_dc_display.disabled="disabled";document.budgetPlannerfrm.misce_tc.disabled="disabled";}else{misceActive=true;document.budgetPlannerfrm.misce_dc_display.disabled="";document.budgetPlannerfrm.misce_tc.disabled="";}break;}recalculate('addToMyTrip');}function calculateThisTripCost(tripBoxId,dailyCost,perticularType){var transport=document.budgetPlannerfrm.transport.value;var currency=document.budgetPlannerfrm.currency.value;var no_travelers=parseInt(document.budgetPlannerfrm.no_travelers.value);var rooms=parseInt(document.budgetPlannerfrm.rooms.value);var stay_for=parseInt(document.budgetPlannerfrm.stay_for.value);var tripCostObj=document.getElementById(tripBoxId);var strNum=""+dailyCost+"";var exchangeRateFactor=1;strNum=strNum.replace(/,/,"");var strNumlen=strNum.length;var cond=(strNum.indexOf('.')==-1);if(!cond){strNum=strNum.replace(/,/,"");strNum=strNum.split(".")[0];strNumlen=strNum.length;}if(strNumlen<6){dailyCost=parseFloat(dailyCost.replace(/,/g,""));if(gblBudgetSavedCurrencyRate!=global_exchange_rate){exchangeRateFactor=global_exchange_rate;}if(tripCostObj){switch(perticularType){case 0:if(exchangeRateFactor!=1){document.budgetPlannerfrm.getting_tc.value=dailyCost*exchangeRateFactor;}break;case Lodging_pid:if(rooms){tripCostObj.value=(dailyCost*rooms*stay_for).toFixed(2);}else{tripCostObj.value=(dailyCost*stay_for).toFixed(2);}if(exchangeRateFactor!=1){document.budgetPlannerfrm.lodging_dc.value=dailyCost*exchangeRateFactor;}break;case Dining_pid:tripCostObj.value=(dailyCost*no_travelers*stay_for).toFixed(2);if(exchangeRateFactor!=1){document.budgetPlannerfrm.dining_dc.value=dailyCost*exchangeRateFactor;}break;case Sightseeing_pid:tripCostObj.value=(dailyCost*no_travelers*stay_for).toFixed(2);if(exchangeRateFactor!=1){document.budgetPlannerfrm.sight_dc.value=dailyCost*exchangeRateFactor;}break;case Entertainment_pid:tripCostObj.value=(dailyCost*no_travelers*stay_for).toFixed(2);if(exchangeRateFactor!=1){document.budgetPlannerfrm.ement_dc.value=dailyCost*exchangeRateFactor;}break;case GettingAround_pid:if(transport==PrivateTransport_pid){var noOfTravelers=parseInt(no_travelers/4);var noOfTravelersDeno=no_travelers%4;if(noOfTravelersDeno!=0){noOfTravelers++;}}else{var noOfTravelers=no_travelers;}tripCostObj.value=(dailyCost*noOfTravelers*stay_for).toFixed(2);if(exchangeRateFactor!=1){document.budgetPlannerfrm.garound_dc.value=dailyCost*exchangeRateFactor;}break;case Shopping_pid:tripCostObj.value=(dailyCost);if(exchangeRateFactor!=1){document.budgetPlannerfrm.shopping_dc.value=dailyCost*exchangeRateFactor;}break;case Miscellaneous_pid:tripCostObj.value=(dailyCost*no_travelers*stay_for).toFixed(2);if(exchangeRateFactor!=1){document.budgetPlannerfrm.misce_dc.value=dailyCost*exchangeRateFactor;}break;}recalculate('addToMyTrip');}}}function CkeckDateOverLapping(LLS_frmdate,LLS_todate,LHS_frmdate,LHS_todate){var	todayDate=new Date();var	LLS_frmdate=new Date(todayDate.getFullYear(),parseInt(extractNumber(LLS_frmdate.split("/")[0]))-1,extractNumber(LLS_frmdate.split("/")[1]));var	LLS_todate=new Date(todayDate.getFullYear(),parseInt(extractNumber(LLS_todate.split("/")[0]))-1,extractNumber(LLS_todate.split("/")[1]));var	LHS_frmdate=new Date(todayDate.getFullYear(),parseInt(extractNumber(LHS_frmdate.split("/")[0]))-1,extractNumber(LHS_frmdate.split("/")[1]));var	LHS_todate=new Date(todayDate.getFullYear(),parseInt(extractNumber(LHS_todate.split("/")[0]))-1,extractNumber(LHS_todate.split("/")[1]));var	LLS_frmdateTime=LLS_frmdate.getTime();var	LLS_todateTime=LLS_todate.getTime();var	LHS_frmdateTime=LHS_frmdate.getTime();var	LHS_todateTime=LHS_todate.getTime();var	cond5=(LLS_todateTime<LLS_frmdateTime);var	cond7=(LHS_frmdateTime>LLS_todateTime&&LHS_todateTime>LLS_frmdateTime);var	cond10=(LHS_todateTime<LLS_frmdateTime&&LHS_frmdateTime<LLS_todateTime);var	cond6=(LHS_todateTime<LHS_frmdateTime);var	cond8=(LLS_frmdateTime<LHS_todateTime);var	cond9=(LLS_todateTime>LHS_frmdateTime);var	cond1=(LHS_frmdateTime<=LLS_todateTime&&LHS_frmdateTime>LLS_frmdateTime);var	cond2=(LLS_frmdateTime>LHS_frmdateTime&&LLS_frmdateTime<LHS_todateTime);var	cond3=(LLS_frmdateTime==LHS_frmdateTime);var	cond4=(LLS_frmdateTime==LHS_todateTime);if(cond5&&cond7){alert('From Date for Lodging High Season falls between Lodging Low Season Dates.');return(false);}else if(cond5&&cond10){alert('To Date for Lodging Low Season falls between Lodging High Season Dates.');return(false);}else if(cond6&&cond8){alert('From Date for Lodging Low Season falls between Lodging High Season Dates.');return(false);}else if(cond6&&cond9){alert('To Date for Lodging Low Season falls between Lodging High Season Dates.');return(false);}if(cond1){alert('From Date for Lodging High Season falls between Lodging Low Season Dates.');return(false);}else if(cond2){alert('From Date for Lodging Low Season falls between Lodging High Season Dates.');return(false);}else if(cond3){alert('From Date for Lodging Low Season and Lodging High Season can not be same.');return(false);}else if(cond4){alert('From Date for Lodging Low Season and To Date For Lodging High Season can not be same.');return(false);}return true;}function cancelWindow(){gblIsSaveRequested=false;gbl_isItineraryCreated=false;if('headerpage_ibtnhome'==gblUserEvent){gblUserEvent='';}if(gblUserEvent=='loadBudgetPage'){gblActionBeforeRegister="";SendRequest("budgetPlanner.php","get","budgetPlannerLoad");}else if(gblPageBeforeRegister=="attractionBrowser"){gblPreviousStartLocationName="";getLandingPage();gblPageBeforeRegister="";attractionpage_load_fn();}else if('TravelerListPage'==gblPageBeforeRegister){gblPageBeforeRegister="";renderview("loadpage",'');SendRequest('TravelersList.php','get','displayTravelersList');}else{global_PreviousURL='';gblUserEvent='';handleEvent('headerpage_ibtnhome');}}function checkCookies(){SendRequest("CookieStorageController.php?RequestType="+8,'post','chkPartnerCookies');}function checkEmailCookies(){SendRequest("CookieStorageController.php?RequestType="+8,'post','chkEmailCookies');}function formatTime(timeString,format){var timeInHr=0,timeInMin=0,timeInSec=0,mode="";var timeArr=new Array();var separator="";var timeStringFormatted;if(timeString&&timeString!=""){if(timeString.match(":")!=-1){separator=":";}else if(timeString.match("/")!=-1){separator="/";}if(!isNaN(timeString)){}else{timeArr=timeString.split(separator);timeInHr=timeArr[0];if(timeInHr.substr(0,1)=="0"){timeInHr=timeInHr.substr(1);}timeInMin=timeArr[1];if(timeInMin.substr(0,1)=="0"){timeInMin=timeInMin.substr(1);}timeInSec=(timeArr.length>2)?timeArr[2]:0;if(parseInt(timeInHr)>=12){mode="PM";}else{mode="AM";}switch(format){case"HR:MM AM/PM":if(parseInt(timeInHr)>12){timeInHr=parseInt(timeInHr)-12;if(timeInHr==0){mode="AM";}}if(parseInt(timeInHr)<10){timeInHr="0"+parseInt(timeInHr);}if(parseInt(timeInMin)<10){timeInMin="0"+parseInt(timeInMin);}timeStringFormatted=timeInHr+separator+timeInMin+" "+mode;break;}}return timeStringFormatted;}return timeString;}function getNextList(UserAction){var bidRequestId,bidType;if(UserAction=='BudgetPreference'||UserAction=='UpdateBudgetPreference'){gblBidRequestFrm='Budget';bidRequestId=gbl_BudgetId;bidType='2';}else{gblBidRequestFrm='Itinerary';bidRequestId=gbl_ItineraryId;bidType='1';}var frmObj=document.frmBidRequest;var budgetTypeObj,transferObj,flightsTypeObj,insuranceObj,groupTypeObj,commentObj,contactTypeObj;var budgetType='',flightsType='',contactObj='',contactType='',tourType='',transfer=0,insurance=0,userCommentObj='';budgetTypeObj=frmObj.rdoBudget;for(var rhCnt=0;rhCnt<budgetTypeObj.length;rhCnt++){if(budgetTypeObj[rhCnt].checked){budgetType=budgetTypeObj[rhCnt].value;break;}}flightsTypeObj=frmObj.rdoFlights;for(var rfCnt=0;rfCnt<flightsTypeObj.length;rfCnt++){if(flightsTypeObj[rfCnt].checked){flightsType=flightsTypeObj[rfCnt].value;break;}}transferObj=frmObj.chkInternalTransfer;if(transferObj.checked){transfer=1;}groupTypeObj=frmObj.rdoGroups;for(var rgCnt=0;rgCnt<groupTypeObj.length;rgCnt++){if(groupTypeObj[rgCnt].checked){tourType=groupTypeObj[rgCnt].value;break;}}insuranceObj=frmObj.chkInsurance;if(insuranceObj.checked){insurance=1;}userCommentObj=frmObj.txtComments.value;if(userCommentObj.match("Tell us more about your")){userCommentObj="";}contactObj=frmObj.rdoContactType;for(var rcCnt=0;rcCnt<contactObj.length;rcCnt++){if(contactObj[rcCnt].checked){contactType=contactObj[rcCnt].value;contactDetails=frmObj.txtPhoneEmail[rcCnt].value;if(contactType=="Phone"){if(bValidate(frmObj.txtPhoneEmail[rcCnt],"Phone","True","Phone Number")==false){}}else if(contactType=="Email"){if(bValidate(frmObj.txtPhoneEmail[rcCnt],"Email","True","Email Address")==false){}}break;}}if(contactType==''||contactDetails==''){}var itineraryDetailList={'action':UserAction,'itineraryID':bidRequestId,'hotelPreference':budgetType,'flightPreference':flightsType,'transfer':transfer,'tourType':tourType,'insurance':insurance,'commentObj':userCommentObj,'contactType':contactType,'contactDetails':contactDetails,'bidType':bidType};formData=ued_encode(itineraryDetailList);SendRequest('/itinerary/BidPreference',"post","BidPreference");}function getNextSPList(){var bidRequestId,bidType;var UserAction=gbl_userAction;if(UserAction=='BudgetPreference'||UserAction=='UpdateBudgetPreference'){gblBidRequestFrm='Budget';bidRequestId=gbl_BudgetId;bidType='2';}else{gblBidRequestFrm='Itinerary';bidRequestId=gbl_ItineraryId;bidType='1';}var frmObj=document.frmBidRequest;var budgetTypeObj,transferObj,flightsTypeObj,insuranceObj,groupTypeObj,commentObj,contactTypeObj;var budgetType='',flightsType='',contactObj='',contactType='',tourType='',transfer=0,insurance=0,userCommentObj='';budgetTypeObj=frmObj.rdoBudget;for(var rhCnt=0;rhCnt<budgetTypeObj.length;rhCnt++){if(budgetTypeObj[rhCnt].checked){budgetType=budgetTypeObj[rhCnt].value;break;}}flightsTypeObj=frmObj.rdoFlights;for(var rfCnt=0;rfCnt<flightsTypeObj.length;rfCnt++){if(flightsTypeObj[rfCnt].checked){flightsType=flightsTypeObj[rfCnt].value;break;}}transferObj=frmObj.chkInternalTransfer;if(transferObj.checked){transfer=1;}groupTypeObj=frmObj.rdoGroups;for(var rgCnt=0;rgCnt<groupTypeObj.length;rgCnt++){if(groupTypeObj[rgCnt].checked){tourType=groupTypeObj[rgCnt].value;break;}}insuranceObj=frmObj.chkInsurance;if(insuranceObj.checked){insurance=1;}userCommentObj=frmObj.txtComments.value;if(userCommentObj.match("Tell us more about your")){userCommentObj="";}contactObj=frmObj.rdoContactType;for(var rcCnt=0;rcCnt<contactObj.length;rcCnt++){if(contactObj[rcCnt].checked){contactType=contactObj[rcCnt].value;contactDetails=frmObj.txtPhoneEmail[rcCnt].value;if(contactType=="Phone"){if(bValidate(frmObj.txtPhoneEmail[rcCnt],"Phone","True","Phone Number")==false){return false;}}else if(contactType=="Email"){if(bValidate(frmObj.txtPhoneEmail[rcCnt],"Email","True","Email Address")==false){return false;}}break;}}if(contactType==''||contactDetails==''){alert("Please provide contact details");return false;}var HashLocationName=document.location.href;var splistHashURL=getBidSPListHashURL(HashLocationName);splistHashURLStr=splistHashURL.split("#")[1];splistHashURL="#"+splistHashURLStr;showLoadingImages();RedirectURLLocation(splistHashURL);}function getBudgetSPList(){var city=document.budgetPlannerfrm.City.selectedIndex;if(city==-1){alert('Please select city.');return false;}var Region=document.budgetPlannerfrm.Region.value;if(Region==0||Region==-1){alert('Please select country.');return false;}var country=document.budgetPlannerfrm.Region[document.budgetPlannerfrm.Region.selectedIndex].innerHTML;var cityId=document.budgetPlannerfrm.City.value;var CityTravelerCount=document.budgetPlannerfrm.no_travelers.value;var CityStartdate=document.budgetPlannerfrm.arival_date.value;var dayOfStay=document.budgetPlannerfrm.stay_for.value;var currentDate=new Date();var sysDate=new Date(currentDate.getFullYear(),currentDate.getMonth(),currentDate.getDate());var arrivalDate=new Date(CityStartdate.split("/")[2],parseInt(extractNumber(CityStartdate.split("/")[0]))-1,extractNumber(CityStartdate.split("/")[1]));if(arrivalDate.getTime()<sysDate.getTime()){CityStartdate=(sysDate.getTime())+ONE_DAY;CityStartdate=getFormatedDate(new Date(CityStartdate));CityStartdate=CityStartdate.split("-")[1]+'/'+CityStartdate.split("-")[2]+'/'+CityStartdate.split("-")[0];}var CityEnddate=new Date(CityStartdate.split("/")[2],parseInt(extractNumber(CityStartdate.split("/")[0]))-1,extractNumber(CityStartdate.split("/")[1]));var CityEnddate=CityEnddate.getTime();CityEnddate=CityEnddate+(dayOfStay*ONE_DAY);CityEnddate=getFormatedDate(new Date(CityEnddate));CityEnddate=CityEnddate.split("-")[1]+'/'+CityEnddate.split("-")[2]+'/'+CityEnddate.split("-")[0];var CityGroup=document.budgetPlannerfrm.rooms.value;var CityTransportation=document.budgetPlannerfrm.transport.value;var CityCurrency=document.budgetPlannerfrm.currency.value;gblIsRequestProposal=true;addToMyTrip();gblBidRequestFrm="Budget";global_CityAirportInfoObj=new CLSCityAirportInfo("09:00:00","09:00:00",CityTravelerCount,cityId,city,CityStartdate,CityEnddate,CityGroup,'',cityId,country,'',CityCurrency,1,'');}function getBidBudget(){gblIsRequestProposal=true;gblBidRequestFrm="Budget";addToMyTrip();}function sendCityReqeust(cityRequest,cityName){var isCityExists=false;if(gbl_arrAllCities){var loc=global_CityAirportInfoObj["LocationID"];gblPreviousDestination=new CLSVacationCityBase(global_airportid,cityName,gbl_arrAllCities,gbl_arrAllLocations,gbl_arrAllAttractions,gbl_arrAllHotels,gbl_arrAllServices,gbl_arrAllLogisticals,gbl_arrAllTravelDetails,gbl_arrAllImages,gbl_arrHotelServices,gbl_arrAllHolidays,gbl_arrAllAdvertisement,gblLocationDurationArray,gbl_arrRestaurants,gbl_arrViatorTours,gbl_arrViatorPass,gblObjArrLocation,gbl_arrAttractionServices,loc,'');}if(gbl_arrAllCities&&gbl_arrAllCities.length>0&&gbl_arrAllLocations&&gbl_arrAllLocations.length>0){if((global_prev_start_location!=global_start_location&&cityName==gbl_arrAllCities[0].name)||(cityName==gbl_arrAllCities[0].name&&isCommingFromBudgetPage)){if(global_start_location==3){for(var vacationCnt=0;vacationCnt<gbl_arrAllVacationCity.length;vacationCnt++){if(gbl_arrAllVacationCity[vacationCnt].name==cityName){isCityExists=true;break;}}if(isCityExists==false){if(gbl_arrRestaurants.length>0&&global_startingLocationName.toLowerCase()!=gbl_arrRestaurants[0].addressDetailObj.city.toLowerCase()){gbl_arrRestaurants=new Array();}if(gbl_arrViatorTours.length>0&&global_startingLocationName.toLowerCase()!=gbl_arrViatorTours[0].city.toLowerCase()){gbl_arrViatorTours=new Array();}if(gbl_arrViatorPass.length>0&&global_startingLocationName.toLowerCase()!=gbl_arrViatorPass[0].city.toLowerCase()){gbl_arrViatorPass=new Array();}gbl_arrAllVacationCity[gbl_arrAllVacationCity.length]=new CLSVacationCityBase(global_location_uri.split("/")[2],cityName,gbl_arrAllCities,gbl_arrAllLocations,gbl_arrAllAttractions,gbl_arrAllHotels,gbl_arrAllServices,gbl_arrAllLogisticals,gbl_arrAllTravelDetails,gbl_arrAllImages,gbl_arrHotelServices,gbl_arrAllHolidays,gbl_arrAllAdvertisement,gblLocationDurationArray,gbl_arrRestaurants,gbl_arrViatorTours,gbl_arrViatorPass,gblObjArrLocation,gbl_arrAttractionServices,'',gbl_arrAllNearByCities);}}gbl_isDataRendered=true;if(isCommingFromBudgetPage){if(global_CityAirportInfoObj["StartType"]==1){gblMainURL=gbl_LandingPageURLHash+"&c="+customReplaceSpecialChar(global_CityAirportInfoObj["Name"]);RedirectURLLocation(gblMainURL);isCommingFromBudgetPage=false;}}if(isEditItinerary){if(global_CityAirportInfoObj["StartType"]==1){gblMainURL=gbl_LandingPageURLHash+"&c="+customReplaceSpecialChar(global_CityAirportInfoObj["Name"]);RedirectURLLocation(gblMainURL);}}return;}}gblIsTSDataReceived=false,gblIsPartnerDataReceived=false;gblIsPartnerAddedInAutoSuggestList=false;gblIsCityPresent=true;gbl_mapFlag=0;gbl_objArrBudget=null;gbl_popularObj=null;gbl_interestsObj=null;gbl_objLocationLogisticals=new Array();gbl_objTimeLocation=null;gbl_objAirportLocation=null;gblABstringCache=new Array();gbl_arrAllCities=new Array();gbl_arrAllLogisticalName=new Array();gbl_arrAllLocations=new Array();gbl_arrAllAirports=new Array();gbl_arrAllTravelDetails=new Array();gbl_arrAllLogisticals=new Array();gbl_arrAllImages=new Array();gbl_arrAllAttractions=new Array();gbl_arrAllHotels=new Array();gbl_arrHotelServices=new Array();gbl_arrAttractionServices=new Array();gbl_arrAllServices=new Array();gbl_arrAllHolidays=new Array();gbl_arrAllAdvertisement=new Array();gblLocationDurationArray=new Array();gbl_arrRestaurants=new Array();gblObjLocationRestaurant=new Array();gbl_arrRestaurantIndexes=new Array();gbl_arrRestaurantIdentity=new Array();gbl_arrViatorTours=new Array();gbl_arrViatorPass=new Array();gbl_arrAllTypeLogisticals=new Array();gbl_arrAllAttractions=new Array();gbl_arrAllLocationsNBC=new Array();gbl_arrLocationsNBC=new Array();gbl_arrAllTravelDetailsNBC=new Array();gbl_arrTransportPricesNBC=new Array();arrTravelDetailsNBC=new Array();gbl_isMPPReceived=false;gbl_isPartnerMPPReceived=false;gbl_isNBCMPPReceived=false;addressDetailObjNBC=new Array();gbl_renderNBC=false;gbl_xmlobj_all="";gbl_xmlobj_allPartner="";gbl_xmlobj_allNearByCities=null;gblSelectedType="Attraction";showLoadingImages();logisticalSuggestionObj=new StateSuggestions();logisticalPartnerSuggestionObj=new StateSuggestions();SendRequest(cityRequest+"/showMPP","get","showMPP");SendRequest(cityRequest+"/showMPPPartner","get","showMPPPartner");SendRequest(cityRequest+"/showMPPNearCity","get","showMPPNearCity");}function dispBidTrips(spID){gblBiddingSPID=spID;if(gbl_arrMyItinerary.length<=0){SendRequest("TripList.php","get","triplist");}else{getItineraryBudget(gbl_ItineraryId);SendRequest('itenaryDetails.php?itineraryID='+gbl_ItineraryId,'get','showItenaryDetails');}}function displaySelectedCountry(dispFlag){global_start_location=4;if(dispFlag==1){global_airportid=gblCountryDetails.countryId;global_airportorcity=gblCountryDetails.countryId;global_startingLocationName=gblCountryDetails.countryName;gbl_arrRegions=gblCountryDetails.regionObj;gbl_arrAllCities=gblCountryDetails.cityObj;gbl_arrAllAttractions=gblCountryDetails.attractionsObj;gbl_arrAllHotels=gblCountryDetails.hotelsObj;gbl_arrAllLogisticals=gblCountryDetails.logisticalsObj;gbl_arrAllImages=gblCountryDetails.imagesObj;gbl_arrHotelServices=gblCountryDetails.hotelServicesObj;gbl_abMCItemIndex=0;gbl_arrLogisticalIndexes=new Array();}if(document.getElementById("lowerAB")){document.getElementById("lowerAB").style.display="none";if(document.getElementById("upperAB")){document.getElementById("upperAB").height="100%";}if(document.getElementById("attraction-list")){}}var iCntr=0;for(var tempCnt=0;tempCnt<gbl_arrCountries.length;tempCnt++){if(gbl_arrCountries[tempCnt].countryName==global_CountryInfoObj.CountryName){iCntr=tempCnt;break;}}if(document.getElementById("attractionheading1")){countryLink='<a class="WebClass_Heading" href="javascript:displaySelectedCountry(0);">'+gbl_arrCountries[iCntr].countryName+'</a>';document.getElementById("attractionheading1").innerHTML=countryLink;}if(document.getElementById("attractionheading")){document.getElementById('attractionheading').innerHTML=gbl_arrCountries[iCntr].countryName;}if(gbl_arrCountries[iCntr].countryDescription!=""&&gbl_arrCountries[iCntr].countryDescription!="null"){document.getElementById('attractiondescription').innerHTML=gbl_arrCountries[iCntr].countryDescription;}var imagePath_credits="";if(gbl_arrCountries[iCntr].imageDetailObj.imageName!=""&&gbl_arrCountries[iCntr].imageDetailObj.imageName!="null"&&gbl_arrCountries[iCntr].imageDetailObj.imageName!="NA"){imagePath_Name=imagepath+gbl_arrCountries[iCntr].imageDetailObj.imageName;global_airport_image=imagePath_Name;if(gbl_arrCountries[iCntr].imageDetailObj.credits!="null"&&gbl_arrCountries[iCntr].imageDetailObj.credits!="NA"&&gbl_arrCountries[iCntr].imageDetailObj.credits!=""&&gbl_arrCountries[iCntr].imageDetailObj.credits!="undefined"){imagePath_credits=gbl_arrCountries[iCntr].imageDetailObj.credits;global_image_credits=imagePath_credits;}}else{imagePath_Name=global_airport_image;imagePath_credits=global_image_credits;}if(document.getElementById("attractionimage")){if(typeof(imagePath_Name)!="undefined"){if(document.getElementById("attractionimage")){document.getElementById("attractionimage").style.display="none";}document.attractionimage.src=imagePath_Name;}if(imagePath_credits!=""&&imagePath_credits!="undefined"){document.getElementById('attractionCredits').innerHTML=imagePath_credits;}}if(document.getElementById("planner_Panel")){document.getElementById("planner_Panel").style.display="none";}if(document.getElementById("lnkServiceList")){document.getElementById("lnkServiceList").style.display="none";}if(document.getElementById("LocationDetails")){document.getElementById("LocationDetails").style.display="none";}if(document.getElementById("AttAlert")){document.getElementById("AttAlert").style.display="none";}if(document.getElementById("webDetails")){document.getElementById("webDetails").style.display="none";}if(document.getElementById("phoneDetails")){document.getElementById("phoneDetails").style.display="none";}if(document.getElementById("InterestMain")){document.getElementById("InterestMain").style.display="none";}if(document.getElementById("DurationMain")){document.getElementById("DurationMain").style.display="none";}if(document.getElementById("visitHoursDiv")){document.getElementById("visitHoursDiv").style.display="none";}if(document.getElementById("seasonDiv")){document.getElementById("seasonDiv").style.display="none";}if(document.getElementById("holidayDiv")){document.getElementById("holidayDiv").style.display="none";}if(document.getElementById("PriceDetails")){document.getElementById("PriceDetails").style.display="none";}if(document.getElementById("attractionheading")){document.getElementById("attractionheading").innerHTML=gbl_arrCountries[0].countryName;}setTimeout('renderCountry();',500);}function updateFW(ID,Type){var image_credits="";var region_name="";var region_desc="";var imagePath_Name="";var city_name="";var city_desc="";var imagePath_Name="",currDestName="";if(Type=="Country"){global_airportorcity=ID;var isDetailsFound=false;for(var vacationCnt=0;vacationCnt<gbl_arrAllVacationCountry.length;vacationCnt++){if(global_airportorcity==gbl_arrAllVacationCountry[vacationCnt].countryId){currDestName=gbl_arrAllVacationCountry[vacationCnt].countryName;if(gbl_arrAllVacationCountry[vacationCnt].dataFetched==true){isDetailsFound=true;break;}}}if(isDetailsFound){renderCountry();DisplayCountryRegionDetails(Type,'');}else{checkCountryContents(currDestName);}}if(Type=="Regions"){DisplayCountryRegionDetails(Type,ID);}else if(Type=="City"){for(var cityCntr=0;cityCntr<gbl_arrAllCities.length;cityCntr++){city_name=gbl_arrAllCities[cityCntr].name;city_desc=gbl_arrAllCities[cityCntr].description;image_credits=gbl_arrAllCities[cityCntr].imageDetailObj.credits;imagePath_Name=imagepath+gbl_arrAllCities[cityCntr].imageDetailObj.imageName;if(gbl_arrAllCities[cityCntr].id==ID){if(document.getElementById("attractionheading")){document.getElementById("attractionheading").innerHTML=gbl_arrCountries[0].countryName+" - "+city_name;}if(document.getElementById("attractiondescription")){if(city_desc=="null"||city_desc==""||city_desc==null){document.getElementById("attractiondescription").innerHTML="";}else{document.getElementById("attractiondescription").innerHTML=city_desc;}}if(document.getElementById("divAttractionDetails")){document.getElementById("divAttractionDetails").style.display="none";}if(document.getElementById("attractionimageDiv")){if(typeof(imagePath_Name)!="undefined"){document.getElementById("verticalDescriptionColumn").style.display="";document.getElementById("attractionimage").src=imagePath_Name;var img=new Image();img.src=imagePath_Name;if(img.width==0&&img.height==0){displayVerticalDesc(false);}}if(image_credits!="null"&&image_credits!="undefined"){document.getElementById('attractionCredits').innerHTML=image_credits;document.getElementById('attractionCreditsRow').style.display="";}else{document.getElementById('attractionCreditsRow').style.display="none";}}break;}}}if(document.getElementById("LocationDetails")){document.getElementById("LocationDetails").style.display="none";}if(document.getElementById("AttAlert")){document.getElementById("AttAlert").style.display="none";}if(document.getElementById("webDetails")){document.getElementById("webDetails").style.display="none";}if(document.getElementById("phoneDetails")){document.getElementById("phoneDetails").style.display="none";}if(document.getElementById("InterestMain")){document.getElementById("InterestMain").style.display="none";}if(document.getElementById("DurationMain")){document.getElementById("DurationMain").style.display="none";}if(document.getElementById("visitHoursDiv")){document.getElementById("visitHoursDiv").style.display="none";}if(document.getElementById("seasonDiv")){document.getElementById("seasonDiv").style.display="none";}if(document.getElementById("holidayDiv")){document.getElementById("holidayDiv").style.display="none";}if(document.getElementById("lnkHotelServiceList")){document.getElementById("lnkHotelServiceList").style.display="none";}if(document.getElementById("PriceDetails")){document.getElementById("PriceDetails").style.display="none";}}function displayFW(){}function SelectDeselectOption(divName,checkBoxObj){var a=document.getElementById(divName);if(checkBoxObj.checked){for(var i=0;i<a.options.length;i++){a.options[i].selected=true;}if(a.onchange){a.onchange();}}else{for(var i=0;i<a.options.length;i++){a.options[i].selected=false;}}}function fillCountryVPDetails(countryName,cityIndex){var cityCnt=0;for(var plannerCnt=0;plannerCnt<gbl_arrAllVacationCountry.length;plannerCnt++){if(cityIndex==plannerCnt&&cityIndex!=""){document.frmdisplaypanel4.drpCountry_vacation.value=gbl_arrAllVacationCountry[plannerCnt].countryName;gbl_VacationCityPlannerIndex=plannerCnt;break;}else if(countryName==gbl_arrAllVacationCountry[plannerCnt].countryName){document.frmdisplaypanel4.drpCountry_vacation.value=gbl_arrAllVacationCountry[plannerCnt].countryName;gbl_VacationCityPlannerIndex=plannerCnt;break;}}}function updatePanelDetails(index){alert("in fun updatePanelDetails ");var arrivaldate=frmobj.arrivaldate.value;var currentArrTime=frmobj.starttime.value;var isChecked=false;var currStartDateTime=new Date(frmobj.arrivaldate.value);currStartDateTime.setHours(frmobj.starttime.value.split(":")[0]);currStartDateTime.setMinutes(frmobj.starttime.value.split(":")[1]);currStartDateTime.setSeconds(0);currStartDateTime=currStartDateTime.getTime();var currEndDateTime=new Date(frmobj.departuredate.value);currEndDateTime.setHours(frmobj.endtime.value.split(":")[0]);currEndDateTime.setMinutes(frmobj.endtime.value.split(":")[1]);currEndDateTime.setSeconds(0);currEndDateTime=currEndDateTime.getTime();if(index>0){var plannerArrDate=gbl_VacationCityPlanner[index-1].CityStartdate;var plannerDepDate=gbl_VacationCityPlanner[index-1].CityEnddate;var plannerArrTime=gbl_VacationCityPlanner[index-1].CityArrivalTime;var plannerArrDateTime=new Date(plannerArrDate);plannerArrDateTime.setHours(plannerArrTime.split(":")[0]);plannerArrDateTime.setMinutes(plannerArrTime.split(":")[1]);plannerArrDateTime=plannerArrDateTime.getTime();var plannerDepTime=gbl_VacationCityPlanner[index-1].CityDepartTime;var plannerDepDateTime=new Date(plannerDepDate);plannerDepDateTime.setHours(plannerDepTime.split(":")[0]);plannerDepDateTime.setMinutes(plannerDepTime.split(":")[1]);plannerDepDateTime=plannerDepDateTime.getTime();if(currStartDateTime<plannerDepDateTime){isChecked=true;var answer=checkItineraryItems(plannerArrDateTime,currStartDateTime,plannerDepDateTime,currEndDateTime,'','','');if(answer==false){return false;}savePanelDetails(frmobj.drpCity_vacation.value,"frmdisplaypanel3");}}if(index+1<gbl_VacationCityPlanner.length){var plannerArrDate=gbl_VacationCityPlanner[index+1].CityStartdate;var plannerDepDate=gbl_VacationCityPlanner[index+1].CityEnddate;var plannerArrTime=gbl_VacationCityPlanner[index+1].CityArrivalTime;var plannerArrDateTime=new Date(plannerArrDate);plannerArrDateTime.setHours(plannerArrTime.split(":")[0]);plannerArrDateTime.setMinutes(plannerArrTime.split(":")[1]);plannerArrDateTime=plannerArrDateTime.getTime();var plannerDepTime=gbl_VacationCityPlanner[index+1].CityDepartTime;var plannerDepDateTime=new Date(plannerDepDate);plannerDepDateTime.setHours(plannerDepTime.split(":")[0]);plannerDepDateTime.setMinutes(plannerDepTime.split(":")[1]);plannerDepDateTime=plannerDepDateTime.getTime();if(currEndDateTime>plannerArrDateTime){isChecked=true;var answer=checkItineraryItems(plannerArrDateTime,currStartDateTime,plannerDepDateTime,currEndDateTime,'','','');if(answer==false){return false;}savePanelDetails(frmobj.drpCity_vacation.value,"frmdisplaypanel3");}}if(!isChecked){gbl_VacationCityPlanner[index].CityStartdate=arrivaldate;gbl_VacationCityPlanner[index].CityEnddate=frmobj.departuredate.value;gbl_VacationCityPlanner[index].CityArrivalTime=currentArrTime;gbl_VacationCityPlanner[index].CityDepartTime=frmobj.endtime.value;}}function showIP(){var IPDiv=document.getElementById("ip");var shortListDiv=document.getElementById("divShortList");document.getElementById('btnShortList').setAttribute("src","../Images/shortlist_bt.png");IPDiv.style.disply="block";shortListDiv.style.display="none";}function showIPShortList(){var IPDiv=document.getElementById("ip");var shortListDiv=document.getElementById("divShortList");document.getElementById('btnShortList').setAttribute("src","../Images/shortlist_bti.png");IPDiv.style.disply="none";shortListDiv.style.display="block";}function popupUserDemoFlash(){var params='width='+screen.width;params+=', height='+screen.height;params+=', top=0, left=0';params+=', resizable=yes';newwin=window.open('Web/TripsketchUserDemo.php',null,params);if(window.focus){newwin.focus();};return false;}function iimport(src,type){if(type=="CSS"){var fileref=document.createElement("link");fileref.setAttribute("rel","stylesheet");fileref.setAttribute("type","text/css");fileref.setAttribute("href",src);document.getElementsByTagName('head')[0].appendChild(fileref);}else{var scriptElem=document.createElement('script');scriptElem.setAttribute('src',src);scriptElem.setAttribute('type','text/javascript');document.getElementsByTagName('head')[0].appendChild(scriptElem);}return true;}function loadScripts(){iimport('Scripts/BudgetReader.js','Script');iimport('Scripts/AttractionBrowser.js','Script');iimport('Scripts/registration.js','Script');iimport('Scripts/TExpertActivities.js','Script');iimport('http://affiliates.hotelscombined.com/scripts/AffiliateScript.js','Script');iimport('http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js','Script');iimport('CSS/Budget.css','CSS');iimport('CSS/dhtmlgoodies_calendar.css?random=20051112','CSS');if(document.getElementById("loginLinks")){document.getElementById("loginLinks").style.display="";}if(document.getElementById("footerlinks_partner")){document.getElementById("footerlinks_partner").style.display="";}if(document.getElementById("footerlinks_feedback")){document.getElementById("footerlinks_feedback").style.display="";}var BrowserURL;BrowserURL=document.location.href;if(BrowserURL.indexOf("fairquote")!=-1){iimport('Scripts/fairquote_tripsketch.js','Script');}}function feedback(windowName){var isLoginUser=0;sign_out=document.getElementById("SignUp");if(sign_out.innerHTML.toLowerCase()=="sign out"){isLoginUser=1;}var objOverlay,iframeObj,overlayInnerObj;objOverlay=document.getElementById("overlay");iframeObj=document.getElementById("itineraryFrame");overlayInnerObj=document.getElementById("overlayInner");overlayInnerObj.style.height="350px";overlayInnerObj.style.display="";if(windowName=='FW'){var attractionName=document.getElementById("attractionheading").innerHTML;if(attractionName==global_startingLocationName){attractionName="";}iframeObj.src="Web/feedbackEmail.php?pageValue=1&startingLocationName="+global_startingLocationName+"&loginStatus="+isLoginUser+"&attractionName="+attractionName;}if(windowName=='BW'){if(document.budgetPlannerfrm.City.value==''){alert('Please select city.');document.budgetPlannerfrm.City.focus();return false;}var w=document.budgetPlannerfrm.City.selectedIndex;var cityname=document.budgetPlannerfrm.City.options[w].text;iframeObj.src="Web/feedbackEmail.php?pageValue=2&cityName="+cityname+"&loginStatus="+isLoginUser;}if(windowName=='TW'){iframeObj.src="Web/feedbackEmail.php?pageValue=3&startingLocationName="+global_startingLocationName+"&loginStatus="+isLoginUser;}objOverlay.style.visibility=(objOverlay.style.visibility=="visible")?"hidden":"visible";if(objOverlay.style.visibility=="visible"){objOverlay.style.height=document.body.scrollHeight;objOverlay.style.width=document.body.scrollWidth-2;}else{objOverlay.style.height="90%";objOverlay.style.width="95%";}document.getElementById("overlayInner").style.height="380px";document.getElementById("overlayFrame").style.height="100%";}function sendFeedback(emailTo,emailSubject,emailFrom,emailMessage){var emailIdTo=emailTo.innerHTML;var emailSub=emailSubject.innerHTML;var browserName=fnToCheckBrowserInfo();var url=window.location.href;if(sign_out.innerHTML.toLowerCase()=="sign out"){var emailFrom=emailFrom.innerHTML;}else{var emailFrom=emailFrom.value;var filterEmail=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;if((emailFrom!="")&&(!filterEmail.test(emailFrom))){hideloadingForFeedBackPopup();alert("Email should be in form xx@xxx.xx");return false;}}var emailText=emailMessage.value;if(emailText==""){hideloadingForFeedBackPopup();alert("Comments cannot be blank.");return false;}browserName=browserName.toString();var array={'type':'feedbackEmail','emailToId':emailIdTo,'emailSubject':emailSub,'emailFromId':emailFrom,'emailMessage':emailText,'browser':browserName,'url':url};formData=ued_encode(array);SendRequest("Web/budgetEmail.php",'post','sendEmail');}function fnToCheckBrowserInfo(){var agt=navigator.userAgent.toLowerCase();if(agt.indexOf("firefox")!=-1){if(/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){var browserStr=/Firefox\/([0-9]+([.]([0-9]+))*)/g;return navigator.userAgent.match(browserStr);}}else if(agt.indexOf("msie")!=-1){if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){var browserStr=/MSIE ([0-9]+([.]([0-9]+))*)/g;return navigator.userAgent.match(browserStr);}}else if(agt.indexOf("safari")!=-1){if(/Version\/(\d{1,2}\.\d{1,2}\.\d{1,2})/.test(navigator.userAgent)){var browserStr=/Version\/([0-9]+([.]([0-9]+))*)/g;return"Safari "+navigator.userAgent.match(browserStr);}}else{return"Unknown Browser"+navigator.userAgent;}}function ShowProcessingMsg(itemCntr){showLoadingImages();}function HideProcessingMsg(itemCntr){hideLoadingImages();}function setHeaderTabClass(selectedTabName){if(selectedTabName=="Home"){document.getElementById('headerpage_ibtnhome').className="TopLevelMenuTextSelectedTab";}else{document.getElementById('headerpage_ibtnhome').className="TopLevelMenuTextTab";}if(selectedTabName=="Budget"){document.getElementById('headerpage_ibtnbudget').className="TopLevelMenuTextSelectedTab";}else{document.getElementById('headerpage_ibtnbudget').className="TopLevelMenuTextTab";}if(selectedTabName=="My Trips"){document.getElementById('headerpage_ibtnmytrip').className="TopLevelMenuTextSelectedTab";if(document.all){document.getElementById('headerpage_ibtnmytrip').onclick=handleEvent;}else{document.getElementById('headerpage_ibtnmytrip').setAttribute('onClick',"javascript:handleEvent(this.id)");}}else{document.getElementById('headerpage_ibtnmytrip').className="TopLevelMenuTextTab";}if(selectedTabName=="Trip Planner"){document.getElementById('headerpage_ibtntripplanner').className="TopLevelMenuTextSelectedTab";}else{document.getElementById('headerpage_ibtntripplanner').className="TopLevelMenuTextTab";}if(selectedTabName=="Read"){document.getElementById('headerpage_ibtnread').className="TopLevelMenuTextSelectedTab";}else{document.getElementById('headerpage_ibtnread').className="TopLevelMenuTextTab";}if(selectedTabName=="Explore"){document.getElementById('headerpage_explore').className="TopLevelMenuTextSelectedTab";}else{document.getElementById('headerpage_explore').className="TopLevelMenuTextTab";}}function changeCountry(){var countryName=document.getElementById('countryFilter').value;var arr=new Array();gbl_arrAllNearByCities=new Array();gbl_isCntryChanged=true;gblIsCountryPresent=false;gblIsCountryExists=false;gbl_checkPlanNowClicked=true;var isCountryExists=false;global_CountryInfoObj.CountryID=global_airportorcity;global_CountryInfoObj.CountryName=countryName;gblIsCountryPresent=true;checkcontents(countryName);}function fillMCityDetails(isPlanNowRequested){var dateString,endDateString;var dateObject=new Date();var totalDuration=0;var tempDuration=0;var noOfDays=0;var endDate="";for(var cityCnt=0;cityCnt<gbl_VacationCityPlanner.length;cityCnt++){tempDuration=0;totalDuration=0;noOfDays=3;var isAttrPresent=false;for(var dCnt=0;dCnt<shortListItemsArrGlobal.length;dCnt++){if(shortListItemsArrGlobal[dCnt].cityId==gbl_VacationCityPlanner[cityCnt].CityID){durationStr=shortListItemsArrGlobal[dCnt].desc;var hrs=parseInt(durationStr.split(":")[0]);var mins=parseInt(durationStr.split(":")[1]);hrs=hrs*60;tempDuration=tempDuration+parseInt(hrs+mins);isAttrPresent=true;}}totalDuration=totalDuration+Math.round(tempDuration/60);if(totalDuration<6&&isAttrPresent){noOfDays=1;}else{noOfDays=Math.round(totalDuration/6);}if(noOfDays==0){noOfDays=3;}if(cityCnt==0){gbl_VacationCityPlanner[cityCnt].Startdate=global_arrivaldate;var arrivalDate=new Date(global_arrivaldate.split("/")[2],parseInt(extractNumber(global_arrivaldate.split("/")[0]))-1,extractNumber(global_arrivaldate.split("/")[1]));endDateObj=new Date(arrivalDate);endDateObj.setDate(arrivalDate.getDate()+noOfDays);var endDateValue=endDateObj.getDate();var endMonthValue=endDateObj.getMonth()+1;var endYearValue=endDateObj.getFullYear();if(endMonthValue<=9)endMonthValue="0"+endMonthValue;if(endDateValue<=9)endDateValue="0"+endDateValue;endDateString=endMonthValue+"/"+endDateValue+"/"+endYearValue;gbl_VacationCityPlanner[cityCnt].Enddate=endDateString;if(gbl_VacationCityPlanner[cityCnt].LocationID==""){gbl_VacationCityPlanner[cityCnt].LocationID=0;}}else{gbl_VacationCityPlanner[cityCnt].Startdate=gbl_VacationCityPlanner[cityCnt-1].Enddate;endDateObj=new Date(gbl_VacationCityPlanner[cityCnt].Startdate);endDateObj.setDate(endDateObj.getDate()+noOfDays);endDateValue=endDateObj.getDate();endMonthValue=endDateObj.getMonth()+1;endYearValue=endDateObj.getFullYear();if(endMonthValue<=9)endMonthValue="0"+endMonthValue;if(endDateValue<=9)endDateValue="0"+endDateValue;endDateString=endMonthValue+"/"+endDateValue+"/"+endYearValue;gbl_VacationCityPlanner[cityCnt].Enddate=endDateString;if(gbl_VacationCityPlanner[cityCnt].LocationID==""){gbl_VacationCityPlanner[cityCnt].LocationID=0;}}gbl_VacationCityPlanner[cityCnt].noOfDays=noOfDays;}if(isPlanNowRequested){gblIsFromMC=true;global_start_location=3;gbl_prevFormHTML=document.getElementById('loadpage').innerHTML;SendRequest("MultiCityPlanner.php?type="+global_start_location+"&isMCntry="+gblIsFromMC,"get","multiCityPlanner");}}function fillMCntryDetails(cntryName){}function fillRenderObjects(cityName,CityId,type){RenderObjects=new Array();if(global_start_location==4){for(var tempCnt=0;tempCnt<gbl_arrAllCities.length;tempCnt++){if(gbl_arrAllCities[tempCnt].id==CityId){var id=gbl_arrAllCities[tempCnt].id;var mapImageName="../Images/CityIcon.jpg";var city=cityName;var latittude=gbl_arrAllCities[tempCnt].addressDetailObj.latitude;var longitude=gbl_arrAllCities[tempCnt].addressDetailObj.longitude;var postalCode=gbl_arrAllCities[tempCnt].addressDetailObj.postalCode;var state=gbl_arrAllCities[tempCnt].addressDetailObj.state;var country=gbl_arrAllCities[tempCnt].addressDetailObj.country;arrAllNBC=gbl_arrAllCities[tempCnt].nbCities;var address="";if(city!="null"&&city!=""){address+=city;}if(postalCode!="null"&&postalCode!=""){if(address!=""){address+=", ";}address+=postalCode;}if(state!="null"&&state!=""){if(address!=""){address+=", ";}address+=state;}if(country!="null"&&country!=""){if(address!=""){address+=", ";}address+=country;}if((latittude!=null&&longitude!=null)&&(latittude!=''&&longitude!='')){var renderableObj=new cls_RenderableObjects(id,'City',mapImageName,latittude,longitude,cityName,address);RenderObjects[RenderObjects.length]=renderableObj;}break;}}if(type=='NBC'){for(var cityCnt=0;cityCnt<arrAllNBC.length;cityCnt++){if(gbl_arrAllNBC[cityCnt].addressDetailObj.latitude!=null||gbl_arrAllNBC[cityCnt].addressDetailObj.longitude!=null){if((latittude!=null&&longitude!=null)&&(latittude!=''&&longitude!='')){var renderableObj=new cls_RenderableObjects('','City',mapImageName,gbl_arrAllNBC[cityCnt].addressDetailObj.latitude,gbl_arrAllNBC[cityCnt].addressDetailObj.longitude,gbl_arrAllNBC[cityCnt].name,''+', '+''+', '+'','');RenderObjects[RenderObjects.length]=renderableObj;}}}}}else{if(gblSelectedType=="Restaurant"){for(var cityCnt=0;cityCnt<gbl_arrAllNearByCities.length;cityCnt++){if(CityId==gbl_arrAllNearByCities[cityCnt].id){var id=gbl_arrAllNearByCities[cityCnt].id;cityName=gbl_arrAllNearByCities[cityCnt].name;var mapImageName="../Images/CityIcon.jpg";var latittude=gbl_arrAllNearByCities[cityCnt].locationsObj[0].addressDetailObj[0].latitude;var longitude=gbl_arrAllNearByCities[cityCnt].locationsObj[0].addressDetailObj[0].longitude;var postalCode=gbl_arrAllNearByCities[cityCnt].locationsObj[0].addressDetailObj[0].postalCode;var state=gbl_arrAllNearByCities[cityCnt].locationsObj[0].addressDetailObj[0].state;var country=gbl_arrAllNearByCities[cityCnt].locationsObj[0].addressDetailObj[0].country;var address="";if(cityName!="null"&&cityName!=""){address+=cityName;}if(postalCode!="null"&&postalCode!=""){if(address!=""){address+=", ";}address+=postalCode;}if(state!="null"&&state!=""){if(address!=""){address+=", ";}address+=state;}if(country!="null"&&country!=""){if(address!=""){address+=", ";}address+=country;}if((latittude!=null&&longitude!=null)&&(latittude!=''&&longitude!='')){var renderableObj=new cls_RenderableObjects(id,'City',mapImageName,latittude,longitude,cityName,address,'');RenderObjects[0]=renderableObj;}var logisticalObj=gblObjLocationRestaurantNBC[cityCnt].arrSortedLogistical;for(var rCnt=0;rCnt<logisticalObj.length;rCnt++){var attrId=logisticalObj[rCnt].id;var attrName=logisticalObj[rCnt].name;var ImageName="../Images/RestaurantIcon.jpg";var lat=logisticalObj[rCnt].addressDetailObj.latitude;var lng=logisticalObj[rCnt].addressDetailObj.longitude;var pCode=logisticalObj[rCnt].addressDetailObj.postalCode;var st=logisticalObj[rCnt].addressDetailObj.state;var cntry=logisticalObj[rCnt].addressDetailObj.country;var uri=logisticalObj[rCnt].uri;var address="";if(cityName!="null"&&cityName!=""){address+=cityName;}if(pCode!="null"&&pCode!=""){if(address!=""){address+=", ";}address+=pCode;}if(st!="null"&&st!=""){if(address!=""){address+=", ";}address+=st;}if(cntry!="null"&&cntry!=""){if(address!=""){address+=", ";}address+=cntry;}if((lat!=null&&lng!=null)&&(lat!=''&&lng!='')){var renderableObj=new cls_RenderableObjects(attrId,'Restaurant',ImageName,lat,lng,attrName,address,uri);RenderObjects[RenderObjects.length]=renderableObj;}}break;}}}else{for(var cityCnt=0;cityCnt<gbl_arrAllNearByCities.length;cityCnt++){if(CityId==gbl_arrAllNearByCities[cityCnt].id){var id=gbl_arrAllNearByCities[cityCnt].id;cityName=gbl_arrAllNearByCities[cityCnt].name;var mapImageName="../Images/CityIcon.jpg";var latittude=gbl_arrAllNearByCities[cityCnt].locationsObj[0].addressDetailObj[0].latitude;var longitude=gbl_arrAllNearByCities[cityCnt].locationsObj[0].addressDetailObj[0].longitude;var postalCode=gbl_arrAllNearByCities[cityCnt].locationsObj[0].addressDetailObj[0].postalCode;var state=gbl_arrAllNearByCities[cityCnt].locationsObj[0].addressDetailObj[0].state;var country=gbl_arrAllNearByCities[cityCnt].locationsObj[0].addressDetailObj[0].country;var address="";if(cityName!="null"&&cityName!=""){address+=cityName;}if(postalCode!="null"&&postalCode!=""){if(address!=""){address+=", ";}address+=postalCode;}if(state!="null"&&state!=""){if(address!=""){address+=", ";}address+=state;}if(country!="null"&&country!=""){if(address!=""){address+=", ";}address+=country;}if((latittude!=null&&longitude!=null)&&(latittude!=''&&longitude!='')){var renderableObj=new cls_RenderableObjects(id,'City',mapImageName,latittude,longitude,cityName,address,'');RenderObjects[0]=renderableObj;}var logisticalObj=gbl_arrAllNearByCities[cityCnt].logisticalsObj;for(var rCnt=0;rCnt<logisticalObj.length;rCnt++){var attrId=logisticalObj[rCnt].id;var attrName=logisticalObj[rCnt].name;var ImageName="../Images/AttractionIcon.jpg";var lat=logisticalObj[rCnt].addressDetailObj.latitude;var lng=logisticalObj[rCnt].addressDetailObj.longitude;var pCode=logisticalObj[rCnt].addressDetailObj.postalCode;var st=logisticalObj[rCnt].addressDetailObj.state;var cntry=logisticalObj[rCnt].addressDetailObj.country;var uri=logisticalObj[rCnt].uri;var address="";if(cityName!="null"&&cityName!=""){address+=cityName;}if(pCode!="null"&&pCode!=""){if(address!=""){address+=", ";}address+=pCode;}if(st!="null"&&st!=""){if(address!=""){address+=", ";}address+=st;}if(cntry!="null"&&cntry!=""){if(address!=""){address+=", ";}address+=cntry;}if((lat!=null&&lng!=null)&&(lat!=''&&lng!='')){var renderableObj=new cls_RenderableObjects(attrId,'Attraction',ImageName,lat,lng,attrName,address,uri);RenderObjects[RenderObjects.length]=renderableObj;}}break;}}}}}function displayNBCMap(cityName){var tempCnt=-1;gbl_dispAttrFlag=true;gbl_mapFlag=0;if(gblSelectedType=="Restaurant"){for(var cityCnt=0;cityCnt<gblObjLocationRestaurantNBC.length;cityCnt++){if(gblObjLocationRestaurantNBC[cityCnt].name==cityName){tempCnt=cityCnt;break;}}fillRenderObjects(gblObjLocationRestaurantNBC[tempCnt].name,gblObjLocationRestaurantNBC[tempCnt].uri,'');var nbcLat=gblObjLocationRestaurantNBC[tempCnt].arrSortedLogistical[0].addressDetailObj.latitude;var nbcLng=gblObjLocationRestaurantNBC[tempCnt].arrSortedLogistical[0].addressDetailObj.longitude;}else{for(var cityCnt=0;cityCnt<gbl_arrAllNearByCities.length;cityCnt++){if(gbl_arrAllNearByCities[cityCnt].name==cityName){tempCnt=cityCnt;break;}}fillRenderObjects(gbl_arrAllNearByCities[tempCnt].name,gbl_arrAllNearByCities[tempCnt].id,'');var nbcLat=gbl_arrAllNearByCities[tempCnt].locationsObj[0].addressDetailObj[0].latitude;var nbcLng=gbl_arrAllNearByCities[tempCnt].locationsObj[0].addressDetailObj[0].longitude;}if(nbcLat&&nbcLng){if(gbl_mapFlag==0){gbl_mapFlag=1;createMap('enlargeMapDiv',nbcLat,nbcLng,arrAttractionNames,arrAttractionIndexes,RenderObjects);}else{fitMap(mapObjects[0]);}}}function SelectDaysChanged(objSelect){var DestCount=document.getElementById('tblDestList').rows.length-1;var DestIndex=objSelect.substring(objSelect.length-1);if(isNaN(DestIndex)){objSelect="DepartureNoDays1";DestIndex=objSelect.substring(objSelect.length-1);}var nextDestIndex=parseInt(DestIndex)+1;var DayToSet=parseInt(document.getElementById(objSelect).value);var iDestCnt;var prevDate="";for(var tempCnt=DestIndex;tempCnt<=DestCount;tempCnt++){var prevIndex=tempCnt-1;var noOfDays=parseInt(document.getElementById('DepartureNoDays'+tempCnt).value);if(tempCnt==DestIndex){var currentDestArrDate=document.getElementById('ArrivalDateDest'+tempCnt).value;if(document.getElementById('DepartureDateDest'+tempCnt)){var currentDestDepDate=document.getElementById('DepartureDateDest'+tempCnt).value;}var monthToSet=extractNumber(currentDestArrDate.substring(0,2));var monthToSet=parseInt(monthToSet)-1;var dateToSet=currentDestArrDate.substring(3,5);var yearToSet=currentDestArrDate.substring(6,10);var dateObject=new Date();dateObject.setFullYear(yearToSet,monthToSet,dateToSet);dateObject.setDate(dateObject.getDate()+DayToSet);dateValue=dateObject.getDate();monthValue=dateObject.getMonth()+1;yearValue=dateObject.getFullYear();if(monthValue<=9)monthValue="0"+monthValue;if(dateValue<=9)dateValue="0"+dateValue;dateString=monthValue+"/"+dateValue+"/"+yearValue;prevDate=dateString;if(document.getElementById('DepartureDateDest'+tempCnt)){document.getElementById('DepartureDateDest'+tempCnt).value=dateString;}}else{document.getElementById("ArrivalDateDest"+tempCnt).value=prevDate;var currentDestArrDate=document.getElementById('ArrivalDateDest'+tempCnt).value;if(document.getElementById('DepartureDateDest'+tempCnt)){var currentDestDepDate=document.getElementById('DepartureDateDest'+tempCnt).value;}var monthToSet=extractNumber(currentDestArrDate.substring(0,2));var monthToSet=parseInt(monthToSet)-1;var dateToSet=currentDestArrDate.substring(3,5);var yearToSet=currentDestArrDate.substring(6,10);var dateObject=new Date();dateObject.setFullYear(yearToSet,monthToSet,dateToSet);dateObject.setDate(dateObject.getDate()+noOfDays);dateValue=dateObject.getDate();monthValue=dateObject.getMonth()+1;yearValue=dateObject.getFullYear();if(monthValue<=9)monthValue="0"+monthValue;if(dateValue<=9)dateValue="0"+dateValue;dateString=monthValue+"/"+dateValue+"/"+yearValue;prevDate=dateString;if(document.getElementById('DepartureDateDest'+tempCnt)){document.getElementById('DepartureDateDest'+tempCnt).value=dateString;}}if(prevIndex<gbl_VacationCityPlanner.length){gbl_VacationCityPlanner[prevIndex].Startdate=document.getElementById('ArrivalDateDest'+tempCnt).value;gbl_VacationCityPlanner[prevIndex].Enddate=prevDate;gbl_VacationCityPlanner[prevIndex].DefaultTransportCost=noOfDays;}}}function findCityName(CityName){var ctrCnt=0;ctrCnt1=gbl_CountryList.length;for(;ctrCnt<ctrCnt1;ctrCnt++){if(CityName.match(gbl_CountryList[ctrCnt].Name)&&CityName.toLowerCase()!=gbl_CountryList[ctrCnt].Name.toLowerCase()){var aPosition=CityName.indexOf(gbl_CountryList[ctrCnt].Name);var secondPos=CityName.indexOf(gbl_CountryList[ctrCnt].Name,aPosition+1);if(secondPos>0){CityName=CityName.substr(0,secondPos-2);return CityName;}else{CityName=CityName.replace(gbl_CountryList[ctrCnt].Name,"");return CityName.substr(0,CityName.length-2);}}}return CityName;}function addFromFW(logisticalCntr){if(gblIsFromMC){var itemName=gbl_arrAllAttractions[logisticalCntr].name;var itemDur=gbl_arrAllAttractions[logisticalCntr].duration;var itemType=gbl_arrAllAttractions[logisticalCntr].type;var itemID=gbl_arrAllAttractions[logisticalCntr].id;var addObj=gbl_arrAllAttractions[logisticalCntr].addressDetailObj;var street=addObj.street;var city=addObj.city;var postalCode=addObj.postalCode;var state=addObj.state;var country=addObj.country;}else{var itemName=gbl_arrAllLogisticals[logisticalCntr].name;var itemDur=gbl_arrAllLogisticals[logisticalCntr].duration;var itemType=gbl_arrAllLogisticals[logisticalCntr].type;var itemID=gbl_arrAllLogisticals[logisticalCntr].id;var addObj=gbl_arrAllLogisticals[logisticalCntr].addressDetailObj;var street=addObj.street;var city=addObj.city;var postalCode=addObj.postalCode;var state=addObj.state;var country=addObj.country;}var address="";if(street!="null"&&street!=""){address+=street;}if(city!="null"&&city!=""){if(address!=""){address+=", ";}address+=city;}if(postalCode!="null"&&postalCode!=""){if(address!=""){address+=", ";}address+=postalCode;}if(state!="null"&&state!=""){if(address!=""){address+=", ";}address+=state;}if(country!="null"&&country!=""){if(address!=""){address+=", ";}address+=country;}var lat=addObj.latitude;var lng=addObj.longitude;global_id=itemID;global_name=itemName;global_address=address;global_longitude=lng;global_latitude=lat;var isAttrAvailable=false;var isLoopBreak=false;if(gbl_inNBC){for(var loCnt=0;loCnt<gbl_arrAllNearByCities.length;loCnt++){var arrLogisticalObj=gbl_arrAllNearByCities[loCnt].logisticalsObj;for(var logCnt=0;logCnt<arrLogisticalObj.length;logCnt++){if(arrLogisticalObj[logCnt].name==itemName){isLoopBreak=false;if(arrLogisticalObj[logCnt].isAvailable==true){newRowId="";isAttrAvailable=true;for(var tempCnt=0;tempCnt<global_ItineraryTimeSlotArr.length;tempCnt++){var slotStatus=global_ItineraryTimeSlotArr[tempCnt].statusOfSlot;var currStartDate=new Date(global_slotStartDateTime.getTime()+gbl_dayIndex*ONE_DAY);var currDayHeader=getDateHeader(currStartDate);var slotStartDate=global_ItineraryTimeSlotArr[tempCnt].startTime;var currSlotDayHeader=getDateHeader(slotStartDate);if(global_ItineraryTimeSlotArr[tempCnt].slotText!="MY LODGING"&&slotStatus!=4&&currSlotDayHeader==currDayHeader){var rowId="R"+global_ItineraryTimeSlotArr[tempCnt].slotNo;var itineraryItemClone=document.createElement('span');itineraryItemClone.innerHTML=itemName;global_indexOfxmlObj=logisticalCntr;var isAvailable=checkFWAvailability(rowId,itineraryItemClone,itemType,itemName,arrLogisticalObj[logCnt].duration);if(isAvailable==1){var status=addToItinerary(rowId,itineraryItemClone,itemType,itemName,'','','');if(status){newRowId="";gbl_isFromFW=false;gbl_isAvailable="false";isLoopBreak=true;if(itineraryItemsArrGlobal.length!=1){addItemToItinerary(itemName);}break;}}else if(isAvailable==5){isLoopBreak=true;break;}else if(isAvailable==4){if(newRowId==""){newRowId=rowId;}}else{gbl_isOpenAlert=true;gbl_isFromFW=false;}}}}else{alert("Attraction is not open for this day/time");isLoopBreak=true;isAvailable=0;newRowId="";break;}}}if(isLoopBreak){break;}}}else if(gblIsFromMC){var arrLogisticalObj=gbl_arrAllAttractions[logisticalCntr];if(arrLogisticalObj.isAvailable==true){isAttrAvailable=true;isLoopBreak=false;for(var tempCnt=0;tempCnt<global_ItineraryTimeSlotArr.length;tempCnt++){var slotStatus=global_ItineraryTimeSlotArr[tempCnt].statusOfSlot;slotStartDateTime=global_ItineraryTimeSlotArr[tempCnt].startTime;curStartDateTime=new Date(global_CityAirportInfoObj["Enddate"]);curStartDateTime.setHours(global_CityAirportInfoObj["DepartTime"].split(":")[0]);curStartDateTime.setMinutes(global_CityAirportInfoObj["DepartTime"].split(":")[1]);var slotStartDate=global_ItineraryTimeSlotArr[tempCnt].startTime;var currSlotDayHeader=getDateHeader(slotStartDate);if(global_ItineraryTimeSlotArr[tempCnt].slotText!="MY LODGING"&&slotStatus!=4&&slotStartDateTime.getTime()<curStartDateTime.getTime()){var rowId="R"+global_ItineraryTimeSlotArr[tempCnt].slotNo;var itineraryItemClone=document.createElement('span');itineraryItemClone.innerHTML=itemName;var isAvailable=checkFWAvailability(rowId,itineraryItemClone,itemType,itemName,arrLogisticalObj.duration);if(isAvailable==1){var status=addToItinerary(rowId,itineraryItemClone,itemType,itemName,'','','');if(status){gbl_isFromFW=false;gbl_isAvailable="false";isLoopBreak=true;if(itineraryItemsArrGlobal.length!=1){addItemToItinerary(itemName);}break;}}else if(isAvailable==5){isLoopBreak=true;break;}else if(isAvailable==4){}else{gbl_isOpenAlert=true;gbl_isFromFW=false;}}}}}else{for(var loCnt=0;loCnt<gbl_arrLocationObj.length;loCnt++){var arrLogisticalObj=gbl_arrLocationObj[loCnt].arrSortedLogistical;for(var logCnt=0;logCnt<arrLogisticalObj.length;logCnt++){if(arrLogisticalObj[logCnt].name==itemName){isLoopBreak=false;if(arrLogisticalObj[logCnt].isAvailable==true){newRowId="";isAttrAvailable=true;for(var tempCnt=0;tempCnt<global_ItineraryTimeSlotArr.length;tempCnt++){var slotStatus=global_ItineraryTimeSlotArr[tempCnt].statusOfSlot;var currStartDate=new Date(global_slotStartDateTime.getTime()+gbl_dayIndex*ONE_DAY);var currDayHeader=getDateHeader(currStartDate);var slotStartDate=global_ItineraryTimeSlotArr[tempCnt].startTime;var currSlotDayHeader=getDateHeader(slotStartDate);if(global_ItineraryTimeSlotArr[tempCnt].slotText!="MY LODGING"&&slotStatus!=4&&currSlotDayHeader==currDayHeader){var rowId="R"+global_ItineraryTimeSlotArr[tempCnt].slotNo;var itineraryItemClone=document.createElement('span');itineraryItemClone.innerHTML=itemName;global_indexOfxmlObj=logisticalCntr;var isAvailable=checkFWAvailability(rowId,itineraryItemClone,itemType,itemName,arrLogisticalObj[logCnt].duration);if(isAvailable==1){var status=addToItinerary(rowId,itineraryItemClone,itemType,itemName,'','','');if(status){newRowId="";gbl_isFromFW=false;gbl_isAvailable="false";isLoopBreak=true;if(itineraryItemsArrGlobal.length!=1){addItemToItinerary(itemName);}break;}}else if(isAvailable==5){isLoopBreak=true;break;}else if(isAvailable==4){if(newRowId==""){newRowId=rowId;}}else{gbl_isOpenAlert=true;gbl_isFromFW=false;}}}}else{alert("Attraction is not open for this day/time");isLoopBreak=true;isAvailable=0;newRowId="";break;}}}if(isLoopBreak){break;}}if(isAvailable==2&&newRowId==""){if(!confirm("You are out of time for today. Would you like to add \""+itemName+"\" to the next available day?")){return false;}else{showLoadingImages();switchDay(0);addFromFW(logisticalCntr);}}else if(isAvailable==3&&newRowId==""){alert("\""+itemName+"\", is not open at on this day");return false;}else if(isAvailable==4||newRowId!=""){if(!confirm("The suggested duration for  \""+itemName+"\", makes the visit last beyond the opening hours of the attraction. Click ok to add anyway.")){return false;}else{var status=addToItinerary(newRowId,itineraryItemClone,itemType,itemName,'','','');}}}if(document.getElementById('itinerary_id').style.display=="none"){showCalendar(true);}}function fillIP(){if(gblIsFromMC){if(shortListItemsArrGlobal.length){for(var sCnt=0;sCnt<shortListItemsArrGlobal.length;sCnt++){for(var lCnt=0;lCnt<gbl_arrAllAttractions.length;lCnt++){if(shortListItemsArrGlobal[sCnt].name==gbl_arrAllAttractions[lCnt].name&&shortListItemsArrGlobal[sCnt].cityId==gbl_arrAllAttractions[lCnt].CityId&&gbl_arrAllAttractions[lCnt].isAvailable==true){gbl_arrAllLogisticals[gbl_arrAllLogisticals.length]=gbl_arrAllAttractions[lCnt];global_indexOfxmlObj=gbl_arrAllLogisticals.length-1;addFromFW(lCnt);break;}}}}}for(iCnt=shortListItemsArrGlobal.length-1,iCnt1=0;iCnt>=iCnt1;iCnt--){for(itiCnt=itineraryItemsArrGlobal.length-1,itiCnt1=0;itiCnt>=itiCnt1;itiCnt--){if(shortListItemsArrGlobal[iCnt]){if(parseInt(shortListItemsArrGlobal[iCnt]["id"])==parseInt(itineraryItemsArrGlobal[itiCnt]["Id"])){shortListItemsArrGlobal.splice(iCnt,1);}}}}if(!shortListItemsArrGlobal.length){document.getElementById('scheduleBtn').style.display='none';}hideLoadingImages();}function showAddYourOwn(){objOverlay=document.getElementById("AB_overlay");objIframe=document.getElementById("itenerary_overlayFrame");var objOverlayABInner=document.getElementById("overlayABInner");if(objOverlayABInner){objOverlayABInner.style.display="";}document.getElementById("overlayABFrame").style.display="none";objIframe.style.display="";objIframe.src=(DIRECTORYSTRUCTUREPATH+"Addyourown.php");objOverlay.style.visibility="visible";if(objOverlay.style.visibility=="visible"){objOverlay.style.height=document.body.scrollHeight;objOverlay.style.width=document.body.scrollWidth-2;}var frameObj=document.getElementById("itenerary_itineraryFrame");frameObj.src=DIRECTORYSTRUCTUREPATH+"Addyourown.php";frameObj.scrolling="no";if(isIE){var leftCo=((document.body.offsetWidth/2.5-document.getElementById("overlayABInner").offsetWidth/2)+120)+"px";var topCo=((document.body.offsetHeight/2.9-document.getElementById("overlayABInner").offsetHeight/2)+100)+"px";document.getElementById('overlayABInner').style.left=leftCo;document.getElementById('overlayABInner').style.top=topCo;}else{document.getElementById('overlayABInner').style.left=((document.width/2.5-document.getElementById("overlayABInner").offsetWidth/2)+120)+"px";document.getElementById('overlayABInner').style.top=((document.height/2.9-document.getElementById("overlayABInner").offsetHeight/2+100))+"px";}}function addOwnType(frmObj){if(frmObj.addYourOwnSelType.value=="Form"){cancel();addAttraction();}else if(frmObj.addYourOwnSelType.value=="Map"){enlargeAttractionBrowserMap("true");showCalendar(false);cancel();if(gblSelectedType=="ViatorTours"&&document.getElementById("viatorDescriptionColumn")&&document.getElementById("viatorAttractionDescription")){document.getElementById("viatorDescriptionColumn").style.display="none";document.getElementById("viatorAttractionDescription").style.display="none";DisplayCurrentLocationDetails(global_CityAirportInfoObj["Name"]);}}else{alert("Invalid option");return false;}}//addOwnType
