// JavaScript Document

Event.observe(window, 'load', Page_onLoad, false);

function Page_onLoad() {
	CreateHorizontalScrollers();
}

function CreateHorizontalScrollers() {
		
	if($('horizontal_carousel')) {
	
		objCarousel = new UI.Carousel("horizontal_carousel");
		
		// Get the current image id
		var arrQuery = "";//getQueryString();
		var intImageId = arrQuery['image_id'];
		
		// Get the list elememt
		var ulThumbs = $('ulThumbs');
		var aLinks = ulThumbs.getElementsByTagName("a");
		
		for (var i = 0; i < aLinks.length; i++) {
			if (aLinks[i].name == intImageId) {
				objCarousel.scrollTo(i);
			}
		}
		
		//Event.observe(window, 'resize', function(event){ windowResizeEvent();});
	}
}

function showMenu() {

	var oSubMenu = document.getElementById( 'subMenu' );
	var stored = oSubMenu.style.visibility
	
	if( stored != 'visible' )
		oSubMenu.style.visibility = 'visible';
	else
		oSubMenu.style.visibility = 'hidden';
}