jQuery(document).ready(function($){
	
	var $mainContent=$('#ajax_box'),
		siteUrl='http://'+top.location.host.toString(),
		url='';
	
	$("#ajax_these").children("ul")
	.delegate('a[href^="'+siteUrl+'"]:not([href*=/wp-admin/]):not([href*=/wp-login.php]):not([href$=/feed/]):not([href*=#])','click',function(){
		location.hash = this.pathname.charAt(0)=='/'? this.pathname : '/'+this.pathname;
		
		return false;
	});
	
	$(window).bind('hashchange',function(){

		url=window.location.hash.substring(1);
		//alert(url);
		if(!url||url.charAt(0)!='/') return;
		url=url+' #content';
		$mainContent.animate({opacity:"0.1"})
			.html('<p>Just a moment..</p>')
			.load(url,function(){
					$mainContent.animate({opacity:"1"});
			});
	});
	
	$(window).trigger('hashchange');


	// top menu hide/show					
	$(".topMenuAction").click(function(){
	
		if( 
	$("#openCloseIdentifier").is(":hidden")){
		//	$("#slider").show(2000);
			$("#slider").animate({marginTop:"-500px"},500);
			$("#topMenuImage").html('<img src="http://artscreen.dk/wp-content/themes/artscreen_v3/images/eject_down.png" />');
			$("#openCloseIdentifier").show();
		}
		else
		{
		//	$("#slider").hide(2000);
			$("#slider").animate({marginTop:"0px"},500);
			$("#topMenuImage").html('<img src="http://artscreen.dk/wp-content/themes/artscreen_v3/images/eject.png" />');
			$("#openCloseIdentifier").hide();
		}
		
	});
	
	
	
	
	
	
	
	
								
});
