function reportAbuse(c,b){var a=USER_ID;if(a==0){showLoginPopup()}else{jQuery.facebox('<DIV id="report-abuse-container" style="color:black;"><div class = "title">Report</div><div class = "report-body"><p>You are about to report a violation of our Terms of Use. <span style = "font-weight: bold;">All reports are strictly confidential.</span></p><p>We will NOT remove posts just because you disagree with the statement being made.</p><div id="report-abuse-error" name = "report-abuse-error" class="clear-both error-container" style="display: none;"><span>{MSG}</span></div><div class = "formRow"><label>Reason:<br/>(required)</label><select id="reason" name="reason" class=""><option value="0">Choose One</option><option value="SPAM_OR_ADVERTISEMENT">Spam or Advertisement</option><option value="ATTACKS_OR_OFFENDS">Attacks or Offends</option></select></div><div class = "formRow" style = "height: 70px;"><label>Additional Comments:<br/>(required)</label><textarea maxlength="256" rows="3" name="additional-comments" id="additional-comments"></textarea></div></div><div class = "report-abuse-footer"><button type = "button" onclick = "javascript:submitReportAbuse();">Submit</button><button type = "button" onclick = "javascript:closeReportAbuse();">Cancel</button></div></DIV><DIV class="clear-both"></DIV>');$j("#facebox .body").css({width:"470px"});$j("#facebox .body").css({padding:"0px"});$j("#facebox .footer").hide();$j("#facebox #report-abuse-error").hide();$j("#facebox").css({left:($j(window).width()-$j("#facebox").width())/2});currentQuestionAnswerId=c;reportAbuseType=b}}function closeReportAbuse(){jQuery(document).trigger("close.facebox")}function submitReportAbuse(){var b=validateReporAbuseForm();if(b){var a="/answers/ajax/ajax-action/submit-report-abuse";var e=$j("#facebox #reason").val();var d=$j("#facebox #additional-comments").val();var c={questionAnswerId:currentQuestionAnswerId,reason:e,additionalComments:d,userId:USER_ID,type:reportAbuseType};goAjax(a,c,afterSubmitReportAbuse);jQuery.facebox.loading();$j("#facebox").css({left:($j(window).width()-$j("#facebox").width())/2})}}function afterSubmitReportAbuse(jsonedResponse){var response=eval("("+jsonedResponse+")");var responseShowed=document.getElementById("success-template").innerHTML;responseShowed=responseShowed.replace(/{STATUS-MSG}/g,"Thanks. Your report has been submitted.");jQuery.facebox(responseShowed);$j("#facebox .body").css({padding:"10px",width:"370px"});$j("#facebox .footer").css({"float":"none",width:"auto"});$j("#facebox").css({left:($j(window).width()-$j("#facebox").width())/2})}function validateReporAbuseForm(){var a=true;var b=$j("#reason");var e=$j("#facebox #reason").val();var c=new Array();if(e=="0"){c[c.length]="Please select a reason"}var d=$j("#facebox #additional-comments").val();if(d==""){c[c.length]="The additional comments is required"}if(c.length>0){a=false;goError(c)}return a}function goError(b){var a="";for(i=0;i<b.length;i++){a=a+"<span>"+b[i]+"</span>"}$j("#facebox #report-abuse-error").html(a);$j("#facebox #report-abuse-error").fadeIn();window.setTimeout("$j('#facebox #report-abuse-error').fadeOut();",3000)};