<!--

function LoadList(iPage, sSort, sFilter)
{
	var sUri = "./AjaxPages/PokeList.php";
	sUri += "?page=" + iPage;
	sUri += "&sort=" + sSort;
	sUri += "&filter=" + sFilter;
	GetPageXML(sUri, "ContentArea");
}

function PopUpPokeMon(iId, sTitle)
{
	iHeight = 500;
	iWidth = 720;
	sUri = "./AjaxPages/PokeData.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, sElement)
{
	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)
				LoadIntoContent(req.responseText, sElement);
			else
				LoadIntoContent("Error loading children", sElement);
			}
		};
		req.send(null);
	}
}

function LoadIntoContent(sHtml, sElement)
{
	document.getElementById(sElement).innerHTML = sHtml;
}

function InitToolTip() {
	SetupToolTip("ToolTipContent","ToolTipBG",-100,20);
}

function TTPokeIcon(iId) {
	var sURL = "./AjaxPages/PokeCard.php?id="+iId;
	ToolTipStart(sURL,0,0,true);
}

function TTMouseOut() {
	ToolTipEnd();
}

function ExpandContract(sDiv, sCheckObject, sChange1, sChange2)
{
	if (document.getElementById(sCheckObject).innerHTML == sChange2) {
		document.getElementById(sDiv).style.display = "block";
		document.getElementById(sCheckObject).innerHTML = sChange1;
	}
	else {
		document.getElementById(sDiv).style.display = "none";
		document.getElementById(sCheckObject).innerHTML = sChange2;
	}
}
//-->
