$(document).ready(function(){
	//	ROUND ELEMENTS
	DD_roundies.addRule('.rounded_05', '5px', true);
	DD_roundies.addRule('.rounded_10', '10px', true);
	
	$('div.intro.error').slideDown('slow');
	$('div.intro.inserted').slideDown('slow');
	
	
	// ============================
	// = SHOW FOOTER STUFF DINGES =
	// ============================
	$('div#footer').mouseenter(function(){
		$(this).stop().animate({height: 58, marginTop: 0}, 200);
	}).mouseleave(function(){
		$(this).stop().animate({height: 35, marginTop: 23}, 200);
	});
	
	
	// ======================
	// = OPEN URL IN POP-UP =
	// ======================
	$('a.blank').click(function(e){
		e.preventDefault();
		window.open($(this).attr('href'), $(this).attr('title'),'width=970,height=500,scrollbars=yes,toolbar=no,location=no');
	});
	
	
	// ===============================
	// = EYES ON SMILEY FOLLOW MOUSE =
	// ===============================
	$(document).mousemove(function(e){
		var _x = ($(window).width()/2 + (e.pageX - $(window).width()/2)) / $(window).width()/2;
		var _y = ($(window).height()/2 + (e.pageY - $(window).height()/2)) / $(window).height()/2;
		
	    $('#lefteye').css("left", 53 + 10*_x);
		$('#lefteye').css("top", 324 + 15*_y);
		
		$('#righteye').css("left", 92 + 15*_x);
		$('#righteye').css("top", 310 + 25*_y);
	   });
	
	$('#tip1').hover(function(){
		$('#hovertip').css("display", "block");
		$('#hovertip').css("top", 300);
		$('#hovertip').animate({top: 275}, 100, function(){
			$('#hovertip').animate({top: 280}, 30);
		});
	},	function(){		
		$('#hovertip').animate({top: 275}, 30, function(){		
			$('#hovertip').animate({top: 300}, 100, function(){				
				$('#hovertip').css("display", "none");
				});
			});
		});
		$('#tip2, #tip3').hover(function(){
			$('#hovertip2').css("display", "block");
			$('#hovertip2').css("top", 300);
			$('#hovertip2').animate({top: 275}, 100, function(){
				$('#hovertip2').animate({top: 280}, 30);
			});
		},	function(){		
			$('#hovertip2').animate({top: 275}, 30, function(){		
				$('#hovertip2').animate({top: 300}, 100, function(){				
					$('#hovertip2').css("display", "none");
					});
				});
			})
});

// ===============
// = UPLOAD FILE =
// ===============
function updateUploadField(fName){
	$('input.foto').val(fName);
}
