function resetWhoForm(A){if(A!=null){if(confirm(WHO_RESET)){document.whoForm.personalityId.value=-1;document.whoForm.personalityId.selectedIndex=-1;getTripPersonality()}}return false}function setChildrenAndSpecialNeedsToZero(){var C=document.whoForm.kidsIncluded.value;if(C==0){document.whoForm.numberOfChildren05.value=0;document.whoForm.numberOfChildren612.value=0;document.whoForm.numberOfChildrenTeen.value=0;document.whoForm.numberOfChildrenOver18.value=0}var D=document.whoForm.specialNeeds;var B=document.whoForm.specialNeeds_c;if(!D.checked){for(var A=0;A<B.length;A++){B[A].checked=false}}}function hideDiv(A,B){if(A){A.style.display="none"}else{}}function createListBox(C,F,B,D,E){var A="";var G=0;if(D=="true"){A=A+'<SELECT NAME="'+F+'" id="'+F+'" onChange="setChildrenChildDiv()" class="listboxThreeDigit">'}else{A=A+'<SELECT NAME="'+F+'" id="'+F+'" class="listboxThreeDigit">'}A=A+'<OPTION selected="true" VALUE="0"> - </OPTION>';if(F=="kidsIncluded"){G=40}else{G=10}for(i=1;i<=G;i++){if(i==B){A+='<option value="'+i+'" selected >'+i+"</option>"}else{A+='<option value="'+i+'">'+i+"</option>"}}A+='</select><span class="listboxlblDivNew">'+E+"</span>";appendChildDiv(C,A)}function whoConfirm(){var kidsIncluded=document.whoForm.kidsIncluded.value;var numberOfChildren05=document.whoForm.numberOfChildren05.value;var numberOfChildren612=document.whoForm.numberOfChildren612.value;var numberOfChildrenTeen=document.whoForm.numberOfChildrenTeen.value;var numberOfChildrenOver18=document.whoForm.numberOfChildrenOver18.value;var specialNeeds=document.whoForm.specialNeeds;var child_specialNeeds=document.whoForm.specialNeeds_c;var specialNeedsFlag=true;var incorrectChildrenFlag=true;if(specialNeeds.checked){if(!(child_specialNeeds[0].checked)&&!(child_specialNeeds[1].checked)&&!(child_specialNeeds[2].checked)&&!(child_specialNeeds[3].checked)){if(!confirm(WHO_SPECIAL_NEEDS_BLANK)){specialNeedsFlag=false}}}if(kidsIncluded!=0){if(!(eval(kidsIncluded)==(eval(numberOfChildren05)+eval(numberOfChildren612)+eval(numberOfChildrenTeen)+eval(numberOfChildrenOver18)))){alert(WHO_INCORRECT_NUMBER_OF_CHILDREN);incorrectChildrenFlag=false}}if(specialNeedsFlag&&incorrectChildrenFlag){return true}else{return false}}function hideDiv(C,A){var B=C.selectedIndex;document.getElementById(A);if(B==0){document.getElementById(A).style.display="none"}else{document.getElementById(A).style.display="block"}}function appendChildDiv(B,D){var C=document.getElementById(B);var A=document.createElement("div");A.innerHTML=D+'<div style="margin:2px"></div>';C.appendChild(A)}function setSpecialNeeds(){setChildrenAndSpecialNeedsToZero();var A=document.getElementById("whoSpecialNeedChildDiv");if(A!=null){if(document.whoForm.specialNeeds.checked){A.style.display="block";document.whoForm.specialNeeds_c[0].checked="true";document.whoForm.specialNeeds_c[0].value=2}else{A.style.display="none"}}}function setChildrenChildDiv(){setChildrenAndSpecialNeedsToZero();var A=document.getElementById("whoChildrenChildDiv");if(A!=null){if(document.whoForm.kidsIncluded.selectedIndex==0){A.style.display="none"}else{A.style.display="block"}}}function setSpecialNeedsValues(){var C=document.whoForm.specialNeeds;if(C!=null){var D="0";var B=",";if(C.checked){var D="1,";var A=document.whoForm.specialNeeds_c;for(i=0;i<A.length;i++){if(A[i].checked){D+=A[i].value+B}}D=D.substring(0,D.length-1)}else{D="0"}C.value=D}}function checkForEmpty(){if(Trim(document.getElementById("where_splocation").value)==""&&Trim(document.getElementById("where_address").value)==""&&Trim(document.getElementById("where_city").value)==""&&Trim(document.getElementById("where_zipcode").value)==""&&Trim(document.getElementById("where_state").value)==""&&Trim(document.getElementById("where_region").value)==""){return WHERE_EMPTY}return""}function getWhereSearchResult(){if(document.getElementById("where_splocation").value!=""){getSearchResult("whereSearch")}else{if((document.getElementById("where_address").value!=""||document.getElementById("where_zipcode").value!="")&&document.getElementById("where_region").value==""){getSearchResult("fetchgeocode")}else{if(document.getElementById("where_city").value==""&&document.getElementById("where_state").value==""&&document.getElementById("where_splocation").value==""&&document.getElementById("where_address").value==""&&document.getElementById("where_zipcode").value==""){var E=new Array();var B=new Array();var D=new Array();E[0]=getRegionGeoCodeCenterPoint(document.getElementById("where_region").value);D[0]=getRegionName(document.getElementById("where_region").value);addStateToTripPlan(E,D)}else{if(document.getElementById("where_city").value!=""&&document.getElementById("where_region").value==""){getSearchResult("whereSearch")}else{if(document.getElementById("where_region").value!=""){alert(REGION_CAN_NOT_ADD_TO_SEARCH)}else{var A=new Array();var C=new Array();A[0]=getStateGeoCode(document.getElementById("where_state").value);C[0]=getStateName(document.getElementById("where_state").value);addStateToTripPlan(A,C)}}}}}}function getWhereState(form,selectedState){var selectedcountry=0;var isSelect=false;for(j=0;j<whereJSONCountryObject.Country[0].objJsonState.length;j++){if(whereJSONCountryObject.Country[[0]].objJsonState[j].StateCode==selectedState){isSelect=true}eval("document."+form).state[j]=new Option(whereJSONCountryObject.Country[[0]].objJsonState[j].StateCode+"-"+whereJSONCountryObject.Country[[0]].objJsonState[j].StateName,whereJSONCountryObject.Country[[0]].objJsonState[j].StateCode);eval("document."+form).state[j].selected=isSelect;isSelect=false}}function whereReset(){document.whereForm0.reset();document.whereForm1.reset();document.whereForm2.reset();document.whereForm3.reset()}function getStateGeoCode(A){for(j=0;j<whereJSONCountryObject.Country[0].objJsonState.length;j++){if(whereJSONCountryObject.Country[[0]].objJsonState[j].StateCode==A){return whereJSONCountryObject.Country[[0]].objJsonState[j].StateGEOCode}}}function getStateName(A){for(j=0;j<whereJSONCountryObject.Country[0].objJsonState.length;j++){if(whereJSONCountryObject.Country[[0]].objJsonState[j].StateCode==A){return whereJSONCountryObject.Country[[0]].objJsonState[j].StateName}}return""}function getStateId(A){for(j=0;j<whereJSONCountryObject.Country[0].objJsonState.length;j++){if(whereJSONCountryObject.Country[[0]].objJsonState[j].StateName==A){return whereJSONCountryObject.Country[[0]].objJsonState[j].StateId}}}function getWhereRegion(form){for(j=0;j<whereJSONRegionObject.Country[0].objJsonRegion.length;j++){eval("document."+form).region[j]=new Option(whereJSONRegionObject.Country[[0]].objJsonRegion[j].RegionName,whereJSONRegionObject.Country[[0]].objJsonRegion[j].RegionId)}}function getRegionGeoCodeCenterPoint(A){for(j=0;j<whereJSONRegionObject.Country[0].objJsonRegion.length;j++){if(whereJSONRegionObject.Country[[0]].objJsonRegion[j].RegionId==A){return whereJSONRegionObject.Country[[0]].objJsonRegion[j].RegionGeocodeCenterPoint}}}function getRegionName(A){for(j=0;j<whereJSONRegionObject.Country[0].objJsonRegion.length;j++){if(whereJSONRegionObject.Country[[0]].objJsonRegion[j].RegionId==A){return whereJSONRegionObject.Country[[0]].objJsonRegion[j].RegionName}}}function getRegionCenterCity(A){for(j=0;j<whereJSONRegionObject.Country[0].objJsonRegion.length;j++){if(whereJSONRegionObject.Country[[0]].objJsonRegion[j].RegionId==A){return whereJSONRegionObject.Country[[0]].objJsonRegion[j].RegionCenterCity}}}function getRegionCenterState(A){for(j=0;j<whereJSONRegionObject.Country[0].objJsonRegion.length;j++){if(whereJSONRegionObject.Country[[0]].objJsonRegion[j].RegionId==A){return whereJSONRegionObject.Country[[0]].objJsonRegion[j].RegionCenterState}}}function getRegionID(A){for(j=0;j<whereJSONRegionObject.Country[0].objJsonRegion.length;j++){if(whereJSONRegionObject.Country[[0]].objJsonRegion[j].RegionName==A){return whereJSONRegionObject.Country[[0]].objJsonRegion[j].RegionId}}return"0"}function checkWhereAlphaNumeric(B,A){CommonValidator.error="";var C=CommonValidator.getElementValueById(B);if(CommonValidator.isNotNull(C)&&CommonValidator.isNotBlank(C)){if(CommonValidator.test(C,"^[A-Z,a-z,0-9,/,\\s,\\t,,,.,',-,_]*$")){}else{CommonValidator.error=A+WHITE_SPACE+NOT_ALPHANUMERIC+NEW_LINE}if(CommonValidator.error==""){if(CommonValidator.test(C,"^[/,\\s,\\t,,,.,',&,@,-,_]*$")){CommonValidator.error=JS_MSG_WHERE_PLEASE_ENTER_ALPHABATE_OR_NUMBER}}}return CommonValidator.error}function checkWhereCityAlphaNumeric(B,A){CommonValidator.error="";var C=CommonValidator.getElementValueById(B);if(CommonValidator.isNotNull(C)&&CommonValidator.isNotBlank(C)){if(CommonValidator.test(C,"^[A-Z,a-z,0-9,\\s,.,',(,),-]*$")){}else{CommonValidator.error=A+WHITE_SPACE+NOT_ALPHANUMERIC+NEW_LINE}if(CommonValidator.error==""){if(CommonValidator.test(C,"^[\\s,.,',-,(,)]*$")){CommonValidator.error=JS_MSG_WHERE_PLEASE_ENTER_ALPHABATE_OR_NUMBER}}}return CommonValidator.error}function checkpoiSearchName(B,A){CommonValidator.error="";var D=CommonValidator.getElementValueById(B);if(CommonValidator.isNotNull(D)&&CommonValidator.isNotBlank(D)){if(CommonValidator.test(D,"^([A-Z,a-z,0-9,/,\\s,\\t,,,.,',&,@,_]|[-])*$")){}else{CommonValidator.error=JS_MSG_COMMON_INVALID_CHARACTER+WHITE_SPACE+A+WHITE_SPACE+JS_MSG_COMMON_FIELD}if(CommonValidator.error==""){if(CommonValidator.test(D,"^[/,\\s,\\t,,,.,',&,@,_,-]*$")){CommonValidator.error=JS_MSG_WHAT_PLEASE_ENTER_ALPHABET_OR_NUMBER}}if(CommonValidator.error==""&&D.length>0){var C=D.substring(0,1);if(CommonValidator.test(C,"^[A-Z,a-z,0-9]*$")){}else{CommonValidator.error=JS_MSG_WHAT_NAME_SHOULD_START_WITH_ALPHABATE_OR_NUMBER+WHITE_SPACE+A+WHITE_SPACE+JS_MSG_COMMON_FIELD}}}return CommonValidator.error}function validateTripDescription(B,A){var C="";var D=CommonValidator.getElementValueById(B);if(CommonValidator.isNotNull(D)&&CommonValidator.isNotBlank(D)){if(CommonValidator.test(D,"^([A-Z,a-z,0-9,/,\\s,\\t,,,.,',&,@,_,-,<,>,=,:,?,!,#,%,^,*,+,(,),$,|,~,{,}]|[-])*$")){}else{C=JS_MSG_COMMON_INVALID_CHARACTER+WHITE_SPACE+A+WHITE_SPACE+JS_MSG_COMMON_FIELD}}return C}function dateDifferences(F,E,A){var C="";var D=new cDate(CommonValidator.getElementValueById(F));var B=new cDate(CommonValidator.getElementValueById(E));if(C==""&&CommonValidator.isNotBlank(CommonValidator.getElementValueById(F))&&CommonValidator.isNotBlank(CommonValidator.getElementValueById(E))){if(D.yyyymmdd>B.yyyymmdd){C=START_DATE_SHOULD_BE_LESS_THAN_END_DATE+"\n"}}else{C=""}return C}function validateForBlank(){var B="";var A="";if(document.getElementById("clickedOnId").value!="addSeason"){if(document.getElementById("when_startdate").value!="mm/dd/yyyy"){B+=document.getElementById("when_startdate").value}B+=document.getElementById("when_travaelduration").value;if(Trim(B)==""){return PLESE_SELECT_AT_LEAST_ONE_OPTION_TO_ADD+"\n"}else{return""}}else{A+=document.getElementById("selectedSeasonId").value;if(Trim(A)==""){return PLESE_SELECT_SEASON_TO_ADD+"\n"}else{return""}}}function validatePastDate(G,F){var B="";if(CommonValidator.isNotBlank(CommonValidator.getElementValueById(G))&&CommonValidator.getElementValueById(G)!="mm/dd/yyyy"){var C=new cDate(CommonValidator.getElementValueById(G));var E=new Date(C.intYear,C.intMonth-1,C.intDate+1);if(E<new Date()){B=START_DATE_SHOULD_BE_GREATER_THAN_CURRENT_DATE+"\n"}}if(CommonValidator.isNotBlank(CommonValidator.getElementValueById(F))&&CommonValidator.getElementValueById(F)!="mm/dd/yyyy"){var A=new cDate(CommonValidator.getElementValueById(F));var D=new Date(A.intYear,A.intMonth-1,A.intDate+1);if(D<new Date()){B=B+END_DATE_SHOULD_BE_GREATER_THAN_CURRENT_DATE+"\n"}}return B}function validateForEndDate(){var H=document.getElementById("when_travaelduration").value;var G=document.getElementById("when_enddate").value;var D=document.getElementById("when_startdate").value;if(G!="mm/dd/yyyy"&&Trim(G)!=""&&(Trim(D)==""||D=="mm/dd/yyyy")&&H>=0){if(H==0){H=1}var C=new Date();var B=new cDate(G);var A=new Date(B.intYear,B.intMonth-1,B.intDate);var F=C.getTime();var E=new Date();E.setTime(F+(H-1)*(24*60*60*1000));if(E>A){return"The duration does not match with the End Date"}else{if(E.getYear()>1900){document.getElementById("when_startdate").value=((new Date()).getMonth()+1)+"/"+(new Date()).getDate()+"/"+((new Date()).getYear())}else{document.getElementById("when_startdate").value=((new Date()).getMonth()+1)+"/"+(new Date()).getDate()+"/"+((new Date()).getYear()+1900)}}}return""}function replaceAll(D,C,B){var A=D.indexOf(C);while(A>-1){D=D.replace(C,B);A=D.indexOf(C)}return D}function pushDefaultValuetoWhen(){var C=document.getElementById("when_travaelduration").value;var F=document.getElementById("when_enddate").value;var L=document.getElementById("when_startdate").value;if((F=="mm/dd/yyyy"||Trim(F)=="")&&Trim(L)!=""&&L!="mm/dd/yyyy"&&C>=0){if(C==0){C=1}var I=new cDate(L);var J=new Date(I.intYear,I.intMonth-1,I.intDate);var K=J.getTime();var D=new Date();D.setTime(K+(C-1)*(24*60*60*1000));if(D.getYear()>1900){document.getElementById("when_enddate").value=(D.getMonth()+1)+"/"+D.getDate()+"/"+D.getYear()}else{document.getElementById("when_enddate").value=(D.getMonth()+1)+"/"+D.getDate()+"/"+(D.getYear()+1900)}}else{if(F!="mm/dd/yyyy"&&Trim(F)!=""&&L!="mm/dd/yyyy"&&Trim(L)!=""){var I=new cDate(L);var B=new cDate(F);var H=new Date(I.intYear,I.intMonth-1,I.intDate);var G=new Date(B.intYear,B.intMonth-1,B.intDate);var A=1000*60*60*24;var E=Math.abs(Math.ceil((G.getTime()-H.getTime())/A));C=E+1;document.getElementById("when_travaelduration").value=C}}}function setDefaultText(A,B){if(document.getElementById(A).value==""){document.getElementById(A).value=B}}var whenjsCalendarObj=new Calendar(false,null,whenjsOnSelect,whenjsOnClose);whenjsCalendarObj.weekNumbers=false;whenjsCalendarObj.firstDayOfWeek=0;whenjsCalendarObj.setTtDateFormat="%A, %B %e, %Y";whenjsCalendarObj.setRange(2002,2020);var txtCalId;function whenjsOnClick(E,B){txtCalId=B;var A=null;whenjsCalendarObj.create();var D=document.getElementById(B).value;if(D!="mm/dd/yyyy"){var C=new cDate(D)}else{var C=new cDate("")}A=createDateObject(E,C);whenjsCalendarObj.setDate(A);whenjsCalendarObj.showAtElement(document.getElementById(B),"BR")}function whenjsOnClose(A){A.hide()}function whenjsOnSelect(B){if(B.dateClicked){var A=B.date.getMonth()+1;document.getElementById(txtCalId).value=A+"/"+B.date.getDate()+"/"+B.date.getFullYear();B.callCloseHandler()}}function createDateObject(A,G){var D=null;var E=G.intDate;var H=G.intMonth-1;var F=G.intYear;var J=new cDate((new Date()).getMonth()+"/"+(new Date()).getDate()+"/"+((new Date()).getYear()+1900));if((F=="")||((E!="")&&(H==""))){if(A=="startdate"){var B=document.getElementById("selectedSeasonId").value;if(B!=""){var I=new cDate(document.getElementById(B+"StartId").value);var L=new Date(I.intYear,I.intMonth-1,I.intDate);if(L>new Date()){D=L}else{D=new Date()}}else{D=new Date()}}else{if(A=="enddate"){var B=document.getElementById("selectedSeasonId").value;var C=document.getElementById("when_travaelduration").value;var K=CommonValidator.checkPositiveInteger("when_travaelduration","travel duration");if(B!=""){if(C!=""&&C!="0"&&K==""){var I=new cDate(document.getElementById(B+"StartId").value);D=new Date(I.intYear,I.intMonth-1,I.intDate);var M=D.getTime();D.setTime(M+C*(24*60*60*1000))}else{var I=new cDate(document.getElementById(B+"EndId").value);D=new Date(I.intYear,I.intMonth-1,I.intDate)}}else{D=new Date();if(C!=""&&C!="0"&&K==""){var M=D.getTime();D.setTime(M+C*(24*60*60*1000))}else{}}}else{D=new Date()}}}else{if(H==""){H=0}if(E==""){E=1}D=new Date(F,H,E)}return D}function showWheelsAlert(B,A){showIt();showPoiPopUp("wheelsAlertDivId",320,94);document.getElementById("wheelsAlertTitle").innerHTML=B;document.getElementById("wheelsAlertBody").innerHTML=A}function hideWheelsAlert(){hideDivById("wheelsAlertDivId");hideIt()}function categoryMouseOver(B){var C=B.id;if(C){var A=C.substring(0,C.indexOf("_"));if(B.src.substr(B.src.lastIndexOf("/")+1)!=A+"Selected.gif"){B.src="/html/themes/wheelscpv/skins/images/what/"+A+"Over.gif"}}}function categoryMouseOut(B){var C=B.id;var A=C.substring(0,C.indexOf("_"));if(B.src.substr(B.src.lastIndexOf("/")+1)!=A+"Selected.gif"){B.src="/html/themes/wheelscpv/skins/images/what/"+A+"NotSelected.gif"}}function showPopup(){resetSelectedSubCategory();var C=document.getElementsByName("categorycheck");for(i=0;i<C.length;i++){if(C[i].checked){var B=C[i].value;var A="sub_"+B;if(document.getElementById(A)){document.getElementById(A).style.display="block"}}else{var B=C[i].value;var A="sub_"+B;if(document.getElementById(A)){document.getElementById(A).style.display="none"}}}setSelectedSubCategoryIds();document.getElementById("viewadvancesearchpopup").style.display="none";showIt();document.getElementById("viewoptiospop").style.display="block";showIt();hideIt()}function addSelectedCat(){var B=document.getElementsByName("subcategorycheck");var C="";for(i=0;i<B.length;i++){if(B[i].checked){if(C==""){C+=B[i].value}else{C+=","+B[i].value}}}if(C!=""){document.getElementById("selectedItemSubCategory").value=C}else{var A="";var B=document.getElementsByName("categorycheck");for(i=0;i<B.length;i++){if(B[i].checked){if(A==""){A+=B[i].value}else{A+=","+B[i].value}}}document.getElementById("selectedItemSubCategory").value=A}document.getElementById("viewoptiospop").style.display="none";hideIt()}function openWhatSearchPopUp(){setAdvanceSearchAttribute();document.getElementById("viewoptiospop").style.display="none";showIt();document.getElementById("viewadvancesearchpopup").style.display="block";showIt();hideIt()}function addAdvanceSearchAttribute(){hideIt();document.getElementById("isAdvancesearch").value="isAdvancesearch";document.getElementById("viewadvancesearchpopup").style.display="none"}function hideAdvancesearchPopup(){showSelectedCheckBox($("serchAttributesForPersisting").value);document.getElementById("isAdvancesearch").value="";document.getElementById("viewadvancesearchpopup").style.display="none";hideIt()}function hidePopup(){showSelectedSubCategoryCheckBox($("categoryIdsForPersisting").value);document.getElementById("viewoptiospop").style.display="none";hideIt()}function modifySearchDivVisibility(E){var C=document.getElementById("selectedItemSubCategory").value;var D=false;if(E.checked){var B=document.getElementById("masterCategoryId").value;if(B==null||B==0){B=1}document.getElementById("selectedItemSubCategory").value=C+","+E.value;document.getElementById("selectedmastercatId").innerHTML=masterCatName[B-1].toLowerCase();document.getElementById("selectedmastercatId_2").innerHTML=masterCatName[B-1].toUpperCase();document.getElementById("selectedmastercatId_3").innerHTML=masterCatName[B-1].toUpperCase();document.getElementById("displaywhencatselected").style.display="block"}else{resetSelectedSubCategory();var A=document.getElementsByName("categorycheck");for(i=0;i<A.length;i++){if(A[i].checked){D=true;break}}if(!D){document.getElementById("displaywhencatselected").style.display="none"}}}function resetSelectedSubCategory(){var H=document.getElementById("selectedItemSubCategory").value;var B="";var F=document.getElementsByName("categorycheck");for(i=0;i<F.length;i++){if(F[i].checked){if(B==""){B+=F[i].value}else{B+=","+F[i].value}}}var I=document.getElementsByName("subcategorycheck");for(i=0;i<I.length;i++){I[i].checked=false}var J="";var E=B.split(",");var A=H.split(",");for(i=0;i<E.length;i++){var G="sub_"+E[i];var D=document.getElementById(G);if(D){var C=D.getElementsByTagName("input");for(j=0;j<C.length;j++){if(C[j].type=="checkbox"){for(k=0;k<A.length;k++){if(C[j].value==A[k]){C[j].checked=true;if(J==""){J+=A[k]}else{J+=","+A[k]}}}}}}}if(J==""){document.getElementById("selectedItemSubCategory").value=B}else{document.getElementById("selectedItemSubCategory").value=J}}function whatSearchValidation(B){var C=document.whatForm.placeOrEvent.value;var A="";if(B!="basicSearch"&&C==""){return""}if(Trim(C).length<3||C==""){return JS_MESSAGE_MINIMUM_SEARCH_CHAR}else{return""}}function whatRegionValidation(){if(document.whatForm.city){if(document.whatForm.region.value!=""&&(document.whatForm.city.value!=""||document.whatForm.state.value!="")){return JS_MESSAGE_CHOOSE_EITHER_CITY_STATE_OR_REGION}else{return""}}else{return""}}function whatSearchValidate(B){var A="";resetTheDefaultString("placeOrEvent",WHAT_SEARCH_FIELD_DEF_STRING);if(A==""){A=checkpoiSearchName("placeOrEvent",JS_MSG_WHAT_SEARCH_FOR_PLACE_OR_EVENT)}if(A==""){A=whatSearchValidation(B)}if(A==""){A=whatRegionValidation()}if(A==""&&B!="basicSearch"){A=checkpoiSearchName("whatcity","City")}if(A==""){if(B=="basicSearch"){document.getElementById("isAdvancesearch").value="false"}else{document.getElementById("isAdvancesearch").value="true"}var C=document.whatForm.masterCategoryId.value;setValueInAdvanceSearchPage(C);getWhatSearchResult()}else{showErrorMessage(A,WCP_MESSAGE_CONTENT_DIV_ID);document.whatForm.placeOrEvent.focus()}return false}function clearWhat(){hideMessage(WCP_MESSAGE_CONTENT_DIV_ID);document.whatForm.placeOrEvent.value="";if(document.whatForm.city){document.whatForm.city.value="";document.whatForm.state.value="";document.whatForm.region.value=""}}function setValueInAdvanceSearchPage(A){if(A==1){setZeroOrOne("kidFriendly05Id");setZeroOrOne("kidFriendly612Id");setZeroOrOne("recommendedForCouplesId");setZeroOrOne("kidFriendlyTeenId");setZeroOrOne("recommendedForSeniorsId");setZeroOrOne("editorPickId");setOneOrZeroTwo("nonSmokingRoomsId");setOneOrZeroTwo("airportShuttleServiceId");setOneOrZeroTwo("kidsActivitiesId");setOneOrZeroTwo("telephoneFreeLocalCallsId");setOneOrZeroTwo("parkingFreeId");setOneOrZeroTwo("allSuitesId");setOneOrZeroTwo("allInclusiveId");setOneOrZeroTwo("hotTubId");setOneOrZeroTwo("golfCourseId");setOneOrZeroTwo("petsAllowedId");if(Ischecked("fitnessCenterId")){document.getElementById("fitnessCenterId").value="1,2"}if(Ischecked("swimmingPoolId")){document.getElementById("swimmingPoolId").value="1,2,3,4"}if(Ischecked("breakfastId")){document.getElementById("breakfastId").value="1,2,3,4,5"}if(Ischecked("roomServiceId")){document.getElementById("roomServiceId").value="1,2,3,4,5"}if(Ischecked("beachId")){document.getElementById("beachId").value="1,2"}if(Ischecked("casinoId")){document.getElementById("casinoId").value="1,2"}if(Ischecked("tennisCourtsId")){document.getElementById("tennisCourtsId").value="1,2"}if(Ischecked("laundryServicesId")){document.getElementById("laundryServicesId").value="1,2,3"}if(Ischecked("kitchensAvailableId")){document.getElementById("kitchensAvailableId").value="1,2,3"}if(Ischecked("internetInRoomId")){document.getElementById("internetInRoom").value="1,2,3,4"}if(Ischecked("internetInRoomWirelessId")){document.getElementById("internetInRoom").value="1,2,3,4"}if(Ischecked("internetFeesInRoomId")){document.getElementById("internetFeesInRoomId").value="1"}}else{if(A==2){setZeroOrOne("kidFriendly05Id");setZeroOrOne("kidFriendly612Id");setZeroOrOne("kidFriendlyTeenId");setZeroOrOne("recommendedForSeniorsId");setZeroOrOne("recommendedForMenId");setZeroOrOne("recommendedForWomenId");setZeroOrOne("recommendedForCouplesId");setZeroOrOne("editorPickId")}else{if(A==3){setZeroOrOne("kidFriendly05Id");setZeroOrOne("kidFriendly612Id");setZeroOrOne("kidFriendlyTeenId");setZeroOrOne("adultOnlyId");setZeroOrOne("recommendedForMenId");setZeroOrOne("recommendedForWomenId");setZeroOrOne("recommendedForCouplesId");setZeroOrOne("recommendedForSeniorsId");setZeroOrOne("editorPickId");setOneOrZeroTwo("toursId");setZeroOrOne("ticketRequiredId")}else{if(A==4){var B="";if(Ischecked("standalone")){B=1}if(Ischecked("inmallId")){B=appendValue(B,2)}document.getElementById("locationId").value=B}else{if(A==5){setZeroOrOne("kidFriendly05Id");setZeroOrOne("kidFriendly612Id");setZeroOrOne("kidFriendlyTeenId");setZeroOrOne("adultOnlyId");setZeroOrOne("recommendedForMenId");setZeroOrOne("recommendedForWomenId");setZeroOrOne("recommendedForCouplesId");setZeroOrOne("recommendedForSeniorsId");setZeroOrOne("editorPickId")}else{if(A==6){}else{if(A==7){setZeroOrOne("kidFriendly05Id");setZeroOrOne("kidFriendly612Id");setZeroOrOne("kidFriendlyTeenId");setZeroOrOne("adultOnlyId");setZeroOrOne("recommendedForMenId");setZeroOrOne("recommendedForWomenId");setZeroOrOne("recommendedForCouplesId");setZeroOrOne("recommendedForSeniorsId");setZeroOrOne("editorPickId");setZeroOrOne("ticketsRequiredId");setOneOrZeroTwo("entranceTicketsOnlineId")}else{if(A==8){}}}}}}}}}function setZeroOrOne(B){var A=document.getElementById(B);if(A){if(A.checked){A.value=1}else{A.value=0}}}function setOneOrZeroTwo(B){var A=document.getElementById(B);if(A){if(A.checked){A.value=1}else{A.value="0 2"}}}function Ischecked(B){var A=document.getElementById(B);if(A){if(A.checked){return true}}return false}function appendValue(A,B){if(A==""){return B}else{return A+","+B}}function checkdata(E){var B;mod=E%2;var D=new Array(0,2,1,4,3,7,8,5,6);for(i=1;i<9;i++){if(E==i){var C="icondiv"+i;var A="iconcontentDiv"+i;B="icondiv"+D[E];document.getElementById(C).className="tdColselected";document.getElementById(A).style.display="block";document.getElementById(B).className="tdColselectedbtm"}else{var C="icondiv"+i;var A="iconcontentDiv"+i;if(C!=B){document.getElementById(C).className="tdCol"}document.getElementById(A).style.display="none"}}}function displaySelectedCategoryDivText(A){if(A!=null&&A!=""&&A!="0"){var C="iconcontentDiv"+A;var B=document.getElementById("whatSelectedCategoryDivTextarea").value;MM_setTextOfLayer(C,B);document.getElementById("whatSelectedCategoryDivTextarea").value="";checkdata(A)}}function setllRating(A){if(A!=null&&A!=""){document.whatSearchForm.llRating[A].selected=true}}function setaAARating(A){if(A!=null&&A!=""){document.whatSearchForm.aAARating[A].selected=true}}function validateCityCommaStateCode(D,C){var B="";var A=document.getElementById("centerpointGeoCode").value;if(A==null||Trim(A)==""){var E=document.whatForm.city.value;if(E!=null&&Trim(E)!=""){if(document.whatForm.state.value==""){return B="Please enter  State Code \n"}}}return""}function setTheDefaultString(C,A){var B=document.getElementById(C).value;if(Trim(B)==""){document.getElementById(C).value=A}}function resetTheDefaultString(C,A){var B=document.getElementById(C).value;if(Trim(B)==A){document.getElementById(C).value=""}}function checkWhatAlphaNumeric(B,A){var C="";var D=CommonValidator.getElementValueById(B);if(CommonValidator.isNotNull(D)&&CommonValidator.isNotBlank(D)){if(CommonValidator.test(D,"^[A-Z,a-z,0-9,/,\\s,\\t,,,.,',&,-,_]*$")){}else{C=A+WHITE_SPACE+NOT_ALPHANUMERIC+"\n"}if(C==""){if(CommonValidator.test(D,"^[/,\\s,\\t,,,.,',&,@,-,_]*$")){C="Please enter atleast one alphabet or a number"}}}return C}function removeSelectOption(A){var B=A.options[0].value;if(B==-1){A.remove(0)}}function resetWhatPortletValue(){document.getElementById("searchPlaceEventId").value="";document.getElementById("location").value="";document.getElementById("centerpointGeoCode").value=""}function resetGeoCode(){document.getElementById("centerpointGeoCode").value=""}function refreshWhatPortlet(){for(i=1;i<9;i++){var A="iconcontentDiv"+i;var B="icondiv"+i;document.getElementById(A).style.display="none";document.getElementById(B).className="tdCol"}document.whatForm.masterCategoryId.value="";document.getElementById("whatSelectedCategoryDivTextarea").value=""}function setAdvanceSearchAttribute(){var A=document.getElementById("parentattributediv").getElementsByTagName("*");var B="";for(i=0;i<A.length;i++){if(A[i].type=="checkbox"){if(A[i].checked){if(B==""){B=A[i].id}else{B+=","+A[i].id}}}}$("serchAttributesForPersisting").value=B}function showSelectedCheckBox(A){var B=document.getElementById("parentattributediv").getElementsByTagName("*");for(i=0;i<B.length;i++){if(B[i].type=="checkbox"){B[i].checked=false}}if(A==null||A==""){return }var C=A.split(",");for(i=0;i<C.length;i++){$(C[i]).checked=true}}function setSelectedSubCategoryIds(){var A=document.getElementsByName("subcategorycheck");var B="";for(i=0;i<A.length;i++){if(A[i].type=="checkbox"){if(A[i].checked){if(B==""){B=A[i].value}else{B+=","+A[i].value}}}}$("categoryIdsForPersisting").value=B}function showSelectedSubCategoryCheckBox(A){var B=document.getElementsByName("subcategorycheck");if(A==null||A==""){for(i=0;i<B.length;i++){B[i].checked=false}return }var C=A.split(",");for(i=0;i<B.length;i++){B[i].checked=false;for(j=0;j<C.length;j++){if(B[i].value==C[j]){$(B[i]).checked=true}}}}var howModesDivArray=new Array("car","mc","rv");var howTravelModesValueArr=new Array("car,truck,suv","motorcycle","rv");function changeTravelMode(E){for(i=0;i<3;i++){var A=howModesDivArray[i]+"_img";var D=howModesDivArray[i]+"_textDiv";var B=document.getElementById(D).parentNode;var C=B.parentNode;if(E==howModesDivArray[i]){document.getElementById(A).style.visibility="visible";document.getElementById(D).className="modeTextSelected";B.className="modeSelected";C.className="modeButtonSelectedDiv";document.howForm.travelMode.value=howTravelModesValueArr[i]}else{document.getElementById(A).style.visibility="hidden";document.getElementById(D).className="modeTextNotselected";B.className="modeNotselected";C.className="modeButtonNotselectedDiv"}}}function resetHowForm(A){if(A!=null){if(confirm(JS_MSG_HOW_RESET)){initialTravelModeDivId=A.initialTravelModeDivId.value;initialValueMilesPerDay=A.initialValueMilesPerDay.value;A.reset();changeTravelMode(initialTravelModeDivId);if(howMilesPerDaySliderElement!=null){howMilesPerDaySliderElement.setValue(getValueForSlider(60,initialValueMilesPerDay))}}}return false}function editGettingStartedWhoDetails(){minimizePortlet(LayoutColumns.plid,"who_portlet",true,"");minimizePortlet(LayoutColumns.plid,"gettingstarted_portlet",false,"");minimizePortlet(LayoutColumns.plid,"what_portlet",false,"");minimizePortlet(LayoutColumns.plid,"when_portlet",false,"");minimizePortlet(LayoutColumns.plid,"where_portlet",false,"");minimizePortlet(LayoutColumns.plid,"how_portlet",false,"");minimizePortlet(LayoutColumns.plid,"map_portlet",false,"");minimizePortlet(LayoutColumns.plid,"calendar_portlet",false,"");minimizePortlet(LayoutColumns.plid,"trip_suitcase_portlet",false,"")}function editGettingStartedWhereDetails(){minimizePortlet(LayoutColumns.plid,"where_portlet",true,"");minimizePortlet(LayoutColumns.plid,"gettingstarted_portlet",false,"");minimizePortlet(LayoutColumns.plid,"what_portlet",false,"");minimizePortlet(LayoutColumns.plid,"when_portlet",false,"");minimizePortlet(LayoutColumns.plid,"who_portlet",false,"");minimizePortlet(LayoutColumns.plid,"how_portlet",false,"");minimizePortlet(LayoutColumns.plid,"calendar_portlet",false,"");minimizePortlet(LayoutColumns.plid,"trip_suitcase_portlet",false,"")}function editGettingStartedWhatDetails(){minimizePortlet(LayoutColumns.plid,"what_portlet",true,"");minimizePortlet(LayoutColumns.plid,"gettingstarted_portlet",false,"");minimizePortlet(LayoutColumns.plid,"where_portlet",false,"");minimizePortlet(LayoutColumns.plid,"when_portlet",false,"");minimizePortlet(LayoutColumns.plid,"who_portlet",false,"");minimizePortlet(LayoutColumns.plid,"how_portlet",false,"");minimizePortlet(LayoutColumns.plid,"map_portlet",false,"");minimizePortlet(LayoutColumns.plid,"calendar_portlet",false,"");minimizePortlet(LayoutColumns.plid,"trip_suitcase_portlet",false,"")}function editGettingStartedWhenDetails(){minimizePortlet(LayoutColumns.plid,"when_portlet",true,"");minimizePortlet(LayoutColumns.plid,"gettingstarted_portlet",false,"");minimizePortlet(LayoutColumns.plid,"what_portlet",false,"");minimizePortlet(LayoutColumns.plid,"where_portlet",false,"");minimizePortlet(LayoutColumns.plid,"who_portlet",false,"");minimizePortlet(LayoutColumns.plid,"how_portlet",false,"");minimizePortlet(LayoutColumns.plid,"map_portlet",false,"");minimizePortlet(LayoutColumns.plid,"trip_suitcase_portlet",false,"")}function editGettingStartedHowDetails(){minimizePortlet(LayoutColumns.plid,"how_portlet",true,"");minimizePortlet(LayoutColumns.plid,"gettingstarted_portlet",false,"");minimizePortlet(LayoutColumns.plid,"what_portlet",false,"");minimizePortlet(LayoutColumns.plid,"when_portlet",false,"");minimizePortlet(LayoutColumns.plid,"who_portlet",false,"");minimizePortlet(LayoutColumns.plid,"where_portlet",false,"");minimizePortlet(LayoutColumns.plid,"map_portlet",false,"");minimizePortlet(LayoutColumns.plid,"calendar_portlet",false,"");minimizePortlet(LayoutColumns.plid,"trip_suitcase_portlet",false,"")}function editCategoryListPst(){minimizePortlet(LayoutColumns.plid,"gettingstarted_portlet",false,"");minimizePortlet(LayoutColumns.plid,"when_portlet",false,"");minimizePortlet(LayoutColumns.plid,"where_portlet",false,"");minimizePortlet(LayoutColumns.plid,"how_portlet",false,"");minimizePortlet(LayoutColumns.plid,"map_portlet",false,"");minimizePortlet(LayoutColumns.plid,"who_portlet",false,"");minimizePortlet(LayoutColumns.plid,"calendar_portlet",false,"");minimizePortlet(LayoutColumns.plid,"trip_suitcase_portlet",false,"");minimizePortlet(LayoutColumns.plid,"what_portlet",true,"");getCategoryList("1")}function editCategoryListPea(){minimizePortlet(LayoutColumns.plid,"gettingstarted_portlet",false,"");minimizePortlet(LayoutColumns.plid,"when_portlet",false,"");minimizePortlet(LayoutColumns.plid,"where_portlet",false,"");minimizePortlet(LayoutColumns.plid,"how_portlet",false,"");minimizePortlet(LayoutColumns.plid,"map_portlet",false,"");minimizePortlet(LayoutColumns.plid,"who_portlet",false,"");minimizePortlet(LayoutColumns.plid,"calendar_portlet",false,"");minimizePortlet(LayoutColumns.plid,"trip_suitcase_portlet",false,"");minimizePortlet(LayoutColumns.plid,"what_portlet",true,"");getCategoryList("2")}function editCategoryListPga(){minimizePortlet(LayoutColumns.plid,"gettingstarted_portlet",false,"");minimizePortlet(LayoutColumns.plid,"when_portlet",false,"");minimizePortlet(LayoutColumns.plid,"where_portlet",false,"");minimizePortlet(LayoutColumns.plid,"how_portlet",false,"");minimizePortlet(LayoutColumns.plid,"map_portlet",false,"");minimizePortlet(LayoutColumns.plid,"who_portlet",false,"");minimizePortlet(LayoutColumns.plid,"calendar_portlet",false,"");minimizePortlet(LayoutColumns.plid,"trip_suitcase_portlet",false,"");minimizePortlet(LayoutColumns.plid,"what_portlet",true,"");getCategoryList("3")}function editCategoryListPsa(){minimizePortlet(LayoutColumns.plid,"gettingstarted_portlet",false,"");minimizePortlet(LayoutColumns.plid,"when_portlet",false,"");minimizePortlet(LayoutColumns.plid,"where_portlet",false,"");minimizePortlet(LayoutColumns.plid,"how_portlet",false,"");minimizePortlet(LayoutColumns.plid,"map_portlet",false,"");minimizePortlet(LayoutColumns.plid,"who_portlet",false,"");minimizePortlet(LayoutColumns.plid,"calendar_portlet",false,"");minimizePortlet(LayoutColumns.plid,"trip_suitcase_portlet",false,"");minimizePortlet(LayoutColumns.plid,"what_portlet",true,"");getCategoryList("4")}function editCategoryListTdo(){minimizePortlet(LayoutColumns.plid,"gettingstarted_portlet",false,"");minimizePortlet(LayoutColumns.plid,"when_portlet",false,"");minimizePortlet(LayoutColumns.plid,"where_portlet",false,"");minimizePortlet(LayoutColumns.plid,"how_portlet",false,"");minimizePortlet(LayoutColumns.plid,"map_portlet",false,"");minimizePortlet(LayoutColumns.plid,"who_portlet",false,"");minimizePortlet(LayoutColumns.plid,"calendar_portlet",false,"");minimizePortlet(LayoutColumns.plid,"trip_suitcase_portlet",false,"");minimizePortlet(LayoutColumns.plid,"what_portlet",true,"");getCategoryList("5")}function editCategoryListTyn(){minimizePortlet(LayoutColumns.plid,"gettingstarted_portlet",false,"");minimizePortlet(LayoutColumns.plid,"when_portlet",false,"");minimizePortlet(LayoutColumns.plid,"where_portlet",false,"");minimizePortlet(LayoutColumns.plid,"how_portlet",false,"");minimizePortlet(LayoutColumns.plid,"map_portlet",false,"");minimizePortlet(LayoutColumns.plid,"who_portlet",false,"");minimizePortlet(LayoutColumns.plid,"calendar_portlet",false,"");minimizePortlet(LayoutColumns.plid,"trip_suitcase_portlet",false,"");minimizePortlet(LayoutColumns.plid,"what_portlet",true,"");getCategoryList("6")}function editCategoryListEvents(){minimizePortlet(LayoutColumns.plid,"gettingstarted_portlet",false,"");minimizePortlet(LayoutColumns.plid,"when_portlet",false,"");minimizePortlet(LayoutColumns.plid,"where_portlet",false,"");minimizePortlet(LayoutColumns.plid,"how_portlet",false,"");minimizePortlet(LayoutColumns.plid,"map_portlet",false,"");minimizePortlet(LayoutColumns.plid,"who_portlet",false,"");minimizePortlet(LayoutColumns.plid,"calendar_portlet",false,"");minimizePortlet(LayoutColumns.plid,"trip_suitcase_portlet",false,"");minimizePortlet(LayoutColumns.plid,"what_portlet",true,"");getCategoryList("7")}function editCategoryListServices(){minimizePortlet(LayoutColumns.plid,"gettingstarted_portlet",false,"");minimizePortlet(LayoutColumns.plid,"when_portlet",false,"");minimizePortlet(LayoutColumns.plid,"where_portlet",false,"");minimizePortlet(LayoutColumns.plid,"how_portlet",false,"");minimizePortlet(LayoutColumns.plid,"map_portlet",false,"");minimizePortlet(LayoutColumns.plid,"who_portlet",false,"");minimizePortlet(LayoutColumns.plid,"calendar_portlet",false,"");minimizePortlet(LayoutColumns.plid,"trip_suitcase_portlet",false,"");minimizePortlet(LayoutColumns.plid,"what_portlet",true,"");getCategoryList("8")}function editLoggedInDetails(){minimizePortlet(LayoutColumns.plid,"gettingstarted_portlet",false,"");minimizePortlet(LayoutColumns.plid,"what_portlet",false,"");minimizePortlet(LayoutColumns.plid,"when_portlet",false,"");minimizePortlet(LayoutColumns.plid,"where_portlet",false,"");minimizePortlet(LayoutColumns.plid,"how_portlet",false,"");minimizePortlet(LayoutColumns.plid,"map_portlet",false,"");minimizePortlet(LayoutColumns.plid,"calendar_portlet",false,"");minimizePortlet(LayoutColumns.plid,"trip_suitcase_portlet",false,"");minimizePortlet(LayoutColumns.plid,"who_portlet",false,"");document.getElementById("mrts_portlet").style.display="block";loadMyRoadTripStuffTab("myTripPersonalities","myTripPersonalitiesTab")}function editNotLoggedInDetails(){minimizePortlet(LayoutColumns.plid,"gettingstarted_portlet",false,"");minimizePortlet(LayoutColumns.plid,"what_portlet",false,"");minimizePortlet(LayoutColumns.plid,"when_portlet",false,"");minimizePortlet(LayoutColumns.plid,"where_portlet",false,"");minimizePortlet(LayoutColumns.plid,"how_portlet",false,"");minimizePortlet(LayoutColumns.plid,"map_portlet",false,"");minimizePortlet(LayoutColumns.plid,"calendar_portlet",false,"");minimizePortlet(LayoutColumns.plid,"trip_suitcase_portlet",false,"");minimizePortlet(LayoutColumns.plid,"who_portlet",false,"");document.getElementById("wheelsLogin_").style.display="block"}function loggedInWho(){document.getElementById("mrts_portlet").style.display="none";editGettingStartedWhoDetails()}function loggedInWhat(){document.getElementById("mrts_portlet").style.display="none";editGettingStartedWhatDetails()}function loggedInWhen(){document.getElementById("mrts_portlet").style.display="none";editGettingStartedWhenDetails()}function loggedInWhere(){document.getElementById("mrts_portlet").style.display="none";editGettingStartedWhereDetails()}function loggedInHow(){document.getElementById("mrts_portlet").style.display="none";editGettingStartedHowDetails()}function loggedInPst(){document.getElementById("mrts_portlet").style.display="none";editCategoryListPst()}function loggedInPea(){document.getElementById("mrts_portlet").style.display="none";editCategoryListPea()}function loggedInPga(){document.getElementById("mrts_portlet").style.display="none";editCategoryListPga()}function loggedInPsa(){document.getElementById("mrts_portlet").style.display="none";editCategoryListPsa()}function loggedInTdo(){document.getElementById("mrts_portlet").style.display="none";editCategoryListTdo()}function loggedInTyn(){document.getElementById("mrts_portlet").style.display="none";editCategoryListTyn()}function loggedInEvents(){document.getElementById("mrts_portlet").style.display="none";editCategoryListEvents()}function loggedInServices(){document.getElementById("mrts_portlet").style.display="none";editCategoryListServices()}function checkIt(A){if(A.value=="new_trip"){document.getElementById("createButton").style.display="block";document.getElementById("text").style.display="block";cleanFields()}else{document.getElementById("createButton").style.display="none";document.getElementById("text").style.display="none";document.getElementById("newTrip").value=""}if(A.value=="existing_trip"){document.getElementById("getButton").style.display="block";document.getElementById("combo").style.display="block";cleanFields()}else{document.getElementById("getButton").style.display="none";document.getElementById("combo").style.display="none";document.getElementById("tripExists").value=""}}function resetGettingStartedForm(B){var A="Are you sure you want to reset your Getting Started Form to default?";if(B!=null){if(confirm(A)){B.reset();cleanFields();document.getElementById("getButton").style.display="none";document.getElementById("createButton").style.display="block";document.getElementById("text").style.display="block";document.getElementById("combo").style.display="none"}}}function getTripState(form,selectedState){var selectedcountry=0;var isSelect=false;for(j=0;j<whereJSONCountryObject.Country[0].objJsonState.length;j++){if(whereJSONCountryObject.Country[[0]].objJsonState[j].StateCode==selectedState){isSelect=true}eval("document."+form).tripState[j]=new Option(whereJSONCountryObject.Country[[0]].objJsonState[j].StateCode+"-"+whereJSONCountryObject.Country[[0]].objJsonState[j].StateName,whereJSONCountryObject.Country[[0]].objJsonState[j].StateCode);eval("document."+form).tripState[j].selected=isSelect;isSelect=false}}var errorMessagePopUp;function gettingStartedValidate(E,F){var H=document.gettingStartedForm;var C=H.existingTrip.value;var J=trim(H.tripName.value);var I=trim(H.tripStreetAddress.value);var D=trim(H.tripCity.value);var B=H.tripState.value;var A=trim(H.tripZipPostalCode.value);if(J==""||D==""||B==""){alert("All fields with * are Mandatory!  Enter Mandatory Fields");return false}else{var G=CommonValidator.checkPostalCode("tripZipPostalCode","");if(G!=""){showPostalErrorAlert();return false}}createTrip(E,F)}function cleanFields(){var A=document.gettingStartedForm;A.tripName.value="";A.tripStreetAddress.value="";A.tripCity.value="";A.tripState.selectedIndex=0;A.tripZipPostalCode.value=""}var calendarSelectedDateYYYYMMMDD=null;function setSelectedDate(A){calendarSelectedDateYYYYMMMDD=A.id}function addToJournal(){alert("Selected Date is "+calendarSelectedDateYYYYMMMDD+" Work in progress")}function findEvents(){alert("Selected Date is "+calendarSelectedDateYYYYMMMDD+" Work in progress")}var selectedCalendarDayId;var selectedCalendarDayClassname;function test(){alert("s");css="rowBg-1";return(css)}function changeColor(A){document.getElementById(A.id).className="selectedDay calendarDay"}function changeColorBack(A){document.getElementById(A.id).className="calendarDay"}function changeCSS(A){if(selectedCalendarDayId){document.getElementById(selectedCalendarDayId).className=selectedCalendarDayClassname}if(selectedCalendarDayId==A.id){document.getElementById(selectedCalendarDayId).className=selectedCalendarDayClassname}else{selectedCalendarDayId=A.id;selectedCalendarDayClassname=A.className;A.className="calendarDay selectedDay"}}var TRIP_SUITCASE_ACTION_GET_OTHER_DAY_TRIP="getOtherDayTrip";var TRIP_SUITCASE_ACTION_GET_FULL_ROUTE_MAP="getFullRouteMap";var TRIP_SUITCASE_PARAM_DIV="wcpv_tripsuitcase_portlet_container";var TRIP_SUITCASE_ACTION_REMOVE_ITEM="removeItem";var TRIP_SUITCASE_ACTION_GET_ARROUND_POIS="getArroundPOIs";var TRIP_SUITCASE_ACTION_RE_ARRANGE_ITEM="reArrangeItem";var TRIP_SUITCASE_ACTION_ADD_TO_TRIP_PLAN="addTOTripPlan";var TRIP_SUITCASE_ACTION_ADD_ALL_TO_TRIP_PLAN="addAllTOTripPlan";var TRIP_SUITCASE_ACTION_CLEAR_TRIP_PLAN="clearTripPlan";var TRIP_SUITCASE_ACTION_DELETE_DAY_IDEAS="deleteDayIdeas";var TRIP_SUITCASE_ACTION_ADD_DAY_IDEAS_TO_PLAN="addDayIdeasToPlan";var TRIP_SUITCASE_ACTION_CLEAR_MY_IDEAS="clearMyIdeas";var TRIP_SUITCASE_ACTION_CHANGE_TAB="changeTab";var TRIP_SUITCASE_ACTION_ROUND_TRIP="roundTrip";var TRIP_SUITCASE_ACTION_RENAME_TRIP="renameTrip";var TRIP_SUITCASE_ACTION_EDIT_TRIP_DESCRIPTION="editTripDescription";var TRIP_SUITCASE_ACTION_EDIT_TRIP_SPONSOREDBY="editTripSponsoredBy";var TRIP_SUITCASE_TAB_ROAD_TRIP_WITH_MAP="ROAD_TRIP_WITH_MAP";var TRIP_SUITCASE_ACTION_LOADING_ROAD_TRIP_WITHMAP="lodingRoadTripWithMap";var TRIP_SUITCASE_ACTION_PLOT_ROAD_TRIP="plotRoadTrip";var TRIP_SUITCASE_ACTION_INSERT_STOPOVER="insertStopOver";var tripSuitcaseDelemiter="###########";var TRIP_SUITCASE_ACTION_SAVE_STOPOVER="saveStopOver";var TRIP_SUITCASE_ACTION_EDIT_STOPOVER="editStopOver";var TRIP_SUITCASE_ACTION_DELETE_STOPOVER="deleteStopOver";var TRIP_SUITCASE_ACTION_EDIT_STOPOVER_NOTES="editStopOverNotes";var TRIP_SUITCASE_ACTION_INSERT_DAYBREAK="insertDayBreak";var TRIP_SUITCASE_ACTION_LEGBREAK="legBreak";var TRIP_SUITCASE_ACTION_GET_GEOCODE_FOR_LEGBREAK="getGeoCodeForLegBreak";var TRIP_SUITCASE_PARAM_MAP_MY_IDEAS_LIST="mapMyIdeasList";var TRIP_SUITCASE_PARAM_MY_IDEAS_LIST="myIdeasList";var TRIP_SUITCASE_ACTION_STORE_TRIP="storeTrip";var menuItems=new Array("tab1","tab2","tab3");var divItems=new Array("tabDiv1","tabDiv2","tabDiv3");var TRIP_SUITCASE_GET_SIGHTS_ALONG_THE_WAY="getSightsAlongTheWay";var tsTabState="2_0";function changeImg(A){for(i=0;i<3;i++){if(A==menuItems[i]){document.getElementById(menuItems[i]).className="tabsSelectedli";document.getElementById(divItems[i]).style.display="block"}else{document.getElementById(menuItems[i]).className="tabsNotselectedli";document.getElementById(divItems[i]).style.display="none"}}}function editWhoDetails(){minimizePortlet(LayoutColumns.plid,"who_portlet",true,"");reloadWhoPortlet("edit")}var numberOfGeoCodes=0;function initiateMAP(C){if(document.tripSuitcaseForm!=null&&document.tripSuitcaseForm.geoCodeStr!=null){var A=document.tripSuitcaseForm.geoCodeStr.value;var B=A.split(tripSuitcaseDelemiter);numberOfGeoCodes=B.length;if(numberOfGeoCodes==1){B=[B,B];numberOfGeoCodes=2}if(C=="onLoad"){plotTripPlanMap(B)}else{RoadTripWithMapLoding(B);setTimeout("plotRoadTrip()",20)}}}function addPushPinsToMap(Y,Q){if(!isMapPortletLoaded){setTimeout("addPushPinsToMap()",100);return }var S=document.tripSuitcaseForm.geoCodeStr.value;var J=S.split(tripSuitcaseDelemiter);var Z=document.tripSuitcaseForm.tripPlanTextArr.value;var F=Z.split(tripSuitcaseDelemiter);var C=document.tripSuitcaseForm.tripPlanPKArr.value;var V=C.split(tripSuitcaseDelemiter);var B=document.tripSuitcaseForm.triPlanFontcolorArrString.value;var R=B.split(tripSuitcaseDelemiter);var e=document.tripSuitcaseForm.tripPlanPushPinArrString.value;var I=e.split(tripSuitcaseDelemiter);var X=document.tripSuitcaseForm.triPlanNumbersArrString.value;var D=X.split(tripSuitcaseDelemiter);var K=document.tripSuitcaseForm.myIdeasGeoCodeStr.value;var U=K.split(tripSuitcaseDelemiter);var P=document.tripSuitcaseForm.myIdeasTextArr.value;var c=P.split(tripSuitcaseDelemiter);var d=document.tripSuitcaseForm.myIdeasPKArr.value;var M=d.split(tripSuitcaseDelemiter);var a=document.tripSuitcaseForm.myIdeasFontcolorArrString.value;var T=a.split(tripSuitcaseDelemiter);var A=document.tripSuitcaseForm.myIdeasPushPinArrString.value;var G=A.split(tripSuitcaseDelemiter);var O=document.tripSuitcaseForm.myIdeasNumbersArrString.value;var H=O.split(tripSuitcaseDelemiter);var N=document.tripSuitcaseForm.tripPlanMapItemIdArrayString.value;var L=N.split(tripSuitcaseDelemiter);var W=document.tripSuitcaseForm.myIdeasMapItemIdArrayString.value;var b=W.split(tripSuitcaseDelemiter);var E=new Array();if(K!=""){addMyIdeasToMap(U,c,M,G,T,H,b)}if(S!=""){addTripPlanToMap(J,F,V,I,R,D,L)}}function plotTripPlanMap(E,B){var F=document.getElementById("ts_routePreference");if(F){B=F.value}else{B="Fastest"}var A=new Array();var D="";for(var C=0;C<E.length;C++){if(D!=E[C]){A[A.length]=new Position(E[C])}D=E[C]}if(document.tripSuitcaseForm.isRoundTrip&&document.tripSuitcaseForm.isRoundTrip.value=="true"&&E[0]!=E[E.length]){A[A.length]=A[0]}removeDayEndPins();window.location.href="#tripsuitcase_anchor";getRouteMapFromPositionsArray(map,A,B,function(G){})}function editHowDetails(){minimizePortlet(LayoutColumns.plid,"how_portlet",true,"");reloadHowPortlet("edit")}function clearTripPlanPushPin(){var A=document.tripSuitcaseForm.tripPlanPKArr.value;var B=A.split(tripSuitcaseDelemiter);removePOIArrFromMap(B);A=document.tripSuitcaseForm.myIdeasPKArr.value;B=A.split(tripSuitcaseDelemiter);removePOIArrFromMap(B);removeDayEndPins();isRoutePlotted=true;fitBestZoomLevel(map)}function clearMyideasPushPin(){var A=document.tripSuitcaseForm.myIdeasPKArr.value;var B=A.split(tripSuitcaseDelemiter);removePOIArrFromMap(B);fitBestZoomLevel(map);document.tripSuitcaseForm.myIdeasGeoCodeStr.value="";document.tripSuitcaseForm.myIdeasTextArr.value="";document.tripSuitcaseForm.myIdeasPKArr.value="";document.tripSuitcaseForm.myIdeasFontcolorArrString.value="";document.tripSuitcaseForm.myIdeasPushPinArrString.value="";document.tripSuitcaseForm.myIdeasNumbersArrString.value=""}function removePOIPushPins(A){setTimeout("fitBestZoomLevel(map)",1000)}function getFullRouteMap(){window.location.href="#map_anchor";fitBestZoomLevel(map)}var noofdays;var days;var timeoutLeft;var timeoutRight;function delCols(B,C){var A=document.getElementById(C);for(i=1;i<=days;i++){colID="dayID"+i;colIDObj=document.getElementById(colID);if(colIDObj){A.removeChild(colIDObj)}}}function addCol(Q,A,O,K){var M=document.tripSuitcaseForm.addedStopOverDays.value;var D=M.split(tripSuitcaseDelemiter);var P=document.tripSuitcaseForm.problematicDays.value;if(P==""){P="100"}var N=P.split(tripSuitcaseDelemiter);noofdays=Q;if(noofdays>10){days=noofdays}else{days=10}if(O>10){initpos=(10-O)*52}else{initpos=0}A="slidetableRow";var J=document.getElementById(A);delCols(noofdays,A);document.getElementById("hdnDiv").style.left=initpos;var H=0;var G=0;for(i=1;i<=days;i++){var B=D[H];var L=N[G];var I=document.createElement("TD");if(i<=noofdays){if(i==O){clsname="daySelected";colID="dayID"+i;I.innerHTML="<a onmouseout=\"daySymbolMouseOut('"+colID+"');\" onmouseover=\"daySymbolMouseOver('"+colID+'\');" href="javascript:;" >'+K+"<br>"+i+"</a>";if(i-1==L&&(i-1)!=0||L==0){clsname="daySelected";G++}}else{if(i-1==B&&(i-1)!=0){clsname="stopOver";colID="dayID"+i;I.innerHTML="<a onmouseout=\"daySymbolMouseOut('"+colID+"');\" onmouseover=\"daySymbolMouseOver('"+colID+"');\">"+K+"<br>"+i+"</a>";H++}else{if(i-1==L&&(i-1)!=0||L==0){clsname="dayNotselected";colID="dayID"+i;I.innerHTML="<a onmouseout=\"daySymbolMouseOut('"+colID+"');\" onmouseover=\"daySymbolMouseOver('"+colID+'\');" href="javascript:;">'+K+"<br>"+i+"</a>";G++}else{clsname="dayNotselected";colID="dayID"+i;I.innerHTML="<a  onmouseout=\"daySymbolMouseOut('"+colID+"');\" onmouseover=\"daySymbolMouseOver('"+colID+'\');" href="javascript:;">'+K+"<br>"+i+"</a>"}}}var F="daySymbolMouseOver('"+colID+"');";var E="daySymbolMouseOut('"+colID+"');";I.onmouseover=new Function(F);I.onmouseout=new Function(E);if(clsname.indexOf("stopOver")==-1){var C="javascript:showIt(); cngCSS("+colID+",'"+noofdays+"','"+i+"','yes');";I.onclick=new Function(C)}I.setAttribute("id",colID)}else{clsname="dummy"}I.className=clsname;J.appendChild(I)}}function goRight(){var A=document.getElementById("daySliderRht").src;var B=document.getElementById("daySliderLft").src;if(noofdays>10){if(A!="/html/css/tripSuitcaseImages/rhtArrow.gif"){document.getElementById("daySliderRht").src="/html/css/tripSuitcaseImages/rhtArrow.gif"}totlen=noofdays*52;finalpos=528-totlen;currposStr=document.getElementById("hdnDiv").style.left;currposStrlen=(currposStr.length)-2;currpos=currposStr.substr(0,currposStrlen);if(currpos>=finalpos){postomov=currpos-13;document.getElementById("hdnDiv").style.left=postomov+"px";if(B!="/html/css/tripSuitcaseImages/lftArrow.gif"){document.getElementById("daySliderLft").src="/html/css/tripSuitcaseImages/lftArrow.gif"}timeoutRight=setTimeout("goRight()",50)}else{if(A!="/html/css/tripSuitcaseImages/lightRhtArrow.gif"){document.getElementById("daySliderRht").src="/html/css/tripSuitcaseImages/lightRhtArrow.gif"}}}}function goLeft(){var imageName=document.getElementById("daySliderLft").src;var rightImageName=document.getElementById("daySliderRht").src;if(noofdays>10){if(imageName!="/html/css/tripSuitcaseImages/lftArrow.gif"){document.getElementById("daySliderLft").src="/html/css/tripSuitcaseImages/lftArrow.gif"}totlen=noofdays*52;currposStr=document.getElementById("hdnDiv").style.left;currposStrlen=(currposStr.length)-2;currpos=currposStr.substr(0,currposStrlen);if(currpos<0){postomov=eval(currpos)+13;document.getElementById("hdnDiv").style.left=postomov+"px";if(rightImageName!="/html/css/tripSuitcaseImages/rhtArrow.gif"){document.getElementById("daySliderRht").src="/html/css/tripSuitcaseImages/rhtArrow.gif"}timeoutLeft=setTimeout("goLeft()",50)}else{if(imageName!="/html/css/tripSuitcaseImages/lightLftArrow.gif"){document.getElementById("daySliderLft").src="/html/css/tripSuitcaseImages/lightLftArrow.gif"}}}}function cngCSS(B,D,C,A){getOtherDayMap(C-1)}function daySymbolMouseOver(B){var C=document.getElementById(B);var A=C.className;if(A!="daySelected"&&A!="dummy"&&A.indexOf("_mouseOver")==-1){document.getElementById(B).className=A+"_mouseOver"}}function daySymbolMouseOut(B){var C=document.getElementById(B);var A=C.className;if(A!="daySelected"&&A!="dummy"&&A.indexOf("_mouseOver")!=-1){A=A.substring(0,A.indexOf("_mouseOver"));document.getElementById(B).className=A}}function addDayEndings(){var A=document.tripSuitcaseForm.dayEndingGeoCodesStr.value;var B=document.tripSuitcaseForm.dayEndingTextStr.value;var C=A.split(tripSuitcaseDelemiter);var E=B.split(tripSuitcaseDelemiter);if(A!=null&&A!=""){try{addDayEndingsOnMap(C,E)}catch(D){}}}function getStopOverPopUp(B,A,C){closeTSPOIShortDescription();if(stopOverPopUp!=null){WheelsAlerts.killAlert(stopOverPopUp);stopOverPopUp=null}if(stopOverPopUp==null){stopOverPopUp=WheelsAlerts.fireMessageBox({width:350,isStopOver:true,modal:false,noCenter:false,title:C,onClose:function(){stopOverPopUp=null}})}AjaxUtil.update(B,stopOverPopUp)}function getOtherDayMap(A){tsTabState="2_2";document.tripSuitcaseForm.dayNumber.value=A;document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_GET_OTHER_DAY_TRIP;submitTripSuitCaseForm()}function expandAllDays(A){tsTabState="2_2";window.location.href="#tripsuitcase_anchor";document.tripSuitcaseForm.index.value=A;document.tripSuitcaseForm.dayNumber.value=A;document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_GET_FULL_ROUTE_MAP;submitTripSuitCaseForm()}function populateValues(D,F,E,C,B,H,G,A){document.tripSuitcaseForm.itemListType.value=D;document.tripSuitcaseForm.itemType.value=F;document.tripSuitcaseForm.itemId.value=E;document.tripSuitcaseForm.upOrDown.value=C;document.tripSuitcaseForm.isFromMap.value=B;document.tripSuitcaseForm.dayNumber.value=H;document.tripSuitcaseForm.mapPK.value=G;document.tripSuitcaseForm.index.value=A}function submitTripSuitCaseForm(){closeTSPOIShortDescription();document.tripSuitcaseForm.action=ACTION;var A=document.tripSuitcaseForm.action+"&"+Form.serialize(document.tripSuitcaseForm);if(tsTabState!=""){A=A+getTabsStateQueryString(tsTabState)}tsTabState="";if(document.tripSuitcaseForm.cmd.value=="addBookedHotel"){A+="&ia_p=1";window.location.href="#tripsuitcase_anchor"}AjaxUtil.update(A,TRIP_SUITCASE_PARAM_DIV,{onComplete:setFocusToTripSuitcase})}function setFocusToTripSuitcase(){if(mrtsEditBtnClicked=="true"){loadContent("/ext/wheelscpv/wheelscoalescedportlet/startingpointportlet_view?&tab_state=1_0",WHEELSCP_TAB_STARTINGPOINT_TAB_LABEL);window.location.href="#tripsuitcase_anchor"}}function getTripItemRemove(F,E,G,A,H,I,B,C){populateValues(F,E,G,A,H,I,B,C);document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_REMOVE_ITEM;try{removeSelectedPOI(B);fitBestZoomLevel(map)}catch(D){}if(F=="goingToList"){tsTabState="2_0"}else{if(F=="myIdeasList"){tsTabState="2_1"}}submitTripSuitCaseForm()}function getTripSearchPois(G,F,H,B,I,J,C,D){whatSearchRadiusSliderElement=null;reloadWhat=true;populateValues(G,F,H,B,I,J,C,D);document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_GET_ARROUND_POIS;window.location.href="#wcp_anchor";try{searchSelectedPOI(C)}catch(E){}reloadWhat=true;whatSearchRadiusSliderElement=null;removeTempPins(true);closeResultDiv();document.tripSuitcaseForm.action=ACTION;var A=document.tripSuitcaseForm.action+"&"+Form.serialize(document.tripSuitcaseForm);showTripSuitcase(false);showWheelsCoalesced(true);AjaxUtil.update(A,"what_content",{onComplete:showHideDiv("what_content","1_2","What")})}function moveTripitem(F,D,G,A,H,I,B,C,E){tsTabState=E;populateValues(F,D,G,A,H,I,B,C);document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_RE_ARRANGE_ITEM;submitTripSuitCaseForm()}function addToTripPlan(D,F,E,C,B,H,G,A){populateValues(D,F,E,C,B,H,G,A);document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_ADD_TO_TRIP_PLAN;updateMapItemId(F,E);if(H=="0"){tsTabState="2_1"}else{if(H!="0"){tsTabState="2_2"}}submitTripSuitCaseForm();if(document.getElementById("ts-pop-up")){closeTSPOIShortDescription()}}function addAllToTripPlan(A){if(A){tsTabState="2_2";document.tripSuitcaseForm.itemListType.value=TRIP_SUITCASE_PARAM_MAP_MY_IDEAS_LIST;document.tripSuitcaseForm.dayNumber.value=A;document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_ADD_DAY_IDEAS_TO_PLAN}else{tsTabState="2_1";document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_ADD_ALL_TO_TRIP_PLAN}submitTripSuitCaseForm()}var mrtsEditBtnClicked="false";function clearTripPlan(A,D,B){closeResultDiv(true);if(A==null||A=="tripSuitcase"||D=="yes"||A=="gettingStarted"){try{clearTripPlanPushPin()}catch(C){}document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_CLEAR_TRIP_PLAN;tsTabState="2_0";submitTripSuitCaseForm()}else{try{clearTripPlanPushPin()}catch(C){}}}function clearMyIdeas(B){try{clearMyideasPushPin()}catch(A){}B=document.tripSuitcaseForm.dayNumber.value;if(B){document.tripSuitcaseForm.itemListType.value=TRIP_SUITCASE_PARAM_MAP_MY_IDEAS_LIST;document.tripSuitcaseForm.dayNumber.value=B;document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_DELETE_DAY_IDEAS;tsTabState="2_2"}else{document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_CLEAR_MY_IDEAS}submitTripSuitCaseForm()}function changeTab(A){if(A=="ROAD_TRIP_WITH_MAP"){tsTabState="2_2"}else{if(A=="MY_IDEAS_PAGE"){tsTabState="2_1"}else{tsTabState="2_0"}}document.tripSuitcaseForm.selectedTab.value=A;document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_CHANGE_TAB;submitTripSuitCaseForm()}function addBookedHotel(A){tsTabState="2_0";document.tripSuitcaseForm.cmd.value=A;submitTripSuitCaseForm()}function setRoundTrip(){document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_ROUND_TRIP;submitTripSuitCaseForm()}function RoadTripWithMapLoding(A){tsTabState="2_2";document.tripSuitcaseForm.selectedTab.value=TRIP_SUITCASE_TAB_ROAD_TRIP_WITH_MAP;document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_LOADING_ROAD_TRIP_WITHMAP;submitTripSuitCaseForm();try{plotTripPlanMap(A)}catch(B){}}function plotRoadTrip(){if(numberOfGeoCodes>1){document.tripSuitcaseForm.selectedTab.value=TRIP_SUITCASE_TAB_ROAD_TRIP_WITH_MAP;document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_PLOT_ROAD_TRIP;tsTabState="2_2";submitTripSuitCaseForm()}else{alert(TRIP_SUITCASE_NO_LOCATIONS_TO_PLOT_ROAD_TRIP);return }}function insertStopOver(C,A){tsTabState="2_2";closeTSPOIShortDescription();document.tripSuitcaseForm.extraCMD.value=A;document.tripSuitcaseForm.selectedTab.value=TRIP_SUITCASE_TAB_ROAD_TRIP_WITH_MAP;document.tripSuitcaseForm.dayNumber.value=C;document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_INSERT_STOPOVER;document.tripSuitcaseForm.action=ACTION;var B=document.tripSuitcaseForm.action+"&"+Form.serialize(document.tripSuitcaseForm);getStopOverPopUp(B,"tripSuitcaseForm",TRIP_SUITCASE_INSERT_STOPOVER)}function deleteStopoverPopup(B,A){tsTabState="2_2";document.tripSuitcaseForm.extraCMD.value=A;document.tripSuitcaseForm.selectedTab.value=TRIP_SUITCASE_TAB_ROAD_TRIP_WITH_MAP;document.tripSuitcaseForm.dayNumber.value=B;showPoiPopUp("stopOverNotesConfirmDiv",270,80)}function deleteStopOver_Yes(){tsTabState="2_2";hideDivById("stopOverNotesConfirmDiv",270,80);hideIt();document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_DELETE_STOPOVER;document.tripSuitcaseForm.action=ACTION;var A=document.tripSuitcaseForm.action+"&"+Form.serialize(document.tripSuitcaseForm);AjaxUtil.update(A,TRIP_SUITCASE_PARAM_DIV)}function deleteStopOver_No(A){tsTabState="2_2";document.tripSuitcaseForm.extraCMD.value="";document.tripSuitcaseForm.selectedTab.value="";document.tripSuitcaseForm.dayNumber.value="";document.tripSuitcaseForm.cmd.value="";document.tripSuitcaseForm.action="";hideDivById("stopOverNotesConfirmDiv",270,80);hideIt()}function addStopOver(dayNumber,divNumber){tsTabState="2_2";var stopoverdiv=document.getElementById("stopoverdiv"+dayNumber);if(stopoverdiv!=null){stopoverdiv.style.display="none"}if(divNumber==null){divNumber=""}var obj=eval("document.tripSuitcaseForm.stopOverDays"+divNumber+"_"+dayNumber);document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_SAVE_STOPOVER;document.tripSuitcaseForm.dayNumber.value=dayNumber;document.tripSuitcaseForm.stopOverDays.value=obj.value;document.tripSuitcaseForm.action=ACTION;var url=document.tripSuitcaseForm.action+"&"+Form.serialize(document.tripSuitcaseForm);AjaxUtil.update(url,TRIP_SUITCASE_PARAM_DIV)}function saveStopOver(B){tsTabState="2_2";closeTSPOIShortDescription();if(B=="add"){document.stopOverForm.cmd.value=TRIP_SUITCASE_ACTION_SAVE_STOPOVER}else{if(B=="edit"){document.stopOverForm.cmd.value=TRIP_SUITCASE_ACTION_EDIT_STOPOVER}else{if(B=="delete"){document.stopOverForm.cmd.value=TRIP_SUITCASE_ACTION_DELETE_STOPOVER}}}document.stopOverForm.action=ACTION;var A=document.stopOverForm.action+"&"+Form.serialize(document.stopOverForm);AjaxUtil.update(A,TRIP_SUITCASE_PARAM_DIV);if(stopOverPopUp!=null){WheelsAlerts.killAlert(stopOverPopUp);stopOverPopUp=null;setSelectVisibility("visible")}}function resetStopOverNotes(dayNumber,dropDownValue){tsTabState="2_2";var obj1=eval("document.tripSuitcaseForm.dummyTextarea_"+dayNumber);var obj2=eval("document.tripSuitcaseForm.textarea_"+dayNumber);var obj3=eval("document.tripSuitcaseForm.stopOverDays1_"+dayNumber);if(obj2.value!=TRIP_SUITCSE_TYPE_YOUR_NOTES_HERE){obj2.value=obj1.value}if(obj2.value==""){obj2.value=TRIP_SUITCSE_TYPE_YOUR_NOTES_HERE}if(obj3!=null){if(dropDownValue>0){obj3.value=dropDownValue}else{obj3.value=1}}var stopoverdiv=document.getElementById("stopoverdiv"+dayNumber);if(stopoverdiv!=null){stopoverdiv.style.display="none"}}function saveStopOverNotes(C){tsTabState="2_2";var B=document.getElementById("stopoverdiv"+C);if(B!=null){B.style.display="none"}document.tripSuitcaseForm.selectedTab.value=TRIP_SUITCASE_TAB_ROAD_TRIP_WITH_MAP;document.tripSuitcaseForm.dayNumber.value=C;document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_EDIT_STOPOVER_NOTES;document.tripSuitcaseForm.action=ACTION;var A=document.tripSuitcaseForm.action+"&"+Form.serialize(document.tripSuitcaseForm);AjaxUtil.update(A,TRIP_SUITCASE_PARAM_DIV)}function insertDayBreak(B,C){tsTabState="2_2";document.tripSuitcaseForm.selectedTab.value=TRIP_SUITCASE_TAB_ROAD_TRIP_WITH_MAP;document.tripSuitcaseForm.legNumber.value=B;document.tripSuitcaseForm.dayNumber.value=C;document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_INSERT_DAYBREAK;document.tripSuitcaseForm.action=ACTION;var A=document.tripSuitcaseForm.action+"&"+Form.serialize(document.tripSuitcaseForm);AjaxUtil.update(A,TRIP_SUITCASE_PARAM_DIV)}function getGeoCodeForLegBreak(D,C,B){tsTabState="2_2";document.tripSuitcaseForm.selectedTab.value=TRIP_SUITCASE_TAB_ROAD_TRIP_WITH_MAP;document.tripSuitcaseForm.legNumber.value=C;document.tripSuitcaseForm.dayNumber.value=D;document.tripSuitcaseForm.breakPoint.value=B;document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_GET_GEOCODE_FOR_LEGBREAK;document.tripSuitcaseForm.action=ACTION;var A=document.tripSuitcaseForm.action+"&"+Form.serialize(document.tripSuitcaseForm);AjaxUtil.update(A,TRIP_SUITCASE_PARAM_DIV)}function breakThisLeg_CarLoading(){tsTabState="2_2";breakThisLeg_Cancel();document.tripSuitcaseForm.selectedTab.value=TRIP_SUITCASE_TAB_ROAD_TRIP_WITH_MAP;document.tripSuitcaseForm.extraCMD.value=TRIP_SUITCASE_ACTION_LEGBREAK;document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_LOADING_ROAD_TRIP_WITHMAP;document.tripSuitcaseForm.legNumber.value=document.tripSuitcaseForm.newGeocode_legNumber.value;document.tripSuitcaseForm.dayNumber.value=document.tripSuitcaseForm.newGeocode_dayNumber.value;showIt();document.tripSuitcaseForm.action=ACTION;var A=document.tripSuitcaseForm.action+"&"+Form.serialize(document.tripSuitcaseForm);AjaxUtil.update(A,TRIP_SUITCASE_PARAM_DIV)}function breakThisLeg(){tsTabState="2_2";breakThisLeg_Cancel();document.tripSuitcaseForm.selectedTab.value=TRIP_SUITCASE_TAB_ROAD_TRIP_WITH_MAP;document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_LEGBREAK;document.tripSuitcaseForm.action=ACTION;showIt();var A=document.tripSuitcaseForm.action+"&"+Form.serialize(document.tripSuitcaseForm);AjaxUtil.update(A,TRIP_SUITCASE_PARAM_DIV)}function breakThisLeg_Cancel(){hideDivById("legBreakDiv");hideIt()}function findNearByHotelsOrCampGrounds(B){window.location.href="#tripsuitcase_anchor";breakThisLeg_Cancel();updateInterstitialText("i_t",JS_MSG_WCPV_INTERSTITIAL_TEXT_NEARBYHOTEL_SEARCH);showPoiPopUp("requestProcessingId",426,100);document.legbreakForm.cmd.value="getHotelsForLeBreak";document.legbreakForm.category.value=B;document.legbreakForm.geocode.value=document.getElementById("ts_newGeocode").value;document.legbreakForm.newGeocode_legNumber.value=document.getElementById("ts_newGeocode_legNumber").value;document.legbreakForm.newGeocode_dayNumber.value=document.getElementById("ts_newGeocode_dayNumber").value;var A=document.legbreakForm.action+"&"+Form.serialize(document.legbreakForm);showTripSuitcase(false);showWheelsCoalesced(true);AjaxUtil.update(A,"portlet_results_content")}var tsOldIndex="-1";function getTripItemDescription(G,F,D,C,H,K,I,E,A,B){if(F=="01"||F=="02"||(F=="04"&&B==1)){var J="tripSuitcaseForm";showPopUpLongDescription(J,D,E,I,F)}else{if(F=="03"||F=="05"||F=="06"||F=="07"||(F=="04"&&B==0)){var J="tripSuitcaseForm";showPopUpShortDescription(G,F,D,C,H,K,I,E,A,B)}}}var tsPopUpOldIndex="-1";function showPopUpShortDescription(itemListType,itemType,poiId,upOrDown,isFromMap,dayNumber,primaryKey,index,event,hasContainsCityGuide){var poiName="";var displayName="";var shortDescription="";showIt();if(isFromMap=="yes"){poiName=eval("document.tripSuitcaseForm.poiName_"+itemListType+"_"+dayNumber+"_"+index).value;displayName=eval("document.tripSuitcaseForm.displayName_"+itemListType+"_"+dayNumber+"_"+index).value;poiName=poiName.replace(/^\s+|\s+$/g,"")}else{poiName=eval("document.tripSuitcaseForm.poiName_"+index).value;displayName=eval("document.tripSuitcaseForm.displayName_"+index).value}var poiText="<div id='bubbleContentOne' style='padding: 0px; z-index: 99; position: absolute;width: 273px; height: 191px; top:60px;'><table border='0' cellspacing='0' cellpadding='0'><tr><th class='miBox'><table border='0' cellspacing='0' cellpadding='0'><tr><th><div class='miTL'></div></th><th class='miHeader'><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><th class='miHeader' align='left'>POI_NAME</th><th><a href='Javascript:void 0;' onclick='javascript:closePopUpShortDescriptionWindow(); hideIt();'><img class='pointerCursor' src='/html/themes/wheelscpv/images/search/close.gif' /></a></th></tr></table></th><th><div class='miTR'></div></th></tr><tr><th class='miBGL'>&nbsp;</th><th colspan='2' class='miTPad-5'><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><th rowspan='2'  class='miImgTD'></th><th class='miAdd' align='left'>POI_ADDRESS</th></tr></table></th></tr><tr><th colspan='3'><div class='miFooter'></div></th></tr></table></th></tr></table></div>";if(itemType=="07"){displayN=poiName+","+displayName;poiText=poiText.replace("POI_ADDRESS",displayN)}else{poiText=poiText.replace("POI_ADDRESS",displayName)}if(poiName.length>35){poiName=poiName.substring(0,33)+"..."}poiText=poiText.replace("POI_NAME",poiName);if(tsPopUpOldIndex!="-1"){if(document.getElementById("bubbleOne-popUpHeader"+tsPopUpOldIndex)!=null){document.getElementById("bubbleOne-popUpHeader"+tsPopUpOldIndex).innerHTML=""}}document.getElementById("bubbleOne-popUpHeader"+itemListType+index+dayNumber).innerHTML=poiText;document.getElementById("bubbleContentOne").style.display="none";document.getElementById("bubbleContentOne").style.display="block";tsPopUpOldIndex=itemListType+index+dayNumber}function closePopUpShortDescriptionWindow(){document.getElementById("bubbleContentOne").style.display="none";document.getElementById("bubbleContentOne").innerHTML=""}function closeTSPOIShortDescription(){if(document.getElementById("ts-pop-up")!=null){document.getElementById("ts-pop-up").style.display="none"}}function showPushPin(C,E,A,B){var D=navigator.appName;if(C=="result"){document.getElementById(E).style.color="#000000";if(Utilities.ie6){document.getElementById(E).style.filter='filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="/html/css/images/pushpins/FFFFFF_roadtrip.png")'}else{document.getElementById(E).style.background="url(/html/css/images/pushpins/FFFFFF_roadtrip.png) no-repeat"}}else{document.getElementById(E).style.color="#"+B;if(Utilities.ie6){document.getElementById(E).style.filter='filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="/html/css/images/pushpins/'+A+"_"+C+'.png")'}else{document.getElementById(E).style.background="url(/html/css/images/pushpins/"+A+"_"+C+".png) no-repeat"}}}function arrageMapPushPins(){}function removeStopOverNotes(A){if(A.value==TRIP_SUITCSE_TYPE_YOUR_NOTES_HERE){A.value=""}}function showFitoMeterImg(B){var C=B;if(C==""){C=1}if(C>0&&C<=100){var A=Math.round(C/6.25);if(A==0){A=1}document.getElementById("fitImg").src="/html/css/tripSuitcaseImages/img"+A+".gif"}}function checkNotes(B){if(B.value.length>200){B.value=B.value.substring(0,200);var A=document.getElementById("tripItenaryStopOverAlertDiv");A.innerHTML="<strong>"+TRIP_SUITCASE_YOU_CANNOT_ENTER_MORE_THAN_200_CHARECTERS+"</strong>";showPoiPopUp("tripItenaryStopOverAlertOuterDiv",270,80)}}function stopoverAlert_OK(){hideDivById("tripItenaryStopOverAlertOuterDiv");hideIt()}function minimizeExpandStopOverNotes(C){var A=document.getElementById("stopovertextaea_"+C);var B=document.getElementById("button_stopoveroextaea_"+C);if(A!=null){A.style.display="block"}if(B!=null){B.style.display="block"}}function editWhenDetails(){minimizePortlet(LayoutColumns.plid,"when_portlet",true,"")}function confirmLogin_OK(){loadLoginPage("login-page",true,"true");window.location.href="#signin_anchor";hideDivById("tripItenaryAlertOuterDiv");hideIt();var A=document.getElementById("isClickedOnStoreTrip");if(A!=null){A.value="true"}}function confirmLogin_close(){hideDivById("tripItenaryAlertOuterDiv");hideIt()}function storeTrip(D,A,C,F,H,G){H=H=="true"?"yes":"no";G=G=="true"?"yes":"no";if(A!="true"){var E=document.getElementById("tripItenaryAlertDiv");E.innerHTML="<strong>"+TRIP_SUITCASE_YOU_HAVE_TO_LOGIN_TO_STORE_THE_TRIP+"</strong>";showPoiPopUp("tripItenaryAlertOuterDiv",270,80);return false}document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_STORE_TRIP;document.tripSuitcaseForm.action=ACTION;if(H=="yes"){if(G=="yes"){document.tripSuitcaseForm.extraCMD.value="updatePersona";document.tripSuitcaseForm.isSysPersona.value="yes";document.tripSuitcaseForm.isCusmisedPersona.value="yes";showPoiPopUp("createPersonaConfirmOuterDiv",270,80);return false}else{document.tripSuitcaseForm.extraCMD.value="updatePersona";document.tripSuitcaseForm.isSysPersona.value="no";document.tripSuitcaseForm.isCusmisedPersona.value="yes";showPoiPopUp("personaUpdateConfirmOuterDiv",270,80);return false}}document.tripSuitcaseForm.extraCMD.value="updatePersona";document.tripSuitcaseForm.storingTrip.value="true";showIt();var B=document.tripSuitcaseForm.action+"&"+Form.serialize(document.tripSuitcaseForm);AjaxUtil.update(B,TRIP_SUITCASE_PARAM_DIV)}function tsUpdateUserPersona(){document.tripSuitcaseForm.storingTrip.value="true";document.tripSuitcaseForm.extraCMD.value="updatePersona";var A=document.tripSuitcaseForm.action+"&"+Form.serialize(document.tripSuitcaseForm);AjaxUtil.update(A,TRIP_SUITCASE_PARAM_DIV)}function tsCreateNewPersona(){document.tripSuitcaseForm.extraCMD.value="updatePersona";var A=document.tripSuitcaseForm.action+"&"+Form.serialize(document.tripSuitcaseForm);AjaxUtil.update(A,TRIP_SUITCASE_PARAM_DIV);hideIt()}function tsDoNotCreateORUpdateUserPersona(){document.tripSuitcaseForm.storingTrip.value="true";document.tripSuitcaseForm.isCusmisedPersona.value="nono";document.tripSuitcaseForm.isSysPersona.value="no";var A=document.tripSuitcaseForm.action+"&"+Form.serialize(document.tripSuitcaseForm);AjaxUtil.update(A,TRIP_SUITCASE_PARAM_DIV)}function carloading(A){document.tripSuitcaseForm.extraCMD.value="retriveTrip";document.tripSuitcaseForm.tripId.value=A;document.tripSuitcaseForm.selectedTab.value=TRIP_SUITCASE_TAB_ROAD_TRIP_WITH_MAP;document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_LOADING_ROAD_TRIP_WITHMAP;showIt();submitTripSuitCaseForm()}function retriveStoredTripAfterCarLoading(A){showIt();document.tripSuitcaseForm.tripId.value=A;document.tripSuitcaseForm.cmd.value="retriveStoredTrip";if(document.tripSuitcaseForm.cmd.value=="retriveStoredTrip"){tsTabState="2_0"}else{tsTabState="2_2"}var B=document.getElementById("p_p_body_how_portlet_min_buttons_img");window.location.href="#tripsuitcase_anchor";submitTripSuitCaseForm()}function retriveStoredTrip(A){showWheelsCoalesced(false);showTripSuitcase(true);tsTabState="2_0";carloading(A)}function retriveStoredTripMap(C,D,A,E){var B=document.tripSuitcaseForm.storingTrip;if(B!=null&&B.value=="true"){closeMYroadTrip(false);B.value="false"}if(C=="retriveStoredTrip"&&A!="updatePersona"){if(document.whoForm!=null){document.whoForm.personalityId.value=D}enableEditButton(true);reloadWhoTab();reloadHowPortlet();window.location.href="#tripsuitcase_anchor"}else{if(A=="updatePersona"){window.location.href="#";window.location.href="#mrts_anchor";if(E=="yes"){showCreatePersona()}}else{if(C==TRIP_SUITCASE_ACTION_STORE_TRIP){window.location.href="#";window.location.href="#mrts_anchor"}}}}function getSightsAlongTheWay(B){document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_GET_SIGHTS_ALONG_THE_WAY;document.tripSuitcaseForm.dayNumber.value=B;reloadWhat=true;window.location.href="#wcp_anchor";whatSearchRadiusSliderElement=null;closeResultDiv();document.tripSuitcaseForm.action=ACTION;var A=document.tripSuitcaseForm.action+"&"+Form.serialize(document.tripSuitcaseForm);showTripSuitcase(false);showWheelsCoalesced(true);AjaxUtil.update(A,"what_content",{onComplete:showHideDiv("what_content","1_2","What")})}function toggleStopOverReminder(B,C,A){var E=document.getElementById(B);var D=document.getElementById(C);var F=document.getElementById(A);if(E.style.display=="none"){E.style.display="block";D.src="/html/css/tripSuitcaseImages/stopOverRemainderClosed.gif";F.innerHTML="&nbsp;<a class='whoLinkTxt' href='Javascript:;'><b>"+TS_CPV_TM_CLOSE_STOP_REMI+"</b></a>"}else{if(E.style.display=="block"){E.style.display="none";D.src="/html/css/tripSuitcaseImages/stopOverRemainderOpened.gif";F.innerHTML="&nbsp;<a class='whoLinkTxt' href='Javascript:;'><b>"+TS_CPV_TM_OPEN_STOP_REMI+"</b></a>"}}}function toggleTripIdeasDiv(A,B){var D=document.getElementById(A);var C=document.getElementById(B);if(D==null){if((C.src).indexOf("upArrowTi.gif")!=-1){C.src="/html/themes/wheelscpv/skins/images/tripplan/dwnArrowTi.gif"}else{if((C.src).indexOf("dwnArrowTi.gif")!=-1){C.src="/html/themes/wheelscpv/skins/images/tripplan/upArrowTi.gif"}}return false}if(D.style.display=="block"){D.style.display="none";C.src="/html/themes/wheelscpv/skins/images/tripplan/upArrowTi.gif"}else{if(D.style.display=="none"){D.style.display="block";C.src="/html/themes/wheelscpv/skins/images/tripplan/dwnArrowTi.gif"}}}function confirmClearTripPlan(){showPoiPopUp("tripPlanConfirmDivId",324,96)}function confirmClearTripPlanYes(){hideDivById("tripPlanConfirmDivId");hideIt();clearTripPlan("tripSuitcase","no")}function confirmClearTripPlanNo(){hideDivById("tripPlanConfirmDivId");hideIt()}function confirmClearTripItenaryMyIdeas(A){document.tripSuitcaseForm.dayNumber.value=A;showPoiPopUp("myIdeasConfirmDivId",324,96)}function confirmClearMyIdeas(){showPoiPopUp("myIdeasConfirmDivId",324,96)}function confirmClearMyIdeasYes(){clearMyIdeas();hideDivById("myIdeasConfirmDivId");hideIt()}function confirmClearMyIdeasNo(){hideDivById("myIdeasConfirmDivId");hideIt()}function confirmRenameTrip(){showPoiPopUp("tripPlanRenameTripDivId",324,96);document.getElementById("tsRenameTripName").value="";document.getElementById("tsRenameTripName").focus()}function confirmRenameTripYes(){if(isBlank(document.getElementById("tsRenameTripName").value)||checkpoiSearchName("tsRenameTripName","New Trip name")!=""){showErrorMessage(JS_MSG_TS_CPV_ENTER_A_VALID_TRIP,"renameTripInfoDiv");return }document.tripSuitcaseForm.renameTrip.value=document.getElementById("tsRenameTripName").value;document.getElementById("tsRenameTripName").value="";document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_RENAME_TRIP;tsTabState="2_0";submitTripSuitCaseForm();hideDivById("tripPlanRenameTripDivId");hideDivById("renameTripInfoDiv");hideIt()}function confirmRenameTripNo(){hideDivById("tripPlanRenameTripDivId");hideDivById("renameTripInfoDiv");hideIt()}function editTripDescription(){showPoiPopUp("tripPlanEditTripDescriptionDivId",324,96);document.getElementById("tsEditTripDescription1").value="";document.getElementById("tsEditTripDescription2").value="";document.getElementById("tsEditTripDescription1").focus()}function editTripDescriptionYes(){var B=document.getElementById("tsEditTripDescription1").value;var A=document.getElementById("tsEditTripDescription2").value;if(isBlank(B)||validateTripDescription("tsEditTripDescription1","Trip description")!=""){showErrorMessage(JS_MSG_TS_CPV_ENTER_A_VALID_TRIP_DESCRIPTION,"editTripDescInfoDiv");return }if(validateTripDescription("tsEditTripDescription2","Trip description")!=""){showErrorMessage(JS_MSG_TS_CPV_ENTER_A_VALID_TRIP_DESCRIPTION,"editTripDescInfoDiv");return }var C=B+"<br/>"+A;document.tripSuitcaseForm.tripDescription.value=C;document.getElementById("tsEditTripDescription1").value="";document.getElementById("tsEditTripDescription2").value="";document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_EDIT_TRIP_DESCRIPTION;tsTabState="2_0";submitTripSuitCaseForm();hideDivById("tripPlanEditTripDescriptionDivId");hideDivById("editTripDescInfoDiv");hideIt()}function editTripDescriptionNo(){hideDivById("tripPlanEditTripDescriptionDivId");hideDivById("editTripDescInfoDiv");hideIt()}function editTripSponsoredBy(A,B){showPoiPopUp("tripPlanEditTripSponsoredByDivId",324,96);document.getElementById("tsEditTripSponsoredBy").value=A;if(!isBlank(B)){document.getElementById("tsEditTripSponsoredByUrl").value=B}else{document.getElementById("tsEditTripSponsoredByUrl").value="http://"}document.getElementById("tsEditTripSponsoredBy").focus()}function editTripSponsoredByYes(){tripSponsoredByLabel=document.getElementById("tsEditTripSponsoredBy").value;tripSponsoredByUrl=document.getElementById("tsEditTripSponsoredByUrl").value;if(isBlank(tripSponsoredByLabel)||validateTripDescription("tsEditTripSponsoredBy","Sponsored by Link")!=""){showErrorMessage(JS_MSG_TS_CPV_ENTER_A_VALID_TRIP_SPONSOREDBY,"editTripSponsoredByInfoDiv");return }if(isBlank(tripSponsoredByUrl)||tripSponsoredByUrl=="http://"){var A=tripSponsoredByLabel}else{if(validateTripDescription("tsEditTripSponsoredByUrl","Sponsored by Link Url")!=""){showErrorMessage(JS_MSG_TS_CPV_ENTER_A_VALID_TRIP_SPONSOREDBY_URL,"editTripSponsoredByInfoDiv");return }var A=tripSponsoredByLabel+"*"+tripSponsoredByUrl}document.tripSuitcaseForm.tripSponsoredBy.value=A;document.getElementById("tsEditTripSponsoredBy").value="";document.tripSuitcaseForm.cmd.value=TRIP_SUITCASE_ACTION_EDIT_TRIP_SPONSOREDBY;tsTabState="2_0";submitTripSuitCaseForm();hideDivById("tripPlanEditTripSponsoredByDivId");hideDivById("editTripSponsoredByInfoDiv");hideIt()}function editTripSponsoredByNo(){hideDivById("tripPlanEditTripSponsoredByDivId");hideDivById("editTripSponsoredByInfoDiv");hideIt()}var billingAddressLine1="";var billingAddressLine2="";var billingCity="";var billingState="";var billingPostalCode="";var popUpObj=null;var confirmnew=false;var isUserPersona=true;var buttonLinks=null;var buttonHref=null;var mrtsselectTab="";var mrtssubTab="list";var rexMrts=/^([a-zA-Z0-9_\-])([a-zA-Z0-9_\-\.]*)@(\[((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.) {3}|((([a-zA-Z0-9\-]+)\.)+))([a-zA-Z]{2,}|(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\])$/;var editlinkactive=true;var colorScheemId="";var renamedTripId="";function loadMyRoadTripStuffTab(A,C,D){var B=MRTS_VIEW_ACTION_URL;B+="&selectedTab="+A+"&selectedSubTab="+D;AjaxUtil.update(B,"myroadtripstuff_portlet_content");document.getElementById("myDetailsTab").className="tabsNotselectedli";document.getElementById("myTripPersonalitiesTab").className="tabsNotselectedli";document.getElementById("myRoadTripsTab").className="tabsNotselectedli";document.getElementById(C).className="tabsSelectedli"}function loadMyRoadTripStuffSubTab(E,F,A){var B=MRTS_VIEW_ACTION_URL;B+="&selectedTab="+E+"&subTab="+F;AjaxUtil.update(B,"myRoadTripStuff");for(var C=1;C<10;C++){var D=document.getElementById("subTabId"+C);if(D!=null){D.style.color="#305983"}else{break}}if(A!=null){A.style.color="#b3b3b3"}}function submitListPagination(){var B;var A="0";var D;D=document.myroadtripstuffFormList;B=document.myroadtripstuffFormList.recordIndex.value;var C=MRTS_VIEW_ACTION_URL;C+="&selectedTab=myRoadTrips&subTab=list&mrtsrecordindex="+B+"&mrtsrecordindexwithout="+A+"&"+Form.serialize(D);ajaxUtilUpdate(C,"myRoadTripStuff")}function submitPrintPagination(){var A=document.myroadtripstuffForm.recordIndex.value;var B=MRTS_VIEW_ACTION_URL;B+="&selectedTab=myRoadTrips&subTab=print&mrtsrecordindex="+A;ajaxUtilUpdate(B,"myRoadTripStuff")}function submitArchiveListPagination(){var A=document.myroadtripstuffForm.recordIndex.value;var B=MRTS_VIEW_ACTION_URL;B+="&selectedTab=myRoadTrips&subTab=archive_list&mrtsrecordindex="+A+"&mrtsrecordindexwithout="+temp+"&"+Form.serialize(document.myroadtripstuffForm);ajaxUtilUpdate(B,"myRoadTripStuff")}function submitJournelPagination(){var B;var A="0";var D;B=document.myroadtripstuffFormJournal.recordIndex.value;A=document.myroadtripstuffFormJournal.mrtswithoutrecordIndex.value;var C=MRTS_VIEW_ACTION_URL;C+="&selectedTab=myRoadTrips&subTab=journal&mrtsrecordindex="+B+"&mrtsrecordindexwithout="+A;ajaxUtilUpdate(C,"myRoadTripStuff")}function submitwithJournelPagination(){var B=document.myroadtripstuffFormJournal.recordIndex.value;var A=MRTS_VIEW_ACTION_URL;A+="&selectedTab=myRoadTrips&subTab=journal&mrtsrecordindexwithout="+B+"&mrtsrecordindex="+document.myroadtripstuffFormJournal.mrtswithrecordIndex.value;ajaxUtilUpdate(A,"myRoadTripStuff")}function submitEmailPagination(){var A=document.myroadtripstuffForm.recordIndex.value;var B=MRTS_VIEW_ACTION_URL;B+="&selectedTab=myRoadTrips&subTab=email&mrtsrecordindex="+A+"&mrtsrecordindexwithout="+temp+"&"+Form.serialize(document.myroadtripstuffForm);ajaxUtilUpdate(B,"myRoadTripStuff")}function submitComparePagination(){var A=document.myroadtripstuffFormCompare.recordIndex.value;var B=MRTS_VIEW_ACTION_URL;B+="&selectedTab=myRoadTrips&subTab=compare&mrtsrecordindex="+A+"&mrtsrecordindexwithout="+temp+"&"+Form.serialize(document.myroadtripstuffFormCompare);ajaxUtilUpdate(B,"myRoadTripStuff")}function reloadMRTSPortlet(A){loadMyRoadTripStuffTab(A,A+"Tab")}var MRTS_PROCESS_MYDETAILS_ACTION_URL;var MRTS_PROCESS_PERSONALITIES_ACTION_URL;var MRTS_AIRPORT_LOOKUP_URL="";var airportLookupWinRef=null;var airportLookupFlag=true;var MRTS_MD_CARD_DELETE_CONFORMATION="";var MRTS_PERSONALITY_DELETED_CONFORMATION="";var MRTS_TRAVELLING_COMPANION_CONFIRM_MSG="";var MRTS_IMAGE_POPUP_URL="";var uploadimageRef=null;var uploadimageFlag=true;function updateMyRoadTripStuffContact(B){var A=MRTS_PROCESS_MYDETAILS_ACTION_URL;A+="&CMD=update_contact&subTab=contact&"+Form.serialize(document.myroadtripstuffForm);AjaxUtil.update(A,"myRoadTripStuff",{onComplete:reloadGettingStarted})}function reloadGettingStarted(){reloadGettingStartedPortlet()}function updatePassword(){var A=MRTS_PROCESS_MYDETAILS_ACTION_URL;A+="&CMD=update_password&selectedTab=myDetails&subTab=password&"+Form.serialize(document.myroadtripstuffForm);ajaxUtilUpdate(A,"myRoadTripStuff")}function checkMRTSAlphaNumeric(B,A){CommonValidator.error="";var C=CommonValidator.getElementValueById(B);if(CommonValidator.isNotNull(C)&&CommonValidator.isNotBlank(C)){if(CommonValidator.test(C,"^[A-Z,a-z,0-9,/,\\s,\\t,,,.,',_,-]*$")){}else{CommonValidator.error=A+WHITE_SPACE+NOT_ALPHANUMERIC}if(CommonValidator.error==""){if(CommonValidator.test(C,"^[/,\\s,\\t,,,.,',&,@,-,_]*$")){CommonValidator.error="Please enter atleast one alphabet or a number"}}}return CommonValidator.error}function updateMyRoadTripStuffTravelPreference(){var A=MRTS_PROCESS_MYDETAILS_ACTION_URL;A+="&CMD=update_travel_preferance&subTab=travel_preferences&"+Form.serialize(document.myroadtripstuffForm);ajaxUtilUpdate(A,"myRoadTripStuff")}function openAirportLookUp(){if(airportLookupWinRef==null||airportLookupWinRef.closed){if(airportLookupFlag){airportLookupFlag=false;airportLookupWinRef=window.open(MRTS_AIRPORT_LOOKUP_URL,"myroadtripstuffAirportLookUPForm","directories=no,width=450px,height=120px,top=160,left=90,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no");if(!airportLookupWinRef){popupblockerWarning();return false}airportLookupFlag=true}}if(airportLookupWinRef!=null){airportLookupWinRef.focus()}}function updateMyRoadTripStuffPayment(){var A=MRTS_PROCESS_MYDETAILS_ACTION_URL;A+="&CMD=payment&subTab=payment&"+Form.serialize(document.myroadtripstuffForm);ajaxUtilUpdate(A,"myRoadTripStuff")}function updateMyRoadTripStuffCreditCard(C,B){var A=MRTS_PROCESS_MYDETAILS_ACTION_URL;A+="&CMD=update_credit_cardId&subTab=payment&defaultCreditCardID="+C+"&llUserId="+B;ajaxUtilUpdate(A,"myRoadTripStuff")}function deleteCard(B){if(confirm(MRTS_MD_CARD_DELETE_CONFORMATION)){var A=MRTS_PROCESS_MYDETAILS_ACTION_URL;A+="&CMD=update_credit_cardId&subTab=payment&status="+B+"&"+Form.serialize(document.myroadtripstuffForm);ajaxUtilUpdate(A,"myRoadTripStuff")}}function updateMyRoadTripStuffPersonal(){var A=MRTS_PROCESS_MYDETAILS_ACTION_URL;A+="&CMD=update_personal&subTab=personal&"+Form.serialize(document.myroadtripstuffForm);ajaxUtilUpdate(A,"myRoadTripStuff")}function updateMyRoadTripStuffCompanions(){var A=MRTS_PROCESS_PERSONALITIES_ACTION_URL;var B=false;if(document.getElementById("mrtsIsSystemPersonaid").value=="0"){if(document.getElementById("kids_included_id1").checked==true){if(document.myroadtripstuffFormTravel.mrtsunumberOfChildren05.value!="0"){B=true}else{if(document.myroadtripstuffFormTravel.mrtsunumberOfChildren612.value!="0"){B=true}else{if(document.myroadtripstuffFormTravel.mrtsunumberOfChildrenTeen.value!="0"){B=true}else{if(document.myroadtripstuffFormTravel.mrtsunumberOfChildrenOver18.value!="0"){B=true}}}}}else{B=true}}else{B=true}if(B){A+="&CMD=my_travel_companian&subTab=my_travelling_companions&"+Form.serialize(document.myroadtripstuffFormTravel);ajaxUtilUpdate(A,"myRoadTripStuff")}else{alert("Plaese select number of children.")}}function loadInfoforImg(B){var A=MRTS_PROCESS_PERSONALITIES_ACTION_URL;A+="&CMD=image_req&personality_id="+B+"&"+Form.serialize(document.myroadtripstuffFormTravel);ajaxUtilUpdate(A,"myRoadTripStuff")}function makeTextBox(B){if(isUserPersona){var C=document.getElementById("personaNameId");if(C.style.color=="white"){B.innerHTML=savelink;B.style.color="#003366";B.style.right="40px";C.style.color="#666666";C.className="mrtsTextBox";B.parentNode.parentNode.className="";document.getElementById("mrtsexampledivid").style.display="block";C.value="";C.readOnly=false}else{var A=MRTS_PROCESS_PERSONALITIES_ACTION_URL;A+="&CMD=my_travel_companian_name&subTab=my_travelling_companions&mrtspersonaname="+C.value;ajaxUtilUpdate(A,"myRoadTripStuff")}}}function uploadImage(){if(uploadimageRef==null||uploadimageRef.closed){if(uploadimageFlag){uploadimageFlag=false;uploadimageRef=window.open(MRTS_IMAGE_POPUP_URL,"","directories=no,width=350px,height=150px,top=160,left=90,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no","");if(!uploadimageRef){popupblockerWarning();return false}uploadimageFlag=true}}if(uploadimageRef!=null){uploadimageRef.focus()}}function deletePersonality(B){if(confirm(MRTS_PERSONALITY_DELETED_CONFORMATION)){var A=MRTS_PROCESS_PERSONALITIES_ACTION_URL;A+="&CMD=delete_personality&personality_id="+B+"&"+Form.serialize(document.myroadtripstuffFormTravel);ajaxUtilUpdate(A,"myRoadTripStuff")}}function loadcreatepage(B){if(isUserPersona&&B!="yes"){confirmnew=confirm(MRTS_TRAVELLING_COMPANION_CONFIRM_MSG)}else{if(B=="yes"){confirmnew=true}}var A=MRTS_PROCESS_PERSONALITIES_ACTION_URL;loadMyRoadTripStuffTab("myTripPersonalities","myTripPersonalitiesTab","new_persona&personality_id=new_persona&confirmnew="+confirmnew)}function createnewpersona(){var B=document.myroadtripstuffFormCreateTravel.mrtspersonaName.value;var C=false;if(document.getElementById("kids_included_id21").checked==true){if(document.myroadtripstuffFormCreateTravel.mrtsnumberOfChildren05.value!="0"){C=true}else{if(document.myroadtripstuffFormCreateTravel.mrtsnumberOfChildren612.value!="0"){C=true}else{if(document.myroadtripstuffFormCreateTravel.mrtsnumberOfChildrenTeen.value!="0"){C=true}else{if(document.myroadtripstuffFormCreateTravel.mrtsnumberOfChildrenOver18.value!="0"){C=true}}}}}else{C=true}if(B==""||B.indexOf("Type your Trip Persona Name here")>0){alert("Please enter a valid persona name.")}else{var A=MRTS_PROCESS_PERSONALITIES_ACTION_URL;if(C){if(confirmnew){A+="&CMD=create_persona&copy_info=yes&subTab=my_travelling_companions&"+Form.serialize(document.myroadtripstuffFormCreateTravel);ajaxUtilUpdate(A,"myRoadTripStuff")}else{A+="&CMD=create_persona&copy_info=no&subTab=my_travelling_companions&"+Form.serialize(document.myroadtripstuffFormCreateTravel);ajaxUtilUpdate(A,"myRoadTripStuff")}}else{alert("Please select number of children.")}}}function updateMyRoadTripStuffMyDrivingStyle(){var A=MRTS_PROCESS_PERSONALITIES_ACTION_URL;A+="&CMD=update_driving_style&subTab=my_driving_style&"+Form.serialize(document.myroadtripstuffForm);ajaxUtilUpdate(A,"myRoadTripStuff")}function updateMyRoadTripStuffMyBudget(){var A=MRTS_PROCESS_PERSONALITIES_ACTION_URL;A+="&CMD=update_my_budget&subTab=my_budget&"+Form.serialize(document.myroadtripstuffFormBudget);ajaxUtilUpdate(A,"myRoadTripStuff")}function updateMyRoadTripStuffMyChoices(){var F=get_IFRAME_doc("mrtsCategory");var E=F.forms["mrtsMyChoiceTreeForm"].elements;var A="";if(E.length>0){var C=true;for(var D=0;D<E.length;D++){if(E[D].name=="associatedCategory"&&E[D].type=="checkbox"&&E[D].checked){if(C){C=false;A=E[D].value}else{A+=","+E[D].value}}}}document.myroadtripstuffFormMyChoice.associatedCategoryString.value=A;var B=MRTS_PROCESS_PERSONALITIES_ACTION_URL;B+="&CMD=update_my_choices&subTab=my_choices&"+Form.serialize(document.myroadtripstuffFormMyChoice);ajaxUtilUpdate(B,"myRoadTripStuff")}var MRTS_MYROADTRIP_LIST_GO_GETING;var MRTS_MYROADTRIP_LIST_DELETE_LIST;var MRTS_MYROADTRIP_LIST_SAVETO_ARCHIVE;var MRTS_MYROADTRIP_LIST_UPDATE_LIST;var MRTS_MRT_EMAIL_EMPTY_RECIPIENT_MESSAGE;var MRTS_MD_ENTER_VALID_EMAIL1_MESSAGE;var MRTS_MD_MAXIMAM_LIMIT_IS10_MESSAGE;var MRTS_MYROADTRIP_EMAIL_EMAILSELECTED_URL;var MRTS_MYROADTRIP_EMAIL_EMAILJOURNAL_URL;var MRTS_MYROADTRIP_EMAIL_EMAILTHISJOURNAL_URL;var MRTS_MRT_JOURNAL_CONFIRM_DELETE_MESSAGE;var MRTS_MYROADTRIP_JOURNAL_DELETE_JOURNAL_URL;var MRTS_MYROADTRIP_JOURNAL_CREATE_JOURNAL_URL;var MRTS_MYROADTRIP_JOURNAL_CREATE_READ_URL;var MRTS_MYROADTRIP_JOURNAL_CHECKFOR_JOURNAL_URL;var MRTS_MYROADTRIP_DELETE_ARCHIVELIST_URL;var MRTS_MYROADTRIP_RETRIVE_ARCHIVELIST_URL;var MRTS_MYROADTRIP_COMPARE_LOADCOMPARE_URL;var MRTS_MYROADTRIP_COMPARE_COMAPAREROADTRIPS_URL;var MRTS_MYROADTRIP_SHOW_TRIP_PERSONALITIES_URL;function showTripPersonalities(){loadMyRoadTripStuffTab("myTripPersonalities","myTripPersonalitiesTab");var A=MRTS_MYROADTRIP_SHOW_TRIP_PERSONALITIES_URL;A+="&selectedTab=myTripPersonalities&subTab=my_travelling_companions";ajaxUtilUpdate(A,"myRoadTripStuff")}function gotoGettingStarted(B){var D=document.tripSuitcaseForm.tripPlanTextArr.value;var C=true;if(D!=null){D=trim(D)}if(D!=""){C=confirm(TRIP_SUITCASE_ARE_YOU_SURE_TO_CLEAR_TRIP_PLAN)}if(C){closeMRTS();clearTripPlan("fromMRTS","yes");reloadGettingStartedPortlet();var A=MRTS_MYROADTRIP_LIST_GO_GETING;ajaxUtilUpdate(A,"gettingstarted");minimizePortlet(LayoutColumns.plid,"gettingstarted_portlet",true,"")}}function deleteList(){var D=document.getElementsByName("tripId");var F=document.getElementById("ts_tripID").value;var A=false;var E=false;for(var C=0;C<D.length;C++){if(D[C].checked){A=true;if(F==D[C].value){E=true}break}}var B=MRTS_MYROADTRIP_LIST_DELETE_LIST;B+="&subTab=list&"+Form.serialize(document.myroadtripstuffFormList);if(A){if(confirm("Are you sure you want to delete the selected trip(s)?")){ajaxUtilUpdate(B,"myRoadTripStuff");reloadGettingStartedPortlet();if(E){clearTripPlan("fromMRTS","yes")}}}else{ajaxUtilUpdate(B,"myRoadTripStuff")}}function saveToArchive(){var A=getSelectedCount("*","Archive");if(A){var B=MRTS_MYROADTRIP_LIST_SAVETO_ARCHIVE;B+="&subTab= list&"+Form.serialize(document.myroadtripstuffFormList);AjaxUtil.update(B,"myRoadTripStuff");document.getElementById("subTabId1").style.color="#004d99";document.getElementById("subTabId5").style.color="#C0C0C0"}}function updateMyRoadTripStuffList(E,G,F,C,D){var B=MRTS_MYROADTRIP_LIST_UPDATE_LIST;var A=document.myroadtripstuffFormList.recordIndex;if(A!=null){A=A.value}else{A="0"}B+="&subTab=list&starstatus="+E+"&starRating="+G+"&mrtsRateIndex="+C+"&mrtsrateTripId="+F+"&mrtsCurRate="+D+"&mrtsrecordindex="+A+"&"+Form.serialize(document.myroadtripstuffFormList);ajaxUtilUpdate(B,"myRoadTripStuff")}function emailSelectedTrips(){var G=true;var B=document.getElementById("mrtsemailsendtext").value;B=trim(B);if(B==""){alert(MRTS_MRT_EMAIL_EMPTY_RECIPIENT_MESSAGE)}else{var F=B.split(";");var E=F.length;if(F[F.length-1]==""){E=E-1}if(E<=10){for(var D=0;D<E;D++){G=checkEmails(F[D]);if(G==false){break}}if(G){var A=getSelectedCount("*","Email");if(A){var C=MRTS_MYROADTRIP_EMAIL_EMAILSELECTED_URL;C+="&selectedTab=myRoadTrips&subTab=email&"+Form.serialize(document.myroadtripstuffForm);ajaxUtilUpdate(C,"myRoadTripStuff")}}else{alert(MRTS_MD_ENTER_VALID_EMAIL1_MESSAGE)}}else{alert(MRTS_MD_MAXIMAM_LIMIT_IS10_MESSAGE)}}}function emailJournalForm(){var A=MRTS_MYROADTRIP_EMAIL_EMAILJOURNAL_URL;A+="&selectedTab=myRoadTrips&subTab=email&"+Form.serialize(document.myroadtripstuffFormJournal);ajaxUtilUpdate(A,"myRoadTripStuff")}function deleteJournal(B){if(confirm(MRTS_MRT_JOURNAL_CONFIRM_DELETE_MESSAGE)){var A=MRTS_MYROADTRIP_JOURNAL_DELETE_JOURNAL_URL;A+="&subTab=journal&"+Form.serialize(document.myroadtripstuffFormJournal);ajaxUtilUpdate(A,"myRoadTripStuff")}}function createJournal(){var A=MRTS_MYROADTRIP_JOURNAL_CREATE_JOURNAL_URL;A+="&subTab=journal&"+Form.serialize(document.myroadtripstuffFormJournal);ajaxUtilUpdate(A,"myRoadTripStuff")}function readJournal(){editlinkactive=true;var A=MRTS_MYROADTRIP_JOURNAL_CREATE_READ_URL;A+="&subTab=journal&"+Form.serialize(document.myroadtripstuffFormJournal);ajaxUtilUpdate(A,"myRoadTripStuff")}var mrts_mailMessage="";function mrtsclearCheckBox(){var D=document.getElementsByName("tripId");if(D!=null){for(var B=0;B<D.length;B++){D[B].checked=false}}var F=document.getElementById("mrtsemailsendtext");var A=document.getElementById("mrtsIsSuperUserId");if(F!=null){if(A==null||A=="no"){F.value=""}}var E=document.getElementById("mrtsemailmsgid");if(E!=null){E.value=mrts_mailMessage}var C=document.getElementById("mrtsmsgcheckboxid");if(C!=null){C.checked=false}}function emailThisJournal(){var F=true;var A=document.getElementById("mrtsjornelmailid").value;A=trim(A);if(A==""){alert(MRTS_MRT_EMAIL_EMPTY_RECIPIENT_MESSAGE)}else{var E=A.split(";");var D=E.length;if(E[E.length-1]==""){D=D-1}if(D<=10){for(var C=0;C<D;C++){F=checkEmails(E[C]);if(F==false){break}}if(F){var B=MRTS_MYROADTRIP_EMAIL_EMAILTHISJOURNAL_URL;B+="&selectedTab=myRoadTrips&subTab=email&"+Form.serialize(document.myroadtripstuffForm);ajaxUtilUpdate(B,"myRoadTripStuff")}else{alert(MRTS_MD_ENTER_VALID_EMAIL1_MESSAGE)}}else{alert(MRTS_MD_MAXIMAM_LIMIT_IS10_MESSAGE)}}}function checkForJournal(B){var A=MRTS_MYROADTRIP_JOURNAL_CHECKFOR_JOURNAL_URL;A+="&subTab=journal&tripId="+B+"&"+Form.serialize(document.myroadtripstuffFormJournal);ajaxUtilUpdate(A,"myRoadTripStuff")}function deleteArchiveList(){var D=document.getElementsByName("tripId");var A=false;for(var C=0;C<D.length;C++){if(D[C].checked){A=true;break}}if(A&&D.length!=0){var B=MRTS_MYROADTRIP_DELETE_ARCHIVELIST_URL;B+="&subTab=archive_list&"+Form.serialize(document.myroadtripstuffForm);if(confirm("Are you sure you want to delete the selected trip(s)?")){ajaxUtilUpdate(B,"myRoadTripStuff")}}else{alert("Select at least one trip to delete.")}}function retriveList(){var A=getSelectedCount("*","Retrieve");if(A){var B=MRTS_MYROADTRIP_RETRIVE_ARCHIVELIST_URL;B+="&subTab=archive_list&"+Form.serialize(document.myroadtripstuffForm);ajaxUtilUpdate(B,"myRoadTripStuff");document.getElementById("subTabId1").style.color="#C0C0C0";document.getElementById("subTabId5").style.color="#004d99"}}function loadCompareList(B){var A=MRTS_MYROADTRIP_COMPARE_LOADCOMPARE_URL;A+="&selectedTab=myRoadTrips&subTab=compare&selectedTripsToCompare="+B;ajaxUtilUpdate(A,"myRoadTripStuff")}function compareRoadTrips(){var A=checkItemsForCompare();if(A){var B=MRTS_MYROADTRIP_COMPARE_COMAPAREROADTRIPS_URL;B+="&subTab= compare&"+Form.serialize(document.myroadtripstuffFormCompare);ajaxUtilUpdate(B,"myRoadTripStuff")}}var WHEELS_COLOR_SCHEMEID="";var buttonLinks=null;var buttonHref=null;function checkButtons(){if(buttonLinks==null){buttonLinks=new Array();buttonHref=new Array();for(var C=0;C<10;C++){var A=document.getElementById("buttonLink"+C);if(A!=null){buttonLinks[C]=A.onclick}}}var D=document.getElementsByName("tripId");var E=false;for(var C=0;C<D.length;C++){if(D[C].checked){E=true;break}}for(var C=0;C<10;C++){var H=document.getElementById("buttonLt"+C);var I=document.getElementById("buttonBg"+C);var F=document.getElementById("buttonRt"+C);var G=document.getElementById("buttonLink"+C);var B=document.getElementById("anLink"+C);if(H!=null&&I!=null&&F!=null&&G!=null&&B!=null){if(E){if(C==0||C==5){G.onclick="";G.style.cursor="default";H.className="button-disabled-left_"+WHEELS_COLOR_SCHEMEID;I.className="button-disabled-bg_"+WHEELS_COLOR_SCHEMEID;F.className="button-disabled-right_"+WHEELS_COLOR_SCHEMEID;B.className="mrtsDisabledLink"}else{G.onclick=buttonLinks[C];G.style.cursor="pointer";H.className="button-save-left_"+WHEELS_COLOR_SCHEMEID;I.className="button-save-bg_"+WHEELS_COLOR_SCHEMEID;F.className="button-save-right_"+WHEELS_COLOR_SCHEMEID;B.className="linkedWhiteText"}}else{if(C==0||C==5){G.onclick=buttonLinks[C];G.style.cursor="pointer";H.className="button-save-left_"+WHEELS_COLOR_SCHEMEID;I.className="button-save-bg_"+WHEELS_COLOR_SCHEMEID;F.className="button-save-right_"+WHEELS_COLOR_SCHEMEID;B.className="linkedWhiteText"}else{G.onclick="";G.style.cursor="default";H.className="button-disabled-left_"+WHEELS_COLOR_SCHEMEID;I.className="button-disabled-bg_"+WHEELS_COLOR_SCHEMEID;F.className="button-disabled-right_"+WHEELS_COLOR_SCHEMEID;B.className="mrtsDisabledLink"}}}}}function checkJournalButtons(G){if(buttonLinks==null){buttonLinks=new Array();for(var B=1;B<11;B++){buttonLinks[B]=document.getElementById("buttonLink"+B).onclick}}var C=document.getElementsByName("tripId");var D=false;for(var B=0;B<C.length;B++){if(C[B].checked){D=true;break}}for(var B=1;B<11;B++){var H=document.getElementById("buttonLt"+B);var I=document.getElementById("buttonBg"+B);var F=document.getElementById("buttonRt"+B);var E=document.getElementById("buttonLink"+B);var A=document.getElementById("anLink"+B);if(G=="journal"){if(!D||(B==2||B==6)){E.onclick="";E.style.cursor="default";H.className="button-disabled-left_"+WHEELS_COLOR_SCHEMEID;I.className="button-disabled-bg_"+WHEELS_COLOR_SCHEMEID;F.className="button-disabled-right_"+WHEELS_COLOR_SCHEMEID;A.className="mrtsDisabledLink"}else{E.onclick=buttonLinks[B];E.style.cursor="pointer";if(B==9||B==10){H.className="button-save-left_reset_"+WHEELS_COLOR_SCHEMEID;I.className="button-save-bg_reset_"+WHEELS_COLOR_SCHEMEID;F.className="button-save-right_reset_"+WHEELS_COLOR_SCHEMEID;A.className="linkedWhiteText"}else{H.className="button-save-left_"+WHEELS_COLOR_SCHEMEID;I.className="button-save-bg_"+WHEELS_COLOR_SCHEMEID;F.className="button-save-right_"+WHEELS_COLOR_SCHEMEID;A.className="linkedWhiteText"}}}else{if(G=="non-journal"){if(!D||!(B==2||B==6||B==9||B==10)){E.onclick="";E.style.cursor="default";H.className="button-disabled-left_"+WHEELS_COLOR_SCHEMEID;I.className="button-disabled-bg_"+WHEELS_COLOR_SCHEMEID;F.className="button-disabled-right_"+WHEELS_COLOR_SCHEMEID;A.className="mrtsDisabledLink"}else{E.onclick=buttonLinks[B];E.style.cursor="pointer";if(B==9||B==10){H.className="button-save-left_reset_"+WHEELS_COLOR_SCHEMEID;I.className="button-save-bg_reset_"+WHEELS_COLOR_SCHEMEID;F.className="button-save-right_reset_"+WHEELS_COLOR_SCHEMEID;A.className="linkedWhiteText"}else{H.className="button-save-left_"+WHEELS_COLOR_SCHEMEID;I.className="button-save-bg_"+WHEELS_COLOR_SCHEMEID;F.className="button-save-right_"+WHEELS_COLOR_SCHEMEID;A.className="linkedWhiteText"}}}}}}function getSelectedCount(C,F){var D=document.getElementsByName("tripId");var B=true;var E=0;for(var A=0;A<D.length;A++){if(D[A].checked){E++}}if(E==0){alert("Please select a trip to "+F+".");B=false}else{if(C=="1"&&E>1){alert("Select only one trip to "+F+".");B=false}}return B}function checkItemsForCompare(){var B=document.getElementsByName("compareIds");var C=0;for(var A=0;A<B.length;A++){if(B[A].checked){C++}}if(B.length==1){alert("At least two trips are needed to compare.")}else{if(C<2){alert("Please select at least two trips to compare.")}else{if(C>3){alert("Sorry, you cannot compare more than three trips at a time.")}else{return true}}}return false}function getTripId(){var C="";var B=document.getElementsByName("tripId");for(var A=0;A<B.length;A++){if(B[A].checked){C=B[A].value}}return C}function enableGreeting(B,A){s=B.value;chkObj=document.getElementById(A);if(trim(s).length>0){chkObj.disabled=false}else{chkObj.checked=false;chkObj.disabled=true}}function updateradio(C){var B=document.getElementsByName("imHandle");if(C.value==null||C.value==""){for(var A=0;A<B.length;A++){B[A].checked=false}}}function updateRadio(B){var A=document.getElementById("mrtsimid").value;if(A==null){B.checked=false}else{A=trim(A);if(A==""){B.checked=false}}}function clearMrtsCard(){document.getElementById("mrtsnameOnCardid").value="";document.getElementById("mrtscreditCardtype").selectedIndex=0;document.getElementById("mrtscreditCardnumber").value="";document.getElementById("mrtscreditCardcode").value="";document.getElementById("expirymonthid").selectedIndex=0;document.getElementById("expiryyearid").selectedIndex=0}function addCard(){document.getElementById("cardadd").style.display="block";document.getElementById("addcard").style.display="none";document.getElementById("cardListTitle").style.display="none";clearMrtsCard()}function displayTableRows(B,C){var A=document.getElementById(B);if(A.style.display=="none"){A.style.display="block";C.src="/html/css/images/minimize.gif"}else{A.style.display="none";C.src="/html/css/images/restore.gif"}}function updatePaymentDetails(){var B=0;var A=document.getElementsByName("defaultCreditCardID").length;for(i=0;i<A;i++){if(document.getElementById("CreditCardID"+i).checked){B=1;break}}if(B==1){updateMyRoadTripStuffCreditCard()}else{alert("Select at least one Card as Default.")}}function get_IFRAME_doc(A){var B=document.getElementById(A)||top.frames[A];if(typeof B!="undefined"&&B!=null){if(B.contentDocument){return B.contentDocument}else{if(B.contentWindow){return B.contentWindow.document}else{if(B.document){return B.document}else{return null}}}}}function checkPetConsideration(C){var B=document.getElementsByName("mrtspetConsideration");if(C.checked){for(var A=0;A<B.length;A++){B[A].checked=false;B[A].disabled=true}C.disabled=false;C.checked=true}else{for(var A=0;A<B.length;A++){B[A].disabled=false}}}function show_popup(E,A,C){var D=window.createPopup();var B=D.document.body;B.style.backgroundColor="#FFFFCC";B.style.border="#ffc30e 1px solid";B.innerHTML="<table cellpadding='2'><tr><td><font face='Verdana' size='1' color='#DDDDFF'>"+E+"</font></td></tr></table>";D.show(event.clientX+15,event.clientY,A,C,document.body)}function setRefreshList(A){mrtssubTab=A}var reloadTSFlag=false;function refreshList(){var A;if(mrtssubTab=="list"){A=document.getElementById("subTabId1");loadMyRoadTripStuffSubTab("myRoadTrips","list",A);var B=document.getElementById("ts_tripID").value;if(renamedTripId==B){reloadTSFlag=true}}else{if(mrtssubTab=="print"){A=document.getElementById("subTabId2");loadMyRoadTripStuffSubTab("myRoadTrips","print",A)}else{if(mrtssubTab=="email"){A=document.getElementById("subTabId3");loadMyRoadTripStuffSubTab("myRoadTrips","email",A)}}}}function reLoadMrtsList(){var A;A=document.getElementById("subTabId1");loadMyRoadTripStuffSubTab("myRoadTrips","list",A)}function editMyRoadTrip(B){var D=document.tripSuitcaseForm.tripPlanTextArr.value;var A=getSelectedCount("1","Edit");var C=true;if(D!=null){D=trim(D)}if((D!="")&&A){C=confirm(TRIP_SUITCASE_ARE_YOU_SURE_TO_CLEAR_TRIP_PLAN)}if(A&&C){var E=getTripId();closeMRTS();retriveStoredTrip(E);document.getElementById("buttonLink2").href="#tripsuitcase_anchor"}}function checkEmails(B){var A=true;if(isBlank(B)||rexMrts.test(trim(B))){A=true}else{A=false}return A}function deselectAll(){var B=document.getElementsByName("tripId");for(var A=0;A<B.length;A++){B[A].checked=false}checkJournalButtons("journal");checkJournalButtons("non-journal")}function printMrtsTrip(){var D=document.getElementsByName("tripId");var A="";var B=false;for(var C=0;C<D.length;C++){if(D[C].checked){A=D[C].value;B=true;break}}if(A!=""){showPrintPopUp("myroadtripstuffportlet",A)}else{alert("Please select at least one trip to print.")}}function showTripItinenaryEmailDiv(B,D,F){var A=$(""+F+"").value;if(B!="true"){var E=document.getElementById("tripItenaryAlertDiv");E.innerHTML="<strong>"+TRIP_SUITCASE_YOU_HAVE_TO_LOGIN_TO_SEND_EMAIL+"</strong>";showPoiPopUp("tripItenaryAlertOuterDiv",270,80);return false}if(D>0){hideMessage(WCPVMRTSMRDT_MESSAGE_CONTENT_DIV_ID);var C=MRTS_VIEW_ACTION_URL;C+="&subTab=email&tripIds="+D+"&tripNames="+escape(A);AjaxUtil.update(C,"mrtsEmailDivId");showModalPopUp("mrtsEmailDivId",350)}else{var E=document.getElementById("tripItenaryEmailAlertDiv");E.innerHTML="<strong>"+TRIP_SUITCASE_PLEASE_SAVE_ROAD_TRIP_TO_SEND_EMAIL+"</strong>";showPoiPopUp("tripItenaryAlertEmailDiv",270,80);return false}}function confirmEmail_OK(){window.location.href="#tripsuitcase_anchor";hideDivById("tripItenaryAlertEmailDiv");hideIt()}function openMRTSPortlet(A){document.getElementById("mrts_portlet").style.display="block";if(A=="MyDetails"){loadMyRoadTripStuffTab("myDetails","myDetailsTab")}else{loadMyRoadTripStuffTab("myRoadTrips","myRoadTripsTab")}}function mrtsEditJournalName(A){var B=document.getElementById("mrtsCrtNametxtId");if(B.readOnly==true){A.style.cursor="default";A.style.textDecoration="none";B.readOnly=false;B.focus()}}var noofImage;var mrtsTimeoutLeft;var mrtsTimeoutRight;var displayImages=4;var personaImageId=new Array();var personaImagePath=new Array();function initializePersonaImageIdAndPathArray(){personaImageId=new Array();personaImagePath=new Array()}function setPersonaImageIdAndPath(B,A){personaImageId[personaImageId.length]=B;personaImagePath[personaImagePath.length]=A}function mrtsAddCol(A){noofImage=personaImageId.length;id="mrtsSlidetableRow";var C=document.getElementById(id);var D=0;if(personaImageId.length==5){document.getElementById("mrtsSliderTableId").style.width="275px"}else{if(personaImageId.length>5){document.getElementById("mrtsSliderTableId").style.width="315px"}}var E=0;for(i=0;i<personaImageId.length;i++){var B=document.createElement("TD");colID="imageId"+i;if(A==personaImageId[i]){if(i>=displayImages){D=(i*(-51))}E=i;B.style.borderStyle="solid";B.style.borderColor="black";B.innerHTML='<a href="javascript:;" onclick="loadInfoforImg('+personaImageId[i]+");\"><img style='width:50px;height:50px;' src='"+personaImagePath[i]+"'/></a>"}else{B.innerHTML='<a href="javascript:;" onclick="loadInfoforImg('+personaImageId[i]+");\"><img style='width:50px;height:50px;' src='"+personaImagePath[i]+"'/></a>"}B.setAttribute("id",colID);C.appendChild(B)}if(personaImageId.length>=5&&(personaImageId.length-E)<displayImages){totlen=noofImage*51;D=256-totlen}document.getElementById("mrtsHdnDiv").style.left=D}function mrtsGoRight(){if(noofImage>displayImages){totlen=noofImage*51;finalpos=256-totlen;currposStr=document.getElementById("mrtsHdnDiv").style.left;currposStrlen=(currposStr.length)-2;currpos=currposStr.substr(0,currposStrlen);if(currpos>=finalpos){postomov=currpos-5;document.getElementById("mrtsHdnDiv").style.left=postomov+"px"}mrtsTimeoutRight=setTimeout("mrtsGoRight()",30)}}function mrtsGoLeft(){if(noofImage>displayImages){totlen=noofImage*51;currposStr=document.getElementById("mrtsHdnDiv").style.left;currposStrlen=(currposStr.length)-2;currpos=currposStr.substr(0,currposStrlen);if(currpos<0){postomov=eval(currpos)+5;document.getElementById("mrtsHdnDiv").style.left=postomov+"px"}mrtsTimeoutLeft=setTimeout("mrtsGoLeft()",30)}}function checkPhone(C){s=C.value;var A=/[+]?[\d-?\(\)\ ]*/;var B=s.match(A)+"";B=(/[-]{2}/).test(B)?B.replace(/[-]{2,}/,"-"):B;B=(/[\ ]{2}/).test(B)?B.replace(/[\ ]{2,}/," "):B;B=(/[\(]{2}/).test(B)?B.replace(/[\(]{2,}/,"("):B;B=(/[\)]{2}/).test(B)?B.replace(/[\)]{2,}/,")"):B;C.value=B}function checkEmailId(A,B){re=/^([a-zA-Z0-9_\-])([a-zA-Z0-9_\-\.]*)@(\[((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.) {3}|((([a-zA-Z0-9\-]+)\.)+))([a-zA-Z]{2,}|(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\])$/;if(isBlank(A.value)||re.test(trim(A.value))){status=""}else{status="Please enter a valid email";A.focus()}}function getStatus(A,C){var B=A.type+"";if(B=="undefined"&&A.length>0){B=A[0].type}if(B=="text"){return isEntered(A)?"":"\n"+C+" is not Entered"}else{if(B=="select-one"){return isEntered(A)?"":"\n"+C+" is not Selected"}else{if(B=="checkbox"){return isTicked(A)?"":"\n"+C+" is not Checked"}else{if(B=="radio"){return isChecked(A)?"":"\n"+C+" is not Selected"}else{if(B=="hidden"){return isEntered(A)?"":"\n"+C+" is not Entered"}else{if(B=="file"){return isEntered(A)?"":"\n"+C+" is not Selected"}}}}}}return""}function isEntered(A){s=trim(A.value);if(s!=""){return true}else{return false}}function isTicked(A){if(A.checked){return true}else{return false}}function isChecked(D){var C=0;for(var B=0;B<D.length;B++){var A=D[B];if(A.checked){C++}}if(C!=0){return true}else{return false}}function isBlank(B){if(B!=null){B=trim(B);for(var A=0;A<B.length;A++){var C=B.charAt(A);if((C!=" ")&&(C!="\n")&&(C!="\t")){return false}}return true}else{return false}}function trim(A){return A.replace(/(^\s+)|(\s+$)/g,"")}function checkDate(B){s=B.value;var A=s.length;var C=/\d*/;if(s.length==3){C=/\d{2}-?/}else{if(A==6){C=/\d{2}-\d{2}-?/}else{if(A>3&A<6){C=/\d{2}-\d*/}else{if(A>6){C=/\d{2}-\d{2}-\d*/}}}}var D=(s.match(C)!=null)?s.match(C):"";s=D.toString();if(s.length<2&&s.length>0&&s!=num.value){s="00".substr(0,8-s.length)+s}if((event.keyCode!=8)&&(s.length==2)){s+="-"}}function checkInteger(C){s=C.value;var A=/\d*/;var B=s.match(A);C.value=B}function checkName(C){s=C.value;var A=/[a-zA-Z.' ']*/;var B=s.match(A);C.value=B;C.value=removeMultiDots(C)}function checkAlphaNos(C){s=C.value;var A=/[a-zA-Z' '\d]*/;var B=s.match(A);C.value=B;C.value=removeMultiDots(C)}function checkZipCode(C){s=C.value;var A=/[a-zA-Z' '\-\d]*/;var B=s.match(A);C.value=B;C.value=removeMultiDots(C)}function removeMultiDots(C){str=C.value;if(str.indexOf(".")>0){var D=str.indexOf(".");if(str.charAt(D+1)=="."){var B=str.substring(0,D);var A=str.substring(D+1,str.length);str=B+A;return C.value=str}D=str.lastIndexOf(".");if(str.charAt(D-1)=="."){var B=str.substring(0,D-1);var A=str.substring(D,str.length);str=B+A;return C.value=str}}return C.value}var togle=false;var isnew=true;var accountarray=new Array();function removelistobj(D){var A=document.getElementById("provider_list");var B=D.parentNode.parentNode.rowIndex;var C=A.rows[B].cells[1].innerHTML;if(confirm("Are you sure you want to delete?")){accountarray.splice(accountarray.length-B,1);A.deleteRow(B)}else{D.checked=false}if(A.rows.length==1){A.deleteRow(0)}}var MRTS_MD_DUPLICATE_ENTRY="";var MRTS_MD_INAVLID_ENTRY="";function updatelist(){var B=document.getElementById("travel_provider");var C=document.getElementById("account_number");var L=document.getElementById("travel_provider");B=B.options[B.selectedIndex].text;var P=document.getElementById("account_number");P=trim(P.value);var M=true;for(var H=0;H<accountarray.length;H++){if((P+B)==accountarray[H]){M=false;H=accountarray.length}}if(B!="Select from list"&&M&&P!=""){var J=document.getElementById("provider_list");var A;if(J.rows.length==0){A=J.insertRow(0);var E=A.insertCell(0);E.colSpan="3";E.align="right";E.innerHTML="remove";isnew=false;A=J.insertRow(1)}else{A=J.insertRow(1)}A.align="right";if(togle){A.className="portlet-section-body";togle=false}else{A.className="portlet-section-alternate";togle=true}var I=A.insertCell(0);var G=A.insertCell(1);var F=A.insertCell(2);I.innerHTML="<input type ='text' name='travelProviderName' class='form-text' value=\""+B+"\"  readOnly style='background:transparent;border:none;width:150px;' />";G.innerHTML="<input type ='text' name='accountNumber' class='form-text' value=\""+P+"\" readOnly style='background:transparent;border:none;width:100px' />";F.innerHTML="<input type ='checkbox' id='travelchekbox' name='remove' value='add' onClick='removelistobj(this)'/>";accountarray[accountarray.length]=P+B;P="";C.value="";L.selectedIndex="0"}else{if(!M){alert(MRTS_MD_DUPLICATE_ENTRY);C.value="";L.selectedIndex="0"}else{var D="";var N=document.myroadtripstuffForm;var O=N.travelProviderName1.value;var K=N.accountNumber1.value;if(O==""){D="Select the Travel Provider\n"}if(K==""){D+="Enter Account Number"}if(D!=""){alert(D)}}}}function showdefault(B){var A=document.myroadtripstuffForm;if(B.checked){A.billingAddressLine1.value=billingAddressLine1;A.billingAddressLine2.value=billingAddressLine2;A.billingCity.value=billingCity;A.billingState.value=billingState;A.billingPostalCode.value=billingPostalCode}else{A.billingAddressLine1.value="";A.billingAddressLine2.value="";A.billingCity.value="";A.billingState.selectedIndex=0;A.billingPostalCode.value=""}}function checkCharacter(C){s=C.value;var A=/[a-zA-Z]*/;var B=s.match(A);C.value=B}function checkAlphaNum(C){s=C.value;var A=/\w*/;var B=s.match(A);C.value=B}function checkChar(B){B=(B)?B:window.event;var A=(B.which)?B.which:B.keyCode;if((A>=48&&A<=57)||A==64){return false}status="";return true}function initializeSlider1(B,D,I,H,E,G,A,F,C){B=new Slider(document.getElementById(D),document.getElementById(I));B.setMinimum(H);B.setMaximum(E);B.onchange=function(){document.getElementById(A).value=B.getValue();document.getElementById(F).innerHTML=C!=null?C[B.getValue()]:B.getValue()};B._blockIncrement=G;B.setValue(document.getElementById(A).value);B.onchange()}function enablekidsinfo(A){if(A){document.getElementById("childrendiv").style.display="none"}else{document.getElementById("childrendiv").style.display="block"}}function setChecked(B){var D=B.checked;var C=document.getElementsByName(B.name);for(var A=0;A<C.length;A++){if(C[A].type=="checkbox"&&C[A].checked){C[A].checked=false}}B.checked=D}function refreshradios(A){document.getElementById("mrtsvehiclecarid").checked=false;document.getElementById("mrtsvehicletruckid").checked=false;document.getElementById("mrtsvehiclesuvid").checked=false;document.getElementById("mrtsvehiclervid").checked=false;document.getElementById("mrtsvehiclemotorcycleid").checked=false;A.checked=true}function newTrip(){closeMRTS();minimizePortlet(LayoutColumns.plid,"gettingstarted_portlet",true,"");document.getElementById("newTrip").focus()}function mrtsShowSpecialNeedsPopup(A,B){showModalPopUp(A,275,155)}function mrtsTripPersonaPopup(A,B){showModalPopUp(A,285,389)}function mrtsEtwinPopUp(A,B){showModalPopUp(A,285,389)}function eTwinLoginMessagePopup(B){var A=document.getElementById("eTwinLoginMessageDiv");if(B=="Overview"){A.innerHTML="<strong>"+OVERVIEW_ETWIN_LOGIN_ERROR_MESSAGE+"</strong>"}else{if(B=="Who"){A.innerHTML="<strong>"+WHO_ETWIN_LOGIN_ERROR_MESSAGE+"</strong>"}}showPoiPopUp("eTwinLoginMesgOuterDiv",270,80)}function eTwinLoginMessageClosePopup(){hideDivById("eTwinLoginMesgOuterDiv");hideIt()}function mrtsclosePopup(A){hideIt();$(A).style.display="none"}function hideDivById(B){var A=document.getElementById(B);if(A!=null){A.style.display="none"}}function showDivById(B){var A=document.getElementById(B);if(A!=null){A.style.display="block"}}function getDivObjById(A){return document.getElementById(A)}function confirmSaveTrip_OK(A){if(A!="true"){loadLoginPage("login-page",true,"true");window.location.href="#signin_anchor"}else{window.location.href="#tripsuitcase_anchor"}hideDivById("printAlertOuterDiv");hideIt()}addEvent(window,"load",convertTrees);function addEvent(C,B,A){if(C.addEventListener){C.addEventListener(B,A,true);return true}else{if(C.attachEvent){return C.attachEvent("on"+B,A)}else{return false}}}function setDefault(A,B){if(typeof (window[A])=="undefined"||window[A]==null){window[A]=B}}function expandTree(B){var A=document.getElementById(B);if(A==null){return false}expandCollapseList(A,nodeOpenClass)}function collapseTree(B){var A=document.getElementById(B);if(A==null){return false}expandCollapseList(A,nodeClosedClass)}function expandToItem(C,E){var B=document.getElementById(C);if(B==null){return false}setDefault("nodeOpenClass","liOpen");var A=expandCollapseList(B,nodeOpenClass,E);if(A){var D=document.getElementById(E);if(D.scrollIntoView){D.scrollIntoView(false)}}}function expandCollapseList(D,G,F){if(!D.childNodes||D.childNodes.length==0){return false}for(var A=0;A<D.childNodes.length;A++){var H=D.childNodes[A];if(F!=null&&H.id==F){return true}if(H.nodeName=="LI"){var E=false;for(var B=0;B<H.childNodes.length;B++){var I=H.childNodes[B];if(I.nodeName=="UL"){E=true;var C=expandCollapseList(I,G,F);if(F!=null&&C){H.className=G;return true}}}if(E&&F==null){H.className=G}}}}function convertTrees(){setDefault("treeClass","mktree");setDefault("nodeClosedClass","liClosed");setDefault("nodeOpenClass","liOpen");setDefault("nodeBulletClass","liBullet");setDefault("nodeBulletClassEnd","liBulletEnd");setDefault("nodeLinkClass","bullet");setDefault("preProcessTrees",true);if(preProcessTrees){if(!document.createElement){return }uls=document.getElementsByTagName("ul");for(var B=0;B<uls.length;B++){var A=uls[B];if(A.nodeName=="UL"&&A.className==treeClass){processList(A)}}}}function processList(C){var E=0;if(!C.childNodes||C.childNodes.length==0){return }for(var A=0;A<C.childNodes.length;A++){var G=C.childNodes[A];if(G.nodeName=="LI"){var D=false;for(var B=0;B<G.childNodes.length;B++){var H=G.childNodes[B];if(H.nodeName=="UL"){D=true;processList(H)}}var I=document.createElement("SPAN");var F="\u00A0";I.className=nodeLinkClass;if(D){if(G.className==null||G.className==""){G.className=nodeClosedClass}if(G.firstChild.nodeName=="#text"){F=F+G.firstChild.nodeValue;G.removeChild(G.firstChild)}I.onclick=function(){this.parentNode.className=(this.parentNode.className==nodeOpenClass)?nodeClosedClass:nodeOpenClass;return false}}else{if(E==C.childNodes.length-1){E=0;G.className=nodeBulletClassEnd}else{G.className=nodeBulletClass;E=parseInt(E)+1}I.onclick=function(){return false}}I.appendChild(document.createTextNode(F));G.insertBefore(I,G.firstChild)}}}function scrollToFirstCategory(){document.body.scrollLeft=0;document.body.scrollTop=0;document.getElementById("tree1").style.display="block"}function popupblockerWarning(){var A=document.getElementById("popupblockerDivTxt");if(A!=null){showPoiPopUp("popupblockerDiv",320,94)}}function openBookingWindow(){var A=window.open("","oBookingWin");if(!A){popupblockerWarning();return false}else{return true}}function addStateToTripSuitCaseFromWhere(url,cmd,parentFormName,poiArr,poiTextArr,strutsPath){MAP_PRIMARY_KEY=MAP_PRIMARY_KEY+1;var parent=eval("document."+parentFormName);var pkarray=new Array();pkarray[0]=MAP_PRIMARY_KEY;stateName=poiTextArr[0];var poiType="";if(getStateId(stateName)!=null&&getStateId(stateName)!=""){poiType="05"}else{poiType="06"}if(poiType=="06"){pushPinData=stateName+"@@@@@@@@@"+poiTextArr[1]+"@@@"+poiTextArr[2]+"@@@US@@@@@@@@@"+MAP_PRIMARY_KEY+"@@@@@@@@@@@@@@@@@@@@@"+poiType+"@@@"}else{pushPinData=stateName+"@@@@@@@@@@@@@@@US@@@@@@@@@"+MAP_PRIMARY_KEY+"@@@@@@@@@@@@@@@@@@@@@"+poiType+"@@@"}var poiPushPinTextArr=new Array();poiPushPinTextArr[poiPushPinTextArr.length]=pushPinData;pinPOIArrayToMap(poiArr,poiPushPinTextArr,pkarray);stateGeoCode=poiArr[0];if(getStateId(stateName)!=null&&getStateId(stateName)!=""){parent.itemId.value=getStateId(stateName);parent.itemType.value="05";parent.itemLegendColor.value="006400";parent.itemFontColor.value="FFFFFF"}else{parent.itemId.value=getRegionID(stateName);parent.itemType.value="06";parent.itemLegendColor.value="8B2323";parent.itemFontColor.value="FFFFFF"}parent.itemScore.value="100";parent.itemName.value=stateName;parent.itemStreet.value="";parent.itemCity.value="";parent.itemState.value="";parent.itemGeoCode.value=stateGeoCode;parent.itemCountry.value="US";parent.itemTelephone.value="";parent.itemZipCode.value="";parent.itemPushPinData.value=pushPinData;var mapItemId=parent.itemId.value;var itemType=parent.itemType.value;if(addPoiToTrip(MAP_PRIMARY_KEY,mapItemId,itemType,cmd,url)){}else{removeTempPins();return false}var extraParameters="";url=url.replace("WHEELS_STRUTS_ACTION",strutsPath);extraParameters=getPortletParamStr("cmd",cmd)+getPortletParamStr("addState","addState")+"&"+Form.serialize(eval("document."+parentFormName));url=url.replace("EXTRA_PARAMETERS",extraParameters);url=url+getTabsStateQueryString("2_0");AjaxUtil.update(url,TRIP_SUITCASE_DIV_ID)}function getWheelsCPVSearchResult(url,cmd,parentFormName,strutsPath,title){var extraParameters="";url=url.replace("WHEELS_STRUTS_ACTION",strutsPath);extraParameters=getPortletParamStr("cmd",cmd)+"&"+Form.serialize(eval("document."+parentFormName));url=url.replace("EXTRA_PARAMETERS",extraParameters);updateInterstitialTextForSearch(strutsPath);showPoiPopUp("requestProcessingId",426,100);AjaxUtil.update(url,"portlet_results_content")}function updateInterstitialTextForSearch(B){var A="";if(B.indexOf("overview")>-1){A=JS_MSG_WCPV_INTERSTITIAL_TEXT_OVERVIEW}else{if(B.indexOf("where")>-1){A=JS_MSG_WCPV_INTERSTITIAL_TEXT_WHERE}else{if(B.indexOf("what")>-1){A=JS_MSG_WCPV_INTERSTITIAL_TEXT_WHAT}}}updateInterstitialText("i_t",A)}var tabItemsOfPOIDetails=new Array("poi_i","poi_f","poi_r","poi_re","poi_s");var tabDivItemsOfPOIDetails=new Array("new_Poi_Info","new_Poi_Facility","new_Poi_Ratings","new_Poi_Recreation","new_Poi_Services");function changeTabsOfPOIDetails(A){for(i=0;i<5;i++){if(A==tabItemsOfPOIDetails[i]){if($(tabItemsOfPOIDetails[i])!=null){$(tabItemsOfPOIDetails[i]).className="selectedTab";$(tabItemsOfPOIDetails[i]).style.padding="1px 0px 0px 1px";$(tabItemsOfPOIDetails[i]+"_div").className="selectedTabDiv";$(tabDivItemsOfPOIDetails[i]).style.display="block"}}else{if($(tabItemsOfPOIDetails[i])!=null){$(tabItemsOfPOIDetails[i]).className="unselectedTab";if($(tabItemsOfPOIDetails[i]+"_div").style.display=="block"){$(tabItemsOfPOIDetails[i]).style.padding="1px 0px 0px 1px"}$(tabItemsOfPOIDetails[i]+"_div").className="unselectedTabDiv";$(tabDivItemsOfPOIDetails[i]).style.display="none"}}}}var tabItemsOfEventDetails=new Array("event_i","event_f");var tabDivItemsOfEventDetails=new Array("new_Event_Info","new_Event_Facility");function changeTabsOfEventDetails(A){for(i=0;i<2;i++){if(A==tabItemsOfEventDetails[i]){if($(tabItemsOfEventDetails[i])!=null){$(tabItemsOfEventDetails[i]).className="selectedTab";$(tabItemsOfEventDetails[i]).style.padding="1px 0px 0px 1px";$(tabItemsOfEventDetails[i]+"_div").className="selectedTabDiv";$(tabDivItemsOfEventDetails[i]).style.display="block"}}else{if($(tabItemsOfEventDetails[i])!=null){$(tabItemsOfEventDetails[i]).className="unselectedTab";$(tabItemsOfEventDetails[i]).style.padding="1px 0px 0px 1px";$(tabItemsOfEventDetails[i]+"_div").className="unselectedTabDiv";$(tabDivItemsOfEventDetails[i]).style.display="none"}}}}var tabItemsOfCityDetails=new Array("cg_o","cg_h","cg_ed","cg_e","cg_t","cg_gt");var tabDivItemsOfCityDetails=new Array("cityGuuide_OverView","cityGuuide_Histroy","cityGuuide_EatAndDrink","cityGuuide_Entertainment","cityGuuide_Tours","cityGuuide_Getting_There");var cityGuideTabItems=new Array("Overview","Historical Background","Eating & Drinking","Things to Do","Recommended Tours","Getting There");function changeTabsOfCityDetails(A){for(i=0;i<6;i++){if(A==tabItemsOfCityDetails[i]){if($(tabItemsOfCityDetails[i])!=null){$(tabItemsOfCityDetails[i]).className="selectedTab";$(tabItemsOfCityDetails[i]).style.padding="1px 0px 0px 1px";$(tabItemsOfCityDetails[i]+"_div").className="selectedTabDiv";$(tabDivItemsOfCityDetails[i]).style.display="block";$("cityTabsContent").innerHTML=cityGuideTabItems[i]}}else{if($(tabItemsOfCityDetails[i])!=null){$(tabItemsOfCityDetails[i]).className="unselectedTab";$(tabItemsOfCityDetails[i]).style.padding="1px 0px 0px 1px";$(tabItemsOfCityDetails[i]+"_div").className="unselectedTabDiv";$(tabDivItemsOfCityDetails[i]).style.display="none"}}}}var popupContainer="tripSuitcase_PoiPopUp";function showPopUpLongDescription(I,C,G,F,H){var A=commonURL1;var E="";var D=0;var B=0;if(H=="01"){E="/ext/wheelscpv/wheelscoalescedportlet/whereportlet_showLongDescription";extraParameters=getPortletParamStr("poiId",C)+getPortletParamStr("formName",I)+getPortletParamStr("index",G)+getPortletParamStr("primaryKey",F)+getPortletParamStr("categoryId",D);B=440}else{if(H=="02"){E="/ext/wheelscpv/wheelscoalescedportlet/whereportlet_showEventLongDescription";extraParameters=getPortletParamStr("eventId",C)+getPortletParamStr("formName",I)+getPortletParamStr("index",G)+getPortletParamStr("primaryKey",F);B=440}else{if(H=="04"){E="/ext/wheelscpv/wheelscoalescedportlet/whereportlet_showCityGuideDescription";extraParameters=getPortletParamStr("cityId",C)+getPortletParamStr("formName",I)+getPortletParamStr("index",G)+getPortletParamStr("mapPrimaryKey",F);B=545}}}A=A.replace("WHEELS_STRUTS_ACTION",E);A=A.replace("EXTRA_PARAMETERS",extraParameters);showPoiPopUp(popupContainer,B);AjaxUtil.update(A,popupContainer)}function closePOIdetailsPopup(A){hideDivById(popupContainer);$(popupContainer).innerHTML=""}function largeImageDisplay(A){$("largeImg").src=SERVER_FILE_UPLOAD_PATH+A;$("Image_div").style.display="block"}function closelargeImageDisplay(){$("Image_div").style.display="none";$("largeImg").src="/html/themes/wheelscpv/skins/images/poidetailspopup/noImgLoad.gif"}function createNewTrip(){var D=document.getElementById("startingZipCode").value;var A=document.getElementById("startingAddress").value;var E="fetchgeocode";if(A==""&&D==""){E="fetchcity"}var B="overviewForm";var C="/ext/wheelscpv/wheelscoalescedportlet/overview_search";var F="Overview Search Results";getWheelsCPVSearchResult(overview_url,E,B,C,F)}function newOverviewTrip(){if(document.getElementById(WCP_MESSAGE_CONTENT_DIV_ID).style.display=="block"){hideMessage(WCP_MESSAGE_CONTENT_DIV_ID)}var A=document.tripSuitcaseForm.geoCodeStr.value;tripSize=A.length;if(tripSize>0){showPoiPopUp("overviewClearTripPlanConfirmDivId",324,150)}}function addStartingAddress(){if(document.getElementById("portlet_results_content").style.display=="block"){closeResultDiv()}ovcity="false";var B=document.getElementById("startingCity").value;var A=document.getElementById("startingAddress").value;if(trim(B)==""||document.getElementById("startingState").selectedIndex==0){message=JS_MSG_GS_MANDATORY_FIELDS+"<br />";if(trim(B)==""&&document.getElementById("startingState").selectedIndex==0){message+=JS_MSG_GS_CITY_FIELD_BLANK+"<br />"+JS_MSG_GS_STATE_SELECTED_INDEX_ZERO}else{if(trim(B)==""){message+=JS_MSG_GS_CITY_FIELD_BLANK}else{if(document.getElementById("startingState").selectedIndex==0){message+=JS_MSG_GS_STATE_SELECTED_INDEX_ZERO}}}showErrorMessage(message,WCP_MESSAGE_CONTENT_DIV_ID)}else{validateOverviewFields()}}function validateOverviewFields(){var B=document.getElementById("startingZipCode").value;var C=document.getElementById("startingCity").value;var A=document.getElementById("startingAddress").value;message="";message+=checkWhereAlphaNumeric("startingAddress",JS_MSG_OVERVIEW_ADDRESS);message+=checkWhereCityAlphaNumeric("startingCity",JS_MSG_OVERVIEW_CITY);message+=CommonValidator.checkPostalCode("startingZipCode",JS_MSG_OVERVIEW_ZIP_CODE);if(message!=""){if(message.substring(message.length-NEW_LINE.length,message.length)==NEW_LINE){message=message.substring(0,message.length-NEW_LINE.length)}showErrorMessage(message,WCP_MESSAGE_CONTENT_DIV_ID)}else{hideMessage(WCP_MESSAGE_CONTENT_DIV_ID);createNewTrip()}}function tripPersonaLink(){closeMRTS(false);loadMyRoadTripStuffSubTab("myTripPersonalities","my_travelling_companions",this)}function getStateForOverview(form,selectedState){var isSelect=false;for(j=1;j<=whereJSONCountryObject.Country[0].objJsonState.length;j++){if(whereJSONCountryObject.Country[[0]].objJsonState[j-1]!=null){if(whereJSONCountryObject.Country[[0]].objJsonState[j-1].StateCode==selectedState){isSelect=true}eval("document."+form).startingState[j]=new Option(whereJSONCountryStateObject.Country[[0]].objJsonState[j-1].StateCode,whereJSONCountryStateObject.Country[[0]].objJsonState[j-1].StateCode);eval("document."+form).startingState[j].selected=isSelect;isSelect=false}}}function showOverViewSuggestion(B,D,E,C,A){if(document.tripSuitcaseForm){var F=document.tripSuitcaseForm.geoCodeStr.value;var G=document.getElementById("overviewState2");if(G!=null){if(F.length>0&&B!=""){document.getElementById("overviewState1").style.display="none";document.getElementById("overviewState2").style.display="block";if(D!=""){document.getElementById("overviewstate2_address").innerHTML=D}document.getElementById("overviewstate2_city").innerHTML=E;document.getElementById("overviewstate2_state").innerHTML=C;document.getElementById("overviewstate2_zipcode").innerHTML=A;defaultPageViewCount("overviewState2")}else{document.getElementById("overviewState2").style.display="none";document.getElementById("overviewState1").style.display="block"}}}}function changeTravelMode(A){if(A=="car"||(A!="car"&&A!="rv"&&A!="motorcycle")){document.getElementById("howImageDiv").innerHTML=STYLE_HOW_CAR_IMAGE_STYLE}else{if(A=="motorcycle"){document.getElementById("howImageDiv").innerHTML=STYLE_HOW_MC_IMAGE_STYLE}else{if(A=="rv"){document.getElementById("howImageDiv").innerHTML=STYLE_HOW_RV_IMAGE_STYLE}}}document.howForm.travelMode.value=A}function addHow(){var B=document.howForm;B.action=urlHowHome;if(howMilesPerDaySliderElement!=null){document.howForm.milesPerDay.value=getValueFromSlider(60,howMilesPerDaySliderElement.getValue())}var A=B.action+"&"+Form.serialize(B);A=A+getTabsStateQueryString("2_0");AjaxUtil.update(A,"wcpv_tripsuitcase_portlet_container",{onComplete:successMessage});window.location.href="#wcp_anchor"}function successMessage(){showConfirmationMessage(JS_MSG_HOW_CONFIRMATION_MESSAGE+viewTripPlanLink,WCP_MESSAGE_CONTENT_DIV_ID)}function setInitialValuesForHowSliders(B,A){document.initialValueMilesPerDay=B;initialTravelMode=A}function reloadHowPortlet(A){if($("how_content").style.display=="block"){reloadHowTab(A)}}function reloadHowTab(B){howMilesPerDaySliderElement=null;reloadHow=true;var A=howURL1;if(B!=null){var C=getPortletParamStr("cmd",B);A+=C}showTripSuitcase(false);showWheelsCoalesced(true);AjaxUtil.update(A,"how_content",{onComplete:loadHow})}function loadHow(){loadContent("/ext/wheelscpv/wheelscoalescedportlet/howportlet_view?&tab_state=1_5",WHEELSCP_TAB_HOW_TAB_LABEL)}function categoryMouseClick(C,D){var E=C.id;var A=C.src;var B=E.substring(0,E.indexOf("_"));if(A.indexOf(B+"Selected.gif")!=-1){document.whatForm.masterCategoryId.value="";C.src="/html/themes/wheelscpv/skins/images/what/"+B+"NotSelected.gif";document.getElementById("CategoryTreeDiv1").style.display="none";document.getElementById("curveDiv").style.display="none";document.getElementById("whatKinkTR").style.background="transparent";document.getElementById("whatKinkTR").style.height="0px";document.getElementById("p2stay_Txt").style.fontWeight="normal";document.getElementById("p2eat_Txt").style.fontWeight="normal";document.getElementById("p2go_Txt").style.fontWeight="normal";document.getElementById("p2shop_Txt").style.fontWeight="normal";document.getElementById("t2do_Txt").style.fontWeight="normal";document.getElementById("events_Txt").style.fontWeight="normal";document.getElementById("thingsuneed_Txt").style.fontWeight="normal";return }document.getElementById("p2stay_Img").src="/html/themes/wheelscpv/skins/images/what/p2stayNotSelected.gif";document.getElementById("p2eat_Img").src="/html/themes/wheelscpv/skins/images/what/p2eatNotSelected.gif";document.getElementById("p2go_Img").src="/html/themes/wheelscpv/skins/images/what/p2goNotSelected.gif";document.getElementById("p2shop_Img").src="/html/themes/wheelscpv/skins/images/what/p2shopNotSelected.gif";document.getElementById("t2do_Img").src="/html/themes/wheelscpv/skins/images/what/t2doNotSelected.gif";document.getElementById("events_Img").src="/html/themes/wheelscpv/skins/images/what/eventsNotSelected.gif";document.getElementById("thingsuneed_Img").src="/html/themes/wheelscpv/skins/images/what/thingsuneedNotSelected.gif";if(C.src.substr(C.src.lastIndexOf("/")+1)!=B+"Selected.gif"){C.src="/html/themes/wheelscpv/skins/images/what/"+B+"Selected.gif"}document.whatForm.masterCategoryId.value=D;selectCategory()}function selectCategory(){document.whatForm.cmd.value="setCategoryList";document.whatForm.action=whatURL1;var A=document.whatForm.action+"&"+Form.serialize(document.whatForm);AjaxUtil.update(A,"CategoryTreeDiv")}function getStateForWhat(form){eval("document."+form).state[0]=new Option("-","");for(j=0;j<whereJSONCountryStateObject.Country[0].objJsonState.length;j++){eval("document."+form).state[j+1]=new Option(whereJSONCountryStateObject.Country[[0]].objJsonState[j].StateCode,whereJSONCountryStateObject.Country[[0]].objJsonState[j].StateCode)}}function getWhatSearchResult(){closeResultDiv();var A=whatURL2;var B="";A=A.replace("WHEELS_STRUTS_ACTION","/ext/wheelscpv/wheelscoalescedportlet/whatportlet_view");if(document.getElementById("selectedItemSubCategory").value==""){document.getElementById("selectedItemSubCategory").value="0"}if(document.getElementById("isAdvancesearch").value=="true"){B=getPortletParamStr("cmd","whatAdvanceSearchResults")+"&"+Form.serialize(document.whatForm)}else{B=getPortletParamStr("cmd","whatSerchResult")+"&"+Form.serialize(document.whatForm)}A=A.replace("EXTRA_PARAMETERS",B);getWheelsCPVSearchResult(A,"whatSerchResult","whatForm","what search result");hideMessage(WCP_MESSAGE_CONTENT_DIV_ID);document.whatForm.placeOrEvent.value=""}function searchReturnToPriorResult(){document.getElementById("whatShortedSearch").value="whatShortedOldList";searchWithInResult()}function searchWithInResult(E){var D=document.searchResultForm.whatWhereOrOverviewSearchResults.value;var F=document.searchResultForm.searchWithResults.value;F=F.replace(/`/g,"'");F=trim(F);var A=document.getElementById("whatShortedSearch").value;if((E!=null&&E=="changeOption")||A=="whatShortedOldList"){document.searchResultForm.searchWithResults.value=document.searchResultForm.searchWithResults_o.value;F=document.searchResultForm.searchWithResults_o.value}else{var C="";if(F==""){C=JS_MSG_WCPV_SR_ENTER_ONE_ALPHA_LEAST;showErrorMessage(C,"searchResultMessagesDivId");return false}C+=checkpoiSearchName("searchWithResultId","Search within results");if(C!=""){showErrorMessage(C,"searchResultMessagesDivId");return false}}if(A!="whatShortedOldList"){document.getElementById("whatShortedSearch").value="whatShortedSearch"}document.searchResultForm.searchWithResults.value=F;document.searchResultForm.recordIndex.value=0;if(D=="whereSearchResult"){document.searchResultForm.action=searchresultURL1}else{if("whatSearchResult"==D){document.searchResultForm.action=searchresultURL2;document.searchResultForm.cmd.value="whatSerchPaginationResult"}}removeTempPins();showIt();var B=document.searchResultForm.action+"&"+Form.serialize(document.searchResultForm);AjaxUtil.update(B,PORTLET_RESULTS_CONTENT)}function getOtherPageResult(){if(document.searchResultForm.searchWithResults!=null&&document.searchResultForm.searchWithResults_o!=null){document.searchResultForm.searchWithResults.value=document.searchResultForm.searchWithResults_o.value}var B=document.searchResultForm.searchType.value;if(B=="addresssearch"){document.searchResultForm.action=searchresultURL1}if(B=="citysearch"){document.searchResultForm.action=searchresultURL1}if(B=="poisearch"){var C=document.searchResultForm.whatWhereOrOverviewSearchResults.value;if("whatSearchResult"==C){document.searchResultForm.action=searchresultURL2;document.searchResultForm.cmd.value="whatSerchPaginationResult"}else{document.searchResultForm.action=searchresultURL1}}removeTempPins(true);showIt();var A=document.searchResultForm.action+"&"+Form.serialize(document.searchResultForm);AjaxUtil.update(A,PORTLET_RESULTS_CONTENT)}function addToTripPlanFromSearchResult(G,F,H,I,J,D){grayOutRow(G);cmd=CMD_ADDTOMYTRIP;document.searchResultForm.index.value=G;document.searchResultForm.itemId.value=I;document.searchResultForm.itemType.value=H;document.searchResultForm.resultSelectedMapPK.value=F;var A=document.searchResultForm.whatWhereOrOverviewSearchResults.value;var C=document.tripSuitcaseForm.geoCodeStr.value;var K=document.tripSuitcaseForm.myIdeasGeoCodeStr.value;if(A=="overviewsearch"&&(C.length>0||K.length>0)){if(J=="true"){document.searchResultForm.cmd.value=CMD_ADDTOMYTRIP;document.searchResultForm.clearTripPlan.value="yes";var E=document.getElementById("searchResultConfirmDiv");E.innerHTML="<strong>"+JS_MSG_WCPV_SR_ARE_YOU_SUER_CLEAR_TRIP+"</strong>";var B=document.getElementById("searchResultConfirmOuterDiv");showPoiPopUp("searchResultConfirmOuterDiv",270,80);return false}}else{document.searchResultForm.clearTripPlan.value="no";if(isAddedToMyideas(H,I)){document.searchResultForm.cmd.value=CMD_MOVETOMYTRIP;var E=document.getElementById("searchResultConfirmDiv");E.innerHTML="<strong>"+JS_MSG_WCPV_SR_ADDED_IN_IDEA_MOVE_TO_TRIP+"</strong>";showPoiPopUp("searchResultConfirmOuterDiv",270,80);return false}else{cmd=CMD_ADDTOMYTRIP}}document.searchResultForm.cmd.value=cmd;addSelectedResultItem()}function confirm_No(){var A=document.searchResultForm.clearTripPlan.value;if(A=="yes"){closeResultDiv()}hideDivById("searchResultConfirmOuterDiv");hideIt()}function addSelectedResultItem(){var E=document.tripSuitcaseForm.geoCodeStr.value;var A=document.tripSuitcaseForm.myIdeasGeoCodeStr.value;var D=document.searchResultForm.searchType.value;var F=document.searchResultForm.resultSelectedMapPK.value;addToSelectedArray(F);if(D!="poisearch"){document.getElementById("portlet_results_content").style.display="none";removeTempPins();window.location.href="#wcp_anchor";showConfirmationMessage(SEARCH_ADDED_TO_TRIP_PLAN+viewTripPlanLink,WCP_MESSAGE_CONTENT_DIV_ID)}else{showConfirmationMessage(SEARCH_ADDED_TO_TRIP_PLAN+viewTripPlanLink,"searchResultMessagesDivId")}var C=document.searchResultForm.action+"&"+Form.serialize(document.searchResultForm);var B=document.searchResultForm.clearTripPlan.value;if(B=="yes"){closeResultDiv();clearTripPlanPushPin()}showIt();C=C+getTabsStateQueryString("2_0");AjaxUtil.update(C,TRIP_SUITCASE_PARAM_DIV)}function grayOutRow(A){var B=document.getElementById("searchResultRowId"+A);if(B!=null){B.className="tr_highlight"}window.location.href="#searchresult_anchor"}function trHighlight(A){var B=document.getElementById("searchResultRowId"+A);if(B!=null&&B.className!="tr_highlight"){B.style.backgroundColor="#E6F0F6"}}function trNormal(A){var B=document.getElementById("searchResultRowId"+A);if(B!=null&&B.className!="tr_highlight"){B.style.backgroundColor="#FFFFFF"}}function addToMyIdeasFromSearchResult(B,G,F,E){grayOutRow(B);if(isAddedToMyideas(F,E)){var D=document.getElementById("searchResultAlertDiv");D.innerHTML="<strong>"+JS_MSG_WCPV_SR_ADDED_IN_IDEA+"</strong>";showPoiPopUp("searchResultAlertOuterDiv",270,80);return false}else{if(isAddedToTripPlan(F,E)){var D=document.getElementById("searchResultAlertDiv");D.innerHTML="<strong>"+JS_MSG_WCPV_SR_ADDE_IN_TRIP+"</strong>";showPoiPopUp("searchResultAlertOuterDiv",270,80);return false}else{cmd=CMD_ADDTOMYTRIP}}document.searchResultForm.index.value=B;document.searchResultForm.cmd.value="addToMyIdeas";var C=searchresultURL3;addToSelectedArray(G);showConfirmationMessage(JS_MSG_SEARCH_ADDED_TO_TRIP_IDEAS+viewTripIdeasLink,"searchResultMessagesDivId");var A=document.searchResultForm.action+"&"+Form.serialize(document.searchResultForm);A=A+getTabsStateQueryString("2_1");showIt();AjaxUtil.update(A,TRIP_SUITCASE_PARAM_DIV)}function addToSelectedArray(D){for(var B=0;B<tempPins.length;B++){if(D==tempPins[B]){selectedPins[selectedPins.length]=D;for(var A=B;A<tempPins.length-1;A++){tempPins[A]=tempPins[A+1]}tempPins.length=tempPins.length-1;var C=commonPins.get(D);var E=C.getMessage();E=E.replace("searchResultForm","tripSuitcaseForm");E=E.replace(addToMyTripHTMLText,"");E=E.replace(addToMyIdeasHTMLText,"");C.setMessage(E);C.hideInfoWindow();break}}}function isAddedToMyideas(E,D){var C=document.getElementById("myIdeasMapItemIdArrayString");var A=E+"-"+D;if(C!=null){var B=C.value;if(B.indexOf(A)!=-1){return true}else{return false}}else{return false}}function isAddedToTripPlan(E,D){var C=document.getElementById("tripPlanMapItemIdArrayString");var A=E+"-"+D;if(C!=null){var B=C.value;if(B.indexOf(A)!=-1){return true}else{return false}}else{return false}}function closeResultDiv(A){document.getElementById("portlet_results_content").style.display="none";document.getElementById("portlet_results_content").innerHTML="";removeTempPins(A)}function searchResultCancel(){document.getElementById("sResultAlertId").style.display="none";closeResultDiv()}function searchResultConfirm(A,D,C,B){clearTripPlan("gettingStarted","yes","true");document.getElementById("sResultAlertId").style.display="none";document.getElementById("portlet_results_content").style.display="none";result(A,D,C,B,"",cmd)}var ovcity="false";function addSoundexingString(B){var A=document.searchResultForm.whatWhereOrOverviewSearchResults.value;if("whatSearchResult"==A){document.whatForm.placeOrEvent.value=B}else{if("whereSearchResult"==A){if(document.searchResultForm.searchType.value=="poisearch"){document.getElementById("place_Or_Event").value=B}else{if(document.searchResultForm.searchType.value=="citysearch"){if(nameOfForm=="whereForm1"){document.getElementById("exact_City").value=B}else{if(nameOfForm=="whereForm2"){document.getElementById("city_Or_Airport_City").value=B}}}}}else{if("overviewsearch"==A){document.getElementById("startingCity").value=B;ovcity=B}}}window.location.href="#wcp_anchor"}function portalSignIn(){submitForm(eval("document."+login_namespace+"fm"),loginURL6)}function CheckTab(C,B,A){if(B!=""&&(document.all)&&(9==event.keyCode)&&(event.shiftKey)){$(B).value=""}if(A!=""&&(document.all)&&(9==event.keyCode)&&!(event.shiftKey)){$(A).value=""}}function loadLoginPage(D,B,F){var C=logInURL1;C+="&CMD="+D;if(B){C+="&fromTSB=true"}var A=document.getElementById("isClickedOnStoreTrip");var E=document.getElementById("mrtsMainTabID").value;C+="&mrtsMainTab="+E;if(F!=null){C+="&isClickedOnStoreTrip=true"}else{if(A!=null&&A.value=="true"){C+="&isClickedOnStoreTrip=true"}}AjaxUtil.update(C,"wheelsLogin");document.getElementById("wheelsLogin_").style.display="block";document.getElementById("wcpvlogin_main").style.display="block"}function sendPassword(){var emailAddress=eval("document.forgotPasswordForm."+login_namespace+"emailAddress").value;var qIndex=eval("document.forgotPasswordForm."+login_namespace+"secretQuestion").selectedIndex;var answer=eval("document.forgotPasswordForm."+login_namespace+"secretAnswer").value;var isValidEmail=checkEmail(emailAddress);answer=trim(answer);if(isValidEmail&&qIndex>0&&answer!=""){var url=liginURL2;url+="&"+Form.serialize(document.forgotPasswordForm);AjaxUtil.update(url,"wheelsLogin")}else{showErrorMessage(JS_MSG_WCPV_FP_ERROR_MSG,"mrtsFPDErrorMSgDivId");$("mrtsFPDErrorMSgDivId").firstChild.width="710px"}}function enableGreeting(B,A){s=B.value;if(trim(s).length>0){A.disabled=false;A.checked=true}else{A.checked=false;A.disabled=true}}var http=null;var xmlDoc=null;function getTagValue(B){var C="";try{C=xmlDoc.getElementsByTagName(B)[0].firstChild.nodeValue}catch(A){}return C}function callBackValidation(){var flag=true;xmlDoc=http.responseXML;var frm=eval("document."+login_namespace+"fm1");var parent=frm.lastName.parentNode;if(http.readyState==4&&http.status==200){var childTags=xmlDoc.documentElement.childNodes;var msg="";var postalcode=document.getElementById("mrts_homepostalcode").value;for(var i=0;i<childTags.length-1;i++){var nodeName=childTags[i].nodeName;var tmsg=getTagValue(nodeName);if(tmsg!=""){msg+=tmsg+"<br/>"}}msg+=CommonValidator.checkPostalCode("mrts_homepostalcode","Zip Code");if(msg!=""){showErrorMessage(msg,"mrtsCreateErrorMSgDivId");flag=false}}if(flag&&http.readyState==4){submitForm(eval("document."+login_namespace+"fm1"),liginURL3)}}function validateValues(){var fname=$("mrts_firstname");var lname=$("mrts_lastname");if(fname.style.color!=""){fname.value=""}if(lname.style.color!=""){lname.value=""}var frm=eval("document."+login_namespace+"fm1");var url=loginURL4;var parameters=Form.serialize(eval("document."+login_namespace+"fm1"));getHttpObject();http.open("POST",url,true);http.onreadystatechange=callBackValidation;http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");http.send(parameters)}function getHttpObject(){if(window.XMLHttpRequest){http=new XMLHttpRequest()}else{if(window.ActiveXObject){http=new ActiveXObject("Microsoft.XMLHTTP")}}}function validateRegisteredUser(){var emailAddress=eval("document."+login_namespace+"fm").login.value;var password=eval("document."+login_namespace+"fm").password.value;var isValidEmail=checkEmail(emailAddress);password=trim(password);if(isValidEmail&&password!=""){var frm=eval("document."+login_namespace+"fm");var url=loginURL5;var parameters=Form.serialize(eval("document."+login_namespace+"fm"));getHttpObject();http.open("POST",url,true);http.onreadystatechange=callBackRegisteredUser;http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");http.send(parameters)}else{showErrorMessage(JS_MSG_WCPV_LO_ERROR_MSG,"mrtsLoginErrorMSgDivId")}}function callBackRegisteredUser(){var flag=true;xmlDoc=http.responseXML;var frm=eval("document."+login_namespace+"fm");if(http.readyState==4&&http.status==200){var value=getTagValue("validUser");if(value!=""){flag=false;showErrorMessage(value,"mrtsLoginErrorMSgDivId");document.getElementById("mrts_login_password").value=""}}if(flag&&http.readyState==4){submitForm(eval("document."+login_namespace+"fm"),loginURL6)}}function closeSignIn(){showSignIn=false;document.getElementById("wcpvlogin_main").style.display="none";document.getElementById("wheelsLogin").innerHTML=""}function openSignInPortlet(A){document.getElementById("mrtsMainTabID").value="myRoadProfile";if(A){document.getElementById("mrtsMainTabID").value="myRoadTrips"}loadLoginPage("login-page")}function clearmrtsloginpage(){document.getElementById("mrts_login_id").value="";document.getElementById("mrts_login_password").value=""}function clearmrtscreateuser(){document.getElementById("mrts_createmail").value="";document.getElementById("mrts_createpassword").value="";document.getElementById("mrts_createpassword2").value="";document.getElementById("mrts_secretans").value="";document.getElementById("mrtscreatechecked").checked=false;document.getElementById("mrts_firstname").value="";document.getElementById("mrts_secretquestion").selectedIndex=0;document.getElementById("mrts_homestate").selectedIndex=0;document.getElementById("mrts_lastname").value="";document.getElementById("mrts_nickname").value="";document.getElementById("mrtsusenickid").checked=false;document.getElementById("mrtsusenickid").disabled=true;document.getElementById("mrtshomeline1").value="";document.getElementById("mrtshomeline2").value="";document.getElementById("mrts_city").value="";document.getElementById("mrts_homepostalcode").value=""}function hideStartingAddress(){if(eval("document."+login_namespace+"fm1").gettingStarted.checked){document.getElementById("startingAddressDiv").style.display="block";eval("document."+login_namespace+"fm1").gettingStartedStreet1.disabled="";eval("document."+login_namespace+"fm1").gettingStartedStreet2.disabled="";eval("document."+login_namespace+"fm1").gettingStartedCity.disabled="";eval("document."+login_namespace+"fm1").gettingStartedState.disabled="";eval("document."+login_namespace+"fm1").gettingStartedZipcode.disabled=""}else{document.getElementById("startingAddressDiv").style.display="none";eval("document."+login_namespace+"fm1").gettingStartedStreet1.disabled="disabled";eval("document."+login_namespace+"fm1").gettingStartedStreet2.disabled="disabled";eval("document."+login_namespace+"fm1").gettingStartedCity.disabled="disabled";eval("document."+login_namespace+"fm1").gettingStartedState.disabled="disabled";eval("document."+login_namespace+"fm1").gettingStartedZipcode.disabled="disabled"}}function closepaswdDiv(){$("mrtsPswdAstId").style.display="none";hideIt()}function checknames(C,A){var D=$("mrts_firstname");var B=$("mrts_lastname");if(A==1){if(C==1||C==3){if(D.value==""||D.value==WCPV_MRTS_MYD_CT_FIRST){D.style.color="#989898";D.value=WCPV_MRTS_MYD_CT_FIRST}}if(C==2||C==3){if(B.value==""||B.value==WCPV_MRTS_MYD_CT_LAST){B.style.color="#989898";B.value=WCPV_MRTS_MYD_CT_LAST}}}else{if(A==2){if(D.style.color!=""){D.style.color="";D.value=""}}else{if(A==3){if(B.style.color!=""){B.style.color="";B.value=""}}}}}function submitThisFormWhen(){document.whenForm.cmd.value="addToTripSandbox";document.whenForm.action=whenURL1;var A=document.whenForm.action+"&"+Form.serialize(document.whenForm);A=A+getTabsStateQueryString("2_0");AjaxUtil.update(A,"wcpv_tripsuitcase_portlet_container");showConfirmationMessage(ADDED_TO_TRIP_PLAN+viewTripPlanLink,WCP_MESSAGE_CONTENT_DIV_ID);window.location.href="#wcp_anchor"}function validateWhenForm(){hideMessage(WCP_MESSAGE_CONTENT_DIV_ID);var B="";if(document.getElementById("clickedOnId").value!="addSeason"){if(document.getElementById("when_startdate").value!="mm/dd/yyyy"){B+=CommonValidator.checkDateFormatMMDDYYYY("when_startdate",JS_MSG_WHEN_START_DATE)}if(B!=""){B=B+"\n"}if(document.getElementById("when_startdate").value!="mm/dd/yyyy"){B+=CommonValidator.checkDateValidityAndFormatMMDDYYYY("when_startdate",JS_MSG_WHEN_START_DATE)}if(B==""){if(document.getElementById("when_enddate").value!="mm/dd/yyyy"){B+=CommonValidator.checkDateFormatMMDDYYYY("when_enddate",JS_MSG_WHEN_END_DATE)}if(B!=""){B=B+"\n"}if(document.getElementById("when_enddate").value!="mm/dd/yyyy"){B+=CommonValidator.checkDateValidityAndFormatMMDDYYYY("when_enddate",JS_MSG_WHEN_END_DATE)}}if(B==""){if(document.getElementById("when_startdate").value!="mm/dd/yyyy"&&document.getElementById("when_enddate").value!="mm/dd/yyyy"){B+=dateDifferences("when_startdate","when_enddate","")}}if(B==""){if(Trim(document.getElementById("when_travaelduration").value)!=""){B+=CommonValidator.checkPositiveInteger("when_travaelduration",JS_MSG_WHEN_NUMBER_OF_DAYS);if(document.getElementById("when_travaelduration").value==0){B+=WHEN_PLEASE_ENTER_A_NUMBER_GREATER_THAN_ZERO}}}if(B==""){B+=validatePastDate("when_startdate","when_enddate")}}if(B==""){B+=validateForBlank()}if(B==""){if(document.getElementById("clickedOnId").value=="addSeason"){deSelectWhenDates()}else{deSelectAllSeason("selectedSeasonId")}pushDefaultValuetoWhen();submitThisFormWhen()}else{B=replaceAll(B,"&nbsp;","");B=replaceAll(B,"<br/>","");var A=B;showErrorMessage(A,WCP_MESSAGE_CONTENT_DIV_ID);window.location.href="#wcp_anchor"}}function relodeWhenPortlet(){document.tripSuitcaseForm.action=whenURL2;var A=document.tripSuitcaseForm.action+"&"+Form.serialize(document.tripSuitcaseForm);showTripSuitcase(false);showWheelsCoalesced(true);AjaxUtil.update(A,"when_content",{onComplete:showHideDiv("when_content","1_3","When")})}function mouseOver(B){var C=B.id;var A=C.substring(0,C.indexOf("_"));if(B.src.substr(B.src.lastIndexOf("/")+1)!=A+"Selected.gif"){B.src="/html/themes/wheelscpv/skins/images/when/"+A+"Over.gif"}}function mouseOut(B){var C=B.id;var A=C.substring(0,C.indexOf("_"));if(B.src.substr(B.src.lastIndexOf("/")+1)!=A+"Selected.gif"){B.src="/html/themes/wheelscpv/skins/images/when/"+A+"NotSelected.gif"}}function setSelectedSeason(E,C){var B=document.getElementsByName("seasons");var G=B.length;var I=E.substring((E.indexOf("_"))+1);var F=E.substring(0,E.indexOf("_"));var H=$(E).src;for(var D=0;D<G;D++){var A=(B[D].id).substring(0,(B[D].id).indexOf("_"));B[D].src="/html/themes/wheelscpv/skins/images/when/"+A+"NotSelected.gif"}if(H.substr($(E).src.lastIndexOf("/")+1)!=F+"Selected.gif"){$(E).src="/html/themes/wheelscpv/skins/images/when/"+F+"Selected.gif";$(C).value=I}else{$(E).src="/html/themes/wheelscpv/skins/images/when/"+F+"NotSelected.gif";$(C).value=""}}function deSelectAllSeason(C){var A=document.getElementsByName("seasons");var E=A.length;for(var B=0;B<E;B++){var D=(A[B].id).substring(0,(A[B].id).indexOf("_"));A[B].src="/html/themes/wheelscpv/skins/images/when/"+D+"NotSelected.gif"}$(C).value=""}function deSelectWhenDates(){document.getElementById("when_startdate").value="mm/dd/yyyy";document.getElementById("when_enddate").value="mm/dd/yyyy";document.getElementById("when_travaelduration").value=""}function setASeason(A){if(A==2){$("spring_2").src="/html/themes/wheelscpv/skins/images/when/springSelected.gif"}else{if(A==3){$("summer_3").src="/html/themes/wheelscpv/skins/images/when/summerSelected.gif"}else{if(A==4){$("autumn_4").src="/html/themes/wheelscpv/skins/images/when/autumnSelected.gif"}else{if(A==1){$("winter_1").src="/html/themes/wheelscpv/skins/images/when/winterSelected.gif"}}}}$("selectedSeasonId").value=A}function setDefaultText(A,B){if(document.getElementById(A).value==""){document.getElementById(A).value=B}}function resetEndDate(){var C="";if(document.getElementById("when_startdate").value!="mm/dd/yyyy"){C+=CommonValidator.checkDateFormatMMDDYYYY("when_startdate","error")}if(document.getElementById("when_startdate").value!="mm/dd/yyyy"){C+=CommonValidator.checkDateValidityAndFormatMMDDYYYY("when_startdate","error")}C+=CommonValidator.checkPositiveInteger("when_travaelduration","error");var B=document.getElementById("when_startdate").value;var E=document.getElementById("when_travaelduration").value;if(Trim(B)!=""&&C==""&&B!="mm/dd/yyyy"){var F=new cDate(B);var G=new Date(F.intYear,F.intMonth-1,F.intDate);var D=G.getTime();if(E>1){G.setTime(D+(E-1)*(24*60*60*1000))}else{G.setTime(D)}if(G.getYear()>1900){var A=(G.getMonth()+1)+"/"+G.getDate()+"/"+G.getYear()}else{var A=(G.getMonth()+1)+"/"+G.getDate()+"/"+(G.getYear()+1900)}document.getElementById("when_enddate").value=A}}var whenjsCalendarObj=new Calendar(false,null,whenjsOnSelect,whenjsOnClose);whenjsCalendarObj.weekNumbers=false;whenjsCalendarObj.firstDayOfWeek=0;whenjsCalendarObj.setTtDateFormat="%A, %B %e, %Y";whenjsCalendarObj.setRange(2002,2020);var txtCalId;function checkKeycode(C,D,B){var A;if(window.event){A=window.event.keyCode}else{if(C){A=C.which}}if((A>=48&&A<=57)||(A>=65&&A<=90)){whenjsOnClick(D,B)}}function whenjsOnClick(F,B){txtCalId=B;var A=null;whenjsCalendarObj.create();var E=document.getElementById(B).value;var C=document.whenForm.when_startdate.value;if(B=="when_enddate"&&C!="mm/dd/yyyy"){var D=new cDate(C)}else{if(E!="mm/dd/yyyy"){var D=new cDate(E)}else{var D=new cDate("")}}A=createDateObject(F,D);whenjsCalendarObj.setDate(A);whenjsCalendarObj.showAtElement(document.getElementById(B),"R")}function whenjsOnClose(A){A.hide()}function whenjsOnSelect(B){if(B.dateClicked){var A=B.date.getMonth()+1;document.getElementById(txtCalId).value=A+"/"+B.date.getDate()+"/"+B.date.getFullYear();B.callCloseHandler();document.getElementById(txtCalId).focus()}}function createDateObject(A,G){var D=null;var E=G.intDate;var H=G.intMonth-1;var F=G.intYear;var J=new cDate((new Date()).getMonth()+"/"+(new Date()).getDate()+"/"+((new Date()).getYear()+1900));if((F=="")||((E!="")&&(H<0))){if(A=="startdate"){var B=document.getElementById("selectedSeasonId").value;if(B!=""){var I=new cDate(document.getElementById(B+"StartId").value);var L=new Date(I.intYear,I.intMonth-1,I.intDate);if(L>new Date()){D=L}else{D=new Date()}}else{D=new Date()}}else{if(A=="enddate"){var B=document.getElementById("selectedSeasonId").value;var C=document.getElementById("when_travaelduration").value;var K=CommonValidator.checkPositiveInteger("when_travaelduration","travel duration");if(B!=""){if(C!=""&&C!="0"&&K==""){var I=new cDate(document.getElementById(B+"StartId").value);D=new Date(I.intYear,I.intMonth-1,I.intDate);var M=D.getTime();D.setTime(M+C*(24*60*60*1000))}else{var I=new cDate(document.getElementById(B+"EndId").value);D=new Date(I.intYear,I.intMonth-1,I.intDate)}}else{D=new Date();if(C!=""&&C!="0"&&K==""){var M=D.getTime();D.setTime(M+C*(24*60*60*1000))}else{}}}else{D=new Date()}}}else{if(H==""){H=0}if(E==""){E=1}D=new Date(F,H,E)}return D}function whereFormValidate(A){var B="";B+=checkpoiSearchName("place_Or_Event",JS_MSG_WHERE_PLACE_OR_EVENT);if(A=="whereForm1"){B+=checkForWhereFormByExactLocationEmpty();B+=checkForByExactLocationEmpty();B+=checkWhereAlphaNumeric("exact_Address",JS_MSG_WHERE_EXACT_ADDRESS);B+=checkWhereCityAlphaNumeric("exact_City",JS_MSG_WHERE_EXACT_CITY);B+=CommonValidator.checkPostalCode("exact_ZipCode",JS_MSG_WHERE_EXACT_ZIPCODE)}else{if(A=="whereForm2"){B+=checkForWhereFormByCityEmpty();B+=checkWhereCityAlphaNumeric("city_Or_Airport_City",JS_MSG_WHERE_EXACT_CITY);B+=CommonValidator.checkPostalCode("city_Or_Airport_ZipCode",JS_MSG_WHERE_EXACT_ZIPCODE)}else{if(A=="whereForm3"){B+=checkForWhereFormRegionEmpty()}else{if(A=="whereForm0"){if(Trim($("place_Or_Event").value)==""){B+=WHERE_EMPTY}else{B+=""}}}}}if(B!=""){if(B.substring(B.length-NEW_LINE.length,B.length)==NEW_LINE){B=B.substring(0,B.length-NEW_LINE.length)}showErrorMessage(B,WCP_MESSAGE_CONTENT_DIV_ID);return false}return true}function checkForWhereFormByExactLocationEmpty(){if(Trim($("place_Or_Event").value)==""&&Trim($("exact_Address").value)==""&&Trim($("exact_City").value)==""&&$("exact_State").selectedIndex==0&&Trim($("exact_ZipCode").value)==""){return WHERE_LOCATION_EMPTY}return""}function checkForByExactLocationEmpty(){if((Trim($("place_Or_Event").value)==""||Trim($("place_Or_Event").value)!="")&&Trim($("exact_Address").value)!=""&&((Trim($("exact_City").value)==""||$("exact_State").selectedIndex==0)&&Trim($("exact_ZipCode").value)=="")){return WHERE_ADDRESS_LOCATION_EMPTY}return""}function checkForWhereFormByCityEmpty(){if(Trim($("place_Or_Event").value)==""&&Trim($("city_Or_Airport_City").value)==""&&$("city_Or_Airport_State").selectedIndex==0&&Trim($("city_Or_Airport_ZipCode").value)==""){return WHERE_CITY_EMPTY}return""}function checkForWhereFormRegionEmpty(){if(Trim($("place_Or_Event").value)==""&&$("general_Region").selectedIndex==0){return WHERE_REGION_EMPTY}return""}function getStateForWhere(form,selectedState){var isSelect=false;eval("document."+form).state[0]=new Option(" - ","");for(j=0;j<whereJSONCountryStateObject.Country[0].objJsonState.length;j++){if(whereJSONCountryStateObject.Country[[0]].objJsonState[j].StateCode==selectedState){isSelect=true}eval("document."+form).state[j+1]=new Option(whereJSONCountryStateObject.Country[[0]].objJsonState[j].StateCode,whereJSONCountryStateObject.Country[[0]].objJsonState[j].StateCode);eval("document."+form).state[j+1].selected=isSelect;isSelect=false}}function addStateToTripPlan(C,E){window.location.href="#wcp_anchor";showConfirmationMessage(WHERE_ADDED_TO_TRIP_PLAN+viewTripPlanLink,WCP_MESSAGE_CONTENT_DIV_ID);var D=CMD_ADDTOMYTRIP;var A="whereResultForm";var B="/ext/wheelscpv/wheelscoalescedportlet/whereportlet_addToTripSuitCase";addStateToTripSuitCaseFromWhere(WHERE_URL,D,A,C,E,B)}var nameOfForm;function whereFormSubmitValidate(frm){hideMessage(WCP_MESSAGE_CONTENT_DIV_ID);var parentFormName=frm;var obj=eval("document."+parentFormName+".specificLocation");obj.value=$("place_Or_Event").value;var cmd="whereSearch";var strutsPath="/ext/wheelscpv/wheelscoalescedportlet/whereportlet_build";var title="Where Search Results";var isError=whereFormValidate(parentFormName);if(!isError){return false}var poiArr=new Array();var poiTextArr=new Array();if($("portlet_results_content").style.display=="block"){closeResultDiv()}if(parentFormName=="whereForm1"){if(Trim($("place_Or_Event").value)==""&&(Trim($("exact_Address").value)==""||Trim($("exact_Address").value)==null)&&(Trim($("exact_City").value)==""&&$("exact_State").selectedIndex!=0&&Trim($("exact_ZipCode").value)=="")){poiArr[0]=getStateGeoCode($("exact_State").value);poiTextArr[0]=getStateName($("exact_State").value);closeResultDiv();addStateToTripPlan(poiArr,poiTextArr)}else{nameOfForm="whereForm1";getWheelsCPVSearchResult(WHERE_URL,cmd,parentFormName,strutsPath,title)}}else{if(parentFormName=="whereForm2"){if(Trim($("place_Or_Event").value)==""&&Trim($("city_Or_Airport_City").value)==""&&$("city_Or_Airport_State").selectedIndex!=0&&Trim($("city_Or_Airport_ZipCode").value)==""){poiArr[0]=getStateGeoCode($("city_Or_Airport_State").value);poiTextArr[0]=getStateName($("city_Or_Airport_State").value);closeResultDiv();addStateToTripPlan(poiArr,poiTextArr)}else{nameOfForm="whereForm2";getWheelsCPVSearchResult(WHERE_URL,cmd,parentFormName,strutsPath,title)}}else{if(parentFormName=="whereForm3"){if(Trim($("place_Or_Event").value)==""&&$("general_Region").selectedIndex!=0){var regionGeoCodeCenterPointArr=new Array();var regionNameArr=new Array();regionGeoCodeCenterPointArr[0]=getRegionGeoCodeCenterPoint($("general_Region").value);regionNameArr[0]=getRegionName($("general_Region").value);regionNameArr[1]=getRegionCenterCity($("general_Region").value);regionNameArr[2]=getRegionCenterState($("general_Region").value);closeResultDiv();addStateToTripPlan(regionGeoCodeCenterPointArr,regionNameArr)}else{getWheelsCPVSearchResult(WHERE_URL,cmd,parentFormName,strutsPath,title)}}else{getWheelsCPVSearchResult(WHERE_URL,cmd,parentFormName,strutsPath,title)}}}document.whereForm0.reset();if(frm=="whereForm1"){document.whereForm2.reset();document.whereForm3.reset()}else{if(frm=="whereForm2"){document.whereForm1.reset();document.whereForm3.reset()}else{if(frm=="whereForm3"){document.whereForm1.reset();document.whereForm2.reset()}else{document.whereForm1.reset();document.whereForm2.reset();document.whereForm3.reset()}}}}function reloadWhoPortlet(B){whoOverAllBudgetSliderElement=null;whoActivityLevelSliderElement=null;whoIndoorOutdoorSliderElement=null;whoFlavourSliderElement=null;var A=whoURL1;if(B!=null){var C=getPortletParamStr("cmd",B);A+=C}showTripSuitcase(false);showWheelsCoalesced(true);AjaxUtil.update(A,"who_content",{onComplete:showHideDiv("who_content","1_1","Who")})}function reloadWhoTab(A){if($("who_content").style.display=="block"){reloadWhoPortlet(A)}}function setWhoSliders(){if(whoOverAllBudgetSliderElement==null){initializeSlider("horizontal",whoOverAllBudgetSliderElement,"whoOverAllBudgetSlider","whoOverAllBudgetSliderInput",1,90,document.initialValueOverallBudget,5,"economy","overallBudget",whoOverAllBudgetArr)}if(whoActivityLevelSliderElement==null){initializeSlider("horizontal",whoActivityLevelSliderElement,"whoActivityLevelSlider","whoActivityLevelSliderInput",0,90,document.initialValueActivityLevel,5,"adrenaline","activityLevel",whoActivityLevelArr)}if(whoIndoorOutdoorSliderElement==null){initializeSlider("horizontal",whoIndoorOutdoorSliderElement,"whoIndoorOutdoorSlider","whoIndoorOutdoorSliderInput",0,90,document.initialValueIndoorOutdoor,5,"locale","indoorOutdoor",whoIndoorOutdoorArr)}if(whoFlavourSliderElement==null){initializeSlider("horizontal",whoFlavourSliderElement,"whoFlavourSlider","whoFlavourSliderInput",0,90,document.initialValueFlavour,5,"style","flavour",whoFlavourArr)}}function showEditProfile(){if($("wcpvmrts_main")==null){closeMRTS(false);loadMyTripPersona()}else{$("wcpvmrts_main").style.display="block";loadContent("/ext/wheelscpv/myroadtripstuffportlet/view?&tab_state=3_1&selectedTab=myTripPersonalities",WHEELSCP_TAB_MRTS_MY_TRIP_PERSONALITY)}}var iTripPersonaCount=0;function loadMyTripPersona(){iTripPersonaCount+=1;if($("myroadtripstuff_persona_content")){loadContent("/ext/wheelscpv/myroadtripstuffportlet/view?&tab_state=3_1&selectedTab=myTripPersonalities",WHEELSCP_TAB_MRTS_MY_TRIP_PERSONALITY);iTripPersonaCount=0}else{if(iTripPersonaCount<=20){setTimeout("loadMyTripPersona()",500)}}}function getTripPersonality(){hideMessage(WCP_MESSAGE_CONTENT_DIV_ID);document.whoForm.cmd.value="getPersonalityOnChange";var A=whoURL2;A+="&"+Form.serialize(document.whoForm);AjaxUtil.update(A,"who_content")}function saveWho(){var B=uncheckChild();if(!B){return false}setSpecialNeedsValues();if(!whoConfirm()){return false}setChildrenAndSpecialNeedsToZero();if(whoOverAllBudgetSliderElement!=null){document.whoForm.overallBudget.value=getValueFromSlider(1,whoOverAllBudgetSliderElement.getValue(),whoOverAllBudgetArr);document.whoForm.activityLevel.value=getValueFromSlider(0,whoActivityLevelSliderElement.getValue(),whoActivityLevelArr);document.whoForm.indoorOutdoor.value=getValueFromSlider(0,whoIndoorOutdoorSliderElement.getValue(),whoIndoorOutdoorArr);document.whoForm.flavour.value=getValueFromSlider(0,whoFlavourSliderElement.getValue(),whoFlavourArr)}var C=document.whoForm.personalityId.selectedIndex;document.whoForm.personaName.value=document.whoForm.personalityId.options[C].text;document.whoForm.action=whoURL3;var A=document.whoForm.action+"&"+Form.serialize(document.whoForm);A=A+getTabsStateQueryString("2_0");AjaxUtil.update(A,"wcpv_tripsuitcase_portlet_container");showConfirmationMessage(JS_MSG_WHO_ADDED_TO_TRIP_PLAN+viewTripPlanLink,WCP_MESSAGE_CONTENT_DIV_ID);window.location.href="#wcp_anchor"}function setInitialValuesForWhoSliders(A,D,B,C){document.initialValueOverallBudget=A;document.initialValueActivityLevel=D;document.initialValueIndoorOutdoor=B;document.initialValueFlavour=C;whoOverAllBudgetSliderElement=null;whoActivityLevelSliderElement=null;whoIndoorOutdoorSliderElement=null;whoFlavourSliderElement=null}function setChildrenAndSpecialNeedsToZero(){var C=document.whoForm.kidsIncluded.value;if(C==0){document.whoForm.numberOfChildren05.value=0;document.whoForm.numberOfChildren612.value=0;document.whoForm.numberOfChildrenTeen.value=0;document.whoForm.numberOfChildrenOver18.value=0}var D=document.whoForm.specialNeeds;var B=document.whoForm.specialNeeds_c;if(!D.checked){for(var A=0;A<B.length;A++){B[A].checked=false}}}function hideDiv(A,B){if(A){A.style.display="none"}else{}}function createListBox(C,E,B,D){var A="";var F=0;if(D=="true"){A=A+'<SELECT NAME="'+E+'" id="'+E+'" onChange="setChildrenChildDiv()" class="txtBox whoCategoriesTxtBox">'}else{A=A+'<SELECT NAME="'+E+'" id="'+E+'" class="txtBox whoCategoriesTxtBox">'}A=A+'<OPTION selected="true" VALUE="0"> 0 </OPTION>';if(E=="kidsIncluded"){F=40}else{F=10}for(i=1;i<=F;i++){if(i==B){A+='<option value="'+i+'" selected >'+i+"</option>"}else{A+='<option value="'+i+'">'+i+"</option>"}}A+="</select>";appendChildDiv(C,A)}function whoConfirm(){hideMessage("wcp_message_content");var adults=document.whoForm.numberOfAdults.value;var seniors=document.whoForm.numberOfSeniors.value;var kidsIncluded=document.whoForm.kidsIncluded.value;var numberOfChildren05=document.whoForm.numberOfChildren05.value;var numberOfChildren612=document.whoForm.numberOfChildren612.value;var numberOfChildrenTeen=document.whoForm.numberOfChildrenTeen.value;var numberOfChildrenOver18=document.whoForm.numberOfChildrenOver18.value;var specialNeeds=document.whoForm.specialNeeds;var child_specialNeeds=document.whoForm.specialNeeds_c;var specialNeedsFlag=true;var incorrectChildrenFlag=true;var isPeopleTraveling=true;if(kidsIncluded!=0){if(!(eval(kidsIncluded)==(eval(numberOfChildren05)+eval(numberOfChildren612)+eval(numberOfChildrenTeen)+eval(numberOfChildrenOver18)))){message=(WHO_INCORRECT_NUMBER_OF_CHILDREN);showErrorMessage(message,"wcp_message_content");incorrectChildrenFlag=false;window.location.href="#wcp_anchor"}}if(adults==0&&seniors==0&&kidsIncluded==0){isPeopleTraveling=false;message=WHO_NO_PEOPLE_TRAVELING;showErrorMessage(message,"wcp_message_content");window.location.href="#wcp_anchor"}if(specialNeedsFlag&&incorrectChildrenFlag&&isPeopleTraveling){return true}else{return false}}function hideDiv(C,A){var B=C.selectedIndex;document.getElementById(A);if(B==0){document.getElementById(A).style.display="none"}else{document.getElementById(A).style.display="block"}}function appendChildDiv(B,D){var C=document.getElementById(B);if(C!=null){var A=document.createElement("div");A.innerHTML=D+'<div style="margin:2px"></div>';C.appendChild(A)}}function setChildrenChildDiv(){setChildrenAndSpecialNeedsToZero();var A=document.getElementById("childDiv");if(A!=null){if(document.whoForm.kidsIncluded.selectedIndex==0){A.style.display="none"}else{A.style.display="block"}}}function setSpecialNeedsValues(){var C=document.whoForm.specialNeeds;if(C!=null){var D="0";var B=",";if(C.checked){var D="1,";var A=document.whoForm.specialNeeds_c;for(i=0;i<A.length;i++){if(A[i].checked){D+=A[i].value+B}}D=D.substring(0,D.length-1)}else{D="0"}C.value=D}}function uncheckChild(){var B=document.whoForm.specialNeeds;var A=document.whoForm.specialNeeds_c;if(B.checked&&A[0].checked==false){showErrorMessage(JS_MSG_WHO_NOT_UPDATED_DUE_TO_SPECIAL_NEEDS,WCP_MESSAGE_CONTENT_DIV_ID);return false}else{return true}}function enableUpdateButton(){$("whoButtonHidden").style.display="none";$("whoButton").style.display="block"}function confirmLogout(){url="/html/wheelscpv/portal/common/logoutConfirm.jsp";AjaxUtil.update(url,"showLogOutPopUpId")}function closeLogOutPopUp(A){$(A).style.display="none";hideIt()}function openNewTripConfirmBox(A,E){var B=document.tripSuitcaseForm.tripPlanTextArr.value;var C=document.tripSuitcaseForm.geoCodeStr.value;var D=false;if((C.length>0)){D=true}if(D){showModalPopUp("newTripPlanConfirmDivId",300,60)}else{if(E=="true"){if($("wcpvmrtps_main")){closeMyRoadTrips(true)}else{closeMRTS(true)}}loadContent("/ext/wheelscpv/wheelscoalescedportlet/startingpointportlet_view?&ia_p=2&tab_state=1_0",WHEELSCP_TAB_STARTINGPOINT_TAB_LABEL)}}function newTripConfirmTripNo(){$("newTripPlanConfirmDivId").style.display="none";hideIt()}function newTripConfirmTripYes(A){reloadOverview();hideIt();$("newTripPlanConfirmDivId").style.display="none";if(A=="true"){if($("wcpvmrtps_main")){closeMyRoadTrips(true)}else{closeMRTS(true)}}}function reloadOverview(){clearTripPlan();clearTripPlanPushPin();loadContent("/ext/wheelscpv/wheelscoalescedportlet/startingpointportlet_view?&ia_p=2&tab_state=1_0",WHEELSCP_TAB_STARTINGPOINT_TAB_LABEL)}function overviewClearTripPlanConfirmYes(){hideDivById("overviewClearTripPlanConfirmDivId");hideIt();clearTripPlan("tripSuitcase","no")}function overviewClearTripPlanConfirmNo(){hideDivById("overviewClearTripPlanConfirmDivId");hideIt()}