/*
	---------------------------------------
	 Standard Funktionen
	---------------------------------------
*/
	// Get elements by class name
	function getElementsByClassName(classname,tag) {
		if(!tag) tag = "*";
		var elements =  document.getElementsByTagName(tag);
		var total_elements = elements.length;
		var regexp = new RegExp('\\b' + classname + '\\b');
		var class_items = new Array()
		
		for(var i=0;i<total_elements;i++) { 
			var this_item = elements[i];
			if(regexp.test(this_item.className)) {
				class_items.push(this_item);
			}
		}
		return class_items;
	}
	
	// Menü Expand / Collapse mit Animation
	function animatedWidth(mode,obj,minimizedWidth) {
		if(mode=="expand"){
			var breite = document.getElementById(obj).scrollHeight;
			$(obj).effect('width',{
				onStart: function() {
					submenus = getElementsByClassName("submenu",'ul');
					for(var i=0;i<submenus.length;i++) {
						if(submenus[i].id != obj) {
							submenus[i].style.display = "none";
							submenus[i].style.backgroundPosition ="0 bottom";
						}
					}
		        	},
				duration: 1100,
				transition: Fx.Transitions.Expo.easeIn
		        }).start(minimizedWidth,172);
		}
		if(mode=="collapse"){
			var breite = document.getElementById(obj).scrollHeight;
			$(obj).effect('width',{
				duration: 700,
				transition: Fx.Transitions.Expo.easeOut,
				onComplete: function() { 
			        	document.getElementById(obj).style.display ="none";
			        	document.getElementById("menu-" + obj).style.backgroundPosition ="-132px bottom";
		        	}
			}).start(breite,minimizedWidth);
		}
	}
	
	
	// Absolute Position ermitteln
	function findPos(obj) {
		var curleft = curtop = 0;
		if (obj.offsetParent) {
			curleft = obj.offsetLeft
			curtop = obj.offsetTop
			while (obj = obj.offsetParent) {
				curleft += obj.offsetLeft
				curtop += obj.offsetTop
			}
		}
		return [curleft,curtop];
	}
	
	function findPosX(obj) {
		var curleft = 0;
		if(obj.offsetParent)
			while(1) 
			{
				curleft += obj.offsetLeft;
				if(!obj.offsetParent)
					break;
				obj = obj.offsetParent;
			}
		else if(obj.x)
				curleft += obj.x;
		return curleft;
	}

	function findPosY(obj) {
		var curtop = 0;
		if(obj.offsetParent)
			while(1)
			{
				curtop += obj.offsetTop;
				if(!obj.offsetParent)
					break;
				obj = obj.offsetParent;
			}
		else if(obj.y)
				curtop += obj.y;
		return curtop;
	}
