function addFavoris(link){
	if (window.sidebar)
		window.sidebar.addPanel(document.title, link, '');
	else if(window.opera && window.print) {
		var operA = document.createElement('a');
		operA.setAttribute('href',link); operA.setAttribute('title',document.title); operA.setAttribute('rel','sidebar');
		operA.click();
	} 
	else if(document.all)
		window.external.AddFavorite(link, document.title);
}

function sendMail(link){
	var mail = document.getElementById('partager_link_mail');
	var contain = document.getElementById('partager_link_contain');
	if(mail.style.display == "block"){
		mail.style.display = "none";
		contain.style.marginLeft = "0";
	}
	else{
		var containWidth = document.getElementById('partager_link').offsetWidth;
		mail.style.display = "block";
		contain.style.marginLeft = (mail.offsetWidth-containWidth)+"px";
	}
}

function sendMailValider(id){
	var nom = document.getElementById('plm_nom').value;
	var prenom = document.getElementById('plm_prenom').value;
	var exp = document.getElementById('plm_exp').value;
	var dest = document.getElementById('plm_dest').value;
	var url = document.getElementById('plm_url').value
	$.ajax({
		type: "POST",
    		url: "ajax/partager/mail.php",
	        data: "id="+id+"&nom="+nom+"&prenom="+prenom+"&exp="+exp+"&dest="+dest+"&url="+url,
		success: function(msg){
		$('#partager_link_mail_msg').html(msg);
		}
	});

}

