$j(window).load(function(){

    //forms
    $j('input[type=text]').addClass('textInput');
    $j('textarea').addClass('textArea');
    $j('input[type=submit]').hover(
            function(){ $j(this).addClass('hovered'); },
            function(){ $j(this).removeClass('hovered'); }
    );
    $j('input[type=button]').hover(
            function(){ $j(this).addClass('hovered'); },
            function(){ $j(this).removeClass('hovered'); }
    );

    //main container height
    //var window_h = $j(window).height();
    //var main_container_h = window_h - $j('#top').height() - $j('#footer').height();
    //$j('#main_content').height(main_container_h-30);

    //$j(window).resize(function(){
    //    window_h = $j(window).height();
    //    main_container_h = window_h - $j('#top').height() - $j('#footer').height();

    //    $j('#main_content').height(main_container_h-30);
    //});

    // hover on intro
    $j('#intro').hover(
            function(){ $j('#enter', this).css('display', 'block'); },
            function(){ $j('#enter', this).css('display', 'none'); });

    //hover on categories
    $j('#categories span').bind('mouseenter', function(){
        $j('a', this).css('display', 'block');
        $j('.bg', this).css('display', 'block');
    });
    $j('#categories span').bind('mouseleave', function(){
        $j('a', this).css('display', 'none');
        $j('.bg', this).css('display', 'none');
    });

    /***
    Simple jQuery Slideshow Script
    Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc.  Please link out to me if you like it :)
    ***/
//    $j(function() {
//        setInterval( "slideSwitch()", 2500 );
//    });

    $j('#contactForm input').focus(function(){
        $j(this).addClass('selected');
    });
    $j('#contactForm input').blur(function(){
        $j(this).removeClass('selected');
    });
    $j('#contactForm textarea').focus(function(){
        $j(this).addClass('selected');
    });
    $j('#contactForm textarea').blur(function(){
        $j(this).removeClass('selected');
    });

    $j('.pics ul li img').noContext();
    $j('#about img').noContext();

    // #######################################################################
    //
    //	ustawienia galerii w 'intro'
    //
    // #######################################################################
    $j('#intro .pics').cycle({
        fx: 'fade',
        timeout: 4000,		// czas wyświetlania zdjęć
        speed: 600			// długość przejścia między zdjęciami
    });

    // #######################################################################
    //
    //	ustawienia galerii
    //
    // #######################################################################
    //$j('#gallery').galleria({
    //   transition: 'fade',
    //    transition_speed: 500,	// długość przejścia między zdjęciami
    //    autoplay: false,
    //    thumbnails: true,
    //    carousel: true,
    //    height: 500,
    //    preload: 1,
    //    queue: false,
    //    image_crop: false
    //});
    $j('.galleria-thumbnails .galleria-image img').ready(function(){
        $j(this).noContext();
    });

}); // $j(document).ready() ---END---

