function inserter()
{
	var newHash = "do=" + window.location.hash.substring(1) + '&ajax=true';
	
	var ret = jQuery.ajax({
	  type: 'GET',
	  url: 'x.php',
	  data: newHash,
	  contentType: 'application/json; charset=utf-8',
	  async: false,
	  processData: false,
	  cache: false,
	  dataType: 'json'
	 });
	
	obj = eval('('+ret.responseText+')');
	
	jQuery.each(obj,function(id,val){
		
		jQuery("#" + id).fadeOut(100,function(){
			jQuery("#" + id).html(val);
		});
		
		jQuery("#" + id).fadeIn(1000);
	
	});
	
	// after load
	$(".linker").removeClass("selected");
	$("a[href=?do="+window.location.hash.substring(1)+"]").addClass("selected");	
}

$(function(){

	

	//Opera quick fix (border-left not showing)

	if($.browser.opera){ $("#pdf").css({ "display" : "inline-block" , "padding-right" : "140px" }); }	
	
	
	/* DYNAMIC PAGE LOAD */
	
	// prevent default event
	$("body").delegate(".linker","click",function(){
		window.location.hash = jQuery(this).attr("href").substring(4);
		return false;
		});
		
	// click
	$(window).bind("hashchange",function(){
		inserter();
	});
	
	// refresh
	if(window.location.hash!="")
	{
		inserter();
	}


})
