/**
 *  SLIDE SHOW
 *
 **/

   var ss_time = 5000;

  function ss() {

    var $active = jQuery('#slideshow IMG.active');
    if ( $active.length == 0 ) $active = jQuery('#slideshow IMG:last');

    var $next =  $active.next().length ? $active.next()
    : jQuery('#slideshow IMG:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 2000,
          function() {
            $active.removeClass('active last-active');
        });
  }

  function ss_start(interval) {
    ss_handler = setInterval( "ss()", interval );
  }

  function ss_stop() {
    clearInterval( ss_handler );
  }

  function init_ss() {
    ss_start(ss_time);
  }


/**
 *    F O R M
 **/
function formFocus(w) {

    //nastavenie focusu pre input
  	jQuery(w+' :input:not(.submit)').focus(function() {
      if (this.value == this.defaultValue){ this.value = ''; }
      if(this.value != this.defaultValue){ this.select(); }
    });
    jQuery(w+' :input:not(.submit)').blur(function() {
      if (jQuery.trim(this.value) == ''){ this.value = (this.defaultValue ? this.defaultValue : ''); }
    });
}


/**
 *    I N I T
 **/
jQuery.noConflict();
(function($) {

  $(document).ready(function() {

    formFocus("#searchForm");
    init_ss();

  });

})(jQuery);
