$(document).ready(function(){
   // Your code here


	
		$('.sponsor:last').css('margin-bottom','0px');

		$('.blog-item.start:last').css('margin-right','0px');

		$('.blog-item.event:last').css('margin-right','0px');
		
		$('h4').addClass('titel');
		$('h4.titel').wrap('<div class="sfondo" />');
		$('h4.big').wrap('<div class="stripes" />');
		$('table').wrap('<p />');
		$('.Kalendar tr:even').css('background-color', '#f5f5f5');
		
		$('#contentWrap').localScroll();

                $('#uberbar').animate({ "opacity": 0 }, 001);
                (function() {
                    $(window).scroll(function() {
                      position = $(window).scrollTop();
                      if(position > 200) {
                                $('#uberbar').css('visibility', 'visible').animate({ "opacity": 1 }, 'fast');	
                      }
                      else if (position < 200){
                                $('#uberbar').css('visibility', 'hidden').animate({ "opacity": 0 }, 'fast');	
                      }
                    });
                })();
                
		//$('.nat_part:last').css('margin','0px 0 20px 10px');
		//$('.aktion_part:last').css('margin-right','0px');
		$('.aktion_part:nth-child(2n)').css('margin-right','0px');
		//$('.aktion_part:last').css('margin-left','10px');
		$('.aktion_part:nth-child(2n)').css('margin-left','10px');

		$('ul, ol').prev('p').css('margin-bottom', '5px');
		$('.portfolio-ul p').css('margin-bottom', '5px');
		$('.portfolio-ul a.btn').css('margin', '0px');
		$('.small_form_feld_last').append('<br/>');
		$('.children').css('z-index','9999');
		
		$("#video_link").click(function() {
		$.fancybox({
				'padding'		: 10,
				'autoScale'		: false,
				'transitionIn'	: 'none',
				'transitionOut'	: 'none',
				'title'			: this.title,
				'width'			: 640,
				'height'		: 386,
				'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
				'type'			: 'swf',
				'swf'			: {
					 'wmode'		: 'transparent',
					'allowfullscreen'	: 'true'
				}
			});
		
		return false;
		});


		
		$(".gallery-icon a").each(function(){
			
			var imagine = $(this).find('img').attr('src').replace("-150x150", "");
			//var linkino = $(this).attr('href').replace("-150x150", "");;
			/*alert(imagine);*/
			$(this).attr('href', imagine);
			$(this).attr('rel', 'galleria');

		});



		
		$('.gallery-icon a').fancybox({
			'overlayShow'	: true,
				'transitionIn'	: 'none',
				'transitionOut'	: 'none',
			'overlayColor'		: '#000',
			'overlayOpacity'	: 0.7

	});


 });



