var headline_count;
var headline_interval;
var old_headline = 0;
var current_headline = 0;

$(document).ready(function () {
	//Append a div with hover class to all the LI
	//$('#menu li').append('<div class="hover"><\/div>');


	$('#menu li').hover(

		//Mouseover, fadeIn the hidden hover class
		function() {

			$(this).children('div').fadeIn('1000');
                        $(this).children('div.hover_text').children('a').fadeIn('1000');
		},

		//Mouseout, fadeOut the hover class
		function() {

			$(this).children('div').fadeOut('1000');
                        $(this).children('a').children('div.hover_text').fadeOut('1000');

	}).click (function () {

		//Add selected class if user clicked on it
		$(this).addClass('selected');

	});
        $(".link_img").mouseover(function () {
            $(this).css("border-color","#fda01b");
            $(this).stop().animate({"opacity": "1"}, "800");
        }).mouseout(function(){
            $(this).css("border-color","#e7eef6");
            $(this).stop().animate({"opacity": "0.8"}, "800");

        });
        $(".link_img_big").mouseover(function () {
            $(this).css("border-color","#fda01b");
            $(this).stop().animate({"opacity": "1"}, "800");
        }).mouseout(function(){
            $(this).css("border-color","#e7eef6");
            $(this).stop().animate({"opacity": "0.8"}, "800");

        });

  	$(".headline").animate({left: 5, opacity: 1},4000);
        $(".kontakt").animate({opacity: 1},2000);

        $('a').focus(function(){
            this.blur();
        });
});



function przetwarzaj_dane (){
  	var blad=false;
  	var formularz=document.forms[0];
  	var napis="";

  	if (formularz.email.value == ""){
            napis += "- Proszę podać zwrotny ades e-mail\n";
            blad=true;
  	}
  	if (formularz.imie.value == ""){
            napis += "- Proszę podać imię\n";
            blad=true;
  	}
  	if (formularz.message.value == ""){
            napis += "- Proszę wpisać wiadomość\n";
            blad=true;
  	}
  	if(formularz.email.value != "")
  	{
		if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(formularz.email.value))) {
       		napis += "- e-mail nie jest prawidłowy\n";
    		blad=true;
		}
	}
  	if (!blad)
            formularz.submit();
  	else
            alert (napis);
}




var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {
if(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false");










var index = 10;

$(function() {
    $('#galeria a').lightBox();
});

$(document).ready(function () {

	$('#menu ul li a').click (function () {

		//Add selected class if user clicked on it
		$(this).addClass('selected');
	});

        $("#obrazki ul li img").mouseover(function () {
            $(this).stop().animate({"opacity": "1"}, "800");
            $(this).css("z-index",++index);
            $(this).css("width","200px");
            $(this).css("left","-10px");
            $(this).css("top","-10px");
        }).mouseout(function(){
            $(this).stop().animate({"opacity": "0.8"}, "800");
            $(this).css("width","178px");
            $(this).css("left","0px");
            $(this).css("top","0px");
        });
});




