// this global array has all of the filenames of the clips for the music page

var clip = new Array();
clip[0] = "antngh";
clip[1] = "bestthing";
clip[2] = "csound";
clip[3] = "csuite";
clip[4] = "discon";
clip[5] = "gdd";
clip[6] = "hipobop";
clip[7] = "insomnia";
clip[8] = "midi";
clip[9] = "mindt";
clip[10] = "molly";
clip[11] = "morada";
clip[12] = "99";
clip[13] = "nmln";
clip[14] = "olds";
clip[15] = "serenade";
clip[16] = "sodjobs";
clip[17] = "stranger";
clip[18] = "symp";
clip[19] = "trio";

// this function is called when each page is loaded.

function setmouseovers () {
// this for-loop takes each link one at a time and sets the mouseover property to change the class.
	for (linknum = 0; linknum < document.links.length; linknum++) {			
		document.links[linknum].onmouseover = function () {
		this.className = 'lit';
		}
		document.links[linknum].onmouseout = function () {
		window.status="";
		this.className = 'unlit';
		}
	}
}

// these statements set the mouseovers of the footer links to generate status bar messages.
function setmouseovers_footer () {
	setmouseovers();
	document.getElementById("musiclink").onmouseover = function () {
		window.status="Hear some samples of my compositions in MP3 format";
		this.className = 'lit';
		return true;
	}
	document.getElementById("homelink").onmouseover = function () {
		window.status="www.kevin-gallagher.com";
		this.className = 'lit';
		return true;
	}
	document.getElementById("linkslink").onmouseover = function () {
		window.status="Other sites of interest";
		this.className = 'lit';
		return true;
	}
	document.getElementById("sitelink").onmouseover = function () {
		window.status="www.kevin-gallagher.com";
		this.className = 'lit';
		return true;
	}
	document.getElementById("maillink").onmouseover = function () {
		window.status="Send email to kevin@kevin-gallagher.com";
		this.className = 'lit';
		return true;
	}

}

// this function is called on the music page to open up a sound sample when a link is clicked.
function play_sample (x, desc) {
	var sample_window=window.open("sample.htm","sample_window"+x,"width=500,height=200");
	window.focus();
	sample_window.document.write("<link rel=stylesheet href='kgsite.css' type='text/css'><center><table><tr><td align=center><embed src='"+clip[x]+"_samp.mp3' width=200 height=40 Volume=255 autoplay=true></td></tr><tr><td align=center>"+desc+"</td></tr><tr><td align=center>(Click <a href='"+clip[x]+"_samp.mp3' onMouseOver='this.className=\"lit\"; return true;' onMouseOut='this.className=\"unlit\"; return true;'>here</a> to open the sound clip with your default player if the embedded sound clip above does not work properly.)</td></tr></table>");
	sample_window.focus();
}

// these functions control showing and hiding descriptions and respective buttons on the music page.

function show(x) {
		document.getElementById(clip[x]+"_s").className='unlit';
		document.getElementById(clip[x]+"_h").className='unlit';
		document.getElementById(clip[x]+"_close").className='unlit';
		document.getElementById(clip[x]).style.display="block";
		document.getElementById(clip[x]+"_h").style.display="block";
		document.getElementById(clip[x]+"_s").style.display="none";
}

function showall() {
	for (i=0;i<clip.length;i++)
	{
	show(i);
	}
}

function hide(x) {
		document.getElementById(clip[x]+"_s").className='unlit';
		document.getElementById(clip[x]+"_h").className='unlit';
		document.getElementById(clip[x]+"_close").className='unlit';
		document.getElementById(clip[x]).style.display="none";
		document.getElementById(clip[x]+"_s").style.display="block";
		document.getElementById(clip[x]+"_h").style.display="none";

}

function hideall() {
	for (i=0;i<clip.length;i++)
	{
	hide(i);
	}
}
