
var mh2SBwidth='200px';var mh2SBheight='400px';var mh2SBspeed=2;var mh2SBpause=1;var mh2SBdataready=false;var mh2SBGEThttp='';var mh2SBPUThttp='';var mh2SBbasedir='';var mh2SBGetPHP='';var mh2EmotePath='';var mh2temptext='';var mh2SBmarquee='';var mh2SBspeed=2;var mh2SBpause=1;var mh2SBnewshout=0;var mh2SBdirection=0;var mh2SBRefresh=0;var mh2refresh=false;var lengthtest1=0;var lengthtest2=0;var runningspeed=0;var pausespeed=0;var actualheight=0;var direction=1;var refreshtimer=0;var scrolltimer=0;function _mh2_setOptions(p_livepath,p_path,p_speed,p_pause,p_newshouts,p_scrolldirection,p_refresh){mh2SBbasedir=Base64.decode(p_livepath);mh2EmotePath=p_path;mh2SBGetPHP=mh2SBbasedir+'mh2shoutbox.getshouts.php?&mh2emotes=';mh2SBPutPHP=mh2SBbasedir+'mh2shoutbox.putshouts.php';mh2SBmarquee=document.getElementById("mh2vmarquee");mh2SBspeed=p_speed;mh2SBpause=p_pause;mh2SBnewshout=p_newshouts;mh2SBdirection=p_scrolldirection;mh2SBRefresh=p_refresh;runningspeed=mh2SBspeed;pausespeed=((mh2SBpause==0)?mh2SBspeed:0);direction=mh2SBdirection;mh2SBGEThttp=getHTTPObject();mh2SBPUThttp=getHTTPObject();if((mh2SBnewshout==2)&&(mh2SBRefresh<=0))mh2SBnewshout=0;if(window.addEventListener)window.addEventListener("load",initializemarquee,false);else if(window.attachEvent)window.attachEvent("onload",initializemarquee);else if(document.getElementById)window.onload=initializemarquee();}function initializemarquee(){mh2SBmarquee=document.getElementById("mh2vmarquee");mh2SBmarquee.style.top=0;marqueeheight=document.getElementById("mh2marqueecontainer").offsetHeight;actualheight=mh2SBmarquee.offsetHeight;mh2temptext='';if(window.opera||navigator.userAgent.indexOf("Netscape/7")!=-1){mh2SBmarquee.style.height=marqueeheight+'px';mh2SBmarquee.style.overflow='scroll';return;}setTimeout('scrolltimer = setInterval("mh2scrollmarquee()",30)',500);if((mh2SBnewshout==2)&&(mh2SBRefresh>0))refreshtimer=setInterval("_mh2getshouts()",(mh2SBRefresh*1000));}function _mh2receivetext(){if(mh2SBGEThttp.readyState==4){mh2temptext=mh2SBGEThttp.responseText;lengthtest2=mh2temptext.length;if((mh2SBnewshout==1)&&(lengthtest1!=lengthtest2)&&(mh2temptext.length>0))mh2refresh=true;mh2SBGEThttp.close;}}function _mh2getshouts(){if((mh2SBGEThttp.readyState==0)||(mh2SBGEThttp.readyState==4)){mh2SBGEThttp.open('GET',mh2SBGetPHP+mh2EmotePath,true);mh2SBGEThttp.onreadystatechange=_mh2receivetext;mh2SBGEThttp.send(null);}}function mh2scrollmarquee(){if(direction==0){if((mh2SBdirection!=direction)&&(parseInt(mh2SBmarquee.style.top)<=(actualheight*(-1)+8))){document.getElementById("mh2errordisp").innerHTML='End of Data';}else{if(parseInt(mh2SBmarquee.style.top)>(actualheight*(-1)+8))mh2SBmarquee.style.top=parseInt(mh2SBmarquee.style.top)-runningspeed+'px';else{mh2SBmarquee.style.top=parseInt(marqueeheight)+8+'px';mh2refresh=true;}}}else{if((mh2SBdirection!=direction)&&(parseInt(mh2SBmarquee.style.top)>marqueeheight-8)){document.getElementById("mh2errordisp").innerHTML='End of Data';}else{if(parseInt(mh2SBmarquee.style.top)<=marqueeheight-8)mh2SBmarquee.style.top=parseInt(mh2SBmarquee.style.top)+runningspeed+'px';else{mh2SBmarquee.style.top=(actualheight*(-1))+'px';mh2refresh=true;}}}if((mh2refresh==true)&&(mh2SBnewshout==1))mh2refresh=true;if((mh2SBdirection==direction)&&(((direction==0)&&(parseInt(mh2SBmarquee.style.top)>(actualheight*(-1)+8))&&(mh2refresh==true))||((direction==1)&&(parseInt(mh2SBmarquee.style.top)<marqueeheight-8)&&(mh2refresh==true))||((mh2refresh==true)&&(mh2SBnewshout==1)))){if(mh2temptext.length>0)mh2SBmarquee.innerHTML=mh2temptext;mh2SBmarquee=document.getElementById("mh2vmarquee");actualheight=mh2SBmarquee.offsetHeight;mh2temptext='';mh2refresh=false;lengthtest1=lengthtest2;if(direction==0)mh2SBmarquee.style.top=parseInt(marqueeheight)+8+'px';else
mh2SBmarquee.style.top=(actualheight*(-1))+'px';if((mh2SBnewshout==0)||(mh2SBRefresh<=0))_mh2getshouts();}}function _mh2postshout(p_uid){var uname=document.getElementById("mh2uname").value;var theshout=document.getElementById("mh2sb_input").value;var tempurl='mh2uid='+p_uid+'&mh2uname='+Base64.encode(uname)+'&mh2shout=';theshout=theshout.replace(/"/gi,'\\"');theshout=theshout.replace(/'/gi,'`');tempurl+=Base64.encode(theshout);if((theshout.length>0)&&(uname.length>0)){mh2SBPUThttp.open('POST',mh2SBPutPHP,true);mh2SBPUThttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');mh2SBPUThttp.onreadystatechange=_mh2closeshout;mh2SBPUThttp.send(tempurl);}else{if(theshout.length==0){document.getElementById("mh2sb_input").value='';document.getElementById("mh2errordisp").innerHTML='No Input';}if(uname.length==0)document.getElementById("mh2errordisp").innerHTML='No Name';}}function _mh2closeshout(){mh2SBPUThttp.close;document.getElementById("mh2sb_input").value='';_mh2countchars();if((mh2SBnewshout==0)||(mh2SBRefresh<=0))_mh2getshouts();}function _mh2countchars(p_max){var counttext;var uname
uname=document.getElementById("mh2uname").value;counttext=document.getElementById("mh2sb_input").value;if(uname.length==0)document.getElementById("mh2errordisp").innerHTML='No Name';else
document.getElementById("mh2errordisp").innerHTML='';if(p_max>0){if(counttext.length>p_max){document.getElementById("mh2sb_input").value=counttext.substring(0,p_max);document.getElementById("mh2countshout").innerHTML='<span class="mh2sb_errors">MAXIMUM<span>';return;}}if(counttext.length>0)document.getElementById("mh2countshout").innerHTML=counttext.length+((p_max>0)?'/'+p_max:'');else
document.getElementById("mh2countshout").innerHTML='';}function _mh2checkenter(p_event,p_userid){if(p_event.keyCode==13)_mh2postshout(p_userid);}function _mh2switchdirection(){if(direction==1)direction=0;else
direction=1;document.getElementById("mh2errordisp").innerHTML='';}function _mh2speed(p_type){if(p_type=='pause'){if(runningspeed==0)runningspeed=mh2SBspeed;else
runningspeed=0;}if(p_type=='faster'){if(mh2SBspeed<10){mh2SBspeed=mh2SBspeed+1;runningspeed=mh2SBspeed;}}if(p_type=='slower'){if(mh2SBspeed>1){mh2SBspeed=mh2SBspeed-1;runningspeed=mh2SBspeed;}}document.getElementById("mh2speed").innerHTML='( '+parseInt(runningspeed)+' )';}function _mh2emoticons(){var currentstate;currentstate=document.getElementById("mh2emoticons").style.display;if(currentstate=='block')document.getElementById("mh2emoticons").style.display='none';else
document.getElementById("mh2emoticons").style.display='block';}function _mh2useemoticon(p_variable){document.getElementById("mh2sb_input").value+=' '+Base64.decode(p_variable)+' ';document.getElementById("mh2emoticons").style.display='none';_mh2countchars();document.getElementById("mh2sb_input").focus();}function getHTTPObject(){var xmlhttp;try
{var xmlhttp=new XMLHttpRequest();}catch(error){try
{var xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(error){return false;}}return xmlhttp;}var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(input){var output="";var chr1,chr2,chr3,enc1,enc2,enc3,enc4;var i=0;input=Base64._utf8_encode(input);while(i<input.length){chr1=input.charCodeAt(i++);chr2=input.charCodeAt(i++);chr3=input.charCodeAt(i++);enc1=chr1>>2;enc2=((chr1&3)<<4)|(chr2>>4);enc3=((chr2&15)<<2)|(chr3>>6);enc4=chr3&63;if(isNaN(chr2)){enc3=enc4=64;}else if(isNaN(chr3)){enc4=64;}output=output+this._keyStr.charAt(enc1)+this._keyStr.charAt(enc2)+this._keyStr.charAt(enc3)+this._keyStr.charAt(enc4);}return output;},decode:function(input){var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(i<input.length){enc1=this._keyStr.indexOf(input.charAt(i++));enc2=this._keyStr.indexOf(input.charAt(i++));enc3=this._keyStr.indexOf(input.charAt(i++));enc4=this._keyStr.indexOf(input.charAt(i++));chr1=(enc1<<2)|(enc2>>4);chr2=((enc2&15)<<4)|(enc3>>2);chr3=((enc3&3)<<6)|enc4;output=output+String.fromCharCode(chr1);if(enc3!=64){output=output+String.fromCharCode(chr2);}if(enc4!=64){output=output+String.fromCharCode(chr3);}}output=Base64._utf8_decode(output);return output;},_utf8_encode:function(string){string=string.replace(/\r\n/g,"\n");var utftext="";for(var n=0;n<string.length;n++){var c=string.charCodeAt(n);if(c<128){utftext+=String.fromCharCode(c);}else if((c>127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128);}else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128);}}return utftext;},_utf8_decode:function(utftext){var string="";var i=0;var c=c1=c2=0;while(i<utftext.length){c=utftext.charCodeAt(i);if(c<128){string+=String.fromCharCode(c);i++;}else if((c>191)&&(c<224)){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;}else{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}}return string;}}