function menuGorne() {
	$('.kwicks').kwicks({
		max: 175,
		duration: 400,
		spacing: 3,
		easing: 'easeOutBounce'
	});
}


function zrobObrazki() {
	$("#tekst img").each(function() {
		$(this).wrap("<div class=\"obrazek\"></div>");
		var szerokosc = $(this).width();
		$(this).parent("div").width(szerokosc);
	});
	$(".obrazek").corner(); 
}


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 animowanyHover(coAnimowac) {
	var klasy = coAnimowac + " li";
	var mnoznik = 1.12;
 
    $(klasy).each(function(){
		$(this).wrapInner("<div></div>");
		$(this).append("<span>&nbsp;</span>");
		var wysokosc = $(this).children("div").height()+8;
		var szerokosc = $(this).parent().width();
		$(this).children("span").width(szerokosc);
		$(this).children("span").height(wysokosc);
		$(this).height(wysokosc);
		
		if (navigator.appName=="Microsoft Internet Explorer") mnoznik = 1.08;
		
		if (! $(this).hasClass("aktywny")) {
			$(this).height(wysokosc*mnoznik);
			$(this).children("span").height(wysokosc*mnoznik);
	        $(this).addClass("animacja");
			$(this).children("span").width(1);
		}
      });

	$(".animacja").hover(function() {
		var szerokosc = $(this).parent().width();
		$(this).children("span").animate({opacity: "show", width: szerokosc}, {"duration": "slow", "easing": "easeOutBounce"});
	}, function() {
		$(this).children("span").animate({opacity: "hide", width: "10px"}, {"duration": 200, "easing": "easeInSine"});
	});
}


$().ready(function(){
	
	$("img.referencja").lightBox();
	$(".galeria a").lightBox();
	
	menuGorne();
	animowanyHover(".aHover");
	//hovering(".menu-gora");
	hovering(".logo-elcl");
	hovering(".logo-edexcel");
	hovering(".logo-elcl-polska");
	hovering(".logo-tellmemore");
});


