var Object = new Array();
for (i = 0; i < 12; i++) Object[i] = 'images/obj' + i + '.jpg';
var p = Object.length;
var preLoad = new Array();
for (i = 0; i < p; i++) {
	preLoad[i] = new Image();
	preLoad[i].src = Object[i];
	}

var zoo = new Array()
zoo[0] = new animal("rooster","&nbsp;Rooster&nbsp;<br>&nbsp;Hubris&nbsp;");
zoo[1] = new animal("buffalo","&nbsp;American&nbsp;<br>&nbsp;Buffalo&nbsp;");
zoo[2] = new animal("horse","&nbsp;Charley&nbsp;<br>&nbsp;Horse&nbsp;");
zoo[3] = new animal("bear","&nbsp;Polar&nbsp;<br>&nbsp;Bear&nbsp;");
zoo[4] = new animal("stork","&nbsp;Stork&nbsp;");
zoo[5] = new animal("camel","&nbsp;Camel&nbsp;");
zoo[6] = new animal("vulture","&nbsp;Vulture&nbsp;");
zoo[7] = new animal("peacock","&nbsp;Peacock&nbsp;");
zoo[8] = new animal("coda","&nbsp;Coda&nbsp;");


function MakeArray(n){
	this.length = n
	return this
	}

function animal(what,which) {
	this.what = what;
	this.which = which;
	}

function writeAnimalLinks() {
	var content = "";
	content += '<table><tr><td width=\"282\" valign=top><table><tr><td width=\"50\" valign=top>';
	content += '<img alt=\"\" src=\"elements/audio.gif\" width=\"32\" height=\"32\" border=\"0\"></td>';
	for (var i=0;i<zoo.length;i++) {
		if ( i==4 ) content += '</td></tr><tr>';
		content += '<td width=\"50\" valign=top align=center><font class=nav1><a href=\"MP3/' + zoo[i].what + '.mp3\" ';
		content += 'onClick=\"window.open(\'\',\'popup\',\'height=100,width=480,scrollbars=no\')\" target=\"popup\">';
		content += zoo[i].which + '</a></font></td>';
		}
	content += '</td></tr></table><td width=\"18\">&nbsp;</td>';
	content += '<td width=\"108\" valign=top><font class=nav1><a href=\"PDFs/Animals_Score.pdf\">';
	content += '<img alt=\"\" src=\"elements/score.gif\" width=\"32\" height=\"32\" border=\"0\" align=\"left\">';
	content += '<img alt=\" \" src=\"images/tpixel.gif\" width=\"1\" height=\"1\" vspace=\"1\" border=\"0\"><br>';
	content += '&nbsp;download&nbsp;<br>&nbsp;score&nbsp;</a></font></td></tr></table>';
	document.write(content);
	}
	
var concerto = new Array()
concerto[0] = new mvmt("vcI-short","&nbsp;I. Vivace, fuoco&nbsp;");
concerto[1] = new mvmt("vcII-short","&nbsp;II. Andante,<br>&nbsp; &nbsp; cadenza&nbsp;");
concerto[2] = new mvmt("vcIII-short","&nbsp;III. Presto&nbsp;");

function mvmt(what,which) {
	this.what = what;
	this.which = which;
	}

function writeVCLinks() {
	var content = "";
	content += '<table><tr><td width=\"240\" valign=top><table><tr><td width=\"32\" valign=top>';
	content += '<img alt=\"\" src=\"elements/audio.gif\" width=\"32\" height=\"32\" border=\"0\"></td>';
	content += '<td width=\"200\" valign=top align=left>';
	for (var i=0;i<concerto.length;i++) {
		content += '<font class=nav1><a href=\"MP3/' + concerto[i].what + '.mp3\" ';
		content += 'onClick=\"window.open(\'\',\'popup\',\'height=100,width=480,scrollbars=no\')\" target=\"popup\">';
		content += concerto[i].which + '</a></font><br>';
		content += '<img alt=\" \" src=\"images/tpixel.gif\" width=\"1\" height=\"1\" vspace=\"1\" border=\"0\"><br>';
		}
	content += '</td><td width=\"108\" valign=top><font class=nav1><a href=\"PDFs/vc-short.pdf\">';
	content += '<img alt=\"\" src=\"elements/score.gif\" width=\"32\" height=\"32\" border=\"0\" align=\"left\">';
	content += '<img alt=\" \" src=\"images/tpixel.gif\" width=\"1\" height=\"1\" vspace=\"1\" border=\"0\"><br>';
	content += '&nbsp;download&nbsp;<br>&nbsp;score&nbsp;</a></font></td></tr></table>';
	content += '</td></tr></table>';
	document.write(content);
	}
	
