/* WSGC Copyright */
dojo.provide("wsgc");if(!dojo._hasResource["dojo.regexp"]){dojo._hasResource["dojo.regexp"]=true;dojo.provide("dojo.regexp");dojo.regexp.escapeString=function(_1,_2){return _1.replace(/([\.$?*!=:|{}\(\)\[\]\\\/^])/g,function(ch){if(_2&&_2.indexOf(ch)!=-1){return ch;}return "\\"+ch;});};dojo.regexp.buildGroupRE=function(_4,re,_6){if(!(_4 instanceof Array)){return re(_4);}var b=[];for(var i=0;i<_4.length;i++){b.push(re(_4[i]));}return dojo.regexp.group(b.join("|"),_6);};dojo.regexp.group=function(_9,_a){return "("+(_a?"?:":"")+_9+")";};}if(!dojo._hasResource["dojo.cookie"]){dojo._hasResource["dojo.cookie"]=true;dojo.provide("dojo.cookie");dojo.cookie=function(_b,_c,_d){var c=document.cookie;if(arguments.length==1){var _f=c.match(new RegExp("(?:^|; )"+dojo.regexp.escapeString(_b)+"=([^;]*)"));return _f?decodeURIComponent(_f[1]):undefined;}else{_d=_d||{};var exp=_d.expires;if(typeof exp=="number"){var d=new Date();d.setTime(d.getTime()+exp*24*60*60*1000);exp=_d.expires=d;}if(exp&&exp.toUTCString){_d.expires=exp.toUTCString();}_c=encodeURIComponent(_c);var _12=_b+"="+_c,_13;for(_13 in _d){_12+="; "+_13;var _14=_d[_13];if(_14!==true){_12+="="+_14;}}document.cookie=_12;}};dojo.cookie.isSupported=function(){if(!("cookieEnabled" in navigator)){this("__djCookieTest__","CookiesAllowed");navigator.cookieEnabled=this("__djCookieTest__")=="CookiesAllowed";if(navigator.cookieEnabled){this("__djCookieTest__","",{expires:-1});}}return navigator.cookieEnabled;};}if(!dojo._hasResource["wsgc.js.Utils"]){dojo._hasResource["wsgc.js.Utils"]=true;dojo.provide("wsgc.js.Utils");dojo.declare("wsgc.js.Utils",null,{constructor:function(_15,_16){this._savedCartCookie=_15;this._sessionCartCookie=_16;this._registerSearchFieldEvents();this._registerNavHoverEventsForIE();this._registerPopupNewWindowEvents();this._scrollToPaymentPageErrors();this._registerSVCApply();this._registerCreditCardFieldEvents();this._registerPopulateShippingFromBilling();this._registerChangeShipToEvents();this._registerInterstitialEvents();this._setBasketCount();this._registerPlaceOrder();this._registerSVCLRC();this._registerMultiSelect();this._footerJOELPopup();this._emailAFriendPreview();this._tradeTaxExemption();this._registerPromotionsSignInEvents();this._registerPaymentGiftCardEvents();this._registerPromoApplyEvents();dojo.query(".forgotPassword").forEach(dojo.hitch(this,function(_17){dojo.connect(_17,"onclick",this,"handleForgotPasswordClick");}));dojo.connect(dojo.byId("cartForm"),"onsubmit",function(evt){dojo.query(".delete-item").forEach("item.disabled = true");return true;});dojo.query(".thankYouSort").forEach(function(_19){dojo.connect(_19,"onchange",null,function(evt){dojo.byId("frmSort").submit();});});dojo.query(".goBack").forEach(function(_1b){dojo.connect(_1b,"onclick",function(evt){evt.preventDefault();history.back();});});this._registerCreateRegistryCheckboxEvent();dojo.query("#registry-access-options #guestPassword").forEach(function(_1d){dojo.connect(_1d,"onfocus",null,function(evt){dojo.query("#securityLevelPassword").forEach(function(_1f){_1f.checked="checked";});});});dojo.query(".alternate-pre input[type='text'], .alternate-pre select").forEach(function(_20){dojo.connect(_20,"onkeypress",null,function(evt){if(dojo.byId("AlternativeAddress")&&typeof evt.keyCode!=="undefined"&&evt.keyCode!==9&&evt.keyCode!==13){dojo.byId("AlternativeAddress").checked="checked";}});});dojo.query(".OpenPirateMap").forEach(function(_22){dojo.connect(_22,"onclick",null,function(evt){var _24=screen.width*0.8;var _25=_24*0.6;var _26=(screen.width-_24)/2;var top=(screen.height-_25)/2;var _28=window.open("http://www.kidlandia.com/PBK_Popup.aspx?SKU=PBK_SKU_2","Kidlandia2","directories=0,status=0,scrollbars=0,resizable=1,menubar=0,toolbar=0,location=0,left="+_26+",top="+top+",width="+_24+",height="+_25);_28.opener=window;return false;});});dojo.query(".OpenFairyMap").forEach(function(_29){dojo.connect(_29,"onclick",null,function(evt){var _2b=screen.width*0.8;var _2c=_2b*0.6;var _2d=(screen.width-_2b)/2;var top=(screen.height-_2c)/2;var _2f=window.open("http://www.kidlandia.com/PBK_Popup.aspx?SKU=PBK_SKU_1","Kidlandia2","directories=0,status=0,scrollbars=0,resizable=1,menubar=0,toolbar=0,location=0,left="+_2d+",top="+top+",width="+_2b+",height="+_2c);_2f.opener=window;return false;});});},DEFAULT_SEARCH_TEXT:"keyword or item #",POPUP_DEFAULT_HEIGHT:560,POPUP_DEFAULT_WIDTH:640,POPUP_DEFAULT_RESIZE:1,POPUP_DEFAULT_NAME:"AppPopup",_savedCartCookie:"",_sessionCartCookie:"",MULTI_BUY_CARTURL:"/shoppingcart/style-and-quantity.html",_multi_buy_items:null,MULTI_BUY_ERROR:"Please select an item to continue.",DISABLED_COLOR:"#C0C0C0",_setBasketCount:function(){var _30=dojo.cookie(this._sessionCartCookie.toUpperCase());if(typeof _30=="undefined"){_30=dojo.cookie(this._savedCartCookie.toUpperCase());}if((typeof _30=="undefined")||(_30.split("|").length<4)){return;}var _31=_30.split("|")[3];if(dojo.byId("cart-count")){if(_31!=="0"){dojo.byId("cart-count").innerHTML=": "+_31;}else{dojo.byId("cart-count").innerHTML="";}}},_registerSearchFieldEvents:function(){var _32=dojo.byId("search-field");if(_32){dojo.connect(_32,"onfocus",this,function(evt){if(evt.currentTarget.value===this.DEFAULT_SEARCH_TEXT){evt.currentTarget.value="";}});dojo.connect(_32,"onblur",this,function(evt){if(evt.currentTarget.value==""){evt.currentTarget.value=this.DEFAULT_SEARCH_TEXT;}});}},_registerInterstitialEvents:function(){var _35=null;dojo.query("form.interstitialForm .btn-edit, form.interstitialForm #btn-edit").forEach(function(_36){dojo.connect(_36,"onclick",this,"_handleInterstitialEditClick");},this);if(dojo.query("form.interstitialForm #btn-continue, form.interstitialForm .btn-continue").length>0){_35=dojo.query("form.interstitialForm #btn-continue, form.interstitialForm .btn-continue")[0];dojo.connect(_35,"onclick",this,"_handleInterstitialContinueClick");}},_registerNavHoverEventsForIE:function(){if(dojo.isIE==6){dojo.query("#nav-container li[class~=\"dropDown\"]").forEach(function(_37){dojo.connect(_37,"onmouseover",function(evt){dojo.addClass(evt.currentTarget,"dropDownHover");if(dojo.byId("birthdate.ageValidationBirthmonth")){dojo.style(dojo.byId("birthdate.ageValidationBirthmonth"),"visibility","hidden");dojo.style(dojo.byId("birthdate.ageValidationBirthday"),"visibility","hidden");}else{if(dojo.byId("manage-registry")||dojo.byId("registry-search")||dojo.byId("create-registry")||dojo.byId("find-registry")||dojo.byId("view-registry")||dojo.byId("gift-card-options")){dojo.query("select").style("visibility","hidden");}else{if(dojo.byId("catalog-request")){dojo.query("#address.state","catalog-request").forEach(function(_39){dojo.style(_39,"visibility","hidden");});}else{if(dojo.byId("store-locator-form")){dojo.query("#state, #country","store-locator-form").forEach(function(_3a){dojo.style(_3a,"visibility","hidden");});}else{if(dojo.byId("shopping-bag")){dojo.query("select").style("visibility","hidden");}else{if(dojo.byId("address-create-edit")){dojo.query("#address.state","address-create-edit").forEach(function(_3b){dojo.style(_3b,"visibility","hidden");});}}}}}}});dojo.connect(_37,"onmouseout",function(evt){dojo.removeClass(evt.currentTarget,"dropDownHover");if(dojo.byId("birthdate.ageValidationBirthmonth")){dojo.style(dojo.byId("birthdate.ageValidationBirthmonth"),"visibility","");dojo.style(dojo.byId("birthdate.ageValidationBirthday"),"visibility","");}else{if(dojo.byId("manage-registry")||dojo.byId("registry-search")||dojo.byId("create-registry")||dojo.byId("find-registry")||dojo.byId("view-registry")||dojo.byId("gift-card-options")){dojo.query("select").style("visibility","");}else{if(dojo.byId("catalog-request")){dojo.query("#address.state","catalog-request").forEach(function(_3d){dojo.style(_3d,"visibility","");});}else{if(dojo.byId("store-locator-form")){dojo.query("#state, #country","store-locator-form").forEach(function(_3e){dojo.style(_3e,"visibility","");});}else{if(dojo.byId("shopping-bag")){dojo.query("select").style("visibility","");}else{if(dojo.byId("address-create-edit")){dojo.query("#address.state","address-create-edit").forEach(function(_3f){dojo.style(_3f,"visibility","");});}}}}}}});});}},_registerPopupNewWindowEvents:function(){dojo.query(".popup").forEach(dojo.hitch(this,function(_40){dojo.connect(_40,"onclick",this,function(evt){evt.preventDefault();evt.stopPropagation();var _42=dojo.attr(evt.currentTarget,"rel");var _43;var _44,_45,_46,_47;try{_43=dojo.fromJson(_42);_44=(_43&&typeof _43.dim!=="undefined"&&typeof _43.dim.height!=="undefined"&&_43.dim.height)?_43.dim.height:this.POPUP_DEFAULT_HEIGHT;_45=(_43&&typeof _43.dim!=="undefined"&&typeof _43.dim.width!=="undefined"&&_43.dim.width)?_43.dim.width:this.POPUP_DEFAULT_WIDTH;_46=(_43&&typeof _43.dim!=="undefined"&&typeof _43.dim.resize!=="undefined"&&_43.dim.resize)?_43.dim.resize:this.POPUP_DEFAULT_RESIZE;_47=(_43&&typeof _43.name!=="undefined"!=="undefined"&&_43.name)?_43.name:this.POPUP_DEFAULT_NAME;}catch(e){_44=this.POPUP_DEFAULT_HEIGHT;_45=this.POPUP_DEFAULT_WIDTH;_46=this.POPUP_DEFAULT_RESIZE;_47=this.POPUP_DEFAULT_NAME;}var url=evt.currentTarget.href;var _49="toolbar=no,location=no,directories=no,scrollbars=1,resizable="+_46+",height="+_44+",width="+_45+",screenX=4,screenY=4,top=4,left=4";var win=window.open(url,_47,_49);win.focus();});}));dojo.query(".newWindow").forEach(function(_4b){dojo.connect(_4b,"onclick",this,function(evt){evt.preventDefault();evt.stopPropagation();var _4d=dojo.attr(evt.currentTarget,"rel");var _4e;var _4f;try{_4e=dojo.fromJson(_4d);_4f=(_4e&&typeof _4e.name!=="undefined"!=="undefined"&&_4e.name)?_4e.name:this.POPUP_DEFAULT_NAME;}catch(e){_4f=this.POPUP_DEFAULT_NAME;}var url=evt.currentTarget.href;var _51="toolbar=yes,location=yes,directories=no,scrollbars=1,resizable=1";var win=window.open(url,_4f,_51);if(window.focus){win.focus();}});},this);dojo.query(".close").forEach(function(_53){dojo.connect(_53,"onclick",function(evt){evt.preventDefault();evt.stopPropagation();window.close();});});dojo.query(".closeAndContinue").forEach(function(_55){dojo.connect(_55,"onclick",this,"_newParentWindow");},this);dojo.query(".driveParent").forEach(function(_56){dojo.connect(_56,"onclick",this,"_redirectParent");},this);dojo.query(".print, .printButton").forEach(function(_57){dojo.connect(_57,"onclick",function(evt){evt.preventDefault();evt.stopPropagation();window.print();});});dojo.query(".rollover").forEach(function(_59){dojo.connect(_59,"onmouseover",function(evt){var _5b=evt.currentTarget.src.replace("_off","_on");evt.currentTarget.src=_5b;});dojo.connect(_59,"onmouseout",function(evt){var _5d=evt.currentTarget.src.replace("_on","_off");evt.currentTarget.src=_5d;});dojo.connect(_59,"onfocus",function(evt){var _5f=evt.currentTarget.src.replace("_off","_on");evt.currentTarget.src=_5f;});dojo.connect(_59,"onblur",function(evt){var _61=evt.currentTarget.src.replace("_on","_off");evt.currentTarget.src=_61;});});dojo.query(".delete-item").forEach(function(_62){dojo.connect(_62,"onclick",function(evt){var _64=_62.name;document.cartForm[_64].value="true";});});dojo.query(".checkoutButton").forEach(function(_65){dojo.connect(_65,"onclick",function(evt){dojo.stopEvent(evt);dojo.byId("checkout").value="true";dojo.byId("cartForm").submit();});});},_registerChangeShipToEvents:function(){var _67=dojo.byId("shipToChanged");if(!_67){return;}opener.location="/shoppingcart/";opener.location.reload(true);window.close();},_registerSVCApply:function(){var _68=dojo.byId("applysvc");if(!_68){return;}dojo.connect(_68,"onclick",function(evt){var _6a=dojo.byId("svcApply");_6a.value="yes";});},_registerPlaceOrder:function(){var _6b=dojo.byId("placeOrderButton");if(!_6b){return;}dojo.connect(_6b,"onclick",function(evt){dojo.byId("placeOrder").value="yes";});},_scrollToPaymentPageErrors:function(){var _6d=dojo.byId("paymentInformation");if(!_6d){return;}this.deferredPayment();var _6e=dojo.byId("svcError");var _6f=dojo.byId("discountsApplied");var _70=dojo.byId("ccError");if(_6e&&dojo.trim(_6e.innerHTML)!==""){if(dojo.query(".gift-cards-and-help").length>0){dojo.query(".gift-cards-and-help")[0].scrollIntoView(true);}}else{if(_70&&dojo.trim(_70.innerHTML)!==""){if(dojo.query(".payment-information-block").length>0){dojo.query(".payment-information-block")[0].scrollIntoView(true);}}else{if(_6f&&dojo.trim(_6f.innerHTML)!==""){if(dojo.query(".gift-cards-and-help").length>0){dojo.query(".gift-cards-and-help")[0].scrollIntoView(true);}}}}var _71=dojo.byId("creditCard.payType");if(_71.value==8){dojo.attr("creditCard.cardExpMonth","disabled",true);dojo.attr("creditCard.cardExpYear","disabled",true);dojo.attr("creditCard.cardVerificationNumber","disabled",true);}},_registerCreditCardFieldEvents:function(){var _72=dojo.byId("creditCard.payType");if(!_72){return;}dojo.connect(_72,"onchange",dojo.hitch(this,function(evt){var _74=evt.target.value;var _75=dojo.byId("creditCard.cardExpMonth");var _76=dojo.byId("creditCard.cardExpYear");var _77=dojo.byId("creditCard.cardVerificationNumber");var _78=dojo.byId("allowZeroExp");if(_74==="8"){_75.selectedIndex=0;dojo.attr(_75,"disabled",true);_76.selectedIndex=0;dojo.attr(_76,"disabled",true);dojo.attr(_77,"disabled",true);_78.value="Y";}else{dojo.attr(_75,"disabled",false);dojo.attr(_76,"disabled",false);dojo.attr(_77,"disabled",false);_78.value="N";}this.deferredPayment();}));},_registerPopulateShippingFromBilling:function(){var _79=dojo.byId("applyBillingAddtoShipping");if(_79){dojo.connect(_79,"onclick",function(evt){var _7b=evt.target.checked;if(_7b){dojo.attr("shiptoAddress.fullName",{"value":dojo.byId("billtoAddress.fullName").value,"disabled":"disabled"});dojo.attr("shiptoAddress.addrLine1",{"value":dojo.byId("billtoAddress.addrLine1").value,"disabled":"disabled"});dojo.attr("shiptoAddress.addrLine2",{"value":dojo.byId("billtoAddress.addrLine2").value,"disabled":"disabled"});dojo.attr("shiptoAddress.city",{"value":dojo.byId("billtoAddress.city").value,"disabled":"disabled"});document.getElementById("shiptoAddress.state").value=document.getElementById("billtoAddress.state").value;dojo.byId("shiptoAddress.state").selectedIndex=dojo.byId("billtoAddress.state").selectedIndex;dojo.attr("shiptoAddress.state","disabled","true");dojo.attr("shiptoAddress.zip",{"value":dojo.byId("billtoAddress.zip").value,"disabled":"disabled"});dojo.attr("shiptoAddress.dayPhone",{"value":dojo.byId("billtoAddress.dayPhone").value,"disabled":"disabled"});dojo.attr("shiptoAddress.eveningPhone",{"value":dojo.byId("billtoAddress.eveningPhone").value,"disabled":"disabled"});dojo.query("#ship-account-info input, #ship-account-info select").addClass("disabled");}else{dojo.query("#ship-account-info input, #ship-account-info select").forEach(function(_7c){_7c.removeAttribute("disabled");});dojo.query("#ship-account-info input, #ship-account-info select").removeClass("disabled");}});if(dojo.attr(_79,"checked")===true){dojo.query("#ship-account-info input, #ship-account-info select").forEach(function(_7d){_7d.setAttribute("disabled","disabled");dojo.addClass(_7d,"disabled");});}}},handleForgotPasswordClick:function(evt){dojo.stopEvent(evt);var _7f=dojo.byId("loginForm");if(_7f){_7f.action=secureAppUrl+"account/password-request-confirmation.html";_7f.submit();}},_handleInterstitialEditClick:function(evt){dojo.stopEvent(evt);evt.preventDefault();dojo.byId("isEditMode").value="1";this._postInterstitialForm();},_handleInterstitialContinueClick:function(evt){dojo.stopEvent(evt);dojo.byId("isEditMode").value="0";this._postInterstitialForm();},_postInterstitialForm:function(){if(dojo.query(".interstitialForm").length>0){var _82=dojo.query(".interstitialForm")[0];_82.submit();}},_forwardToExternalSite:function(win,url){if(win){win.close();}var _85=window.open(url);},_registerSVCLRC:function(){var _86="";dojo.query(".removeSVCLRCButton").forEach(function(_87){dojo.connect(_87,"onclick",function(evt){if(!dojo.attr(evt.currentTarget,"svcnumber")){return false;}_86=dojo.attr(evt.currentTarget,"svcnumber");dojo.byId("removeSvcLrc").value=_86;return true;});});},_newParentWindow:function(evt){var win;var url=evt.currentTarget.href;if(dojo.isFF){try{if(dojo.exists("window.opener.utils._forwardToExternalSite")){window.opener.utils._forwardToExternalSite(window,url);}else{win=window.open(url);window.close();}}catch(e){win=window.open(url);window.close();}}else{win=window.open(url);window.close();}},_redirectParent:function(evt){evt.preventDefault();evt.stopPropagation();var url=evt.currentTarget.href;if(dojo.exists("window.opener")){window.opener.location.href=url;if(dojo.exists("window.opener.focus")){window.opener.focus();}}else{var win=window.open(url);window.close();}window.close();},deferredPayment:function(){var _8f=dojo.byId("creditCard.payType").value;var _90=dojo.byId("deferredPayment");if(_90){var _91=dojo.byId("deferPayments");var _92=_91.value.split(",");var _93=dojo.byId("creditCard.payType").options;var _94=dojo.byId("deferredCardType");for(var i=0;i<_92.length;i++){if(_8f===_92[i]){for(var j=0;j<_93.length;j++){if(_93[j].value==_8f){_94.innerHTML=_93[j].text;}}dojo.style(_90,{"display":"block"});break;}else{dojo.style(_90,{"display":"none"});}}}},_registerMultiSelect:function(){this._multi_buy_items=[];if(dojo.byId("productGroupIds")&&dojo.byId("productGroupIds").value!==""){this._multi_buy_items=dojo.byId("productGroupIds").value.split(",");}if(dojo.query("form[name='multiSelect']").length>0){dojo.query(".pagination a").connect("onclick",this,function(evt){var _98=dojo.query("form[name='multiSelect']")[0];var _99=evt.currentTarget.href;evt.preventDefault();this._writeMultiBuyItemsToField();_98.action=_99;_98.submit();});dojo.query(".btn-add-selected a").connect("onclick",this,function(evt){var _9b=dojo.query("form[name='multiSelect']")[0];var _9c=this.MULTI_BUY_CARTURL;evt.preventDefault();this._writeMultiBuyItemsToField();if(dojo.byId("productGroupIds")&&dojo.trim(dojo.byId("productGroupIds").value)!==""){_9b.action=_9c;_9b.submit();}else{if(dojo.byId("pageErrorHook")){dojo.byId("pageErrorHook").innerHTML=this.MULTI_BUY_ERROR;window.scroll(0,0);}}});dojo.query(".muliBuyCheckbox").forEach(function(_9d){if(_9d.checked){if(dojo.indexOf(this._multi_buy_items,_9d.value)===-1){this._multi_buy_items.push(_9d.value);}}},this);dojo.query(".muliBuyCheckbox").connect("onclick",this,"_handleMutliBuyCheckboxClick");}},_writeMultiBuyItemsToField:function(){if(dojo.byId("productGroupIds")&&this._multi_buy_items){dojo.byId("productGroupIds").value=this._multi_buy_items.join(",");}},_handleMutliBuyCheckboxClick:function(evt){var _9f=evt.currentTarget;var _a0=evt.currentTarget.value;if(_9f.checked){if(dojo.indexOf(this._multi_buy_items,_a0)===-1){this._multi_buy_items.push(_a0);}}else{if(dojo.indexOf(this._multi_buy_items,_a0)>-1){this._multi_buy_items.splice(dojo.indexOf(this._multi_buy_items,_a0),1);}}},_footerJOELPopup:function(){dojo.query("#joinEmail").forEach(function(frm){dojo.connect(frm,"onsubmit",this,function(evt){evt.preventDefault();evt.stopPropagation();var url=document.joinEmail.action+"?email="+document.joinEmail.email.value;var _a4="toolbar=no,location=no,directories=no,scrollbars=1,resizable=0,height=300,width=410,screenX=4,screenY=4,top=4,left=4";var win=window.open(url,"joinemail",_a4);win.focus();});});dojo.query("#inpageJoinEmail").forEach(function(frm){dojo.connect(frm,"onsubmit",this,function(evt){evt.preventDefault();evt.stopPropagation();var url=document.inpageJoinEmail.action+"?email="+document.inpageJoinEmail.email.value;var _a9="toolbar=no,location=no,directories=no,scrollbars=1,resizable=0,height=300,width=410,screenX=4,screenY=4,top=4,left=4";var win=window.open(url,"joinemail",_a9);win.focus();});});},_emailAFriendPreview:function(){var _ab=dojo.byId("emailAFriend");if(!_ab){return;}var _ac=dojo.byId("btn-preview");dojo.connect(_ac,"onclick",function(evt){dojo.byId("preview").value="true";});},_tradeTaxExemption:function(){var _ae=dojo.byId("apply-tax-exemption");if(!_ae){return;}var _af=dojo.byId("yesexemption");var _b0=dojo.byId("noexemption");dojo.connect(_af,"onclick",function(evt){dojo.byId("termsBlock").className="";});dojo.connect(_b0,"onclick",function(evt){dojo.byId("termsBlock").className="hide";});},_registerPromotionsSignInEvents:function(){var _b3=dojo.byId("apply-tax-exemption");if(!_b3){return;}var _b4=dojo.byId("yesexemption");var _b5=dojo.byId("noexemption");dojo.connect(_b4,"onclick",function(evt){dojo.byId("termsBlock").className="";dojo.query(".message").forEach("item.className='hide';");});dojo.connect(_b5,"onclick",function(evt){dojo.byId("termsBlock").className="hide";dojo.query(".message").forEach("item.className='hide';");});dojo.connect(dojo.byId("accepttoc"),"onclick",function(evt){dojo.query(".message").forEach("item.className='hide';");});},_registerPaymentGiftCardEvents:function(){var _b9=dojo.byId("base-gift-display");if(!_b9){return;}var _ba=dojo.byId("has-gift-cards");var _bb=dojo.byId("no-gift-cards");if((dojo.byId("svcError"))||(dojo.byId("discountsApplied"))){_ba.checked="checked";dojo.byId("extended-gift-display").className="show";}dojo.connect(_ba,"onclick",function(evt){dojo.byId("extended-gift-display").className="show";});dojo.connect(_bb,"onclick",function(evt){if(dojo.byId("discountsApplied")){_ba.checked="checked";dojo.byId("remove-cards").className="show";}else{dojo.byId("extended-gift-display").className="hide";}});},_registerPromoApplyEvents:function(){var _be=dojo.byId("applyPromoBlock");var _bf=dojo.byId("removePromoBlock");if(_be){var _c0=dojo.byId("applyPromo");if(_c0){dojo.connect(_c0,"onclick",function(evt){dojo.byId("promoApply").value="yes";});}}else{if(_bf){var _c2=dojo.byId("removePromoButton");if(_c2){dojo.connect(_c2,"onclick",function(evt){dojo.byId("removePromo").value="yes";});}}else{return;}}},_registerCreateRegistryCheckboxEvent:function(){dojo.query(".useRegistrantAddress").forEach(function(_c4){dojo.connect(_c4,"onclick",this,function(evt){var _c6;if(evt&&evt.currentTarget){_c6=evt.currentTarget.checked;if(_c6){var _c7=["addrLine1","addrLine2","city","state","zip","dayPhone"];for(var i=0;i<_c7.length;i++){dojo.byId("createRegistry.coRegistrantAddress."+_c7[i]).value=dojo.byId("createRegistry.registrantAddress."+_c7[i]).value;}}dojo.query(".coregAddInfo").forEach("item.disabled="+_c6+";");if(dojo.isIE){var _c9="#ffffff";if(_c6){_c9=this.DISABLED_COLOR;}dojo.query(".coregAddInfo").forEach("item.style.backgroundColor='"+_c9+"';");}}});},this);if(dojo.byId("createRegistry.coRegHasSameAddr")&&dojo.byId("createRegistry.coRegHasSameAddr").checked){dojo.query(".coregAddInfo").forEach("item.disabled='disabled';");if(dojo.isIE){var _ca="#ffffff";_ca=this.DISABLED_COLOR;dojo.query(".coregAddInfo").forEach("item.style.backgroundColor='"+_ca+"';");}}},bvCheckLoadState:function(){if(!BVisLoaded){dojo.byId("BVSubmissionFrame").src="";dojo.byId("BVSubmissionContainer").innerHTML="Review Submission Currently Unavailable";}}});}if(!dojo._hasResource["dojox.xml.parser"]){dojo._hasResource["dojox.xml.parser"]=true;dojo.provide("dojox.xml.parser");dojox.xml.parser.parse=function(str){if(dojo.isIE){var _cc=new ActiveXObject("Microsoft.XMLDOM");_cc.async="false";_cc.loadXML(str);var pe=_cc.parseError;if(pe.errorCode!==0){throw new Error("Line: "+pe.line+"\n"+"Col: "+pe.linepos+"\n"+"Reason: "+pe.reason+"\n"+"Error Code: "+pe.errorCode+"\n"+"Source: "+pe.srcText);}return _cc;}else{var _ce=new DOMParser();var _cc=_ce.parseFromString(str,"text/xml");var de=_cc.documentElement;var _d0="http://www.mozilla.org/newlayout/xml/parsererror.xml";if(de.nodeName=="parsererror"&&de.namespaceURI==_d0){var _d1=de.getElementsByTagNameNS(_d0,"sourcetext")[0];if(!_d1){_d1=_d1.firstChild.data;}throw new Error("Error parsing text "+_cc.documentElement.firstChild.data+" \n"+_d1);}return _cc;}};}if(!dojo._hasResource["dojox.embed.Flash"]){dojo._hasResource["dojox.embed.Flash"]=true;dojo.provide("dojox.embed.Flash");(function(){var _d2,_d3;var _d4="dojox-embed-flash-",_d5=0;function prep(_d6){_d6=dojo.mixin({expressInstall:false,width:320,height:240,style:null,redirect:null},_d6||{});if(!("path" in _d6)){console.error("dojox.embed.Flash(ctor):: no path reference to a Flash movie was provided.");return null;}if(!("id" in _d6)){_d6.id=(_d4+_d5++);}return _d6;};if(dojo.isIE){_d2=function(_d7){_d7=prep(_d7);if(!_d7){return null;}var _d8=_d7.path;if(_d7.vars){var a=[];for(var p in _d7.vars){a.push(p+"="+_d7.vars[p]);}_d8+=((_d8.indexOf("?")==-1)?"?":"&")+a.join("&");}var s="<object id=\""+_d7.id+"\" "+"classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" "+"width=\""+_d7.width+"\" "+"height=\""+_d7.height+"\""+((_d7.style)?" style=\""+_d7.style+"\"":"")+">"+"<param name=\"movie\" value=\""+_d8+"\" />";if(_d7.params){for(var p in _d7.params){s+="<param name=\""+p+"\" value=\""+_d7.params[p]+"\" />";}}s+="</object>";return {id:_d7.id,markup:s};};_d3=(function(){var _dc=10,_dd=null;while(!_dd&&_dc>6){try{_dd=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_dc--);}catch(e){}}if(_dd){var v=_dd.GetVariable("$version").split(" ")[1].split(",");return {major:(v[0]!=null)?parseInt(v[0]):0,minor:(v[1]!=null)?parseInt(v[1]):0,rev:(v[2]!=null)?parseInt(v[2]):0};}return {major:0,minor:0,rev:0};})();}else{_d2=function(_df){_df=prep(_df);if(!_df){return null;}var _e0=_df.path;if(_df.vars){var a=[];for(var p in _df.vars){a.push(p+"="+_df.vars[p]);}_e0+=((_e0.indexOf("?")==-1)?"?":"&")+a.join("&");}var s="<embed type=\"application/x-shockwave-flash\" "+"src=\""+_e0+"\" "+"id=\""+_df.id+"\" "+"name=\""+_df.id+"\" "+"width=\""+_df.width+"\" "+"height=\""+_df.height+"\""+((_df.style)?" style=\""+_df.style+"\" ":"")+"swLiveConnect=\"true\" "+"allowScriptAccess=\"always\" "+"pluginspage=\""+window.location.protocol+"//www.adobe.com/go/getflashplayer\" ";if(_df.params){for(var p in _df.params){s+=" "+p+"=\""+_df.params[p]+"\"";}}s+=" />";return {id:_df.id,markup:s};};_d3=(function(){var _e4=navigator.plugins["Shockwave Flash"];if(_e4&&_e4.description){var v=_e4.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split(".");return {major:(v[0]!=null)?parseInt(v[0]):0,minor:(v[1]!=null)?parseInt(v[1]):0,rev:(v[2]!=null)?parseInt(v[2]):0};}return {major:0,minor:0,rev:0};})();}dojox.embed.Flash=function(_e6,_e7){this.id=null;this.movie=null;this.domNode=null;if(_e6&&_e7){this.init(_e6,_e7);}};dojo.extend(dojox.embed.Flash,{onReady:function(_e8){},onLoad:function(_e9){},init:function(_ea,_eb){this.destroy();_eb=_eb||this.domNode;if(!_eb){throw new Error("dojox.embed.Flash: no domNode reference has been passed.");}this._poller=null;this._pollCount=0,this._pollMax=250;if(dojox.embed.Flash.initialized&&dojox.embed.Flash.available!==0){this.id=dojox.embed.Flash.place(_ea,_eb);this.domNode=_eb;setTimeout(dojo.hitch(this,function(){this.movie=(dojo.isIE)?dojo.byId(this.id):document[this.id];this.onReady(this.movie);this._poller=setInterval(dojo.hitch(this,function(){if(this.movie&&typeof this.movie.PercentLoaded==="function"&&(this.movie.PercentLoaded()==100||this._pollCount++>this._pollMax)){clearInterval(this._poller);delete this._poller;delete this._pollCount;delete this._pollMax;this.onLoad(this.movie);}}),10);}),1);}else{dojo.query("img",dojo.byId(this.domNode)).forEach("dojo.style(item, 'display', 'inline')");}},_destroy:function(){this.domNode.removeChild(this.movie);this.id=this.movie=this.domNode=null;},destroy:function(){if(!this.movie){return;}var _ec=dojo.mixin({},{id:true,movie:true,domNode:true,onReady:true,onLoad:true});for(var p in this){if(!_ec[p]){delete this[p];}}if(this._poller){dojo.connect(this,"onLoad",this,"_destroy");}else{this._destroy();}}});dojo.mixin(dojox.embed.Flash,{minSupported:8,available:_d3.major,supported:(_d3.major>=8),version:_d3,initialized:false,onInitialize:function(){dojox.embed.Flash.initialized=true;},__ie_markup__:function(_ee){return _d2(_ee);},proxy:function(obj,_f0){dojo.forEach((dojo.isArray(_f0)?_f0:[_f0]),function(_f1){this[_f1]=dojo.hitch(this,function(){return (function(){return eval(this.movie.CallFunction("<invoke name=\""+_f1+"\" returntype=\"javascript\">"+"<arguments>"+dojo.map(arguments,function(_f2){return __flash__toXML(_f2);}).join("")+"</arguments>"+"</invoke>"));}).apply(this,arguments||[]);});},obj);}});if(dojo.isIE){dojox.embed.Flash.place=function(_f3,_f4){var o=dojox.embed.Flash.__ie_markup__(_f3);_f4=dojo.byId(_f4);if(!_f4){_f4=dojo.doc.createElement("div");_f4.id=o.id+"-container";dojo.body().appendChild(_f4);}if(o){_f4.innerHTML=o.markup;return o.id;}return null;};dojox.embed.Flash.onInitialize();}else{dojox.embed.Flash.place=function(_f6,_f7){var o=_d2(_f6);_f7=dojo.byId(_f7);if(!_f7){_f7=dojo.doc.createElement("div");_f7.id=o.id+"-container";dojo.body().appendChild(_f7);}if(o){_f7.innerHTML=o.markup;return o.id;}return null;};dojox.embed.Flash.onInitialize();}})();}if(!dojo._hasResource["wsgc.js.MetricsWrapper"]){dojo._hasResource["wsgc.js.MetricsWrapper"]=true;dojo.provide("wsgc.js.MetricsWrapper");dojo.declare("wsgc.js.MetricsWrapper",null,{constructor:function(){dojo.query("[metrics]").forEach(dojo.hitch(this,function(_f9){dojo.connect(_f9,"onclick",this,"_executeMetricsCall");}));},_executeMetricsCall:function(evt){try{var _fb=dojo.attr(evt.currentTarget,"metrics");eval(_fb);}catch(e){console.debug("Metrics call failed.");}}});}
