﻿/**
 * Autor: Paweł Kateusz, kateusz@gmail.com
 * Data utworzenia: 2011-04-28
 * Skrypty na strone kateusz.pl
 */
$(document).ready(function(){

/**
 * Wywołanie jQueryUI
 * Wymaga; jquery-ui.js
 */
$('.button').button();

/**
 * Wywołanie jquery-ui-plugins-by-pk.js
 */
$('.table-ui').jQueryUI_Table();

/**
 * Zaokraglone rogi
 * Wymaga: jquery.corner.js
 */
$(".corner-5").corner("5px");
$(".corner-top-5").corner("top 5px");
$(".corner-right-5").corner("right 5px");
$(".corner-bottom-5").corner("bottom 5px");
$(".corner-left-5").corner("left 5px");
$(".corner-tr-5").corner("tr 5px");
$(".corner-tl-5").corner("tl 5px");
$(".corner-br-5").corner("br 5px");
$(".corner-bl-5").corner("bl 5px");
$("#menu li.first").corner("left 5px");
$("#menu li li.first").uncorner();
$("#menu ul ul").corner("bottom 5px");
$("#menu li li.last").corner("bottom 3px");

/**
 * Ukrywane okienka w stopce
 */
$("#footer-container #copyright").hover(
    function(){
        $(this).addClass("hover");
        $(this).stop(true, true).animate({
            left: '0',
            bottom: '0'
        }, 500 );
    },
    function(){
        $(this).removeClass("hover");
        $(this).stop(true, true).animate({
            left: '-380',
            bottom: '-40'
        }, 500 );
    }
);
$("#footer-container #info").hover(
    function(){
        $(this).addClass("hover");
        $(this).stop(true, true).animate({
            right: '0',
            bottom: '0'
        }, 500 );
    },
    function(){
        $(this).removeClass("hover");
        $(this).stop(true, true).animate({
            right: '-380',
            bottom: '-40'
        }, 500 );
    }
);

/**
 * Animowany powrot na gore strony
 */
$("#back-to-top").click(function(){
    $('html, body').animate({scrollTop: '0px'}, 300)
        .animate({scrollTop: '20px'}, 300)
        .animate({scrollTop: '0px'}, 300);
    return false;
});

/**
 * Zwijane/rozwijane zakladki
 */
$(".element-rozwijany").hide();
$(".element-rozwijany:first").show();
$(".zwinrozwin-element").click(function(){
    $(this).find("+ .element-rozwijany").toggle("slow");
});

/**
 * Animowane menu
 */
$("#menu li").hover(
    function(){
        $(this).addClass("hover");
        $(this).find("ul").stop(true, true).slideDown('slow');
    },
    function(){
        $(this).removeClass("hover");
        $(this).find("ul").stop(true, true).slideUp('fast');
    }
);

/**
 * Tolltipy
 */
$(".sitemap a").tipTip({defaultPosition:"right", delay:0, maxWidth:"300px"});
$("#footer-container a").tipTip({delay:0});

/**
 * Kolorowanie skladni publikowanych fragmentow kodu.
 * Wymaga do dzialania jquery.snippet.min.js (http://www.steamdev.com/snippet/).
 */
//$('pre.syntax_js').snippet("javascript",{style:"berries-dark",transparent:true,showNum:true});
//$('pre.syntax_js').snippet("javascript",{style:"dull",transparent:true,showNum:true});
//$('pre.syntax_js').snippet("javascript",{style:"nedit",transparent:true,showNum:true});
$('pre.syntax_js').snippet("javascript",{style:"peachpuff",transparent:true,showNum:true});

});

