// JavaScript Document
   

var map = null;

function mapOn() {
	//alert('map on');
	if(parseInt(map.style.left) < 0){ //Only move the map if it's not in place
		var leftPoint = parseInt(map.style.left);// Get the map's left position
		//Easing effect:
		var nudge = -leftPoint; // Create A Positive number out of the left position
		var ease = (nudge/8);// Divide that number by 8
		var easing = Math.round(ease);// Round it off
  		map.style.left = leftPoint+easing+1+'px';// Add it to the current left point and make that the new left point of the map
  		setTimeout(mapOn,25); // recall the animation in 10msec
	}else{
		map.style.left = '0px';
	}	
}

function mapOff() {
	//alert('map off');
	if(parseInt(map.style.left) > -600){
		
		var leftPoint = parseInt(map.style.left);
		if (leftPoint < 0){
		var nudge = -leftPoint;
		}else{
		var nudge = leftPoint + 1;
		}
		var ease = (nudge+(nudge/2));
		var easing=Math.round(ease);
		map.style.left = 0-easing+'px';
		setTimeout(mapOff,25); // recall the animation in 10msec
	}else{
		 map.style.left = '-600px';
	}
}

function init() {
  map = document.getElementById('largeMap');
  map.style.left = '-600px';
}


window.onload = init;
   
   