var background_div = function()
{
	var id, left, top, width, height, repeat, back;
	var isPlaying;
	var new_obj;
	
	var childList = new Array();
	var iChildList = 0;
	
	this.start = function( node )
	{
		isPlaying = false;
		
		id = node.getAttribute('id');
		left = parseInt(node.getAttribute('left'));
		top = parseInt(node.getAttribute('top'));
		width = parseInt(node.getAttribute('width'));
		height = parseInt(node.getAttribute('height'));
		repeat = node.getAttribute('repeat');
		back = node.getAttribute('back');
		
		this.makeToPlay( node );
		
		if( back != "" )
		{
			var preload = new Image();
			preload.onload = makeNextObject;
			preload.src = back;
		}
		else makeNextObject();
	}
	
	this.makeToPlay = function( node )
	{
		for( var i = 0; i < node.childNodes.length; i++ )
		{
			if( node.childNodes[i].nodeType != 3 )
			{
				childList[iChildList] = node.childNodes[i].firstChild.nodeValue;
				iChildList++;
			}
		}
	}
	
	this.makeStyle = function( node )
	{
		node.style.top = top + "px";
		node.style.left = left + "px";
		node.style.width = width + "px";
		node.style.height = height + "px";
		node.style.background = "url('" + back + "')";
		node.style.position = "absolute";
		node.style.backgroundRepeat = repeat;
	}

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

			new_obj.setAttribute("id", id);

			this.makeStyle( new_obj );

			parent.appendChild(new_obj);

			if( parent == document.getElementById('map_contained') )redimMapContained( left, top, width, height );

			isPlaying = true;
			
			for( var i = 0; i < iChildList; i++ )
			{
				playIt( childList[i], new_obj );
			}
		}
	}
	
	this.stop = function()
	{
		if( isPlaying == true )
		{
			for( var i = 0; i < iChildList; i++ )
			{
				stopObject( childList[i] );
			}
			
			new_obj.parentNode.removeChild( new_obj );
			isPlaying = false;
		}
	}
}