// This function inserts email addresses.
// username and host make up the email address.
// mailto is boolean, specifying whether to make a mail to href
// text is optional text for the href to display. if ommited, defaults to
//  email address. Valid not to even supply this param.
function MakeLink(username, host, mailto, text)
{
   if(mailto)
      document.write("<a href=" + '"' +  "mailto:" + username + "@" + host + '"' + ">")

   if(text)
      document.write(text)
   else
      document.write(username + "@" + host)
   if(mailto)
      document.write("</a>")
}



// Functions for Last Updated on pages.
function initArray() {  
   this.length = initArray.arguments.length
   for (var i = 0; i < this.length; i++)
      this[i+1] = initArray.arguments[i]
}

function PrintLastUpdated()
{
   var MOYArray = new   

   initArray("January","February","March","April","May",
             "June","July","August","September","October",
             "November","December");

   var DOYArray = new   

   initArray("Sunday","Monday","Tuesday","Wedsnday","Thursday",
             "Friday","Saturday");

   var YearAdd = 0;
   var LastModDate = new Date(document.lastModified);

   // Netscape returns the year as the # of years since 1900, but IE returns the
   // year as the actual year, so if Netscape, add 1900 to the year.
   if(LastModDate.getYear() < 1900)
      YearAdd = 1900;

   var LastUpdate = DOYArray[LastModDate.getDay() + 1]+" "+ MOYArray[(LastModDate.getMonth()+1)]+" "+LastModDate.getDate()+",  "+(LastModDate.getYear()+YearAdd);
	// This is kinda a hack. Must be redefined if installed undeer a different site root.
	var SiteRoot = '/';

   var URLString = new String(document.URL);
   i = URLString.lastIndexOf("/");
// len = URLString.length();
   slicer = URLString.slice(i + 1, URLString.length);
// Remove any #section at the end of the URL.
   i = slicer.lastIndexOf("#");
   if(i > 0)
      slicer = slicer.slice(0, i);

   document.write('<table class="footer-table" border="0" width="100%">');
   document.write('<tr><td width="33%"><font class="footer"><i>Updated: '+LastUpdate +'</font></i></td>');
   document.write('    <td width="33%"align="center"><font class="footer">');
   document.write('   <a href="http://validator.w3.org/check/referer"><img border="0" src="' + SiteRoot + 'images/icons/html401.png" alt="Valid HTML 4.01!"></a>');
//   document.write('   <a href="http://validator.w3.home/check/referer"><img border="0" src="images/icons/html401.png" alt="Valid HTML 4.01!"></a>');
   document.write('   <a href="http://jigsaw.w3.org/css-validator/"><img border="0" src="' + SiteRoot + 'images/icons/css2.png" alt="Valid CSS!"></a>');
   document.write('</font></td>');
   document.write('    <td width="33%" align="right"><font class="footer"><i>' +slicer + "</i></font></td></tr>");
//   document.write('<TR><TD ALIGN=CENTER COLSPAN=2><FONT class=FOOTER><I>'+document.URL +'</FONT></I></TD></TR>');

   document.write('</table>');
}

function PrintFooter()
{
	PrintLastUpdated();
}








// For music page. Prints the last updated date for a file
function FileLastUpdated(Filename)
{
//   var LastModDate = new Date(document.lastModified);
     var LastModDate = new Date(Filename.date);
     // Netscape returns the year as the # of years since 1900, but IE returns the
     // year as the actual year, so if Netscape, add 1900 to the year.
     if(LastModDate.getYear() < 1900)
        YearAdd = 1900;

//   var LastUpdate = DOYArray[LastModDate.getDay() + 1]+" "+ MOYArray[(LastModDate.getMonth()+1)]+" "+LastModDate.getDate()+",  "+(LastModDate.getYear()+1900);
   var LastUpdate = LastModDate.getDay()+"/"+ (LastModDate.getMonth()+1)+"/"+(LastModDate.getYear()+YearAdd);

//   document.write('Updated: '+LastUpdate);
}




