var actImage = 1;
var Time = 3000;

var actTeaserImage = 1;
var topTeaserTime = 4000;
var topTeaserTimer = false;

var actTopThemeImage1 = 1;
var topThemeTime1 = 2500;
var topThemeTimer1 = false;

var actTopThemeImage2 = 1;
var topThemeTime2 = 2800;
var topThemeTimer2 = false;

$(document).ready(
	function() 
	{
//		$("#landing_teaser_right1").hide( 0);
		$("#landing_teaser_right2").hide( 0);
		$("#landing_teaser_right3").hide( 0);
		$("#landing_teaser_right4").hide( 0);
		$("#landing_teaser_right5").hide( 0);
		$("#landing_teaser_right6").hide( 0);
		
		setTimeout( "next_image()", Time);

		$("#landing_top_right1sw").hide( 0);
		$("#landing_top_right2f").hide( 0);
		$("#landing_top_right3f").hide( 0);
		$("#landing_top_right4f").hide( 0);

		$("#landing_top2 img").hide( 0);
		$("#landing_top3 img").hide( 0);
		$("#landing_top4 img").hide( 0);
		
		topTeaserTimer = setTimeout( "next_topTeaser()", topTeaserTime);

		$('#landing_top1 img').hover(
			function() 
			{
				stopTeaser( 1);
			},
			function() 
			{
				startTeaser( 1);
			}
		);

		$('#landing_top2 img').hover(
			function() 
			{
				stopTeaser( 2);
			},
			function() 
			{
				startTeaser( 2);
			}
		);

		$('#landing_top3 img').hover(
			function() 
			{
				stopTeaser( 3);
			},
			function() 
			{
				startTeaser( 3);
			}
		);

		$('#landing_top4 img').hover(
			function() 
			{
				stopTeaser( 4);
			},
			function() 
			{
				startTeaser( 4);
			}
		);

		$('#landing_top_right1').hover(
			function() 
			{
				stopTeaser( 1);
			},
			function() 
			{
				startTeaser( 1);
			}
		);

		$('#landing_top_right2').hover(
			function() 
			{
				stopTeaser( 2);
			},
			function() 
			{
				startTeaser( 2);
			}
		);

		$('#landing_top_right3').hover(
			function() 
			{
				stopTeaser( 3);
			},
			function() 
			{
				startTeaser( 3);
			}
		);

		$('#landing_top_right4').hover(
			function() 
			{
				stopTeaser( 4);
			},
			function() 
			{
				startTeaser( 4);
			}
		);
		
		$("#landing_toptheme1_2 img").hide( 0);
		$("#landing_toptheme1_3 img").hide( 0);
		$("#landing_toptheme1_4 img").hide( 0);
		$("#landing_toptheme1_5 img").hide( 0);
		$("#landing_toptheme1_6 img").hide( 0);
		$("#landing_toptheme1_7 img").hide( 0);
		$("#landing_toptheme1_8 img").hide( 0);
		$("#landing_toptheme1_9 img").hide( 0);
		$("#landing_toptheme1_10 img").hide( 0);
		$("#landing_toptheme1_11 img").hide( 0);
		$("#landing_toptheme1_12 img").hide( 0);
		$("#landing_toptheme1_13 img").hide( 0);
		$("#landing_toptheme1_14 img").hide( 0);
		
		$("#landing_toptheme_text1_" + actTopThemeImage1 + " div").css( "background-color", "#2195AC");
		$("#landing_toptheme_text1_" + actTopThemeImage1 + " a").css( "color", "#fff");
		
		topThemeTimer1 = setTimeout( "next_topTheme1()", topThemeTime1);

		$('#landing_toptheme_text1_1').hover(
			function() 
			{
				stopTheme1( 1);
			},
			function() 
			{
				startTheme1( 1);
			}
		);

		$('#landing_toptheme_text1_2').hover(
			function() 
			{
				stopTheme1( 2);
			},
			function() 
			{
				startTheme1( 2);
			}
		);

		$('#landing_toptheme_text1_3').hover(
			function() 
			{
				stopTheme1( 3);
			},
			function() 
			{
				startTheme1( 3);
			}
		);

		$('#landing_toptheme_text1_4').hover(
			function() 
			{
				stopTheme1( 4);
			},
			function() 
			{
				startTheme1( 4);
			}
		);

		$('#landing_toptheme_text1_5').hover(
			function() 
			{
				stopTheme1( 5);
			},
			function() 
			{
				startTheme1( 5);
			}
		);

		$('#landing_toptheme_text1_6').hover(
			function() 
			{
				stopTheme1( 6);
			},
			function() 
			{
				startTheme1( 6);
			}
		);

		$('#landing_toptheme_text1_7').hover(
			function() 
			{
				stopTheme1( 7);
			},
			function() 
			{
				startTheme1( 7);
			}
		);

		$('#landing_toptheme_text1_8').hover(
			function() 
			{
				stopTheme1( 8);
			},
			function() 
			{
				startTheme1( 8);
			}
		);

		$('#landing_toptheme_text1_9').hover(
			function() 
			{
				stopTheme1( 9);
			},
			function() 
			{
				startTheme1( 9);
			}
		);

		$('#landing_toptheme_text1_10').hover(
			function() 
			{
				stopTheme1( 10);
			},
			function() 
			{
				startTheme1( 10);
			}
		);

		$('#landing_toptheme_text1_11').hover(
			function() 
			{
				stopTheme1( 11);
			},
			function() 
			{
				startTheme1( 11);
			}
		);

		$('#landing_toptheme_text1_12').hover(
			function() 
			{
				stopTheme1( 12);
			},
			function() 
			{
				startTheme1( 12);
			}
		);

		$('#landing_toptheme_text1_13').hover(
			function() 
			{
				stopTheme1( 13);
			},
			function() 
			{
				startTheme1( 13);
			}
		);

		$('#landing_toptheme_text1_14').hover(
			function() 
			{
				stopTheme1( 14);
			},
			function() 
			{
				startTheme1( 14);
			}
		);

		$("#landing_toptheme2_2 img").hide( 0);
		$("#landing_toptheme2_3 img").hide( 0);
		$("#landing_toptheme2_4 img").hide( 0);
		$("#landing_toptheme2_5 img").hide( 0);
		$("#landing_toptheme2_6 img").hide( 0);
		$("#landing_toptheme2_7 img").hide( 0);
		$("#landing_toptheme2_8 img").hide( 0);
		
		$("#landing_toptheme_text2_" + actTopThemeImage2 + " div").css( "background-color", "#2195AC");
		$("#landing_toptheme_text2_" + actTopThemeImage2 + " a").css( "color", "#fff");
		
		topThemeTimer2 = setTimeout( "next_topTheme2()", topThemeTime2);
		
		$('#landing_toptheme_text2_1').hover(
			function() 
			{
				stopTheme2( 1);
			},
			function() 
			{
				startTheme2( 1);
			}
		);
		
		$('#landing_toptheme_text2_2').hover(
			function() 
			{
				stopTheme2( 2);
			},
			function() 
			{
				startTheme2( 2);
			}
		);
		
		$('#landing_toptheme_text2_3').hover(
			function() 
			{
				stopTheme2( 3);
			},
			function() 
			{
				startTheme2( 3);
			}
		);
		
		$('#landing_toptheme_text2_4').hover(
			function() 
			{
				stopTheme2( 4);
			},
			function() 
			{
				startTheme2( 4);
			}
		);
		
		$('#landing_toptheme_text2_5').hover(
			function() 
			{
				stopTheme2( 5);
			},
			function() 
			{
				startTheme2( 5);
			}
		);
		
		$('#landing_toptheme_text2_6').hover(
			function() 
			{
				stopTheme2( 6);
			},
			function() 
			{
				startTheme2( 6);
			}
		);
		
		$('#landing_toptheme_text2_7').hover(
			function() 
			{
				stopTheme2( 7);
			},
			function() 
			{
				startTheme2( 7);
			}
		);
		
		$('#landing_toptheme_text2_8').hover(
			function() 
			{
				stopTheme2( 8);
			},
			function() 
			{
				startTheme2( 8);
			}
		);

	}
);

