var Shoutbox={};Shoutbox.refresh=8E3;Shoutbox.height=180;Shoutbox.scroll=0;Shoutbox.first=true;Shoutbox.lang={};Shoutbox.lang.tooshort="lang:tooshort";Shoutbox.lang.toolong="lang:toolong";Shoutbox.lang.posting="lang:posting";Shoutbox.lang.banned="lang:banned";Shoutbox.disabled={};Shoutbox.disabled.color=false;Shoutbox.disabled.bgcolor=false;Shoutbox.disabled.faces=false;Shoutbox.disabled.b=false;Shoutbox.disabled.i=false;Shoutbox.disabled.u=false;Shoutbox.feature={};Shoutbox.feature.nosound=Shoutbox.feature.b=Shoutbox.feature.i=Shoutbox.feature.u=0;Shoutbox.feature.default_color="#000000";Shoutbox.feature.default_bgcolor="#ffffff";Shoutbox.feature.color="";Shoutbox.feature.bgcolor="";Shoutbox.feature.face="";Shoutbox.hide=false;function Shoutbox_GetFeatures(){var a=Shoutbox.disabled.b?"":Shoutbox_CookieGet("shoutbox_b"),b=Shoutbox.disabled.i?"":Shoutbox_CookieGet("shoutbox_i"),c=Shoutbox.disabled.u?"":Shoutbox_CookieGet("shoutbox_u"),d=Shoutbox.disabled.color?"":Shoutbox_CookieGet("shoutbox_color"),f=Shoutbox.disabled.bgcolor?"":Shoutbox_CookieGet("shoutbox_bgcolor"),g=Shoutbox.disabled.faces?"":Shoutbox_CookieGet("shoutbox_face"),h=Shoutbox_CookieGet("shoutbox_nosound");Shoutbox.feature.b=a==1?0:1;Shoutbox_SetStyle("b");Shoutbox.feature.i=b==1?0:1;Shoutbox_SetStyle("i");Shoutbox.feature.u=c==1?0:1;Shoutbox_SetStyle("u");Shoutbox.feature.nosound=h==1?0:1;Shoutbox_SetStyle("nosound");a=/^(#[a-zA-Z0-9]{3}|#[a-zA-Z0-9]{6}|[a-zA-Z]{3,9})$/;Shoutbox.feature.color=a.test(d)?d:"";if(!Shoutbox.disabled.color){colorPicker.color=Shoutbox.feature.color;colorPicker.bg=false}Shoutbox_SetStyle("color",Shoutbox.feature.color);Shoutbox.feature.bgcolor=a.test(f)?f:"";if(!Shoutbox.disabled.bgcolor){colorPicker.bg_color=Shoutbox.feature.bgcolor;colorPicker.bg=true}Shoutbox_SetStyle("bgcolor",Shoutbox.feature.bgcolor);if(!Shoutbox.disabled.faces){a=/^[a-zA-Z0-9 ]{3,30}$/;Shoutbox.feature.face=a.test(g)?g:"";Shoutbox_SetStyle("face",Shoutbox.feature.face)}document.getElementById("shoutbox_send").disabled=false;document.getElementById("shoutbox_send").value="Send message";document.getElementById("shoutbox_message").disabled=false;document.getElementById("shoutbox_message").value="";Shoutbox.hide=Shoutbox.hide&&Shoutbox_CookieGet("shoutbox_hide")==""||Shoutbox_CookieGet("shoutbox_hide")==1?true:false;if(Shoutbox.hide&&!Shoutbox.popup){Shoutbox.loading=true}else{Shoutbox.hide=0;document.getElementById("shoutbox").style.display="";document.getElementById("shoutbox_message").focus()}}function Shoutbox_SetStyle(a,b,c){switch(a){case"nosound":Shoutbox.feature.nosound=Shoutbox.feature.nosound==1?0:1;if(Shoutbox.feature.nosound){document.getElementById("shoutbox_nosound").style.backgroundImage="url("+smf_images_url+"/bbc/bbc_hoverbg.gif)"}Shoutbox_CookieSet("shoutbox_nosound",Shoutbox.feature.nosound);break;case"b":Shoutbox.feature.b=Shoutbox.feature.b==1?0:1;document.getElementById("shoutbox_message").style.fontWeight=Shoutbox.feature.b==1?"bold":"normal";if(Shoutbox.feature.b){document.getElementById("shoutbox_b").style.backgroundImage="url("+smf_images_url+"/bbc/bbc_hoverbg.gif)"}Shoutbox_CookieSet("shoutbox_b",Shoutbox.feature.b);break;case"i":Shoutbox.feature.i=Shoutbox.feature.i==1?0:1;document.getElementById("shoutbox_message").style.fontStyle=Shoutbox.feature.i==1?"italic":"normal";if(Shoutbox.feature.i){document.getElementById("shoutbox_i").style.backgroundImage="url("+smf_images_url+"/bbc/bbc_hoverbg.gif)"}Shoutbox_CookieSet("shoutbox_i",Shoutbox.feature.i);break;case"u":Shoutbox.feature.u=Shoutbox.feature.u==1?0:1;document.getElementById("shoutbox_message").style.textDecoration=Shoutbox.feature.u==1?"underline":"none";if(Shoutbox.feature.u){document.getElementById("shoutbox_u").style.backgroundImage="url("+smf_images_url+"/bbc/bbc_hoverbg.gif)"}Shoutbox_CookieSet("shoutbox_u",Shoutbox.feature.u);break;case"color":a=/^(#[a-zA-Z0-9]{3}|#[a-zA-Z0-9]{6}|[a-zA-Z]{3,9})$/;Shoutbox.feature.color=a.test(b)?b:"";document.getElementById("shoutbox_message").style.color=Shoutbox.feature.color!=""?Shoutbox.feature.color:Shoutbox.feature.default_color;document.getElementById("shoutbox_message").style.border="1px solid "+(Shoutbox.feature.color!=""?Shoutbox.feature.color:Shoutbox.feature.default_color);if(!Shoutbox.disabled.color){Shoutbox_CookieSet("shoutbox_color",Shoutbox.feature.color);colorPicker.color=Shoutbox.feature.color;c&&ColorPicker_ShowHide();Shoutbox_Hover(document.getElementById("shoutbox_color"),false)}break;case"bgcolor":a=/^(#[a-zA-Z0-9]{3}|#[a-zA-Z0-9]{6}|[a-zA-Z]{3,9})$/;Shoutbox.feature.bgcolor=a.test(b)?b:"";document.getElementById("shoutbox_message").style.backgroundColor=Shoutbox.feature.bgcolor!=""?Shoutbox.feature.bgcolor:Shoutbox.feature.default_bgcolor;if(!Shoutbox.disabled.bgcolor){Shoutbox_CookieSet("shoutbox_bgcolor",Shoutbox.feature.bgcolor);colorPicker.bg_color=Shoutbox.feature.bgcolor;c&&ColorPicker_ShowHide();Shoutbox_Hover(document.getElementById("shoutbox_bgcolor"),false)}break;case"face":a=/^[a-zA-Z0-9 ]{3,30}$/;Shoutbox.feature.face=a.test(b)?b:"";if(Shoutbox.feature.face!=""){document.getElementById("shoutbox_message").style.fontFamily=Shoutbox.feature.face;Shoutbox_CookieSet("shoutbox_face",Shoutbox.feature.face)}document.getElementById("shoutbox_faces").style.display="none";Shoutbox_Hover(document.getElementById("shoutbox_face"),false);break;case"smileys":b=document.getElementById("shoutbox_smileys").style;b.display=b.display=="none"?"":"none"}Shoutbox.first||document.getElementById("shoutbox_message").focus(document.getElementById("shoutbox_message").value.length-1)}function Shoutbox_ShowHide(a){if(Shoutbox.popup){return false}var b=document.getElementById("shoutbox");if(b.style.display=="none"){b.style.display="";document.getElementById("shoutbox_img").src=smf_images_url+"/collapse.gif";a||Shoutbox_CookieSet("shoutbox_hide",0);Shoutbox.loading=false;Shoutbox.hide=false;Shoutbox_GetMsgs()}else{b.style.display="none";document.getElementById("shoutbox_img").src=smf_images_url+"/expand.gif";a||Shoutbox_CookieSet("shoutbox_hide",1);Shoutbox.msgs!==false&&window.clearTimeout(Shoutbox.msgs);Shoutbox.loading=true;Shoutbox.hide=true}return false}function Shoutbox_CookieGet(a){var b=document.cookie,c=b.indexOf(a+"=");if(c==-1){return""}c+=a.length+1;e=b.indexOf(";",c);return unescape(e==-1?b.substring(c):b.substring(c,e))}function Shoutbox_CookieSet(a,b){document.cookie=a+"="+escape(b)}function Shoutbox_getXML(a,b){if(window.XMLHttpRequest){var c=new XMLHttpRequest;c.onreadystatechange=function(){c.readyState==4&&c.status==200&&b(c.responseXML)};c.open("GET",a,true);c.send(null)}}function Shoutbox_sendXML(a,b,c){if(window.XMLHttpRequest){var d=new window.XMLHttpRequest;d.onreadystatechange=function(){if(d.readyState==4){d.status==200?c(d.responseXML):c(false)}};d.open("POST",a,true);typeof d.setRequestHeader!="undefined"&&d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");d.send(b)}}Shoutbox.posting=Shoutbox.loading=Shoutbox.msgs=false;Shoutbox.currentmsg=1;Shoutbox.countmsgs=Shoutbox.maxmsgs=0;Shoutbox.keepmsgs=100;function Shoutbox_GetMsgs(){if(!(Shoutbox.posting||Shoutbox.loading)){Shoutbox.msgs!==false&&window.clearTimeout(Shoutbox.msgs);Shoutbox.loading=true;document.getElementById("shoutbox_status").style.visibility="visible";Shoutbox_getXML(smf_scripturl+"?action=shoutbox;sa=get;xml;row="+Shoutbox.maxmsgs+(Shoutbox.first?";restart":""),Shoutbox_PutMsgs)}}function Shoutbox_PutMsgs(a){Shoutbox.msgs!==false&&window.clearTimeout(Shoutbox.msgs);if(a&&a.getElementsByTagName("banned")[0]){setOuterHTML(document.getElementById("shoutbox_banned"),"");document.getElementById("shoutbox_status").style.visibility="hidden";document.getElementById("shoutbox_send").value="Send message";document.getElementById("shoutbox_send").disabled=true;document.getElementById("shoutbox_message").value="";document.getElementById("shoutbox_message").disabled=true;return window.alert(Shoutbox.lang.banned)}var b=false;if(a&&a.getElementsByTagName("error")[0]){b=a.getElementsByTagName("error")[0].childNodes[0].nodeValue}if(!a||!a.getElementsByTagName("msgs")[0]){if(!Shoutbox.hide){Shoutbox.msgs=window.setTimeout("Shoutbox_GetMsgs();",Shoutbox.refresh);Shoutbox.loading=false}document.getElementById("shoutbox_status").style.visibility="hidden";b&&window.alert(b)}else{var c=!Shoutbox.first&&a.getElementsByTagName("reset")[0];if(Shoutbox.ie){var d="";if(Shoutbox.msgdown){d+='<table cellspacing="0" cellpadding="0" border="0" align="left"><tr><td valign="bottom" height="'+Shoutbox.height+'"><table id="shoutbox_table" cellspacing="0" cellpadding="2" border="0">';d+=(c?"":getInnerHTML(document.getElementById("shoutbox_table")))+a.getElementsByTagName("msgs")[0].childNodes[0].nodeValue;d+="</table></td></tr></table>"}else{d+='<table id="shoutbox_table" cellspacing="0" cellpadding="2" border="0" align="left">';d+=a.getElementsByTagName("msgs")[0].childNodes[0].nodeValue+(c?"":getInnerHTML(document.getElementById("shoutbox_table")));d+="</table>"}setInnerHTML(document.getElementById("shoutbox_banned"),d)}else{if(c){Shoutbox.msgdown?setInnerHTML(document.getElementById("shoutbox_banned"),'<table cellspacing="0" cellpadding="0" border="0" align="left"><tr><td valign="bottom" height="'+Shoutbox.height+'"><table id="shoutbox_table" cellspacing="0" cellpadding="2" border="0"><tr id="shoutbox_msgs"></tr></table></td></tr></table>'):setInnerHTML(document.getElementById("shoutbox_banned"),'<table id="shoutbox_table" cellspacing="0" cellpadding="2" border="0" align="left"><thead id="shoutbox_msgs"></thead></table>')}setOuterHTML(document.getElementById("shoutbox_msgs"),a.getElementsByTagName("msgs")[0].childNodes[0].nodeValue)}if(c){Shoutbox.currentmsg=1;Shoutbox.countmsgs=Shoutbox.maxmsgs=0}c=parseInt(a.getElementsByTagName("count")[0].childNodes[0].nodeValue);if(Shoutbox.countmsgs+c>Shoutbox.keepmsgs){for(d=Shoutbox.currentmsg;d<Shoutbox.currentmsg+Shoutbox.countmsgs+c-Shoutbox.keepmsgs;d++){document.getElementById("shoutbox_row"+d).parentNode.removeChild(document.getElementById("shoutbox_row"+d))}Shoutbox.currentmsg+=Shoutbox.countmsgs+c-Shoutbox.keepmsgs}Shoutbox.maxmsgs+=c;Shoutbox.countmsgs=Shoutbox.countmsgs+c>Shoutbox.keepmsgs?Shoutbox.keepmsgs:Shoutbox.countmsgs+c;if(!Shoutbox.hide){Shoutbox.msgs=window.setTimeout("Shoutbox_GetMsgs();",Shoutbox.refresh);Shoutbox.loading=false}document.getElementById("shoutbox_status").style.visibility="hidden";if(Shoutbox.msgdown&&(document.getElementById("shoutbox_banned").scrollTop>=Shoutbox.scroll||Shoutbox.scroll==0)){document.getElementById("shoutbox_banned").scrollTop=document.getElementById("shoutbox_banned").scrollHeight;document.getElementById("shoutbox_banned").scrollTop=document.getElementById("shoutbox_banned").scrollHeight;Shoutbox.scroll=document.getElementById("shoutbox_banned").scrollTop}b&&window.alert(b);!Shoutbox.first&&a.getElementsByTagName("newmsgs")[0]&&Shoutbox_NewMsgs()}Shoutbox.first=false}function Shoutbox_NewMsgs(){if(!Shoutbox.feature.nosound){var a=document.getElementById("shoutbox_object");if(typeof a.TCallLabel!="undefined"){a.TCallLabel("/shoutbox","start")}else{a=document.getElementById("shoutbox_embed");typeof a.TCallLabel!="undefined"&&a.TCallLabel("/shoutbox","start")}}}Shoutbox.maxlength=1024;Shoutbox.minlength=1;function Shoutbox_SentMsg(a){if(!Shoutbox.first){if(Shoutbox.posting){return window.alert(Shoutbox.lang.posting)}Shoutbox.posting=true;document.getElementById("shoutbox_send").disabled=true;msg=document.getElementById("shoutbox_message").value;if(!msg||msg==""||msg.length<Shoutbox.minlength){Shoutbox.posting=false;document.getElementById("shoutbox_send").disabled=false;return window.alert(Shoutbox.lang.tooshort+""+Shoutbox.minlength)}if(msg.length>Shoutbox.maxlength){Shoutbox.posting=false;document.getElementById("shoutbox_send").disabled=false;return window.alert(Shoutbox.lang.toolong+""+Shoutbox.maxlength)}var b=[];b[b.length]="msg="+escape(Shoutbox_toEntities(msg.replace(/&#/g,"&#38;#"))).replace(/\+/g,"%2B");if(Shoutbox.feature.b){b[b.length]="bold=1"}if(Shoutbox.feature.i){b[b.length]="italic=1"}if(Shoutbox.feature.u){b[b.length]="underline=1"}var c=/^(#[a-zA-Z0-9]{3}|#[a-zA-Z0-9]{6}|[a-zA-Z]{3,9})$/;if(c.test(Shoutbox.feature.color)){b[b.length]="color="+Shoutbox.feature.color}if(c.test(Shoutbox.feature.bgcolor)){b[b.length]="bgcolor="+Shoutbox.feature.bgcolor}c=/^[a-zA-Z0-9 ]{3,30}$/;if(c.test(Shoutbox.feature.face)){b[b.length]="face="+Shoutbox.feature.face}Shoutbox.msgs!==false&&window.clearTimeout(Shoutbox.msgs);Shoutbox.loading=true;document.getElementById("shoutbox_status").style.visibility="visible";document.getElementById("shoutbox_message").value="";document.getElementById("shoutbox_message").focus();Shoutbox_sendXML(smf_scripturl+"?action=shoutbox;sa=send;sesc="+a+";xml;row="+Shoutbox.maxmsgs,b.join("&"),Shoutbox_PostMsg)}}function Shoutbox_PostMsg(a){Shoutbox.msgs!==false&&window.clearTimeout(Shoutbox.msgs);Shoutbox.posting=false;document.getElementById("shoutbox_send").disabled=false;Shoutbox_PutMsgs(a)}function Shoutbox_Hover(a,b){if(!b&&a.alt!=""){if(a.alt=="faces"||a.alt=="smileys"){if(document.getElementById("shoutbox_"+a.alt).style.display!="none"){return}}else{if(a.alt=="color"){if(document.getElementById("colorpicker").style.display!="none"){return}}else{if(a.alt=="bgcolor"){if(document.getElementById("colorpicker").style.display!="none"){return}}else{if(Shoutbox.feature[a.alt]){return}}}}}a.style.backgroundImage="url("+smf_images_url+(b?"/bbc/bbc_hoverbg.gif)":"/bbc/bbc_bg.gif)")}function Shoutbox_toEntities(a){for(var b="",c=0;c<a.length;c++){b+=a.charCodeAt(c)>127?"&#"+a.charCodeAt(c)+";":a.charAt(c)}return b}function openWin(a,b,c,d){if(b&&self.screen.availWidth*0.8<b||c&&self.screen.availHeight*0.8<c){d=false;b=Math.min(b,self.screen.availWidth*0.8);c=Math.min(c,self.screen.availHeight*0.8)}else{d=typeof d!="undefined"&&d==true}window.open(a,"shoutbox","toolbar=no,location=no,status=no,menubar=no,scrollbars="+(d?"no":"yes")+",width="+(b?b:480)+",height="+(c?c:220)+",resizable=no");return false};
