var $index = 0;
var $koniec = 0;

$(document).ready(function(){
	/* This code is executed after the DOM has been completely loaded */

	$('article .powrot a, footer a.up').click(function(e){

		// If a link has been clicked, scroll the page to the link's hash target:

		$.scrollTo( this.hash || 0, 1500);
		e.preventDefault();
	});

//  $(function()
//  {
//	  $('.galeria_show').jScrollPane();
//  });


});

function MenuNajazd(NumerPozycji)
{

		 var SelektorDiva = "div.div_menu" + NumerPozycji;

	if (NumerPozycjiPoprzedniej != NumerPozycji) {
		$(SelektorDiva).fadeTo("fast", 0.8);
		$(SelektorDiva).fadeTo("fast", 1);

		NumerPozycjiPoprzedniej = NumerPozycji;
	}
}



function animacjaL()
{
    
//   if (winodw.$koniec != 1)
//   {
   
    $(".galeria_box").animate({"left": "-=13px"},5600, "linear", function () 
    {

//       animacjaL();          
    });
    
    window.$index++;
    
//  }

          
  
}

function animacjaR()
{

  window.$koniec = 1;
      
  if   (window.$index != 0)
  {
    $(".galeria_box").animate({"left": "+=300px"},600, "linear", function () 
    {

                
    });
  
    window.$index--;
  } 
            
  
}


function FaceBShowOn()
{

   if (window.$koniec == 0)
   {
      window.$koniec = 1;            
      $(".facebook").animate({"top": "+=290px"},300, "linear", function () 
      {
        window.$koniec = 2;
                
      });
    }
    
 
  return(true);
}

function FaceBShowOut()
{

   if (window.$koniec == 2)
   {
        window.$koniec = 3;
      
      $(".facebook").animate({"top": "-=290px"},300, "linear", function () 
      {

        window.$koniec = 0;
                        
      });
    }
    
 
  return(true);
}

function check_kontakt(form_we)
{

  go = false;
  blad = false; 
 
// e-mail
  SelektorDiva = "error_email";
  document.getElementById(SelektorDiva).innerHTML=" ";
  if (form_we.email.value.match(/^[0-9a-z_.-]+@([0-9a-z-]+.)+[a-z]{2,6}$/)) 
  { }
  else
  {
    document.getElementById(SelektorDiva).innerHTML="niepoprawny adres e-mail";
    blad = true;
  }
  if(form_we.email.value.length==0)
  {
    document.getElementById(SelektorDiva).innerHTML="pole musi być wypełnione";
    blad = true;
  }

// Obrazek

/*  SelektorDiva = "error_obrazek"; 
  document.getElementById(SelektorDiva).innerHTML= " ";
  if (form_we.obrazek.value.length == 0)
  { 
    document.getElementById(SelektorDiva).innerHTML="Tutaj należy wpisać tekst z obrazka";
    blad = true;
  } */
  
 if (blad != true)
 {
  go=true;
 }

 return(go);
 
}
