function createTipDiv()
{
	tipDiv = document.createElement("div");
	tipDiv.id = "tipDiv";
	document.body.appendChild(tipDiv);
	
	tipDivInner = document.createElement("div");
	tipDivInner.id = "tipDivInner";
	tipDiv.appendChild(tipDivInner);
	
	tipIframe = document.createElement("iframe");
	tipIframe.id = "tipIframe";
	document.body.appendChild(tipIframe);
}

function showTips(myField)
{
	if (!document.getElementById("tipDiv")) {createTipDiv();}
	myField.parentNode.getElementsByClassName = getElementsByClassName;
	if (myField.parentNode.getElementsByClassName("tip")[0])
	{
		myField.findPos = findPos;
		myField.findPos();

		tipDiv = document.getElementById('tipDiv');
		tipDiv.firstChild.innerHTML = myField.parentNode.getElementsByClassName("tip")[0].innerHTML;

		tipDiv.style.display = "block";
		tipDiv.style.left = myField.posLeft + 8 + "px";
		tipDiv.style.top = myField.posTop - tipDiv.offsetHeight + 2 + "px";
		placeIframe(tipDiv); // Now, display the transparent Iframe which forces slect-one fields to be on the background!
		
		addEvent(myField,"mouseout",hideTips);
		addEvent(myField,"click",hideTips);
		addEvent(myField,"keypress",hideTips);
	}
}

function placeIframe(tipDiv)
{
	// tipIframe is a transparent Iframe which forces slect-one fields to be on the background!
	tipIframe = document.getElementById('tipIframe');
	tipIframe.style.filter = "alpha(opacity=0)";
	tipIframe.style.MozOpacity = 0;
	tipIframe.style.opacity = 0;
	tipIframe.style.width = tipDiv.offsetWidth + "px";
	tipIframe.style.height = tipDiv.offsetHeight + "px";
	tipIframe.style.top = tipDiv.style.top;
	tipIframe.style.left = tipDiv.style.left;
	tipIframe.style.display = "block";
}

function hideTips()
{
	document.getElementById('tipIframe').style.display="none";
	document.getElementById('tipDiv').style.display="none";
}
