var Navigation = { run:function(){

Event.observe($('my_menu'),"mouseover",function(event){

	/* Get the element from where event is generated*/
	var elt = $(Event.element(event)); 
	
	/*Be sure that it under our unordered list*/
	if (elt && elt.descendantOf($('my_menu')) && elt.nodeName=='LI'){
		
		/*Stop the bubling of the event */
		Event.stop(event);
		
		/*	Get the child elements of the already expanded menu,
			which is not parent of currently selected menu or a child of it */
		var its=$$('.selected_item').findAll(function(e){
			return !elt.descendantOf(e) && !e.descendantOf(elt) && e!=elt
		});
		
		/*Add this special tracking class name*/
		elt.addClassName("selected_item"); 							

		/*Hide them all*/
		its.each(function(e){e.select("ul").invoke('hide')});
		
		/*remove the tracker class off them  them all*/
		its.invoke("removeClassName","selected_item");
		
		/*Collect the UL i.e child menu container  and display them*/
		var ul=elt.childElements().find(function(e){return e.nodeName=='UL';});
		if (ul) {
			ul.setStyle({"display":"block"});					
		}	
	}		
});
}}

var FlashGallery = {
	run:function(){
		//console.log(this.flashlinks);
		if(navigator.appVersion.indexOf("MSIE")>-1){
			$('sppo_flash').innerHTML ='<object type="application/x-shockwave-flash" width="425" height="425" movie="'+FlashGallery.flashlinks[0]+'"><param name="movie" value="'+FlashGallery.flashlinks[0]+'"><param name="wmode" value="transparent"><embed src="'+FlashGallery.flashlinks[0]+'" style="position:relative" width="425" height="425" wmode="transparent"></embed></object>';
		}else{
			$('sppo_flash').innerHTML ='<object width="425" height="425" movie="'+FlashGallery.flashlinks[0]+'"><param name="movie" value="'+FlashGallery.flashlinks[0]+'"><param name="wmode" value="transparent"><embed src="'+FlashGallery.flashlinks[0]+'" style="position:relative" width="425" height="425" wmode="transparent"></embed></object>';
		}
		//$('sppo_flash_list').innerHTML = '';
	},
	
	view: function (path){
				if(navigator.appVersion.indexOf("MSIE")>-1){
					$('sppo_flash').innerHTML ='<object type="application/x-shockwave-flash" width="425" height="425" style="position:relative"><param name="movie" value="'+path+'"><param name="wmode" value="transparent"> <embed src="'+path+'" style="position:relative" width="425" height="425" wmode="transparent"></embed></object>';
				}else{
					$('sppo_flash').innerHTML ='<object width="425" height="425" style="position:relative"><param name="movie" value="'+path+'"><param name="wmode" value="transparent"> <embed src="'+path+'" style="position:relative" width="425" height="425" wmode="transparent"></embed></object>';
				}
	}
}

var feAction = {
	showContent: function(){
		Effect.Appear('content',{from: 0.0, to: 1.0, queue: 'end'});

	}
}

Event.observe(window, 'load', function() {
Navigation.run();
FlashGallery.flashlinks = ['/fileadmin/resources/flash/player1.swf','/fileadmin/resources/flash/player2.swf','/fileadmin/resources/flash/player3.swf']
 if(FlashGallery.flashlinks)FlashGallery.run();
});