/*
	---------------------------------------
	 Menue
	---------------------------------------
*/

	function toggleMenuOnload(obj) {
		
		var curHeight 	= document.getElementById(obj).scrollHeight;
		var curWidth 	= document.getElementById(obj).scrollWidth;
		var objClassName = document.getElementById(obj).className;
		var objId 	= obj;
		
		var subMenuClassName = objClassName.substring(5);
		
		var submenus = getElementsByClassName("submenu",'ul');
		for(var i=0;i<submenus.length;i++) {
			if(submenus[i].id != subMenuClassName) {
				submenus[i].style.display = "none";
			}
		}
		
		var menus = getElementsByClassName("menu",'a');
		for(var i=0;i<menus.length;i++) {
			menus[i].style.backgroundPosition ="-132px bottom";
		}
		document.getElementById(objId).style.backgroundPosition ="0 bottom";
		
		if(document.getElementById(subMenuClassName)) {
			var subMenu = document.getElementById(subMenuClassName);
			
		//	if(subMenu.style.display == "block") {
		//		animatedWidth("collapse",subMenuClassName,1);
		//	}
			if((subMenu.style.display == "none") || (subMenu.style.display == false)) {
			
				subMenu.style.width ="1px";
				subMenu.style.display ="block";
				
				var curLeft 	= findPosX(document.getElementById(objId));
				var curTop 	= findPosY(document.getElementById(objId));
		
				subMenu.style.position ="absolute";
				subMenu.style.left = (curLeft+curWidth) + "px";

				if (window.navigator.userAgent.indexOf("MSIE ") > -1) {
					subMenu.style.top = (curTop+curHeight-19) + "px";
				} else {
					subMenu.style.top = (curTop+curHeight-20) + "px";
				}
				if (window.navigator.userAgent.indexOf("Safari") > -1) {
					subMenu.style.top = (curTop+curHeight-19) + "px";
				}
				if (window.navigator.userAgent.indexOf("Opera") > -1) {
					subMenu.style.top = (curTop+curHeight-19) + "px";
				}


				$(subMenuClassName).effect('width',{
					duration: 1300,
					transition: Fx.Transitions.Expo.easeInOut
			        }).start(1,(curWidth+30));
			}
		}
	}


	function toggleMenu() {
		this.blur();

		var curHeight 	= this.scrollHeight;
		var curWidth 	= this.scrollWidth;
		var objClassName = this.className;
		var objId 	= this.id;
		
		var subMenuClassName = objClassName.substring(5);
		
		submenus = getElementsByClassName("submenu",'ul');
		for(var i=0;i<submenus.length;i++) {
			if(submenus[i].id != subMenuClassName) {
				submenus[i].style.display = "none";
			}
		}
		
		menus = getElementsByClassName("menu",'a');
		for(var i=0;i<menus.length;i++) {
			menus[i].style.backgroundPosition ="-132px bottom";
		}
		document.getElementById(objId).style.backgroundPosition ="0 bottom";
		
		if(document.getElementById(subMenuClassName)) {
			var subMenu = document.getElementById(subMenuClassName);
			
		//	if(subMenu.style.display == "block") {
		//		animatedWidth("collapse",subMenuClassName,1);
		//	}
			if((subMenu.style.display == "none") || (subMenu.style.display == false)) {
			
				subMenu.style.width ="1px";
				subMenu.style.display ="block";
				
				var curLeft 	= findPosX(document.getElementById(objId));
				var curTop 	= findPosY(document.getElementById(objId));
		
				subMenu.style.position ="absolute";
				subMenu.style.left = (curLeft+curWidth) + "px";

				if (window.navigator.userAgent.indexOf("MSIE ") > -1) {
					subMenu.style.top = (curTop+curHeight-19) + "px";
				} else {
					subMenu.style.top = (curTop+curHeight-20) + "px";
				}
				if (window.navigator.userAgent.indexOf("Safari") > -1) {
					subMenu.style.top = (curTop+curHeight-19) + "px";
				}
				if (window.navigator.userAgent.indexOf("Opera") > -1) {
					subMenu.style.top = (curTop+curHeight-19) + "px";
				}


				$(subMenuClassName).effect('width',{
					duration: 1300,
					transition: Fx.Transitions.Expo.easeInOut
			        }).start(1,(curWidth+30));
			}
		}
	}

