function AllowTabCharacter()
{
	if (event != null)
	{
		if (event.srcElement)
		{
			if (event.srcElement.value)
			{
				if (event.keyCode == 9)
				{
					// tab character
					if (document.selection != null)
					{
						document.selection.createRange().text = '\t';
						event.returnValue = false;
					}
					else
					{
						event.srcElement.value += '\t';
						return false;
					}
				}
			}
		}
	}
}

//hides a div then turns the image from plus to minus or vice versa
function showorhide( rid )
{
	var myImg = document.getElementById("i" + rid);
	var myDiv = document.getElementById("d" + rid);

	if (myImg.src == "http://pd.pliner.com/images/plus.gif")
	{
		myImg.src = "http://pd.pliner.com/images/icons/minus.gif"
		myDiv.style.display = "block";
	}
	else
	{
		myImg.src = "http://pd.pliner.com/images/icons/plus.gif"
		myDiv.style.display = "none";
	}
}


function GoToFirstChlidLink(elem)
{
	for (i=0; i < elem.childNodes.length; i++)
		if (elem.childNodes[i].nodeName.toLowerCase() == 'a')
			document.location.href = elem.childNodes[i].href;
}

//--------------------------------------------------
// A generic hide function the makes an element
// invisible, and pulls it out of relative alignment
// so it does not hold any space
//
function hideElement(elemID)
{
	document.getElementById(elemID).style.position   = "absolute";
	document.getElementById(elemID).style.visibility = "hidden";
}

//--------------------------------------------------
// A generic show function that makes an element
// visible, and pulls it back into relative
// alignment with it's surroundings so it will
// size to the content around it
//
function showElement(elemID)
{
	document.getElementById(elemID).style.position   = "relative";  // FF, NS want to hear 'relative' (so does W3c standard)
	document.getElementById(elemID).style.position   = "static";    // but IE will only listen to 'static'
	document.getElementById(elemID).style.visibility = "visible";
}

function findPosX(obj)
{
	var curleft = 0;
	if(obj.offsetParent)
		while(1)
		{
			curleft += obj.offsetLeft;
			if(!obj.offsetParent)
				break;
			obj = obj.offsetParent;
		}
	else if(obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if(obj.offsetParent)
		while(1)
		{
			curtop += obj.offsetTop;
			if(!obj.offsetParent)
				break;
			obj = obj.offsetParent;
		}
	else if(obj.y)
		curtop += obj.y;
	return curtop;
}
