// do not edit this javascript unless cleared through multimedia

// ------------------------
// Browser / OS Detection -
// ------------------------
var IE = (document.all) ? 1 : 0;
var DOM = (document.getElementById) ? 1 : 0;
var NS4 = (document.layers) ? 1 : 0;
var MAC = ((navigator.appVersion.indexOf("PPC") >0) || (navigator.appVersion.indexOf("Mac") >0)) ? 1 : 0;

var ua = navigator.userAgent;
var OPERA = (ua.indexOf("Opera") > 0) ? 1 : 0;
var SAF = (navigator.appVersion.indexOf("Safari") >0) ? 1 : 0;

if (ua.indexOf("AOL") > 0) {
	var s_prop9="AOL"; // for Omniture
	var dclk_seg="aol"; // for Doubleclick
    }


function getEl(el) {
    return document.all ? document.all[el] : document.getElementById(el);
    }

// ---------------------------------
// clipping functions for Mr. Pukey
// and other dynamically positioned
// icons
// ---------------------------------

function clipObj(who) {
    if (IE) { 
        var clipper = document.all[who];
    }
    else if (DOM) {
        var clipper=document.getElementById(who);
    }
    clipper.style.clip = 'rect(0px 19px 32px 0px)';
    timer = setTimeout("unclipObj('"+who+"')", 2500);
}

function unclipObj(who) {
    if (IE) {
        var clipper = document.all[who];
    }
    else if (DOM) {
        var clipper=document.getElementById(who);
    }
    clipper.style.clip = 'rect(0px 64px 32px 0px)';
}


// --------------------------
// Cookie releated functions
// --------------------------

function setCookie (name, value, expires) {
	if (!expires) expires = new Date();
	document.cookie = name + "=" + value + "; expires=" + expires.toGMTString() +";domain=.sportsline.com; path=/";
}

function readCookie(name) {
    if(document.cookie == '') { 
	return false; 
    } else { 
	var firstChar, lastChar;
	var theBigCookie = document.cookie;
	name = name + '=';
	firstChar = theBigCookie.indexOf(name);	
	if (firstChar != -1) {
	    firstChar += name.length;
	    lastChar = theBigCookie.indexOf(';', firstChar); 
	    if(lastChar == -1) lastChar = theBigCookie.length;
	    return unescape(theBigCookie.substring(firstChar, lastChar));
	} else {return false;}
    }	
} 

function killCookie(name, path, domain) {
  var theValue = readCookie(name);
  if(theValue) {
      document.cookie = name + '=' + theValue + '; expires=Fri, 13-Apr-1970 00:00:00 GMT' + ((path)?';path=' + path:'') + ((domain)?';domain=' + domain:''); // set an already-expired cookie
  }
} 

function getValue(cookieName,name) {
	cookieValue=readCookie(cookieName)
	findString=name;
	if (cookieValue) {
		namePos=cookieValue.indexOf(findString,0);
		if (namePos==-1) {return false;}
		valueStart=(cookieValue.indexOf('&',namePos+1)+1);
		valueEnd=cookieValue.indexOf('&',valueStart+1);
		if (valueEnd==-1)  valueEnd=cookieValue.length;
		valueIs=cookieValue.substring(valueStart,valueEnd)
		if (namePos!=null) {return valueIs;}
	}
	else {return false;}
}

function mTrack(mTrackName,mTrackMax,cName,cExpires) {

    if (arguments.length == 2) {var cName='mediaTrack';}
    var newExp = (cExpires) ? ';expires='+cExpires : '';

    var showAd=true;
    if (!readCookie(cName)) {
        newCook=mTrackName +'|' +1;
        document.cookie=(cName +'='  + newCook +";domain=.sportsline.com;path=/" +newExp);
    	}
    else if (readCookie(cName)) {
        oldCook = readCookie(cName);
        var thisAH = oldCook.indexOf(mTrackName);
        if (thisAH==-1) {
            newCook=oldCook +'|' +mTrackName +'|' +1;
            document.cookie=(cName +'=' + newCook +";domain=.sportsline.com;path=/" +newExp);
            }
        else {
            var splitCook = oldCook.split('|');
            var cookPlus; var plusOne;
            for (i=0; i < splitCook.length; i+=2 ) {
                plusOne = i+1;
                if (splitCook[i]==mTrackName) {
                    cookPlus = parseInt(splitCook[plusOne])+1;
                    splitCook[plusOne]=cookPlus;
                    if (cookPlus > mTrackMax) showAd = false;
                    }
                }
            newCook="";
            for (var j=0; j < splitCook.length-1; j+=2) {
                newCook += splitCook[j] + '|' +splitCook[j+1];
                if (j+2 < splitCook.length) {newCook += '|';}
                }
            document.cookie=(cName +'=' + newCook +";domain=.sportsline.com;path=/" +newExp );
            }
        }
    return showAd;
    }

