

var InfoBox = {
	
	nextID: 0,
	
	generateID: function() {
		do {
			this.nextID++;
			x = $('infobox-' + this.nextID);
		} while (x);
		return 'infobox-' + this.nextID;
	},
	
	show: function (parent, title, text) {
		
		var div = document.createElement("div");
		div.className = "infobox";
		div.id = this.generateID();
		
		var a = document.createElement("a");
		a.href = "#";
		a.onclick = function() {
			parent.removeChild(div);
			return false;
		};
		a.innerHTML = "Close";
		
		div.innerHTML = "<strong>" + title + "</strong><br /><br />" + text + "<br /><br />";
		div.appendChild(a);
		parent.appendChild(div);
		
		/*
		setTimeout(function() {
			parent.removeChild(div);
		}, 5000);
		*/
		
	}
	
};


