// fenetre popup au centre
function fenetreCentre(url,nom,largeur,hauteur,options) {
	var haut=(screen.height-hauteur)/2;
	var Gauche=(screen.width-largeur)/2;
	fencent=window.open(url,nom,"top="+haut+",left="+Gauche+",width="+largeur+",height="+hauteur+","+options);
}

// fenetre popup plein ecran
function fenetreSplash(url,nom,options) {
	var Haut=0;
	var Gauche=0;
	var Bas=0;
	var Droite=0;
	fencent=window.open(url,nom,"top="+Haut+",left="+Gauche+",width="+screen.width+",height="+screen.height+","+options);
}

// vérifie email est valide
function checkEmail(element) {
	email = document.getElementById(element).value;
	var msg = '';
	if (email!= "")	{
		indexAroba = email.indexOf('@');
		indexPoint = email.indexOf('.');
		if ((indexAroba < 0) || (indexPoint < 0)) {
			msg += "L'email doit être de la form email@fournisseur.com\n";
		}
		if(email=='email@fournisseur.com') {
			msg += "Vous devez entrer un email valide";
		}
	}
	else { msg += "Vous devez rentrer votre email !!! \n"; }
	if(msg!='') { 
		alert(msg);
		return false;
	}
	else {
		return true;
	}
}

// fonction pour lancer une anim flash
function FlashInt(swf, largeur, hauteur, couleur, nom, cat, maxImg) {
		 document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+largeur+'" height="'+hauteur+'" id="flash" align="middle">');
		 document.write('<param name="allowScriptAccess" value="always" />');
		 document.write('<param name="allowFullScreen" value="false" />');
		 document.write('<param name="movie" value="'+swf+'" />');
		 document.write('<param name="quality" value="high" />');
		 document.write('<param name="flashvars" value="&cat='+cat+'&maxImg='+maxImg+'" />');

		 document.write('<param name="bgcolor" value="'+couleur+'" />');
		  document.write('<embed src="'+swf+'" ');
		   document.write('quality="high" ');
		   document.write('flashvars="&cat='+cat+'&maxImg='+maxImg+'"');
		   document.write('bgcolor="'+couleur+'" ');
		   document.write('width="'+largeur+'" height="'+hauteur+'" ');
		   document.write('name="'+nom+'" ');
		   document.write('align="middle" ');
		   document.write('allowScriptAccess="always" allowFullScreen="false" ');
		   document.write('type="application/x-shockwave-flash" ');
		   document.write('pluginspage="http://www.macromedia.com/go/getflashplayer" />');
		 document.write('</object>');
}

function blink()
{
   if (text_visible)
	 {
	    text_tmp = document.getElementById('CDEmail').value;
			document.getElementById('CDEmail').value = '';
			text_visible = false;
	 }
   else
	 {
	    document.getElementById('CDEmail').value = text_tmp;
			text_visible = true;
	 }
}

function start_blink()
{
   if (document.getElementById('CDEmail').value=='@')
	 {
	    text_timer = setInterval('blink()', 500);
	 }
}

function stop_blink()
{
   if (text_timer)
	 {
	    clearInterval(text_timer);
	 }
 }
 
 
function email_focus()
{
   stop_blink();
	 e = document.getElementById('CDEmail');
	 if (e.value == 'email@fournisseur.com') e.value = '';
}

function email_blur()
{
   e = document.getElementById('CDEmail');
	 if (e.value == 'email@fournisseur.com' || e.value == '')
	 {
	    e.value = 'email@fournisseur.com';
	    start_blink();
	 }
}