// --------------------------
// window opening functions -
// --------------------------
function openScroll(url,name,width,height) {
    popupWin = window.open(url, name, 'menubar=0,toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,width=' +width +',height=' +height +',left=50,top=50');
}

function openPopup(url,name,width,height) {
	popupWin = window.open(url, name, 'menubar=0,toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=0,width=' +width +',height=' +height +',left=50,top=50');
}

function SW(url, name, type) {//translate legacy popup function to new openPopup
	var swArray = new Array([],[508,494],[494,331],[550,400],[523,360],[532,412],[610,550],[494,550]);
	for (var i=0; i < swArray.length; i++) {
  		var swWidth = swArray[type][0];
		var swHeight = swArray[type][1];
	}
  openPopup(url,name,swWidth,swHeight);
}

// --------------------
// position detection -
// --------------------
function psuedoGetElementById(elm,d){ 
    var p,i,x; if(!d) d=document; if((p=elm.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; elm=elm.substring(0,p);
        }
    if(!(x=d[elm])&&d.all) x=d.all[elm]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][elm];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=document.getElementById(elm,d.layers[i].document);
    return x;
	}
	
function getCoordinates(obj) {
    var point = { x: 0, y: 0 };
    while(obj) {
        point.x += obj.offsetLeft;
        point.y += obj.offsetTop;
        obj = obj.offsetParent;
        }
    return point;
    }

function whereami(anchorid) {
    var locarr = new Array();
    if(NS4) {
        if (document.anchors[anchorid]){
            locarr[0] = document.anchors[anchorid].x;
            locarr[1] = document.anchors[anchorid].y;
            }
        }
    else if(DOM) {
        var myanchor = document.getElementById(anchorid);
        var coordinates = getCoordinates(myanchor)
        if (myanchor){
            locarr[0] = coordinates.x;
            locarr[1] = coordinates.y;
            }
        }
    else {
	var myanchor = psuedoGetElementById(anchorid);
    var coordinates = getCoordinates(myanchor)
    if(myanchor.offsetLeft&&myanchor.offsetTop){
        locarr[0] = coordinates.x;
        locarr[1] = coordinates.y;
        }
    }
	return locarr;
	}

// ------------------------------------------
// 2-tier fast fact drop-down scripts (oly) -
// ------------------------------------------

function ShowLayerFF(showEl,event) {
    if (showEl == "gnddhome") return;
    clearTimeout(timer);
    HideAllLayers();

    if(NS4) {var whichEl = document.layers[showEl];} 
    else if(DOM) {var whichEl = document.getElementById(showEl);}
    else {var whichEl = psuedoGetElementById(anchorid);}

    whichAnchor = showEl + "A";

    var coor= new Array();
    corr = whereami(whichAnchor);
    cmLeft = corr[0];
    cmTop = corr[1];

	if (whichEl.style) {
		if(MAC && IE){
		cmLeft = whichEl.offsetLeft;
		cmTop = 4;
		}
		if (showEl != 'gnddmore' && showEl != 'gnddfantasy' && showEl != 'gnddcycling') {
			if((cmLeft+whichEl.clientWidth)>770){
			cmLeft=(770-whichEl.clientWidth);
			}
		}
		whichEl.style.left = cmLeft;	
		whichEl.style.top = cmTop + 18;
		whichEl.style.visibility = "visible";
	}
	else {	
		whichEl.visibility = "visible";
		whichEl.top = cmTop + 18;
                if (showEl != 'gnddmore' && showEl != 'gnddfantasy' && showEl != 'gnddcycling') {
			    if((cmLeft+whichEl.width)>770){
				cmLeft=(770-whichEl.width);
				}
                }
		whichEl.left = cmLeft;
	} 	
	cmTop = 0; cmLeft = 0;
}

// -------------------------------
// I am not sure what uses this  -
// -------------------------------

