	$(document).ready(function() {
	    
	    $('#menuline a').each(
		    function (){
	    		$(this).hover(function() {
	    			clearTimeout(timer);
	    			/*pos = $(this).position();
	    			//pos = $(this).offset();
	    			//console.log(pos);
	    			width = $(this).innerWidth();
	    			newpos=pos['left']+(width/2)-4;
	    			//console.log(width);
	    			$('#arrow').show();
	    			
	    			$('#arrow').animate({"left": newpos+"px"}, { queue:false, duration:300 }, 'easeout');
	    			*/
	    			moveTo($(this));
	    			
				},
				function () {
					timer = setTimeout("moveTo('#menuline div.active a')", 30);
					//moveTo('#menuline div.active a');
					/*pos = $('#menuline div.active a').position();
					width = $('#menuline div.active a').innerWidth();
	    			newpos=pos['left']+(width/2)-4;
	    			$('#arrow').animate({"left": newpos+"px"}, { queue:false, duration:300 }, 'easeout');*/
				});
			});
		
		timer = setTimeout("setArrow()", 200);
			
	});   
	function setArrow(obj) {
		obj = $('#menuline div.active a');
		if (obj.length) {
			pos = $(obj).position();
			width = $(obj).innerWidth();
		    newpos=pos['left']+(width/2)-4;
		    $('#arrow').css('top',  105);
		    $('#arrow').css("left", newpos+"px");
		    $('#arrow').slideDown(100);
		} else {
			$('#arrow').slideUp(300);
		}
	}
	function moveTo(obj) {
		//console.log(obj.length);
		obj = $(obj);
		if (obj.length) {
			
			pos = obj.position();
			width = obj.innerWidth();
		    newpos=pos['left']+(width/2)-4;
		    objArrow = $('#arrow');
		    objArrow.show();
		    objArrow.css('top',  105);
		    objArrow.animate({"left": newpos+"px"}, { queue:false, duration:300}); //
		} else {
			$('#arrow').slideUp(300);
		}
	}
