var accordionClickCounter = 0;

var hide = true;

var mySlide;

var flashheader;

var fast_month_arr = new Array('Jan','Feb','Mar','Apr','Mai','Jun','Jul','Aug','Okt','Nov','Sep','Dez');

time_date = new Date();
time_startSecs = time_date.getTime();

window.addEvent('domready', function(){
	
	if ($('sv_box') !== null) {
		sv_showBox(0);
	}
	
	flashheader = new Swiff('fileadmin/templates/kite/flash/xmlheader.swf', {
    	width:  1000,
    	height: 430,
    	container: $('slideshow'),
    	params: {
			
		},
		vars: {
			xmlPath: 'fileadmin/templates/kite/xml/'+xmlheader,
			descriptionLanguage: language,
    	}
	});
	
	$$('.stars').each(function(i) {
		i.innerHTML = i.innerHTML.replace('*','<img src="fileadmin/templates/kite/img/star_on.gif" />');
		i.innerHTML = i.innerHTML.replace('*','<img src="fileadmin/templates/kite/img/star_on.gif" />');
		i.innerHTML = i.innerHTML.replace('*','<img src="fileadmin/templates/kite/img/star_on.gif" />');
		i.innerHTML = i.innerHTML.replace('*','<img src="fileadmin/templates/kite/img/star_on.gif" />');
		i.innerHTML = i.innerHTML.replace('*','<img src="fileadmin/templates/kite/img/star_on.gif" />');
		i.innerHTML = i.innerHTML.replace('*','<img src="fileadmin/templates/kite/img/star_on.gif" />');
	});
	
});

function hideSub(id) {
	if (hide) {
		$('submenu'+id).set('tween', {}).tween('height', '1');
	}
}

function secondsOnSite() {
	d = new Date();
	return (d.getTime() - time_startSecs)/1000;
}

function sv_showBox(id) {
	$$('.sv_boxes').each(function(e){e.hide();});
	$$('.sv_nav').each(function(e){e.removeClass('act');});

	$('sv_nav_'+id).addClass('act');
	$('sv_box_'+id).show();
}

/*
	$('submenu1').addEvent('mouseenter', function(e){
		hide = false;
	});

	$('submenu1').addEvent('mouseleave', function(e){
		$('submenu1').set('tween', {}).tween('height', '1');
	});
	
	// The same as before: adding events
	$('menuLink1').addEvents({
		'mouseenter': function(){
			// Always sets the duration of the tween to 1000 ms and a bouncing transition
			// And then tweens the height of the element
			$('submenu1').setStyle('height',269);
			//$('submenu1').set('tween', {
			//	duration: 1000,
			//	transition: Fx.Transitions.Bounce.easeOut // This could have been also 'bounce:out'
			//}).tween('height', '246');
		},
		'mouseleave': function(){
			// Resets the tween and changes the element back to its original size
			hide = true;
			window.setTimeout('hideSub(1);', 1000);
			//myVerticalSlide.slideIn();
		}
	});
	
	
	$('submenu2').addEvent('mouseenter', function(e){
		hide = false;
	});

	$('submenu2').addEvent('mouseleave', function(e){
		$('submenu2').set('tween', {}).tween('height', '1');
	});
	
	// The same as before: adding events
	$('menuLink2').addEvents({
		'mouseenter': function(){
			// Always sets the duration of the tween to 1000 ms and a bouncing transition
			// And then tweens the height of the element
			$('submenu2').setStyle('height',160);
			//$('submenu2').set('tween', {
			//	duration: 1000,
			//	transition: Fx.Transitions.Bounce.easeOut // This could have been also 'bounce:out'
			//}).tween('height', '160');
		},
		'mouseleave': function(){
			// Resets the tween and changes the element back to its original size
			hide = true;
			window.setTimeout('hideSub(2);', 1000);
			//myVerticalSlide.slideIn();
		}
	});
	
	try {
	  $('submenu3').addEvent('mouseenter', function(e){
		  hide = false;
	  });
  
	  $('submenu3').addEvent('mouseleave', function(e){
		  $('submenu3').set('tween', {}).tween('height', '1');
	  });
	  
	  // The same as before: adding events
	  $('menuLink3').addEvents({
		  'mouseenter': function(){
			  // Always sets the duration of the tween to 1000 ms and a bouncing transition
			  // And then tweens the height of the element
			  $('submenu3').setStyle('height',166);
			  //$('submenu3').set('tween', {
			  //	  duration: 1000,
			  //	  transition: Fx.Transitions.Bounce.easeOut // This could have been also 'bounce:out'
			  //}).tween('height', '166');
		  },
		  'mouseleave': function(){
			  // Resets the tween and changes the element back to its original size
			  hide = true;
			  window.setTimeout('hideSub(3);', 1000);
			  //myVerticalSlide.slideIn();
		  }
	  });
	}
	catch (e) {
	}
	*/
