// convert all characters to lowercase to simplify testing
	var agt=navigator.userAgent.toLowerCase();

	// *** BROWSER VERSION ***
  	// Note: On IE5, these return 4, so use is_ie5up to detect IE5.
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);

    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1));
    var is_nav2 = (is_nav && (is_major == 2));
    var is_nav3 = (is_nav && (is_major == 3));
    var is_nav4 = (is_nav && (is_major == 4));
    var is_nav4up = (is_nav && (is_major >= 4));
    var is_navonly = (is_nav && ((agt.indexOf(";nav") != -1) ||
                     (agt.indexOf("; nav") != -1)) );
    var is_nav5 = (is_nav && (is_major == 5));
    var is_nav5up = (is_nav && (is_major >= 5));

    var is_ie   = (agt.indexOf("msie") != -1);
    var is_ie3  = (is_ie && (is_major < 4));
    var is_ie4  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) );
    var is_ie4up  = (is_ie  && (is_major >= 4));
    var is_ie5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
    var is_ie5up  = (is_ie  && !is_ie3 && !is_ie4);

    // KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
    // or if this is the first browser window opened.  Thus the
    // variables is_aol, is_aol3, and is_aol4 aren't 100% reliable.
    var is_aol   = (agt.indexOf("aol") != -1);
    var is_aol3  = (is_aol && is_ie3);
    var is_aol4  = (is_aol && is_ie4);


function launchWindow(url) {

var theWin = null
	if (theWin == null) {
		theWin = window.open(url, "popup", "resizable=1,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,copyhistory=0,width=400,height=250,screenY=50,left=50,top=50");
		theWin.focus();
	}
}

function launchWin(url) {
	// if pop-up window has not yet been defined, define and open it
	if(!parent.parentWin) {
       	parent.parentWin = window.open(url,"parentWin","width=400,height=200,toolbar=yes,menubar=yes,location=no,scrollbars=yes,resizable=yes,screenX=50,screenY=50,left=50,top=50");
	}

	// else if pop-up window has been defined
	else {
		// if that window is open
		if(!parent.parentWin.closed) {
			// if browser is IE 5 or above or NS 4 or above, assign it focus
			if(is_ie5up || is_nav4up) {
				parent.parentWin.location = url;
				parent.parentWin.focus();
			}
			// else if browser is not IE 5 or above or NS 4 or above, close it and reopen a new one
			else {
			  // window.close(url)
				parent.parentWin.close();
				parent.parentWin = window.open(url,"parentWin","width=400,height=200,toolbar=yes,menubar=yes,location=no,scrollbars=yes,resizable=yes,screenX=50,screenY=50,left=50,top=50");
			}
		}
		// else if the window has been closed, reopen it
		else {
			parent.parentWin = window.open(url,"parentWin","width=400,height=200,toolbar=yes,menubar=yes,location=no,scrollbars=yes,resizable=yes,screenX=50,screenY=50,left=50,top=50");
		}
		return(0);
	}
}


function goPlay(fileName)
{
window.open(fileName,"Game_Window","toolbar=no,height=490,width=630,screenX=1,screenY=1,resizable=no,scrollbars=yes");
 }	 


function goLeader(fileName)
{
	window.open(fileName);
}

function goScreenShot(fileName)
{
	window.open(fileName,"","toolbar=no,height=500,width=640,screenX=1,screenY=1,resizable,scrollbars");
}

function pageClose()
{
	self.close();
}

function openWithToolbars(fileName)
{
	window.open(fileName);
}

function openWithoutToolbars(fileName)
{
	window.open(fileName,"","toolbar=no,height=500,width=640,screenX=1,screenY=1,resizable,scrollbars");
}

function popupWithSize(fileName,width,height)
{
	window.open(fileName,"PopUpPage","toolbar=no,height="+height+",width="+width+",screenX=1,screenY=1,resizable");
}

function popupWithSizeNoresize(fileName,width,height)
{
	window.open(fileName,"PopUpPage","toolbar=no,height="+height+",width="+width+",screenX=1,screenY=1,resizable=no");
}

function popupWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function board(url)
{ 
	if(navigator.appName == "Netscape"){
		newurl = url.replace(/\x25/g,"%25");
		if(parseFloat(navigator.appVersion) <= 4.08){
			newurl = newurl.replace(/\x3dhttp\x3a/g,"=http%3a");
		}
		}else{
		newurl = url;
	}
	boards=window.open(newurl,"boards","width=660,height=579,toolbar=yes,location=yes,menubar=yes,top=1,left=1,resizable=yes,status=yes,scrollbars=yes");
	boards.focus();
}

function confirmLegal(ftpSite)
{
	var P1;
	P1 = "Terms & Conditions of Downloading Materials\n\nThe materials provided on this web site are provided \"as is\", without warranties of any kind. Electronic Arts, its \nsubsidiaries, divisions, affiliaties and licensors (\"EA\") disclaim all warranties, either express or implied, including but not \nlimited to, warranties of merchantability and fitness for a particular purpose.\n\nThere are inherent dangers in the use of any materials available for downloading on the Internet, and you are cautioned \nto make sure that you completely understand the potential risks before downloading any materials. You are soley \nresponsible for adequate protection and backup of the data and equipment used in connection with any of the materials.\nTo the extent allowed by applicable law, in no event will EA be liable for damages of any kind that may be incurred with \nyour hardware, peripherals or software programs.\n\nYou may download one copy of the materials on any single computer for your personal, non-commercial, home use only, \nprovided you keep intact all copyright and other proprietary notices. No materials from this web site may be copied, \nreproduced, modified, republished, uploaded, posted, transmitted or distributed in any way, without prior written consent \nof EA. Unauthorized use of the materials is a violation of EA's copyright and constitutes infringement of EA's proprietary \nrights.\n\nTo accept this agreement and proceed with download click \"OK\" or click \"Cancel\" to decline.";
	if (confirm(P1))
	{ self.location = ftpSite; }
}

function closeGamepop(originUrl)
{
        if (window.name == "Game_Window"){
                window.close();
        }else{
          if (window.history.length > 1)
          {
                window.history.go(-1);
          }
          else  
          {
                window.location.replace(originUrl);
          }
        }
}

function gotoExperienceSite(myHostName, destURL){
 var hatURL = "http://" + myHostName + "/experience/header/header.jsp";
 document.cookie = "brand" + "=" + myHostName + "; domain=.ea.com; path=/";
 document.writeln("<html>");
 document.writeln("<head>");
 document.writeln("<title> E A &nbsp; O N L I N E - Electronic Arts</title>");
 document.writeln("</head>");
 document.writeln("<frameset rows='40,*' frameborder='0' border='0' framespacing='0'>");
 document.writeln("<frame src=" + hatURL + " "+ "marginwidth='0' marginheight='0' scrolling='No' frameborder='No'  noresize>");
 document.writeln("<frame src=" + destURL + " "+ "marginwidth='0' marginheight='0' scrolling='yes' frameborder='No' noresize>");
 document.writeln("</frameset>");
 document.writeln("</html>");
 }

function gotoExperienceSite2(myHostName, destURL){
// document.cookie = "brand" + "=" + myHostName + "; domain=.ea.com; path=/";
 location = (destURL + "?p=" + myHostName)
 }
  
function openWin(URL)
{
	OpenWin = this.open(URL, "CtrlWindow", "width=400,height=300,menubar=no,scrollbars=yes,toolbar=no");
}


