// JavaScript Document

//Slideshow
function slideSwitch() {
    var $active = $('#slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 3000, function() {
            $active.removeClass('active last-active');

        });
}


//dauer des bildwechsels = 3sec
$(function() {
    setInterval( "slideSwitch()", 10000 );
});

			
$(document).ready(function() {

	$("#scrollable").show();

	$(function() {

	$('#scrollable').bxCarousel({
		display_num: 7,
		move: 1,
		prev_image: 'fileadmin/templates_tv/main/imgs/scroller_prev.gif',
		next_image: 'fileadmin/templates_tv/main/imgs/scroller_next.gif',
		margin: 0
	});
		
		
		//mouse over: zeige inner div mit gr��erem bild
		$("li.image").mouseover(function() {
			$(this).children("div.imageover").show();
			}).mouseout(function() {
			$(this).children("div.imageover").hide();
		});		
		
		
		
	});
	
	
$("li[id^=trigger_]").mouseover(function(){
	//Bei Mouse over div Layer einblenden (wenn es einen gibt)
	$("div[id^=dropped_]").show();
	//Bei Mouse over einen event. anderen geöffneten div Layer ausblenden
	$(".dropped").not($(this).find("div[id^=dropped_]")).hide();
	//wenn der hover Menüpunkt Unterseiten hat (die Klasse ul.lev2 existiert) dann class over hinzufügen
	var nd = $("ul.lev2:visible").length;
		if (nd >0){
			{ this.className = "down over"; };
			} 
		if (nd == 0){
			{ this.className = " down"; };
			} 
});


$("li[id^=trigger_]").mouseout(function(){
	//Beim Verlassen des Menüpunktes class over löschen
	{ this.className = " down"; };
	//Beim Verlassen des Menüpunktes div Layer ausblenden
	$("div[id^=dropped_]").hide();
});


$('area').mouseover(function() {
	var id = $(this).attr('class');
	var layer = '#lay' + id.substring(4);
	var layerlogo = '#logolay' + id.substring(4);
	
	//alle verstecken
	$('div[id^=lay]').hide();
	$('div[id^=logolay]').hide();
	

	$(layer).show();
	$(layerlogo).show();
  	return false; 
});

$("#middle,#top,#rootline,#wrapper_bottom").mouseover(function() {
	$('div[id^=lay]').hide();
	$('div[id^=logolay]').hide();
});


// Hover Effekt Produktliste
$(".produktliste .produkt").mouseover(function(){
	$(this).attr('style', 'background-color:#FFFFFF;');
});
$(".produktliste .produkt").mouseout(function(){
	$(this).attr('style', 'background-color:#ECECED;');
});


// Switchen zwischen Produktbeschreibung und Produktgallerie	
$("#gallery").click(function() {
	$(".tab1").attr('style', 'display:none');						 
	$("#gallery").addClass('act');
	$("#pagetitle").addClass('no');
	$(".tab2").attr('style', 'display:block'); 
});

$("#pagetitle").click(function() {
	$(".tab2").attr('style', 'display:none');					 
	$("#gallery").removeClass('act');
	$("#pagetitle").removeClass('no');
	$(".tab1").attr('style', 'display:block'); 
});



});
 

			

