$(document).ready(function(){init()});function init(){$("#nojs").hide();$("#optnew").hide();$("#newu").click(function(){toggleOptional()});var deleteLink=0;if(typeof showAdminLink!='undefined'&&showAdminLink==1)deleteLink=1;if(typeof showReportLink!='undefined'&&showReportLink==1){$(".f_tc2").each(function(){var tmp=$(this).parent().prev().find(".f_pid");var lnks='<br><div class="f_trep"><a href="#" rel="'+tmp.attr("name")+'" class="f_replnk">Is this post offensive?</a>'+(deleteLink==1?' <a href="#" rel="'+tmp.attr("name")+'" class="f_dellnk">Delete this post?</a>':'')+'</div>';$(this).append(lnks)});$(".f_replnk").click(function(event){var repyn=$("#f_repyn");var pid=$(this).attr("rel");repyn.html('<a href="#" id="f_repy">Yes</a> | <a href="#" id="f_repn">No</a>');$("#f_repn").click(function(event){repyn.fadeOut("fast");event.preventDefault()});$("#f_repy").click(function(event){$.post('/disorder/forum/report.html',{pid:pid});repyn.fadeOut("fast",function(){repyn.text("Thank You");repyn.fadeIn("fast",function(){setTimeout(function(){repyn.fadeOut("fast")},1500)})});event.preventDefault()});repyn.css("position","absolute");repyn.css("top",$(this).offset().top-repyn.height()-10);repyn.css("left",$(this).offset().left);repyn.css("z-index","2000");repyn.fadeIn("fast");event.preventDefault()});if(deleteLink==1){$(".f_dellnk").click(function(event){var repyn=$("#f_repyn");var pid=$(this).attr("rel");repyn.html('<a href="#" id="f_repy">Yes</a> | <a href="#" id="f_repn">No</a>');$("#f_repn").click(function(event){repyn.fadeOut("fast");event.preventDefault()});$("#f_repy").click(function(event){$.post('/disorder/forum/delete.html',{p:pid});repyn.fadeOut("fast",function(){repyn.text("Deleted");repyn.fadeIn("fast",function(){setTimeout(function(){repyn.fadeOut("fast")},1500)})});event.preventDefault()});repyn.css("position","absolute");repyn.css("top",$(this).offset().top-repyn.height()-10);repyn.css("left",$(this).offset().left);repyn.css("z-index","2000");repyn.fadeIn("fast");event.preventDefault()})}}}function toggleOptional(){if(document.getElementById("newu").checked)$("#optnew").slideDown("fast");else $("#optnew").slideUp("hide")}
