$(document).ready(function(){
	/* This code is executed after the DOM has been completely loaded */
	
	$('.nav a,.footer a.up').click(function(e){
										  
		// If a link has been clicked, scroll the page to the link's hash target:
		
		$.scrollTo( this.hash || 0, 600);
		//alert(this.hash);
		e.preventDefault();
	});
	
	
	var url = window.location;
	var url=String(url);
	var lastPos = url.substring(url.length-2,url.length);
	//alert( url.charAt(lastPos) );
	//alert(lastPos);
	if(lastPos=="up"){
		$.scrollTo( '#1startup' || 0, 600);
	}
	if(lastPos=="al"){
		$.scrollTo( '#1professional' || 0, 600);
	}
	if(lastPos=="ed"){
		$.scrollTo( '#1advanced' || 0, 600);
	}

	// Demo
	
	$('#backToTheTut').hover(function(){
		$(this).stop().animate({'left':-20},'slow');
	},function(){
		$(this).stop().animate({'left':-410},'slow');
	});
	
	setTimeout(function(){$('#backToTheTut').animate({'left':-410},'slow');},2000);

});

function rescroll(id){
//alert("123");
	$.scrollTo( id || 0, 600);

}

