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, _width, _height, _player) {

	if(typeof(_width) == 'undefined'){
		_width = 950;
	}
	if(typeof(_height) == 'undefined'){
		_height = 800;
	}		
	if(typeof(_player) == 'undefined'){
		_player = 'iframe';
	}	
    Shadowbox.open({player:_player, 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 nqToolTip() {
	xOffset = 5;
	yOffset = 5;
	
	Dom.getElementsBy(function(e){return e.className=='screenshot';}, 'a', document.body, function(e) {
		YAHOO.util.Event.addListener(e, "mouseover", function(ev) {
			var p = document.createElement('p');
			p.id = 'screenshot';
			p.innerHTML += "<img src='"+ e.rel +"' />";
			document.body.appendChild(p);
			Dom.setStyle(p,'top',(YAHOO.util.Event.getPageY(ev) + xOffset) + "px");
			Dom.setStyle(p,'left',(YAHOO.util.Event.getPageX(ev) + yOffset) + "px");
			Dom.setStyle(p,'display','block');
			});
		YAHOO.util.Event.addListener(e, "mouseout", function(ev) {
			document.body.removeChild(Dom.get('screenshot'));
			});
		YAHOO.util.Event.addListener(e, "mousemove", function(ev) {
			Dom.setStyle('screenshot','top',(YAHOO.util.Event.getPageY(ev) + xOffset) + "px");
			Dom.setStyle('screenshot','left',(YAHOO.util.Event.getPageX(ev) + yOffset) + "px");
			}); 
	});
}


$(function() {
	$(".btn_more").hover(function(){
    	$(this).find('.black').stop().animate({opacity: 0.5}, {queue:false, duration:500});
    },
    function(){
		$(this).find('.black').stop().animate({opacity: 0.2}, {queue:false, duration:350});
    });    
});


$(function() {
	$(".softInterne").hover(function(){
    	$(this).find('.over').stop().animate({opacity: 1}, {queue:false, duration:500});
    },
    function(){
		$(this).find('.over').stop().animate({opacity: 0}, {queue:false, duration:350});
    });    
});

$(function() {
	$('#carousel_partenaires').jcarousel({
		scroll: 1,
		animation: 1000,
		auto: 3,
		wrap: 'circular'
	});
});

$(function() {
	$('#search a').click( function() {
		$('#search form').submit();
	});
});

$(function() {
	$('#titre_actu_0').tooltip();
	$('#titre_actu_1').tooltip();
	$('#titre_actu_2').tooltip();
});