function jumpTo( jumpURL ) {
   window.location = jumpURL }

function showStory( location , n , auto ) {
  autoRotate = auto ; 
  for ( i = 1 ; i < ( ( location == 'top' ) ? 4 : 5 ) ; i += 1 ) {
    storyTabElement = document.getElementById( location + 'storytab' + i ) ;
    storyTabElement.className = location + 'storytab_' + ( ( i == n ) ? 'on' : 'off' ) ;
    storyBoxElement = document.getElementById( location + 'storybox' + i ) ;
    storyBoxElement.style.display = ( i == n ) ? 'inline' : 'none' } }

function rotateStories( delay ) {
  if ( autoRotate ) {
    showStory( 'mid' , autoStory , true ) ; 
    autoStory = ( autoStory == 4 ) ? 1 : autoStory + 1 ; 
    timeout = setTimeout( 'rotateStories( delay )' , delay ) } }

startList = function() {
  if ( document.all && document.getElementById ) {
    navRoot = document.getElementById( 'nav' ) ;
    for ( i = 0 ; i < navRoot.childNodes.length ; i++ ) {
      node = navRoot.childNodes[i] ;
      if ( node.nodeName == "LI" ) {
        node.onmouseover = function() { this.className += " over" ; }
        node.onmouseout = function() { this.className = this.className.replace( " over" , "" ) } } } } }

function setNav() {
   if ( document.getElementById && document.getElementById( 'navmenu' ) ) {
      navRoot = document.getElementById( 'navmenu' ) ;
      for ( i = 0 ; i < navRoot.childNodes.length ; i++ ) {
         node = navRoot.childNodes[ i ] ;
         if ( node.className == "menu_collapsed" ) {
            node.onmouseover = function() { this.className = 'menu_expanded' ; }
            node.onmouseout = function() { this.className = 'menu_collapsed' ; }
            for ( j = 0 ; j < node.childNodes.length ; j++ ) {
               if ( node.childNodes[ j ].className == 'menu_dropdowncontainer' ) {
                  elem = node.childNodes[ j ] ;
                  for ( k = 0 ; k < elem.childNodes.length ; k++ ) {
                     if ( elem.childNodes[ k ].className == 'menu_dropdown' ) {
                        menuElem = elem.childNodes[ k ] ;
                        for ( q = 0 ; q < menuElem.childNodes.length ; q++ ) {
                           if ( menuElem.childNodes[ q ].className == 'menu_item' ) {
                              dropElem = menuElem.childNodes[ q ] ;
                              dropElem.onmouseover = function() { this.className = 'menu_itemon' ; }
                              dropElem.onmouseout = function() { this.className = 'menu_item' ; }
                              for ( d = 0 ; d < dropElem.childNodes.length ; d++ ) {
                                 if ( dropElem.childNodes[ d ].className == "menu_dropdown2" ) {
                                    tier2Item = dropElem.childNodes[ d ] ;
                                    for ( r = 0 ; r < tier2Item.childNodes.length ; r++ ) {
                                       if ( tier2Item.childNodes[ r ].className != 'menu_rule' ) {
                                          tier2Item.childNodes[ r ].onmouseover = function() { this.className = 'menu_itemon' ; }
                                          tier2Item.childNodes[ r ].onmouseout = function() { this.className = 'menu_item' ; } } } } } } } } } } } } } } }

function changeScoreboard( t , sport ) {
  if ( this.id == currentTab ) return ;
  document.getElementById( currentTab ).className = 'tabSet-saag-off' ;
  t.className = 'tabSet-saag-on' ;
  currentTab = t.id ;
  document.getElementById( "scoreboard_iframe" ).src = '/portal/systemcontent/homepagescoreboard?open&sport=' + sport ;
}

function isEmailAddr( email ) {
   var emailFilter = /^.+@.+\..{2,4}$/ ;
   return emailFilter.test( email ) }

browserName = navigator.appName ;
browserVer = parseInt( navigator.appVersion ) ;
if ( browserVer >= 3 ) {
   version = "n3" }
else {
   version = "n2" }
