
function lightbox (titre,file,width,HTML)
{
	if (!document.getElementById('lightbox_bg'))
	{
		var lightbox_bg = document.createElement('DIV');
		lightbox_bg.id = 'lightbox_bg';
		document.body.appendChild(lightbox_bg);
		lightbox_bg.style.height = document.body.offsetHeight+'px';
		
		var isMSIE = (navigator.userAgent.toLowerCase().indexOf('msie')>=0)?true:false;
		
		if (isMSIE)
		lightbox_bg.style.height = document.body.scrollHeight+'px';

		var lightbox=document.createElement('DIV');
		lightbox.id = 'lightbox';
		
		if (width == 'small')
		{
			width = 300;
			lightbox.style.height = '120px';
		}
		
		lightbox.style.width = width+'px';
		var docWidth = document.body.clientWidth;		
		lightbox.style.left = docWidth/2 - width/2 + 'px';

		var scroll_pos = Math.max( document.body.scrollTop, document.documentElement.scrollTop );
		lightbox.style.top = (scroll_pos + 100) + 'px';
			
		document.body.appendChild(lightbox);
		
		lightbox.innerHTML = "<div id='lightbox_header'><a href='javascript:close_lightbox();'><img src='/images/close_popup.gif' border='0' /></a>"+titre+"</div><div id='lightbox_content'></div>";
		
		if (typeof(HTML)=='string')
		document.getElementById('lightbox_content').innerHTML = HTML;
		else
		ajax_loadContent('lightbox_content',file);
		
	}
}

function close_lightbox()
{
	document.body.removeChild(document.getElementById('lightbox'));
	document.body.removeChild(document.getElementById('lightbox_bg'));
	
}

function lightbox_message(titre,HTML)
{	
	var flash = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='769' height='577'>\n<param name='movie' value='flash/"+HTML+".swf'>\n<param name='quality' value='high'>\n<embed src='flash/"+HTML+".swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='769' height='577'></embed></object>\n";
	
	lightbox (titre,'',790,flash);
}
