var base = '/';

if (document.location.hash && document.location.hash.substr(1,1)=='!') {
	document.location=document.location.hash.substr(2);
} else {
	var lsth = '';
	function hashCheck() {
		var thsh = document.location.hash.substr(1);
		if (lsth !== thsh && lsth.substr(0,1)=='!') {lsth = thsh;hashBrowse(lsth.substr(1));}
	}
	setInterval(hashCheck, 100);
}

function hashBrowse(q) {
	h = document.domain;
	if(q.indexOf(h)!=-1)q=q.substr(q.indexOf(h)+h.length);
	if ($(window).scrollTop() > 140) $('html,body').animate({scrollTop: 140}, 500);
	$('#content').load(q+(q.indexOf('?')!=-1?'&':'?')+'ajax', function(s) { 
		document.title = $('#title').text();
		pageTracker._trackPageview(q);
	});
	location.hash = '!'+q;
	lsth = location.hash.substr(1);
}
function hashRefresh() {
	hashBrowse(hashReturn());	
}
function hashReturn() {
	return ((document.location.hash&&document.location.hash.substr(1,1)=='!')?location.hash.substr(2):window.location.pathname);	
}