function WM_changeLinks(linksstr) {
var linkarr = linksstr.split('|');
        for(urlset in linkarr){
        var urlsetarr = linkarr[urlset].split('^');
        var oldHref = urlsetarr[0];
        var newHref = urlsetarr[1];
                for (daLink = 0; daLink < document.links.length; daLink++) {
						if(urlsetarr[2]=="fuzzy"){
							if (document.links[daLink].href.indexOf(oldHref) != -1) {
							document.links[daLink].href = document.links[daLink].href.replace(oldHref,newHref);
							}
						}
						if(urlsetarr[2]=="exact"){
	                        if (document.links[daLink].href == oldHref || document.links[daLink].href == (oldHref + '/')) {
	                        document.links[daLink].href = newHref;
	                        }
						}
						
                }
			if(typeof(ff_nfl)!="undefined"){			
          	      for (daLink = 0; daLink < ff_nfl.length; daLink++) {
     	                  var linkstr = ff_nfl[daLink][0];
	                       if (linkstr==oldHref || linkstr == (oldHref + '/')) {
                         	ff_nfl[daLink][0]=newHref;
                    	    }
               	 }
			}
        }
}

// --------------------------------------------------------------------------
// AJAX and other scripts for the tab-sets on home page, arenas, and other  -
// --------------------------------------------------------------------------

function getHTTPObject() {
	var xmlhttp;
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		 try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		 } catch (E) {
				xmlhttp = false;
		 }
	}

	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
		} catch (e) {
			xmlhttp = false;
		}
	}

	return xmlhttp;
}



<!-- scripts-tab -->
function tabSetParent(){
    this.newSet = function( name ){
        eval( 'this.' + name + '= new tabSetObj("'+ name +'");' );
    }
}

function tabSetObj( name ){

    if(IE && MAC){return;}
    
    this.name = name;
    this.spacer = '<img src="http://images.sportsline.com/images/spacer.gif" width="1" height="1">';
	this.preTabCell  = function(){return ''}
	this.postTabCell = function(){return ''}
	this.preTabFoot  = function(){return ''}
	this.postTabFoot = function(){return ''}
    this.addId        = function(){return ''}
    this.addMouseOver = function(){return ''}
    this.addMouseOut  = function(){return ''}

    this.arrayPush = function( array, value ){
        array[array.length] = value;
        return;
    }
	
    // addTab to TabSet
    this.addTab = function( label, url, row, def ){
        if( row == null ) row = 0;
        this.row = new Array();
		
        if( def ) this.defaultRow = row;

        if( this.label ){
            if( this.label[row] )
            {                    
                this.arrayPush( this.label[row], label )
                this.arrayPush( this.url[row], url );
            }else{                                    
                this.label[row] = Array( label );
                this.url[row] = Array( url );
            }
        }else{
            this.label = new Array();
            this.label[row] = Array( label );
            this.url = new Array();
            this.url[row] = Array( url );
        }
        this.row[row] = true;
        if( def ) this.defaultCell = this.label[row].length - 1;

    }

     this.getClassName = function(){
        return (( this.defaultRow == row ) && ( this.defaultCell == cell )) ? this.classOn : this.classOff ;
    }
    
    this.drawTabSet = function( dRow, dCell ){
        if( dRow != null ) this.defaultRow = dRow;
        if( dCell != null ) this.defaultCell = dCell;

        var tabSetHtml = '';
        // For Each Row
        for( row=this.row.length-1; row>=0; row-- ){
            rowHtml = '';
            label = this.label[row]
            rowHtml+= '<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>';
            
			if( this.tabVSpace ){
				rowHtml+= '<td height="'+ this.tabVSpace +'"></td></tr><tr>';
			}
						
			// For each Tab in a Specified row
            for( cell=0; cell < label.length; cell++ ){
                className = this.getClassName(cell);
                mouseOver = this.addMouseOver(cell,className);
                mouseOut = this.addMouseOut(cell,className);
                addId = this.addId(cell);
                rowHtml += this.preTabCell();
				rowHtml += '<td';
                rowHtml += ' class="'+ className +'"';
                rowHtml += ' onclick="javascript:tabSet.' + this.name + ".click(" + row + "," + cell + ')"';
                //rowHtml += ' title="Row('+ row +') Cell('+ cell +')"';
                rowHtml += addId + mouseOver + mouseOut;
                rowHtml += '>';
                // rowHtml += '<a style="text-decoration:none;" href="javascript:tabSet.' + this.name + ".click(" + row + "," + cell + ')">';
                rowHtml += label[cell];
                // rowHtml += '</a>';
                rowHtml += '</td>';
				rowHtml += this.postTabCell();
                if( this.tabHSpace ) rowHtml += '<td width="'+ this.tabHSpace +'">' + this.spacer + '</td>';
            }
            rowHtml+= '</tr>';
			rowHtml+= "\n\n\n";
			
            // Footer Row
		    if( this.defaultRow == row && this.footer != false){
                rowHtml += '<tr>';
                for( cell=0; cell < label.length; cell++ ){
                    className = (( this.defaultRow == row ) && ( this.defaultCell == cell )) ? this.footClassOn : this.footClassOff ;
                    rowHtml += this.preTabFoot();
					rowHtml += '<td';
                    rowHtml += ' class="'+ className +'"';
                    rowHtml += '>';
                    rowHtml += this.spacer;
                    rowHtml += '</td>';
					rowHtml += this.postTabFoot();
                    if( this.tabHSpace ) rowHtml += '<td width="'+ this.tabHSpace +'" class="' + this.hSpace + '">' + this.spacer + '</td>';
                }
                rowHtml += '</tr>';
            }        
            rowHtml+= '</table>';
            if( this.defaultRow == row ){
                bottomRow = rowHtml;
            }else{
                tabSetHtml += rowHtml;
            }

        }
        document.getElementById(this.tabDivName).innerHTML = tabSetHtml + bottomRow;
    }

    this.renderTabs = function( dRow, dCell ){

		this.tabDivName = 'tabSet-tab-'+ this.name;
        var div = '<div id="'+ this.tabDivName +'"></div>';
        document.write( div );

        this.drawTabSet();

    }

    this.click = function( row, cell ){
		this.changeContents( this.url[row][cell] );
        this.drawTabSet( row, cell );
    }

    this.changeContents= function( url ){
        http = getHTTPObject();
        http.open( "GET", url, true);
        http.onreadystatechange = this.onreadystatechange;
        tabSet.tabDestination = this.name;
        http.send(null);
    }        

    this.onreadystatechange = function(){
        if (http.readyState == 4) {
            eval( "document.getElementById('tabSet_" + tabSet.tabDestination + "_div').innerHTML = http.responseText;" );
        }
    }

}
var tabSet = new tabSetParent();

