	var xOffset = 10;
	var yOffset = 20;
	
	

function loadFrame(){
       
       $('#frame').attr('rel','Loaded');
       setTimeout("$('#logo').css('background','url(../images/LOGO.png)').css('z-index',10000); $('#loader').fadeOut('slow');",1000);
       
}

	$(function(){
			  
			   
		$("body").append("<div id='tooltip'></div>");
		
		$().mousemove(function(e){
			if($('.pp_overlay').size()<1){
				var top; var left;
				
				left = 0 - e.pageX;
				top =  0 - e.pageY;
				extrat = 0;
			   	extral = 0;
				
			   if($(window).width()>1600){
			   	extral = 741 + (($(window).width() - 1600));
			   }
			   
			   if($(window).height()>1236){
			   	extrat = 618 + (($(window).height() - 1236));
			   }
			  
				
				if(left < extral ){
					$('#frame').css('left',left + extral);
				}
				
				if(top + 1236 > $(window).height()){
					$('#frame').css('top',top + extrat);
				}
			   
			}
		});
		
		$("a[rel^='prettyPhoto']").prettyPhoto({
				animationSpeed: 'normal', /* fast/slow/normal */
				padding: 40, /* padding for each side of the picture */
				opacity: 0.35, /* Value betwee 0 and 1 */
				showTitle: true, /* true/false */
				allowresize: true, /* true/false */
				counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
				theme: 'dark_square', /* light_rounded / dark_rounded / light_square / dark_square */
				callback: function(){}
		});
		
		$("a.tooltip").hover(function(e){
		
			$(this).attr('title','');
				
			$("#tooltip")
				.html($(this).attr('name'))
				.css("top",(e.pageY - xOffset) + "px")
				.css("left",(e.pageX + yOffset) + "px")
				.show();		
		})
		.mousemove(function(e){
			$("#tooltip")
				.html($(this).attr('name'));
		
			if($("#tooltip").size()>0){
				$("#tooltip")
				.css("top",(e.pageY - xOffset) + "px")
				.css("left",(e.pageX + yOffset) + "px");
			}
			
		})
		.mouseout(function(e){
			$("#tooltip").hide(0,function(){$(this).html('');});
		});
		
	});