if ( version == "n3" ) {
   function imgchg( imgst , imgName ) {
      if ( version == "n3" ) {
         imgc = eval( imgName + imgst + ".src" ) ;
         document[ imgName ].src = imgc } } }

function doScheduleRequest() {
   actionForm = document.ScheduleEmail ; 
   email = actionForm.RequestEmail.value ; 
   if ( !isEmailAddr( email ) ) {
      alert( 'Alert: Please enter a valid Email Address !' ) ;
      actionForm.RequestEmail.focus() ;
      return }
   actionForm.submit() }

function Ticker( containerId , linkId , headlines , newsFlash ) {
  if ( document.getElementById( containerId ) ) {
    this.tickerTextElement = document.getElementById( containerId ) ;
    this.tickerLinkElement = document.getElementById( linkId ) ;
    this.linkId = linkId ; 
    this.headlines = headlines ;
    this.headlineIndex = 0 ;	
    this.timeout = Ticker.FadeTimeout ;
    if ( newsFlash || ( this.headlines && this.headlines.length == 1 ) ) {
      this.tickerTextElement.innerHTML = this.headlines[0] ;
      this.tickerTextElement.style.color = '333333' ;
      this.tickerLinkElement = document.getElementById( linkId ) ;
      if ( this.tickerLinkElement ) { this.tickerLinkElement.style.color = '333333' ; } }
    else {
      if ( this.headlines && this.headlines.length > 0 ) {
        var fader = this ;
        setTimeout( function() { fader.fade( 0 , 1 ) ; } , this.timeout ) ; } } } }

Ticker.prototype.fade = function( step , direction ) {
//  this.tickerTextElement.style.color = Ticker.Shade[step] ;
  if ( this.tickerLinkElement ) { this.tickerLinkElement.style.color = Ticker.Shade[step] ; }
  if ( step <= 0 ) {
    direction = 1 ;
    this.changeHeadline() ; }
  else if ( step >= Ticker.Shade.length - 1 ) {
    direction = -1 ;
    this.timeout = Ticker.PauseTimeout ; }
  step = step + direction ;
  var fader = this ;
  setTimeout( function() { fader.fade( step , direction ) } , this.timeout ) ;
  if ( this.timeout == Ticker.PauseTimeout ) {
    this.timeout = Ticker.FadeTimeout ; } }

Ticker.prototype.changeHeadline = function() {
  if ( this.headlineIndex == this.headlines.length ) {
    this.headlineIndex = 0 ; }
  this.tickerTextElement.innerHTML = this.headlines[this.headlineIndex] ;
  this.tickerLinkElement = document.getElementById( this.linkId ) ;
  this.headlineIndex++ ; }

Ticker.FadeTimeout = 30 ;
Ticker.PauseTimeout = 6000 ;
Ticker.Shade1 = new Array( 'cccccc' , 'bbbbbb' , 'aaaaaa' , '999999' , '888888' , '777777' , '666666' , '555555' , '444444' , '333333' ) ;
Ticker.Shade = new Array( 'eaf2fc' , 'd0dbec' , 'b6c4dc' , '9cadcc' , '8296bc' , '687fac' , '4e689c' , '34518c' , '1a3a7c' , '00236c' ) ;

function submitLink( site ) {
  encodedURL = encodeURIComponent( location.href ) ; 
  encodedTitle = document.title.replace( " " , "+" ) ; 
  switch (site) {
    case 'delicious' :
      submitHandler = 'http://del.icio.us/post?url=' + encodedURL + '&title=' + encodedTitle ;
      break ;
    case 'digg' :
      submitHandler = 'http://digg.com/submit?phase=2&url=' + encodedURL + '&title=' + encodedTitle ;
      break;
    case 'reddit':
      submitHandler = 'http://reddit.com/submit?url=' + encodedURL + '&title=' + encodedTitle ;
      break;
    case 'facebook':
      submitHandler = 'http://www.facebook.com/share.php?u=' + encodedURL ;
      break;
    case 'stumbleupon':
      submitHandler = 'http://www.stumbleupon.com/submit?url=' + encodedURL ;
      break;
    default:
      submitHandler = '' ;
  }
  if ( submitHandler != '' ) {
    window.open( submitHandler ) ;
  }
  return false ;
}