

 function openmypage(page)
 {
  w = screen.width-50;
  h=screen.height-50;

  l = (screen.width-10 - w) / 2;
  t = (screen.height-30 - h) / 2;

  features = "width="+w+",height="+h+",left="+l+",top="+t;
  features += ",screenX="+l+",screenY="+t;
  features += ",scrollbars=1,resizable=1,location=0";
  features += ",menubar=0,toolbar=0,status=0";

  window.open(page, Math.round(Math.random()*1000), features);

 }


/*
email		= Courriel
domaine		= Domaine
texte		= Lien du email
*/
function writeEmailWithText(email,domaine,texte)
{
	if (email>"") {
		document.write('<a href=\"mailto:' + email + '@' + domaine + '\">');
		document.write(texte+'</a>');
	}
}

/*
email		= Courriel
domaine		= Domaine
*/
function writeEmailShowAddress(email,domaine)
{
	if (email>"") {
		document.write('<a href=\"mailto:' + email + '@' + domaine + '\">');
		document.write(email+'@');
		document.write(domaine+'</a>');
	}
}

/*
Title		= Titre de la fenetre
Alignment	= Left, Right, Center
Width		= Mettre 0 si indefini	
*/
	function writeTableauStyle1Top(Title,Alignment,Width)
	{
	document.write('<table class="body-mainpage" cellpadding=0 cellspacing=0>');
	document.write('<tr><td class="title-mainpage">&nbsp;'+Title+'&nbsp;</td></tr>');
	document.write('<tr><td valign="top">');
	if (Width>0)
	   document.write('	<table width='+ Width +' border=0 cellspacing=5><tr><td align="'+Alignment+'">')
	   else
	   document.write('	<table border=0 cellspacing=5><tr><td align="'+Alignment+'">')
	}
	function writeTableauStyle1Bottom() 
	{	
	document.write('	</td></tr></table>');		
	document.write('</td></tr></table>');
	}

	
function addHSpace(Weight) 
{
	document.write('<table width="'+Weight+'"><tr><td></td></tr></table>');
}
function addVSpace(Height) 
{
	document.write('<table height="'+Height+'"><tr><td></td></tr></table>');
}

function getSelectedPage()
{
var oSelect = document.getElementById("webpage")
var Url = oSelect.options[oSelect.selectedIndex].value
var WindowsLabel = Math.random();

if (Url  > "") {
  photoWin = window.open( Url , '', '')
  }
}


function actu_iframe()
{
	if (navigator.appName=="Opera" )
		{
		if  (document.all) document.all.id_iframe.style.height = document.frames("id_iframe" ).document.body.scrollHeight;
			else
			document.getElementById("id_iframe" ).style.height = document.getElementById("id_iframe" ).contentDocument.body.scrollHeight;
		 }

	if  (navigator.appName=="Microsoft Internet Explorer" ) 
		{
		if  (document.all) document.all.id_iframe.style.height = document.frames("id_iframe" ).document.body.scrollHeight;
			else
			document.getElementById("id_iframe" ).style.height = document.getElementById("id_iframe" ).contentDocument.body.scrollHeight;
		 }
	else
		{
		document.getElementById("id_iframe" ).style.height = document.getElementById("id_iframe" ).contentDocument.body.offsetHeight +"px";
		}
}


var timeout         = 500;
var closetimer     = 0;
var ddmenuitem   = 0;

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose; 