$(document).ready(function(){
	
	if(location.hash != "") {
		show_mission(location.hash.replace("#",""));
	}
	
	$('#overlay').click(function() {
			close_mission('#mission');
	});
});

function show_mission(id) {

	var url = base_url + 'task/open/'+id;
	
	$.ajax({
		  url: url,
		  cache: false,
		  success: function(html){
		  	$('#overlay').height($(document).height());
		  	$('#overlay').show();
		  	$('#container').append(html);
		  },
		  error: function(XMLHttpRequest, textStatus, errorThrown) {
			  alert(textStatus + ' : ' + errorThrown)
		  }
	});
	
	
	return false;

}