<!--
var nonews = "<img src = 'nonews.gif'>"
var today = new Date();

// start month, start date, start year, end month, end date, end year, image, alt text, opponent, dates, link 
var event = new Array(
"4|10|2010|4|11|2010|busROCH.jpg|Next stop Rochester|Rochester|Saturday, April 10 to Sunday, April 11, 2010|"
);
var news = new Array(
"01| 21|2006|  4|11 |2010|2010 Roadtrips|roadtrip.htm",
"10| 21|2006| 12|30 |2010|Visit the NLL Insider Forums!|http://www.wingszone.com/nllmb",
"02| 10|2007| 12|30 |2010|View the pre 2007 WingsZone Archive|http://www.wingszone.com/archive_index.html"
);
var delimiter = "|";
var defaultimage = "<img src = 'bushead.jpg' alt = 'PWFC buses'>";

var tablecode = '<table border="0"><tr>'+
'<td align="center" valign="top" width="175" height="2"><font size="4"><b>Opponent</b></font></td>'+
'<td align="center" valign="top" width="475" height="2"><font size="4"><b>Dates</b></font></td>'+
'</tr>';

var aopen = '<a href="';
var aclose = '">';
var aend = '</a>';
var tdstart = '<td align="center"><font size="4">';
var tdend = '</font></td>';
var rstart = '<tr>';
var rend = '</tr>';

var image;
var htmlcode;
//today = new Date("jan 19, 2002"); //for testing
//showimages(); //for testing


var currentDate;
var startDate;
var endDate;
var strArray;
function writetable() {
  htmlcode = tablecode;
  currentDate = getDate(today);
  var strArray;
  for(i = 0; i < event.length; i++) {
    strArray = event[i].split(delimiter);
    if(strArray.length >= 9) {
      endDate = (strArray[5] * 10000) + (strArray[3] * 100) + (strArray[4] * 1);
      htmlcode += rstart;
      htmlcode += tdstart + linkText(strArray[8],strArray[10]) + tdend;
      htmlcode += tdstart + linkText(strArray[9],strArray[10]) + tdend;
      htmlcode += rend;
    }
    htmlcode += rend;
  }
  htmlcode += '</table>';
  document.write(htmlcode);
}
function linkText(string, link) {
  var text = "";
      if(currentDate <= endDate & link.length > 0){
        text += aopen + link + aclose + string + aend;
      } else {
	text += string;
      }
  return text;
}

function showBus() {
  image = defaultimage;
  currentDate = getDate(today);
  for(i = 0; i < event.length; i++) {
    strArray = event[i].split(delimiter);
    startDate = (strArray[2] * 10000) + (strArray[0] * 100) + (strArray[1] * 1);
    if(strArray.length >= 7) {
      endDate = (strArray[5] * 10000) + (strArray[3] * 100) + (strArray[4] * 1);
      if(currentDate >= startDate & currentDate <= endDate){
	image = "";

	if(strArray.length >= 9 && strArray[10].length > 0) {
	  image += "<a href=" + strArray[10] + ">";
	}

        image += "<img border=0 src=" + strArray[6];
	if(strArray[7]) image += " alt='" + strArray[7] + "'";
	image += ">";
	if(strArray.length >= 9 && strArray[10].length > 0) {
	  image += "</a>";
	}
      }
    }
  }
  document.write(image);
}

function writeNews() {
  htmlcode = "";
  currentDate = getDate(today);
  for(i = 0; i < news.length; i++) {
    strArray = news[i].split(delimiter);
      startDate = (strArray[2] * 10000) + (strArray[0] * 100) + (strArray[1] * 1);
      endDate = (strArray[5] * 10000) + (strArray[3] * 100) + (strArray[4] * 1);
      if(currentDate >= startDate & currentDate <= endDate & strArray[7].length > 0){
        htmlcode += aopen + strArray[7] + '" class="news">' + strArray[6] + aend + '<br>';
      }
  }
//  document.write(htmlcode);
  if(htmlcode.length == 0) {
    htmlcode = nonews
  }
	if (document.all) {
		document.all.news.innerHTML=htmlcode
	}
	if (document.layers) {
		document.news.document.write(htmlcode)
		document.news.document.close()
	}
}

function showimages() {
  var images = "";
  for(i = 0; i < event.length; i++) {
    strArray = event[i].split(delimiter);
         images += "<img src=" + strArray[6];
	 if(strArray[7]) images += " alt='" + strArray[7] + "'";
	 images += ">";
  }
document.write(images + defaultimage);
}

function getDate(date) {
  var Year = date.getFullYear();
  return (Year * 10000) + ((date.getMonth()+1) * 100) + date.getDate();

}
// -->


