core=new Object();core.forum=new Object();core.forum.lastEdit="";core.forum.lastEditBtn="";core.forum.id_post=null;core.forum.isSave=false;core.forum.loaded=function(a){core.forum.id_post.innerHTML=a.responseText||"ошибка получения данных";if(!core.forum.isSave){core.forum.id_edit.innerHTML="";core.forum.id_edit.innerHTML+=""}else{core.forum.id_edit.innerHTML=core.forum.lastEditBtn;core.forum.id_post=null}};core.forum.cancelEdit=function(){this.id_post.innerHTML=this.lastEdit;this.id_edit.innerHTML=this.lastEditBtn;this.id_post=null};core.forum.savePost=function(){id_m=$("idm");new Ajax.Request("savepost.html?id="+this.post_id,{method:"post",postBody:"s="+encodeURIComponent(id_m.value),onSuccess:core.forum.loaded});this.isSave=true};core.forum.editMessage=function(b,a){this.isSave=false;this.post_id=a;if(this.id_post!=null){this.id_post.innerHTML=this.lastEdit}this.id_post=$("idp"+a);this.id_edit=$("ide"+a);this.lastEdit=this.id_post.innerHTML;this.lastEditBtn=this.id_edit.innerHTML;this.id_post.innerHTML="Загрузка....";new Ajax.Request("edit.html?id="+a,{method:"get",onSuccess:core.forum.loaded})};core.forum.selectPage=function(){var a=0;if(a=prompt("Выберите страницу")){document.location="?page="+a}};core.forum.go=function(){var a=$("idForumGo");document.location=a.options[a.selectedIndex].value+".html"};core.forum.hideOptions=function(a){d=(window.event)?window.event.srcElement:a.target;if(d.className=="btnOptions"){return true}var b=$("forumOptions");while(d.parentNode){if((d.tagName.toLowerCase()=="div")&&d.tagName){n=d.getAttributeNode("id");if(n&&(n.value=="forumOptions")&&(b.style.visibility=="visible")){return}}d=d.parentNode}if(b==null){return}b.style.visibility="hidden"};core.forum.showOptions=function(a){var e=$("forumOptions");if(e.parentNode.tagName.toLowerCase()!="body"){c=e.parentNode;c.removeChild(e);document.body.appendChild(e)}if(e.style.visibility=="visible"){e.style.visibility="hidden";return}e.style.width="200px";var c=getPos(a);e.style.visibility="visible";e.style.top=c.bottom-1+"px";e.style.left=c.right-e.offsetWidth+"px"};if(document.addEventListener){document.addEventListener("mousedown",core.forum.hideOptions,false)}else{document.attachEvent("onmousedown",core.forum.hideOptions)}core.forum.deleteMessage=function(a){if(confirm("Вы дейтвительно хотите удалить это сообщение?")){document.location="/forum/delete.html?id="+a}};core.forum.deleteTopic=function(a){if(confirm("Вы дейтвительно хотите удалить этот топик?")){document.location="/forum/deletetopic.html?id="+a}};function opov(a){a.className="ac"}function opout(a){a.className=""};