// detection du plug-in flash 5 et +
var UseFlash = 0;
if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] ) {
	// Test si Flash version 5 ou + dans Netscape
	var plugin = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
	if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1))>=5)
		UseFlash = 1;
} else if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
	navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	// Suppose que IE Win accepte le tag OBJECT
	UseFlash = 1;
}
// fenetre popup devis
function wpopup(fic) {
	window.onerror = null;
//	scr_w = screen.availWidth;
	scr_h = screen.availHeight;

	w = 640;
	h = (scr_h-50)*0.75;

	size= ",width=" + w + ",height=" + h;
	wpop = window.open(fic,"DEVIS","scrollbars=yes,resizable=no,toolbar=no,status=no,menubar=no,location=no,directories=no"+size);
	wpop.moveTo ( 50,50 );
//	wflash.moveTo ( (scr_w - (w+50)),(scr_h - (h+50)) );
	wpop.focus();
}

// fenetre popup certif
function wpopup2(fic) {
	window.onerror = null;
//	scr_w = screen.availWidth;
	scr_h = screen.availHeight;
	w = 450;
	h = 550;
	size= ",width=" + w + ",height=" + h;
	wpop2 = window.open(fic,"Certificat","scrollbars=yes,resizable=no,toolbar=no,status=no,menubar=no,location=no,directories=no"+size);
	wpop2.moveTo ( 50,50 );
//	wflash.moveTo ( (scr_w - (w+50)),(scr_h - (h+50)) );
	wpop2.focus();
}

// fenetre popup certif oseo
function wpopup3(fic) {
	window.onerror = null;
//	scr_w = screen.availWidth;
	scr_h = screen.availHeight;
	w = 720;
	h = 520;
	size= ",width=" + w + ",height=" + h;
	wpop3 = window.open(fic,"OSEO excellence 2010","scrollbars=no,resizable=no,toolbar=no,status=no,menubar=no,location=no,directories=no"+size);
	wpop3.moveTo ( 50,50 );
	wpop3.focus();
}

function VerifEmail(elm) {
	var email = elm.value;
	var aroba = email.indexOf("@");
	var point = email.indexOf(".", aroba);

	if ( (aroba == -1)
			|| ((point == -1) || (point == (aroba + 1)))
			|| ((email.lastIndexOf(".") + 1) == email.length)
			|| (email.indexOf("..") != -1) )
	{
		return false;
	}
	return true;
}

// test validation du formulaire
function formvalid(f) {
/*
	if (f.email.value == '') {
		alert( "Vous devez saisir votre adresse email" );
		f.email.focus();
		return false;
	}
*/
	if (f.email.value == '') {
		return true
	}
	else if ( VerifEmail(f.email) == false) {
		alert( "Votre adresse email n'est pas valide" );
		f.email.focus();
		return false;
	}
	else {
		return true;
	}
}