
/* - shoutbox.js - */
// http://wicked-ruffneck-crew.com/portal_javascripts/shoutbox.js?original=1
var ns=(navigator.appName.indexOf("Netscape")!=-1);var ie=(navigator.appName.indexOf("Microsoft Internet Explorer")!=-1);var xhttp_put=false;var xhttp_get=false;var debug=false;
function overrideThisShoutboxForm(){if(!W3CDOM){return false}
if(typeof(shoutbox_id)!='undefined'){sb_form=document.getElementById(shoutbox_id+'-form');sb_form.onsubmit=function(){handleShoutBoxSubmit();return false}}}
function handleShoutBoxSubmit(){sb_nick=document.getElementById(shoutbox_id+'-nick');sb_comment=document.getElementById(shoutbox_id+'-comment');sb_referer=document.getElementById(shoutbox_id+'-referer');sb_button=document.getElementById(shoutbox_id+'-button');document.getElementById(shoutbox_id+'-spinner').style.display='inline';xhttp_put=new XMLHttpRequest();if(sb_comment.value!=''){if(xhttp_put.readyState==0){sb_comment.disabled=true;sb_button.disabled=true;parameters='comment='+encodeURIComponent(sb_comment.value);parameters+='&last_referer='+encodeURIComponent(sb_referer.value);if(sb_nick){sb_nick.disabled=true;parameters+='&nickname='+encodeURIComponent(sb_nick.value)}
xhttp_put.open("POST",sb_form.action,true);xhttp_put.setRequestHeader('Content-Type','application/x-www-form-urlencoded');var id=shoutbox_id
xhttp_put.onreadystatechange=handlePutShoutBox;xhttp_put.send(parameters)}}}
function handlePutShoutBox(){xhttp_get=new XMLHttpRequest();if(xhttp_put.readyState==4){sb_comment.value='';if(sb_nick) sb_nick.value=''}
if(xhttp_get.readyState==0){sb_form=document.getElementById(shoutbox_id+'-form');url_parts=sb_form.action.split('/');url_parts[url_parts.length-1]=shoutbox_ajax_response_template;shoutbox_url=url_parts.join('/');xhttp_get.open("GET",shoutbox_url+'?base_id='+shoutbox_id+'&rand='+Date.parse(Date())+Math.floor(Math.random() * 1000000),true);xhttp_get.onreadystatechange=handleReceiveShoutBox;xhttp_get.send(null)}}
function handleReceiveShoutBox(){if(xhttp_get.readyState==4){response=xhttp_get.responseText
document.getElementById(shoutbox_id).innerHTML=response;document.getElementById(shoutbox_id+'-spinner').style.display='none';sb_form=document.getElementById(shoutbox_id+'-form');sb_form.onsubmit=function(){handleShoutBoxSubmit();return false}}}

