// jQuery Document Ready Funktion

$(document).ready(function() {
    
    if ($('.contentFoot').height() > 0 ) {
            $('.contentMain').css("padding-bottom", $('.contentFoot').height() + 20 + "px" );
    }
        
    // Fancybox
    
    if (typeof $.fn.fancybox != 'undefined') {
        $("ul.gallery li a, table.products a[rel='gallery'], .contentAside .panoLink, .gallery a[rel='gallery'], .galleryXL a[rel='gallery']").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'	:       600,
		'speedOut'	:       200,
		'centerOnScroll':	true,	
                'titlePosition' :       'over' //ggf auch 'inside'
	});
    }
    
    //Table Tooltips
    
    if ($('table td.price .tooltip').length) {
	
	$('table td.price').hover(function() {
	    $(this).attr('title', '');
	    $(this).find('.tooltip').fadeIn('fast');
	    $(this).addClass('hover');
	}, function(){
	    $(this).find('.tooltip').fadeOut('fast');
	    $(this).removeClass('hover');
	});
    };
    
    // Label über Input positionieren

    function labelOverInput (input, label) {
        
        input.val('');
        label.addClass('overlay');
        
        input.addClass('js');    
        input.focus(function () {
            $(this).prev('label').hide();
        });
        
        input.blur(function () {
            if (input.val()=='') {
                $(this).prev('label').show();
            }
        });   
    }

});

