var isIe4=false, isDom=false, isMac=false, isWin=false, isNs=false, isNs4=false, isFlash=-1, isLoaded=false;
var isIe=false, isIe50=false, preLoad=new Array(), imgString=new Array(), imgStringActive=new Array();
var imageRoot;

imageRoot="/pp/";

function init()
{
	if (isDom)
	{
		isLoaded=true;
		imgPreload[0]=imageRoot+"_template/images/navigation/home-hover.gif";
		imgPreload[1]=imageRoot+"_template/images/navigation/meet-nigel-hover.gif";
		imgPreload[2]=imageRoot+"_template/images/navigation/episodes-hover.gif";
		imgPreload[3]=imageRoot+"_template/images/navigation/fun-stuff-hover.gif";
		imgPreload[4]=imageRoot+"_template/images/navigation/links-hover.gif";		
	}
}

imgString=("")

function imgPreload()
{
	var imageURL = "";
	var aLength=imgPreload.arguments.length, i;
	for (i=0; i<aLength; i++)
	{
		preLoad[i]=new Image();
		preLoad[i].src=imgPreload.arguments[i];
	}
}


function imgSwap(imgID)
{
	if (isLoaded) 
	{
		imgString=imageRoot+"_template/images/navigation/"+imgID+"-hover.gif";
		document.getElementById(imgID).setAttribute('src',imgString);
	}
}

function restoreImg(imgID,isActive)
{
	if (isLoaded) 
	{
		if(isActive!=1)
		{
			imgString=imageRoot+"_template/images/navigation/"+imgID+"-inactive.gif";
		}
		else
		{
			imgString=imageRoot+"_template/images/navigation/"+imgID+"-active.gif";
		}
		document.getElementById(imgID).setAttribute('src',imgString);
	}
}

isMac=(navigator.platform=="MacPPC")? true:false;
isWin=(navigator.appVersion.indexOf("Win")!=-1)? true:false;
isIe=(navigator.appName=="Microsoft Internet Explorer")? true:false;
isIe4=(document.all)? true:false;
isDom=(document.getElementById)? true:false;
if ((parseInt(navigator.appVersion)==4) && (navigator.appName=="Netscape"))
{
	isNs4 = true;
	isImg = true;
}
window.onload=init;

function gameClose()
{
	document.getElementById('gameFlash').style.display = 'none';
	document.getElementById('gameFlash').innerHTML = '';
	document.getElementById('gameFlash').style.width = '1px';
	document.getElementById('gameFlash').style.height = '1px';
	document.getElementById('gameFlash').style.top = '0px';
	document.getElementById('gameFlash').style.left = '0px';
}
function gameOpen()
{
	document.getElementById('gameFlash').style.width = '758px';
	document.getElementById('gameFlash').style.height = '482px';
	document.getElementById('gameFlash').style.top = '128px';
	document.getElementById('gameFlash').style.left = '1px';
}
function gameBurst()
{
	document.getElementById('gameFlash').style.width = '247px';
	document.getElementById('gameFlash').style.height = '285px';
	document.getElementById('gameFlash').style.top = String(Math.floor(100+300*Math.random()))+'px';
	document.getElementById('gameFlash').style.left = String(Math.floor(5+508*Math.random()))+'px';
}