var WikiPreferences={onPageLoad:function(){window.onbeforeunload=(function(){if($("prefs").getFormElements().some(function(A){return(A.getValue()!=A.getDefaultValue())})){return"prefs.areyousure".localize()}}).bind(this)},savePrefs:function(){var A={prefSkin:"SkinName",prefTimeZone:"TimeZone",prefTimeFormat:"DateFormat",prefOrientation:"Orientation",editor:"editor",prefLanguage:"Language",prefSectionEditing:"SectionEditing"};for(var B in A){if($(B)){Wiki.prefs.set(A[B],$(B).getValue())}}}};window.addEvent("load",WikiPreferences.onPageLoad.bind(WikiPreferences));var WikiGroup={MembersID:"membersfield",GroupID:"groupfield",NewGroupID:"newgroup",GroupInfoID:"groupinfo",CancelBtnID:"cancelButton",SaveBtnID:"saveButton",CreateBtnID:"createButton",DeleteBtnID:"deleteButton",groups:{"(new)":{members:"",groupInfo:""}},cursor:null,isEditOn:false,isCreateOn:false,putGroup:function(E,A,C,B){this.groups[E]={members:A,groupInfo:C};var D=$("grouptemplate");gg=D.clone().removeProperty("id").setHTML(E).inject(D.getParent()).show();if(B||!this.cursor){this.onMouseOverGroup(gg)}},onMouseOverGroup:function(B){if(this.isEditOn){return }this.setCursor(B);var A=this.groups[(B.id==this.GroupID)?"(new)":B.innerHTML];$(this.MembersID).value=A.members;$(this.GroupInfoID).innerHTML=A.groupInfo},setCursor:function(A){if(this.cursor){$(this.cursor).removeClass("cursor")}this.cursor=$(A).addClass("cursor")},onClickNew:function(){if(this.isEditOn){return }this.isCreateOn=true;$(this.MembersID).value="";this.toggle()},toggle:function(){this.isEditOn=!this.isEditOn;$(this.MembersID).disabled=$(this.SaveBtnID).disabled=$(this.CreateBtnID).disabled=$(this.CancelBtnID).disabled=!this.isEditOn;var A=$(this.DeleteBtnID);if(A){A.disabled=this.isCreateOn||!this.isEditOn}if(this.isCreateOn){$(this.CreateBtnID).toggle();$(this.SaveBtnID).toggle()}var C=$(this.NewGroupID),B=$(this.MembersID);if(this.isEditOn){B.getParent().addClass("cursor");C.disabled=!this.isCreateOn;if(this.isCreateOn){C.focus()}else{B.focus()}}else{B.getParent().removeClass("cursor");if(this.isCreateOn){this.isCreateOn=false;C.value=C.defaultValue;B.value=""}C.blur();B.blur();C.disabled=false}},onSubmitNew:function(B,C){var A=$(this.NewGroupID);if(A.value==A.defaultValue){alert("group.validName".localize());A.focus()}else{this.onSubmit(B,C)}},onSubmit:function(B,C){if(!this.cursor){return false}var A=(this.cursor.id==this.GroupID)?$(this.NewGroupID).value:this.cursor.innerHTML;B.setAttribute("action",C);B.group.value=A;B.members.value=$(this.MembersID).value;B.action.value="save";Wiki.submitOnce(B);B.submit()}};