$(document).ready(function() {
	
	var $arrow = $('#arrow');
	var currentId = '#' + $('body').attr('id') + '_link';
	var xCordCurrent = $(currentId).offset().left - ($arrow.width() / 2) + ($(currentId).width() / 2) - $('#header .wrapper:eq(0)').offset().left;
	
	$arrow.animate(
	{ left: xCordCurrent }, {
		duration: 'slow',
		easing: 'easeOutBack'
	});
	
	$('#navbar li').hover(function(event) {
			$arrow.stop();
			var xCordHover = $(event.target).offset().left + ($(event.target).width() / 2) - ($arrow.width() / 2) - $('#header .wrapper:eq(0)').offset().left;
			$arrow.animate(
			{ left: xCordHover }, {
				duration: 'slow',
				easing: 'easeOutBack'
			})	
		}, function(event) {
			$arrow.stop();
			$arrow.animate(
			{ left: xCordCurrent }, {
				duration: 'slow',
				easing: 'easeOutBack'
			})
		});
	
});