// ----------------------
// Mouse-over Tool-tips -
// ----------------------

var iconTop=0;
var iconLeft=0;

var iconPos = whereami('tooltip');

function getMousePosDOM(e) {
    iconTop=e.clientY;
    iconLeft=e.clientX;
    }

function getMousePosIE() {
    iconTop=event.clientY;
    iconLeft=event.clientX;
//  iconY=event.scrollX;
    }

function tooltipOn(message,shift) {
// if called from the child, then pass second argument

	if(MAC && IE){
		// Do nothing - IE Mac can't handle style.width properly
		}

    else if (IE&&!SAF) {

        document.all.tooltip.innerHTML=message;
        // get shifts for when called from child
        var shiftItX=arguments.length==2?sekritLeft-document.body.scrollLeft:0;
        var shiftItY=arguments.length==2?sekritTop-document.body.scrollTop:0;
        // else pos.
        document.all.tooltip.style.top=document.body.scrollTop+iconTop+10+shiftItY;
        document.all.tooltip.style.left=document.body.scrollLeft+iconLeft+10+shiftItX;

		
        document.all.tooltip.style.visibility="visible";
        }
		
	else if (DOM) {
        document.getElementById('tooltip').innerHTML=message;
        // get shifts for when called from child
        var shiftItX=arguments.length==2?sekritLeft-window.pageXOffset:0;
        var shiftItY=arguments.length==2?sekritTop -window.pageYOffset:0;
        // else pos
        document.getElementById('tooltip').style.top=window.pageYOffset+iconTop+10+shiftItY;
        document.getElementById('tooltip').style.left=window.pageXOffset+iconLeft+10+shiftItX;

        document.getElementById('tooltip').style.visibility="visible";
        }
		
	else if (NS4) {alert('Sorry, this page will not work in Netscape Navigator 4.x. Please use Internet Explorer 4+, Netscape Navigator 6+, Mozilla, Opera, Safari or any other standards compliant browser.'); return;}

	return;
	}

function tooltipOff() {
	if (IE) {document.all.tooltip.style.visibility="hidden";}
    else if (DOM) {document.getElementById('tooltip').style.visibility="hidden";}
    else return;
    }

if (IE) {document.onmousemove=getMousePosIE;}
else if (DOM) {document.onmousemove=getMousePosDOM;}

