
function annim_flash( url_annimation , width , height )
  {
	code  = "<object classid='clsid: d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='"+width+"' height='"+height+"'>";
	code += "<param name='movie' value='" + url_annimation + "'> ";
	code += "<param name='quality' value='high'> ";
	code += "<param name='wmode' value='transparent'> ";
	code += "<embed src='"+url_annimation+"' quality='high' wmode='transparent' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+width+"' height='"+height+"'></embed>";
	code += "</object>";

	document.write(code);
  }



function hide_element(id_element)
  {
	element = document.getElementById(id_element);
	if( element.style.display=="none" )
	    {
		element.style.display="";
	    }
	else
	    {
		element.style.display="none";
	    }
  }

function confirmer(commentaire)
  {
	if( confirm(commentaire) )
	  {
		return true;
	  }
	else
	  {
		return false;
	  }
  }

function clignote_element( id_element )
   {
	element = document.getElementById( id_element );
	element.style.backgroundColor = '#FF0000';
	setTimeout( "element.style.backgroundColor = '#FFFFFF';" , 400 );
	setTimeout( "element.style.backgroundColor = '#FF0000';" , 600 );
	setTimeout( "element.style.backgroundColor = '#FFFFFF';" , 1600 );
   }


function verif_email(mail)
  {
	var arobase = mail.indexOf('@');
	var point = mail.lastIndexOf('.');
	if((arobase < 3)||(point + 2 > mail.length) || (point < arobase+3)) return false;
	return true;
  }

function is_numeric(num)
	{
		var exp = new RegExp( "^[0-9-.]*$" , "g" );
		return exp.test(num);
	}


function check_input_text( id_element )
   {
	if( document.getElementById( id_element ).value=="" )
	  {
		alert("Le champ est vide");
		clignote_element( id_element );
		document.getElementById( id_element ).focus();
		return false;
	  }
	else
	  {
		return true;
	  }
   }

function check_email( id_element )
  {
	if(!verif_email(document.getElementById( id_element ).value))
	  { 
		alert("Erreur email");
		clignote_element( id_element );
		document.getElementById( id_element ).focus();
		return false;
	  }
	else
	  {
		return true;
	  }
  }

function check_selectbox( id_element , default_value )
   {
	if(document.getElementById( id_element ).selectedIndex != default_value)
	  {
		return true;
	  }
	else
	  {
	  	alert("Vous devez selectionner une option dans la liste déroulante");
		clignote_element( id_element );
		document.getElementById( id_element ).focus();
		return false;
	  }
   }




function check_formulaire_contact()
   {
	if( !check_input_text("nom") )		{ return false; }
	if( !check_input_text("prenom") )		{ return false; }
	if( !check_email("email") )	 		{ return false; }
	if( !check_selectbox("sujet" , "0" ) )	{ return false; }

	return true;
   }



function change_texte_sujet( value )
   {
	for( i=1 ; i<7 ; i++ )
	  {
		document.getElementById( 'txt_option_' + i ).style.display = "none";
	  }

	document.getElementById( 'txt_option_' + value ).style.display = "";

   }






