/*
 * KEYVISUAL
 *
 */
/*
var currentImage = 1;

function rotateKeyvisual(){
	
	var keyvisual = jQuery('#keyvisual');
	var gwsize = keyvisual.find('img').size();
	
	var curKeyv = keyvisual.find('.keyv');
	var nextKeyv = curKeyv.next();
	
	if(currentImage >= gwsize) {
		//alert(currentImage);
		currentImage = 0;
		nextKeyv = keyvisual.find('img').eq(0);
		
	}
	//});


	curKeyv.fadeOut(2000);
	
	nextKeyv.fadeIn(2500, function(){ 
		curKeyv.removeClass('keyv');
		nextKeyv.addClass('keyv');		
	});
	
	currentImage++; 
	


}
	
jQuery(function() {
	setInterval("rotateKeyvisual()", 10000);
});

*/

/*
 * var bxslider
 * 
 */

jQuery(document).ready(function(){
    jQuery('.keyvisual-inner').bxSlider({
	mode: 'fade',                 // 'horizontal', 'vertical', 'fade'
	controls: true,                     // true, false - previous and next controls
	speed: 2000,                         // integer - in ms, duration of time slide transitions will occupy
	auto: true,                        // true, false - make slideshow change automatically
	autoDelay: 0,                       // integer - in ms, the amount of time before starting the auto show
	pause: 10000,                        // integer - in ms, the duration between each slide transition
	autoHover: true,                   // true, false - if true show will pause on mouseover
	pager: true,                        // true / false - display a pager (ziffern)
	nextText: 'next',                   // string - text displayed for 'next' control
	nextImage: '',                      // string - filepath of image used for 'next' control. ex: 'images/next.jpg'
	prevText: 'prev',                   // string - text displayed for 'previous' control
	prevImage: '',                      // string - filepath of image used for 'previous' control. ex: 'images/prev.jpg'
	wrapperClass: 'bx-wrapper',         // string - classname attached to the slider wraper
	randomStart: false,                 // true, false - if true show will start on a random slide


	// ticker == horizontal durchlaufend !!
	ticker: false,                      // true, false - continuous motion ticker mode (think news ticker)
										// note: autoControls and autoControlsSelector apply to ticker!
	tickerSpeed: 5000,                  // integer - has an inverse effect on speed. therefore, a value of 10000 will 
										// scroll very slowly while a value of 50 will scroll very quickly.
	tickerDirection: 'next',            // 'next', 'prev' - direction in which ticker show will traverse
	tickerHover: true                 // true, false - if true ticker will pause on mouseover
	
	// mehr optionen auf http://bxslider.com
	
	});
  });



/*
 * IW-Accordion 
 * 
 */
var accordion_active = false; //False = geschlossen, 0-X jeweilige element beim Anfang geoeffnet


jQuery(document).ready(function(){

	/* Accordion */
	jQuery("#accordion-contact").accordion({ header: "h3", autoHeight: false, active: false, collapsible: true }); 
	
	/* Accordion */
	//jQuery("#accordion-content").accordion({ header: "h3", autoHeight: false, active: false, collapsible: true }); 
	jQuery(".accordion").accordion({ header: "h3", autoHeight: false, active: false, collapsible: true }); 

});


/*
 * ALTERNATIV MENUE
 *
 */
jQuery(document).ready(function(){


	/*
	* MENUE HEAD MIT SUB
	*/
	jQuery(".menue_list p.menue_head_sub").mouseover(function()
	{
	   //on mouseover
	   jQuery(this).css({backgroundPosition:"0 -180px"}).next("div.menue_body").slideDown(500).siblings("div.menue_body").slideUp("slow");
	   //alle anderen mouseout
	   jQuery(this).siblings('p.menue_head_sub').removeAttr("style");

	});

	/*
	* MENUE HEAD MIT SUB AKTUELLER
	*/
	jQuery(".menue_list p.menue_head_sub.cur").mouseover(function()
	{
	   //on mouseover
	   jQuery(this).css({backgroundPosition:"0 -300px"}).next("div.menue_body").slideDown(500).siblings("div.menue_body").slideUp("slow");
	   //alle anderen mouseout
	   jQuery(this).siblings('p.menue_head_sub').removeAttr("style");

	});	


	/*
	* MENUE HEAD NORMAL
	*/
	jQuery(".menue_list p.menue_head_no").mouseover(function()
	{
	   //on mouseover
	   jQuery(this).css({backgroundPosition:"0 -240px"}).next("div.menue_body").slideDown(500).siblings("div.menue_body").slideUp("slow");
	   //alle anderen mouseout
	   jQuery(this).siblings('p.menue_head_sub').removeAttr("style");

	});




	jQuery(".menue_list p").mouseout(function()
	{
	  jQuery(this).removeAttr("style");


	});

	/*
	 * Mouseleave fuer komplette Liste
	 */
	jQuery('#navi').mouseleave(function(){
		if(	jQuery('p.menue_head.cur').size()	<  1 ||	jQuery('p.menue_head_no.cur').size()	>=	1	) {
			jQuery('p.menue_head').next('.menue_body').slideUp("slow");
		}
		else {
			jQuery('p.menue_head.cur').next('.menue_body').slideDown("slow").siblings("div.menue_body").slideUp("slow");
		}
		
	});	

});




