jurb = {
	interval : 100,
	location : [],
	onChange : null,
	onLoad : null,
	setLocation : function() {
		this.location=new Array();
		var s=window.location.hash.substr(1);
		if (s.substr(0,1)=='!') {
			s = s.substr(1);
		}
		this.location[0]=s;
		var elements=s.split('/');
		for (i=0;i<elements.length;i++) {
			this.location[i+1] = elements[i];
		}
	},
	checkChanges : function() {
		var s=window.location.hash.substr(1);
		if (s.substr(0,1)=='!') {
			s = s.substr(1);
		}
		if (this.location[0]==undefined || this.location[0]==null) {
			this.setLocation();
			if (this.onLoad!=null) {
				this.onLoad(this.location);
			}
		}
		if (this.location[0]!=s) {
			this.setLocation();
			if (this.onChange!=null) {
				this.onChange(this.location);
			}
		}
	},
	gotoLocation: function(url) {
		window.location.hash = '!'+url;
		this.setLocation();
	},
	getLocation : function() {
		return this.location;
	},
	setHash: function(s){
		window.location.hash = '!'+s;
	}
}
window.setInterval("jurb.checkChanges()",jurb.interval);
