function PopupCentrer(page,name,largeur,hauteur,options) 
{
    var top=(screen.height-hauteur)/2;
    var left=(screen.width-largeur)/2;
    window.open(page,name,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}
    
function openShadowbox( _page ) {
    Shadowbox.open({player:'iframe',content:_page,height:800,width:950, options:{fadeDuration:0.1, resizeDuration:0.1, animSequence:"sync"}});
}

function openShadowboxTailleVoulu( _page, width_, height_) {
    Shadowbox.open({player:'image',content:_page,height:height_,width:width_, options:{fadeDuration:0.1, resizeDuration:0.1, animSequence:"sync"}});
}

function closeShadowbox( _goto ) {
    Shadowbox.close();
    
    if(typeof(_goto) != 'undefined')
        document.location.replace(_goto);
}

function is_mail(mail){
	var filter_email=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	return filter_email.test(mail);
}

var t_res;

function preload( t_img ) 
{
	t_res = new Array()
	for(var i=0;i<t_img.length;i++)
	{
		var el = new Image();
		el.src = t_img[i];
		t_res.push( el );
	}
}



function goToParole(idPuce,nombrePuce,isrunning)
	{
		var index_next_parole;
		
		if(typeof(timeout_paroles)!='undefined') {
			window.clearTimeout(timeout_paroles);
			delete(timeout_paroles);
		}
		
		//Dom.get('numParole').innerHTML = idPuce+1;
		var attributes = {
					scroll: { to: [250*idPuce, 0] }
				};
				var anim = new YAHOO.util.Scroll('sliderBoutique', attributes, 0.8, YAHOO.util.Easing.easeIn);
				anim.animate();
				
		for(var i=0;i<nombrePuce;i++)
		{
			Dom.get('puceBoutique'+i).src ="images/interfaces/spot-off.png";
		}
		Dom.get('puceBoutique'+idPuce).src ="images/interfaces/spot-on.png";
		
		if(idPuce==(nombrePuce-1)) {
			index_next_parole = 0;
		}
		else {
			index_next_parole = idPuce+1;
		}
		
		//On coupe le time out si il y'a eu un click
		if(isrunning == true)
		{
			timeout_paroles = window.setTimeout('goToParole('+index_next_parole+','+nombrePuce+',true)',5000);
		}
	}
	
	
function placeAnimHome()
{
	var chiffreAlea = Math.random()*10000;
	swfobject.embedSWF("flash/demo-animation.swf?random_chiffre="+chiffreAlea, "animationFlashHome", "620", "270", "9.0.0","expressInstall.swf", {}, {wmode:"transparent", quality:"high"}, {id:"FlashObjectId"});
}


function reloader(){
 
	jQuery('.containerbis .active-textbis').animate({opacity:1, marginLeft: "-180px"}, 1000);	
	jQuery('.containerbis .active-textbisa').delay(300).animate({opacity:1, marginLeft: "-180px"}, 1000);
	jQuery('.containerbis .active-textbisb').delay(600).animate({opacity:1, marginLeft: "-180px"}, 1000);
};


