var border_img = function()
{
	var id, leftPrc, topPrc, rightPrc, bottomPrc, back;
	var isPlaying;
	var img;
	
	this.start = function( node )
	{
		isPlaying = false;
		
		id = node.getAttribute('id');
		leftPrc = parseInt(node.getAttribute('leftPrc'));
		topPrc = parseInt(node.getAttribute('topPrc'));
		rightPrc = parseInt(node.getAttribute('rightPrc'));
		bottomPrc = parseInt(node.getAttribute('bottomPrc'));
		back = node.getAttribute('back');
		
		if( back != "" )
		{
			var preload = new Image();
			preload.onload = makeNextObject;
			preload.src = back;
		}
		else makeNextObject();
	}
	
	this.updateStyle = function()
	{
		img.style.left = parseInt(map_zone_width * (leftPrc / 100)) + "px";
		img.style.top = parseInt(map_zone_height * (topPrc / 100)) + "px";
		img.width = parseInt(map_zone_width * ((100 - ( leftPrc + rightPrc)) / 100));
		img.height = parseInt(map_zone_height * ((100 - ( topPrc + bottomPrc)) / 100));
		img.src = back;
		img.style.position = "absolute";
	}

	this.play = function( parent )
	{	
		if( isPlaying == false )
		{
			img = document.createElement("img");

			img.setAttribute("id", id);

			this.updateStyle();

			document.getElementById('map_background').appendChild(img);
			
			toUpdateObjects.push(this);

			isPlaying = true;
		}
	}
	
	this.stop = function()
	{
		if( isPlaying == true )
		{
			removeAllNodes( img, true );
			isPlaying = false;
		}
	}
}