/////////////////////////////////////////////////////////////////////////
//
// to get the position of the div reference : offsetLeft, offsetTop
//
// div property that can be modify: left, top
//
/////////////////////////////////////////////////////////////////////////


var xDivRef = "xDivReference";
var xTargetArray = new Array();

	var xLV1 = new Object();
	xLV1.xTarget = "xDivMenu";
	xLV1.xTruePositionLeft = -19;
	xLV1.xTruePositionTop = 121;

xTargetArray[0] = xLV1;


function xSetDivPosition()
{
	var xLV1 = xAcquireTarget(xDivRef);
	var xLV2 = xGetDivPosition(xLV1,'offsetLeft');
	var xLV3 = xGetDivPosition(xLV1,'offsetTop');
	var xLV4 = xTargetArray;
	for(i=0;i<=xLV4.length-1;i++){
		var xLV5 = xAcquireTarget(xLV4[i].xTarget);
		xSetVisibility(xLV5,'hidden');
		var xLV6 = xLV2 + xLV4[i].xTruePositionLeft;
		var xLV7 = xLV3 + xLV4[i].xTruePositionTop;
		xSetProperty(xLV5,xLV6,xLV7);
		xSetVisibility(xLV5,'visible');
	}
}

function xGetDivPosition(xTarget,xProp)
{
	var xLV1;
	if(xProp=='offsetLeft'){(!(document.layers))? xLV1 = xTarget.offsetLeft : xLV1 = xTarget.pageX;}
	if(xProp=='offsetTop'){(!(document.layers))? xLV1 = xTarget.offsetTop : xLV1 = xTarget.pageY;}
	return xLV1;
}

function xSetProperty(xTarget,xProp1,xProp2)
{
	(!(document.layers))? xTarget.style.left = xProp1+'px' : xTarget['left'] = xProp1;
	(!(document.layers))? xTarget.style.top = xProp2+'px' : xTarget['top'] = xProp2;
}

function xSetVisibility(xT,xValue)
{	
	(!(document.layers))? xT.style.visibility = xValue : xT['visibility'] = xValue;
}

function xAcquireTarget(xTarget)
{
	var xLV1;
	if(document.all && document.getElementById) xLV1 = document.all[xTarget];
	if(document.layers) xLV1 = document.layers[xTarget];
	if(document.addEventListener) xLV1 = document.getElementById(xTarget);
	return xLV1;
}

function regenerate()
{
	window.location.reload();
}

window.onresize = function()
{
	(document.layers)? regenerate() : xSetDivPosition();
}



