$(document).ready(function(){	

	$(".Menue").click(function(){ 
	//	alert('test');
		var Site = 'index';
		if($(this).attr('id') != 'Home'){
			Site = $(this).attr('id').toLowerCase();
		}
		location.href = Site+'.php';
	});
	
	//$(".FooterMenue").click(function(){ 
	$("#Imprint").click(function(){ 
		location.href = $(this).attr('id').toLowerCase()+'.php';
	});

	$("#Video").click(function(){ 
		$('#MonitorVideo').html('<iframe id="Video" scrolling="no" border="0" src="Video/confovis.html"></iframe>');
	});
		/*
	$("#Products").mouseover(function(){ 
		$("#ProductsMenue").css("display","inline");
	});
	
	$("#Products").mouseout(function(){ 
		$("#ProductsMenue").css("display","none");
	});
	*/
	
	
	
	$("#MoreFeaturesHead").click(function(){
		if($("#MoreFeaturesContent").css("display") == "none"){
			$("#MoreFeaturesContent").css("display", "inline");
			
			$("#ProductsKeyFeatures").css("display", "inline");
			
			$("#ProductsKeyFeatures").animate({opacity:1.0, minHeight:30}, 'fast', function(){				
			$("#ProductsKeyFeatures").css("display", "inline");
				$("#ProductsSoftware").css("display", "inline");
				$("#ProductsSoftware").animate({opacity:1.0, minHeight:30}, 'fast', function(){
				$("#ProductsSoftware").css("display", "inline");
					$("#ProductsIntegration").css("display", "inline");
					$("#ProductsIntegration").animate({opacity:1.0, minHeight:30}, 'fast', function(){
					$("#ProductsIntegration").css("display", "inline");
					$("#ProductsMore").css("padding-bottom", "10px");
				
					});
				});
			});
		}else{
			$("#MoreFeaturesContent").hide('fast');
			$("#ProductsMore").css("padding-bottom", "0px");
			
			
			$("#ProductsKeyFeatures").css("display", "none")
			$("#ProductsKeyFeatures").css("min-height", "0px")
			$("#ProductsKeyFeatures").css("opacity", "0.0")
			
			$("#ProductsSoftware").css("display", "none")
			$("#ProductsSoftware").css("min-height", "0px")
			$("#ProductsSoftware").css("opacity", "0.0")
			
			$("#ProductsIntegration").css("display", "none")
			$("#ProductsIntegration").css("min-height", "0px")
			$("#ProductsIntegration").css("opacity", "0.0")
				
		}	
	});
		
		
	$("#KeyFeaturesHead").click(function(){
		InformationSlider(this, "KeyFeaturesContent", "355px");
	});
	
	$("#SoftwareHead").click(function(){
		InformationSlider(this, "SoftwareContent", "335px");
	});
	
	$("#IntegrationHead").click(function(){
		InformationSlider(this, "IntegrationContent", "235px");
	});
		
		
	StartSlideshow();	
	
	
	$("#ActionTechnologyEntend").click(function(){
		if($("#TechnologyExtend").css("display") == "none"){
			$("#TechnologyExtend").show("fast");
		}else{
			$("#TechnologyExtend").hide("fast");
		}
	});
		
		
});




function InformationSlider(Xself, objectID, height){
		if($("#"+objectID).css("display") == "none"){
			$("#"+objectID).css("height", "0px");
			$("#"+objectID).css("opacity", "0.0");
			$("#"+objectID).css("display", "inline");			
			$(Xself).find("div").addClass("arrow_up");
			$(Xself).find("div").removeClass("arrow_down");
			$("#"+objectID).animate({height:''+height+''}, 'fast', function() {
				$("#"+objectID).animate({opacity:1.0}, 'slow', function() {
				});
			});
		}else{			
			$(Xself).find("div").removeClass("arrow_up");
			$(Xself).find("div").addClass("arrow_down");
			$("#"+objectID).animate({opacity:0.0}, 'fast', function() {
				$("#"+objectID).animate({height:'0px'}, 'fast', function() {
					$("#"+objectID).css("display", "none");
					$("#"+objectID).css("opacity", "0.0");
				});
			});
			
		}
	}	
		
	
	
	var Banner_ID = 1;

function ChangeBanner(){
	if(Banner_ID < 3){
		if(Banner_ID == 0){		
			$("#Slide2").attr("src", "gfx/SlideDefault.png");
		
		}else{
			$("#Slide"+(Banner_ID-1)).attr("src", "gfx/SlideDefault.png");
		}		
		$("#Slide"+Banner_ID).attr("src", "gfx/SlideActive.png");
		Banner_ID++;
	}else{
		Banner_ID = 0;
		ChangeBanner();
	}
}


function slideSwitch(){
	setTimeout('ChangeBanner()', 1000);
	var $active = $('#BannerContainer IMG.active');
	if ( $active.length == 0 ) $active = $('#BannerContainer IMG:last');
	var $next = $active.next().length ? $active.next()
	: $('#BannerContainer IMG:first');
	$active.addClass('last-active');
	$active.css({opacity: 1.0})
	.animate({opacity: 0.0}, 2000, function() {
	$active.removeClass('last-active active');
	});
	$next.css({opacity: 0.0})
	.addClass('active')
	.animate({opacity: 1.0}, 2000, function() {
	$active.removeClass('active last-active');
	});
}

function StartSlideshow(){
	setInterval( "slideSwitch()", 5000 );
}; 
