/* Walidacja formularza */
function form_check()
{
  var komunikat = '';                
  niewysylaj=0;
  $(".wymagane").each(function(){    if((this.value == this.defaultValue) || ($(this).val() == '')) { $(this).addClass('warning'); niewysylaj='1'; }    });
  if(niewysylaj == 1) { komunikat += 'Proszę wypełnić wszystkie pola.'; }
  var wzorMaila = /^[0-9a-z_.-]+@+[0-9a-z.-]+\.[a-z]{2,3}$/i;
  if (wzorMaila.test($(".input_mail").val())) { /* poprawny mail */ } else { if(komunikat != '') { komunikat += ' '; } komunikat += 'Prosze podac poprawny adres e-mail.'; $(".input_mail").addClass('warning'); niewysylaj='1'; }
  if (niewysylaj == '1') { alert(komunikat); return false; } else { return true; }  
}

function prev() { window.history.back() }

  $('.slideshow').cycle({ 
    fx: 'fade', timeout: 4000, speed: 500, height: '430px', cleartype: !$.support.opacity, cleartypeNoBg: true, requeueOnImageNotLoaded: true, fit: 0
  }); 

$(document).ready(function() {

  $(".wymagane").focus(function(){ if(this.value != this.defaultValue){ this.select(); } else { this.value = ''; } });
  $(".wymagane").blur(function(){ if(this.value == ''){ this.value = this.defaultValue;  }   });

  $(".wymagane").focus(function(){ if( $(this).val() == '' ) { $(this).removeClass('warning'); } });

  /*
  $('.galeria a.fancy').fancybox(
    {
    'showNavArrows':'false',
    'titleShow':true,
    'titlePosition':'outside',
    'transitionIn':'fade',
    'transitionOut':'fade',
    'cyclic':'false',
    'overlayColor':'#000000',
    'overlayOpacity':'0.8',
    'scrolling':'no',
    'hideOnOverlayClick':'true'
    }
  );
  */

  
})
