function AjaxResult(response){eval(response)}
function checkEnter(event, func){var key = event.keyCode; if (key == 13){eval(func)}}
function logout(){$.post('/req/creation/logout.php',{},AjaxResult)}
function msgConfirm(Pid, Act){$.post('/req/creation/confirm.php',{pid:Pid,act:Act},AjaxResult)}
function auth(){$('<div id="authplace"><h2>Авторизация</h2>Ник<br  /><input type="text" id="nick" /><br /><br />Пароль<br /><input type="password" id="pass" /><br /><br /><input type="button" onclick="$(\'#authplace\').animate({height:\'hide\', opacity:\'hide\'},1000, 0, function(){$(\'#authplace\').remove()})" value="Отмена" />&nbsp;&nbsp;<input type="button" onclick="go()" value="Авторизоваться" /><br  /><span id="authmess"></span><br /></div>').appendTo('#auth').animate({height:'show', opacity:'show'},1000)}
function go(){
var Nick = $('#nick').val()
var Pass = $('#pass').val()
$.post('/req/creation/auth.php', {nick:Nick,password:Pass},AjaxResult)
}
function save(){
var Nick = $('#nick').val()
var Header = $('#name').val()
var Msg = $('#msg').val()
var Category = $('#category').val()
$.post('/req/creation/save.php',{nick:Nick,header:Header,msg:Msg,category:Category},AjaxResult)
}
function vote(Pid){
var VoteVal = $('input:checked', '#votetable').val()
if(!VoteVal) return
$.post('/req/creation/vote.php',{vote:VoteVal,pid:Pid},AjaxResult)
}
function savecomment(Pid){
var Comment = $('#comment').val()
$.post('/req/creation/savecomment.php',{msg:Comment,pid:Pid},AjaxResult)
}
function msgMove(Pid){
var Category = $('#move').val()
$.post('/req/creation/move.php',{category:Category,pid:Pid},AjaxResult)
}
function deleteMsg(Id){if(confirm('Удалить комментарий?'))$.post('/req/creation/delete_comment.php',{id:Id},AjaxResult)}
function deleteP(Id){if(prompt('Удалить произведение? Введите "delete", чтобы продолжить') == 'delete')$.post('/req/creation/delete.php',{id:Id},AjaxResult)}
function sentenceCap(Pid){if(confirm('Вы уверены?'))$.post('/req/creation/sentence_cap.php',{pid:Pid},AjaxResult)}
//$(document).ready(function(){$('#creationlist').tablesorter({sortList:[[2,1],[0,0]], widthFixed: true, widgets: ['zebra']}).tablesorterPager({container: $('#pager')})})