//   ************************************************************************//
//   * Module Name		: Layer_MoveXY.js									*//
//   * Release			: 1.1												*//
//   * Date				: 29/02/2008										*//
//   * Project			: AGSE_TT											*//
//   * Author			: aCOSwt											*//
//   * Description		: Animation moving a layer							*//
//   * History			: 1.0 : First Site Version							*//
//   *					: 1.1 : Misc adaptations due to CSS + differences	*//
//   *					:       MSIE / Others								*//
//   * Language			: JavaScript										*//
//   * Compatibility	: FireFox 2 - IE 7 - Opera 9 - Konqueror 3			*//
//   ************************************************************************//

function Layer_MoveXY(layerId,x_dest,y_dest,incX,incY,speed){

	var	x_dist, y_dist, funcstr, el_layer;

	el_layer=document.getElementById(layerId);
	if(navigator.appName=="Microsoft Internet Explorer"){
		x_dist=x_dest-parseInt(el_layer.currentStyle.left);
		y_dist=y_dest-parseInt(el_layer.currentStyle.top);}
	else{
		x_dist=x_dest-parseInt(document.defaultView.getComputedStyle(el_layer,null).getPropertyValue("left"));
		y_dist=y_dest-parseInt(document.defaultView.getComputedStyle(el_layer,null).getPropertyValue("top"));}
	if(Math.abs(x_dist)<incX)
		x_dist=0;
	else
		x_dist=x_dist-(x_dist/Math.abs(x_dist))*incX;
		el_layer.style.left=(x_dest-x_dist)+"px";
	if(Math.abs(y_dist)<incY)
		y_dist=0;
	else
		y_dist=y_dist-(y_dist/Math.abs(y_dist))*incY;
		el_layer.style.top=(y_dest-y_dist)+"px";
	if(!(x_dist==0 && y_dist==0)){
		if(speed){
			funcstr="Layer_MoveXY('"+layerId+"',"+x_dest+","+y_dest+","+incX+","+incY+","+speed+")";
			setTimeout(funcstr,speed);}
		else
			return(1);}
	else
		return(0);}	