function get_CurrentYear()
{
	var yObj = new Date();
	var dtmCurYear = yObj.getYear();
	
	if(navigator.appName == "Netscape")
	{
		dtmCurYear += 1900;
	}
	
	return dtmCurYear;
}


function showDate()
{
	var yObj = new Date();
	var dtmCurYear = get_CurrentYear();
	var dtmCurDay = yObj.getDate();
	var dtmCurMonth = yObj.getMonth();

	document.write(textMonth(dtmCurMonth) + " " + dtmCurDay + ", " + dtmCurYear + "&nbsp;");
}

function textMonth(month)
{
	switch(month)
	{
		case 0:
			return "January";
			break;
		case 1:
			return "February";
			break;
		case 2:
			return "March";
			break;
		case 3:
			return "April";
			break;
		case 4:
			return "May";
			break;
		case 5:
			return "June";
			break;
		case 6:
			return "July";
			break;
		case 7:
			return "August";
			break;
		case 8:
			return "September";
			break;
		case 9:
			return "October";
			break;
		case 10:
			return "November";
			break;
		case 11:
			return "December";
			break;
	}
}


function drawHeader(page)
{
	var links		= "<a href=\"links.htm\" class=\"text_1\">links</a>";
	var artists		= "<a href=\"artists.htm\" class=\"text_1\">artists</a>";
	var bio			= "<a href=\"bio.htm\" class=\"text_1\">bio</a>";
	var gear		= "<a href=\"gear.htm\" class=\"text_1\">gear</a>";
	var audio		= "<a href=\"audio.htm\" class=\"text_1\">audio</a>";
	var demo		= "<a href=\"demo.htm\" class=\"text_1\" title=\"Receive a free CD\">demo CD</a>";
	var usemap		= "usemap=\"#mapName\"";
	
	switch(page)
	{
		case "links":
			links = page;
			break;
		case "artists":
			artists = page;
			break;
		case "bio":
			bio = page
			break;
		case "gear":
			gear = page
			break;
		case "audio":
			audio = page
			break;
		case "demo":
			demo = page + " CD";
			break;
	    case "":
	        break;
		default:
			usemap = "";
			break;	
	}

	var tables =
	"<map name=\"mapName\"><area shape=\"rect\" coords=\"25,10,260,65\" title=\"Chris G Home Page\" href=\"index.htm\"></map>" + 	
	"<table cellpadding=\"0\" cellspacing=\"0\" align=\"center\" bgcolor=\"#ffffff\" style=\"border-left-style:solid; border-right-style:solid; border-width:1px; border-color:#005555; width:780px;\">" +
	"<tr><td colspan=\"8\" height=\"4\"></td></tr>" +
	"<tr><td width=\"387\"></td>" +
	"<td><img src=\"images/left_bar.gif\"></td>" +
	"<td width=\"1\"></td>" +
	"<td width=\"70\" bgcolor=\"#669999\" align=\"center\" class=\"text_6\">" + links + "</td>" +
	"<td width=\"1\"></td>" +
	"<td width=\"80\" bgcolor=\"#669999\" align=\"center\" class=\"text_6\">" + artists + "</td>" +
	"<td width=\"1\"></td>" +
	"<td width=\"90\" bgcolor=\"#669999\" align=\"center\"><a href=\"mailto:me@chris-g.com\" class=\"text_1\" title=\"Send Email to Chris G\">contact</a></td></tr>" +
	"<tr><td colspan=\"8\" height=\"1\"></td></tr></table>" +
	"<table cellpadding=\"0\" cellspacing=\"0\" align=\"center\" bgcolor=\"#ffffff\" style=\"border-left-style:solid; border-right-style:solid; border-width:1px; border-color:#005555; width:780px;\">" +
	"<tr><td colspan=\"10\" valign=\"top\"><img src=\"images/header.gif\" border=\"0\"" + usemap + "></td></tr>" +
	"<tr><td colspan=\"10\" height=\"1\"></td></tr>" +
	"<tr><td width=\"60\" bgcolor=\"#669999\" align=\"center\" class=\"text_6\">" + bio + "</td>" +
	"<td width=\"1\"></td>" +
	"<td width=\"70\" bgcolor=\"#669999\" align=\"center\" class=\"text_6\">" + gear + "</td>" +
	"<td width=\"1\"></td>" +
	"<td width=\"80\" bgcolor=\"#669999\" align=\"center\" class=\"text_6\">" + audio + "</td>" +
	"<td width=\"1\"></td>" +
	"<td width=\"90\" bgcolor=\"#669999\" align=\"center\" class=\"text_6\">" + demo + "</td>" +
	"<td width=\"1\"></td>" +
	"<td><img src=\"images/right_bar.gif\"></td>" +
	"<td width=\"330\" align=\"right\" valign=\"middle\"><div id=\"dateText\" class=\"text_2\"><script language=\"javascript\">showDate()</script></div></td></tr></table>";

	document.write(tables);
}

