var emoticons_max_number=3;function max_emoticons(c,b){var d=0;var a=c.match(/\[confused\]|\[crying\]|\[happy\]|\[kidding\]|\[mad\]|\[sad\]|\[scared\]|\[serious\]|\[shy\]|\[skeptical\]|\[smile\]|\[surprised\]|\[wink\]|\[laugh\]|\[love\]/g);if(a!=null){d=a.length}else{d=0}if(d>b){alert("The maximum number of emoticons in a post is "+emoticons_max_number);return true}else{return false}}function add_emoticon(a){var b=document.comments.comment.value;if(!max_emoticons(b,emoticons_max_number-1)){b=b+" "+a+" ";document.comments.comment.value=b}}function validateComment(){if(document.comments.thename){var d=document.comments.thename.value}var c=document.comments.comment.value;illegal_chars=new RegExp("[^ .A-Za-z0-9-_]");document.comments.antibot.value="passedJStest";if(findLeetSpeak(c)){return false}if(findCurseWords(c)){return false}if(findTextAbuse(c)){return false}if(max_emoticons(c,emoticons_max_number)){return false}var b=c.replace(/\s+/g,"");var b=b.replace(/\[[a-z]+\]/g,"");var a=b.length;if(document.comments.thename){if((d=="")||(d.length>30)){alert("Your guest name is empty or over the maximum of 30 characters");document.comments.thename.focus();return false}else{if(illegal_chars.test(d)){alert(d.match(illegal_chars)+" is an illegal character in a name. You can only use alphanumerical characters, spaces, point, dash and underscore.");document.comments.thename.focus();return false}}}if(c==""){alert("Please insert your comment");document.comments.comment.focus();return false}else{if((a<50)||(c.length<50)){alert("Your comment has "+a+" characters, the minimum is 50.\nPlease compose a more complete sentence.\nPosts stuffed with repetitive characters to avoid this message will be deleted.");document.comments.comment.focus();return false}else{if(c==c.toUpperCase()){alert("Please don't post in all uppercase, it is considered shouting");document.comments.comment.focus();return false}}}return true};

