<!--

function PopUpImage(iId, sTitle, iWidth, iHeight)
{
	iHeight += 28;

	if (iWidth > 700) {
		iWidth = 700;
		iHeight += 20;
	}

	if (iHeight > 660) {
		iHeight = 660;
		iWidth += 20;
	}

	sUri = "./Show.php?id=" + iId;
	PopupManager.CreatePopup(iWidth, iHeight, 50, 10, sTitle, sUri);
}

function GetPage(iPage)
{
	sUri = "Gallery.php";
	if ((iPage > 0) && (iPage < 4))
	{
		sUri += "?type=" + iPage;
		GetPageXML(sUri);
	}
	else
	{
		document.href.location = "http://matt.cookiedoom.com";
	}
}

function GetPageXML(sUri)
{
	var req;
	req = false;
  // branch for native XMLHttpRequest object
  if(window.XMLHttpRequest) {
  	try {
			req = new XMLHttpRequest();
    }
		catch(e) {
			req = false;
    }
    	// branch for IE/Windows ActiveX version
  }
	else if(window.ActiveXObject) {
  	try {
   		req = new ActiveXObject("Msxml2.XMLHTTP");
  	}
		catch(e) {
    	try {
    		req = new ActiveXObject("Microsoft.XMLHTTP");
    	}
			catch(e) {
    		req = false;
    	}
		}
  }
	if(req) {
		//req.onreadystatechange = processReqChange;
		req.open("GET", sUri, true);
		req.onreadystatechange = function () {
		if (req.readyState == 4) {
			if(req.status == 200)
				LoadPage(req.responseText);
			else
				LoadPage("Error loading children");
			}
		};
		req.send(null);
	}
}

function LoadPage(sHtml)
{
	document.getElementById("ContentArea").innerHTML = sHtml;
}

//-->
