$(document).ready(function(){ // doc ready

///////////////////////////////
//
//	Slider
//
///////////////////////////////

	
  $('#slider').bxSlider({
	auto: true,
	autoHover: true,
	pause: 8000,
	autoDelay: 5000,
	speed: 800,
	mode: 'horizontal',
   infiniteLoop: false,
   hideControlOnEnd: true
  });



///////////////////////////////
//
//	Teaser
//
///////////////////////////////


$('.boxgrid.caption').hover(function(){
    $(".cover", this).stop().animate({top:'0px'},{queue:false,duration: 300});
}, function(){
    $(".cover", this).stop().animate({top:'110px'},{queue:false,duration: 200});
});




	
///////////////////////////////
//
//	Externe Links in neuem Fenster öffnen
//
///////////////////////////////
	
 $('a.extern').click(function(){
  window.open($(this).attr('href'));
  return false;
 });


///////////////////////////////
//
//	Accordion
//
///////////////////////////////

$('.accordionueberschrift').click(function() {

		$('.accordionueberschrift').removeClass('aktiv');
	 	$('.accordioninhalt').slideUp(300);

		if($(this).next().is(':hidden') == true) {
				$(this).addClass('aktiv');

				$(this).next().slideDown(300);
	 			} 
});

$('.accordionueberschrift').mouseover(function() {
			$(this).addClass('hover');
}).mouseout(function() {
		$(this).removeClass('hover');										
	});
$('.accordioninhalt').hide();




///////////////////////////////
//
//	Suche
//
///////////////////////////////

$('.sucheingabe #rexsearch_form .submit').hover(function(){
    $(".sucheingabe").addClass('hover');
}, function(){
    $(".sucheingabe").removeClass('hover');
});

$("#metaNavi ul").find("li").first().addClass('first');
$("#mainNavi ul").find("li").first().addClass('first');
$("#mainNavi ul li ul.subnavi ").find("li").last().addClass('last');
$(".footerrechts ul").find("li").first().addClass('first');


});


