function openPopup(type)
{
	if(type=='summertime_1')
	{
		var width=520;
		var height=window.screen.availHeight;
		var top=0;
		
		var location='/de/meta/popup';
		var querystring='?imageLocation=/assets/images/sidebar/0906_summertime_1.jpg&pagetitle=Summer Time';
		
		var popup=window.open(location+querystring, 'summertime', 'width='+width+',height='+height+',top='+top+',status=no,scrollbars=yes,resizable=no');
	}
	else if(type=='summertime_2')
	{
		var width=520;
		var height=window.screen.availHeight;
		var top=0;
		
		var location='/de/meta/popup';
		var querystring='?imageLocation=/assets/images/sidebar/0906_summertime_2.jpg&pagetitle=Summer Time';
		
		var popup=window.open(location+querystring, 'summertime', 'width='+width+',height='+height+',top='+top+',status=no,scrollbars=yes,resizable=no');
	}
}

$(document).ready(function() {
	
	// HTML: Sidebar: Banner-Klick
	$('div.sidebar div.summer-time h4').append('<a href="javascript:openPopup(\'summertime\');"></a>')
	
	// Lightbox Initialisierung
	if(lang=='de') { var txtImageString='Bild'; var txtOfString='von'; }
	else { txtImageString='Image'; txtOfString='of'; }
	$('a[rel*=lightbox]').lightBox({
		fixedNavigation: true,
		overlayBgColor: '#000',
		overlayOpacity: 0.8,
		imageLoading: '/assets/js/jquery-lightbox/images/loading.gif',
		imageBtnClose: '/assets/js/jquery-lightbox/images/closelabel.gif',
		imageBtnPrev: '/assets/js/jquery-lightbox/images/prevlabel.gif',
		imageBtnNext: '/assets/js/jquery-lightbox/images/nextlabel.gif',
		containerResizeSpeed: 350,
		txtImage: txtImageString,
		txtOf: txtOfString,
		currentLocation: currentLocation
	});
	
	
	// jQuery SmoothScroll
	$('a[href*=#]').click(function() {
		
		// duration in ms
		var duration=1500;
		
		// easing values: swing | linear
		var easing='swing';

		// make sure it's the same location		
		if(location.pathname.replace(/^\//,'')==this.pathname.replace(/^\//,'') && location.hostname==this.hostname && this.hash.replace(/#/,''))
		{
			// get parameters
			var hash=this.hash;
			var target=$(hash).offset().top;

			// animate to target and set the hash to the window.location after the animation
			$("html:not(:animated),body:not(:animated)").animate({ scrollTop: target }, duration, easing, function() { location.hash=hash; });

			// cancel default click action
			return false;
		}

	});

});