$(function(){
	$('.page#about')[0].y = 600;
	$('.page#contact')[0].y = 500;
	$('#nav-map area').click(function(){
		drawer($(this));
	});
})

function drawer(ele) {
	var dest = (ele.hasClass('about')) ? $('.page#about') : $('.page#contact');
	var time = ($('.page.open').length) ? 100 : 250;
	$('.page.info').hide().removeClass('open');
	dest.addClass('open');
	if($.browser.msie) {$('html, body').animate({scrollTop: 0}, 10)};
	$('.page#main').animate({top: dest[0].y+'px'}, time, 'linear',
		function(){
			$('.page-inner', this).click(function(e){
				$('.page.open').fadeOut(100).removeClass('open');
				$('.page#main').animate({top: '0'}, time, 'linear',
					function(){
						$(this).unbind('click');
						$('.page.open').hide();
				});
			});
	});
	setTimeout((function(){
		dest.fadeIn(100);
	}), 100);
}