
$(window).load(function() {
		$("#loader").hide();	
		$('#slideshowHolder').innerfade({
								speed: 'slow',
								timeout: 5000,
								type: 'sequence',
								containerheight: 'auto'
							});
});


$(document).ready(function()
{		

		$('.mod_navigation a').click(function(event) {
											 if(this.rel!="direkt") event.preventDefault();
											 
											  var doref = this.href;
											  $('.mod_navigation').find('.active').removeClass("active");
											  $(this).addClass("active");
											  
											
											jQuery.each(jQuery.browser, function(i) {
        											if($.browser.msie){
														$("#show").hide();
											  			$("#bottomlineloader").show();
														$('.jScrollPaneContainer').hide("fast", function() {
															$('#main').load(doref + ' #main', function() { doresize();
															$('.jScrollPaneContainer').show("fast", function() { 
																														 $("#bottomlineloader").fadeOut(200);
    													  }); 
														});
											 			});
        											} else {
														$("#show").fadeOut("fast");
											  			$("#bottomlineloader").fadeIn(100);
														$('.jScrollPaneContainer').animate({ top: 100, opacity: 0 }, 250, function() {
															$('#main').load(doref + ' #main', function() { doresize();
															$('.jScrollPaneContainer').animate({ top: 0, opacity: 1 }, 500, function() { 
																														 $("#bottomlineloader").fadeOut(200);
    													  }); 
														});
											 			});
													}
    											});
								  
		});
		
		$('#verstecken').click(function() {
		jQuery.each(jQuery.browser, function(i) {
        		if($.browser.msie){
				$('.jScrollPaneContainer').hide();
				} else { 
				$(".jScrollPaneContainer").animate({ top: 100, opacity: 0 },200);
				}
		});
			$("#content #show").fadeIn("middle");
        });
		$('#show').click(function() {
		jQuery.each(jQuery.browser, function(i) {
        		if($.browser.msie){
				$('.jScrollPaneContainer').show();
				} else { 
				$(".jScrollPaneContainer").animate({ top: 0, opacity: 1 },450);
				}
		});
			$("#show").fadeOut("fast");
        });
		
		
		$('body').pngFix( );	
		jQuery("#images").EmbedPicasaGallery('skischuletux3000',{ });
});

$(window).resize(function() {
			doresize();
});

function starthide() {
	$('#show').show();
		doresize();
		jQuery.each(jQuery.browser, function(i) {
        		if($.browser.msie){
					$('.jScrollPaneContainer').fadeOut();
				} else { 
					$(".jScrollPaneContainer").animate({ top: 100, opacity: 0 },50);
				}
		});

}

function nobgnologoleft() {
	$("#logoleft").hide();
	$("#text").css({"background":"none"});
}

function doresize() {

			var wh = $(window).height();
			var ww = $(window).width();
			
			if(wh<600) { 
			wh = 600; 
			}
			if(ww<1000) { ww = 1000; }
	
			
			$("#content .inner").height(wh - 180);		
			$(".jScrollPaneContainer").height(wh-180);
			$("#content").height(wh-180);
			
			$("#supersizethumbnails").css({"margin-top": wh - 240});
			$("#bottomline").width(ww);
			$("#supersizethumbnails").width(ww-20);
			
			if($(window).width()>1200) {$("#footer .inner").width(1010); }
			if($(window).width()<900) {$("#footer .inner").width(900); }
			var domiddle = ($("#content").height() - $("#main").height()) - 60;
			if(domiddle<41) { domiddle = 0; }
			
			$("#text").css({"margin-top": domiddle});
			
			var doleft = ($(window).width() - $("#content .inner").width() ) / 2;
			if(doleft<5) { doleft = 5; }
			$("#anzeigen").css({"margin-left": doleft + 20});
			
			if($(window).height()<600) { 
			wh = 600; 
			$("#content .inner").height(380); 
			$("#text").height(380); 
			$(".jScrollPaneContainer").height(400); 
			$("#content").height(400);  
			$("body").css({"overflow":"auto", "overflow-x": "scroll"});
			} else { $("body").css({"overflow-x": "hidden"}); }
			
			if($(window).width()<1000) { ww = 1000;  $("body").css({"overflow-y": "scroll"}); } else { $("body").css({"overflow":"auto", "overflow-y": "hidden"}); $("#navigation").width(1010); }
			$("#verstecken").width($("#content #text").width()+70);
			$("#show").width($("#content #text").width()+70);
			$("#show").css({"margin-top": $('#content').height()-20});
			$("#images a").slimbox({/* Put custom options here */}, null, function(el) {
			return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
			});
			$("a[rel='lightbox']").colorbox();
			$(".inlinehtml a[rel='lightbox']").colorbox({iframe:true, innerWidth:625, innerHeight:590});
			$('#text').jScrollPane(
								   {
									   reinitialiseOnImageLoad: true
								   }
			);	
}



/**
* Fullscreenr - lightweight full screen background jquery plugin
* By Jan Schneiders
* Version 1.0
* www.nanotux.com
**/
(function($){	
	$.fn.fullscreenr = function(options) {
		if(options.height === undefined) alert('Please supply the background image height, default values will now be used. These may be very inaccurate.');
		if(options.width === undefined) alert('Please supply the background image width, default values will now be used. These may be very inaccurate.');
		if(options.bgID === undefined) alert('Please supply the background image ID, default #bgimg will now be used.');
		var defaults = { width: 1280,  height: 1024, bgID: 'bgimg' };
		var options = $.extend({}, defaults, options); 
		$(document).ready(function() { $(options.bgID).fullscreenrResizer(options);	});
		$(window).bind("resize", function() { $(options.bgID).fullscreenrResizer(options); });		
		return this; 		
	};	
	$.fn.fullscreenrResizer = function(options) {
		// Set bg size
		var ratio = options.height / options.width;	
		// Get browser window size
		var browserwidth = $(window).width();
		var browserheight = $(window).height();
		// Scale the image
		if ((browserheight/browserwidth) > ratio){
		    $(this).height(browserheight);
		    $(this).width(browserheight / ratio);
		} else {
		    $(this).width(browserwidth);
		    $(this).height(browserwidth * ratio);
		}
		// Center the image
		$(this).css('left', 0);
		$(this).css('top', 0);
		return this; 		
	};
})(jQuery);


var FullscreenrOptions = {  width: 1024, height: 683, bgID: '.sliderimg' };
jQuery.fn.fullscreenr(FullscreenrOptions);


/* PICASA */
