browser = navigator.appName;
ie = "Microsoft Internet Explorer";
netscape = "Netscape";
os = navigator.platform;
mac = 'MacPPC'

if (browser == ie || os == mac) {
	document.write('<link rel="stylesheet" type="text/css" href="http://espn.go.com/insertfiles/nhl/css/style_ie.css" title="master">');
} else if (browser == netscape) {
	document.write('<link rel="stylesheet" type="text/css" href="http://espn.go.com/insertfiles/nhl/css/style_nn.css" title="master">');
}

ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false

tabsSched = new Array ("teamOne", "teamTwo", "teamThree");

function show(tab) {
	if (browser == netscape) {
		document.layers[tab].visibility = 'visible';
	} else if (browser == ie) {
		document.all[tab].style.visibility = 'visible';
	}
}

function hide(tab) {
	if (browser == netscape) {
		document.layers[tab].visibility = 'hidden';
	} else if (browser == ie) {
		document.all[tab].style.visibility = 'hidden';
	}
}

function display(tab, set) {
	if (set == 0) {
		tabs = tabsSched;       
	}
	if (set == 1) {
		tabs = tabsClub;
	}
	for (var i = 0; i < tabs.length; i++) {
		if (tabs[i] == tab) {
			show(tabs[i]);
		} else {
			hide(tabs[i]);
		}
	}
}
        
function donothing() {} 

function gotosite(site) {            
	if (site != "") {                    
		self.location=site; 
	}
}

function clearForm() {
	document.seeklight.qt.value = "";
}

ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false

function target(page) {
	if (ns4) {
		document.ADspota.document.ADstore.src = page;
	} else if (ie4) {
		parent.ADstore.document.location = page;
	}
}
	
if(!window.saveInnerWidth) {
	window.onresize = resize;
	window.saveInnerWidth = window.innerWidth;
	window.saveInnerHeight = window.innerHeight;
}

function resize() {
	if (saveInnerWidth < window.innerWidth || saveInnerWidth > window.innerWidth ||	saveInnerHeight > window.innerHeight ||	saveInnerHeight < window.innerHeight ) {
		window.history.go(0)
	}
}

function launchWindow (url, name, width, height) {
	var x = 0;
	var y = 0;
	if (navigator.appVersion.length > 0 && navigator.appVersion.charAt(0) > '3' && navigator.appVersion.charAt(0) <= '9') {
		if(width > screen.availWidth - 12) {
			width = screen.availWidth - 12;
		}
		if(height > screen.availHeight - 48) {
			height = screen.availHeight - 48;
		}
		x = (screen.availWidth - 12 - width) / 2;
		y = (screen.availHeight - 48 - height) / 2;
	}
	var params =  "status=1,scrollbars=1,resizable=1,screenX=" + x + ",screenY=" + y + ",width=" + width + ",height=" + height + ")";
	var windowvar = window.open(url, name, params);
}

function launchGameCastHockey(hteam,season,date,live) {
	window.name = "_gamecast";
	var url = "http://scores.espn.go.com/cgi/gamecast/nhl/index.asp?season="+season+"&date="+date+"&hteam="+hteam+"&live="+live+"";
	var name = "gamecast_" + hteam;
	launchWindow (url, name, 650, 625);
}
