//<script>

var productpage = false
if (document.layers) 
	{
	origWidth = innerWidth;
	origHeight = innerHeight;
	}
if (document.layers) 
	{
	onresize = reDo;
	}
	else
	{
	onresize = updateproductlayers;
	}
 
 //Variables
 window.onerror = null;
 var bName = navigator.appName;
 var bVer = parseInt(navigator.appVersion);
 var NS4 = (bName == "Netscape" && bVer >= 4 && bVer < 5);
 var NS5 =  (bName == "Netscape" && bVer >= 5);
 var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
 var NS3 = (bName == "Netscape" && bVer < 4);
 var IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4);
 var menuActive = 0
 var menuOn = 0
 var onLayer
 var secondlayer = null
 var timeOn = null
 var loaded = 0
 var displayedmenu = "";
 var newmenu = "";
 var openlayer = false;
 var picCur=0;
 var rotateID;
 var TimerID;
 var menu1 = new Image(); menu1.src = "images/invis.gif";
 var menu2 = new Image(); menu2.src = "images/bluearrow.gif";
 var start_pos = 0
 var destination = 106
 var animationrate = 40
 var timerRunning = false
 var TimerOn1
 var starttime
 var rotateImages ="backward"
 var menuColor = "#000000"

 //PRECACHE IMAGES HERE
main0 = new Image(); main0.src = "images/film97c.gif"; main1 = new Image(); main1.src = "images/film97b.gif"; 
projects0 = new Image(); projects0.src = "images/film97e.gif"; projects1 = new Image(); projects1.src = "images/film97b.gif"; 
films0 = new Image(); films0.src = "images/film97h.gif"; films1 = new Image(); films1.src = "images/film97b.gif"; 
credits0 = new Image(); credits0.src = "images/film97f.gif"; credits1 = new Image(); credits1.src = "images/film97b.gif"; 
contact0 = new Image(); contact0.src = "images/film97g.gif"; contact1 = new Image(); contact1.src = "images/film97b.gif"; 


//Layer variables/Browser sniffer
if (NS5) { 

	    document.layers = document.getElementsByTagName("*") 
		layerStyleRef="layer.";
		layerRef="document.layers";
		styleSwitch=".style";
		visible="visible";
		topRef='top';
		leftRef='left';
		heightRef = 'clip.height';
		DOM_pixelconvert = "px";


} 


//Layer variables/Browser sniffer
if (NS4 || IE4) {
	if (NS4) {
		layerStyleRef="layer.";
		layerRef="document.layers";
		styleSwitch="";
		visible="show";
		topRef='top';
		leftRef='left';
		heightRef = 'clip.height';
	 }else{
		layerStyleRef="layer.style.";
		layerRef="document.all";
		styleSwitch=".style";
		visible="visible";
		topRef='pixelTop';
		leftRef='pixelLeft';
		heightRef = 'pixelHeight';
	 }
}
 


//Netscape resize fix
function reDo()
	{
	if (innerWidth != origWidth || innerHeight != origHeight) location.reload();
	}
 



//Sliding Layers Callling function
function moveLayer(activelayer)
{ 


   if (secondlayer != null) {eval(layerRef+'["'+secondlayer+'"]'+styleSwitch+'.visibility="hidden"');}


   secondlayer =null
   onLayer = activelayer;
	if (timerRunning == true)
	{
	//clearTimeout(TimerOn1)
	}

	if (!openlayer) 
	{	
		Open(activelayer)
	}
	else
	{ 	newmenu = activelayer;
		Close(displayedmenu);
	}
}

