// Beat Fly JavaScript core document
/*jquery setting*/
$(document).ready(function(){
							
	//animation
	$('#body-background img, ul#gallery li img').css('opacity',0);
	$('#body-background img, ul#gallery li img').animate({ opacity: 1}, 2000);
	
	//img effect
	$('ul#gallery li img').hover(function() {
		$(this).stop().animate({
			opacity : 0.7
		}, 500);
		},
		function(){
		$(this).stop().animate({
			opacity : 1
		}, 500);
	});
	
	//form focus
	$('#name').focus();
	
	//file type
	$("a[href$=.jpg], a[href$=.png], a[href$=.bmp], a[href$=.gif], a[href$=.jpeg]").attr("target","_blank");
	
	//tooltip
	$('#containerWrap a').addClass('tooltip');
	
	//overlay
	$.ajaxSetup ({
		cache: false
	});
	var ajax_load = "<img src='splash_library/loading.gif' alt='loading...' />";

		//load() functions prima + 1
		var loadUrllink = "photo.php";
		$("a#prima").click(function(e){
			$("#contenitore").html(ajax_load).load(loadUrllink + " #1");
				$('#overlay').fadeIn();
		e.preventDefault();
		});
		
		//load() functions seconda + 2
		var loadUrllink = "photo.php";
		$("a#seconda").click(function(e){
			$("#contenitore").html(ajax_load).load(loadUrllink + " #2");
				$('#overlay').fadeIn();
		e.preventDefault();
		});
		
		//load() functions terza + 3
		var loadUrllink = "photo.php";
		$("a#terza").click(function(e){
			$("#contenitore").html(ajax_load).load(loadUrllink + " #3");
				$('#overlay').fadeIn();
		e.preventDefault();
		});
		
		//load() functions quarta + 4
		var loadUrllink = "photo.php";
		$("a#quarta").click(function(e){
			$("#contenitore").html(ajax_load).load(loadUrllink + " #4");
				$('#overlay').fadeIn();
		e.preventDefault();
		});
			
			//close
			$('a#chiudi').live("click",function(){
				$('#overlay').fadeOut();
			return false;
			});
						
});//end
	
//tooltip
this.tooltip=function(){xOffset=10;yOffset=20;$("a.tooltip").hover(function(e){this.t=this.title;this.title="";$("body").append("<p id='tooltip'>"+this.t+"</p>");$("#tooltip").css("top",(e.pageY-xOffset)+"px").css("left",(e.pageX+yOffset)+"px").fadeIn("fast")},function(){this.title=this.t;$("#tooltip").remove()});$("a.tooltip").mousemove(function(e){$("#tooltip").css("top",(e.pageY-xOffset)+"px").css("left",(e.pageX+yOffset)+"px")})};$(document).ready(function(){tooltip()});
