$(document).ready(function(){
	$("#tabs").tabs();
	$("#dialog_login").dialog({
			bgiframe: true,
			height: 240,
			width: 500,
			modal: true
		});
});
function showTooltip(x, y, contents) {
    $('<div id="tooltip">' + contents + '</div>').css( {
        position: 'absolute',
        display: 'none',
        top: y + 5,
        left: x + 5,
        border: '1px solid #fdd',
        padding: '2px',
        'background-color': '#fee',
        opacity: 0.80
    }).appendTo("body").fadeIn(200);
}

function masqueTableau($id){
			//get effect type from 
			
			//most effect types need no options passed by default
			var options = {};
			//check if it's scale, transfer, or size - they need options explicitly set
			
			//run the effect
			$("#"+$id).hide('slide',options,500,callback);
};
function afficheTableau($id){
			//get effect type from 
			
			//most effect types need no options passed by default
			var options = {};
			//check if it's scale, transfer, or size - they need options explicitly set
			
			//run the effect
			$("#"+$id).show('slide',options,500,callbackhide);
};
function callback(){
	setTimeout(function(){
		$("#effect:hidden").removeAttr('style').hide().fadeIn();
	}, 1000);
};
function callbackhide(){
	setTimeout(function(){
				$("#effect:visible").removeAttr('style').hide().fadeOut();
			}, 1000);

};

function toutCocherFacture(tab){
	liste=tab.split("#");
	for(i=0;i<liste.length;i++){
		if(document.getElementById("facture_"+liste[i])){
			document.getElementById("facture_"+liste[i]).checked="checked";
		}
	}
}

function toutDecocherFacture(tab){
	liste=tab.split("#");
	for(i=0;i<liste.length;i++){
		if(document.getElementById("facture_"+liste[i])){
			document.getElementById("facture_"+liste[i]).checked="";
		}
	}
}

function recupChamps(){
	var nbr=$("#sortable2").children().length;
	var premier=$("#sortable2").find("li");
	var liste="";
	for(i=0;i<nbr;i++){
		liste+=premier.attr("id")+"##";
		premier=premier.next();
	}
	liste=liste.substring(0,liste.length-2);
	xajax_genereExport(xajax.getFormValues('form_export'),liste);
}



