function next(what) {
	//alert(what);
	$("#"+what+"_scrollcontent_slide").animate({"left": "-=946"}, 500);
	aktuelles++;
	if(aktuelles==maxcount) {
		$('#'+what+'_scrollnavigation_next').css('display','none');
	}
	$('#'+what+'_scrollnavigation_prev').css('display','');
}

function prev(what) {
	//alert(what);
	$("#"+what+"_scrollcontent_slide").animate({"left": "+=946"}, 500);
	aktuelles--;
	if(aktuelles==0) {
		$('#'+what+'_scrollnavigation_prev').css('display','none');
	}
	$('#'+what+'_scrollnavigation_next').css('display','');
}

function subnext(what) {
	//alert(what);
	$("#"+what+"_subscrollcontent_slide").animate({"left": "-=946"}, 500);
	subaktuelles++;
	if(subaktuelles==submaxcount) {
		$('#'+what+'_subscrollnavigation_next').css('display','none');
	}
	$('#'+what+'_subscrollnavigation_prev').css('display','');
}

function subprev(what) {
	//alert(what);
	$("#"+what+"_subscrollcontent_slide").animate({"left": "+=946"}, 500);
	subaktuelles--;
	if(subaktuelles==0) {
		$('#'+what+'_subscrollnavigation_prev').css('display','none');
	}
	$('#'+what+'_subscrollnavigation_next').css('display','');
}

function lightbox(section,what,path) {
	//alert(section+"_"+what+".php?ptr="+path);
	$("#aktuelles_subscrollcontent").html("");
	$('#lightbox').fadeIn(1000);
	$("#lightbox_content").load(path+section+"_"+what+".php?ptr="+path);
	$('#lightbox_content').fadeIn(1000);
	setTimeout(function(){ 
		$("#aktuelles_subscrollcontent_slide").fadeIn(1000);
	}, 5000 ); 
}

function clearlightbox() {
	//alert(what);
	$('#lightbox').fadeOut(1000);
	$('#lightbox_content').fadeOut(1000);
	$("#liegestuhl_flash").html("");
	$("#lightbox_liegestuhl").fadeOut(1000);
	setTimeout(function(){ 
		$("#aktuelles_subscrollnavigation").html("");
	}, 1000 ); 
}

function nothing() {
	$('#lightbox').css('display','');
}

$(function() {
    $('.kunden_img').hover(function() {
        var currentImg = $(this).attr('src');
        $(this).attr('src', $(this).attr('hover'));
        $(this).attr('hover', currentImg);
    }, function() {
        var currentImg = $(this).attr('src');
        $(this).attr('src', $(this).attr('hover'));
        $(this).attr('hover', currentImg);
    });
});

function kundenansicht(what,path) {
	//$('#stage').scrollTo( '#aktuelles', 1000 );
	alert(what+'--'+path);
	window.setTimeout("lightbox('aktuelles','"+what+"','"+path+"');",300);
}

var pos=0;
var maxpos=4;
function scroll(direction) {
	if(direction=='down' && pos < maxpos) {
		$("#themenabend_scrollcontent_slide").animate({"top": "-=220"}, 500);
		pos++;
	} 
	if(direction=='up' && pos > 0) {
		$("#themenabend_scrollcontent_slide").animate({"top": "+=220"}, 500);
		pos--;
	}
	
	if(pos == 0) {
		$('#themenabend_navigationimage_up').css('display','none');
	} else {
		$('#themenabend_navigationimage_up').css('display','');
	}
	
	if(pos == maxpos) {
		$('#themenabend_navigationimage_down').css('display','none');
	} else {
		$('#themenabend_navigationimage_down').css('display','');
	}
}

function themenabend_over(what) {
	what.style.color="#cf1d14";
}

function themenabend_out(what) {
	what.style.color ="#404040";
}

function liegestuhl(path) {
	$('#lightbox').fadeIn(1000);
	$('#lightbox_liegestuhl').fadeIn(1000);
	$("#lightbox_liegestuhl").load(path+"liegestuhl.php?ptr="+path);
	window.setTimeout("$('#liegestuhl_flash').css('display','')",6000);
}

