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()}};