function menu_enter(id){
	document.getElementById(id).className = 'menu_on';
}
function menu_exit(id){
	document.getElementById(id).className = 'menu_off';
}
function flashPutHref(href) { location.href = href; }
function flashPutTitle(title) { document.title = title; }

function sspLoadAlbum(album) {
   document.getElementById('experienceFlash').sspLoadAlbum(album);
}

function checkJoin(){
	var errorMsg = '';
	if (document.getElementById('first_name').value.length < 1) errorMsg += "Missing first name.\n";
	if (document.getElementById('last_name').value.length < 1) errorMsg += "Missing last name.\n";
	if (document.getElementById('email_address').value.length < 1) errorMsg += "Missing email address.\n";
	else if (document.getElementById('email_address2').value != document.getElementById('email_address').value) errorMsg += "The email addresses do not match.\n";
	if (errorMsg != ''){
		window.alert(errorMsg);
		return false;
	}
	return true;
}

function clearGalleryHighlight(){
	var e = document.getElementsByClassName('menuWhiteHash');
	e.each(function(a){
		Element.removeClassName(a,'menuWhiteHash');
	});
	var e = document.getElementsByClassName('menuSelected');
	e.each(function(a){
		Element.removeClassName(a,'menuSelected');
		Element.addClassName(a,'menuUnselected');
		Element.addClassName(a,'menuSection');
	});
}

function addWhiteHash(id){
	Element.addClassName($(id),'menuWhiteHash');
}
function selectedSection(id){
	Element.addClassName($(id),'menuSelected');
	Element.removeClassName($(id),'menuUnselected');
	Element.removeClassName($(id),'menuSection');
}

function highlightAlbum(){
	var myHash = window.location.hash;
	if (myHash.substring(0,10)=='#id=album-'){
		var amp = myHash.indexOf('&');
		var myAlbum = myHash.substring(4,amp);
		clearGalleryHighlight();
		addWhiteHash(myAlbum + '-1');
		selectedSection(myAlbum + '-2');
	}
}
function pageLoad(){
	highlightAlbum();
}
