var monthNames = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var message = "This function has been disabled."
var BlinkingImagesLinkNum = -1
var UseImage1 = 1


function BlinkImages(){
//swaps between 2 images every 2 seconds if we are at the right time
//assumes:
//    1) there is a hyperlink with a hash of 'BlinkingImagesLink'
//    2) there is an images with id 'BlinkingImages'

  var i

  //find the correct link by number to change
  if (BlinkingImagesLinkNum == -1){
    for (i = 0; i < document.links.length; i++){
      if (document.links[i].hash == '#BlinkingImagesLink'){
        BlinkingImagesLinkNum = i;
      }
    }
  }

  if (CheckShowTime() == true){
    if (BlinkingImagesLinkNum != -1){
      document.links[BlinkingImagesLinkNum].href = 'http://players.eonstreams.com/FastAim/Player/Player.php?PlayerID=670';
    }
    if (UseImage1 == 0){
      document.images['BlinkingImages'].src = 'graphics/fox_logo_live.gif';
      UseImage1 = 1;
    }
    else{
      document.images['BlinkingImages'].src = 'graphics/fox_logo.gif';
      UseImage1 = 0;
    }
  }
  else{
    if (BlinkingImagesLinkNum != -1){
      document.links[BlinkingImagesLinkNum].href = 'http://790kfan.com';
    }
    document.images['BlinkingImages'].src = 'graphics/fox_logo.gif';
  }

  //call this function again every 2 seconds
  setTimeout('BlinkImages()', 2000);
}


function BlinkPics(PicName, NumPics, BlinkRate, CurrPicNum){
//swaps between images every few seconds
//assumes:
//    1) there is an images with id PicName
//    2) all the pics are .jpg files with names corresponding in order
//    3) BlinkRate is in milliseconds

  document.images[PicName].src = 'graphics/' + PicName + CurrPicNum + '.jpg';

  CurrPicNum = CurrPicNum + 1;
  if (CurrPicNum >= NumPics){
      CurrPicNum = 0;
  }


  //call this function again every few seconds
  setTimeout('BlinkPics("' + PicName + '",' + NumPics + ',' + BlinkRate + ',' + CurrPicNum + ')', BlinkRate);
}


function CheckShowTime(){
//Checks if the show is currenlty playing. 
//Show is on Saturday's between 9 and 10 AM Pacific time.
//GMT time is 8 hours difference between Pacific time.

  var CurrTime = new Date()
  var CurrDay  = CurrTime.getDay()
  var CurrHour = CurrTime.getHours() + (CurrTime.getTimezoneOffset() / 60) - 8

  if (CurrDay == 6 && CurrHour == 9){
    return true;
  }
  else{
    return false;
  }
}


function toForm(){
  document.forms[0].elements[0].focus();
}


function tell_date(){
//writes the date
  var now = new Date();
  document.write(monthNames[now.getMonth()] + " " + now.getDate() + ", " + now.getYear());
}


function tell_lastmodified(){
//writes the date last modified
  var date_lm = document.lastModified;
  var s   = "Unknown";
  var d1;

  // check if we have a valid date
  if(0 != (d1=Date.parse(date_lm))){
    s = new Date(d1);
  }

  document.write(monthNames[s.getMonth()] + " " + s.getDate() + ", " + s.getYear());
}


function no_click(){
  if (document.layers){
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown=clickNS4;
  }
  else if (document.all&&!document.getElementById){
    document.onmousedown=clickIE4;
  }

  document.oncontextmenu=new Function("alert(message);return false")
}


function clickIE4(){
  if (event.button==2){
    alert(message);
    return false;
  }
}


function clickNS4(e){
  if (document.layers||document.getElementById&&!document.all){
    if (e.which==2||e.which==3){
      alert(message);
      return false;
    }
  }
}
