function checkMail(from)
{
	var re = /^[A-Za-z0-9.-_--]+@[A-Za-z0-9.-_--]+\.[A-Za-z]{2,5}$/;
	if (re.test(from.value)) {	return true;}
	else	{alert("Format adresse e-mail invalide.");	}
	return false;
}
function razValue(obj, vlDef)
{
	if (obj.value == vlDef)
		obj.value="";
}
function isIE()
{
	return (navigator.appName.match(/Explorer/i));
}
var shortcut = '';
function myInit(wuVerticalJS) {	
	if (document.getElementById('wuInHeader')) { var wuInHeader = document.getElementById('wuInHeader').clientHeight; }
	else { var wuInHeader = 0; }
	if (document.getElementById('wuInFooter')) { var wuInFooter = document.getElementById('wuInFooter').clientHeight; }
	else { var wuInFooter = 0; }
	var contentHeight = document.getElementById('wuAll').clientHeight - wuInHeader - wuInFooter;
	if (document.getElementById('wuContent').clientHeight < contentHeight) document.getElementById('wuContent').height = contentHeight;
	if (document.getElementById('wuAllContent').clientHeight < contentHeight) document.getElementById('wuAllContent').height = contentHeight;
	if (shortcut != '') {		
		if(shortcutPos == 'left') { document.getElementById(shortcut).style.left = '0px'; }
		if(shortcutPos == 'right') { document.getElementById(shortcutDiv).style.left = document.getElementById(shortcut).clientWidth - shortcutWidth; }	
	}	
	if(isIE() != 'Explorer' && wuVerticalJS != '') {
	  if (window.innerWidth != screen.width) {
      window.resizeBy(1,1);
      window.resizeBy(-1, -1);
    }
  }
}

// Fonction nav html
function menu (id, alignImg, img, imgWidth, imgHeight, imgAlt, ewResources, unvisible, font, pcolor, color, bgpcolor, bgcolor, align, textdecoration, fontweight, fontstyle, textsize, borderstyle, borderpx, borderpcolor, bordercolor, bordermg)
{
	var quote = '\'\"';
	var qquote = ' ';	
	//Image
	if (img !='' ) {
		if (alignImg ==  'fond') {
			document.getElementById('cadre'+id).style.backgroundPosition='center center';
			document.getElementById('cadre'+id).style.backgroundRepeat='no-repeat';
			document.getElementById('cadre'+id).style.backgroundImage='url('+ewResources+img+')';
			//document.getElementById('cadre'+id).style.width=imgWidth;
			//document.getElementById('cadre'+id).style.height=imgHeight;
			document.getElementById('cadre'+id).title=imgAlt.replace(quote, qquote);
			document.getElementById('cadre'+id).style.cursor=isIE()? 'hand' : 'pointer';
		} else {
			document.getElementById('img'+id).src=ewResources+img;
			document.getElementById('img'+id).width=imgWidth;
			document.getElementById('img'+id).height=imgHeight;
			document.getElementById('img'+id).title=imgAlt.replace(quote, qquote);
			document.getElementById('img'+id).style.display='block';
			document.getElementById('cadre'+id).style.cursor=isIE()? 'hand' : 'pointer';
		}
	} else {
		if (alignImg == 'fond') {
			document.getElementById('cadre'+id).style.backgroundImage='url()';
			//document.getElementById('cadre'+id).style.width='';
			//document.getElementById('cadre'+id).style.height='';
			document.getElementById('cadre'+id).title='';
		} else {
			if (img != '' ) {
				document.getElementById('img'+id).src='';
				document.getElementById('img'+id).width='';
				document.getElementById('img'+id).height='';
				document.getElementById('img'+id).title='';
				document.getElementById('img'+id).style.display='block';
			}
		}
	}
	//Visibilite texte
	if (unvisible =='on') {
		document.getElementById('divLink'+id).style.display='none';
	} else {
		document.getElementById('divLink'+id).style.display='block';
	}
	//alignement du texte
	if (align != '' ) {
		document.getElementById('divLink'+id).style.textAlign=align;
	} else {
		document.getElementById('divLink'+id).style.textAlign='left';
	}
	//Cadre
	if (borderstyle != '')
	{
		if (borderpcolor != '' && borderpcolor != 'none') {
			document.getElementById('divLink'+id).style.border=borderpx+'px '+borderstyle+' '+borderpcolor;
		} else {
			if (bordercolor != '' && bordercolor != 'none') {
				document.getElementById('divLink'+id).style.border=borderpx+'px '+borderstyle+' '+bordercolor;
			} else {
				document.getElementById('divLink'+id).style.border=borderpx+'px '+borderstyle+' black';
			}
		}
	}
	//Marge 
	if (bordermg != '') {
		document.getElementById('divLink'+id).style.padding=bordermg+'px' ;
	} else {
		document.getElementById('divLink'+id).style.padding='0px' ;
	}
	//Curseur  -->
	document.getElementById('divLink'+id).style.cursor=isIE()? 'hand' : 'pointer';
	//Class du texte
	if (font != '') {
		document.getElementById('spanLink'+id).className=font;
	} else {
		document.getElementById('spanLink'+id).className= 'wuDefaultText';
	}
	//Couleur du texte
	if (pcolor != '' ) {
		document.getElementById('spanLink'+id).style.color=pcolor;
	} else {
		if (color != 'none' && color != '') {
			document.getElementById('spanLink'+id).style.color=color;
		}
	}
	//Couleur de fond du texte
	if (bgpcolor != '' ) {
		document.getElementById('spanLink'+id).style.backgroundColor=bgpcolor;
	} else {
		if (bgcolor != 'none' && bgcolor != '') {
			document.getElementById('spanLink'+id).style.backgroundColor=bgcolor;
		}
	}				
	//soulignement 
	if (textdecoration != '' ) {
		document.getElementById('spanLink'+id).style.textdecoration=textdecoration;
	}
	//bold du texte
	if (fontweight != '' ) {
		document.getElementById('spanLink'+id).style.fontWeight=fontweight;
	}
	//italique du texte
	if (fontstyle != '' ) {
		document.getElementById('spanLink'+id).style.fontStyle=fontstyle;
	}
	//taille du texte
	if (textsize != '' ) {
		document.getElementById('spanLink'+id).style.fontSize=textsize;
	}
	
}

function changeStatus(obj, imgOpen, imgClose, ArboID, wuOpenObjects) {	
	document.getElementById(obj).style.display = document.getElementById(obj).style.display == "none" ? "block" : "none";
	document.getElementById('i'+obj).src = document.getElementById(obj).style.display == "none" ? imgClose : imgOpen;	
	if (document.getElementById(obj).style.display == "none") {
		 wuOpenObjects = wuOpenObjects.replace(obj, "");
	} else {
		if (wuOpenObjects.indexOf(obj) <= 0) {
			wuOpenObjects += obj;
		}
	}	
	document.getElementById('wuTempOpenObjects_'+ArboID).value = wuOpenObjects;
	doRequest('wuOpenArbo.php?arboID='+ArboID+'&wuOpen='+wuOpenObjects , 'wuDivOpenObjects_'+ArboID );					
}

