/*** 
Function: 	getSiteMsg
Author: 	Dower Chin
Date:		09/30/2008
Description:
	Function that performs an Ajax call to pull a dsired file that is to be a site message.
	To use:
	
	1. Place a <div id="siteMsg"></div> somewhere on your site. 
		Note that styling in the include file is only for the portion within the div.
		You need to style around the div as necassary, ie, centering within a table, etc.
	2. Place this script near the bottom of your html file. The bottom is necessary because
		Ajax may process the include call before the page renders, and will not know where to put
		the message html data. Putting the code at the end ensures the page is rendered before
		making the call.
		
        <script language="javascript" src="/js/siteMsg.js"></script>
        <script language="javascript">getSiteMsg("PATHTOYOURFILE");</script>
*/


var http = false;

if(navigator.appName == "Microsoft Internet Explorer") {
  http = new ActiveXObject("Microsoft.XMLHTTP");
} else {
  http = new XMLHttpRequest();
} 

function getSiteMsg(msgFile) {
  http.open("GET", msgFile, true);
  http.onreadystatechange=function() {
    if(http.readyState == 4) {
      document.getElementById('siteMsg').innerHTML = http.responseText;
    }
  }
  http.send(null);
}