/* begin nav */
function initnav(obj) {
	if (document.getElementById && document.getElementById(obj)) {
		navRoot = document.getElementById(obj);
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			// make sure drop downs don't extend past 990
			if (node.offsetLeft > 775) {
				var adjust = 775-node.offsetLeft;
				for (var j=0; j<node.childNodes.length; j++) {
					if (node.childNodes[j].nodeName.toUpperCase() == 'UL') {
						node.childNodes[j].style.left = adjust+'px';
					}
				}
			}
			node.onmouseover = function() {
				if (this.className.indexOf('lo') != -1) {
					if (this.className.indexOf('solid') != -1) {
						this.className = 'hi solid';
					} else {
						this.className = 'hi';
					}
				}
			}
			node.onmouseout = function() {
				if (this.className.indexOf('hi') != -1) {
					if (this.className.indexOf('solid') != -1) {
						this.className = 'lo solid';
					} else {
						this.className = 'lo'
					}
				}
			}
		}
	}
}
/* end nav */

/* begin CJ JS For Search Box 1/22/07*/
function swapSearch(type) {
	if (type != null) {
		// Set form action
		document.searchBox.page.value = getSearchAction(type);
		
		// New multimedia action url
		if (type == "Video") {
			document.searchBox.searchStr.name = "queryString";
			document.searchBox.action = "http://sports.espn.go.com/broadband/video/search";
		}

		// Clear CSS styles
		document.getElementById('searchBox-ESPN').className="none";
		document.getElementById('searchBox-Photos').className="none";
		document.getElementById('searchBox-Video').className="none";

		// Highlight what user clicked
		setTimeout(function(){document.getElementById('searchBox-'+type).className="realm";},100);
	}
}
function getSearchAction(type) {
	action="espn";
	if (type == "Photos") {
		action = "images"
	}
	else if (type == "Video") {
		action = "multimedia";
	}
	return action;
}
/* end CJ JS For Search Box 1/22/07*/

function gotosite(loc) {
	if(loc != null && loc != '') {
		location.href = loc;
		//window.location = loc;
	}
}


/* used for fantasy popup code generated by player linker tool */
var subWindow = null
function newWin(url)    {
if (url.indexOf('http')<0){
	url = "http://games.espn.go.com"+url
}
if (!subWindow || subWindow.closed) {
    subWindow = window.open(url,"newWin",'width=800,height=525,resizable=yes,scrollbars=yes,location=yes,status=yes,toolbar=yes,menubar=yes,directories=yes')
} else {
    subWindow.focus();
    subWindow = window.open(url,"newWin",'width=800,height=525,resizable=yes,scrollbars=yes,location=yes,status=yes,toolbar=yes,menubar=yes,directories=yes')
    }
}        

