var iInitLinePosition = 0;

function moveLineIE()
{
	moveLineFF(event);
}

function initLine(iX)
{
	iInitLinePosition = iX;
	
	moveLineToPosition(getInitPosition());
}

function getInitPosition()
{
	menuObj			= document.getElementById('menupanel');
	var iMenuLeft 	= menuObj.parentNode.offsetLeft;
	
	return iInitLinePosition + iMenuLeft;
}

function moveLineToPosition(iX)
{
	logObj 			= document.getElementById('logpanel');
	menuObj			= document.getElementById('menupanel');
	lineObj			= document.getElementById('linepanel');

	var iMenuLeft 	= menuObj.parentNode.offsetLeft;
	var iMenuTop 	= menuObj.offsetTop;
	var iMenuWidth	= 554;
	var iMenuWidthMargin = 50;
	var iMenuHeight	= 17;
	var iMenuHeightMargin = 50;
	var iLineMargin = 11;
	
	moveLineTo(lineObj, (iX - iMenuLeft - iLineMargin));
}

function moveLineFF(event)
{
	logObj 			= document.getElementById('logpanel');
	menuObj			= document.getElementById('menupanel');
	lineObj			= document.getElementById('linepanel');
	
	var iMenuLeft 	= menuObj.parentNode.offsetLeft;
	var iMenuTop 	= menuObj.offsetTop;
	var iMenuWidth	= 554;
	var iMenuWidthMargin = 50;
	var iMenuHeight	= 17;
	var iMenuHeightMargin = 50;
	var iLineMargin = 11;
	var iX			= event.clientX;
	var iY			= event.clientY;

	if(iX >= (iMenuLeft + iMenuWidthMargin) && iX <= (iMenuLeft + iMenuWidth + iMenuWidthMargin))
	{
		if(iY <= (iMenuTop + iMenuHeight + iMenuHeightMargin))
		{
			moveLineTo(lineObj, (iX - iMenuLeft - iLineMargin));
		}
		else
		{
			moveLineToPosition(getInitPosition());
			//setValue(logObj, 'Uit de panel' + iMenuTop);
		}
	}
	else
	{
		moveLineToPosition(getInitPosition());
		//setValue(logObj, 'Uit de panel' + iMenuTop);
	}
}

function moveLineTo(objToMove, iLeft)
{
	if(objToMove)
	{
		objToMove.style.left = iLeft + 'px';
	}
}

function setValue(obj,value)
{
	obj.innerHTML = value;
}


if(navigator.appName != "Netscape")
{
	// Call the IE function 
	document.onmousemove = moveLineIE;
}
else
{
	// Call the Netscape function
	document.onmousemove = moveLineFF;
}
