function checkUrl()
{
	if(window.location.hash[1]=="/")
	{
		window.location.href = window.location.hash.slice(2);
	}
}

/* assign ajax to content links */
function assignAjaxLinksContent()
{
	$("#content a.ajax").click(function() {

		var href = $(this).attr("href");
		var data = href.slice(href.indexOf("?")+1);

		$.ajax({
			method: "get", url: "ajax.php", data: data,
			beforeSend:	function()		{ $("#content").css("opacity",0.25); $("#ajax_loader").show(); },
			success:	function(html)	{ $("#content").html(html); $("#content").css("opacity",1.0); $("#ajax_loader").hide(); window.location.hash = "/"+href; assignAjaxLinksContent(); }
		});

		return false;
	});
}

/* assign ajax to all links */
function assignAjaxLinksAll()
{
	$("a.ajax").click(function() {

		var href = $(this).attr("href");
		var data = href.slice(href.indexOf("?")+1);

		$.ajax({
			method: "get", url: "ajax.php", data: data,
			beforeSend:	function()		{ $("#content").css("opacity",0.25); $("#ajax_loader").show(); },
			success:	function(html)	{ $("#content").html(html); $("#content").css("opacity",1.0); $("#ajax_loader").hide(); window.location.hash = "/"+href; assignAjaxLinksContent(); }
		});

		return false;
	});
}