var tt = new Array();

function CreateTooltip(contextid,header,text)
{

	tt[contextid] = new YAHOO.widget.Panel('panel'+contextid, { width:"320px", visible:false ,modal:true,fixedcenter : true, constraintoviewport:true } );
	tt[contextid].setHeader(header);
	tt[contextid].setBody(text);
	tt[contextid].render(document.body);
	
	
	tt[contextid].showTooltip = function()
	{
		if(this.cfg.getProperty("visible") == false)
		{
			for(i in tt)
			{
				if(tt[i].cfg.getProperty("visible")==true)
				{
					tt[i].cfg.setProperty("visible",false)
				}
			}
			this.cfg.setProperty("visible",true)
		}
		else
		{
			this.cfg.setProperty("visible",false)
		}
	}
	
	
	YAHOO.util.Event.addListener(contextid, "click", tt[contextid].showTooltip, tt[contextid], true);
}        



function CreateTooltip2(contextid,header,text)
{
	var left = YAHOO.util.Dom.getViewportWidth() /2 -160;
	var top =150;
	tt[contextid] = new YAHOO.widget.Panel('panel'+contextid, { xy:[left,top], width:"320px", visible:false,modal:true,fixedcenter : false, constraintoviewport:true ,draggable:false} );
	tt[contextid].render(document.body);
	
	
	tt[contextid].showTooltip = function()
	{
		if(this.cfg.getProperty("visible") == false)
		{
			for(i in tt)
			{
				if(tt[i].cfg.getProperty("visible")==true)
				{
					tt[i].cfg.setProperty("visible",false)
				}
			}
			this.cfg.setProperty("visible",true)
		}
		else
		{
			this.cfg.setProperty("visible",false)
		}
	}
	

	
	YAHOO.util.Event.addListener(contextid, "click", tt[contextid].showTooltip, tt[contextid], true);
}        



function CreateTT(contextid,text)
{
	
	
	tt[contextid] = new YAHOO.widget.Tooltip("tooltip", 
	{  
		context: contextid,
		text: text, 
	    showDelay:500,
		hidedelay:200 
	} );	
	
	
	YAHOO.util.Event.addListener(contextid, "click", tt[contextid].showTooltip, tt[contextid], true);
}        
