	function redirect( page )
	{
		document.location.href = page ;
	}
	
	function popup( url, height, width )
	{
		var winl = (screen.width - width ) / 2;
		var wint = (screen.height - height ) / 2;
	
		window.open( url, 'POPUP', "top="+wint+", left="+winl+", height="+ height +", width="+width+", menubar=no, resizable=no, scroolbars=no, status=no, toolbar=no" );
	}
	
	function playFlash( pub , largeur , hauteur , couleur , lien )
	{
		document.write("<object type=\"application/x-shockwave-flash\" data=\""+pub+"\" width=\""+largeur+"\" height=\""+hauteur+"\"> \n");
		document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" /> \n");
		document.write("<param name=\"movie\" value=\""+pub+"\" /> \n");
		document.write("<param name=\"menu\" value=\"false\" /> \n");
		document.write("<param name=\"quality\" value=\"BEST\" /> \n");
		document.write("<param name=\"bgcolor\" value=\""+couleur+"\" /> \n");
		document.write("<param name=\"flashvars\" value=\"lien_pub="+lien+"\" /> \n");
		
		document.write("<a href=\""+lien+".html\"><img src=\""+pub+".gif\" width=\""+largeur+"\" height=\""+hauteur+"\" alt=\"\" /> </a> \n");
		
		document.write("</object> \n");
	}
	
	// fonction de vérification du nb de produit comparer !
	
	var nbre_max = 3;
	var nbre     = 0;
	
	function checkbox( num )
	{
		if( ( document.form.produit[num].checked ) == true )
		{
			nbre++;
		}
		else
		{
			nbre--;
		}
		if( nbre > nbre_max )
		{
			alert('Pas plus de 3 ateliers !');
			document.form.produit[num].checked = false;
			nbre--;
		}
	} 
	
	function cacheFavoris( id )
	{
		document.getElementById('fav-' + id ).style.display = 'none' ;
		document.getElementById('fav-a-on-' + id ).style.display = 'none' ;
		document.getElementById('fav-a-off-' + id ).style.display = 'inline' ;
		SetCookie( id , "fermer" ) ;
	}

	function montreFavoris( id )
	{
		document.getElementById('fav-' + id ).style.display = 'block' ;
		document.getElementById('fav-a-on-' + id ).style.display = 'inline' ;
		document.getElementById('fav-a-off-' + id ).style.display = 'none' ;
		SetCookie( id , "ouvert" ) ;
	}
	
	function checkCookie( id )
	{
		if ( GetCookie( id ) == 'fermer' )
		{
			cacheFavoris( id );
		}
		else
		{
			montreFavoris( id );
		}
	}
	
	function SetCookie ( name , value )
	{
		document.cookie = name + "=" + value + ";" ;
	}
	
	function getCookieVal( offset )
	{
		var endstr=document.cookie.indexOf (";", offset);
		if ( endstr == -1 )
		{
			endstr = document.cookie.length;
		}
		return unescape( document.cookie.substring( offset , endstr ) );
	}
	
	function GetCookie( name )
	{
		var arg=name+"=";
		var alen=arg.length;
		var clen=document.cookie.length;
		var i=0;
		while (i<clen) {
			var j=i+alen;
			if (document.cookie.substring(i, j)==arg)
	                        return getCookieVal (j);
	                i=document.cookie.indexOf(" ",i)+1;
	                        if (i==0) break;
		}
		return null;
	}
	
	function SetCookie( name, value )
	{
		var aujourdhui = new Date() ;
		var expdate = new Date() ;
		
		document.cookie = name + "=" + value + ";" ;
	}

	function setOpacity(obj, opacity)
	{
		opacity = (opacity == 100)?99.999:opacity;
		obj.style.filter = "alpha(opacity:"+opacity+")";
		obj.style.KHTMLOpacity = opacity/100;
		obj.style.MozOpacity = opacity/100;
		obj.style.opacity = opacity/100;
		return true;
	}
	
	function fadeIn(objId,opacity)
	{
		if (document.getElementById)
		{
			obj = document.getElementById(objId);
			if (opacity <= 100)
			{
				setOpacity(obj, opacity);
				opacity += 10;
				window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
	    	}
		}
	}
	
	function displayPics()
	{
		var photos 		= document.getElementById('galerie_mini') ;
		var liens 		= photos.getElementsByTagName('a') ;
		var big_photo 	= document.getElementById('big_pict') ;
		var lien_big 	= document.getElementById('lienGrandeImage') ;
		
		for(var i = 0 ; i < liens.length ; i++)
		{
			liens[i].onclick = function()
			{
				big_photo.setAttribute( 'src' , 'medias/images/spacer.gif' );
				big_photo.setAttribute( 'width' , '1' );
				big_photo.setAttribute( 'height' , '1' );
				
				big_photo.setAttribute( 'src' , this.href );
				big_photo.setAttribute( 'width' , '640' );
				big_photo.setAttribute( 'height' , '480' );
				
				lien_big.href = this.href ;
				lien_big.target = '_blank' ;
				
				return false ;
			}
		}
		document.getElementById('grandeImage').setAttribute( 'height' , '480' );
		
		big_photo.setAttribute( 'src' , liens[0].href );
		big_photo.setAttribute( 'width' , '640' );
		big_photo.setAttribute( 'height' , '480' );
		
		lien_big.href   = liens[0].href ;
		lien_big.target = '_blank' ;
	}
	
	function liste_produit()
	{
		select = document.forms.contact.raison.options.selectedIndex + 1 ;
		
		// support technique
		if ( select == 4 )
		{
			// Rendre visible le menu deroulant de produit
			document.getElementById('produit-libelle').style.display = 'inline' ;
			document.getElementById('produit-value').style.display = 'table' ;
		}
		else
		{
			document.getElementById('produit-libelle').style.display = 'none' ;
			document.getElementById('produit-value').style.display = 'none' ;
		}
	}
