raptor.defineModule("com.ebay.raptor.vi.AjaxUtil",function(){return{getJSON:function(b,a,c,e){var d=null;b&&(d=$.getJSON(b+"&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("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)},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"})))}(a.bmlPromotionMsg||a.ebayIncentivesMsg||a.ebayBucksMsg||a.nectarMainMsg)&&this.showIncentivesDiv();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"))}},loadHtml:function(a){var b=this.conf;a.nodes&&0<a.nodes.length&&(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.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");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="",g=!1,f=0;f<e.length;f++)e[f].disabled&&(e[f].watchList?!e[f].full&&!c.isItemEnded&&b.push({listId:e[f].listId,listName:e[f].listName,isWatchList:!0,isWishList:!1,listURL:c.myEbayWatchListUrl}):(h=c.myEbayOtherListBaseUrl+"&tagname="+e[f].listName+"&tagId="+e[f].listId,g=e[f].listId==c.wishListId?!0:!1,b.push({listId:e[f].listId,listName:e[f].listName,isWatchList:!1,isWishList:g,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 g=0;g<d.length;g++)if(!d[g].watchList&&(e=c.userListModel.variationMap,null!=e)){if(null==e[this.variationId])this.disableEnableList(d[g].listId,!1,!1);else{var f=!1;0<=jQuery.inArray(d[g].listId,e[this.variationId])&&(f=!0);this.disableEnableList(d[g].listId,f,!1);f&&(e=c.myEbayOtherListBaseUrl+
"&tagname="+d[g].listName+"&tagId="+d[g].listId,h=d[g].listId==c.wishListId?!0:!1,b.push({listId:d[g].listId,listName:d[g].listName,isWatchList:!1,isWishList:h,listURL:e}))}this.disableEnableList(d[g].listId,f,!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)});$("#"+b.drpdwnListId).click(function(b){a.handleDropdownClick(b)});b.addToNewDisabled?$("#"+b.atnId).bind("click",function(b){a.toggleDropDown(b)}):
($("#"+b.atnId).bind("click",function(){a.showCreateNewOverlay()}),a.attachAddToNewListEvents())},handleAddToWatchButtonClick:function(a){this.isWatchDisabled?this.toggleDropDown(a):(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()}),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()}),b.openDropDown=!0)},checkDropDownWidth:function(){var a=this.conf;$("#"+
a.drpdwnLayerId).css("width","auto");$.browser.msie&&8>$.browser.version&&$("#"+a.drpdwnLayerId).css({position:"relative",visibility:"hidden"});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("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+"^VARIATION":b;else var d=this.variationId?c.addToWatchUrl+"&var="+this.variationId+"&entityInfo="+this.variationId+"^VARIATION":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})):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+
"^VARIATION":a.myEbayBaseUrl,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){this.ListIsWatch=!1;if(a=this.getRemoveListURL(a.listDetails))this.sendRequest(a),this.ListIsWatch&&this.setWatchersContent(-1,parseInt($(this.conf.watchersElmSelector+" .vi-buybox-watchcount").html()))},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^"+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){var c=this,d=c.conf;b?$.ajax({url:a,dataType:"json",cache:!1,beforeSend:function(a){a.setRequestHeader("srt",{toString:function(){return d.addAjaxCSRF}})},success:function(){c.processAjaxResponse.apply(c,arguments)}}):c.ajaxUtil.getJSON(a,c.processResponse,c)},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?(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=this.conf.watchersLabel,d=d.replace("-1",c);1>=c&&(d=this.conf.watcherLabel,d=d.replace("-1",c));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 g=
a.listDetails[h];g.maxLimitReached&&this.handleListMaxError(g,!1);var f="";this.isWishRequest?(this.disableEnableList(b.wishListId,!0,!1,b.addedToWishListTxt),f=$("div#"+b.drpdwnListId+'> ul > li >a[i="'+b.wishListId+'"]').parent(),e=b.myEbayOtherListBaseUrl+"&tagname="+g.listName+"&tagId="+g.listId,d.push({listId:g.listId,listName:g.listName,isWatchList:!1,isWishList:!0,listURL:e})):(this.disableEnableList(g.listId,!0,!1,b.statusMsgTxt.replace("$",this.limitCharText(a.listDetails[0].listName))),
f=$("div#"+b.drpdwnListId+'> ul > li >a[i="'+g.listId+'"]').parent(),e=b.myEbayOtherListBaseUrl+"&tagname="+g.listName+"&tagId="+g.listId,d.push({listId:g.listId,listName:g.listName,isWatchList:!1,isWishList:!1,listURL:e}));$($("#"+b.drpdwnListId+">ul").children()[0]).after(f)}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;$("#"+e.atlBtnId).html('<a href="javascript:;">'+e.atwAltCaption+"</a>");try{$("#vi_oly_atwlstovly .clz").trigger("click")}catch(h){}}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,$("#"+e.atlBtnId+" > a").html(e.btnDefDispName)),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;$("#"+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())?(a=a.myEbayBaseUrl+"&tagName="+c.val(),this.variationId&&(a+="&var="+this.variationId+"&entityInfo="+this.variationId+"^VARIATION"),this.sendRequest(a+b)):(c.val(a.addtoNewInputTxt),this.showDefCreatNewErr())},
createNewListResponseHandler:function(a){for(var b=this.conf,c=b.isUserSignedIn?!0:!1,d=0,e=[],h="",g=0;g<a.listDetails.length;g++){var f=a.listDetails[g];if(f.itemAdded){var h=this.listElemId="atl_"+f.listId,i=b.addtoReplaceTxt.replace("$",f.listName),i=this.limitCharText(i);b.msku&&this.variationId&&this.updateVariationMap(f.listId,!1);$($("#"+b.drpdwnListId+">ul").children()[0]).after("<li><a n="+f.listName+" i="+f.listId+" id="+h+" ds='true' class='ul-ds' href=javascript:;>"+i+"</a></li>");d++;
h=b.myEbayOtherListBaseUrl+"&tagname="+f.listName+"&tagId="+f.listId;e.push({listId:f.listId,listName:f.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(f.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(b){var a=this;a.conf=b;a.pubsub=raptor.require("pubsub");a.ajaxUtil=raptor.require("com.ebay.raptor.vi.AjaxUtil");a.msgs=raptor.require("com.ebay.raptor.vi.MsgHandler");a.pubsub&&a.pubsub.subscribe(a.msgs("ADD_TO_WATCH_BTN"),function(b){a.toggleWatchLink(b.status)},a);a.attachClickEvent()},toggleWatchLink:function(b){var a=this.conf;b?$("#"+a.linkTopId).css("display","none"):$("#"+a.linkTopId).css("display","inline")},
attachClickEvent:function(){var b=this;$("#"+b.conf.linkTopId).click(function(){b.makeWatchRequest();return!1})},makeWatchRequest:function(){var b=this.conf;this.pubsub.publish(this.msgs("ADD_TO_WATCH_LNK"),{status:!0,addRequest:!0,watchLink:b.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);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(/&amp;/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(/&amp;/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(),$("#atcLnk").hide()):($("#"+a.cartBtnId).hide(),
$("#"+a.cartBtnId).parent().hide(),$("#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.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){var b=this;b.conf=a;b.showTopCompMsg=!!a.showTopCompModel;b.fldsSel=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.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.expCount=-1;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.hsnAncId).click(function(){b.setHsnTsn()});
$("#"+a.mainId+"slctBtn").click(function(){b.htOlySelect()});$("#"+a.mainId+"htCancel").click(function(){b.htOlyCancel()});a.istecdoc&&$.ajax({type:"GET",dataType:"script",async:!1,url:a.tecdocAuthUrl+a.sellerid,success:function(b){"true"==b&&$("#copyrt").html(a.tecdocCr)}})},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="",c=0;c<a.length;c++){var d=a[c].split(":");1<d.length&&"Plat_Gen"!=d[0]&&(b+=a[c]+"|")}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()},displayFilters:function(a){if("SUCCESS"===a.status.name){this.clearTable(this.conf.slctId);var b=a.displayNames,c=a.propertyNames,a=a.data,d=c.length;this.srchFlds=c;var e=document.getElementById(this.conf.slctId);if(e){var g=e.insertRow(0);
g.style.fontWeight="bold";var f="77"==this.conf.site?1:0;for(f;f<b.length;f++){var h=g.insertCell("77"==this.conf.site?f-1:f),i=b[f],j=document.createElement("label");"3"==this.conf.site||"15"==this.conf.site?(2>=f&&$(h).addClass("intlrq"),3<=f&&(i+=" "+this.conf.optionalTxt),"Variant"===i&&(h.style.padding="0 10px 0 0")):"77"==this.conf.site&&(3>=f&&$(h).addClass("intlrq"),4<=f&&(i+=" "+this.conf.optionalTxt));j.htmlFor=c[f];j.innerHTML=i;h.appendChild(j)}g=e.insertRow(1);this.createFilters(g,c);
this.findIfBoats(a);this.isCompLoaded=!1;this.fillFilters(a);"77"==this.conf.site?h=g.insertCell(d-1):(h=g.insertCell(d),h.colSpan="2",h.style.padding="10px 0 10px 0");h.style.paddingRight="10px";h.style.verticalAlign="top";h.appendChild(this.buildGo());(g=document.getElementById(this.srchFlds[f]))&&0<g.selectedIndex&&this.makeNavRelCall(g)}this.makeFirstCall();this.conf.myVehiclesOn&&100!=this.conf.site&&($("#"+this.conf.mainId+"vehfltr")&&g)&&(g.disabled=!0);this.initz=!0;this.conf.byApp&&!this.SP?
this.showHide(["dthr"],!1):this.showHide(["dthr"],!0);this.buildAddCB(e.parentNode)}else this.serviceErr()},findIfBoats:function(){var a=this.srchFlds,b="77"==this.conf.site?1:0;this.isBoats=!1;for(b;b<a.length;b++)"B_Component"==a[b]&&(this.isBoats=!0)},setHsnTsn:function(){var a=this,b=a.srchFlds,c=$("#"+a.conf.mainId+"goBtn"),d=$("#"+a.conf.mainId+"Go");a.resetSrchFldFilters();c&&d&&(c.attr("disabled",!0),d.attr("disabled",!0));a.showHide(["goThrbr"],!0);a.showHide(["goSpan"],!1);for(d=1;d<b.length;d++){var e=
document.getElementById(b[d]);e.selectedIndex=0;e.disabled="1"==d?!1:!0}var g=document.getElementById(a.conf.mainId+"hsnBox"),f=document.getElementById(a.conf.mainId+"tsnBox");g.value="HSN";f.value="TSN";g.style.color="#999";f.style.color="#999";g.onfocus=function(){"HSN"==g.value&&a.emptyTextBox(this)};f.onfocus=function(){"TSN"==f.value&&a.emptyTextBox(this);""!=g.value&&"HSN"!=g.value?(c.attr("disabled",!1),c.click(function(){a.makeHTPageCall(null,!0)})):c.attr("disabled",!0)}},handleFilters:function(){var a=
this.srchFlds=this.conf.propNames,b=this.conf.dsplNames,c=a.length;if("100"==this.conf.site&&848!=this.conf.catalogId)for(var d=0;d<a.length;d++)"Submodel"==a[d]?a[d]=this.conf.propNames[d]="Trim":"Engine - Liter_Display"==a[d]&&(a[d]=this.conf.propNames[d]="Engine");var e=document.getElementById(this.conf.slctId);if(e){var g=e.insertRow(0);g.style.fontWeight="bold";for(d=0;d<b.length;d++){var f=g.insertCell(d),h=b[d],i=document.createElement("label");i.htmlFor=a[d];i.innerHTML=h;f.appendChild(i)}g=
e.insertRow(1);this.createFilters(g,a);this.buildAddCB(e.parentNode);f=this.conf.startYear;e=this.conf.endYear;if(b=document.getElementById(a[0]))for(d=1;e>=f;e--)h=new Option(e,e),b.options[d]=h,d++,this.preSelect(b,h);for(d=1;d<a.length;d++)f=document.getElementById(a[d]),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=g.insertCell(c);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.style.marginTop="-2px";b.value="100"==a.conf.site?b.name=a.conf.goTxt:b.name=a.conf.checkComptxt;b.disabled=!0;if("77"==a.conf.site){var c=document.getElementById(a.conf.mainId+"htfltr");c&&c.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)};return b},buildAddCB:function(a){if((-1==this.expCount||this.expCount<this.conf.myVehicleMaxNum)&&this.conf.isUserSignedIn&&this.conf.showExplicitChbox&&1700!=this.conf.catalogId){var b=document.createElement("input");b.type="checkbox";b.name="name";b.value="value";b.id="expCB";var c=document.createElement("div");c.id="expCBLb";c.innerHTML=this.conf.explicitChboxLabel;a.appendChild(b);a.appendChild(c);b.checked=!0}},makePageCall:function(a,b,c,d){b&&(this.showAll=!1);$("#"+this.conf.pgnId).hide();
b=this.getUrl(!1,this.showAll,this.CREQ,c);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";d&&(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 c=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 d=$("li[value=13]"),e=$("li[value=20]");$("li[value=11]").css("display","none");$(d).removeClass("op").addClass("opd hrl");$(e).removeClass("op").addClass("opd");$(d).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(!c.isUserSignedIn||!a.E)$("li[value^=20]").css("display","none"),$(d).css("padding-top","10px"),$(d).removeClass("hrl");if(c.isUserSignedIn)for(d=0;d<parseInt(c.expCount);d++)this.setVehicles(d,a.E,b,!0);for(d=0;d<parseInt(c.impCount);d++)this.setVehicles(d,a.I,b,!1);this.valFromURL&&0!=this.valFromURL&&this.selectOption(this.valFromURL)}},selectOption:function(a){for(var b=-1,c=1;c<=
this.conf.impCount;c++){var d=$("li[value=30"+c+"]").html();if(""!=d&&-1!=a.search(d)){b=c;break}}-1!=b&&$("li[value=30"+b+"]").addClass("sel")},isNull:function(a){return null==a||"null"==a?!0:!1},setVehicles:function(a,b,c,d){var e=this,g,f="",h="";g=d?$("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]){for(var i=3;5>=i;i++)e.isNull(b[a][i])||(h+=b[a][i]+" ",f+=c[i-3]+":"+b[a][i]+"|");"100"==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]?"":c[3]+":"+b[a][7];e.isNull(b[a][6])?e.isNull(b[a][7])||(h+=b[a][7]+" "):h+=b[a][6]+" ";e.isNull(b[a][8])||(f="100"==e.conf.site&&848!=e.conf.catalogId?f+("|Engine - Liter_Display:"+b[a][8]):f+("|"+c[4]+":"+b[a][8]));10>b[a].length?e.isNull(b[a][8])||(h+=b[a][8]+" "):"100"==e.conf.site&&848!=e.conf.catalogId&&!e.isNull(b[a][9])?(h+=b[a][9]+" ",f+="null"==b[a][9]?"":"|Engine:"+b[a][9]):e.isNull(b[a][8])||(h+=
b[a][8]+" ")}else if(b[a][0]){i="77"==e.conf.site?1:0;for(i;i<=c.length;i++){var j=b[a]["77"==e.conf.site?i+2:i+3];e.isNull(j)||(f+=c[i]+":"+j+"|",h="--"==j?h+"[--]":h+j,!e.isNull(b[a][i+1])&&"undefined"!=b[a][i+1]&&(h+=" "))}}var f=encodeURIComponent(f),k=b[a][2],l=b[a][1];$(g).html(h);$(g).attr("u",f);"null"!=k&&"null"!=l&&($(g).attr("vt",k),$(g).attr("si",l),"0"==l?$(g).attr("title",e.conf.dsContent):"3"==k&&$(g).attr("title",e.conf.mcContent));"1"==l&&"3"!=k?($(g).bind("click",function(){e.makeSavedVehPageCall(f,
h,d,k,l)}),$(g).addClass("plr")):$(g).removeClass("op").addClass("opa")}else $(g).css("display","none")},makeSavedVehPageCall:function(a,b,c,d,e){var g=this.getUrl(!1,!0,this.CREQ);if("100"!=this.conf.site||void 0==this.conf.productId||null==this.conf.productId||""==this.conf.productId)g+="&pn="+this.getPropertyNames(this.propNames);g=g+"&page=1"+("&sfp="+a);g+="&_trksid="+this.conf.trksid;this.showAll=!1;this.recentValue=b;if(this.isSavedVehClkd=c)this.recVal=b,this.recSfp=a,this.vehtype=d,this.si=
e;this.trgTopCompUpd=!0;this.makeCall(g,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,b="77"==this.conf.site?1:0;firstFieldIndex=b;if(null!==a)for(b;b<a.length;b++){var c=document.getElementById(a[b]);c&&(c.selectedIndex=0);c.disabled="3"==this.conf.site||"15"==this.conf.site||"77"==this.conf.site?
firstFieldIndex==b?!1:!0:c?c.index:0<b}this.setButtonState()},showHide:function(a,b){for(var c=this.conf.mainId,d=0;d<a.length;d++){var e=document.getElementById(c+a[d]);e&&(e.style.display=b?"none":"")}},showHideWithID:function(a,b,c){for(var d=0;d<a.length;d++){var e=document.getElementById(c+a[d]);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)},setMyVehicleDropDown:function(a,b,c){var d="",e="",g=this.srchFlds,f="",
h="",i=this.conf;if(null!==g&&this.uniqueVehicle){if(a)e=this.recVal,d=this.recSfp,f=this.vehtype,h=this.si,this.recentValue=e;else if(null!=b&&null!=c)e=c,h=f="1",d=encodeURIComponent(b);else{for(f=0;f<g.length;f++)if((h=document.getElementById(g[f]))&&0!==h.selectedIndex){0!==f&&(d+="|",e+=" ");b=h.options[h.selectedIndex].value;if("100"==this.conf.site&&"Trim"===g[f]&&848!=i.catalogId){if(c=this.isFieldsMapped1to1("Submodel","Trim"),-1!=c){var j=document.getElementById("Submodel");null!=j&&void 0!=
j&&(d+="Submodel:"+j.options[c].value+"|")}}else"100"==this.conf.site&&("Engine"===g[f]&&848!=i.catalogId)&&(c=this.isFieldsMapped1to1("Engine - Liter_Display","Engine"),-1!=c&&(j=document.getElementById("Engine - Liter_Display"),null!=j&&void 0!=j&&(d+="Engine - Liter_Display:"+j.options[c].value+"|")));d+=h.id+":"+b;e+=b}h=f="1";d=encodeURIComponent(d);this.recentValue=""}g=this.iLen;this.iLen==i.impCount?g=i.impCount:g=this.iLen+1;this.iLen=g;b=1;c=!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;c=!0;break}}if(1==b&&!c){$($("#"+i.mainId+"ieveh .crtval").children()[1]).html(e);for(c=1;c<=g;c++){var b=$("li[value=30"+c+"]"),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",d);j&&($(b).removeClass("opa").addClass("op plr"),$(b).attr("title",""));"null"!=f&&"null"!=h&&($(b).attr("vt",f),$(b).attr("si",h),"0"==h?($(b).attr("title",i.dsContent),$(b).removeClass("op plr").addClass("opa")):
"3"==f&&($(b).attr("title",i.mcContent),$(b).removeClass("op plr").addClass("opa")));$(b).css("display","");e=n;d=k;f=l;h=m}}else 1!=b&&this.changeInternalDDOrder(b);for(d=1;d<=g;d++)this.setClickEvnt(d,a),b=$("li[value=30"+d+"]"),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 c=$("li[value=30"+b+"]"),d=$(c).hasClass("opa"),
e=$(c).attr("u"),g=$(c).attr("vt"),f=$(c).attr("si"),h=$(c).html();$(c).html(nVal);$(c).attr("u",nUrl);d&&($(c).removeClass("opa").addClass("op plr"),$(c).attr("title",""));"null"!=nType&&"null"!=nSInfo&&($(c).attr("vt",nType),$(c).attr("si",nSInfo),"0"==nSInfo?($(c).attr("title",this.conf.dsContent),$(c).removeClass("op plr").addClass("opa")):"3"==nType&&($(c).attr("title",this.conf.mcContent),$(c).removeClass("op plr").addClass("opa")));nVal=h;nUrl=e;nType=g;nSInfo=f}},resetMyVehicleDD:function(){for(var a=
1,b=1;b<=this.conf.impCount;b++){var c=$("li[value=30"+b+"]").html();if(this.recentValue.replace(/\s/g,"")==c.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 c=this,d=$("li[value=30"+a+"]"),e=$(d).html(),g=$(d).attr("vt"),f=$(d).attr("si");$(d).unbind("click");"1"==f&&"3"!=g&&$(d).bind("click",function(){c.makeSavedVehPageCall($(d).attr("u"),e,!1,g,f)});b?$("li[value=301]").removeClass("sel"):($(d).removeClass("sel"),
$("li[value=301]").addClass("sel"),$("li[value^=20]").removeClass("sel"))},showHideEle:function(a,b){for(var c=0;c<a.length;c++){var d=document.getElementById(a[c]);d&&(d.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 c=b.substring(0,40);$("#readNotesId").val(b);$("#notesSp").html(c).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)},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?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?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.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"],!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"],
!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,c=this.conf.mainId;a=this.conf.nullBaseURL+"?_from=R40&_nkw="+this.nullReccoKeyword;if(this.selVel&&""!=this.selVel){a+="&selvel="+this.selVel;var d="",e=this.selVel.split("~");
if(1<e.length)for(var g=0;g<e.length;g++)"null"!=e[g]&&(0!=g&&(d+=","),d+=g+1);a+="&selfil="+encodeURIComponent(d)}b&&(a+="&_sacat="+b);"100"==this.conf.site&&(a+="&_vxp=mtr");$("#nullRecco").attr("href",a);$("#nullRecco").click(function(){$(document).trigger("rover",{sid:"p2047675.l4092"})});$("#"+c+"norecco").css({color:"#333","padding-left":"5px"});$("#"+c+"cerr > p > span.clr").append($("#"+c+"norecco"));$("#"+c+"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 c=$("div#"+b.conf.pgnId+"> div > span.pg-cs"),a=$("div#"+b.conf.pgnId+"> div > span.pg-m"),d=a.children().size(),e=0;e<=d;e++)$($($(a).children()[e]).children()[0]).unbind("click");if(10<tp&&13>d){for(e=11;e<=tp;e++)$('<span class="pg-nm pg-nmp"><a href="javascript:;">'+e+"</a></span>").insertBefore(".pg-cdr");d=$(a).children().size()}for(e=tp+1;e<d-1;e++)$(a.children()[e]).hide();
$(c).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],d=$($($(a).children()[d-1]).children()[0]).children()[0],g=$(".pg-cdl").children()[0],f=$(".pg-cdr").children()[0];if(10<tp){if(11>cp){for(var h=0;10>=h;h++)c=$(a).children()[h],$(c).css("display","");for(h=11;h<=tp;h++)c=$(a).children()[h],$(c).css("display","none")}if(1!=cp&&1==cp%10){for(var h=tp>=cp+9?cp+
9:tp,i=cp;i<=h;i++)c=$(a).children()[i],$(c).css("display","");for(h=1;h<cp;h++)c=$(a).children()[h],$(c).css("display","none")}if(cp&&0==cp%10){for(h=cp;h>=cp-9;h--)c=$(a).children()[h],$(c).css("display","");for(h=cp+1;h<=tp;h++)c=$(a).children()[h],$(c).css("display","none")}}1==cp?b.makeLeftArrDisabled(e,g):(b.makeLeftArrEnabled(e,g),$(g).bind("click",function(){b.makePageCall(cp-1,!1)}));cp!==tp?($(f).bind("click",function(){b.makePageCall(cp+1,!1)}),b.makeRightArrEnabled(d,f)):(b.makeRightArrDisabled(d,
f),b.makeLeftArrEnabled(e,g));for(e=1;e<=tp;e++)c=$(a).children()[e],d=$(c).children()[0],$(c).removeClass("pg-cr").addClass("pg-nm"),d||($(c).html(""),$(c).append('<a href="javascript:;">'+e+"</a>")),cp==e?($(c).removeClass("pg-nm").addClass("pg-cr"),$(d).css("color","#000"),$(d).css("text-decoration","none"),b.disableAnchor(d,!0)):($(d).css("color","#777777"),$(d).css("text-decoration","none"),b.enableAnchor(d,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,c){$(a).attr("href","javascript:;");c||(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 c=$("div#"+b.conf.pgnId+"> div > span.pg-m"),c=$(c).children()[a];(c=$(c).children()[0])&&$(c).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)},drawTable:function(a,b,c){var d=this,e=b.length,g=document.getElementById(d.conf.mainId+"ctbl");g.className=100==d.conf.site?"fTbl":"fTblUK";for(var f=0;f<c.length;f++){for(var h=c[f],i=0;i<e;i++)if(0==i)var j=h[b[i]];
if(j&&null!==j[0]&&0<j[0].length)break}f=g.insertRow(0);f.id=100==d.conf.site?"fTblFTr":"fTblFTrUK";for(h=0;h<e;h++){var i=f.insertCell(h),k=a[h];if(0==h){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=d.conf.notesAlertMsg,k.className="ntsClr",i.appendChild(k))}else i.innerHTML=k;0===h&&(i.id="fTblFTd")}for(j=0;j<c.length;j++){f=g.insertRow(j+
1);k=c[j];for(h=0;h<e;h++)if(i=f.insertCell(h),0===h&&(i.id="fTblFTd"),l=k[b[h]],0==h)if(l&&null!==l[0]&&0<l[0].length){var m=document.createElement("SPAN");m.id="ICN"+j;m.notes=l;l=m.notes[0];20<l.length&&(l=l.substr(0,20)+"...");m.onmouseover=function(){$(document).trigger("rover",{sid:"p2047675.l1559"});d.showNotes(this.notes,this.id)};m.innerHTML=l;i.appendChild(m);i.style.width="14%"}else i.innerHTML="&nbsp;",i.style.width="5%";else 100==d.conf.site&&"Parts Diagram"==a[h]?l&&null!==l[0]&&0<l[0].length?
(m=document.createElement("A"),m.innerHTML='<span class="gspr oeZoom">&nbsp;</span>',m.style.textDecoration="none",i.id="DIA"+j,i.oeUrl=l[0],i.refNo=l[1],i.qty=l[2],i.onclick=function(){$(document).trigger("rover",{sid:"p2047675.l4026"});d.showDiagram(this.oeUrl,this.id);!d.isNull(this.refNo)&&""!=this.refNo?($("#asmbl").html(this.refNo),$("#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());!d.isNull(this.qty)&&""!=this.qty&&0<1*this.qty?($("#asmblQty").html(1*this.qty),$("#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()},i.appendChild(m),i.style.width="10%",i.style.textAlign=
"center",i.className="pDiaTd"):(i.innerHTML="&nbsp;",i.style.width="10%"):i.innerHTML=l?l:"All"}d.pubsub.publish("_CLOSE_OLAY",{cmpId:d.conf.olyId})},showDiagram:function(a,b){var c=this.getChild(this.conf.diaOvl),d=$("#ovlMainImg");this.pubsub.publish("_CLOSE_OLAY",{cmpId:this.conf.diaOvl});$("#mImg").find(".zoomIcon").remove();$("#mImg").find(".zoomImg").remove();c&&c.conf&&(d.hide(),this.buildDiagramImage(a),$("#ovlMainImg").parent().zoom({url:a}),c.conf.trigger=b,c.show($("#"+c.conf.trigger)))},
buildDiagramImage:function(a){var b=this,c=document.createElement("img"),d=$("#ovlMainImg"),e=$("#ovlThrImg");c.src=a;e.attr("src","http://p.ebaystatic.com/aw/pics/globalAssets/imgLoading_30x30.gif");e.show();c.complete||4===c.readyState?(d.attr("src",a),b.findnSetImageSize(a),e.hide(),d.show()):c.onload=function(){d.attr("src",a);b.findnSetImageSize(a);e.hide();d.show()};c.onerror=function(){}},findnSetImageSize:function(a){var b=this,c,d=0,e=0;c=document.createElement("img");c.src=a;c.complete||
4===c.readyState?(d=c.width,e=c.height,b.setImageSize(d,e)):c.onload=function(){d=c.width;e=c.height;b.setImageSize(d,e)}},setImageSize:function(a,b){var c=0,d=0,e=0;if(640<a||600<b){if(c=640/a>600/b?600/b:640/a)d=b*c,e=a*c}else d=b,e=a;$("#ovlMainImg").css({width:e,height:d})},setRover:function(a,b){if("undefined"==typeof this.lastLinkId||this.lastLinkId!=b)(new Image).src="http://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 c=this.getChild(this.conf.olyId);this.pubsub.publish("_CLOSE_OLAY",{cmpId:this.conf.olyId});c&&c.conf&&(document.getElementById(this.conf.mainId+"notesOlp").innerHTML=a,c.conf.trigger=b,c.show($("#"+c.conf.trigger)))},createFilters:function(a,b){var c=this,d=c.conf,e="77"==c.conf.site?1:0;firstFieldIndex=e;for(e;e<b.length;e++){var g=a.insertCell("77"==
c.conf.site?e-1:e);g.style.paddingRight="10px";var f=document.createElement("SELECT");f.id=b[e];f.index=e;"77"==d.site?4<=e&&(f.style.width="150px"):3<=e&&(f.style.width="150px");"B_Component"!=b[e]&&(f.onchange=function(){c.makeNavRelCall(this)});if("Submodel"===b[e]&&848===d.catalogId)f.options[0]=new Option(c.conf.allSub,"");else if("Submodel"===b[e]&&"15"==d.site)f.options[0]=new Option(c.conf.allSub,"");else if("100"==c.conf.site&&"Trim"===b[e]&&848!=d.catalogId){f.options[0]=new Option(c.conf.allTrim,
"");var h=document.createElement("SELECT");h.id="Submodel";h.style.display="none";g.appendChild(h)}else"100"==c.conf.site&&"Engine"===b[e]&&848!=d.catalogId?(f.options[0]=new Option(c.conf.allEng,""),h=document.createElement("SELECT"),h.id="Engine - Liter_Display",h.style.display="none",g.appendChild(h)):f.options[0]="B_Engine"===b[e]?new Option(c.conf.allEng,""):"B_Model"===b[e]?new Option(c.conf.allModel,""):"B_Component"===b[e]?new Option("--",""):new Option("-"+c.conf.selectTxt+"-","");g.appendChild(f);
if(0!==e||firstFieldIndex!=e)f.disabled=!0}},makeNavRelCall:function(a){var b=this.getUrl(a,!1,this.MDDS),c=a.selectedIndex,d=this.srchFlds,e=d.length;if("100"==this.conf.site&&848!=this.conf.catalogId)if("Trim"==a.id){var g=this.isFieldsMapped1to1("Submodel","Trim");-1<g&&(elem=document.getElementById("Submodel"),elem.selectedIndex=g)}else"Engine"==a.id&&(g=this.isFieldsMapped1to1("Engine - Liter_Display","Engine"),-1<g&&(elem=document.getElementById("Engine - Liter_Display"),elem.selectedIndex=
g));b+="&pn="+this.getPropertyNames(d);this.resetSrchFlds(a);a.index+1<e&&0<c&&"B_Component"!=d[a.index+1]?("100"==this.conf.site&&848!=this.conf.catalogId&&(c=b,"Trim"==d[a.index+1]?this.makeCall(c+"&rf=Submodel",this.updateFilters):"Engine"==d[a.index+1]&&(c+="&rf=Engine - Liter_Display",this.makeCall(c,this.updateFilters))),b+="&rf="+d[a.index+1],this.makeCall(b,this.updateFilters)):this.setButtonState()},resetSrchFlds:function(a){var b=this.srchFlds;if(null!==b)for(var c=0;c<b.length;c++){var d=
document.getElementById(b[c]);!this.start&&(d&&d.index>a.index)&&(d.selectedIndex=0);d&&(d.disabled=a&&d?a.index<d.index:0<c)}this.setButtonState()},updateFilters:function(a){this.fillFilters(a.data);this.setButtonState()},setButtonState:function(){var a=this.srchFlds,b=!0,c=!0,d=3;"77"==this.conf.site&&(d=4);for(var e=0;e<d;e++){var g=document.getElementById(a[e]);if("Trim"!==a[e]&&"A_Trim"!==a[e]&&"Submodel"!==a[e]&&"Engine - Liter_Display"!==a[e]&&g&&0===g.selectedIndex){c=b=!1;break}}if(a=document.getElementById(this.conf.mainId+
"Go"))a.disabled=!b;if(b=document.getElementById("B_Component"))b.disabled=!c},fillFilters:function(a){var b=this.srchFlds,c="77"==this.conf.site?1:0,d="77"==this.conf.site?4:3;if("100"==this.conf.site&&848!=this.conf.catalogId){var e=a[0];"Submodel"in e?this.updateHiddenField(e,"Submodel"):"Engine - Liter_Display"in e&&this.updateHiddenField(e,"Engine - Liter_Display")}for(c;c<b.length;c++){if(this.isBoats&&!this.isCompLoaded){var g=document.getElementById(b[c]),f=this.getUrl(g,!1,this.MDDS);this.isCompLoaded=
!0;f+="&rf=B_Component";this.makeCall(f,this.updateComponent)}try{if(0<a.length){var e=a[0],h=e[b[c]],g=document.getElementById(b[c]);if(h){if(g){c==d&&b[c+1]&&(document.getElementById(b[c+1]).selectedIndex=0);this.clearOptions(g);for(f=0;f<h.length;f++)if(h[f]){var i=new Option(h[f],h[f]);g.options[f+1]=i;this.preSelect(g,i)}1===h.length&&(i.selected=!0);g.disabled=!1;0<g.selectedIndex&&this.makeNavRelCall(g)}}else if(("HSN-TSN"!==b[c]&&this.SP[g.id]&&""!==this.SP[g.id]||this.SP[g.id]&&""!==this.SP[g.id])&&
1>=g.options.length){var j=new Option(this.SP[g.id],this.SP[g.id]);g.options[g.options.length]=j;j.selected=!0}}}catch(k){}}},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 c=0;c<a.length;c++)if(a[c]){var d=new Option(a[c],a[c]);b.options[c+1]=d;this.preSelect(b,d)}1===a.length&&(d.selected=!0)}}},updateHiddenField:function(a,b){if(null==a||void 0==a){var c=document.getElementById(b);e.clearOptions(c)}else{var d=
a[b],e=this;if(0<d.length&&(c=document.getElementById(b),d&&c)){e.clearOptions(c);for(var g=0;g<d.length;g++)if(d[g]){var f=new Option(d[g],d[g]);c.options[g+1]=f;e.preSelect(c,f)}1===d.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){for(var b="",c=0;c<a.length;c++)0!==c&&"DiagramURL"!=a[c]&&(b+="|"),"DiagramURL"!=
a[c]&&(b+=a[c]);return encodeURIComponent(b)},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,c,d){var e,g=this.conf.categoryId,f=this.conf.productId,h=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;c&&(e+="&req="+c);b||(a=a?this.getSrchFldPairs(a):this.getSrchFldPairs(!1,d),""!==a&&(e+="&sfp="+encodeURIComponent(a)),c==this.CREQ&&(""==a&&this.conf.fitsFiltr&&(a=this.conf.fitsFiltr,e+="&sfp="+encodeURIComponent(a)),c=this.getSelectedVehicle(a),this.conf.myVehiclesOn&&(this.uniqueVehicle&&this.conf.isImplicitSaveOn)&&($($("#"+this.conf.mainId+"ieveh .crtval").children()[1]).html(c),this.SP={}),this.chosen=this.valFromURL=c,this.updateVehicleChosen(c)));
g&&(e+="&cid="+g);f&&(e+="&pid="+f);h&&(e+="&item="+h);0<i&&(e+="&ct="+i);0<this.conf.previewItem&&(e+="&pi=1");return e},getSelectedVehicle:function(a){var b="",c="",d="",a=decodeURIComponent(a).split("|"),e=[];if("100"==this.conf.site&&848!=this.conf.catalogId)for(var g=0;g<a.length;g++){var f=a[g].split(":");1<f.length&&e.push(f[0])}for(g=0;g<a.length;g++)if(f=a[g].split(":"),1<f.length&&"null"!=f[1]){if("100"==this.conf.site&&848!=this.conf.catalogId&&("Submodel"==f[0]?d+="+"+f[1]+"+":"Engine - Liter_Display"==
f[0]&&(d+=f[1]),"Submodel"==f[0]&&-1<$.inArray("Trim",e)||"Engine - Liter_Display"==f[0]&&-1<$.inArray("Engine",e)))continue;0!=g&&(b+=" ",c+="~","100"==this.conf.site&&848!=this.conf.catalogId?3>g&&(d+="+"):d+="+");b+=f[1];c+=f[1];"100"==this.conf.site&&848!=this.conf.catalogId?3>g&&(d+=f[1]):d+=f[1]}this.selVel=encodeURIComponent(c);this.nullReccoKeyword=d;return b},updateVehicleChosen:function(a){var b=this.conf.mainId,c=document.getElementById(b+"vchsn");c&&(c.innerHTML=" "+a);if(c=document.getElementById(b+
"vnmchsn"))c.innerHTML=" "+a+"."},updateHTChosen:function(a){var b=document.getElementById(this.conf.mainId+"_htchsn");b&&(b.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,c=a.insertCell(0);c.style.paddingRight="10px";var d=document.createElement("INPUT");d.type="TEXT";d.maxLength=4;d.size=5;d.id=b.conf.mainId+"hsnBox";d.value="zu 2";d.style.color="#999999";d.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");d.disabled=!1;c.appendChild(d);c=a.insertCell(1);c.style.paddingRight="10px";d=document.createElement("INPUT");d.type="TEXT";d.maxLength=3;d.size=4;d.id=b.conf.mainId+"tsnBox";d.value="zu 3";d.style.color="#999999";d.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&&(d.disabled=!1);c.appendChild(d)},emptyTextBox:function(a){a.value="";a.style.color="#000000"},makeHTPageCall:function(a){var b="",c="",b=document.getElementById(this.conf.mainId+"hsnBox").value,c=document.getElementById(this.conf.mainId+
"tsnBox").value;if(4!==b.length||3!==c.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 d=this.getUrl(!1,!0,this.CREQ),d=d+("&pn="+this.getPropertyNames(this.propNames));a?(a=a.request.page)&&(d+="&page="+a):d+="&page=1";d=d+"&rmode=1"+("&sfp="+("hsn:"+b+"|tsn:"+
c));this.chosen=b+"/"+c;this.updateHTChosen(this.chosen);this.makeCall(d,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,c=a.propertyNames,d=a.displayNames;this.clearTable(this.conf.mainId+"htevtbl");for(var e=c.length,g=document.getElementById(this.conf.mainId+"htevtbl"),f=g.insertRow(0),h=0;h<e;h++){var i=f.insertCell(h);
i.style.fontWeight="bold";i.height="30px";i.innerHTML=0==h?"&nbsp;":d[h]}this.htecount=b;for(d=0;d<b;d++){var f=g.insertRow(d+1),j=a.data[d];1==d%2&&(f.style.background="#DEE5FF");for(h=0;h<e;h++)if(0==h){i=f.insertCell(h);i.height="30px";var k=null;try{k=document.createElement("<input name='vehpick' type='radio' id='"+this.conf.mainId+"pick"+d+"' value='"+this.getChoosenVehicle(c,j)+"' />")}catch(l){}k||(k=document.createElement("INPUT"),k.type="RADIO",k.id=this.conf.mainId+"pick"+d,k.name="vehpick",
k.value=this.getChoosenVehicle(c,j));i.appendChild(k)}else i=f.insertCell(h),i.innerHTML=j[c[h]]}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.htecount,c=0;c<b;c++)if((a=document.getElementById(this.conf.mainId+"pick"+c))&&a.checked){this.showAll=!1;var d=this.getUrl(!1,!0,this.CREQ),d=d+("&pn="+this.getPropertyNames(this.propNames)),d=d+"&page=1";a=a.value;d+="&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(d,this.displayCompatibilityInfo);this.showHide(["dctbl"],!0);this.showHide(["dthr"],!1)}},getChsnValue:function(a){for(var b=
"",c=0;c<a.length;c++){var d=a[c].split(":");1<d.length&&"null"!=d[1]&&(0!=c&&(b+=" "),b="--"==d[1]?b+"[--]":b+d[1])}return b},getChoosenVehicle:function(a,b){for(var c="",d=1;d<a.length;d++)1!==d&&(c+="|"),c+=a[d]+":"+b[a[d]];return c},htOlyCancel:function(){this.pubsub.publish("_CLOSE_OLAY",{cmpId:this.conf.htOverlayOSId})},getSrchFldPairs:function(a,b){var c="",d=this.srchFlds,e="",g="";if(null!==d){for(var f=this.fldsSel=0;f<d.length;f++){var h=document.getElementById(d[f]);if(h&&0!==h.selectedIndex){this.fldsSel++;
0!==f&&("77"==this.conf.site&&1==f||(c+="|"),e+="~","100"==this.conf.site&&848!=this.conf.catalogId?3>f&&(g+="+"):g+="+");if(!this.isGoClicked||!h.disabled)c+=h.id+":"+h.options[h.selectedIndex].value,e+=h.options[h.selectedIndex].value,"100"==this.conf.site&&848!=this.conf.catalogId?3>f&&(g+=h.options[h.selectedIndex].value):g+=h.options[h.selectedIndex].value;if(a&&a.id===h.id)break}}this.selVel=encodeURIComponent(e);b&&("100"==this.conf.site&&848!=this.conf.catalogId)&&(d=this.isFieldsMapped1to1("Submodel",
"Trim"),-1!=d&&(h=document.getElementById("Submodel"),c=c+"|"+(h.id+":"+h.options[d].value),g=g+"+"+h.options[d].value+"+"),d=this.isFieldsMapped1to1("Engine - Liter_Display","Engine"),-1!=d&&(h=document.getElementById("Engine - Liter_Display"),c=c+"|"+(h.id+":"+h.options[d].value),g+=h.options[d].value));this.nullReccoKeyword=g}return encodeURIComponent(c)},isFieldsMapped1to1:function(a,b){var c=document.getElementById(a),d=document.getElementById(b);if(null==c||void 0==c||null==d||void 0==d)return-1;
for(var d=d.options[d.selectedIndex].value,e=0,g=0,f=0;f<c.length;f++)null!=c[f].value&&(void 0!=c[f].value&&""!=c[f].value&&0==d.indexOf(c[f].value))&&(e++,g=f);return 1==e?g:-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)},startTimer:function(){var a=this;a.tId=a.needsToCheckHashChange?window.setInterval(function(){a.checkMsg()},1E3):window.setTimeout(function(){a.checkMsg()},1E3)},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;""!==self.tId&&window.clearTimeout(self.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=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;if(a.origin===this.cfg.tgto){try{c=JSON.parse(a.data)}catch(d){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);this.ondemandTransl(b);b[4]||(this.executed=!0);this.cfg.logDescTimer&&this.addDescLodTime(b[5])}},frameBuster:function(a){top.location!=self.location&&top.location.replace(a)},ondemandTransl:function(a){a[2]&&""!==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]&&(st=$("#subTitle").html(a[3]))},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.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.handleClickEvt(b)});a.fsElm.bind("mouseover",function(b){a.handleMouseoverEvt(b)});a.fsElm.bind("mouseout",function(b){a.handleMouseoutEvt(b)});a.fsElm.ready(function(){a.placeBorder($("div#"+b.fsId+" > ul > li:nth-child(1)"))})},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")):($(a.target).parents("li").css("width","-=4").css("height","-=4").css("border","2px solid #666"),d="IMG"==a.target.nodeName?$(a.target).attr("index"):$(a.target).find("img").attr("index"));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})}},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,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 g=!1;return{init:function(a){a.bulkCartItemIdAppended=!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);a.isSMEInterruptLayer&&(this.isSMEInterrupt=!0);a.isCartLyr&&(this.cartLyr=!0)},bindClickEventsOnButtons:function(a){var b=
this;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);g||(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});g||(b.pubsub.publish(b.msgs("VALIDATE_MSKU_VARIATIONS"),{}),b.submitBtn(a,a.bestOfferBtnId));d.preventDefault()});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(){g=!0;b.pubsub.publish("_VI_BTN_MSGS",{id:a.binBtnId,isDisable:!0})},this)},registerPubSubMsgs:function(a){this.pubsub&&(this.pubsub.subscribe(this.msgs("TOGGLE_QTY_DISPLAY_STATE"),function(a){this.variationId=a.variationId},this),this.pubsub.subscribe(this.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("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))},updateStpOverlay:function(a,b){if($("#"+a.qtyBoxId).attr("disabled")){$("#orgPrc").html(a.isModel.originalRetailPrice?a.isModel.originalRetailPrice:"");var d=a.isModel.amtSaved;a.isModel.savingsPercent&&(d=a.isRedesign?a.isModel.savingsPercent+"% off":3==a.siteId?d+(" ("+a.isModel.savingsPercent+"% "+a.savingsRateUpperCase+
"*)"):a.isEUSite?d+(" (-"+a.isModel.savingsPercent+" %*)"):d+(" ("+a.isModel.savingsPercent+"% "+a.savingsRateLowerCase+")"));$("#youSaveSTP").html(d?d:"");a.isModel.originalRetailPrice?$("#vi-orgPrc-container").show():$("#vi-orgPrc-container").hide();d?$("#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.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 d;if(a){var c=a.submitURL;if(c){var f=$("#"+a.qtyBoxId);if(this.isBOPIS){var h=$("#vispw");d=h.attr("uloc");var g=h.attr("storeid"),h=h.attr("ft");if(this.isBOPISOnly&&
!g){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");return!1}this.isEncodeBOPISUrl&&(d=encodeURIComponent(d));if(d=(d?"&uloc="+d:"")+(g?(this.isPUDO?"&locid=":"&storeid=")+g:"")+(h?"&ft="+h:""))c=a.submitURL+=d}if(f&&0<f.length)if("true"===$(f).attr(a.isValid)){c=a.isBulkCart?"qty":$(f).attr("name");f=$(f).val();
c=b==a.cartBtnId&&a.isBulkCart?a.submitURL+"&item=iid:"+a.itemId+",qty:"+f:a.submitURL+"&"+(c+"="+f);try{if("undefined"==typeof this.variationId){var e=$("#sel-msku-variation");"undefined"!==typeof e&&(null!=e&&e&&0<e.html().length&&"-1"!=e.html())&&(this.variationId=e.html())}}catch(j){}this.variationId&&(c=b==a.cartBtnId&&a.isBulkCart?c+(",vid:"+this.variationId):c+("&var="+this.variationId));if(b==a.binBtnId&&a.isSMEInterruptLayer){if(this.isSMEInterrupt)return this.pubsub.publish("SME_BIN_INTERRUPT",
{binBtnId:a.binBtnId}),!1;this.isSMEInterrupt=!0}if(this.isWrty||!this.isWrty&&a.hasWrtyIntercept)return b==a.cartBtnId&&a.isBulkCart?a.bulkCartItemIdAppended||(a.submitURL=c,a.bulkCartItemIdAppended=!0):a.submitURL=c,this.pubsub.publish("_WARRANTY",{vQty:f,btnId:a.binBtnId,cartConfig:a}),!1;if("t"==a.binEnabled&&b==a.binBtnId)return this.pubsub.publish(this.msgs("BIN_SVC_ID"),{vQty:f,vId:this.variationId?this.variationId:""}),!1;if("t"==a.bolEnabled&&b==a.bestOfferBtnId)return this.pubsub.publish(this.msgs("BEST_OFFER_SVC_ID"),
{vQty:f}),!1;top.location=b!=a.cartBtnId?c:b==a.cartBtnId&&a.isBulkCart&&a.bulkCartItemIdAppended?a.submitURL:c}else this.pubsub.publish("LKDHDR_MOVETO_TOP",{ts:(new Date).getTime()});else{try{"undefined"==typeof this.variationId&&(e=$("#sel-msku-variation"),"undefined"!==typeof e&&(null!=e&&e&&0<e.html().length&&"-1"!=e.html())&&(this.variationId=e.html()))}catch(k){}b==a.cartBtnId&&a.isBulkCart&&(c=a.submitURL+"&item=iid:"+a.itemId+",qty:1");this.variationId&&(c=b==a.cartBtnId&&a.isBulkCart?c+(",vid:"+
this.variationId):c+("&var="+this.variationId));if(b==a.binBtnId&&a.isSMEInterruptLayer){if(this.isSMEInterrupt)return this.pubsub.publish("SME_BIN_INTERRUPT",{binBtnId:a.binBtnId}),!1;this.isSMEInterrupt=!0}if(this.isWrty||!this.isWrty&&a.hasWrtyIntercept)return b==a.cartBtnId&&a.isBulkCart?a.bulkCartItemIdAppended||(a.submitURL=c,a.bulkCartItemIdAppended=!0):a.submitURL=c,this.pubsub.publish("_WARRANTY",{vQty:"",btnId:a.binBtnId,cartConfig:a}),!1;if("t"==a.binEnabled&&b==a.binBtnId)return this.pubsub.publish(this.msgs("BIN_SVC_ID"),
{vQty:"",vId:this.variationId?this.variationId:""}),!1;if("t"==a.bolEnabled&&b==a.bestOfferBtnId)return this.pubsub.publish(this.msgs("BEST_OFFER_SVC_ID"),{vQty:""}),!1;top.location=b!=a.cartBtnId?c:b==a.cartBtnId&&a.isBulkCart&&a.bulkCartItemIdAppended?a.submitURL:c}}}return!1}}});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(),c=$("#"+a.bidInputId).val();b==c&&$(this).val("")}})},refreshBid:function(a){var b=this,d=b.cfg,c,e;a&&(c=!a.IsReserve||a.IsReserve&&a.IsReserveMet?!1:!0,d.isABINCounterEnabled&&(1<=a.BidCount&&!c&&!a.IsEnded&&!b.bMsgSent)&&(b.pubsub.publish(d.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)),(c=a.CurrentPrice.MoneyStandard)&&$("#"+d.bpId).html(c),c=a.ViewerItemRelation,"HIGHBIDDER"==c&&a.MaximumBid?b.amountUtils&&b.amountUtils.parseCurrencyByCleanAmt(a.MaximumBid.CleanAmount)<b.amountUtils.parseCurrencyByCleanAmt(a.MinimumToBid.CleanAmount)?(c=a.MinimumToBid.MoneyStandard,e=d.mtbTxt):(c=a.MaximumBid.MoneyStandard,e=d.mtbHBTxt):(c=a.MinimumToBid.MoneyStandard,e=d.mtbTxt),
c&&(a.isAdminView?$("#"+d.mtbId).html(e.replace(d.dummy," ")):$("#"+d.mtbId).html(e.replace(d.dummy,c))),(c=a.LocalCurrentPrice)&&$("#"+d.cbLocalId).html(c.MoneyStandard),a.IsReserve&&(e=a.IsReserveMet?d.resTxt:d.resNMTxt,$("#"+d.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={};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=""));d.pubsub.publish(e,{maxbid:a,shipping:c,impCharge:f,isRedirect:g})};return{init:function(e,a,c,f,g,b,h,l,k,m,i){var j=this;j.util=raptor.require("com.ebay.raptor.vi.bid.Util");b&&d.pubsub.subscribe(b,function(){d.bidClick(a,c,f,g,h,i)},j);l&&(attachEventPressHandler=function(b){if(j.util.isEnterKey(b))return $("#"+
c).blur(),d.bidClick(a,c,f,g,h,i),!1},$("#"+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).click(function(b){k.trackBidBtn&&$(document).trigger("rover",{sid:k.bidTrackingId});d.bidClick(a,c,f,g,h,i);b.preventDefault()})}}});raptor.defineClass("com.ebay.raptor.vi.isum.buyerProtection",function(){return{init:function(a){$("#"+a.ebpHdrId+" a").attr("target","_blank");$("#"+a.ebpHdrId).bind("click",function(){window.open(decodeURIComponent(a.siteUrl));0==a.siteId&&!1==a.isAutoVehicle&&trackingUtil("EBP_complete_Banner_US_only");!0==a.isAutoVehicle&&trackingUtil("VEHICLE_PURCHASE_PROTECTION_BANNER_CLICK")});$("#"+a.ebpHdrId+" a").click(function(b){b.stopPropagation();!1==a.isAutoVehicle&&trackingUtil("EBP_complete_Banner_US_only")});
if($.browser.msie&&7>=parseInt($.browser.version,10)){var c=$("#"+a.ebpHdrId).outerWidth();$("#"+a.ebpVarWidthId).width(parseInt(c)-65);0!=a.siteId&&(c=parseInt(c)-365-20,0>c&&(c=0),$("div.vi-bg-ban").width(c))}else $("#"+a.ebpVarWidthId).width("100%");$(window).resize(function(){if($.browser.msie&&7>=parseInt($.browser.version,10)){var b=$("#"+a.ebpHdrId).outerWidth();$("#"+a.ebpVarWidthId).width(parseInt(b)-65);0!=a.siteId&&(b=parseInt(b)-365-20,0>b&&(b=0),$("div.vi-bg-ban").width(b))}})}}});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")}))},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;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,k=a.maxQty,q=$("#"+a.errorIcon),m=$("#"+a.errorMsg),f=!0,g,j=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?g=1===d?a.errTextMap[1]:a.errTextMap[3]:this.disableQtyChk?
f=!1:e>d?g=a.isSupressQty||d>a.availQtyThreshold?a.errTextMap[4]:1===d?a.errTextMap[1]:a.errTextMap[0]:0<k&&e>k?(g=e>d?a.errTextMap[4]:a.errTextMap[2],j=k):n?h===d&&e<h?(g=a.errTextMap[6],j=h):0<l&&l<h?(g=a.errTextMap[5],j=d,p=o):f=!1:f=!1;if(g&&(d=$("#"+g).html()))d=d.replace(a.dummyQty,j).replace(a.anotherfield,p),$(m).html(d);$(q).toggle(f);$(m).toggle(f);$(c).attr(a.isValid,f?"false":"true");b.publish("QTY_VALIDATION_OUTPUT",{isValid:!f,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"};$("#"+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"}),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);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="http://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)});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 b=$("#"+a.selPrefix+h),c;c=a.isRefresh||a.isRedesign?b.parent():b;"errorIcon"===c.prev().attr("class")&&"none"!=c.next().css("display")&&(n=!0,d.isAlreadyValidated=!0);-1!=b.val()&&(this.hasPictures&&(j=b.val()),f++,b=e.menuItemMap[b.val()].matchingVariationIds,$.each(b,function(a,b){g[b]=g.hasOwnProperty(b)?g[b]+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","http://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,b){b!=f&&delete g[a]}),$.each(g,function(b){f==e.menuModels.length&&d.makeAllPostVariationValidationCalls(a,b);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.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}):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").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};"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);$("#prcIsumConv span").html(c.convertedPrice);$("#binPrice").html(c.convertedPrice);$("#mm-saleOrgPrc").html(c.originalPrice);$("#mm-saleDscPrc").html(c.price);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(b,c){$("#"+a.tmpCloneElmId).html("");var e=$("#"+a.optPrefix+
c);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][c]=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(b,c){null!=$("#"+a.optPrefix+
c)&&$("#"+a.selPrefix+d).append(n["select-"+d][c]);$("#"+a.optPrefix+c).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,b){return a-b});for(k=1;k<m.length;k++)m[k]===m[k-1]&&m.splice(k--,1);$.each(m,function(b,c){var g=e.menuItemMap[c].displayName;$("#"+a.tmpCloneElmId).html(a.optionsObj["select-"+d][c]);f[c].outofstock?(g+=" "+a.outOfStockTxt,$("#"+a.optPrefix+c).html(g),$("#"+a.optPrefix+c).attr("outofstock","true"),$("#"+a.optPrefix+c).attr("disabled",
"disabled"),$("#"+a.optPrefix+c).css("color","#cccccc")):($("#"+a.optPrefix+c).html(g),$("#"+a.optPrefix+c).css("color","#000000"),$("#"+a.optPrefix+c).removeAttr("outofstock"),$("#"+a.optPrefix+c).removeAttr("disabled"));g=$("#"+a.tmpCloneElmId).html($("#"+a.optPrefix+c).clone()).html();a.optionsObj["select-"+d][c]=g;$("#"+a.tmpCloneElmId).html();$("#"+a.selPrefix+d).append(g);$("#"+a.optPrefix+c).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.defineClass("ebay.viewItem.PicturePanel",function(){return{init:function(a){this.cfg=a;this.pubsub=raptor.require("pubsub");this.mainImg=$("#"+a.mainImgId);this.thbrImg=$("#"+a.thbrImgId);this.regPubsub()},regPubsub:function(){var a=this,b=a.cfg;b.fsImgList&&(a.pubsub.publish("_TRIGGER_ZOOM_ENLARGE",{img:b.fsImgList[0],id:0}),a.mskuSkip=!1,a.mainImg.attr("mskuSkip","false"),"-1"==parseInt($("#"+b.mskuId).html())&&$("#"+b.fsId).ready(function(){a.pubsub.publish("_TRIGGER_CLK_VI_FS_IMG_"+b.fsId,
{index:0})}),a.regFSEvents())},regFSEvents:function(){var a=this,b=a.cfg;a.pubsub.subscribe("_GROUP_MSKU_IMAGES",function(b){a.groupMSKUImages(b)},a);a.pubsub.subscribe("_TRIGGER_CLICK_ON_MAIN_IMG_FILMSTRIP",function(d){a.mskuSkip=!0;a.mainImg.attr("mskuSkip","true");a.pubsub.publish("_TRIGGER_CLK_VI_FS_IMG_"+b.fsId,{index:d.index})},a);a.pubsub.subscribe("_VI_FS_CLK_EVT_"+b.fsId,function(b){a.handleImgClk(b)},a);b.isEnableTouch||(a.pubsub.subscribe("_VI_FS_MOUSE_IN_EVT_"+b.fsId,function(b){a.changeImgOnHover(b.currentImgIndex)},
a),a.pubsub.subscribe("_VI_FS_MOUSE_OUT_EVT_"+b.fsId,function(){var b=a.mainImg.attr("clk");b&&a.changeImgOnHover(b)},a))},handleImgClk:function(a){var b=this.cfg,d=a.currentImgIndex;this.changeImgOnClick(a);if(this.mainImg.attr("mskuIndex")){var c=eval("["+this.mainImg.attr("mskuIndex")+"]");c&&$.each(c,function(a,c){$("div#"+b.fsId+" > ul > li:nth-child("+(c+1)+") a").css("border","")})}this.pubsub.publish("_TRIGGER_IMG_PRELOAD",{id:d});-1!=a.selectedIndex&&this.pubsub.publish("_TRIGGER_MSKU_IMG_GROUPING",
{index:a.selectedIndex,skipBoxReset:this.mainImg.attr("mskuSkip")})},changeImgOnClick:function(a){var b=this,d=b.cfg,c=a.currentImgIndex;b.mainImg.hide();d.thbrImgId&&b.thbrImg.attr("imgsel",c).attr("src","http://p.ebaystatic.com/aw/pics/globalAssets/imgLoading_30x30.gif").show();a=document.createElement("img");a.src=d.fsImgList[c].displayImgUrl;a.complete||4===a.readyState?(picOnLoad(!0),b.mainImg.attr("src",d.fsImgList[c].displayImgUrl),b.pubsub.publish("_TRIGGER_ZOOM_ENLARGE",{img:d.fsImgList[c],
id:c})):a.onload=function(){picOnLoad(!0);b.mainImg.attr("src",d.fsImgList[c].displayImgUrl);b.pubsub.publish("_TRIGGER_ZOOM_ENLARGE",{img:d.fsImgList[c],id:c})};a.onerror=function(){picOnError()}},changeImgOnHover:function(a){var b=this,d=b.cfg,c;b.lastIndex=a;b.mainImg.hide();d.thbrImgId&&b.thbrImg.attr("src","http://p.ebaystatic.com/aw/pics/cmp/icn/iconImgNA_96x96.gif").show();c=document.createElement("img");c.src=d.fsImgList[a].displayImgUrl;c.setAttribute("imgId",a);c.complete||4===c.readyState?
c.getAttribute("imgId")==b.lastIndex&&(b.mainImg.attr("src",d.fsImgList[a].displayImgUrl),picOnLoad(!1)):c.onload=function(){c.getAttribute("imgId")==b.lastIndex&&(b.mainImg.attr("src",d.fsImgList[a].displayImgUrl),picOnLoad(!1))}},groupMSKUImages:function(a){var b=this.cfg;this.mainImg.attr("clk",a.index);$.each(a.imgGroupArr,function(d,c){c!=a.index&&$("div#"+b.fsId+" > ul > li:nth-child("+(c+1)+") a ").css("border","1px solid #333333")});a.imgGroupArr=jQuery.grep(a.imgGroupArr,function(b){return b!=
a.index});this.mainImg.attr("mskuIndex",a.imgGroupArr).attr("mskuSkip","false")}}});raptor.defineModule("ebay.viewItem.PicturePanelPH",function(){var d;d=5;return{init:function(a){this.cfg=a;this.pubsub=raptor.require("pubsub");this.dropSSTimers();this.bindPreLoadImgsEvt()},dropSSTimers:function(){$(window).load(function(){var a=raptor.require("ebay.profiler.Profiler"),b=0;if("undefined"!=typeof oGaugeInfo){"undefined"!=typeof picTimer&&(b=picTimer);if("undefined"!=typeof picTimer1&&(b>picTimer1||0==b))b=picTimer1;if("undefined"!=typeof picTimer2&&(b>picTimer2||0==b))b=picTimer2;
"undefined"!=typeof sPT&&0!=b&&a.addParam("i_11i",b-sPT);"undefined"!=typeof oGaugeInfo.iST&&0!=b&&a.addParam("jsljgr2",b-oGaugeInfo.iST)}})},bindPreLoadImgsEvt:function(){var a=this,b=a.cfg;$(window).load(function(){var c=parseInt(b.prLdImgThrsld);0<c&&(d=c,a.fsL=b.fsImgList.length,a.pubsub.subscribe("_TRIGGER_IMG_PRELOAD",function(b){a.preloadLargeImages(b)},a))})},preloadLargeImages:function(a){var b=this.cfg,c,e,g;if(a&&(a.id||0==parseInt(a.id))&&!b.fsImgList[a.id].iscached){c=parseInt(a.id);
e=0<c-d?c-d:0;g=0<this.fsL-(c+d)?c+d:this.fsL;for(var f=c+1;f<g;f++)this.createPLImages(f);for(;e<c;e++)this.createPLImages(e);b.fsImgList[a.id].iscached=!0}},createPLImages:function(a){var b=this.cfg,c;try{c=b.fsImgList[a]}catch(d){}c&&(this.createImgTag(c.displayImgUrl),this.createImgTag(c.maxImageUrl))},createImgTag:function(a){a&&(document.createElement("img").src=a)}}});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.attachClickEvent()},attachClickEvent:function(){var a=this;$("#"+a.conf.bsiecid+" a").click(function(){var b=$("#"+a.conf.cid);b.hasClass("bsi-exp")?b.removeClass("bsi-exp"):(b.addClass("bsi-exp"),a.pubsub.publish(a.msgs("BS_CONTACTDETAILS"),{bsciid:a.conf.bsciid}))})}}});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("com.ebay.raptor.vi.shipping.CalculateShipping",function(){return{init:function(a){this.cfg=a;this.sendGetRatesCall();this.validateShippingSection();this.pubsub=raptor.require("pubsub")},sendGetRatesCall:function(){var a=this,b=a.cfg;a.ajaxUtil=raptor.require("com.ebay.raptor.vi.AjaxUtil");b.isPaypalAccepted&&b.isGSPEnabled&&($(".hideGspPymt").hide(),$(".pd-showGspLegal").show());b.isGSPEnabled&&a.hideReturns();$("#"+b.getRatesBtn).click(function(){ddVal=$("#"+b.countryDd).val();
zipVal=$("#"+b.zipBx).val();qtyVal=$("#"+b.qtyBx).val();a.validateCountryDDAndZip(ddVal,zipVal);var c=b.getRatesUrl;!c||a.qtyErr||a.zipError||a.ddError?(a.zipError&&($("#"+b.zipBx+"-errIcn").show(),$("#"+b.zipBx+"-errTxt").show()),a.ddError&&($("#"+b.countryDd+"-errIcn").show(),$("#"+b.countryDd+"-errTxt").show())):($("#shCost-err").hide(),$("#shCost-err2").hide(),void 0===qtyVal&&(qtyVal=""),a.isZipAvaialble(ddVal)||(zipVal=""),c=c+"&"+$.param({quantity:qtyVal,country:ddVal,zipCode:zipVal,co:"0"}),
a.triggerCall(c),a.cleanErrorMessage())})},cleanErrorMessage:function(){$("#shCost-err > B").html(" "+$("#shCountry option:selected").text())},validateCountryDDAndZip:function(a){this.ddError="-99"===a?!0:this.zipError=!1},isZipAvaialble:function(a){return this.cfg.countryZipMap[a]?!0:!1},triggerCall:function(a){this.ajaxUtil.getJSON(a,this.handleResponse,this)},isZipRequredAndZipError:function(){return"none"!=$("#shZipCodeDiv").css("display")?(""!=$("shZipCode").val(),!0):!1},handleResponse:function(a){var b=
this.cfg;if(a){var c=a.isBOPIS&&!b.isBOPIS||b.isBOPIS&&!a.isBOPIS,d=a.isEBNOnly&&!b.isEBNOnly||b.isEBNOnly&&!a.isEBNOnly;if(a.isPUDO&&!b.isPUDO||b.isPUDO&&!a.isPUDO||c||d)top.location.reload();else if($("#"+b.zipBx+"-errIcn").hide(),$("#"+b.zipBx+"-errTxt").hide(),$("#"+b.zipBx+"-errTxt2").hide(),$("#"+b.countryDd+"-errIcn").hide(),$("#"+b.countryDd+"-errTxt").hide(),$("#shCost-err").hide(),$("#shCost-err2").hide(),$("#freeShip").hide(),$("#sh-gspLogoWrapper").hide(),$("#impchSummary").hide(),$("#impch_xo").hide(),
$("#impch_show").hide(),$("#importChargeSummary").html(""),c='<div id="locatedInLabel" >'+$("#locatedInLabel").html()+"</div>",d='<div id="shipsTo" >'+$("#shipsTo").html()+"</div>",a.invalidZip||a.invalidZipLength)$("#"+b.zipBx+"-errIcn").show(),a.invalidZip&&$("#"+b.zipBx+"-errTxt").show(),a.invalidZipLength&&$("#"+b.zipBx+"-errTxt2").show();else{a.shipCostZipError||a.shipCostError&&this.isZipRequredAndZipError()?$("#shCost-err2").show():a.shipCostError&&$("#shCost-err").show();a.shippingTable&&
$("#shippingSection").html(a.shippingTable);a.deliverySummary&&$("#delSummary").html(a.deliverySummary);a.shippingSummary&&$("#shSummary").html(a.shippingSummary);(a.discounts||""===a.discounts)&&$("#discounts").html(a.discounts);a.freeShipping?($("#freeShip").show(),this.pubsub.publish("UPDATE_PICTURE_RIBBON",{freeShipping:!0})):($("#freeShip").show(),this.pubsub.publish("RESET_PICTURE_RIBBON",{}));a.isShowGSP?($("#sh-gspLogoWrapper").show(),$("#impchSummary").show(),this.pubsub.publish("IMP_CHG_SHOW"),
a.importChargeCost?($("#impch_show").show(),$("#impchCost").html(a.importChargeCost)):$("#impch_xo").show(),b.isPaypalAccepted&&($(".hideGspPymt").hide(),$(".pd-showGspLegal").show()),this.hideReturns(),a.showEUMessage?($("#vi-sh-imp-nonEU").hide(),$("#vi-sh-imp-EU").show()):($("#vi-sh-imp-nonEU").show(),$("#vi-sh-imp-EU").hide()),$("#sh-gsp-wrap").css({width:"69%","float":"left"})):($(".hideGspPymt").show(),$(".pd-showGspLegal").hide(),this.pubsub.publish("IMP_CHG_HIDE"),this.showReturns(),$("#sh-gsp-wrap").css({width:"100%",
"float":"none"}));a.shippingAndDeliverySummary&&$("#shSummaryOneLine").html(a.shippingAndDeliverySummary);0<$("#shSummaryOneLine #ship_Anch").length?($("#shSummaryOneLine #ship_Anch").append(c),$("#shSummaryOneLine #ship_Anch").append(d)):($("#shSummaryOneLine #del_Anch").parent().append(c),$("#shSummaryOneLine #del_Anch").parent().append(d));a.shipsToSummary&&$("#shipsToSummary").html(a.shipsToSummary);a.shipsTo&&$("#shipsToTab").html(a.shipsTo);if(a.shipTotalCostConv&&$("#convbinPrice")&&"none"!=
$("#isum-shipCostDiv").css("display"))try{$("#convbinPrice").get(0).firstChild.nodeValue=a.shipTotalCostConv,$("#convbinPrice > SPAN").show()}catch(e){}else $("#convbinPrice > SPAN").hide();this.pubsub.publish("VI_ACCORDIONS_UPDATE_SNIPPETS",{isCalculateShipping:!0})}}else $("#shCost-err").show()},validateShippingSection:function(){var a=this,b=a.cfg,c=b.remQty;$("#"+b.qtyBx).keyup(function(){selectedQty=$("#"+b.qtyBx).val();isInt=a.isInteger(selectedQty);selectedQty=parseInt(selectedQty,10);!isInt||
1>selectedQty||selectedQty>c?($("#"+b.qtyBx+"-errIcn").show(),$("#"+b.qtyBx+"-errTxt").show(),a.qtyErr=!0):($("#"+b.qtyBx+"-errIcn").hide(),$("#"+b.qtyBx+"-errTxt").hide(),a.qtyErr=!1)});$("#"+b.countryDd).change(function(){ddVal=$("#"+b.countryDd).val();zipDiv=$("#"+b.zipBx+"Div");"-99"!=ddVal?($("#"+b.zipBx+"errIcn").hide(),$("#"+b.zipBx+"errTxt").hide(),$("#"+b.getRatesBtn+"Div").show()):$("#"+b.getRatesBtn+"Div").hide();a.isZipAvaialble(ddVal)?$(zipDiv).show():$(zipDiv).hide()})},isInteger:function(a){if(a)for(var b=
0,c=a.length;b<c;b++){var d=a.charAt(b);if(!("0"<=d&&"9">=d))return!1}return!0},hideReturns:function(){0>=$(".bsi-c-uk-bislr").length&&($("#ret-accept").hide(),$("#ret-accept").next("div.spcr").hide(),0<$("#ret-acpt-tab-au").length?($("#rpdId").children().hide(),$(".section-sttl").show(),$(".rpSubCont .rpAUCont").show().addClass("gspReturn")):$("#ret-acpt-tab").hide())},showReturns:function(){$("#ret-accept").show();$("#ret-accept").next("div.spcr").show();0<$("#ret-acpt-tab-au").length?($("#rpdId").children().show(),
$(".rpSubCont .rpAUCont").removeClass("gspReturn")):$("#ret-acpt-tab").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()},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()}}});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.ListPanel",function(){return{init:function(b){var a=this;a.pubsub=raptor.require("pubsub");a.msgs=raptor.require("com.ebay.raptor.vi.MsgHandler");a.cfg=b;a.listIds=[];a.prevListDetails=[];a.isPanelOpen=!1;a.allListDetails=[];a.pubsub.subscribe(b.listAddSvcId,function(b){a.updateMsg(b)},a);a.pubsub.subscribe("STATUS_PANEL_LIST_SVC_INIT",function(b){a.updateMsg(b)},a);a.pubsub.subscribe("HIDE_DROPDOWN",function(){a.hideDropDown()},a);a.pubsub.subscribe("TRIGGER_LIST_REMOVE",
function(){a.remove()},a);$("#"+b.remove).click(function(){a.remove()});$("html").bind("click",function(){a.hideDropDown()});b.isShareTextClickable&&$("#socShrSubTxt").click(function(){a.shareTextConst();return!1});b.isClts&&a.bindAddToColMsg();a.pubsub.publish("LIST_PANEL_READY",{})},hideDropDown:function(){this.isPanelOpen&&this.hide()},updateMsg:function(b){var a=this,e=a.cfg;a.allListDetails=[];if(b){if(b.isOnLoad&&(b.isMSKU&&(a.listIds=[]),a.prevListDetails=[],!b.listDetails||!(b.listDetails&&
0<b.listDetails.length))){a.watching=!1;a.hideMessagePanel();return}a.prevListDetails&&0<a.prevListDetails.length&&(a.addList(a.prevListDetails),a.prevListDetails.length=0);if(b.listDetails){a.buildMessage(b);b.isOnLoad&&b.listDetails&&1<b.listDetails.length&&a.addList(b.listDetails);a.prevListDetails=b.listDetails;for(var d=0;d<b.listDetails.length;d++)if(b.listDetails[d].isWatchList){a.toggleWatcherViewMsg(!1);break}}a.allListDetails=[];a.allListDetails=b.isOnLoad?a.prevListDetails:a.prevListDetails.concat(a.listIds)}1<
a.listIds.length&&(a.toggleBinded=!0,$("#"+e.icon).bind("click",function(b){b.stopPropagation();a.togglePanel()}))},togglePanel:function(){this.isPanelOpen?this.hide():(this.show(),this.pubsub.publish(this.msgs("FORCE_CLOSE_OVERLAY"),{hideOnly:!0}))},show:function(){var b=this.cfg,a,e,d,c,f,g;a=$("#"+b.icon);c=$("#"+b.listPanel);g=$("#"+b.msgPanel);a&&(c&&g)&&($(a).addClass(b.iconCSS),e=$(a).width(),d=$(a).position().left,$(c).offset({top:0,left:0}),f=$(c).width(),g=$(g).height(),$.browser.msie&&
8>$.browser.version&&(g-=20),d+e<f?a=d:(e=$(a).outerWidth(),a=d+e-f-2),b.isRefresh&&(a=d,g-=20),$(c).css({position:"absolute",top:g+"px",left:a+"px",display:"block"}),this.isPanelOpen=!0)},hide:function(){var b=this.cfg;$("#"+b.icon).removeClass(b.iconCSS);$("#"+b.listPanel).hide();this.isPanelOpen=!1},addList:function(b){var a=!1;if(b&&this.listIds)for(var e=0,d=b.length;e<d;e++){var c=b[e];if(c&&c.listId){for(var f=0,g=this.listIds.length;f<g;f++)if(this.listIds[f].listId&&c.listId===this.listIds[f].listId){a=
!0;break}a||this.add(c)}}},add:function(b){var a=this.cfg;b&&($("#"+a.listContainer).append(this.buildNewElem(b)),this.listIds.push(b))},buildNewElem:function(b){var a=this.cfg,e;return b?(e=document.createElement("a"),e.id=b.listId,e.innerHTML=b.isWatchList?a.watchListName:b.isWishList?a.wishListName:b.listName,e.setAttribute("n",b.listName),e.href=b.listURL,e):""},remove:function(b){var a=this.cfg;this.pubsub&&!b&&this.pubsub.publish(a.triggerRemoveSvcId,{listDetails:this.allListDetails});$("#"+
a.listContainer).empty();$("#"+a.listMsg).empty();$("#"+a.removeContainer).hide();this.listIds.length=0;this.prevListDetails.length=0;this.toggleWatcherViewMsg(!0);this.watching=!1;this.hideMessagePanel()},toggleRemove:function(b){var a=this.cfg;0===b?$("#"+a.removeContainer).hide():(1===b?$("#"+a.remove).html(a.REMOVE):1<b&&$("#"+a.remove).html(a.REMOVE_ALL),$("#"+a.removeContainer).show())},hideMessagePanel:function(){var b=this.cfg;this.isPanelOpen&&this.hide();!this.watching&&this.collection?
($("#"+b.listMsg).hide(),$("#"+b.removeContainer).hide(),this.toggleWatcherViewMsg(!0)):!this.watching&&!this.collection&&(b.isHideStatusMsgPanel&&$("#"+b.msgPanel).hide(),$("#listPanel").hide(),$("#s_w_pipe").hide());this.showHideColPipe()},showMessagePanel:function(){var b=this.cfg;$("#"+b.listMsgContainer).show();b.isHideStatusMsgPanel||$("#s_w_pipe").show();$("#"+b.msgPanel).show();$("#listPanel").show();this.showHideColPipe()},buildMessage:function(b){var a=this.cfg,e,d="",c,f;if(b&&(c=b.listDetails)&&
0<c.length){f=c.length;e=this.listIds.length;if(b.isOnLoad&&b.isSignedIn)d=this.buildShortMsg(c,f,e);else if(1===f){if((c=c[0])&&c.listId)0===e?d=c.isWatchList?a.ADDEDTO_WATCHLIST.replace(a.listLinkPH,c.listURL):c.isWishList?a.ADDEDTO_WISHLIST.replace(a.listLinkPH,c.listURL):a.ADDEDTO_ONE_LIST.replace(a.listLinkPH,c.listURL).replace(a.listNamePH,c.listName):1===e?(d=this.listIds[0].listURL,d=c.isWatchList?a.ADDEDTO_WATCHLIST_ONE_OTHER.replace(a.listLinkPH,c.listURL).replace(a.otherLinkPH,d):c.isWishList?
a.ADDEDTO_WISHLIST_ONE_OTHER.replace(a.listLinkPH,c.listURL).replace(a.otherLinkPH,d):a.ADDEDTO_ONE_LIST_ONE_OTHER.replace(a.listLinkPH,c.listURL).replace(a.otherLinkPH,d).replace(a.listNamePH,c.listName)):1<e&&(d=c.isWatchList?a.ADDEDTO_WATCHLIST_MULTIPLE_OTHER.replace(a.listLinkPH,c.listURL).replace(a.otherLinkPH,"javascript:;").replace(a.listCountPH,e):c.isWishList?a.ADDEDTO_WISHLIST_MULTIPLE_OTHER.replace(a.listLinkPH,c.listURL).replace(a.otherLinkPH,"javascript:;").replace(a.listCountPH,e):a.ADDEDTO_ONE_LIST_MULTIPLE_OTHER.replace(a.listLinkPH,
c.listURL).replace(a.otherLinkPH,"javascript:;").replace(a.listCountPH,e).replace(a.listNamePH,c.listName))}else 0===e?d=a.ADDEDTO_MULIPLE_NEW_LIST.replace(a.newListCountPH,f):1===e?d=a.ADDEDTO_MULIPLE_NEW_LIST_ONE_OTHER.replace(a.newListCountPH,f).replace(a.otherLinkPH,c[0].listURL):1<e&&(d=a.ADDEDTO_MULIPLE_NEW_LIST_MULTIPLE_OTHER.replace(a.newListCountPH,f).replace(a.listCountPH,e).replace(a.otherLinkPH,"javascript:;"));d&&($("#"+a.listMsg).html(d).show(),this.watching=!0,this.showMessagePanel(),
b.isSignedIn?this.toggleRemove(f+e):$("#"+a.removeContainer).hide())}},buildShortMsg:function(b,a,e){var d=this.cfg,c="";b&&(1===a&&0===e?(b=b[0],c=b.isWatchList?d.ONLOAD_WATCHLIST.replace(d.listLinkPH,b.listURL):b.isWishList?d.ONLOAD_WISHLIST.replace(d.listLinkPH,b.listURL):d.ONLOAD_SINGLE_LIST.replace(d.listLinkPH,b.listURL).replace(d.listNamePH,b.listName)):c=d.ONLOAD_MULITPLE_LIST.replace(d.listLinkPH,"javascript:;").replace(d.listCountPH,a+e));return c},toggleWatcherViewMsg:function(b){var a=
this.cfg;b?($("span#"+a.watcherViewMsgElem+" .viWatcherMsg").html(""),$("#"+a.watcherViewMsgElem).hide()):a.watcherViewMsg&&($("span#"+a.watcherViewMsgElem+" .viWatcherMsg").html(a.watcherViewMsg),$("#"+a.watcherViewMsgElem).show())},bindAddToColMsg:function(){var b=this;$(".vi-atc-smsg-s > a, .vi-atc-smsg-m > a").attr("href","javascript:;");$(".vi-atc-smsg-s > a, .vi-atc-smsg-m > a").bind("click",function(){$(".clnw-collect").trigger("click")});b.pubsub.subscribe("ADD_TO_COLLECTION_STATUS_MSG",function(a){b.updateAddToColMsg(a)},
b)},updateAddToColMsg:function(b){0==b.cnt?(this.collection=!1,this.showHideColMsg()):(this.collection=!0,1<b.cnt?($(".vi-atc-smsg-m > a > span").html(b.cnt),$(".vi-atc-smsg-s").hide(),$(".vi-atc-smsg-m").show()):($(".vi-atc-smsg-m").hide(),$(".vi-atc-smsg-s").show()),this.showHideColMsg(!0))},showHideColMsg:function(b){var a=this.cfg;b?($("#"+a.atcL).show(),this.showMessagePanel()):($("#"+a.atcL).hide(),this.hideMessagePanel())},showHideColPipe:function(){var b=this.cfg;b.isClts&&(this.watching&&
this.collection?$("."+b.colPipe).show():$("."+b.colPipe).hide())},shareTextConst:function(){var b=this.cfg,a;a=$("#"+b.socialStatusId+" a").attr("href");$("#socShrSubTxt").attr("href",a);window.open(a,"","scrollbars,resizable,screeny=top,width=800,screenX=200,screenY=100,height="+b.ssPopHeight,"_blank")}}});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.vehiclehistoryreport.VehicleHistoryReport",function(){return{init:function(a){this.cfg=a;this.pubsub=raptor.require("pubsub");this.bindClick()},bindClick:function(){var a=this,b=a.cfg;""!=b.reportUrl&&(a.ajaxUtil=raptor.require("com.ebay.raptor.vi.AjaxUtil"),$("#viTabs_1").click(function(){0==$("#vhr_ac_rpt #subcontent").length&&($("#throbber_vhr").show(),url=b.reportUrl,a.makeCall(url,a.display,a))}))},makeCall:function(a,b){this.ajaxUtil.getJSON(a,b,this)},
display:function(a){a&&("false"===a.IsError?(a=a.SubContent,$("#throbber_vhr").hide(),$("#vhr_ac_rpt > div").css({visibility:"visible"}),$("#vhr_ac_rpt").append(a)):(a=a.SubContent,$("#throbber_vhr").hide(),$("#vhr_ac_rpt").html(a)));$("#throbber_vhr").hide()}}});raptor.defineClass("com.ebay.raptor.vi.VIButton",function(){return{init:function(a){var b=this;b.cfg=a;b.pubsub=raptor.require("pubsub");b.pubsub.subscribe("_VI_BTN_MSGS",function(c){c.id==a.btnId&&b.enableDisableBtn(c)},b);$("#"+a.btnId).mousedown(function(){$("#"+a.btnId).hasClass("d")||$("#"+a.btnId).addClass(a.mouseDownClass)});$("#"+a.btnId).bind("mouseup mouseout",function(){$("#"+a.btnId).hasClass("d")||$("#"+a.btnId).removeClass(a.mouseDownClass)})},enableDisableBtn:function(a){var b=this.cfg;
a.isDisable?(b.isCSS3||$("#"+b.btnId+"_parent").addClass("d"),$("#"+b.btnId).addClass("d").attr("disabled","disabled")):a.isEnable&&(b.isCSS3||$("#"+b.btnId+"_parent").removeClass("d"),$("#"+b.btnId).removeClass("d").removeAttr("disabled"))},disable:function(){var a=this.cfg;a&&$("#"+a.btnId).addClass("d").attr("disabled","disabled")},enable:function(){var a=this.cfg;a&&$("#"+a.btnId).removeClass("d").removeAttr("disabled")}}});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.wrtyCt=0;a.chkdVals=[];$("#"+b.cnclLnk).click(function(){a.cancel()});a.pubsub.channel(b.atcOlyId).subscribe("_OLY_CLS_SVC",function(){a.onClose()},a);b.atcOnLoad&&$(document).ready(function(){a.handleCart()});b.binOnLoad&&$(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=function(){$("#svcGk").services({itemToFetchServicesFor:b.itemId,
siteId:b.siteId,categoryId:b.catId,disabled:!1,onSelectionChange:"getCallBack",saleType:b.saleType,serviceURL:b.serviceURL})};a.ajaxUtil.loadScripts(!0,b.widgetJSURL,function(){a.ajaxUtil.loadScripts(!0,b.aggrJSURL,c)})})},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+="%26quantity="+c),top.location=a,!1;b.wrtyUrl&&((0!=a.length||b.warrantyId)&&""!==b.mapPCOlyId&&this.pubsub.publish("_CLOSE_OLAY",{cmpId:b.mapPCOlyId}),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+="%26quantity="+c),top.location=a,!1;""!==b.mapPCOlyId&&this.pubsub.publish("_CLOSE_OLAY",{cmpId:b.mapPCOlyId});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+="&quantity="+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,!1;d=d+"&restype=json"+("&rand="+Date.now());!a.cartConfig||a.cartConfig&&!a.cartConfig.isBulkCart?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?this.makeRequest(d,b):
f=c,this.wrtyCt++);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);this.pubsub.publish("_WARRANTY_SELECTED",{isWrty:!1});this.pubsub.publish("_SUBMIT_CARTBTN",a.cartConfig)}},makeRequest:function(b,a){this.bBin=a;this.ajaxUtil.getJSON(b,this.handleResponse,this)},
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)):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),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),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+="&quantity="+d);d=this.getChkdVal();if(""!==this.reqCt){if(c+="&item="+b.itemId,!a)return top.location=c,!1}else b=null!==d?d:b.warrantyId,c+="&item="+b;c=c+"&restype=json"+("&rand="+Date.now());this.makeRequest(c,a)},makeRequest:function(a,b){this.bBin=b;this.ajaxUtil.getJSON(a,this.handleResponse,this)},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.enlargeLayerv2",function(){return{init:function(a){this.conf=a;this.pubsub=raptor.require("pubsub");this.regLyrPubsub()},regLyrPubsub:function(){var a=this,c=a.conf;a.pubsub.subscribe("_TRIGGER_ENLARGE",function(b){a.trgEnLyr(b)},a);a.pubsub.subscribe("_SHOW_ENLARGE_IMG",function(){!a.isTouchEvent&&a.isZoom&&a.showEnLyr()},a);a.pubsub.subscribe("_SHOW_ENLARGE_IMG_FOR_BTF_CMP",function(b){b.setDefaultImgId&&(a.currImgId=0);a.showEnLyr()},a);a.pubsub.subscribe("_VI_P_LAYER_CLOSED",
function(b){b.id==c.id&&a.pubsub.publish("_IMG_CAROUSEL_CLS",{id:c.id})},a)},trgEnLyr:function(a){this.currImgId=a.id;this.isZoom=a.img.zoomEnabled;this.isTouchEvent=a.isTouch;this.unbindEvts();this.bindEvts()},bindEvts:function(){var a=this,c=a.conf;a.isTouchEvent?$("#"+c.mainImgHldrId).bind("click",function(b){a.isHandleFSClk=!1;b.stopPropagation();a.showEnLyr()}):a.isZoom||$("#"+c.mainImgHldrId).bind("click",function(){a.isHandleFSClk=!1;a.showEnLyr()})},unbindEvts:function(){var a=this.conf;$("#"+
a.mainImgHldrId).unbind("touchstart");$("#"+a.mainImgHldrId).unbind("click")},showEnLyr:function(){var a=this.conf;this.pubsub.publish("_OPEN_VI_P_LAYER",{id:a.id});this.pubsub.publish("_IMG_CAROUSEL_OPN",{id:a.id,imgid:this.currImgId})}}});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("_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("_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("_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","http://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.pagelayer",function(){return{init:function(a){this.conf=a;this.showing=this.inited=!1;this.pubsub=raptor.require("pubsub");this.bindLayerEvents()},bindLayerEvents:function(){var a=this;a.pubsub&&(a.pubsub.subscribe("_OPEN_VI_P_LAYER",function(b){b.id==a.conf.cmpId&&a.openLayer()}),a.pubsub.subscribe("_CLOSE_VI_P_LAYER",function(b){b.id==a.conf.cmpId&&a.closeLayer()}));$(document).bind("keydown",function(b){27==b.keyCode&&a.closeLayer()});$(".vi_pl_panel .vi_pl_cls_btn").bind("click",
function(){a.closeLayer()});a.conf.isBckBtnSupport&&"function"==typeof window.history.pushState&&(window.onpopstate=function(){a.closeLayer(!0)})},openLayer:function(){this.showing||(this.showing=!0,this.conf.isHideScroll&&(this.bodyMinH=$("body").css("min-height"),$("html").css("overflow-x","hidden"),$("html").css("overflow-y","hidden")),this.inited||$("body").append($("#"+this.conf.cmpId)),this.conf.isFade?$("#"+this.conf.cmpId).fadeIn("slow",function(){$(".vi_pl_panel .vi_pl_cls_btn").focus()}):
($("#"+this.conf.cmpId).show(),$(".vi_pl_panel .vi_pl_cls_btn").focus()),this.conf.isBckBtnSupport&&"function"==typeof window.history.pushState&&window.history.pushState({},null,window.location.href))},closeLayer:function(a){this.showing&&(this.showing=!1,this.conf.isHideScroll&&($("html").css("overflow-x",""),$("html").css("overflow-y","")),this.conf.isFade?$("#"+this.conf.cmpId).fadeOut(150):$("#"+this.conf.cmpId).hide(),$("#mainImgHldr").parent().focus(),this.pubsub.publish("_VI_P_LAYER_CLOSED",
{id:this.conf.cmpId}),!a&&(this.conf.isBckBtnSupport&&"function"==typeof window.history.pushState)&&window.history.go(-1))}}});raptor.defineClass("ebay.viewItem.imageCarousel",function(){return{init:function(a){this.conf=a;this.touchGestures="touch dragleft dragright drag transform dragend swipeleft swiperight";this.imgArray=a.imgArr;null!=this.imgArray&&(1<this.imgArray.length&&(this.hasNavArr=!0),this.enlargeImageCnt=$("#"+a.imgCntId),this.pubsub=raptor.require("pubsub"),this.regPubsub())},regPubsub:function(){var a=this,b=a.conf;a.pubsub.subscribe("_IMG_CAROUSEL_OPN",function(c){c.id==b.layerId&&(a.isHandleFSClk=!1,a.currImgId=
a.initImgId=c.imgid,a.showCmp())},a);a.pubsub.subscribe("_IMG_CAROUSEL_CLS",function(b){if(b.id==a.conf.layerId)a.onCmpCls()},a);b.isFS&&a.pubsub.subscribe("_VI_FS_CLK_EVT_"+b.fsId,function(b){a.isHandleFSClk?(a.currImgId=a.prevImgId=b.currentImgIndex,a.changeImg(!1)):a.isHandleFSClk=!0},a)},bindCmpEvts:function(){var a=this,b=a.conf;setTimeout(function(){a.bindWinEvt(!0)},0);b.isFS&&!b.isEnableTouch&&($(".vi_img_crsl_fspl").removeAttr("style"),a.fsSlideTimer=setTimeout(function(){a.toggleFs(!0)},
2E3),$("#"+b.layerId+" .vi_img_crsl_fspl_trg").bind("mouseenter",function(){a.toggleFs()}),$("#"+b.layerId+" .vi_img_crsl_fspl_trg").bind("mouseleave",function(){a.toggleFs(!0)}));a.hasNavArr&&$("body").bind("keydown."+b.layerId,function(a){-1<[32,37,38,39,40].indexOf(a.keyCode)&&a.preventDefault();37==a.keyCode?$("#"+b.layerId+" .vi_img_crsl_imgpl .pntrArrPrev").click():39==a.keyCode&&$("#"+b.layerId+" .vi_img_crsl_imgpl .pntrArrNext").click()});b.isEnableTouch&&("ontouchstart"in document.documentElement&&
!a.bindedTouch)&&a.bindTouchEvts()},unbindCmpEvts:function(){var a=this.conf;this.bindWinEvt(!1);a.isFS&&!a.isEnableTouch&&($("#"+a.layerId+" .vi_img_crsl_fspl_trg").unbind("mouseenter"),$("#"+a.layerId+" .vi_img_crsl_fspl_trg").bind("mouseleave"));this.hasNavArr&&$("body").unbind("keydown."+a.layerId)},bindWinEvt:function(a){var b=this;a?$(window).bind("resize.ebayvipgevt",function(){b.setImgSize()}):$(window).unbind("resize.ebayvipgevt")},toggleFs:function(a){var b=this.conf,c=a?0:108,a=a?0:0.95;
"undefined"!=typeof this.fsSlideTimer&&clearTimeout(this.fsSlideTimer);$("#"+b.layerId+" .vi_img_crsl_fspl").stop();$("#"+b.layerId+" .vi_img_crsl_fspl").animate({height:c+"px",opacity:a},{duration:350})},showCmp:function(){var a=this.conf;this.bindCmpEvts();trackingUtil(a.opnTrk);if(this.initiated)c=this.getFsCfg(),this.pubsub.publish("_SETUP_VI_FS_"+c.fsId,c);else{if(a.isFS){var b=raptor.require("ebay.viewItem.utils.filmstrip"),c=this.getFsCfg();this.filmstrip=new b(c)}this.initiated=!0}a.isEnableTouch&&
($("#"+a.layerId+" .vi_img_crsl_cmp").css("margin-top","-52px"),$("#"+a.layerId+" .vi_img_crsl_imgpl .pntrArr").css("margin-top","-52px"));this.changeImg(!0)},getFsCfg:function(){var a=this.conf,b=parseInt($("#Body").css("min-width")),c=$(window).width();c<b&&(b=500>c?500:c);a.cellNumber=parseInt((b-40)/a.cellWidth);a.cellNumber=a.cellNumber>this.imgArray.length?this.imgArray.length:a.cellNumber;b={};b.sliderId=a.sliderId;b.fsId=a.fsId;b.cellNumber=a.cellNumber;b.cellWidth=a.cellWidth;b.cellHeight=
a.cellHeight;b.fsARRTrk=a.fsARRTrk;b.fsTHBTrk=a.fsTHBTrk;return b},changeImg:function(a){var b=this,c=b.conf;b.enlargeImageCnt.css({width:30,height:30});b.enlargeImageCnt.attr("src","http://q.ebaystatic.com/aw/pics/cmp/img/imgThrobber_30x30.gif");b.cmpImg=document.createElement("img");var d={};d.id=b.currImgId;d.src=c.islarge?b.cmpImg.src=b.imgArray[b.currImgId].enlargeEnabled?b.imgArray[b.currImgId].maxImageUrl:b.imgArray[b.currImgId].displayImgUrl:b.cmpImg.src=b.imgArray[b.currImgId].displayImgUrl;
b.cmpImg.complete||4===b.cmpImg.readyState?b.setCmpImg(d,a):b.cmpImg.onload=function(){b.setCmpImg(d,a)};c.isFS&&a&&b.pubsub.publish("_TRIGGER_CLK_VI_FS_IMG_"+c.fsId,{index:b.currImgId});b.hasNavArr&&b.setImgArrs();b.pubsub.publish("_TRIGGER_IMG_PRELOAD",{id:b.currImgId})},setImgArrs:function(){var a=this,b=a.conf,c=a.imgArray.length,d=$("#"+b.layerId+" .vi_img_crsl_imgpl .pntrArrPrev"),g=$("#"+b.layerId+" .vi_img_crsl_imgpl .pntrArrNext");0==a.currImgId?(d.addClass("disablePrev"),d.removeClass("activePrev"),
d.unbind("click"),a.bindPrevArrwKey=!1):(d.addClass("activePrev"),d.removeClass("disablePrev"),a.bindPrevArrwKey||(d.bind("click",function(){a.isHandleFSClk=!1;b.arrTrk&&trackingUtil(b.arrTrk);--a.currImgId;a.changeImg(!0);a.pubsub.publish("_IMG_CAROUSEL_CHNG_IMG",{id:a.conf.layerId,curImg:a.currImgId})}),a.bindPrevArrwKey=!0));a.currImgId==c-1?(g.addClass("disableNext"),g.removeClass("activeNext"),g.unbind("click"),a.bindNxtArrwKey=!1):(g.addClass("activeNext"),g.removeClass("disableNext"),a.bindNxtArrwKey||
(g.bind("click",function(){a.isHandleFSClk=!1;b.arrTrk&&trackingUtil(b.arrTrk);++a.currImgId;a.changeImg(!0);a.pubsub.publish("_IMG_CAROUSEL_CHNG_IMG",{id:a.conf.layerId,curImg:a.currImgId})}),a.bindNxtArrwKey=!0));d.show();g.show()},setCmpImg:function(a){a.id==this.currImgId&&(this.setImgSize(),this.enlargeImageCnt.attr("src",a.src))},setImgSize:function(a,b){var c=this.conf,d=0,g=0,f=0,h=f=0;this.imgPanelWidth=$("#"+c.layerId).width();this.imgPanelHeight=$("#"+c.layerId).height();this.imgPanelHeight=
c.isEnableTouch?this.imgPanelHeight-$("#"+c.layerId+" .vi_img_crsl_fspl").height():this.imgPanelHeight;a=a&&0<a?a:this.cmpImg.width;b=b&&0<b?b:this.cmpImg.height;if(a>this.imgPanelWidth||b>this.imgPanelHeight){if(f=this.imgPanelHeight/b,h=this.imgPanelWidth/a,f=h>f?this.imgPanelHeight/b:this.imgPanelWidth/a)d=b*f,g=a*f}else d=b,g=a;this.enlargeImageCnt.css({width:g,height:d})},onCmpCls:function(){var a=this.conf;a.clsTrk&&trackingUtil(a.clsTrk);this.unbindCmpEvts();this.isHandleFSClk=!1;this.currImgId=
this.initImgId},bindTouchEvts:function(){var a=this.conf,b=0,c=0,d=1,g=1,f=0,h=0,i=document.getElementById(a.imgCntId);(new Hammer($("#"+a.layerId)[0],{transform_always_block:!0,transform_min_scale:1,drag_block_horizontal:!0,drag_block_vertical:!0,drag_min_distance:0})).on(this.touchGestures,function(e){switch(e.type){case "touch":g=d;break;case "drag":1!=d?(b=0+e.gesture.deltaX,c=0+e.gesture.deltaY,b>f&&(b=f),b<-f&&(b=-f),c>h&&(c=h),c<-h&&(c=-h)):saved_posY=saved_posX=c=b=0;break;case "transform":d=
Math.max(1,Math.min(g*e.gesture.scale,10));f=Math.ceil((d-1)*i.clientWidth/2);h=Math.ceil((d-1)*i.clientHeight/2);b>f&&(b=f);b<-f&&(b=-f);c>h&&(c=h);c<-h&&(c=-h);break;case "dragleft":1==d&&60<e.gesture.distance&&(e.gesture.stopDetect(),$("#"+a.layerId+" .vi_img_crsl_imgpl .pntrArrNext").click());break;case "swipeleft":e.gesture.stopDetect();d=1;$("#"+a.layerId+" .vi_img_crsl_imgpl .pntrArrNext").click();break;case "dragright":1==d&&60<e.gesture.distance&&(e.gesture.stopDetect(),$("#"+a.layerId+" .vi_img_crsl_imgpl .pntrArrPrev").click());
break;case "swiperight":e.gesture.stopDetect(),d=1,$("#"+a.layerId+" .vi_img_crsl_imgpl .pntrArrPrev").click()}e="initial";1!=d&&(e="translate3d("+b+"px,"+c+"px, 0) scale3d("+d+","+d+", 0) ");i.style.transform=e;i.style.oTransform=e;i.style.msTransform=e;i.style.mozTransform=e;i.style.webkitTransform=e});this.bindedTouch=!0}}});raptor.defineClass("ebay.viewItem.utils.filmstrip",function(){var j={defaultConfig:{cellNumber:6,cellWidth:75,cellHeight:76,gap:0,speed:6,loop:!1,duration:50},typeCast:function(a){a.cellNumber=parseInt(a.cellNumber);a.cellWidth=parseInt(a.cellWidth);a.cellHeight=parseInt(a.cellHeight);a.gap=parseInt(a.gap);a.speed=parseInt(a.speed);a.duration=parseInt(a.duration);return a}};return{init:function(a){var b=this;b.current=0;b.init=!0;b.pubsub=raptor.require("pubsub");b.pubsub.subscribe("_SETUP_VI_FS_"+
a.fsId,function(a){b.setupFs(a)},b);b.setupFs(a);b.handlrBinded||(b.bindTriggerEvent(),b.registerPubSubEvents(),b.handlrBinded=!0);b.init=!1},setupFs:function(a){var b=this,c=b.conf,c=b.conf=j.typeCast($.extend(!0,{},j.defaultConfig,a)),a=b.strip=$("#"+c.sliderId);b.slider=a.find("#"+c.fsId);b.list=a.find("#"+c.fsId+" ul.lst");b.conf.hasFilmstrip=!1;b.selected=a.find(".sel");a.find("a.flm-btn.pre").removeClass("hide disable");a.find("a.flm-btn.nxt").removeClass("hide disable");if(b.list.children("li").length>
c.cellNumber){b.conf.hasFilmstrip=!0;b.slider.css({width:c.cellNumber*c.cellWidth+(c.cellNumber-1)*c.gap+1+"px",height:c.cellHeight+3+"px"});var f=b.total=b.list.children().length;b.list.css("width",f*(c.cellWidth+1+c.gap));b.list.children("li").css({width:c.cellWidth+1+c.gap,height:c.cellHeight});b.btns=a.find("a.flm-btn").css("margin-top",c.cellHeight/2-6);b.previous=a.find("a.flm-btn.pre");!c.loop&&b.init&&b.previous.addClass("disable");b.next=a.find("a.flm-btn.nxt");a.css({width:b.slider.outerWidth()+
b.previous.outerWidth()+b.next.outerWidth()+20+"px",height:c.cellHeight+3+"px"});c.cellNumber>=b.list.children().length&&(b.previous.addClass("disable"),b.next.addClass("disable"));b.btns.on("click",function(a){b.arrowHandler(a,!1,null,0)})}else c.cellNumber=b.list.children("li").length,b.slider.css({width:c.cellNumber*c.cellWidth+(c.cellNumber-1)*c.gap+1+"px",height:c.cellHeight+3+"px"}),a.css({width:b.slider.outerWidth()+20+"px",height:c.cellHeight+3+"px"}),a.find("a.flm-btn.pre").addClass("hide"),
a.find("a.flm-btn.nxt").addClass("hide")},arrowHandler:function(a,b,c,f,h){var d=this,e=d.conf;if(!d.list.is(":animated")&&(a=b?c:$(a.target),!a.hasClass("disable"))){var g=b?f:e.speed,c=d.list.position().left,i=g*(e.cellWidth+e.gap),f=2*e.duration;if(a.hasClass("nxt"))d.previous&&d.previous.removeClass("disable"),d.total-d.current-g>e.cellNumber?(i=g*(e.cellWidth+e.gap),f=g*e.duration,d.current+=g):e.loop||(i=(d.total-d.current-e.cellNumber)*(e.cellWidth+e.gap),f=(d.total-d.current-e.cellNumber)*
e.duration,d.current+=d.total-d.current-e.cellNumber,d.next&&d.next.addClass("disable")),d.selected.addClass("hide"),d.list.animate({left:c-i},f,null,function(){var a;b&&(a=$("div#"+e.fsId+" > ul > li:nth-child("+(h+1)+")"));d.placeBorder(a,!0);if(e.loop){a=d.list.children();for(var c=0;c<g;c++)d.list.append(a[c]);d.list.css("left",d.list.position().left+i)}}),e.fsARRTrk&&trackingUtil(e.fsARRTrk),d.pubsub.publish("_VI_FS_ARRW_CLK_EVT_"+e.fsId,{});else if(a.hasClass("pre")){0<d.current-g?(d.current-=
g,f=g*e.duration):e.loop||(i=d.current*(e.cellWidth+e.gap),f=d.current*e.duration,d.current=0,d.previous&&d.previous.addClass("disable"));if(e.loop){for(var a=d.list.children(),c=a.length-1,j=a.length-g;c>=j;c--)d.list.prepend(a[c]);d.list.css("left",d.list.position().left-i)}d.selected.addClass("hide");d.list.animate({left:d.list.position().left+i},f,null,function(){var a;b&&(a=$("div#"+e.fsId+" > ul > li:nth-child("+(h+1)+")"));d.placeBorder(a,!0)});e.loop||d.next&&d.next.removeClass("disable");
e.fsARRTrk&&trackingUtil(e.fsARRTrk);d.pubsub.publish("_VI_FS_ARRW_CLK_EVT_"+e.fsId,{})}}},registerPubSubEvents:function(){var a=this;a.pubsub.subscribe("_TRIGGER_CLK_VI_FS_IMG_"+a.conf.fsId,function(b){a.triggerClickOnFsImg(b)},this)},bindTriggerEvent:function(){var a=this,b=a.conf;$("#"+b.fsId).bind("click",function(b){a.handleClickEvt(b)});"ontouchstart"in document.documentElement||($("#"+b.fsId).bind("mouseover",function(b){a.handleMouseoverEvt(b)}),$("#"+b.fsId).bind("mouseout",function(b){a.handleMouseoutEvt(b)}))},
handleClickEvt:function(a){var b=this.conf,c=a.target;"DIV"==c.nodeName&&c.children[0]&&"IMG"!=c.children[0].nodeName||"A"==c.nodeName&&-1!=c.className.indexOf("flm-btn")||(c=-1,"LI"==a.target.nodeName?(this.placeBorder(a.target),c=$(a.target).find("img").attr("index")):(this.placeBorder($(a.target).parents("li")),c="IMG"==a.target.nodeName?$(a.target).attr("index"):$(a.target).find("img").attr("index")),b.fsTHBTrk&&trackingUtil(b.fsTHBTrk),this.pubsub.publish("_VI_FS_CLK_EVT_"+b.fsId,{currentImgIndex:this.getCurImgIndex(a),
selectedIndex:c}))},placeBorder:function(a){if(a){var a=$(a),b=this.conf,c=$("div#"+b.fsId+" > ul").position().left,f=this.conf.hasFilmstrip?17:0,h=$("#"+b.sliderId).offset().left,d=$("#"+b.fsId).offset().left,a=d+parseInt(a[0].offsetLeft)-h+c-1,b=parseInt($("#"+b.fsId).css("width"));a<f||a>b+d-h-f?this.selected.addClass("hide"):this.selected.removeClass("hide");this.selected.css({left:a})}},handleMouseoverEvt:function(a){var b=this.conf;"DIV"==a.target.nodeName&&a.target.id!=b.fsId&&a.target.children[0]&&
"IMG"!=a.target.children[0].nodeName||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){this.slideThumb(a)},slideThumb:function(a){var b=this.conf,c=a.index,f=this.current,h=this.current+(b.speed-1),a=parseInt(a.index)+
1;try{c<f?this.arrowHandler(null,!0,$("div#"+b.sliderId+" > a.pre"),f-c,c):c>h&&this.arrowHandler(null,!0,$("div#"+b.sliderId+" > a.nxt"),c-h,c)}catch(d){}$("#"+b.fsId+" > ul > li:nth-child("+a+")").click()}}});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.ovV4=this.userAction=!1;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,
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))a.IsEnded?setTimeout(function(){i.superclass.closeLayer.apply(b)},2500):((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),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.userAction=!1,!a.isAutoRefresh&&a.ROIUrls&&b.bidUtil.preload(a.ROIUrls))},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);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);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())},
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,h=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+" "+h),$("#"+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+" "+h),$("#"+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),h=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+" "+h)}var g=this.showOnlyTwoButtons("#"+b.placeBidSectionId+b.btn);14==this.variant?g?$(".bidSecTabWrap .wholeWrap .btnsWrap").addClass("twoBtn"):$(".bidSecTabWrap .wholeWrap .btnsWrap").removeClass("twoBtn"):g?$("#"+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&&(g?($("#"+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&&(g?($("#"+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"],[])))},isCBT:function(a,b){return parseFloat(a)!=parseFloat(b)?!0:!1},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);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),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))},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,b){var c=this.cfg,d="",e,f=this.BidderStatus.valueOf(a.ViewerItemRelation),h=a.MaximumBid,g=a.MinimumToBid,f=f===this.BidderStatus.HIGHBIDDER;
if(!a.IsAdminView){if(a.isAutoRefresh&&f&&h&&g&&this.amountUtils.parseCurrencyByCleanAmt(g.CleanAmount)>this.amountUtils.parseCurrencyByCleanAmt(h.CleanAmount))e=14==this.variant?c.minToBidHBDynTxtId:c.minBidHBTxt,d=g.MoneyStandard;else if(h||g)f&&h?(e=14==this.variant?c.minToBidHBDynTxtId:c.minBidHBTxt,d=h.MoneyStandard):g&&(e=14==this.variant?c.minToBidOBDynTxtId:c.minBidTxt,d=g.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.bottomHelpTxtId+"_cnt"),b.push(c.topHelpTxtId+"_cnt"),$("#"+c.bottomHelpTxtId).data("exp","0"),$("#"+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,h=d?"keypress":"click",g=function(h){var g=!1;if(d){if(13==(h.keyCode?h.keyCode:
h.which))g=!0}else g=!0;if(g){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(h+e.evtNS,"#"+a,g);$(".pow").on(h+e.evtNS,"#"+a,g)},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())},attachHelpTxtEvts:function(){var a=this.cfg,b=function(a){a&&
1==$("#"+a).data("exp")&&($("#"+a+"_cnt").slideUp("fast"),$("#"+a).data("exp","0"),$("#"+a).attr("aria-expanded","false"))},c=function(){var c=$(this)[0].id;c&&(c==a.topHelpTxtId?b(a.bottomHelpTxtId):c==a.bottomHelpTxtId&&b(a.topHelpTxtId),1==$("#"+c).data("exp")?b(c):c&&0==$("#"+c).data("exp")&&($("#"+c+"_cnt").slideDown("fast"),$("#"+c).data("exp","1"),$("#"+c).attr("aria-expanded","true")));return!1};$(".pow").off("click"+this.evtNS,"#"+a.topHelpTxtId,c);$(".pow").on("click"+this.evtNS,"#"+a.topHelpTxtId,
c);$(".pow").off("click"+this.evtNS,"#"+a.bottomHelpTxtId,c);$(".pow").on("click"+this.evtNS,"#"+a.bottomHelpTxtId,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("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.executeScripts(a.html),d.style.display="none",d.innerHTML=a.html,this.loadCssJS(a),d.style.display="block")}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()},loadCssJS:function(a){var b=a.cssUrl,a=a.jsUrl;if("undefined"!=typeof b&&null!=b)for(var c=0;c<b.length;c++)$("head").append($("<link/>").attr({type:"text/css",rel:"stylesheet",
href:b[c]}));if("undefined"!=typeof a&&null!=a)for(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()})})();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>":""}}});raptor.defineClass("com.ebay.raptor.vi.reviews.ProductReview",function(){return{init:function(a){var b=this,c=raptor.require("pubsub");b.cfg=a;c.subscribe(a.fetchReviewsSvcId,function(a){b.fetchReviews(a)},b);a.isOnLoad?c.publish(a.fetchReviewsSvcId,{}):$(window).scroll(function(){b.chkPos()&&c.publish(a.fetchReviewsSvcId,{isScroll:!0})})},fetchReviews:function(a){var b=this,c=b.cfg,d=c.reviewURL,e=raptor.require("com.ebay.raptor.vi.AjaxUtil");a&&d&&(a=a.isScroll?c.scrollTrksId:c.clickTrksId,e&&(d&&
!b.requestDone)&&(d+="&"+$.param({_trksid:a}),$("#"+c.throbberId).show(),console.log(d),e.getJSON(d,b.processResponse,b),b.requestDone=!0,window.setTimeout(function(){b.showErr()},c.timeOut)))},processResponse:function(a){var b;if(a&&(a=a.htmlContentMap)){for(var c in a)(b=$("#"+c))&&$(b).html(a[c]);this.attachReviewsJSEvt();$(".trrrt a").each(function(){var a=$(this).attr("href"),a=a.replace("p4340","p2047675");$(this).attr("href",a)})}},attachReviewsJSEvt:function(){for(var a=0;5>a;a++)$("#"+a+
"_trc")&&$("#"+a+"_sdtl").click(function(a){return function(){$("#"+a+"_trc").hide();$("#"+a+"_sdtl").hide();$("#"+a+"_dtl").css({display:""})}}(a))},chkPos:function(){var a=this.cfg,b=$("#"+a.productReviewId),c=document.documentElement.clientWidth;return b&&$(b).offset().top<=$(window).scrollTop()+c+a.range?!0:!1},showErr:function(){var a=this.cfg,b=$("#"+a.throbberId);b&&($(b).hide(),$("#"+a.errMsgId).show())}}});