616 lines
332 KiB
Plaintext
616 lines
332 KiB
Plaintext
raptor.defineModule("com.ebay.raptor.vi.AjaxUtil",function(){return{getJSON:function(b,a,c,e,f){var d=null;b&&(d=$.getJSON(b+"&"+(f?f:"cb")+"=?",function(){a&&a.apply(c,arguments)}));d&&e&&d.always(function(){e.apply(c,arguments)})},extractInlineCss:function(b){var a=document.createElement("style");a.type="text/css";a.styleSheet?a.styleSheet.cssText=b:a.appendChild(document.createTextNode(b));document.getElementsByTagName("head")[0].appendChild(a)},loadScripts:function(b,a,c){b?c?$.ajax({url:a,dataType:"script",
|
|
cache:!0,success:c}):$.ajax({url:a,dataType:"script",cache:!0}):(b=document.createElement("script"),b.type="text/javascript",b.text=a,document.getElementsByTagName("head")[0].appendChild(b))}}});raptor.defineClass("ui.InlineFeedbackLink",function(){return{init:function(){var c=$("#"+this._id);if("true"==c.find("#epconfigured").val()){var d=encodeURIComponent(c.find("#srvName").val()),a=c.find("#linkcontent").val();c.find("#surveylink").html(a);var a=c.find("#domSubmit")[0],b;a.contentDocument?b=a.contentDocument:a.contentWindow?b=a.contentWindow.document:window.frames.domSubmit&&(b=window.frames.domSubmit.document);b&&(b.open(),a=c.find("#surveyDiv")[0],b.write(a.innerHTML),b.close());a=
|
|
c.find("#surveytld").val();if(!a||"null"==a||"undefined"==a)a=location.hostname.lastIndexOf("."),a=0>a?"com":location.hostname.substring(a+1,location.hostname.length);a="https://qu.ebay."+a+"/survey?srvName=";b.getElementById("surveyForm").setAttribute("action",a+d);c.find("#surveylink").click(function(){var a=document.getElementsByTagName("html")[0].innerHTML,a="<html>"+a+"</html>";b.getElementById("domContent").value=encodeURIComponent(a);b.getElementById("pageUrlHidden").value=encodeURIComponent(location.href);
|
|
var a=Math.round((screen.height-800)/2),c=Math.round((screen.width-800)/2);window.open("","eBaySurvey","top="+a+",left="+c+",height=800px,width=800px,toolbar=no,menubar=no,scrollbars=yes, resizable=no,location=no, status=no");b.getElementById("surveyForm").submit()})}}}});raptor.defineClass("ebay.viewItem.Incentives",function(){return{init:function(a){this.conf=a;this.ajaxUtil=raptor.require("com.ebay.raptor.vi.AjaxUtil");this.pubsub=raptor.require("pubsub");a.isRewardsCall&&this.makeRewardsCall()},makeRewardsCall:function(){var a=this.conf;a.rewardsUrl&&this.ajaxRequest(a.rewardsUrl+"&item="+a.itemId+"&cguid="+a.cguid)},ajaxRequest:function(a){this.ajaxUtil.getJSON(a,this.processResponse,this)},processResponse:function(a){var b=this.conf;if(a){a.css&&this.ajaxUtil.extractInlineCss(a.css);
|
|
if(!a.eBayIncentiveOfferMsg){b.isShowNectarPoints||b.isShowVoucher?(a.nectarMainMsg&&this.paintHtml(a.nectarMainMsg,b.rewardsDiv),a.nectarOverlayContent&&($("#vi-inc-nector-msg").html(a.nectarOverlayContent),this.pubsub.publish("_BIND_OLAY",{cmpId:"vi-inc-nector-msg-oly",trigger:"nectarDetails"})),a.voucherOverlayContent&&($("#vi-inc-nector-voucher-msg").html(a.voucherOverlayContent),this.pubsub.publish("_BIND_OLAY",{cmpId:"vi-inc-nector-voucher-msg-oly",trigger:"vouchershowmehow"}))):a.ebayBucksMsg&&
|
|
b.isRewardsJSON&&this.paintHtml(a.ebayBucksMsg,b.rewardsDiv);if(a.bmlPromotionMsg){var c=a.bmlPromotionMsg.replace('/aw/pics/payments/bml/logoBML_77x18.gif" height="18" width="77"','/aw/pics/logos/logoPaypalCredit_160x55.png" height" height="29" width="82"',"g");this.paintHtml(c,b.bmlDiv);c=$(".bmloff_cont").html();this.paintHtml(c,b.ppcDiv)}a.ebayIncentivesMsg&&(this.paintHtml(a.ebayIncentivesMsg,b.couponDiv),a.ebayOverlayIncentiveMsg&&($("#vi-inc-coupn-msg").html(a.ebayOverlayIncentiveMsg),this.pubsub.publish("_BIND_OLAY",
|
|
{cmpId:"vi-inc-cpn-msg",trigger:"couponshowmehow"})))}if(a.bmlPromotionMsg||a.ebayIncentivesMsg||a.ebayBucksMsg||a.nectarMainMsg)this.showIncentivesDiv(),$(document).trigger("vi_modules_loaded",["vi_loy",!0]);this.pubsub.publish("_INCENTIVES_RETURNED");this.attachIncentivesClickEvents()}},paintHtml:function(a,b){$("#"+b).html(a)},showIncentivesDiv:function(){$("#"+this.conf.incentiveDiv).show()},attachIncentivesClickEvents:function(){var a=this;$("#downArrow").click(function(){a.toggleRewardsDetailsDiv()});
|
|
$("#upArrow").click(function(){a.toggleRewardsDetailsDiv()});$("#rwrdMoreLnk").click(function(){a.toggleRewardsDetailsDiv()})},toggleRewardsDetailsDiv:function(){$("#textDiv").toggle();$("#detailsDiv").toggle()}}});raptor.defineModule("com.ebay.raptor.vi.SMEUtil",function(){return{init:function(a){this.conf=a},processResponse:function(a,b){if(b){var c=raptor.require("com.ebay.raptor.vi.AjaxUtil");c&&(this.loadCss(b,c),this.loadHtml(b),this.loadScript(b,c),$(window).trigger("resize"),$(document).trigger("vi_modules_loaded",["vi_sme",!0]))}},loadHtml:function(a){var b=this.conf;a.nodes&&0<a.nodes.length&&(a.nodes[0]&&(2==b.bannerPosition?$("#sme_module_placement_2").html(a.nodes[0]):$("#promotionsCntr").html(a.nodes[0])),
|
|
a.nodes[1]&&(b.isShowRedesignBanner?($("#AdPanel").css("height","auto"),$("#AdPanel").html(a.nodes[1])):$("#vi_sme_prmts_bnr_cntr").html(a.nodes[1])))},loadCss:function(a,b){if(a.styles&&0<a.styles.length)for(var c=0;c<a.styles.length;c++){var d=a.styles[c];d.rules?b.extractInlineCss(d.rules):d.href&&$("<link/>",{rel:"stylesheet",type:"text/css",href:d.href}).appendTo("head")}},loadScript:function(a,b){if(a.scripts&&0<a.scripts.length)for(var c=0;c<a.scripts.length;c++){var d=a.scripts[c];d.src?b.loadScripts(!0,
|
|
d.src):d.text&&b.loadScripts(!1,d.text)}}}});raptor.defineModule("com.ebay.raptor.vi.SMEBanner",function(){return{init:function(){$("a.smeOfferMsg, a.smeOfferLink").on("click",function(){var a={};a.sid=$(this).is(".smeOfferMsg")?"p2047675.m2197.l9090":"p2047675.m2197.l9091";a.itemid=this.dataset.itemid;a.boid=this.dataset.boid;a.boty=this.dataset.boty;$(document).trigger("rover",a)});$(".vi-auth-content .vi-auth-link").on("click",function(){trackingUtil("VI_AUTH_LEARN_MORE")})}}});raptor.defineClass("ebay.viewItem.sme",function(){return{init:function(b){var a=this;a.conf=b;a.pubsub=raptor.require("pubsub");a.pubsub&&a.pubsub.subscribe("SME_BIN_INTERRUPT",function(b){a.triggerSMEBinInterruptLayer(b)},a);b.url&&a.makePromotionsCall()},makePromotionsCall:function(){$.ajax({url:this.getURLWithLayoutParams()+"&cb=this.raptor.require('com.ebay.raptor.vi.SMEUtil').processResponse",dataType:"script",async:!0,context:this})},getURLWithLayoutParams:function(){var b=this.conf,a="1200",
|
|
c="940";b.redesign?a=c=parseInt($("body").css("width")):(a=parseInt($("#Body").css("max-width")),c=parseInt($("#Body").css("min-width")));return b.url+"&minw="+c+"&maxw="+a},triggerSMEBinInterruptLayer:function(b){var a=this.conf;"true"==$("#sme_vi_interrupt_inp").attr("value")?(this.intLayerEvtBinded||this.bindInterruptLayerEvents(b),this.pubsub.publish("_OPEN_OLAY",{cmpId:a.binIntLayerId})):this.pubsub.publish("BYPASS_SME_BIN_INTERRUPT",{binBtnId:b.binBtnId,isSMEInterrupt:!1})},bindInterruptLayerEvents:function(b){var a=
|
|
this,c=a.conf;$("#"+c.binIntLayerBinLnkId).bind("click",function(){a.pubsub.publish("BYPASS_SME_BIN_INTERRUPT",{binBtnId:b.binBtnId,isSMEInterrupt:!1})});$("#"+c.binIntLayerClsBtnId).bind("click",function(){a.pubsub.publish("_CLOSE_OLAY",{cmpId:c.binIntLayerId})});a.intLayerEvtBinded=!0}}});raptor.defineClass("ebay.viewItem.AddToList",function(){return{init:function(a){var b=this;b.conf=a;b.openDropDown=!1;b.ListIsWatch=!1;b.isWatchDisabled=a.atwDisabled;b.watchfull=a.watchListFull;b.pubsub=raptor.require("pubsub");b.ajaxUtil=raptor.require("com.ebay.raptor.vi.AjaxUtil");b.msgs=raptor.require("com.ebay.raptor.vi.MsgHandler");b.watchVariant=a.watchVariant;b.useVariant=0<b.watchVariant;if(b.pubsub){b.pubsub.subscribe(b.msgs("ADD_TO_WATCH_LNK"),function(a){b.handleWatchLinkClick(a)},b);
|
|
b.pubsub.subscribe(b.msgs("TRIGGER_REMOVE_SVC_ID"),function(a){b.removeFromList(a)},b);var c;try{c=raptor.require("com.ebay.raptor.vi.topmessagepanel.ListPanel")}catch(d){}b.isTopListPanel=c?!0:!1;a.msku?b.pubsub.subscribe("MSKU_USER_LIST_UPDATE",function(a){b.handleMskuUpdates(a)},b):b.isTopListPanel&&b.triggerTopListPanel(!1);b.pubsub.publish(b.msgs("VALIDATE_LIST_MODULE_READY"),{});this.pubsub.subscribe("MSKU_UPDATE_WATCHERS",function(b){this.mskuVarWatchersUpdate(a,b)},this);this.pubsub.subscribe("MSKU_RESET_WATCHERS",
|
|
function(){var b=$(a.watchersElmSelector).parent().hasClass("vi-default-watchhot");this.mskuVarWatchersUpdate(a,{watchCount:a.defaultWatchCount,showWatchCount:!0,isHot:b})},this)}b.handlrBinded||b.bindHandlr()},mskuVarWatchersUpdate:function(a,b){if(b.showWatchCount&&1<=b.watchCount){var c=1<b.watchCount?a.watchersLabel:a.watcherLabel,c=c.replace("-1",b.watchCount);$(a.watchersElmSelector).html(c);b.isHot?$(a.watchersElmSelector).parent().addClass("ap-watchCount-hot"):($(a.watchersElmSelector).parent().removeClass("ap-watchCount-hot"),
|
|
$(a.watchersElmSelector).parent().addClass("ap-watchCount"));$(a.watchersElmSelector).show()}else $(a.watchersElmSelector).html("")},handleMskuUpdates:function(a){var b=this.conf,c=[];a.isWatched?(this.disableWatchList(),c.push({listId:b.watchListId,listName:b.watchName,isWatchList:!0,isWishList:!1,listURL:b.myEbayWatchListUrl})):this.watchfull||this.enableWatchList();this.updateVariationAndLists(a,c);this.isTopListPanel&&this.triggerTopListPanel(!0,c)},triggerTopListPanel:function(a,b){var c=this.conf,
|
|
d=c.isUserSignedIn?!0:!1;if(a)this.pubsub.publish("STATUS_PANEL_LIST_SVC_INIT",{listDetails:b,isOnLoad:!0,isMSKU:!0,isSignedIn:d});else{for(var b=[],e=c.userListModel.listMenus,h="",f=!1,g=0;g<e.length;g++)e[g].disabled&&(e[g].watchList?!e[g].full&&!c.isItemEnded&&b.push({listId:e[g].listId,listName:e[g].listName,isWatchList:!0,isWishList:!1,listURL:c.myEbayWatchListUrl}):(h=c.myEbayOtherListBaseUrl+"&tagname="+e[g].listName+"&tagId="+e[g].listId,f=e[g].listId==c.wishListId?!0:!1,b.push({listId:e[g].listId,
|
|
listName:e[g].listName,isWatchList:!1,isWishList:f,listURL:h})));this.pubsub.publish("STATUS_PANEL_LIST_SVC_INIT",{listDetails:b,isOnLoad:!0,isMSKU:!1,isSignedIn:d})}},updateVariationAndLists:function(a,b){var c=this.conf;this.variationId=a.variationId;var d=c.userListModel.listMenus,e="",h=!1;if(this.variationId)for(var f=0;f<d.length;f++)if(!d[f].watchList&&(e=c.userListModel.variationMap,null!=e)){if(null==e[this.variationId])this.disableEnableList(d[f].listId,!1,!1);else{var g=!1;0<=jQuery.inArray(d[f].listId,
|
|
e[this.variationId])&&(g=!0);this.disableEnableList(d[f].listId,g,!1);g&&(e=c.myEbayOtherListBaseUrl+"&tagname="+d[f].listName+"&tagId="+d[f].listId,h=d[f].listId==c.wishListId?!0:!1,b.push({listId:d[f].listId,listName:d[f].listName,isWatchList:!1,isWishList:h,listURL:e}))}this.disableEnableList(d[f].listId,g,!1)}return b},updateVariationMap:function(a,b){var c=this.conf,d=c.userListModel.variationMap;a&&(c.msku&&this.variationId&&(b?null!=d&&0<=jQuery.inArray(a,d[this.variationId])&&d[this.variationId].splice($.inArray(a,
|
|
d[this.variationId]),1):null!=d?(null==d[this.variationId]&&(d[this.variationId]=[]),d[this.variationId].push(a)):(d={},d[this.variationId]=[a])),this.conf.userListModel.variationMap=d)},bindHandlr:function(){this.handlrBinded=!0;this.bindTriggerEvent()},bindTriggerEvent:function(){var a=this,b=a.conf;$("#"+b.atlBtnId).click(function(b){a.handleAddToWatchButtonClick(b);return!1});$("#"+b.atlArrId).click(function(b){a.toggleDropDown(b);$(document).trigger("rover",{sid:"p2047675.l9162"})});$("#"+b.drpdwnListId).click(function(b){a.handleDropdownClick(b)});
|
|
$("#atl_-99").click(function(){$(document).trigger("rover",{sid:"p2047675.l9113",isWatching:!1,type:"dropdown"})});a.useVariant&&$("#atl_arr a").focus(function(b){$(window).keydown(function(d){32===d.which&&(d.preventDefault(),a.toggleDropDown(b))})});b.isWatchHeartEnabled&&($("#"+b.atlBtnId).on("mouseenter",".watch-show-overlay",function(){a.pubsub.publish("_OPEN_OLAY",{cmpId:"addToWatchToolTip",trigger:"atl_btn"})}),$("#"+b.atlBtnId).on("mouseleave",".watch-show-overlay",function(){a.pubsub.publish("_CLOSE_OLAY",
|
|
{cmpId:"addToWatchToolTip"})}));b.addToNewDisabled?$("#"+b.atnId).bind("click",function(b){a.toggleDropDown(b)}):($("#"+b.atnId).bind("click",function(){a.showCreateNewOverlay()}),a.attachAddToNewListEvents())},handleAddToWatchButtonClick:function(a){this.conf.isWatchHeartEnabled&&this.pubsub.publish("_CLOSE_OLAY",{cmpId:"addToWatchToolTip"});this.isWatchDisabled?($(document).trigger("rover",{sid:"p2047675.l9113",isWatching:!0,type:"button"}),this.useVariant?this.pubsub.publish("TRIGGER_LIST_REMOVE",
|
|
{watchOnly:!0}):this.toggleDropDown(a)):($(document).trigger("rover",{sid:"p2047675.l9113",isWatching:!1,type:"button"}),a=a.target||a.srcElement,a.href&&(this.listElemId=a.id),this.addToWatch())},handleWatchLinkClick:function(a){a.status?a.addRequest?this.addToWatch(!0,a.watchLink):this.disableWatchList():this.watchfull||this.enableWatchList()},toggleDropDown:function(a){var b=this,c=b.conf;b.pubsub.publish("HIDE_DROPDOWN",{});b.openDropDown?($("#"+c.drpdwnLayerId).hide(),$("html").unbind("click",
|
|
function(){b.hideLayer()}),$("#"+c.drpdwnLayerId).unbind("click",function(a){a.stopPropagation()}),$("#"+c.atlArrId+" a").attr("aria-expanded","false"),b.openDropDown=!1):(b.pubsub.publish(b.msgs("FORCE_CLOSE_OVERLAY"),{hideOnly:!0}),$("#"+c.drpdwnLayerId).show(),b.checkDropDownWidth(),a.stopPropagation(),$("html").bind("click",function(){b.hideLayer()}),$("#"+c.drpdwnLayerId).bind("click",function(a){a.stopPropagation()}),$("#"+c.atlArrId+" a").attr("aria-expanded","true"),b.openDropDown=!0)},checkDropDownWidth:function(){var a=
|
|
this.conf;$.browser.msie&&8>$.browser.version&&$("#"+a.drpdwnLayerId).css({position:"relative",visibility:"hidden"});if(!this.useVariant){$("#"+a.drpdwnLayerId).css("width","auto");var b=$("#"+a.drpdwnLayerId).width();b<a.drpdwnMinWidth?b=a.drpdwnMinWidth:b>a.drpdwnMaxWidth&&(b=a.drpdwnMaxWidth);$("#"+a.drpdwnLayerId).width(parseInt(b));$("#"+a.atnId).css({"max-width":parseInt(b)-2,"white-space":"normal"})}$.browser.msie&&8>$.browser.version&&$("#"+a.drpdwnLayerId).css({position:"absolute",visibility:""})},
|
|
hideLayer:function(){var a=this.conf;this.openDropDown&&($("#"+a.drpdwnLayerId).hide(),this.openDropDown=!1)},handleDropdownClick:function(a){var b=this.conf,c=a.target||a.srcElement;if(!(this.useVariant&&c.parentNode.getAttribute("id")==b.atnId)){if("javascript:;"===c.href){var d=c.getAttribute("ds");if(d&&"true"!==d||!d)this.listElemId=c.id,c.getAttribute("i")==b.watchListId?this.addToWatch():this.addToList()}this.toggleDropDown(a)}},addToWatch:function(a,b){var c=this.conf;this.pubsub.publish("HIDE_DROPDOWN",
|
|
{});this.pubsub.publish(this.msgs("VALIDATE_MSKU_VARIATIONS"),{});this.pubsub.publish("ADD_TO_WATCH_TRIGGERED",{});var d="";if(a)d=this.variationId?b+"&var="+this.variationId+"&entityInfo="+this.variationId+"%5EVARIATION":b;else var d=this.variationId?c.addToWatchUrl+"&var="+this.variationId+"&entityInfo="+this.variationId+"%5EVARIATION":c.addToWatchUrl,e=$("#"+this.listElemId),d=d+"&tagId="+e.attr("i")+"&etn="+e.attr("n");if(!c.msku||c.msku&&this.variationId)c.isUserSignedIn?(this.isWatchRequest=
|
|
!0,this.sendRequest(d,c.isNewRaptorCmd),this.pubsub.publish(this.msgs("VARIATION_EDIT_WATCH_STATUS"),{variationId:this.variationId,variationWatched:!0}),this.setWatchersContent(1,parseInt($(this.conf.watchersElmSelector+" .vi-buybox-watchcount").html())||0)):top.location.href=d;c.msku&&!this.variationId&&this.pubsub.publish("LKDHDR_MOVETO_TOP",{ts:(new Date).getTime()});$("#atl_btn > a").focus()},addToList:function(){var a=this.conf,b="&_trsksid=";this.pubsub.publish(this.msgs("VALIDATE_MSKU_VARIATIONS"),
|
|
{});var c=$("#"+this.listElemId);c.attr("t")&&"wish"==c.attr("t")?(this.isWishRequest=!0,b+=a.wishListTrackingParam):b+=a.otherListTrackingParam;var d=this.variationId?a.myEbayBaseUrl+"&var="+this.variationId+"&entityInfo="+this.variationId+"%5EVARIATION":a.myEbayBaseUrl;a.wishListCSRFToken&&(d+="&srt="+a.wishListCSRFToken);d=d+"&tagId="+c.attr("i")+"&etn="+c.attr("n")+b;if(!a.msku||a.msku&&this.variationId)a.isUserSignedIn?(this.updateVariationMap(c.attr("i"),!1),this.sendRequest(d)):top.location.href=
|
|
d;$("#atl_btn > a").focus()},removeFromList:function(a){var b=this.conf;this.ListIsWatch=!1;var c=a.watchOnly?this.getRemoveFromWatchUrl(a.listDetails):this.getRemoveListURL(a.listDetails);c&&(a.watchOnly&&b.isDeleteWatchRaptorCmd?this.sendRequest(c,b.isDeleteWatchRaptorCmd,b.deleteAjaxCSRF):this.sendRequest(c),this.ListIsWatch&&($("#atl_btn > a").addClass("watch-show-overlay"),this.setWatchersContent(-1,parseInt($(this.conf.watchersElmSelector+" .vi-buybox-watchcount").html()))))},getRemoveFromWatchUrl:function(a){var b=
|
|
this.conf,c="";this.ListIsWatch=!0;this.enableWatchList();b.msku&&(this.pubsub.publish(this.msgs("VARIATION_EDIT_WATCH_STATUS"),{variationId:this.variationId,variationWatched:!1}),c+="&variationIds="+b.itemId+"."+this.variationId);a&&a[0]&&this.updateVariationMap(a[0].listId,!0);return b.removeFromWatchBaseUrl+c},getRemoveListURL:function(a){var b=this.conf,c="",d=!1,e=!0;if(a){1<a.length&&(e=!1);c=b.msku?c+("&entityId="+this.variationId+"&LineID=VariationId%5E"+b.itemId+"_"+this.variationId):c+("&entityId="+
|
|
b.itemId);e&&(c+="&tagId="+a[0].listId);for(var h=0;h<a.length;h++)a[h].isWatchList?(this.ListIsWatch=d=!0,this.enableWatchList(),b.msku&&this.pubsub.publish(this.msgs("VARIATION_EDIT_WATCH_STATUS"),{variationId:this.variationId,variationWatched:!1})):this.disableEnableList(a[h].listId,!1,!1),this.updateVariationMap(a[h].listId,!0);!e&&d?(this.ListIsWatch=!0,c+="&inwl=true"):!e&&!d&&(c+="&inwl=false")}return b.removeListUrl+c},sendRequest:function(a,b,c){var d=this,e=d.conf;b?$.ajax({url:a,dataType:"json",
|
|
cache:!1,beforeSend:function(a){a.setRequestHeader("srt",{toString:function(){return c?c:e.addAjaxCSRF}})},success:function(){d.processAjaxResponse.apply(d,arguments)}}):d.ajaxUtil.getJSON(a,d.processResponse,d)},processAjaxResponse:function(a){a&&this.processResponse(JSON.parse(a))},processResponse:function(a){if(a&&a.status){if(!a.listDetails[0]||!a.listDetails[0].listId)a.listDetails=eval(a.listDetails);switch(a.action){case 0:this.createNewListResponseHandler(a);break;case 1:this.isWatchRequest?
|
|
this.addToWatchResponseHandler(a):this.addToListResponseHandler(a)}}else this.errorMsg(a)},addToWatchResponseHandler:function(a){var b=this.conf,c=a.result,d=a.listDetails[0],e=b.isUserSignedIn?!0:!1;d.maxLimitReached&&this.handleListMaxError(d,!0);1==c||2==c||5==c?(this.disableWatchList(),e&&this.setWatchersContent(1,parseInt(a.watcherCount)),this.pubsub.publish(this.msgs("LIST_ADD_SVC_ID"),{listDetails:[{listId:d.listId,listName:d.listName,isWatchList:!0,isWishList:!1,listURL:b.myEbayWatchListUrl}],
|
|
isSignedIn:e}),this.isWatchRequest=!1):3==c&&this.disableWatchList(!0)},setWatchersContent:function(a,b){var c=b+a,d=1===c?d=this.conf.watcherLabel:this.conf.watchersLabel,d=d.replace("-1",c);1>c?$(this.conf.watchersElmSelector).html(""):isNaN(c)||$(this.conf.watchersElmSelector).html(d)},addToListResponseHandler:function(a){for(var b=this.conf,c=b.isUserSignedIn?!0:!1,d=[],e="",h=0;h<a.listDetails.length;h++){var f=a.listDetails[h];f.maxLimitReached&&this.handleListMaxError(f,!1);var g="";this.isWishRequest?
|
|
(this.disableEnableList(b.wishListId,!0,!1,b.addedToWishListTxt),g=$("div#"+b.drpdwnListId+'> ul > li >a[i="'+b.wishListId+'"]').parent(),e=b.myEbayOtherListBaseUrl+"&tagname="+f.listName+"&tagId="+f.listId,d.push({listId:f.listId,listName:f.listName,isWatchList:!1,isWishList:!0,listURL:e})):(this.disableEnableList(f.listId,!0,!1,b.statusMsgTxt.replace("$",this.limitCharText(a.listDetails[0].listName))),g=$("div#"+b.drpdwnListId+'> ul > li >a[i="'+f.listId+'"]').parent(),e=b.myEbayOtherListBaseUrl+
|
|
"&tagname="+f.listName+"&tagId="+f.listId,d.push({listId:f.listId,listName:f.listName,isWatchList:!1,isWishList:!1,listURL:e}));$($("#"+b.drpdwnListId+">ul").children()[0]).after(g)}this.pubsub.publish(this.msgs("LIST_ADD_SVC_ID"),{listDetails:d,isSignedIn:c});this.isWishRequest=!1},handleListMaxError:function(a,b){var c=this.conf,d="";this.isWishRequest?(d=$("div#"+c.drpdwnListId+'> ul > li >a[i="'+c.wishListId+'"]'),d.text(c.wishListFullTxt)):(d=$("div#"+c.drpdwnListId+'> ul > li >a[i="'+a.listId+
|
|
'"]'),b?(this.watchfull=!0,d.text(c.watchListFullTxt)):d.text(c.otherListFullTxt.replace("$",this.limitCharText(a.listName))))},disableWatchList:function(a){var b=this.conf;this.pubsub.publish(this.msgs("ADD_TO_WATCH_BTN"),{status:!0});this.disableEnableList(b.watchListId,!0,!0,a?b.watchListFullTxt:b.addedToWatchListTxt)},enableWatchList:function(a){this.disableEnableList(this.conf.watchListId,!1,!0,a);this.pubsub.publish(this.msgs("ADD_TO_WATCH_BTN"),{status:!1})},enableAllLists:function(){for(var a=
|
|
$("#atl_drpdwnListId>ul").find("li>a"),b=0;b<a.length;b++)this.disableEnableList($(a[b]).attr("i"),!1,!1)},disableEnableList:function(a,b,c,d){var e=this.conf,a=$("div#"+e.drpdwnListId+'> ul > li >a[i="'+a+'"]');if(b){if(c){this.isWatchDisabled=!0;b=e.atwAltCaption;e.isWatchHeartEnabled&&(b='<img src="'+e.heartAltUrl+'" alt="'+e.atwAltCaption+'">'+b);var h=3==this.watchVariant?" wide-width":"",h=this.useVariant?' class="btn btn-ter'+h+'"':"";$("#"+e.atlBtnId).html('<a href="javascript:;"'+h+">"+b+
|
|
"</a>");try{$("#vi_oly_atwlstovly .clz").trigger("click")}catch(f){}}a.attr("ds","true");a.attr("class","ul-ds");d&&(this.showStatusMsg(d),c&&this.pubsub.publish("ADD_TO_WATCH_MSG_STATUS_TRIGGERED",{display:!0}))}else c&&(this.isWatchDisabled=!1,d=e.btnDefDispName,e.isWatchHeartEnabled&&(d='<img src="'+e.heartUrl+'" alt="'+e.btnDefDispName+'">'+d),$("#"+e.atlBtnId+" > a").html(d)),a.removeAttr("ds","true"),a.removeClass("ul-ds"),$("#"+e.statusMsgId).hide(),c&&this.pubsub.publish("ADD_TO_WATCH_MSG_STATUS_TRIGGERED",
|
|
{display:!1})},showStatusMsg:function(a){var b=this.conf;this.useVariant||($("#"+b.statusMsgContId).html(a),$("#"+b.statusMsgId).show())},showCreateNewOverlay:function(){var a=this,b=a.conf;a.pubsub.publish(a.msgs("VALIDATE_MSKU_VARIATIONS"),{});if((!b.msku||b.msku&&a.variationId)&&b.addnewOverlayId)a.pubsub.publish("_OPEN_OLAY",{cmpId:b.addnewOverlayId}),$("#"+b.addtoNewDivErrId).hide(),$("#"+b.addtoNewDefErrId).hide(),$("#"+b.addtoNewRespErrId).hide();a.toggleDropDown();$("html").bind("click",function(){a.closeAddNewOverlay()});
|
|
$("#"+b.addnewOverlayId).bind("click",function(a){a.stopPropagation()})},attachAddToNewListEvents:function(){var a=this,b=a.conf;$("#"+b.addtoNewBtnId).click(function(){a.createNewListRequest()});$("#"+b.cancelBtnId).click(function(){a.closeAddNewOverlay()});$("#"+b.addtoNewInputId).focus(function(){a.toggleAddToNewListInputTxt(!0)});$("#"+b.addtoNewInputId).blur(function(){a.toggleAddToNewListInputTxt(!1)})},createNewListRequest:function(){var a=this.conf,b="&_trsksid="+a.otherListTrackingParam,
|
|
c=$("#"+a.addtoNewInputId);c.val()!=a.addtoNewInputTxt&&""!=$.trim(c.val())?(c=a.myEbayBaseUrl+"&tagName="+c.val(),this.variationId&&(c+="&var="+this.variationId+"&entityInfo="+this.variationId+"%5EVARIATION"),c+=b,a.wishListCSRFToken&&(c+="&srt="+a.wishListCSRFToken),this.sendRequest(c)):(c.val(a.addtoNewInputTxt),this.showDefCreatNewErr())},createNewListResponseHandler:function(a){for(var b=this.conf,c=b.isUserSignedIn?!0:!1,d=0,e=[],h="",f=0;f<a.listDetails.length;f++){var g=a.listDetails[f];if(g.itemAdded){var h=
|
|
this.listElemId="atl_"+g.listId,i=b.addtoReplaceTxt.replace("$",g.listName),i=this.limitCharText(i);b.msku&&this.variationId&&this.updateVariationMap(g.listId,!1);$($("#"+b.drpdwnListId+">ul").children()[0]).after("<li><a n="+g.listName+" i="+g.listId+" id="+h+" ds='true' class='ul-ds' href=javascript:;>"+i+"</a></li>");d++;h=b.myEbayOtherListBaseUrl+"&tagname="+g.listName+"&tagId="+g.listId;e.push({listId:g.listId,listName:g.listName,isWatchList:!1,isWishList:!1,listURL:h})}}this.pubsub.publish(this.msgs("LIST_ADD_SVC_ID"),
|
|
{listDetails:e,isSignedIn:c});b=1<d?b.statusMsgTxtMulti.replace("$",d):b.statusMsgTxt.replace("$",this.limitCharText(g.listName));this.closeAddNewOverlay();this.showStatusMsg(b);this.checkMaxLists(a.listCount)},checkMaxLists:function(a){var b=this,c=b.conf;a>=c.maxListsAllowed&&($("#"+c.atnId).unbind("click"),$("#"+c.atnId).bind("click",function(a){b.toggleDropDown(a)}),$("#"+c.atnId+">a").attr("ds","true"),$("#"+c.atnId+">a").addClass("atnDs"))},errorMsg:function(a){var b=this.conf;$("#"+b.addtoNewDivErrId).show();
|
|
$("#"+b.addtoNewDefErrId).hide();if(a.topErrorMsg){var c=$("#"+b.addtoNewRespErrId);c.html(a.topErrorMsg);c.show()}a.bottomErrorMsg&&($("#"+b.addtoNewBtmErrId).html(a.bottomErrorMsg),$("#"+b.addtoNewBtmErrId).show())},showDefCreatNewErr:function(){var a=this.conf;$("#"+a.addtoNewDivErrId).show();$("#"+a.addtoNewDefErrId).show();$("#"+a.addtoNewRespErrId).hide();$("#"+a.addtoNewBtmErrId).hide()},toggleAddToNewListInputTxt:function(){var a=this.conf,b=$("#"+a.addtoNewInputId);b.val()==a.addtoNewInputTxt?
|
|
b.val(""):""==b.val()&&b.val(a.addtoNewInputTxt)},limitCharText:function(a){var b=this.conf,c=b.charLimit;return a&&a.length>c?a.substring(0,c).concat(b.ellipses):a},closeAddNewOverlay:function(){var a=this,b=a.conf;$("#"+b.addtoNewInputId).val(b.addtoNewInputTxt);$("html").unbind("click",function(){a.closeAddNewOverlay()});a.pubsub.publish("_CLOSE_OLAY",{cmpId:b.addnewOverlayId});$("#atl_btn > a").focus()}}});raptor.defineClass("ebay.viewItem.AddToWatchLink",function(){return{init:function(a){var b=this;b.conf=a;b.pubsub=raptor.require("pubsub");b.ajaxUtil=raptor.require("com.ebay.raptor.vi.AjaxUtil");b.msgs=raptor.require("com.ebay.raptor.vi.MsgHandler");b.pubsub&&b.pubsub.subscribe(b.msgs("ADD_TO_WATCH_BTN"),function(a){b.toggleWatchLink(a.status)},b);b.attachClickEvent()},toggleWatchLink:function(a){var b=this.conf;a?$("#"+b.linkTopId).css("display","none"):$("#"+b.linkTopId).css("display","inline")},
|
|
attachClickEvent:function(){var a=this;$("#"+a.conf.linkTopId).click(function(){a.makeWatchRequest();return!1})},makeWatchRequest:function(){var a=this.conf;!a.userSignedIn&&a.ended&&(top.location.href=a.addToWatchUrl);this.pubsub.publish(this.msgs("ADD_TO_WATCH_LNK"),{status:!0,addRequest:!0,watchLink:a.addToWatchUrl})}}});raptor.defineClass("raptor.vi.BestOffer",function(){return{init:function(a){var b=this;b.cfg=a;b.pubsub=raptor.require("pubsub");b.ajaxUtil=raptor.require("com.ebay.raptor.vi.AjaxUtil");b.msgs=raptor.require("com.ebay.raptor.vi.MsgHandler");b.pubsub&&(b.pubsub.subscribe(b.msgs("BEST_OFFER_SVC_ID"),function(a){b.show(a)},this),b.pubsub.subscribe(b.msgs("REVIEW_OFFER_SVC_ID"),function(){b.openOly(a.mngQkBoUrl)},this),b.pubsub.channel(a.boOlyId).subscribe("_OLY_CLS_SVC",function(){b.onClose()},b));a.boOnLoad&&
|
|
$(document).ready(function(){b.openOly(a.mkQkBoUrl)})},openOly:function(a){this.pubsub.publish("_OPEN_OLAY",{cmpId:this.cfg.boOlyId});this.buildUrl(a)},show:function(a){var b=this.cfg;this.msg=a;if(b.mkQkBoSiUrl)return this.reloadParent(b.mkQkBoSiUrl),!1;this.pubsub.publish("_OPEN_OLAY",{cmpId:b.boOlyId});this.buildUrl("t"==b.isRO?b.mngQkBoUrl:b.mkQkBoUrl)},buildUrl:function(a){var b=this.cfg,c;"undefined"!==typeof this.msg&&(c=""!==this.msg.vQty?this.msg.vQty:"");""!==c&&(a+="&quantity="+c);b.pgVal&&
|
|
(a+="&pgv="+b.pgVal);this.request(a)},request:function(a){this.ajaxUtil.getJSON(a,this.response,this)},response:function(a){var b=this.cfg;if(a){if("REDIRECT"==a.status)return this.reloadParent(a.redirectUrl),!1;"SUCCESS"==a.status&&(a.cssUrls&&""!==a.cssUrls[0]?this.loadCss(a,b,this.handleJs):this.handleJs(a))}},loadCss:function(a,b,c){var d=this,b=$("#"+b.boTrbrId),e=document.createElement("link");e.type="text/css";e.rel="stylesheet";e.href=a.cssUrls[0];document.getElementsByTagName("head")[0].appendChild(e);
|
|
$.browser.msie&&8>=parseInt($.browser.version,10)&&b.addClass("js").removeClass("js");b=document.createElement("img");b.onerror=function(){c&&c(a,d)};b.src=a.cssUrls[0]},handleJs:function(a,b){var c;a.js&&""!==a.js&&(c=document.createElement("script"),c.type="text/javascript",c.text=a.js,document.getElementsByTagName("head")[0].appendChild(c));b.handleBOResponse(a)},reloadParent:function(a){var b;"undefined"!==typeof this.msg&&(b=""!==this.msg.vQty?this.msg.vQty:"");"undefined"!==typeof b&&""!==b&&
|
|
(a+="%26quantity="+b);top.location.href=a},handleBOResponse:function(a){var b=this.cfg,c=$("#"+b.boTrbrId),d=$("#"+b.boCntId);a.html&&""!==a.html&&d&&(c.hide(),d.html(a.html),this.pubsub.publish("_OPEN_OLAY",{cmpId:b.boOlyId}));handleBOLyrResponse(a)},onClose:function(){var a=window.location.href,a=a.replace(/&*boolp=1/,""),a=a.replace(/&*autorefresh=true/,""),a=a+(-1!=a.indexOf("?")?"&autorefresh=true":"?autorefresh=true");top.location=a}}});raptor.defineClass("com.ebay.raptor.vi.bid.BidLayer",function(){return{init:function(a){var b=raptor.require("pubsub");b&&(b.subscribe(a.svcId,function(c){if(c&&!c.isRedirect&&(c=this.getChild(a.overlayId))){c.show();try{$("#"+a.overlayId).parent().css("marginTop","-50px"),$("#"+a.overlayId).parent().parent().siblings(".clz").css("marginTop","-15px")}catch(b){}}},this),a.openOnLoad&&$(document).ready(function(){b.publish(a.invokeClkId,{})}))}}});raptor.defineClass("com.ebay.raptor.vi.bid.BidUtil",function(){var c=function(){};c.getItemData=function(a){var b;a&&(a[0]&&a[0].ViewItemLiteResponse&&a[0].ViewItemLiteResponse.Item&&a[0].ViewItemLiteResponse.Item[0])&&(b=a[0].ViewItemLiteResponse.Item[0],b.isAutoRefresh=!0);return b};c.timeLeftV=function(a){var b;a&&(b=function(a){var b=0;a&&(b=parseInt(a),b=isNaN(b)?0:b);return b},b={day:b(a.DaysLeft),hour:b(a.HoursLeft),minute:b(a.MinutesLeft),second:b(a.SecondsLeft)});return b};c.timeLeftFormat=
|
|
function(a,b,h,d){var f="",g,e,i;if(a){g=a.day;e=a.hour;i=a.minute;a=a.second;if(0<g){if(h=1===g?b.dayTxt:b.dayCharTxt,f+=c.appendTime(g,h,d&&1===g?!0:!1),0<e||d&&0===e)b=1===g?1===e?b.hourTxt:b.hoursTxt:b.hourCharTxt,f=d?f+c.appendTime(e,b,1===g?!0:!1,1===g?null:10,1<g&&0===e?!0:!1):f+c.appendTime(e,b,!1)}else f=h?f+(c.appendTime(e,b.hourCharTxt,!1,10,!1).trim()+c.appendTime(i,b.minuteCharTxt,!1,10,!1).trim()+c.appendTime(a,b.secondCharTxt,!1,10,!0).trim()):f+(c.appendTime(e,b.hourCharTxt,!1)+c.appendTime(i,
|
|
b.minuteCharTxt,!1,d&&1<=e&&0===i?0:null,d&&1<=e&&0===i?!0:!1)+c.appendTime(a,b.secondCharTxt,!1,null,!0)),(3>=e||h)&&$("#"+b.cssElemId).addClass(b.css);return f}};c.appendTime=function(a,b,h,d,c){h=h?" ":"";return(a||0===a&&c)&&!isNaN(a)&&(!c&&0<a||c)&&b?(d&&a<d&&(a="0"+a),a+=h+$("#"+b).html()+" "):""};c.decrementOneSec=function(a){var b,c,d;a&&(day=a.day||0,b=a.hour||0,c=a.minute||0,d=a.second||0,0<d?d-=1:0===d&&0<c?(c-=1,d=59):0===d&&0===c&&0<b?(b-=1,d=c=59):0===b&&(0===d&&0===c&&0<day)&&(day-=
|
|
1,b=23,d=c=59),a.second=d,a.minute=c,a.hour=b,a.day=day);return a};c.convertToSeconds=function(a){var b=0,c,d;a&&(b=a.day||0,c=a.hour||0,d=a.minute||0,a=a.second||0,b=86400*b+3600*c+60*d+a);return b};c.preload=function(a){$(a).each(function(){$("<img/>")[0].src=this})};return c});raptor.defineClass("com.ebay.raptor.vi.bid.Bid",function(){return{init:function(a){var b=this;b.pubsub=raptor.require("pubsub");b.util=raptor.require("com.ebay.raptor.vi.bid.Util");b.bidUtil=raptor.require("com.ebay.raptor.vi.bid.BidUtil");b.bidTimeLeft={};b.cfg=a;b.cfg.isGsp=!1;b.isBidTextDirty=!1;b.pubsub&&(b.pubsub.subscribe(a.svcId,function(a){b.bidClick(a)},b),b.pubsub.subscribe(a.counterSvcId,function(a){b.timeCounter(a)},b),b.pubsub.subscribe(a.autoRefreshSvcId,function(a){b.autoRefresh(a)},
|
|
b))},timeCounter:function(){var a;this.bidUtil&&(this.overlay&&this.overlay.showing)&&(a=this.bidUtil.decrementOneSec(this.getBidTimeLeft()),this.updateTimeLeft(a,!0))},startCounter:function(a,b,d){var c=this.cfg,b={TimeLeft:a,AccessedDate:b,ViewerItemRelation:d,DetailLevel:c.detailLevel};this.setBidTimeLeft(a);this.pubsub&&this.pubsub.publish(c.counterStartSvcId,b)},autoRefresh:function(a){a&&(this.overlay&&this.overlay.showing)&&this.processResponse(a)},bidVars:function(){var a=this.cfg;this.ajaxUtil=
|
|
raptor.require("com.ebay.raptor.vi.AjaxUtil");this.BidStatus=raptor.require("com.ebay.raptor.vi.bid.enums.BidStatus");this.BidError=raptor.require("com.ebay.raptor.vi.bid.enums.BidError");this.BidderStatus=raptor.require("com.ebay.raptor.vi.bid.enums.BidderStatus");this.button=this.getChild(a.bidBtnId);this.statusMsg=this.getChild(a.statusMsgId);this.overlay=this.getParent(a.overlayId)},toggleBidEvt:function(a,b){var d=this,c=d.cfg,e=c.enterBidId+c.value,f,g;b?(d.util.enablDisableBtn(d.button,!0),
|
|
$("#"+c.bidBtnId+c.btn).unbind("click.Bid"),$("#"+e).unbind("keypress.Bid"),d.isBidTextDirty=!1):(f=function(){d.triggerCall(a,e)},g=function(b){d.util.isEnterKey(b)&&d.triggerCall(a,e)},d.util.enablDisableBtn(d.button,!1),$("#"+c.bidBtnId+c.btn).bind("click.Bid",f),$("#"+e).bind("keypress.Bid",g))},subscribeOlyClose:function(){var a=this,b=a.cfg;if(a.overlay){var d=a.overlay.conf;d&&d.closeSvcId&&(a.olyCloseHandle=a.pubsub.channel(b.overlayId).subscribe(d.closeSvcId,function(){a.layerCleanUp(b.isRefreshOnClose,
|
|
b.refreshUrl)},a))}},updateCurrBid:function(a,b,d){var c=this.cfg;a&&(this.util.displayContent(c.curBidId,a.MoneyStandard,c.value,c.wrapper),d&&$("#"+c.curBidId+c.lable).html(d));this.updateApprox(b,c.curBidId)},updateApprox:function(a,b){var d=this.cfg,c;a&&(a.MoneyStandard&&b)&&(c=$("#"+d.approxTxt).html().replace(d.dummy,a.MoneyStandard),$("#"+b+d.approx).html(c).show())},setBidTimeLeft:function(a){self.bidTimeLeft=a},getBidTimeLeft:function(){return self.bidTimeLeft},updateCurrency:function(a){var b=
|
|
this.cfg;a&&$("#"+b.enterBidId+b.currencyId).html(a)},closeLayer:function(){this.overlay&&this.overlay.hide()},bidClick:function(){},triggerCall:function(){},processResponse:function(){},updateTimeLeft:function(){},layerCleanUp:function(){},removeMaxBidParam:function(a){if(a){var b=a.indexOf("?maxbid"),d=a.indexOf("&maxbid"),c=a.lastIndexOf("&");if(-1!==b)return c=a.substr(b+1),c=c.indexOf("&")+1,0===c?a.substr(0,b):a.substr(0,b+1)+a.substr(b+c+1,a.length);if(-1!==d){if(d==c)return a.substr(0,d);
|
|
c=a.substr(d+1);c=c.indexOf("&")+1;return a.substr(0,d)+a.substr(d+c,a.length)}}return a}}});raptor.defineClass("com.ebay.raptor.vi.bid.Counter",function(){return{init:function(b){var a=this,c;a.cfg=b;a.viewerItemRelationMap={NONE:0,OUTBIDDER:5,HIGHBIDDER:2};a.autoRefreshTime=0;a.pubsub=raptor.require("pubsub");a.bidUtil=raptor.require("com.ebay.raptor.vi.bid.BidUtil");a.ajaxUtil=raptor.require("com.ebay.raptor.vi.AjaxUtil");a.accessedDate=b.accessedDate;a.viewerItemRelation=b.viewerItemRelation;a.detailLevel=b.detailLevel;a.secondsLeft=0;a.pubsub.subscribe(b.timerSvcId,function(b){a.triggerAutoRefresh(b)},
|
|
a);a.pubsub.subscribe(b.counterStartSvcId,function(b){a.callStart(b)},a);a.pubsub.subscribe(b.counterStopSvcId,function(){a.stop()},a);a.pubsub.subscribe("_DESTROY_BID_TIMER",function(){a.stop()});if((0<b.timeLeftInMins||0<b.timeLeftInSec)&&(b.isUrgencyHigh||b.isUrgencyMedHigh||b.enableAFAlways))b.enableAFAlways&&a.triggerAutoRefresh(),c={minute:b.timeLeftInMins,second:b.timeLeftInSec},$(window).ready(function(){a.start(c);$(window).on("focus",function(){a.pubsub.publish(b.timerSvcId,{})})});a.busy=
|
|
!1;a.isSSEEnaInBrowser=!1;a.sseVal=a.cfg.sseVal?a.cfg.sseVal:0;a.sseOpen=!1;a.doTimeeRangeBroadcast=!1;0<a.sseVal&&(a.timeRangeBroadcast=b.timeRangeBroadcast?b.timeRangeBroadcast:0,a.isSSEEnaInBrowser=a.isSSEEnabledInBrowser(),a.timeRangeBroadcast&&(a.doTimeeRangeBroadcast=a.isSSEEnaInBrowser?!0:!1,a.pubsub.subscribe("_STOP_TIME_RANGE_REACHED",function(){a.doTimeeRangeBroadcast=!1},a),1<a.sseVal&&a.pubsub.subscribe("_SSE_RESPONSE",function(b){a.triggerAutoRefresh(b)},a),a.pubsub.subscribe("_BID_SSE_OPENED",
|
|
function(){a.sseOpen=!0},a),a.pubsub.subscribe("_BID_SSE_CLOSED",function(){a.resetSSE()},a),a.pubsub.subscribe("_BID_SSE_ERROR",function(){a.resetSSE()},a)))},callStart:function(b){var a;b&&(this.accessedDate=b.AccessedDate||this.accessedDate,b.ViewerItemRelation&&this.viewerItemRelationMap&&(a=this.viewerItemRelationMap[b.ViewerItemRelation]),this.viewerItemRelation=a||this.viewerItemRelation,this.detailLevel=b.DetailLevel||this.detailLevel,this.start(b.TimeLeft))},start:function(b){var a=this,
|
|
b=a.bidUtil.convertToSeconds(b);a.setSecondsLeft(b);a.isStartCounter(a.getSecondsLeft())?a.counterHandler||(a.counterHandler=window.setInterval(function(){a.counter()},1E3)):a.stop()},stop:function(){var b=this.cfg;window.clearInterval(this.counterHandler);this.counterHandler=null;b.timerStopSvcId&&this.pubsub.publish(b.timerStopSvcId,{})},counter:function(){var b=this.getSecondsLeft()-1;this.setSecondsLeft(b);this.autoRefreshTime++;this.doTimeeRangeBroadcast&&b<=this.timeRangeBroadcast&&this.pubsub.publish("_TIME_RANGE_REACHED",
|
|
{});this.isAutoRefresh(b)&&!this.isSSEActive()?this.triggerAutoRefresh():this.triggerCounterSvc();0>=b&&this.stop()},triggerCounterSvc:function(){this.pubsub.publish(this.cfg.counterSvcId,{})},isStartCounter:function(b){var a=this.cfg;return 0!==b&&(b<=60*a.counterStartFromInMins||a.enableAFAlways)?!0:!1},isAutoRefresh:function(b){var a=this.cfg,c,g,d,h,f,e;if(a.autoRefreshEnabled){if(0===b)return this.triggerCounterSvc(),!0;if(a.enableAFAlways){if(this.calCIntvl&&(e=Math.ceil(b/60),this.accInt=Math.round(Number(Math.pow(e,
|
|
a.afIntervalPower))*a.afIntervalFraction),this.accInt<a.afIntervalResetValue&&(this.accInt=a.afIntervalResetValue),this.calCIntvl=!1),this.autoRefreshTime===this.accInt)return!0}else if(c=60*a.slowDurationInMins,g=a.slowIntervalInSecs,d=60*a.fastDurationInMins,h=a.fastIntervalInSecs,f=60*a.accelerateDurationInMins,e=Math.ceil(b/60),a=Math.round(Math.pow(a.accelerationBase,e)*a.accelerationRatio),b>d&&b<c&&this.autoRefreshTime===g||b<=f&&0===b%60||b<f&&b>d&&this.autoRefreshTime===a||b<=d&&this.autoRefreshTime>=
|
|
h)return!0}return!1},triggerAutoRefresh:function(b){var a=this.cfg.autoRefreshURL;a&&!this.busy&&(this.busy=!0,a+=-1!==a.indexOf("?")?"&":"?",b&&b.sse?(this.sse=!0,a+=$.param({lastaccessed:this.accessedDate||"",lvr:this.viewerItemRelation,dl:this.detailLevel,sse:b.sse})):a+=$.param({lastaccessed:this.accessedDate||"",lvr:this.viewerItemRelation,dl:this.detailLevel}),this.triggerCall(a),this.autoRefreshTime=0,this.calCIntvl=!0)},triggerCall:function(b){this.ajaxUtil.getJSON(b,this.autoRefresh,this,
|
|
this.alwaysCallback)},alwaysCallback:function(){this.busy=!1},autoRefresh:function(b){var a=this.cfg;response=this.bidUtil.getItemData(b);this.busy=!1;response&&this.pubsub&&(response.fastDurationInMins=a.fastDurationInMins,this.sse&&(response.sse=!0,this.sse=!1),this.pubsub.publish(a.autoRefreshSvcId,response))},getSecondsLeft:function(){return this.secondsLeft},setSecondsLeft:function(b){return this.secondsLeft=0>b?0:b},isSSEActive:function(){return 3==this.sseVal&&this.sseOpen?!0:!1},resetSSE:function(){this.busy=
|
|
this.sseOpen=!1},isSSEEnabledInBrowser:function(){return"undefined"!==typeof EventSource?!0:!1}}});raptor.defineClass("com.ebay.raptor.vi.bid.Util",function(){var c=function(){};c.updateStatusMsg=function(a,b){if(-1!==a&&b)switch(a){case 0:b.error();break;case 1:b.notice();break;case 2:b.warning();break;case 3:b.confirm()}};c.enablDisableBtn=function(a,b){a&&(b?a.disable():a.enable())};c.displayContent=function(a,b,d,c){a&&b&&($("#"+a+d).html(b),$("#"+a+c).show())};c.rmvEvt=function(a){if(a)for(var b=0,c=a.length;b<c;b++)a[b]&&$("#"+a[b]).unbind()};c.isEnterKey=function(a){return a&&13==a.keyCode};
|
|
c.showHide=function(a,b){if(a)for(var c=0,e=a.length;c<e;c++)a[c]&&(b?$("#"+a[c]).show():$("#"+a[c]).hide())};c.helpPopup=function(a){var b=screen.width-430;a&&(a=window.open(a,"help","width=420,height=550,scrollbars=yes,status=no,toolbar=no,location=no,resizable=yes,top=0,screenY=0,left="+b+",screenX="+b))&&a.focus();return!1};return c});raptor.defineEnum("com.ebay.raptor.vi.bid.enums.BidError","INVALID_BIDAMOUNT LOW_BIDAMOUNT INVALID_BIDAMOUNT_OF_HIGH_BIDDER BUYER_BLOCKED_NO_LINKED_PAYPAL_ACCOUNT BID_GREATER_THAN_BIN DECSEP REDIRECT REFRESH AUCTION_ENDED OFFER_AMOUNT_ZERO".split(" "));raptor.defineEnum("com.ebay.raptor.vi.bid.enums.BidStatus","PLACEBID REVIEWBID CONFIRMBID LEGAL ENDED ACTIVE".split(" "));raptor.defineEnum("com.ebay.raptor.vi.bid.enums.BidderStatus",["OUTBIDDER","HIGHBIDDER"]);raptor.defineClass("com.ebay.raptor.vi.bid.oneclick.OneClickBid",{superclass:"com.ebay.raptor.vi.bid.Bid"},function(){var g=function(a){var b=this,c;g.superclass.init.apply(b,arguments);if(c=document.getElementById(a.learnMoreId))c.onclick=function(){b.util&&b.util.helpPopup(c.href);return!1}};g.prototype={bidClick:function(a){var b=this,c=b.cfg,e;g.superclass.bidVars.apply(b);a&&(e=a.isRedirect);$("#"+c.enterBidId+c.value).click(function(){b.isBidTextDirty=!0});$("#"+c.enterBidId+c.value).keydown(function(){b.isBidTextDirty=
|
|
!0});b.triggerCall(c.bidInitURL,null,e);$("#"+c.updateId+c.btn).click(function(){b.triggerUpdateData(c.updateURL)})},triggerUpdateData:function(a){var b=this.cfg;this.ajaxUtil&&a&&(a+=-1!==a.indexOf("?")?"&":"?",a+=$.param({lastaccessed:this.accessedDate||"",lvr:this.viewerItemRelation,dl:this.detailLevel||b.detailLevel}),this.ajaxUtil.getJSON(a,this.updateData,this))},updateData:function(a){(a=this.bidUtil.getItemData(a))&&g.superclass.autoRefresh.apply(this,[a])},triggerCall:function(a,b,c){b=$("#"+
|
|
b).val();a&&this.ajaxUtil&&(b&&(a=a+"&"+$.param({maxbid:b})),c?top.location.href=a:(this.ajaxUtil.getJSON(a,this.processResponse,this),g.superclass.toggleBidEvt.apply(this,["",!0])))},processResponse:function(a){var b=this.cfg,c,e,d,f,h;if(a)if((c=this.BidError.valueOf(a.Error))&&c==this.BidError.REDIRECT)top.location.href=a.ErrorUrl;else{a.fastDurationInMins&&(this.fastDur=60*a.fastDurationInMins);e=this.BidStatus.valueOf(a.Status);d=this.BidderStatus.valueOf(a.ViewerItemRelation);f=a.IsReserve;
|
|
h=a.IsReserveMet;if(e===this.BidStatus.LEGAL)this.setLegal(a);else if(e==this.BidStatus.ENDED||a.IsEnded)this.setEnded(a,d,f,h);else if(e==this.BidStatus.ACTIVE||a.isAutoRefresh)this.setActive(a,c,d,f,h);else return;!a.isAutoRefresh&&(!a.Error&&a.ROIUrls)&&this.bidUtil.preload(a.ROIUrls);a.isAutoRefresh||(this.pubsub.publish(b.olySvcId,{}),this.olyCloseHandle||g.superclass.subscribeOlyClose.apply(this))}},layerCleanUp:function(a,b){var c=this.cfg;this.util.rmvEvt([c.enterBidId+c.value,c.bidBtnId+
|
|
c.btn,c.updateId+c.btn,c.closeId+c.value]);this.olyCloseHandle&&(this.olyCloseHandle.unsubscribe(),this.olyCloseHandle=null);a&&b&&(top.location.href=b)},setLegal:function(){},setEnded:function(a,b,c,e){var d=this.cfg,f=$("#"+d.winningBidTxt).html(),h=[d.timeLeftId+d.wrapper,d.enterBidId+d.wrapper,d.disclaimerId];g.superclass.updateCurrBid.apply(this,[a.CurrentPrice,a.LocalCurrentPrice,f]);this.endedItemStatus(b,c,e,a.IsSold);this.updateMaxBid(a);this.util.showHide(h,!1);this.showCloseBtn(d.closeId,
|
|
$("#"+d.closeTxt).html())},endedItemStatus:function(a,b,c,e){var d=this.cfg,f,h=-1,g;if(a){if(a===this.BidderStatus.HIGHBIDDER&&!b||a==this.BidderStatus.HIGHBIDDER&&b&&c)f=d.AUCTION_ENDED_WINNER,h=3,g=d.successClz;else if(a===this.BidderStatus.OUTBIDDER&&!b)f=d.AUCTION_ENDED_OUTBID,h=2,g=d.warningClz;else if((a===this.BidderStatus.OUTBIDDER||a===this.BidderStatus.HIGHBIDDER)&&b&&!c)f=d.AUCTION_ENDED_RESERVE_NOT_MET,h=1,e||(a=$("#"+d.startingBidTxt).html())&&$("#"+d.curBidId+d.lable).html(a);this.showStatus(f,
|
|
h,g)}},showCloseBtn:function(a,b){var c=this,e=c.cfg,d;$("#"+a+e.value).remove();d=$(document.createElement("input")).attr({id:a+e.value,type:"button",value:b});$("#"+a+e.wrapper).append(d).show();$("#"+a+e.value).click(function(){g.superclass.closeLayer.apply(c)})},setActive:function(a,b,c,e,d){var f=this.cfg;b?this.updateBidAmtError(b):this.activeItemStatus(c,e,d,a.isAutoRefresh);b=this.bidUtil.timeLeftV(a.TimeLeft);this.updateTimeLeft(b);this.accessedDate=a.AccessedDate;this.viewerItemRelation=
|
|
a.ViewerItemRelation;g.superclass.startCounter.apply(this,[b,a.AccessedDate,a.ViewerItemRelation]);g.superclass.updateCurrBid.apply(this,[a.CurrentPrice,a.LocalCurrentPrice]);this.updateMaxBid(a);this.updateIncreaseBid(a,c);a.isAutoRefresh||g.superclass.toggleBidEvt.apply(this,[f.bidURL,!1]);this.fastDur&&this.fastDur>this.bidUtil.convertToSeconds(b)?$("#"+f.updateId+f.btn).css({visibility:"hidden"}):$("#"+f.updateId+f.btn).css({visibility:"visible"})},activeItemStatus:function(a,b,c,e){var d=this.cfg,
|
|
f,g=-1,i;a===this.BidderStatus.HIGHBIDDER&&!b?(f=d.HIGHBIDDER_STATUS,g=3,i=d.successClz):a===this.BidderStatus.HIGHBIDDER&&b&&c?(f=d.HIGHBIDDER_STATUS,g=3,i=d.successClz):a===this.BidderStatus.HIGHBIDDER&&b&&!c?(f=d.HIGHBIDDER_RESERVE_NOT_MET_STATUS,g=1):a===this.BidderStatus.OUTBIDDER&&(f=d.OUTBIDDER_STATUS,g=2,i=d.warningClz);if(!this.prevBidderStatus||this.prevBidderStatus&&e)i=null;this.showStatus(f,g,i);this.prevBidderStatus=a},updateBidAmtError:function(a){var b=this.cfg,c,e=b.errorClz;a===
|
|
this.BidError.LOW_BIDAMOUNT?c=b.MIN_BID_ERROR_STATUS:a===this.BidError.OFFER_AMOUNT_ZERO?c=b.MIN_BID_ERROR_STATUS:a===this.BidError.INVALID_BIDAMOUNT_OF_HIGH_BIDDER?c=b.HIGH_BID_ERROR_STATUS:a===this.BidError.INVALID_BIDAMOUNT&&(c=b.MAKE_BID_ERROR_STATUS);this.showStatus(c,0,e)},showStatus:function(a,b,c){var e=this.cfg;a&&-1!==b&&(this.util.updateStatusMsg(b,this.statusMsg),this.util.displayContent(e.statusMsgId,$("#"+a).html(),e.value,e.wrapper),this.showFlash(b,c))},showFlash:function(a,b){var c=
|
|
this.cfg,e=c.statusMsgId+c.value;b&&($("#"+e).addClass(b),setTimeout(function(){$("#"+e).removeClass(b)},1E3))},updateTimeLeft:function(a){var b=this.cfg,c,e,d,f="";a&&(c=a.day,e=a.hour,d=a.minute,a=a.second,dayTxt=1===c?b.dayTxt:b.daysTxt,hourTxt=1===e?b.hourTxt:b.hoursTxt,minuteTxt=1===d?b.minuteTxt:b.minutesTxt,secondTxt=1===a?b.secondTxt:b.secondsTxt,0<c?f+=this.bidUtil.appendTime(c,dayTxt,!0)+this.bidUtil.appendTime(e,hourTxt,!0):0===c&&(0<e?f+=this.bidUtil.appendTime(e,hourTxt,!0)+this.bidUtil.appendTime(d,
|
|
minuteTxt,!0):0===e&&(f+=this.bidUtil.appendTime(d,minuteTxt,!0)+this.bidUtil.appendTime(a,secondTxt,!0))),this.util.displayContent(b.timeLeftId,f,b.value))},updateMaxBid:function(a){var b=this.cfg,c=a.MaximumBid;a.IsAdminView||(c&&this.util.displayContent(b.reviewBidId,c.MoneyStandard,b.value,b.wrapper),g.superclass.updateApprox.apply(this,[a.MaximumBidLocal,b.reviewBidId]))},updateIncreaseBid:function(a,b){var c=this.cfg,e,d=a.MinimumToBid,f;a.IsAdminView||(e=a.MaxBidPlusOneIncrement,b===this.BidderStatus.HIGHBIDDER&&
|
|
e?f=e.CleanAmount:d&&(f=d.CleanAmount),f&&(!$("#"+c.enterBidId+c.value).is(":focus")&&!this.isBidTextDirty)&&$("#"+c.enterBidId+c.value).val(f),$("#"+c.enterBidId+c.wrapper).show());d&&g.superclass.updateCurrency.apply(this,[d.CurrencySymbol])}};return g});raptor.defineClass("com.ebay.raptor.vi.bid.placebid.PlaceBid",{superclass:"com.ebay.raptor.vi.bid.Bid"},function(){var e=function(a){e.superclass.init.apply(this,arguments)};e.prototype={bidClick:function(a){var b=this.cfg,c,d;e.superclass.bidVars.apply(this);a&&(c=a.maxbid,this.shipping=a.shipping,this.impCharge=a.impCharge,d=a.isRedirect);c=c?c:b.maxBidDefVal;this.triggerCall(b.bidInitURL,c,!0,d)},triggerCall:function(a,b,c,d){if(a){this.hideAll();this.throbber(!0);if(this.maxBidAmt=b=c&&b?b:$("#"+
|
|
b).val())d?(c=-1!==a.indexOf("?")?"&":"?",c+=$.param({maxbid:b}),a+=encodeURIComponent(c)):(a+=-1!==a.indexOf("?")?"&":"?",a+=$.param({maxbid:b}));d?top.location.href=a:this.ajaxUtil&&(this.ajaxUtil.getJSON(a,this.processResponse,this),e.superclass.toggleBidEvt.apply(this,["",!0]))}},processResponse:function(a){var b=this,c=b.cfg,d;if(a&&(d=b.BidError.valueOf(a.Error),!d||!b.isRedirectErrors(d,a.ErrorUrl)))a.IsEnded?setTimeout(function(){e.superclass.closeLayer.apply(b)},2500):(a.isAutoRefresh||($("#"+
|
|
c.enterBidId+c.value).val(""),b.throbber(!1)),c=b.BidStatus.valueOf(a.Status),a.isAutoRefresh&&b.status&&(c=b.status),c&&(b.defaultFields(a),c==b.BidStatus.PLACEBID?b.placeBid(a):c==b.BidStatus.REVIEWBID?b.reviewBid(a):c==b.BidStatus.CONFIRMBID&&b.confirmBid(a),a.isAutoRefresh||b.attachLayerEvt(c),b.status=c),b.updateBidAmtError(d))},placeBid:function(a){var b=this.cfg;$("#"+b.bidTitleId).html($("#"+b.placeBidTxt).html());$("#"+b.enterBidId+b.lable).html($("#"+b.yourMaxBidTxt).html());this.updateMinToBid(a);
|
|
$("#"+b.enterBidId+b.wrapper).show();$("#"+b.grayArea).show();$("#"+b.nextStepId).show()},reviewBid:function(a){var b=this.cfg;$("#"+b.bidTitleId).html($("#"+b.reviewBidTxt).html());a.isAutoRefresh||this.updateImportCharge();a.MaximumBid&&!a.isAutoRefresh&&(this.util.displayContent(b.reviewBidId,a.MaximumBid.MoneyStandard,b.value,b.wrapper),$("#"+b.enterBidId+b.value).val(a.MaximumBid.CleanAmount),e.superclass.updateApprox.apply(this,[a.MaximumBidLocal,b.reviewBidId]));a.IsAdminView&&$("#"+b.reviewBidId+
|
|
b.wrapper).show();$("#"+b.grayArea).show();this.cfg.isGsp?$("#"+b.disclaimerGspId).show():$("#"+b.disclaimerId).show()},confirmBid:function(a){var b=this.cfg;$("#"+b.bidTitleId).html($("#"+b.confirmBidTxt).html());a.MaximumBid?this.util.displayContent(b.reviewBidId,a.MaximumBid.MoneyStandard,b.value,b.wrapper):this.BidderStatus.valueOf(a.ViewerItemRelation)==this.BidderStatus.OUTBIDDER&&$("#"+b.reviewBidId+b.value).html()&&$("#"+b.reviewBidId+b.wrapper).show();$("#"+b.enterBidId+b.lable).html($("#"+
|
|
b.incMaxBidTxt).html());this.updateMinToBid(a);$("#"+b.enterBidId+b.wrapper).show();$("#"+b.grayArea).show();this.confirmBidMsg(a);!a.isAutoRefresh&&a.ROIUrls&&this.bidUtil.preload(a.ROIUrls)},defaultFields:function(a){var b;b=a.isAutoRefresh&&!a.TimeLeft?this.bidUtil.timeLeftV({}):this.bidUtil.timeLeftV(a.TimeLeft);this.updateTimeLeft(b);e.superclass.startCounter.apply(this,[b,a.AccessedDate,a.ViewerItemRelation]);this.updateShipping();e.superclass.updateCurrBid.apply(this,[a.CurrentPrice,a.LocalCurrentPrice])},
|
|
updateImportCharge:function(){var a=this.cfg,b=$("#"+this.impCharge).css("display");b&&"none"!=b?(this.cfg.isGsp=!0,b=$("#"+a.defaultImpChargeTxt).html(),$("#"+a.impChBidTxtId+a.value).hide(),$("#"+a.impChBidTxtId+a.value+"Err").hide(),this.util.displayContent(a.impChId,b,a.value,a.wrapper),new (raptor.require("com.ebay.raptor.vi.shipping.CalculateImportCharge"))({impChIdLink:a.impChId+"Lnk",maxBidAmt:this.maxBidAmt,impChIdCnt:a.impChId+a.value,calcImportChargeUrl:a.calcImportChargeUrl,impChBidTxtId:a.impChBidTxtId+
|
|
a.value})):this.cfg.isGsp=!1},updateShipping:function(){var a=this.cfg,b=this.shipping;b||(b=$("#"+a.defaultShpTxt).html());this.util.displayContent(a.shippingId,b,a.value,a.wrapper)},updateTimeLeft:function(a,b){var c=this.cfg,d="";$("#"+c.timeLeftId+c.value).removeClass(c.lessTimeCss);a&&(formatCfg={dayTxt:c.dayTxt,dayCharTxt:c.dayCharTxt,hourTxt:c.hourTxt,hoursTxt:c.hoursTxt,hourCharTxt:c.hourCharTxt,minuteCharTxt:c.minuteCharTxt,secondCharTxt:c.secondCharTxt,cssElemId:c.timeLeftId+c.value,css:c.lessTimeCss},
|
|
d=this.bidUtil.timeLeftFormat(a,formatCfg,!1,c.enableAFAlways),b?this.util.displayContent(c.timeLeftId,d,c.value):this.util.displayContent(c.timeLeftId,d,c.value,c.wrapper))},updateMinToBid:function(a){if(!a.IsAdminView){var b=this.cfg,c="",d,f=this.BidderStatus.valueOf(a.ViewerItemRelation),g=a.MaximumBid,h=a.MinimumToBid;f&&f===this.BidderStatus.HIGHBIDDER&&g?(d=b.minBidHBTxt,c=g.MoneyStandard):h&&(d=b.minBidTxt,c=h.MoneyStandard);$("#"+b.enterBidId+b.min).html($("#"+d).html().replace(b.dummy,c)).show();
|
|
e.superclass.updateApprox.apply(this,[a.LocalCurrentPrice,b.curBidId]);a.MinimumToBid&&e.superclass.updateCurrency.apply(this,[a.MinimumToBid.CurrencySymbol])}},attachLayerEvt:function(a){var b=this,c=b.cfg,d=c.enterBidId+c.value,f=c.bidBtnId+c.link;if(a){$("#"+f).unbind();var g=function(a,b,d){$("#"+a+c.btn).val($("#"+b).html());$("#"+a+c.link).html($("#"+d).html())};a==b.BidStatus.PLACEBID?(g(c.bidBtnId,c.placeBtnTxt,c.cancelTxt),e.superclass.toggleBidEvt.apply(b,[c.placeBidURL,!1]),$("#"+f).bind("click",
|
|
function(){e.superclass.closeLayer.apply(b)})):a==b.BidStatus.REVIEWBID?(g(c.bidBtnId,c.confirmBtnTxt,c.changeTxt),e.superclass.toggleBidEvt.apply(b,[c.confirmBidURL,!1]),$("#"+f).bind("click",function(){b.triggerCall(c.bidInitURL,null)})):a==b.BidStatus.CONFIRMBID&&(g(c.bidBtnId,c.increaseBtnTxt,c.closeTxt),e.superclass.toggleBidEvt.apply(b,[c.bidAgainURL,!1]),$("#"+f).bind("click",function(){e.superclass.closeLayer.call(b)}));$("#"+c.bidBtnId+c.wrapper).show();b.olyCloseHandle||e.superclass.subscribeOlyClose.apply(b);
|
|
$("#"+d).focus()}},confirmBidMsg:function(a){var b=this.cfg,c,d=-1,e=this.BidderStatus.valueOf(a.ViewerItemRelation);e&&(e==this.BidderStatus.OUTBIDDER?(c=b.OUTBIDDER,d=0):e==this.BidderStatus.HIGHBIDDER&&(d=3,c=a.IsReserve&&!a.IsReserveMet?b.HIGHBIDDER_RESERVE_NOT_MET:a.IsFirstBid?b.HIGHBIDDER_FIRST:a.IsOneMaxBidAway?b.HIGHBIDDER_1_MAX_BID_AWAY:this.lessThanHour(a.TimeLeft)?b.HIGHBIDDER_60_MIN_LEFT:b.HIGHBIDDER),c&&-1!==d&&(this.util.updateStatusMsg(d,this.statusMsg),this.util.displayContent(b.statusMsgId,
|
|
$("#"+c).html(),b.value,b.wrapper)))},isRedirectErrors:function(a,b){return a===this.BidError.REDIRECT?(top.location.href=b,!0):a===this.BidError.REFRESH||a===this.BidError.AUCTION_ENDED?(e.superclass.closeLayer.apply(this),!0):!1},updateBidAmtError:function(a){var b=this.cfg,c,d=-1;a===this.BidError.DECSEP?(c=b.DECSEP,d=0):a===this.BidError.INVALID_BIDAMOUNT?(c=b.INVALID_BIDAMOUNT,d=0):a===this.BidError.LOW_BIDAMOUNT?(c=b.LOW_BIDAMOUNT,d=0):a===this.BidError.INVALID_BIDAMOUNT_OF_HIGH_BIDDER?(c=b.INVALID_BIDAMOUNT_OF_HIGH_BIDDER,
|
|
d=0):a===this.BidError.BUYER_BLOCKED_NO_LINKED_PAYPAL_ACCOUNT?(c=b.BUYER_BLOCKED_NO_LINKED_PAYPAL_ACCOUNT,d=1):a===this.BidError.BID_GREATER_THAN_BIN&&(c=b.BID_GREATER_THAN_BIN,d=1);c&&-1!==d&&(this.util.updateStatusMsg(d,this.statusMsg),this.util.displayContent(b.statusMsgId,$("#"+c).html(),b.value,b.wrapper))},throbber:function(a){var b=this.cfg;this.util.showHide([b.loadingId,b.resumeBidId],a)},hideAll:function(){var a=this.cfg;this.util.showHide([a.loadingId,a.resumeBidId,a.statusMsgId+a.wrapper,
|
|
a.timeLeftId+a.wrapper,a.shippingId+a.wrapper,a.impChId+a.wrapper,a.curBidId+a.wrapper,a.reviewBidId+a.wrapper,a.enterBidId+a.wrapper,a.confirmBidId+a.wrapper,a.bidBtnId+a.wrapper,a.grayArea,a.disclaimerId,a.disclaimerGspId,a.nextStepId],!1)},lessThanHour:function(a){if((a=this.bidUtil.timeLeftV(a))&&!(0<a.day||1<a.hour))if(!(1===a.hour&&(1<a.minute||1<a.second)))return!0;return!1},layerCleanUp:function(a,b){var c=this.cfg,c=[c.bidBtnId+c.btn,c.bidBtnId+c.link,c.enterBidId+c.value];this.util&&(this.util.rmvEvt(c),
|
|
this.olyCloseHandle&&(this.olyCloseHandle.unsubscribe(),this.olyCloseHandle=null));if(a&&b){var d=this.removeMaxBidParamPlacebid(b);setTimeout(function(){top.location.href=d},1)}},removeMaxBidParamPlacebid:function(a){return e.superclass.removeMaxBidParam.apply(this,arguments)}};return e});raptor.defineClass("raptor.vi.BinLayer",function(){return{init:function(a){var b=this;b.cfg=a;b.pubsub=raptor.require("pubsub");b.ajaxUtil=raptor.require("com.ebay.raptor.vi.AjaxUtil");b.msgs=raptor.require("com.ebay.raptor.vi.MsgHandler");b.pubsub&&(b.pubsub.subscribe(b.msgs("BIN_SVC_ID"),function(a){b.show(a)},this),b.pubsub.channel(a.binOlyId).subscribe("_OLY_CLS_SVC",function(){b.onClose()},b));a.binOnLoad&&$(document).ready(function(){b.openOly(a.mkQkBinUrl)})},openOly:function(a){this.pubsub.publish("_OPEN_OLAY",
|
|
{cmpId:this.cfg.binOlyId});this.buildUrl(a)},show:function(a){var b=this.cfg,c;this.msg=a;if(b.mkQkBinSiUrl)return b=b.mkQkBinSiUrl,"undefined"!==typeof a.dcl&&a.dcl&&(b+="%26fdcl=1"),this.reloadParent(b),!1;""!==b.mapPCOlyId&&this.pubsub.publish("_CLOSE_OLAY",{cmpId:b.mapPCOlyId});c=b.mkQkBinUrl;"undefined"!==typeof a.dcl&&a.dcl&&(c=b.mkQkBinDclUrl);this.pubsub.publish("_OPEN_OLAY",{cmpId:b.binOlyId});this.buildUrl(c)},buildUrl:function(a){var b=this.cfg,c;"undefined"!==typeof this.msg?(c=""!==this.msg.vQty?
|
|
this.msg.vQty:"",b=""!==this.msg.vId?this.msg.vId:""):(c="undefined"!==typeof b.selQty&&""!==b.selQty?b.selQty:"",b="undefined"!==typeof b.selVarId&&""!==b.selVarId?b.selVarId:"");a+=""!==c?"&quantity="+c:"&quantity=1";""!==b&&(a+="&var="+b);this.request(a)},request:function(a){this.ajaxUtil.getJSON(a,this.response,this)},response:function(a){var b=this.cfg;if(a){if("REDIRECT"==a.status)return this.reloadParent(a.redirectUrl),!1;"SUCCESS"==a.status&&(a.cssUrls&&""!==a.cssUrls[0]?this.loadCss(a,b,
|
|
this.handleJs):this.handleJs(a))}},loadCss:function(a,b,c){var d=this,b=$("#"+b.binTrbrId),e=document.createElement("link");e.type="text/css";e.rel="stylesheet";e.href=a.cssUrls[0];document.getElementsByTagName("head")[0].appendChild(e);$.browser.msie&&8>=parseInt($.browser.version,10)&&b.addClass("js").removeClass("js");b=document.createElement("img");b.onerror=function(){c&&c(a,d)};b.src=a.cssUrls[0]},handleJs:function(a,b){var c;a.js&&""!==a.js&&(c=document.createElement("script"),c.type="text/javascript",
|
|
c.text=a.js,document.getElementsByTagName("head")[0].appendChild(c));b.handleBINResponse(a)},reloadParent:function(a){var b=this.cfg,c;"undefined"!==typeof this.msg?(c=""!==this.msg.vQty?this.msg.vQty:"",b=""!==this.msg.vId?this.msg.vId:""):(c="undefined"!==typeof b.selQty&&""!==b.selQty?b.selQty:"",b="undefined"!==typeof b.selVarId&&""!==b.selVarId?b.selVarId:"");a+=""!==c?"%26quantity="+c:"%26quantity=1";""!==b&&(a+="%26var="+b);top.location.href=a},handleBINResponse:function(a){var b=this.cfg,
|
|
c=$("#"+b.binTrbrId),d=$("#"+b.binCntId);a.html&&""!==a.html&&d&&(c.hide(),d.html(a.html),this.pubsub.publish("_OPEN_OLAY",{cmpId:b.binOlyId}));handleBinLyrResponse(a)},onClose:function(){var a=window.location.href,a=a.replace(/&*biolp=1/,"");-1!=a.indexOf("&iqrsp=1")&&(a=a.replace(/&*iqrsp=1/,""));a=a.replace(/&*autorefresh=true/,"");a+=-1!=a.indexOf("?")?"&autorefresh=true":"?autorefresh=true";top.location=a}}});raptor.defineClass("com.ebay.raptor.vi.bid.placebid.Emailtheseller",function(){return{init:function(a){var b=this;b.conf=a;b.YMMServiceCallURL=a.YMMServiceCallURL;b.ELFDataSubmitURL=a.ELFDataSubmitURL;b.isFsbo=a.isFsbo;b.isSignedIn=a.isSignedIn;b.ELFUserId=a.ELFUserId;b.ELFSellerId=a.ELFSellerId;b.itemNumber=a.itemNumber;b.timeLeft=a.timeLeft;b.saleEndTime=a.saleEndTime;b.saleEndTimeString=a.saleEndTimeString;b.sellerPhoneNum=a.sellerPhoneNum;b.handlrBinded=!1;$("#slrCntctNum").text(function(){var a=
|
|
b.sellerPhoneNum[0],a=a.replace(/[^0-9]/g,"");return a.replace(/(\d{3})(\d{3})(\d{4})/,"$1 $2 $3")});$("#emailBtn_btn").bind("click",function(d){var c=$(".elf-form");d.preventDefault();if(d=b.getChild(a.overlayId))c.removeClass("error"),c.find(".notification").addClass("hidenotif"),c.find(":text").val(""),c.find(":checked").removeAttr("checked"),c.find("textarea").val("Enter your question here..."),c.find("#valueRem").text(1E3),d.show(),$("#elf-form-send").attr("tabindex","16"),b.buildTime(),b.FillinDetails(),
|
|
$("#YMM")&&$("#YMM").hide();b.handlrBinded||b.bindHandlr()})},bindHandlr:function(){this.handlrBinded=!0;this.bindTriggerEvents()},YMMResponse:function(a){var b=this;$.getJSON(a+"&cb=?",function(a){"SUCCESS"===a.status.name&&"null"!=a.data&&(a=a.data,a[0].Make&&(b.reviseMake(),$.each(a[0].Make,function(b,a){$("#slctMake").append($("<option></option>").attr("value",a).text(a))}),b.reviseModel()),a[0].Model&&(b.reviseModel(),$.each(a[0].Model,function(b,a){$("#slctModel").append($("<option></option>").attr("value",
|
|
a).text(a))})))})},buildUrlForYMM:function(a){var b=this.YMMServiceCallURL,b=b.replace(/&/g,"&");this.YMMResponse(b+("&"+a),"Year")},reviseMake:function(){$("#slctMake").empty();var a=new Option("option text","value");$(a).html("Any");$("#slctMake").append(a)},reviseModel:function(){$("#slctModel").empty();var a=new Option("option text","value");$(a).html("Any");$("#slctModel").append(a)},refreshCaptcha:function(){$.ajax({type:"GET",url:"Motors/ELF/RefreshCaptcha",dataType:"json",success:function(a){a=
|
|
jQuery.parseJSON(a);a.imageURL&&$("#captchaImageURL").attr("src",a.imageURL)}})},saveELFData:function(a){var b=this;b.showThrobber();var d=b.itemNumber,c=null,e=null,g=null;b.isSignedIn?((c=b.ELFDataSubmitURL)&&0!=c.length&&(c=c.replace(/&/g,"&")),c+="itemNumber="+d+"&"+a):c="itemNumber="+d+"&"+a;c&&0!=c.length&&(c=c.replace(/ /g,"+"));var c=c+"&Ajax=true",f=!0;b.isSignedIn?(e=c+"&callback=?",c="",g="jsonp",f=!0):null!=document.getElementById("captchaImageURL")&&(c+="&captchaImageURL="+$("#captchaImageURL").attr("src"),
|
|
e="Motors/ELF/SubmitData",g="json",f=!1);$.ajax({type:"GET",url:e,data:c,dataType:g,success:function(a){f?"null"!=a.success&&b.postResponseSuccess():(a=jQuery.parseJSON(a),"null"!=a.success&&a.success&&b.postResponseSuccess(),"null"!=a.imageUrl&&b.postResponseCaptchaRefresh(a))}}).error(function(){b.closeOverlay();b.showErrorOnCloseOverlay()})},postResponseSuccess:function(){this.closeOverlay();for(var a={},b=location.search.substring(1),d=/([^&=]+)=([^&]*)/g,c;c=d.exec(b);)a[decodeURIComponent(c[1])]=
|
|
decodeURIComponent(c[2]);a.confirmvalue="1";a.EmbeddedLeadForm="confirm";location.search=$.param(a)},postResponseCaptchaRefresh:function(a){$("#throbber_elf").hide();$(".elf-form").show();$("#captchastring").val("");$("#captchaImageURL").attr("src",a.imageURL);$(this).parent("div").addClass("error");$("#captchaerror2").css("display","block")},closeOverlay:function(){this.pubsub.publish("_CLOSE_OLAY",{cmpId:this.conf.overlayId});$(".elf-form-wrapper").find(".form_price span").remove()},showThrobber:function(){$(".elf-form").hide();
|
|
$("#throbber_elf").show()},showErrorOnCloseOverlay:function(){for(var a={},b=location.search.substring(1),d=/([^&=]+)=([^&]*)/g,c;c=d.exec(b);)a[decodeURIComponent(c[1])]=decodeURIComponent(c[2]);a.confirmvalue="0";a.EmbeddedLeadForm="confirm";location.search=$.param(a)},buildTime:function(){var a=this.timeLeft,b=Math.floor(a/86400),d=Math.floor(a%86400/3600),c=Math.floor(a%86400%3600/60),a=a%86400%3600%60,e=null,g=null,f=null,h=null,i=null,g=(10>b&&0!=b?"0"+b:b)+"d ",f=(10>d&&0!=d?"0"+d:d)+"h ",
|
|
h=(10>c&&0!=c?"0"+c:c)+"m ",i=(10>a&&0!=a?"0"+a:a)+"s ";0<b&&(e=g,e+=f);0==b&&0<d&&(e=f,e+=h);0==b&&(0==d&&0<c)&&(e=h,e+=i);0==b&&(0==d&&0==c&&0<a)&&(e=i);$("#timeLeftid").html(e)},FillinDetails:function(){var a=this;$("#elf-form-send").on("click",function(){if(a.ELFUserId==a.ELFSellerId)a.closeOverlay(),a.showErrorOnCloseOverlay();else{var b="",d=$(".elf-form .required").length,c=0;$(".elf-form .required").each(function(){""===$.trim($(this).val())?($(this).parent("div").addClass("error"),$(this).next(".notification").removeClass("hidenotif")):
|
|
("firstNameId"===$(this).attr("id")||"lastNameId"===$(this).attr("id"))&&!1===/^[A-Za-z ]+$/.test($(this).val())?($(this).parent("div").addClass("error"),$(this).next(".notification").removeClass("hidenotif")):"emailAddressId"===$(this).attr("id")&&!1===/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/.test($(this).val())?($(this).parent("div").addClass("error"),$(this).next(".notification").removeClass("hidenotif")):"zipCodeId"===$(this).attr("id")&&!1===/^[0-9]{5}(?:-[0-9]{4})?$/.test($(this).val())?
|
|
($(this).parent("div").addClass("error"),$(this).next(".notification").removeClass("hidenotif")):"phoneNumId"===$(this).attr("id")&&!1===/^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/.test($(this).val())?($(this).parent("div").addClass("error"),$(this).next(".notification").removeClass("hidenotif")):"elf_Additionalcomment"===$(this).attr("id")&&"Enter your question here..."==$(this).val()?($(this).parent("div").addClass("error"),$(this).next(".notification").removeClass("hidenotif")):($(this).parent("div").removeClass("error"),
|
|
$(this).next(".notification").addClass("hidenotif"),b=b+$(this).attr("name")+"="+encodeURIComponent($(this).val())+"&",c++,c==d&&($(".elf-form .notRequired").each(function(){var a=$(this).attr("id");$("#"+a).is(":checkbox")&&(b=$("#"+a).is(":checked")?b+($(this).attr("name")+"=Y&"):b+($(this).attr("name")+"=N&"));$("#"+a).is("select")&&$("#"+a).is(":enabled")&&(a=document.getElementById(a),a=a.options[a.selectedIndex].text,"Any"!=a&&(b+=$(this).attr("name")+"="+a+"&"));$("#"+$(this).attr("id")).is("textarea")&&
|
|
(a="","Enter your question here..."!=$(this).val()&&(a=$(this).val()),b+=$(this).attr("name")+"="+a+"&")}),b=b.substring(0,b.length-1),a.saveELFData(b)))})}});a.pubsub=raptor.require("pubsub");$("#elf-form-ovl_cancel").on("click",function(b){var d=a.conf;b.stopImmediatePropagation();a.pubsub.publish("_CLOSE_OLAY",{cmpId:d.overlayId});$(".elf-form-wrapper").find(".form_price span").remove()})},bindTriggerEvents:function(){var a=this;$(".imp").on("blur",function(){var a=$(this).attr("id"),d=$("#"+a).val().trim();
|
|
$("#"+a).val(d);if("firstNameId"==a||"lastNameId"==a)!0===/^[A-Za-z ]+$/.test($(this).val())?($(this).parent("div").removeClass("error"),$(this).next(".notification").addClass("hidenotif")):($(this).parent("div").addClass("error"),$(this).next(".notification").removeClass("hidenotif"));"emailAddressId"==a?!0===/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/.test($(this).val())?($(this).parent("div").removeClass("error"),$(this).next(".notification").addClass("hidenotif")):($(this).parent("div").addClass("error"),
|
|
$(this).next(".notification").removeClass("hidenotif")):"zipCodeId"==a?!0===/^[0-9]{5}(?:-[0-9]{4})?$/.test($(this).val())?($(this).parent("div").removeClass("error"),$(this).next(".notification").addClass("hidenotif")):($(this).parent("div").addClass("error"),$(this).next(".notification").removeClass("hidenotif")):"phoneNumId"==a?!0===/^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/.test($(this).val())?($(this).parent("div").removeClass("error"),$(this).next(".notification").addClass("hidenotif")):
|
|
($(this).parent("div").addClass("error"),$(this).next(".notification").removeClass("hidenotif")):"captchastring"==a&&(""==$(this).val()?($(this).parent("div").addClass("error"),$(this).next(".notification").removeClass("hidenotif")):($(this).parent("div").removeClass("error"),$(this).next(".notification").addClass("hidenotif")))});$("#tradeIn").click(function(){$("#YMM").toggle()});$("#slctYear").change(function(){var b=$("#slctYear")[0],b=b.options[b.selectedIndex].text;"Any"!=b?$("#slctMake").prop("disabled",
|
|
!1):$("#slctMake").prop("disabled",!0);$("#slctModel").prop("disabled",!0);b="sfp=Year:"+b+"&rf=Make";a.buildUrlForYMM(b)});$("#elf_Additionalcomment").focusin(function(){"Enter your question here..."==$(this).val()&&$(this).val("");$(this).parent("div").hasClass("error")&&($(this).parent("div").removeClass("error"),$(this).next(".notification").addClass("hidenotif"))}).blur(function(){""==$(this).val()?($(this).val("Enter your question here..."),$(this).parent("div").addClass("error"),$(this).next(".notification").removeClass("hidenotif")):
|
|
($(this).parent("div").removeClass("error"),$(this).next(".notification").addClass("hidenotif"))});$("#elf_Additionalcomment").keyup(function(){var a=1E3-$("#elf_Additionalcomment").val().length;0>a?this.value=this.value.substring(0,1E3):$("#valueRem").text(a)});$("#firstNameId,#lastNameId,#emailAddressId").keyup(function(){0>63-$(this).val().length&&(this.value=this.value.substring(0,63))});$(".imp").focusin(function(){$(this).parent("div").hasClass("error")&&($(this).parent("div").removeClass("error"),
|
|
$(this).next(".notification").addClass("hidenotif"))});$("#slctMake").change(function(){var b=$("#slctMake")[0],b=b.options[b.selectedIndex].text;"Any"!=b?$("#slctModel").prop("disabled",!1):$("#slctModel").prop("disabled",!0);b="&sfp=Make:"+b+"&rf=Model";a.buildUrlForYMM(b)});$("#refreshCaptcha").click(function(){a.refreshCaptcha()})}}});raptor.defineClass("ebay.viewItem.Cart",function(){var c=!1;return{init:function(a){this.pubsub=raptor.require("pubsub");this.conf=a;this.olayCloseSvcId="_OLY_CLS_SVC";this.actionPanel=raptor.require("raptor.vi.ActionPanel");this.cookie=raptor.require("ebay.cookies");this.pubsub=raptor.require("pubsub");this.msgs=raptor.require("com.ebay.raptor.vi.MsgHandler");this.registerPubSubEvents(a);this.attachBtnClickEvent();this.attachMsgHandler()},registerPubSubEvents:function(a){this.pubsub.subscribe(this.msgs("HIDE_ADD_TO_CART_LINK"),
|
|
function(b){this.hideAddToCartLink(a,b.toHide)},this);this.pubsub.publish(this.msgs("VALIDATE_CART_MODULE_READY"),{});this.pubsub.subscribe("TRIGGER_CART_BTN",function(){$("#"+a.cartBtnId).trigger("click")},this);this.pubsub.subscribe(this.msgs("AUTO_REFRESH_DISABLE_BTN_SVC"),function(){c=!0;this.pubsub.publish("_VI_BTN_MSGS",{id:a.cartBtnId,isDisable:!0})},this)},hideAddToCartLink:function(a,b){b?($("#"+a.cartBtnId).show(),$("#"+a.cartBtnId).parent().show(),a.isATCRedesignLayerV1Active&&($("#"+a.cartBtnId).show(),
|
|
$("#vi-viewInCartBtn").hide()),$("#atcLnk").hide()):($("#"+a.cartBtnId).hide(),$("#"+a.cartBtnId).parent().hide(),a.isATCRedesignLayerV1Active&&($("#"+a.cartBtnId).hide(),$("#vi-viewInCartBtn").show()),$("#atcLnk").show())},attachBtnClickEvent:function(){var a=this,b=a.conf,d={qtyBoxId:"qtyTextBox",submitURL:b.cartUrl,isValid:"isValid",isBulkCart:b.isBulkCart?!0:!1,hasWrtyIntercept:b.hasWrtyIntercept?!0:!1,itemId:b.itemId};b.isATCRedesignLayerV1Active&&$("#"+b.cartBtnId).click(function(e){var d={atcRedesignOlayId:b.atcRedesignOverlayId};
|
|
a.pubsub&&!c&&a.pubsub.publish("_TRG_CLK_ATCREDESIGN_BTN",d);e.preventDefault()});b.isATCRedesignLayerV1Active||$("#"+b.cartBtnId).click(function(b){a.pubsub&&!c&&a.pubsub.publish("_SUBMIT_CARTBTN",d);b.preventDefault()})},attachMsgHandler:function(){var a=this;a.pubsub.channel(a.conf.cartOlayId).subscribe(a.olayCloseSvcId,function(b){a.cartOverlayClose(b)},a)},cartOverlayClose:function(){var a=this.cookie.readCookie("dp1","pbf");this.cookie.writeCookielet("dp1","pbf",this.cookie.setBitFlag(a,66,
|
|
1))}}});raptor.defineModule("raptor.vi.Charity",function(){return{init:function(a){var b=this;b.conf=a;a.signedIn&&a.onload?$(window).load(function(){b.addToFavCall()}):a.signedIn&&a.lnkId&&$(window).load(function(){b.chckCharity()});$("#"+a.lnkId).bind("click",function(){b.addToFavCall()});$("#"+b.conf.addedCharityId).bind("click",function(){b.rmvToFavCall()})},chckCharity:function(){this.makeScriptCall(this.conf.svcURL+"srt="+this.conf.csrf)},addToFavCall:function(){this.makeScriptCall(this.conf.svcURL+
|
|
"setFavNpId="+this.conf.charityid+"&srt="+this.conf.csrf)},rmvToFavCall:function(){this.makeScriptCall(this.conf.svcURL+"setFavNpId="+this.conf.charityid+"&srt="+this.conf.csrf+"&action=remove")},processRes:function(a){a&&1==a.status&&(a=a.userFavNpIds?a.userFavNpIds.split(","):[],a=-1!=$.inArray(String(this.conf.charityid),a)?!0:!1,this.addRmvCharityDspl(a))},addRmvCharityDspl:function(a){a?($("#"+this.conf.lnkId).hide(),$("#"+this.conf.addedCharityId).show()):($("#"+this.conf.addedCharityId).hide(),
|
|
$("#"+this.conf.lnkId).show())},makeScriptCall:function(a){var b=document.createElement("script");b.type="text/javascript";b.async=!0;b.src=a+"&cb=this.raptor.require('raptor.vi.Charity').processRes";document.getElementsByTagName("head")[0].appendChild(b)}}});raptor.defineClass("raptor.vi.CompareItems",function(){return{init:function(a){this.cfg=a;this.rmv=this.getRemovedItems();this.request(a.itm)},request:function(a){var b=this,a=location.href.split("itm")[0]+"itm/compare?item="+a+"&items=ALL";$.ajax({url:a,context:document.body}).done(function(a){a&&(b.populate(a),$("#cp_showMore").bind("click",function(){trackingUtil("VI_COMPARE_SHOW_MORE_DETAILS");b.showHide(!0)}),$("#cp_showLess").bind("click",function(){trackingUtil("VI_COMPARE_SHOW_LESS_DETAILS");
|
|
b.showHide(!1)}),$(".a_itemLink").bind("click",function(){trackingUtil("VI_COMPARE_ITEM_IMAGE_CLICK")}),$(".li_itemName a").bind("click",function(){trackingUtil("VI_COMPARE_ITEM_TITLE_CLICK")}),$(".cp_remove").bind("click",function(){trackingUtil("VI_COMPARE_REMOVE_ITEM");b.saveRemovedItem(this)}))})},populate:function(a){var b=this.cont=$("#div_compareContainer");$(b).html(a);this.cleanUpStorage();this.removeDeletedItems();this.showModule()},removeDeletedItems:function(){var a;if(null!==this.rmv){for(a=
|
|
0;a<=this.rmv.length;a++)$('.div_items[item="'+this.rmv[a]+'"]').remove();for(a=$(".div_items").not(".u-dspn").length;7>a;a++)$(".div_items.u-dspn").first().removeClass("u-dspn")}},showModule:function(){var a=$("#compareHeader");this.cfg.enableDelete&&$(".cp_remove.u-dspn").removeClass("u-dspn");$(this.cont).show();$(a).css("display","inline")},showHide:function(a){$(".ol_item_detail li").toggleClass("item_details_expand",a);$(".li_hide").toggle(a);$("#cp_showMore").toggle();$("#cp_showLess").toggle()},
|
|
removeItem:function(a){$(a).parents(".div_items").remove();$(".div_items.u-dspn").first().animate({opacity:"show"},1500).removeClass("u-dspn")},cleanUpStorage:function(){var a=[],b=$(".div_items").length;if(null!==this.rmv){for(var c=0;c<=b;c++)for(var d=0;d<this.rmv.length;d++)$(".div_items:eq("+c+")").attr("item")===this.rmv[d]&&a.push($(".div_items:eq("+c+")").attr("item"));try{localStorage.setItem("cmp_itm",JSON.stringify(a))}catch(e){}}},saveRemovedItem:function(a){var b=[];try{b=JSON.parse(localStorage.getItem("cmp_itm")),
|
|
null===b?b=[$(a).attr("item")]:b.push($(a).attr("item")),localStorage.setItem("cmp_itm",JSON.stringify(b))}catch(c){}this.removeItem(a)},getRemovedItems:function(){var a=[];try{return a=JSON.parse(localStorage.getItem("cmp_itm")),null===a?null:a}catch(b){return null}}}});raptor.defineClass("raptor.vi.Compatibility",function(){return{init:function(a){try{var b=this;b.conf=a;b.showTopCompMsg=!!a.showTopCompModel;b.showTopCompSection=!!a.fitsMessageDictionary;b.fldsSel=0;b.fldsSelected=0;b.srchFlds=[];b.propNames=[];b.propTypes=[];b.dsplNames=[];b.SP=a.selProps?a.selProps:{};b.pdsFlds=a.showTopCompModel&&a.showTopCompModel.selectedProperties?a.showTopCompModel.selectedProperties:{};b.vehicleType=848===b.conf.catalogId?"3":"1";b.MDDS=a.MDReqId;b.CREQ=a.reqType;b.start=
|
|
!0;b.initz=!1;b.showAll=!1;b.pubsub=raptor.require("pubsub");b.ajaxUtil=raptor.require("com.ebay.raptor.vi.AjaxUtil");b.fitsMessageDictionary=a.fitsMessageDictionary;b.expCount=-1;b.pfvModel=a.pfvModel;b.pfvModel&&(void 0!==b.pfvModel.fitmentDetailsMore&&0<Object.keys(b.pfvModel.fitmentDetailsMore).length)&&($("#fitsMoreInfo")&&0<$("#fitsMoreInfo").length&&$("#fitsMoreInfo").show(),$("#fits-msg-main")&&0<$("#fits-msg-main").length&&$("#fits-msg-main").addClass("mrb10"));b.handlrBinded||b.bindHandlr();
|
|
$("body").click(function(){b.pubsub.publish("_CLOSE_OLAY",{cmpId:a.olyId})});$("#"+a.seeCompLnk).click(function(){$($("#viTabs_0")[0]).trigger("click",["noTabTracking"]);$(document).trigger("rover",{sid:"p2047675.l1558"})});$("#"+a.showAllCmpLnk).click(function(){b.makeShowAllCall(null)});$("#"+a.mainId+"ieveh .crtval").click(function(){b.dropdownClicked()});$("#"+a.mainId+"ieveh > a > b").click(function(){b.dropdownClicked()});$("#"+a.mainId+"myGarageLink").click(function(){$(document).trigger("rover",
|
|
{sid:"p2047675.l44447"})});0<$("#diagramLink").length&&this.addClickEvent("#diagramLink");"HSNTSN"==a.selectOverlayTypeToShow?($("#"+a.hsnAncId).click(function(){b.setHsnTsn()}),$("#"+a.mainId+"slctBtn").click(function(){b.htOlySelect()}),$("#"+a.mainId+"htCancel").click(function(){b.sltRowOlyCancel(b.conf.htOverlayOSId)})):($("#"+b.conf.mainId+"anc").click(function(){b.setMakesForStreetNames()}),$("#"+a.mainId+"sn-slctBtn").click(function(){b.snOlySelect(b.conf.mainId+"streetNameResponseOverlay")}),
|
|
$("#"+a.mainId+"sn-Cancel").click(function(){b.sltRowOlyCancel(b.conf.mainId+"streetNameResponseOverlay")}));a.istecdoc&&$.ajax({type:"GET",dataType:"script",async:!1,url:a.tecdocAuthUrl+a.sellerid,success:function(b){"true"==b&&$("#copyrt").html(a.tecdocCr)}})}catch(d){}},setMakesForStreetNames:function(){$(document).trigger("rover",{sid:"p2047675.l7767"});var a=this.conf.vurl+"fitment/getdata?site="+this.conf.site+"&cat="+this.conf.categoryId,a=77==this.conf.site?a+"&pn=DEM_Make,DEM_StreetName":
|
|
a+"&pn=UKM_Make,UKM_StreetName";this.makeCall(a,this.parseVServiceMakesResponse)},parseVServiceMakesResponse:function(a){var b=this;if("SUCCESS"===a.status.name)if(0<a.data.length){b.pubsub.publish("_OPEN_OLAY",{cmpId:b.conf.mainId+"streetNameLookupOverlay",trigger:b.conf.mainId+"anc"});$("#"+b.conf.mainId+"goStreetBtn").attr("disabled",!0);var d=a.data.length;b.conf.makesStreenName=a.data;var c=document.getElementById(b.conf.mainId+"s-make"),e=document.getElementById(b.conf.mainId+"s-name");b.clearOptions(c);
|
|
b.clearOptions(e);c.options[0]=new Option("-"+b.conf.strtNMakeLbl+"-","");e.options[0]=new Option("-"+b.conf.strtNameLbl+"-","");e.disabled=!0;for(var h=0;h<d;h++)77==b.conf.site?c.add(new Option(a.data[h].DEM_Make,a.data[h].DEM_Make)):c.add(new Option(a.data[h].UKM_Make,a.data[h].UKM_Make));c.onchange=function(){b.selectedMake(this)};e.onchange=function(){b.selectedStreetName(this)};c.focus()}else b.showHide("dcthd ctVMTxt ctVNMTxt dthr dctbl err".split(" "),!0),b.showHide(["sn-NMTxt","ctshd"],!1);
|
|
else b.showHide("dcthd ctVMTxt ctVNMTxt dthr dctbl err".split(" "),!0),b.showHide(["sn-NMTxt","ctshd"],!1)},selectedMake:function(a){var b=$("#"+this.conf.mainId+"goStreetBtn"),d=document.getElementById(this.conf.mainId+"s-name");if(a&&0<a.selectedIndex){if(a=this.getStreetNamesFromMake(a.options[a.selectedIndex].value),"undefined"!==typeof a&&0<a.length){d.disabled=!1;this.clearOptions(d);d.options[0]=new Option("-"+this.conf.strtNameLbl+"-","");for(b=0;b<a.length;b++)d.add(new Option(a[b],a[b]))}}else this.clearOptions(d),
|
|
d.disabled=!0,b.attr("disabled",!0)},selectedStreetName:function(a){var b=this,d=$("#"+b.conf.mainId+"goStreetBtn");if(a&&0<a.selectedIndex){var c=a.options[a.selectedIndex].value;c&&(d.attr("disabled",!1),d.click(function(){$(document).trigger("rover",{sid:"p2047675.l7768"});b.makeStreetNameCompCheckCall(c)}))}else d.attr("disabled",!0)},makeStreetNameCompCheckCall:function(){var a=this.conf.vurl;this.pubsub.publish("_CLOSE_OLAY",{cmpId:this.conf.mainId+"streetNameLookupOverlay"});this.showHide("dcthd ctVMTxt sn-NMTxt ctVNMTxt dctbl err".split(" "),
|
|
!0);var a=a+("fitment/getdata?cat="+this.conf.categoryId+"&site="+this.conf.site),a=a+("&pn="+this.getPropertyNames(this.srchFlds,",")),b=document.getElementById(this.conf.mainId+"s-make"),d=document.getElementById(this.conf.mainId+"s-name"),b=b.options[b.selectedIndex].value,d=d.options[d.selectedIndex].value,a=77==this.conf.site?a+("&fmt=list&sfp=DEM_Make:"+b+",DEM_StreetName:"+d):a+("&fmt=list&sfp=UKM_Make:"+b+",UKM_StreetName:"+d);this.makeCall(a,this.parseStreetNameLookupResponse)},parseStreetNameLookupResponse:function(a){if("SUCCESS"===
|
|
a.status.name)if(0<a.data.length){var b=a.data.length,d=this.srchFlds,c=this.dsplNames;this.clearTable(this.conf.mainId+"sn-evtbl");for(var e=c.length,h=document.getElementById(this.conf.mainId+"sn-evtbl"),f=h.insertRow(0),g="",i=0;i<e;i++)g=0==i?g+"<td> </td>":g+("<td>"+c[i]+"</td>");f.innerHTML=g;this.overlayRowCount=b;for(c=0;c<b;c++){f=h.insertRow(c+1);g=a.data[c];for(i=0;i<e;i++)if(0==i){var j=f.insertCell(i),k=null;try{k=document.createElement("<input name='vehpick' type='radio' id='"+
|
|
this.conf.mainId+"pick"+c+"' value='"+this.getChoosenVehicle(d,g,!0)+"' />")}catch(l){}k||(k=document.createElement("INPUT"),k.type="RADIO",k.id=this.conf.mainId+"pick"+c,k.name="vehpick",k.value=this.getChoosenVehicle(d,g,!0));j.appendChild(k)}else j=f.insertCell(i),j.innerHTML=g[d[i-1]]}this.pubsub.publish("_OPEN_OLAY",{cmpId:this.conf.mainId+"streetNameResponseOverlay"})}else this.showHide("dcthd ctVMTxt ctHTMTxt ctHTIFTxt ctVNMTxt dthr dctbl err".split(" "),!0),this.showHide(["ctHTNMTxt","ctshd"],
|
|
!1)},getStreetNamesFromMake:function(a){var b=[],d=this.conf.makesStreenName;if(0<d.length)for(var c=0;c<d.length;c++){var e=d[c].ChildProperty;if(77==this.conf.site){if(d[c].DEM_Make===a){for(a=0;a<e.length;a++)b.push(e[a].DEM_StreetName);break}}else if(d[c].UKM_Make===a){for(a=0;a<e.length;a++)b.push(e[a].UKM_StreetName);break}}return b},bindHandlr:function(){var a=this;a.handlrBinded=!0;$("body").scroll(function(){a.initialize()});$("body").mouseover(function(){a.initialize()});$(document).keypress(function(){a.initialize()})},
|
|
initialize:function(){if(this.initz)return!1;this.start&&this.dsplRelCall();this.start=!1},dsplRelCall:function(){var a;$("#"+this.conf.mainId).show();if(this.conf.fitsFiltr&&-1!=this.conf.fitsFiltr.indexOf("Plat_Gen")){a=this.conf.fitsFiltr.split("|");for(var b="",d=0;d<a.length;d++){var c=a[d].split(":");1<c.length&&"Plat_Gen"!=c[0]&&(b+=a[d]+"|")}this.conf.fitsFiltr=b}$("#"+this.conf.pgnId).hide();this.conf.myVehiclesOn||(this.conf.fitsFiltr="");this.conf.sitespdOptim?(this.conf.myVehiclesOn||
|
|
(this.conf.fitsFiltr=""),1700===this.conf.catalogId?(a=this.getUrl(!1,!1,this.MDDS),this.makeCall(a,this.displayFilters)):this.handleFilters()):(a=this.getUrl(!1,!1,this.MDDS),this.makeCall(a,this.displayFilters));if(this.conf.myVehiclesOn&&(a=this.getUrl(!1,!1,this.MDDS),this.makeCall(a+"&rf=vehicles",this.displayMyVehicles),this.conf.fitsFiltr&&!this.conf.isBySpec)){a=this.getUrl(!1,!1,this.CREQ);a+="&sfp="+encodeURIComponent(this.conf.fitsFiltr);if("100"!=this.conf.site||void 0==this.conf.productId||
|
|
null==this.conf.productId||""==this.conf.productId)a+="&pn="+this.getPropertyNames(this.propNames);a+="&page=1";this.makeCall(a,this.displayCompatibilityInfo);this.showHide(["dctbl","err"],!0);this.showHide(["dthr"],!1)}},makeCall:function(a,b){this.ajaxUtil.getJSON(a,b,this);this.startTime=(new Date).getTime()},skipFitmentViewSetSkipProperty:function(a,b){this.conf.fitmentViewSetSkipProperty&&(a.shift(),b.shift())},displayFilters:function(a){if("SUCCESS"===a.status.name){this.clearTable(this.conf.slctId);
|
|
var b=a.displayNames,d=a.propertyNames,a=a.data;this.srchFlds=d;var c=document.getElementById(this.conf.slctId);if(c){var e=c.insertRow(0);e.style.fontWeight="bold";this.skipFitmentViewSetSkipProperty(b,d,this.conf.site,this.conf.catalogId);for(var h=d.length,f=0;f<b.length;f++){var g=e.insertCell(f),i=b[f],j=document.createElement("label");if(("3"==this.conf.site||"15"==this.conf.site||"77"==this.conf.site||"71"==this.conf.site||"101"==this.conf.site||"186"==this.conf.site)&&"Variant"===i)g.style.padding=
|
|
"0 10px 0 0";j.htmlFor=d[f];j.innerHTML=i;g.appendChild(j)}e=c.insertRow(1);this.createFilters(e,d,b);this.findIfBoats(a);this.isCompLoaded=!1;this.fillFilters(a);g=e.insertCell(h);"77"!=this.conf.site&&(g.colSpan="2",g.style.padding="10px 0 10px 0");g.style.paddingRight="10px";g.style.verticalAlign="top";g.appendChild(this.buildGo());(e=document.getElementById(this.srchFlds[f]))&&0<e.selectedIndex&&this.makeNavRelCall(e)}this.makeFirstCall();this.conf.myVehiclesOn&&100!=this.conf.site&&($("#"+this.conf.mainId+
|
|
"vehfltr")&&e)&&(e.disabled=!0);this.initz=!0;this.conf.byApp&&!this.SP?this.showHide(["dthr"],!1):this.showHide(["dthr"],!0);this.buildAddCB(c.parentNode)}else this.serviceErr()},findIfBoats:function(){var a=this.srchFlds;this.isBoats=!1;for(var b=0;b<a.length;b++)"B_Component"==a[b]&&(this.isBoats=!0)},setHsnTsn:function(){var a=this,b=a.srchFlds,d=$("#"+a.conf.mainId+"goBtn"),c=$("#"+a.conf.mainId+"Go");a.resetSrchFldFilters();d&&c&&(d.attr("disabled",!0),c.attr("disabled",!0));a.showHide(["goThrbr"],
|
|
!0);a.showHide(["goSpan"],!1);for(c=1;c<b.length;c++){var e=document.getElementById(b[c]);e.selectedIndex=0;e.disabled="1"==c?!1:!0}var h=document.getElementById(a.conf.mainId+"hsnBox"),f=document.getElementById(a.conf.mainId+"tsnBox");h.value="HSN";f.value="TSN";h.style.color="#999";f.style.color="#999";h.onfocus=function(){"HSN"==h.value&&a.emptyTextBox(this)};f.onfocus=function(){"TSN"==f.value&&a.emptyTextBox(this);""!=h.value&&"HSN"!=h.value?(d.attr("disabled",!1),d.click(function(){a.makeHTPageCall(null,
|
|
!0)})):d.attr("disabled",!0)}},handleFilters:function(){var a=this.srchFlds=this.conf.propNames,b=this.conf.dsplNames,d=a.length;if("100"==this.conf.site&&848!=this.conf.catalogId)for(var c=0;c<a.length;c++)"Submodel"==a[c]?a[c]=this.conf.propNames[c]="Trim":"Engine - Liter_Display"==a[c]&&(a[c]=this.conf.propNames[c]="Engine");var e=document.getElementById(this.conf.slctId);if(e){var h=e.insertRow(0);h.style.fontWeight="bold";for(c=0;c<b.length;c++){var f=h.insertCell(c),g=b[c],i=document.createElement("label");
|
|
i.htmlFor=a[c];i.innerHTML=g;f.appendChild(i)}h=e.insertRow(1);this.createFilters(h,a,this.conf.dsplNames);this.buildAddCB(e.parentNode);f=this.conf.startYear;e=this.conf.endYear;if(b=document.getElementById(a[0]))for(c=1;e>=f;e--)g=new Option(e,e),b.options[c]=g,c++,this.preSelect(b,g);for(c=1;c<a.length;c++)f=document.getElementById(a[c]),this.SP[f.id]&&""!==this.SP[f.id]?(e=new Option(this.SP[f.id],this.SP[f.id]),f.options[f.options.length]=e,e.selected=!0):this.pdsFlds[f.id]&&""!==this.pdsFlds[f.id]&&
|
|
(e=new Option(this.pdsFlds[f.id],this.pdsFlds[f.id]),f.options[f.options.length]=e,e.selected=!0);f=h.insertCell(d);f.style.paddingRight="10px";f.style.verticalAlign="top";f.appendChild(this.buildGo());b&&0<b.selectedIndex&&this.makeNavRelCall(b)}this.makeFirstCall();this.init=!0;this.conf.byApp&&this.conf.totCount<=this.conf.showAllCt?this.showHide(["dthr"],!1):this.showHide(["dthr"],!0);this.showHide(["dslct"],!1)},serviceErr:function(){this.showHide(["err","serr"],!1);this.showHide(["dthr","cerr",
|
|
"dslct","norecco"],!0)},buildGo:function(){var a=this,b=document.createElement("INPUT");b.type="BUTTON";b.id=a.conf.mainId+"Go";b.className="btn btn-s btn-ter";b.style.marginTop="-2px";b.value="100"==a.conf.site?b.name=a.conf.goTxt:b.name=a.conf.checkComptxt;b.title=b.value;b.disabled=!0;if("77"==a.conf.site){var d=document.getElementById(a.conf.mainId+"htfltr");d&&d.checked&&(b.disabled=!1)}b.onclick=function(){a.isGoClicked=!0;a.conf.myVehiclesOn&&a.conf.isImplicitSaveOn?"100"==a.conf.site?(a.makePageCall(null,
|
|
!0,!0,!0),a.setMyVehicleDropDown(!1)):(a.isSavedVehClkd=!1,a.chckFitsClicked=!0,a.makePageCall(null,!0,!1,!0)):a.makePageCall(null,!0,!1,!0)};d=document.createElement("div");d.className="goButton";d.appendChild(b);return d},buildAddCB:function(a){if((-1==this.expCount||this.expCount<this.conf.myVehicleMaxNum)&&this.conf.isUserSignedIn&&this.conf.showExplicitChbox){var b=document.createElement("input");b.type="checkbox";b.name="name";b.value="value";b.id="expCB";var d=document.createElement("div");
|
|
d.id="expCBLb";d.innerHTML=this.conf.explicitChboxLabel;a.appendChild(b);a.appendChild(d);b.checked=!0}},makePageCall:function(a,b,d,c){b&&(this.showAll=!1);$("#"+this.conf.pgnId).hide();b=this.getUrl(!1,this.showAll,this.CREQ,d);if("100"!=this.conf.site||void 0==this.conf.productId||null==this.conf.productId||""==this.conf.productId)b+="&pn="+this.getPropertyNames(this.propNames);b=a?b+("&page="+a):b+"&page=1";c&&(b+="&goclk=1",(a=document.getElementById("expCB"))&&a.checked&"none"!=a.style.display&&
|
|
(b+="&expsv=true"));this.makeCall(b,this.displayCompatibilityInfo);this.showHide(["dctbl","err"],!0);this.showHide(["dthr"],!1)},displayMyVehicles:function(a){if("SUCCESS"===a.status.name&&"null"!=a.data){var b=a.data,a=a.propertyNames;if(b=b[0])this.getDropdownObject(b,a),a=this.conf.myVehicleMaxNum,this.expCount=null!=b.E&&void 0!=b.E?b.E.length:0,null!=b.E&&(void 0!=b.E&&b.E.length>=a)&&this.showHideWithID(["expCB","expCBLb"],!0,"");else{this.conf.myVehiclesOn=!1;this.showHide(["mvRow"],!0);this.showHide(["vehfltr"],
|
|
!0);if(b=document.getElementById(this.conf.mainId+"htdiv"))b.className="",b.style.paddingLeft="12px";a&&(a[1].disabled=!1)}}else this.serviceErr(),this.showHide(["fltTxt"],!0)},getDropdownObject:function(a,b){var d=this.conf;this.iLen=this.eLen=0;if(a){this.showHide(["fltTxt"],!0);this.showHide(["topMsg","mvdd","or"],!1);a.E&&(this.eLen=a.E.length);a.I&&(this.iLen=a.I.length);var c=$("li[value=13]"),e=$("li[value=20]");$("li[value=11]").css("display","none");$(c).removeClass("op").addClass("opd hrl");
|
|
$(e).removeClass("op").addClass("opd");$(c).hover(function(){$(this).css("cursor","default");$(this).css("background-color","#fff")});$(e).hover(function(){$(this).css("cursor","default");$(this).css("background-color","#fff")});$("li[value=14]").removeClass("op").addClass("opd hrl ptblr");if(!d.isUserSignedIn||!a.E)$("li[value^=20]").css("display","none"),$(c).css("padding-top","10px"),$(c).removeClass("hrl");if(d.isUserSignedIn)for(c=0;c<parseInt(d.expCount);c++)this.setVehicles(c,a.E,b,!0);for(c=
|
|
0;c<parseInt(d.impCount);c++)this.setVehicles(c,a.I,b,!1);this.valFromURL&&0!=this.valFromURL&&this.selectOption(this.valFromURL)}},selectOption:function(a){for(var b=-1,a=a.replace(/[\[\]']+/g,""),d=1;d<=this.conf.impCount;d++){var c=$("li[value=30"+d+"]").html(),c=c.replace(/[\[\]']+/g,"");if(""!=c&&-1!=a.search(c)){b=d;break}}-1!=b&&$("li[value=30"+b+"]").addClass("sel")},isNull:function(a){return null==a||"null"==a?!0:!1},setVehicles:function(a,b,d,c){var e=this,h,f="",g="";h=c?$("li[value=20"+
|
|
parseInt(a+1)+"]"):$("li[value=30"+parseInt(a+1)+"]");if(b&&b[a]){if("0"==b[a][0]||"100"==b[a][0]||"2"==b[a][0]){for(var i=3;5>=i;i++)e.isNull(b[a][i])||(g+=b[a][i]+" ",f+=d[i-3]+":"+b[a][i]+"|");("100"==e.conf.site||"2"==e.conf.site)&&848!=e.conf.catalogId?(f+="null"==b[a][7]?"":"Submodel:"+b[a][7],f+="null"==b[a][6]?"":"|Trim:"+b[a][6]):f+="null"==b[a][7]?"":d[3]+":"+b[a][7];e.isNull(b[a][6])?e.isNull(b[a][7])||(g+=b[a][7]+" "):g+=b[a][6]+" ";e.isNull(b[a][8])||(f=("100"==e.conf.site||"2"==e.conf.site)&&
|
|
848!=e.conf.catalogId?f+("|Engine - Liter_Display:"+b[a][8]):f+("|"+d[4]+":"+b[a][8]));10>b[a].length?e.isNull(b[a][8])||(g+=b[a][8]+" "):("100"==e.conf.site||"2"==e.conf.site)&&848!=e.conf.catalogId&&!e.isNull(b[a][9])?(g+=b[a][9]+" ",f+="null"==b[a][9]?"":"|Engine:"+b[a][9]):e.isNull(b[a][8])||(g+=b[a][8]+" ")}else if(b[a][0]){i="77"==e.conf.site?1:0;for(i;i<=d.length;i++){var j=b[a]["77"==e.conf.site?i+2:i+3];e.isNull(j)||(f+=d[i]+":"+j+"|",g="--"==j?g+"[--]":g+j,!e.isNull(b[a][i+1])&&"undefined"!=
|
|
b[a][i+1]&&(g+=" "))}}var f=encodeURIComponent(f),k=b[a][2],l=b[a][1];$(h).html(g);$(h).attr("u",f);"null"!=k&&"null"!=l&&($(h).attr("vt",k),$(h).attr("si",l),"0"==l&&$(h).attr("title",e.conf.dsContent));"1"==l&&k==e.vehicleType?($(h).bind("click",function(){$(document).trigger("rover",{sid:"p2047675.l10055"});e.makeSavedVehPageCall(f,g,c,k,l)}),e.addMyGarageTracking(),$(h).addClass("plr")):$(h).removeClass("op").addClass("opa")}else $(h).css("display","none")},makeSavedVehPageCall:function(a,b,d,
|
|
c,e){var h=this.getUrl(!1,!0,this.CREQ);if("100"!=this.conf.site||void 0==this.conf.productId||null==this.conf.productId||""==this.conf.productId)h+="&pn="+this.getPropertyNames(this.propNames);h=h+"&page=1"+("&sfp="+a);h+="&_trksid="+this.conf.trksid;this.showAll=!1;this.recentValue=b;if(this.isSavedVehClkd=d)this.recVal=b,this.recSfp=a,this.vehtype=c,this.si=e;this.trgTopCompUpd=!0;this.makeCall(h,this.displayCompatibilityInfo);this.resetSrchFldFilters();this.chosen=this.getSelectedVehicle(a);this.updateVehicleChosen(this.chosen);
|
|
this.showHide(["dctbl","err"],!0);this.showHide(["dthr"],!1)},resetSrchFldFilters:function(){var a=this.srchFlds;if(null!==a)for(var b=0;b<a.length;b++){var d=document.getElementById(a[b]);d&&(d.selectedIndex=0);d.disabled=d?d.index:0<b}this.setButtonState()},showHide:function(a,b){for(var d=this.conf.mainId,c=0;c<a.length;c++){var e=document.getElementById(d+a[c]);e&&(e.style.display=b?"none":"")}},showHideWithID:function(a,b,d){for(var c=0;c<a.length;c++){var e=document.getElementById(d+a[c]);e&&
|
|
(e.style.display=b?"none":"")}},makeFirstCall:function(){if(!this.conf.fitsFiltr||""==this.conf.fitsFiltr&&!this.conf.myVehiclesOn){var a=!0;$.isEmptyObject(this.SP)&&(a=!1);a?this.makePageCall(null,!0):this.conf.byApp&&!this.conf.fitsFiltr&&this.makeShowAllCall()}},makeShowAllCall:function(){sUrl=this.getUrl(!1,!0,this.CREQ);if("100"!=this.conf.site||void 0==this.conf.productId||null==this.conf.productId||""==this.conf.productId)sUrl+="&pn="+this.getPropertyNames(this.propNames);sUrl+="&page=1";
|
|
this.makeCall(sUrl,this.displayCompatibilityInfo);this.showAll=!0;this.showHide(["dctbl","err"],!0);this.showHide(["dthr"],!1)},getVehicleType:function(){return this.vehicleType?this.vehicleType:"1"},setMyVehicleDropDown:function(a,b,d){var c="",e="",h=this.srchFlds,f="",g="",i=this.conf;if(null!==h&&this.uniqueVehicle){if(a)e=this.recVal,c=this.recSfp,f=this.vehtype,g=this.si,this.recentValue=e;else if(null!=b&&null!=d)c=b,e=d,f=this.getVehicleType(),g="1",c=encodeURIComponent(c);else{for(f=0;f<
|
|
h.length;f++)if((g=document.getElementById(h[f]))&&0!==g.selectedIndex){0!==f&&(c+="|",e+=" ");b=g.options[g.selectedIndex].value;if("100"==this.conf.site&&"Trim"===h[f]&&848!=i.catalogId){if(d=this.isFieldsMapped1to1("Submodel","Trim"),-1!=d){var j=document.getElementById("Submodel");null!=j&&void 0!=j&&(c+="Submodel:"+j.options[d].value+"|")}}else"100"==this.conf.site&&("Engine"===h[f]&&848!=i.catalogId)&&(d=this.isFieldsMapped1to1("Engine - Liter_Display","Engine"),-1!=d&&(j=document.getElementById("Engine - Liter_Display"),
|
|
null!=j&&void 0!=j&&(c+="Engine - Liter_Display:"+j.options[d].value+"|")));c+=g.id+":"+b;e+=b}f=this.getVehicleType();g="1";c=encodeURIComponent(c);this.recentValue=""}h=this.iLen;this.iLen==i.impCount?h=i.impCount:h=this.iLen+1;this.iLen=h;b=1;d=!1;for(j=1;j<=i.impCount;j++){var k=$("li[value=30"+j+"]").html();if(k&&e.replace(/\s/g,"")==k.replace(/\s/g,"")){b=j;d=!0;break}}if(1==b&&!d){$($("#"+i.mainId+"ieveh .crtval").children()[1]).html(e);for(d=1;d<=h;d++){var b=$("li[value=30"+d+"]"),j=$(b).hasClass("opa"),
|
|
k=$(b).attr("u"),l=$(b).attr("vt"),m=$(b).attr("si"),n=$(b).html();$(b).html(e);$(b).attr("u",c);j&&($(b).removeClass("opa").addClass("op plr"),$(b).attr("title",""));"null"!=f&&"null"!=g&&($(b).attr("vt",f),$(b).attr("si",g),"0"==g?($(b).attr("title",i.dsContent),$(b).removeClass("op plr").addClass("opa")):f!=this.vehicleType&&$(b).removeClass("op plr").addClass("opa"));$(b).css("display","");e=n;c=k;f=l;g=m}}else 1!=b&&this.changeInternalDDOrder(b);for(c=1;c<=h;c++)this.setClickEvnt(c,a),b=$("li[value=30"+
|
|
c+"]"),e=$(b).hasClass("op"),i=$(b).hasClass("plr"),e&&!i&&$(b).addClass("plr")}},changeInternalDDOrder:function(a){var b=$("li[value=30"+a+"]");nUrl=$(b).attr("u");nType=$(b).attr("vt");nSInfo=$(b).attr("si");nVal=$(b).html();for(b=1;b<=a;b++){var d=$("li[value=30"+b+"]"),c=$(d).hasClass("opa"),e=$(d).attr("u"),h=$(d).attr("vt"),f=$(d).attr("si"),g=$(d).html();$(d).html(nVal);$(d).attr("u",nUrl);c&&($(d).removeClass("opa").addClass("op plr"),$(d).attr("title",""));"null"!=nType&&"null"!=nSInfo&&
|
|
($(d).attr("vt",nType),$(d).attr("si",nSInfo),"0"==nSInfo?($(d).attr("title",this.conf.dsContent),$(d).removeClass("op plr").addClass("opa")):"3"==nType&&($(d).attr("title",this.conf.mcContent),$(d).removeClass("op plr").addClass("opa")));nVal=g;nUrl=e;nType=h;nSInfo=f}},addMyGarageTracking:function(){$("#"+this.conf.mainId+"ieveh .ptblr").bind("click",function(){$(document).trigger("rover",{sid:"p2047675.l44447"})})},resetMyVehicleDD:function(){for(var a=1,b=1;b<=this.conf.impCount;b++){var d=$("li[value=30"+
|
|
b+"]").html();if(this.recentValue.replace(/\s/g,"")==d.replace(/\s/g,"")){a=b;break}}if(1!=a){this.changeInternalDDOrder(a);for(a=1;a<=this.iLen;a++)this.setClickEvnt(a,!1)}},setClickEvnt:function(a,b){var d=this,c=$("li[value=30"+a+"]"),e=$(c).html(),h=$(c).attr("vt"),f=$(c).attr("si");$(c).unbind("click");"1"==f&&h==d.vehicleType&&$(c).bind("click",function(){$(document).trigger("rover",{sid:"p2047675.l10055"});d.makeSavedVehPageCall($(c).attr("u"),e,!1,h,f)});d.addMyGarageTracking();b?$("li[value=301]").removeClass("sel"):
|
|
($(c).removeClass("sel"),$("li[value=301]").addClass("sel"),$("li[value^=20]").removeClass("sel"))},_removeClassByRegex:function(a,b,d){var c=RegExp(d?"^"+b+".+":"^.+"+b+"$");a.removeClass(function(a,b){return b.split(/\s+/).filter(function(a){return c.test(a)}).join(" ")})},resetComptabilityViewStyling:function(a){var b=a.closest("#fits-msg-main");this._removeClassByRegex(b,"-border",!1);a=a.find("#fits-icon");this._removeClassByRegex(a,"icon-",!0);if((a=$("#fits-msg"))&&0<a.length)a.removeClass(),
|
|
a.empty();$("#fits-select-btn")&&0<$("#fits-select-btn").length&&$("#fits-select-btn").remove();$("#fits-action-link")&&0<$("#fits-action-link").length&&$("#fits-action-link").remove();$("#fits-select-btn")&&0<$("#fits-select-btn").length&&$("#fits-select-btn").remove();$("#fits-edit-btn")&&0<$("#fits-edit-btn").length&&$("#fits-edit-btn").hide();$("#fitsMoreInfoContent")&&0<$("#fitsMoreInfoContent").length&&$("#fitsMoreInfoContent").children().remove();$("#fitsMoreInfo")&&0<$("#fitsMoreInfo").length&&
|
|
$("#fitsMoreInfo").hide();$("#fits-msg-main")&&0<$("#fits-msg-main").length&&$("#fits-msg-main").removeClass("mrb10")},addClickEvent:function(a){var b=this;$(a).bind("click",function(){b.showDiagram($(this).data("href"),this.id);b.updateOEMDiagram($(this).data("refno"),$(this).data("qty"))})},addCompatibilityViewStyling:function(a,b){a.closest("#fits-msg-main").addClass(b+"-border");a.find("#fits-icon").addClass("icon-"+b);a.find("#fits-msg").addClass("fits-msg__"+b)},updateFitsMessage:function(a,
|
|
b,d){a=a.find("#fits-msg");a.text(b);d&&a.append(" <span class='selectedVehicle'>"+this.chosen+"</span>")},enableCompViewFitsYes:function(a){this.addCompatibilityViewStyling(a,this.fitsMessageDictionary.FITS_YES_MSG_TYPE);this.updateFitsMessage(a,this.fitsMessageDictionary.FITS_YES,!0);a.find("#fits-edit-btn").show()},enableCompViewFitsMaybe:function(a){this.addCompatibilityViewStyling(a,this.fitsMessageDictionary.FITS_MAYBE_MSG_TYPE);this.updateFitsMessage(a,this.fitsMessageDictionary.FITS_MAYBE,
|
|
!0)},enableCompViewFitsWarning:function(a){this.addCompatibilityViewStyling(a,this.fitsMessageDictionary.FITS_NO_MSG_TYPE);this.updateFitsMessage(a,this.fitsMessageDictionary.FITS_NO,!0);a.find("#fits-edit-btn").show()},enableCompViewFitsError:function(a){this.addCompatibilityViewStyling(a,this.fitsMessageDictionary.FITS_TRY_AGAIN_MSG_TYPE);this.updateFitsMessage(a,this.fitsMessageDictionary.FITS_TRY_AGAIN,!1)},showHideEle:function(a,b){for(var d=0;d<a.length;d++){var c=document.getElementById(a[d]);
|
|
c&&(c.style.display=b?"none":"")}},displayTopCompInfo:function(a){if("SUCCESS"===a.status.name)if(this.updateVehicleMessage(this.chosen),a.data&&0<a.data.length){if(a.data[0]&&a.data[0].FitmentComments&&0<a.data[0].FitmentComments.length){var b=a.data[0].FitmentComments[0];if(b&&0<b.length)if(this.showHideEle(["topCompNotes"],!1),40>b.length)$("#notesSp").html(b),$("#readMoreId").hide();else{var d=b.substring(0,40);$("#readNotesId").val(b);$("#notesSp").html(d).append("... ");$("#readMoreId").show()}}b=
|
|
this.getFourthAttribute(a.data[0]);a=this.getFifthAttribute(a.data[0]);5<=this.fldsSel||b&&"undefined"==typeof a&&4<=this.fldsSel||"undefined"==typeof b&&3<=this.fldsSel?this.displayTopCompInfoExact():this.displayTopCompInfoMaybe()}else this.showHideEle(["topFitsNot","topSeeAll","topSeeIndent"],!1),this.showHideEle(["topFitsNeed","topFits","topFitsMost","topSeeMore","topCompNotes"],!0),$("#topCompNotes .l-dl").text("");else this.showHideEle(["topSeeAll"],!1),this.showHideEle("topFitsNeed topFits topFitsMost topSeeMore topCompNotes topFitsNot topSeeIndent".split(" "),
|
|
!0)},_displayTopCompInfo:function(a){$fitsContentContainer=$("#fits-msg-content");this.resetComptabilityViewStyling($fitsContentContainer);if("SUCCESS"===a.status.name)if(a.data&&0<a.data.length){var b=this.getFourthAttribute(a.data[0]),d=this.getFifthAttribute(a.data[0]);this.fldsSelected=this.selVel.split("~").length;5<=this.fldsSelected||b&&"undefined"==typeof d&&4<=this.fldsSelected||"undefined"==typeof b&&3<=this.fldsSelected?this.enableCompViewFitsYes($fitsContentContainer):this.enableCompViewFitsMaybe($fitsContentContainer);
|
|
a.data[0]&&(a.data[0].FitmentComments&&0<a.data[0].FitmentComments.length&&""!=a.data[0].FitmentComments[0])&&(b=a.data[0].FitmentComments[0],b=b.replace(/<br\s*\/?>/gi," "),$("#fitsMoreInfo").show(),$("#fits-msg-main").addClass("mrb10"),$("#fitsMoreInfoContent").append("<span>"+this.fitsMessageDictionary.FITS_IMPORTANT+": "+b+"</span>"),void 0!==a.data[0].DiagramURL&&0<a.data[0].DiagramURL.length&&($("#fitsMoreInfoContent").append('<span class="fitsDiagram"><a id="diagramLink">'+this.fitsMessageDictionary.FITS_SEE_DIAGRAM+
|
|
"</a></span>"),$("#diagramLink").data({href:a.data[0].DiagramURL[0],refno:a.data[0].DiagramURL[1],qty:a.data[0].DiagramURL[2]}),this.addClickEvent("#diagramLink")))}else this.enableCompViewFitsWarning($fitsContentContainer);else this.enableCompViewFitsError($fitsContentContainers)},displayTopCompInfoMaybe:function(){this.showHideEle(["topFitsMost","topSeeMore","topSeeIndent"],!1);this.showHideEle(["topFitsNeed","topFits","topFitsNot","topSeeAll","topCompNotes"],!0)},displayTopCompInfoExact:function(){this.showHideEle(["topFits",
|
|
"topSeeAll","topSeeIndent"],!1);this.showHideEle(["topFitsNeed","topFitsMost","topFitsNot","topSeeMore"],!0)},getFourthAttribute:function(a){var b=void 0;"3"==this.conf.site&&a.Variant&&(b=a.Variant);"77"==this.conf.site||"71"==this.conf.site||"101"==this.conf.site||"186"==this.conf.site?a.Platform&&(b=a.Platform):a.Trim&&(b=a.Trim);return b},getFifthAttribute:function(a){var b=void 0;"3"==this.conf.site?a["Cars Type"]&&(b=a["Cars Type"]):"77"==this.conf.site||"71"==this.conf.site||"101"==this.conf.site||
|
|
"186"==this.conf.site?a.Type&&(b=a.Type):a.Engine&&(b=a.Engine);return b},updateVehicleMessage:function(a){var b=$("#topFits .l-dl");b.text(a);selector="#topFitsMost .l-dl";b=$(selector);b.text(a);selector="#topFitsNot .l-dl";b=$(selector);b.text(a)},displayCompatibilityInfo:function(a){if(this.isGoClicked||this.trgTopCompUpd)this.showTopCompMsg&&(this.trgTopCompUpd=!1,this.displayTopCompInfo(a)),this.showTopCompSection&&(this.trgTopCompUpd=!1,this._displayTopCompInfo(a)),this.triggerTopUpdate=this.isGoClicked=
|
|
!1;this.endTime=(new Date).getTime();this.recentValue&&""!=this.recentValue&&($($("#"+this.conf.mainId+"ieveh .crtval").children()[1]).html(this.recentValue),this.isSavedVehClkd?this.setMyVehicleDropDown(!0,null,null):this.resetMyVehicleDD());12E3>this.endTime-this.startTime?"SUCCESS"===a.status.name?(a.displayNames&&0===this.dsplNames.length&&(this.dsplNames=a.displayNames),a.propertyNames&&(this.propNames=a.propertyNames),this.uniqueVehicle=100==this.conf.site?!0:a.uniqueVehicle,this.clearTable(this.conf.mainId+
|
|
"ctbl"),this.conf.myVehiclesOn&&(this.updateMyVeh&&($($("#"+this.conf.mainId+"ieveh .crtval").children()[1]).html(this.chosen),this.setMyVehicleDropDown(!1,this.sfArg,this.chosen),this.valFromURL=this.chosen,this.updateMyVeh=!1),this.chckFitsClicked&&(this.setMyVehicleDropDown(!1,null,null),this.chckFitsClicked=!1)),this.updateVehicleChosen(this.chosen),0<a.data.length?(this.drawTable(this.dsplNames,this.propNames,a.data),this.showHide(["stts","note","epid"],!1),a.pageInfo&&this.buildPagination(a.pageInfo),
|
|
this.showHide(["dcthd"],this.conf.byApp?!this.showAll:!0),this.showHide(["ctTtlTxt"],!this.showAll),this.showHide(["ctTxt"],this.showAll),this.showHide(["ctVNMTxt","ctHTNMTxt","ctHTIFTxt","sn-NMTxt"],!0),this.showHide(["ctVMTxt"],!this.htselected&&!this.showAll?!1:!0),this.showHide(["ctHTMTxt"],this.htselected&&!this.showAll?!1:!0),this.showHide(["dctbl"],!1),this.showHide(["ctshd"],!1),this.showHide(["err","cerr","norecco"],!0)):a.noCompatibilityBySpec?(this.showHide(["err","cbserr"],!1),this.showHide(["dthr",
|
|
"cerr","dslct","norecco"],!0)):(this.conf.isNullReccoEnabled&&this.setURLToNullRecco(),this.showHide(["err","cerr","norecco"],!1),$(document).trigger("rover",{sid:"p2047675.l4091"}),this.showHide("dcthd ctVMTxt ctHTMTxt ctHTNMTxt ctHTIFTxt sn-NMTxt".split(" "),!0),this.showHide(["ctTxt","serr","ctTtlTxt"],!0),this.showHide(["ctVNMTxt","ctshd"],!1)),this.initz=!0,this.showHide(["dthr"],!0)):a.noCompatibilityBySpec?(this.showHide(["err","cbserr"],!1),this.showHide(["dthr","cerr","dslct","norecco"],
|
|
!0)):this.serviceErr():this.serviceErr()},setURLToNullRecco:function(){var a,b=this.conf.categoryId,d=this.conf.mainId;a=this.conf.nullBaseURL+"?_from=R40&_nkw="+this.nullReccoKeyword;if(this.selVel&&""!=this.selVel){a+="&selvel="+this.selVel;var c="",e=this.selVel.split("~");if(1<e.length)for(var h=0;h<e.length;h++)"null"!=e[h]&&(0!=h&&(c+=","),c+=h+1);a+="&selfil="+encodeURIComponent(c)}b&&(a+="&_sacat="+b);"100"==this.conf.site&&(a+="&_vxp=mtr");$("#nullRecco").attr("href",a);$("#nullRecco").click(function(){$(document).trigger("rover",
|
|
{sid:"p2047675.l4092"})});$("#"+d+"norecco").css({color:"#333","padding-left":"5px"});$("#"+d+"cerr > p > span.clr").append($("#"+d+"norecco"));$("#"+d+"cerr > p > span.clr").css({display:"inline",margin:"0"})},buildPagination:function(a){var b=this;tp=a.totalPageCount;cp=a.currentPageNo;b.updateCount(a.totalRecordCount);if(null!==tp&&null!==cp)if(1<tp){$("#"+b.conf.pgnId).show();for(var d=$("div#"+b.conf.pgnId+"> div > span.pg-cs"),a=$("div#"+b.conf.pgnId+"> div > span.pg-m"),c=a.children().size(),
|
|
e=0;e<=c;e++)$($($(a).children()[e]).children()[0]).unbind("click");if(10<tp&&13>c){for(e=11;e<=tp;e++)$('<span class="pg-nm pg-nmp"><a href="javascript:;">'+e+"</a></span>").insertBefore(".pg-cdr");c=$(a).children().size()}for(e=tp+1;e<c-1;e++)$(a.children()[e]).hide();$(d).html(b.conf.pageTxt);$("#pageId").html(cp);$("#totalPageNo").html(tp);$($(".pg-cdr").children()[0]).attr("href","javascript:;");var e=$($($(a).children()[0]).children()[0]).children()[0],c=$($($(a).children()[c-1]).children()[0]).children()[0],
|
|
h=$(".pg-cdl").children()[0],f=$(".pg-cdr").children()[0];if(10<tp){if(11>cp){for(var g=0;10>=g;g++)d=$(a).children()[g],$(d).css("display","");for(g=11;g<=tp;g++)d=$(a).children()[g],$(d).css("display","none")}if(1!=cp&&1==cp%10){for(var g=tp>=cp+9?cp+9:tp,i=cp;i<=g;i++)d=$(a).children()[i],$(d).css("display","");for(g=1;g<cp;g++)d=$(a).children()[g],$(d).css("display","none")}if(cp&&0==cp%10){for(g=cp;g>=cp-9;g--)d=$(a).children()[g],$(d).css("display","");for(g=cp+1;g<=tp;g++)d=$(a).children()[g],
|
|
$(d).css("display","none")}}1==cp?b.makeLeftArrDisabled(e,h):(b.makeLeftArrEnabled(e,h),$(h).bind("click",function(){b.makePageCall(cp-1,!1)}));cp!==tp?($(f).bind("click",function(){b.makePageCall(cp+1,!1)}),b.makeRightArrEnabled(c,f)):(b.makeRightArrDisabled(c,f),b.makeLeftArrEnabled(e,h));for(e=1;e<=tp;e++)d=$(a).children()[e],c=$(d).children()[0],$(d).removeClass("pg-cr").addClass("pg-nm"),c||($(d).html(""),$(d).append('<a href="javascript:;">'+e+"</a>")),cp==e?($(d).removeClass("pg-nm").addClass("pg-cr"),
|
|
$(c).css("color","#000"),$(c).css("text-decoration","none"),b.disableAnchor(c,!0)):($(c).css("color","#777777"),$(c).css("text-decoration","none"),b.enableAnchor(c,null,!0))}else $("#"+b.conf.pgnId).hide();if(null!==cp&&null!==tp&&2<=tp)for(a=cp+1;a<=tp;a++)b.setPaginationClick(a);if(null!==cp&&null!==tp&&2<=tp)for(a=1;a<cp;a++)b.setPaginationClick(a)},enableAnchor:function(a,b,d){$(a).attr("href","javascript:;");d||(b?$(a).attr("title",this.conf.prevPage):$(a).attr("title",this.conf.nextPage));$(a).hover(function(){$(this).css("cursor",
|
|
"pointer");$(this).css("color","#777777")})},disableAnchor:function(a,b){$(a).removeAttr("href");$(a).removeAttr("title");$(a).hover(function(){$(this).css("cursor","default");b&&($(this).css("color","#000"),$(this).css("text-decoration","none"))})},makeLeftArrDisabled:function(a,b){this.disableAnchor(b,!1);$(a).removeClass("pg-ul").addClass("pg-uld")},makeLeftArrEnabled:function(a,b){this.enableAnchor(b,!0,!1);$(a).removeClass("pg-uld").addClass("pg-ul")},makeRightArrDisabled:function(a,b){this.disableAnchor(b,
|
|
!1);$(a).removeClass("pg-ur").addClass("pg-urd")},makeRightArrEnabled:function(a,b){this.enableAnchor(b,!1,!1);$(a).removeClass("pg-urd").addClass("pg-ur")},setPaginationClick:function(a){var b=this;$("div#"+b.conf.pgnId+"> div > span.pg-cs");var d=$("div#"+b.conf.pgnId+"> div > span.pg-m"),d=$(d).children()[a];(d=$(d).children()[0])&&$(d).bind("click",function(){b.makePageCall(a,!1)})},updateCount:function(a){var b=this.conf.mainId;0>=this.conf.totCount&&(this.conf.totCount=a);$("#"+b+"ct").html(a);
|
|
$("#"+b+"cttl").html(a)},updateOEMDiagram:function(a,b){!this.isNull(a)&&""!=a?($("#asmbl").html(a),$("#asmbl").css("font-weight","bold"),0<$("#arrDiv1").length||($("#asmbl").parent().parent().prepend('<div class="gspr oeArr" id="arrDiv1"></div>'),$("#arrDiv1").css("margin","0 15px 0 0")),$("#asmbl").parent().parent().show(),$("#asmblLyr").show()):($("#asmbl").parent().parent().hide(),$("#asmblLyr").hide());!this.isNull(b)&&""!=b&&0<1*b?($("#asmblQty").html(1*b),$("#asmblQty").css("font-weight","bold"),
|
|
0<$("#arrDiv2").length||($("#partQty").prepend('<div class="gspr oeArr" id="arrDiv2"></div>'),$("#arrDiv2").css("margin","0 15px 0 0")),$("#partQty").show(),$("#asmblLyr").show()):$("#partQty").hide()},drawTable:function(a,b,d){var c=this,e=b.length,h=document.getElementById(c.conf.mainId+"ctbl");h.className=100==c.conf.site?"fTbl":"fTblUK";$(h).off("click").on("click",function(a){if($(a.target).is(".fitment-moreless")){var a=$(a.target),b=a.prev("span"),d=a.data("id"),e="";try{e=$("#"+d).get(0).notes[0]}catch(f){}"MORE"===
|
|
a.data("mode")?(b.html(e),a.html(c.conf.less),a.data("mode","LESS"),a.attr("aria-expanded",!0),$(document).trigger("rover",{sid:"p2047675.l9601"})):(b.html(a.data("shortValue")),a.html(c.conf.more),a.data("mode","MORE"),a.attr("aria-expanded",!1),$(document).trigger("rover",{sid:"p2047675.l9602"}))}});for(var f=0;f<d.length;f++){for(var g=d[f],i=0;i<e;i++)if(0==i)var j=g[b[i]];if(j&&null!==j[0]&&0<j[0].length)break}f=h.insertRow(0);f.id=100==c.conf.site?"fTblFTr":"fTblFTrUK";for(g=0;g<e;g++){var i=
|
|
f.insertCell(g),k=a[g];if(0==g){var l=document.createElement("SPAN");l.innerHTML=k;i.appendChild(l);j&&(null!==j[0]&&0<j[0].length)&&(k=document.createElement("SPAN"),k.innerHTML="<br>",i.appendChild(k),k=document.createElement("SPAN"),k.innerHTML=c.conf.notesAlertMsg,k.className="ntsClr",i.appendChild(k))}else i.innerHTML=k;0===g&&(i.id="fTblFTd")}for(var m,j=0;j<d.length;j++){f=h.insertRow(j+1);k=d[j];for(g=0;g<e;g++)if(i=f.insertCell(g),0===g&&(i.id="fTblFTd"),m=k[b[g]],0==g)if(m&&null!==m[0]&&
|
|
0<m[0].length){l=document.createElement("SPAN");l.id="ICN"+j;l.notes=m;var n=l.notes[0];58<n.length&&(n=n.substr(0,58)+"...");$(l).html(n);i.appendChild(l);58<n.length&&(m=$("<a href='javascript:;' class='fitment-moreless' />"),m.data({id:l.id,shortValue:n,mode:"MORE"}),m.attr("aria-expanded",!1),m.html(c.conf.more),i.appendChild(m.get(0)));l=$("#"+l.id);l.on("hover touchend",function(){$(document).trigger("rover",{sid:"p2047675.l1559"});event.preventDefault()});i.style.width="20%"}else i.innerHTML=
|
|
" ",i.style.width="5%";else 100==c.conf.site&&"Parts Diagram"==a[g]?m&&null!==m[0]&&0<m[0].length?(l=document.createElement("A"),l.innerHTML='<span class="gspr oeZoom"> </span>',l.style.textDecoration="none",i.id="DIA"+j,i.oeUrl=m[0],i.refNo=m[1],i.qty=m[2],i.onclick=function(){$(document).trigger("rover",{sid:"p2047675.l4026"});c.showDiagram(this.oeUrl,this.id);c.updateOEMDiagram(this.refNo,this.qty)},i.appendChild(l),i.style.width="10%",i.style.textAlign="center",i.className="pDiaTd"):
|
|
(i.innerHTML=" ",i.style.width="10%"):i.innerHTML=m?m:"All"}c.pubsub.publish("_CLOSE_OLAY",{cmpId:c.conf.olyId});h.onmouseleave=function(){c.pubsub.publish("_CLOSE_OLAY",{cmpId:c.conf.olyId})}},showDiagram:function(a,b){var d=this.getChild(this.conf.diaOvl),c=$("#ovlMainImg");this.pubsub.publish("_CLOSE_OLAY",{cmpId:this.conf.diaOvl});$("#mImg").find(".zoomIcon").remove();$("#mImg").find(".zoomImg").remove();d&&d.conf&&(c.hide(),this.buildDiagramImage(a),$("#ovlMainImg").parent().zoom({url:a}),
|
|
d.conf.trigger=b,d.conf.noFixedPos=!0,d.show($("#"+d.conf.trigger)))},buildDiagramImage:function(a){var b=this,d=document.createElement("img"),c=$("#ovlMainImg"),e=$("#ovlThrImg");d.src=a;e.attr("src","//p.ebaystatic.com/aw/pics/globalAssets/imgLoading_30x30.gif");e.show();d.complete||4===d.readyState?(c.attr("src",a),b.findnSetImageSize(a),e.hide(),c.show()):d.onload=function(){c.attr("src",a);b.findnSetImageSize(a);e.hide();c.show()};d.onerror=function(){}},findnSetImageSize:function(a){var b=this,
|
|
d,c=0,e=0;d=document.createElement("img");d.src=a;d.complete||4===d.readyState?(c=d.width,e=d.height,b.setImageSize(c,e)):d.onload=function(){c=d.width;e=d.height;b.setImageSize(c,e)}},setImageSize:function(a,b){var d=0,c=0,e=0;if(640<a||600<b){if(d=640/a>600/b?600/b:640/a)c=b*d,e=a*d}else c=b,e=a;$("#ovlMainImg").css({width:e,height:c})},setRover:function(a,b){if("undefined"==typeof this.lastLinkId||this.lastLinkId!=b)(new Image).src="//rover.ebay.com/roverclk/0/0/9?trknvp=sid%3D"+a+"."+b;this.lastLinkId=
|
|
b},updateVehicleCount:function(a){var b=document.getElementById(this.conf.mainId+"_vct");b&&(b.innerHTML=a)},updateHTCount:function(a){var b=document.getElementById(this.conf.mainId+"_htct");b&&(b.innerHTML=a)},showNotes:function(a,b){var d=this.getChild(this.conf.olyId);this.pubsub.publish("_CLOSE_OLAY",{cmpId:this.conf.olyId});d&&d.conf&&(document.getElementById(this.conf.mainId+"notesOlp").innerHTML=a,d.conf.trigger=b,d.show($("#"+d.conf.trigger)))},createFilters:function(a,b,d){for(var c=this,
|
|
e=c.conf,h="-"+c.conf.selectTxt+"-",f,g=0;g<b.length;g++){f=a.insertCell(g);f.style.paddingRight="10px";var i=document.createElement("SELECT");i.id=b[g];i.index=g;3<=g&&(i.style.width="150px");"B_Component"!=b[g]&&(i.onchange=function(){c.makeNavRelCall(this)});if("100"==c.conf.site&&"Trim"===b[g]&&848!=e.catalogId){i.options[0]=new Option(h,"");var j=document.createElement("SELECT");j.id="Submodel";j.style.display="none";f.appendChild(j)}else"100"==c.conf.site&&"Engine"===b[g]&&848!=e.catalogId?
|
|
(i.options[0]=new Option(h,""),j=document.createElement("SELECT"),j.id="Engine - Liter_Display",j.style.display="none",f.appendChild(j)):i.options[0]="B_Engine"===b[g]?new Option(c.conf.allEng,""):"B_Model"===b[g]?new Option(c.conf.allModel,""):"B_Component"===b[g]?new Option("--",""):new Option(h,"");f.appendChild(i);f=d?c.conf.selectTxt+" "+d[g]:c.conf.selectTxt;i.setAttribute("title",f);if(0!==g||0!=g)i.disabled=!0}},makeNavRelCall:function(a){var b=this.getUrl(a,!1,this.MDDS),d=a.selectedIndex,
|
|
c=this.srchFlds,e=c.length;if("100"==this.conf.site&&848!=this.conf.catalogId)if("Trim"==a.id){var h=this.isFieldsMapped1to1("Submodel","Trim");-1<h&&(elem=document.getElementById("Submodel"),elem.selectedIndex=h)}else"Engine"==a.id&&(h=this.isFieldsMapped1to1("Engine - Liter_Display","Engine"),-1<h&&(elem=document.getElementById("Engine - Liter_Display"),elem.selectedIndex=h));b+="&pn="+this.getPropertyNames(c);this.resetSrchFlds(a);a.index+1<e&&0<d&&"B_Component"!=c[a.index+1]?("100"==this.conf.site&&
|
|
848!=this.conf.catalogId&&(d=b,"Trim"==c[a.index+1]?this.makeCall(d+"&rf=Submodel",this.updateFilters):"Engine"==c[a.index+1]&&(d+="&rf=Engine - Liter_Display",this.makeCall(d,this.updateFilters))),b+="&rf="+c[a.index+1],this.makeCall(b,this.updateFilters)):this.setButtonState()},resetSrchFlds:function(a){var b=this.srchFlds;if(null!==b)for(var d=0;d<b.length;d++){var c=document.getElementById(b[d]);!this.start&&(c&&c.index>a.index)&&(c.selectedIndex=0);c&&(c.disabled=a&&c?a.index<c.index:0<d)}this.setButtonState()},
|
|
updateFilters:function(a){this.fillFilters(a.data);this.setButtonState()},setButtonState:function(){var a=this.srchFlds,b=!0,d=!0,c=a.length,e=document.getElementById("B_Component");if(e){for(var h=0;3>h;h++)if((f=document.getElementById(a[h]))&&0===f.selectedIndex){d=!1;break}e.disabled=!d;c-=1}for(h=0;h<c;h++){var f=document.getElementById(a[h]);if(f&&0===f.selectedIndex){b=!1;break}}if(a=document.getElementById(this.conf.mainId+"Go"))a.disabled=!b},fillFilters:function(a){var b=this.srchFlds;if("100"==
|
|
this.conf.site&&848!=this.conf.catalogId){var d=a[0];"Submodel"in d?this.updateHiddenField(d,"Submodel"):"Engine - Liter_Display"in d&&this.updateHiddenField(d,"Engine - Liter_Display")}for(var c=0;c<b.length;c++){if(this.isBoats&&!this.isCompLoaded){var e=document.getElementById(b[c]),h=this.getUrl(e,!1,this.MDDS);this.isCompLoaded=!0;h+="&rf=B_Component";this.makeCall(h,this.updateComponent)}try{if(0<a.length){var d=a[0],f=d[b[c]],e=document.getElementById(b[c]);if(f){if(e){3==c&&b[c+1]&&(document.getElementById(b[c+
|
|
1]).selectedIndex=0);this.clearOptions(e);for(h=0;h<f.length;h++)if(f[h]){var g=new Option(f[h],f[h]);e.options[h+1]=g;this.preSelect(e,g)}1===f.length&&(g.selected=!0);e.disabled=!1;0<e.selectedIndex&&this.makeNavRelCall(e)}}else if(("HSN-TSN"!==b[c]&&this.SP[e.id]&&""!==this.SP[e.id]||this.SP[e.id]&&""!==this.SP[e.id])&&1>=e.options.length){var i=new Option(this.SP[e.id],this.SP[e.id]);e.options[e.options.length]=i;i.selected=!0}}}catch(j){}}},updateComponent:function(a){a=a.data;if(0<a.length){var a=
|
|
a[0].B_Component,b=document.getElementById("B_Component");if(a&&b){for(var d=0;d<a.length;d++)if(a[d]){var c=new Option(a[d],a[d]);b.options[d+1]=c;this.preSelect(b,c)}1===a.length&&(c.selected=!0)}}},updateHiddenField:function(a,b){if(null==a||void 0==a){var d=document.getElementById(b);e.clearOptions(d)}else{var c=a[b],e=this;if(0<c.length&&(d=document.getElementById(b),c&&d)){e.clearOptions(d);for(var h=0;h<c.length;h++)if(c[h]){var f=new Option(c[h],c[h]);d.options[h+1]=f;e.preSelect(d,f)}1===
|
|
c.length&&(f.selected=!0)}}},preSelect:function(a,b){this.SP[a.id]&&this.SP[a.id]===b.value?(b.selected=!0,this.SP[a.id]=""):this.pdsFlds[a.id]&&this.pdsFlds[a.id]===b.value&&(b.selected=!0,this.pdsFlds[a.id]="")},getPropertyNames:function(a,b){for(var b="undefined"!==typeof b?b:"|",d="",c=0;c<a.length;c++)0!==c&&"DiagramURL"!=a[c]&&(d+=b),"DiagramURL"!=a[c]&&(d+=a[c]);return encodeURIComponent(d)},closeDD:function(){document.getElementById(this.ovelId).style.visibility="hidden"},clearOptions:function(a){for(var b=
|
|
a.options.length-1;0<b;b--)a.options[b]=null},clearTable:function(a){if(a=document.getElementById(a))for(var b=a.rows.length;0<b;b--)a.deleteRow(b-1)},getUrl:function(a,b,d,c){var e,h=this.conf.categoryId,f=this.conf.productId,g=this.conf.itemId,i=this.conf.PRecCount;this.valFromURL=0;e=this.conf.url;e+="&rand="+Date.now();e+="&site="+this.conf.site;e+="&vs="+this.conf.viewSite;d&&(e+="&req="+d);b||(a=a?this.getSrchFldPairs(a):this.getSrchFldPairs(!1,c),""!==a&&(e+="&sfp="+encodeURIComponent(a)),
|
|
d==this.CREQ&&(""==a&&this.conf.fitsFiltr&&(a=this.conf.fitsFiltr,e+="&sfp="+encodeURIComponent(a)),d=this.getSelectedVehicle(a),this.conf.myVehiclesOn&&(this.uniqueVehicle&&this.conf.isImplicitSaveOn)&&($($("#"+this.conf.mainId+"ieveh .crtval").children()[1]).html(d),this.SP={}),this.chosen=this.valFromURL=d,this.updateVehicleChosen(d)));h&&(e+="&cid="+h);f&&(e+="&pid="+f);g&&(e+="&item="+g);0<i&&(e+="&ct="+i);0<this.conf.previewItem&&(e+="&pi=1");return e},getSelectedVehicle:function(a){var b="",
|
|
d="",c="",a=decodeURIComponent(a).split("|"),e=[];if("100"==this.conf.site&&848!=this.conf.catalogId)for(var h=0;h<a.length;h++){var f=a[h].split(":");1<f.length&&e.push(f[0])}for(h=0;h<a.length;h++)if(f=a[h].split(":"),1<f.length&&"null"!=f[1]){if("100"==this.conf.site&&848!=this.conf.catalogId&&("Submodel"==f[0]?c+="+"+f[1]+"+":"Engine - Liter_Display"==f[0]&&(c+=f[1]),"Submodel"==f[0]&&-1<$.inArray("Trim",e)||"Engine - Liter_Display"==f[0]&&-1<$.inArray("Engine",e)))continue;0!=h&&(b+=" ",d+="~",
|
|
"100"==this.conf.site&&848!=this.conf.catalogId?3>h&&(c+="+"):c+="+");b+=f[1];d+=f[1];"100"==this.conf.site&&848!=this.conf.catalogId?3>h&&(c+=f[1]):c+=f[1]}this.selVel=encodeURIComponent(d);this.nullReccoKeyword=c;return b},updateVehicleChosen:function(a){var b=this.conf.mainId,d=document.getElementById(b+"vchsn");d&&(d.innerHTML=" "+a);if(d=document.getElementById(b+"vnmchsn"))d.innerHTML=" "+a+"."},vehFilterSelected:function(){document.getElementById(this.srchFlds["77"==this.conf.site?1:0]).disabled=
|
|
!1;$("#"+this.conf.mainId+"Go").attr("disabled",!0)},mvRadioClicked:function(){this.resetSrchFldFilters();$("#"+this.conf.mainId+"Go").attr("disabled",!0)},dropdownClicked:function(){this.resetSrchFldFilters();this.conf.pullMenuCSId&&this.pubsub.publish("_CLOSE_OLAY",{cmpId:this.conf.pullMenuCSId});this.conf.helpCSId&&this.pubsub.publish("_CLOSE_OLAY",{cmpId:this.conf.helpCSId})},createHsnTsnFilters:function(a){var b=this,d=a.insertCell(0);d.style.paddingRight="10px";var c=document.createElement("INPUT");
|
|
c.type="TEXT";c.maxLength=4;c.size=5;c.id=b.conf.mainId+"hsnBox";c.value="zu 2";c.style.color="#999999";c.onfocus=function(){$("#"+b.conf.mainId+"htfltr").prop("checked",!0);$("#"+b.conf.mainId+"hsnBox").prop("disabled",!1);$("#"+b.conf.mainId+"tsnBox").prop("disabled",!1);for(var a=b.srchFlds,c=1;c<a.length;c++){var d=document.getElementById(a[c]);d.selectedIndex=0;d.disabled=!0}$("#"+b.conf.mainId+"Go").prop("disabled",!1);b.emptyTextBox(this)};$("#"+b.conf.mainId+"htfltr");c.disabled=!1;d.appendChild(c);
|
|
d=a.insertCell(1);d.style.paddingRight="10px";c=document.createElement("INPUT");c.type="TEXT";c.maxLength=3;c.size=4;c.id=b.conf.mainId+"tsnBox";c.value="zu 3";c.style.color="#999999";c.onfocus=function(){$("#"+b.conf.mainId+"htfltr").prop("checked",!0);$("#"+b.conf.mainId+"hsnBox").prop("disabled",!1);$("#"+b.conf.mainId+"tsnBox").prop("disabled",!1);for(var a=b.srchFlds,c=1;c<a.length;c++){var d=document.getElementById(a[c]);d.selectedIndex=0;d.disabled=!0}$("#"+b.conf.mainId+"Go").prop("disabled",
|
|
!1);b.emptyTextBox(this)};vehRadio&&vehRadio.checked&&(c.disabled=!1);d.appendChild(c)},emptyTextBox:function(a){a.value="";a.style.color="#000000"},makeHTPageCall:function(a){var b="",d="",b=document.getElementById(this.conf.mainId+"hsnBox").value,d=document.getElementById(this.conf.mainId+"tsnBox").value;if(4!==b.length||3!==d.length)this.pubsub.publish("_CLOSE_OLAY",{cmpId:this.conf.pullMenuCSId}),this.showHide("dcthd ctVMTxt ctHTMTxt ctHTNMTxt ctVNMTxt dctbl err".split(" "),!0),this.showHide(["ctHTIFTxt",
|
|
"_ctshd"],!1);else{this.showHide("dcthd ctVMTxt ctHTMTxt ctHTNMTxt ctVNMTxt ctHTIFTxt".split(" "),!0);var c=this.getUrl(!1,!0,this.CREQ),c=c+("&pn="+this.getPropertyNames(this.propNames));a?(a=a.request.page)&&(c+="&page="+a):c+="&page=1";c=c+"&rmode=1"+("&sfp="+("hsn:"+b+"|tsn:"+d));this.chosen=b+"/"+d;this.makeCall(c,this.parseHTResponse);this.showHide(["dctbl"],!0);this.showHide(["goSpan"],!0);this.showHide(["goThrbr"],!1)}},parseHTResponse:function(a){if("SUCCESS"===a.status.name&&a.hsnTsnExpansion)if(0<
|
|
a.data.length){var b=a.data.length,d=a.propertyNames,c=a.displayNames;this.clearTable(this.conf.mainId+"htevtbl");for(var e=d.length,h=document.getElementById(this.conf.mainId+"htevtbl"),f=h.insertRow(0),g=0;g<e;g++){var i=f.insertCell(g);i.style.fontWeight="bold";i.height="30px";i.innerHTML=0==g?" ":c[g]}this.overlayRowCount=b;for(c=0;c<b;c++){var f=h.insertRow(c+1),j=a.data[c];1==c%2&&(f.style.background="#DEE5FF");for(g=0;g<e;g++)if(0==g){i=f.insertCell(g);i.height="30px";var k=null;try{k=
|
|
document.createElement("<input name='vehpick' type='radio' id='"+this.conf.mainId+"pick"+c+"' value='"+this.getChoosenVehicle(d,j)+"' />")}catch(l){}k||(k=document.createElement("INPUT"),k.type="RADIO",k.id=this.conf.mainId+"pick"+c,k.name="vehpick",k.value=this.getChoosenVehicle(d,j));i.appendChild(k)}else i=f.insertCell(g),i.innerHTML=j[d[g]]}this.pubsub.publish("_CLOSE_OLAY",{cmpId:this.conf.htOverlayOSId});if((a=this.getChild(this.conf.htOverlayOSId))&&a.conf)a.conf.trigger=this.conf.hsnTsnGoBtn,
|
|
a.show($("#"+a.conf.trigger))}else this.showHide("dcthd ctVMTxt ctHTMTxt ctHTIFTxt ctVNMTxt dthr dctbl err".split(" "),!0),this.showHide(["ctHTNMTxt","ctshd"],!1);this.pubsub.publish("_CLOSE_OLAY",{cmpId:this.conf.pullMenuCSId})},htOlySelect:function(){for(var a,b=this.overlayRowCount,d=0;d<b;d++)if((a=document.getElementById(this.conf.mainId+"pick"+d))&&a.checked){this.showAll=!1;var c=this.getUrl(!1,!0,this.CREQ),c=c+("&pn="+this.getPropertyNames(this.propNames)),c=c+"&page=1";a=a.value;c+="&sfp="+
|
|
a;this.pubsub.publish("_CLOSE_OLAY",{cmpId:this.conf.htOverlayOSId});var e="",e=a.split("|");this.chosen=e=this.getChsnValue(e);this.sfArg=a;this.updateMyVeh=!0;this.makeCall(c,this.displayCompatibilityInfo);this.showHide(["dctbl"],!0);this.showHide(["dthr"],!1)}},snOlySelect:function(a){for(var b,d=this.overlayRowCount,c=0;c<d;c++)if((b=document.getElementById(this.conf.mainId+"pick"+c))&&b.checked){this.showAll=!1;var e=this.getUrl(!1,!0,this.CREQ),e=e+("&pn="+this.getPropertyNames(this.propNames)),
|
|
e=e+"&page=1";b=b.value;e+="&sfp="+b;this.pubsub.publish("_CLOSE_OLAY",{cmpId:a});var h="",h=b.split("|");this.chosen=h=this.getChsnValue(h);this.sfArg=b;this.updateMyVeh=!0;this.makeCall(e,this.displayCompatibilityInfo);this.showHide(["dctbl"],!0);this.showHide(["dthr"],!1)}},getChsnValue:function(a){for(var b="",d=0;d<a.length;d++){var c=a[d].split(":");1<c.length&&"null"!=c[1]&&(0!=d&&(b+=" "),b="--"==c[1]?b+"[--]":b+c[1])}return b},getChoosenVehicle:function(a,b,d){for(var c="",e=d=d?0:1;e<a.length;e++)e!==
|
|
d&&(c+="|"),c+=a[e]+":"+b[a[e]];return c},sltRowOlyCancel:function(a){this.pubsub.publish("_CLOSE_OLAY",{cmpId:a})},getSrchFldPairs:function(a,b){var d="",c=this.srchFlds,e="",h="";if(null!==c){for(var f=this.fldsSel=0;f<c.length;f++){var g=document.getElementById(c[f]);if(g&&0!==g.selectedIndex){this.fldsSel++;0!==f&&(d+="|",e+="~","100"==this.conf.site&&848!=this.conf.catalogId?3>f&&(h+="+"):h+="+");if(!this.isGoClicked||!g.disabled)d+=g.id+":"+g.options[g.selectedIndex].value,e+=g.options[g.selectedIndex].value,
|
|
"100"==this.conf.site&&848!=this.conf.catalogId?3>f&&(h+=g.options[g.selectedIndex].value):h+=g.options[g.selectedIndex].value;if(a&&a.id===g.id)break}}this.selVel=encodeURIComponent(e);b&&("100"==this.conf.site&&848!=this.conf.catalogId)&&(c=this.isFieldsMapped1to1("Submodel","Trim"),-1!=c&&(g=document.getElementById("Submodel"),d=d+"|"+(g.id+":"+g.options[c].value),h=h+"+"+g.options[c].value+"+"),c=this.isFieldsMapped1to1("Engine - Liter_Display","Engine"),-1!=c&&(g=document.getElementById("Engine - Liter_Display"),
|
|
d=d+"|"+(g.id+":"+g.options[c].value),h+=g.options[c].value));this.nullReccoKeyword=h}return encodeURIComponent(d)},isFieldsMapped1to1:function(a,b){var d=document.getElementById(a),c=document.getElementById(b);if(null==d||void 0==d||null==c||void 0==c)return-1;for(var c=c.options[c.selectedIndex].value,e=0,h=0,f=0;f<d.length;f++)null!=d[f].value&&(void 0!=d[f].value&&""!=d[f].value&&0==c.indexOf(d[f].value))&&(e++,h=f);return 1==e?h:-1}}});(function(a){var i={url:!1,icon:!0,callback:!1,duration:120,on:"mouseover"};a.fn.zoom=function(r){return this.each(function(){var c=a(this),b=new Image,e=a(b),j=c.css("position"),d=a.extend({},i,r||{}),n=!1;c.css({position:/(absolute|fixed)/.test(j)?j:"relative",overflow:"hidden"});if(!d.url&&(d.url=c.find("img").attr("src"),!d.url))return;d.icon&&a('<div class="zoomIcon"/>').appendTo(c);b.onload=function(){function i(){k=c.outerWidth();l=c.outerHeight();j=(b.width-k)/k;q=(b.height-l)/l}function f(a){g=
|
|
a.pageX-m.left;h=a.pageY-m.top;g>k?g=k:0>g&&(g=0);h>l?h=l:0>h&&(h=0);b.style.left=g*-j+"px";b.style.top=h*-q+"px";a.preventDefault()}function o(b){a(c.children()[0]).css({visibility:"hidden"});m=c.offset();i();f(b);e.stop().fadeTo(a.support.opacity?d.duration:0,1)}function p(){e.stop().fadeTo(d.duration,0);a(c.children()[0]).css({visibility:"visible"})}var k,l,j,q,g,h,m=c.offset();e.addClass("zoomImg").css({position:"absolute",top:0,left:0,opacity:0,width:b.width,height:b.height,border:"none",maxWidth:"none"}).appendTo(c);
|
|
"grab"===d.on?e.mousedown(function(b){m=c.offset();a(document).one("mouseup",function(){p();a(document).unbind("mousemove",f)});o(b);a(document).mousemove(f);b.preventDefault()}):"click"===d.on?e.click(function(b){if(!n)return n=!0,o(b),a(document).mousemove(f),a(document).one("click",function(){p();n=!1;a(document).unbind("mousemove",f)}),!1}):(i(),e.hover(o,p).mousemove(f));a.isFunction(d.callback)&&d.callback.call(b)};b.src=d.url})};a.fn.zoom.defaults=i})(jQuery);raptor.defineClass("ui.Pulldown",function(){return{events:["change"],defaultConfig:{id:"",triggerMode:"click",width:"auto",height:"auto",hasIcon:!0,onChange:null,type:"normal",preventDefault:!1},clzName:{normal:"",anchor:"achr"},init:function(a){this.config=$.extend(!0,{},this.defaultConfig,a);this.pulldown=$("#"+this.config.id);this.select=this.pulldown.find("ul.select");this.options=this.pulldown.find("li.op");this.hdr=this.selectedOption=this.currentValue=this.currentOption=this.currentOptionWpr=
|
|
null;this.dropped=!1;this.select.css("display","none");this.pulldown.addClass(this.clzName[this.config.type]);this.buildCurrentSelect();this.regHdlr()},buildCurrentSelect:function(){var a=this.config;this.currentOptionWpr=$("<a href='javascript:;' class='crtval'><span></span></a>");this.pulldown.prepend(this.currentOptionWpr);this.currentOption=this.currentOptionWpr.find("span");this.highlightSelected();try{if("auto"!=a.width&&(this.currentOptionWpr.css("width",parseInt(a.width)),this.pulldown.css("width",
|
|
this.currentOptionWpr.outerWidth()+20)),"auto"!=a.height){var b=parseInt(a.height)+"px";this.currentOptionWpr.css({height:b,"line-height":b,"padding-top":"0px","padding-bottom":"0px"});this.select.css("top",b)}else this.select.css("top",this.currentOptionWpr.outerHeight()+"px")}catch(c){}a.hasIcon&&(this.hdr=$("<b class='icn'></b>"),this.currentOptionWpr.prepend(this.hdr),this.currentOptionWpr.css("padding-right",this.hdr.width()+10+"px"),this.hdr.css("top",Math.round(this.currentOptionWpr.outerHeight()-
|
|
this.hdr.height())/2+"px"));this.select.find("li.hr").css("width",this.select.width())},highlightSelected:function(a){a=this.selectedOption=a?a:this.select.find("li.sel");0==a.length&&(a=this.selectedOption=this.select.find("li:first-child"));this.currentOption.html(a.attr("label")?a.attr("label"):a.html())},regHdlr:function(){var a=this,b=a.config;"mouseover"==b.triggerMode?(a.currentOptionWpr.mouseover(function(){a.toggleDropdown(!0)}),a.currentOptionWpr.mouseout(function(){a.toggleDropdown(!1)}),
|
|
a.select.mouseover(function(){a.dropped=!0}),a.select.mouseout(function(){a.toggleDropdown(!1)})):(a.currentOptionWpr.click(function(){a.toggleDropdown(!0);return!1}),a.hdr.click(function(){a.toggleDropdown(!0);return!1}),$("body").click(function(){a.toggleDropdown(!1)}));a.options.live("click",function(){var c=$(this);a.toggleDropdown(!1);if(c.attr("value")!=a.currentValue&&(a.selectedOption.removeClass("sel"),c.addClass("sel"),a.currentValue=c.attr("value"),a.highlightSelected(c),b.onChange&&"function"===
|
|
$.type(b.onChange)&&b.onChange(),a.publish("change",a),b.preventDefault))return!1})},toggleDropdown:function(a){var b=this;a?(b.dropped=!0,b.select.css("display","block")):(b.dropped=!1,setTimeout(function(){b.dropped||b.select.css("display","none")},100))},getCurrentValue:function(){return this.currentValue},insertOption:function(a,b,c,d){a=$("<li class='op"+(d?" sel":"")+"' value='"+b+"'"+(c?" label='"+c+"'":"")+">"+a+"</li>");this.select.append(a);this.options=this.select.find("li.op");d&&(this.selectedOption.removeClass("sel"),
|
|
this.highlightSelected(a))}}});raptor.defineClass("com.ebay.raptor.vi.Description",function(){return{init:function(a){var b=this;b.cfg=a;b.tId="";b.bSwap=!1;b.logHorzScrollRoverSent=!1;b.extendDescContainerRoverSent=!1;"function"==typeof window.postMessage?(window.addEventListener?window.addEventListener("message",function(a){b.rcvMsg(a)},!1):window.attachEvent("onmessage",function(a){b.rcvMsg(a)},!1),(a=document.getElementById("desc_ifr"))&&!b.executed&&a.contentWindow.postMessage(JSON.stringify({op:"resizeIframe"}),"*")):($("#desc_ifr").hasClass("lazyload")&&
|
|
(b.needsToCheckHashChange=!0),b.startTimer());b.frameBuster(window.location.href);b.pubsub=raptor.require("pubsub");b.pubsub.subscribe("_RESET_FRAME_RESIZE_FLAG",function(){b.executed=!1},b);b.cfg.descSnippetEnabled&&b.bindDescOverlayEvents();try{var c=0;$("#desc_div").one("mouseenter",function(){c=(new Date).getTime()});$("#desc_div").one("mouseleave",function(){var a=(new Date).getTime()-c;trackingUtil("VI_DESC_HOVERED","ex1",a)})}catch(d){}},startTimer:function(){var a=this;a.tId=a.needsToCheckHashChange?
|
|
window.setInterval(function(){a.checkMsg()},1E3):window.setTimeout(function(){a.checkMsg()},1E3)},bindDescOverlayEvents:function(){var a=this,b=0;$(a.cfg.descSnippetOpenBtn).on("click",function(){var c=document.getElementById("desc_ifr");c&&1>b&&("function"==typeof window.postMessage?c.contentWindow.postMessage(JSON.stringify({op:"resizeIframe"}),"*"):a.startTimer(),b++)})},checkMsg:function(){var a,b=window.location.hash;""!==b?a=this.parseData(b):(""===b||"undefined"===typeof b)&&this.startTimer();
|
|
a&&0!==a[0]&&this.resizeFrm(a)},parseData:function(a){var b=[0,0],c=a.indexOf("ht_"),d=a.indexOf("wt_"),c=a.substring(c+3,d),a=a.substring(d+3);b[0]+=Number(c);b[1]+=Number(a);return b},resizeFrm:function(a){var b=$.browser,c=document.getElementById("desc_ifr"),b=b.mozilla?24:54;""!==this.tId&&window.clearTimeout(this.tId);isNaN(a[0])||("undefined"!==typeof a[0]&&0<a[0]&&(c.height=a[0]+b),isNaN(a[1])||("undefined"!==typeof a[1]&&0<a[1]&&(c.width=this.cfg.descSnippetEnabled?"100%":a[1],this.extendDescContainer(c,
|
|
a),this.logHorzScroll(a[1])),$(window).trigger("collections_resize")))},logHorzScroll:function(a){var b=$("#storeHeader"),c=$("#Body").hasClass("sz940"),d=$("#Body").hasClass("sz1152"),e=$("#Body").hasClass("sz1280");b&&0<b.length&&(a+=b.outerWidth());if((c&&898<a||d&&1110<a||e&&1238<a)&&$(document).width()>$(window).width())c={},d=$(".iti-act-num"),c.imp="2047686",c.dw=a,c.vw=$(window).width(),c.sh=b&&0<b.length?"true":"false",0<d.length&&(c.itm=d.html()),this.logHorzScrollRoverSent||(this.logHorzScrollRoverSent=
|
|
!0,$(document).trigger("rover",c))},extendDescContainer:function(a,b){var c=$("#desc_out_cr");if(c&&0<c.length){$(a);var d=b[1],e=$("#storeHeader"),f=$(document.body).hasClass("sz980"),g=$(document.body).hasClass("sz1200");e&&0<e.length&&(d+=e.outerWidth());if(f&&938<d||g&&1158<d)c.css({width:d+"px"}),c={},e=$("#itm_num"),c.imp="2047686",c.bh=b[0],c.bw=d,0<e.length&&(c.itm=e.html()),this.extendDescContainerRoverSent||(this.extendDescContainerRoverSent=!0,$(document).trigger("rover",c))}},rcvMsg:function(a){var b=
|
|
[],c,d=this.cfg.tgto.replace("http://","https://");if(!(a.origin!==this.cfg.tgto&&a.origin!==d)){try{c=JSON.parse(a.data)}catch(e){return}b[0]=parseInt(c.h);b[1]=parseInt(c.w);b[2]=c.t;b[3]=c.s;b[4]=c.e;b[5]=c.lt;this.resizeFrm(b);b[4]||(this.executed=!0);this.cfg.logDescTimer&&this.addDescLodTime(b[5]);try{var f=document.getElementById("desc_ifr"),a=JSON.stringify({windowHeight:window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,windowWidth:window.innerWidth||document.documentElement.clientWidth||
|
|
document.body.clientWidth});f.contentWindow.postMessage(a,"*")}catch(g){}}},frameBuster:function(a){top.location!=self.location&&top.location.replace(a)},ondemandTransl:function(a){a[2]&&(""!==a[2]&&!this.parseTitleForXSS(a[2]))&&(this.bSwap&&($(".it-icon-pd").insertAfter($("#itemTitle")),this.bSwap=!1),$("#itemTitle").html(a[2]),a[2].match(/text-align:right/)&&($("#itemTitle").find("p:first").addClass("it-mrg0"),$(".it-icon-pd")&&($("#itemTitle").find("p:first").prepend($(".it-icon-pd")),this.bSwap=
|
|
!0)));a[3]&&(""!==a[3]&&!this.parseTitleForXSS(a[3]))&&(st=$("#subTitle").html(a[3]))},parseTitleForXSS:function(a){return null!==a&&(-1!=a.indexOf("<script")||-1!=a.indexOf("<script"))?!1:!0},addDescLodTime:function(a){var b=raptor.require("ebay.profiler.Profiler");"undefined"!=typeof oGaugeInfo&&0!=a&&b.addParam("i_3i",a);try{"undefined"!=typeof oGaugeInfo&&("undefined"!=typeof descGaugeStartInfo&&null!=descGaugeStartInfo.descST)&&(loadStartTime=(new Date).getTime()-descGaugeStartInfo.descST-
|
|
a,b.addParam("i_4i",loadStartTime))}catch(c){}}}});raptor.defineClass("com.ebay.raptor.vi.description.VehiclePaidVhr",function(){return{init:function(b){this.cfg=b;this.pubsub=raptor.require("pubsub");this.bindClick()},bindClick:function(){var b=this,c=b.cfg;$("#acScore").bind("click",function(){var a=b.getChild(c.overlayId);a&&a.show()});$(".vi-vs-sfld > a , #vhrsl, .vi-vs-sval").click(function(a){a.preventDefault();a.stopPropagation();"vhrSeeClk"==a.target.id&&trackingUtil("VEHICLE_FREE_HISTORY_REPORT_DESCRIPTION_TAB");$("#viTabs_1").trigger("click",
|
|
["noTabTracking"]);if("vhrTitleCheckLbl"==a.target.id||"vhrTitleCheckVal"==a.target.id)window.location.hash="#title-and-problem-check";if("vhrOdoCheckLbl"==a.target.id||"vhrOdoCheckVal"==a.target.id)window.location.hash="#odometer-check";if("vhrAccidentsLbl"==a.target.id||"vhrAccidentsVal"==a.target.id)window.location.hash="#accident";if("vhrOwnersLbl"==a.target.id||"vhrOwnersVal"==a.target.id)window.location.hash="#vehicle-use-and-event-check"})}}});raptor.defineClass("ebay.viewItem.FilmStrip",function(){return{init:function(a){this.conf=a;this.imgArray=a.fsImgList;this.fsElm=$("#"+a.fsId);this.mainImgElm=$("#"+a.mainImgId);this.mainImgHldr=$("#"+a.mainImgHldr);this.pubsub=raptor.require("pubsub");this.handlrBinded||this.bindHandlr();this.registerPubSubEvents()},registerPubSubEvents:function(){var a=this;a.pubsub.subscribe("_TRIGGER_CLK_VI_FS_IMG_"+a.conf.fsId,function(b){a.triggerClickOnFsImg(b)},this)},bindHandlr:function(){this.handlrBinded=
|
|
!0;this.bindTriggerEvent()},bindTriggerEvent:function(){var a=this,b=a.conf;a.fsElm.bind("click",function(b){a.hideMainImgBg();a.handleClickEvt(b)});a.fsElm.bind("mouseover",function(b){a.hideMainImgBg();a.handleMouseoverEvt(b)});a.fsElm.bind("mouseout",function(b){a.hideMainImgBg();a.handleMouseoutEvt(b)});a.fsElm.ready(function(){a.placeBorder($("div#"+b.fsId+" > ul > li:nth-child(1)"))})},hideMainImgBg:function(){this.mainImgHldr.css("backgroundImage","none")},handleClickEvt:function(a){var b=
|
|
this.conf;if(!($(a.target).is("div#"+b.fsId+".flmstp")||"LI"==a.target.nodeName)){var c=parseInt(this.mainImgElm.attr("clk"))+1;c&&$("div#"+b.fsId+" > ul > li:nth-child("+c+")").css("border","");var d=-1;"LI"==a.target.nodeName?($(a.target).css("width","-=4").css("height","-=4").css("border","2px solid #666"),d=$(a.target).find("img").attr("index"),stockAttr=$(a.target).find("img").attr("stock")):($(a.target).parents("li").css("width","-=4").css("height","-=4").css("border","2px solid #666"),"IMG"==
|
|
a.target.nodeName?(d=$(a.target).attr("index"),stockAttr=$(a.target).attr("stock")):(d=$(a.target).find("img").attr("index"),stockAttr=$(a.target).find("img").attr("stock")));c&&$("div#"+b.fsId+" > ul > li:nth-child("+c+")").css("width","+=4").css("height","+=4");this.pubsub.publish("_VI_FS_CLK_EVT_"+b.fsId,{currentImgIndex:this.getCurImgIndex(a),selectedIndex:d});"undefined"!=typeof stockAttr?$("#sPhoto_picLabel").show():$("#sPhoto_picLabel").hide()}},placeBorder:function(a){a&&(this.mskuSkip?$(a).css("width",
|
|
"-=4").css("height","-=4").css("border","0px"):$(a).css("width","-=4").css("height","-=4").css("border","2px solid #666"))},handleMouseoverEvt:function(a){var b=this.conf;"LI"==a.target.nodeName||a.target.id==b.fsId||this.pubsub.publish("_VI_FS_MOUSE_IN_EVT_"+b.fsId,{currentImgIndex:this.getCurImgIndex(a)})},handleMouseoutEvt:function(){this.pubsub.publish("_VI_FS_MOUSE_OUT_EVT_"+this.conf.fsId,{})},getCurImgIndex:function(a){var b=0,b=$(a.target);return b="IMG"==a.target.nodeName?b.attr("index"):
|
|
$(b.find("img")).attr("index")},triggerClickOnFsImg:function(a){var b=this.conf;this.hideMainImgBg();var c=$("div#"+b.fsId+" > ul > li:nth-child("+(a.index+1)+")").position().top,d=this.fsElm.position().top,c=c-d+this.fsElm.scrollTop();0>c&&(c=0);this.fsElm.scrollTop(c);$("div#"+b.fsId+" > ul > li:nth-child("+(a.index+1)+") > a").click()}}});raptor.defineClass("com.ebay.raptor.vi.ItemAttributes",function(){return{init:function(a){$("#"+a.readMoreId).one("click",function(){$(document).trigger("rover",{sid:"p2047675.l2779"});$("#"+a.hiddenContentId).attr("aria-expanded","true").show();$("#"+a.readMoreId).hide()})}}});raptor.defineClass("raptor.vi.ActionPanel",function(){var i=!1;return{init:function(a){a.bulkCartItemIdAppended=!1;a.disableBINBtnFeatureON=a.disableBINBtnFeatureON;a.busy=!1;this.isBOPIS=a.isBOPIS;this.isBOPISOnly=a.isBOPISOnly;this.isPUDO=a.isPUDO;this.isEncodeBOPISUrl=a.isEncodeBOPISUrl;this.pubsub=raptor.require("pubsub");this.msgs=raptor.require("com.ebay.raptor.vi.MsgHandler");this.registerPubSubMsgs(a);this.bindClickEventsOnButtons(a);this.ajaxUtil=raptor.require("com.ebay.raptor.vi.AjaxUtil");
|
|
a.isSMEInterruptLayer&&(this.isSMEInterrupt=!0);a.isCartLyr&&(this.cartLyr=!0);this.isAddOnInstallationEnabled=!1;this.isAddOnInterceptEnabled=a.isAddOnInterceptEnabled;this.isAddOnInstallationChecked=!1;this.binUrl=a.binURL},bindClickEventsOnButtons:function(a){var b=this;if(a.isFeedbackLinkActive){var c=$(".vi-feedback"),e=$("#vi-feedback-link-to-olay");if(c&&0<c.length)e.on("click",function(){b.pubsub.publish("_OPEN_OLAY",{cmpId:"vi-feedback-overlay"});trackingUtil("VI_NEW_FEEDBACK_LNK")})}if(a.isEbayPlusUpsellLinkPresent&&
|
|
(c=$("#newEbayplusSignupLink")))c.on("click",function(a){a.preventDefault();b.pubsub.publish("_OPEN_OLAY",{cmpId:"vi-ebayplus-new-overlay"});trackingUtil("VI_NEW_EBAYPLUS_SIGNUP_LNK")});a.isSubmitButtonPresent&&($("form[name='viactiondetails']").submit(function(b){b.preventDefault();$("#"+a.binBtnId).click()}),$("#"+a.binBtnId+"_submit").click(function(b){b.preventDefault();$("#"+a.binBtnId).click()}),a.isModel.bin&&!a.isModel.bid&&$("form[name='viactiondetails']").attr("action",""));$("#"+a.binBtnId).click(function(d){a.submitURL=
|
|
a.binURL;a.binGXOUrl&&($("#sh-not-mayBe")&&0<$("#sh-not-mayBe").length)&&(a.submitURL=a.binGXOUrl);i||(b.pubsub.publish(b.msgs("VALIDATE_MSKU_VARIATIONS"),{}),b.submitBtn(a,a.binBtnId));d.preventDefault()});$("#"+a.bestOfferBtnId).click(function(d){a.submitURL=a.bestOfferURL;a.bestOfferTrackingId&&$(document).trigger("rover",{sid:a.bestOfferTrackingId});i||(b.pubsub.publish(b.msgs("VALIDATE_MSKU_VARIATIONS"),{}),b.submitBtn(a,a.bestOfferBtnId));d.preventDefault()});a.isATCRedesignLayerV1Active&&(b.validateAndAppendQty=
|
|
function(d){var c=$("#"+a.qtyBoxId);c&&0<c.length?"true"===$(c).attr(a.isValid)&&((c=$(c).val())?(d+=c.toString(),b.qtyValue=c.toString()):d+="1"):d+="1";return d},b.validateAndAppendMsku=function(a){try{if("undefined"==typeof b.variationId){var c=$("#sel-msku-variation");"undefined"!==typeof c&&(null!=c&&c&&0<c.html().length&&"-1"!=c.html())&&(b.variationId=c.html())}if(b.variationId)return a+b.variationId.toString()}catch(e){}},b.atcRedesignClkHandler=function(d){b.atcRedesignlayerCfg=d;b.pubsub.publish(b.msgs("VALIDATE_MSKU_VARIATIONS"),
|
|
{});b.pubsub.channel(d.atcRedesignOlayId).subscribe("_OLY_CLS_SVC",function(){b.onCloseATCLayer()},b);if($(".errorIcon").is(":visible"))return!1;if(a.noGuestCart)return d=a.isModel.shopCartPageURL,d=d+(b.validateAndAppendQty("&qty=")||"")+(b.validateAndAppendMsku("&vid=")||""),top.location=d,!1;b.pubsub.publish("_OPEN_OLAY",{cmpId:d.atcRedesignOlayId});b.overlayParent=$("#vi_oly_"+d.atcRedesignOlayId);b.atcOverlayContainer=b.overlayParent.find(".atc-layer-container");b.throbberEl=b.overlayParent.find(".atcThrobber");
|
|
b.atcLayerErrMsgTxt=b.overlayParent.find(".app-atc-layer__errorMessage--pageMessage > span");b.atcLayerWrapper=b.overlayParent.find(".atc-layer-wrapper");b.nodeServiceErr=b.overlayParent.find(".node-service-err");b.overlayCloseBtn=b.overlayParent.find(".viicon-close");b.spinnerTxt=b.overlayParent.find(".vi-spinnerText");b.smeLink=b.overlayParent.find(".app-atc-layer__sme >a");b.viewAllLink=b.overlayParent.find(".viewAllLink");b.showOrHidethrobber(!0);var d=b.validateAndAppendMsku("&variation_id=")||
|
|
"",c=b.validateAndAppendQty("&quantity=");b.ajaxUtil.getJSON("/cta/addtocart?item="+a.itemId+c+d+"&_trksid=p2047675.l1473",b.atcResponseHandler,b)},b.onCloseATCLayer=function(){var a={sid:b.overlayCloseBtn.attr("data-trkid")};$(document).trigger("pulsar",a);a=window.location.href;if(b.variationId)if(!(-1<a.indexOf("?"))&&!(-1<a.indexOf("var")))a+=b.validateAndAppendMsku("?var=");else if(-1<a.indexOf("?")&&!(-1<a.indexOf("var")))a+=b.validateAndAppendMsku("&var=");else if(-1<a.indexOf("&var=")||-1<
|
|
a.indexOf("?var="))var c=b.extractVariationId(a),a=a.replace("var="+c,b.validateAndAppendMsku("var="));top.location=a},b.atcResponseHandler=function(d){if(d){var c=d.css.toString().split("href=")[1],c=c.substring(1,c.length-2);$("head link[rel='stylesheet']").last().after(d.css);b.atcOverlayContainer.html(d.html);!d.atcStatus&&"down"===d.expsvc&&b.atcLayerErrMsgTxt&&b.atcLayerErrMsgTxt.text(a.errMsgATC);var e=document.createElement("img");e.onerror=function(){b.atcLayerWrapper.append(d.headerHTML);
|
|
b.atcLayerWrapper.find(".clzBtnSection").on("click",function(){b.pubsub.publish("_CLOSE_OLAY",{cmpId:b.atcRedesignlayerCfg.atcRedesignOlayId})});b.showOrHidethrobber(!1);b.pubsub.publish("_REPAINT_WINDOW",{cmpId:b.atcRedesignlayerCfg.atcRedesignOlayId})};e.src=c;b.attachTrackingEventListenerATC();b.smeLink&&b.smeLink.attr("target","_blank");b.viewAllLink&&b.viewAllLink.attr("target","_blank")}else b.showOrHidethrobber(!1),b.atcOverlayContainer.hide(),b.nodeServiceErr.show()},b.attachTrackingEventListenerATC=
|
|
function(){b.overlayParent.find("li.similar-item").on("click",function(){var a={sid:"p2484178.l"+$(this).attr("trk").toString()};$(document).trigger("rover",a)})},b.showOrHidethrobber=function(c){var e=[];if(c)b.atcOverlayContainer.hide(),b.nodeServiceErr.hide(),b.overlayCloseBtn.hide(),b.atcLayerWrapper.addClass("bgProgress"),b.throbberEl.show("slow",function(){var c=setTimeout(function(){b.spinnerTxt.fadeOut("slow",function(){b.spinnerTxt.text(a.throbberMessageATC_2).fadeIn("slow")})},4E3),d=setTimeout(function(){b.spinnerTxt.fadeOut("slow",
|
|
function(){b.spinnerTxt.text(a.throbberMessageATC_4).fadeIn("slow")})},7E3);e.push(c);e.push(d)}),b.pubsub.publish("_REPAINT_WINDOW",{cmpId:b.atcRedesignlayerCfg.atcRedesignOlayId});else{for(c=0;c<e.length;c++)clearTimeout(e[c]);b.atcLayerWrapper.removeClass("bgProgress");b.nodeServiceErr.hide();b.throbberEl.hide();b.overlayCloseBtn.show();b.atcOverlayContainer.show()}});b.pubsub.subscribe("_TRG_CLK_ATCREDESIGN_BTN",function(a){b.atcRedesignClkHandler(a)},this);b.pubsub.subscribe(b.msgs("SUBMIT_CARTBTN"),
|
|
function(a){b.pubsub.publish(b.msgs("VALIDATE_MSKU_VARIATIONS"),{});b.handleCartBtnClk(a)},this);b.pubsub.subscribe(b.msgs("SUBMIT_BINBTN"),function(a){b.submitBtn(a)},this);b.pubsub.subscribe(b.msgs("AUTO_REFRESH_DISABLE_BTN_SVC"),function(){i=!0;b.pubsub.publish("_VI_BTN_MSGS",{id:a.binBtnId,isDisable:!0})},this)},extractVariationId:function(a){var b=null;return b=(a=a.match(/var=[^&]*/))&&a[0]&&a[0].replace("var=","")},registerPubSubMsgs:function(a){var b=this;this.pubsub&&(this.pubsub.subscribe(b.msgs("TOGGLE_QTY_DISPLAY_STATE"),
|
|
function(a){this.variationId=a.variationId},this),this.pubsub.subscribe(b.msgs("UPDATE_STP_VALUES"),function(b){this.updateStpOverlay(a,b)},this),this.pubsub.subscribe("_WARRANTY_SELECTED",function(a){this.isWrty=a.isWrty},this),this.pubsub.subscribe("_ADDON_INSTALL_AVAILABLE",function(a){this.isAddOnInstallationEnabled=a.isAddOnInstallationEnabled},this),this.pubsub.subscribe("BYPASS_SME_BIN_INTERRUPT",function(a){this.isSMEInterrupt=a.isSMEInterrupt;$("#"+a.binBtnId).trigger("click")},this),this.pubsub.subscribe("TRIGGER_BIN_BTN",
|
|
function(){$("#"+a.binBtnId).trigger("click")},this),this.pubsub.subscribe("ADDON_INSTALLATION_STATUS_CHANGED",function(a){b.isAddOnInstallationChecked=a},this),this.pubsub.subscribe("ADDONS_REQUIRES_CALL_TO_ACTION",function(a){b.requireAddon=a.requireAddon;b.isAddOnInstallationChecked=a.isTireInstallationChecked}))},updateStpOverlay:function(a,b){if($("#"+a.qtyBoxId).attr("disabled")){$("#orgPrc").html(a.isModel.originalRetailPrice?a.isModel.originalRetailPrice:"");var c=a.isModel.amtSaved;a.isModel.savingsPercent&&
|
|
(c=a.isRedesign?a.isModel.savingsPercent+"% off":3==a.siteId?c+(" ("+a.isModel.savingsPercent+"% "+a.savingsRateUpperCase+"*)"):a.isEUSite?c+(" (-"+a.isModel.savingsPercent+" %*)"):c+(" ("+a.isModel.savingsPercent+"% "+a.savingsRateLowerCase+")"));$("#youSaveSTP").html(c?c:"");a.isModel.originalRetailPrice?$("#vi-orgPrc-container").show():$("#vi-orgPrc-container").hide();c?$("#vi-youSaveSTP-container").show():$("#vi-youSaveSTP-container").hide();$("#prcIsum").html(a.isModel.binPrice?a.isModel.binPrice:
|
|
"")}else $("#orgPrc").html(b.retailPrice?b.retailPrice:""),$("#youSaveSTP").html(b.amtSaved?b.amtSaved:""),$("#prcIsum").html(b.binPrice?b.binPrice:""),b.savingsPercentValue&&(c=$("#vi-discountValue"))&&0<c.length&&c.html(""+b.savingsPercentValue.toString()),b.retailPrice?$("#vi-orgPrc-container").show():$("#vi-orgPrc-container").hide(),b.amtSaved?$("#vi-youSaveSTP-container").show():$("#vi-youSaveSTP-container").hide()},handleCartBtnClk:function(a){if(this.cartLyr&&!this.isWrty)return this.pubsub.publish("TRG_CART_LYR",
|
|
{}),!1;this.submitBtn(a)},submitBtn:function(a,b){var c=null;if(a&&!a.busy){this.enDisButton(a,b,!0);var e=a.submitURL;if(e){var d=$("#"+a.qtyBoxId),f=null;if(this.isBOPIS&&!this.isAddOnInstallationChecked){var c=$("#vispw"),f=c.attr("uloc"),h=c.attr("ft"),c=c.attr("storeid");if(this.isBOPISOnly&&!c){try{$("#viTabs_1")[0].trigger("click",["noTabTracking"])}catch(i){$("#viTabs_1").trigger("click",["noTabTracking"])}trackingUtil("VIP_BLOCK_PURCHASE_BTNS");$("html, body").stop().animate({scrollTop:$("#shpCntId").offset().top},
|
|
700,"swing");this.enDisButton(a,b,!1);return!1}this.isEncodeBOPISUrl&&(f=encodeURIComponent(f));if(f=(f?"&uloc="+f:"")+(c?(this.isPUDO?"&locid=":"&storeid=")+c:"")+(h?"&ft="+h:""))e=a.submitURL+=f}if(d&&0<d.length)if("true"===$(d).attr(a.isValid)){h=a.isBulkCart?"qty":$(d).attr("name");d=$(d).val();e=b==a.cartBtnId&&a.isBulkCart?a.submitURL+"&item=iid:"+a.itemId+",qty:"+d:a.submitURL+"&"+(h+"="+d);try{if("undefined"==typeof this.variationId){var g=$("#sel-msku-variation");"undefined"!==typeof g&&
|
|
(null!=g&&g&&0<g.html().length&&"-1"!=g.html())&&(this.variationId=g.html())}}catch(j){}this.variationId&&(e=b==a.cartBtnId&&a.isBulkCart?e+(",vid:"+this.variationId):e+("&var="+this.variationId));if(b==a.binBtnId&&a.isSMEInterruptLayer){if(this.isSMEInterrupt)return this.enDisButton(a,b,!1),this.pubsub.publish("SME_BIN_INTERRUPT",{binBtnId:a.binBtnId}),!1;this.isSMEInterrupt=!0}if(this.requireAddon&&(b===a.binBtnId||b===a.cartBtnId))return g=b===a.binBtnId?"BUY_IT_NOW":"ADD_TO_CART",this.enDisButton(a,
|
|
b,!1),this.pubsub.publish("ADDON_CALL_TO_ACTION",{submitURL:e,buyItNowURL:this.binUrl,actionButtonType:g,bopisURLParam:f,itemId:a.itemId,itemQuantity:d,strmLineBinLayerInput:this.isShowStrmLineBin(a,b)?this.buildStrmLineBinLayerInput(e,h,d,this.variationId,f):null}),!1;if(this.isAddOnInterceptEnabled&&(!this.isWrty&&!a.wrtyflow)&&(b==a.binBtnId||b==a.cartBtnId))return this.pubsub.publish("ADDON_INTERCEPT",{vQty:d,subUrl:e}),!1;if(this.isWrty||!this.isWrty&&a.hasWrtyIntercept)if(b==a.binBtnId||b==
|
|
a.cartBtnId)return b==a.cartBtnId&&a.isBulkCart?a.bulkCartItemIdAppended||(a.submitURL=e,a.bulkCartItemIdAppended=!0):a.submitURL=e,this.enDisButton(a,b,!1),this.pubsub.publish("_WARRANTY",{vQty:d,btnId:a.binBtnId,cartConfig:a}),!1;if(this._doAddOnInstallation(a,b,d,e,c))return!1;if("t"==a.binEnabled&&b==a.binBtnId)return this.enDisButton(a,b,!1),this.pubsub.publish(this.msgs("BIN_SVC_ID"),{vQty:d,vId:this.variationId?this.variationId:""}),!1;if("t"==a.bolEnabled&&b==a.bestOfferBtnId)return this.enDisButton(a,
|
|
b,!1),this.pubsub.publish(this.msgs("BEST_OFFER_SVC_ID"),{vQty:d}),!1;if(b!=a.cartBtnId){if(this.triggerStrmLineBinOlay(a,b,e,h,d,this.variationId,f))return;top.location=e}else if(b==a.cartBtnId&&a.isBulkCart&&a.bulkCartItemIdAppended)top.location=a.submitURL;else{if(this.triggerStrmLineBinOlay(a,b,e,h,d,this.variationId,f))return;top.location=e}}else this.enDisButton(a,b,!1),this.pubsub.publish("LKDHDR_MOVETO_TOP",{ts:(new Date).getTime()});else{try{"undefined"==typeof this.variationId&&(g=$("#sel-msku-variation"),
|
|
"undefined"!==typeof g&&(null!=g&&g&&0<g.html().length&&"-1"!=g.html())&&(this.variationId=g.html()))}catch(k){}b==a.cartBtnId&&a.isBulkCart&&(e=a.submitURL+"&item=iid:"+a.itemId+",qty:1");this.variationId&&(e=b==a.cartBtnId&&a.isBulkCart?e+(",vid:"+this.variationId):e+("&var="+this.variationId));if(b==a.binBtnId&&a.isSMEInterruptLayer){if(this.isSMEInterrupt)return this.enDisButton(a,b,!1),this.pubsub.publish("SME_BIN_INTERRUPT",{binBtnId:a.binBtnId}),!1;this.isSMEInterrupt=!0}if(this.requireAddon&&
|
|
(b===a.binBtnId||b===a.cartBtnId))return g=b===a.binBtnId?"BUY_IT_NOW":"ADD_TO_CART",this.enDisButton(a,b,!1),this.pubsub.publish("ADDON_CALL_TO_ACTION",{submitURL:e,buyItNowURL:this.binUrl,actionButtonType:g,bopisURLParam:f,itemId:a.itemId,itemQuantity:"1",strmLineBinLayerInput:this.isShowStrmLineBin(a,b)?this.buildStrmLineBinLayerInput(e,null,null,this.variationId,f):null}),!1;if(this.isAddOnInterceptEnabled&&(!this.isWrty&&!a.wrtyflow)&&(b==a.binBtnId||b==a.cartBtnId))return this.pubsub.publish("ADDON_INTERCEPT",
|
|
{vQty:"",subUrl:e}),!1;if(this.isWrty||!this.isWrty&&a.hasWrtyIntercept)if(b==a.binBtnId||b==a.cartBtnId)return b==a.cartBtnId&&a.isBulkCart?a.bulkCartItemIdAppended||(a.submitURL=e,a.bulkCartItemIdAppended=!0):a.submitURL=e,this.enDisButton(a,b,!1),this.pubsub.publish("_WARRANTY",{vQty:"",btnId:a.binBtnId,cartConfig:a}),!1;if(this._doAddOnInstallation(a,b,"1",e,c))return!1;if("t"==a.binEnabled&&b==a.binBtnId)return this.enDisButton(a,b,!1),this.pubsub.publish(this.msgs("BIN_SVC_ID"),{vQty:"",vId:this.variationId?
|
|
this.variationId:""}),!1;if("t"==a.bolEnabled&&b==a.bestOfferBtnId)return this.enDisButton(a,b,!1),this.pubsub.publish(this.msgs("BEST_OFFER_SVC_ID"),{vQty:""}),!1;if(b!=a.cartBtnId){if(this.triggerStrmLineBinOlay(a,b,e,null,null,this.variationId,f))return;top.location=e}else if(b==a.cartBtnId&&a.isBulkCart&&a.bulkCartItemIdAppended)top.location=a.submitURL;else{if(this.triggerStrmLineBinOlay(a,b,e,null,null,this.variationId,f))return;top.location=e}}}}return!1},enDisButton:function(a,b,c){a.disableBINBtnFeatureON&&
|
|
(c?($("#"+b).attr("disabled","disabled"),a.busy=!0):($("#"+b).removeAttr("disabled"),a.busy=!1))},_doAddOnInstallation:function(a,b,c,e,d){if(this.isAddOnInstallationEnabled){if(d&&!this.isAddOnInstallationChecked)return!1;d="";void 0!==b&&b==a.binBtnId?d="BIN":"isBulkCart"in a&&(d="ATC");if(""!==d)return this.enDisButton(a,b,!1),this.pubsub.publish("ADDON_INSTALLATION_BUTTON_CLICK",{vQty:c,subUrl:e,buyAction:d,binUrl:this.binUrl}),!0}return!1},triggerStrmLineBinOlay:function(a,b,c,e,d,f,h){if(!this.isShowStrmLineBin(a,
|
|
b))return!1;this.enDisButton(a,b,!1);this.pubsub.publish("SHOW_STREAMLINE_BIN_OVERLAY",this.buildStrmLineBinLayerInput(c,e,d,f,h));return!0},isShowStrmLineBin:function(a,b){return a?"t"===a.isStreamLineBinLayer&&b===a.binBtnId||a.mapStpShowStrmLineBinLayer:!1},buildStrmLineBinLayerInput:function(a,b,c,e,d){a={ampUrlParams:{},signinRedirectUrl:a,bopisURLParam:d};b&&(a.ampUrlParams[b]=c);a.ampUrlParams.var=e;return a}}});raptor.defineClass("com.ebay.raptor.vi.BidHistory",function(){return{init:function(b){var a=this;a.pubsub=raptor.require("pubsub");a.cfg=b;a.pubsub&&(a.pubsub.subscribe(b.autoRefreshSvcId,function(b){a.refreshBids(b)},a),a.pubsub.subscribe("inlineBidUpdate",function(b){a.refreshBids(b)},a))},refreshBids:function(b){var a=this.cfg;b&&$("#"+a.bidCmpId).html(b.BidCount)}}});raptor.defineClass("com.ebay.raptor.vi.BidPrice",function(){return{init:function(a){var b=this;b.pubsub=raptor.require("pubsub");b.amountUtils=raptor.require("com.ebay.raptor.vi.powerbid.AmountUtils");b.cfg=a;b.bRP=!1;b.tId="";b.bMsgSent=!1;b.pubsub&&(b.pubsub.subscribe(a.autoRefreshSvcId,function(a){b.refreshBid(a)},b),b.pubsub.subscribe(a.ocbSvcId,function(a){b.setRP(a)},b),b.pubsub.subscribe(a.pbSvcId,function(a){b.setRP(a)},b),b.pubsub.subscribe(a.powSvcId,function(a){b.setRP(a)},b),b.pubsub.subscribe("inlineBidUpdate",
|
|
function(a){b.refreshBid(a)},b));"undefined"!==typeof a.bidInputId&&$("#"+a.bidInputId).click(function(){if($.browser.msie){var b=a.bidPlaceholderTxt.trim(),d=$("#"+a.bidInputId).val();b==d&&$(this).val("")}})},refreshBid:function(a){var b=this,c=b.cfg,d,e;a&&(d=!a.IsReserve||a.IsReserve&&a.IsReserveMet?!1:!0,c.isABINCounterEnabled&&(1<=a.BidCount&&!d&&!a.IsEnded&&!b.bMsgSent&&!c.isSPersistenBIN)&&(b.pubsub.publish(c.autoRefreshDisableBtnSvcId,{}),b.bMsgSent=!0),b.bRP&&window.clearTimeout(b.tId),
|
|
a.IsRefreshPage&&!b.bRP&&b.refreshPage(),0===b.getTimeLeft(a)&&(a.IsEnded&&!b.bRP)&&(b.tId=window.setTimeout(function(){b.refreshPage()},2500)),(d=a.CurrentPrice.MoneyStandard)&&$("#"+c.bpId).html(d),d=a.ViewerItemRelation,"HIGHBIDDER"==d&&a.MaximumBid?b.amountUtils&&b.amountUtils.parseCurrencyByCleanAmt(a.MaximumBid.CleanAmount)<b.amountUtils.parseCurrencyByCleanAmt(a.MinimumToBid.CleanAmount)?(d=a.MinimumToBid.MoneyStandard,e=c.mtbTxt):(d=a.MaximumBid.MoneyStandard,e=c.mtbHBTxt):(d=a.MinimumToBid.MoneyStandard,
|
|
e=c.mtbTxt),d&&(a.isAdminView?$("#"+c.mtbId).html(e.replace(c.dummy," ")):$("#"+c.mtbId).html(e.replace(c.dummy,d))),(d=a.LocalCurrentPrice)&&$("#"+c.cbLocalId).html(d.MoneyStandard),a.IsReserve&&(e=a.IsReserveMet?c.resTxt:c.resNMTxt,$("#"+c.resId).html(e)))},getTimeLeft:function(a){var a=a.TimeLeft,b=0;a&&(b=86400*a.DaysLeft+3600*a.HoursLeft+60*a.MinutesLeft+a.SecondsLeft);return b},setRP:function(){this.bRP=!0},refreshPage:function(){var a;a=window.location.href;a=a.replace(/#ht_.*/,"");a=a.replace("&autorefresh=true",
|
|
"");a+=-1!=a.indexOf("?")?"&autorefresh=true":"?autorefresh=true";top.location.replace(a)}}});raptor.defineClass("com.ebay.raptor.vi.itemsummary.BidSection",function(){var d={},h;d.pubsub=raptor.require("pubsub");d.bidClick=function(e,a,c,f,g,b){a=$("#"+a).val();c=$("#"+c).html();$.browser.msie&&b&&(b=b.trim(),a&&a==b&&(a=""));h=(new Date).getTime();d.pubsub.publish(e,{maxbid:a,shipping:c,impCharge:f,isRedirect:g,sPTBflOld:h})};return{init:function(e,a,c,f,g,b,i,h,l,m,j){var k=this;k.util=raptor.require("com.ebay.raptor.vi.bid.Util");b&&d.pubsub.subscribe(b,function(){d.bidClick(a,c,f,g,i,
|
|
j)},k);h&&(attachEventPressHandler=function(b){if(k.util.isEnterKey(b))return $("#"+c).blur(),d.bidClick(a,c,f,g,i,j),!1},$("#"+c).off(),$("#"+c).bind("keypress",attachEventPressHandler));m&&($("form[name='viactiondetails']").submit(function(a){a.preventDefault();$("#"+cfg.binBtnId).click()}),$("#"+e+"_submit").click(function(a){a.preventDefault();$("#"+e).click()}));$("#"+e).off();$("#"+e).click(function(b){l.trackBidBtn&&$(document).trigger("rover",{sid:l.bidTrackingId});d.bidClick(a,c,f,g,i,j);
|
|
b.preventDefault()})}}});raptor.defineClass("com.ebay.raptor.vi.RelativeEndTime",function(){return{init:function(a){this.replaceEndTime(a.dateElemSelector,a.dateAttr,a)},replaceEndTime:function(a,c,b){var a=$(a),d=a.attr(c),c="";if(d){var e=parseInt(d),d=new Date(e);if((e=this.diffMs(e))||0==e)c=this.structureDiffData(e),c=this.createRelativeTime(d,c,b);b.isEnded&&a.parent().css("margin-left","-7px");a.html(c)}},diffMs:function(a){a=new Date(a);if(isNaN(a.getTime()))return!1;var c=new Date;return a.getTime()-c.getTime()},
|
|
createRelativeTime:function(a,c,b){var d=a.getHours(),e=a.getMinutes(),f=b.AM,g=b.is24HR,e=9<e?e:"0"+e;g?f="":12<d?(d-=12,f=b.PM):12==d?f=b.PM:0==d&&(d=12);0==c.days&&(new Date).getDate()!=a.getDate()&&(c.days=1);c.days?(a=6<c.days||-1>=c.days?g?a.getDate()+"/"+(a.getMonth()+1):a.getMonth()+1+"/"+a.getDate():1<=c.days?this.getDay(a,b):b.endsTomorrowTerm,a=210==b.siteId?a+(", "+d+" h "+e+f):a+(", "+d+":"+e+f)):a=210==b.siteId?b.todayTerm+", "+d+" h "+e+f:b.todayTerm+" "+d+":"+e+f;b.isEnded&&(a=", ",
|
|
a=210==b.siteId?a+(d+" h "+e+f):a+(d+":"+e+f));return a},getDay:function(a,c){var b=a.getDay();return c.days[b]},structureDiffData:function(a){var a=a/1E3,c=parseInt(a/86400),b=a%3600;return{days:c,hours:Math.floor(a%86400/3600),minutes:Math.floor(b/60),seconds:Math.floor(b%60)}}}});raptor.defineClass("com.ebay.raptor.vi.TimeLeft",function(){return{init:function(a){var b=this;b.pubsub=raptor.require("pubsub");b.bidUtil=raptor.require("com.ebay.raptor.vi.bid.BidUtil");b.timeLeft={};b.stopTimer=!1;b.cfg=a;b.pubsub&&((a.isUrgencyHigh||a.isUrgencyMedHigh||a.enableAFAlways)&&(!a.isBinCounter&&!a.isDealsTimer)&&b.pubsub.publish(a.timerSvcId,{}),b.pubsub.subscribe(a.pbSvcId,function(){b.stopTimer=!0},b),b.pubsub.subscribe(a.powSvcId,function(){b.stopTimer=!0},b),b.pubsub.subscribe(a.ocbSvcId,
|
|
function(){b.stopTimer=!0},b),b.pubsub.subscribe(a.counterSvcId,function(a){b.timeLeftCounter(a)},b),b.pubsub.subscribe(a.autoRefreshSvcId,function(a){b.autoRefresh(a)},b),b.pubsub.subscribe(a.timerStopSvcId,function(){window.setTimeout(function(){b.refreshPage()},2500)},b));if(a.isBinCounter||a.isDealsTimer)a.timeLeft={day:a.timeLeft.daysLeft,hour:a.timeLeft.hoursLeft,minute:a.timeLeft.minutesLeft,second:a.timeLeft.secondsLeft},b.startCountdown(a.timeLeft)},timeLeftCounter:function(){var a;this.bidUtil&&
|
|
!this.stopTimer&&(a=this.bidUtil.decrementOneSec(this.getTimeLeft()),this.updateTimeLeft(a))},startCounter:function(a,b,c){var d=this.cfg,b={TimeLeft:a,AccessedDate:b,ViewerItemRelation:c,DetailLevel:d.detailLevel};this.setTimeLeft(a);this.pubsub&&this.pubsub.publish(d.counterStartSvcId,b)},startCountdown:function(a){var b=this.cfg;this.setTimeLeft(a);this.timeLeftCounter(b)},autoRefresh:function(a){var b;a&&!this.stopTimer&&(b=this.bidUtil.timeLeftV(a.TimeLeft),this.updateTimeLeft(b),this.startCounter(b,
|
|
a.AccessedDate,a.ViewerItemRelation))},updateTimeLeft:function(a){var b=this.cfg,c="";a&&($("#"+b.timeLeftId).removeClass(b.lessTimeCss),c=0>=a.hour&&!b.isDealsTimer?b.hotTimeCss:b.lessTimeCss,formatCfg={dayTxt:b.dayTxt,dayCharTxt:b.dayCharTxt,hourTxt:b.hourTxt,hoursTxt:b.hoursTxt,hourCharTxt:b.hourCharTxt,minuteCharTxt:b.minuteCharTxt,secondCharTxt:b.secondCharTxt,cssElemId:b.timeLeftId,css:c},c=this.bidUtil.timeLeftFormat(a,formatCfg,b.isDealsTimer,b.enableAFAlways),$("#"+b.timeLeftId).html(c),
|
|
this.pubsub.publish("VI_TIME_LEFT_UPDATE",{content:c,className:$("#"+b.timeLeftId).attr("class")}),b.isAccessibilityOffScreenTimerOn&&this.pubsub.publish("OFFSCREEN_BID",{timerId:"offscreenTimerPage",isOffScreenOnBidLayer:0,insertionPoint:$("#vi-time-wrapperSection"),timeLeft:a,sourceOfTimer:$("#vi-cdown_timeLeft")}))},setTimeLeft:function(a){self.timeLeft=a},getTimeLeft:function(){return self.timeLeft},refreshPage:function(){var a;a=window.location.href;a=a.replace(/#ht_.*/,"");a=a.replace("&autorefresh=true",
|
|
"");a+=-1!=a.indexOf("?")?"&autorefresh=true":"?autorefresh=true";top.location.replace(a)}}});raptor.defineClass("com.ebay.raptor.vi.ValidateQuantity",function(){return{init:function(a){var b=this;b.cfg=a;b.disableQtyChk=a.disableQtyCheck;b.pubsub=raptor.require("pubsub");b.pubsub.subscribe("VALIDATE_QTY",function(a){b.validate(a)},b);b.pubsub.publish("VALIDATE_QTY",a);$("#"+a.qtyBoxId).keyup(function(){b.pubsub.publish("VALIDATE_QTY",a);var c=a.smeOfferTiers;c&&0<c.length&&(0<$("#prcIsum").length&&b.adjustPrice($("#"+a.qtyBoxId).val(),$("#prcIsum"),c),0<$("#mm-saleDscPrc").length&&b.adjustPrice($("#"+
|
|
a.qtyBoxId).val(),$("#mm-saleDscPrc"),c))});b.msgs=raptor.require("com.ebay.raptor.vi.MsgHandler");b.registerPubSubMsgs(a)},adjustPrice:function(a,b,c){for(i in c)if(a>=parseInt(c[i].fromQuantityConditionValue)&&a<=parseInt(c[i].toQuantityConditionValue)){b.html(c[i].afterDiscountItemPriceWithSymbol);break}a>=parseInt(c[c.length-1].toQuantityConditionValue)&&b.html(c[c.length-1].afterDiscountItemPriceWithSymbol)},registerPubSubMsgs:function(a){this.pubsub&&(this.pubsub.subscribe(this.msgs("TOGGLE_QTY_DISPLAY_STATE"),
|
|
function(b){this.toggleQtyBox(a,b.isDisabled);this.variationId=b.variationId},this),this.pubsub.subscribe(this.msgs("VALIDATE_QTY_MSKU"),function(b){this.validateMSKUQty(a,b)},this),this.pubsub.publish(this.msgs("VALIDATE_QTY_MODULE_READY"),{}))},toggleQtyBox:function(a,b){$("#"+a.qtyBoxId).attr("disabled",b);b&&$("#"+a.qtyBoxId).attr(a.isValid,"false");$("#"+a.qtyBoxId).val(1)},validateMSKUQty:function(a,b){a.remainingQty=b.quantityAvailable;a.maxQty=b.supressQty?b.maxQty:b.quantityAvailable;a.variationId=
|
|
b.variationId;a.isSupressQty=1===b.quantityAvailable?!1:b.supressQty;this.pubsub.publish("VALIDATE_QTY",a)},validate:function(a){var a=a||this.cfg,b=raptor.require("pubsub");if(a){var c=$("#"+a.qtyBoxId),e=$(c).val(),d=a.remainingQty,j=a.maxQty,q=$("#"+a.errorIcon),m=$("#"+a.errorMsg),g=!0,f,k=d,r=this.isInteger(e),n=a.isMinRemnantSetEnabled,h=a.remnantQtyValue,o=0,l=0,p;n&&(o=d-h+1,l=d-e);if(!$(c).attr("disabled")){e=parseInt(e,10);!r||1>e?f=1===d?a.errTextMap[1]:a.errTextMap[3]:this.disableQtyChk?
|
|
g=!1:0<j&&e>j?j>d?f=a.errTextMap[4]:(f=a.errTextMap[2],k=j):e>d?f=a.isSupressQty||d>a.availQtyThreshold?a.errTextMap[4]:1===d?a.errTextMap[1]:a.errTextMap[0]:n?h===d&&e<h?(f=a.errTextMap[6],k=h):0<l&&l<h?(f=a.errTextMap[5],k=d,p=o):g=!1:g=!1;if(f&&(d=$("#"+f).html()))d=d.replace(a.dummyQty,k).replace(a.anotherfield,p),$(m).html(d);$(q).toggle(g);$(m).toggle(g);$(c).attr(a.isValid,g?"false":"true");b.publish("QTY_VALIDATION_OUTPUT",{isValid:!g,selectedQty:e})}}},isInteger:function(a){if(a){for(var b=
|
|
0,c=a.length;b<c;b++){var e=a.charAt(b);if(!("0"<=e&&"9">=e))return!1}return!0}return!1}}});raptor.defineClass("com.ebay.raptor.vi.itemsummary.gotogether.GoTogether",function(){return{init:function(a){var b=this,c;b.cfg=a;1<a.quantityTotal&&(b.enbaleGoTogether(),c=raptor.require("pubsub"),c.subscribe("QTY_VALIDATION_OUTPUT",function(a){b.enbaleGoTogether(a)},b),b.clkGoTogetherHandler=function(){b.clkGoTogether()});$("#"+a.helpIconId).click(function(){$(document).trigger("rover",{sid:"p2047675.l3122"})});a.showJITMsg&&(a=b.getChild(a.overlayId))&&a.conf&&a.show($("#"+a.conf.trigger))},enbaleGoTogether:function(){var a=
|
|
this.cfg,b=$("#"+a.qtyBoxId);b&&(this.isValid="true"===$(b).attr(a.isValid),this.selectedQty=$(b).val(),b=this.getChild(a.btnWidgetId),this.isValid&&1<this.selectedQty?b&&(b.enable(),$("#"+a.btnId).bind("click",this.clkGoTogetherHandler)):(b&&b.disable(),$("#"+a.btnId).unbind("click",this.clkGoTogetherHandler)))},clkGoTogether:function(){this.loadGoTogether()},loadGoTogether:function(){var a=this.cfg.btnUrl,b=-1;a&&(b=a.indexOf("?"),a+=(-1===b?"?":"&")+$.param({quantity:this.selectedQty}),window.location.href=
|
|
a)}}});raptor.defineClass("com.ebay.raptor.vi.jitmsg.JITMsg",function(){return{init:function(a){var b=this,c=raptor.require("pubsub");b.cfg=a;b.cfg.pubsub=c;a.showJITMsg&&c&&(b.closeHandler=c.channel(a.olpId).subscribe(a.closeSvcId,function(){try{b.toggleMsg()}catch(a){}},b),a.manualShowTrigger&&$(window).load(function(){$("#"+a.triggerId).trigger("mouseenter");$("#"+a.triggerId).trigger("click")}))},toggleMsg:function(){var a=this.cfg;$("#"+a.jitMsgId).hide();$("#"+a.helpMsgId).show();try{this.setCookie()}catch(b){}this.closeHandler.unsubscribe();
|
|
try{a.trackOnClose&&trackingUtil(a.trackingKey)}catch(c){}a.manualShowOnHover&&($("#"+a.triggerId).mouseover(function(){a.pubsub.publish("_OPEN_OLAY",{cmpId:a.olpId,trigger:a.triggerId})}),$("#"+a.triggerId).mouseout(function(){a.pubsub.publish("_CLOSE_OLAY",{cmpId:a.olpId,trigger:a.triggerId})}))},setCookie:function(){var a=this.cfg,b=raptor.require("ebay.cookies"),c=b.readCookie(a.cookieName,a.cookielet);b.writeCookielet(a.cookieName,a.cookielet,b.setBitFlag(c,a.cookieBit,1))}}});raptor.defineClass("raptor.vi.MapStp",function(){return{init:function(a){this.pubsub=raptor.require("pubsub");this.msgs=raptor.require("com.ebay.raptor.vi.MsgHandler");this.cfg=a;this.registerPubSubEvents(a);this.addEventListener(a)},registerPubSubEvents:function(){var a=this;a.pubsub.subscribe(a.msgs("UPDATE_MAP_VALUES"),function(b){a.updateMapOverlay(b)},this);a.pubsub.publish(a.msgs("VALIDATE_MAPSTP_MODULE_READY"),{})},updateMapOverlay:function(a){var b=this.cfg;b.varId=a.varId;a.binPrice?$("#"+
|
|
b.qtyBoxId).attr("disabled")||(this.cfg.msku={},this.cfg.msku.rp=a.retailPrice,this.cfg.msku.as=a.amtSaved,this.cfg.msku.bp=a.binPrice,$("#"+b.rpOlpId).html(a.retailPrice?a.retailPrice:""),$("#orgPrc").html(a.retailPrice?a.retailPrice:""),a.retailPrice?$("#orgPrc-lbl").show():$("#orgPrc-lbl").hide(),$("#"+b.asOlpId).html(a.amtSaved?a.amtSaved:""),$("#"+b.bpOlpId).html(a.binPrice?a.binPrice:"")):(this.cfg.msku={},this.setContent(b))},setContent:function(a){a&&(a.msku&&a.msku.bp?($("#"+a.rpOlpId).html(a.msku.rp?
|
|
a.msku.rp:""),$("#"+a.asOlpId).html(a.msku.as?a.msku.as:""),$("#"+a.bpOlpId).html(a.msku.bp?a.msku.bp:""),$("#orgPrc").html(a.msku.rp?a.msku.rp:""),a.msku.rp?$("#orgPrc-lbl").show():$("#orgPrc-lbl").hide()):($("#"+a.rpOlpId).html(a.rp?a.rp:""),$("#"+a.asOlpId).html(a.as?a.as:""),$("#"+a.bpOlpId).html(a.bp?a.bp:""),$("#orgPrc").html(a.rp?a.rp:""),a.rp?$("#orgPrc-lbl").show():$("#orgPrc-lbl").hide()))},addEventListener:function(a){var b=this,c={binBtnId:a.binBtnId,qtyBoxId:"qtyTextBox",submitURL:a.submitURL,
|
|
isValid:"isValid",mapStpShowStrmLineBinLayer:a.showStrmLineBinLayer};$("#"+a.binBtnId).click(function(){b.pubsub&&(b.pubsub.publish(b.msgs("VALIDATE_MSKU_VARIATIONS"),{}),"t"==a.binEnabled&&(c={binBtnId:a.binBtnId,qtyBoxId:"qtyTextBox",submitURL:a.submitURL,isValid:"isValid",binEnabled:"t"}),a.showStrmLineBinLayer&&b.pubsub.publish("_CLOSE_OLAY",{cmpId:a.mapPCOlyId}),b.pubsub.publish(b.msgs("SUBMIT_BINBTN"),c))});$("#"+a.mapPCId).click(function(){b.setContent(a)});!a.isMsku&&("DURING_CHECKOUT"==a.priceExposure&&
|
|
"t"==a.binEnabled)&&$("#"+a.mapPrcDChkId+" a").each(function(){$(this).attr("href","javascript:;");$(this).click(function(){b.pubsub.publish(b.msgs("BIN_SVC_ID"),{vQty:$("#"+c.qtyBoxId).val(),vId:"",dcl:!0});return!1})});a.isMsku&&"DURING_CHECKOUT"==a.priceExposure&&$("#"+a.mapPrcDChkId+" a").each(function(){$(this).attr("href","javascript:;");$(this).click(function(){if(b.pubsub&&(b.pubsub.publish(b.msgs("VALIDATE_MSKU_VARIATIONS"),{}),"true"==$("#"+c.qtyBoxId).attr(c.isValid)&&(-1!=a.varId||0<parseInt($("#"+
|
|
a.selectedVarDomId).html())))){if(void 0==a.varId||0>=a.varId)a.varId=$("#"+a.selectedVarDomId).html();if("t"==a.binEnabled)return b.pubsub.publish(b.msgs("BIN_SVC_ID"),{vQty:$("#"+c.qtyBoxId).val(),vId:a.varId,dcl:!0}),!1;b.duringChkoutUrl=a.duringChkoutUrl;a.duringCheckoutGXOUrl&&($("#sh-not-mayBe")&&0<$("#sh-not-mayBe").length)&&(b.duringChkoutUrl=a.duringCheckoutGXOUrl);window.location=b.duringChkoutUrl+"&var="+a.varId+"&quantity="+$("#"+c.qtyBoxId).val()}})})}}});raptor.defineClass("com.ebay.raptor.vi.msku.ItemVariations",function(){return{init:function(a){this.newTouchMsgFix=a.newTouchMsgFix;a.defaultPopStackWatchers=-1;a.updateSelectFlag=!0;this.setOptionsObj(a);this.pubsub=raptor.require("pubsub");this.msgs=raptor.require("com.ebay.raptor.vi.MsgHandler");this.bindEventsOnSelectBoxes(a);this.registerPubSubEvents(a);this.mskuDrpClkd=!1;try{this.pubsub.publish(this.msgs("VARIATIONS_CONFIG_READY"),a.itmVarModel)}catch(b){}-1!=a.itmVarModel.selectedVariationId&&
|
|
$("#"+a.selPrefix+"1").change();$(window).load(function(){a.isMSKURedesign&&$(document).trigger("rover",{sid:"p2047675.l5902"})})},registerPubSubEvents:function(a){var b=this;1>=parseInt(a.totalValidVariationsExt)&&-1==a.itmVarModel.selectedVariationId&&b.setVariationId(a);var c=a.hasCart?3:2;b.modulesReadyObj=a.isWdgtLoadingDelayed?{quant:0,list:0,cart:0,total:c,triggerThreshold:c}:{quant:0,list:0,cart:0,total:0,triggerThreshold:c};this.pubsub.subscribe(b.msgs("VALIDATE_MSKU_VARIATIONS"),function(){this.validateMskuSelectBoxes(a)},
|
|
this);this.pubsub.subscribe(b.msgs("TRIGGER_MSKU_IMG_GROUPING"),function(c){this.sendMSKUImgGroupsToFilmStrip(a,c)},this);this.pubsub.subscribe(b.msgs("VARIATION_EDIT_WATCH_STATUS"),function(c){a.itmVarModel.itemVariationsMap[c.variationId].variationWatched=c.variationWatched},this);a.isWdgtLoadingDelayed&&b.qtyReaadyOnLoad(a);this.pubsub.subscribe(b.msgs("VALIDATE_QTY_MODULE_READY"),function(){b.qtyReaadyOnLoad(a)},this);this.pubsub.subscribe(b.msgs("VALIDATE_MAPSTP_MODULE_READY"),function(){-1!=
|
|
a.itmVarModel.selectedVariationId&&a.itmVarModel.itemVariationsMap[a.itmVarModel.selectedVariationId].quantityAvailable&&this.makeMapStpUpdateCall(a,a.itmVarModel.selectedVariationId)},this);this.pubsub.subscribe(b.msgs("VALIDATE_LIST_MODULE_READY"),function(){-1!=a.itmVarModel.selectedVariationId&&a.itmVarModel.itemVariationsMap[a.itmVarModel.selectedVariationId].quantityAvailable&&(0==this.modulesReadyObj.list&&(this.modulesReadyObj.list=1,this.modulesReadyObj.total=this.modulesReadyObj.quant+this.modulesReadyObj.list+
|
|
this.modulesReadyObj.cart),this.modulesReadyObj.total==this.modulesReadyObj.triggerThreshold&&this.makeAllPostVariationValidationCalls(a,a.itmVarModel.selectedVariationId))},this);this.pubsub.subscribe(b.msgs("VALIDATE_CART_MODULE_READY"),function(){-1!=a.itmVarModel.selectedVariationId&&a.itmVarModel.itemVariationsMap[a.itmVarModel.selectedVariationId].quantityAvailable&&(0==this.modulesReadyObj.cart&&(this.modulesReadyObj.cart=1,this.modulesReadyObj.total=this.modulesReadyObj.quant+this.modulesReadyObj.list+
|
|
this.modulesReadyObj.cart),this.modulesReadyObj.total==this.modulesReadyObj.triggerThreshold&&this.makeAllPostVariationValidationCalls(a,a.itmVarModel.selectedVariationId))},this)},qtyReaadyOnLoad:function(a){var b=this;a.lastOptionPseudoId=1;if(!a.isEndedItem){var c=$("#"+a.selectedVarDomId).html();if((a.allBoxesSelected&&-1==parseInt(c)||!a.allBoxesSelected&&3<c.length||0<a.numSelectedBoxesOnLoad&&!a.allBoxesSelected)&&!a.vtiParamCase)b.showAllDropDownOptions(a),$("#"+a.selectedVarDomId).html("-1"),
|
|
a.itmVarModel.selectedVariationId=-1,a.oneTraitSelectBoxes&&1<a.oneTraitSelectBoxes.length&&(b.selectLastOptnInSelectBoxes(a),b.setOptionsObj(a),a.updateSelectFlag=!0,b.updateSelectBoxesOnChange(a,a.lastOptionPseudoId,!0))}if(-1!=a.itmVarModel.selectedVariationId&&a.itmVarModel.itemVariationsMap[a.itmVarModel.selectedVariationId].quantityAvailable)0==this.modulesReadyObj.quant&&(this.modulesReadyObj.quant=1,this.modulesReadyObj.total=this.modulesReadyObj.quant+this.modulesReadyObj.list+this.modulesReadyObj.cart),
|
|
this.modulesReadyObj.total==this.modulesReadyObj.triggerThreshold&&this.makeAllPostVariationValidationCalls(a,a.itmVarModel.selectedVariationId);else if(a.vtiParamCase&&-1==a.itmVarModel.selectedVariationId){b.showAllDropDownOptions(a);$("#"+a.selectedVarDomId).html("-1");var d=1;$.each(a.itmVarModel.menuModels,function(){var c=this;$.each(this.menuItemValueIds,function(h,g){c.selectedValueId==g&&void 0==$("#"+a.optPrefix+g).attr("outofstock")&&($("#"+a.optPrefix+g).attr("selected","selected"),a.updateSelectFlag=
|
|
!0,b.updateSelectBoxesOnChange(a,$("#"+a.selPrefix+d).attr("pseudoid"),!0))});d++})}},selectLastOptnInSelectBoxes:function(a){var b=eval("["+a.oneTraitSelectBoxes.substring(0,a.oneTraitSelectBoxes.length-1)+"]");$.each(b,function(c,b){$("#"+a.optPrefix+b).attr("selected","selected");a.lastOptionPseudoId=$("#"+a.optPrefix+b).attr("pseudoid")})},setSelectBoxWidth:function(a,b,c){c.isRedesign||a.width(b+"px")},setOptionsObj:function(a){a.optionsObj={};var b=this,c=1,d=a.itmVarModel,e=0,h=!1;a.vtiParamCase=
|
|
!1;void 0==a.originalOptns&&(h=!0,a.originalOptns={});$.each(d.menuModels,function(){var d={},f=$("#"+a.selPrefix+c);-1!=f.val()&&e++;var h=190;a.isSelectBoxXL&&(h=290);a.isBuyBoxRevolutionEnabled&&(h=250);b.setSelectBoxWidth(f,h,a);var j=this;$.each(this.menuItemValueIds,function(c,b){$("#"+a.tmpCloneElmId).html("");j.selectedValueId==b&&(a.vtiParamCase=!0);var e=$("#"+a.tmpCloneElmId).append($("#"+a.optPrefix+b).clone()).html();d[b]=e});a.optionsObj["select-"+c]=d;c++});a.allBoxesSelected=e==d.menuModels.length?
|
|
!0:!1;h&&(a.numSelectedBoxesOnLoad=e,a.originalOptns=$.extend(!0,{},a.optionsObj))},setVariationId:function(a){for(var b in a.itmVarModel.itemVariationsMap)0<parseInt(a.itmVarModel.itemVariationsMap[b].quantityAvailable)&&(a.itmVarModel.selectedVariationId=b,$("#"+a.selectedVarDomId).html(b))},executeOnQtyModuleReady:function(a){-1!=a.itmVarModel.selectedVariationId&&this.makeAllPostVariationValidationCalls(a,a.itmVarModel.selectedVariationId)},sendMSKUImgGroupsToFilmStrip:function(a,b){var c=this,
|
|
d=parseInt(b.index),e=a.itmVarModel,h=e.menuModels,g=-1;try{$.each(e.menuItemPictureIndexMap,function(a,b){-1!=jQuery.inArray(d,b)&&(g=a,c.pubsub.publish(c.msgs("GROUP_MSKU_IMAGES"),{imgGroupArr:b,index:d}))})}catch(f){}if("false"==b.skipBoxReset){c.clickEmergedFromSelectBox=!1;c.showAllDropDownOptions(a);for(i=0;i<h.length;i++)h[i].hasPictures?a.isEndedItem?$("#"+a.optPrefix+g).attr("selected",""):void 0==$("#"+a.optPrefix+g).attr("outofstock")&&$("#"+a.optPrefix+g).attr("selected",""):($("#"+a.selPrefix+
|
|
(i+1)+" option:first-child").attr("selected",""),a.oneTraitSelectBoxes&&1<a.oneTraitSelectBoxes.length&&c.selectLastOptnInSelectBoxes(a)),a.updateSelectFlag=!1,c.updateSelectBoxesOnChange(a,$("#"+a.selPrefix+(i+1)).attr("pseudoid"),!1)}else c.clickEmergedFromSelectBox=!0},validateMskuSelectBoxes:function(a){var b=1,c;$.each(a.itmVarModel.menuModels,function(){var d=$("#"+a.selPrefix+b),e;e=a.isRefresh||a.isRedesign?d.parent():d;if(-1==d.val())if("undefined"==typeof c&&(c=a.selPrefix+b),"errorIcon"===
|
|
e.prev().attr("class"))e.prev().css("display","block"),e.next().hasClass("err")?e.next().css("display","block"):e.next().next().css("display","block"),a.isRedesign&&(d.css("border","1px solid #DD1E31"),d.addClass("vi-VR-ie7red"));else{var h="";a.isRefresh&&!a.isRedesign&&(h="margin-left:21%;padding-left:10px;");var g="display:block";a.isRedesign&&(g="display:none",d.css("border","1px solid #DD1E31"),d.addClass("vi-VR-ie7red"));e.parent().children().first().hasClass("errorIcon")?e.parent().children().first().show():
|
|
e.parent().children().first().before('<div class="errorIcon" aria-relevant="all" aria-atomic="true" aria-live="assertive" style="'+g+'"><img alt="Error icon" class="errorimg" src="//p.ebaystatic.com/aw/pics/s.gif"></div>');e.parent().children().last().hasClass("err")?e.parent().children().last().show():e.parent().children().last().after('<div class="u-cb err" aria-relevant="all" aria-atomic="true" aria-live="assertive" style="display: block;'+h+'" aria-label="'+a.errorMsg.replace("?",this.displayName)+
|
|
'">'+a.errorMsg.replace("?",this.displayName)+"</div>");d.attr("aria-label",a.errorMsg.replace("?",this.displayName))}else"errorIcon"===e.prev().attr("class")&&(e.prev().css("display","none"),e.next().hasClass("err")?e.next().css("display","none"):e.next().next().css("display","none"),d.css("border","1px solid lightgray"),d.removeClass("vi-VR-ie7red"));b++});"undefined"!=typeof c&&document.getElementById(c).focus()},bindEventsOnSelectBoxes:function(a){var b=this,c=a.itmVarModel,d=1;a.selectBoxOpen=
|
|
!1;1<=c.menuModels.length&&$.each(c.menuModels,function(){a.isMSKURedesign&&$("#"+a.selBtnPrefix+d+" span.btn").bind("click",function(c){var d=$(this);b.mskuBtnUIEventHandler(a,d,c)});$("#"+a.selPrefix+d).bind("change",function(){b.updateSelectBoxesOnChange(a,this.getAttribute("pseudoid"),!0);try{if(!b.mskuDrpClkd){var c=$(".msku-sel").length+":"+this.getAttribute("pseudoid")+":"+this.selectedIndex;trackingUtil("VI_MSKU_DRP_CLICK","vi_msel",c);b.mskuDrpClkd=!0}}catch(d){}});d++})},mskuBtnUIEventHandler:function(a,
|
|
b){var c=b.parent().attr("pseudoid"),d=$(b).attr("mskudisabled"),e=$(b).attr("outofstock");"undefined"!==typeof d&&!1!==d&&this.showAllDropDownOptions(a);"undefined"!==typeof e&&!1!==e||$("#"+a.selPrefix+c).val(b.attr("value")).change()},resetMskuBtnUI:function(a){var b=1;$.each(a.itmVarModel.menuModels,function(){$.each(this.menuItemValueIds,function(c,b){var e=$("#"+a.optBtnPrefix+b);if(e.removeClass("msku-maroon-border")){var h=e.parent().attr("pseudoid");$("#"+a.selPrefix+h).val(e.attr("value")).change()}e.removeClass("msku-maroon-dotted-border")});
|
|
b++})},updateMskuBtnUI:function(a){var b=1;$.each(a.itmVarModel.menuModels,function(){$.each(this.menuItemValueIds,function(c,b){var d=$("#"+a.optBtnPrefix+b);d.removeClass("msku-maroon-border");if(0<$("#"+a.optPrefix+b).length){var f=$("#"+a.optPrefix+b).attr("outofstock");"undefined"!==typeof f&&!1!==f?d.attr("mskudisabled","disabled"):d.removeAttr("mskudisabled")}else d.attr("mskudisabled","disabled")});var c=$("#"+a.selPrefix+b);if(-1!=c.val()){var d="btn btn-s msku-maroon-border ";$("#"+a.optBtnPrefix+
|
|
c.val()).hasClass("msku-color-box-cntr")&&(d+="msku-color-box-cntr");$("#"+a.optBtnPrefix+c.val()).attr("class",d)}b++})},updateSelectBoxesOnChange:function(a,b,c){var d=this,e=a.itmVarModel,h=1,g={},f=0,n=!1,j=-1,o=0,k=-1;d.clickEmergedFromSelectBox=c;$.each(e.menuModels,function(){var c=$("#"+a.selPrefix+h),b;b=a.isRefresh||a.isRedesign?c.parent():c;"errorIcon"===b.prev().attr("class")&&"none"!=b.next().css("display")&&(n=!0,d.isAlreadyValidated=!0);-1!=c.val()&&(this.hasPictures&&(j=c.val()),f++,
|
|
c=e.menuItemMap[c.val()].matchingVariationIds,$.each(c,function(a,c){g[c]=g.hasOwnProperty(c)?g[c]+1:1}));h++;o++});n&&d.validateMskuSelectBoxes(a);0<f?(0<=j&&d.clickEmergedFromSelectBox&&(0<e.menuItemPictureIndexMap[j].length?d.newTouchMsgFix?k=e.menuItemPictureIndexMap[j][0]:d.pubsub.publish(d.msgs("TRIGGER_CLICK_ON_MAIN_IMG_FILMSTRIP"),{index:e.menuItemPictureIndexMap[j][0]}):($("#icImg").attr("src","//p.ebaystatic.com/aw/pics/nextGenVit/imgNoImg.gif"),d.pubsub.publish("_TRIGGER_ZOOM_ENLARGE",
|
|
{img:{enlargeEnabled:!1,zoomEnabled:!1},id:0}))),d.applyVariationsToDropDowns(a,g,f,b)):d.showAllDropDownOptions(a);d.pubsub&&(f==e.menuModels.length?($.each(g,function(a,c){c!=f&&delete g[a]}),$.each(g,function(c){f==e.menuModels.length&&d.makeAllPostVariationValidationCalls(a,c);e.menuItemPictureIndexMap&&0<e.menuItemPictureIndexMap[j].length&&d.clickEmergedFromSelectBox&&(d.newTouchMsgFix?k=e.menuItemPictureIndexMap[j][0]:d.pubsub.publish(d.msgs("TRIGGER_CLICK_ON_MAIN_IMG_FILMSTRIP"),{index:e.menuItemPictureIndexMap[j][0]}))})):
|
|
d.resetMessages(a));-1!=k&&d.pubsub.publish(d.msgs("TRIGGER_CLICK_ON_MAIN_IMG_FILMSTRIP"),{index:k});a.isMSKURedesign&&d.updateMskuBtnUI(a,null)},resetMessages:function(a){$("#"+a.selectedVarDomId).html("-1");a.itmVarModel.selectedVariationId=-1;this.pubsub.publish(this.msgs("TOGGLE_QTY_DISPLAY_STATE"),{isDisabled:!0});a.isRedesign&&"undefined"!==typeof a.dealInfo||(this.pubsub.publish(this.msgs("UPDATE_STP_VALUES"),{}),this.pubsub.publish(this.msgs("UPDATE_MAP_VALUES"),{}));a.isEndedItem||this.pubsub.publish(this.msgs("ADD_TO_WATCH_LNK"),
|
|
{status:!1});this.pubsub.publish("RESET_PICTURE_RIBBON",{});this.pubsub.publish("MSKU_RESET_WATCHERS",{});this.updatePopStack(a,-1,!0);this.pubsub.publish("MSKU_USER_LIST_UPDATE",{isDisabled:!1,isWatched:!1});this.pubsub.publish(this.msgs("HIDE_ADD_TO_CART_LINK"),{toHide:!0})},makeAllPostVariationValidationCalls:function(a,b){a.isEndedItem||(this.makeQtyValidationCalls(a,b),this.pubsub.publish("VI_MSKU_POST_VARIATION_SELECTION",{variationId:b}));this.makeMapStpUpdateCall(a,b);this.makeCartUpdateCall(a,
|
|
b);this.makePictureIconUpdateCalls(a,b);this.updatePopStack(a,b,!1);if(b){var c=this.isVariationWatched(a,b);this.pubsub.publish("MSKU_USER_LIST_UPDATE",{isDisabled:!1,variationId:b,isWatched:c})}},updatePopStack:function(a,b,c){c?-1!=a.defaultPopStackWatchers&&($("#"+a.popStackWatchersId).parent().html(a.defaultPopStackWatchers),this.updatePopStackHotness(a.defaultPopStackWatchersHot,a.popStackWatchersId)):(b=a.itmVarModel.itemVariationsMap[b],-1==a.defaultPopStackWatchers&&(a.defaultPopStackWatchers=
|
|
$("#"+a.popStackWatchersId).parent().html(),a.defaultPopStackWatchersHot=!1,$("#"+a.popStackWatchersId).parent().hasClass("u-b")&&(a.defaultPopStackWatchersHot=!0)),b.watchCountMessage?(c=$("<div/>").html(b.watchCountMessage).text(),$("#"+a.popStackWatchersId).parent().html(c)):($("#"+a.popStackWatchersId).parent().html('<span id="vi-pop-wtchrs" class="ap-watchCount"></span>'),$("#"+a.popStackWatchersId).parent().next().hide()),this.updatePopStackHotness(b.watchCountHot,a.popStackWatchersId))},updatePopStackHotness:function(a,
|
|
b){var c=$("#vi-pop-viewz"),d=!1;0<c.length&&(c.parent().prev().hasClass("u-dspn")||(d=!0));a&&!d?($("#"+b).parent().addClass("u-b"),$("#"+b).parent().prev().show()):($("#"+b).parent().removeClass("u-b"),$("#"+b).parent().addClass("vi-pop-lgtgry"),$("#"+b).parent().prev().hide())},makePictureIconUpdateCalls:function(a,b){var c=a.itmVarModel.itemVariationsMap[b];c.almostGone||c.lastOne?this.pubsub.publish("UPDATE_PICTURE_RIBBON",{almostGone:c.almostGone,lastOne:c.lastOne}):c.savingsPercent&&a.offTxt?
|
|
this.pubsub.publish("UPDATE_PICTURE_RIBBON",{mskuPercentOff:c.savingsPercent+a.offTxt}):this.pubsub.publish("UPDATE_PICTURE_RIBBON",{});this.pubsub.publish("MSKU_UPDATE_WATCHERS",{watchCount:c.watchCount,showWatchCount:c.watchCountShown,isHot:c.watchCountHot})},makeQtyValidationCalls:function(a,b){this.pubsub.publish(this.msgs("TOGGLE_QTY_DISPLAY_STATE"),{isDisabled:!1,variationId:b});this.isAlreadyValidated=!1;var c=a.itmVarModel.itemVariationsMap[b];quantityAvailable=c.quantityAvailable;var d=c.almostGone,
|
|
e=c.lastOne;$("#"+a.selectedVarDomId).html(b);$("#qtySubTxt").removeClass("vi-VR-qtyAvlbAlgn");a.supressQty||(0>=a.lotSize?d?($("#qtySubTxt").html('<span class="vi-qtyA-hot vi-capt-txt ">'+a.almostGoneContent+"</span>"),$("#qtySubTxt").addClass("vi-VR-qtyAvlbAlgn")):0<a.availableQtyThreshold&&quantityAvailable>a.availableQtyThreshold&&!a.isSellerView?($("#qtySubTxt").html(a.qtyMsgMoreTen.replace("-1",a.availableQtyThreshold)),a.isRedesign&&$("#qtySubTxt").addClass("vi-VR-qtyAvlbAlgn ")):e?($("#qtySubTxt").html('<span class="vi-qtyA-hot ">'+
|
|
a.lastOneContent+"</span>"),$("#qtySubTxt").addClass("vi-VR-qtyAvlbAlgn")):0<=quantityAvailable&&($("#qtySubTxt").html(a.qtyMsgAvlb.replace("-1",quantityAvailable)),$("#qtySubTxt").addClass("vi-VR-qtyAvlbAlgn")):1==quantityAvailable?$("#qtySubTxt").html(a.lotMsgAvlb.replace("-1",a.availableQtyThreshold)):0<a.availableQtyThreshold&&quantityAvailable>a.availableQtyThreshold?$("#qtySubTxt").html(a.lotsMsgAvlb.replace("-1",a.availableQtyThreshold)):$("#qtySubTxt").html(a.lotsMsgMoreTenAvlb.replace("-1",
|
|
a.availableQtyThreshold)));this.pubsub.publish(this.msgs("VALIDATE_QTY_MSKU"),{quantityAvailable:quantityAvailable,maxQty:c.maxQuantity,supressQty:a.supressQty})},makeMapStpUpdateCall:function(a,b){var c=a.itmVarModel.itemVariationsMap[b],d=c.amountSaved;c.savingsPercent&&(d=a.isRedesign?c.savingsPercent+"% off":3==a.siteId?d+(" ("+c.savingsPercent+"% "+a.savingsRateUpperCase+"*)"):a.isEUSite?d+(" (-"+c.savingsPercent+" %*)"):d+(" ("+c.savingsPercent+"% "+a.savingsRateLowerCase+")"));c.vatPrice&&
|
|
$("#vi-binprcminusvat").html(c.vatPrice);var e={retailPrice:c.originalRetailPrice,amtSaved:d,binPrice:c.price,varId:b,convPrice:c.convertedPrice,savingsPercentValue:c.savingsPercent};"STP"==c.pricingTreatment?this.pubsub.publish(this.msgs("UPDATE_STP_VALUES"),e):("DURING_CHECKOUT"==c.minAdvertisedPriceExposure?($("#vi-mskumap-postchkout").show(),$("#vi-mskumap-prechkout").hide(),$("#vi-mskumap-none").hide()):"PRE_CHECKOUT"==c.minAdvertisedPriceExposure?($("#vi-mskumap-postchkout").hide(),$("#vi-mskumap-prechkout").show(),
|
|
$("#vi-mskumap-none").hide()):"NONE"==c.minAdvertisedPriceExposure&&($("#vi-mskumap-postchkout").hide(),$("#vi-mskumap-prechkout").hide(),$("#vi-mskumap-none").show()),this.pubsub.publish(this.msgs("UPDATE_MAP_VALUES"),e));a.isRedesign?"NONE"==c.pricingTreatment&&!c.originalPrice&&"undefined"==typeof a.dealInfo?$("#"+a.priceCntrId).addClass("vi-VR-hidePriceCntr"):$("#"+a.priceCntrId).removeClass("vi-VR-hidePriceCntr"):"NONE"==c.pricingTreatment?$("."+a.priceCntrId).css("display","none"):$("."+a.priceCntrId).css("display",
|
|
"block");$("#prcIsum").html(c.price);c.totalPrice&&null!=c.totalPrice&&$("#mtp_yotpp").html(c.totalPrice);$("#prcIsumConv span").html(c.convertedPrice);$("#binPrice").html(c.convertedPrice);$("#mm-saleOrgPrc").html(c.originalPrice);$("#mm-saleDscPrc").html(c.price);(e=$("#vi-priceDetails .vi-originalPrice"))&&0<e.length&&e.html(c.originalPrice);c.amountSaved&&$("#mm-saleAmtSavedPrc").html(d)},isVariationWatched:function(a,b){return a.itmVarModel.itemVariationsMap[b].variationWatched?!0:!1},makeCartUpdateCall:function(a,
|
|
b){a.itmVarModel.itemVariationsMap[b].varationInCart?this.pubsub.publish(this.msgs("HIDE_ADD_TO_CART_LINK"),{toHide:!1}):this.pubsub.publish(this.msgs("HIDE_ADD_TO_CART_LINK"),{toHide:!0})},applyVariationsToDropDowns:function(a,b,c){var d=1,e=a.itmVarModel,h=e.menuModels.length,g=[],f={};$.each(e.menuModels,function(){var n=a.optionsObj,j=$("#"+a.selPrefix+d),o=this;$.each(this.menuItemValueIds,function(c,b){$("#"+a.tmpCloneElmId).html("");var e=$("#"+a.optPrefix+b);e.hide();e.val()==j.val()&&e.attr("selected",
|
|
"selected");var f=$("#"+a.tmpCloneElmId).append(e.clone()).html();f&&(f=f=f.replace('selected="selected"',""),f=f=f.replace("selected",""),parseInt(e.val())==parseInt(j.val())&&(f=f.replace(" id=",' selected="selected" id=')),n["select-"+d][b]=f)});var k=a.selectTxt;a.isBuyBoxRevolutionEnabled&&(k=this.name);if(1==c&&-1!=j.val())$("#"+a.selPrefix+d).html('<option value="-1">'+k+"</option>"),$.each(this.menuItemValueIds,function(c,b){null!=$("#"+a.optPrefix+b)&&$("#"+a.selPrefix+d).append(n["select-"+
|
|
d][b]);$("#"+a.optPrefix+b).show()});else{var l=j.val();-1==l?$("#"+a.selPrefix+d).html('<option value="-1" selected="selected">'+k+"</option>"):$("#"+a.selPrefix+d).html('<option value="-1">'+k+"</option>");var m=[];$.each(b,function(a,b){var d=e.itemVariationsMap[a].traitValuesMap[o.name],j=!1;if(2<=parseInt(c)&&-1==parseInt(l)&&2!=h||c==h&&2!=h)if(b<c&&b!=c&&(b<=h/2||5==h&&b<=(h+1)/2))d=e.itemVariationsMap[a].traitValuesMap[o.name],g.push(a),j=!0;j||(m.push(d),void 0==f[d]&&(f[d]={},f[d].count=
|
|
b,f[d].outofstock=!0),b>f[d].count&&(f[d].count=b),e.itemVariationsMap[a].inStock&&(f[d].outofstock=!1))});m.sort(function(a,c){return a-c});for(k=1;k<m.length;k++)m[k]===m[k-1]&&m.splice(k--,1);$.each(m,function(c,b){var g=e.menuItemMap[b].displayName;$("#"+a.tmpCloneElmId).html(a.optionsObj["select-"+d][b]);f[b].outofstock?(g+=" "+a.outOfStockTxt,$("#"+a.optPrefix+b).html(g),$("#"+a.optPrefix+b).attr("outofstock","true"),$("#"+a.optPrefix+b).attr("disabled","disabled"),$("#"+a.optPrefix+b).css("color",
|
|
"#cccccc")):($("#"+a.optPrefix+b).html(g),$("#"+a.optPrefix+b).css("color","#000000"),$("#"+a.optPrefix+b).removeAttr("outofstock"),$("#"+a.optPrefix+b).removeAttr("disabled"));g=$("#"+a.tmpCloneElmId).html($("#"+a.optPrefix+b).clone()).html();a.optionsObj["select-"+d][b]=g;$("#"+a.tmpCloneElmId).html();$("#"+a.selPrefix+d).append(g);$("#"+a.optPrefix+b).show()})}d++});g=this.arrayUnique(g);2<parseInt(c)&&c!=h&&(d=1,$.each(e.menuModels,function(){var b=this,h=$("#"+a.selPrefix+d);$.each(g,function(d,
|
|
g){var l=e.itemVariationsMap[g].traitValuesMap[b.name];h.val()!=$("#"+a.optPrefix+l).val()&&(null!=f[l]&&null!=f[l].count&&f[l].count!=c)&&$("#"+a.optPrefix+l).remove()});d++}))},arrayUnique:function(a){for(var b=[],c=a.length,d=0;d<c;d++){for(var e=d+1;e<c;e++)a[d]===a[e]&&(e=++d);b.push(a[d])}return b},showAllDropDownOptions:function(a){var b=1,c=a.originalOptns;$.each(a.itmVarModel.menuModels,function(){var d=a.selectTxt;a.isBuyBoxRevolutionEnabled&&(d=this.name);var e=$("#"+a.selPrefix+b);e.html('<option value="-1">'+
|
|
d+"</option>");$.each(this.menuItemValueIds,function(d,e){$("#"+a.selPrefix+b).append(c["select-"+b][e]);$("#"+a.optPrefix+e).removeAttr("selected");$("#"+a.optPrefix+e).show();$("#"+a.tmpCloneElmId).html("");var f=$("#"+a.tmpCloneElmId).append($("#"+a.optPrefix+e).clone()).html(),f=f=f.replace('selected="selected"',""),f=f=f.replace("selected","");c["select-"+b][e]=f});e.attr("selectedIndex",0);e.val(-1);b++});this.resetMessages(a)}}});raptor.defineClass("raptor.vi.OnDemandTransl",function(){return{init:function(a){this.pubsub=raptor.require("pubsub");this.ajaxUtil=raptor.require("com.ebay.raptor.vi.AjaxUtil");this.addEventListener(a);this.bSwap=!1;this.lstSelLng={};this.lstLng={}},addEventListener:function(a){for(var c=this,b=0;b<a.tlc.length;b++)$("#tlc_"+a.tlc[b].locale).click(function(){c.menuClick=!0;c.buildUrl(a,this.id)})},buildUrl:function(a,c){var b=c.substr(4,c.length-4),d;d=a.descUrl;d+="&targetlc="+b;"function"==typeof window.postMessage?
|
|
($("#"+a.descId).attr("src",d),"undefined"==typeof a.lstLcl||a.lstLcl!==b||a.isTranslEnabledAll?(d=a.isTranslEnabledAll?!1:!0,this.makeRequest(a,b,d)):this.pubsub.publish("_RESET_FRAME_RESIZE_FLAG",{})):(d+=a.descParam,$("#"+a.descId).attr("src",d),this.makeRequest(a,b,!1));this.swapMenu(c,a);this.pubsub.publish("_CLOSE_OLAY",{cmpId:a.odtOlyId})},makeRequest:function(a,c,b){a=a.url+"&targetlc="+c;this.ajaxUtil.getJSON(a+(b?"&slo=1":"&slo=0"),this.handleResponse,this);this.pubsub=raptor.require("pubsub");
|
|
this.pubsub.publish("_RESET_FRAME_RESIZE_FLAG",{})},handleResponse:function(a){a&&(a.status&&"SUCCESS"==a.status)&&("undefined"!==typeof a.title&&""!=a.title&&(this.bSwap&&($(".it-icon-pd").insertAfter($("#itemTitle")),this.bSwap=!1),$("#itemTitle").html(a.title),a.title.toString().match(/text-align:right/)&&($("#itemTitle").find("p:first").addClass("it-mrg0"),$(".it-icon-pd")&&($("#itemTitle").find("p:first").prepend($(".it-icon-pd")),this.bSwap=!0))),"undefined"!==typeof a.subTitle&&""!=a.subTitle&&
|
|
$("#subTitle").html(a.subTitle))},swapMenu:function(a,c){var b=this,d,e,f,g,h,j,i;vOrigTxt=b.getVal(c.vOrigLng,a);d=$("#"+c.odtLnkId).find("span:first");i=c.isTranslEnabledAll?0:1;e=$("#"+a).find("span:eq("+i+")");$("#"+c.odtOlyId).find('span[style="font-weight: bold;"]').css("font-weight","normal");c.isTranslEnabledAll?(null==b.dfTxt&&(b.dfTxt=$(d).html()),f=$("#"+c.vOrigId),g=$("#"+c.vTranslId),$(c.logoId).hide(),""!==c.dfltLng&&(h=c.dfltLng,a.substring(4)!==h||a.substring(4)===h&&b.menuClick?($(g).hide(),
|
|
j="tlc_"+h,$(f).unbind("click"),$(f).html(vOrigTxt),$(f).show(),$(f).click(function(){b.menuClick=!1;b.buildUrl(c,j)}),b.setLastLng($(d).html()),$(d).html($(e).html()),b.setLastSel(a)):(a.substring(4),$(f).hide(),vTranslTxt=b.getVal(c.vTranslLng,b.getLastSel()),$(g).unbind("click"),$(g).html(vTranslTxt),$(g).show(),b.menuClick&&$(d).html(b.dfTxt),$(g).click(function(){b.menuClick=!1;b.buildUrl(c,b.getLastSel())})))):(b.setLastSel(a),$(d).html($(e).html()),d=c.en,$("#tlc_"+c.tlc_en).show(),$(e).text()==
|
|
d&&$("#tlc_"+c.tlc_en).hide());$("#"+a).find("span:eq("+i+")").css("font-weight","bold")},setLastSel:function(a){self.lstSelLng=a},getLastSel:function(){return self.lstSelLng},setLastLng:function(a){self.lstLng=a},getLastLng:function(){return self.lstLng},getArr:function(a){for(var c=[0,0],b=[],d=0;d<a.split(",").length;d++){b[d]=a.split(",")[d];c[d]=[];for(var e=0;e<b[d].split(":").length;e++)c[d][e]=b[d].split(":")[e]}return c},getVal:function(a,c){for(var b=this.getArr(a),d,e=0;e<b.length;e++)b[e][0]==
|
|
c&&(d=b[e][1]);return d}}});raptor.defineModule("js.sellerinfo.BSIContactDetails",function(){return{init:function(c){var a=this;a.conf=c;a.isAdded=!1;a.pubsub=raptor.require("pubsub");a.msgs=raptor.require("com.ebay.raptor.vi.MsgHandler");this.pubsub.subscribe(a.msgs("BS_CONTACTDETAILS"),function(b){b&&b.bsciid&&!a.isAdded&&(b=$("#"+b.bsciid))&&a.decodeContact(b)},this)},decodeContact:function(c){var a=$("#"+this.conf.bscdid);a&&(a.find("*").each(function(){if(0==this.children.length){var a=$(this).text();a&&$(this).html(a.split("").reverse().join(""))}}),
|
|
c.append(a),this.isAdded=!0)}}});raptor.defineModule("js.sellerinfo.BusinessSellerInfo",function(){return{init:function(a){this.conf=a;this.pubsub=raptor.require("pubsub");this.msgs=raptor.require("com.ebay.raptor.vi.MsgHandler");this.attachClickEvents();this.rpClicked=this.tcClicked=this.ciClicked=!1},attachClickEvents:function(){var a=this,b=$("#"+a.conf.cid);a.conf.showHideBusinessContactInfo&&$("#"+a.conf.bsiecid+" a").click(function(){a.ciClicked||(a.ciClicked=!0,$(document).trigger("vi_modules_loaded",["vi_bsf","ci",!0]),trackingUtil("VI_BSI_CHEVRON_CONTACTINFO"));
|
|
if(b.hasClass("bsi-exp"))b.removeClass("bsi-exp");else{b.addClass("bsi-exp");try{a.pubsub.publish(a.msgs("BS_CONTACTDETAILS"),{bsciid:a.conf.bsciid})}catch(c){}}});if(a.conf.hideTermsAndConditions)$("#"+a.conf.textboxLabelId).on("click",function(){b.toggleClass("bsi-exp-toc");a.tcClicked||(a.tcClicked=!0,$(document).trigger("vi_modules_loaded",["vi_bsf","tc",!0]))});$("#bsi-returns-exp").on("click",function(){$(this).toggleClass("bsi-exp-open");$("#bsi-returns").toggle();a.rpClicked||(a.rpClicked=
|
|
!0,$(document).trigger("vi_modules_loaded",["vi_bsf","rp",!0]))})}}});raptor.defineClass("com.ebay.raptor.vi.share.ShareLinks",function(){return{init:function(b){var d=this,a;d.cookie=raptor.require("ebay.cookies");if("SHARE"==b.widgetType){var c=b.shareJsElmId;if(document.getElementById(c))return;a=document.createElement("script");a.id=c;a.async=!0;a.defer=!0;a.src=b.plaModel.shareWidgetJsUrl;$(window).load(function(){document.getElementsByTagName("head")[0].appendChild(a);$("#ebay-scShare-div").on("click",".scTalkPopUpClose",function(){d.talkOverlayClose()})})}"SIGNALS"==
|
|
b.widgetType&&(c=b.signalsJsElmId,$("head").append('<meta property="fb:app_id" content="102628213125203">'),document.getElementById(c)||(a=document.createElement("script"),a.id=c,a.async=!0,a.defer=!0,a.src=b.plaModel.socialSignalsJsUrl,$(window).load(function(){document.getElementsByTagName("head")[0].appendChild(a)})))},talkOverlayClose:function(){var b=this.cookie.readCookie("dp1","pbf");this.cookie.writeCookielet("dp1","pbf",this.cookie.setBitFlag(b,66,1))}}});raptor.defineClass("com.ebay.raptor.vi.shipping.CalculateImportCharge",function(){return{init:function(a){this.cfg=a;this.pubsub=raptor.require("pubsub");this.sendGetRatesCall()},sendGetRatesCall:function(){var a=this,b=a.cfg,c=b.calcImportChargeUrl;a.ajaxUtil=raptor.require("com.ebay.raptor.vi.AjaxUtil");c||(c="http://www.d-sjc-00532519.dev.ebay.com:8080/itm/getrates?item=250002821288&country=3&zipcode=95123");b.calculateOnLoad?(c=a.appendParameters(c,{co:"1",maxBid:b.maxBidAmt}),a.triggerCall(c)):
|
|
$("#"+b.impChIdLink).click(function(){var c=b.calcImportChargeUrl;c&&(c=a.appendParameters(c,{co:"1",maxBid:b.maxBidAmt}),a.triggerCall(c))})},appendParameters:function(a,b){return a?a+"&"+$.param(b):a},triggerCall:function(a){this.ajaxUtil.getJSON(a,this.handleResponse,this)},handleResponse:function(a){var b=this.cfg;b.calculateOnLoad?this.pubsub.publish("IMP_CHARGE_RESPONSE",a):a&&a.impChCost?($("#"+b.impChIdCnt).html(a.impChCost),$("#"+b.impChBidTxtId).show()):($("#"+b.impChIdCnt).html(""),$("#"+
|
|
b.impChBidTxtId+"Err").show())}}});raptor.defineClass("raptor.vi.SimilarItems",function(){return{init:function(a){this.cfg=a;this.ajaxUtil=raptor.require("com.ebay.raptor.vi.AjaxUtil");this.addEventListener(a);this.disableAnchor()},addEventListener:function(a){var b=this;$("#"+a.selView).mouseover(function(){b.showMenu(a)});$("#"+a.selView).mouseout(function(){b.hideMenu(a)});$("#"+a.selMenu).mouseout(function(){b.hideMenu(a)});$("#"+a.selGallery).click(function(){b.request(a.gvUrl)});$("#"+a.selList).click(function(){b.request(a.lvUrl)})},
|
|
disableAnchor:function(){$('a[href="#shId"]').replaceWith($('a[href="#shId"]').text());$('a[href="#rpdId"]').replaceWith($('a[href="#rpdId"]').text())},showMenu:function(a){$("#"+a.selMenu).show()},hideMenu:function(a){$("#"+a.selMenu).hide()},request:function(a){var b=this.cfg;this.ajaxUtil.getJSON(a,this.response,this);this.hideMenu(b)},response:function(a){var b=this.cfg,d=$("#"+b.siDivId),c=$("#"+b.tglView);a&&d&&(d.html(a.hlpView),$(c).hasClass("vLIST")?($(c).addClass("vGRID"),$(c).removeClass("vLIST"),
|
|
$("#"+b.selMenu).addClass("lv"),$("#"+b.selMenu).removeClass("gv"),$("#"+b.selList).show(),$("#"+b.selGallery).hide()):($(c).addClass("vLIST"),$(c).removeClass("vGRID"),$("#"+b.selMenu).removeClass("lv"),$("#"+b.selMenu).addClass("gv"),$("#"+b.selGallery).show(),$("#"+b.selList).hide()))}}});raptor.defineClass("com.ebay.raptor.vi.shipping.ShippingQuoteGigaMove",function(){return{init:function(a){this.cfg=a;this.pubsub=raptor.require("pubsub");this.bindClick()},bindClick:function(){var a=this;$("#viTabs_1, #viTabs_2").bind("click",function(b){"Shipping and payments"==b.target.innerHTML&&a.getshippingUrl()});$(".vhr_shp").bind("click",function(){a.getshippingUrl()})},getshippingUrl:function(){var a=this.cfg;""!=a.shippingUrl&&0==$("#shippingSection #subcontent").length&&(url=a.shippingUrl,
|
|
this.makeCall(url,this.display,this))},makeCall:function(a,b){this.ajaxUtil=raptor.require("com.ebay.raptor.vi.AjaxUtil");this.ajaxUtil.getJSON(a,b,this)},display:function(a){a&&(a=a.SubContent,$("#shippingSection").html(a))}}});raptor.defineClass("ebay.viewItem.solt",function(){return{init:function(a){this.conf=a;this.ajaxUtil=raptor.require("com.ebay.raptor.vi.AjaxUtil");a.url&&this.makeInstantSaleFrameCall();this.quickSaleInit()},makeInstantSaleFrameCall:function(){var a=this.conf;a.url&&this.ajaxUtil.getJSON(a.url,this.processInstantSaleResponse,this)},processInstantSaleResponse:function(a){var b=this.conf;if(a&&(a.ins_sale_price&&0<a.ins_sale_price.length)&&(a=a.ins_sale_price[0].insSalePrice))$("#"+b.instSalePricePH).html(a),
|
|
$("#"+b.instantSaleCntId).show()},quickSaleInit:function(){var a=this,b=a.conf;if(0<b.quickSaleVar&&b.soltQuickSaleAjaxUrl&&b.soltQuickSaleUrl)if(1==b.quickSaleVar)a.quickSaleAjaxCall();else if(2==b.quickSaleVar)$(window).on("load",function(){a.quickSaleAjaxCall()});else if(10<=b.quickSaleVar)$(window).on("load",setTimeout(function(){a.quickSaleAjaxCall()},b.quickSaleVar))},quickSaleAjaxCall:function(){var a=this,b=a.conf;b.soltQuickSaleAjaxUrl&&b.soltQuickSaleUrl&&$.ajax({url:b.soltQuickSaleAjaxUrl,
|
|
success:function(b){a.quickSaleAjaxResp(b)}})},quickSaleAjaxResp:function(a){var b=this.conf;a&&a.instantSaleEligible&&a.instantSaleEligible&&(a=$("#inst_sale_btn"),a.attr("href",b.soltQuickSaleUrl),a.removeAttr("_sp"),a.text(b.soltQuickSaleBtnTxt),$("#"+b.instantSaleMsgId).html("<b>"+b.soltQuickSaleMsg+"</b>"))}}});raptor.defineClass("raptor.vi.CategoryList",function(){return{init:function(a){this.ajaxUtil=raptor.require("com.ebay.raptor.vi.AjaxUtil");this.handleRequest(a)},handleRequest:function(a){this.ajaxUtil.getJSON(a.refreshCateUrl)}}});raptor.defineClass("ui.Tab",function(){return{events:["select"],init:function(c){var d=this,b=$("#"+c.id),a=0,e=0,f=b.children(".tab"),h=b.children(".content"),g=f.find("a.item");g.each(function(){a+=$(this).width()+10});b.css("min-width",a+150);0!=h.length&&g.each(function(){var a=$(this);a.attr("idx",e);e++;a.click(function(){c.isDS3DeepLinksV2?1<=a.attr("idx")&&b.children(".content.sel").removeClass("sel"):b.children(".content.sel").removeClass("sel");f.find(".item.sel").removeClass("sel");$("#"+
|
|
this.id+"_cnt").addClass("sel");$(this).addClass("sel");d.publish("select",{index:$(this).attr("idx"),source:d})})})}}});raptor.defineClass("com.ebay.raptor.vi.topmessagepanel.TopMessagePanel",function(){return{init:function(a){var b=this;b.pubsub=raptor.require("pubsub");b.cfg=a;b.pubsub&&b.pubsub.subscribe(a.autoRefreshSvcId,function(a){b.setMessage(a)},b)},setMessage:function(a){var b=this.cfg,c,d=!1,e=!1,f,g;a&&!b.inlineExp&&(c=a.ViewerItemRelation,this.getTimeLeft(a),"HIGHBIDDER"==c?(f=a.IsReserve&&!a.IsReserveMet?b.CHINESE_BUYER_HIGH_BIDDER_RESERVE_NOT_MET_PC_ON:b.CHINESE_BUYER_HIGH_BIDDER_PC_ON,d=!0,e=!1,$("#"+
|
|
b.panelId).find(".msg").addClass("msg green")):"OUTBIDDER"==c&&(g=b.CHINESE_BUYER_OUTBIDDER_PC_ON,d=!1,e=!0,$("#"+b.panelId).find(".msg").addClass("msg red")),d?$("#"+b.smId).html(f):e&&$("#"+b.smId).html(g))},getTimeLeft:function(a){var a=a.TimeLeft,b=0;a&&(b=86400*a.DaysLeft+3600*a.HoursLeft+60*a.MinutesLeft+a.SecondsLeft);return b}}});raptor.defineClass("com.ebay.raptor.vi.MsgHandler",function(){var a;a={VALIDATE_MSKU_VARIATIONS:"_VALIDATE_MSKU_VARIATIONS",TRIGGER_MSKU_IMG_GROUPING:"_TRIGGER_MSKU_IMG_GROUPING",VARIATION_EDIT_WATCH_STATUS:"VARIATION_EDIT_WATCH_STATUS",VALIDATE_QTY_MODULE_READY:"VALIDATE_QTY_MODULE_READY",VALIDATE_MAPSTP_MODULE_READY:"VALIDATE_MAPSTP_MODULE_READY",VALIDATE_LIST_MODULE_READY:"VALIDATE_LIST_MODULE_READY",VALIDATE_CART_MODULE_READY:"VALIDATE_CART_MODULE_READY",GROUP_MSKU_IMAGES:"_GROUP_MSKU_IMAGES",
|
|
TRIGGER_CLICK_ON_MAIN_IMG_FILMSTRIP:"_TRIGGER_CLICK_ON_MAIN_IMG_FILMSTRIP",TOGGLE_QTY_DISPLAY_STATE:"_TOGGLE_QTY_DISPLAY_STATE",UPDATE_MAP_VALUES:"_UPDATE_MAP_VALUES",UPDATE_MAP_VALUES:"_UPDATE_MAP_VALUES",UPDATE_STP_VALUES:"_UPDATE_STP_VALUES",ADD_TO_WATCH_LNK:"_ADD_TO_WATCH_LNK",ADD_TO_WATCH_BTN:"_ADD_TO_WATCH_BTN",HIDE_ADD_TO_CART_LINK:"HIDE_ADD_TO_CART_LINK",VALIDATE_QTY_MSKU:"_VALIDATE_QTY_MSKU",VARIATION_EDIT_WATCH_STATUS:"VARIATION_EDIT_WATCH_STATUS",SUBMIT_BINBTN:"_SUBMIT_BINBTN",SUBMIT_CARTBTN:"_SUBMIT_CARTBTN",
|
|
REMOVE_LISTS:"_REMOVE_LISTS",LIST_ADD_SVC_ID:"_LIST_ADD_SVC_ID",LIST_REMOVE_SVC_ID:"_LIST_REMOVE_SVC_ID",TRIGGER_REMOVE_SVC_ID:"_TRIGGER_REMOVE_SVC_ID",BEST_OFFER_SVC_ID:"_BEST_OFFER_SVC_ID",REVIEW_OFFER_SVC_ID:"_REVIEW_OFFER_SVC_ID",FORCE_CLOSE_OVERLAY:"FORCE_CLOSE_OVERLAY",BIN_SVC_ID:"_BIN_SVC_ID",AUTO_REFRESH_DISABLE_BTN_SVC:"AUTO_REFRESH_DISABLE_BTN_SVC"};return function(b){return a[b]}});raptor.defineClass("com.ebay.raptor.vi.overlayHandler",function(){return{init:function(){var a=this;a.pubsub=raptor.require("pubsub");a.msgs=raptor.require("com.ebay.raptor.vi.MsgHandler");a.listOfOverlayIds=[];a.pubsub.subscribe("REGISTER_OVERLAY",function(b){a.registerOverlay(b)},a);a.pubsub.subscribe("FORCE_CLOSE_OVERLAY",function(b){a.forceCloseOverlay(b)},a)},registerOverlay:function(a){this.listOfOverlayIds.push(a.id)},forceCloseOverlay:function(a){for(i=0;i<this.listOfOverlayIds.length;i++)this.pubsub.publish("_CLOSE_OLAY",
|
|
{cmpId:this.listOfOverlayIds[i],hideOnly:a.hideOnly})}}});raptor.defineClass("com.ebay.raptor.vi.StatusMsg",function(){return{init:function(a){this.cfg=a;this.commonClz=a.smClz+" "+a.sizeClz},error:function(){this.cfg.isRefresh?this.addClass("vi-VR-msgMrg20-5 sm-co sm-er","gspr icmer"):this.addClass(this.commonClz+" smo-e","sm-me ebg")},notice:function(){this.cfg.isRefresh?this.addClass("vi-VR-msgMrg20-5 sm-co sm-al","gspr icmal"):this.addClass(this.commonClz+" smo-i","sm-mi ibg")},warning:function(){this.cfg.isRefresh?this.addClass("vi-VR-msgMrg20-5 sm-co sm-er",
|
|
"gspr icmer"):this.addClass(this.commonClz+" smo-w","sm-mw wbg")},confirm:function(){this.cfg.isRefresh?this.addClass("vi-VR-msgMrg20-5 sm-co sm-su","gspr icmsu"):this.addClass(this.commonClz+" smo-c","sm-mc cbg")},rmvClass:function(){var a=this.cfg;a.isRefresh?($("#"+a.outer+"_container").removeClass(),$("#"+a.outer+"_icon").removeClass()):($("#"+a.outer).removeClass(),$("#"+a.message).removeClass())},addClass:function(a,c){var b=this.cfg;this.rmvClass();b.isRefresh?($("#"+b.outer+"_container").addClass(a),
|
|
$("#"+b.outer+"_icon").addClass(c)):($("#"+b.outer).addClass(a),$("#"+b.message).addClass(c))}}});raptor.defineClass("com.ebay.raptor.vi.vehiclehistoryreport.VehicleHistoryReport",function(){return{init:function(a){this.cfg=a;this.pubsub=raptor.require("pubsub");this.bindClick();this.isIframeLoaded=!1;0==this.cfg.isVhrEnabled&&$("#vhr-unavailable").show();2==this.cfg.isVhrEnabled&&this.bindMessageEvents()},bindMessageEvents:function(){var a=document.getElementById("autocheckVhr"),c=function(b){"vhr_resize"==b.data.name&&void 0!==b.data.height?($("#vhr-spinner").hide(),a.height=b.data.height+"px"):
|
|
"vhr_scroll"==b.data.name&&void 0!==b.data.pos&&(b=b.data.pos,null!=a.offsetParent&&(b+=a.offsetParent.offsetTop),window.scrollTo(0,b))};void 0!==a&&(window.addEventListener?window.addEventListener("message",c,!1):window.attachEvent&&(window.attachEvent("onvhr_resize",c),window.attachEvent("onvhr_scroll",c)))},bindClick:function(){var a=this,c=a.cfg;""!=c.reportUrl&&(a.ajaxUtil=raptor.require("com.ebay.raptor.vi.AjaxUtil"),$("#viTabs_1").click(function(){if(0==$("#vhr_ac_rpt #subcontent").length)if(1==
|
|
a.cfg.isVhrEnabled)$("#throbber_vhr").show(),url=c.reportUrl,a.makeCall(url,a.display,a);else if(2==a.cfg.isVhrEnabled){var b=document.getElementById("autocheckVhr");null!==b&&!a.isIframeLoaded&&($("#vhr-spinner").show(),b.src=a.cfg.motorsWebURL,a.isIframeLoaded=!0)}}))},makeCall:function(a,c){this.ajaxUtil.getJSON(a,c,this)},display:function(a){a&&("false"===a.IsError?(a=a.SubContent,$("#throbber_vhr").hide(),$("#vhr_ac_rpt > div").css({visibility:"visible"}),a&&(a=a.replace('action="http:','action="https:')),
|
|
$("#vhr_ac_rpt").append(a)):(a=a.SubContent,$("#throbber_vhr").hide(),$("#vhr_ac_rpt").html(a)));$("#throbber_vhr").hide()}}});raptor.defineClass("raptor.vi.GeekSquadWidget",function(){return{init:function(b){var a=this;a.cfg=b;a.ajaxUtil=raptor.require("com.ebay.raptor.vi.AjaxUtil");a.pubsub=raptor.require("pubsub");a.reqCt="";a.signin=0;a.wrtyCt=0;a.chkdVals=[];a.pubsub.subscribe("SHOW_ADDON_LABEL",function(b){a.showAddOnLabel(b)},this);$("#"+b.cnclLnk).click(function(){a.cancel()});a.pubsub.channel(b.atcOlyId).subscribe("_OLY_CLS_SVC",function(){a.onClose()},a);b.atcOnLoad&&(a.signin=1,$(document).ready(function(){a.handleCart()}));
|
|
b.binOnLoad&&(a.signin=1,$(document).ready(function(){a.handleBin()}));a.addEventListener(b,null);window.getCallBack=function(c){0<c.length?(a.resp=c,a.makeSelect(b,c),a.fillBinOly(c),a.addEventListener(b,c),a.chkdVals=a.getChkdVal(a.resp)):(a.chkdVals=a.getChkdVal(a.resp),a.pubsub.publish("_WARRANTY_SELECTED",{isWrty:!1}));b.cartConfig&&b.cartConfig.hasWrtyIntercept&&(b.cartConfig.hasWrtyIntercept=!1,a.pubsub.publish("_SUBMIT_CARTBTN",b.cartConfig))};$(document).ready(function(){$("<link/>",{rel:"stylesheet",
|
|
type:"text/css",href:b.aggrCSSURL}).appendTo("head");var c="";"undefined"!==typeof b.warrantyTerms&&(null!==b.warrantyTerms&&""!==b.warrantyTerms)&&(c=JSON.parse(b.warrantyTerms));var d=function(){$("#svcGk").services({itemToFetchServicesFor:b.itemId,siteId:b.siteId,categoryId:b.catId,disabled:!1,onSelectionChange:"getCallBack",saleType:b.saleType,serviceURL:b.serviceURL,fetchedServiceItems:c})};a.ajaxUtil.loadScripts(!0,b.widgetJSURL,function(){a.ajaxUtil.loadScripts(!0,b.aggrJSURL,d)})})},showAddOnLabel:function(){$("#addOnlbl")&&
|
|
0<$("#addOnlbl").length&&$("#addOnlbl").css("display","inline-block")},fillBinOly:function(b){var a="",c;for(c in b)b.hasOwnProperty(c)&&(a+='<div class="ew-bin-cnt"> - '+b[c].warrantyProvider+" "+b[c].warrantyDescription+"</div>");$("#"+this.cfg.wtryCntDiv).html(a)},addEventListener:function(b,a){var c=this;c.pubsub.subscribe("_WARRANTY",function(b){c.handleMsg(b,a)},this)},makeSelect:function(b,a){$("#"+b.addPrId);$("#"+b.addDivId);$("#"+b.addTxtId);if(a)for(var c=0;c<a.length;c++)a[c].warrantyItemId?
|
|
this.pubsub.publish("_WARRANTY_SELECTED",{isWrty:!0}):this.pubsub.publish("_WARRANTY_SELECTED",{isWrty:!1})},handleMsg:function(b){this.msg=b;this.cfg.cartConfig=b.cartConfig;"undefined"==typeof b.btnId?this.handleCart():this.handleBin()},handleBin:function(){var b=this.cfg,a;a=this.chkdVals;var c;if(0!=a.length||b.warrantyId){$("#"+b.binTrbrId).show();$("#"+b.binCntId).hide();if("undefined"!==typeof b.blrUrl)return a=0!=a.length?a:b.warrantyId,a=b.blrUrl+"%26wid="+a,"undefined"!==typeof this.msg?
|
|
c=""!==this.msg.vQty?this.msg.vQty:"":""!==b.quantity&&(c=b.quantity),""!==c&&"undefined"!==typeof c&&(a=a+("%26quantity="+c)+("%26qty="+c)),top.location=a,!1;b.wrtyUrl&&((0!=a.length||b.warrantyId)&&""!==b.mapPCOlyId&&this.pubsub.publish("_CLOSE_OLAY",{cmpId:b.mapPCOlyId}),(!b.addOnRedesignEnabled||b.addOnRedesignEnabled&&"undefined"!==typeof this.signin&&1===this.signin)&&this.pubsub.publish("_OPEN_OLAY",{cmpId:b.binOlyId}),this.buildUrl(!0))}},handleCart:function(){var b=this.cfg,a;a=this.chkdVals;
|
|
var c;if((!b.cartConfig||!(b.cartConfig.hasWrtyIntercept&&0==a.length))&&(null!==a||b.warrantyId)){if("undefined"!==typeof b.clrUrl)return a=null!==a?a:b.warrantyId,a=b.clrUrl+"%26wid="+a,"undefined"!==typeof this.msg?c=""!==this.msg.vQty?this.msg.vQty:"":""!==b.quantity&&(c=b.quantity),""!==c&&"undefined"!==typeof c&&(a=a+("%26quantity="+c)+("%26qty="+c)),top.location=a,!1;""!==b.mapPCOlyId&&this.pubsub.publish("_CLOSE_OLAY",{cmpId:b.mapPCOlyId});(!b.addOnRedesignEnabled||b.addOnRedesignEnabled&&
|
|
"undefined"!==typeof this.signin&&1===this.signin)&&this.pubsub.publish("_OPEN_OLAY",{cmpId:b.atcOlyId});this.buildUrl(!1)}else this.pubsub.publish("SHOW_WARRANTY_ATC_INTERCEPT",{})},getChkdVal:function(b){var a=[];if(null!=b)for(var c=0;c<b.length;c++)a.push(b[c].warrantyItemId);return a},buildUrl:function(b){var a=this.cfg,c,d=a.wrtyUrl,e,i,f=0;"undefined"!==typeof this.msg?e=""!==this.msg.vQty?this.msg.vQty:"":""!==a.quantity&&(e=a.quantity);""!==e&&"undefined"!==typeof e&&(d=d+("&quantity="+e)+
|
|
("&qty="+e));var h=this.chkdVals,g=this.wrtyCt;i="undefined"!=typeof a.warrantyId?a.warrantyId.split(",").length:h.length;if(""!==this.reqCt){d+="&item="+a.itemId;if(!b)return top.location=d.replace("/sc/atc?","/sc/add?"),!1;d+="&restype=json";d+="&rand="+Date.now();!a.cartConfig||a.cartConfig&&!a.cartConfig.isBulkCart?a.addOnRedesignEnabled||this.makeRequest(d,b):f=a.itemId}else g<i&&(null!==h[g]&&"undefined"!==typeof h[g]?c=h[g]:"undefined"!=typeof a.warrantyId&&(c=1<=a.warrantyId.split(",").length?
|
|
a.warrantyId.split(",")[g]:a.warrantyId),d+="&item="+c,d+="&restype=json",d+="&rand="+Date.now(),!a.cartConfig||a.cartConfig&&!a.cartConfig.isBulkCart?a.addOnRedesignEnabled||this.makeRequest(d,b):f=c,this.wrtyCt++);if(b&&a.addOnRedesignEnabled&&(f=a.itemId,"undefined"!==typeof f&&0!=f&&"undefined"!==typeof c&&0!=c))return""!==e&&"undefined"!==typeof e||(e=1),a.wrtyBulkAddToCartUrl=a.wrtyBulkAddToCartUrl+"&item=iid:"+f+",qty:"+e+"&item=iid:"+c+",qty:"+e,this.wrtyCt>=i&&(top.location=a.wrtyBulkAddToCartUrl),
|
|
!1;if(a.cartConfig&&a.cartConfig.isBulkCart&&0!=f){""!==e&&"undefined"!==typeof e||(e=1);if(!a.cartConfig.bulkCartItemIdAppended||f!=a.itemId)a.cartConfig.submitURL=a.cartConfig.submitURL+"&item=iid:"+f+",qty:"+e;a.cartConfig&&a.cartConfig.hasWrtyIntercept&&(a.cartConfig.hasWrtyIntercept=!1);a.cartConfig.wrtyflow=!0;this.pubsub.publish("_WARRANTY_SELECTED",{isWrty:!1});this.pubsub.publish("_SUBMIT_CARTBTN",a.cartConfig)}},makeRequest:function(b,a){this.bBin=a;var c=0<b.indexOf("/sc/atc?")?"callback":
|
|
null;this.ajaxUtil.getJSON(b,this.handleResponse,this,null,c)},handleResponse:function(b){var a=this.cfg;b&&(b.status&&"SUCCESS"==b.status?""===this.reqCt?(b="undefined"!==typeof a.warrantyId?a.warrantyId.split(",").length:this.chkdVals.length,this.wrtyCt>=b&&(this.reqCt=1),this.buildUrl(this.bBin)):a.removeWarrantyBinLayer?top.location=a.crtUrl:this.bBin?($("#"+a.binTrbrId).hide(),$("#"+a.binCntId).show()):(this.pubsub.publish("_CLOSE_OLAY",{cmpId:a.atcOlyId}),top.location=a.crtUrl):this.pubsub.publish("_CLOSE_OLAY",
|
|
{cmpId:a.binOlyId}))},cancel:function(){var b=this.cfg;raptor.require("raptor.vi.ActionPanel");this.pubsub.publish("_CLOSE_OLAY",{cmpId:b.binOlyId});this.pubsub.publish("_WARRANTY_SELECTED",{isWrty:!1});$("#"+b.binBtnId).trigger("click")},onClose:function(){var b=window.location.href,b=b.replace(/[?\&]w[b|c]olp=1/,"");top.location=b}}});raptor.defineClass("raptor.vi.Warranty",function(){return{init:function(a){this.pubsub=raptor.require("pubsub");this.ajaxUtil=raptor.require("com.ebay.raptor.vi.AjaxUtil");this.cnts=this.getArr(a.contIds);this.lbls=this.getArr(a.lblIds);this.desc=this.getArr(a.descIds);this.reqCt=this.curWrty="";this.addEventListener(a)},addEventListener:function(a){var b=this;b.cfg=a;$("#"+a.lmDivId).click(function(){b.toggleList(a)});$("#"+a.hdDivId).click(function(){b.toggleList(a)});for(var c=0;c<=b.lbls.length;c++)$("#"+
|
|
b.lbls[c]).click(function(){b.resetChkBox(this,a)});$("#"+a.cfmBtnId).click(function(){b.makeSelect(a)});$("#"+a.cnclLnk).click(function(){b.cancel()});b.pubsub.subscribe("_WARRANTY",function(a){b.handleMsg(a)},this);b.pubsub.channel(a.binOlyId).subscribe("_OLY_CLS_SVC",function(){b.onClose()},b);b.pubsub.channel(a.atcOlyId).subscribe("_OLY_CLS_SVC",function(){b.onClose()},b);a.atcOnLoad&&$(document).ready(function(){b.handleCart()});a.binOnLoad&&$(document).ready(function(){b.handleBin()})},handleMsg:function(a){this.msg=
|
|
a;"undefined"==typeof a.btnId?this.handleCart():this.handleBin()},getArr:function(a){for(var b=[],c=0;c<a.split(",").length;c++)b[c]=a.split(",")[c];return b},toggleList:function(a){$("#"+a.lmDivId).toggle();$("#"+a.hdDivId).toggle();$("#"+a.lstDivId).toggle();$("#"+a.dtlsDivId).toggle()},resetList:function(a){$("#"+a.lmDivId).show();$("#"+a.hdDivId).hide();$("#"+a.lstDivId).hide();$("#"+a.dtlsDivId).hide()},resetChkBox:function(a,b){"t"==$(a).attr("chk")?($(a).attr("chk","f"),$(a).addClass(b.lblCls),
|
|
$(a).removeClass(b.lblChkCls),$(a).next().css("font-weight","normal")):($(a).attr("chk","t"),$(a).removeClass(b.lblCls),$(a).addClass(b.lblChkCls),$(a).next().css("font-weight","bold"));for(var c in this.lbls)if(this.lbls.hasOwnProperty(c)&&a.id!=this.lbls[c]){var d=$("#"+this.lbls[c]);"t"==d.attr("chk")&&(d.attr("chk","f"),d.addClass(b.lblCls),d.removeClass(b.lblChkCls),d.next().css("font-weight","normal"))}},makeSelect:function(a){var b=$("#"+a.addPrId),c=$("#"+a.addDivId),d=$("#"+a.addTxtId);this.pubsub.publish("_CLOSE_OLAY",
|
|
{cmpId:a.addOlyId});for(var f in this.lbls)if(this.lbls.hasOwnProperty(f)){var e=$("#"+this.lbls[f]);if("t"==e.attr("chk")){b.html(e.siblings(a.prcCls).html());b.addClass(a.addCls);d.html(e.next().html());c.show();this.pubsub.publish("_WARRANTY_SELECTED",{isWrty:!0});break}else b.html(a.addFrPrxTxt),b.removeClass(a.addCls),this.pubsub.publish("_WARRANTY_SELECTED",{isWrty:!1}),c.hide()}this.resetList(a)},saveState:function(a){this.curWrty=""!==a?a:""},getChkdVal:function(){var a;for(a=0;a<this.lbls.length;a++){var b=
|
|
$("#"+this.lbls[a]);if("t"==b.attr("chk"))return a=b.attr("v")}return null},handleBin:function(){var a=this.cfg,b;b=this.getChkdVal();if(null!==b||a.warrantyId){$("#"+a.binTrbrId).show();$("#"+a.binCntId).hide();if("undefined"!==typeof a.blrUrl)return b=a.blrUrl+"%26wid="+b,"undefined"!==typeof this.msg?vQty=""!==this.msg.vQty?this.msg.vQty:"":""!==a.quantity&&(vQty=a.quantity),""!==vQty&&(b+="%26quantity="+vQty,b+="%26qty="+vQty),window.location.replace(b),!1;a.wrtyUrl&&(this.pubsub.publish("_OPEN_OLAY",
|
|
{cmpId:a.binOlyId}),this.buildUrl(!0))}},handleCart:function(){var a=this.cfg,b;b=this.getChkdVal();if(null!==b||a.warrantyId){if("undefined"!==typeof a.clrUrl)return b=a.clrUrl+"%26wid="+b,"undefined"!==typeof this.msg?vQty=""!==this.msg.vQty?this.msg.vQty:"":""!==a.quantity&&(vQty=a.quantity),""!==vQty&&(b+="%26quantity="+vQty,b+="%26qty="+vQty),window.location.replace(b),!1;this.pubsub.publish("_OPEN_OLAY",{cmpId:a.atcOlyId});this.buildUrl(!1)}},buildUrl:function(a){var b=this.cfg,c=b.wrtyUrl,
|
|
d;"undefined"!==typeof this.msg?d=""!==this.msg.vQty?this.msg.vQty:"":""!==b.quantity&&(d=b.quantity);""!==d&&(c=c+("&quantity="+d)+("&qty="+d));d=this.getChkdVal();if(""!==this.reqCt){if(c+="&item="+b.itemId,!a)return top.location=c.replace("/sc/atc?","/sc/add?"),!1}else b=null!==d?d:b.warrantyId,c+="&item="+b;c+="&restype=json";c+="&rand="+Date.now();this.makeRequest(c,a)},makeRequest:function(a,b){this.bBin=b;var c=0<a.indexOf("/sc/atc?")?"callback":null;this.ajaxUtil.getJSON(a,this.handleResponse,
|
|
this,null,c)},handleResponse:function(a){var b=this.cfg;a&&(a.status&&"SUCCESS"==a.status?""===this.reqCt?(this.reqCt=1,this.buildUrl(this.bBin)):this.bBin?($("#"+b.binTrbrId).hide(),$("#"+b.binCntId).show()):(this.pubsub.publish("_CLOSE_OLAY",{cmpId:b.atcOlyId}),top.location=b.crtUrl):this.pubsub.publish("_CLOSE_OLAY",{cmpId:b.binOlyId}))},cancel:function(){this.pubsub.publish("_CLOSE_OLAY",{cmpId:this.cfg.binOlyId})},onClose:function(){var a=window.location.href,a=a.replace(/[?\&]w[b|c]olp=1/,"");
|
|
top.location=a}}});raptor.defineClass("ebay.viewItem.ZoomEnlarge",function(){return{init:function(a){var b=this;b.conf=a;b.pubsub=raptor.require("pubsub");b.pubsub.subscribe("_TRIGGER_ZOOM_ENLARGE",function(a){b.handleMsg(a)},b);b.pubsub.subscribe("_SHOW_ENLARGE_MSG",function(){b.showZoomOrEnlargeMsg(!1)},b);b.pubsub.subscribe("_HIDE_ENLARGE_MSG",function(a){b.toggleEnlargeMsg(a.isZoom)},b);b.bindImageEnterKeyHandler();b.pubsub.subscribe("_LKHR_THB_IMG_CLK",function(){b.sendImgMsg()},b)},bindImageEnterKeyHandler:function(){$("#linkMainImg").bind("keydown",
|
|
function(a){13==a.keyCode&&$("#mainImgHldr").trigger("click")})},handleMsg:function(a){var b=this.conf,c=a.img.enlargeEnabled,d=a.img.zoomEnabled&&!b.disableZoom;this.imgMsg=a;c&&d?($("#mainImgHldr").unbind("click"),"ontouchstart"in document.documentElement||b.isTouch?(this.pubsub.publish("_TRIGGER_ENLARGE",{img:a.img,id:a.id,isZoom:"true",isTouch:"true"}),this.showZoomOrEnlargeMsg(!1)):(this.pubsub.publish("_TRIGGER_ZOOM",{img:a.img,id:a.id}),this.pubsub.publish("_TRIGGER_ENLARGE",{img:a.img,id:a.id,
|
|
isZoom:"true"}),this.showZoomOrEnlargeMsg(!0))):c&&!d?(c=$("#mainImgHldr"),c.unbind("mouseenter mouseleave"),c.unbind("click"),c.css("cursor","pointer"),"ontouchstart"in document.documentElement||b.isTouch?this.pubsub.publish("_TRIGGER_ENLARGE",{img:a.img,id:a.id,isZoom:"false",isTouch:"true"}):this.pubsub.publish("_TRIGGER_ENLARGE",{img:a.img,id:a.id,isZoom:"false"}),this.showZoomOrEnlargeMsg(!1)):($("#mainImgHldr").unbind("mouseenter mouseleave mousemove"),$("#mainImgHldr").unbind("click"),$("#mainImgHldr").unbind("touchstart"),
|
|
this.hideZoomOrEnlargeMsg())},showZoomOrEnlargeMsg:function(a){var b=this.conf,a=a?b.zoomMsg:b.enlargeMsg;$("#"+b.zoomEnMsgId).html(a);$("#"+b.zoomEnMsgCntId).css("visibility","visible")},hideZoomOrEnlargeMsg:function(){$("#"+this.conf.zoomEnMsgCntId).css("visibility","hidden")},toggleEnlargeMsg:function(a){var b=this.conf;a&&$("#"+b.zoomEnMsgId).html(b.zoomMsg)},sendImgMsg:function(){"undefined"!=this.imgMsg.id&&this.pubsub.publish("_BTF_IMG_CMP_ON_READY",this.imgMsg)}}});raptor.defineClass("ebay.viewItem.Zoom",function(){var g;g={hideOtherOverlay:function(){$("html").click();$("#vi_oly_atwlstovly").css("display","none");$("#vi_oly_vi-erc-bubble-olay").css("display","none");$(".msku-sel").hide();try{GH&&GH.hA()}catch(c){}},postZoomClosed:function(){$(".msku-sel").show();$(".msku-btn-sel-cmp").each(function(){$(this).hasClass("u-dspn")||$(this).prev().hide()})}};return{init:function(c){var a=this;a.conf=c;a.imgArray=[];a.pubsub=raptor.require("pubsub");a.pubsub.subscribe("_TRIGGER_ZOOM",
|
|
function(b){a.triggerZoom(b)},a);a.window=$(window);a.view=$("#mainImgHldr")},triggerZoom:function(c){var a=this,b=a.conf;a.mainImg=$("#"+b.mainImgId);a.mainImg.id=c.id;a.mainImg.zoomImgUrl=c.img.maxImageUrl;a.mainImg.isZoom=c.img.zoomEnabled;a.mainImg.isEnlarge=c.img.enlargeEnabled;a.viewImg=$("#icImg");a.zoomImg=$("#"+b.zoomImgId);$("#mainImgHldr").unbind("mouseenter");$("#mainImgHldr").unbind("mouseleave");var d=document.createElement("img");d.setAttribute("imgId",c.id);d.src=a.mainImg.zoomImgUrl;
|
|
d.complete||4===d.readyState?a.imageLoad(d):d.onload=function(){a.imageLoad(d)}},imageLoad:function(c){var a=this;if(c.getAttribute("imgId")==a.mainImg.id){a.bindTriggerEvent(c);var b=$("#mainImgHldr").parent();b.bind("keydown",function(c){b.is(":focus")&&13===c.keyCode&&a.pubsub.publish("viEnlargeImgLayer_SHOW_ENLARGE_IMG",{isZoom:!0})});!$.browser.msie&&!$.browser.opera?a.view.is(":hover")&&a.showZoomTriggerMask(c):$("#mainImgHldr").bind("mousemove",function(){$("#mainImgHldr").unbind("mousemove");
|
|
a.showZoomTriggerMask(c)})}},bindTriggerEvent:function(c){var a=this;$("#mainImgHldr").bind("mouseenter",function(){a.showZoomTriggerMask(c)});$("#mainImgHldr").bind("mouseleave",function(){a.hideZoomTriggerMask(c)})},initZoom:function(c){var a=this.conf,b=this.imgArray[this.mainImg.id];b||(b={height:this.mainImg.height(),width:this.mainImg.width(),zoomImgHeight:c.height,zoomImgWidth:c.width,offset:this.mainImg.offset()},this.imgArray[this.imgId]=b);this.mainImgtopPad=(a.mImgContainerSize-b.height)/
|
|
2;this.mainImgleftPad=(a.mImgContainerSize-b.width)/2;this.maskElem=$("#"+a.maskId);this.zoomCntr=$("#"+a.zoomCntrId);this.imgCntr=$("#"+a.imgCntrId);$("#vi_zoomEnl_plc_hldr").append(this.maskElem);$("#vi_zoomEnl_plc_hldr").append(this.zoomCntr);this.initZoomTriggerMask();this.initZoomViewer(this.imgArray[this.imgId]);this.initZoomSelector(this.imgArray[this.imgId])},initZoomTriggerMask:function(){var c=this.conf;this.zoomTriggerMask=$("#vi_zoom_trigger_mask");this.zoomTriggerMask.css({height:c.mImgContainerSize,
|
|
width:c.mImgContainerSize,top:0,left:1});this.zoomTriggerMarker=$("#vi_zoom_trigger_mrk");this.zoomTriggerMarker.css({top:(c.mImgContainerSize-120)/2,left:(c.mImgContainerSize-120)/2});this.view.append(this.zoomTriggerMask)},initZoomSelector:function(c){var a=this.conf,c=this.imgArray[this.imgId];this.ratioH=c.zoomImgHeight/c.height;this.ratioW=c.zoomImgWidth/c.width;this.zoomSelector=$("#"+a.zoomSelId);var a=this.zoomCntr.height()/this.ratioH,a=a>c.height?c.height:a,b=this.zoomCntr.width()/this.ratioW,
|
|
b=b>c.width?c.width:b;this.zoomSelector.height(a);this.zoomSelector.width(b);this.view.append(this.zoomSelector)},initZoomViewer:function(){var c=this.conf,a=0,a=c.isNewZoomTest1?$("#LeftSummaryPanel").width()+$("#RightSummaryPanel").width():(c.redesign?$("#ItemPanel"):$("#LeftSummaryPanel")).width(),b=$("#CenterPanel"),d=$("#PicturePanel").offset(),e=$(window).height(),g=$(window).scrollTop(),f=b.height()-(d.top-b.offset().top);if(c.redesign||c.isNewZoomTest1)b.offset(),b=e+g-d.top-3,b<f&&(f=b),
|
|
b=$(window).width()-(d.left+$("#PicturePanel").width())-18,b<a&&0<b&&(a=b);$.browser.msie&&8>$.browser.version?(this.maskElem.css({top:d.top+"px",left:d.left+c.mImgContainerSize+18-(c.redesign?3:0)+"px",height:f+"px",width:a-(c.redesign?0:12)+"px"}),this.zoomCntr.css({top:d.top+"px",left:d.left+c.mImgContainerSize+18-(c.redesign?3:0)+"px",height:f+"px",width:a-(c.redesign?0:c.isNewZoomTest1?-14:12)+"px"})):(this.maskElem.css({top:d.top+"px",left:d.left+c.mImgContainerSize+18-(c.redesign?3:0)+"px",
|
|
height:f+"px",width:a-(c.redesign?-5:18)+"px"}),this.zoomCntr.css({top:d.top+"px",left:d.left+c.mImgContainerSize+18-(c.redesign?3:0)+"px",height:f+"px",width:a-(c.redesign?-5:18-(c.isNewZoomTest1?15:0))+"px"}))},showZoomTriggerMask:function(c){var a=this;0==a.mainImg.width()||0==a.mainImg.height()||(a.isTriggerMaskShown=!0,a.initZoom(c),a.zoomTriggerMarker.bind("mouseenter",function(b){a.showingZoom||a.showZoom(b,c)}),a.zoomTriggerMask.show(),a.pubsub.publish("_SHOW_ENLARGE_MSG",{isZoom:!0}),a.mainImg.isEnlarge&&
|
|
a.zoomTriggerMask.bind("click",function(){a.hideZoom();a.pubsub.publish("viEnlargeImgLayer_SHOW_ENLARGE_IMG",{isZoom:!0})}))},hideZoomTriggerMask:function(){this.isTriggerMaskShown&&(this.zoomTriggerMask.hide(),this.isTriggerMaskShown=!1,this.mainImg.isZoom&&this.mainImg.isEnlarge&&(this.pubsub.publish("_HIDE_ENLARGE_MSG",{isZoom:!0}),this.zoomTriggerMask.unbind("click")))},showZoom:function(c,a){var b=this,d=b.conf;b.showingZoom=!0;trackingUtil("ZOOM_ON_HOVER");g.hideOtherOverlay();b.zoomImg.attr("src",
|
|
b.mainImg.zoomImgUrl);b.zoomTriggerMask.hide();b.view.bind("mouseleave",function(){b.hideZoom()});$(window).bind("resize",function(){b.hideZoom()});b.view.bind("mousemove",function(a){b.handleMoveEvt(a)});b.initZoomViewer(b.imgArray[b.imgId]);b.initZoomSelector(b.imgArray[b.imgId]);b.handleMoveEvt(c);b.zoomSelector.show();b.maskElem.show();b.zoomCntr.show();b.imgCntr.show();b.zoomImg.show();b.pubsub.publish("_SHOW_ENLARGE_MSG",{isZoom:!0});b.mainImg.isEnlarge&&b.zoomSelector.bind("click",function(){b.hideZoom();
|
|
b.pubsub.publish("viEnlargeImgLayer_SHOW_ENLARGE_IMG",{isZoom:!0})});b.zoomTriggerMarker.unbind("mouseenter");d.imgCntrLeftPad=0;if((d.redesign||d.isNewZoomTest1)&&a&&b.zoomCntr.width()>a.width)d.imgCntrLeftPad=(b.zoomCntr.width()-a.width)/2;b.pubsub.publish("_TRIGGER_IMG_PRELOAD",{id:b.mainImg.id})},hideZoom:function(){this.showingZoom=!1;this.view.unbind("mousemove");$(window).unbind("resize");g.postZoomClosed();this.zoomSelector.hide();this.maskElem.hide();this.zoomCntr.hide();this.imgCntr.hide();
|
|
this.zoomImg.hide();this.zoomImg.attr("src","//p.ebaystatic.com/aw/pics/s.gif");this.mainImg.isZoom&&this.mainImg.isEnlarge&&(this.pubsub.publish("_HIDE_ENLARGE_MSG",{isZoom:!0}),this.zoomSelector.unbind("click"))},handleMoveEvt:function(c){var a=this.imgArray[this.imgId],b=this.window.scrollTop(),d=this.window.scrollLeft();this.setZoomPosition(Math.floor(c.clientX-this.viewImg.offset().left+d),Math.floor(c.clientY-this.viewImg.offset().top+b),a)},setZoomPosition:function(c,a){var b=this.conf,d=c-
|
|
this.zoomSelector.width()/2,e=a-this.zoomSelector.height()/2,d=Math.max(d,0),e=Math.max(e,0),d=Math.min(d,this.viewImg.width()-this.zoomSelector.outerWidth()),e=Math.min(e,this.viewImg.height()-this.zoomSelector.outerHeight());this.zoomSelector.css({left:d+this.mainImgleftPad+1+"px",top:e+this.mainImgtopPad+"px"});this.imgCntr.css({top:-(e*this.ratioH)+"px",left:-(d*this.ratioW)+b.imgCntrLeftPad+"px"})}}});raptor.defineModule("com.ebay.raptor.vi.utils",function(){return{scrollPageToTop:function(a){if(a&&0!=a)return $("html, body").animate({scrollTop:0},300),!1}}});raptor.defineClass("com.ebay.raptor.vi.bid.powerbid.PowerBid",{superclass:"com.ebay.raptor.vi.bid.Bid"},function(){var i=function(a){this.variant=a.variant;this.trending_tracked_outbid=this.trending_tracked=this.ovV4=this.userAction=!1;this.sPTBflOld=null;this.evtNS=a.evtNS;this.amountUtils=raptor.require("com.ebay.raptor.vi.powerbid.AmountUtils");i.superclass.init.apply(this,arguments);this.invalidBidAmountErr=null};i.prototype={bidClick:function(a){var b=this.cfg,c,d;i.superclass.bidVars.apply(this);
|
|
a&&(c=a.maxbid,this.shipping=a.shipping,this.impCharge=a.impCharge,this.sPTBflOld=a.sPTBflOld,d=a.isRedirect);c=c?c:b.maxBidDefVal;this.triggerCall(b.powerBidInitURL,c,!0,d,!0)},triggerCall:function(a,b,c,d,e){var f=this.cfg;if(a&&(this.invalidBidAmountErr=null,this.callFromPage=e,this.callFromPage||(this.userAction=!0,2==this.variant&&$("#"+f.rgtBubbleId).hide(),this.pubsub.publish("_CLOSE_OLAY",{cmpId:"powerBidSurveyOly"}),5<this.variant&&15>this.variant&&(this.pubsub.publish("_CLOSE_OLAY",{cmpId:"helpLayerOly1"}),
|
|
this.pubsub.publish("_CLOSE_OLAY",{cmpId:"helpLayerOly2"}))),b=c&&b?b:null,e||!this.valiadteInput(b))){this.hideAll(e);$("#"+f.layerWrapper).hide();this.throbber(!0);if(this.maxBidAmt=b)d?(e=-1!==a.indexOf("?")?"&":"?",e+=$.param({maxbid:b}),a+=encodeURIComponent(e)):(a+=-1!==a.indexOf("?")?"&":"?",a+=$.param({maxbid:b}));d?top.location.href=a:this.ajaxUtil&&this.ajaxUtil.getJSON(a,this.processResponse,this)}},processResponse:function(a){var b=this,c=b.cfg,d,e;if(a&&(b.callFromPage||!a.isAutoRefresh||
|
|
!b.userAction))if(d=b.BidError.valueOf(a.Error),!d||!b.isRedirectErrors(d,a.ErrorUrl))if(a.IsEnded)setTimeout(function(){i.superclass.closeLayer.apply(b)},2500);else{(e=a.isAutoRefresh?b.status:b.BidStatus.valueOf(a.Status))&&!a.isAutoRefresh&&a.ViewerItemRelation&&e!=b.BidStatus.valueOf("REVIEWBID")&&(b.BidderStatus.valueOf(a.ViewerItemRelation)==b.BidderStatus.HIGHBIDDER?e=b.BidStatus.valueOf("CONFIRMBID"):b.BidderStatus.valueOf(a.ViewerItemRelation)==b.BidderStatus.OUTBIDDER&&(e=b.BidStatus.valueOf("PLACEBID")));
|
|
e&&(b.updateCurrBidColor(a,e),b.defaultFields(a),e==b.BidStatus.PLACEBID?b.placeBid(a):e==b.BidStatus.REVIEWBID?b.reviewBid(a):e==b.BidStatus.CONFIRMBID&&b.confirmBid(a),!a.isAutoRefresh&&b.callFromPage&&b.attachPowerBidEvts(),b.status=e);if((!a.isAutoRefresh||!b.trending_tracked)&&a&&a.CurrentPrice&&a.CurrentPrice.CleanAmount&&c.trendingPrice)if(a.CurrentPrice.CleanAmount>c.trendingPrice)$(".trending_help_info").hide(),$(".trendingPriceOnBidLayer").hide(),b.trending_tracked=!1;else{$(".trending_help_info").show();
|
|
$(".trendingPriceOnBidLayer").show();b.trending_tracked=!0;var f={sid:"p2047675.l9019"};c.trendingPrice&&(f.tprice=c.trendingPrice);a.CurrentPrice&&(a.CurrentPrice.CleanAmount&&(f.curprice=a.CurrentPrice.CleanAmount),a.CurrentPrice.CurrencyCode&&(f.currency=a.CurrentPrice.CurrencyCode));f.bl=a.ViewerItemRelation&&b.BidderStatus.valueOf(a.ViewerItemRelation)==b.BidderStatus.HIGHBIDDER&&b.trending_tracked?"hl":"pl";if(a.TimeLeft){var g=0;a.TimeLeft.DaysLeft&&(g+=864E5*a.TimeLeft.DaysLeft);a.TimeLeft.HoursLeft&&
|
|
(g+=36E5*a.TimeLeft.HoursLeft);a.TimeLeft.MinutesLeft&&(g+=6E4*a.TimeLeft.MinutesLeft);a.TimeLeft.SecondsLeft&&(g+=1E3*a.TimeLeft.SecondsLeft);f.timeLeft=g}e._name!=b.BidStatus.REVIEWBID._name&&!a.isAutoRefresh&&(setTimeout(function(){$(document).trigger("rover",f)},0),!b.trending_tracked_outbid&&(a.ViewerItemRelation&&b.BidderStatus.valueOf(a.ViewerItemRelation)==b.BidderStatus.OUTBIDDER&&a.OutbidBySmartBid)&&(setTimeout(function(){$(document).trigger("rover",{sid:"p2047675.l9053"})},0),b.trending_tracked_outbid=
|
|
!0))}a.ViewerItemRelation&&b.BidderStatus.valueOf(a.ViewerItemRelation)==b.BidderStatus.HIGHBIDDER&&b.trending_tracked?$(".trendingPriceOnBidLayer_high").show():$(".trendingPriceOnBidLayer_high").hide();b.updateBidAmtError(d,a);b.postProcessResponse(a);a.isAutoRefresh||(b.throbber(!1),$("#"+c.layerWrapper).show(),b.setTextFocus(a),a.isNewUser?(c=$("#vi_oly_powerBid").position(),$("#vi_oly_newuserOly").css({left:c.left+385,top:c.top+90})):($("#vi_oly_newuserOly").hide(),$("#vi_oly_newuserOly_layer1").hide(),
|
|
$("#vi_oly_newuserOly_layer2").hide()),b.setTimer());b.userAction=!1;!a.isAutoRefresh&&a.ROIUrls&&b.bidUtil.preload(a.ROIUrls)}},setTimer:function(){try{if("undefined"!=typeof this.sPTBflOld){var a=(new Date).getTime()-this.sPTBflOld;$(document).trigger("BflTimer",{type:"placebid",diff:a,kind:"Old",sid:"m5028"})}}catch(b){window.console&&window.console.log(b)}},setTextFocus:function(a){var b=this.cfg;if(!a.isAutoRefresh){var c;if(this.BidStatus.valueOf(a.Status)!=this.BidStatus.valueOf("REVIEWBID")){if(2==
|
|
this.variant||6<=this.variant&&15>this.variant)c=b.ebayBidSectionId+b.value;c&&0<$("#"+c).length&&$("#"+c).focus()}else(2==this.variant||6<=this.variant&&15>this.variant)&&$("#"+b.reviewSectionId+b.btn).focus()}},setCursorPos:function(a,b){if(10>b)try{if(a.createTextRange){var c=a.createTextRange();c.move("character",b);c.select()}else a.setSelectionRange&&a.setSelectionRange(b,b)}catch(d){}},postProcessResponse:function(a){this.cfg.showBanner&&this.showOrHideBanner(a)},showOrHideBanner:function(a){this.BidderStatus.valueOf(a.ViewerItemRelation)===
|
|
this.BidderStatus.HIGHBIDDER?$("#vi_oly_powerBid .layerWrap .mobBan").show():$("#vi_oly_powerBid .layerWrap .mobBan").hide()},placeBid:function(a){var b=this.cfg;this.addRemoveClasses($("#"+b.layerWrapper),["conB","revB"],["plaB"]);this.updateMaximumBid(a,!1);this.updateMinToBid(a,!1);this.populateNextIncrementValue(a);!a.isAutoRefresh&&0<$("#"+b.ebayBidSectionId+b.value).length&&$("#"+b.ebayBidSectionId+b.value).val("");a.isAutoRefresh||this.cfg.isGsp&&this.updateImportCharge(!1);(14==this.variant||
|
|
!a.isAutoRefresh)&&this.updateEbaySectionTxt(a,!0);14==this.variant&&!a.isAutoRefresh&&this.updateHelpContent(a);this.confirmBidMsg(a);a.isAutoRefresh||this.updateLegalText(1);this.showOrHideEle([b.topPanelId,b.placeBidSectionId,b.bidSectionId+b.wrapper,b.disclaimerId+"_txt",b.disclaimerId],!0)},reviewBid:function(a){var b=this.cfg;this.addRemoveClasses($("#"+b.layerWrapper),["conB","plaB"],["revB"]);if(!a.isAutoRefresh&&(a.MaximumBid&&($("#"+b.reviewSectionId+b.value).html(a.MaximumBid.MoneyStandard),
|
|
$("#"+b.reviewSectionId+b.value+"_hdn").val(a.MaximumBid.CleanAmount)),a.MaximumBidLocal&&$("#"+b.reviewSectionId+b.approx).html($("#"+b.approxAmtNewId).html().replace("##2##",a.MaximumBidLocal.MoneyStandard)),2==this.variant||6<=this.variant&&15>this.variant)){var c=$("#"+b.reviewSectionId+b.btn).html(),d=$("#"+b.reviewSectionId+b.value).html();c&&$("#"+b.reviewSectionId+b.btn).html(c+"<span class='offscreen'>"+d+"</span>")}!a.isAutoRefresh&&this.cfg.isGsp&&this.updateImportCharge(!0);a.isAutoRefresh||
|
|
this.updateLegalText(2);this.showOrHideEle([b.topPanelId,b.reviewSectionId+b.wrapper,b.disclaimerId+"_txt",b.disclaimerId],!0)},confirmBid:function(a){var b=this.cfg,c=this.BidderStatus.valueOf(a.ViewerItemRelation)===this.BidderStatus.HIGHBIDDER;this.addRemoveClasses($("#"+b.layerWrapper),["revB","plaB"],["conB"]);this.updateMaximumBid(a,!0);a.isAutoRefresh?!c&&(10==this.variant||11==this.variant||12==this.variant||13==this.variant||14==this.variant)&&$("#"+b.highBidTopSectionId).hide():this.cfg.isGsp&&
|
|
this.updateImportCharge(!1);10==this.variant||11==this.variant||12==this.variant||13==this.variant||14==this.variant?this.updateMinToBid(a,!0):(this.updateMinToBid(a,!0),$("#"+b.placeBidSectionId+b.value).val(a.MaxBidPlusOneIncrement?a.MaxBidPlusOneIncrement.CleanAmount:a.MinimumToBid.CleanAmount));this.confirmBidMsg(a);(10==this.variant||11==this.variant||12==this.variant||13==this.variant||14==this.variant)&&this.populateNextIncrementValue(a);(14==this.variant||!a.isAutoRefresh)&&this.updateEbaySectionTxt(a,
|
|
!1);14==this.variant&&!a.isAutoRefresh&&this.updateHelpContent(a);a.isAutoRefresh||this.updateLegalText(3);this.showOrHideEle([b.topPanelId,b.bidSectionId+b.wrapper,b.disclaimerId+"_txt",b.disclaimerId],!0);!a.isAutoRefresh&&0<$("#"+b.ebayBidSectionId+b.value).length&&($("#"+b.ebayBidSectionId+b.value).val(""),$("#"+b.ebayBidSectionId+b.value).focus())},updateHelpContent:function(a){var b=this.cfg;a&&(this.BidderStatus.valueOf(a.ViewerItemRelation)==this.BidderStatus.OUTBIDDER&&a.OutbidBySmartBid)&&
|
|
(this.expandCnt(b.topHelpTxtId),$("#"+b.seeMoreHelpId).show(),$("#"+b.seeMoreHelpId+"_cnt").hide())},updateLegalText:function(a){var b=this.cfg;1==a||3==a?($(".layerWrap .rev_gsp").hide(),$(".layerWrap .rev_noGsp").hide(),b.isGsp?($(".layerWrap .noGsp").hide(),$(".layerWrap .gsp").show()):($(".layerWrap .gsp").hide(),$(".layerWrap .noGsp").show())):2==a&&($(".layerWrap .gsp").hide(),$(".layerWrap .noGsp").hide(),b.isGsp?($(".layerWrap .rev_noGsp").hide(),$(".layerWrap .rev_gsp").show()):($(".layerWrap .rev_gsp").hide(),
|
|
$(".layerWrap .rev_noGsp").show()))},populateNextIncrementValue:function(a){var b=this.cfg,c=a.MaxBidPlusOneIncrement?a.MaxBidPlusOneIncrement:a.MinimumToBid,d=a.MinimumToBidLocal;bidderStatus=this.BidderStatus.valueOf(a.ViewerItemRelation);var e=bidderStatus===this.BidderStatus.HIGHBIDDER,f=b.bidBtnTxt,g=b.nowTxt;2==this.variant?($("#"+b.placeBidSectionId+b.btn).html(f+" "+c.MoneyStandard),$("#"+b.placeBidSectionId+b.value).val(c.CleanAmount)):6==this.variant||7==this.variant||8==this.variant||9==
|
|
this.variant?(6==this.variant?$("#"+b.placeBidSectionId+b.btn).html($("#"+b.bidBtnTxtNowNewId).html().replace("##3##",c.MoneyStandard)):$("#"+b.placeBidSectionId+b.btn).html(f+" "+c.MoneyStandard+" "+g),$("#"+b.placeBidSectionId+b.value).val(c.CleanAmount)):10==this.variant||11==this.variant?e?(a.isAutoRefresh?(c=this.getNextIncrementAmount(a),a.LocalCurrentPrice&&(d=this.amountUtils.getLocalPrice(a,c))):a.MaximumBid?(c=a.PowerBidVal1,a.LocalCurrentPrice&&(d=a.PowerBidVal1Local)):(c=a.PowerBidVal2,
|
|
a.LocalCurrentPrice&&(d=a.PowerBidVal2Local)),$("#"+b.placeBidSectionId+b.btn).html(f+" "+c.MoneyStandard),$("#"+b.placeBidSectionId+b.value).val(c.CleanAmount)):($("#"+b.placeBidSectionId+b.btn).html(f+" "+c.MoneyStandard+" "+g),$("#"+b.placeBidSectionId+b.value).val(c.CleanAmount),a.isAutoRefresh&&(a.LocalCurrentPrice&&!d)&&(d=this.amountUtils.getLocalPrice(a,c))):(12==this.variant||13==this.variant||14==this.variant)&&this.populateValuesforGamfc1(a);14!=this.variant&&a.LocalCurrentPrice&&(d||(d=
|
|
this.amountUtils.getLocalPrice(a,c)),d?($("#"+b.placeBidSectionId+b.approx).html(d.MoneyStandard),$("#"+b.placeBidSectionId+b.approx).show()):$("#"+b.placeBidSectionId+b.approx).hide())},getNextIncrementAmount:function(a){return this.amountUtils&&a?this.amountUtils.getMaxPlusOneIncrementPrice(a):null},getNextIncrementLocalAmount:function(a){return this.amountUtils&&a?this.amountUtils.getMaxPlusOneIncrementLocalPrice(a):null},showOnlyTwoButtons:function(a){return 33<$(a+"_1").text().length+$(a+"_2").text().length+
|
|
$(a+"_3").text().length},IsResponseRounded:function(a){return a&&a.PowerBidVal1&&a.PowerBidVal2&&a.PowerBidVal3&&a.PowerBidVal1.MoneyStandardNoDecimals&&a.PowerBidVal2.MoneyStandardNoDecimals&&a.PowerBidVal3.MoneyStandardNoDecimals?!0:!1},populateValuesforGamfc1:function(a){try{var b=this.cfg,c=b.bidBtnTxt,d=!1;14==this.variant&&(d=this.IsResponseRounded(a));if(d)$("#"+b.placeBidSectionId+b.btn+"_1").html($("#"+b.bidBtnTxtNewId).html().replace("##3##",a.PowerBidVal1.MoneyStandardNoDecimals)),$("#"+
|
|
b.placeBidSectionId+b.btn+"_2").html($("#"+b.bidBtnTxtNewId).html().replace("##3##",a.PowerBidVal2.MoneyStandardNoDecimals)),$("#"+b.placeBidSectionId+b.btn+"_3").html($("#"+b.bidBtnTxtNewId).html().replace("##3##",a.PowerBidVal3.MoneyStandardNoDecimals));else{var a=a.isAutoRefresh?this.amountUtils.setPowerBidVal(a):this.amountUtils.roundingMakeQuickBid(a),e=this.amountUtils.removeDecimalDigits(a.PowerBidVal1.MoneyStandard,a.decimalSeparator),f=this.amountUtils.removeDecimalDigits(a.PowerBidVal2.MoneyStandard,
|
|
a.decimalSeparator),g=this.amountUtils.removeDecimalDigits(a.PowerBidVal3.MoneyStandard,a.decimalSeparator);$("#"+b.placeBidSectionId+b.btn+"_1").html(c+" "+e);$("#"+b.placeBidSectionId+b.btn+"_2").html(c+" "+f);$("#"+b.placeBidSectionId+b.btn+"_3").html(c+" "+g)}var h=this.showOnlyTwoButtons("#"+b.placeBidSectionId+b.btn);14==this.variant?h?$(".bidSecTabWrap .wholeWrap .btnsWrap").addClass("twoBtn"):$(".bidSecTabWrap .wholeWrap .btnsWrap").removeClass("twoBtn"):h?$("#"+b.placeBidSectionId+b.btn+
|
|
"_3").css({display:"none"}):$("#"+b.placeBidSectionId+b.btn+"_3").css({display:"inline-block"});$("#"+b.placeBidSectionId+b.btn+"_1"+b.value).val(a.PowerBidVal1.CleanAmount);$("#"+b.placeBidSectionId+b.btn+"_2"+b.value).val(a.PowerBidVal2.CleanAmount);$("#"+b.placeBidSectionId+b.btn+"_3"+b.value).val(a.PowerBidVal3.CleanAmount);14==this.variant?a.LocalCurrentPrice&&(h?($("#"+b.placeBidSectionId+b.approx+"_1").html(a.PowerBidVal1Local.MoneyStandard),$("#"+b.placeBidSectionId+b.approx+"_2").html(a.PowerBidVal2Local.MoneyStandard)):
|
|
($("#"+b.placeBidSectionId+b.approx+"_1").html(a.PowerBidVal1Local.MoneyStandard),$("#"+b.placeBidSectionId+b.approx+"_2").html(a.PowerBidVal2Local.MoneyStandard),$("#"+b.placeBidSectionId+b.approx+"_3").html(a.PowerBidVal3Local.MoneyStandard))):a.MinimumToBidLocal&&(h?($("#"+b.placeBidSectionId+b.approx+"_4").html(a.PowerBidVal1Local.MoneyStandard),$("#"+b.placeBidSectionId+b.approx+"_5").html(a.PowerBidVal2Local.MoneyStandard),$("#"+b.placeBidSectionId+b.approx+"_3btn").hide(),$("#"+b.placeBidSectionId+
|
|
b.approx+"_2btn").show()):($("#"+b.placeBidSectionId+b.approx+"_1").html(a.PowerBidVal1Local.MoneyStandard),$("#"+b.placeBidSectionId+b.approx+"_2").html(a.PowerBidVal2Local.MoneyStandard),$("#"+b.placeBidSectionId+b.approx+"_3").html(a.PowerBidVal3Local.MoneyStandard),$("#"+b.placeBidSectionId+b.approx+"_2btn").hide(),$("#"+b.placeBidSectionId+b.approx+"_3btn").show()))}catch(i){}},updateEbaySectionTxt:function(a,b){var c=this.cfg,d,e;e=(d=this.BidderStatus.valueOf(a.ViewerItemRelation))&&d===this.BidderStatus.HIGHBIDDER;
|
|
isOutBidder=d&&d===this.BidderStatus.OUTBIDDER;isError=a.Error;if(2==this.variant)b?($("#"+c.ebayBidSectionId+c.txt1).hide(),$("#"+c.ebayBidSectionId+c.txt2).show(),this.showOrHideEle([c.preBidId+c.wrapper],!1),this.showOrHideEle([c.placeBidSectionId,c.seperatorId],!0)):(e&&($("#"+c.ebayBidSectionId+c.txt1).show(),$("#"+c.ebayBidSectionId+c.txt2).show(),this.showOrHideEle([c.preBidId+c.wrapper],!0)),this.showOrHideEle([c.placeBidSectionId,c.seperatorId],!1));else if(6==this.variant||7==this.variant||
|
|
8==this.variant||9==this.variant)b?($("#"+c.ebayBidSectionId+c.txt0).hide(),$("#"+c.ebayBidSectionId+c.txt1).hide(),$("#"+c.ebayBidSectionId+c.txt2).show(),$("#"+c.ebayBidSectionId+c.txt1_btn).hide(),$("#"+c.ebayBidSectionId+c.txt2_btn).show(),this.showOrHideEle([c.preBidId+c.wrapper],!1),this.showOrHideEle([c.placeBidSectionId,c.seperatorId],!0)):(e&&($("#"+c.ebayBidSectionId+c.txt0).show(),$("#"+c.ebayBidSectionId+c.txt2).hide(),$("#"+c.ebayBidSectionId+c.txt1).show(),$("#"+c.ebayBidSectionId+c.txt2_btn).hide(),
|
|
$("#"+c.ebayBidSectionId+c.txt1_btn).show()),this.showOrHideEle([c.placeBidSectionId,c.seperatorId],!1));else if(10==this.variant||11==this.variant||12==this.variant||13==this.variant||14==this.variant)b?(10==this.variant||13==this.variant||14==this.variant?($("#vi_oly_powerBid .V"+this.variant+" .placeBidSectionTr").find("td:first").removeClass("placebidsec_pdn_hb").addClass("placebidsec_pdn_ob"),$("#vi_oly_powerBid .V"+this.variant+" .ebayBidSectionCnt").removeClass("ebaybidsec_pdn_hb").addClass("ebaybidsec_pdn_ob")):
|
|
($("#vi_oly_powerBid .V"+this.variant+" .placeBidSectionTr").find("td:first").removeClass("placebidsec_pdn_hb_rev").addClass("placebidsec_pdn_ob_rev"),$("#vi_oly_powerBid .V"+this.variant+" .ebayBidSectionCnt").removeClass("ebaybidsec_pdn_hb_rev").addClass("ebaybidsec_pdn_ob_rev")),14!=this.variant&&$("#vi_oly_powerBid .V"+this.variant+" .inpWrap").css({margin:"10px"}),$("#"+c.placeBidSectionId+c.txt_gamf_1+"_1").removeClass("ttl1_hb").addClass("ttl1"),$("#"+c.highBidTopSectionId).hide(),14!=this.variant&&
|
|
($("#"+c.placeBidSectionId+c.txt0).hide(),$("#"+c.seperatorId+c.txt0).hide(),$("#"+c.ebayBidSectionId+c.txt1).hide(),$("#"+c.ebayBidSectionId+c.txt2).show(),$("#"+c.ebayBidSectionId+c.txt1_btn).hide()),$("#"+c.ebayBidSectionId+c.txt2_btn).show(),this.showOrHideEle([c.preBidId+c.wrapper],!1),this.showOrHideEle([c.placeBidSectionId,c.seperatorId],!0)):e?(10==this.variant||13==this.variant||14==this.variant?($("#vi_oly_powerBid .V"+this.variant+" .placeBidSectionTr").find("td:first").removeClass("placebidsec_pdn_ob").addClass("placebidsec_pdn_hb"),
|
|
$("#vi_oly_powerBid .V"+this.variant+" .ebayBidSectionCnt").removeClass("ebaybidsec_pdn_ob").addClass("ebaybidsec_pdn_hb")):($("#vi_oly_powerBid .V"+this.variant+" .placeBidSectionTr").find("td:first").removeClass("placebidsec_pdn_ob_rev").addClass("placebidsec_pdn_hb_rev"),$("#vi_oly_powerBid .V"+this.variant+" .ebayBidSectionCnt").removeClass("ebaybidsec_pdn_ob_rev").addClass("ebaybidsec_pdn_hb_rev")),$("#"+c.placeBidSectionId+c.txt_gamf_1+"_1").removeClass("ttl1").addClass("ttl1_hb"),$(".hb_or").hide(),
|
|
$("#"+c.seperatorId).hide(),14==this.variant?($("#"+c.highBidTopSectionId).show(),this.showOrHideEle([c.seperatorId],!1),this.showOrHideEle([c.placeBidSectionId],!1)):($("#"+c.ebayBidSectionId+c.txt2).hide(),$("#"+c.ebayBidSectionId+c.txt2_btn).hide(),$("#"+c.highBidTopSectionId).show(),this.showOrHideEle([c.seperatorId],!1),this.showOrHideEle([c.placeBidSectionId],!1),$("#"+c.ebayBidSectionId+c.txt1).show(),$("#"+c.ebayBidSectionId+c.txt1_btn).show())):($("#"+c.highBidTopSectionId).hide(),this.showOrHideEle([c.seperatorId],
|
|
!0),this.showOrHideEle([c.placeBidSectionId],!0))},updateBidCount:function(a){var b=this.cfg;14==this.variant?1==a.BidCount?$("#"+b.bidCountId+b.value).html(b.bidCountDynTxt.replace("##2##",a.BidCount)):$("#"+b.bidCountId+b.value).html(b.bidsCountDynTxt.replace("##2##",a.BidCount)):(1==a.BidCount?$("#"+b.belowBidsTxtId).html(b.belowBidTxt):$("#"+b.belowBidsTxtId).html(b.belowBidsTxt),$("#"+this.cfg.bidCountId+b.value).html(a.BidCount))},defaultFields:function(a){var b;b=a.isAutoRefresh&&!a.TimeLeft?
|
|
this.bidUtil.timeLeftV({}):this.bidUtil.timeLeftV(a.TimeLeft);this.updateBidCount(a);this.updateTimeLeft(b);i.superclass.startCounter.apply(this,[b,a.AccessedDate,a.ViewerItemRelation]);this.callFromPage&&(this.updateScope(a),this.updateShipping());this.updateCurrBid(a.CurrentPrice,a.LocalCurrentPrice);this.updateSymbol(a)},updateScope:function(a){var b=this.cfg;a&&a.LocalCurrentPrice?(this.addRemoveClasses($("#"+b.layerWrapper),[],["ap"]),this.addRemoveClasses($("#"+b.layerWrapper+" .topWrap tr.approxTr"),
|
|
["dn"],[])):(this.addRemoveClasses($("#"+b.layerWrapper),["ap"],[]),this.addRemoveClasses($("#"+b.layerWrapper+" .topWrap tr.approxTr"),[],["dn"]));this.impCharge&&((impChTxt=$("#"+this.impCharge).css("display"))&&"none"!=impChTxt?(this.cfg.isGsp=!0,this.addRemoveClasses($("#"+b.layerWrapper),[],["ic"])):(this.cfg.isGsp=!1,this.addRemoveClasses($("#"+b.layerWrapper),["ic"],[])))},updateSymbol:function(a){var b=this.cfg;a&&(a.MinimumToBid&&a.MinimumToBid.CurrencySymbol)&&$("#"+b.ebayBidSectionId+"_symb").html(a.MinimumToBid.CurrencySymbol)},
|
|
updateImportCharge:function(a){var b=this.cfg,c=$("#"+this.impCharge).css("display");this.cfg.isGsp&&(a?(a=raptor.require("com.ebay.raptor.vi.shipping.CalculateImportCharge"),14==this.variant?new a({maxBidAmt:this.maxBidAmt,calcImportChargeUrl:b.calcImportChargeUrl,calculateOnLoad:!0}):($("#"+b.impChId+"_topPIC"+b.wrapper).hide(),c=$("#"+b.defaultImpChargeTxt).html(),$("#"+b.impChBidTxtId+b.value).hide(),$("#"+b.impChBidTxtId+b.value+"Err").hide(),this.util.displayContent(b.impChId,c,b.value,b.wrapper),
|
|
new a({impChIdLink:b.impChId+"Lnk",maxBidAmt:this.maxBidAmt,impChIdCnt:b.impChId+b.value,calcImportChargeUrl:b.calcImportChargeUrl,impChBidTxtId:b.impChBidTxtId+b.value}))):($("#"+b.impChId+b.wrapper).hide(),this.impCharge?((c=$("#"+this.impCharge+" #impchCost ").html())&&""!=c?14==this.variant?$("#"+b.impChId+"_topPIC"+b.value).html($("#"+b.aprroxTopICId).html().replace("##2##",c)):($("#"+b.impChId+"_topPIC"+b.value).html(c),$("#"+b.impChBidTxtId+"_topPIC"+b.value).show()):($("#"+b.impChId+"_topPIC"+
|
|
b.value).hide(),14!=this.variant&&$("#"+b.impChBidTxtId+"_topPIC"+b.value).hide(),$("#"+b.impChId+"_topPICErr").show()),$("#"+b.impChId+"_topPIC"+b.wrapper).show()):$("#"+b.impChId+"_topPIC"+b.wrapper).hide()))},isFreeShipping:function(){var a=this.cfg;return 0<$(".sh-CostBB").size()&&$(".sh-CostBB").html()==a.freeShipLabel?!0:!1},updateShipping:function(){var a=this.cfg,b=this.shipping;b?($("#"+a.layerWrapper).removeClass("sErr"),a.shippingId&&b&&($("#"+a.olyId+" .dummy").html(b),(b=$("#"+a.olyId+
|
|
" .dummy span:first-child").html())&&(14==this.variant?this.isFreeShipping()?$("#"+a.shippingId+a.value).html($("#"+a.freeShippingNewId).html()):$("#"+a.shippingId+a.value).html($("#"+a.shipAmtNewId).html().replace("##2##",b)):6==this.variant?this.isFreeShipping()?$("#"+a.shippingId+a.value).html(a.freeTxt):$("#"+a.shippingId+a.value).html(b):$("#"+a.shippingId+a.value).html(b)),(b=$("#"+a.olyId+" .dummy"))&&b.find("#convetedPriceId").html()?14==this.variant?$("#"+a.shippingId+a.approx).html(this.appendApproxTxt(b.find("#convetedPriceId").html())):
|
|
$("#"+a.shippingId+a.approx).html(b.find("#convetedPriceId").html()):14==this.variant&&$("#"+a.layerWrapper+" .shipApproxTop").hide(),$("#"+a.shippingId+a.wrapper).show())):(b=14==this.variant?$("#"+a.defaultShpTxtNew).html():$("#"+a.defaultShpTxt).html(),$("#"+a.shippingId+a.value).html(b),$("#"+a.layerWrapper).addClass("sErr"),14==this.variant?$("#"+a.layerWrapper+" .shipApproxTop").hide():$("#"+a.shippingId+"_acc_approx").hide())},updateTimeLeft:function(a,b){var c=this.cfg,d="";$("#"+c.timeLeftId+
|
|
c.value).removeClass(c.lessTimeCss);$("#"+c.timeLeftId+c.value).removeClass("medHotRedTime");$("#"+c.timeLeftId+c.value).removeClass("hotRedTime");a&&(formatCfg={dayTxt:c.dayTxt,dayCharTxt:c.dayCharTxt,hourTxt:c.hourTxt,hoursTxt:c.hoursTxt,hourCharTxt:c.hourCharTxt,minuteCharTxt:c.minuteCharTxt,secondCharTxt:c.secondCharTxt,cssElemId:c.timeLeftId+c.value,css:c.lessTimeCss},3>a.hour&&(formatCfg.css="medHotRedTime",1>a.hour&&(formatCfg.css="hotRedTime")),d=this.bidUtil.timeLeftFormat(a,formatCfg,!1,
|
|
c.enableAFAlways),14==this.variant&&(d=c.timeLeftDynTxt.replace("##2##",d)),b?this.util.displayContent(c.timeLeftId,d,c.value):this.util.displayContent(c.timeLeftId,d,c.value,c.wrapper),this.pubsub=raptor.require("pubsub"),c.isAccessibilityOffScreenTimerOn&&this.pubsub.publish("OFFSCREEN_BID",{timerId:"offscreenTimerLayer",isOffScreenOnBidLayer:1,insertionPoint:$(".bidWrap"),timeLeft:a,sourceOfTimer:$(".timeLeftVal")}))},updateMaximumBid:function(a,b){var c=this.cfg;bidderStatus=this.BidderStatus.valueOf(a.ViewerItemRelation);
|
|
if(b&&a&&a.MaximumBid){if(14==this.variant)$("#"+c.ebayBidSectionId+"_currMax"+c.value).html(a.MaximumBid.MoneyStandard);else{var d=a.MaximumBid.MoneyStandard,e=d.indexOf(a.MaximumBid.CleanAmount),d=d.substring(0,e);$("#"+c.ebayBidSectionId+"_currMax"+c.value).html(a.MaximumBid.MoneyStandard);$("#"+c.ebayBidSectionId+"_currMax"+c.value+"1").html(d);$("#"+c.ebayBidSectionId+"_currMax"+c.value+"2").html(a.MaximumBid.CleanAmount)}a.MaximumBidLocal&&(14==this.variant?$("#"+c.ebayBidSectionId+"_currMax"+
|
|
c.value+c.approx).html($("#"+c.approxAmtNewId).html().replace("##2##",a.MaximumBidLocal.MoneyStandard)):$("#"+c.ebayBidSectionId+"_currMax"+c.value+c.approx).html(a.MaximumBidLocal.MoneyStandard));$("#"+c.ebayBidSectionId+"_currMax").show()}else $("#"+c.ebayBidSectionId+"_currMax").hide()},updateMinToBid:function(a){this.BidderStatus.valueOf(a.ViewerItemRelation)===this.BidderStatus.HIGHBIDDER?$(".minToBid_14").show():$(".minToBid_14").hide()},updateMinToBidOld:function(a,b){var c=this.cfg,d="",e,
|
|
f=this.BidderStatus.valueOf(a.ViewerItemRelation),g=a.MaximumBid,h=a.MinimumToBid,f=f===this.BidderStatus.HIGHBIDDER;if(!a.IsAdminView){if(a.isAutoRefresh&&f&&g&&h&&this.amountUtils.parseCurrencyByCleanAmt(h.CleanAmount)>this.amountUtils.parseCurrencyByCleanAmt(g.CleanAmount))e=14==this.variant?c.minToBidHBDynTxtId:c.minBidHBTxt,d=h.MoneyStandard;else if(g||h)f&&g?(e=14==this.variant?c.minToBidHBDynTxtId:c.minBidHBTxt,d=g.MoneyStandard):h&&(e=14==this.variant?c.minToBidOBDynTxtId:c.minBidTxt,d=h.MoneyStandard);
|
|
d&&(b||12==this.variant||13==this.variant||14==this.variant)?(14==this.variant?$("#"+c.olyId+" .minToBid_14").html($("#"+e).html().replace("##2##",d)).show():$("#"+c.olyId+" .minimumToBid").html($("#"+e).html().replace(c.dummy,d)).show(),$("#"+c.olyId+" .minToBidWrap").show()):$("#"+c.olyId+" .minToBidWrap").hide()}},updateCurrBid:function(a,b,c){var d=this.cfg;a&&(this.util.displayContent(d.curBidId,a.MoneyStandard,d.value,d.wrapper),c&&$("#"+d.curBidId+d.lable).html(c));this.updateApprox(b,d.curBidId)},
|
|
updateApprox:function(a,b){var c=this.cfg,d;a&&(a.MoneyStandard&&b)&&(d=a.MoneyStandard,14==this.variant?$("#"+b+c.approx).html(this.appendApproxTxt(d)).show():$("#"+b+c.approx).html(d).show())},appendApproxTxt:function(a){var b=this.cfg;return a?$("#"+b.approxAmtNewId).html().replace("##2##",a):""},confirmBidMsg:function(a){var b=this.cfg,c=null,d=null,e=-1,f=this.BidderStatus.valueOf(a.ViewerItemRelation);if(f)if(6<=this.variant&&15>this.variant){if(f==this.BidderStatus.OUTBIDDER?(a.OutbidBySmartBid?
|
|
(a.OutbidByMatchingBid?(c=b.maxbid_OUTBIDDER_BY_MATCHING_BID_1,d=b.maxbid_OUTBIDDER_BY_MATCHING_BID_2):(c=b.maxbid_OUTBIDDER_BY_MAX_BID_1,d=b.maxbid_OUTBIDDER_BY_MAX_BID_2),a.isAutoRefresh||(this.smartOutbid=!0)):(c=b.maxbid_OUTBIDDER_BY_INC_BID_1,d=b.maxbid_OUTBIDDER_BY_INC_BID_2,a.isAutoRefresh||(this.smartOutbid=!1)),this.smartOutbid&&a.isAutoRefresh&&(a.OutbidByMatchingBid?(c=b.maxbid_OUTBIDDER_BY_MATCHING_BID_1,d=b.maxbid_OUTBIDDER_BY_MATCHING_BID_2):(c=b.maxbid_OUTBIDDER_BY_MAX_BID_1,d=b.maxbid_OUTBIDDER_BY_MAX_BID_2)),
|
|
e=0):f==this.BidderStatus.HIGHBIDDER&&(e=3,a.IsReserve&&!a.IsReserveMet?c=b.HIGHBIDDER_RESERVE_NOT_MET:a.IsFirstBid?c=b.maxbid_HIGHBIDDER_FIRST:a.IsOneMaxBidAway?c=b.HIGHBIDDER_1_MAX_BID_AWAY:this.lessThanHour(a.TimeLeft)?c=b.HIGHBIDDER_60_MIN_LEFT:6<=this.variant&&15>this.variant?a.HighBidderAgain?(c=b.maxbid_HIGHBIDDER_AGAIN_1,d=b.maxbid_HIGHBIDDER_AGAIN_2):c=b.maxbid_HIGHBIDDER_1:c=b.maxbid_HIGHBIDDER_1,this.smartOutbid=!1),c&&-1!==e?(this.updateStatusMsg(e),6<=this.variant&&15>this.variant&&a.HighBidderAgain&&
|
|
c==b.maxbid_HIGHBIDDER_AGAIN_1?this.displayMsg_maxbid(!0,$("#"+c).html(),null):this.displayMsg_maxbid(!0,$("#"+c).html(),$("#"+d).html())):this.displayMsg(!1),b.bidSmsEnabled&&(6==this.variant||9==this.variant||10==this.variant||11==this.variant||12==this.variant||13==this.variant||7==this.variant&&(f==this.BidderStatus.OUTBIDDER||f==this.BidderStatus.HIGHBIDDER)||8==this.variant&&f==this.BidderStatus.HIGHBIDDER)&&a.BidSmsLayer)a=$.parseJSON(a.BidSmsLayer),a.doNotShowSMSOptIn||($("#"+b.bidSmsId).show(),
|
|
$("#"+b.bidSmsCollapseId).show(),a.result&&a.result.mobileNumber&&1==a.result.itemEndingSubscription?(c=a.result.mobileNumber,$("#"+b.bidSmsNumId).html(c.substring(c.indexOf("-")+1,c.length)),$("#"+b.bidSmsImgMb).hide(),$("#"+b.bidSmsImgSc).show(),f==this.BidderStatus.HIGHBIDDER?($("#"+b.bidSmsExpId).hide(),$("#"+b.bidSmsRemExpId).hide(),$("#"+b.bidSmsSuccExpId).show()):f==this.BidderStatus.OUTBIDDER&&($("#"+b.bidSmsExpId).hide(),$("#"+b.bidSmsRemExpId).hide(),$("#"+b.bidSmsSuccExpId).hide())):(a.result&&
|
|
(a.result.mobileNumber&&0==a.result.itemEndingSubscription)&&(c=a.result.mobileNumber,0!=c.length&&(c=c.split("-"),4==c.length&&($("#"+b.bidSmsCty).html("+"+c[0]),$("#"+b.bidSmsCity).val(c[1]),$("#"+b.bidSmsPhone1).val(c[2]),$("#"+b.bidSmsPhone2).val(c[3])))),f==this.BidderStatus.HIGHBIDDER?($("#"+b.bidSmsSuccExpId).hide(),$("#"+b.bidSmsRemExpId).hide(),$("#"+b.bidSmsExpId).show()):f==this.BidderStatus.OUTBIDDER&&($("#"+b.bidSmsExpId).hide(),$("#"+b.bidSmsRemExpId).hide(),$("#"+b.bidSmsSuccExpId).hide()))),
|
|
a.delayTimeInMinutes&&$("#"+b.bidSmsElapTime).html(a.delayTimeInMinutes),a.countryISDCode&&$("#"+b.bidSmsCty).html("+"+a.countryISDCode)}else f==this.BidderStatus.OUTBIDDER?(a.OutbidBySmartBid?(c=b.OUTBIDDER_BY_SMART_BID,a.isAutoRefresh||(this.smartOutbid=!0)):(c=b.OUTBIDDER,a.isAutoRefresh||(this.smartOutbid=!1)),this.smartOutbid&&a.isAutoRefresh&&(c=b.OUTBIDDER_BY_SMART_BID),e=0):f==this.BidderStatus.HIGHBIDDER&&(e=3,c=a.IsReserve&&!a.IsReserveMet?b.HIGHBIDDER_RESERVE_NOT_MET:a.IsFirstBid?b.HIGHBIDDER_FIRST:
|
|
a.IsOneMaxBidAway?b.HIGHBIDDER_1_MAX_BID_AWAY:this.lessThanHour(a.TimeLeft)?b.HIGHBIDDER_60_MIN_LEFT:b.HIGHBIDDER,this.smartOutbid=!1),c&&-1!==e?5==this.variant?(this.util.updateStatusMsg(e,this.statusMsg),this.util.displayContent(b.statusMsgId,$("#"+c).html(),b.value,b.wrapper)):(this.updateStatusMsg(e),this.displayMsg(!0,$("#"+c).html())):this.displayMsg(!1)},isRedirectErrors:function(a,b){return a===this.BidError.REDIRECT?(top.location.href=b,!0):a===this.BidError.REFRESH||a===this.BidError.AUCTION_ENDED?
|
|
(i.superclass.closeLayer.apply(this),!0):!1},updateBidAmtError:function(a,b){var c=this.cfg,d,e=-1;a===this.BidError.DECSEP?(d=c.DECSEP,e=0):a===this.BidError.INVALID_BIDAMOUNT?(d=c.INVALID_BIDAMOUNT,e=0):a===this.BidError.OFFER_AMOUNT_ZERO?(d=c.MIN_BID_ERROR_STATUS,e=0):a===this.BidError.LOW_BIDAMOUNT?(d=6<=this.variant&&15>this.variant?c.maxbid_LOW_BIDAMOUNT:c.LOW_BIDAMOUNT,e=0):a===this.BidError.INVALID_BIDAMOUNT_OF_HIGH_BIDDER?(d=c.INVALID_BIDAMOUNT_OF_HIGH_BIDDER,e=0):a===this.BidError.BUYER_BLOCKED_NO_LINKED_PAYPAL_ACCOUNT?
|
|
(d=c.BUYER_BLOCKED_NO_LINKED_PAYPAL_ACCOUNT,e=1):a===this.BidError.BID_GREATER_THAN_BIN&&(d=c.BID_GREATER_THAN_BIN,e=1);d&&-1!==e&&(6<=this.variant&&15>this.variant?(this.updateStatusMsg(e),d==c.maxbid_LOW_BIDAMOUNT?this.displayMsg_maxbid(!0,$("#"+d).html()+b.MinimumToBid.MoneyStandard,null):this.displayMsg_maxbid(!0,$("#"+d).html(),null)):(this.updateStatusMsg(e),this.displayMsg(!0,$("#"+d).html())))},throbber:function(a){var b=this.cfg;this.util.showHide([b.loadingId,b.resumeBidId],a);a&&$("#"+
|
|
b.resumeBidId+"_ttl").focus()},hideAll:function(a){var b=this.cfg,b=[b.loadingId,b.resumeBidId,b.statusMsgId+b.wrapper,b.disclaimerId,b.disclaimerGspId,b.bidSectionId+b.wrapper,b.reviewSectionId+b.wrapper];this.updateHideArray(a,b);this.util.showHide(b,!1)},updateHideArray:function(a,b){var c=this.cfg;a?b.push(c.topPanelId):14==this.variant&&(b.push(c.topHelpTxtId+"_cnt"),$("#"+c.topHelpTxtId).data("exp","0"))},lessThanHour:function(a){if((a=this.bidUtil.timeLeftV(a))&&!(0<a.day||1<a.hour))if(!(1===
|
|
a.hour&&(1<a.minute||1<a.second)))return!0;return!1},showOrHideEle:function(a,b){$.each(a,function(){b?$("#"+this).show():$("#"+this).hide()})},displayMsg:function(a,b){var c=this.cfg;a?($("#"+c.olyId+" .sMsgWrap p").html(b),$("#"+c.olyId+" .sMsgWrap").show()):$("#"+c.olyId+" .sMsgWrap").hide()},displayMsg_maxbid:function(a,b,c){var d=this.cfg;a?($("#"+d.olyId+" .sMsgWrap p.first").html(b),$("#"+d.olyId+" .sMsgWrap p.second").html(c),$("#"+d.olyId+" .sMsgWrap").show()):$("#"+d.olyId+" .sMsgWrap").hide()},
|
|
updateStatusMsg:function(a){var b=this.cfg;if(-1!==a){var c=$("#"+b.olyId+" .sMsgWrap p"),d=$("#"+b.olyId+" .sMsgWrap i");1==this.variant&&$("#"+b.olyId+" .sMsgWrap div:first-child");switch(a){case 0:this.addRemoveClasses(c,["mi-su","mi-in","mi-al"],["mi-er"]);this.addRemoveClasses(d,["icmsu","icmin","icmal"],["icmer"]);break;case 1:this.addRemoveClasses(c,["mi-su","mi-er","mi-al"],["mi-in"]);this.addRemoveClasses(d,["icmsu","icmer","icmal"],["icmin"]);break;case 2:this.addRemoveClasses(c,["mi-su",
|
|
"mi-er","mi-in"],["mi-al"]);this.addRemoveClasses(d,["icmsu","icmer","icmin"],["icmal"]);break;case 3:this.addRemoveClasses(c,["mi-al","mi-er","mi-in"],["mi-su"]),this.addRemoveClasses(d,["icmal","icmer","icmin"],["icmsu"])}}},addRemoveClasses:function(a,b,c){for(var d=0;d<b.length;d++)a.removeClass(b[d]);for(d=0;d<c.length;d++)a.addClass(c[d])},getBidValue:function(a){var b=this.cfg,c;if(1==a){if(2==this.variant||6<=this.variant&&11>=this.variant)c=$("#"+b.placeBidSectionId+b.value).val(),c=this.amountUtils.sanitizeAmt(c)}else 2==
|
|
a?c=$("#"+b.ebayBidSectionId+b.value).val():3==a&&(c=$("#"+b.reviewSectionId+b.value+"_hdn").val(),c=this.amountUtils.sanitizeAmt(c));return c},getBidValue_gamfc:function(a,b){var c=this.cfg,d;1==a?(d=$("#"+b+c.value).val(),d=this.amountUtils.sanitizeAmt(d)):2==a?d=$("#"+c.ebayBidSectionId+c.value).val():3==a&&(d=$("#"+c.reviewSectionId+c.value+"_hdn").val(),d=this.amountUtils.sanitizeAmt(d));return d},attachEvt:function(a,b,c,d){var e=this,f=e.cfg,g=d?"keypress":"click",h=function(g){var h=!1;if(d){if(13==
|
|
(g.keyCode?g.keyCode:g.which))h=!0}else h=!0;if(h){if(f.showReviewScreen&&e.status==e.BidStatus.valueOf("CONFIRMBID"))if((10==e.variant||11==e.variant)&&1==b)c=f.quickBidAgainUrl;else if((12!=e.variant||13!=e.variant)&&12!=e.variant&&13!=e.variant)c=f.bidAgainUrl;12==e.variant||13==e.variant||14==e.variant?e.triggerCall(c,e.getBidValue_gamfc(b,a),!0,null):e.triggerCall(c,e.getBidValue(b),!0,null);return!1}};$(".pow").off(g+e.evtNS,"#"+a,h);$(".pow").on(g+e.evtNS,"#"+a,h)},focusHdlr:function(){$("#"+
|
|
this.cfg.olyId+" .inpWrap").addClass("inpFocus")},blurHdlr:function(){$("#"+this.cfg.olyId+" .inpWrap").removeClass("inpFocus")},attachTextBoxEvts:function(){var a=this,b=a.cfg,c=function(){a.focusHdlr()},d=function(){a.blurHdlr()},e=function(){a.focusHdlr();$("#"+b.olyId+" .inpWrapSection .inpWrap input").focus();return!1};14==a.variant&&($(".pow").off("click"+a.evtNS,".inpWrapSection .inpWrap",e),$(".pow").on("click"+a.evtNS,".inpWrapSection .inpWrap",e));$(".pow").off("focus"+a.evtNS,".inpWrap .inpVal",
|
|
c);$(".pow").on("focus"+a.evtNS,".inpWrap .inpVal",c);$(".pow").off("blur"+a.evtNS,".inpWrap .inpVal",d);$(".pow").on("blur"+a.evtNS,".inpWrap .inpVal",d);$(".pow").on("click"+a.evtNS,".inpWrap .symb",function(){$("#"+b.olyId+" .inpWrap .inpVal").focus()})},attachBubbleEvts:function(){var a=this,b=a.cfg,c=function(){2==a.variant&&($("#"+b.rgtBubbleId).show(),$("#"+b.rgtBubbleId+" .closeBut").focus())},d=function(){2==a.variant&&$("#"+b.rgtBubbleId).hide()},e=function(c){var d=c.keyCode?c.keyCode:
|
|
c.which;c.target&&(13==d?2==a.variant&&"closeBut"==c.target.className&&($("#"+b.rgtBubbleId).hide(),$(".pow #powHlp").focus(),c.preventDefault()):9==d?"closeBut"==c.target.className&&($(".pow .smartBidIns a").focus(),c.preventDefault()):27==d&&($("#"+b.rgtBubbleId).hide(),$(".pow #powHlp").focus(),c.stopPropagation()))};$(".pow").off("click"+a.evtNS,".sh-bubble #powHlp",c);$(".pow").on("click"+a.evtNS,".sh-bubble #powHlp",c);$(".pow").off("click"+a.evtNS,".sh-bubble .hlpOly .closeBut",d);$(".pow").on("click"+
|
|
a.evtNS,".sh-bubble .hlpOly .closeBut",d);$(".pow").off("keydown"+a.evtNS," #vi_oly_powHelpRightOly",e);$(".pow").on("keydown"+a.evtNS," #vi_oly_powHelpRightOly",e)},layerCleanUp:function(a,b){$(".pow").off(this.evtNS);this.util&&this.olyCloseHandle&&(this.olyCloseHandle.unsubscribe(),this.olyCloseHandle=null);if(a&&b){var c=this.removeMaxBidParamPowerbid(b);setTimeout(function(){top.location.href=c},1)}},removeMaxBidParamPowerbid:function(a){return i.superclass.removeMaxBidParam.apply(this,arguments)},
|
|
attachCloseButtonEvents:function(){var a=this,b=function(){a.pubsub.publish("_CLOSE_OLAY",{cmpId:"powerBid"})};$(".pow").off("click"+a.evtNS,".powClz",b);$(".pow").on("click"+a.evtNS,".powClz",b);b=function(b){13==b.keyCode&&(a.pubsub.publish("_CLOSE_OLAY",{cmpId:"powerBid"}),b.preventDefault())};$(".pow").off("keydown"+a.evtNS,".powClz",b);$(".pow").on("keydown"+a.evtNS,".powClz",b)},subscribeEvents:function(){var a=this.cfg;this.pubsub.subscribe("IMP_CHARGE_RESPONSE",function(b){b&&b.impChCost?
|
|
$("#"+a.impChId+a.value).html($("#"+a.aprroxTopICId).html().replace("##2##",b.impChCost)):($("#"+a.impChId+a.value).hide(),$("#"+a.impChBidTxtId+a.value+"Err").show())})},attachPowerBidEvts:function(){var a=this.cfg;12==this.variant||13==this.variant||14==this.variant?(this.attachEvt(a.placeBidSectionId+a.btn+"_1",1,a.oneXConfirmUrl),this.attachEvt(a.placeBidSectionId+a.btn+"_2",1,a.twoXConfirmUrl),this.attachEvt(a.placeBidSectionId+a.btn+"_3",1,a.fiveXConfirmUrl)):this.attachEvt(a.placeBidSectionId+
|
|
a.btn,1,a.powerBidConfirmURL);2!=this.variant&&14!=this.variant?(this.attachEvt(a.ebayBidSectionId+a.btn+"_tx1",2,a.maxbidUrl),this.attachEvt(a.ebayBidSectionId+a.btn+"_tx2",2,a.maxbidUrl)):this.attachEvt(a.ebayBidSectionId+a.btn,2,a.maxbidUrl);this.attachEvt(a.ebayBidSectionId+a.value,2,a.maxbidUrl,!0);this.attachEvt(a.reviewSectionId+a.btn,3,a.reviewConfirmUrl);this.attachTextBoxEvts();this.attachBubbleEvts();this.olyCloseHandle||i.superclass.subscribeOlyClose.apply(this);14==this.variant&&(this.subscribeEvents(),
|
|
this.attachHelpTxtEvts())},collapseCnt:function(a){a&&1==$("#"+a).data("exp")&&($("#"+a+"_cnt").slideUp("fast"),$("#"+a).data("exp","0"),$("#"+a).attr("aria-expanded","false"))},expandCnt:function(a){a&&0==$("#"+a).data("exp")&&($("#"+a+"_cnt").slideDown("fast"),$("#"+a).data("exp","1"),$("#"+a).attr("aria-expanded","true"));this.trending_tracked&&!this.trending_tracked_outbid?$(document).trigger("rover",{sid:"p2047675.l9053"}):this.trending_tracked_outbid=!1},attachHelpTxtEvts:function(){var a=this,
|
|
b=a.cfg,c=function(){var c=$(this)[0].id;c&&(c==b.seeMoreHelpId&&($("#"+b.seeMoreHelpId).data("exp","0"),$("#"+b.seeMoreHelpId).hide()),1==$("#"+c).data("exp")?a.collapseCnt(c):a.expandCnt(c));return!1};$(".pow").off("click"+a.evtNS,"#"+b.topHelpTxtId,c);$(".pow").on("click"+a.evtNS,"#"+b.topHelpTxtId,c);$(".pow").off("click"+a.evtNS,"#"+b.seeMoreHelpId,c);$(".pow").on("click"+a.evtNS,"#"+b.seeMoreHelpId,c)},updateCurrBidColor:function(a,b){var c=this.cfg,d=this.BidderStatus.valueOf(a.ViewerItemRelation);
|
|
a&&b&&(d&&d===this.BidderStatus.HIGHBIDDER?($("#"+c.curBidId+c.value).removeClass("errCol"),$("#"+c.curBidId+c.value).addClass("sucCol")):d&&d===this.BidderStatus.OUTBIDDER?($("#"+c.curBidId+c.value).removeClass("sucCol"),$("#"+c.curBidId+c.value).addClass("errCol")):($("#"+c.curBidId+c.value).removeClass("sucCol"),$("#"+c.curBidId+c.value).removeClass("errCol")))},valiadteInput:function(a){if(!a||!1==this.hasNumbers(a))return this.invalidBidAmountErr=this.BidError.valueOf("INVALID_BIDAMOUNT"),this.updateBidAmtError(this.invalidBidAmountErr),
|
|
this.userAction=!1,!0;this.invalidBidAmountErr=null;return!1},hasNumbers:function(a){return a?/\d/g.test(a):!1}};return i});raptor.defineClass("com.ebay.raptor.vi.bid.powerbid.inlineSurvey.inlineSurvey",{},function(){var e=function(a){this.cfg=a;this.initValues();this.subscribeEvents();this.attachSurveyEvents(".inlineFeedback")};e.prototype={initValues:function(){this.pubsub=raptor.require("pubsub");this.submitClicked=this.surveySubmitted=!1},subscribeEvents:function(){var a=this,b=a.cfg;a.pubsub.channel(b.linkId+"Oly").subscribe("_OLY_CLS_SVC",function(){a.submitClicked?($("#"+b.inlineFeedbackId+"_result").show(),$("#"+
|
|
b.inlineFeedbackId+"_result").focus()):$("#"+b.linkId).focus();a.submitClicked=!1},a)},attachSurveyEvents:function(a){var b=this,c=b.cfg;$("#"+c.inlineFeedbackId+"_submit").bind("click"+a,function(){var a=c.inlineFeedbackId+"_frm",d=b.getFmDoc(a);d&&(d.open(),d.write('<html><head></head><body><form id="surveySubmitForm" action="'+c.surveyUrl+'" method="post"><input type="hidden" name="rate" id="rateHidden" value=""/><input type="hidden" name="guid" id="guidHidden" value=""/><input type="hidden" name="userComments" id="userCommentsHidden" value=""/><input type="hidden" name="surveyName" id="surveyNameHidden" value=""/><input type="hidden" name="surveyDate" id="surveyDateHidden" value=""/><input type="hidden" name="treatments" id="treatmentsHidden" value=""/><input type="hidden" name="dom" id="domHidden" value=""/><input type="hidden" name="page_url" id="pageUrlHidden" value=""/></form></body></html>'),
|
|
d.close());b.submitClicked=!0;b.pubsub.publish("_CLOSE_OLAY",{cmpId:c.linkId+"Oly"});b.submitForm(a);$("#powerBidSurvey").hide()});var d=c.defaultTxt;$("#"+c.inlineFeedbackId+"_comments").focus(function(){$(this).val()==d&&$(this).val("")}).blur(function(){""==$(this).val()&&$(this).val(d)});$("#"+c.inlineFeedbackId+"_cancel").bind("click",function(){b.pubsub.publish("_CLOSE_OLAY",{cmpId:c.linkId+"Oly"});$("#"+c.inlineFeedbackId+"_comments").val(d)})},encodePageDom:function(){var a=document.getElementsByTagName("html")[0].innerHTML;
|
|
return a=encodeURIComponent("<html>"+a+"</html>")},submitForm:function(a){var b=this.cfg,c=b.surveyName;try{iDoc=this.getFmDoc(a),iDoc.getElementById("surveyNameHidden").value=c}catch(d){return}var a=raptor.require("ebay.cookies"),e=this.convertDateToUTC(new Date);iDoc.getElementById("rateHidden").value=$("input[name="+b.inlineFeedbackId+"_radio]:checked").val();iDoc.getElementById("guidHidden").value=a.readCookie("npii","tguid");iDoc.getElementById("surveyDateHidden").value=e;iDoc.getElementById("surveyNameHidden").value=
|
|
c;iDoc.getElementById("domHidden").value=this.encodePageDom();iDoc.getElementById("pageUrlHidden").value=encodeURIComponent(location.href);b.treatments&&(iDoc.getElementById("treatmentsHidden").value=b.treatments);c=encodeURIComponent($("#"+b.inlineFeedbackId+"_comments").val());c==encodeURIComponent(b.defaultTxt)&&(c="");iDoc.getElementById("userCommentsHidden").value=c;iDoc.getElementById("surveySubmitForm").submit()},convertDateToUTC:function(a){return a.getUTCFullYear()+"-"+a.getUTCMonth()+"-"+
|
|
a.getUTCDate()+"-"+a.getUTCHours()+"-"+a.getUTCMinutes()+"-"+a.getUTCSeconds()},getFmDoc:function(a){var b=$("#"+a)[0],c;b.contentDocument?c=b.contentDocument:b.contentWindow?c=b.contentWindow.document:window.frames[a]&&(c=window.frames[a].document);return c},encodePageDom:function(){var a=document.getElementsByTagName("html")[0].innerHTML;return a=encodeURIComponent("<html>"+a+"</html>")}};return e});raptor.defineClass("com.ebay.raptor.vi.PicturePanel.PicturePanelIcons",function(){return{init:function(a){this.pubsub=raptor.require("pubsub");this.registerPubSubEvents(a)},registerPubSubEvents:function(a){this.pubsub.subscribe("UPDATE_PICTURE_RIBBON",function(b){this.makePictureIconsUpdateCall(a,b,!1)},this);this.pubsub.subscribe("RESET_PICTURE_RIBBON",function(){this.makePictureIconsUpdateCall(a,{almostGone:a.defaultCaseHasAlmostGone,lastOne:a.defaultCaseHasLastOne,endingSoon:a.defaultCaseHasEndingSoon,
|
|
topSelling:a.defaultCaseHasTopSelling,percentOff:a.defaultCaseHasPercentOff,freeShipping:a.defaultCaseHasFreeShipping,bopis:a.defaultCaseHasBOPIS,ebntimer:a.defaultCaseHasEBN},!0)},this)},makePictureIconsUpdateCall:function(a,b,c){b.almostGone||b.lastOne||b.endingSoon||b.topSelling||b.percentOff||b.mskuPercentOff||b.freeShipping||b.bopis||b.ebntimer?(b.almostGone&&($(a.ribbonContentSelector).html(a.almostGoneTxt),$(a.ribbonContentSelector).parent().attr("title",a.almostGoneTxt)),b.lastOne&&($(a.ribbonContentSelector).html(a.lastOneTxt),
|
|
$(a.ribbonContentSelector).parent().attr("title",a.lastOneTxt)),b.endingSoon&&($(a.ribbonContentSelector).html(a.endingSoonTxt),$(a.ribbonContentSelector).parent().attr("title",a.endingSoonTxt)),b.topSelling&&($(a.ribbonContentSelector).html(a.topSellingTxt),$(a.ribbonContentSelector).parent().attr("title",a.topSellingTxt)),b.percentOff&&($(a.ribbonContentSelector).html(a.percentOffTxt),$(a.ribbonContentSelector).parent().attr("title",a.percentOffTxt)),b.mskuPercentOff&&($(a.ribbonContentSelector).html(b.mskuPercentOff),
|
|
$(a.ribbonContentSelector).parent().attr("title",b.mskuPercentOff)),b.freeShipping&&($(a.ribbonContentSelector).html(a.freeShippingTxt),$(a.ribbonContentSelector).parent().attr("title",a.freeShippingTxt)),b.almostGone||b.lastOne||b.endingSoon||b.topSelling?$(a.ribbonContentSelector).parent().addClass(a.lastOneClass):a.lastOneClass&&$(a.ribbonContentSelector).parent().removeClass(a.lastOneClass),!b.bopis&&!b.ebntimer?($(a.pictureIconSel).removeClass(a.bopisClass),$(a.pictureIconSel).removeClass(a.ebnTimerClass),
|
|
$(a.ebnContentSelector).addClass("u-dspn")):($(a.pictureIconSel).addClass(a.bopisClass),$(a.ebnContentSelector).addClass("u-dspn"),b.ebntimer&&($(a.pictureIconSel).addClass(a.ebnTimerClass),$(a.ebnContentSelector).removeClass("u-dspn"))),$(a.ribbonContainerSel).show(),$(a.ribbonContentSelector).parent().show()):c?($(a.ribbonContainerSel).hide(),$(a.ribbonContentSelector).parent().hide()):this.makePictureIconsUpdateCall(a,{almostGone:a.defaultCaseHasAlmostGone,lastOne:a.defaultCaseHasLastOne,endingSoon:a.defaultCaseHasEndingSoon,
|
|
topSelling:a.defaultCaseHasTopSelling,percentOff:a.defaultCaseHasPercentOff,freeShipping:a.defaultCaseHasFreeShipping,bopis:a.defaultCaseHasBOPIS,ebntimer:a.defaultCaseHasEBN},!0)}}});raptor.defineClass("raptor.merch.MerchManager",function(){return{init:function(a){var b=this;b.m=a;b.url=a.url;b.pubsub=raptor.require("pubsub");b.pubsub.subscribe("MERCH_RE_TRIGGER",function(a){b.trigger(a)},this);b.profiler=raptor.require("ebay.profiler.Profiler");b.sbfFlagValue=raptor.require("ebay.cookies").getBitFlag(raptor.require("ebay.cookies").readCookie("ebay","sbf"),20);b.customCallbackHandler?b.pubsub.subscribe("MERCH_INIT",function(){b.sendUrl()},this):b.m.enableOnScroll?(b.scrollHandler=
|
|
function(){b.callMerchOnScroll()},$(window).bind("scroll",b.scrollHandler)):$(document).ready(function(){window.setTimeout(function(){b.sendUrl()},0)})},trigger:function(a){this.m=a;this.url=a.url;this.sendUrl()},callMerchOnScroll:function(){var a=this.m.pids,b=this.m.th,c=$(window).scrollTop(),a=$("#merch_html_"+a[0]);if(!("undefined"==typeof a||null==a))if(a=a.offset(),!("undefined"==typeof a||null==a)){var a=a.top,d=$(window).height();a<=c+d+b&&this.sendUrl()}},sendUrl:function(){var a=this.url,
|
|
b=encodeURIComponent(window.location.href);this.startTime=(new Date).getTime();b=b.replace(/'/g,"%27");if(a+="&srcUrl="+b)this.getJson(a),this.m.enableOnScroll&&$(window).unbind("scroll",this.scrollHandler)},getJson:function(a){var b=this;window.merchCallBack=function(a){b.render(a)};b.m.loadJsAsync?b.loadJSAsync(a+"&callback=parent.window.merchCallBack"):$.getJSON(a+"&callback=?",function(a){b.render(a)},b)},render:function(a){var b=this.m.merchRaptorEnabled?a:a.data.map;if(this.customCallbackHandler)this.pubsub.publish("MERCH_RESPONSE",
|
|
{data:a});else for(var c in b)if(a=b[c]){var d=document.getElementById("merch_html_"+c);d&&("undefined"!=typeof a.html&&""!=a.html)&&(this.loadCss(a.cssUrl),d.style.display="none",d.innerHTML=a.html,d.style.display="block",this.loadJs(a.jsUrl),this.executeScripts(a.html))}this.setSBFFlag();a=(new Date).getTime()-this.startTime;"undefined"!=typeof oGaugeInfo&&this.profiler.addParam("i_5i",a)},executeScripts:function(a){for(var b,c=/<script\b[\s\S]*?>([\s\S]*?)<\/script>/ig;b=c.exec(a);)if(b=b[1]){var d=
|
|
this.getHead(),e=this.createScript();e.type="text/javascript";e.text=b;d.appendChild(e)}},setSBFFlag:function(){if(this.sbfFlagValue){var a=raptor.require("ebay.cookies").setBitFlag(raptor.require("ebay.cookies").readCookie("ebay","sbf"),20,this.sbfFlagValue);raptor.require("ebay.cookies").writeCookielet("ebay","sbf",a)}},getHead:function(){return document.getElementsByTagName("head")[0]},createScript:function(){return document.createElement("script")},loadJSAsync:function(a){var b=document.createElement("iframe");
|
|
(b.frameElement||b).style.cssText="width: 0; height: 0; border: 0";(b.frameElement||b).src="javascript:false";var c=document.getElementsByTagName("script"),c=c[c.length-1];c.parentNode.insertBefore(b,c);b=b.contentWindow.document;b.open().write("<body onload=\"var js = document.createElement('script');js.src = '"+a+"';document.body.appendChild(js);\">");b.close()},loadCss:function(a){if(!("undefined"===typeof a||!a||0===a.length))for(var b=0;b<a.length;b++)$("head").append($("<link/>").attr({type:"text/css",
|
|
rel:"stylesheet",href:a[b]}))},loadJs:function(a){if(!("undefined"===typeof a||!a||0===a.length))for(var b=0;b<a.length;b++)$.ajax({type:"GET",url:a[b],success:function(){},dataType:"script",cache:!0})}}});(function(){var c=raptor.require("raptor.rtm.RtmManager",!1,null,!0);c&&(c.loadJSViaNonBlockingAndAsync=function(c){var d,b,a=document.createElement("iframe");a.src="javascript:false";a.title="";a.role="presentation";(a.frameElement||a).style.cssText="width: 0; height: 0; border: 0";$("body").append(a);try{b=a.contentWindow.document}catch(e){d=document.domain,a.src="javascript:var d=document.open();d.domain='"+d+"';void(0);",b=a.contentWindow.document}b.open()._l=function(){var a=this.createElement("script");
|
|
d&&(this.domain=d);a.id="js-iframe-async";a.src=c;this.body.appendChild(a)};b.write('<body onload="document._l();">');b.close()})})();define("raptor/domProxy",["raptor"],function(h,i){var c=function(a){if("string"===typeof a){var b=a,a=document.getElementById(b);if(!a)throw h.createError(Error('Target element not found: "'+b+'"'));}return a},d=function(a){var b=i.find("raptor/pubsub");b&&b.publish("dom/beforeRemove",{el:a})},e={forEachChildEl:function(a,b,c){e.forEachChild(a,b,c,1)},forEachChild:function(a,b,c,g){if(a)for(var d=0,a=a.childNodes,e=a.length;d<e;d++){var f=a[d];f&&(null===g||g===f.nodeType)&&b.call(c,f)}},detach:function(a){a=
|
|
c(a);a.parentNode.removeChild(a)},appendTo:function(a,b){c(b).appendChild(c(a))},remove:function(a){a=c(a);d(a);a.parentNode&&a.parentNode.removeChild(a)},removeChildren:function(a){a=c(a);e.forEachChildEl(a,function(a){d(a)});a.innerHTML=""},replace:function(a,b){b=c(b);d(b);b.parentNode.replaceChild(c(a),b)},replaceChildrenOf:function(a,b){b=c(b);e.forEachChildEl(b,function(a){d(a)});b.innerHTML="";b.appendChild(c(a))},insertBefore:function(a,b){b=c(b);b.parentNode.insertBefore(c(a),b)},insertAfter:function(a,
|
|
b){var b=c(b),a=c(a),d=b.nextSibling,e=b.parentNode;d?e.insertBefore(a,d):e.appendChild(a)},prependTo:function(a,b){b=c(b);b.insertBefore(c(a),b.firstChild||null)}};return e});define("raptor/renderer/RenderResultProxy",function(e){var d=e("raptor/domProxy"),f=function(a,c){this.html=a;this.context=c;this._node=null};f.prototype={getWidget:function(){if(!this.widgetDefs)throw Error("Cannot call getWidget() until after HTML fragment is added to DOM.");return this.widgetDefs.length?this.widgetDefs[0].widget:void 0},getWidgets:function(a){if(!this.widgetDefs)throw Error("Cannot call getWidgets() until after HTML fragment is added to DOM.");var c,b;if(a){c=[];for(b=0;b<this.widgetDefs.length;b++){var d=
|
|
this.widgetDefs[b].widget;a(d)&&c.push(d)}}else{c=Array(this.widgetDefs.length);for(b=0;b<this.widgetDefs.length;b++)c[b]=this.widgetDefs[b].widget}return c},_afterInsert:function(){var a=e.find("raptor/widgets");a&&(this.widgetDefs=a.getWidgetsContext(this.context).widgets);(a=e.find("raptor/pubsub"))&&a.publish("raptor/renderer/renderedToDOM",{node:this.getNode(),context:this.context});return this},appendTo:function(a){d.appendTo(this.getNode(),a);return this._afterInsert()},replace:function(a){d.replace(this.getNode(),
|
|
a);return this._afterInsert()},replaceChildrenOf:function(a){d.replaceChildrenOf(this.getNode(),a);return this._afterInsert()},insertBefore:function(a){d.insertBefore(this.getNode(),a);return this._afterInsert()},insertAfter:function(a){d.insertAfter(this.getNode(),a);return this._afterInsert()},prependTo:function(a){d.prependTo(this.getNode(),a);return this._afterInsert()},getNode:function(){var a=this._node,c,b;if(!a){b=document.createElement("body");b.innerHTML=this.html;if(1===b.childNodes.length)a=
|
|
b.childNodes[0];else for(a=document.createDocumentFragment();c=b.firstChild;)a.appendChild(c);this._node=a}return a}};return f});define("raptor/renderer",["raptor"],function(d,f){var h=f("raptor/render-context"),i=f("raptor/renderer/RenderResultProxy");return{render:function(a,f,b){if("string"===typeof a){var c=d.find(a);if(!c&&(a.endsWith("Renderer")||(c=a.lastIndexOf("/"),c=d.find(a+"/"+a.substring(c+1)+"Renderer")),!c))throw d.createError(Error('Renderer not found with name "'+a+'"'));a=c}var g=a.render||a.process||a;if("function"!==typeof g)throw d.createError(Error('Not a valid renderer: "'+a+'". Renderer must be an object with "render" or "process" function or renderer must be a function.'));
|
|
var e,c=function(){e=g.call(a,f||{},b)};b?e=b.captureString(c)||e:(b=h.createContext(),c(),e||(e=b.getOutput()));return new i(e,b)},renderTemplate:function(a,d,b){return this.render(function(c,b){f("raptor/templating").render(a,d,b)},{},b)}}});define.extend("raptor/widgets",function(h,n){var r=h("raptor/logging").logger("raptor/widgets"),l={},s=h("raptor"),o=Array.isArray,t=s.createError,p=h("raptor/widgets/Widget"),x=function(a){var b={};s.forEach(a,function(a){b[a[0]]={target:a[1],props:a[2]}},this);return b},u=function(){};u.prototype={_remove:function(a,b){var d=this[b];o(d)?this[b]=d.filter(function(b){return b!==a}):delete this[b]},_add:function(a,b,d){var g=this[b];g?o(g)?g.push(a):this[b]=[g,a]:this[b]=d?[a]:a},getWidget:function(a){return this[a]},
|
|
getWidgets:function(a){return(a=this[a])?o(a)?a:[a]:[]}};var w=function(a,b,d,g,i,q,f,m){if(!h.exists(a))throw t(Error('Unable to initialize widget of type "'+a+'". The class for the widget was not found.'));var c,e=h(a);r.debug('Creating widget of type "'+a+'" ('+b+")");if(e.initWidget)g.elId=b,g.events=q,c=e,e.onReady||(e.onReady=n.onReady);else{var j=function(){},k;j.prototype=k=e.prototype;c=new j;p.makeWidget(c,k);c.registerMessages(["beforeDestroy","destroy"],!1);(j=k.events||e.events)&&c.registerMessages(j,
|
|
!1);b&&(c._id=b,c.el=c.getEl());e.getName||(e.getName=function(){return a});k.constructor=e;p.legacy&&(c._parentWidget=f);q&&(c._events=x(q));c.widgets=new u;l[b]=c;if(d&&i){var v;d.endsWith("[]")&&(d=d.slice(0,-2),v=!0);c._assignedId=d;c._scope=i;b=l[i];if(!b)throw t(Error("Parent scope not found: "+i));b.widgets._add(c,d,v);p.legacy&&(b[d]=c)}}return{widget:c,init:function(){var b=function(){try{c.initWidget?c.initWidget(g):e.call(c,g)}catch(b){var d='Unable to initialize widget of type "'+a+"'. Exception: "+
|
|
b;if(m)r.error(d,b);else throw b;}};if(!0===c.initBeforeOnDomReady)b();else c.onReady(b)}}};h("raptor/pubsub").subscribe({"dom/beforeRemove":function(a){(a=n.get(a.el.id))&&a.destroy({removeNode:!1,recursive:!0})},"raptor/renderer/renderedToDOM":function(a){n.getWidgetsContext(a.context).initWidgets()}});return{initWidget:function(a){var b=w(a.type,a.id,a.assignedId,a.config,a.scope?a.scope.id:null,a.events);a.widget=b.widget;a.children.length&&a.children.forEach(this.initWidget,this);b.init()},_serverInit:function(a){var b=
|
|
function(a,g){if(a)for(var i=0,h=a.length;i<h;i++){var f=a[i],m=f[0],c=f[1],e=f[2]||{},j=f[3],k=f[4],l=f[5]||{},f=f.slice(6);0===j&&(j=void 0);0===k&&(k=void 0);0===e&&(e=void 0);m=w(m,c,k,e,j,l,g,1);f&&f.length&&b(f,m.widget);m.init()}};b(a)},get:function(a){return l[a]},_remove:function(a){delete l[a]}}});raptor.defineClass("com.ebay.raptor.vi.lockedheader.LockedHeaderCore",function(){return{init:function(c){var a=this;$("#TopPanelDF").position();a.conf=c;a.conf.lkhdrImpressionTracked=!1;a.viUtils=raptor.require("com.ebay.raptor.vi.utils");a.lkdHdr=$("#"+a.conf.lockedHeaderId);if(a.lkdHdr&&!(a.lkdHdr&&0==a.lkdHdr.length)){a.pubsub=raptor.require("pubsub");a.pubsub&&(a.pubsub.subscribe("ADD_TO_WATCH_MSG_STATUS_TRIGGERED",function(b){a.handleWatchLinkClick(b)},a),a.pubsub.subscribe("LKDHDR_MOVETO_TOP",
|
|
function(b){a.viUtils.scrollPageToTop(b.ts)},a),a.pubsub.subscribe("HIDE_ADD_TO_CART_LINK",function(b){a.handleAddedToCartLink(b)},a),$(".lkdr-imgCr").bind("click",function(){a.conf.isV4Version?a.pubsub.publish("_SHOW_ENLARGE_IMG_FOR_BTF_CMP",{setDefaultImgId:!0}):a.pubsub.publish("_LKHR_THB_IMG_CLK",{})}));a.open=!1;var e=function(){a.showHide()};a.pubsub.subscribe("VI_TIME_LEFT_UPDATE",function(b){a.updateTimeLeft(b.content,b.className)},a);$(window).resize(function(){a.positionLkdhdrContent()});
|
|
$(a.conf.lkTitleId).click(function(){$(document).trigger("rover",{sid:"p2047675.l6301"});a.scrollToTop()});$(".lhdr-thumb-td").click(function(){$(document).trigger("rover",{sid:"p2047675.l6302"})});$(document).ready(function(){a.positionLkdhdrContent();a.lkdHdrHt=a.lkdHdr.outerHeight();a.lkdFtr=$("#lkd-ftr");$(a.conf.lkAddToWatchListBtnId).on("click",function(){$(document).trigger("rover",{sid:"p2047675.l4608"});$(a.conf.origWatchListBtnId).click()});$(a.conf.lkAddToCartBtnId).on("click",function(){$(document).trigger("rover",
|
|
{sid:"p2047675.l4607"});$(a.conf.origCartBtnId).click()});$(a.conf.lkBinBtnId).on("click",function(){$(document).trigger("rover",{sid:"p2047675.l5155"});$(a.conf.origBinBtnId).click()});$(a.conf.lkBidBtnId).on("click",function(){$(document).trigger("rover",{sid:"p2047675.l5156"});$(a.conf.origBidBtnId).click()});if($.browser.msie&&!c.disableLkhdrForIE||!$.browser.msie)$("body").addClass("vi-lkdhdr-trmt"),$(window).bind("load",e),$(window).bind("scroll",e);var b=$("#"+a.conf.bidPriceId),g=$("#"+a.conf.binPriceId);
|
|
!(g&&0<g.length)&&(b&&0<b.length)&&a.updateTimeLeft($("#vi-cdown_timeLeft").html(),$("#vi-cdown_timeLeft").attr("class"));try{var f=encodeURIComponent($("#vi-lkhdr-itmTitl").text()),b=f,d=a.getCutoffThreshold(80,b);b.length>d?(b=b.substr(0,d)+"...",$("#lhdr-ttl a.lhdr-ttl-main").html(decodeURIComponent(b))):$("#lhdr-ttl a.lhdr-ttl-main").html($("#vi-lkhdr-itmTitl").html());b=55;c.isGeo&&(b=30);d=a.getCutoffThreshold(b,f);f.length>d?(f=f.substr(0,d)+"...",$("#lhdr-ttl a.lhdr-ttl-ellip").html(decodeURIComponent(f))):
|
|
$("#lhdr-ttl a.lhdr-ellip-main").html($("#vi-lkhdr-itmTitl").html())}catch(i){}try{if(a.conf.isMSKU&&-1!=a.conf.itemVariationsModel.selectedVariationId){var h=a.conf.itemVariationsModel.selectedVariationId;a.conf.itemVariationsModel.itemVariationsMap[h].varationInCart&&a.handleAddedToCartLink({toHide:!1});a.conf.itemVariationsModel.itemVariationsMap[h].variationWatched&&a.handleWatchLinkClick({display:!0})}}catch(j){}})}},getCutoffThreshold:function(c,a){var e=c,b=a.split("%");return e+=2*b.length},
|
|
updateTimeLeft:function(c,a){$("#"+this.conf.lkTimeLeftId).html(c);$("#"+this.conf.lkTimeLeftId).attr("class",a)},positionLkdhdrContent:function(){var c=$("#TopPanelDF").position().left;this.lkdHdr.css("padding-left",c+"px");var a=100-100*c/$(document).width();$("#"+this.conf.lockedHeaderId+" table").width(a+"%");$("#"+this.conf.buttonsCntrId).css("padding-right",c+"px")},scrollToTop:function(){$("html, body").animate({scrollTop:0},300);return!1},handleWatchLinkClick:function(c){c.display?($(this.conf.lkAddToWatchListBtnId).hide(),
|
|
$(this.conf.lkAddToWatchListAddedBtnId).show(),$("#lhdr-tick-icon").addClass("lhdr-tick-icon"),0<$("#vi-lkdhdr-cart-btn").length&&"none"!=$("#vi-lkdhdr-cart-btn").parent().css("display")?$("#lhdr-tick-icon").css("top","8px"):$("#lhdr-tick-icon").css("top","0px")):($(this.conf.lkAddToWatchListAddedBtnId).hide(),$("#lhdr-tick-icon").removeClass("lhdr-tick-icon"),$(this.conf.lkAddToWatchListBtnId).show())},handleAddedToCartLink:function(c){c.toHide?($(this.conf.lkAddedToCartlnkId).parent().removeClass("lhdr-tick-icon"),
|
|
$(this.conf.lkAddedToCartlnkId).hide(),$(this.conf.lkAddToCartBtnId).parent().show()):($(this.conf.lkAddToCartBtnId).parent().hide(),$(this.conf.lkAddedToCartlnkId).show(),$(this.conf.lkAddedToCartlnkId).parent().addClass("lhdr-tick-icon"))},showHide:function(){var c=$(window).scrollTop()+8,a=$(this.conf.tabId).offset().top;0>a&&(a=9);$("#pse-pdfview-main-wrapper").is(":visible")?(this.lkdHdr.stop(!0,!0).fadeOut(),this.pubsub.publish("_LKHR_FADE_OUT",{}),this.open=!1,0<this.lkdFtr.length&&this.lkdFtr.hide()):
|
|
c>=a&&!this.open?(this.open=!0,this.pubsub.publish("SHOW_BROWSE_TRIGGER",{}),this.lkdHdr.stop(!0,!0).fadeIn(),this.updateItemInfo(),0<this.lkdFtr.length&&this.lkdFtr.show(),this.conf.lkhdrImpressionTracked||($(document).trigger("rover",{sid:"p2047675.l5331"}),this.conf.lkhdrImpressionTracked=!0)):c<a&&this.open&&(this.lkdHdr.stop(!0,!0).fadeOut(),this.pubsub.publish("_LKHR_FADE_OUT",{}),this.open=!1,0<this.lkdFtr.length&&this.lkdFtr.hide())},updateItemInfo:function(){var c=$("#lhdr-prcfmt");$("#"+
|
|
this.conf.timeLeftId);var a=$("#"+this.conf.bidPriceId),e=$("#"+this.conf.binPriceId),b=$("#"+this.conf.mapOriginalPriceId),g=$("#"+this.conf.mmBinPriceId),f=$("#"+this.conf.mmOriginalPriceId),d=$(".vi-binConvPrc"),i=e&&0<e.length,h=a&&0<a.length;this.itemInfoHTML="";h&&!i&&this.addToItemInfo(a.html(),"lhdr-prc");0<e.length?this.conf.isMAPItem||this.addToItemInfo(e.html(),"lhdr-prc"):0<b.length?(this.addToItemInfo(b.html(),"lhdr-prc-strk"),this.conf.isMAPItem||this.addToItemInfo(this.conf.mapBinPrice,
|
|
"lhdr-prc")):0<g.length&&(this.addToItemInfo(f.html(),"lhdr-prc-strk"),this.conf.isMAPItem||this.addToItemInfo(g.html(),"lhdr-prc"));this.conf.isMAPItem||(0<d.length?this.addToItemInfo(d.html(),"vi-lkhdr-convPrc"):(d=$("#prcIsumConv"),0<d.length&&this.addToItemInfo(d.html(),"vi-lkhdr-convPrc")));a=$("#CenterPanelInternal .sh-CostBB").html();0<$("#fshippingCost").length?($("#lkhdr-comma").show(),$("#lkd_hdr .sh-CostBB-lkdhdr").html(a)):$("#lkhdr-comma").hide();this.conf.isV4Version||(this.conf.freeShipLabel==
|
|
a?$("#lkd_hdr .sh-CostBB-lkdhdr").addClass("vi-greenlabel"):$("#lkd_hdr .sh-CostBB-lkdhdr").removeClass("vi-greenlabel"));c.html(this.itemInfoHTML);0<d.length&&$(".lhdr-prc").attr("style","font-size:14px !important;")},addToItemInfo:function(c,a){this.itemInfoHTML+=c?"<span class='"+(a?a:"")+"'>"+c+"</span>":""}}});(function(c){function m(a){this.$element=c(a);this.original_text=this.$element.html();this.settings=c.extend({},c.fn.trunk8.defaults)}function n(){var a=this.data("trunk8"),d=a.settings,b=d.width,o=d.side,g=d.fill,h=f.getLineHeight(this)*d.lines,a=a.original_text,j=a.length,i="",e,l,k;this.html(a);if(b===p.auto){if(!(this.height()<=h)){b=0;for(e=j-1;b<=e;)l=b+(e-b>>1),k=f.eatStr(a,o,j-l,g),this.html(k),this.height()>h?e=l-1:(b=l+1,i=i.length>k.length?i:k);this.html("");this.html(i);d.tooltip&&this.attr("title",
|
|
a)}}else isNaN(b)?c.error('Invalid width "'+b+'".'):(k=f.eatStr(a,o,j-b,g),this.html(k),d.tooltip&&this.attr("title",a))}var e,f,p={auto:"auto"};m.prototype.updateSettings=function(a){this.settings=c.extend(this.settings,a)};e={init:function(a){return this.each(function(){var d=c(this),b=d.data("trunk8");b||d.data("trunk8",b=new m(this));b.updateSettings(a);n.call(d)})},update:function(a){return this.each(function(){var d=c(this);a&&(d.data("trunk8").original_text=a);n.call(d)})},revert:function(){return this.each(function(){var a=
|
|
c(this).data("trunk8").original_text;c(this).html(a)})},getSettings:function(){return this.get(0).data("trunk8").settings}};f={eatStr:function(a,d,b,e){var g=a.length,h=f.eatStr.generateKey.apply(null,arguments),j,i;if(f.eatStr.cache[h])return f.eatStr.cache[h];("string"!==typeof a||0===g)&&c.error('Invalid source string "'+a+'".');if(0>b||b>g)c.error('Invalid bite size "'+b+'".');else if(0===b)return a;"string"!==typeof(e+"")&&c.error("Fill unable to be converted to a string.");switch(d){case "right":return f.eatStr.cache[h]=
|
|
c.trim(a.substr(0,g-b))+e;case "left":return f.eatStr.cache[h]=e+c.trim(a.substr(b));case "center":return j=g>>1,i=b>>1,f.eatStr.cache[h]=c.trim(f.eatStr(a.substr(0,g-j),"right",b-i,""))+e+c.trim(f.eatStr(a.substr(g-j),"left",i,""));default:c.error('Invalid side "'+d+'".')}},getLineHeight:function(a){var a=c(a),d=a.css("float"),b=a.css("position"),f=a.html(),e;"none"!==d&&a.css("float","none");"absolute"===b&&a.css("position","static");a.html("i").wrap('<div id="line-height-test" />');e=c("#line-height-test").innerHeight();
|
|
a.html(f).css({"float":d,position:b}).unwrap();return e}};f.eatStr.cache={};f.eatStr.generateKey=function(){return Array.prototype.join.call(arguments,"")};c.fn.trunk8=function(a){if(e[a])return e[a].apply(this,Array.prototype.slice.call(arguments,1));if("object"===typeof a||!a)return e.init.apply(this,arguments);c.error("Method "+a+" does not exist on jQuery.trunk8")};c.fn.trunk8.defaults={fill:"…",lines:1,side:"right",tooltip:!0,width:p.auto}})(jQuery);raptor.defineClass("com.ebay.raptor.vi.reviews.ProductReviewRedesignV2",function(){return{init:function(c){function b(){i=null;var a=$(".rvws_container"),b=a.offset().top,a=a.height(),n=$(document).scrollTop();if(!f&&n+500>b)f=!0,g=(new Date).getTime(),$(".ebay-review-section").each(function(a,c){h.push($(c).attr("id").split("_")[1])}),h=h&&h.join(",");else if(f&&(n>b+a||n+500<b))d=!0,$(document).trigger("rover",{sid:"p2047675.m3945.l7016",startTime:g,endTime:(new Date).getTime(),reviewIds:h,listingid:c.itemId,
|
|
username:c.username})}var a=this,d=!1,f=!1,m=!1,g,h=[];a.cfg=c;a.pubsub=raptor.require("pubsub");try{window.ebay&&(window.ebay.auth&&window.ebay.client)&&(window.ebay.auth.init(window.ebayAuthTokens),ebay.client.initialize(c.cosgrcEndpoint))}catch(o){}var i=null;$(document).click(function(){$(".inapp-success-overlay").is(":visible")&&$(".inapp-success-overlay").hide()});$(window).unload(function(){f&&!d&&$(document).trigger("rover",{sid:"p2047675.m3945.l7016",startTime:g,endTime:(new Date).getTime(),
|
|
reviewIds:h,listingid:c.itemId,username:c.username})});c.isReviewsMediaImagesEnabled&&(a.pubsub&&a.pubsub.publish("_REVIEWS_LAZYLOAD_IMAGES",$(".reviews-images .review-pic img")),$("[id^=review-media-image_]").on("click",function(){a.pubsub&&a.pubsub.publish("_REVIEWS_IMAGES_LAYER_OPEN",$(this))}));$(window).scroll(function(){d||(i&&clearTimeout(i),i=setTimeout(b,500))});$(".rc").hover(function(){m||($(document).trigger("rover",{sid:"p2047675.m3945.l7014"}),m=!0)});$(".prodreview, #_rvwlnk, .ebay-content-wrapper a").click(function(){$(document).trigger("rover",
|
|
{sid:"p2047675.m3945.l7015"});$("html,body").animate({scrollTop:$("#rwid").offset().top},1E3)});$(".review-item-content").trunk8({fill:'<a class="show-full-review-link" href="#">'+c.readFullReviewTxt+"…</a>",tooltip:!1,lines:5});$(".show-full-review-link").on("click",function(){var e=$(this),b=a.getPosition(e),e=e.closest(".ebay-review-section"),n=-1,d="",k=e.attr("class").split(" ");try{n=e.attr("id").split("_")[1],d=Array.isArray(k)&&(~k.indexOf("topFavorable")?"favorable":~k.indexOf("topCritical")?
|
|
"critical":"")}catch(f){}$(document).trigger("rover",{sid:"p2047675.m3946.l7021",position:b,rvwid:n,listingid:c.itemId,type:d});$(this).parent().trunk8("revert");return!1});$(".ebay-review-section").on("click",".vote-up-link",function(){var e=$(this),b=e.data("value"),d="p2047675.m3946.l7023",f=a.getPosition($(this)),k=e.closest(".ebay-review-section"),g="",j=k.attr("class").split(" "),l=-1;try{l=k.attr("id").split("_")[1],g=Array.isArray(j)&&(~j.indexOf("topFavorable")?"favorable":~j.indexOf("topCritical")?
|
|
"critical":"")}catch(i){}"cancel"===b&&(d="p2047675.m3946.l7029");$(document).trigger("rover",{sid:d,listingid:c.itemId,position:f,rvwid:l,type:g});a.call("vote",b,e,"?action="+b,c)});$(".ebay-review-section").on("click",".vote-down-link",function(){var b=$(this),d=b.data("value"),f="p2047675.m3946.l7024",g=a.getPosition($(this)),k=b.closest(".ebay-review-section"),i="",j=k.attr("class").split(" "),l=-1;try{l=k.attr("id").split("_")[1],i=Array.isArray(j)&&(~j.indexOf("topFavorable")?"favorable":~j.indexOf("topCritical")?
|
|
"critical":"")}catch(h){}"cancel"===d&&(f="p2047675.m3946.l7030");$(document).trigger("rover",{sid:f,listingid:c.itemId,position:g,rvwid:l,type:i});a.call("vote",d,b,"?action="+d,c)});$(".ebay-review-section").on("click",".report-spam-link",function(){var b=$(this),d=b.data("value"),f=b.parent(),g="p2047675.m3946.l7025",i=a.getPosition($(this)),h=b.closest(".ebay-review-section"),j="",l=h.attr("class").split(" "),m=-1;try{m=h.attr("id").split("_")[1],j=Array.isArray(l)&&(~l.indexOf("topFavorable")?
|
|
"favorable":~l.indexOf("topCritical")?"critical":"")}catch(o){}"cancel"===d&&(g="p2047675.m3946.l7028");$(document).trigger("rover",{sid:g,listingid:c.itemId,position:i,rvwid:m,type:j});"report"===d?a.isUserLoggedIn(c)?(f.addClass("marked-inapp"),f.append($(".inapp-spam-overlay")),$(".inapp-spam-overlay").show(),b.closest(".ebay-review-section").addClass("ghosted"),$("#reviewsSection").on("click",".inapp-reasons-list input",function(){$(".inapp-action input").removeClass("disabled")})):window.location=
|
|
a.getSigninUrl(c):a.call("flag",d,b,"?action=cancel",c)});$(".inapp-spam-overlay").on("click",".overlay-close",function(){a.handleCancelReportSpam($(this))});$(".inapp-success-overlay").on("click",".overlay-close",function(){$(".inapp-success-overlay").hide()});$(".inapp-spam-overlay").on("click",".inapp-action a",function(){a.handleCancelReportSpam($(this))});$(".inapp-spam-overlay").on("click",".inapp-action input",function(){a.handleSubmitReportSpam($(this),c)});$(document).on("updateUserSiginStatus",
|
|
function(a,b){b&&b.signin&&(c.isUserSignedIn=!0,c.username=b.username)})},getPosition:function(c){return $(".ebay-review-section").index(c.closest(".ebay-review-section"))+1},handleCancelReportSpam:function(c){c.closest(".marked-inapp").removeClass("marked-inapp");c.closest(".ebay-review-section").removeClass("ghosted");$(".inapp-action input").addClass("disabled");$(".inapp-spam-overlay").hide();$(".inapp-reasons-list").find("input").attr("checked",!1)},handleSubmitReportSpam:function(c,b){var a=
|
|
c.closest(".ebay-review-section"),d=a.find(".inapp-reasons-list").find("input:checked"),a=a.find(".report-spam-link");this.call("flag",d.val(),a,"?action=inappropriate&reason="+d.val(),b)},isUserLoggedIn:function(c){var b=raptor.require("ebay.cookies"),a=raptor.require("Base64"),d=!1;null!==b&&(void 0!==b&&null!=c)&&(b=b.readCookie("dp1","u1p"),a=a.decode(decodeURIComponent(b)),b=c.username,d=c.isUserSignedIn&&""!=a&&a===b);return d},getSigninUrl:function(c){return"https://signin."+c.currentDomain+
|
|
"/ws/eBayISAPI.dll?SignIn&ru="+encodeURIComponent(document.URL)},call:function(c,b,a,d,f){var m=f.cosgrcEndpoint,g=a.closest(".ebay-review-section");if(this.isUserLoggedIn(f)){if(""!==m){var h=g.attr("id").split("_")[1];ebay.client.ajax.execute("POST",m+"/review/"+h+"/"+c+d,{timeout:3E3,clientid:"urwwidget",dataType:"json",headers:{"Content-Type":"application/json",Accept:"application/json","x-ebay-c-marketplace-id":f.marketplaceid}},function(d,f){switch(c){case "vote":if("cancel"===b){a.data("value",
|
|
a.hasClass("vote-up-link")?"up":"down");var e=a.hasClass("vote-up-link")?"voted-up":"voted-down";a.closest("div").removeClass(e)}else"down"===b?(a.closest("div").addClass("voted-down"),a.data("value","cancel"),e=g.find(".vote-up-link"),"cancel"===e.data("value")&&(e.data("value","up"),e.closest("div").removeClass("voted-up"))):(a.data("value","cancel"),a.closest("div").addClass("voted-up"),e=g.find(".vote-down-link"),"cancel"===e.data("value")&&(e.data("value","down"),e.closest("div").removeClass("voted-down")));
|
|
break;case "flag":"cancel"===b?(a.data("value","report"),a.closest("div").removeClass("marked-inapp"),a.closest(".ebay-review-section").removeClass("ghosted")):($(".inapp-spam-overlay").hide(),a.parent().append($(".inapp-success-overlay")),$(".inapp-reasons-list").find("input").attr("checked",!1),$(".inapp-action button").addClass("disabled"),a.parent().parent().find("div[name=vote]").removeClass(),$(".inapp-success-overlay").show(),setTimeout(function(){$(".inapp-success-overlay").hide()},5E3),a.data("value",
|
|
"cancel"))}g.find("span.positive-h-c").text(f.result.votesPositive);e=f.result.votesTotal-f.result.votesPositive;g.find("span.negative-h-c").text(!isNaN(e)&&e)},function(){$(document).trigger("rover",{sid:"p2047675.m3946.l7075"})})}}else window.location=this.getSigninUrl(f)}}});
|
|
$(function(){function c(b,a){b.css({transform:"rotateZ(-"+a+"deg)","-ms-transform":"rotate(-"+a+"deg)","-moz-transform":"rotateZ(-"+a+"deg)","-webkit-transform":"rotateZ(-"+a+"deg)","-o-transform":"rotateZ(-"+a+"deg)"})}$(".pie").each(function(){var b=$(this).data("percent").split("%")[0],a=$(this).find(".left span"),d=$(this).find(".right span"),b="--"===b?0:b;50>=b?(a.hide(),c(d,180-360*(b/100))):c(a,180-360*((b-50)/100))})});raptor.defineClass("com.ebay.raptor.vi.reviews.ProductReviewsImagesOverlay",function(){var g,h;return{init:function(){this.pubsub=raptor.require("pubsub");g="_REVIEWS_IMAGES_LAYER_OPEN";h="_REVIEWS_LAZYLOAD_IMAGES";this.bindEventListener()},bindEventListener:function(){var a=this;$(".reviews-carsoul-thumbnails").on("click","button.review-pic",function(){var b=$(this);setTimeout(function(){a.handleImageCarsoulChanged(b)},0)});$(".rvwImageEnlarge").on("click","button",function(){var b=$(this);setTimeout(function(){a.handleImageCarsoulChanged(b)},
|
|
0)});$(".vi_pl_panel").on("fluid-fs:navigate",function(a,d){var c=$(this).find(".reviews-carsoul-thumbnails ul li button[data-imageIndex="+d.current+"]");c.length&&($(this).find(".reviews-carsoul-thumbnails ul li button").removeClass("selected"),$(c[0]).addClass("selected"))});a.pubsub.subscribe(g,function(b){var d="rvwEnlargeImgLayer_"+b.attr("id").split("_")[1].split("_")[0];a.pubsub.publish(d+"_OPEN_VI_P_LAYER",{id:d});a.handleProductReviwsImageOverlayOpen(b)});a.pubsub.subscribe(h,function(b){a.initImagesLazyLoad(b)})},
|
|
handleProductReviwsImageOverlayOpen:function(a){var b=a.closest(".ebay-review-section").attr("id").split("_")[1],d=$("#rvwEnlargeImgLayer_"+b),c=d.find(".rvwImageEnlarge"),a=a.data("imageindex");$(".reviews-carsoul-thumbnails button").removeClass("selected");c.data("islazyloaded")||(this.initImagesLazyLoad(d.find(".reviews-images-overlay .review-pic-overlay-filmstip-main img")),this.initImagesLazyLoad(d.find(".reviews-carsoul-thumbnails button.review-pic img")),c.attr("data-islazyloaded",!0),c.filmstrip());
|
|
var e=c.data("__FS__INSTANCE"),f=e.props.current,c=Infinity==e.props.total?c.find(".review-pic-overlay-filmstip-main").length-1:e.props.total;e.props.total=c;e.isTransitioning=!1;e._clickHandler({data:f-a});d.find(".reviews-carsoul-thumbnails button[data-imageindex="+a+"]").addClass("selected");e.isTransitioning=!1;this.imageOverlayOpenClickTracking(a,b,c)},imageOverlayOpenClickTracking:function(a,b,d){$(document).trigger("rover",{sid:"p2047675.m3946.l8861",rvwid:b,rvwImageindex:1+parseInt(a),totalImages:1+
|
|
parseInt(d)})},initImagesLazyLoad:function(a){a.one("load",function(){for(var b=0;b<a.length;b++)a[b]&&pagespeed.lazyLoadImages.loadIfVisible(a[b])}).each(function(){this.complete&&$(this).attr("src",$(this).attr("imgurl"))})},handleImageCarsoulChanged:function(a){var b=a.data("imageindex"),d=a.closest("[id^=rvwEnlargeImgLayer_]"),c=d.find(".rvwImageEnlarge"),e=c.data("__FS__INSTANCE"),f=e.props.current,c=Infinity==e.props.total?c.find(".review-pic-overlay-filmstip-main").length-1:e.props.total;d.find(".reviews-carsoul-thumbnails button").removeClass("selected");
|
|
e.props.total=c;e.isTransitioning=!1;void 0!=b?(e._clickHandler({data:f-b}),a.addClass("selected")):d.find(".reviews-carsoul-thumbnails button[data-imageindex="+f+"]").addClass("selected");e.isTransitioning=!1}}});var func=function(){function g(a){var b=this,c=a||{};this.$el=a.$el;this.$ul=a.$ul;this.isTransitioning=!1;this.transitionStartTime=0;this.dataItemIdAttr=c.dataAttr||"item-id";this.props=void 0;this.mobiUX=!1;c.isMobiUX&&($.fluidmixins.isTouch&&$.fluidmixins.hasWebKitTouch?this.mobiUX=!0:this.$el.removeClass("fluid-filmstrip-mobiux"));this.mobiUX||(this.selectorPrev=c.selectorPrev||"button:first-child",this.selectorNext=c.selectorNext||"button:last-child",this.$el.on("click",this.selectorPrev,function(a){a.data=
|
|
1;b._clickHandler.call(b,a)}).on("click",this.selectorNext,function(a){a.data=-1;b._clickHandler.call(b,a)}),this.$el.tact({dragstart:function(a){b._dragHandler.call(b,a)},drag:function(a){b._dragHandler.call(b,a)},dragend:function(a){b._dragHandler.call(b,a)},swipe:function(a){b._swipeHandler.call(b,a)}}),this._supportsTransitions&&("function"===typeof this._translate&&(this._translate=this._translate()),this.$ul.css("transition",this._translate+" 0.4s ease-out").css(this._translate,"translate3d(0%, 0, 0)").on("webkitTransitionEnd oTransitionEnd otransitionend transitionend",
|
|
function(){b._setTransitionEnd.call(b)})),$(document).on(h,function(){void 0===b._resizeFunc?b._resizeTime=(new Date).getTime():200>(new Date).getTime()-b._resizeTime&&(clearTimeout(b._resizeFunc),b._resizeTime=(new Date).getTime());b._resizeFunc=setTimeout(function(){var a=b._getProps();b.props.total!==a.total&&(b.props.resized=!0,b._setButtons());b._resizeFunc=void 0},200)}));this.$el.on("click","ul > li",function(){b._eventPublisher(m,{type:"click",id:$(this).data(b.dataItemIdAttr)})});this._setButtons();
|
|
return this}var h="__FS_RESIZE",m="fluid-fs:click",i=!1;if("function"!==typeof $.fn.tact)throw Error("Tactile.js depedency is missing.");g.prototype._clickHandler=function(a,b,c){var d=this,e=this.$ul,f=this.props,g=this.isTransitioning,h=this._supportsTransitions,b=b||400,j=f.current,i=a.data-j,l=c||100*i+"%",k={};0===j&&1===a.data||(j===f.total&&-1===a.data||!0===g)||(this.isTransitioning=!0,this.transitionStartTime=(new Date).getTime(),h?(k=this.getTransObj(b/1E3),k[this._translate]="translate3d("+
|
|
l+",0,0)",e.css(k)):e.stop(!0,!0).animate({left:l},b,function(){d.isTransitioning=!1;f.offset=e.position().left}),void 0===c&&(f.current=Math.abs(i),this._setButtons(),this._eventPublisher("fluid-fs:navigate",{type:"navigate",dir:a.data,current:f.current})))};g.prototype._eventPublisher=function(a,b){this.$el.trigger(a,b)};g.prototype._dragHandler=function(a){var b=this.$ul,c=this.props,d=a.gesture.dir,e=c.offset+a.gesture.delta.x+"px",f=c.current;if(!this.isTransitioning)if("dragstart"===a.gesture.type)b.css(this.getTransObj(0));
|
|
else{if(0===f&&0<a.gesture.delta.x||f===c.total&&-1===d)e=c.offset+a.gesture.delta.x/4+"px";if("dragend"===a.gesture.type)if(0===f&&0<a.gesture.delta.x||f===c.total&&-1===d)b.css(this.getTransObj(0.4)),e=-(100*f)+"%";else if(!1===a.gesture.swipe)if(0.1>a.gesture.delta.x/this.props.width)b.css(this.getTransObj(0.4)),e=-(100*f)+"%";else{a.gesture.velocity=0.5;this._swipeHandler.call(this,a);return}b.css(this._translate,"translate3d("+e+",0,0)")}};g.prototype._swipeHandler=function(a){if(this.isTransitioning)if(this.transitionStartTime+
|
|
1E3<=(new Date).getTime())this.isTransitioning=!1;else return;var b={};b.delegateTarget=this.$el;b.data=a.gesture.dir;this._clickHandler.call(this,b,400/a.gesture.velocity)};g.prototype._getProps=function(){var a=this.$ul,b=a.find("li:first-child").width(),c=a.children("li").length,a=a.width(),d={},e=this.props&&this.props.current?this.props.current:0,f=this.props&&this.props.offset?this.props.offset:0;d.width=a;d.current=e;d.offset=f;d.total=Math.ceil(b*c/a)-1;return d};g.prototype._setButtons=function(){var a=
|
|
this.$el,b,c=this.selectorPrev,d=this.selectorNext,e=!1;void 0===this.props||(e=!0===this.props.resized)?(this.props=b=this._getProps(),!0===e&&b.current>b.total&&(this.props.current=b.total,this._clickHandler({data:1},400,-100*b.total+"%"))):b=this.props;!1===this.mobiUX&&(a.find(c+","+d).attr("aria-disabled",!1),0===b.total?a.find(c+","+d).attr("aria-disabled",!0).css("visibility","hidden"):0===b.current?a.find(c).attr("aria-disabled",!0):b.current===b.total&&a.find(d).attr("aria-disabled",!0))};
|
|
g.prototype._translate=function(){var a=(document.body||document.documentElement).style,b=["Webkit","Moz","O","ms"],c;if("string"===typeof a.transform)return"transform";for(c=0;c<b.length;c++)if("string"===typeof a[b[c]+"Transform"])return"-"+b[c].toLowerCase()+"-transform";return"left"};g.prototype.getTransObj=function(a){return{"transition-duration":a+"s","-webkit-transition-duration":a+"s","-moz-transition-duration":a+"s","-o-transition-duration":a+"s"}};g.prototype._supportsTransitions=function(){var a=
|
|
(document.body||document.documentElement).style,b="webkit Webkit Moz Khtml O ms".split(" "),c;c=navigator.userAgent;if(!0===(-1<c.indexOf("Mozilla/5.0")&&(-1<c.indexOf("Android ")&&-1<c.indexOf("AppleWebKit"))&&!1===-1<c.indexOf("Chrome")))return!1;if("string"===typeof a.transition)return!0;for(c=0;c<b.length;c++)if("string"===typeof a[b[c]+"Transition"])return!0;return!1}();g.prototype._setTransitionEnd=function(){this.props.offset=this.$ul.position().left;this.isTransitioning=!1};$.fn.filmstrip=
|
|
function(a){var a=a||{},b=a.selectorPrev||"button:first-child",c=a.selectorNext||"button:last-child",d=a.dataAttr||"item-id",e=a.mobiUX||!1;if(!1===i){if(!0==="onorientationchange"in window)$(window).on("orientationchange",function(){$(document).trigger(h)});else $(window).on("resize",function(){$(document).trigger(h)});i=!0}return this.each(function(){var a=$(this),h=a.find("ul:first-child");void 0===a.data("__FS__INSTANCE")&&a.data("__FS__INSTANCE",new g({$el:a,$ul:h,selectorPrev:b,selectorNext:c,
|
|
dataAttr:d,isMobiUX:e}))})}};window.addEventListener?window.addEventListener("load",func,!1):window.attachEvent&&window.attachEvent("onload",func);(function(d){function f(a,b){this.settings={};this.$el=d(a);this.handlers={};document.addEventListener&&this._bindEvents(1,b)}var i=["touchstart","touchmove","touchend","touchcancel"],j={touchstart:function(a){var b=this.settings,a=a.changedTouches[0];b.dY=0;b.dX=0;b.scroll=0;b.dir=0;b.userDragging=!1;b.sX=Math.abs(a.screenX);b.sY=Math.abs(a.screenY);b.sT=(new Date).getTime();b.id=a.identifier},touchmove:function(a){var b=this.$el,c=this.settings,e=a.changedTouches[0];if(!c.scroll)if(c.dir=c.dX>=
|
|
e.screenX-c.sX?-1:1,c.dX=e.screenX-c.sX,c.dY=e.screenY-c.sY,!c.userDragging&&0.5<Math.abs(c.dY/c.dX))c.scroll=1;else if(c.userDragging||c.listenDrag&&(10<Math.abs(c.dY)||10<=Math.abs(c.dX)))a.gesture=this._extendGestureObj(c),a.preventDefault(),c.userDragging?(a.gesture.type="drag",b.trigger("tact:drag",a)):(c.sX=e.screenX,c.sY=e.screenY,a.gesture=this._extendGestureObj(c),a.gesture.type="dragstart",b.trigger("tact:dragstart",a),c.userDragging=!0)},touchend:function(a){var b=this.$el,c=this.settings,
|
|
e=a.changedTouches[0],h=(new Date).getTime(),g=Math.abs(e.screenX),d=Math.abs(e.screenY),e=!1,f;f=h-c.sT;d=Math.floor(Math.sqrt((g-c.sX)*(g-c.sX)+(d-c.sY)*(d-c.sY)));a.gesture=this._extendGestureObj(c);a.gesture.end=h;a.gesture.duration=f;0.5<Math.abs(c.sX-g)/Math.abs(c.sT-h)&&(a.gesture.velocity=Math.abs(c.sX-g)/Math.abs(c.sT-h),a.gesture.type="swipe",e=!0,b.trigger("tact:swipe",a));c.userDragging&&(c.userDragging=!1,a.gesture.type="dragend",a.gesture.swipe=e,b.trigger("tact:dragend",a));150>f&&
|
|
10>d&&(delete a.gesture.dir,delete a.gesture.delta,a.gesture.type="tap",b.trigger("tact:tap",a))},touchcancel:function(a){this.handlers.touchend(a)}},k=function(a,b,c){var e=b.$el.data("__TACTILE_LISTENER_BOUND");1===a&&(void 0===e||!1===e)?(a=function(a){j[c].call(b,a)},b.handlers[c]=a):a=b.handlers[c];return a},l=function(a,b,c){return function(e,d){c.settings.enabled&&b[a].call(c.$el[0],d)}};f.prototype._bindEvents=function(a,b){var c=1===a?"add":"remove",e=this.$el.get(0),d,g,f;g=0;for(f=i.length;g<
|
|
f;g++)e[c+"EventListener"](i[g],k(a,this,i[g]));this.$el.data("__TACTILE_LISTENER_BOUND",!!a);if("add"===c&&b)for(d in this.settings.enabled=1,b)if(b.hasOwnProperty(d)){if("function"===typeof b[d])this.$el.on("tact:"+d+".tact",l(d,b,this));-1<d.indexOf("drag")&&(this.settings.listenDrag=!0)}};f.prototype._extendGestureObj=function(a){var b={};b.dir=a.dir;b.id=a.id;b.start=a.sT;b.delta={};b.delta.x=a.dX;b.delta.y=a.dY;return b};d.fn.extend({tact:function(a){return"string"===typeof a||a instanceof String?
|
|
"enable"===a?this.each(function(){var a=d(this).data("__TACTILE");a&&a.settings&&(a.settings.enabled=1)}):"disable"===a?this.each(function(){var a=d(this).data("__TACTILE");a&&a.settings&&(a.settings.enabled=0)}):"destroy"===a?this.each(function(){var a=d(this).data("__TACTILE");a&&(a._bindEvents(0),d(this).off(".tact"),d(this).removeData("__TACTILE"))}):this:this.each(function(){var b=d(this);void 0===b.data("__TACTILE")?b.data("__TACTILE",new f(this,a)):(b=b.data("__TACTILE"),b._bindEvents(1,a))})}})})(jQuery);raptor.defineClass("com.ebay.raptor.vi.share.SocialWidget",function(){return{init:function(a){var b=this;b.conf=a;b.addTrackingHandlers();$(".social-widget").click(function(a){b.triggerShare(a);return!1});b.conf.isTalkOn&&(b.talkPopPosition(),b.showTalkPopupAfterDelay(),$(".scTalkPopUpClose").click(function(){$(".scShareTalkPopup").hide()}),$(window).load(function(){$("#social-widget").on("click",".scTalkPopUpClose",function(){b.talkOverlayCloseCookie()})}))},addTrackingHandlers:function(){$(".social-widget").on("click",
|
|
"a.sw_facebook",function(){$(document).trigger("rover",{sid:"p2047675.l9105"})});$(".social-widget").on("click","a.sw_twitter",function(){$(document).trigger("rover",{sid:"p2047675.l9106"})});$(".social-widget").on("click","a.sw_pinterest",function(){$(document).trigger("rover",{sid:"p2047675.l9107"})});$(".social-widget").on("click","a.sw_vk",function(){$(document).trigger("rover",{sid:"p2047675.l9108"})});$(".social-widget").on("click","a.sw_talk",function(){$(document).trigger("rover",{sid:"p2047675.l9109"})});
|
|
$(".social-widget").on("click","a.sw_email",function(){$(document).trigger("rover",{sid:"p2047675.l9110"})})},triggerShare:function(a){a=a.target||a.srcElement;if(this.isClass(a,"scIcon")){var b=a.getAttribute("data-destination"),c;c=a.getAttribute("data-tracking");"email"==b?ebayShare.init(this.conf.shareMailPopJs):"talk"==b?window.open(a.href,"_blank"):(null!==c&&""!=c&&$(document).trigger("rover",{sid:c}),c="scrollbars,resizable,screeny=top,width="+this.popWinWidth(b)+",screenX=200,screenY=100,height="+
|
|
this.popWinHeight(b),window.open(a.href,b,c,"_blank"));return!1}},popWinWidth:function(a){switch(a){case "facebook":a=800;break;case "vk":a=605;break;default:a=800}return a},popWinHeight:function(a){var b=this.conf;switch(a){case "facebook":a=b.fbPopupHeight?b.fbPopupHeight:300;break;case "twitter":a=b.twitterPopupHeight?b.twitterPopupHeight:350;break;case "vk":a=430;break;default:a=350}return a},isClass:function(a,b){return a.className.match(RegExp("(\\s|^)"+b+"(\\s|$)"))?!0:!1},showTalkPopupAfterDelay:function(){setTimeout(function(){$(".scShareTalkPopup").removeClass("scClosePopup");
|
|
setTimeout(function(){$(".scShareTalkPopup").addClass(" scClosePopup")},5E3)},500)},talkPopPosition:function(){var a=$(".sw_talk").position();$(".scShareTalkPopup").css({left:a.left-95,top:a.top-62})},talkOverlayCloseCookie:function(){var a=this.cookie.readCookie("dp1","pbf");this.cookie.writeCookielet("dp1","pbf",this.cookie.setBitFlag(a,66,1))}}});if("undefined"===typeof ebaysc)var ebaysc={rokenCalled:!1};
|
|
var ebayShare={element:null,signInDuration:120,hasEtafParam:0,hasEtafToEmail:!1,etafLanguage:"en_US",etafTitle:"",params:null,usesEtaf:0,url:"",cssLoaded:!1,cssStack:[],test:"",language:"",imageUrl:"",spid:"",shareCmdHost:"",title:"",itemId:"",strings:{en_US:{share:"",tt_email:""},de_DE:{share:":",tt_email:""}},getElementsByClass:function(a,c){var b,d,h=RegExp("(^|\\s)"+a+"(\\s|$)"),e,f,g=[];void 0===c&&(c=document);b=c.getElementsByTagName("*");d=b.length;for(f=e=0;e<d;e++)h.test(b[e].className)&&
|
|
(g[f]=b[e],f++);return g},attr:function(a){if(a=this.element.getAttribute(a))return a},html:function(a){return a||0===a||""===a?(this.element.innerHTML=a,this):this.element.innerHTML},parseUrlParams:function(){for(var a={},c=document.location.search.substring(1).split("&"),b=0;b<c.length;b++){var d=c[b].split("=");a[d[0]]=d[1]}return a},loadScript:function(a,c){var b=document.createElement("script");b.id=a;b.src=c;document.getElementsByTagName("head")[0].appendChild(b)},checkEtafParam:function(){ebayShare.params=
|
|
ebayShare.parseUrlParams();void 0!==ebayShare.params.etaf&&"1"==ebayShare.params.etaf&&(Math.round((new Date).getTime()/1E3)-parseInt(ebayShare.params.tp,10)<ebayShare.signInDuration&&(ebayShare.hasEtafParam=1),void 0!==ebayShare.params.email&&(ebayShare.hasEtafToEmail=!0))},launchEtaf:function(a,c){ebayShare.params=ebayShare.parseUrlParams();void 0!==ebayShare.params.etafElem&&(c=document.getElementById(ebayShare.params.etafElem));void 0!==c&&null!==c&&(ebayShare.url=c.getAttribute("etafShareUrl"),
|
|
ebayShare.etafTitle=c.getAttribute("etafShareTitle"),ebayShare.clickedEtafElement=c.getAttribute("id"));document.getElementById("ebay-etaf")?etaf.showEmailFlow():ebayShare.loadScript("ebay-etaf",a)},init:function(a){var c=ebayShare.getElementsByClass("scIcon sw_email"),b=0;ebayShare.shareCmdHost=ebayShare.getShareCommandHost(window.location.href);for(var d=0;d<c.length;d++)b++,ebayShare.render(c[d],b,a);!1===ebaysc.rokenCalled&&(a=ebayShare.parseUrlParams(),a.roken&&(c=document.createElement("img"),
|
|
c.setAttribute("src","http://r.ebay.com/"+a.roken),c.setAttribute("width","1"),c.setAttribute("height","1"),c.setAttribute("align","left"),document.getElementById("ebayShare_1").appendChild(c),ebaysc.rokenCalled=!0))},render:function(a,c,b){this.element=a;a=ebayShare.attr("data-language")?ebayShare.attr("data-language"):"en_US";a=ebayShare.sanitizeLocale(a);ebayShare.spid=parseInt(ebayShare.attr("data-spid"),10);ebayShare.itemId=ebayShare.attr("data-itemid");ebayShare.title=this.sanitizeTitle(encodeURIComponent(ebayShare.attr("etafsharetitle")));
|
|
ebayShare.encodedTitle=ebayShare.title;ebayShare.language="de_CH"===a||"de_AT"===a?ebayShare.etafLanguage="de_DE":"fr_BE"===a?ebayShare.etafLanguage="fr_FR":ebayShare.etafLanguage=a?a:"en_US";ebayShare.url=ebayShare.attr("etafShareUrl");ebayShare.etafTitle=ebayShare.attr("etafShareTitle");ebayShare.clickedEtafElement=ebayShare.attr("id");ebayShare.usesEtaf=1;ebayShare.checkEtafParam();ebayShare.launchEtaf(null!==b&&void 0!==b?b:"http://ir.ebaystatic.com/rs/v/dbizjriqoaytxlsqwfmu1memde0.js")},sanitizeLocale:function(a){return a.replace(/-/g,
|
|
"_")},capitalize:function(a){return a.substr(0,1).toUpperCase()+a.substr(1)},loadCss:function(a,c){for(var b=0;b<ebayShare.cssStack.length;b++)if(ebayShare.cssStack[b]==c)return;ebayShare.cssStack.push(c);b=document.createElement("style");b.setAttribute("type","text/css");document.getElementsByTagName("head")[0].appendChild(b);var d=document.createTextNode(a);b.styleSheet?b.styleSheet.cssText=d.nodeValue:b.appendChild(d)},sanitizeTitle:function(a){return a.replace(/'/g,"%27")},getItemId:function(){return ebayShare.itemId},
|
|
isItemPage:function(){return!0},getEnv:function(a){a=a.replace(/http:\/\//,"").split("/");return-1!=a[0].indexOf(".qa.ebay.")?"QA":-1!=a[0].indexOf("corp.ebay.")?"DEV":-1!=a[0].indexOf("dev.ebay.")?"DEV":-1!=a[0].indexOf("ebay.")?"PROD":"OON"},getShareCommandHost:function(a){var c="",b=null,c=a.replace(/http:\/\//,"").split("/"),b=c[0].split(".");b.splice(0,1);b=b.join(".");return c="QA"===ebayShare.getEnv(a)?-1!==b.indexOf("stratus")?"www."+b.match(/qa\.ebay\.[a-zA-Z]+\.*[a-zA-Z]*/g):"www."+b.match(/([a-zA-Z]+\.[a-zA-Z]+\.)*qa\.ebay\.[a-zA-Z]+\.*[a-zA-Z]*/g):
|
|
"PROD"===ebayShare.getEnv(a)?-1!==b.indexOf("stratus")?"www."+b.match(/ebay\.[a-zA-Z]+\.*[a-zA-Z]*/g):"www."+b.match(/[a-zA-Z]*\.*[a-zA-Z]*\.*ebay\.[a-zA-Z]+\.*[a-zA-Z]*/g):"DEV"===ebayShare.getEnv(a)?"www.qa."+c[0].match(/ebay\.[a-zA-Z]+\.*[a-zA-Z]*/g):"www.ebay.com"},getFacebookShareUrl:function(a,c,b){var c=c="",d=ebayShare.getImageUrl();shareUrl=encodeURIComponent(b);18==a&&(c="&apnd="+encodeURIComponent("app_id="+etaf.fbSendappidProd+"&display=popup"));return c="http://"+ebayShare.shareCmdHost+
|
|
"/soc/share?swd="+a+"&du="+shareUrl+"&rt=nc&t="+ebayShare.encodedTitle+"&spid="+ebayShare.spid+c+"&media="+d+"&shorten=0"},getImageUrl:function(){var a=ebayShare.attr("data-imageUrl");if(ebayShare.imageUrl)return ebayShare.imageUrl;if(a)return ebayShare.imageUrl=a;a=ebayShare.getOGInfo("og:image");if(!a)return!1;ebayShare.imageUrl=ebayShare.imageUrlCleanUp(a);return a},getOGInfo:function(a){for(var c=document.getElementsByTagName("meta"),b=0;b<c.length;b++)if("object"==typeof c[b]&&c[b].getAttribute("property")===
|
|
a)return c[b].content},imageUrlCleanUp:function(a){-1<a.indexOf("+")&&(a=a.replace(RegExp("\\+","g"),"%2B"));return a}};raptor.defineClass("com.ebay.cache.wrapper",function(){return{init:function(a){var b=this;b.cfg=a;b.pubsub=raptor.require("pubsub");b.maskClicked=!1;$("#cache_mask").click(function(){if(!b.maskClicked){var a="//rover.ebay.com/roverclk/0/0/9?trknvp=sid%3Dp2047675.l9047&ts="+(new Date).getTime();(new Image).src=a;b.maskClicked=!0}});b.scache=!1;$(document).on("_FETCH_RESPONSE",function(a,d){if("object"==typeof d)b.processFetchModuleResponse(d);else{b.scache=!0;try{var e=JSON.parse(d);e&&e.prefetchredirect?
|
|
b.deleteSWKey():(b.changeLocationUrl(),b.processFetchModuleResponse(e))}catch(f){$(document).trigger("rover",{sid:"p2047675.l8980"}),b.deleteSWKey()}}});window.fetchResponseHandlerPrefetch?window.fetchResponseHandlerPrefetch(!0):window.fetchResponseRequested=!0},deleteSWKey:function(){try{this.cfg&&this.cfg.reloadVIForServiceWorker&&"undefined"!==typeof reloadViewitem?this.clearSwCacheEntryWithURLParamBust(top.location.href):this.clearSwCacheEntry(top.location.href)}catch(a){}},clearSwCacheEntry:function(a){"serviceWorker"in
|
|
navigator?(navigator.serviceWorker.getRegistration("/itm").then(function(a){(!a||"undefined"===typeof a)&&top.location.reload(!0)}).catch(function(a){console.log("SW Post messages failed: ",a)}),caches.keys().then(function(b){b.filter(function(a){return-1<a.indexOf("SRPVIPREFETCH")}).map(function(b){caches.open(b).then(function(b){b.delete(a);top.location.reload(!0)}).catch(function(){})})})):top.location.reload(!0)},clearSwCacheEntryWithURLParamBust:function(a){"serviceWorker"in navigator?(navigator.serviceWorker.getRegistration("/itm").then(function(a){(!a||
|
|
"undefined"===typeof a)&&reloadViewitem(!0)}).catch(function(a){console.log("SW Post messages failed: ",a)}),caches.keys().then(function(b){b.filter(function(a){return-1<a.indexOf("SRPVIPREFETCH")}).map(function(b){caches.open(b).then(function(b){b.delete(a);reloadViewitem()}).catch(function(){})})})):reloadViewitem(!0)},processFetchModuleResponse:function(a){var b=this;a&&($(document).trigger("PREFETCH_RESPONSE_RCVD",a),b.updateTrackingPSIValue(a),b.loadScripts(a),b.destroyWindowEvents(),a.body&&
|
|
(b.updateMainContainer(a),b.updateStatusMessage(a),b.updateMerch(a),b.updateFollowSeller(a),b.updateShippingContent(a),b.updateWatchLink(a),b.updateBtcUrl(a),b.updateDescContent(a),b.updateProductQnAContainer(a),b.updateEGDSection(a),b.updateSmartBackToURL()),$("#gh-cat").val(0),b.positionAddtoListDropdown(),$("#cache_mask").fadeOut(200),"undefined"!=typeof oGaugeInfo&&window.fetchDiff&&raptor.require("ebay.profiler.Profiler").addParam("i_30i",window.fetchDiff),$(document).ready(function(){"function"==
|
|
typeof rtmExec&&rtmExec();"function"==typeof normalexec&&normalexec();b.scache?$(document).trigger("rover",{sid:"p2047675.l8977"}):$(document).trigger("rover",{sid:"p2047675.l8832"})}),$(document).trigger("SSCACHE_FETCH_SUCCESS"),$(document).trigger("SSCACHE_FETCH_SUCCESS_COMPLETE",a))},changeLocationUrl:function(){history&&-1==window.location.href.indexOf("&frcectupt=true")&&history.replaceState({},"viprefetch",window.location.href+"&frcectupt=true")},updateTrackingPSIValue:function(a){a.psi&&$("body").trigger("TRACKING_UPDATE_PSI",
|
|
{psi:a.psi})},updateSmartBackToURL:function(){$("#smtBackToAnchor")&&$("#smtBackToAnchor").attr("href","javascript:history.go(-1)")},updateFollowSeller:function(a){if(a=a.body["vi-follow-seller"]){var b=$("#followSeller .fol-widget");b&&0<b.length&&(this.destroyWidget(b[0].id,!0,!0),$("#followSeller").html(a))}},destroyWindowEvents:function(){this.pubsub.publish("_DESTROY_BID_TIMER",{})},loadScripts:function(a){var b=this;a&&a.cssUrl&&$("<link/>",{rel:"stylesheet",type:"text/css",href:a.cssUrl}).appendTo("head");
|
|
a&&a.jsUrl&&$.ajax({url:a.jsUrl,dataType:"script",cache:!0,async:!0,success:function(){b.updateFooterCnt(a)},fail:function(){}})},loadBidJS:function(a){a&&(a.bidRedesignTest&&a.bidRedesignJSUrl)&&$.ajax({url:a.bidRedesignJSUrl,dataType:"script",cache:!0,async:!0,success:function(){window.ShoppingCTALayer&&new ShoppingCTALayer({width:"540px"})},fail:function(){}})},loadJsScource:function(a){if(a){var b=document.createElement("script");b.type="text/javascript";b.src=a;b.async=!0;document.getElementsByTagName("head")[0].appendChild(b)}},
|
|
updateMerch:function(a){var b=this;if(a=a.body["vi-merch-abf"]){var c=[];if(a){var d=document.createElement("div");d.innerHTML=a;$.each($(d).find("script"),function(a,b){b&&b.src&&(c.push(b.src),$(b).remove())});$("#vi-merch-abf").html($(d).html());$.each(c,function(a,c){b.loadJsScource(c)})}}},updateFooterCnt:function(a){a.foot&&0<a.foot.length&&$(document).append($(a.foot))},destroyWidget:function(a,b,c){a&&(a=raptor.require("raptor/widgets").get(a))&&a.destroy({removeNode:b,recursive:c})},destroyWidgets:function(a,
|
|
b,c){if(a){var d=widgeParenttMap[a];if(d&&0<d.length)for(var e=0;e<d.length;e++)this.destroyWidgets(d[e],b,c);this.destroyWidget(a,b,c)}},removeDuplicateResources:function(a){var b=document.createElement("div");b.innerHTML=a;$.each($(b).find("script"),function(a,b){b&&b.src&&b.remove()});return $(b).html()},updateMainContainer:function(a){if((a=a.body["vi-container"])&&0<a.length){var b=$("#mainContent"),c=$(b).parent(),b=$(c).parent(),c=c[0].id;widgeParenttMap?this.destroyWidgets(c,!1,!1):this.destroyWidget(c,
|
|
!0,!0);html=this.removeDuplicateResources(a);$(b).html(html);$(b).css("min-height","auto")}},updateStatusMessage:function(a){a.body["vi-status"]&&0<a.body["vi-status"].length?$(".vi-inheritstyl").html(a.body["vi-status"]):$(".vi-inheritstyl").addClass("collapse")},updateShippingContent:function(a){try{a.body.vi_ship_tab&&0<a.body.vi_ship_tab.length?$("#vi-ship-maincntr").html(a.body.vi_ship_tab):$("#shGetRatesDiv").is(":visible")&&$("#shGetRates")&&$("#shGetRates").click()}catch(b){}},updateWatchLink:function(a){try{a.body.vi_addto_watch_link&&
|
|
0<a.body.vi_addto_watch_link.length&&$(".watchLnk").parent().html(a.body.vi_addto_watch_link)}catch(b){}},updateEGDSection:function(a){try{a&&(a.body.vi_egd_section&&0<a.body.vi_egd_section.length)&&$("#vi-egdSection").html(a.body.vi_egd_section)}catch(b){}},updateProductQnAContainer:function(a){try{if(a.body.vi_product_qna_content&&0<a.body.vi_product_qna_content.length){var b=document.createElement("html");b.innerHTML=a.body.vi_product_qna_content;var c=b.getElementsByClassName("qna--wrapper");
|
|
$(".qna--wrapper").html(c&&c[0]&&c[0].innerHTML)}}catch(d){}},positionAddtoListDropdown:function(){"undefined"===typeof $df&&($df={set:function(a,b){a=document.getElementById(a);b=document.getElementById(b);a&&b&&a.parentNode.replaceChild(b,a)}});$df.set("ph_addToListDropdown","addToListDropdown")},updateBtcUrl:function(a){try{a.btcUrl&&$("#smtBackToAnchor").attr("href",a.btcUrl)}catch(b){}},updateDescContent:function(a){try{a.body.vi_desc_content&&0<a.body.vi_desc_content.length&&$("#desc_wrapper_ctr").html(a.body.vi_desc_content)}catch(b){}}}});raptor.defineClass("com.ebay.raptor.vi.utils.Timer.TimerUtils",function(){return{init:function(a){var e=this;e.pubsub=raptor.require("pubsub");e.pubsub.subscribe("OFFSCREEN_BID",function(b){b.sourceOfTimerText=1==b.isOffScreenOnBidLayer?b.sourceOfTimer.text().split(" ")[0]+" "+b.sourceOfTimer.text().split(" ")[1]:b.sourceOfTimer.text();b.timeLeftOffScreenMessage=a.timeLeftOffScreenMessage;b.offScreenMessage=a.offScreenMessage;e.initializeOffScreenTimer(b)})},initializeOffScreenTimer:function(a){var e=
|
|
$("<p />"),b=60,f=a.timeLeftOffScreenMessage,c=a.offScreenMessage,d=a.timerId;e.attr("role","timer").attr("aria-live","polite").attr("id",d).addClass("timer-offscreen");1>a.timeLeft.hour&&($("#"+d)&&0==$("#"+d).length&&a.insertionPoint.append(e),59==a.timeLeft.minute&&59==a.timeLeft.second&&(c=c.replace("##1##",b),$("#"+d).text(f+a.sourceOfTimerText+c)),59>=a.timeLeft.minute&&(0==a.timeLeft.second&&0<a.timeLeft.minute)&&$("#"+d).text(f+a.sourceOfTimerText),0==a.timeLeft.minute&&59==a.timeLeft.second&&
|
|
(c=a.offScreenMessage,c=c.replace("##1##",15),$("#"+d).text(f+a.sourceOfTimerText+c)),0==a.timeLeft.minute&&(45==a.timeLeft.second||30==a.timeLeft.second||15==a.timeLeft.second)&&$("#"+d).text(f+a.sourceOfTimerText))}}});raptor.defineClass("com.ebay.raptor.vi.VolumePricingQuantityPills",function(){return{init:function(c){this.pubsub=raptor.require("pubsub");this.bindClickEventsOnButtons(c)},bindClickEventsOnButtons:function(c){var g=this;if($(".vi-vpqp-pills")&&0<$(".vi-vpqp-pills").length)$(".vi-vpqp-pills").on("click",function(){g.updatePills(this,".vi-vpqp-pills","#qtyTextBox","#prcIsum","#vi-vpo-usave",c);$(".qtyCntVal .errorIcon")&&0<$(".qtyCntVal .errorIcon").length&&($(".qtyCntVal .errorIcon")[0].style.display=
|
|
"none");$("#qtyErrMsg .err")&&0<$("#qtyErrMsg .err").length&&($("#qtyErrMsg .err")[0].style.display="none");trackingUtil("VI_VOLUME_PRICING_QUANTITY_PILLS")});if($("#qtyTextBox")&&0<$("#qtyTextBox").length)$("#qtyTextBox").on("keyup",function(){var d=$("#qtyTextBox")&&$("#qtyTextBox").attr("value"),e=$(".vi-vpqp-pills")&&$(".vi-vpqp-pills")[d-1];g.updatePills(e,".vi-vpqp-pills","#qtyTextBox","#prcIsum","#vi-vpo-usave",c,d)})},updatePills:function(c,g,d,e,i,a,f){var h=a&&a.vpqpModel&&a.vpqpModel.volumePricingOfferModel&&
|
|
a.vpqpModel.volumePricingOfferModel.length,b=$(c)&&$(c).attr("data-index")?$(c).attr("data-index"):h-1,j=a&&a.vpqpModel&&a.vpqpModel.showDiscount;1<=b&&j?($("#prcIsum-lbl")&&0<$("#prcIsum-lbl").length&&$("#prcIsum-lbl").html(a&&a.vpqpModel&&a.vpqpModel.nowLabel),$(".vi-vpo-discount")&&0<$(".vi-vpo-discount").length&&$(".vi-vpo-discount").removeClass("hide")):($("#prcIsum-lbl")&&0<$("#prcIsum-lbl").length&&$("#prcIsum-lbl").html(a&&a.vpqpModel&&a.vpqpModel.unitPriceLabel),$(".vi-vpo-discount")&&0<
|
|
$(".vi-vpo-discount").length&&$(".vi-vpo-discount").addClass("hide"));if(!("0"===f||f>h-1)){if(""===f)return!1;f=a&&a.vpqpModel&&a.vpqpModel.volumePricingOfferModel&&a.vpqpModel.volumePricingOfferModel[b]&&a.vpqpModel.volumePricingOfferModel[b].quantity?a.vpqpModel.volumePricingOfferModel[b].quantity:""}h=a&&a.vpqpModel&&a.vpqpModel.volumePricingOfferModel&&a.vpqpModel.volumePricingOfferModel[b]&&a.vpqpModel.volumePricingOfferModel[b].discountValueStrPercent?a.vpqpModel.volumePricingOfferModel[b].discountValueStrPercent:
|
|
"";j=a&&a.vpqpModel&&a.vpqpModel.volumePricingOfferModel&&a.vpqpModel.volumePricingOfferModel[b]&&a.vpqpModel.volumePricingOfferModel[b].afterDiscountItemPricePerUnitWithSymbol?a.vpqpModel.volumePricingOfferModel[b].afterDiscountItemPricePerUnitWithSymbol:"";a=a&&a.vpqpModel&&a.vpqpModel.volumePricingOfferModel&&a.vpqpModel.volumePricingOfferModel[b]&&a.vpqpModel.volumePricingOfferModel[b].afterDiscountItemPriceDouble?a.vpqpModel.volumePricingOfferModel[b].afterDiscountItemPriceDouble:"";for(b=0;b<
|
|
$(g).length;b++)$(g).removeClass("vi-vpqp-sel");$(d)&&(0<$(d).length&&0<f)&&$(d).attr("value",f);$(i)&&0<$(i).length&&$(i).html(h);$(e)&&0<$(e).length&&($(e).attr("content",a),$(e).html(j));$(c).addClass("vi-vpqp-sel")}}});raptor.defineClass("raptor.vi.StreamLineBinLayer",function(){return{init:function(a){var b=this;b.cfg=a;b.pubsub=raptor.require("pubsub");b.urlParamsFromVI=null;b.strmLineBinInput=null;b.gXoUrl=a.gXoUrl;b.$signinBtn=$("#"+a.signinBtnId);b.$gxoBtn=$("#"+a.gxoBtnId);b.$olayItemImgId=$("#"+a.olayItemImgId);b.$itemImgId=$("#"+a.itemImgId);b.$signinBtn.click(function(){b.handleSigninRedirect()});b.$signinBtn.keyup(b.handleKeyUp);b.$gxoBtn.click(function(){b.handleGxoRedirect()});b.$gxoBtn.keyup(b.handleKeyUp);
|
|
b.olayImgUrl=a.olayImgUrl;b.imgNaUrl=a.imgNaUrl;b.imgNaTxt=a.imgNaTxt;b.roverlUrlForTestTreatment=a.roverlUrlForTestTreatment;b.roverTestXtTagDropCount=0;b.pubsub&&(b.pubsub.subscribe("SHOW_STREAMLINE_BIN_OVERLAY",function(a){b.strmLineBinInput=a;b.openOly()},b),b.pubsub.channel(a.streamLineBinOlyId).subscribe("_OLY_CLS_SVC",function(){b.onClose()},b))},handleKeyUp:function(a){a.stopPropagation();(13===a.keyCode||32===a.keyCode)&&$(this).click()},handleSigninRedirect:function(){this.strmLineBinInput&&
|
|
this.strmLineBinInput.signinRedirectUrl&&(this.dropClientTrackingInfo(this.getSID(44296)),window.location=this.strmLineBinInput.signinRedirectUrl+"&hideGxo=1")},handleGxoRedirect:function(){this.strmLineBinInput&&this.strmLineBinInput.ampUrlParams&&(this.gXoUrl=this.strmLineBinInput.ampUrlParams.quantity?this.gXoUrl+"&quantity="+this.strmLineBinInput.ampUrlParams.quantity:this.gXoUrl+"&quantity=1",this.gXoUrl=this.strmLineBinInput.ampUrlParams.qty?this.gXoUrl+"&qty="+this.strmLineBinInput.ampUrlParams.qty:
|
|
this.strmLineBinInput.ampUrlParams.quantity?this.gXoUrl+"&qty="+this.strmLineBinInput.ampUrlParams.quantity:this.gXoUrl+"&qty=1",this.strmLineBinInput.ampUrlParams.var&&(this.gXoUrl=this.gXoUrl+"&var="+this.strmLineBinInput.ampUrlParams.var),this.strmLineBinInput.bopisURLParam&&(this.gXoUrl+=this.strmLineBinInput.bopisURLParam),this.dropClientTrackingInfo(this.getSID(44297)),window.location=this.gXoUrl+"&_trksid="+this.getSID(44297))},openOly:function(){var a=this.cfg;this.updateOverlayImage();this.dropClientTrackingInfo(this.getSID(44295));
|
|
this.roverlUrlForTestTreatment&&0===this.roverTestXtTagDropCount&&((new Image).src=this.roverlUrlForTestTreatment+"&ts="+(new Date).getTime(),this.roverTestXtTagDropCount++);this.pubsub.publish("_OPEN_OLAY",{cmpId:a.streamLineBinOlyId})},updateOverlayImage:function(){var a=this,b;0<a.$itemImgId.length&&0<a.$olayItemImgId.length&&(a.$olayItemImgId.one("error",function(){a.$olayItemImgId.attr("src",a.imgNaUrl);a.$olayItemImgId.attr("alt",a.imgNaTxt)}),(b=a.$itemImgId.attr("src"))&&b!==a.olayImgUrl?
|
|
(a.$olayItemImgId.attr("src",b),a.$olayItemImgId.attr("alt",a.$itemImgId.attr("alt"))):a.$olayItemImgId.attr("src",a.olayImgUrl))},onClose:function(){this.dropClientTrackingInfo(this.getSID(44298))},dropClientTrackingInfo:function(a){$(document).trigger("rover",{sid:a})},getSID:function(a){return"p2047675.l"+a}}});raptor.defineClass("raptor.vi.InsCalcOverlay",function(){return{init:function(b){var a=this;a.cfg=b;a.loadStatus="INITIAL";a.linkIdFocus=null;a.pubsub=raptor.require("pubsub");a.msgs=raptor.require("com.ebay.raptor.vi.MsgHandler");a.pubsub&&(a.pubsub.channel(b.insCalcOlyId).subscribe("_OLY_CLS_SVC",function(b){a.setFocus(b)},a),a.pubsub.subscribe("_INS_CALC_CLOSE_OLAY",function(b){a.closeOly(b)},a),a.pubsub.subscribe("_INS_CALC_OPEN_OLAY",function(b){a.setFocusAndOpenOly(b)},a))},setFocusAndOpenOly:function(b){this.linkIdFocus=
|
|
b.inslinkId;this.openInsCalcOly(b)},openInsCalcOly:function(b){var a=this.cfg,c=$("#"+a.insCalcTrbrId),d=$("#"+a.insCalcErrId);this.msg=b;"INITIAL"!==this.loadStatus?(this.pubsub.publish("_INS_CALC_OLAY_RESET"),this.pubsub.publish("_OPEN_OLAY",{cmpId:a.insCalcOlyId})):(c.show(),d.hide(),this.pubsub.publish("_OPEN_OLAY",{cmpId:a.insCalcOlyId}),b=a.insCalcUrl+"&cb=?",this.request(b))},request:function(b){var a=this,c=a.cfg;a.loadStatus="IN_PROGRESS";$.ajax({url:b,timeout:c.insCalcTimeout,crossDomain:!0,
|
|
dataType:"jsonp",success:function(b){a.loadHtml(b)},error:function(b){a.error(b)}})},loadHtml:function(b){var a=this.cfg,c=$("#"+a.insCalcTrbrId),d=$("#"+a.insCalcOlyDivId);(!b||!b.html||""==b.html)&&this.error(b);d&&(c.hide(),d.html(b.html),d.show(),this.pubsub.publish("_OPEN_OLAY",{cmpId:a.insCalcOlyId}),this.loadStatus="LOADED")},error:function(b){var a=this.cfg,c=$("#"+a.insCalcTrbrId);$("#"+a.insCalcOlyDivId);var d=$("#"+a.insCalcErrId);if(!b||!b.html||""==b.html)c.hide(),d.show(),this.pubsub.publish("_OPEN_OLAY",
|
|
{cmpId:a.insCalcOlyId}),this.loadStatus="INITIAL"},setFocus:function(){this.linkIdFocus&&0<$("#"+this.linkIdFocus).length&&$("#"+this.linkIdFocus).focus()},closeOly:function(){this.pubsub.publish("_CLOSE_OLAY",{cmpId:this.cfg.insCalcOlyId})}}});raptor.defineClass("ebay.viewItem.BuyerFeedback",function(){return{constants:{feedbackContId:".byrfdbk_cont",feedbackRtContId:"#byrfdbk_rgt_cont",feedbackUlId:"#byrfdbk_rgt_cont_ul",leftNavFltrClz:".byrfdbk_tot_pos",seeAllBtnClz:".byrfdbk_rt_btn",feedbackExpandId:"#byrfdbk_expnd",atfLinkId:"#byrfdbk_atf_lnk",btfContId:"#byrfdbk",feedbackSelClz:".byrfdbk_sel",feedbackSelVarClz:".byrfdbk_sel_var",feedbackMr:".byrfdbk_sel_mr",modalNavFltrClz:".byrfdbk_modal_tot_pos",modalContId:".byrfdbk_modal_cont",
|
|
closeBtnId:".clz"},init:function(c){function b(f,c){return function(){var e=$(this),b=e.attr("data-p"),d=parseInt(e.attr("data-v"),10),g=e.closest(a.constants.modalContId);0>=d||g.hasClass(b)||(d=$(a.constants[f]),g=d.hasClass(b),d.removeClass("POSITIVE NEGATIVE NEUTRAL"),g||(d.addClass(b),c&&(e=e.find(".byrfdbk_tot_pos_txt").text(),d.find(a.constants.feedbackSelVarClz).text(e))),a.track(d))}}var a=this,h=$(this.constants.leftNavFltrClz);a.pubsub=raptor.require("pubsub");$(a.constants.feedbackMr).on("click",
|
|
function(){var f=$(this),b=f.closest(a.constants.feedbackContId);b.is(".POSITIVE,.NEGATIVE,.NEUTRAL")&&b.removeClass("POSITIVE NEGATIVE NEUTRAL");a.track(f)});h.on("click",b("feedbackContId",!0));$(a.constants.modalNavFltrClz).on("click",b("modalContId"));$(a.constants.modalNavFltrClz).on("keypress",function(a){if(32===a.keyCode||13===a.keyCode)a.preventDefault(),this.click()});$(a.constants.atfLinkId).on("hover",function(){var b=$(this);b.off("mouseenter mouseleave");a.track(b.find("#byrfdbk_atf_lnk_sm"))});
|
|
$(a.constants.atfLinkId).on("click",function(b){if($(b.target).hasClass("byrfbdk_seller_link"))return!0;c.modalEnabled?$("html body").css({height:0,overflow:"hidden"}):$(a.constants.btfContId)[0].scrollIntoView();a.track($(this))})},track:function(c){var b=c?c.attr("trk"):null;b&&($(document).trigger("rover",{sid:b}),c.removeAttr("trk"))}}});raptor.defineClass("ebay.viewItem.Scandal",function(){var b=0;return{init:function(a){this.cfg=a;this.adsMap=a.adsMap;this.cfg&&this.cfg.collapseEmptyAdsAfterFetchCall&&(this.cfg.emptyAvipLeaderBoard&&$("#scandal100938").hide(),this.cfg.emptyCvipLeaderBoard&&$("#scandal100939").hide());this.adsMap&&this.callAds(this.adsMap)},callAds:function(a){try{for(var c={},b=this.cfg&&this.cfg.adsPbPids?this.cfg.adsPbPids:[100562,100563,100564,100565,100566,100567,100568,100610,100916,100917,100918,100919,100920,
|
|
100921,100922,100923,100938,100939,100726,100727],d=0;d<b.length;d++){var e=b[d];this.isAdAvailable(e)&&(c[e]=a[e].ad)}window.scandalAds=window.scandalAds||[];window.scandalAds.push(c)}catch(f){}},trackingParams:function(a){a&&a.scandal_dur&&(b+=parseInt(a.scandal_dur));if("undefined"!==typeof $trk&&$trk.image&&$trk.onRover){var c=$trk.image;$trk.image=jQuery("<img/>").css("display","none");$trk.onRover(null,a);$trk.image=c}raptor.require("ebay.profiler.Profiler").addParam("i_13i",b)},getPubTypeForAd:function(a){return 0<=
|
|
a&&this.cfg&&this.cfg.adsPbType&&a<this.cfg.adsPbType.length&&this.cfg.adsPbType[a]?this.cfg.adsPbType[a]:2},isAdAvailable:function(a){return this.adsMap&&this.adsMap[a]&&this.adsMap[a].ad&&null!==this.adsMap[a].ad.ad?!0:!1}}});raptor.defineModule("com.ebay.raptor.vi.tracking.SitespeedTimers",function(e){return{init:function(b){var a=this;a.cfg=b;a.scrollx=0;a.scrolly=0;a.Profiler=e.require("ebay.profiler.Profiler");"undefined"!=typeof oGaugeInfo&&(a.min_scroll_time_=200,a.scroll_timer_=null,a.last_scroll_time_=0,a.winH=$(window).height(),a.Profiler.addParam("i_1i",a.winH+$(document).scrollTop()),a.Profiler.addParam("i_0i",a.winH),$(window).load(function(){a.loadHandler()}),$(window).scroll(function(){a.lazy_onscroll()}),
|
|
"function"==typeof window.postMessage&&(window.addEventListener?window.addEventListener("message",function(){a.loadHandler()},!1):window.attachEvent("onmessage",function(){a.loadHandler()},!1)),a.chunkTimers(),a.addEventListener())},addEventListener:function(){try{var b=this;b.Profiler=e.require("ebay.profiler.Profiler");if("undefined"!=typeof oGaugeInfo)$(document).on("BflTimer",function(a,d){d&&"placebid"===d.type&&b.Profiler.addParam("i_16i",d.diff);$(document).trigger("rover",d)})}catch(a){window.console&&
|
|
window.console.log(a)}},loadHandler:function(){var b=this.cfg.itemId,a=$(document).width(),c=$(document).height();this.Profiler.addParam("i_2i",a+"|"+c+"^"+b)},scrollHandler:function(){var b=this.winH+$(document).scrollTop();this.scrolly<b&&(this.bw=this.scrolly=b);this.Profiler.addParam("i_1i",this.scrolly)},lazy_onscroll:function(){var b=this;if(!b.scroll_timer_){var a=(new Date).getTime(),c=b.min_scroll_time_;a-b.last_scroll_time_>b.min_scroll_time_&&(c=0);b.scroll_timer_=window.setTimeout(function(){b.last_scroll_time_=
|
|
(new Date).getTime();b.scrollHandler();b.scroll_timer_=null},c)}},chunkTimers:function(){topEnd&&(centerStart&&0!=topEnd&&0!=centerStart)&&this.Profiler.addParam("i_5i",centerStart-topEnd)}}}); |