/*
________________________________________________________________________________________________
GESTION POPUP
*/
function closeDivPopup()
{	
	$("#futur_popup").removeAttr("style");
	$("#futur_popup").html('');
}

function openDivPopup(params, vertical)
{	
	// vertical: si vertical ou non
	if (typeof(vertical)=="undefined") vertical=false;
	
	$("#futur_popup").show();
	
	var newHeight="100%";
	var newWidth="100%";
	if (document.all) 
		newHeight=document.body.scrollHeight+"px";
	else 
		newHeight=document.documentElement.scrollHeight+"px";
	
	$("#futur_popup").css('height', newHeight);
	$("#futur_popup").css('width', newWidth);
	
	$.ajax({
		type: "GET",
		url: "/_global/popup/view.php",
		data: params + "&pv=" + (vertical?'on':''),
		success: function(transport){
			//alert( "Data Saved: " + transport );
			if(transport != 0)
			{
				$("#futur_popup").html(transport);
			} else location.href = '/_erreur/index.php';
		}		   
	});
}

/*
________________________________________________________________________________________________
CONFIRMATION
*/
function confirmation(message,lien) {
	if (confirm(message)) location.href=lien;
}

/*
________________________________________________________________________________________________
GESTION TOOLS RESIZE
*/
//Spécifie la fourchette des différentes tailles
var tailles = new Array( '80%','90%','100%','110%','120%','130%' );
var firstSize = 2;  
function resizeFonts(classe, coef) {
	/* Construit la taille du texte : + / - */
	var taille = firstSize;
	taille += coef;
	if ( taille < 0 ) taille = 0;
	if ( taille > 4 ) taille = 4;
	firstSize = taille;
	
	/* Récupere les classe aui vont êtr modifier*/
	cibles = $('.' + classe);
	for(i=0; i < cibles.length; i++)
	{
		cibles[i].style.fontSize = tailles[taille];
	}
}

/*
________________________________________________________________________________________________
BACK TOP
*/
$(document).ready(function() {
    $('a[href=#top]').click(function(){
        $('html, body').animate({scrollTop:0}, 'slow');
        return false;
    });
});