function write2Links(filename) {
	var content = "";
	var browserName = navigator.appName;
	if (browserName == "Microsoft Internet Explorer") {
		content += '<table><tr><td width=\"74\" valign=top><font class=nav1>';
		content += '<a href=\"MP3/' + filename + '.mp3\">';
		content += '<img alt=\"\" src=\"elements/audio.gif\" width=\"32\" height=\"32\" border=\"0\" align=\"left\">';
		content += '<img alt=\" \" src=\"images/tpixel.gif\" width=\"1\" height=\"1\" vspace=\"1\" border=\"0\"><br>';
		content += '&nbsp;MP3&nbsp;<br>&nbsp;audio&nbsp;</a></font></td>';
		content += '<td width=\"98\" valign=top><font class=nav1><a href=\"PDFs/' + filename + '.pdf\">';
		content += '<img alt=\"\" src=\"elements/score.gif\" width=\"32\" height=\"32\" border=\"0\" align=\"left\">';
		content += '<img alt=\" \" src=\"images/tpixel.gif\" width=\"1\" height=\"1\" vspace=\"1\" border=\"0\"><br>';
		content += '&nbsp;download&nbsp;<br>&nbsp;score&nbsp;</a></font></td></tr></table>';
		}
	else {
		content += '<table><tr><td width=\"74\" valign=top><font class=nav1>';
		content += '<a href=\"MP3/' + filename + '.mp3\" onClick=\"window.open(\'\',\'popup\',\'height=100,width=480,scrollbars=no\')\" target=\"popup\">';
		content += '<img alt=\"\" src=\"elements/audio.gif\" width=\"32\" height=\"32\" border=\"0\" align=\"left\">';
		content += '<img alt=\" \" src=\"images/tpixel.gif\" width=\"1\" height=\"1\" vspace=\"1\" border=\"0\"><br>';
		content += '&nbsp;MP3&nbsp;<br>&nbsp;audio&nbsp;</a></font></td>';
		content += '<td width=\"98\" valign=top><font class=nav1><a href=\"PDFs/' + filename + '.pdf\">';
		content += '<img alt=\"\" src=\"elements/score.gif\" width=\"32\" height=\"32\" border=\"0\" align=\"left\">';
		content += '<img alt=\" \" src=\"images/tpixel.gif\" width=\"1\" height=\"1\" vspace=\"1\" border=\"0\"><br>';
		content += '&nbsp;download&nbsp;<br>&nbsp;score&nbsp;</a></font></td></tr></table>';
		}
	document.write(content);
	}
	
function writeSLink(filename) {
	var content = "";
	content += '<table><tr><td width=\"74\" valign=top><font class=nav1></font></td>';
	content += '<td width=\"98\" valign=top><font class=nav1><a href=\"PDFs/' + filename + '.pdf\">';
	content += '<img alt=\"\" src=\"elements/score.gif\" width=\"32\" height=\"32\" border=\"0\" align=\"left\">';
	content += '<img alt=\" \" src=\"images/tpixel.gif\" width=\"1\" height=\"1\" vspace=\"1\" border=\"0\"><br>';
	content += '&nbsp;download&nbsp;<br>&nbsp;score&nbsp;</a></font></td></tr></table>';
	document.write(content);
	}
	
function curtis() { 
	var f="david"
	var m="&#45;"
	var l="gompper"
	var d="uiowa"
	var s="edu"
	document.write('<a href=mailto:' + f + m + l + '@' + d + '.' + s + '>&nbsp;Contact Me&nbsp;</a>' ); 
	}

function writeUpdate() {
	var update = "";
	var m = document.lastModified;
	var yr = m.indexOf("20");
	var q = m.indexOf(":");
	var gmt = m.indexOf("GMT")
	var p = m.length;
	if ( yr < 7 ) update = m.substring(0,yr+4);
	else if ( gmt < 1) update = m.substring(0,q-3) + ', ' + m.substring(yr,yr+4);
	else if ( gmt > 1) update = m.substring(0,q-3);
	document.write(update);
	}
	
function daysFrom(num,day,month,year) {
  var write = ""
  var daystocount=new Date(year, month-1, day)
  today=new Date()
  if (today.getMonth()==month && today.getDate()>day)
  daystocount.setFullYear(daystocount.getFullYear())
  var oneday=1000*60*60*24
  if ( Math.ceil( (today.getTime()-daystocount.getTime() )/(oneday) ) < 90 ) 
  if (num>1) write = "<i>(&nbsp;new releases&nbsp;)</i>"
  else write = "<i>(&nbsp;new release&nbsp;)</i>"
  document.write(write)
}

