$(document).ready(function(){
 $('#hire_me').show();
 $('.contact').hide();
 
 $('#hire_me').click(function(){
  $('#hire_me').fadeOut(600);
  $('.contact').slideDown("slow");
 });
 
 $('#input_submit').click(function(e){
  e.preventDefault();
  jmeno=$('#input_jmeno').val();
  email=$('#input_email').val();
  text=$('#input_text').val();
  time=$('#time').val();
  $.ajax({type: "POST",
                   url: "odeslat.php",
                   data: "jmeno="+jmeno+"&email="+email+"&text_zpravy="+text+"&time="+time,
  success: function(html){
   if(html=="NEVYPLNENO")hlasit("Některé z formulářových polí není vyplněno!");
   if(html=="SPAM")hlasit("Zpráva odeslána příliš rychle!");
   if(html=="ERROR")hlasit("Nastala chyba. Zkuste prosím později!");
   if(html=="OK"){
    $('.progress').css("width",'0%');
    $('.status').html('Probíhá odesílání ...');
    $('.contact').slideUp("slow");
    $('.sending').slideDown("slow",function(){$('.progress').animate({"width":"100%"},3000,"linear",function(){
     $('.status').html('Úspěšně odesláno');
     $('.sending').fadeOut(5000,function(){$('#hire_me').fadeIn(200)});
    });});
    
   }
  }
  });
 });
 
 $().piroBox({
			my_speed: 600, //animation speed
			bg_alpha: 0.5, //background opacity
			radius: 4, //caption rounded corner
			scrollImage : false, // true == image follows the page, false == image remains in the same open position
			pirobox_next : 'piro_next', // Nav buttons -> piro_next == inside piroBox , piro_next_out == outside piroBox
			pirobox_prev : 'piro_prev',// Nav buttons -> piro_prev == inside piroBox , piro_prev_out == outside piroBox
			close_all : '.piro_close',// add class .piro_overlay(with comma)if you want overlay click close piroBox
			slideShow : 'slideshow', // just delete slideshow between '' if you don't want it.
			slideSpeed : 4 //slideshow duration in seconds(3 to 6 Recommended)
	});
});

function hlasit(txt){
  $('#hlaska').hide();
  $('#hlaska').html(txt);
  $('#hlaska').show("fast").fadeOut(6000);
}


