
var name = "#menu-wrap";
var menuYloc = null;

$(document).ready(function(){
	
	menuYloc = parseInt($(name).css("left").substring(0,$(name).css("left").indexOf("px")))
	$(window).scroll(function () { 
		offset = menuYloc+$(document).scrollLeft()+"px";
		$(name).animate({left:offset},{duration:500,queue:false});
	});
	
	$('#menu-wrap a, #footer-menu a, .takemeto').live('click', function() {
		
		var thisObj = this;
		if ($(thisObj).attr('href').charAt(0) == '#') {
			$.scrollTo($(thisObj).attr('href'), 1000, {
				offset: {top:-0},
				onAfter:function(){
				//$($(thisObj).attr('href')).expose({api: true}).load();
				$('.selected').removeClass('selected');
				$($(thisObj).attr('href')+'_bg').addClass('selected');
				//$($(thisObj).attr('href')+'_bg').animate({
				//	opacity: 0.2,
				//	backgroundColor: '#000000'
				//}, 500);
			}});
			return false;
		}
	});
	
});