//Close a sliding layer
function Close(displayedmenu)
{	Closelayerlocation  = eval('parseInt('+layerRef+'["'+displayedmenu+'"]'+styleSwitch+'.'+leftRef+')');
	activepos = displayedmenu
	openlayer = false
	if (Closelayerlocation >=start_pos)
	{	timerRunning = true
		Closelayerlocation-=animationrate;
		eval(layerRef+'["'+displayedmenu+'"]'+styleSwitch+'.'+leftRef+'='+Closelayerlocation)
		TimerOn1 = setTimeout("Close(activepos)",0)
	}
	else
	{	
	
		eval(layerRef+'["'+displayedmenu+'"]'+styleSwitch+'.visibility="hidden"');
		if (newmenu != displayedmenu) 
			{ 
			Open(newmenu)
			}
		else
			{
			//timerRunning = false;
			}
	}
}


//Open a sliding layer
function Open(activelayer)
{	eval(layerRef+'["'+activelayer+'"]'+styleSwitch+'.visibility="'+visible+'"');

	layerlocation  = eval('parseInt('+layerRef+'["'+activelayer+'"]'+styleSwitch+'.'+leftRef+')');
	activepos = activelayer

	if (layerlocation <=destination)
	{ 	timerRunning = true;
		layerlocation+=animationrate;
		eval(layerRef+'["'+activelayer+'"]'+styleSwitch+'.'+leftRef+'='+layerlocation)
		TimerOn1 = setTimeout("Open(activepos)",0)
	}
	timerRunning = false;
	displayedmenu = activelayer
	openlayer = true;
}


//Display active product layer
function showproductlayer(activelayer)
{	
onLayer = ""
   if (secondlayer != null) {eval(layerRef+'["'+secondlayer+'"]'+styleSwitch+'.visibility="hidden"');}
   secondlayer =null
	if (NS4 || IE4) 
	{
	product = (NS4) ? "ScrollList" : "product"
	if (NS4)
	{
		for (i=0; i<3; i++)
		{
			eval(layerRef+'["'+product+i+'"]'+styleSwitch+'.visibility="hide"');
		}
	
	}
	
	for (i = 0; i<=4; i++)
		{ 
			if (i == activelayer) 
			{
			eval(layerRef+'["'+product+i+'"]'+styleSwitch+'.visibility="'+visible+'"');
				if (NS4) {
						elMain =  eval('document["'+product+i+'"].document.elMain');
						elScroll = eval('document["'+product+i+'"].document.elScroll');
						docHeight = elMain.document.height;
						lyrHeight = elMain.clip.height;
						if (docHeight > lyrHeight){
							elScroll.visibility = "show";
							}//end of sublayer size check
					
				}//end of NS sublayer show
			}//end of show the selected layer
			else 
			//hide the non-selected layers
			{
			eval(layerRef+'["'+product+i+'"]'+styleSwitch+'.visibility="hidden"');
			if (NS4) {eval(layerRef+'["ScrollList'+i+'"].document.elScroll.visibility="hide"');}
			}
		}//end of for-next loop

	}// end of NS4 and IE4 Check

}//end of show product layers

 
//BUTTON ROLLOVERS for the left nav bar
function change(Name,Image,No) { 
	if (NS4) document.leftNav.document.images[Name].src =eval(Image + No + ".src"); 
if (IE4 || NS5) document.images[Name].src =eval(Image + No + ".src"); 
}
 
//Button Rollover of other images
function change2(Name,Image,No) { 
	document.images[Name].src =eval(Image + No + ".src")
}
 
// HIDE MENU - used for non-sliding layer sub menus (like genre sub lists)
function hideLayer(layerName){
		if (layerName != null) {

					if (menuActive == 0) {
					 if (NS4 || IE4) {
					  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
					 }
					}
		 }
}

// TIMER FOR BUTTON MOUSE OUT
function btnTimer() {
 timeOn = setTimeout("btnOut()",1000)
}

// BUTTON MOUSE OUT
function btnOut(layerName) {
 if (menuActive == 0) {
  hideLayer(secondlayer)
  }
}

