var req; var td=null; var ret=""; var url='http://www.jogjapenatahcinta.com/remote.php'; var counter =0; var xml=''; var what=''; function DoCallback(data){ // branch for native XMLHttpRequest object if(window.XMLHttpRequest){ req=new XMLHttpRequest(); req.onreadystatechange=processReqChange; req.open('POST', url, true); req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); req.send(data); // branch for IE/Windows ActiveX version }else if(window.ActiveXObject){ req=new ActiveXObject('Microsoft.XMLHTTP'); if(req){ req.onreadystatechange=processReqChange; req.open('POST', url, true); req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); req.send(data); } } } function processReqChange(){ // only if req shows 'loaded' if(req.readyState==4){ if(req.status==200){eval(what);} else{alert('There was a problem retrieving the XML data:\n' + req.responseText);} } } function clearFont(){ code=wysiwyg.getHTMLContent(); code=code.replace(/])*face="([^"]*)"/gi,"0){ what="CheckUsernameReturn(req.responseXML)"; DoCallback("w=CheckUsername" + "&Username=" + document.getElementById('Username').value ); return true; }else{ alert('Masukkan satu nama-pengguna untuk memeriksa ketersediaannya.'); } } function CheckLength(textarea){ var MaxLength=500; biolen=textarea.value.length; if(biolen>MaxLength){ textarea.value=textarea.value.substr(0, MaxLength); return; } var RemainingLength=(MaxLength - biolen); limitcheck='Anda bisa mencari yang lain ' + RemainingLength + ' karakter kedalam biografi Anda.'; document.getElementById('biolength').innerHTML=limitcheck; } function CheckUsernameReturn(returned){ // get the status of the ajax response // our getXMLData function relies on a global variable called 'xml' // so we just put the response into that. xml=returned.documentElement; var status=getXMLData('status'); if(status==1){ // user account was successfully create document.getElementById("UsernameCheck").innerHTML=getXMLData('message'); return true; }else{ document.getElementById("UsernameCheck").innerHTML='Terjadi kesalahan saat mengecek nama-pengguna tersebut.'; return false; } } function CheckSubmitArticleForm(){ if(document.getElementById("Title").value==""){ alert("Masukkan judul guratan."); document.getElementById("Title").focus(); return false; } if(document.getElementById("Summary").value==""){ alert("Masukkan ringkasan."); document.getElementById("Summary").focus(); return false; } if(document.getElementById("ACategories").selectedIndex==-1){ alert("Pilih satu kategori."); document.getElementById("ACategories").focus(); return false; } return true; } function CheckSubmitBlogForm(){ if(document.getElementById("Title").value==""){ alert("Masukkan sebuah judul"); document.getElementById("Title").focus(); return false; } if(wysiwyg.getHTMLContent()==" " || wysiwyg.getHTMLContent()=="
" || wysiwyg.getHTMLContent()=="
" || wysiwyg.getHTMLContent()=="" || wysiwyg.getHTMLContent()==" 
" || wysiwyg.getHTMLContent()=="
 "){ alert('Silakan masukkan isi untuk kiriman blog Anda'); return false; } } function CheckSubmitArticleForm2(){ atype=document.getElementById('ArticleType'); articleType=atype.options[atype.selectedIndex].value; if(document.getElementById("Title").value==""){ alert("Masukkan judul guratan."); document.getElementById("Title").focus(); return false; } if(document.getElementById("Summary").value==""){ alert("Masukkan ringkasan."); document.getElementById("Summary").focus(); return false; } if(document.getElementById("ACategories").selectedIndex==-1){ alert("Pilih satu kategori."); document.getElementById("ACategories").focus(); return false; } if(articleType==1){// full article if(document.getElementById("PageTitle").value==""){ alert("Anda perlu memasukkan judul guratan dan juga judul halaman."); document.getElementById("PageTitle").focus(); return false; } if(wysiwyg.getHTMLContent()==" " || wysiwyg.getHTMLContent()=="
" || wysiwyg.getHTMLContent()=="" || wysiwyg.getHTMLContent()==" 
"){ alert('Silakan masukkan isi untuk guratan kedalam editor.'); return false; } } return true; } function CheckLoginForm(){ if(document.getElementById("Username").value==""){ alert("Silakan masukkan nama-pengguna Anda."); document.getElementById("Username").focus(); return false; } if(document.getElementById("Password").value==""){ alert("Silakan masukkan kata sandi Anda."); document.getElementById("Password").focus(); return false; } return true; } function CheckAuthorForm(){ if(document.getElementById("Username").value==""){ alert("Silakan masukkan nama-pengguna Anda."); document.getElementById("Username").focus(); return false; } if(document.getElementById("Password").value==""){ alert("Silakan masukkan kata sandi Anda."); document.getElementById("Password").focus(); return false; } if(document.getElementById("Password").value != document.getElementById("PasswordConfirm").value){ alert("Kata sandi Anda tidak sama."); document.getElementById("Password").focus(); document.getElementById("Password").select(); return false; } if(document.getElementById("FirstName").value==""){ alert("Silakan masukkan nama awal Anda."); document.getElementById("FirstName").focus(); return false; } if(document.getElementById("LastName").value==""){ alert("Silakan masukkan nama akhir Anda."); document.getElementById("LastName").focus(); return false; } if(document.getElementById("Email2").value==""){ alert("Silakan masukkan alamat email Anda."); document.getElementById("Email2").focus(); return false; } if(document.getElementById("Email2").value.indexOf('.')==-1 || document.getElementById("Email2").value.indexOf('@')==-1){ alert('This email address is not valid.'); document.getElementById("Email2").focus(); document.getElementById("Email2").select(); return false; } if(document.getElementById("Biography").value==""){ alert("Silakan masukkan biografi Anda."); document.getElementById("Biography").focus(); return false; } return true; } function CheckUserForm(){ if(document.getElementById("Username").value==""){ alert("Silakan masukkan nama-pengguna Anda."); document.getElementById("Username").focus(); return false; } if(document.getElementById("Password").value==""){ alert("Silakan masukkan kata sandi Anda."); document.getElementById("Password").focus(); return false; } if(document.getElementById("Password").value != document.getElementById("PasswordConfirm").value){ alert("Kata sandi Anda tidak sama."); document.getElementById("Password").focus(); document.getElementById("Password").select(); return false; } if(document.getElementById("FirstName").value==""){ alert("Silakan masukkan nama awal Anda."); document.getElementById("FirstName").focus(); return false; } if(document.getElementById("LastName").value==""){ alert("Silakan masukkan nama akhir Anda."); document.getElementById("LastName").focus(); return false; } if(document.getElementById("Email2").value==""){ alert("Silakan masukkan alamat email Anda."); document.getElementById("Email2").focus(); return false; } if(document.getElementById("Email2").value.indexOf('.')==-1 || document.getElementById("Email2").value.indexOf('@')==-1){ alert('This email address is not valid.'); document.getElementById("Email2").focus(); document.getElementById("Email2").select(); return false; } return true; } function UserAccountReturn(returned){ // get the status of the ajax response // our getXMLData function relies on a global variable called 'xml' // so we just put the response into that. xml=returned.documentElement; var status=getXMLData('status'); if(status==1){ // user account was successfully create document.getElementById("custom").value=getXMLData('usertoken'); document.getElementById("UserForm").submit(); return true; }else{ var message=getXMLData('message'); alert(message); return false; } } function isdefined(variable){ return eval('(typeof('+variable+') != "undefined");'); } function getXMLData(name){ // we rely on a global variable called 'xml' if(isdefined('xml')){return xml.getElementsByTagName(name)[0].firstChild.data;}else{return '';} } function emailToFriend(ArticleLink){ var t=(screen.availHeight/2) - (485/2); var l=(screen.availWidth/2) - (605/2); var emailWin=window.open(ArticleLink+"/articleemail", "emailWin", "scrollbars=yes,toolbar=1,statusbar=0,width=605,height=485,top="+t+",left="+l); } function CheckArticleCommentForm(){ if(document.getElementById('ArticleRating_3')){ var sel=false; var ok=false; for(i=1; i < 6; i++){ eval("sel=document.getElementById('ArticleRating_"+i+"').checked;"); if(sel) ok=true; } if(!ok){ alert("Pilih rating untuk guratan ini."); return false; } } if(document.getElementById('ArticleComment')){ if(document.getElementById('ArticleComment').value.length < 3){ alert('Masukkan komentar.'); return false; } } if('1'=='1'){ if(document.getElementById('FromEmail').value.length < 3){ alert('Masukkan alamat email Anda. Ini tidak akan diterbitkan dimanapun dalam situs ini.'); return false; } } if('1'=='1'){ if(document.getElementById('FromName').value.length < 3){ alert('Masukkan nama Anda.'); return false; } } return true; } function CheckBlogCommentForm(){ if(document.getElementById('ArticleComment')){ if(document.getElementById('ArticleComment').value.length < 3){ alert('Masukkan komentar.'); return false; } } if('1'=='1'){ if(document.getElementById('FromEmail').value.length < 3){ alert('Masukkan alamat email Anda. Ini tidak akan diterbitkan dimanapun dalam situs ini.'); return false; } } if('1'=='1'){ if(document.getElementById('FromName').value.length < 3){ alert('Masukkan nama Anda.'); return false; } } return true; } function CheckArticleCommentForm1(){ var sel=false; var ok=false; for(i=1; i < 6; i++){ eval("sel=document.getElementById('ArticleRating_"+i+"').checked;"); if(sel) ok=true; } if(ok){ if(document.getElementById("addCommentBox").checked==1){ if(document.getElementById("ArticleComment").value==""){ alert("Masukkan komentar."); document.getElementById("ArticleComment").focus(); return false; }else return true; } }else{ alert("Pilih rating untuk guratan ini."); return false; } } function CheckArticleCommentForm2(){ var sel=false; var ok=false; if(document.getElementById("ArticleComment").value==""){ alert("Masukkan komentar."); document.getElementById("addCommentBox").checked=true; swapComment(); document.getElementById("ArticleComment").focus(); return false; }else{return true;} } function CheckEmailForm(frm){ if(frm.YourName.value==""){ alert("Masukkan nama Anda."); frm.YourName.focus(); return false; } if(frm.YourEmail.value==""){ alert("Masukkan email Anda."); frm.YourEmail.focus(); return false; } if(frm.YourEmail.value.indexOf(".")==-1 || frm.YourEmail.value.indexOf("@")==-1){ alert("Email Anda tidak valid."); frm.YourEmail.focus(); return false; } if(frm.FriendsName.value==""){ alert("Masukkan nama teman Anda."); frm.FriendsName.focus(); return false; } if(frm.FriendsEmail.value==""){ alert("Masukkan email teman Anda."); frm.FriendsEmail.focus(); return false; } if(frm.FriendsEmail.value.indexOf(".")==-1 || frm.FriendsEmail.value.indexOf("@")==-1){ alert("Email teman Anda tidak valid."); frm.FriendsEmail.focus(); return false; } frm.Message.disabled=false; return true; } function CheckEditArticleForm(){ } var CurrentReplyBox=0; function ReplyToComment(id){ if(id>0){ if(CurrentReplyBox==0){ // we're moving from the default position to a comment document.getElementById('ReplyToComment'+id).innerHTML=document.getElementById('SubmitCommentForm').innerHTML; $('#ReplyToComment'+id).show("normal"); $('#SubmitCommentForm').hide("normal"); document.getElementById('SubmitCommentForm').innerHTML=''; // document.getElementById('commentReplyRow').style.display=''; document.getElementById('ReplyToCommentLink'+id).style.display='none'; document.getElementById('CancelReplyLink'+id).style.display=''; document.getElementById('CommentParentID').value=id; }else{ // we're moving from one comment to another document.getElementById('ReplyToComment'+id).innerHTML=document.getElementById('ReplyToComment'+CurrentReplyBox).innerHTML; $('#ReplyToComment'+id).show("normal"); $('#ReplyToComment'+CurrentReplyBox).hide("normal"); document.getElementById('ReplyToComment'+CurrentReplyBox).innerHTML=''; //document.getElementById('commentReplyRow').style.display=''; document.getElementById('ReplyToCommentLink'+CurrentReplyBox).style.display=''; document.getElementById('CancelReplyLink'+CurrentReplyBox).style.display='none'; document.getElementById('ReplyToCommentLink'+id).style.display='none'; document.getElementById('CancelReplyLink'+id).style.display=''; document.getElementById('CommentParentID').value=id; } }else{ // we are cancelling a reply document.getElementById('SubmitCommentForm').innerHTML=document.getElementById('ReplyToComment'+CurrentReplyBox).innerHTML; $('#SubmitCommentForm').show("slow"); $('#ReplyToComment'+CurrentReplyBox).hide("slow"); document.getElementById('ReplyToComment'+CurrentReplyBox).innerHTML=''; //document.getElementById('commentReplyRow').style.display='none'; document.getElementById('ReplyToCommentLink'+CurrentReplyBox).style.display=''; document.getElementById('CancelReplyLink'+CurrentReplyBox).style.display='none'; document.getElementById('CommentParentID').value=0; } CurrentReplyBox=id; } function LoadUploadedImage(){ var FeatureImageThumbnailName=document.getElementById('FeatureImageThumbnailName').value; var FeatureImageName=document.getElementById('FeatureImageName').value; document.getElementById('FeatureImageFrame').src='http://www.jogjapenatahcinta.com/remote.php?w=ArticleImageForm'; document.getElementById('FeatureImageFrame').style.display='none'; document.getElementById('FeatureImagePreview').src='http://www.jogjapenatahcinta.com/content_images/'+FeatureImageThumbnailName; document.getElementById('FullImageLink').href='http://www.jogjapenatahcinta.com/content_images/'+FeatureImageName; document.getElementById('FeatureImageOptions').style.display=''; } function ArticleImageToggle(onlyEnabled){ var list=new Array; list[0]='artimage_url_row'; list[1]='artimage_file_row'; if(onlyEnabled=='artimage_file_row'){ document.getElementById('FeatureImageFrame').style.display=''; } if(onlyEnabled=='artimage_file_row1'){ document.getElementById('FeatureImageFrame').style.display='none'; onlyEnabled='artimage_file_row'; } for(i=0;i