$(document).ready(function() {

$("#menu_pasek a img[class='active']").attr('src','gfx/'+$("#menu_pasek a img[class='active']").attr('id')+'a.png');


var szer=$(".abutton img").attr('width');
var wys=$(".abutton img").attr('height');
$(".abutton").css('background-image','url(gfx/'+$(".abutton").attr('id')+'a.gif)').css('height',wys).css('width',szer);
$(".abutton img").css('visibility','hidden');


	$("#menu_pasek a img").mouseover(function(){

	if($(this).attr('class')!='active') $(this).attr('src','gfx/'+$(this).attr('id')+'h.png');

	}).mouseout(function(){

	if($(this).attr('class')=='active') $(this).attr('src','gfx/'+$(this).attr('id')+'a.png');
	else $(this).attr('src','gfx/'+$(this).attr('id')+'.png');

	}).click(function()
	{

	if($(this).attr('class')!='active'){

		//zmieniamy kolor starego przycisku na normlany
		var old=$("#menu_pasek .active").attr('id');
		var t=$(this).attr('id');
	
			$("#"+old).attr('src','gfx/'+old+'.png');
			$("#"+old).attr('class','');

		//aktywujemy kolor nowego przycisku
		$(this).attr('src','gfx/'+t+'a.png'); 
		$(this).attr('class','active'); 

			//znikamy stare linki i pokazujemy nowe
			$("#linki_"+old).fadeOut(500,function(){
			$("#linki_"+t).fadeIn(500);
			});

	}


	});



	$("#menu a").hover(function(){

	var id=$(this).attr('id');
	var szer=$("#"+id+" img").attr('width');
	var wys=$("#"+id+" img").attr('height');

	$(this).css('height',wys).css('width',szer).css('background-image','url(gfx/'+id+'a.gif)');
	
	$("#"+id+" img").fadeOut(500);

	},function(){

	var id=$(this).attr('id');
	$("#"+id+" img").fadeIn(500);
	});

	Czas();

});

function SzybkiKontakt(form)
{
	
  if (form.telefon.value == "") {
    alert("Podaj numer telefonu, na który mamy zadzwonić" );
    form.telefon.focus();
    return false;
  }

return true;
}



function Data(){
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()+1
var months=new Array(13);
months[1]="Styczeń";
months[2]="Luty";
months[3]="Marzec";
months[4]="Kwiecień";
months[5]="Maj";
months[6]="Czerwiec";
months[7]="Lipiec";
months[8]="Sierpień";
months[9]="Wrzesień";
months[10]="Październik";
months[11]="Listopad";
months[12]="Grudzień";
var lmonth=months[month];
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
document.write(" "+daym+" "+lmonth+" "+year)
}

function Czas(){
var Digital=new Date()
 var hours=Digital.getHours()
 var minutes=Digital.getMinutes()
 var seconds=Digital.getSeconds()


 if (minutes<=9)
 minutes="0"+minutes
 if (seconds<=9)
 seconds="0"+seconds

document.getElementById('zegar').innerHTML=hours+":"+minutes+":"+seconds
setTimeout("Czas()",1000)
}

window.onload=Czas



  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-15901804-2']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();


