// -------------------------------------------------------------------
// writeHeader()
//  Standard Header
// -------------------------------------------------------------------
var banner=""
function setBanner(newBanner) 
{
  banner = newBanner
}
function writeAnchor(label,address) 
{
  document.write('<a href="' + address + '"><font size="-1">' + label + '</font></a>');
}
function writeMailAnchor(label,address) 
{
  document.write('<a href="mailto:' + address + '"><font size="-1">' + label + '</font></a>');
}
function loadImages() 
{
	//Pre-loads your image
	grphcs=new Array(11)
	grphcs[0]="Images/flash/image0.JPG";
	grphcs[1]="Images/flash/image1.JPG";
	grphcs[2]="Images/flash/image2.JPG";
	grphcs[3]="Images/flash/image3.JPG";
	grphcs[4]="Images/flash/image4.JPG";
	grphcs[5]="Images/flash/image5.JPG";
	grphcs[6]="Images/flash/image6.JPG";
	grphcs[7]="Images/flash/image7.JPG";
	grphcs[8]="Images/flash/image8.JPG";
	grphcs[9]="Images/flash/image9.JPG";
	grphcs[10]="Images/flash/image10.JPG";


	// currently loaded image
	var x=0;
	document.write('<div>');	
	document.write('<img id="si0" src="'+grphcs[0]+'" style="position:absolute;0px;0px;visibility:visible;" height="250" width="300">');
	
	for (i = 1; i < grphcs.length; i++)
	{
		document.write('<img id="si'+i+'" src="'+grphcs[i]+'" style="position:absolute;0px;0px;visibility:hidden;" height="250" width="300">');
	}
	document.write('</div>');		

}
function changeImage(time)
{
	// hide currently displayed image
	for (i = 0; i < grphcs.length; i++)
	{
		if(document.getElementById("si"+i).style.getAttribute("visibility")=="visible")
		{
			document.getElementById("si"+i).style.visibility = "hidden";
			if (++i >= grphcs.length) i=0;
			document.getElementById("si"+i).style.visibility = "visible";
			break;
		}
	}		
	setTimeout('changeImage('+time+')',time);
}
function writeHeader(title) 
{
	document.write('<tr>');
	document.write('<td colspan="5">');
	document.write('<table  cellSpacing=0 width="100%" border=0 bgcolor=red>');
	document.write('<TR vAlign=center align=middle bgColor=red>');
	document.write('<TD><IMG height=150 src="images/logo-white.jpg" width=250></TD>');
	document.write('<TD><FONT color=white size=+5><B><I>Wakefield Soccer Association</I></B></FONT></TD>');
	document.write('</tr>');

	document.write('<TR vAlign=center align=middle bgColor=red>');
	document.write('<td colspan="2">');
	document.write('<div id="chromemenu">');
	document.write('<ul>');
	document.write('<li><a href="http://www.WakefieldSoccer.org" style="border-left: 1px solid #DADADA;">Home</a></li>');
	document.write('<li><a href="Coaches.htm">Coaches</a></li>');
	document.write('<li><a href="Directions.htm">Directions</a></li>');
	document.write('<li><a href="Events.htm">Calendar of Events</a></li>');
	document.write('<li><a href="TravelTeamInfo.htm">Travel Team Info</a></li>');
	document.write('<li><a href="Intramural.htm">Intramural Team Info</a></li>');
	document.write('<li><a href="Contacts.htm">Contact Us</a></li>');
	document.write('<li><a href="TOPS.htm">TOPS</a></li>');
	document.write('</ul>');
	document.write('</div>');
	document.write('</table>');
	document.write('</td>');
	document.write('</tr>');
}

