// JavaScript Document
Cufon.replace('ul#menu li a', {hover: true});
Cufon.replace('.social_item a');
Cufon.replace('h1');
Cufon.replace('h2');
Cufon.replace('h3');


function createPartner(){
	$.get("/it/ajax_partner.php", function(data){
		$('.gallery_container').html(data);
		$("ul.gallery li").hover(function() { //On hover...
	
			var thumbOver = $(this).find("img").attr("src"); //Get image url and assign it to 'thumbOver'
	
			//Set a background image(thumbOver) on the <a> tag - Set position to bottom
			$(this).find("a.thumb").css({'background' : 'url(' + thumbOver + ') no-repeat center bottom'});
	
			//Animate the image to 0 opacity (fade it out)
			$(this).find("span").stop().fadeTo('normal', 0 , function() {
				$(this).hide() //Hide the image after fade
			});
		} , function() { //on hover out...
			//Fade the image to full opacity 
			$(this).find("span").stop().fadeTo('normal', 1).show();
		});

	});
	
	
}
function createPhotoIndex(){
	$.get("/it/ajax_photoindex.php", function(data){
		$('#last_media').html(data);
		$('#last_media a').lightBox({fixedNavigation:true, 
				imageLoading:			'/library/js/jquery-lightbox/images/lightbox-ico-loading.gif',
				imageBtnPrev:			'/library/js/jquery-lightbox/images/lightbox-btn-prev.gif',		
				imageBtnNext:			'/library/js/jquery-lightbox/images/lightbox-btn-next.gif',		
				imageBtnClose:			'/library/js/jquery-lightbox/images/lightbox-btn-close.gif',	
				imageBlank:				'/library/js/jquery-lightbox/images/lightbox-blank.gif'	});

	});
}

function createEventi(){
	$.get("/it/ajax_eventi.php", function(data){
		$('#eventi').html(data);

	});
}

$(document).ready(function(){

    $(document).pngFix(); 
	
	createPhotoIndex();
	createEventi();
});