var path = "" + window.location;
if ((path.indexOf('cgi-bin') != -1) || (path.indexOf('error_docs') != -1))
   path = "/";
else
   path = "";

document.writeln("<LINK REL=StyleSheet " + "HREF='" + path + "style.css' " + "TYPE='text/css' MEDIA=screen>");
document.writeln('<script language="javascript" src="swfobject.js"></script>');

function swap_image2 (img,src)
{
  if (document.all)
  {
	    document.img.src = "src"; 
  }
  else
  {
	 alert('Netscape');
  }
} //swap_image

function swap_image()
{ //start
  var rem, keep=0, store, obj, switcher=new Array, history=document.Data;

    for (rem=0; rem < (swap_image.arguments.length-2); rem+=3) 
	{
      store = swap_image.arguments[(navigator.appName == 'Netscape')?rem:rem+1];
      if ((store.indexOf('document.layers[')==0 && document.layers==null) ||
          (store.indexOf('document.all[')==0 && document.all==null))
          store = 'document'+store.substring(store.lastIndexOf('.'),store.length);
      obj = eval(store);
      if ((obj != null) && (obj.src.indexOf('_on') == -1))
	  {
   	   switcher[keep++] = obj;
       switcher[keep++] = (history==null || history[keep-1]!=obj)?obj.src:history[keep];
	   obj.src = swap_image.arguments[rem+2];
      } //if 
    }//for
	document.Data = switcher;

} //end

function restore_image()
{ //start
  if (document.Data != null)
    for (var rem=0; rem<(document.Data.length-1); rem+=2)
      document.Data[rem].src=document.Data[rem+1];
} //end

function today_is()
{
  d = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
  m = new Array("January",
  	  	  	    "February",
				"March",
				"April",
				"May",
				"June",
				"July",
				"August",
				"September",
				"October",
				"November",
				"December");

  today = new Date();
  day = today.getDate();
  year = today.getYear();

  if (year < 2000)    // Y2K Fix, Isaac Powell
  {year = year + 1900;} // http://onyx.idbsu.edu/~ipowell

  end = "th";
  if (day==1 || day==21 || day==31) 
  {end="st";}
  if (day==2 || day==22) 
  {end="nd";}
  if (day==3 || day==23) 
  {end="rd";}
  day+=end;

  document.write(d[today.getDay()]+", "+m[today.getMonth()]+" "+day+", " + year);
} // today_is

function old_generate_header(msg)
{
  document.writeln('<table width="100%" cellpadding="0" cellspacing="0" border="0">'); 
  document.writeln('<tr valign="bottom" colspan="2"><td width="128" bgcolor="#D1EBFC"><img name="logo" src="' + path + 'images/logo.jpg" width="128" height="137" alt="" border="0"></td>');
  document.writeln('<td  style="border-bottom: 1px solid black;" valign="top" align="center"><a name="top"><a class="gnav" href="' + path + 'index.html" title="WWW.WHOSHOTGOLIATH.COM"><img src="' + path + 'images/wsgheader.jpg" width="560" height="100" alt="WWW.INVISIBLEWORSHIPBAND.COM" border="0"></a></a><br>');
  document.writeln('<span><i><font size="-1" color="#000000">SLINGIN CHRISTIAN ROCK</font></i><br><b><font size="-2" color="#000000">');
  today_is();   
  document.writeln('</font></b></span><br><br clear="all">');  
  document.writeln('<span style="background: black;"><img src="' + path + 'images/spacer.gif" width="100%" height="1"></span><br>');
  document.writeln('<span><font size="+1" color="#000000"><b>' + msg + '</b></font></span>');   
  //document.writeln('<span style="background: black;"><img src="' + path + 'images/spacer.gif" width="100%" height="1"></span>');

  document.writeln('</td></tr>');
  document.writeln('</table>');
} //old_generate_header

