$(document).ready(function(){$(".video_player").before('<div id="report_popover"></div>');$("#report_popover").addClass("hide");var a=$("a.like_this").attr("id");changeToUnlike=function(){$("a.like_this").addClass("liked");$("a.like_this").html("Un-like it");$("a.like_this").unbind("click");$("a.like_this").click(function(b){b.preventDefault();$.post("/?add/like",{post_id:a},function(c){if(c!=""){alert(c)}else{changeToLike()}})})};changeToLike=function(){$("a.like_this").removeClass("liked");$("a.like_this").html("Like it");$("a.like_this").unbind("click");$("a.like_this").click(function(b){b.preventDefault();$.post("/?add/like",{post_id:a},function(c){if(c!=""){alert(c)}else{changeToUnlike()}})})};$.post("/?ajax/doilike",{post_id:a},function(b){if(b=="true"){changeToUnlike()}else{}});$(".commentlink").click(function(b){if($(this).hasClass("noshow")){}else{$("#commentsection").toggleClass("hide")}});$(".comment .content").hover(function(){$(this).find(".report").removeClass("hide")},function(){$(this).find(".report").addClass("hide")});$("a.like_this").click(function(c){c.preventDefault();var b=$(this).attr("id");$.post("/?add/like",{post_id:b},function(d){if(d!=""){alert(d)}else{changeToUnlike()}})});$(".report_video").click(function(b){b.preventDefault();if($("#report_popover").html()==""){$("#report_popover").html('<h3>Report this video</h3><p>Thank you for taking your time to file this report. We take your report very seriously. Could you please tell us a little more about why you\'re reporting this video?</p><ul><li><a href="" class="spam">This video is spam</li><li><a href="" class="inappropriate">This video is inappropriate</a></li><li><a href="" class="copyright">This video is violating copyright</a></li><li><a href="" class="duplicate">This video is a duplicate</a></li></ul><a href="" style="float: right;" class="close">Close this window</a>')}$("#report_popover").toggleClass("hide")});$("#report_popover a").live("click",function(d){d.preventDefault();var b=$(".report_video").attr("id");var c=$(this).attr("class");if(c!="close"){$.post("/?add/videoabusereport",{type:c,post_id:b},function(e){$("#report_popover").html('<h3>Thank you!</h3><p>Thank you for your report.</p><p><a href="" class="close">Close this window.</a></p>');$(".report_video").replaceWith('<div class="report">Reported! Thank you!</div>')})}});$("#report_popover .close").live("click",function(b){b.preventDefault();$("#report_popover").toggleClass("hide")});$(".reportcommentlink").click(function(c){c.preventDefault();var b=$(this).parent().attr("id");$("#popover_"+b).removeClass("hide");$("#popover_"+b+" .twopad").remove();$("#popover_"+b).append('<div class="twopad"><b>Are you sure you want to report this comment?</b><br /><a href="#" class="spam_link">Yes, it is spam</a> | <a href="#" class="abuse_link">Yes, it is inappropriate</a> | <a href="#" class="cancel_link">No, nevermind</a></div>');$(".cancel_link").click(function(d){d.preventDefault();$("#popover_"+b).addClass("hide")});$(".spam_link").click(function(d){d.preventDefault();$.post("/?add/commentabusereport",{type:"spam",comment_id:b},function(e){$("#popover_"+b+" .twopad").remove();$("#popover_"+b).append('<div class="twopad">Thank you for your report!<br /><a href="#" class="closebox">[close]</a></div>');$(".closebox").click(function(f){f.preventDefault();$("#popover_"+b).addClass("hide")})})});$(".abuse_link").click(function(d){d.preventDefault();$.post("/?add/commentabusereport",{type:"abuse",comment_id:b},function(e){$("#popover_"+b+" .twopad").remove();$("#popover_"+b).append('<div class="twopad">Thank you for your report!<br /><a href="#" class="closebox">[close]</a></div>');$(".closebox").click(function(f){f.preventDefault();$("#popover_"+b).addClass("hide")})})})})});
