	
	$(document).ready(function() {
		
		$('iframe').hide();
		$('#email').focus();
		
		$("a.youtube-snipped").click(function(){
			$.fancybox({
				'padding'		: 0,
				'autoScale'		: false,
				'transitionIn'	: 'fade',
				'transitionOut'	: 'fade',
				'title'			: this.title,
				'width'			: 640,
				'height'		: 390,
				'overlayShow' 	: true,
				'overlayOpacity': 0.4,
				'overlayColor' 	: '#333',
				'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
				'type'			: 'swf',
				'swf'			: {
									'wmode'				: 'transparent',
									'allowfullscreen'	: 'false',
									'autoplay'			: 'true'
									}
				});
			return false;
		});
		
		$('#shirt').click(function(){
			$('#bg').css({'display':'block','opacity':0}).animate({'opacity':0.4},300,function(){
				$('.shirt_box').attr('src','http://widgets.sellaround.net/widget/#00Tp/web').show();
				$('#close, #bg').click(function(){
					$('.shirt_box').hide();
					$('#bg').fadeOut(400);
				});
			});
		});
		$('#hoody').click(function(){
			$('#bg').css({'display':'block','opacity':0}).animate({'opacity':0.4},300,function(){
				$('.hoody_box').attr('src','http://widgets.sellaround.net/widget/#00Tq/web').show();
				$('#close, #bg').click(function(){
					$('.hoody_box').hide();
					$('#bg').fadeOut(400);
				});
			});
		});
		
		
		$(".im").fancybox({
			'transitionIn'		: 'fade',
			'transitionOut'		: 'fade',
			'width'				: 450,
			'height'			: 390,
			'scrolling'			: 'auto',
			'overlayShow' 		: true,
			'overlayOpacity'	: 0.4,
			'overlayColor' 		: '#333',
			'padding'			: 25,
			'moadl'				: true,
			'autoScale'			: false,
			'autoDimensions'	: false,
			'centerOnScroll'	: true
		});
				
				
		var ticker = function(){
			if($('ul#ticker li').size()<=1) return false;
			setTimeout(function(){
				var weiter = $('#ticker li:first').height()+10;
				$('#ticker li:first').animate( {'margin-top': -weiter+'px'}, 900, function(){
					$(this).detach().appendTo('ul#ticker').removeAttr('style');	
				});
				ticker();
			}, 9000);
		};
		ticker();
		
		$("#ticket").fancybox({
			'transitionIn'		: 'fade',
			'transitionOut'		: 'fade',
			'overlayOpacity'	: 0.4,
			'overlayColor' 		: '#333',
			'width'				: 680,
			'height'			: 420,
			'centerOnScroll'	: true,
			'padding'			: 25,
			'type' 				: 'iframe'
		});
		
		$("#ticker li a").fancybox({
			//'hideOnContentClick': true,
			'transitionIn'		: 'fade',
			'transitionOut'		: 'fade',
			'width'				: 640,
			'overlayShow' 		: true,
			'overlayOpacity'	: 0.4,
			'overlayColor' 		: '#333',
			'padding'			: 25,
			'modal'				: false,
			'autoScale'			: true,
			'autoDimensions'	: true,
			'centerOnScroll'	: true
		});
		
		$("#wood").fancybox({
			//'hideOnContentClick': true,
			'transitionIn'		: 'fade',
			'transitionOut'		: 'fade',
			'width'				: 645,
			'overlayShow' 		: true,
			'overlayOpacity'	: 0.4,
			'overlayColor' 		: '#333',
			'padding'			: 0,
			'modal'				: false,
			'autoScale'			: true,
			'autoDimensions'	: true,
			'centerOnScroll'	: true,
			'cache'				: false
		});
		
		$('#submit').click(function(){
			var email = $('#email').val();
			$.ajax({
				type: "POST",
				url: "inc/mail.inc.php",
				data: 'mail='+email,
				success: function(data){
					$('#error span').stop(true, true).hide().text(data).fadeIn(200).delay(1000).fadeOut(1000);
					if(data=='The email is registered.') { $('#email').val(''); } else { $('#email').focus(); }
			  	}
			});
		});
				
		if(window.location.hash=='#insession1'){
			$("a.nachricht1").trigger('click');
			window.location.hash='';
		}
				
		if(window.location.hash=='#tickets'){
			$("#ticket").trigger('click');
			window.location.hash='';
		}
		
		if($('img#wood-gal')){
			var x = 0;
			var woodshow = function(){
				setTimeout(function(){
					x++;
					if(x==9) x=1;
					$('img#wood-gal').attr('src','img/thumbs/thumb'+x+'.jpg');
					woodshow();
				}, 2000);
			};
			woodshow();
		}
				
		
	});
