$(document).ready(function() {
						   
	var hash = window.location.hash.substr(1);
	var href = $('.blue_button a').each(function(){
		var href = $(this).attr('href');
		if(hash==href.substr(0,href.length-5)){
			var toLoad = hash+'.html #content';
			$('#content').load(toLoad)
		}											
	});

	$('.blue_button a').click(function(){
								  
		var toLoad = $(this).attr('href')+' #content';
		$('#content').hide('fast',loadContent);
		$('#load').remove();
		$('#wrapper').append('<span id="load">LOADING...</span>');
		$('#load').fadeIn('normal');
		window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);
		function loadContent() {
			$('#content').load(toLoad,'',showNewContent())
		}
		function showNewContent() {
			$('#content').show(1000,hideLoader());
		}
		function hideLoader() {
			$('#load').fadeOut('normal');
		}
		return false;
		
	});

/* Office page js */

    $('#change_europe').click(function () {
    	$("#change_europe_content").show("slow");
        $("#change_the_americas_content").hide("slow");
        $("#change_asia_content").hide("slow");
        $("#change_australasia_content").hide("slow");
        $("#change_middle_east_content").hide("slow"); 
		$("#change_africa_content").hide("slow");
    });
    
    $('#change_the_americas').click(function () {
    	$("#change_europe_content").hide("slow");
        $("#change_the_americas_content").show("slow");
        $("#change_asia_content").hide("slow");
        $("#change_australasia_content").hide("slow");
        $("#change_middle_east_content").hide("slow"); 
		$("#change_africa_content").hide("slow");
    });
    
    $('#change_asia').click(function () {
    	$("#change_europe_content").hide("slow");
        $("#change_the_americas_content").hide("slow");
        $("#change_asia_content").show("slow");
        $("#change_australasia_content").hide("slow");
        $("#change_middle_east_content").hide("slow"); 
		$("#change_africa_content").hide("slow");
    });        
    
    $('#change_australasia').click(function () {
    	$("#change_europe_content").hide("slow");
        $("#change_the_americas_content").hide("slow");
        $("#change_asia_content").hide("slow");
        $("#change_australasia_content").show("slow");
        $("#change_middle_east_content").hide("slow"); 
		$("#change_africa_content").hide("slow");
    });
    
    $('#change_middle_east').click(function () {
    	$("#change_europe_content").hide("slow");
        $("#change_the_americas_content").hide("slow");
        $("#change_asia_content").hide("slow");
        $("#change_australasia_content").hide("slow");
        $("#change_middle_east_content").show("slow");
		$("#change_africa_content").hide("slow");
    });  

	$('#change_africa').click(function () {
    	$("#change_europe_content").hide("slow");
        $("#change_the_americas_content").hide("slow");
        $("#change_asia_content").hide("slow");
        $("#change_australasia_content").hide("slow");
        $("#change_middle_east_content").hide("slow"); 
		$("#change_africa_content").show("slow"); 
    });      
        
});

