var habboclub={closeSubscriptionWindow:function(a){if(a){Event.stop(a)}if($("subscription_dialog")){Element.remove("subscription_dialog")}if($("subscription_result")){Element.remove("subscription_result")}Overlay.hide()},showSubscriptionResultWindow:function(a,b){Element.wait($("hc_confirm_box"));var c={optionNumber:a};
if(!!$("settings-gender")){c.newGender=$F("settings-gender")}if(!!$("settings-figure")){c.figureData=$F("settings-figure")}new Ajax.Request(habboReqPath+"/habboclub/habboclub_subscribe",{method:"post",parameters:c,onComplete:function(e,d){if(d!=null){var h=d.daysLeft;var f=$$("#clubdaysleft a")[0];if(f){f.innerHTML=""+h
}if($("clubdaysleft")){$("clubdaysleft").show()}if($("joinclub")){$("joinclub").hide()}}if($("subscription_dialog")){Element.remove("subscription_dialog")}habboclub.updateMembership();var g=Dialog.createDialog("subscription_result",b,"9003",0,-1000,habboclub.closeSubscriptionWindow);Dialog.appendDialogBody(g,e.responseText,true);
Dialog.moveDialogToCenter(g)}})},catalogUpdate:function(b,a){new Ajax.Request(habboReqPath+"/habblet/ajax/habboclub_gift",{method:"post",parameters:"month="+encodeURIComponent(b)+"&catalogpage="+encodeURIComponent(a),onComplete:function(d,c){($("hc-gift-catalog")).innerHTML=d.responseText}});return false
},updateMembership:function(){new Ajax.Request(habboReqPath+"/habblet/ajax/habboclub_enddate",{method:"get",onComplete:habboclub._updateMembershipCallback})},buttonClick:function(c,a){var b=Dialog.createDialog("subscription_dialog",a,9001,0,-1000,habboclub.closeSubscriptionWindow);Dialog.setAsWaitDialog();
Dialog.moveDialogToCenter(b);Overlay.show();var d={optionNumber:c};if(!!$("settings-gender")){d.newGender=$F("settings-gender")}if(!!$("settings-figure")){d.figureData=$F("settings-figure")}new Ajax.Request(habboReqPath+"/habboclub/habboclub_confirm",{method:"post",parameters:d,onComplete:function(f,e){Dialog.setDialogBody(b,f.responseText)
}});return false},_updateMembershipCallback:function(b,a){$("hc-buy-container").innerHTML=b.responseText;Rounder.init()}};