function drawHeader_Reflections(page)
{
	var story		= "<a href=\"story.htm\" class=\"text_14\">about Andrew</a>";
	var music		= "<a href=\"music.htm\" class=\"text_14\">the music</a>";
	var purchase	= "<a href=\"index.htm\" class=\"text_14\">purchase</a>";
	var usemap		= "usemap=\"#mapName\"";
	
	switch(page)
	{
		case "story":
			story = "about Andrew";
			break;
		case "music":
			music = "the " + page;
			break;
		case "purchase":
			purchase = page
		default:
			usemap = "";
			break;	
	}

	var tables =
	
	"<map name=\"mapName\"><area shape=\"rect\" coords=\"0,0,778,184\" title=\"Reflections Home Page\" href=\"index.htm\"></map>" + 	
	
	"<table cellpadding=\"0\" cellspacing=\"0\" align=\"center\" bgcolor=\"#ffffff\" style=\"border-left-style:solid; border-right-style:solid; border-width:1px; border-color:#588dcd; width:780px;\">" +
    "<tr><td height=\"2\"></td></tr>" +
    "<tr><td valign=\"top\"><img src=\"images/reflections_header.jpg\" border=\"0\"" + usemap + "></td></tr></table>" +
	
	"<table cellpadding=\"0\" cellspacing=\"0\" align=\"center\" bgcolor=\"#ffffff\" style=\"border-left-style:solid; border-right-style:solid; border-width:1px; border-color:#588dcd; width:780px;\">" +
	"<tr><td colspan=\"8\" height=\"1\"></td></tr>" +
	
	"<tr><td width=\"307\" height=\"17\" valign=\"middle\"><div id=\"dateText\" class=\"text_15\"><script language=\"javascript\">showDate()</script></div></td>" +  "</tr></table>";
	
	/*
	"<td><img src=\"images/left_bar.gif\"></td>" +
	"<td width=\"1\"></td>" +
	"<td width=\"125\" bgcolor=\"#7bb4e1\" align=\"center\" class=\"text_18\">" + story + "</td>" +
	"<td width=\"1\"></td>" +
	"<td width=\"100\" bgcolor=\"#7bb4e1\" align=\"center\" class=\"text_18\">" + music + "</td>" +
	"<td width=\"1\"></td>" +
	"<td width=\"95\" bgcolor=\"#7bb4e1\" align=\"center\" class=\"text_18\">" + purchase + "</a></td></tr>" +
	"<tr><td colspan=\"8\" height=\"1\"></td></tr></table>";
	*/
    
	document.write(tables);
}

function drawFooter(height, reflections)
{
	var table;
	var dtmCurYear = get_CurrentYear();
	var years = "2000-" + dtmCurYear;
	var name = "Chris G";
	var email = "<a href=\"mailto:me@chris-g.com\" class=\"text_5\">me@chris-g.com</a>";
	
	if(reflections != undefined)
	{
	    years = "1983-" + dtmCurYear;
	    name = "Andrew Gorczyca";
	    email = "<a href=\"mailto:chrisg@chris-g.com\" class=\"text_19\">chrisg@chris-g.com</a>";
	}

	table =
	"<table border=\"0\" align=\"center\">" +
	"<tr><td class=\"text_5\" style=\"padding-top:24px; text-align: center;\">All site contents copyright © " + years + " by " + name + " - all rights reserved.<br/>Address e-mail to:&nbsp;&nbsp;"+ email + "</td></tr>" +
	"</table>";

	document.write(table);
}