function stopTeaser( nr)
{
	if ( actTeaserImage != nr)
	{
		$("#landing_top_right" + actTeaserImage + "sw").show( 0);
		$("#landing_top_right" + actTeaserImage + "f").hide( 0);
		$("#landing_top_right" + nr + "sw").hide( 0);
		$("#landing_top_right" + nr + "f").show( 0);
		
		$("#landing_top" + actTeaserImage + " img").hide( 0);
		$("#landing_top" + nr + " img").show( 0);
	}
	
	if ( topTeaserTimer)
	{
		clearTimeout( topTeaserTimer);
	}
}

function startTeaser( nr)
{
	if ( actTeaserImage != nr)
	{
		$("#landing_top_right" + nr + "sw").show( 0);
		$("#landing_top_right" + nr + "f").hide( 0);
		$("#landing_top_right" + actTeaserImage + "sw").hide( 0);
		$("#landing_top_right" + actTeaserImage + "f").show( 0);
		
		$("#landing_top" + actTeaserImage + " img").show( 0);
		$("#landing_top" + nr + " img").hide( 0);
	}
	
	topTeaserTimer = setTimeout( "next_topTeaser()", topTeaserTime);
}

function next_image()
{
	$("#landing_teaser_right" + actImage).fadeOut( "slow");
	
	++actImage;
	
	if ( actImage > 6)
	{
		actImage = 1;
	}
	
	$("#landing_teaser_right" + actImage).fadeIn( "slow");

	setTimeout( "next_image()", Time);
}

function next_topTeaser()
{
	$("#landing_top_right" + actTeaserImage + "sw").fadeIn( "slow");
	$("#landing_top_right" + actTeaserImage + "f").fadeOut( "slow");
	$("#landing_top" + actTeaserImage + " img").fadeOut( "slow");
	
	++actTeaserImage;
	
	if ( actTeaserImage > 4)
	{
		actTeaserImage = 1;
	}
	
	$("#landing_top_right" + actTeaserImage + "sw").fadeOut( "slow");
	$("#landing_top_right" + actTeaserImage + "f").fadeIn( "slow");
	$("#landing_top" + actTeaserImage + " img").fadeIn( "slow");

	topTeaserTimer = setTimeout( "next_topTeaser()", topTeaserTime);
}


