


if( navigator.appName == "Netscape" && parseInt(navigator.appVersion) == 4) {

   // force a reload when the window is resize so styles aren't lost
   originalWindowWidth = innerWidth;
   originalWindowHeight = innerHeight;
   window.onresize = function() { if(innerWidth != originalWindowWidth || innerHeight != originalWindowHeight) location.reload(); };

   // increase pixel font sizes by 1px in Windows
   if (navigator.platform == "Win32") {
	
  	   // Tag selectors
  	   document.tags.body.fontSize = '11px';
  	   document.tags.td.fontSize = '11px';
  	   document.tags.th.fontSize = '11px';
     	document.tags.p.fontSize = '11px';
  	   document.tags.input.fontSize = '11px';
  	   document.tags.select.fontSize = '11px';
  	   document.tags.textarea.fontSize = '11px';
  	   document.tags.div.fontSize = '11px';
  	   document.tags.span.fontSize = '11px';
  	
  	   // Class selectors
  	   // replace "--className--" with class identifier
  	   //document.classes.--className--.all.fontSize = '11px';
  	
  	   // Id selectors
  	   // replace "--idName--" with id identifier
  	   //document.ids.--idName--.all.fontSize = '11px';
   }
}

//1k DHTML API
d=document;l=d.layers;op=navigator.userAgent.indexOf('Opera')!=-1;
function gE(e,f){if(l){f=(f)?f:self;var V=f.document.layers;if(V[e])return V[e];for(var W=0;W<V.length;)t=gE(e,V[W++]);return t;}if(d.all)return d.all[e];return d.getElementById(e);}
function sE(e){l?e.visibility='show':e.style.visibility='visible';}
function hE(e){l?e.visibility='hide':e.style.visibility='hidden';}
function sZ(e,z){l?e.zIndex=z:e.style.zIndex=z;}
function sX(e,x){l?e.left=x:op?e.style.pixelLeft=x:e.style.left=x;}
function sY(e,y){l?e.top=y:op?e.style.pixelTop=y:e.style.top=y;}
function sW(e,w){l?e.clip.width=w:op?e.style.pixelWidth=w:e.style.width=w;}
function sH(e,h){l?e.clip.height=h:op?e.style.pixelHeight=h:e.style.height=h;}
function sC(e,t,r,b,x){l?(X=e.clip,X.top=t,X.right=r,X.bottom=b,X.left=x):e.style.clip='rect('+t+' '+r+' '+b+' '+x+')';}
function wH(e,h){if(l){Y=e.document;Y.open();Y.write(h);Y.close();}else if(e.innerHTML)e.innerHTML=h;}
/******************************************************************************
	Popup windows
******************************************************************************/

function openPopup(url) {
	openCenteredWindow(url, 'nintendo', 700, 616, 'status', '');
}

function openOffsite(url) {
	openFullChromeWindow(url, 'offsite','status', '');
}


/******************************************************************************
	Scrolling layer
******************************************************************************/

SCROLL_ID = 'scrolling';
SCROLL_TOP = 0;
SCROLL_HEIGHT =423;
SCROLL_WIDTH = 760;
SCROLL_END_ANCHOR_ID = 'endscrolldiv'
SCROLL_INCREMENT = 8;
SCROLL_DELAY = 70;

SCROLL_UP   = 0;
SCROLL_DOWN = 1;
SCROLL_SCROLLTOP = SCROLL_TOP;

var scrollInterval = null;
var scrollDirection = null;

function getContentHeight() {
	if (document.layers){
		return document.layers[SCROLL_ID].document.anchors[SCROLL_END_ANCHOR_ID].y;
   }
	else if (document.all) {
		return document.all[SCROLL_END_ANCHOR_ID].offsetTop;
	}
   else {
      return document.getElementById(SCROLL_END_ANCHOR_ID).offsetTop;
   }
}

function scrollLayerBy(direction, increment, hauteur) {
	var windowHeight = hauteur;
	var windowTop = SCROLL_TOP;
	var windowBottom = windowTop + windowHeight;
	var windowRef = gE(SCROLL_ID);
	
	// get distance from content top to window top
	var topDistance = windowTop - SCROLL_SCROLLTOP;
	
	// get distance from content bottom to window bottom
	var bottomDistance = getContentHeight() - topDistance - windowHeight;

	// if scrolling down
	if (direction == SCROLL_DOWN) {
	
		// if content bottom is at window bottom, don't scroll
		if (bottomDistance <= 0) return;
		
		// if scroll increment would take content bottom above window bottom, reset increment so content bottom will be at window bottom
		if (bottomDistance - increment <= 0) increment = bottomDistance;
		
		// scroll by increment down
		setScrollTop(SCROLL_SCROLLTOP - increment, hauteur)
	}
	
	// if scrolling up
	else if (direction == SCROLL_UP) {

		// if content top is at window top, don't scroll
		if (topDistance <= 0) return;

		// if scroll increment would take content top below window top, reset increment so content top will be at window top
		if (topDistance - increment <= 0) increment = topDistance;

		// scroll by increment up
		setScrollTop(SCROLL_SCROLLTOP + increment, hauteur)
	}
}

function setScrollTop(value, hauteur) {
	sY(gE(SCROLL_ID), value);
	sC(gE(SCROLL_ID), SCROLL_TOP - value, SCROLL_WIDTH, SCROLL_TOP - value + hauteur, 0);
	SCROLL_SCROLLTOP = value;
}

function stopScroll() {
	clearTimeout(scrollInterval);
}

function startScroll(direction) {
   scrollDirection = direction;
   scrollInterval = setInterval('scrollLayerBy(scrollDirection, SCROLL_INCREMENT, SCROLL_HEIGHT)', SCROLL_DELAY);
}
function startScrollBreve(direction) {
   scrollDirection = direction;
   scrollInterval = setInterval('scrollLayerBy(scrollDirection, SCROLL_INCREMENT, SCROLL_HEIGHTBREVE)', SCROLL_DELAY);
}

function positionScrollContent() {
   var scrolling = gE('scrolling');
   sX(scrolling, (getInnerWidth(window) - 107) / 2);
   sE(scrolling);

   var buttons = gE('mainmenu');
   sX(buttons, (getInnerWidth(window) - ( (navigator.appName == 'Netscape' && parseInt(navigator.appVersion) == 4) ? 16 : 0) - 164) / 2);
   sE(buttons);

   var buttons = gE('bottomButtons');
   sX(buttons, (getInnerWidth(window) - ( (navigator.appName == 'Netscape' && parseInt(navigator.appVersion) == 4) ? 16 : 0) + 236) / 2);
   sE(buttons);

   var scrolling = gE('signup');
   sX(scrolling, (getInnerWidth(window) - 562) / 2);
   sE(scrolling);

}

onresize = positionScrollContent;

if (document.layers){
	originalWindowWidth = innerWidth;
	originalWindowHeight = innerHeight;
	onresize=function() { if(innerWidth != originalWindowWidth || innerHeight != originalWindowHeight) location.reload() };
}