function divSwitch(div, divCount)
{ 
	var divId;
	var divStyle;	
	
    for(i=1; i<=divCount; i++)
    {
        divStyle = (div == i) ? 'block' : 'none';
        
        divId = document.getElementById('div' + i);
        
        divId.style.display = divStyle;
    }
}

function drawDivPagination(div, divCount)
{
    var divPrev     = "";
    var divNext     = "";
    var divider     = "";
    var pagination  = "";
    
    //build Prev and Next links
    if(div > 1)
    {
        divPrev = "<a href=\"javascript:divSwitch(" + (div - 1) + ", " + divCount + ");\" class=\"text_3\">&lt; Prev</a> | ";
    }
    
    if(div < divCount)
    {
        divNext = "<a href=\"javascript:divSwitch(" + (div + 1) + ", " + divCount + ");\" class=\"text_3\">Next &gt;</a>";
    }
    
    //build numbered div pagination links
    pagination = divPrev;
    
    for(i=1; i<=divCount; i++)
    {
        if(div == i)
        {
            pagination += (div != divCount) ? "<b>" + i + "</b> | " : "<b>" + i + "</b>";
        }
        else
        {
            pagination += "<a href=\"javascript:divSwitch(" + i + ", " + divCount + ");\" class=\"text_3\">" + i + "</a> | ";
        }
    }
    
    pagination += divNext;
    
    document.write(pagination);  
}

function popUp(linkName, no_tools)
{
	var actionWindow;	
	
	if(no_tools)
	{
		actionWindow = window.open('', 'Link', 'width=860, height=600, status=0, scrollbars=1, menubar=0, toolbar=0, location=0, resizable=yes, minimize=yes, left=0, top=0, screenX=0, screenY=0');
	}
	else
	{
		actionWindow = window.open('', 'Link', 'width=800, height=600, status=0, scrollbars=1, menubar=1, toolbar=0, location=1, resizable=yes, minimize=yes, left=0, top=0, screenX=0, screenY=0');
	}
	
	actionWindow.location.href = linkName;
	actionWindow.focus();
}

function popUpImage(linkName)
{
	var actionWindow;	
	
	actionWindow = window.open('', 'Link', 'width=740, height=730, status=0, scrollbars=1, menubar=0, toolbar=0, location=0, resizable=yes, minimize=yes, left=0, top=0, screenX=0, screenY=0');
	
	actionWindow.location.href = linkName;
	actionWindow.focus();
}


function showPicture(pictureId)
{
	var leftPosition;
   
    var tables  = "<table cellpadding=\"0\" cellspacing=\"0\"><tr><td><a href=\"javascript:hidePicture();\"><img src=\"images/show_" + pictureId + "_.jpg\" class=\"image\" width=\"500\" height=\"370\" title=\"Close Window\"></a></td></tr></table>" +
	              "<table cellpadding=\"0\" cellspacing=\"0\" class=\"table_0\"><tr><td class=\"text_0\" style=\"width:427px; padding:10px;\">" + captionArray[pictureId] +
	              "</td><td align=\"right\" valign=\"bottom\" style=\"width:26px; padding:10px;\"><a href=\"javascript:hidePicture();\" class=\"text_3\">Close</a></td></tr></table>";

    leftPosition = getLeftPosition();
        
    document.getElementById('largePicture').style.left = (leftPosition + 66);
    document.getElementById('largePicture').innerHTML  = tables;
}

function hidePicture()
{
    document.getElementById('largePicture').innerHTML = "";
}

function getLeftPosition()
{
	var windowWidth;
	var leftPosition;

	//ensure centering of footer text
	if (parseInt(navigator.appVersion) > 3) 
	{
 		if (navigator.appName.indexOf("Microsoft") != -1) 
		{
  			windowWidth  = document.body.offsetWidth - 20;		
 		}
		else
		{
			//catch-all value for scrollbar or non-scrollbar width
			windowWidth = document.width;			
		}

		leftPosition = ((windowWidth - 780) / 2);
    }
    
    return leftPosition;
}

