/* Fonction de vérification et validation d'une adresse email*/
function isEMail(c)
{
var reg = /^[a-z0-9._-]+@[a-z0-9.-]{2,}[.][a-z]{2,3}$/
var r=reg.exec(c)!=null;
return (r)
}


/* Fonction pour ajouter le site  */
function addFav() 
{ 
if (document.all)	window.external.AddFavorite('http://www.cubexagency.com', document.title); 
else 				alert('Vous pouvez faire CTRL + D pour ajouter cette page dans vos signets, ou favoris.');
}


/* Fonction pour avoir des images png transparentes sur IE */
function IE_CorrectAlpha_PNG()
	{ 
	for(i=0; i<document.images.length; i++)
		{ 
		img    = document.images[i]; 
		imgExt  = img.src.substring(img.src.length-3, img.src.length); 
		imgExt  = imgExt.toUpperCase(); 
		if (imgExt == "PNG")
			{ 
			imgID    = (img.id) ? "id='" + img.id + "' " : ""; 
			imgClass= (img.className) ? "class='" + img.className + "' " : ""; 
			imgTitle= (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "; 
			imgStyle= "display:inline-block;" + img.style.cssText; 
			if (img.align == "left") { imgStyle = "float:left;"  + imgStyle; } else if (img.align == "right"){ imgStyle = "float:right;" + imgStyle; } 
			if (img.parentElement.href)   { imgStyle = "cursor:hand;" + imgStyle; }        
			strNewHTML    = '<span '+imgID+imgClass+imgTitle+' style="width:'+img.width+'px; height:'+img.height+'px;'+imgStyle+';'+'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+img.src+'\', sizingMethod=\'scale\');"></span>'; 
			img.outerHTML = strNewHTML; 
			i = i-1; 
			}
		}
	} 
window.attachEvent("onload", IE_CorrectAlpha_PNG);


/* Fonction pour ouvrir le contenu d'une fenetre */
function OuvrirContenu(id)
	{
	//alert(document.getElementById(id).style.display);
	if (document.getElementById(id).style.display=='none') document.getElementById(id).style.display='block';
	else document.getElementById(id).style.display='none';
	}


/* Fonction pour ouvrir le contenu d'une fenetre */
function RollOut(id)
	{
		document.getElementById(id).className = document.getElementById(id).className.replace('-RO','');
	}
	
function RollOver(id)
	{
		document.getElementById(id).className = document.getElementById(id).className+'-RO';
	}
	
function ChangerBtn(id)
	{
	if (document.getElementById(id).className.indexOf('-RO') != -1) RollOut(id);
	else RollOver(id);
	}