var sLastTab = "";
var sLastTabNews = "20040408";
var sLastTabPictures = "TableWindow";
var sLastTabSupport = "FAQ";
var gbSubWebAccess = false;

function OpenCodeFinder()
{
	window.open('http://scenario.com/IPN/CodeFinder1.htm','CodeFinder','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=320, height=356, top=100, left=100');
}

function SetTab(oTab)
{
return;
	if (!oTab || oTab.id == sLastTab)
		return;
	if (sLastTab)
		header.document.getElementById(sLastTab).src = "tabs/" + sLastTab + "Off.png";
	oTab.src = "tabs/" + oTab.id + "On.png";
	sLastTab = oTab.id;
}

function LoadFrame()
{
	// sometimes the menu frame doesn't load
//alert(self.contents1);
//alert(self.contents1.location);
//	if (!self.contents1 || self.contents1.location.substr("menu.htm") == -1)
		self.contents1.location = "menu.htm";
	if (location.search) {
		var input = unescape(location.search.substr(1));
		if (input) {
			var srchArray = input.split("&");
			var tempArray = new Array();
			for (var i = 0; i < srchArray.length; i++) {
				tempArray = srchArray[i].split("=");
				if (tempArray[0] == "page") {
					self.main1.location.href = tempArray[1];
					return;
				}
				if (tempArray[0] == "version") {
					//alert(tempArray[1]);
				}
			}
		}
	}
	//SetTab(header.document.getElementById('Card'));
	//self.main1.location.href = "products.htm";
	//alert(self.main1.location.href);
	//if (self.main1.src == undefined)
		//self.main1.location = "products.htm";
}

function LoadedPage(sLevel, sSite, sPage)
{
	var asSections = [
		"iPoker",
		"card",
		"poker"
		];
		
	var i;
	if (top.contents1) {
		// close everything
		for (i = 0; i < asSections.length; i++)
			if (top.contents1.document.getElementById(asSections[i]))
				top.contents1.document.getElementById(asSections[i]).style.display = "none";
		// open the selected section
		if (top.contents1.document.getElementById(sSite))
			top.contents1.document.getElementById(sSite).style.display = "block";
		// special case for iPoker Card
		if (sSite == "iPoker")
			top.contents1.document.getElementById("card").style.display = "block";
		// actual submenus (could parse this)

		if (sSite == "") {
			if (top.contents1.Select) // why?
				top.contents1.Select(sPage);
		}
		else if (top.contents1.Select) // why?
			top.contents1.Select(sSite + "/" + sPage);
	}
	else if (sSite == "") // top level
		window.location = sLevel + "index.htm?page=" + sPage;
	else
		window.location = sLevel + "index.htm?page=" + sSite + "/" + sPage;

/*
if (top.header)
	top.SetTab(top.header.document.getElementById('Pictures'));
else
	window.location = "../index.htm?tab=Pictures";
*/
}

function GetPageParameter(sKey)
{
	if (location.search) {
		var input = unescape(location.search.substr(1));
		if (input) {
			var srchArray = input.split("&");
			var tempArray = new Array();
			for (var i = 0; i < srchArray.length; i++) {
				tempArray = srchArray[i].split("=");
				if (tempArray[0] == sKey)
					return tempArray[1];
			}
		}
	}
	return "";
}


