;$(document).ready(function()
{
    $('a[href=#top]').click(function(){
        $('html, body').animate({scrollTop:0}, 'slow');
        return false;
    });
    $(":submit,a").focus(function(){$(this).blur()});
    $('.onload-focus').focus();

    $("input.default-title").each(function(){
        $(this).defaultValue($(this).attr('title'));
    });
    
    $('.mail').each(function(){
        text = $(this).text().replace(/ \(a\) /g, '@').replace(/ \(?(tecka|\.)\)? /g, '.');
        $(this).replaceWith($('<a href="mailto:'+text+'" title="napsat email">'+text+'</a>'));
    });
    
    $('.featured').prepend($('<ul></ul>').addClass('index'));
    $('.featured .list').cycle({
        activePagerClass:      'active', 
        fx:                    'fade',
        speed:                 'slow', 
        timeout:               5000, 
        pager:                 '.featured .index',
        pagerAnchorBuilder:    function(idx, slide){
            return '<li><a href="javascript:void(0);">' + (idx+1) + '</a></li>';
        },
        updateActivePagerLink: function(pager, idx, activeClass){
            $(pager).find('a').removeClass(activeClass).filter('a:eq('+idx+')').addClass(activeClass);
        },
        pause:  1,
        cleartypeNoBg: true 
    });
    
	$("a.gallery").fancybox({
        'transitionIn'	:	'elastic',
        'transitionOut'	:	'elastic',
        'speedIn'		:	200, 
        'speedOut'		:	200, 
        'overlayShow'	:	true
    });
    
    $('a.show-block').click(function(e){
        e.preventDefault();
        $($(this).attr('href')).slideToggle();
    });
    
    $("#our-clients .box").jCarouselLite({
        btnNext: "#our-clients .left",
        btnPrev: "#our-clients .right",
        auto:3000,
        speed:600,
        visible:4
    });
});

