function getXMLHTTPRequest(){
		objXmlHttp = false;
        if (window.XMLHttpRequest) {
            objXmlHttp = new XMLHttpRequest();
            if (objXmlHttp.overrideMimeType) {
                objXmlHttp.overrideMimeType('text/xml');
            }
        } else if (window.ActiveXObject) {
            try {
                objXmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    objXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }

        if (!objXmlHttp) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }

		return objXmlHttp;
}

var http = getXMLHTTPRequest();

function useHttpResponse() {
   if (http.readyState == 4) {
    if(http.status == 200) {
	   var timeValue = http.responseText;
       document.getElementById('shoutbox_frame').innerHTML = timeValue;
    }
  } else {
	  //document.getElementById('shoutbox_frame').innerHTML = '<span class="shoutbox_loading"><img src="sysimages/loading2.gif" /><br />Please wait...</span>';
	  //document.getElementById('shoutbox_frame').innerHTML = timeValue;
  }
}

function load_shoutbox(mode,Shout_Name,Shout_URL,ShoutMessage,ShoutIP) {
	switch(mode){
	case 'send':
		var myurl = './features/shoutbox/frame.php';
		var modurl = myurl+'?shoutsubmit=yes&ShoutName='+Shout_Name+'&ShoutURL='+Shout_URL+'&Message='+ShoutMessage+'&IP='+ShoutIP;
		http.open("POST", modurl, true);
		http.onreadystatechange = useHttpResponse;
		http.send(null);
	break;
	case 'load':
		var myurl = './features/shoutbox/frame.php';
		http.open("GET", myurl, true);
		http.onreadystatechange = useHttpResponse;
		http.send(null);
	break;
	}
}

