
// 	GLOBALS ++==++==++==++==++==++==++==++==++==++==++==
// 	++==++==++==++==++==++==++==++==++==++==++==++==++==

Array.prototype.indexOf = function(t) {
	var i = this.length;
	while (i--) {
		if (this[i] == t)
			return i;
	}
	return -1;
}

//	GLOBAL: onloadList, a list of functions to call with the onload event
// 	---------------------------------------------------------------------
if (typeof onloadList == "undefined")	var onloadList = new Array();

var OVER = '_over';
var OUT = '';
var ACTIVE = '_active';
		
		
// 	ROLLOVERS   ++==++==++==++==++==++==++==++==++==++==++==
// 	++==++==++==++==++==++==++==++==++==++==++==++==++==++==



// 	RESIZE  ++==++==++==++==++==++==++==++==++==++==++==++==
// 	++==++==++==++==++==++==++==++==++==++==++==++==++==++==

var macie45 = Boolean(navigator.userAgent.toLowerCase().indexOf('mac') != -1 && document.all && !document.getElementById);

// adjusts layout depending if browser window is big or small
resizeFix = function(){
	if (document.body && !macie45) {
		// - - - - - - - - - -
		var contentWidth = 850;
		var bgNegOffset = -221;
		// - - - - - - - - - -
		var windowWidth = document.all ? document.body.clientWidth : window.innerWidth;
		var bs = document.body.style;
		if (windowWidth < contentWidth){
			bs.backgroundPosition = bgNegOffset;
			bs.margin = '10px 0px 0px 0px';		// netscape left
			bs.textAlign = 'left'				// ie left
			if (document.images.mens) {
				buildRollovers('mens', 'mens_noedge');
				imgSwap('mens', OUT);
			}
		} else {
			bs.backgroundPosition = 'center';
			bs.margin = '10px auto 0px auto';	// netscape center (w/ width on body)
			bs.textAlign = 'center'				// ie center
			if (document.images.mens) {
				buildRollovers('mens', 'mens');
				imgSwap('mens', OUT);
			}
		}
	} else {
		// use noedge img for netscape 4/macie4.5 since it never centers
		if (document.images.mens) {
			buildRollovers('mens', 'mens_noedge');
			imgSwap('mens', OUT);
		}
		// force macie45 left w/ no background even though css lets it
		if (document.body && macie45) {
			var bs = document.body.style;
			bs.backgroundImage = 'url()';
			bs.margin = '10px 0px 0px 0px';		// netscape left
			bs.textAlign = 'left'				// ie left
		}
			
	}
}

// if browser is a mac, hack the onresize so it works every time
if (navigator.userAgent.toLowerCase().indexOf('mac') != -1)
	window.onresize = function() { setTimeout("resizeFix();", 1); }
else
 	window.onresize = resizeFix;
 



function getCenterX(width) {
	var x = (640 - width)/2;
	if (screen) {
		x = (screen.availWidth - width)/2;
	}
	return x;
}
function getCenterY(height) {
	var y = (480 - height)/2;
	if (screen) {
        	y = (screen.availHeight - height)/2;
	}
	return y;
}

// 	Functions from old site ++==++==++==++==++==++==++==
// 	++==++==++==++==++==++==++==++==++==++==++==++==++==

//---------------------------------------------------------------------------
//temporary check until iwregex gets better
function strip(v){
	var chr;
	var str="";
	for(var i=0;i<v.length;i++){
	 chr = v.charAt(i);
	 if(chr!="'"&&chr!='"')str+=chr;
	 }
	return (str=="")?"":str;
}
//---------------------------------------------------------------------------
