var BusyNotifier = {
	//BusyNotifier.showBusy({});
	//Creates a throbber to show that data is being loaded.
	// 		id as a string for the element you want the notifier displayed on
	//		top  as an int for the offset from top  (defaults to 0px)
	//		left as an int for the offset from left (defaults to 0px)
	color:"#55bb00",
	pulseCount:0,
	busyInterval:null,
	showBusy: function(params){
		var id    = params["id"];
		var top   = params["top"]   ? parseInt(params["top"])  : 0;
		var left  = params["left"]  ? parseInt(params["left"]) : 0;
		var text  = params["text"]  ? params["text"]  : "Loading";
		this.color = params["color"] ? params["color"] : this.color;
				
		document.getElementById(id).innerHTML  = [
			"<div style='position:relative;'>",
			"     <div style='position:absolute;top:" + top + "px;left:" + left + "px;'>",
			"	  <div id='throbber'>",
			"		<div id='busyNot1' style='background-color:" + this.color +  ";width:16px;height:16px;float:left;margin:10px'></div>",
			"		<div id='busyNot2' style='background-color:" + this.color +  ";width:8px;height:8px;float:left;margin:10px'></div>",
			"		<div id='busyNot3' style='background-color:" + this.color +  ";width:8px;height:8px;float:left;margin:10px'></div>",
			"     </div></div>", 
			"     <div style='position:absolute;top:" + (top+30) + "px;left:" + (left+20) + "px;font-weight:bold'>" + text + "</div>",
			"</div>"
		].join("");
		this.pulseCount = 0;
		this.busyInterval = setInterval("BusyNotifier.pulseNodes()", 500);
		
	},
	//BusyNotifer.hideBusy(id);
	//Removes the throbber.
	hideBusy: function(id){
		clearInterval(this.busyInterval);
		document.getElementById(id).innerHTML = "";
	},
	pulseNodes: function(){
		busyNot    = new Array;
		busyNot[1] = document.getElementById("busyNot1");
		busyNot[2] = document.getElementById("busyNot2");
		busyNot[3] = document.getElementById("busyNot3");
		switch(this.pulseCount){
			case 0:
				busyNot[1].style.backgroundColor = this.color;
				busyNot[1].style.width  = "16px";
				busyNot[1].style.height = "16px";
				busyNot[2].style.backgroundColor = this.color;
				busyNot[2].style.width  = "8px";
				busyNot[2].style.height = "8px";
				busyNot[3].style.backgroundColor = this.color;
				busyNot[3].style.width  = "8px";
				busyNot[3].style.height = "8px";
				this.pulseCount += 1;
			break;
			case 1:
				busyNot[2].style.backgroundColor = this.color;
				busyNot[2].style.width  = "16px";
				busyNot[2].style.height = "16px";
				busyNot[3].style.backgroundColor = this.color;
				busyNot[3].style.width  = "8px";
				busyNot[3].style.height = "8px";
				busyNot[1].style.backgroundColor = this.color;
				busyNot[1].style.width  = "8px";
				busyNot[1].style.height = "8px";
				this.pulseCount += 1;
			break;
			case 2:
				busyNot[3].style.backgroundColor = this.color;
				busyNot[3].style.width  = "16px";
				busyNot[3].style.height = "16px";
				busyNot[1].style.backgroundColor = this.color;
				busyNot[1].style.width  = "8px";
				busyNot[1].style.height = "8px";
				busyNot[2].style.backgroundColor = this.color;
				busyNot[2].style.width  = "8px";
				busyNot[2].style.height = "8px";
				this.pulseCount = 0;
			break;
			default:
			break;						
		}

	}
}; 



		