function clearDefaultandCSS(el){if(el.defaultValue==el.value){el.value="";}if(el.style){el.className="";}document.getElementById("hk_snap").style.display="";document.getElementById("hk_btn").style.display="";}function blankComment(el){document.getElementById("comment1").className="commentsel";document.getElementById("hk_snap").style.display="none";document.getElementById("hk_btn").style.display="none";document.getElementById("comment1").value="Write a comment...";}var usercontid="";function add_comment(seoTitle,content_uid,content_media,content_id,image){usercontid=content_uid;var comment=document.getElementById("comment1").value;if(isWhitespace(comment)){blankComment();return false;}var uid=readCookie("userid");if(!uid>0){show_new_popup();window.scrollTo(0,0);}else{var parentid=0;var contid=content_id;var body;var title_div="title"+content_id+"_1";var body_div="body"+content_id+"_1";var title=document.getElementById(title_div).innerHTML;try{if(document.getElementById(body_div).innerHTML!=null||document.getElementById(body_div).innerHTML!=""){body=document.getElementById(body_div).innerHTML;}}catch(e){body=" ";}if(readCookie("fb_id")>0){window.scrollTo(0,0);callPublish(readCookie("name"),title,image,seoTitle,body,"add_comment");}if(readCookie("tw_id")>0){window.scrollTo(0,0);popupTwitter(DOMAINNAME+CONTEXT_ROOT+"/content/"+seoTitle,"fulltitle"+content_id+"_1");}blankComment();CommentService.insertComment(comment,uid,contid,parentid,{callback:function(success){CommentService.getCommentsByIdDWRLimit(contid,1,1,showComment_detail);},async:false});}}function showComment_detail(list){var ct="";var userid=readCookie("userid");for(var i=0;i<list.length;i++){var comtid=list[i].uid;ct=ct+"<div id='comment_"+list[i].commentId+"' class='reply_module' onmouseover='showcommentaction("+list[i].commentId+")' onmouseout='hidecommentaction("+list[i].commentId+")'>";ct=ct+"<div class='reply_content'>";ct=ct+"<div class='desc_parent_a'>";ct=ct+"<div class='layer1'>";if(list[i].picture!=""){if(list[i].username!=null||list[i].username!=""){ct=ct+"<a href='"+CONTEXT_ROOT+"/user/"+list[i].username+"'><img style='height:60px;width:60px;' alt='Snap' src='"+list[i].picture+"' class='snap'/></a>";}else{ct=ct+"<a href='"+CONTEXT_ROOT+"/user/"+list[i].uname+"'><img style='height:60px;width:60px;' alt='Snap' src='"+list[i].picture+"' class='snap'/></a>";}}else{if(list[i].username!=null||list[i].username!=""){ct=ct+"<a href='"+CONTEXT_ROOT+"/user/"+list[i].username+"'><img style='height:60px;width:60px;' alt='Snap' src='"+CONTEXT_IMAGEURL+"/hotklixers_snap.gif' class='snap'/></a>";}else{ct=ct+"<a href='"+CONTEXT_ROOT+"/user/"+list[i].uname+"'><img style='height:60px;width:60px;' alt='Snap' src='"+CONTEXT_IMAGEURL+"/hotklixers_snap.gif' class='snap'/></a>";}}ct=ct+"<div class='inner_desc_a'>";ct=ct+"<label class='heading'>";if(list[i].username!=null||list[i].username!=""){ct=ct+"<a href='"+CONTEXT_ROOT+"/user/"+list[i].username+"' id='"+list[i].commentId+"div' onmouseout=resetDivId('"+list[i].commentId+"div') onmouseover=displayProfileSummary('"+list[i].commentId+"div','"+list[i].uname+"','"+list[i].username+"') class='link_b'>"+list[i].name+"</a>&nbsp;&nbsp;";}else{ct=ct+"<a href='"+CONTEXT_ROOT+"/user/"+list[i].uname+"' id='"+list[i].commentId+"div' onmouseout=resetDivId('"+list[i].commentId+"div') onmouseover=displayProfileSummary('"+list[i].commentId+"div','"+list[i].uname+"','"+list[i].username+"') class='link_b'>"+list[i].name+"</a>&nbsp;&nbsp;";}ct=ct+"<span>";ct=ct+list[i].elapsed;ct=ct+"</span>";ct=ct+"</label>";ct=ct+"<span class='actions' id='comment_action_"+list[i].commentId+"' style='display:none;'>";ct=ct+"<a id='comment_abuse_";ct=ct+i;if(comtid==userid){ct=ct+"' ></a>";}else{ct=ct+"' href='#' class='link_b' onclick='reportabuse(this.id,'"+list[i].commentId+"','comment');return false;'>Report Abuse<img alt='Filters' src='"+CONTEXT_IMAGEURL+"/filter_arrow_a.gif' class='no_float'/></a>";}if(comtid==userid||userid==usercontid){ct=ct+"<a id='comment_abuse_";ct=ct+i;ct=ct+"' href='#' class='link_b' onclick=\"delcomment_detail('"+list[i].commentId+"','"+list[i].contentId+"');return false;\">Delete</a>";}ct=ct+"</span>";ct=ct+"<span class='sub_desc'>";ct=ct+"<a href='#' class='link_default'>"+list[i].comment+"</a>";ct=ct+"</span>";ct=ct+"</div>";ct=ct+"</div>";ct=ct+"</div>";ct=ct+"</div>";ct=ct+"</div>";}ct=ct+document.getElementById("1").innerHTML;document.getElementById("1").innerHTML=ct;}function delcomment_detail(commentid,contentid){CommentService.deleteComment(commentid,contentid,{callback:function(success){removeElement("comment_"+commentid);},async:false});}function removeElement(id){if(navigator.appName=="Microsoft Internet Explorer"){document.getElementById(id).outerHTML="";}else{var parentNode=document.getElementById(id).parentNode;var currentNode=document.getElementById(id);parentNode.removeChild(currentNode);}}var gCommentsPageno=1;function moreComments(){var count=(gCommentsPageno*10)+1;document.getElementById(count).style.display="block";gCommentsPageno++;var totalComments=document.getElementById("commentCount").value;if(totalComments<count+10){document.getElementById("moreCommentsLink").style.display="none";}}function getRelatedByMedia(cid,media){gCid=cid;gMedia=media;callFromPagination(1);}function loadMoreLinks(uid,cid,media){gUid=uid;gCid=cid;gMediaMore=media;callFromPaginationMore(1);}function getPopularByMedia(media,cid){gMedia=media;gCid=cid;callFromPaginationPop(1);}var relatedPageSize=5;function callFromPagination(pageNo){document.getElementById("relatedPagingStr").innerHTML="";preloader("module_details");RelatedContentService.getRelatedContentResult(gCid,gMedia,pageNo,relatedPageSize,function(result){showSelectedMedia(gMedia,"related");if(result.results.length<=0){if(gMedia=="all"){gMedia="links";}document.getElementById("module_details").innerHTML='<p class="label" style="text-align:left;"> There are no related '+gMedia+" </p>";}else{if(relatedPageSize==5){document.getElementById("module_details").innerHTML=displaySynopsis(result.results);}else{document.getElementById("module_details").innerHTML=displaySynopsisSubmitStory(result.results);}gapi.plusone.go();document.getElementById("relatedPagingStr").innerHTML=result.pgString;}});}function callFromPaginationPop(pageNo){document.getElementById("paginationPop").innerHTML="";preloader("module_details");ContentService.getPopularContentResult(gMedia,pageNo,5,"callFromPaginationPop",function(result){gPagingString=result.pgString;showSelectedMedia(gMedia,"popular");if(result.results.length<=0){if(gMedia=="all"){gMedia="links";}document.getElementById("module_details").innerHTML='<p class="label" style="text-align:left;"> There are no popular '+gMedia+" </p>";}else{if(gMedia=="all"){gMedia="links";}else{if(gMedia=="story"){gMedia="stories";}else{if(gMedia=="video"){gMedia="videos";}else{if(gMedia=="photo"){gMedia="photos";}}}}document.getElementById("module_details").innerHTML='<p style="float:left; width:auto; padding:5px 8px 0 10px;">Most popular '+gMedia+" across categories in the last 24 hours.</p>"+displaySynopsis(result.results);gapi.plusone.go();document.getElementById("paginationPop").innerHTML=result.pgString;}});}function callFromPaginationMore(pageNo){document.getElementById("moreFromUserPagingStr").innerHTML="";preloader("module_detailsLink");ContentService.getMoreFromUserResult(gUid,gCid,gMediaMore,pageNo,function(result){showSelectedMedia(gMediaMore,"viewmore");if(result.results.length<=0){if(gMedia=="all"){gMedia="links";}document.getElementById("module_detailsLink").innerHTML='<p class="label" style="text-align:left;"> There are no '+gMedia+" </p>";}else{document.getElementById("module_detailsLink").innerHTML=displaySynopsis(result.results);gapi.plusone.go();document.getElementById("moreFromUserPagingStr").innerHTML=result.pgString;}});}function showSelectedMedia(media,type){if(type=="viewmore"){var photoL=document.getElementById("photolink");var videoL=document.getElementById("videolink");var storyL=document.getElementById("storylink");var allL=document.getElementById("alllink");}else{if(type=="popular"){var photoL=document.getElementById("photopopular");var videoL=document.getElementById("videopopular");var storyL=document.getElementById("storypopular");var allL=document.getElementById("allpopular");}else{if(type=="related"){var photoL=document.getElementById("photorelated");var videoL=document.getElementById("videorelated");var storyL=document.getElementById("storyrelated");var allL=document.getElementById("allrelated");}}}if(media=="photo"){photoL.className="highlight link_c";allL.className="highlight";videoL.className="highlight";storyL.className="highlight";}else{if(media=="video"){videoL.className="highlight link_c";photoL.className="highlight";allL.className="highlight";storyL.className="highlight";}else{if(media=="story"){storyL.className="highlight link_c";photoL.className="highlight";allL.className="highlight";videoL.className="highlight";}else{allL.className="highlight link_c";photoL.className="highlight";videoL.className="highlight";storyL.className="highlight";}}}}function reportabuse(id,cid,parenttype){var posX=0;var posY=0;var reporterid=readCookie("userid");posX=findPosX(document.getElementById(id));posY=findPosY(document.getElementById(id));var uid=readCookie("userid");if(!uid>0){show_new_popup();window.scrollTo(0,0);}else{AbusesService.chkAbusesRecord(reporterid,cid,parenttype,function(data){if(data==1){thickbox("Thank you. You have already reported this link");}else{document.getElementById("report_reason").value="";document.getElementById("comid").value=cid;document.getElementById("ptype").value=parenttype;for(var i=0;i<5;i++){document.report_abused_form.abused_report[i].checked="";}document.getElementById("report_abused").style.top=posY+"px";document.getElementById("report_abused").style.left=posX+"px";document.getElementById("report_abused").style.display="block";}});}}function report1(parenttype){var reporterid=readCookie("userid");var cid=document.getElementById("comid").value;var parenttype=document.getElementById("ptype").value;var racatid="";var body=document.getElementById("report_reason").value;var flag=0;for(var i=0;i<document.report_abused_form.abused_report.length;i++){if(document.report_abused_form.abused_report[i].checked){racatid=document.report_abused_form.abused_report[i].value;flag=1;}}if(flag==0){document.getElementById("message_editprofile").innerHTML='<b style="float:none;font-weight:normal;">Please select a reason for report abuse</b>';document.getElementById("message_editprofile").style.display="";return false;}else{var captchaChallenge=document.getElementById("recaptcha_challenge_field").value;var captchaResponse=document.getElementById("recaptcha_response_field").value;if(captchaResponse==""){document.getElementById("message_editprofile").innerHTML='<b style="float:none;font-weight:normal;">Please enter the verification code.</b>';document.getElementById("message_editprofile").style.display="";return false;}}AbusesService.insertAbusesReport(reporterid,cid,parenttype,racatid,body,captchaChallenge,captchaResponse,showAbuse_detail);}function showAbuse_detail(success){if(success==-1){Recaptcha.reload();document.getElementById("message_editprofile").innerHTML='<b style="float:none;font-weight:normal;">Please enter correct verification code.</b>';document.getElementById("message_editprofile").style.display="";return false;}document.getElementById("report_reason").value="";for(var i=0;i<document.report_abused_form.abused_report.length;i++){document.report_abused_form.abused_report[i].checked="";}document.getElementById("message_editprofile").innerHTML="";document.getElementById("message_editprofile").style.display="none";Recaptcha.reload();close_block("report_abused");if(success==1){thickbox("Thank you. You have already reported this link");}else{thickbox("Thank you. Your report has been forwarded to the Hotklix moderator");}}function showcommentaction(commentId){var divnm="comment_action_"+commentId;document.getElementById(divnm).style.display="";}function hidecommentaction(commentId){var divnm="comment_action_"+commentId;document.getElementById(divnm).style.display="none";}