function drawMusicalLinks(arrayPosition)
{
	var rowsCells	= "";

	//outer loop draws five rows
	for(i=0; i<5; i++)
	{
		rowsCells += "<tr>";
		
		//inner loop draws table cells with link data
		for(ii=arrayPosition; ii<(arrayPosition + 4); ii++)
		{
			rowsCells += "<td width=\"165\">";
			rowsCells += "<img src=\"images/spacer.gif\" width=\"0\" height=\"16\">";
			rowsCells += "<a href=\"Javascript:popUp('" + hrefArray[ii] + "')\" class=\"text_3\">" + nameArray[ii] + "</a></td>";	
		}
		
		arrayPosition += 4;
		
		rowsCells += "</tr>";		
	}
	
	document.write(rowsCells);	
}

function buildScrollingImages()
{
    var html = "";
    var jsFunction = "";

    //build HTML of images shown in scrollable div (show.htm page)
    for(i=0; i<=17; i++)
    {
		switch(i)
		{
			case 0:
				jsFunction = "popUp('http://www.kevingilbert.com');";
				break;
			case 1:
				jsFunction = "popUp('http://www.spocksbeard.com');";
				break;
			default:
				jsFunction = "showPicture(" + i + ");";
				break;
		}		
        
        html += "<a href=\"javascript:" + jsFunction + "\"><img title=\"" + titleArray[i] + "\" src=\"images/show_" + i + ".jpg\" width=\"135\" height=\"100\" border=\"0\"></a><br/>";
    	html += "<img src=\"images/spacer.gif\" width=\"1\" height=\"30\"><br/>";
    }

    document.getElementById('divContent_1').innerHTML  = html;    
}

function buildPictureArrays()
{
	titleArray	 = new Array();
	captionArray = new Array();
	
	titleArray[0]  = "Kevin Gilbert";
	titleArray[1]  = "Spock's Beard";
	titleArray[2]  = "Bryan Beller and Mike Keneally";
	titleArray[3]  = "Nick D'Virgilio";	
	titleArray[4]  = "Chris G";	
	titleArray[5]  = "City Of The Sun";	
	titleArray[6]  = "Suit Fugue";	
	titleArray[7]  = "Water Under The Bridge";	
	titleArray[8]  = "Best Laid Plans";	
	titleArray[9]  = "Certifiable #1 Smash";	
	titleArray[10] = "The Way Back Home";	
	titleArray[11] = "Mike Keneally";
	titleArray[12] = "Ryo Okumoto";
	titleArray[13] = "Nick D'Virgilio and Alan Morse";
	titleArray[14] = "Spock's Beard";
	titleArray[15] = "Nick D'Virgilio";
	titleArray[16] = "Spock's Beard";
	titleArray[17] = "Spock's Beard 2002";		
	
	captionArray[0]  = "";
	captionArray[1]  = "";
	captionArray[2]  = "<b>Bryan Beller</b> and <b>Mike Keneally</b><br/>Taylor Guitar Clinic - Autumn 2002";
	captionArray[3]  = "<b>Nick D'Virgilio</b> rehearses for the ProgWest performance<br/>The Power Plant, North Hollywood, CA - November 7, 2002";
	captionArray[4]  = "<b>Chris G</b> rehearses for the ProgWest performance<br/>The Power Plant, North Hollywood, CA - November 7, 2002";
	captionArray[5]  = "The tribute band performs <b>City Of The Sun</b><br/>ProgWest 2002, Claremont, CA - November 10, 2002";
	captionArray[6]  = "The tribute band adds a comedic flair to the ending of <b>Suit Fugue</b><br/>ProgWest 2002, Claremont, CA - November 10, 2002";
	captionArray[7]  = "The tribute band performs <b>Water Under The Bridge</b><br/>ProgWest 2002, Claremont, CA - November 10, 2002";
	captionArray[8]  = "Marc Ziegenhagen laying it down for <b>Best Laid Plans</b><br/>ProgWest 2002, Claremont, CA - November 10, 2002";
	captionArray[9]  = "The tribute band performs <b>Certifiable #1 Smash</b><br/>ProgWest 2002, Claremont, CA - November 10, 2002";
	captionArray[10] = "<b>Nick D'Virgilio</b> leads the tribute band on <b>The Way Back Home</b><br/>ProgWest 2002, Claremont, CA - November 10, 2002";
	captionArray[11] = "<b>Mike Keneally</b> performs solo material with his band<br/>ProgWest 2002, Claremont, CA - November 10, 2002";
	captionArray[12] = "<b>Ryo Okumoto</b> performs solo material with other players<br/>ProgWest 2002, Claremont, CA - November 10, 2002";
	captionArray[13] = "<b>Nick D'Virgilio</b> and <b>Alan Morse</b> perform <b>The Doorway</b><br/>ProgWest 2002, Claremont, CA - November 10, 2002";
	captionArray[14] = "<b>Spock's Beard</b> performs <b>Go The Way You Go</b><br/>ProgWest 2002, Claremont, CA - November 10, 2002";
	captionArray[15] = "<b>Nick D'Virgilio</b> takes his turn at drums onstage<br/>ProgWest 2002, Claremont, CA - November 10, 2002";
	captionArray[16] = "<b>Spock's Beard</b> performs <b>The Devil's Got My Throat</b><br/>ProgWest 2002, Claremont, CA - November 10, 2002";
	captionArray[17] = "<b>Spock's Beard</b> takes a final bow after the performance<br/>ProgWest 2002, Claremont, CA - November 10, 2002";
}