// MENU MOUSE OVER  
function menuOver(itemName,layerID) {
 if (NS4 || IE4) 
 { 
 onLayer = layerID

  if (NS4) 
	{ 
    document[onLayer].document.images[itemName].src = menu2.src
	} else {
     document.all[itemName].src = menu2.src
	}
  }
}

// MENU MOUSE OUT 
function menuOut(itemName) {
 menuActive = 0 
  if (NS4 || IE4) {
  if (NS4) {
    document[onLayer].document.images[itemName].src = menu1.src
  } else {
     document.all[itemName].src = menu1.src
  }
  }
  //timeOn = setTimeout("hideLayer(onLayer)", 400)
 }

// Creates menu object
function menuLink(title, url, menulink, linkloc) {
 this.title = title
 this.url = url
 this.menulink = menulink
 this.linkloc = linkloc 
}

// Builds menu table
function menuMaker(menuArray) {
	var arrowimage = ""
	 n = ""
	 j = eval(menuArray + ".length") - 1;
	 topofLayer = "<div ID='" + eval(menuArray + ".id") + "'>"
	 wraptop = "<table border='0' cellspacing='0' cellpadding='0'><tr><td><img src='images/hot_up_left.gif'></td><td background='images/hot_top.gif'><font size=1>&nbsp;</font></td><td width='12'><img src='images/hot_up_right.gif'></td></tr><tr><td background='images/hot_left.gif'><font size=1>&nbsp;</font></td><td bgcolor='#000000'>"
	 topTable = topofLayer + wraptop+ "<table border='0' cellspacing='0' cellpadding='0' bgcolor='" + menuColor + "'>"
	 endrow = "</td></tr>"
	 btmTable = "</table>"
	 wrapbottom = "</td><td background='images/hot_right.gif'><font size=1>&nbsp;</font></td></tr><tr><td><img src='images/hot_lower_left.gif'></td><td background='images/hot_bottom.gif'><font size=1>&nbsp;</font></td><td><img src='images/hot_lower_right.gif'></td></tr></table>"
	 btmofLayer =  btmTable+wrapbottom+"</div>"
	 
	 n += topTable
	 for( var i = 0; i <=j; i++) {
		 linktext = eval(menuArray + '[' + i + '].title')
		 linkurl = eval(menuArray + '[' + i + '].url')
		 linkloc = eval(menuArray + '[' + i + '].linkloc')
		 imageOver = eval(menuArray + '.imgname') + i 
		 menulink = eval(menuArray + '[' + i + '].menulink')
		 idname = eval(menuArray + ".id") 
		 
		 if (linkloc == null) {
			linkloc = "_top"
		 }
		 
		 if (menulink !=null) 
			{
			arrowimage =" <img src =\"leftarrow.gif\">"
			txt_btnTime = "btnTimer(); "
			}
		 else
			{
			arrowimage = ""
			if (idname == "companyMenu") {txt_btnTime = "btnTimer(); "} else {txt_btnTime = ""}
			}
		
		 bgnrow = "<tr><td><img src='http://feedback.interplay.com/nav/spacer.gif' width=10 height=8 alt='' border='0' name='" + eval(menuArray + ".imgname") + i + "'></td><td>";
		 n += bgnrow + "<a href='" + linkurl + "' onMouseOver='menuOver(\"" + imageOver + "\",\"" +  idname + "\"); showLayer(\"" + menulink + "\")' onMouseOut='"+txt_btnTime+"menuOut(\"" + imageOver + "\")' class='menus' target='" + linkloc + "'>" + eval(menuArray + "[" + i + "].title") + "</a>" +arrowimage+ endrow
	 	
	 }
	 n +=  btmofLayer
    return n
}

//Jump to a selected product
function gameUpdate(loadpage)
{ 
	select_games = document.topname.select_games
	gameID = select_games.options[select_games.selectedIndex].value;
	if (gameID !=0) {location=loadpage+"?GameID=" + gameID;}
}


