﻿window.onload = function(){

}
function doSubmit(ref){
   var comment = document.getElementById('txtComment').value;
        if (comment != ""){
            WCFGallery.JSON_insertGalleryComment(comment,ref , insertGalleryCommentOnComplete, insertGalleryCommentOnError);
            }else{
            alert("silahkan tulis comment terlebih dahulu");
            }
        }
        
        function insertGalleryCommentOnComplete(result){
            if (result == "") {
            document.getElementById("txtComment").innerHTML = "&nbsp;";         
            document.getElementById("divStatusComment").innerHTML = "Komentar telah berhasil dikirimkan";
            window.location=document.location.href;
            }else if (result == "-1"){
            document.getElementById("divStatusComment").innerHTML = "Silahkan Login terlebih dahulu";
            } else {
                document.getElementById("divStatusComment").innerHTML = "Komentar gagal dikirimkan, silahkan mencoba kembali ";
            }
        
        }
        

        function insertGalleryCommentOnError(){
        }
 
 function doSubmitAlbum(sn,ac,ar){
   var comment = document.getElementById('txtComment').value;
        if (comment != ""){
            WCFGallery.JSON_insertGalleryCommentAlbum(comment ,sn ,ac ,ar, insertGalleryCommentAlbumOnComplete, insertGalleryCommentAlbumOnError);
            }else{
            alert("silahkan tulis comment terlebih dahulu");
            }
        }
        
        function insertGalleryCommentAlbumOnComplete(result){
            if (result == "") {
            document.getElementById("txtComment").innerHTML = "&nbsp;";         
            document.getElementById("divStatusComment").innerHTML = "Komentar telah berhasil dikirimkan";
            window.location=document.location.href;
            }else if (result == "-1"){
            document.getElementById("divStatusComment").innerHTML = "Silahkan Login terlebih dahulu";
            } else {
                document.getElementById("divStatusComment").innerHTML = "Komentar gagal dikirimkan, silahkan mencoba kembali ";
            }
        
        }
        

        function insertGalleryCommentAlbumOnError(){
        }
 
 
