var soundfile="sidebar.wav" ;



function playsound(soundfile){

	if (document.all && document.getElementById){

		document.getElementById("soundeffect").src="" //reset first in case of problems

		document.getElementById("soundeffect").src=soundfile

	}

}



function resize() {

	var w_newWidth,w_newHeight;

	var w_maxWidth=1600,w_maxHeight=1200;



	if (navigator.appName.indexOf("Microsoft") != -1) {

		w_newWidth=document.body.clientWidth;

		w_newHeight=document.body.clientHeight;

	} else {

		var netscapeScrollWidth=15;

		w_newWidth=window.innerWidth-netscapeScrollWidth;

		w_newHeight=window.innerHeight-netscapeScrollWidth;

	}

	if (w_newWidth>w_maxWidth)

		w_newWidth=w_maxWidth;



	if (w_newHeight>w_maxHeight)

		w_newHeight=w_maxHeight;

	

	/* resize all the graphics to fit the entire width of the screen 

	that way on large monitors the menu graphics will appear readable

	while on 800 x 600 the information will be hires and appropiately 

	sized as well. Thus this enables the utilization of the entire

	width of the screen for the main menu bar. Quite pleasing for users

	when viewing specialized and beautiful graphics like mine.

      */

	var dTotal;

	var oImg;

	var iButtons;

	var sName;

	var dDiff;

	var dRatioDiff;

	var dRatioHeight;



	iButtons=1;

	dTotal=0;

	sName = 'imgNav' + iButtons;

	while(oImg=document.getElementById(sName)) {

		dTotal+=oImg.width+34;

		iButtons++;

		sName = 'imgNav' + iButtons;

	}

	iButtons--;

	

/*

	alert("Width is " + dTotal + " buttons = " + iButtons);

	alert(w_newWidth + '   ' + w_newHeight);

*/



	dDiff=w_newWidth - dTotal;

	dRatioDiff = dDiff / iButtons;

	dRatioHeight = w_newHeight / 10;



	iButtons=1;

	sName = 'imgNav' + iButtons;

	while(oImg=document.getElementById(sName)) {

		oImg.width+=dRatioDiff;

		oImg.height=dRatioHeight;

		iButtons++;

		sName = 'imgNav' + iButtons;

	}	

   }



var imPreload = new Array;



function CreateMenu() {

/*

	Build the main menu 

	1) Preload all the graphics to calculate the width of the navigation bar

	2) get the width of the client area

	3) adjust the size proportionally 



*/

/* html page name linked to graphics and _On for active graphics.

	a[1] = 'Name';

		Name.html

		Name.png

		Name_On.png

	b[1] = 'Title Test for balloon tip.';

	c[1] = 'Status Bar text';



*/



var a = new Array; 



var b = new Array;

var c = new Array;



document.write('<bgsound src="#" id="soundeffect" loop=1 autostart="true" />');



a[1]='Home';		

b[1]='Go to the home page.';

c[1]='The home page contains Proverbs and links of the day.';



/*
a[2]='Empire';		

b[2]='The Message to the Empire page.';

c[2]='Are New Yorkers going to March in the opposite direction forever?';


a[3]='Music';

b[3]='Download original digital music at AlienTimes.com. I hope to get a laptop and speakers so that I can create more content. --- I believe modifications have been have in the high hat areas in some of the music. ***Can it be debugged?***';

c[3]='The Music page contains original music created By Anthony Matarazzo. (c) 2006-2009 AlienTimes.com';
*/


a[2]='Ideas';

b[2]='Read visionary ideas about technology and the future..';

c[2]='The Ideas page contains creative insights for scientists.';



/*

a[5]='Visual';

b[5]='Download hi-resolution posters and view stunning original artwork.';

c[5]='The artwork page contains universal language posters and other original artwork.';



a[5]='Software';

b[5]='Download Software written by AlienTimes.com for your computer.';

c[6]='The software page contains screen savers and other science software.';



a[7]='Stories';

b[7]='Read captivating stories online.';

c[7]='The stories page contains original short stories by Anthony Matarazzo';



a[7]='Poetry';

b[7]='Into poetry, check out these original poems.';

c[7]='Check the poetry page for original work.';



a[9]='Gallery';

b[9]='Photo gallery online.';

c[9]='The photo gallery contains images of fans and other strange objects.';

*/


a[3]='Gallery';

b[3]='Photo gallery online.';

c[3]='The photo gallery contains images of fans and other strange objects.';


a[4]='World';

b[4]='World view in symbol expression.';

c[4]='Realize the infinite realm of the cosmos.';


a[5]='Links';

b[5]='Favorite sites and links to other cool domains.';

c[5]='Find the greatest links with solid content in here.';


a[6]='Author';

b[6]='Read about, pictures and contact the author Tony Matarazzo.';

c[6]='Photographs from the American continent.';



var i;

var s;

var dWidth;

for(i=1;i<a.length;i++) {

	imPreload[i] = new Image();

	imPreload[i].src='Menu/" + a[i] + "_On.png';

}

document.write('<Table border=1>');

document.write('<tr bgcolor=black><td>');

for(i=1;i<a.length;i++) {



/*

	s = "<a style='link{width:75%;color: #7FFF00;text-decoration:none;}hover{background-color: #FF9900;color: rgb(255,214,253);filter:progid:DXImageTransform.Microsoft.Glow(Color=lime,Strength=3);width:75%;}">' href='";

*/

	s = "<a onmouseover=\"this.style.color='Indigo';this.style.backgroundColor='Cornsilk';\"  onmouseout=\"this.style.color='WhiteSmoke';this.style.backgroundColor='black';\" style='text-decoration:none;color=WhiteSmoke' href='";



	if(a[i]=='Home') {

		s = s + "main.html'";

	} else {

		s = s + a[i] + ".html'";

	}

	s = s + " title='" + b[i] + "'>";

/*

	s = s + "<img border=0 id=imgNav" + i; 

	s = s + " src='Menu/";

	s = s + a[i] + ".png' ";

	s = s + "OnMouseOver=\"this.src='Menu/";

	s = s + a[i] + "_On.png';a('" + c[i] + "');playsound('Sounds/sidebar.wav');return true\" ";

	s = s + "OnMouseOut=\"this.src='Menu/";

	s = s + a[i] + ".png';b()\">";

*/



	s = s + '<font size=5>' + a[i] + '&nbsp;&nbsp;&diams;</font>'; 



	s = s + "</a>";

	s = s + "       ";

	document.write(s);

}

document.write('</td></tr></table>');

document.writeln('');

window.onResize = resize;

window.onLoad = resize;

}

