/*------------------------------------------*/
/* INIT										*/
/*------------------------------------------*/
var lock = new Array();

/*------------------------------------------*/
/* fonction	pour mini-carousel				*/
/*------------------------------------------*/
function mcar_zoom(id, sid)
	{
	//alert("id="+id+", sid="+sid);

	generic = 'generic_'+id;
	source = 'details_a_'+id;
	dst = 'details_b_'+id;

	//--------------- Gestion div
	if(sid>0)
		{
		if(lock[id]!='') 
			{
			div1 = dst;
			div2 = source;
			lock[id]=0;
			}
		else 
			{
			div1 = source;
			div2 = dst;
			lock[id]=1;
			}
		}

	//--------------- FADE
	if(sid>0)
		{
		$(div1).setStyle('display','block');
		$(div2).setStyle('display','block');
		$(generic).setStyle('display','none');

		var fx1 = new Fx.Style(div1, 'opacity', {duration: 2000, transition: Fx.Transitions.linear, unit: ''});
		fx1.start(1,0);
		}

	//--------------- CHANGE IMG
	if(sid==0) 
		{
		$(dst).setStyle('display','none');
		$(source).setStyle('display','none');
		$(generic).setStyle('display','block');
		}
	else 
		{
		$(div2).src="img/cat/details/"+id+"_"+sid+".jpg";
		}

	//--------------- APPEAR
	if(sid>0)
		{
		if (window.webkit419) end=0.9999; else end=1;	// Workaround for Safari 2.0
		var fx2 = new Fx.Style(div2, 'opacity', {duration: 3000, transition: Fx.Transitions.linear, unit: ''});
		fx2.start(0,end);
		}
	}

/*------------------------------------------*/
/* fonction	pour popup						*/
/*------------------------------------------*/
function popup(num)
	{
	dest='';
	switch(num)
		{
		case 1: dest='contact.php'; x=325; y=360; break;
		case 2: dest='plan_acces.php'; x=610; y=360; break;
		case 3: dest='mentions-legales.php'; x=400; y=450; break;
		}

	if(dest!='') open_popup(x, y, dest);
	}

/*------------------------------------------*/
function open_popup(x,y,page)
	{
	t=window.open(page,x+'x'+y,'top='+(((screen.height)/2)-(y/2))+',left='+(((screen.width)/2)-(x/2))+',toolbar=no, location=0, directories=0, status=0, scrollbars=yes, menu=no, width='+x+',height='+y);
	t.focus();
	}