
/*
 * Cufon
 **/
    Cufon('h2');
    Cufon('h3');
    Cufon('h4');
    Cufon('h5');

/*
 * Superlight
 * hover scroll
 **/

    $(document).ready(function() {

        $('body').supersleight();

        $('body').each(function() {
            //alert($(window).width());
            if($('html').width() < '990') {
                $('html').css('width', '991px');
                $.each($.browser, function(i, val) {
                   if(i=="msie" && $.browser.version.substr(0,3)=="6.0") {
                        $('body').css('width', '987px');
                   }
                 });
            }
        });
		$('#page').each(function() {
            if($(window).height() < '720') {
                $('html').scrollTop(720-$(window).height());
            }
        });

        $('div.scroll-content').hoverscroll({
            vertical: true,
            width: 'auto',
            height: 380,
			debug: 0
        });
        
        $('div.gallery').hoverscroll({
            vertical: true,
            width: 'auto',
            height: 490,
			debug: 0
        });


        $('#kontakt').each(function() {
            $('.send', this).click(function(){
                $('#kontakt').submit();
                return false;
            });

            $('.reset', this).click(function(){
                $('#kontakt input, #kontakt textarea').val('');
                return false;
            });
        });

		if (jQuery('.gallery .thumb').length > 0){
			$("#wrapper .gallery a").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
				    return '<span id="fancybox-title-over">Zdjęcie ' +  (currentIndex + 1) + ' / ' + currentArray.length + '</span>';
				}
			});
		}
	
    });
