var gwMenus;
var gwImagesON;
var gwImagesOF;

function gwMenu (menu, title, x, y) {
	this.menu = menu;
	this.title = title;
	this.x = x;
	this.y = y;
}

function loadMenus() {
	gwMenus = new Array();
	gwImagesON = new Array();
	gwImagesOF = new Array();

	window.menu2 = new Menu(116,"#339999","#000084");
	menu2.addMenuItem("VIEW PROMO CLIP","location='promo.html'");
	menu2.addMenuItem("WHAT PEOPLE SAY","location='review.html'");
	menu2.addMenuItem("BIOGRAPHY","location='bio.html'");
//	menu2.addMenuItem("ENTREVUE","location='http://www.radio-canada.ca/Medianet/CBKF/008FE674_20050608_164153.asx'");
	gwMenus[2] = new gwMenu (menu2, "about Anne", 0, 45);

	window.menu3 = new Menu(132,"#000084","#339999");
	menu3.addMenuItem("WORKSHOPS","location='workshop.html'");
	menu3.addMenuItem("FAMILY SHOWS","location='family.html'");
	menu3.addMenuItem("SCHOOL SHOWS","location='school.html'");
	menu3.addMenuItem("ARTIST IN RESIDENCE","location='artist.html'");
	gwMenus[3] = new gwMenu (menu3, "programs", 0, 57);

	window.menu5 = new Menu(117,"#006600","#9933FF");
	menu5.addMenuItem("SAMPLES","location='samples.html'");
	menu5.addMenuItem("CD","location='cd.html'");
	menu5.addMenuItem("VIDEO","location='video.html'");
	menu5.addMenuItem("STRINGS","location='strings.html'");
	menu5.addMenuItem("ORDER FORM","location='order.html'");
	gwMenus[5] = new gwMenu (menu5, "recordings", 5, 39);

	window.menu6 = new Menu(130,"#FF9900","#006600");
	menu6.addMenuItem("QUESTIONS KIDS ASK","location='faq.html'");
	menu6.addMenuItem("STRING STUFF","location='string.html'");
	menu6.addMenuItem("AFTER THE SHOW","location='after.html'");
	gwMenus[6] = new gwMenu (menu6, "been to a show?", -5, 56);

	menu2.writeMenus();
}

function clickMenu(menu_id) {
	confirm('"'+gwMenus[menu_id].title+'" is a menu.  When you pass the cursor over it, menu items appear.  Select one of the menu items.');
	toggleMenu(menu_id);
}

function toggleMenu(menu_id) {
	var mid, menu_name, image_name, x;

	mid = Math.abs(menu_id);
	menu_name = "menu"+Math.abs(mid);
	image_name = "image"+Math.abs(mid);

	if (gwMenus[mid])
		if (menu_id > 0)
			MM_showMenu(gwMenus[mid].menu,gwMenus[mid].x,gwMenus[mid].y,null,image_name);
		else
			MM_startTimeout();
	else {
		mmDoHide();
		if (!gwImagesON[mid]) {   // retain the images to prevent continued reload
			gwImagesON[mid] = new Image;
			gwImagesOF[mid] = new Image;
			gwImagesON[mid].src = document.images[image_name].src;
			x = document.images[image_name].src.length - 6;
			gwImagesOF[mid].src = document.images[image_name].src.substr(0,x) + "of.jpg";
		}
		if (menu_id > 0)
			document.images[image_name].src = gwImagesOF[mid].src;
		else
			document.images[image_name].src = gwImagesON[mid].src;
	}
}

