
function goPlay(fileName) {
         window.open(fileName,"Game_Window","toolbar=no,height=490,width=630,screenX=1,screenY=1,resizable=no,scrollbars=yes");
}

function goPlay1(fileName) {
    window.open(fileName,"Game_Window","toolbar=no,height=570,width=630,screenX=1,screenY=1,resizable=no,scrollbars=no");
}

function goPlayBig(fileName) {
window.open(fileName, "Game_Window", "status=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes,width=792,height=490,top=20,left=20" );
}

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 popupWithScrollSize(fileName,width,height) {
    window.open(fileName,"PopUpPage","toolbar=no,height="+height+",width="+width+",screenX=1,screenY=1,resizable=no,scrollbars=1");
}

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;
    }
    self.location = newurl;
}

function confirmLegal(ftpSite) {
    var P1 = "";
    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) {
    quesPos = destURL.indexOf("?");
	if (myHostName.indexOf("icq.com") > -1) {
	    location.href = "http://icq.ea.com/exphat.jsp?destURL=" + destURL;
	} else {
		if (quesPos==-1) {
	        location.href = "http://" + document.domain + "/exphat.jsp?destURL=" + destURL;
	    }
	    else {
	        str1 = destURL.substring(0,quesPos);
	        str2 = destURL.substring(quesPos+1,destURL.length);
	        destURL = str1 + "&" + str2;
	        location.href  = "http://" + document.domain + "/exphat.jsp?destURL=" + destURL;
	    }
	}
}

function gotoExperienceSite2(myHostName, destURL) {
    location = (destURL + "?p=" + myHostName);
}

function openWin(URL) {
    OpenWin = this.open(URL, "CtrlWindow", "width=400,height=300,menubar=no,scrollbars=yes,toolbar=no");
}

function relativeLink(destination) {
    if (location.hostname == "ea.icq.com") {
        location.href = "http://icq.ea.com"+destination;
    }
    else {
        location.href = destination;
    }
}

function goToNonSecure(url){
	nonSecureUrl = "http://"+document.domain+url;
	self.location=nonSecureUrl;
}

function nonSecureUrl(url){
	nonSecure = "http://"+document.domain+url;
	return nonSecure;
}

// Fixes Netscape 4.x resize issue
if ((navigator.appName == "Netscape") && (parseFloat(navigator.appVersion) > 4.08)){
        window.captureEvents(Event.RESIZE);
        window.onresize = handleResize;
}

// Fixes Netscape 4.x resize issue: call by IF above
function handleResize(){
        location.reload();
        return false;
}

function rollimg(imgname, imgloc) {
	for(i=0; i<document.images.length; i++){
		if(document.images[i].name == imgname){
			document.images[i].src = "http://images.ea.com/"+imgloc;
			return;
			}
	}
};

function openNewWindow(fileName,width,height) {
    window.open(fileName,"newWindow","toolbar=yes,height="+height+",width="+width+",screenX=1,screenY=1,resizable=yes,scrollbars=1,location=1,status=1,directories=1,menubar=1");
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,id,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) {
  
		  if ((obj=MM_findObj(args[i]))!=null) { 
	  			v=args[i+2];
				id=args[i+3];
				//alert(id);
	    		if (obj.style) { 
					obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; 
				}
			    obj.visibility=v; 
				if(v == "show" || v == "visible") {
					obj.left = anchorPositionLeft( document.getElementById(id) );
					obj.top = anchorPositionTop( document.getElementById(id) ) + 15;
				}
		}
	}
}

function anchorPositionLeft(element) {
	var offsetLeft=element.offsetLeft;
	while ((element=element.offsetParent) != null) { offsetLeft += element.offsetLeft; }
	return offsetLeft;
}

function anchorPositionTop(element) {
	var offsetTop=element.offsetTop;
	while((element=element.offsetParent) != null) { offsetTop += element.offsetTop; }
	return offsetTop;
}

function sf(){document.zipForm2.sZip.focus();}
