$(function() {

	$.exposeColor = '#fff';
	$.exposeLoadSpeed = 300;
	$.exposeOpacity = 0.8;
		

	$('#tabs li a').click(function(){ return false; });

	$.featureList(
		$("#tabs li a"),
		$("#output li"), {
			start_item: 0
		}
	);
		
	$('.socials img').hover(function(){

		if(!$(this).hasClass('logo')){
	
			clearTimeout($.hover);
			
			var title = $(this).attr('title');
			$('.socials .frame').html(title).fadeIn(300);
			
		}
		
	},
	function(){
	
		if(!$(this).hasClass('logo')){
		
			$.hover = setTimeout(function(){
				$('.socials .frame').fadeOut(300,function(){
					$(this).html('');
				});
			},1000);
		
		}
		
	});
	
	
	$('.socials .frame').hover(function(){
		clearTimeout($.hover);
	},
	function(){
	
			clearTimeout($.hover);
			
			$.hover = setTimeout(function(){
				$('.socials .frame').fadeOut(300,function(){
					$(this).html('');
				});
			},1000);
				
	});	
	
	
	$(window).load(function(){		
		$('.email').attr('href','mailto:' + 'jp' + '@' + 'php-pixel.de').click(function(){ $(this).blur(); });
	});

	

	$.overlay = $("#overlay").overlay({ 
	 	 
	    expose: { 	 
	        color: $.exposeColor, 
	        loadSpeed: $.exposeLoadSpeed, 
	        opacity: $.exposeOpacity
	    }, 
	 
	    closeOnClick: false, 
	 
	    api: true 
	 
	});
	
	$('.impressum').click(function(){
	
		var link = $(this).attr('href');
	
		$.ajax({	
			type: "POST",
			async: false,
			url: link,
			success: function(data){
			
				$('#overlay').html(data).prepend('<div class="close"></div>').find('.impressum_email').html('jp' + '@' + 'php-pixel.de');
				$.overlay.load();
				
			}
		});
		
		return false;
	
	});
	
	$('.modal .close').live('click',function(){
		$.overlay.close();
	});


	// Analytics
	$.getScript('http://www.google-analytics.com/ga.js',function() {
          var pageTracker = _gat._getTracker('UA-16694514-1');
          pageTracker._trackPageview();
    });

});