//Screen shot slide show
function rotate() {
			if (pics.length !=0)
			{
			 if(rotateID) {
			 clearInterval(rotateID)
			 }
			 if (rotateImages =="forward") 
				{
				forward1();
				}

			if (rotateImages =="backward")
				{
				backward1();
				}
			 rotateID = setInterval("rotate()", 2000)
			}
}


//change the direction of the screen shot rotation
function changeRotate(direction)
{   clearInterval(rotateID);
	rotateImages = direction;
	rotate();
}


//forward rotation of the screen shots
function forward1() {
	clearInterval(rotateID)
	 var picLast = pics.length - 1
	 document.picRotate.src = pics[picLast]
 
	 if(picCur >= picLast)
	 {
		var picNew = 0
	 }else{
		var picNew = picCur + 1
	 }
	 document.picRotate.src = pics[picNew]
	 picCur = picNew
	 
	 if (locations[picCur] != "")
	 {
		document.clicklink.src = "extras_11.gif"
	 }else{
		document.clicklink.src = "extras_1a.gif"
	 }
 
}

//backward rotation of the screen shots
function backward1() {
	clearInterval(rotateID)
	 var picLast = 1
	 document.picRotate.src = pics[picLast]
 
	 if(picCur >= picLast)
	 {
		var picNew = picNew = picCur - 1
	 }else{
		var picNew = pics.length - 1
	 }
	 document.picRotate.src = pics[picNew]
	 picCur = picNew
	 
	 if (locations[picCur] != "")
	 {
		document.clicklink.src = "extras_11.gif"
	 }else{
		document.clicklink.src = "extras_1a.gif"
	 }
 
}

//Open the larger screen shot from the smaller one
function picLink() 
{ 
	if (locations[picCur] != "")
	{
		var imgval = locations[picCur]
		
		options = "menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=510,width=690,alwaysRaised=yes,left="+(screen.width/2 - 190)+",top=40";
		previewWindow = window.open(imgval, "Preview", options);
	}

}

//Show sub menus- used for non-sliding layer sub menus (like genre sub lists)
function showLayer(layerName){
	if (timeOn != null) 
		{
		clearTimeout(timeOn)
		}
	if ((secondlayer !=null) && (secondlayer !=onLayer))
	//if an existing child layer is not open and the current layer does not equal the mouse overlayer then
	{
		eval(layerRef+'["'+secondlayer+'"]'+styleSwitch+'.visibility="hidden"');
	}


	if ( (layerName !=null) && (layerName !="null"))
	{ 
		eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
		secondlayer = layerName
	}
		
}

//Move the summary, features, downloads, and spec layers to a new location based on the current browser width
function updateproductlayers() {

	if (productpage) 
		{
		layer_pos=655;
		min_pos = 202;

		 if(navigator.appName == "Netscape") {
		   		JW = window.innerWidth
		   		//wm.visibility = "hide"
		   		//wm.visibility= "show"
		 		}
		 		else
				{
		   		JW = document.body.clientWidth;
				}


			if ((JW*.9)-layer_pos-min_pos >=1 )
				{
					newposleft = ((JW*.9)-layer_pos)
				}
				else
				{
					newposleft = min_pos
				}

			//eval(layerRef+'["snow"]'+styleSwitch+'.'+leftRef+'='+newposleft)
			product = (NS4) ? "ScrollList" : "product"
			eval(layerRef+'["'+product+'0"]'+styleSwitch+'.'+leftRef+'='+newposleft)
			eval(layerRef+'["'+product+'1"]'+styleSwitch+'.'+leftRef+'='+newposleft)
			eval(layerRef+'["'+product+'2"]'+styleSwitch+'.'+leftRef+'='+newposleft)
			eval(layerRef+'["'+product+'3"]'+styleSwitch+'.'+leftRef+'='+newposleft)
		}

}


