var _g_blogPostId=null;function addBlogPostComment(b,f,e,h,d){var a=document.getElementById("addBlogPostCommentBtn_"+b);if(a){a.disabled=true}var g=new Object();g.blogPostId=b;g.action="addBlogPostComment";if(d){g.comment=document.getElementById("commentTextPopup").value}else{g.comment=document.getElementById("blogPostCommentText").value}g.commentDeleteCallback=h;g.blogId=f;var c=new Object();c.callbackMethod=e;c.blogPostId=b;c.isPopup=d;formSubmitAJAX("/blogPost/comments",g,"submitAddBlogPostCommentCallback",c)}function submitAddBlogPostCommentCallback(results,callbackParams){if(document.getElementById("blogPostCommentText")){var comments=results.getElementsByTagName("comment");if(comments.length>0){var htmlValue="";for(var i=0;i<comments.length;i++){htmlValue=htmlValue+comments[i].firstChild.nodeValue}if(callbackParams.callbackMethod!=""){eval(callbackParams.callbackMethod)(htmlValue,callbackParams.blogPostId)}}document.getElementById("blogPostCommentText").value="";document.getElementById("addBlogPostCommentBtn_"+callbackParams.blogPostId).disabled=false}if(callbackParams.isPopup){resetPopupDiv()}}function deleteBlogPostComment(d,b,e,a,g){var f=new Object();f.action="deleteBlogPostComment";f.blogPostId=b;f.commentId=d;f.blogId=e;var c=new Object();c.containerId=a;c.callbackMethod=g;c.commentId=d;c.blogPostId=b;formSubmitAJAX("/blogPost/comments",f,"submitDeleteBlogPostCommentCallback",c)}function submitDeleteBlogPostCommentCallback(results,callbackParams){var containerEle=document.getElementById("userComment_"+callbackParams.commentId);containerEle.style.display="none";if(callbackParams.callbackMethod!=""){eval(callbackParams.callbackMethod)(callbackParams.blogPostId)}}function ci_commentDeletedCallback(b){var a=parseInt(document.getElementById("commentsCountBox_"+b).innerHTML);if(document.getElementById("commentsCountBox_"+b)!=null){document.getElementById("commentsCountBox_"+b).innerHTML=(a-1)}if(document.getElementById("commentsCountBoxTop_"+b)!=null){document.getElementById("commentsCountBoxTop_"+b).innerHTML="Comments ("+(a-1)+")"}}function ci_commentAddedCallback(d,c){var a=parseInt(document.getElementById("commentsCountBox_"+c).innerHTML);if(document.getElementById("commentsCountBox_"+c)!=null){document.getElementById("commentsCountBox_"+c).innerHTML=(a+1)}if(document.getElementById("commentsCountBoxTop_"+c)!=null){document.getElementById("commentsCountBoxTop_"+c).innerHTML="Comments ("+(a+1)+")"}var b=document.getElementById("blogPostCommentsContainer_"+c);b.style.display="";var e=b.innerHTML;b.innerHTML=e+d}function fetchandShowComments(a,d){var c=new Object();c.blogPostId=a;c.p_ret=d;c.action="getComments";var b=new Object();b.blogPostId=a;formSubmitAJAX("/blogPost/comments",c,"fetchAndShowCommentsCB",b)}function fetchAndShowCommentsCB(b,a){var c=b.getElementsByTagName("comments");if(c!=null&&c.length>0){document.getElementById("blogPostComments_"+a.blogPostId).innerHTML=generateAJAXResponseHTML(c[0].childNodes)}document.getElementById("showComments_"+a.blogPostId).href="javascript:showElement('blogPostComments_"+a.blogPostId+"');"}function resetPopupDiv(){hideElement("popUpDiv");if(document.getElementById("popUpContent").innerHTML!=""){document.getElementById("addCommentPopupCon").innerHTML=document.getElementById("popUpContent").innerHTML;document.getElementById("popUpContent").innerHTML=""}}function viewLargeImage(b){var a=document.getElementById("largeImgDiv_"+b).innerHTML;showAndReturnPopupAboveRight(null,-1,-1,a,false,1024,768,"largerPopUpDiv","largerPopUpContent",true)};