var currentBlk = '';
function init_namae() {
	$('#logo_galeria').cycle({ 
	    fx:     'fade', 
	    speed:   20000, 
	    timeout: 2500, 
	    next:   '#logo_galeria', 
	    pause:   1
	});
	$('#overview_galeria').cycle({ 
	    fx:     'fade', 
	    speed:   9000, 
	    timeout: 10500, 
	    next:   '#overview_galeria', 
	    pause:   1
	});

	$('#corporateidentity').find('div.current').stop().animate({opacity: "1"}, 0).animate({backgroundPosition: '0px 0px'}, 500);
	$('#corporateidentity').find('.opener').addClass('current');
	// currentBlk = 'corporateidentity';
	currentBlk = 'studio';

	$('#studio, #references, #corporateidentity, #projects, #linksmates, #imprint').hover(
		function() {
			$(this).find('div.opener').stop().animate({opacity: "0.3"}, 0).animate({backgroundPosition: '0px 0px'}, 5000);
			$(this).find('div.current').stop().animate({opacity: "1"}, 0);
		},
		function () {
			$(this).find('div.opener').stop().animate({opacity: "0.2"}, 0).animate({backgroundPosition: '-832px 0px'}, 500);
			$(this).find('div.current').stop().animate({opacity: "1"}, 0);
		});
	$('#studio, #references, #corporateidentity, #projects, #linksmates, #imprint').click(
		function(event) {
			if(currentBlk != '' && currentBlk != this.id)
			{
				$('#'+currentBlk).find('div.additional').hide('slow');
				$('#'+currentBlk).find('.opener').animate({opacity: "0.3"}, 0).animate({backgroundPosition: '-832px 0px'}, 500).removeClass('current');
			}
			$(this).find('div.additional').toggle('slow');
			$(this).find('.opener').addClass('current');
			$(this).find('div.current').stop().animate({opacity: "1"}, 0).animate({backgroundPosition: '0px 0px'}, 500);
			currentBlk = this.id; 
			$(this).blur();
			
			return true;
		});
	$('#studio a, #references a, #corporateidentity a, #projects a, #linksmates a, #imprint a').click(
		function(event) {
			event.stopPropagation();			
		});
		
	// setInterval(function() {
	//      	$('#logo_right_animation_layer')
	// 		.animate({backgroundPosition: "3px -10px"}, 10000)
	// 		.animate({backgroundPosition: "5px 0px"}, 10000)
	// 		.animate({backgroundPosition: "-2px -12px"}, 10000)
	// 		.animate({backgroundPosition: "5px -5px"}, 10000)
	// 		.animate({backgroundPosition: "-5px -3px"}, 10000)
	// 		.animate({backgroundPosition: "0px -23px"}, 10000)
	// 		.animate({backgroundPosition: "0px 0px"}, 10000);
	// 		$('#logo_left_animation_layer1')
	// 		.animate({backgroundPosition: "5px -5px"}, 10000)
	// 		.animate({backgroundPosition: "-5px -10px"}, 10000)
	// 		.animate({backgroundPosition: "3px -5px"}, 10000)
	// 		.animate({backgroundPosition: "-2px -7px"}, 10000)
	// 		.animate({backgroundPosition: "5px -3px"}, 10000)
	// 		.animate({backgroundPosition: "0px 0px"}, 10000);
	// }, 60000);
	
	// $('#logo_right_animation_layer')
	// .animate({backgroundPosition: "3px -10px"}, 10000)
	// .animate({backgroundPosition: "5px 0px"}, 10000)
	// .animate({backgroundPosition: "-2px -12px"}, 10000)
	// .animate({backgroundPosition: "5px -5px"}, 10000)
	// .animate({backgroundPosition: "-5px -3px"}, 10000)
	// .animate({backgroundPosition: "0px -23px"}, 10000)
	// .animate({backgroundPosition: "0px 0px"}, 10000);
	$('#logo_left_animation_layer1')
	.animate({opacity: "0.4"}, 0)
	.animate({opacity: "1"}, 10000)
	.animate({opacity: "0"}, 17000)
	.animate({backgroundPosition: "5px -5px"}, 0)
	.animate({opacity: "1"}, 17000)
	.animate({opacity: "0"}, 17000)
	.animate({backgroundPosition: "-5px -10px"}, 0)
	.animate({opacity: "1"}, 17000)
	.animate({opacity: "0"}, 17000)
	.animate({backgroundPosition: "3px -5px"}, 0)
	.animate({opacity: "1"}, 17000)
	.animate({opacity: "0"}, 17000)
	.animate({backgroundPosition: "-2px -7px"}, 0)
	.animate({opacity: "1"}, 17000)
	.animate({opacity: "0"}, 17000)
	.animate({backgroundPosition: "5px -3px"}, 0)
	.animate({opacity: "1"}, 17000)
	.animate({opacity: "0"}, 17000)
	.animate({backgroundPosition: "0px 0px"}, 0)
	.animate({opacity: "1"}, 17000);
	
	$('#logo_left_animation_layer2')
	.animate({opacity: "0"}, 0)
	.animate({opacity: "0"}, 10000)
	.animate({backgroundPosition: "3px -5px"}, 0)
	.animate({opacity: "1"}, 17000)
	.animate({opacity: "0"}, 17000)
	.animate({backgroundPosition: "5px -3px"}, 0)
	.animate({opacity: "1"}, 17000)
	.animate({opacity: "0"}, 17000)
	.animate({backgroundPosition: "-2px -7px"}, 0)
	.animate({opacity: "1"}, 17000)
	.animate({opacity: "0"}, 17000)
	.animate({backgroundPosition: "5px -3px"}, 0)
	.animate({opacity: "1"}, 17000)
	.animate({opacity: "0"}, 17000)
	.animate({backgroundPosition: "5px -3px"}, 0)
	.animate({opacity: "1"}, 17000)
	.animate({opacity: "0"}, 17000)
	.animate({backgroundPosition: "-2px -7px"}, 0)
	.animate({opacity: "1"}, 17000)
	.animate({opacity: "0"}, 17000)
	.animate({backgroundPosition: "0px 0px"}, 0);
 	
}
