function showSubMenu(showItem)	{

	var menuList = new Array("Moments", "Slideshow", "Information");
	
	if ($(showItem) && $(showItem).style.display == "none")	{
	
		for (i=0; i<menuList.length; i++)	{
			//$(menuList[i]).hide();
			if (showItem != menuList[i])	{
				//Effect.SlideUp(menuList[i], { duration: 1.0 } );
				//Effect.BlindUp(menuList[i], { duration: 3.0 } );
				$(menuList[i]).style.display = "none";
			}
		}
		//Effect.BlindDown(showItem, { duration: 0.5 });
		Effect.Appear(showItem);

		

	}

}//end function

var newTimeout;

function is_child_of(parent, child) {
	if( child != null ) {			
		while( child.parentNode ) {
			if( (child = child.parentNode) == parent ) {
				return true;
			}
		}
	}
	return false;
}

function fixOnMouseOut(element, event) {
	
	var current_mouse_target = null;
	clearInterval(scrollTimeout);
	
	if( event.toElement ) {				
		current_mouse_target 			 = event.toElement;
	} else if( event.relatedTarget ) {				
		current_mouse_target 			 = event.relatedTarget;
	}

	if( !is_child_of(element, current_mouse_target) && element != current_mouse_target && !is_child_of($('gallery_div'), current_mouse_target) && !is_child_of($('gallery_div_back'), current_mouse_target) && current_mouse_target != 'gallery_div_back' ) {
		

		newTimeout = setTimeout(mOutGallery,200);
		
		//clearTimeout('scrollTimeout'); 
	}
}
		
		
		
function mOutGallery()
{
	new Effect.Move('gallery_holder', {x: 0, y: 0, mode: 'absolute', duration: 0.1 })
}

function thisMovie(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
	return window.top[movieName];
}else{
if(top.document[movieName].length != undefined){
	return top.document[movieName][1];
}
	return top.document[movieName];
}
}



var mySlides = Array("slide1", "slide2", "slide3", "slide4", "slide5");
var mySlideIndex = 0;
var prevSlide;


function updateTheSlide()	{
	var opacity = 100;
	//document.getElementById(mySlides[mySlideIndex-1]).style.display = 'none';
	if ((mySlideIndex + 1) == mySlides.length)	{
		mySlideIndex = 0;
		prevSlide = mySlides.length - 1;
		
		//document.getElementById(mySlides[]).style.display = 'block';
		new Effect.Opacity(mySlides[mySlideIndex],{ duration: 2.0, transition: Effect.Transitions.linear, from: 0, to: 1, afterFinish: finishUpdate2 });
		
	}
		
	else	{
		mySlideIndex++;
		prevSlide = mySlideIndex - 1;
		
		document.getElementById(mySlides[mySlideIndex]).style.display = 'block';
		
		document.getElementById(mySlides[mySlideIndex]).style.opacity = (opacity / 100);
    	document.getElementById(mySlides[mySlideIndex]).style.MozOpacity = (opacity / 100);
    	document.getElementById(mySlides[mySlideIndex]).style.KhtmlOpacity = (opacity / 100);
    	document.getElementById(mySlides[mySlideIndex]).style.filter = "alpha(opacity=" + opacity + ")";
		
		new Effect.Opacity(mySlides[prevSlide],{ duration: 2.0, transition: Effect.Transitions.linear, from: 1, to: 0, afterFinish: finishUpdate });
		
	}
		
	
	
}
function finishUpdate()	{
	
	var myTimeout = setTimeout('updateTheSlide()', 4000);
	
}
function finishUpdate2()	{
	//document.getElementById(mySlides[7]).style.display = 'none';
	document.getElementById(mySlides[mySlides.length-1]).style.opacity = 0;
    document.getElementById(mySlides[mySlides.length-1]).style.MozOpacity = 0;
    document.getElementById(mySlides[mySlides.length-1]).style.KhtmlOpacity = 0;
    document.getElementById(mySlides[mySlides.length-1]).style.filter = "alpha(opacity=0)";
	var myTimeout = setTimeout('updateTheSlide()', 4000);
}
