// ==================================================
// Preload menubar images
// ==================================================

if (document.images) {
	img1_hover		= new Image();
	img1_out			= new Image();
	img1_selected	= new Image();
	img2_hover		= new Image();
	img2_out			= new Image();
	img2_selected	= new Image();
   img3_hover		= new Image();
	img3_out			= new Image();
	img3_selected	= new Image();
   img4_hover		= new Image();
	img4_out			= new Image();
	img4_selected	= new Image();
   img5_hover		= new Image();
	img5_out			= new Image();
	img5_selected	= new Image();
   img6_hover		= new Image();
	img6_out			= new Image();
	img6_selected	= new Image();

	img1_hover.src		= "images/topMenu_home_over.gif";
	img1_out.src		= "images/topMenu_home.gif";
	img1_selected.src	= "images/topMenu_home_selected.gif";
   img2_hover.src		= "images/topMenu_whyTib_over.gif";
	img2_out.src		= "images/topMenu_whyTib.gif";
	img2_selected.src	= "images/topMenu_whyTib_selected.gif";
   img3_hover.src		= "images/topMenu_people_over.gif";
	img3_out.src		= "images/topMenu_people.gif";
	img3_selected.src	= "images/topMenu_people_selected.gif";
   img4_hover.src		= "images/topMenu_studio_over.gif";
	img4_out.src		= "images/topMenu_studio.gif";
	img4_selected.src	= "images/topMenu_studio_selected.gif";
   img5_hover.src		= "images/topMenu_orlando_over.gif";
	img5_out.src		= "images/topMenu_orlando.gif";
	img5_selected.src	= "images/topMenu_orlando_selected.gif";
   img6_hover.src		= "images/topMenu_join_tiburon_over.gif";
	img6_out.src		= "images/topMenu_join_tiburon.gif";
	img6_selected.src	= "images/topMenu_join_tiburon_selected.gif";
}
// ==================================================
// Menubar Mouseover Code
// ==================================================

function hover(i) {
    if (document.images)
        eval('document.img'+i+'.src=img'+i+'_hover.src');
}
function out(k) {
    if (document.images)
        eval('document.img'+k+'.src=img'+k+'_out.src');
}
function outSelected(k) {
    if (document.images)
        eval('document.img'+k+'.src=img'+k+'_selected.src');
}
// ================================================================
// Unique Random Game Generator (Home Page) - No longer used
// ================================================================

var Found=false;
var Current = new Array();
var MaxValue=6; //(Example: 5 is equal to: 1,2,3,4,5)
var NumUnique=3;  //The number of unique numbers required
var Count=0;
var Current = new Array(NumUnique);
GetUnique();

/*function displayGames() {
	document.write('<div class="home_games_spacer" style="width:9px"></div>');
	Count=0;
	for(i=0;i<NumUnique;i++) {
		if(Current[i]==1) {
			document.write('<div class="home_games" onmouseover="this.className=&#39;home_games_over&#39;" onmouseout="this.className=&#39;home_games&#39;"><a href="games_madden08.html"><img src="images/home_game1.jpg" width="225" height="298" border="0" alt="Madden NFL 08" /></a></div>');
		}
      else if(Current[i]==2) {
			document.write('<div class="home_games" onmouseover="this.className=&#39;home_games_over&#39;" onmouseout="this.className=&#39;home_games&#39;"><a href="games_nascar08.html"><img src="images/home_game2.jpg" width="225" height="298" border="0" alt="NASCAR 08" /></a></div>');
		}
      else if(Current[i]==3) {
			document.write('<div class="home_games" onmouseover="this.className=&#39;home_games_over&#39;" onmouseout="this.className=&#39;home_games&#39;"><a href="games_tigerWoods08.html"><img src="images/home_game3.jpg" width="225" height="298" border="0" alt="Tiger Woods PGA Tour 08" /></a></div>');
		}
      else if(Current[i]==4) {
			document.write('<div class="home_games" onmouseover="this.className=&#39;home_games_over&#39;" onmouseout="this.className=&#39;home_games&#39;"><a href="games_ncaa08.html"><img src="images/home_game4.jpg" width="225" height="298" border="0" alt="NCAA Football 08" /></a></div>');
		}
      else if(Current[i]==5) {
			document.write('<div class="home_games" onmouseover="this.className=&#39;home_games_over&#39;" onmouseout="this.className=&#39;home_games&#39;"><a href="games_gameShow.html"><img src="images/home_game5.jpg" width="225" height="298" border="0" alt="Game Show" /></a></div>');
		}
      else if(Current[i]==6) {
			document.write('<div class="home_games" onmouseover="this.className=&#39;home_games_over&#39;" onmouseout="this.className=&#39;home_games&#39;"><a href="games_NFLtour.html"><img src="images/home_game6.jpg" width="225" height="298" border="0" alt="NFL Tour" /></a></div>');
		}
		if(i<(NumUnique-1)) {
			document.write('<div class="home_games_spacer"></div>');
		}
	}
}*/

