$(document).ready(function(){


	var wechsel = new Array();
	/////////////////////////
	// Gallery

		//
		var sld = $('#bgImg').cycle({
		    fx:			'scrollHorz',
		    timeout:  	0,
		    random: 	3,
		    easing:  	'backinout',
		    prev:  		'#btnPrev',
		    next:  		'#btnNext'
		});

		$(".galleryItem a img").mouseover(function () {
			//$(this).animate({opacity: 0.2}, 100 );
			$(this).animate({opacity: 0.6}, 90 );
			$(this).attr( 'src', $(this).attr('src').replace("shade=1", "shade=0") );
			$(this).animate({opacity: 1}, 600 );

		});

		$(".galleryItem a img").mouseout(function () {
			if (wechsel[$(this).attr( 'src')] != true) {
				$(this).attr('src', $(this).attr('src').replace("shade=0", "shade=1"));
			}
		});

		$(".galleryItem a img").click(function () {
			$(this).attr( 'src', $(this).attr('src').replace("shade=1", "shade=0") );
			wechsel[$(this).attr( 'src')] = true;
		});




	/////////////////////////
	// Content Ein- & Ausblenden

		// Content Link
		$("#content a.downBtn").click( function () {
			$("#content").animate({marginTop: 497}, 800);
			$("#smallCont").animate({marginTop: 477}, 800);
		});

		// Small to Large Content
		$('#contUp').click( function () {
			$("#content").animate({marginTop: 0}, 800);
			$("#smallCont").animate({marginTop: 507}, 800);
		});


	/////////////////////////
	// Navigation Ein- & Ausblenden
		// Link (unten)
		$("#nav a.downBtn").click( function () {
			$("#nav").animate({marginTop: 402}, 800);
		});

		// Logo
		$("#nav img.logo").click( function () {
			if( $("#nav").css("marginTop") == "0px" ){
				$("#nav").animate({marginTop: 402}, 800);
			}
			else{
				$("#nav").animate({marginTop: 0}, 800);
			}
		});
});