function next_topTheme1()
{
	$("#landing_toptheme1_" + actTopThemeImage1 + " img").fadeOut( "slow");
	$("#landing_toptheme_text1_" + actTopThemeImage1 + " div").css( "background-color", "#D2E4E6");
	$("#landing_toptheme_text1_" + actTopThemeImage1 + " a").css( "color", "#000");
	
	++actTopThemeImage1;
	
	if ( actTopThemeImage1 > 14)
	{
		actTopThemeImage1 = 1;
	}
	
	$("#landing_toptheme1_" + actTopThemeImage1 + " img").fadeIn( "slow");
	$("#landing_toptheme_text1_" + actTopThemeImage1 + " div").css( "background-color", "#2195AC");
	$("#landing_toptheme_text1_" + actTopThemeImage1 + " a").css( "color", "#fff");

	topThemeTimer1 = setTimeout( "next_topTheme1()", topThemeTime1);
}


function next_topTheme2()
{
	$("#landing_toptheme2_" + actTopThemeImage2 + " img").fadeOut( "slow");
	$("#landing_toptheme_text2_" + actTopThemeImage2 + " div").css( "background-color", "#D2E4E6");
	$("#landing_toptheme_text2_" + actTopThemeImage2 + " a").css( "color", "#000");
	
	++actTopThemeImage2;
	
	if ( actTopThemeImage2 > 8)
	{
		actTopThemeImage2 = 1;
	}
	
	$("#landing_toptheme2_" + actTopThemeImage2 + " img").fadeIn( "slow");
	$("#landing_toptheme_text2_" + actTopThemeImage2 + " div").css( "background-color", "#2195AC");
	$("#landing_toptheme_text2_" + actTopThemeImage2 + " a").css( "color", "#fff");

	topThemeTimer2 = setTimeout( "next_topTheme2()", topThemeTime2);
}

function stopTheme1( nr)
{
//	if ( actTopThemeImage1 != nr)
	{
		$("#landing_toptheme_text1_" + actTopThemeImage1 + " div").css( "background-color", "#D2E4E6");
		$("#landing_toptheme_text1_" + actTopThemeImage1 + " a").css( "color", "#000");
		
		$("#landing_toptheme_text1_" + nr + " div").css( "background-color", "#2195AC");
		$("#landing_toptheme_text1_" + nr + " a").css( "color", "#fff");
		
		$("#landing_toptheme1_" + actTopThemeImage1 + " img").hide( 0);
		$("#landing_toptheme1_" + nr + " img").show( 0);
	}
	
	if ( topThemeTimer1)
	{
		clearTimeout( topThemeTimer1);
	}
}

function startTheme1( nr)
{
//	if ( actTeaserImage != nr)
	{
		$("#landing_toptheme_text1_" + nr + " div").css( "background-color", "#D2E4E6");
		$("#landing_toptheme_text1_" + nr + " a").css( "color", "#000");
		
		$("#landing_toptheme_text1_" + actTopThemeImage1 + " div").css( "background-color", "#2195AC");
		$("#landing_toptheme_text1_" + actTopThemeImage1 + " a").css( "color", "#fff");
		
		$("#landing_toptheme1_" + actTopThemeImage1 + " img").show( 0);
		$("#landing_toptheme1_" + nr + " img").hide( 0);
	}
	
	topThemeTimer1 = setTimeout( "next_topTheme1()", startTheme1);
}


function stopTheme2( nr)
{
//	if ( actTopThemeImage2 != nr)
	{
		$("#landing_toptheme_text2_" + actTopThemeImage2 + " div").css( "background-color", "#D2E4E6");
		$("#landing_toptheme_text2_" + actTopThemeImage2 + " a").css( "color", "#000");
		
		$("#landing_toptheme_text2_" + nr + " div").css( "background-color", "#2195AC");
		$("#landing_toptheme_text2_" + nr + " a").css( "color", "#fff");
		
		$("#landing_toptheme2_" + actTopThemeImage2 + " img").hide( 0);
		$("#landing_toptheme2_" + nr + " img").show( 0);
	}
	
	if ( topThemeTimer2)
	{
		clearTimeout( topThemeTimer2);
	}
}

function startTheme2( nr)
{
//	if ( actTeaserImage != nr)
	{
		$("#landing_toptheme_text2_" + nr + " div").css( "background-color", "#D2E4E6");
		$("#landing_toptheme_text2_" + nr + " a").css( "color", "#000");
		
		$("#landing_toptheme_text2_" + actTopThemeImage2 + " div").css( "background-color", "#2195AC");
		$("#landing_toptheme_text2_" + actTopThemeImage2 + " a").css( "color", "#fff");
		
		$("#landing_toptheme2_" + actTopThemeImage2 + " img").show( 0);
		$("#landing_toptheme2_" + nr + " img").hide( 0);
	}
	
	topThemeTimer2 = setTimeout( "next_topTheme2()", startTheme2);
}

