// JavaScript Document
function confirmaction(link){
	var answer = confirm("Are You Sure?");
	if(answer){
		document.location = link;
	}
}
function OpenWin(src, width, height){
	window.open(src, '', 'location=no, menubar=no, scrollbar=no, status=no, resizable=no, height='+height+', width='+width+', top=150, left=250');
}
var xmlHttp = null;
function GetXmlHttp()
{
  if (window.XMLHttpRequest)
  {// code for all new browsers
    return new XMLHttpRequest();
  }
  else if (window.ActiveXObject)
  {// code for IE5 and IE6
    return new ActiveXObject("Microsoft.XMLHTTP");
  }
}

var lastLayerId = "";
function ToggleDisplay(layerid){
  if(lastLayerId != "" && lastLayerId != layerid)
  {
    document.getElementById(lastLayerId).style.display = "none";
  }
  lastLayerId = layerid;
  if(document.getElementById(lastLayerId).style.display != "block"){
    document.getElementById(lastLayerId).style.display = "block";
  }
  else{
    document.getElementById(lastLayerId).style.display = "none";
  }
}

function GetPage(url)
{
  if(xmlHttp == null)
  {
    xmlHttp = GetXmlHttp();
  }
  xmlHttp.onreadystatechange=XmlHttpStateChange;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}

function XmlHttpStateChange()
{
  if (xmlHttp.readyState==4)
  {
    document.getElementById("MAINCONTENT").innerHTML = xmlHttp.responseText;
  }
}

