function URLProcessor(){
}

URLProcessor.prototype={
	Init: function(layer, handler){		
		this.Handler=handler;
		var _this=this;
		layer.onclick=function(e){
			e = e || window.event;
			target = e.target || e.srcElement; 
			if (target.tagName=="IMG" && target.parentNode)
				target=target.parentNode;
			if (target.tagName!="A"){
				return;
			}			
			href=target.href;	
			p=_this.ProcessURL(href);
			return _this.Handler(href, p);	
		}
	},
	
	ProcessURL: function (href){		
		ind=href.indexOf("#");		
		isAjaxHref=(ind!=-1)&&(ind!=href.length-1);
			
		p=null;
		if (isAjaxHref){
			t=href.substring(ind+2,href.length);
			p=t.split("/");
		}		
		return p;		
	}
}