jQuery.noConflict();
(function($) { 
  $(function() {
    // more code using $ as alias to jQuery
	
	
    
    $(document).ready
    (
    	function()
    	{
    	    //navi  
    	    
    	    /*
            navi_act = 0;
            is_over = 0;
            timer = 0;
             
            
            $("#navi").width(18);
            //$("#footer").animate({"height": "35px"}, "normal");
            
            $("#navi").bind("mouseenter", function(){
                is_over = 1;
                if(navi_act == 0) $("#navi").animate({"width": "142px"}, "slow");
                navi_act = 1;
            });
            
            $("#navi").bind("mouseleave", function(){
                is_over = 0;
                if(timer == 0) {
                    timer = 1;
                    setTimeout(function(){
                        if (is_over == 0) {
                            $("#navi").animate({"width": "18px"}, "fast", "", function(){
                                navi_act = 0;
                            });
                        }
                        timer = 0;
                    },700);
                }
            });
            
            */
            
            var newsoption = {
                firstname:"home_news",
                secondname:"showhere",
                thirdname:"home_news_show",
                fourthname:"home_news_button",
                newsspeed:'10000',
                isauto:'1',
                imagedir: "fileadmin/templates/images/buttons/",
                newscountname:"test",
                disablenewscount:false
            }
            $.init_plus(newsoption);
            
            
            // header imagebox
            if($("#imageScreen").size()!=0) {
                var imageBoxArr = new Array();
                $("#imageSources img").each(function(){
                    imageBoxArr.push( $(this).attr("src") );
                }); 
                showImage();
            }
            
            function showImage() {
                $("#imageScreen img").attr("src", imageBoxArr[0]).fadeIn("slow",function(){
                    $("#imageScreen").css("background-image", "url("+imageBoxArr[0]+")");
                    imageBoxArr.push(imageBoxArr[0]);
                    imageBoxArr.shift();
                    $(this).hide();
                    setTimeout(showImage,8000); 
                });
            }
                    
            

            //init teaserBox home
            if($("#content_teaser_box .outer_content_home"))
            {
                $("#content_teaser_box .outer_content_home").hide();
                $("#content_teaser_box .outer_content_home:first").show();
                
                $("#content_teaser_box h2").click(function () {
                    $("#content_teaser_box .outer_content_home").hide();
                    $(this).next(".outer_content_home").addClass($(this).attr("class"));
                    $(this).next(".outer_content_home").fadeIn("slow");
                });
            }
			
			
			
			
			$('.logoSlideInner').each(function(idx, el){
				$(el).find('li:first').addClass('active');
				var initHeight = $(el).find('img:first').height();
				$(this).height(initHeight);
				setInterval( function() { slideSwitch(el); }, 3000, el );
			})
			
			
    	}
    );
  });
})(jQuery);


			

function slideSwitch(slEl) {

	var $active = jQuery(slEl).find('li.active');

	if ( $active.length == 0 ) $active = jQuery(slEl).find('li:last');

	var $next =  $active.next().length ? $active.next()
		:  jQuery(slEl).find('li:first');

	$active.addClass('last-active');

	var $newHeight = jQuery($next).find('img:first').height();

	jQuery(slEl).animate({height:$newHeight + 'px'}, 500);
	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1000, function() {
			$active.removeClass('active last-active');
		});
}



