/* md5:64d22e0d497b53742b594baf390bec90 */
var Home=new Class({Implements:[Options,Events],options:{},initialize:function(a){this.setOptions(a),this.initlinks()},initlinks:function(){var a,b;$("sign-in-cont")&&($("sign-in-hub").addEvent("click",function(a){a=new Event(a),a.stop(),this.sign_in()}.bind(this)),$("sign-up-toggle").addEvent("click",function(a){a=new Event(a),a.stop(),$("sign-up-cont").removeClass("hide"),$("sign-in-cont").addClass("hide")}.bind(this)),$("sign-in-password").addEvent("keydown",function(a){a=new Event(a),a.key==="enter"&&this.sign_in()}.bind(this)),$("sign-up").addEvent("click",function(a){a=new Event(a),a.stop(),this.sign_up()}.bind(this)),$("sign-in-toggle").addEvent("click",function(a){a=new Event(a),a.stop(),$("sign-in-cont").removeClass("hide"),$("sign-up-cont").addClass("hide")}.bind(this)),$("sign-up-password").addEvent("keydown",function(a){a=new Event(a),a.key==="enter"&&this.sign_up()}.bind(this)))},sign_in:function(){var a={login:1,email:$("sign-in-email").get("value"),password:$("sign-in-password").get("value")},b=hub.options.site_url+"/login/",c;c=new Request.JSON({url:b,onComplete:function(a){a&&parseInt(a.success,10)===1?window.location=window.location:a?hub.show_alert("sign-in-alert","bad","",a.errors.getRandom()):hub.show_alert("sign-in-alert","bad","","Sorry! Something went wrong with your sign-in")}.bind(this)}),c.post(a)},sign_up:function(){var a={new_account:1,name:$("sign-up-name").get("value"),email:$("sign-up-email").get("value"),password:$("sign-up-password").get("value"),opt_in:$("sign-up-opt-in").getProperty("checked")},b=hub.options.site_url+"/login/",c=new Request.JSON({url:b,onComplete:function(a){parseInt(a.success,10)===1?window.location=window.location:hub.show_alert("sign-up-alert","bad","",$H(a.errors).getValues().getRandom())}});c.post(a)}})
