var $=function(id) { return document.getElementById(id); }; var cmtInput,cmtVar; function setInput() { cmtInput="
"; } function rmInput() { if($('commentInput')) { var elm=$('commentInput'); elm.parentNode.removeChild(elm); } } function cmtCancel() { rmInput(); cmtVar=["Post comment","",-1]; setInput(); $('comments').innerHTML=cmtInput+$('comments').innerHTML; //$('cmtText').focus(); } function cmtReply(x) { rmInput(); cmtVar=["Post reply","Cancel reply",x]; setInput(); $('comment'+x).innerHTML+=cmtInput; $('cmtText').focus(); } function postComment(x) { var form=document.createElement('form'); form.setAttribute("id","postSubmit"); form.setAttribute("action","./?f="+cid); form.setAttribute("method","post"); form.setAttribute("target","_self"); var data={ name: $('cmtName').value, text: $('cmtText').value, post: x }; for(key in data) { var hidden=document.createElement('input'); hidden.setAttribute("type","hidden"); hidden.setAttribute("name",key); hidden.setAttribute("value",data[key]); form.appendChild(hidden); } document.body.appendChild(form); form.submit(); } function loadComments() { for(var i=0;i