/*
// Functions scrolling messages on first page.
function scroll_status (seed)
{
//    var msg = "Welcome my homepage. Recently updated to a framed version, including JavaScript, CGI and some animated gifs. The update is not quite complete yet, stay tuned....";
//    var msg = "Welcome my homepage. Last updated Friday January 12, 2001. 12/01/01 NEW - Moved from http://minyos.its.rmit.edu.au/~s9606303/ to http://www.alphalink.com.au/~ord/home/. Please update any links.";
    var msg = "Welcome to my homepage. Last updated Friday Janary 18, 2002. Check Updates page for full details." +
              "      19/01/2002       - House keeping" +
              "      28/12/2001 - NEW - Added Bootleg List, My Software & Software." +
              "      19/08/2001 - NEW - Added weekly top 25 music chart."+
              "      25/01/2001 - UPDATED - Music Collection database has been updated. My bootlegs are now part of the database as well. The CGI has been revamped so that the display is customizable, and the database searchable." +
              "      12/01/2001 - NEW - Moved from http://minyos.its.rmit.edu.au/~s9606303/ to http://www.alphalink.com.au/~ord/home/. Please update any links.";
    var out = " ";
    var c = 1;
    if (150 < seed) {
            seed--;
            var cmd="scroll_status(" + seed + ")";
            timerTwo = window.setTimeout(cmd, 100);
    }
    else if (seed <= 150 && 0 < seed) {
            for (c=0 ; c < seed ; c++) {
                    out+=" ";
            }
            out+=msg;
            seed--;
            var cmd="scroll_status(" + seed + ")";
                window.status=out;
            timerTwo=window.setTimeout(cmd,100);
    }
    else if (seed <= 0) {
            if (-seed < msg.length) {
                    out+=msg.substring(-seed,msg.length);
                    seed--;
            var cmd="scroll_status(" + seed + ")";
                    window.status=out;
                    timerTwo=window.setTimeout(cmd,100);
            }
            else {
                    window.status=" ";
                    timerTwo=window.setTimeout("scroll_status(150)",100);
            }
    }
}

*/

/*
 * Convert external links to open in a new window.
 */
function externalLinks()
{ 
	if (!document.getElementsByTagName) return; 
	var anchors = document.getElementsByTagName("a"); 
	// alert(anchors + anchors.length);
	for (var i=0; i<anchors.length; i++) { 
		var anchor = anchors[i]; 
		if (anchor.getAttribute("href") && 
			anchor.getAttribute("rel") == "external") 
		{
			anchor.target = "_blank"; 
		}
	} 
} 

/********************
 * To call different things as startup, we need to queue them,
 * and then execute them.
 * Add anything to start onload use addOnLoad(fn)
 */

var onLoads = new Array();
//var doc = document;

/* Adds a function to load at start
 *
 */
function addOnLoad(f)
{
	onLoads.push(f);
}

/*
 * Execute functions on start.
 */
function startOnLoads()
{
	for(i=0; i<onLoads.length; i++) {
		//alert(onLoads[i]);
		var func = onLoads[i];
		func();
		// alert(func);
	}
}

	function removeSidebar()
	{
		var contentDiv = document.getElementById( 'content-center' );
		contentDiv.style.width = '700px';

		var rightDiv = document.getElementById( 'content-right' );
		rightDiv.style.display = 'none';
	}

	function toggleLiveRows()
	{
		var table = document.getElementById('live_show_list');
		//var rows = table.childNodes[1].rows;
		var rows = table.lastChild.childNodes;
		var state;

		for(i=0; i<rows.length; i++)
		{
			if(rows[i].className == 'hideable')
			{
				state = rows[i].style.display == 'none';
				if(!state)
					rows[i].style.display = 'none';
				else
					rows[i].style.display = '';
			}
		}
		var toggle = document.getElementById('live-toggle');
		if(state)
			toggle.innerHTML = 'Hide';
		else
			toggle.innerHTML = 'Show All';
	}

addOnLoad(externalLinks);
window.onload = startOnLoads;