/*
	---------------------------------------
	 Produkte / Sortiment
	---------------------------------------
*/

	function showProductsDetails() {
		this.blur();
		var selectedProduct1 = this.id + "-d";
		document.getElementById(selectedProduct1).style.display ="block";
	}
	
	function hideProductsDetails() {
		var selectedProduct2 = this.id + "-d";
		document.getElementById(selectedProduct2).style.display ="none";
	}
	
	function zoomProduct() {
		var selectedProduct = "product-large-" + this.id;
		$('zoom').effect('opacity',{
			duration: 600,
			transition: Fx.Transitions.Expo.bounceOut,
			onStart: function() { 
				document.getElementById("zoom").style.opacity ="0";
				document.getElementById("zoom").style.filter = "alpha(opacity=0)";
				document.getElementById("zoom").style.display ="block";
		        	document.getElementById(selectedProduct).style.display ="block";
	        	}
		}).start(0,0.4);
	}

	function closeProductLarge() {
		var selectedProduct = this.id;
		$('zoom').effect('opacity',{
			duration: 600,
			transition: Fx.Transitions.Expo.bounceIn,
			onComplete: function() { 
		        	document.getElementById(selectedProduct).style.display ="none";
				document.getElementById("zoom").style.display ="none";
	        	}
		}).start(0.4,0);
	}
	
	function nextContainer() {
		var checkNext = getElementsByClassName("page3",'');
		var checkNextLenghtCount = checkNext.length;

		if(checkNextLenghtCount > 0) {		
			if(document.getElementById("wo").value == "3") {
				// Ausblenden
				$('productcontainer-1').effect('opacity',{
					duration: 1200,
					transition: Fx.Transitions.Expo.easeOut,
					onStart: function() { 
						document.getElementById("productcontainer-1").style.display ="none";
						document.getElementById("2-container").removeClass('selected');
			        	}
				}).start(1.0,0);
			
				// Einblenden
				$('productcontainer-2').effect('opacity',{
					duration: 1200,
					transition: Fx.Transitions.Expo.easeOut,
					onStart: function() { 
						document.getElementById("productcontainer-2").style.display ="block";
						document.getElementById("3-container").addClass('selected');
			        	}
				}).start(0,1.0);
				
				// Value setzen
				document.getElementById("wo").value ="1";
			} else if(document.getElementById("wo").value == "2") {
				// Ausblenden
				$('productcontainer-0').effect('opacity',{
					duration: 1200,
					transition: Fx.Transitions.Expo.easeOut,
					onStart: function() { 
						document.getElementById("productcontainer-0").style.display ="none";
						document.getElementById("1-container").removeClass('selected');
			        	}
				}).start(1.0,0);
			
				// Einblenden
				$('productcontainer-1').effect('opacity',{
					duration: 1200,
					transition: Fx.Transitions.Expo.easeOut,
					onStart: function() { 
						document.getElementById("productcontainer-1").style.display ="block";
						document.getElementById("2-container").addClass('selected');
			        	}
				}).start(0,1.0);
				
				// Value setzen
				document.getElementById("wo").value ="3";
			} 
		} else {
			// Ausblenden
			$('productcontainer-0').effect('opacity',{
				duration: 1200,
				transition: Fx.Transitions.Expo.easeOut,
				onStart: function() { 
					document.getElementById("productcontainer-0").style.display ="none";
					document.getElementById("1-container").removeClass('selected');
		        	}
			}).start(1.0,0);
			
			// Einblenden
			$('productcontainer-1').effect('opacity',{
				duration: 1200,
				transition: Fx.Transitions.Expo.easeOut,
				onStart: function() { 
					document.getElementById("productcontainer-1").style.display ="block";
					document.getElementById("2-container").addClass('selected');
		        	}
			}).start(0,1.0);
		}
	}
	
	function previousContainer() {
		var checkPrevious = getElementsByClassName("page3",'');
		var checkPreviousLenghtCount = checkPrevious.length;
		
		if(checkPreviousLenghtCount > 0) {
			if(document.getElementById("wo").value == "1") {
				// Ausblenden
				$('productcontainer-2').effect('opacity',{
					duration: 1200,
					transition: Fx.Transitions.Expo.easeOut,
					onStart: function() { 
						document.getElementById("productcontainer-2").style.display ="none";
						document.getElementById("3-container").removeClass('selected');
			        	}
				}).start(1.0,0);
			
				// Einblenden
				$('productcontainer-1').effect('opacity',{
					duration: 1200,
					transition: Fx.Transitions.Expo.easeOut,
					onStart: function() { 
						document.getElementById("productcontainer-1").style.display ="block";
						document.getElementById("2-container").addClass('selected');
			        	}
				}).start(0,1.0);
				
				// Value setzen
				document.getElementById("wo").value ="3";
				
			} else if(document.getElementById("wo").value == "3") {
				// Ausblenden
				$('productcontainer-1').effect('opacity',{
					duration: 1200,
					transition: Fx.Transitions.Expo.easeOut,
					onStart: function() { 
						document.getElementById("productcontainer-1").style.display ="none";
						document.getElementById("2-container").removeClass('selected');
			        	}
				}).start(1.0,0);
			
				// Einblenden
				$('productcontainer-0').effect('opacity',{
					duration: 1200,
					transition: Fx.Transitions.Expo.easeOut,
					onStart: function() { 
						document.getElementById("productcontainer-0").style.display ="block";
						document.getElementById("1-container").addClass('selected');
			        	}
				}).start(0,1.0);
				
				// Value setzen
				document.getElementById("wo").value ="2";
			}
		} else {
			// Ausblenden
			$('productcontainer-1').effect('opacity',{
				duration: 1200,
				transition: Fx.Transitions.Expo.easeOut,
				onStart: function() { 
					document.getElementById("productcontainer-1").style.display ="none";
					document.getElementById("2-container").removeClass('selected');
		        	}
			}).start(1.0,0);
			
			// Einblenden
			$('productcontainer-0').effect('opacity',{
				duration: 1200,
				transition: Fx.Transitions.Expo.easeOut,
				onStart: function() { 
					document.getElementById("productcontainer-0").style.display ="block";
					document.getElementById("1-container").addClass('selected');
					
		        	}
			}).start(0,1.0);
		}
	}
	
	function ContainerOne() {
		var checkOne = getElementsByClassName("page3",'');
		var checkOneLenghtCount = checkOne.length;
		
		if(checkOneLenghtCount > 0) {
			// Ausblenden
			$('productcontainer-2').effect('opacity',{
				duration: 1200,
				transition: Fx.Transitions.Expo.easeOut,
				onStart: function() { 
					document.getElementById("productcontainer-2").style.display ="none";
					document.getElementById("3-container").removeClass('selected');
		        	}
			}).start(1.0,0);
		}
		
		// Ausblenden
		$('productcontainer-1').effect('opacity',{
			duration: 1200,
			transition: Fx.Transitions.Expo.easeOut,
			onStart: function() { 
				document.getElementById("productcontainer-1").style.display ="none";
				document.getElementById("2-container").removeClass('selected');
	        	}
		}).start(1.0,0);
		
		// Einblenden
		$('productcontainer-0').effect('opacity',{
			duration: 1200,
			transition: Fx.Transitions.Expo.easeOut,
			onStart: function() { 
				document.getElementById("productcontainer-0").style.display ="block";
				document.getElementById("1-container").addClass('selected');
	        	}
		}).start(0,1.0);
		
		// Value setzen
		document.getElementById("wo").value ="2";
	}
	
	function ContainerTwo() {
		var checkTwo = getElementsByClassName("page3",'');
		var checkTwoLenghtCount = checkTwo.length;
		
		if(checkTwoLenghtCount > 0) {
			// Ausblenden
			$('productcontainer-2').effect('opacity',{
				duration: 1200,
				transition: Fx.Transitions.Expo.easeOut,
				onStart: function() { 
					document.getElementById("productcontainer-2").style.display ="none";
					document.getElementById("3-container").removeClass('selected');
		        	}
			}).start(1.0,0);
		}
		
		// Ausblenden
		$('productcontainer-0').effect('opacity',{
			duration: 1200,
			transition: Fx.Transitions.Expo.easeOut,
			onStart: function() { 
				document.getElementById("productcontainer-0").style.display ="none";
				document.getElementById("1-container").removeClass('selected');
	        	}
		}).start(1.0,0);
		
		// Einblenden
		$('productcontainer-1').effect('opacity',{
			duration: 1200,
			transition: Fx.Transitions.Expo.easeOut,
			onStart: function() { 
				document.getElementById("productcontainer-1").style.display ="block";
				document.getElementById("2-container").addClass('selected');
	        	}
		}).start(0,1.0);
		
		// Value setzen
		document.getElementById("wo").value ="3";
	}
	
	function ContainerThree() {
		// Ausblenden
		$('productcontainer-0').effect('opacity',{
			duration: 1200,
			transition: Fx.Transitions.Expo.easeOut,
			onStart: function() { 
				document.getElementById("productcontainer-0").style.display ="none";
				document.getElementById("1-container").removeClass('selected');
	        	}
		}).start(1.0,0);
		
		// Ausblenden
		$('productcontainer-1').effect('opacity',{
			duration: 1200,
			transition: Fx.Transitions.Expo.easeOut,
			onStart: function() { 
				document.getElementById("productcontainer-1").style.display ="none";
				document.getElementById("2-container").removeClass('selected');
	        	}
		}).start(1.0,0);
		
		// Einblenden
		$('productcontainer-2').effect('opacity',{
			duration: 1200,
			transition: Fx.Transitions.Expo.easeOut,
			onStart: function() { 
				document.getElementById("productcontainer-2").style.display ="block";
				document.getElementById("3-container").addClass('selected');
	        	}
		}).start(0,1.0);
		
		// Value setzen
		document.getElementById("wo").value ="1";
	}
	