//Open the download window
function downloadwindow(idcode)
{
/*
		self.name = "displaywindow";
		url  = "download.asp?idcode="+idcode
		options = "menubar=no,toolbar=no,resizable=no,scrollbars=Yes,height=375,width=400,alwaysRaised=yes,left="+(screen.width/2 - 160)+",top=40";
		downloadWindow = window.open(url, "download", options);
*/
}

prMenu = new Array(1)
prMenu.id = "projectsMenu"
prMenu.imgname = "pr"
prMenu[0] = new menuLink("Projects", "projects.htm", null)
prMenu[1] = new menuLink("Films", "films.htm", null)
prMenu[2] = new menuLink("Credits", "credits.htm", null)
prMenu[3] = new menuLink("Contact", "contact.htm", null)


flMenu = new Array(2)
flMenu.id = "filmsMenu"
flMenu.imgname = "fl"
flMenu[0] = new menuLink("Comedy", "comedy.htm", null)
flMenu[1] = new menuLink("Documentary", "documentary.htm", null)
flMenu[2] = new menuLink("Drama", "drama.htm", null)
flMenu[3] = new menuLink("Horror", "horror.htm", null)
flMenu[4] = new menuLink("TV/News/PSAs", "tnp.htm", null)
flMenu[5] = new menuLink("Industrial", "industrial.htm", null)
flMenu[6] = new menuLink("Experimental", "experimental.htm", null)
flMenu[7] = new menuLink("Lifestyle", "lifestyle.htm", null)


crMenu = new Array(3)
crMenu.id = "creditsMenu"
crMenu.imgname = "cr"
crMenu[0] = new menuLink("Projects", "projects.htm", null)
crMenu[1] = new menuLink("Films", "films.htm", null)
crMenu[2] = new menuLink("Credits", "credits.htm", null)
crMenu[3] = new menuLink("Contact", "contact.htm", null)


ctMenu = new Array(4)
ctMenu.id = "contactMenu"
ctMenu.imgname = "ct"
ctMenu[0] = new menuLink("Projects", "projects.htm", null)
ctMenu[1] = new menuLink("Films", "films.htm", null)
ctMenu[2] = new menuLink("Credits", "credits.htm", null)
ctMenu[3] = new menuLink("Contact", "contact.htm", null)


document.write(menuMaker("prMenu"))
document.write(menuMaker("flMenu"))
document.write(menuMaker("crMenu"))
document.write(menuMaker("ctMenu"))


//creates the menus, starts the screenshot slide show, and creates the netscape slide bar widget for product.asp on load
function init_product()
{
  	updateproductlayers()
	rotate();
	eval(layerRef+'["projectsMenu"]'+styleSwitch+'.'+leftRef+'='+start_pos)
	eval(layerRef+'["filmsMenu"]'+styleSwitch+'.'+leftRef+'='+start_pos)
	eval(layerRef+'["creditsMenu"]'+styleSwitch+'.'+leftRef+'='+start_pos)
	eval(layerRef+'["contactMenu"]'+styleSwitch+'.'+leftRef+'='+start_pos)

	if (NS4)
	{
		makeScroll('ScrollList0');
		makeScroll('ScrollList1');
		//document.ScrollList1.visibility = "hide"
		makeScroll('ScrollList2');
		//document.ScrollList2.visibility = "hide"
		makeScroll('ScrollList3');
		//document.ScrollList3.visibility = "hide"
	}
	showproductlayer(0);
}

//creates the slide menus on load of all pages except product.asp
function init()
{

	eval(layerRef+'["mainMenu"]'+styleSwitch+'.'+leftRef+'=0')
	eval(layerRef+'["projectsMenu"]'+styleSwitch+'.'+leftRef+'=0')
	eval(layerRef+'["filmsMenu"]'+styleSwitch+'.'+leftRef+'=0')
	eval(layerRef+'["creditsMenu"]'+styleSwitch+'.'+leftRef+'=0')
	eval(layerRef+'["contactMenu"]'+styleSwitch+'.'+leftRef+'=0')
}
