function setpng(img) { if(document.all && (IEver=parseFloat(navigator.appVersion.split("MSIE")[1])) && (IEver>=5.5) && (IEver<7) && document.body.filters && img) {
	imgName=img.src.toUpperCase();
	if(imgName.substring(imgName.length-3,imgName.length)=="PNG") img.outerHTML=
		"<span "+(img.id?"id='"+img.id+"' ":"")+(img.className?"class='"+img.className+"' ":"")+(img.title?"title=\""+img.title+"\" ":"")
		+"style=\"width:"+img.width+"px;height:"+img.height+"px;"+(img.align=="left"?"float:left;":(img.align=="right"?"float:right;":""))
		+(img.parentElement.href?"cursor:hand;":"")+"display:inline-block;"+img.style.cssText+";"
		+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+img.src+"',sizingMethod='scale');\"></span>";
}}


function recadre_btn_milieu()
{
	if(document.getElementById('nb_lien_btn_milieu'))
	{
		nb_el = document.getElementById('nb_lien_btn_milieu').value;
		width_max = 130;
		
		for(i = 1; i <= nb_el; i++)
		{
			el_width = document.getElementById('fond_btn_milieu_' + i).offsetWidth;
			if(el_width > width_max)
			{
				document.getElementById('fond_btn_milieu_' + i).style.width = width_max + 'px';
			}
		}
	}
}



function affiche_nav_flash(etat)
{
	switch(etat)
	{
		case '':
		document.getElementById('img_roll_nav').style.display = 'none';
		document.getElementById('nav_flash').style.display = '';
		break;
		case 'none':
		if(!testerconfig()) document.getElementById('img_roll_nav').style.display = '';
		document.getElementById('nav_flash').style.display = 'none';
		break;
	}
}

function masquer_image_roll()
{
	document.getElementById('img_roll_nav').style.display = 'none';
}

function testerconfig()
{
	var quelSyst = 1;

	if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.indexOf("Mac") != -1 )
	{
		quelSyst = 0; //si le navigateur est explorer sous Mac
	}
	else 
	{
		quelSyst = 0; //si le navigateur est un netscape ou mozilla ou firefox
	}

	if(quelSyst == 1) return true;
	else return false;
}

function afficher_actu(id_actu)
{
	if(document.getElementById('actu_' + id_actu).style.display == 'none')
	{
		document.getElementById('actu_' + id_actu).style.display = '';
		document.getElementById('img_puce_' + id_actu).src = 'squelettes/IMG/puce-actu-bas.gif';
	}
	else
	{
		document.getElementById('actu_' + id_actu).style.display = 'none';
		document.getElementById('img_puce_' + id_actu).src = 'squelettes/IMG/puce-actu-droite.gif';
	}
}


/* Formulaires */
function verif_form_contact(form_name) {
	error = false;
	form = form_name;
	error_message = "Merci de remplir ou corriger les champs suivants\n\n";
	check_input("societe", '1', "Votre societe\n");
	check_input("nom", '1', "Votre nom\n");
	check_input("prenom", '1', "Votre prenom\n");
	check_input("fonction", '1', "Votre fonction\n");
	
	check_input_email("email", "Votre email\n");
	check_input("verif", '1', "Le code de verification\n");
	check_select("message", "", "Votre message\n");

	if (error == true) {
		alert(error_message);
		return false;
	} else {
		submitted = true;
		return true;
	}
}
function verif_form_contact2(form_name) {
	error = false;
	form = form_name;
	error_message = "Merci de remplir ou corriger les champs suivants\n\n";
	
	check_checkbox_multiple("objet[]","L'objet de votre demande\n");
	check_input("societe", '1', "Votre societe\n");
	check_input("nom", '1', "Votre nom\n");
	check_input("prenom", '1', "Votre prenom\n");
	
	check_input("fonction", '1', "Votre fonction\n");
	check_input_email("email", "Votre email\n");
	check_input("verif", '1', "Le code de verification\n");
	

	if (error == true) {
		alert(error_message);
		return false;
	} else {
		submitted = true;
		return true;
	}
}
function verif_form_recrutement(form_name) {
	error = false;
	form = form_name;
	error_message = "Merci de remplir ou corriger les champs suivants\n\n";
	
	check_input("nom", '1', "Votre nom\n");
	check_input("prenom", '1', "Votre prenom\n");
	check_input("adresse", '1', "Votre adresse\n");
	check_input("cp", '1', "Votre code postal\n");
	check_input("fichier", '1', "Votre fichier joint\n");
	check_input_email("email", "Votre email\n");

	if (error == true) {
		alert(error_message);
		return false;
	} else {
		submitted = true;
		return true;
	}
}

function verif_form_projet(form_name) {
	error = false;
	form = form_name;
	error_message = "Merci de remplir ou corriger les champs suivants\n\n";
	
	check_input("nom", '1', "Votre nom\n");
	check_input("prenom", '1', "Votre prenom\n");
	check_input_email("email", "Votre email\n");
	check_select("message", "", "Votre message\n");

	if (error == true) {
		alert(error_message);
		return false;
	} else {
		submitted = true;
		return true;
	}
}

function emailvalide(adresse)
{
	var str = new String(adresse);
	var point = str.lastIndexOf('.');
	var arobase = str.lastIndexOf('@');
	var espace = str.indexOf(' ');
	var lgtotal = str.length;
		
	if( (lgtotal-point <3) || point == -1 || arobase == -1 || espace != -1 || point < arobase || (point-arobase <=1))
		return false;
	else return true;
}

function verifformnewsletter()
{
	var chpemail = document.newsletter.email.value;
	if(!chpemail || !emailvalide(chpemail))
	{
		alert("L'adresse email saisie n'a pas un format correct.");
		return false;
	}
	else return true;
}

/* ZOOM IMAGE */
function afficher_zoom(fichier, lien_site)
{
	var so = new SWFObject(lien_site + "swf/zoom-image.swf", "zoomimage", "100%", "100%", "9", "");
	so.addParam("scale", "noscale");
	so.addParam("wmode", "transparent");
	so.addParam("FlashVars","fichier="+fichier);
	so.write("zoom_image");

	afficher("zoom_image","block");
	
	// masque du champs select pour IE6 >_<
	document.getElementById("pays").style.visibility = "hidden";
	
	window.scrollTo(0,0);
}

function afficher(info,etat)
{
	var object = info;
	
	if (document.layers && document.layers[object])
	{ 
		//document.layers[object].visibility = etat;
		document.layers[object].display = etat;
	} 
	else if (document.all)
	{ 
		//document.all[object].style.visibility = etat;
		document.all[object].style.display = etat;
	}
	else if (document.getElementById) 
	{
		//document.getElementById(object).style.visibility = etat; 
		document.getElementById(object).style.display = etat;
	} 
}

function fermer_zoom()
{
	afficher("zoom_image","none");
	
	// ré affichage du champs select pour IE6 >_<
	document.getElementById("pays").style.visibility = "visible";
}
function fin_anim()
{

		window.location.href="spip.php?page=contact&type=animation";

}
/* */
