

var Hasher = {
	
	currentHash: false,
	hashInterval: false,
	hashIntervalTime: 200,
	
	check: function(){
		if(self.location.hash.substr(1) === this.currentHash) return true;
		this.currentHash = self.location.hash.substr(1);
		//$('debug').set('html', this.currentHash);
		this.process();
	},
	
	process: function(){
		if(!document.imgList){
			document.imgList = new ImgList();
			document.imgList.init();
		}
		document.imgList.clean();
		if(this.currentHash === "")
			$ajax('actions/images.xml.php', false, function(response){ document.imgList.updateXml(response); });
		else{
			var folder = this.currentHash.split("/");
			$ajax('actions/images.xml.php?folder='+folder[0], false, function(response){ document.imgList.updateXml(response); });
		}
	}
};


window.addEvent("load", function(){ Hasher.hashInterval = setInterval(function(){Hasher.check()}, Hasher.hashIntervalTime); });



