var ns6 = document.getElementById && !document.all;

var dayColorOver = "#ffffff";
var dayColorOut = "#000000";

var dayFontOver = "#000000";
var dayFontOut = "#ffffff";

var dateColorOver = "#ffffff";
var dateColorOut = "#d7d7d7";

var eventColorOver = "#999999";
var eventColorOut = "#ffffff";

var eventFontOver = "#ffffff";
var eventFontOut = "#0033cc";

var numDividers = 6;

function myMouseOver( event, day ) {
  EventMouseOver( event );
  DayMouseOver( day );
}
function myMouseOverE( cell, event, day ) {
  cell.style.backgroundColor = '#b2753d';
  myMouseOver( event, day )
}
function myMouseOut( event, day ) {
  EventMouseOut( event );
  DayMouseOut( day );
}
function myMouseOutE( cell, event, day ) {
  cell.style.backgroundColor = '#cccccc';
  myMouseOut( event, day )
}
function DayMouseOver( day ) {
  if( !ns6 ) {
    for( var i = 1; i <= numDividers; i++ ) {
      eval( day + 'Link' + i ).style.color = dayFontOver;
      eval( day + i ).style.backgroundColor = dayColorOver;
      eval( day + i ).style.color = dayFontOver;
    }
  } else {
    for( var i = 1; i <= numDividers; i++ ) {
      document.getElementById( day + 'Link' + i ).style.color = dayFontOver;
      document.getElementById( day + i ).style.backgroundColor = dayColorOver;
      document.getElementById( day + i ).style.color = dayFontOver;
    }
  }
}
function DayMouseOut( day ) {
  if( !ns6 ) {
    eval( day + '1' ).style.backgroundColor = dateColorOut;
    eval( day + 'Link1' ).style.color = dayFontOver;
    for( var i = 2; i <= numDividers; i++ ) {
      eval( day + 'Link' + i ).style.color = dayFontOut;
      eval( day + i ).style.backgroundColor = dayColorOut;
      eval( day + i ).style.color = dayFontOut;
    }
  } else {
    document.getElementById( day + '1' ).style.backgroundColor = dateColorOut;
    document.getElementById( day + 'Link1' ).style.color = dayFontOver;
    for( var i = 2; i <= numDividers; i++ ) {
      document.getElementById( day + 'Link' + i ).style.color = dayFontOut;
      document.getElementById( day + i ).style.backgroundColor = dayColorOut;
      document.getElementById( day + i ).style.color = dayFontOut;
    }
  }
}
function EventMouseOver( event ) {
  if( !ns6 ) {
    eval( event ).style.backgroundColor = eventColorOver;
    eval( event ).style.color = eventFontOver;
    eval( event + 'I' ).style.backgroundColor = eventColorOver;
    eval( event + 'Link' ).style.color = eventFontOver;
  } else {
    document.getElementById( event ).style.backgroundColor = eventColorOver;
    document.getElementById( event ).style.color = eventFontOver;
    document.getElementById( event + 'I' ).style.backgroundColor = eventColorOver;
    document.getElementById( event + 'Link' ).style.color = eventFontOver;
  }
}
function EventMouseOut( event ) {
  if( !ns6 ) {
    eval( event ).style.backgroundColor = eventColorOut;
    eval( event ).style.color = eventFontOut;
    eval( event + 'I' ).style.backgroundColor = eventColorOut;
    eval( event + 'Link' ).style.color = eventFontOut;
  } else {
    document.getElementById( event ).style.backgroundColor = eventColorOut;
    document.getElementById( event ).style.color = eventFontOut;
    document.getElementById( event + 'I' ).style.backgroundColor = eventColorOut;
    document.getElementById( event + 'Link' ).style.color = eventFontOut;
  }
}

function GoToEvent( id ) {
  if (typeof P_popupoff != 'undefined') P_popupoff();
    document.location.href='/olympics/2004/schedules/'+id+'BySport.html';
}

function GoToDate( id ) {
  if (typeof P_popupoff != 'undefined') P_popupoff();
    document.location.href='/olympics/2004/schedules/8'+id+'ByDate.html';
}