function GetUnique() {
	for (i=0;Count<NumUnique;Count++) {
		Found=false;
		var rndValue = get_random();
		var j=0;
		for (j=0; j<Current.length; j++) {
			if (Current[j] == rndValue) {
				Found=true;
				break;
			}
		}
		if (Found) {
			Count--;
		} else {
			Current[Count]=rndValue;
		}
	}
}
function get_random() {
	var ranNum=(Math.round(Math.random()*(MaxValue-1))+1);
	return ranNum;
}
// ==================================================
// Random (Employee) Header Generator (Home Page)
// ==================================================

var ranNum=0;

function getRandom(numbr) {
	var newNum = (Math.floor(Math.random()*numbr)+1);
	if(newNum == ranNum) { getRandom(numbr); }
	else {
		ranNum = newNum;
		return ranNum;
	}
}
function homeHeader() {
	randNum = getRandom(11);
	switch(randNum) {
		case 1:
			buf='<div class="page_header" style="background-image:url(images/employees/sheetal_home.jpg)" onmouseover="this.className=&#39;page_header_hover&#39;" onmouseout="this.className=&#39;page_header&#39;" onclick="self.location=&#39;bios/bio_Sheetal.html&#39;">';
			buf+='<div class="page_header_text">"Working at Tiburon presents challenges that demand "thinking outside the box" ...almost all of the time! EA offers a fun-filled, challenging ';
			buf+='work environment. It&#39;s not just programming, but the art of programming that we learn and practice here."<br /><br />-Sheetal, Software Engineer</div></div>';
			break
		case 2:
			buf='<div class="page_header" style="background-image:url(images/employees/vince_home.jpg)" onmouseover="this.className=&#39;page_header_hover&#39;" onmouseout="this.className=&#39;page_header&#39;" onclick="self.location=&#39;bios/bio_Vince.html&#39;">';
			buf+='<div class="page_header_text">"Tiburon is full of great people who also happen to be exceptionally talented. It&#39;s exciting to know that the games we&#39;re ';
			buf+='working on are making millions of people happy."<br /><br />-Vince, Software Engineer</div></div>';
			break
		case 3:
			buf='<div class="page_header" style="background-image:url(images/employees/astrid_home.jpg)" onmouseover="this.className=&#39;page_header_hover&#39;" onmouseout="this.className=&#39;page_header&#39;" onclick="self.location=&#39;bios/bio_Astrid.html&#39;">';
			buf+='<div class="page_header_text">"What I like most about working at Tiburon is the fact that I get to work on advanced technology. I also get to work with some of';
			buf+='the smartest people in the industry which gives me the opportunity to learn and grow as a programmer."<br /><br />-Astrid, Software Engineer</div></div>';
			break
		case 4:
			buf='<div class="page_header" style="background-image:url(images/employees/audrey_home.jpg)" onmouseover="this.className=&#39;page_header_hover&#39;" onmouseout="this.className=&#39;page_header&#39;" onclick="self.location=&#39;bios/bio_Audrey.html&#39;">';
			buf+='<div class="page_header_text">"Tiburon is a workplace filled with diversity. It takes all kinds of talents coming together to create a top-selling videogame. ';
			buf+='Even with so many different personalities, everyone at Tiburon has the same goal - delivering a fantastic product."<br /><br />-Audrey, Broadcast Producer</div></div>';
			break
      case 5:
			buf='<div class="page_header" style="background-image:url(images/employees/cory_home.jpg)" onmouseover="this.className=&#39;page_header_hover&#39;" onmouseout="this.className=&#39;page_header&#39;" onclick="self.location=&#39;bios/bio_Cory.html&#39;">';
			buf+='<div class="page_header_text">"I think EA is an amazing place to grow a career. You learn and work with the best people in the ';
			buf+='industry."<br /><br />-Cory, Development Manager</div></div>';
			break
      case 6:
			buf='<div class="page_header" style="background-image:url(images/employees/dale_home.jpg)" onmouseover="this.className=&#39;page_header_hover&#39;" onmouseout="this.className=&#39;page_header&#39;" onclick="self.location=&#39;bios/bio_Dale.html&#39;">';
			buf+='<div class="page_header_text">"EA has given me so many opportunities to try new things and to develop new skills.  Being able to create the products ';
			buf+='that so many people will play and enjoy is really great."<br /><br />-Dale, Executive Producer</div></div>';
			break
      case 7:
			buf='<div class="page_header" style="background-image:url(images/employees/henry_home.jpg)" onmouseover="this.className=&#39;page_header_hover&#39;" onmouseout="this.className=&#39;page_header&#39;" onclick="self.location=&#39;bios/bio_Henry.html&#39;">';
			buf+='<div class="page_header_text">"I really enjoy working with the talented individuals we have here … It&#39;s a great place to learn and grow as a programmer. ';
			buf+='It&#39;s also great place to make friends."<br /><br />-Henry, Technical Director</div></div>';
			break
      case 8:
			buf='<div class="page_header" style="background-image:url(images/employees/jennie_home.jpg)" onmouseover="this.className=&#39;page_header_hover&#39;" onmouseout="this.className=&#39;page_header&#39;" onclick="self.location=&#39;bios/bio_Jennie.html&#39;">';
			buf+='<div class="page_header_text">"The best thing about Tiburon is that I have an opportunity to work on titles that millions of people play ';
			buf+='(including myself)."<br /><br />-Jennie, Software Engineer</div></div>';
			break
      case 9:
			buf='<div class="page_header" style="background-image:url(images/employees/maurice_home.jpg)" onmouseover="this.className=&#39;page_header_hover&#39;" onmouseout="this.className=&#39;page_header&#39;" onclick="self.location=&#39;bios/bio_Maurice.html&#39;">';
			buf+='<div class="page_header_text">"What I like the most about Tiburon is the work environment. The people here are really great and you can really feel ';
			buf+='the vibe that you are working with gamers - people who love making great games!"<br /><br />-Maurice, Associate Character Animator</div></div>';
			break
      case 10:
			buf='<div class="page_header" style="background-image:url(images/employees/mike_home.jpg)" onmouseover="this.className=&#39;page_header_hover&#39;" onmouseout="this.className=&#39;page_header&#39;" onclick="self.location=&#39;bios/bio_Mike.html&#39;">';
			buf+='<div class="page_header_text">"EA attracts the top talent from around the globe. I&#39;ve learned more working here than I ever did in school. I also ';
			buf+='love working on games people care about. It&#39;s very rewarding knowing your hard work is going to be appreciated by millions of ';
			buf+='people."<br /><br />-Mike, Art Director</div></div>';
			break
      case 11:
			buf='<div class="page_header" style="background-image:url(images/employees/olivier_home.jpg)" onmouseover="this.className=&#39;page_header_hover&#39;" onmouseout="this.className=&#39;page_header&#39;" onclick="self.location=&#39;bios/bio_Olivier.html&#39;">';
			buf+='<div class="page_header_text">"EA is a great company to work for, there is a lot of opportunity to learn/grow. I really like being part of one of the ';
			buf+='best game studios in the industry. Me and my family really appreciate being in the sunny Florida!"<br /><br />-Olivier, Senior Software Engineer</div></div>';
			break
	}
	document.getElementById('page_header').innerHTML = buf;
	setTimeout("homeHeader()",12000);
}

