// #lehed
$j().ready(function(){
	setInterval("checkAnchor()", 300);
});
var currentAnchor = null;
function checkAnchor(){
	if(currentAnchor != document.location.hash){
		currentAnchor = document.location.hash;
		if(!currentAnchor)
			query = "section=home";
		else
		{
			//Creates the  string callback. This converts the url URL/#main&id=2 in URL/?section=main&id=2
			var splits = currentAnchor.substring(1).split('&');
			//Get the section
			var section = splits[0];
			delete splits[0];
			//Create the params string
			var params = splits.join('&');
			var query = "section=" + section + params;
		}
		//Send the petition
		$j("#loading").show();
		$j.get("callback.php",query, function(data){
			$j("#content").html(data);
			$j("#loading").hide();
		});
	}
}
