window.addEvent("domready",function(){var otherEl=$("codeLogger");var myEffect=new Fx.Tween(otherEl);otherEl.setStyle("height","0px");otherEl.setStyle("overflow","hidden");parseCodeResponse=function(jsonObj){var success=jsonObj.success;if(success=="false"){success="error";}else{success="success";}
var response=jsonObj.response;var el=new Element("div",{"class":"ajaxResponse "+success,"html":success+": "+response});el.inject($("codeLogger"));var otherEl=$("codeLogger");myEffect.start("height",(otherEl.getStyle("height").toInt()+69)+"px");};postCode=function(){if(domain=='undead'){var request=new Request.JSON({url:"post.php",onComplete:function(jsonObj){parseCodeResponse(jsonObj);}}).post({"mafiaCode":$("codeField").value,"race":$("race").value});}else{var request=new Request.JSON({url:"post.php",onComplete:function(jsonObj){parseCodeResponse(jsonObj);}}).post({"mafiaCode":$("codeField").value});}}
$("submitcode").addEvent("click",function(e){e.stop();postCode();});});