$(window).load(function(){
	var max_width = 400; 	//max width
	var selector = 'img'; 	
	
	$(selector).each(function(){
		var width = $(this).width();
		var height = $(this).height();
		if (width > max_width) {
			//Set variables	for manipulation
			var ratio = (height / width );
			var new_width = max_width;
			var new_height = (new_width * ratio);
			
			//Shrink the image and add link to full-sized image
			$(this).height(new_height).width(new_width);
			$(this).hover(function(){
				$(this).attr("title", "This image has been scaled down.  Click to view the original image.")
				$(this).css("cursor","pointer");
				});
			$(this).click(function(){
				window.location = $(this).attr("src");
				});
		} 
	} 
	);

});


$(document).ready(function(){

  $(".gradualfader").fadeTo("slow", 0.7); 
  $(".gradualfader").hover(function(){
      $(this).fadeTo("slow", 1.0);
  },function(){
    $(this).fadeTo("slow", 0.7);
  });
  
  $('ul.sf-menu').superfish({ 
			delay:       1000,                            // one second delay on mouseout 
            animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
            speed:       'fast',                          // faster animation speed 
            autoArrows:  false,                           // disable generation of arrow mark-up 
            dropShadows: false                            // disable drop shadows 
        }); 
});


$(function () {
var clantreffen = new Date(2004, 5 - 1 , 19); 
$('.countdown').countdown({since: clantreffen, format: 'YOd',layout: '{yn} <strong>{yl}</strong>  {on} <strong>{ol}</strong> {dn} <strong>{dl}</strong>'});
});

