
var omnitureCustom=function(){var URL=window.location.href;var customCookie=omnitureStandard.getOmniCookie('omniData');var customHWSCookie=omnitureStandard.getOmniCookie('omniHWSData');return{getOmniCustomValues:function(){s.products=$("#omniProduct").val();$("#primary-nav-container a").click(function(){var primaryNavLinkFlag="HWSPrimeNavLink";var primaryNavLocation="HWSPrimaryNav";var primaryNavDescription="HWS Primary Nav";if($(this).attr("title").length>0){var thisTitle=$(this).attr("title").replace(/[\n\r\t]/g,"");primaryNavLinkFlag+=thisTitle;primaryNavDescription=thisTitle;}else if($(this).text().length>0){var thisText=$(this).text().replace(/[\n\r\t]/g,"");primaryNavLinkFlag+=thisText;primaryNavDescription=thisText;}
primaryNavLinkFlag+="Flag*";omnitureCustom.setHWSClickEventTrackingId(primaryNavLinkFlag,primaryNavLocation,primaryNavDescription);});$(".sendto-link").click(function(event){var theEventClass=$(event.target).attr("href");var currentDomain=document.domain;if(typeof theEventClass!=='undefined'&&theEventClass.match(/.+\.pdf/i)){var pdfFileName=currentDomain+theEventClass;sendPDFTrackingData(pdfFileName);}});$(".join-rewards").click(function(event){var s=s_gi(s_account);s.linkTrackEvents="event2";s.linkTrackVars="eVar1,eVar8.eVar9,eVar22,prop27,events,products";s.eVar1="uri=:"+URL+"loc=body:linkDescription=MRCC Apply Now";s.eVar8=$('#omniRewardsNumber').val();s.eVar9=$('#eliteMembershipLevel').val();s.eVar22=$('#omniProfileState').val();s.prop27=$('#omniProfileState').val();s.events="event2";s.products=$("#omniProduct").val();void(s.tl(true,"o","MRCC Ad Click"));});$("#photo-gallery-link a").click(function(){var photoGalleryLinkCookieFlag="HWSPhotoGalleryLinkFlag*";var photoGalleryLocation="mainImage";var photoGalleryDescription="Photo Gallery";omnitureCustom.sendHWSClickEventTrackingId(photoGalleryLinkCookieFlag,photoGalleryLocation,photoGalleryDescription);});$("#hotel-photos a, #photo-gallery-container #photos a").click(function(){var photoThumbnailLinkCookieFlag="HWSPhotoThumbnailFlag*";var photoThumbnailLocation="photoGallery";var photoThumbnailDescription="Photo Thumbnails";if($(this).parents("ul#hotel-photos").length>0){photoThumbnailLocation="bottomSectionThumbnails";}
omnitureCustom.sendHWSClickEventTrackingId(photoThumbnailLinkCookieFlag,photoThumbnailLocation,photoThumbnailDescription);});$("#view-all-photos a").click(function(){var photoThumbnailLinkCookieFlag="HWSPhotoViewAllLinkFlag*";var photoThumbnailLocation="bottomSectionThumbnails";var photoThumbnailDescription="View All Photos";omnitureCustom.setHWSClickEventTrackingId(photoThumbnailLinkCookieFlag,photoThumbnailLocation,photoThumbnailDescription);});$("#hotel-title-area .hotel-links a").click(function(){var toolLinkCookieFlag="HWSToolLink";var toolLinkLocation="auxiliary";var toolLinkDescription=$(this).attr("title");toolLinkCookieFlag+=toolLinkDescription+"Flag*";if($(this).attr("rel").length>0){omnitureCustom.sendHWSClickEventTrackingId(toolLinkCookieFlag,toolLinkLocation,toolLinkDescription);}
else{omnitureCustom.setHWSClickEventTrackingId(toolLinkCookieFlag,toolLinkLocation,toolLinkDescription);}});$("#breadcrumb-nav a").click(function(){var breadCrumbCookieFlag="HWSBreadCrumbLinkFlag*";var breadCrumbLocation="breadcrumb";var breadCrumbDescription="";omnitureCustom.setHWSClickEventTrackingId(breadCrumbCookieFlag,breadCrumbLocation,breadCrumbDescription);});$("#find-a-hotel-control, #my-account-control, .toggle-link").click(function(){if(!$(this).hasClass("open")){var eventName="";var offerId="";var thisId=$(this).attr("id");var thisClasses=$(this).attr("class");if(thisId.length>0){if(thisId.match("find-a-hotel-control")){eventName="HWS: Expand Find a Hotel";}
else if(thisId.match("my-account-control")){eventName="HWS: Expand My Account Widget";}
else if(thisId.match("phone-number")){eventName="HWS: Expand Phone Numbers";}
else if(thisId.match("capacity-toggle")){eventName="HWS: Expand Show Capacity Chart";}
else if(thisId.match("read-more")){eventName="HWS: Expand Read More";}
else if(thisId.match("expand-offer-")){eventName="HWS: Expand Deals";offerId=thisId.substring(13);}else{eventName="HWS: Expand "+thisId;}}else if(thisClasses.match("phone-number")){eventName="HWS: Expand Phone Numbers";}
else if($(this).text().length>0){var thisText=$(this).text().replace(/[\n\r\t]/g,"");eventName="HWS: Expand "+thisText;}
omnitureCustom.sendExpandFlyoutTrackingData(eventName,offerId);}});$("#standard-offers .hws-reservations-form button").click(function(){var offerId=$(this).attr("id");if(offerId.length>13){offerId=offerId.substring(13);}
if(customCookie.match("HWSOfferSearch")){var offerStartStr=customCookie.indexOf("HWSOfferSearch");var offerCookieStr=customCookie.substring(offerStartStr);var offerEndStr=offerCookieStr.indexOf("*");offerCookieStr=offerCookieStr.substring(0,offerEndStr+1);customCookie=customCookie.replace(offerCookieStr,"HWSOfferSearch"+offerId+"*");}else{customCookie+="HWSOfferSearch"+offerId+"*";}
document.cookie="omniData="+customCookie+";path=/";});$(".tabs-container .tab-headings a").click(function(){var thisText=$(this).text().replace(/[\n\r\t]/g,"");var tabbedContainerTabCookieFlag="HWSTabClickFlag"+thisText+"*";if(customHWSCookie.match(tabbedContainerTabCookieFlag)==null){var HWSTabLink="uri=HWS Section:loc=tabbedContainer:linkDescription="+thisText;var title="Tabbed Container Tab Click";omnitureCustom.sendTracingData(HWSTabLink,title);customHWSCookie+=tabbedContainerTabCookieFlag;document.cookie="omniHWSData="+customHWSCookie+";path=/";}});$('p.message-data a').click(function(){var thisText=$(this).text().replace(/[\n\r\t]/g,"");var AbovePropertyLink="uri=HWS Section:loc=AbovePropertyMessage:linkDescription="+thisText;;var title="Above Property Message Link Click";omnitureCustom.sendTracingData(AbovePropertyLink,title);});$('.message-info a').live("click",function(){var thisText=$(this).text().replace(/[\n\r\t]/g,"");var AbovePropertyLightboxLink="uri=HWS Section:loc=AbovePropertyLightbox:linkDescription="+thisText;var title="Above Property Message Lightbox Link Click";omnitureCustom.sendTracingData(AbovePropertyLightboxLink,title);});$('#hotel-specific-message a').click(function(){var thisText=$(this).text().replace(/[\n\r\t]/g,"");var PropertyMessageLink="uri=HWS Section:loc=PropertyMessage:linkDescription="+thisText;;var title="Property Message Link Click";omnitureCustom.sendTracingData(PropertyMessageLink,title);});$('#find-flight-car-packages-form #advanced-search a').click(function(){var vacationPackagesLinkData="uri=HWS Section:loc=body:linkDescription=VBM Advanced Search";var title="Vacation Packages Advanced Search Link Click";omnitureCustom.sendTracingData(vacationPackagesLinkData,title);});$("#weekend-rates a.weekend-rate").click(function(){var thisWeekendRate=$(this);var weekendRateId=thisWeekendRate.attr("id");if(weekendRateId.length>0){setTrackingCookie(weekendRateId,"weekendRateURI");}});$("#reservations-summary .button-submit").click(omnitureCustom.buttonProcessOmniCookie);$("#GroupSalesFindAndReserveSearchActionForm").ready(function(){$("#GroupSalesFindAndReserveSearchActionForm #button-submit-container button").click(function(){var thisMARSHA=$("#omniProduct").val().substring(1);customCookie+="HWSQckGrpFrm"+thisMARSHA+"*";document.cookie="omniData="+customCookie+";path=/";});});if(URL.match("/hotels/travel-guide")||URL.match("/hotels/event-planning/wedding-planning/")){s.events+=",event34";}else if(URL.match("/hotels/hotel-deals")){s.events+=",event21";$("#hotel-specials button").click(function(){var hwsSearch="";if(customCookie.match("hwsSearchType")){hwsSearch=customCookie.substring(customCookie.indexOf("hwsSearchType"));hwsSearch=hwsSearch.substring(0,hwsSearch.indexOf("*")+1);}
if(hwsSearch!=""){customCookie=customCookie.replace(hwsSearch,"hwsSearchTypeDeals*");}
else{customCookie+="hwsSearchTypeDeals*";}
document.cookie="omniData="+customCookie+";path=/";});}
else if(URL.match("/hotels/event-planning/business-meeting")){var moduleOnPage=$('#product-module-on-page');var uRLDomain=URL.substring(URL.indexOf('//')+2);if(moduleOnPage.length>0&&moduleOnPage.val().match('true')){s.pageName=uRLDomain+"||HWS-module";}else{s.pageName=uRLDomain+"||HWS-non-module";}}
else if(URL.match("/hotels/travel/")){omnitureCustom.hwsProcessOmniCookie();}
else if(URL.match("/hotels/hotel-rooms/")){$("#guest-rooms-list .button-submit").each(function(){$(this).click(omnitureCustom.buttonProcessOmniCookie);});if($("#guest-rooms-list").length>0){$("#guest-rooms-list").ready(function(){$("#guest-rooms-list .open-quick-view-heading, #guest-rooms-list .open-quick-view").click(function(){var quickViewRoomCode;var sendRequestFlag="HWSExpandRoomQuickView*";var MARSHAPropertyQuickView=$("#omniProduct").val();if($(this).attr("class").match("open-quick-view-heading")){quickViewRoomCode=$(this).attr("id").substring(19);}
else{quickViewRoomCode=$(this).attr("id").substring(18);}
if(customHWSCookie.match(sendRequestFlag)==null){if(quickViewRoomCode.match("-")){quickViewRoomCode=quickViewRoomCode.replace(/-/g,"");}
var s=s_gi(s_account);s.linkTrackEvents="prodView,event24";s.linkTrackVars="prop29,eVar37,products,events";s.events="prodView,event24";s.products=MARSHAPropertyQuickView;s.eVar37=quickViewRoomCode;s.prop29="HWS: Expand Room Details";void(s.tl(this,"o","HWS Expand "+MARSHAPropertyQuickView+" "+quickViewRoomCode+" Room Details"));customHWSCookie+=sendRequestFlag+"*";document.cookie="omniHWSData="+customHWSCookie+";path=/";}});$("#guest-rooms-list .carousel-component").click(function(){var sendRequestFlag="HWSRoomPhotoClick*";var MARSHAPropertyQuickView=$("#omniProduct").val();var roomPool=$(this).attr("id").substring(0,5);if(customHWSCookie.match(sendRequestFlag)==null){if(roomPool.match("-")){roomPool=roomPool.replace(/-/g,"");}
var s=s_gi(s_account);s.linkTrackEvents="prodView,event25";s.linkTrackVars="prop29,eVar37,products,events";s.events="prodView,event25";if($(this).parents("a.photo-detail").length>0){s.linkTrackEvents+=",event65";s.events+=",event65";}
s.products=MARSHAPropertyQuickView;s.eVar37=roomPool;s.prop29="HWS: Click Photo Carousel";void(s.tl(this,"o","HWS "+MARSHAPropertyQuickView+" "+roomPool+" Photo Carousel Click"));customHWSCookie+=sendRequestFlag+"*";document.cookie="omniHWSData="+customHWSCookie+";path=/";}});});}}},sendTracingData:function(evar1,objectTitle){var s=s_gi(s_account);s.linkTrackEvents="event2";s.linkTrackVars="eVar1,products,events";s.events="event2";s.eVar1=evar1;s.products=$("#omniProduct").val();void(s.tl(this,"o",objectTitle));},performAdditionalRequests:function(){},sendHWSClickEventTrackingId:function(clickEventFlag,clickEventLocation,clickEventDescription){if(clickEventFlag.length>0&&customHWSCookie.match(clickEventFlag)==null){var clickEventId="uri=HWS Section";if(clickEventLocation.length>0){clickEventId+=":loc="+clickEventLocation;}
if(clickEventDescription.length>0){clickEventId+=":linkDescription="+clickEventDescription;}
var s=s_gi(s_account);s.linkTrackEvents="event2";s.linkTrackVars="eVar1,products,events";s.events="event2";s.eVar1=clickEventId;s.products=$("#omniProduct").val();void(s.tl(this,"o",clickEventDescription+"Link Click"));customHWSCookie+=clickEventFlag;document.cookie="omniHWSData="+customHWSCookie+";path=/";}},setHWSClickEventTrackingId:function(clickEventFlag,clickEventlocation,clickEventdescription){if(clickEventFlag.length>0&&customHWSCookie.match(clickEventFlag)==null){var clickEventId="uri=HWS Section";if(clickEventlocation.length>0){clickEventId+=":loc="+clickEventlocation;}
if(clickEventdescription.length>0){clickEventId+=":linkDescription="+clickEventdescription;}
setTrackingCookie(clickEventId,"uri");customHWSCookie+=clickEventFlag;document.cookie="omniHWSData="+customHWSCookie+";path=/";}},sendExpandFlyoutTrackingData:function(eventName,offerId){var flyoutCookieFlag="HWSFlyoutFlag*";if(eventName.length>0&&customHWSCookie.match(flyoutCookieFlag)==null){var s=s_gi(s_account);s.linkTrackEvents="event24";s.linkTrackVars="prop29,products,events";s.events="event24";s.products=$("#omniProduct").val();s.prop29=eventName;if(offerId.length>0){s.linkTrackVars+=",eVar23";s.eVar23=offerId;}
void(s.tl(this,"o",eventName));customHWSCookie+=flyoutCookieFlag;document.cookie="omniHWSData="+customHWSCookie+";path=/";}},buttonProcessOmniCookie:function(){var hwsSearch="";var searchType="";if(customCookie.match("hwsSearchType")){hwsSearch=customCookie.substring(customCookie.indexOf("hwsSearchType"));hwsSearch=hwsSearch.substring(0,hwsSearch.indexOf("*")+1);}
if(this.href&&URL.match("hotels/hotel-rooms")&&this.href.match("/hotels/checkAvailability.mi?")){var availabilitySearchCompletedMARSHA="";var thisMarsha=$("#omniProduct").val().substring(1);if(customCookie.match("availabilitySearchComplete")){var searchedMarshaStart=customCookie.indexOf("availabilitySearchComplete")+26;availabilitySearchCompletedMARSHA=customCookie.substring(searchedMarshaStart);var searchedMarshaEnd=availabilitySearchCompletedMARSHA.indexOf("*");availabilitySearchCompletedMARSHA=availabilitySearchCompletedMARSHA.substring(0,searchedMarshaEnd);}
if(availabilitySearchCompletedMARSHA!=thisMarsha){if(hwsSearch!=""){customCookie=customCookie.replace(hwsSearch,"hwsSearchTypeRoom*");}
else{customCookie+="hwsSearchTypeRoom*";}}}else if(this.href&&this.href.match("/hotels/continueReservation.mi")){if(hwsSearch!=""){customCookie=customCookie.replace(hwsSearch,"hwsSearchTypeContinue*");}
else{customCookie+="hwsSearchTypeContinue*";}}
document.cookie="omniData="+customCookie+";path=/";},hwsProcessOmniCookie:function(){if(customCookie.match("hwsCrossSell")){s.events+=",event64";customCookie=customCookie.replace("hwsCrossSell*","");document.cookie="omniData="+customCookie+";path=/";}}};}();