function generate_header(msg)
{

  document.writeln('<table width="100%" cellpadding="0" cellspacing="0" border="0">'); 
  document.writeln('<tr valign="bottom" colspan="2"><td width="128" bgcolor="#D1EBFC"><img name="logo" src="' + path + 'images/logo.jpg" width="128" height="137" alt="" border="0"></td>');
  document.writeln('<td><table width="100%" cellpadding="0" cellspacing="0" border="0">');
  document.writeln('<tr><td valign="top" align="center" bgcolor="black"><a name="top"><a class="gnav" href="' + path + 'index.html" title="WWW.WHOSHOTGOLIATH.COM"><img src="' + path + 'images/bandheader.jpg" width="800" height="112" alt="WWW.WHOSHOTGOLIATH.COM" border="0"></a></a></td></tr>');
  document.writeln('<tr><td style="border-bottom: 1px solid black;" valign="top" align="center"><a name="top"><a class="gnav" href="' + path + 'index.html" title="WWW.WHOSHOTGOLIATH.COM"><img src="' + path + 'images/wsgheader.gif" width="253" height="50" alt="WWW.WHOSHOTGOLIATH.COM" border="0"></a></a>');

  //document.writeln('<br><span><i><font size="-1" color="#000000">SLINGIN CHRISTIAN ROCK</font></i><br><b><font size="-2" color="#000000">');
  //today_is();   
  //document.writeln('</font></b></span><br><br clear="all">');  
  document.writeln('<span style="background: black;"><img src="' + path + 'images/spacer.gif" width="100%" height="1"></span><br>');
  document.writeln('<span><font size="+1" color="#000000"><b>' + msg + '</b></font></span>');   
  //document.writeln('<span style="background: black;"><img src="' + path + 'images/spacer.gif" width="100%" height="1"></span>');

  document.writeln('</td></tr>');
  document.writeln('</table>');
  document.writeln('</td></tr></table>');
} //generate_header

function generate_href (link,name,on,off,title)
{
  quote = "'";
  document.write('<a href="' + link + '" onMouseOut="restore_image();" onMouseOver="swap_image(' +  quote + 'document.' + name +  quote + ',' +  quote + 'document.' + name +  quote + ',' +  quote + path + 'images/' + off +  quote + ');" title="' + title + '"><img name="' + name + '" src="' + path + 'images/' + on + '" width="98" height="32" alt="' + title + '" border="0"></a>');
} //generate_href

function generate_lnav()
{
  document.writeln('<table align="top" cellpadding="0" cellspacing="0" border="1">');
  document.writeln('<tr><td><script src="' + path + 'navbar.js"></script></td></tr>');
  document.writeln('</table><br>');
}

