  function overlayopen(divid,blackoverlayid)
  {
   var browserName = whichBrs();
   var maintableHeight = document.getElementById("bg-mmt-header").offsetHeight;
   var leftPos = (screen.width / 2) - 390;
   var topPos = (screen.height / 2) - 320;
   var bodywidth;
   var bodyheight;
   
   document.getElementById(divid).style.left=leftPos+"px";
   document.getElementById(divid).style.top=topPos+"px";
      
   bodywidth = document.body.scrollWidth;
   bodyheight = document.body.scrollHeight;

   document.getElementById(blackoverlayid).style.height=bodyheight+"px";	

   if(browserName=="IE")
  	{
  	 	document.getElementById(blackoverlayid).style.width=bodywidth+"px";
  	 	document.getElementById(blackoverlayid).style.height=bodyheight+"px";	
  	}

   if(browserName=="Firefox")
  	{
  	 	document.getElementById(blackoverlayid).style.height=bodyheight+"px";	
 		document.getElementById(divid).style.top=topPos-30+"px";	  		
  	}

  	document.getElementById(divid).style.display="block";
  	document.getElementById(blackoverlayid).style.display="block";
  }	
  
  
  function overlayclose(divid,blackoverlayid)
  {
  	document.getElementById(divid).style.display="none";
  	document.getElementById(blackoverlayid).style.display="none";
  }
    
  
function whichBrs() {
		var agt=navigator.userAgent.toLowerCase();
		if (agt.indexOf("opera") != -1) return 'Opera';
		if (agt.indexOf("staroffice") != -1) return 'Star Office';
		if (agt.indexOf("webtv") != -1) return 'WebTV';
		if (agt.indexOf("beonex") != -1) return 'Beonex';
		if (agt.indexOf("chimera") != -1) return 'Chimera';
		if (agt.indexOf("netpositive") != -1) return 'NetPositive';
		if (agt.indexOf("phoenix") != -1) return 'Phoenix';
		if (agt.indexOf("firefox") != -1) return 'Firefox';
		if (agt.indexOf("safari") != -1) return 'Safari';
		if (agt.indexOf("skipstone") != -1) return 'SkipStone';
		if (agt.indexOf("msie") != -1) return "IE";
		if (agt.indexOf("netscape") != -1) return 'Netscape';
		if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla';
		if (agt.indexOf('\/') != -1) {
		if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') {
		return navigator.userAgent.substr(0,agt.indexOf('\/'));}
		else return 'Netscape';} else if (agt.indexOf(' ') != -1)
		return navigator.userAgent.substr(0,agt.indexOf(' '));
		else return navigator.userAgent;
}

/* Ajax functions */

function AJAXInteraction(div,url, callback) {
    var req = init();
    req.onreadystatechange = processRequest;

function init() {
      if (window.XMLHttpRequest) {
        return new XMLHttpRequest();
      } else if (window.ActiveXObject) {
        return new ActiveXObject("Microsoft.XMLHTTP");
      }
    }

function processRequest () {
			if (req.readyState == 4) {
        if (req.status == 200) {
          if (callback) {
            if(document.getElementById(div) != null) {
            	  callback( document.getElementById(div).innerHTML=req.responseText);
                overlayopen("overlaycontents","blackoverlay");
            }
            }
		}
      }
    }
this.doGet = function() {
      req.open("GET", url, true);
      req.send(null);
    }
this.doPost = function(body) {
      req.open("POST", url, true);
      req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
      req.send(body);
    }
}

	/*function load_stylesheet(filename) {
	var css = document.createElement('link');
  css.rel = 'stylesheet';
  css.type = 'text/css';
  css.href = filename;
 	document.body.appendChild(css);
}*/

function makeRequest(url,div) {
	//var stylesheetname = "http://localhost:8080/ishptgo/styles/overlay-alert_210409.css";
	//load_stylesheet(stylesheetname);
	url=url+"?"+Math.random();
	var ai = new AJAXInteraction(div,url, function() { });
  ai.doGet();
}

/* Ajax functions */