/**
 * Data loader for JSON Struts Action
 */
var breadCrump = new Class({
	/** 
	 * Constructor
	 * @param psAppUrl root url for application
	 */
	initialize: function(){
		this.url = window.location.href;
		this.els = $$("div.breadcrumb ul");
		
		if(this.els && this.els.length > 0){
			var lsRegexp = "^http://.*/.._../([^/]*)/.*$";
			var loRegExp = new RegExp(lsRegexp,"g");
			this.actionName = loRegExp.exec(this.url);
			if(this.actionName == null){
				lsRegexp = "^http://.*/.._../([^?]*)\?.*$";
				loRegExp = new RegExp(lsRegexp,"g");
				this.actionName = loRegExp.exec(this.url);
				if(this.actionName == null){
					lsRegexp = "^http://.*/.._../(.*)$";
					loRegExp = new RegExp(lsRegexp,"g");
					this.actionName = loRegExp.exec(this.url);
				}
			}
			if(this.actionName != null){ this.actionName = this.actionName[1];}
			this.load();
		}
	},

	load : function(){
		var loParams = new Hash({actionName : this.actionName,
								 actionUri : this.url});
		var loDiv = this.els[0];
		goDataLoader.load("jSonBreadCrump"
							, null
							, loParams
							, function(poResponseJSON, psResponseTEXT){
								if(poResponseJSON){
									var lsData = poResponseJSON["tagCode"];
									loDiv.setProperty("html", lsData);
								}else{
									displayErrorMessage("errorMessage"
											, goLabels.standardErrorMsg + "<div><i>breadcrumb</i></div>"
											, goLabels.standardErrorTitle, 300, 100);
								}
		});
	}
});