function generate_tnav(link)
{
  //display top navigation bar
  document.writeln('<table width="100%" cellspacing="0" cellpadding="0" border="0" style="background-image: url(' + path + 'images/bg.gif); background-repeat: repeat-x;">');
  document.writeln('<tr><td width="49%" valign="top">&nbsp;</td>');
  document.writeln('<td width="2%" valign="top">');

  document.writeln('<table width="725px" cellspacing="0" cellpadding="0" border="0">');
  document.write('<tr><td width="725px" valign="top" align="center" nowrap>');

  if (link == 'about invisible')  
     generate_href(path + 'invisible.html','tab1','invisible_tab_on.gif','invisible_tab_off.gif','Invisible');
  else
     generate_href(path + 'invisible.html','tab1','invisible_tab_off.gif','invisible_tab_on.gif','Invisible');
  
  if (link == 'our mission')  
     generate_href(path +'mission.html','tab2','mission_tab_on.gif','mission_tab_off.gif','Our Mission');
  else
     generate_href(path +'mission.html','tab2','mission_tab_off.gif','mission_tab_on.gif','Our Mission');
  
  if (link == 'our music')  
     generate_href(path +'cd2.html','tab3','music_tab_on.gif','music_tab_off.gif','Our Music');
  else
     generate_href(path +'cd2.html','tab3','music_tab_off.gif','music_tab_on.gif','Our Music');
  
  if (link == 'on the road')  
     generate_href(path +'ontheroad.html','tab4','road_tab_on.gif','road_tab_off.gif', 'On the Road');
  else
     generate_href(path +'ontheroad.html','tab4','road_tab_off.gif','road_tab_on.gif', 'On the Road');
     
  if (link == 'contact us')  
     generate_href(path +'contactus.html','tab5','contact_tab_on.gif','contact_tab_off.gif','Contact Us');
  else
     generate_href(path +'contactus.html','tab5','contact_tab_off.gif','contact_tab_on.gif','Contact Us');
     
  if (link == 'hefc')  
     generate_href('http://www.friendlychurch.org/visitor.htm','tab6','hefc_tab_on.gif','hefc_tab_off.gif','Visit HEFC');
  else
     generate_href('http://www.friendlychurch.org/visitor.htm','tab6','hefc_tab_off.gif','hefc_tab_on.gif','Visit HEFC');
  
  document.writeln('</td></tr>'); 
  
  if (link == 'about invisible')  
  {  
    document.write('<tr><td width="820px" valign="top" align="center" nowrap>');
    document.write('<a href="' + path + 'jamie.html" title="About Jamie Cosley"><img src="' + path + 'images/jamielink.gif" width="73" height="20" alt="About Jamie Cosley" border="0"></a>');
    document.write('<a href="' + path + 'michelle.html" title="About Michelle Wassenberg"><img src="' + path + 'images/michellelink.gif" width="73" height="20" alt="About Michelle Wassenberg" border="0"></a>');
    document.write('<a href="' + path + 'scott.html" title="About Scott Wassenberg"><img src="' + path + 'images/scottlink.gif" width="73" height="20" alt="About Scott Wassenberg" border="0"></a>');
    //document.write('<a href="' + path + 'patrick.html" title="About Patrick Crisp"><img src="' + path + 'images/patricklink.gif" width="73" height="20" alt="About Patrick Crisp" border="0"></a>');
    //document.write('<a href="' + path + 'brett.html" title="About Brett Crisp"><img src="' + path + 'images/brettlink.gif" width="73" height="20" alt="About Brett Crisp" border="0"></a>');
    document.write('<a href="' + path + 'glenn.html" title="About Glenn Sharp"><img src="' + path + 'images/glennlink.gif" width="73" height="20" alt="About Glenn Sharp" border="0"></a>');
    //document.write('<a href="' + path + 'ray.html" title="About Ray Stopper"><img src="' + path + 'images/raylink.gif" width="73" height="20" alt="About Ray Stopper" border="0"></a>');
    document.write('<a href="' + path + 'michael.html" title="About Michael Hooper"><img src="' + path + 'images/michaellink.gif" width="73" height="20" alt="About Michael Hooper" border="0"></a>');
    document.write('<a href="' + path + 'joe.html" title="About Joe Blackburn"><img src="' + path + 'images/joelink.gif" width="73" height="20" alt="About Joe Blackburn" border="0"></a>');
    document.write('<a href="' + path + 'niki.html" title="About Niki Ward"><img src="' + path + 'images/nikilink.gif" width="73" height="20" alt="About Niki Ward" border="0"></a>');
    document.write('<a href="' + path + 'jennifer.html" title="About Jennifer Hoover"><img src="' + path + 'images/jenniferlink.gif" width="73" height="20" alt="About Jennifer Hoover" border="0"></a>');
    
	document.write('</td>');
    document.writeln('</td></tr>');
  }	  
  else if (link == 'our music')  
  {  
    document.write('<tr><td width="725px" valign="top" align="center" nowrap>');
    document.write('<a href="' + path + 'cd1.html" title="Invisible CD"><img src="' + path + 'images/invisiblelink.gif" width="73" height="20" alt="Our Music" border="0"></a>');
    document.write('<a href="' + path + 'makingthecd.html" title="Making of the Invisible CD"><img src="' + path + 'images/makingthecdlink.gif" width="150" height="20" alt="Making of the Invisible CD" border="0"></a>');
    document.write('<a href="' + path + 'cd2.html" title="Not Seeing Is Believing CD"><img src="' + path + 'images/notseeinglink.gif" width="165" height="20" alt="Not Seeing is Believing CD" border="0"></a>');
    document.write('<a href="' + path + 'makingthenotseeingcd.html" title="Making of the Not Seeing Is Believing CD"><img src="' + path + 'images/makingthecdlink.gif" width="150" height="20" alt="Making of the Not Seeing Is Believing CD" border="0"></a>');
    document.write('<a href="' + path + 'order.html" title="Order a CD"><img src="' + path + 'images/order.gif" width="100" height="20" alt="Order a CD" border="0"></a>');
	document.writeln('</td></tr>');
  }	 
  else if (link == 'our mission')  
  {  
    document.write('<tr><td width="725px" valign="top" align="center" nowrap>');
    document.write('<a href="' + path + 'mission.html" title="Our Mission"><img src="' + path + 'images/ourmissionlink.gif" width="95" height="20" alt="Our Mission" border="0"></a>');
	document.writeln('</td></tr>');
  }	  
  else if (link == 'welcome')  
  {  
    document.write('<tr><td width="725px" valign="top" align="center" nowrap>');
    document.write('<img src="' + path + 'images/welcome.gif" width="280" height="20" alt="Welcome" border="0">');
    document.writeln('</td></tr>');
  }	     
  document.writeln('</table>');  
  document.writeln('</td><td width="49%" valign="top"><img src="' + path + 'images/bg.gif" width="1" height="52" alt="" border="0"></td>');
  document.writeln('</tr></table>');

}//generate_tnav

