	var toggled = ""; 				// tells me if the menu has been toggled out
	var prmSec = 0000;				// the seconds that have to pass until something will go on
	var jetzt;						// "jetzt" is the time now
	var vDate = new Date();			
	var vorhin = vDate.getTime();	// "vorhin" is the time the last animation was started	
	var brandarray = new Array("citroen","dacia","fiat","ford","opel","peugeot","renault","vw"); // Array with my brand names
	var slidearray = new Array();
	
	slidearray[0] = new Object();
	slidearray[0]['citroen'] 	= -1;
	slidearray[0]['dacia'] 		= -1;
	slidearray[0]['fiat'] 		= -1;
	slidearray[0]['ford'] 		= -1;
	slidearray[0]['opel'] 		= -1;
	slidearray[0]['peugeot'] 	= -1;
	slidearray[0]['renault'] 	= -1;
	slidearray[0]['vw'] 		= -1;

	var fadepunkt = "fadepunkt1";
	var fader = 0;
	
	function togglemenu()
	{
		var hereDate = new Date();
		jetzt = hereDate.getTime(); // set the time for "jetzt"
		
		if( toggled == 0) // is menu out or not
		{			
			if((jetzt-vorhin)>=prmSec) // has enough time for the animation passed
			{
				// then do the animation
				Effect.toggle('vehiclemenu', 'slide', { duration: 0.5 });
				Effect.toggle('vehiclemanuf', 'appear', { duration: 0.5, delay: 0.5 });
				toggled = 1;
				prmSec = 1000; // setting the time to wait for the next run
				var nowDate = new Date(); // set a new date for the time the last animation was started
				vorhin = nowDate.getTime();
			}
		}else{			
			if((jetzt-vorhin)>=prmSec) // has enough time for the animation passed
			{
				cleanup(''); // close all open submenus
				Effect.toggle('vehiclemanuf', 'appear', { duration: 0.5});
				Effect.toggle('vehiclemenu', 'slide', { duration: 0.5, delay: 0.5 });
				toggled = 0;
				prmSec = 1000; // setting the time to wait for the next run
				var nowDate = new Date(); // set a new date for the time the last animation was started
				vorhin = nowDate.getTime();
			}
		}
	}
	
	function toggleon(target) // open target
	{
		Effect.BlindDown(target, { duration: 0.25, afterFinisch: slidearray[0][target] = 1, queue: { position: 'end', scope: target } }); 	// Open the target window	
		cleanup(target);		
	}
	
	function toggleoff(target) // close target
	{
		Effect.BlindUp(target, { duration: 0.25, afterFinisch: slidearray[0][target] = -1, queue: { position: 'end', scope: target } }); 	// close the target window				
	}	
	
	function cleanup(exception) // closing all brand menues exept the the given exception
	{
		for (var i = 0; i < brandarray.length; i++) 
		{
			if (exception != brandarray[i] && slidearray[0][brandarray[i]] == 1)
			{	
				toggleoff(brandarray[i]);
			}
		}
	}	

	function morphus(target)
	{
		new Effect.Morph(target, { style: 'color:#af0917;', duration: 0.3, queue: { position: 'end', scope: 'marken' } });
	}
	function morphis(target)
	{
		new Effect.Morph(target, { style: 'color:#666666;', duration: 0.3, queue: { position: 'end', scope: 'marken' } });
	}
	
	function togglebullet(target) // close target
	{
		if(target != fadepunkt && fader == 0) {
			fader = 1;
			
			Effect.toggle(fadepunkt, 'appear', { duration: 0.25, queue: { position: 'end', scope: 'fadepunkte' } });
			Effect.toggle(target, 'appear', { duration: 0.25, afterFinish: function(){fader=0;}, queue: { position: 'end', scope: 'fadepunkte' } });
			fadepunkt = target;
		}			
	}	