function buildLinkArrays()
{
	hrefArray = new Array();
	nameArray = new Array();
	
	hrefArray[0]  = "http://www.terrybozzio.com";
	hrefArray[1]  = "http://www.manu-katche.com/actualites.htm";
	hrefArray[2]  = "http://www.simon-phillips.com";
	hrefArray[3]  = "http://www.toddsucherman.com";
	hrefArray[4]  = "http://www.billbruford.com";
	hrefArray[5]  = "http://www.facebook.com/OfficalThomasLang";
	hrefArray[6]  = "http://www.toto99.com/jeff/tribute.shtml";
	hrefArray[7]  = "http://www.tonyverderosa.com";
	hrefArray[8]  = "http://www.vinniecolaiuta.com";
	hrefArray[9]  = "http://www.rodmorgenstein.com";
	hrefArray[10] = "http://www.mikeportnoy.com";
	hrefArray[11] = "http://www.chadwackerman.com";
	hrefArray[12] = "http://www.philcollins.com/us";
	hrefArray[13] = "http://www.carlpalmer.com";
	hrefArray[14] = "http://www.buddyrich.com";
	hrefArray[15] = "http://www.daveweckl.com";
	hrefArray[16] = "http://www.stewartcopeland.net";
	hrefArray[17] = "http://www.neilpeart.net";
	hrefArray[18] = "http://www.vitalinformation.com";
	hrefArray[19] = "http://www.alanwhite.net";
	
	
	
	hrefArray[20]  = "http://www.chickcorea.com";		hrefArray[21]  = "http://www.j-tull.com";			hrefArray[22]  = "http://www.patmetheny.com";		hrefArray[23]  = "http://www.spocksbeard.com";
	hrefArray[24]  = "http://www.depechemode.com";		hrefArray[25]  = "http://www.king-crimson.com";		hrefArray[26]  = "http://www.queensryche.com";		hrefArray[27]  = "http://www.thepolice.com";
	hrefArray[28]  = "http://www.thomasdolby.com";		hrefArray[29]  = "http://www.kingsxrocks.com";		hrefArray[30]  = "http://www.tr-i.com";				hrefArray[31]  = "http://www.toto99.com";
	hrefArray[32]  = "http://www.genesis-music.com";	hrefArray[33]  = "http://www.ledzeppelin.com";		hrefArray[34]  = "http://www.rush.com";				hrefArray[35]  = "http://www.yesworld.com";
	hrefArray[36]  = "http://www.kevingilbert.com";		hrefArray[37]  = "http://www.davematthewsband.com";	hrefArray[38]  = "http://www.howardshore.com";		hrefArray[39]  = "http://www.zappa.com";
	
	
	
	hrefArray[40]  = "http://www.acousticchambers.com";		hrefArray[41]  = "http://www.joecarolus.com";			hrefArray[42]  = "http://www.philkeaggy.com";			hrefArray[43]  = "http://www.parallelsthemusicofyes.com";
	hrefArray[44]  = "http://www.ajalon.net";				hrefArray[45]  = "http://www.ndvmusic.com";				hrefArray[46]  = "http://www.keneally.com";				hrefArray[47]  = "http://www.londonbridgestudio.com";	
	hrefArray[48]  = "http://www.adrianbelew.net";			hrefArray[49]  = "http://web.me.com/darindipietro/";	hrefArray[50]  = "http://www.myspace.com/davemeros";	hrefArray[51]  = "http://www.therockcandyband.com";
	hrefArray[52]  = "http://www.bryanbeller.com";			hrefArray[53]  = "http://www.wonky.net";				hrefArray[54]  = "http://www.smugband.com";				hrefArray[55]  = "http://www.twba.com";	
	hrefArray[56]  = "http://www.brandicarlile.com";		hrefArray[57]  = "http://www.myspace.com/grungelive";	hrefArray[58]  = "http://www.ryookumoto.com";			hrefArray[59]  = "http://barry.warsaw.us";	
	
	
	nameArray[0]  = "Terry Bozzio";
	nameArray[1]  = "Manu Katche";
	nameArray[2]  = "Simon Phillips";
	nameArray[3]  = "Todd Sucherman";
	nameArray[4]  = "Bill Bruford";
	nameArray[5]  = "Thomas Lang";
	nameArray[6]  = "Jeff Porcaro";
	nameArray[7]  = "Tony Verderosa";
	nameArray[8]  = "Vinnie Colaiuta";
	nameArray[9]  = "Rod Morgenstein";
	nameArray[10] = "Mike Portnoy";
	nameArray[11] = "Chad Wackerman";
	nameArray[12] = "Phil Collins";
	nameArray[13] = "Carl Palmer";
	nameArray[14] = "Buddy Rich";
	nameArray[15] = "Dave Weckl";
	nameArray[16] = "Stewart Copeland";
	nameArray[17] = "Neil Peart";
	nameArray[18] = "Steve Smith";
	nameArray[19] = "Alan White";	
	
	
	
	nameArray[20]  = "Chick Corea";		nameArray[21]  = "Jethro Tull";			nameArray[22]  = "Pat Metheny";			nameArray[23]  = "Spock's Beard";
	nameArray[24]  = "Depeche Mode";	nameArray[25]  = "King Crimson";		nameArray[26]  = "Queensr&#255;che";	nameArray[27]  = "The Police";
	nameArray[28]  = "Thomas Dolby";	nameArray[29]  = "King's X";			nameArray[30]  = "Todd Rundgren";		nameArray[31]  = "Toto";
	nameArray[32]  = "Genesis";			nameArray[33]  = "Led Zeppelin";		nameArray[34]  = "Rush";				nameArray[35]  = "Yes";
	nameArray[36]  = "Kevin Gilbert";	nameArray[37]  = "Dave Matthews Band";	nameArray[38]  = "Howard Shore";		nameArray[39]  = "Frank Zappa";
		
	
	
	nameArray[40]  = "Acoustic Chambers";	nameArray[41]  = "Joe Carolus";				nameArray[42]  = "Phil Keaggy";		nameArray[43]  = "Parallels";
	nameArray[44]  = "Ajalon";				nameArray[45]  = "Nick D'Virgilio";			nameArray[46]  = "Mike Keneally";	nameArray[47]  = "Jonathan Plum";
	nameArray[48]  = "Adrian Belew";		nameArray[49]  = "Darin Di Pietro";			nameArray[50]  = "Dave Meros";		nameArray[51]  = "Rock Candy";
	nameArray[52]  = "Bryan Beller";		nameArray[53]  = "Shawn \"Yogi\" Farley";	nameArray[54]  = "Rick Musallam";	nameArray[55]  = "The Whole Bolivian Army";
	nameArray[56]  = "Brandi Carlile";		nameArray[57]  = "Grunge";					nameArray[58]  = "Ryo Okumoto";		nameArray[59]  = "Barry Warsaw";	
}

