
var spy_curr='';var spy_map=[];function url_spy(){var hash=document.location.hash;if(hash!=spy_curr){spy_curr=hash;document.fire("url:change");url_spy_process(document.location.hash.substring(1));}}function url_spy_add(regex,callback){spy_map.push({'regex':regex,'callback':callback});}function url_spy_process(url){$A(spy_map).each(function(i){var reg=new RegExp(i.regex);if(reg.test(url)){var data=reg.exec(url);i.callback(data);}});}document.observe('dom:loaded',function(){setInterval(url_spy,50);});
