
    var $j = jQuery.noConflict()

    $j(document).ready(function(){

// colorbox - galeria -----------------------
        $j(".cboxElement").colorbox({
            transition: 'elastic',
            speed: '350',
            opacity: '0.9',
            overlayClose: false,
            slideshow: true,
            slideshowSpeed: '2500',
            slideshowAuto: false,
            slideshowStart: 'PLAY',
            slideshowStop: 'STOP',
            previous: '<',
            next: '>',
            maxWidth: '100%',
            maxHeight: '100%',
            current: '{current} z {total}'
        });

//formularz kontaktowy ----------------------

        $j('.contact input[type=text]').each(function(){
            $j(this).after('<input id="'+$j(this).attr('id')+'Hidden" type="Hidden" value="'+$j(this).val()+'"/>');
        });
        $j('.contact textarea').each(function(){
            $j(this).after('<input id="'+$j(this).attr('id')+'Hidden" type="Hidden" value="'+$j(this).val()+'"/>');
        });
        $j('.contact input[type=text]').click(function(){
            delContactVal(this);
        });
        $j('.contact textarea').click(function(){
            delContactVal(this);
        });
        $j('.contact input[type=text]').blur(function(){
            reContactVal(this);
        });
        $j('.contact textarea').blur(function(){
            reContactVal(this);
        });

        function delContactVal(obj){
                 try {
                     if ($j(obj).val() == $j('#' + $j(obj).attr('id') + 'Hidden').val()) {
                         $j(obj).val('');
                     }
                 }
                 catch (e) {
                 }

            }

            function reContactVal(obj){
                 try {
                     if ($j(obj).val() == '') {
                         $j(obj).val($j('#' + $j(obj).attr('id') + 'Hidden').val());
                     }
                 }
                 catch (e) {
                 }
            }

//paginator ----------------------------------------
//		jQuery(function(){
//			jQuery(".articles_list li").quickpaginate({ perpage: 2, showcounter: true, pager : jQuery("#paginator") });
//		});

        jQuery(function(){
            jQuery("#gallery li").quickpaginate({ perpage: 18, showcounter: true, pager : jQuery("#paginator") });
        });

// main menu ---------------------------------------------

        $j('.main_menu li a').click(function(){

            $j(this).addClass('selected');
        });

        $j(function(){
            $j('.scroll-pane').jScrollPane();
        });
    });

    $j(window).load(function(){

        $j("a").attr({onfocus: "blur()"});
        $j("div").attr({onfocus: "blur()"});

        $j('.internal').attr({rel: "images"});

        $j(".internal").colorbox({
            transition: 'elastic',
            speed: '350',
            opacity: '0.9',
            overlayClose: false,
            slideshow: true,
            slideshowSpeed: '2500',
            slideshowAuto: false,
            slideshowStart: 'PLAY',
            slideshowStop: 'STOP',
            previous: '<',
            next: '>',
            maxWidth: '100%',
            maxHeight: '100%',
            current: '{current} z {total}'
        });

//zdjecie do intro w artykule ---------------------------

        $j('.intro_img img').each(function(){
                $j(this).css('width', 160);
        });


});
