// JavaScript Document
var newz = 100;
var intervallen		= new Object();	
function clearIntervallen(){
	for(i=0;i<intervallen.length;i++){
		clearTimeout(intervallen[i]);
	}
}
function mover(id,to_x,to_y,to_width,to_height,speed,start){	
	if(!start && intervallen[id]){
		clearTimeout(intervallen[id]);
	}
	speed 		= parseInt(speed);
	if(speed < 1) speed = 1;
	if(speed > 3) speed = 3;		
	divElement 	= document.getElementById(id);
	var notFinished = false;
	if(to_x){
		to_x 			= parseInt(to_x);		
		speed_x 		= (to_x - parseInt(divElement.style.left)) 			/ speed;
		if(Math.abs(speed_x) > 1){
			var new_x 		= parseInt(divElement.style.left) 		+ speed_x;
			notFinished 	= true;				
		}else{
			var new_x 		= to_x;
		}
		divElement.style.left 	= new_x + 'px';
		var to_x_to = '\''+to_x+'\'';
	}else{
		var to_x_to = 'false';
	}
	
	if(to_y){
		to_y 			= parseInt(to_y);				
		speed_y 		= (to_y - parseInt(divElement.style.top)) 			/ speed;
		if(Math.abs(speed_y) > 1){
			var new_y		= parseInt(divElement.style.top) 		+ speed_y;
			notFinished 	= true;				
		}else{
			var new_y 		= to_y;
		}
		divElement.style.top 	= new_y + 'px';
		var to_y_to = '\''+to_y+'\'';
	}else{
		var to_y_to = 'false';
	}
	
	if(to_width){
		to_width 		= parseInt(to_width);						
		speed_width 		= (to_width - parseInt(divElement.style.width)) 			/ speed;
		if(Math.abs(speed_width) > 1){
			var new_width 		= parseInt(divElement.style.width) 		+ speed_width;
			notFinished 		= true;				
		}else{
			var new_width 		= to_width;
		}
		divElement.style.width 	= new_width + 'px';
		var to_width_to = '\''+to_width+'\'';
	}else{
		var to_width_to = 'false';
	}
	
	
	if(to_height){
		to_height 				= parseInt(to_height);						
		speed_height 			= (to_height - parseInt(divElement.style.height)) 			/ speed;
		if(Math.abs(speed_height) > 1){
			var new_height 		= parseInt(divElement.style.height) 		+ speed_height;
			notFinished 		= true;				
		}else{
			var new_height 		= to_height;
		}
		divElement.style.height 	= new_height + 'px';
		var to_height_to = '\''+to_height+'\'';
	}else{
		var to_height_to = 'false';
	}
	
	
							
	if(notFinished == true){					
		intervallen[id] = setTimeout('mover(\''+id+'\','+to_x_to+','+to_y_to+','+to_width_to+','+to_height_to+','+speed+',false)',30);
	}
}	