function hovering(klasa) {
	var klasa_z_hoverem = (klasa + "-hover").substr(1,100);
	
    $(klasa).hover(function() {
		$(this).addClass(klasa_z_hoverem);
      }, function() {
        $(this).removeClass(klasa_z_hoverem);
      });
}


function antyspam(domena, nazwa) {
	var domyslnyTekst = "<i>kliknij tutaj, aby zobaczyć adres mailowy</i>";
	$(".adresMailowy").html(domyslnyTekst);
	$(".adresMailowy").click(function() {
		var adres = "<a href='mailto: "+nazwa+"@"+domena+"'>"+nazwa+"@"+domena+"</a>";
		$(this).html(adres);
	});
}


function otworz(url) {
	window.location.href=url;
}

function menu(id) {
	$(id + ' ul li').hover(function(){
		if (! $(this).hasClass("animowany"))
		$(this).find('ul:first').animate({height:'show', opacity:'0.9'}, 100);
		},
		function(){
		$(this).find('ul:first').animate({height:'hide', opacity:'hide'}, 100);
	});
}


/* 
 ----------------------------------
  Tooltips
 ----------------------------------
*/
function tooltips(szerokosc) {
$('.tooltip').bt({
  contentSelector: "$(this).attr('title')",
    fill: 'rgba(255, 255, 255, .8)',
	width: 100,
    cornerRadius: 8,
    strokeWidth: 1,
    shadow: true,
    shadowOffsetX: 3,
    shadowOffsetY: 3,
    shadowBlur: 8,
    shadowColor: 'rgba(0,0,0,.)',
    shadowOverlap: false,
	overlap: -4,
	cssStyles: {'font-size': '10pt', 'text-align': 'center'},
    noShadowOpts: {strokeStyle: '#999', strokeWidth: 2},
    positions: ['left', 'bottom'],
	hoverIntentOpts: {
    interval: 50,
    timeout: 10
  }
});

$('.galeria').bt({
  contentSelector: "$(this).attr('title')",
    fill: 'rgba(255, 255, 255, .8)',
	width: 270,
    cornerRadius: 8,
    strokeWidth: 1,
    shadow: true,
    shadowOffsetX: 3,
    shadowOffsetY: 3,
    shadowBlur: 8,
    shadowColor: 'rgba(0,0,0,.)',
    shadowOverlap: false,
	overlap: -4,
	cssStyles: {'font-size': '10pt', 'text-align': 'center'},
    noShadowOpts: {strokeStyle: '#999', strokeWidth: 2},
    positions: ['left', 'top'],
	hoverIntentOpts: {
    interval: 50,
    timeout: 10
  }
});

}


$().ready(function(){
	tooltips();
	menu("#menu-gorne");
	hovering(".pozycjaMenu");

    $('.partnerzy-clip').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		delay:  7000
	});
	
	$('#galeria a').lightBox({
			fixedNavigation:		true,
			overlayBgColor: 		'#023d69',		// (string) Background color to overlay; inform a hexadecimal value like: #RRGGBB. Where RR, GG, and BB are the hexadecimal values for the red, green, and blue values of the color.
			containerBorderSize:	10,			// (integer) If you adjust the padding in the CSS for the container, #lightbox-container-image-box, you will need to update this value
			containerResizeSpeed:	400,		// (integer) Specify the resize duration of container image. These number are miliseconds. 400 is default.
			txtImage:				'Zdjęcie',	// (string) Specify text "Image"
			txtOf:					'z'
	});
	$('#galeriaPelna a').lightBox({
			fixedNavigation:		true,
			overlayBgColor: 		'#023d69',		// (string) Background color to overlay; inform a hexadecimal value like: #RRGGBB. Where RR, GG, and BB are the hexadecimal values for the red, green, and blue values of the color.
			containerBorderSize:	10,			// (integer) If you adjust the padding in the CSS for the container, #lightbox-container-image-box, you will need to update this value
			containerResizeSpeed:	400,		// (integer) Specify the resize duration of container image. These number are miliseconds. 400 is default.
			txtImage:				'Zdjęcie',	// (string) Specify text "Image"
			txtOf:					'z'
	});
});
