function gid(id)
{
	
	return document.getElementById(id);
	
}

function setAnimateTargetX(objId, targetX)
{
	
	animateX_Target[objId] = findPosX(objId) + targetX;
	
}

function setAnimateTargetWidth(objId, targetWidth)
{
	
	animateWidth_Target[objId] = targetWidth;
	
}

function animateX(timeout)
{
	
	recall = false;
	increment = 1;
	
	for (index in animateX_Target)
	{
		
		tempObj = document.getElementById(index);
		
		if (findPosX(index) != animateX_Target[index])
		{
			
			recall = true;
			
			if (findPosX(index) < animateX_Target[index])
			{
				
				tempObj.style.left = (findPosX(index) + increment) + 'px';
				if (findPosX(index) >= animateX_Target[index]) { tempObj.style.left = animateX_Target[index] + 'px'; }
				
			}
			
			if (findPosX(index) > animateX_Target[index])
			{
				
				tempObj.style.left = (findPosX(index) - increment) + 'px';
				if (findPosX(index) <= animateX_Target[index]) { tempObj.style.left = animateX_Target[index] + 'px'; }
				
			}
			
		}
		
	}
	
	if (recall)
	{
		
		setTimeout("animateX(" + timeout + ");", timeout);
		
	}
	
}

function animateWidth(timeout)
{
	
	recall = false;
	increment = 1;
	
	for (index in animateWidth_Target)
	{
		
		tempObj = document.getElementById(index);
		
		if (getWidth(index) != animateWidth_Target[index])
		{
			
			recall = true;
			
			if (getWidth(index) < animateWidth_Target[index])
			{
				
				tempObj.style.width = (getWidth(index) + increment) + 'px';
				if (getWidth(index) >= animateWidth_Target[index]) { tempObj.style.width = animateWidth_Target[index] + 'px'; }
				
			}
			
			if (getWidth(index) > animateWidth_Target[index])
			{
				
				tempObj.style.width = (getWidth(index) - increment) + 'px';
				if (getWidth(index) <= animateWidth_Target[index]) { tempObj.style.width = animateWidth_Target[index] + 'px'; }
				
			}
			
		}
		
	}
	
	if (recall)
	{
		
		setTimeout("animateWidth(" + timeout + ");", timeout);
		
	}
	
}

function findPosX(id)
{

obj = document.getElementById(id);

var curleft = 0;

if (obj.offsetParent)
{

while (obj.offsetParent)
{

curleft += obj.offsetLeft;
obj = obj.offsetParent;

}

} else if (obj.x) {

curleft += obj.x;

}

return curleft;
}

function getWidth(tempId)
{

var tempWidth = 0;

if (gid(tempId) != null)
{

tempWidth = gid(tempId).offsetWidth;

if (!tempWidth)
{

tempWidth = gid(tempId).style.width;

if (tempWidth.substr(tempWidth.length - 2, 2) == 'px')
{


tempWidth = Number(tempWidth.substr(0, tempWidth.length - 2));

}

}

if (!tempWidth)
{

tempWidth = gid(tempId).width;

}

}

return tempWidth;

}

var animateX_Target = new Array();
var animateWidth_Target = new Array();
