function initialize()
{
    jQuery('#baners').bxSlider({
      alignment: 'horizontal',        // 'horizontal', 'vertical' - direction in which slides will move
      controls: false,                 // determines if default 'next'/'prev' controls are displayed
      speed: 1000,                     // amount of time slide transition lasts (in milliseconds)
      pager: true,                    // determines if a numeric pager is displayed (1 2 3 4...)
      pager_short: false,             // determines if a 'short' numeric pager is displayed (1/4)
      pager_short_separator: ' / ',   // text to be used to separate the short pager
      margin: 0,                      // if 'horizontal', applies a right margin to each slide, if 'vertical' a
                                      // bottom margin is applied. example: margin: 50
      next_text: '>>',              // text to be displayed for the 'next' control
      next_image: '',                 // image to be used for the 'next' control
      prev_text: '<<',              // text to be displayed for the 'prev' control
      prev_image: '',                 // image to be used for the 'prev' control
      auto: true,                    // determines if slides will move automatically
      pause: 5000,                    // time between each slide transition (auto mode only) 
      auto_direction: 'next',         // order in which slides will transition (auto mode only)
      auto_hover: false,               // determines if slideshow will pause while mouse is hovering over slideshow
      auto_controls: false,           // determines if 'start'/'stop' controls are displayed (auto mode only)
      ticker: false,                  // determines if slideshow will behave as a constant ticker
      ticker_controls: false,         // determines if 'start'/'stop' ticker controls are displayed (ticker mode only)
      ticker_direction: 'next',       // order in which slides will transition (ticker mode only)
      ticker_hover: true,             // determines if slideshow will pause while mouse is hovering over slideshow
      stop_text: 'stop',              // text to be displayed for the 'stop' control
      start_text: 'start',            // text to be displayed for the 'start' control
      wrapper_class: 'bxslider_wrap'  // class name to be used for the outer wrapper of the slideshow
    });
    
    jQuery("#baners img").each(function() { jQuery(this).parent().prepend("<h2 class='baner-title'>"+jQuery(this).attr('title')+"</h2>") } );
    jQuery("input.search").focus(function(){jQuery(this).val('')});
    jQuery('input#email').val('twój adres e-mail').css({
        color: '#999'
    }).focus(function()
    {
        if (jQuery(this).val() == "twój adres e-mail") 
            jQuery(this).val('').css({
                color: '#111'
            })
    }).blur(function()
    {
        if (jQuery(this).val() == "") 
            jQuery(this).val('twój adres e-mail').css({
                color: '#999'
            })
    });
    jQuery('#newsletter_regulamin').click(function()
    {
        window.open(jQuery(this).attr('href'), 'Regulamin', 'menubar=no, toolbar=no, location=no, scrollbars=yes, resizable=yes, status=no, width=750, height=650')
        return false;
    });
    
    jQuery("#formularz").validate({
        rules: {
            email: {
                required: true,
                email: true
            },
            zgoda: {
                required: true
            }
        },
        messages: {
            email: {
                email: 'Nieprawidłowy format adresu'
            }
        }
    });
    jQuery('#drawer-close').click(function() {
      jQuery('#drawer').animate({height: 0, opacity: 0});
      return false;
    });
    jQuery('#drawer').css({height: 0}).animate({height: "250px"});
}

jQuery(initialize);