function writeBanner(banner) 
{
  if (!isNull(banner)) {
   if (banner.length > 0) {
	document.write('  <tr>');
	document.write('	<td height="35" align="center" class="banner">');
	document.write('	<marquee width="85%">' + banner + '</marquee>');
	document.write('	</td>');
	document.write('  </tr>'); 
    }
  }
}
function writeFooter() 
{
	document.write('<tr height="20" >');
	document.write('<td colspan="5" bgcolor=white>');
	document.write('<center>Comments or questions about this site should be sent to:<BR>');
	document.write('	<a href="mailto:webmaster@wakefieldsoccer.org"><font size="-1">webmaster@wakefieldsoccer.org</font></a>');
	document.write('</center>');	
	document.write('</td>');
	document.write('</tr>');
}
function writeIndex(root) 
{
	document.write('<td width=200 valign=top>');

	document.write('<table cellspacing=0 border=1 bordercolor=red id="index" >');
	document.write('	<tr bgcolor=red><th><Font color=White Size=+1>Menu:</font></th></tr>');
	document.write('	<tr>');
	document.write('	<td valign="top" nowrap bgcolor=white>');
	document.write('<ul class="flipMenu">');
	document.write('	<li><a target="_self" href="' + root + 'index.htm">Home</a></li>');
	document.write('	<li><a target="_self" href="' + root + 'Events.htm">Calendar of Events</a></li>');
	document.write('	<li><a target="_self" href="' + root + 'GeneralInfo.htm">General Info</a></li>');
	document.write('	<li><a target="_self" href="' + root + 'Coaches.htm">Coaches</a></li>');
	document.write('	<li><a target="_self" href="' + root + 'Referees.htm">Referees</a></li>');
	document.write('	<li><a target="_self" href="' + root + 'Registration.htm">Registration</a></li>');
	document.write('	<li><a target="_self" href="' + root + 'TravelTeamInfo.htm">Travel Team Info</a></li>');
	document.write('	<li><a target="_self" href="' + root + 'Intramural.htm">Intramural Team Info</a></li>');
	document.write('	<li><a target="_self" href="' + root + 'pictures.htm">Pictures</a></li>');
	document.write('	<li><a target="_self" href="' + root + 'Links.htm">Links</a></li>');
	document.write('	<li><a target="_self" href="' + root + 'Contacts.htm">Contact Us</a></li>');
	document.write('<li>Directions to Fields');
	document.write('	<UL>');
	document.write('    <LI><A href="DIRECTIONS/Blatz.htm">Blatz Field</A> </LI>');
	document.write('    <LI><A href="DIRECTIONS/Dolbeare.htm">Dolbeare Field</A> </LI>');
	document.write('    <LI><A href="DIRECTIONS/Doyle.htm">Doyle Field</A> </LI>');
	document.write('    <LI><A href="DIRECTIONS/Mapleway.htm">Mapleway Field</A> </LI>');
	document.write('    <LI><A href="DIRECTIONS/Moulton.htm">Moulton Park</A> </LI>');
	document.write('    <LI><A href="DIRECTIONS/Nasella.htm">Nasella Field</A> </LI>');
 	document.write('    <LI><A href="DIRECTIONS/Sullivan.htm">Sullivan Field</A> </LI>');
	document.write('    <LI><A href="DIRECTIONS/Walton.htm">Walton Field</A> </LI>');
	document.write('    <LI><A href="DIRECTIONS/Yeuell.htm">Yeuell School</A></LI></UL>');
	document.write('</li>');
	document.write('<li><a target="_self" href="' + root + 'Minutes.htm">Meeting Minutes</a></li>');
	document.write('<hr width=100%>');
	document.write('<li><a href="javascript:openAllFlips()">Show ');	document.write('All</a></li>');
	document.write('<li><a href="javascript:closeAllFlips()">Hide All</a></li>');
	document.write('</ul>');
	document.write('	</td>');
	document.write('  </tr>');
	document.write('</table>');
}

//
// format date as dd-mmm-yyyy
// example: 12-Jan-99
//
function date_ddmmmyy(date)
{
  var d = date.getDate();
  var m = date.getMonth() + 1;
  var y = date.getYear();

  // handle different year values 
  // returned by IE and NS in 
  // the year 2000.

  if(y < 2000)
  {
    y += 1900;
  }

  /*--
  if(y >= 2000)
  {
    y -= 2000;
  }
  if(y >= 100)
  {
    y -= 100;
  }
  --*/

  // could use splitString() here 
  // but the following method is 
  // more compatible
  var mmm = 
    ( 1==m)?'January':( 2==m)?'February':(3==m)?'March':
    ( 4==m)?'April':( 5==m)?'May':(6==m)?'June':
    ( 7==m)?'July':( 8==m)?'August':(9==m)?'September':
    (10==m)?'October':(11==m)?'November':'December';

  return "" +
    mmm + " " +
    (d<10?"0"+d:d) + ", " + 
    y;
}


//
// get last modified date of the 
// current document.
//
function date_lastmodified()
{
  var lmd = document.lastModified;
  var s   = "Unknown";
  var d1;

  // check if we have a valid date
  // before proceeding
  if(0 != (d1=Date.parse(lmd)))
  {
    s = "" + date_ddmmmyy(new Date(d1));
  }
  //document.write("This page was updated on " + s);
  return(s);
}
