// ==================================================
// Tree Menu
// ==================================================

function initTreeMenu(objectName) {
  	eval("orlando_"+objectName+"_visible=false");
  	eval("document.getElementById('sub"+objectName+"').className='orlandoHidden'");
}
function treeMenuMouseOver(objectName) {
	if(eval("orlando_"+objectName+"_visible"))  {
		document.getElementById(objectName).className='treeMenuParent_visible treeMenuParentLink_over';
	}
	else {
   	document.getElementById(objectName).className='treeMenuParent treeMenuParentLink_over';
	}
}
function treeMenuMouseOut(objectName) {
	if(eval("orlando_"+objectName+"_visible"))  {
		document.getElementById(objectName).className='treeMenuParent_visible treeMenuParentLink';
	}
	else {
   	document.getElementById(objectName).className='treeMenuParent treeMenuParentLink';
	}
}
function treeMenu(objectName) {
	isMenuVisible = eval("orlando_"+objectName+"_visible");
	if (!isMenuVisible) {
		eval("orlando_"+objectName+"_visible=true");
		document.getElementById(objectName).className='treeMenuParent_visible treeMenuParentLink_over';
		eval("document.getElementById('sub"+objectName+"').className='orlandoVisible'");
	}
   else {
		eval("orlando_"+objectName+"_visible=false");
		document.getElementById(objectName).className='treeMenuParent treeMenuParentLink_over';
		eval("document.getElementById('sub"+objectName+"').className='orlandoHidden'");
	}
}

// ==================================================
// Orlando Tree Menu
// ==================================================

function initOrlandoMenu(objectName) {
  	eval("orlando_"+objectName+"_visible=false");
  	eval("document.getElementById('sub"+objectName+"').className='orlandoHidden'");
}
function orlandoMenuMouseOver(objectName) {
	if(eval("orlando_"+objectName+"_visible"))  {
		document.getElementById(objectName).className='orlandoMenuParent_visible orlandoMenuParentLink_over';
	}
	else {
   	document.getElementById(objectName).className='orlandoMenuParent orlandoMenuParentLink_over';
	}
}
function orlandoMenuMouseOut(objectName) {
	if(eval("orlando_"+objectName+"_visible"))  {
		document.getElementById(objectName).className='orlandoMenuParent_visible orlandoMenuParentLink';
	}
	else {
   	document.getElementById(objectName).className='orlandoMenuParent orlandoMenuParentLink';
	}
}
function orlandoMenu(objectName) {
	isMenuVisible = eval("orlando_"+objectName+"_visible");
	if (!isMenuVisible) {
		eval("orlando_"+objectName+"_visible=true");
		document.getElementById(objectName).className='orlandoMenuParent_visible orlandoMenuParentLink_over';
		eval("document.getElementById('sub"+objectName+"').className='orlandoVisible'");
	}
   else {
		eval("orlando_"+objectName+"_visible=false");
		document.getElementById(objectName).className='orlandoMenuParent orlandoMenuParentLink_over';
		eval("document.getElementById('sub"+objectName+"').className='orlandoHidden'");
	}
}