var newPage = new Array();
newPage[0] = new aPage('5','anelm');
newPage[1] = new aPage('4','animals');
newPage[2] = new aPage('2','anon');
newPage[3] = new aPage('0','balloons');
newPage[4] = new aPage('7','blackeyes');
newPage[5] = new aPage('1','butterfly');
newPage[6] = new aPage('5','caedmon');
newPage[7] = new aPage('2','callingcards');
newPage[8] = new aPage('3','chorale');
newPage[9] = new aPage('3','credo');
newPage[10] = new aPage('1','crossed');
newPage[11] = new aPage('1','crossings');
newPage[12] = new aPage('1','dontgothere');
newPage[13] = new aPage('2','echoes');
newPage[14] = new aPage('2','finnegan');
newPage[15] = new aPage('4','fivelovesongs');
newPage[16] = new aPage('0','flip');
newPage[17] = new aPage('3','homage');
newPage[18] = new aPage('1','horseraces');
newPage[19] = new aPage('2','ikona');
newPage[20] = new aPage('0','ikon');
newPage[21] = new aPage('3','insidecage');
newPage[22] = new aPage('1','kuta');
newPage[23] = new aPage('5','lament');
newPage[24] = new aPage('4','lightpoem');
newPage[25] = new aPage('4','love');
newPage[26] = new aPage('4','mbs');
newPage[27] = new aPage('3','meditation');
newPage[28] = new aPage('1','musica');
newPage[29] = new aPage('2','musicglen');
newPage[30] = new aPage('7','nonusitata');
newPage[31] = new aPage('4','paternoster');
newPage[32] = new aPage('4','poetrymidsummer');
newPage[33] = new aPage('3','preludes');
newPage[34] = new aPage('4','shades');
newPage[35] = new aPage('3','shadows');
newPage[36] = new aPage('1','shadowsII');
newPage[37] = new aPage('5','sixlovepoems');
newPage[38] = new aPage('0','spirals');
newPage[39] = new aPage('2','star');
newPage[40] = new aPage('7','tempest');
newPage[41] = new aPage('3','toccata');
newPage[42] = new aPage('2','traceur');
newPage[43] = new aPage('0','transitus');
newPage[44] = new aPage('1','trio');
newPage[45] = new aPage('0','vc');
newPage[46] = new aPage('4','whiteglass');
newPage[47] = new aPage('6','wx5');
newPage[48] = new aPage('6','yndy');

function aPage(cat,comp) {
	this.cat = cat
	this.comp = comp
	}

function writeBrowse(catnum,match) {
	var content = "";
	var category = "Cat" + (catnum + 1);
	content += '<img alt="" src="elements/tab' + category + '.jpg" width="20" height="144" border="0">'; 
	content += '<br><img alt=\" \" src=\"images/tpixel.gif\" width=\"1\" height=\"1\" vspace=\"1\" border=\"0\"><br>';

	for (var i=0;i<newPage.length;i++) {
		if ( match == newPage[i].comp ) break;
		}
	for (var j=i+1;j<=newPage.length;j++) {
		if ( j == newPage.length ) j=0;
		if ( catnum == newPage[j].cat ) break;
		}
	content += '<a href=\"' + newPage[j].comp + '.html\">';
	content += '<img alt="" src="elements/tabBrowseCat.jpg" width="15" height="120" border="0">'; 
	content += '<br><img alt=\" \" src=\"images/tpixel.gif\" width=\"1\" height=\"1\" vspace=\"1\" border=\"0\"><br>';
	content += '</a>';

	for (i=0;i<newPage.length;i++) {
		if ( match == newPage[i].comp ) break;
		}
	content += '<a href=\"';
	if ( i == newPage.length-1 ) content += newPage[0].comp;
	else content += newPage[i+1].comp;
	content += '.html\">';
	content += '<img alt="" src="elements/tabBrowseAll.jpg" width="15" height="120" border="0">'; 
	content += '</a>';

	document.write(content);
	}

function getWindowSize(dim) {
	var size = "";
	var wSize = 0;
	if ( navigator.userAgent.indexOf("MSIE") > 0 ) {
		wSize = document.body.clientWidth;
		} 
	else if ( navigator.userAgent.indexOf("Netscape") > 0 ) {
		wSize = window.outerWidth;
		} 
	else if ( navigator.userAgent.indexOf("Firefox") > 0 ) {
		wSize = window.outerWidth;
		} 
	else if ( navigator.userAgent.indexOf("Safari") > 0 ) {
		wSize = window.outerWidth;
		} 
	else {                                                
		wSize = window.outerWidth;
		}
	return(wSize);      
	}

function getStatus(page,link,status) {
	var content = "";
	content += '<a href=\"' + page + '.html" ';
	content += 'onmouseover=\"window.status=\'Go to: ' + page + ', ' + status + '\';return true\"  ';
	content += 'onmouseout=\"window.status=\' \';return true\">&nbsp;' + link + '&nbsp;</a>&nbsp; &nbsp;';
	return(content);
	}
	