/*
	---------------------------------------
	 Sortiment / Menü
	---------------------------------------
*/

	function slideOutMenu() {
		var selectedMenu = this.id;
		var fxOut = new Fx.Styles(selectedMenu, {
			duration: 350,
			transition: Fx.Transitions.Back.easeOut,
			wait: true
		});
		fxOut.start({
			'padding-right': 30
		});
	}
	
	function slideInMenu() {
		var selectedMenu = this.id;
		var fxIn = new Fx.Styles(selectedMenu, {
			duration: 350,
			transition: Fx.Transitions.Back.easeIn,
			wait: true
		});
		fxIn.start({
			'padding-right': 0
		});
	}

//	==============================================
// 	 Bilder/Texte ein-/ausblenden
//	==============================================	
	function fadeFx(element) {
		if(element.length < 1) { return; }
		
		$elname = $('lfs_00');
		
		// Bild/Text ausblenden, Leerbild einblenden		
		if(document.getElementById(element).style.display == "block") {
			// Bild/Text ausblenden
			var div = $(element).setStyles({
				display:'none',
				opacity: 0
			});
			new Fx.Style(div, 'opacity', {
				changeTransition: Fx.Transitions.Back.easeOut,
				duration: 1000
			} ).start(0,1);
			
			// Leer.gif einblenden
			var leerdiv = $elname.setStyles({
				display:'block',
				opacity: 0
			});
			new Fx.Style(leerdiv, 'opacity', {duration: 1000} ).start(0,1);
		// Bild/Text einblenden, Leerbild ausblenden
		} else {
			// Leer.gif ausblenden
			var leerdiv = $elname.setStyles({
				display:'none',
				opacity: 0
			});
			new Fx.Style(leerdiv, 'opacity', {duration: 1000} ).start(0,1);
						
			// Bild/Text einblenden
			var div = $(element).setStyles({
				display:'block',
				opacity: 0
			});
			new Fx.Style(div, 'opacity', {
				changeTransition: Fx.Transitions.Back.easeOut,
				duration: 1000
			} ).start(0,1);
		}
	}
	
	function fadeFxGlossar(element) {
		if(element.length < 1) { return; }
		
		$elname = $('lfs_00');
		
		// Bild/Text ausblenden, Leerbild einblenden		
		if(document.getElementById(element).style.display == "block") {
			// Bild/Text ausblenden
			var div = $(element).setStyles({
				display:'none',
				opacity: 0
			});
			new Fx.Style(div, 'opacity', {
				changeTransition: Fx.Transitions.Back.easeOut,
				duration: 1000
			} ).start(0,1);
			
			// Leer.gif einblenden
			var leerdiv = $elname.setStyles({
				display:'block',
				opacity: 0
			});
			new Fx.Style(leerdiv, 'opacity', {duration: 1000} ).start(0,1);
		// Bild/Text einblenden, Leerbild ausblenden
		} else {
			// Leer.gif ausblenden
			var leerdiv = $elname.setStyles({
				display:'none',
				opacity: 0
			});
			new Fx.Style(leerdiv, 'opacity', {duration: 1000} ).start(0,1);
			
			// alle anderen Divs ausblenden
			$elname_array = new Array('lfs_01','lfs_02','lfs_03','lfs_04','lfs_05','lfs_06','lfs_07');
			
			for(var i=0;i<$elname_array.length;i++) {
				var anderediv = $($elname_array[i]).setStyles({
					display:'none',
					opacity: 0
				});
				new Fx.Style(leerdiv, 'opacity', {duration: 1000} ).start(0,1);
			}			
						
			// Bild/Text einblenden
			var div = $(element).setStyles({
				display:'block',
				opacity: 0
			});
			new Fx.Style(div, 'opacity', {
				changeTransition: Fx.Transitions.Back.easeOut,
				duration: 1000
			} ).start(0,1);
		}
	}
	
	function fadeFxStandorte(element) {
		if(element.length < 1) { return; }
		
		$elname = $('lfs_00');
		
		// Bild/Text ausblenden, Leerbild einblenden		
		if(document.getElementById(element).style.display == "block") {
			// Bild/Text ausblenden
			var div = $(element).setStyles({
				display:'none',
				opacity: 0
			});
			new Fx.Style(div, 'opacity', {
				changeTransition: Fx.Transitions.Back.easeOut,
				duration: 1000
			} ).start(0,1);
			
			// Leer.gif einblenden
			var leerdiv = $elname.setStyles({
				display:'block',
				opacity: 0
			});
			new Fx.Style(leerdiv, 'opacity', {duration: 1000} ).start(0,1);
		// Bild/Text einblenden, Leerbild ausblenden
		} else {
			// Leer.gif ausblenden
			var leerdiv = $elname.setStyles({
				display:'none',
				opacity: 0
			});
			new Fx.Style(leerdiv, 'opacity', {duration: 1000} ).start(0,1);
			
			// alle anderen Divs ausblenden
			$elname_array = new Array('lfs_01','lfs_02','lfs_03','lfs_04','lfs_05','lfs_06','lfs_07','lfs_08','lfs_09','lfs_10','lfs_11','lfs_12','lfs_13','lfs_14','lfs_15');
			
			for(var i=0;i<$elname_array.length;i++) {
				var anderediv = $($elname_array[i]).setStyles({
					display:'none',
					opacity: 0
				});
				new Fx.Style(leerdiv, 'opacity', {duration: 1000} ).start(0,1);
			}			
						
			// Bild/Text einblenden
			var div = $(element).setStyles({
				display:'block',
				opacity: 0
			});
			new Fx.Style(div, 'opacity', {
				changeTransition: Fx.Transitions.Back.easeOut,
				duration: 1000
			} ).start(0,1);
		}
	}

	function fadeFxGeschichte(element) {
		if(element.length < 1) { return; }
		
		$elname = $('lfs_00');
		
		// Bild/Text ausblenden, Leerbild einblenden		
		if(document.getElementById(element).style.display == "block") {
			// Bild/Text ausblenden
			var div = $(element).setStyles({
				display:'none',
				opacity: 0
			});
			new Fx.Style(div, 'opacity', {
				changeTransition: Fx.Transitions.Back.easeOut,
				duration: 1000
			} ).start(0,1);
			
			// Leer.gif einblenden
			var leerdiv = $elname.setStyles({
				display:'block',
				opacity: 0
			});
			new Fx.Style(leerdiv, 'opacity', {duration: 1000} ).start(0,1);
		// Bild/Text einblenden, Leerbild ausblenden
		} else {
			// Leer.gif ausblenden
			var leerdiv = $elname.setStyles({
				display:'none',
				opacity: 0
			});
			new Fx.Style(leerdiv, 'opacity', {duration: 1000} ).start(0,1);
			
			// alle anderen Divs ausblenden
			$elname_array = new Array('lfs_01','lfs_02','lfs_03');
			
			for(var i=0;i<$elname_array.length;i++) {
				var anderediv = $($elname_array[i]).setStyles({
					display:'none',
					opacity: 0
				});
				new Fx.Style(leerdiv, 'opacity', {duration: 1000} ).start(0,1);
			}
						
			// Bild/Text einblenden
			var div = $(element).setStyles({
				display:'block',
				opacity: 0
			});
			new Fx.Style(div, 'opacity', {
				changeTransition: Fx.Transitions.Back.easeOut,
				duration: 1000
			} ).start(0,1);
		}
	}

