$(document).ready(function(){
	var d = new Date(),
		monat = new Array('','','march','april','may','june','jule','august','sept','okt','nov',''),
		aktMon = d.getMonth();
	
	if(monat[aktMon] != ''){
		showBox(monat[aktMon]);
	}

	$('#sitewrapper').itemCarousel({
		'hoverClass':null,
		'viewCount': 1,
		'scrollInterval': 6000,
		'autoScroll': true
	});
});

var closelightbox = function(){
		$('div#overlay').hide();
		$('div#lb').hide();
		$('div#lightboxcontent').empty();
};
var loadContent = function(content){
		
		scrollTo(0,0);
		$('#lightboxcontent').load(content+'.html');

		$('div#overlay').css('height',$(document).height());
		$('div#overlay').show();
		$('div#lb').show();
		
		if($('div#lb').is(':visible')){
			var screenwidth = $(document).width(),
			leftpos = (screenwidth/2)-390;
			$('div#lb').css('left',leftpos);
		}

		if(content=='impressum'){
			$('div#titletext').text('Impressum');		
		}else if(content=='video'){
			$('div#titletext').text('Video');	
		}
		
		
};

 

function showBox(id){
	var page = 'abfahrten_'+id+'.html';
	
	$('div.showcontent').each(function(){
		$(this).hide();
	});
	
	$('div.linkwrapper').each(function(){
		$(this).show();
	});
	
	$.ajax({
		url : page,
		success : function( data ) {
			$('div#'+id).show();
			$('#'+id).html(data);
			$('div#'+id+'link').hide();
		}
	});
}


