var CreditsList=Class.create({initialize:function(){$$(".open[rel]").each(function(D){D.observe("click",function(I){var G=D.up(".method");var F=G.parentNode.select("."+D.getAttribute("rel"));if(!!F&&F.length>0){if(F.first().visible()){var H=F.first();var E=H.up(".paymentmethods-client");E.scrollTop=Math.max(H.cumulativeOffset()[1]-E.cumulativeOffset()[1],0)
}else{F.invoke("remove");G.insert({after:F.first()});var H=G.parentNode.select("."+D.getAttribute("rel")).first();Effect.Fade(G,{duration:0.5,afterFinish:function(){var K=/.*(idx[0-9]+).*/;var J=G.className.replace(K,"$1");var L=H.className.replace(K,"$1");H.removeClassName(L).addClassName(J).show();
G.removeClassName(J).addClassName(L).hide()}})}}})});var B=function(){$$(".method-group.phone .method, .method-group.phone-single .method, .method-group.utilities .method,").each(function(D){D.select("h2").invoke("insert",{after:'<div class="top"><div></div></div>'});D.insert('<div class="bottom"><div></div></div>')
})};B();var C=function(F){var D=F.select(".method:visible");if(D.length>2){D=D.slice(0,2)}var G=[D[0].getHeight(),D[1].getHeight()];var I,H;var E="spacer";if(G[0]!=G[1]){if(G[0]>G[1]){H=G[0]-G[1];if(D[1].select(".smallprint").length>0){I=D[1].select(".smallprint:first")[0];E+="-smallprint"}else{I=D[1].select(".summary:first")[0];
E+="-summary"}}else{if(G[1]>G[0]){H=G[1]-G[0];if(D[0].select(".smallprint").length>0){I=D[0].select(".smallprint:first")[0];E+="-smallprint"}else{I=D[0].select(".summary:first")[0];E+="-summary"}}}I.insert({after:'<div class="'+E+'" style="height: '+H+'px"></div>'})}};var A=function(E){var D=function(I){var F=I.element();
if(!F.getAttribute("target")){I.stop();if(F.hasClassName("country")){new Ajax.Updater($$(".paymentmethods-client-list").first(),habboReqPath+"/habblet/paymentmethods_new",{method:"post",parameters:{viewName:"client",slug:F.getAttribute("rel")},evalScripts:true,onComplete:function(J){E.scrollTop=0;B()
}})}else{if(F.hasClassName("target-utilities")){var H=$$(".utilities").first();if(!!H){var G=H.up(".paymentmethods-client");G.scrollTop=Math.max(H.cumulativeOffset()[1]-G.cumulativeOffset()[1],0)}}HabbletLoader.openLink(F)}}};E.observe("click",Event.delegate({a:D,"a.new-button *":D}))};if($$(".paymentmethods-client").length==0){$$(".method-group.phone, .method-group.phone-single").each(C)
}else{$$(".paymentmethods-client").each(A)}}});var NewRedeemHabblet=Class.create({form:null,busy:false,initialize:function(A){this.form=$(A)||$("voucher-form");if(!!this.form){this.form.observe("submit",this._redeemVoucher.bind(this));this.form.observe("click",this._clicked.bind(this))}},_clicked:function(B){if(this.busy){return 
}var A=B.findElement(".redeem-submit");if(!!A){this._redeemVoucher(B)}},_redeemVoucher:function(A){if(this.busy){return }A.stop();this.busy=true;new Ajax.Updater(this.form,habboReqPath+"/habblet/ajax/new_redeemvoucher",{method:"post",parameters:{voucherCode:this.form.down("input[type=text]").value},onComplete:function(B){this.form.select(".rounded").each(function(D){Rounder.addCorners(D,8,8)
});var C=B.getHeader("X-Habbo-Balance");if((!!C||C===0)){$$(".redeem-balance-amount").each(function(D){D.innerHTML=C})}this.busy=false}.bind(this)})}});__credits__defined__=true;