//	==============================================
// 	 Slideshow
//	==============================================		
	var ImageSlideShow = new Class({
		getOptions: function(){
			return {
				duration_in: 1500,
				duration_out: 1100,
				change: 3000
			}
		},
		initialize: function( prefix, count, options ) {
			this.setOptions(this.getOptions(), options );
			options = this.getOptions();
			this.prefix = prefix;
			this.active = 0;
			this.count = count;
			this.active = this.random();
			$( this.elementId( this.active ) ).setStyles({ 'opacity': '1' } );
			//setTimeout( function this.changer()", this.options.change );
			this.startTimer()
		},
		startTimer: function(){
			this.timer = this.changer.periodical( this.options.change, this );
		},
		changer: function() {
			oldimg = this.elementId( this.active );
			this.active = this.random();
			newimg = this.elementId( this.active );
			$(newimg).effect( 'opacity', {duration: this.options.duration_in} ).start(1);
			$(oldimg).effect( 'opacity', {duration: this.options.duration_out} ).start(0);
		},
		random: function() {
			available = new Array();
			for( i=1; i<=this.count;i++) {
				if( i != this.active ) {
					available.push( i );
				}
			}
			random = Math.floor(Math.random()*available.length);
			return available[random];
		},
		elementId: function( id ) {
			return this.prefix + id;
		}
	});