var state = new Array();
state[1] = getStatus("11.welcome","Welcome","");
state[2] = getStatus("12.bio","Biography","");
state[3] = getStatus("13.media","Media","");
state[4] = getStatus("14.comp","Compositions","");
state[5] = getStatus("15.cds","Discography","");
state[6] = getStatus("16.photos","Photos","");

var pageName = new Array();
pageName[1] = "Welcome";
pageName[2] = "Biography";
pageName[3] = "Media";
pageName[4] = "Compositions";
pageName[5] = "Discography";
pageName[6] = "Photos";

function writeElements(page) {
	var content = "";
	var screenwidth = getWindowSize();
	var contact = "";

	var moddate = "";
	var m = document.lastModified;
	var yr = m.indexOf("201");
	var q = m.indexOf(":");
	var gmt = m.indexOf("GMT")
	var p = m.length;
	if ( yr < 7 ) moddate = m.substring(0,yr+4);
	else if ( gmt < 1) moddate = m.substring(0,q-3) + ', ' + m.substring(yr,yr+4);
	else if ( gmt > 1) moddate = m.substring(0,q-3);

	var contact = "";
	var f="david";
	var m="&#45;";
	var l="gompper";
	var d="uiowa";
	var s="edu";
	contact = '<a href=mailto:' + f + m + l + '@' + d + '.' + s + '>&nbsp;Contact Me&nbsp;</a>';

	content += '<div id=\"cherryhead\" style=\"position:absolute; ';
	content += 'width:' + screenwidth + '; height:60; left: 0; top: 0; z-index:2; ';
	content += 'overflow:hidden; visibility:visible;\">';
	content += '<img alt=\"\" src=\"elements/CherryHead.jpg\" width=\"' + screenwidth + '\" height=\"60\">';
	content += '<br></div>';

	content += '<div id=\"BlairDGname\" style=\"position:absolute; ';
	content += 'width:330; height:30; left:120; top:20; z-index:2; ';
	content += 'overflow:hidden; visibility:visible;\">';
	content += '<img alt=\"\" src=\"elements/BlairDGname2.jpg\" width=\"330\" height=\"40\">';
	content += '<br></div>';

	content += '<div id=\"layerCurtainL\" style=\"position:absolute; ';
	content += 'width:96; height:534; left:0; top:76; z-index:2; ';
	content += 'overflow:hidden; visibility:visible;\">';
	content += '<img alt=\"\" src=\"elements/leftcanvas.jpg\" width=\"96\" height=\"534\" border=\"0\">';
	content += '<br></div>';

//	content += '<div id=\"cherryfoot\" style=\"position:absolute; ';
//	content += 'width:' + screenwidth + '; height:30; left:0; top:610; z-index:9; ';
//	content += 'overflow:hidden; visibility:visible; ';
//	content += 'background:url(elements/cherry.jpg);"></div>';

	content += '<div id=\"layerUpdate\" style=\"position:absolute; ';
	content += 'width:120; height:16; left:650; top:592; z-index:10; ';
	content += 'overflow:hidden; visibility:visible;\">';
	content += '<font class=\"v10\" color=\"#999999\">' + moddate + '</font></div>';

	content += '<div id=\"layerNav\" style=\"position:absolute; ';
	content += 'width:100%; height:16; left:0; top:60; z-index:8; ';
	content += 'overflow:hidden; visibility:visible; background:#330000;\">';
	content += '<font class=\"vb11\"><div style=\"margin-left:120px;\">';
	
	for (var i=1;i<7;i++) {
		if ( page != i ) content += state[i];
		else {
			content += '</font><font class=a13 color=\"#990000\"><i><b>&nbsp;' + pageName[page];
			content += '&nbsp;</b></i></font><font class=vb11>&nbsp; &nbsp;';
			}
		}
	content += contact + '</div></font></div>';

	document.write(content);
	}

function writeImage() {
	var content = "";
	var screenheight = getWindowSize()-466;
	content += '<div id=\"layerImage\" style=\"position:absolute; ';
	content += 'width:246; height:400; left:-8; top:210; z-index:4; ';
	content += 'overflow:hidden; visibility:visible;\">';
	content += '<img src=\"images/cutDKG5b.gif\" width=\"246\" height=\"400\" border=\"0\"></div>';
	document.write(content);
	}
	
function openPadDiv() {
	var content = "";
	if ( navigator.userAgent.indexOf("Firefox") < 1 ) {
		content += '<div style=\"padding: 21px 4px 0px 8px;\">';
		}
	else content += '<div style=\"padding: 12px 3px 0px 6px;\">';
	document.write(content);
	}
	
function closeDiv() {
	var content = "";
	content += '</div>';
	document.write(content);
	}
	
	
