function Slide(image, caption, url)
{
	this.image = image;
	this.caption = caption;
	this.url = url;

	this.getImage = function()
	{
		return this.image;
	};
	this.getCaption = function()
	{
		return this.caption;
	};
	this.getURL = function()
	{
		return this.url;
	}
}
function goLink(which)
{
	//alert("This would open the page for: " + which.id);
	if(which)
	{
		if(which.id)
		{
			document.location.href="/content.php?view=" + which.id;
		}
		else
		{
			document.location.href = which;
		}
	}	
}

function doMenuMouseover(which)
{
	which.style.border="1px solid #FFFFFF";
	which.style.backgroundColor="#3A366D";
	//toggleMenu(which.id);
	if(anyMenuVisible(which.id))
	{
		toggleMenu(which);
	}
	
}
function doMenuMouseout(which)
{
	which.style.border="1px solid #787ED0";
	which.style.backgroundColor="#1A1830";
	//toggleMenu(which.id);	
}
function doMenuItemMouseOver(which)
{
	which.style.border="1px solid #FFFFFF";
	which.style.backgroundColor="#3A366D";
	
}
function doMenuItemMouseOut(which)
{
	which.style.border="1px solid #877C6E";
	which.style.backgroundColor="#1A1830";	
}
function findPosX(obj)
{
	var curleft = 0;
	if(obj.offsetParent)
	{
		while(1)
		{
			curleft += parseInt(obj.offsetLeft);
			if(!obj.offsetParent)
		  	{
				break;
		  	}
		  	obj = obj.offsetParent;
		}
	}
	else if(obj.x)
	{
		curleft += parseInt(obj.x);
	}
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if(obj.offsetParent)
	{
		while(1)
		{
	  		curtop += parseInt(obj.offsetTop);
	  		if(!obj.offsetParent)
	  		{
	  			break;
	  		}
	  		obj = obj.offsetParent;
		}
	}
	else if(obj.y)
	{
		curtop += parseInt(obj.y);
	}
	return curtop;
}
function initMenus(name)
{
	for(var i = 0; i < menus.length; i++)
	{
		var current_menu = menus[i];
		var current_div = document.getElementById(current_menu);
		var current_dropdown = document.getElementById("items_" + current_menu);
		current_dropdown.style.top = findPosY(current_div) + parseInt(current_div.offsetHeight) + 5 + "px";
		current_dropdown.style.left = findPosX(current_div) + "px";
		if(name != null && name != current_menu)
		{
			current_dropdown.style.visibility = "hidden";
			current_div.className="menu_header";
		}
		else if(name==null)
		{
			current_dropdown.style.visibility = "hidden";
			current_div.className="menu_header";
		}
		//current_dropdown.style.width = current_div.offsetWidth;
	}
}
function toggleMenu(which)
{
	var name = which.id;
	initMenus(name);
	var menu_root = document.getElementById(name);
	var menu_name = "items_" + name;
	var menu_exists = document.getElementById(menu_name);
	if(menu_exists)
	{
		if(menu_exists.style.visibility=="visible")
		{
			menu_exists.style.visibility="hidden";
			menu_root.className="menu_header";
		}
		else
		{
			menu_exists.style.visibility="visible";
			menu_root.className="menu_header_lowered";
		}
	}
}
function anyMenuVisible(name)
{
	var menu_visible = false;

	for(var i = 0; i < menus.length; i++)
	{
		var current_dropdown = document.getElementById("items_" + menus[i]);
		if(menus[i] != name)
		{
			if(current_dropdown.style.visibility=="visible")
			{
				menu_visible = true;
				break;
			}
		}
	}
	return menu_visible;
}
function toggleBio(name)
{
	//if the overlay is showing we're toggling off
	var overlay = document.getElementById("bio_overlay");
	var bioElement = document.getElementById("bio_" + name);
	if(overlay.style.display=="block")
	{
		bioElement.style.display="none";
		overlay.style.display="none";
	}
	else
	{
		//make a call to doResize
		doOnResize();
		overlay.style.display="block";
		//alert(bioElement.style.width);
		bioElement.style.left=((viewportwidth/2)-(parseInt(bioElement.style.width)/2)) + "px";
		//alert("new left should be: " + ((viewportwidth/2)-(bioElement.style.width/2)));
		//alert("viewport width=" + viewportwidth + " left = " + bioElement.style.left);
		bioElement.style.display="block";
	}
}
function toggleConcert(name)
{
	//if the overlay is showing we're toggling off
	window.scrollTo(0,0);
	var overlay = document.getElementById("concert_overlay");
	var bioElement = document.getElementById("concert_" + name);
	if(overlay.style.display=="block")
	{
		bioElement.style.display="none";
		overlay.style.display="none";
	}
	else
	{
		//make a call to doResize
		doOnResize();
		overlay.style.display="block";
		//alert(bioElement.style.width);
		bioElement.style.left=((viewportwidth/2)-(parseInt(bioElement.style.width)/2)) + "px";
		//alert("new left should be: " + ((viewportwidth/2)-(bioElement.style.width/2)));
		//alert("viewport width=" + viewportwidth + " left = " + bioElement.style.left);
		bioElement.style.display="block";
	}
}
function highlightBioImage(which)
{
	
	if(which)
	{
		//which.height = which.height - 2;
		//which.width = which.width - 2;
		//which.style.zIndex="5000";
		//which.style.border = "1px solid #877C6E";
	}
}
function unhighlightBioImage(which)
{
	if(which)
	{
		//which.style.border = "none";
		//which.height = which.height + 2;
		//which.width = which.width + 2;
	}
}