function footer_spacer()
{
  if (document.layers)
     {pixels = window.screen.height - 20 - 52 - 20 - 100 - 100 - window.innerHeight;}
  else
     {pixels = window.screen.availHeight - 20 - 52 - 20 - 100 - 165;}
  document.writeln('<img src="' + path + 'images/spacer.gif" width="1" height="' + pixels + '" alt="" border="0">'); 
} //footer_spacer

function generate_footer()
{
  var p = "" + window.location;
  if ((p.indexOf('music.html') == -1) && (p.indexOf('cgi-bin') == -1))
     generate_mp3_player();
	 
  document.writeln('<br><br clear="all"><center>');
  document.writeln('<table width="100%" border="0" cellpadding="0" cellspacing="0">'); 
  document.writeln('<tr><td width="128"><img src="' + path + 'images/spacer.gif" width="128" height="1"></td><td align="center"><font size="-1">Please <a class="bnav" href="' + path + 'contactus.html" title="Contact Who Shot Goliath">contact us</a> if you would like us to play at your church or special event.  Please sign our <a class="bnav" href="http://www.whoshotgoliath.com/cgi-bin/yabb2/YaBB.pl?board=guestbook;action=post;title=StartNewTopic" title="Sign the Who Shot Goliath Guest Book">Guest Book</a>!</font></td></tr>');
  document.writeln('<tr><td width="128"><img src="' + path + 'images/spacer.gif" width="128" height="1"></td><td bgcolor="black"><img src="' + path + 'images/spacer.gif" width="100%" height="1"></td></tr>');
  document.writeln('<tr><td width="128"><img src="' + path + 'images/spacer.gif" width="128" height="1"></td><td align="center"><b><font size="-3">This page was last updated on: ' + document.lastModified + '</font></b></td></tr>');
  document.writeln('<tr><td width="128"><img src="' + path + 'images/spacer.gif" width="128" height="1"></td><td bgcolor="black"><img src="' + path + 'images/spacer.gif" width="100%" height="1"></td></tr>');  
  document.writeln('</table>');
  document.writeln('</center>');  
} //generate_footer

function generate_mp3_player()
{
  document.writeln('<br>');
  document.writeln('<br>');
  document.writeln('<table align="center" bordercolor="#000000" border="1" cellspacing="0" cellpadding="4" class="eventtable">');
  document.writeln('<tr class="eventheader"><td align="center">');
  document.writeln('	<div id="wsgmicro" style="border: 1px solid black;">');
  document.writeln('	    <br>');
  document.writeln('		To view the MP3 Player you will need to have Javascript turned on and have <a href="http://www.adobe.com/go/getflashplayer/" target="_blank">Flash Player 9</a> or newer installed.');
  document.writeln('	</div>');

  document.writeln('	<script type="text/javascript">');
  document.writeln('		// <![CDATA[');

  document.writeln('	var so = new SWFObject("ep_player.swf", "ep_player", "301", "16", "9", "#FFFFFF");');
  document.writeln('		so.addVariable("skin", "skins/micro_player/skin.xml");');
  document.writeln('		so.addVariable("playlist", "playlist.xspf");');
  document.writeln('		so.addVariable("autoplay", "true");');
  document.writeln('		so.addVariable("shuffle", "true");');
  document.writeln('		so.write("wsgmicro");');

  document.writeln('		// ]]>');
  document.writeln('	</script>');
  document.writeln('</td></tr>');
  document.writeln('</table>');
}

function clientCoords()
{
    var offsetInfo = ""
    clientInfo = "The x coordinate is: " + window.event.clientX + "\r"
    clientInfo += "The y coordinate is: " + window.event.clientY + "\r"
    alert(clientInfo);
}

function generate_recipient()
{
  document.writeln('<input name="recipient" type=hidden value="invisible' +
                   '@' +
				   'invisible' + 'worship' + 'band.com">'); 	   
} //generate_recipient

function do_download(song)
{
  document.writeln("<p><a class='bnav' href='" + path + "/mp3/" + song + ".mp3' title='Download " + song + "'>Download " + song + "</a><br><SPAN style='font-size:10px'>(right/option-click and select Save Target As...)</SPAN></p>");
} // do_download

/* <body onmousemove="window.status = 'X=' + window.event.clientX + ' Y=' + window.event.clientY" ondblclick="clientCoords()"> */



