function getCharCount() { var obj=document.getElementById("storyTextArea"); setInterval(function(){readCharCount(obj)},100); } function readCharCount(obj) { var sp=document.getElementById("storyCharsTextBox"); var text=document.createTextNode(obj.value.length); sp.removeChild(sp.lastChild); sp.appendChild(text); } function storySend(form) { if (document.getElementById("storyTextArea").value.length<1000) { alert ('Error, your story is too short'); return; } if (document.getElementById("storyTitle").value=='') { alert ('Error, Fill the title'); return; } var cu=new curtain(document.getElementById("storiesSendForm")); advAJAX.submit (form, { onSuccess: function (res) { cu.stop(); if (error=getAjaxResponse(res,"error")) { alert (error); } else location.href=base+"stories/showFolder/0.html"; } }); } function editItem (obj,Obj) { location.href=base+Obj.page+'/editItem/'+Obj.id+'.html'; } function storySave(form,id) { applyCommand(form,'stories','showStory',id); }