/*
	---------------------------------------
	 Listener	 
	---------------------------------------
*/ 

	window.addEvent('domready', function() {
		var haushaltswaren_menu = getElementsByClassName("haushaltswaren-menu",'');
		for(var i=0;i<haushaltswaren_menu.length;i++) {
			haushaltswaren_menu[i].onmouseover=slideOutMenu;			
		}
		var haushaltswaren_menu2 = getElementsByClassName("haushaltswaren-menu",'');
		for(var i=0;i<haushaltswaren_menu2.length;i++) {
			haushaltswaren_menu2[i].onmouseout=slideInMenu;
		}
		
		if ($('gallery')) { 
			var countgallery = getElementsByClassName("imagesildeshow",'');
			if(countgallery.length > 1) {
				ImageSlideShow.implement(new Options);
				new ImageSlideShow( "slide_img", countgallery.length );
			}
		}

	});
	
	function init() {
		var menu = getElementsByClassName("menu",'a');
		for(var i=0;i<menu.length;i++) {
			    menu[i].onclick=toggleMenu;
		}				
		var products = getElementsByClassName("product",'');
		for(var i=0;i<products.length;i++) {
			    products[i].onmouseover=showProductsDetails;
		}
		var products2 = getElementsByClassName("product",'');
		for(var i=0;i<products2.length;i++) {
			    products2[i].onmouseout=hideProductsDetails;
		}
		var products3 = getElementsByClassName("product",'');
		for(var i=0;i<products3.length;i++) {
			    products3[i].onclick=zoomProduct;
		}
		var largeView = getElementsByClassName("product-large",'');
		for(var i=0;i<largeView.length;i++) {
			    largeView[i].onclick=closeProductLarge;
		}		
		var next = getElementsByClassName("next",'');
		for(var i=0;i<next.length;i++) {
			next[i].onclick=nextContainer;
		}		
		var back = getElementsByClassName("back",'');
		for(var i=0;i<back.length;i++) {
			back[i].onclick=previousContainer;
		}
		var p3 = getElementsByClassName("page3",'');
		for(var i=0;i<p3.length;i++) {
			p3[i].onclick=ContainerThree;
		}
		var p2 = getElementsByClassName("page2",'');
		for(var i=0;i<p2.length;i++) {
			p2[i].onclick=ContainerTwo;
		}
		var p1 = getElementsByClassName("page1",'');
		for(var i=0;i<p1.length;i++) {
			p1[i].onclick=ContainerOne;
		}
	}
	window.onload=init;
