function confirm(titre,message,func){mess=message;mess+="<br /><br /><input type=button class=yes id='Oui' value='Oui' />";mess+="<input type=button class=no id='Non' value='Non' />";Popup(mess,titre);$("body").delegate('#Popup #Oui',"click",function(e){ClosePopup();try{func()}catch(exception){$(func).click()}$("body").undelegate('#Popup #Oui')});$("body").delegate('#Popup #Non,#Popup #Close',"click",function(e){ClosePopup();$("body").undelegate('#Popup #Oui')});return false}function Popup(data,titre){if(titre!=null){$('#Popup .titre').html(titre)}$('#Popup .content').html(data);width=$(window).width();pwidth=$('#Popup').width();left=width/2-pwidth/2;bordure=20;margintop=200;$('#Popup').css('left',Math.round(left));$('#Popup').css('top',margintop);$('#Popup').css('position','fixed');$('#Popup').show();_Voile()}function _Voile(){bordure=20;pwidth=$('#Popup').width();pheight=$('#Popup').height();left=parseInt($('#Popup').css('left'));margintop=parseInt($('#Popup').css('top'));$('#Voile').css('height',pheight+bordure*4);$('#Voile').css('width',pwidth+bordure*4);$('#Voile').css('left',left-bordure);$('#Voile').css('top',margintop-bordure);$('#Popup').css('position','fixed');$('#Voile').show();}function ClosePopup(){$('#Popup').hide();$('#Voile').hide();$('#Popup .titre').html('')}$(function(){$('body').prepend('<div id="Popup">'+'<div class="barre"></div>'+'<div class="titre"></div>'+'<div class="close">'+'<a href="" id="Close" onclick="ClosePopup();return false;" title="Fermer"></a>'+'</div>'+'<div class="content"></div>'+'</div>'+'<div id="Voile"></div>');$("#Popup").draggable({drag:function(){_Voile()}})});
