﻿ $(document).ready(function() {
  $("#of_slide_close, .lang_nav img, #close, #x_close").mouseover(function(){
   $(this).animate({opacity: 0.8},80);
  }); 
  
  $("#of_slide_close, .lang_nav img, #close, #x_close").mouseout(function(){
   $(this).animate({opacity: 1.0},80);
  }); 
  
  $("#of_slide_close").click(function(){
   $(this).fadeOut(190);
   $(".of_slide").fadeOut(190);
  }); 
  
  
 });
 
 function open_greating()
 {
   $("#send_greating_bg").fadeIn(190);
   $("#send_greating").fadeIn(190);

 }
 
 function hide_greating()
 {
   $("#send_greating_bg").fadeOut(190);
   $("#send_greating").fadeOut(190);
   
 }
 
 
 
 
 function get_width()
  {
   
   var win_width = $(window).width();
   var con_width = $("#con_gal").width();
   var minus = win_width - con_width;
   var minus = parseInt(minus/2);
   //alert(win_width+"-"+con_width+"="+minus);
   $("#con_gal").animate({"marginLeft": minus+"px"},330);
  }
 
 
 function open_gal(source)
 {
  var source = source;
  
  $("#con_gal").fadeIn(320);
  $("#bg_gal").fadeIn(320);
  $("#con_gal").html('<img src="../graf/of_slide_close.png" alt="x" id="close" /><img src="' + source + '" alt="zdjęcie" />');
  

  setTimeout('get_width()', 330);
  
  
  $("#close").click(function(){
   $(this).fadeOut(190);
   $("#con_gal").fadeOut(190);
   $("#bg_gal").fadeOut(190);
  }); 
  
 }

 
 
 
 
 
  function spr_greating_card(f)
 {
  if(f.name.value=='') 
   { 
    alert("Podaj imię i nazwisko (nazwę firmy)");
	return false; 
   }
   
   if(f.email.value=='') 
   { 
    alert("Podaj email");
	return false; 
   }

   if ( ((f.email.value.indexOf('@',1))==-1)||(f.email.value.indexOf('.',1))==-1 )
   {
	alert("Nie prawidłowy format adresu");
	return false; 
   }
   
   if(f.telefon.value=='') 
   { 
    alert("Podaj telefon");
	return false; 
   }
   
   if(f.temat.value=='') 
   { 
    alert("Podaj temat wiadomości");
	return false; 
   }
  
   if(f.tresc.value=='') 
   { 
    alert("Podaj treść wiadomości");
	return false; 
   } else return true;   

}




 function spr_rezerwacja(f)
 {
   if(f.name.value=='') 
   { 
    alert("Podaj imię i nazwisko (nazwę firmy)");
	return false; 
   }
   
   if(f.contact.value=='') 
   { 
    alert("Podaj kontakt");
	return false; 
   }
   
    
   if(f.hotel_2os1.value=='0' & f.hotel_2os.value=='0' & f.hotel_superior.value=='0' & f.hotel_apartment.value=='0') 
   { 
    alert("Wybierz pokój");
	return false; 
   }

   
   
   
    
   if( $("#sposobplatnossssci input:checked").length < 1) 
   {  
   
    alert("Wybierz płatność");
	return false;
   }
   
   
   
   if( $("#sposob_potwierdzenia input:checked").length < 1)
   {   
   
    alert("Wybierz sposób potwierdzenia");
	return false; 
   }
   
   
   
   if(f.confirmation_email.value=='' & f.confirmation_phone.value=='' & f.confirmation_fax.value=='')
   {
		alert("Podaj sposób potwierdzenia");
		return false; 
   }
   
    
   if(f.get_in.value=='') 
   { 
    alert("Podaj datę przyjazdu");
	return false; 
   }
   
    
   if(f.get_out.value=='') 
   { 
    alert("Podaj datę odjazdu");
	return false; 
   } else return true;
   
      
   
 }

 
 
 function spr_rezerwacja_restauracja(f)
 {
    if(f.name.value=='') 
   { 
    alert("Podaj imię i nazwisko (nazwę firmy)");
	return false; 
   }
   
   if(f.contact.value=='') 
   { 
    alert("Podaj kontakt");
	return false; 
   }
   
    
    
   if(f.get_in.value=='') 
   { 
    alert("Podaj datę przyjazdu");
	return false; 
   }
   
    
   
   if( $("#sposob_potwierdzenia input:checked").length < 1)
   {   
   
    alert("Wybierz sposób potwierdzenia");
	return false; 
   }
   
   
   
   if(f.confirmation_email.value=='' & f.confirmation_phone.value=='' & f.confirmation_fax.value=='')
   {
		alert("Podaj sposób potwierdzenia");
		return false; 
   }
   
   
 }
