function menuin(tt,ordner){
	if (document.getElementById(tt)){
		document.getElementById(tt).src="img/"+tt+"_over.gif";
	}
	document.getElementById("m"+tt+"").style.visibility="visible";
}

function menuout(tt,state,ordner){
	if (document.getElementById(tt)){
		if(state!="no"){
			document.getElementById(tt).src="img/"+tt+".gif";
		}
	}
	document.getElementById("m"+tt+"").style.visibility="hidden";
}

function menuEvents(tt,state,ordner){
	if($(tt)){
		$(tt).addEvents(
			{
			'mouseenter': function(){menuin(tt,ordner);},
			'mouseleave': function(){menuout(tt,state,ordner);}
				}
			);}
}
 function submenuEvents(tt,state,ordner){
 			if($('m'+tt)){
		$('m'+tt).addEvents(
			{
			'mouseenter': function(){menuin(tt,ordner);},
			'mouseleave': function(){menuout(tt,state,ordner);}
				}
			);}
 }
 
window.addEvent('domready', function(){
 	doMenu();
});

var myGallery;
var isPaused = 0;
function startGallery() {
 myGallery = new gallery($('myGallery'), {
timed: true,
showArrows: true,
showCarousel: false,
embedLinks: false,
showInfopane: false
});
}
window.addEvent('domready', startGallery);

  function resumeGallery() {
    if (this.options.timed)
			//this.timer = this.nextItem.delay(this.options.delay, this);
   if (this.galleryInit == 1)
		{
			imgPreloader = new Image();
			imgPreloader.onload=function(){
				this.startSlideShow.delay(10, this);
			}.bind(this);
			imgPreloader.src = this.galleryData[0].image;
			if(this.options.preloader)
				this.galleryElements[0].load();
		} else {
			if (this.options.showInfopane)
			{
				if (this.options.showInfopane)
				{
					this.showInfoSlideShow.delay((500 + this.options.fadeDuration), this);
				} else
					if ((this.options.showCarousel)&&(this.options.activateCarouselScroller))
						this.centerCarouselOn(position);
			}
		}
  }

  function pauseGallery() {
    if (this.options.timed)
			$clear(this.timer);
			 myGallery.clearTimer();
 myGallery.options.timed=false;
  }

  function PausePlayGallery() {
    if (isPaused == 0)
    {
    myGallery.clearTimer();
 		myGallery.options.timed=false;
    isPaused = 1;
    document.getElementById('pausebutton').src = 'img/play.gif';
    }
  else
    {
   myGallery.options.timed=true;
	 myGallery.prepareTimer();;
	 myGallery.nextItem();
    isPaused = 0;
    document.getElementById('pausebutton').src = 'img/break.gif';
    }
  }