function Clicker(tagName, NodeName)
{
	var oItem;// = document.frmOrders.all(tagName, 0);
	var sStyle;// = oItem.style.display;
	var oParent;
	
	oItem = document.getElementById(tagName);

	if (oItem != null)
	{
		sStyle = oItem.style.display;

		if (PreviousItem != null && oItem != PreviousItem)
		{
			if (PreviousItem.style.display == 'inline')
			{
				PreviousItem.style.display = 'none';
			}
		}
		
		if (sStyle == 'none')
		{
			oItem.style.display = 'inline';
			
			oItem.focus();
			oParent = null;
		}
		else
		{
			oItem.style.display = 'none';
			
		}
			
		PreviousItem = oItem;
		PreviousTag = NodeName;
			
		sStyle = null;
		oItem = null;
	}
}

function IsInFrame()
{
	var bInFrame = false;
	
	if (window.parent != null && window.parent != 'undefined')
	{
		if (window.parent.frames != null && window.parent.frames != 'undefined' && window.parent.frames.length > 1)
			return true;
		else
			return false;
	}
	else
		return false;
}

// subpage not in use
function checkframes(page, subpage)
{

	var oFrames = null, oFrame;
	var sName;
	var sNames = "top;meny;main".split(';');
	var bReturnVal = true;
	var bNameFound;
	
	if (IsInFrame())
	{
		if (window.parent != null && window.parent != 'undefined')
		{
			if (window.parent.frames != null && window.parent.frames != 'undefined' && window.parent.frames.length > 1)
				oFrames = window.parent.frames;
			else
				oFrames = null;
		}
		else
			oFrames = null;
				
		if (oFrames != null && oFrames != 'undefined')
		{
			if (oFrames.length > 0)
			{
				bOK = true;
				
				for (i=0; i < oFrames.length; i++)
				{
					bNameFound = false;
					
					for (j=0; j < sNames.length; j++)
					{
						if (oFrames[i].name == sNames[j]) 
						{
							bNameFound = true;
							break;
						}
					}
					
					if (bNameFound)
					{
						bReturnVal = true;
						break;
					}
				}
			}
			else
				bReturnVal = false;
		}
		else
			bReturnVal = false;
			
		if (!bReturnVal)		
		{
			window.location.replace(page);
		}
	}	
	else
		bReturnVal = false;
	
	
	if (!bReturnVal)
	{
		if (page != null || page != 'undefined')
			window.location.replace(page);
		return false;
	}
	else
		return true;
}
