// JavaScript Document

function getHttpObject()
{
var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }
  return xmlHttp;
  }
  
//Load Div
function showAlert(msg, scrWidth, scrHeight, type, loadId){
	var msg;
	var scrWidth;
	var scrHeight;
	var type;
	this.msg 		= msg;
	this.scrWidth 	= scrWidth;
	this.scrHeight 	= scrHeight;
	this.type		= type;
	var myWidth 	= (window.screen.width/2) - scrWidth;	
	var myHeight	= (window.screen.height/2) - scrHeight;
	document.getElementById(loadId).innerHTML = "<img src='images/load.gif' />";
	var xmlHttp = getHttpObject();
	if(type == "Alert")
		xmlHttp.open("GET","../templates/showalert.php?width="+myWidth+"&height="+myHeight,true);
	else if(type == "Confirm")
		xmlHttp.open("GET","../templates/showconfirm.php?width="+myWidth+"&height="+myHeight,true);
	else if(type == "Prompt")
		xmlHttp.open("GET","../templates/showprompt.php?width="+myWidth+"&height="+myHeight,true);
	xmlHttp.send(null);
	if(xmlHttp.readyState == 4){
			document.getElementById.innerHTML = "";			
	}	
}