// Lightbox
$(document).ready(function(){$("a.lightbox").lightBox();});

// Target _blank
$(document).ready(function(){$('a[href^="http://"]').attr("target", "_blank");});
$(document).ready(function(){$('a[href^="https://"]').attr("target", "_blank");});

// Presse papier
function copyclipboard(intext) {
   
   window.clipboardData.setData('Text', intext);
}

// Ajax
function ajax(file, id, data){

	$.ajax({
		type: "POST",
		url: "ajax/"+file,
		data: data,
		success: function(html){
			$("#"+id).html(html);
			ajxcharge='ok';
		}
	});
}

function openm(quoi, nbrmess) {
	
		for(var i=1;i<=nbrmess;i++){
			
			if(document.getElementById('text'+i)){
				if(document.getElementById('text'+i).style.display == ''){
					document.getElementById('text'+i).style.display = 'none';
				}
			}
		}
	
		document.getElementById('text'+quoi).style.display = '';
		document.getElementById('objet'+quoi).style.fontWeight = 'normal';
		ajax('../ajax/read_message.php', '', 'id='+quoi)
}

function popup(url, width, height){
	
	var top =(screen.height-width)/2;     
	var left =(screen.width-height)/2; 
	
	window.open(url, 'exemple', 'height='+height+', width='+width+', top='+top+', left='+left+', toolbar=no, menubar=yes, location=no, resizable=yes, scrollbars=no, status=no');
}


$(document).ready(function(){

	$(".openAbout").click(function(){
		$("#about").slideToggle("slow");
		$(this).toggleClass("active"); return false;
	});
	
});

$(document).ready(function(){

	$(".openDir").click(function(){
		$("#dir").slideToggle("slow");
		$(this).toggleClass("active"); return false;
	});
	
});