var default_link = function()
{
	var id, left, top, width, height, link, back, type, title, bet, win, desc;
	var isPlaying;
	var linkObj;
	var container;
	
	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'));
		link = node.getAttribute('link');
		back = node.getAttribute('back');
		type = node.getAttribute('type');
		title = node.getAttribute('title');
		bet = node.getAttribute('bet');
		win = node.getAttribute('win');
		desc = node.getAttribute('desc');
		
		if( back != "" )
		{
			var preload = new Image();
			preload.onload = makeNextObject;
			preload.src = back;
		}
		else makeNextObject();
	}
	
	this.play = function( parent )
	{	
		if( isPlaying == false )
		{
			container = document.createElement("div");
			
			container.setAttribute("id", id);
			
			container.style.top = top + "px";
			container.style.left = left + "px";
			container.style.width = width + "px";
			container.style.height = height + "px";
			if( back != "" )
				container.style.background = "url('" + back + "')";
			container.style.position = "absolute";
			container.style.backgroundRepeat = "no-repeat";
			
			container.onmouseover = function()
			{
				isOnLink = true;
				linkDialogPlay( container, type, title, bet, win, desc );
			}
			
			container.onmouseout = function()
			{
				isOnLink = false;
				linkDialogStop();
			}
			
			container.onclick = function()
			{
				changeCurrentPage(link);
			}
			
			container.style.cursor = "pointer";

			parent.appendChild(container);

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

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

var shop_link = function()
{
	var id, left, top, width, height, txtTop, txtLength, txtColor, link, back, type, title, desc, cat;
	var isPlaying;
	var linkObj;
	var container;
	
	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'));
		txtTop = parseInt(node.getAttribute('txt_top'));
		txtLength = parseInt(node.getAttribute('txt_length'));
		txtColor = node.getAttribute('txt_color');
		link = node.getAttribute('link');
		if( back != "" )
			back = node.getAttribute('back');
		type = node.getAttribute('type');
		title = node.getAttribute('title');
		desc = node.getAttribute('desc');
		cat = node.getAttribute('cat');
		
		if( back != "" )
		{
			var preload = new Image();
			preload.onload = makeNextObject;
			preload.src = back;
		}
		else makeNextObject();
	}
	
	this.play = function( parent )
	{	
		if( isPlaying == false )
		{
			container = document.createElement("div");
			
			container.setAttribute("id", id);
			
			container.style.top = top + "px";
			container.style.left = left + "px";
			container.style.width = width + "px";
			container.style.height = height + "px";
			container.style.background = "url('" + back + "')";
			container.style.position = "absolute";
			container.style.backgroundRepeat = "no-repeat";
			
			var txtDiv = document.createElement("div");
			txtDiv.style.top = txtTop + "px";
			txtDiv.style.width = width + "px";
			txtDiv.style.height = txtLength + "px";
			txtDiv.style.position = "absolute";
			txtDiv.style.fontWeight = "bold";
			txtDiv.style.fontSize = txtLength + "px";
			txtDiv.style.textAlign = "center";
			txtDiv.style.color = txtColor;
			
			var txt = document.createTextNode(title);
			
			txtDiv.appendChild(txt);
			container.appendChild(txtDiv);
			
			container.onmouseover = function()
			{
				isOnLink = true;
				linkDialogPlay( container, type, "boutique : " + title, "", "", desc );
			}
			
			container.onmouseout = function()
			{
				isOnLink = false;
				linkDialogStop();
			}
			
			container.onclick = function()
			{
				changeCurrentPage(link + "?cat=" + cat);
			}
			
			container.style.cursor = "pointer";

			parent.appendChild(container);

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

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