<!--

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)
{
	iWidth = 720;
	iHeight = 540;
	sUri = "./AjaxPages/PokeData.php?id=" + iId;
	PopupManager.CreatePopup({title:sTitle,
														size:{x:iWidth, y:iHeight},
														source:sUri,
														contentType:'ajax',
														resizable:false,
														loc:{x:50, y:200},
														onAjaxComplete:function(PopupId) { AddPopupAccordion(PopupId); } });
	//PopupManager.CreatePopup(iWidth, iHeight, 50, 200, sTitle, sUri, "", "AddPopupAccordion");
}

function AddPopupAccordion(iPopupId)
{
	new Accordion('h3.atStart', 'Span.atStart', {
		opacity: false,
		onActive: function(PokeDataInfoTitle, PokeDataInfo){
			PokeDataInfoTitle.setStyle('color', '#8080ff');
			PokeDataInfo.style.display = 'block';
		},
 
		onBackground: function(PokeDataInfoTitle, PokeDataInfo){
			PokeDataInfoTitle.setStyle('color', '#000000');
			PokeDataInfo.style.display = 'none';
		}
	}, $('accordion_'+iPopupId));
}

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;
	}
}
//-->
