﻿
function Vehix_InfoBox()
{
	this.elms = new Object();
	this.placement = new Object();
	this.add=function(key,id)
		{
			this.elms[key]=id;
		};
	this.show=function(placementKey,infoKey)
		{
			if (this.placement[placementKey] && this.elms[infoKey])
			{				
				var container=$get(this.placement[placementKey].container);
				var info=$get(this.placement[placementKey].output);
				var source=$get(this.elms[infoKey]);
				if (container && info && source)
				{
					info.innerHTML = source.innerHTML;
					container.style.display='block';
				}
			}			
		};
	this.hide=function(placementKey)
		{
			if (this.placement[placementKey])
			{				
				var container=$get(this.placement[placementKey].container);
				if (container)
				{
					container.style.display='none';
				}
			}			
		};
	this.addInfoBox=function(placementKey,containerId,outputId)
		{
			if (placementKey && containerId && outputId)
			{
				this.placement[placementKey] = {container:containerId,output:outputId};
			}
		};
}
var Vehix_InfoBox=new Vehix_InfoBox();
