//////////////////////
// STELA JS LIB

/* ***************************************************** *
 *  Modifications du 26/juil./2004
 *
 *	AMJ-goupe©2004	batteur@AMJ-groupe.com
 *
 *	MODIFICATION TABLE DE REFACTION
 *	'stela-profiles-modif.php' fait 
 *	appel à la fonction 'refacVerifDelai()' de lib/stela-jslib.js
 *	au moment de la validation dans
 *	'templates/stela-simulation-couts.tpl'
 *	 
 *	Modifications du 28/03/2008 16:30:41
 *	changement des valeurs des indices de calculs de la table de refaction
 *	0.76 -> 0.89
 *	0.75 -> 0.89
 *	0.76 -> 0.9
 *	0.75 -> 0.89
 *	0.76 -> 0.9
 *	0.45 -> 0.53       
 *	 
 *	Modifications du 22/12/2008 18:55:37
 *	changement des valeurs des indices de calculs de la table de refaction
 *	sont désormais sous forme de variables 
 *	$30j = 0.81
 *	$25j = 0.82
 *	$20j = 0.82
 *	$15j = 0.82
 *	$10j = 0.81
 *	$5j = 0.49
 *	
 *  Modifications du 24/03/2009 19:42:25
 *  $30j = 0.54;
 *  $25j = 0.53;
 *  $20j = 0.54;
 *  $15j = 0.53;
 *  $10j = 0.54;
 *  $5j = 0.32;   
 
 * ***************************************************** */


function swap(_Obj, _index,  _Type) {
  document.images[_Obj+_index].src = "/styles/common/"+_Obj+"_"+_Type+".jpg";
}

function facture_print(cecli, fac){
        var win = window.open("../stela_print_facture.php?CECLI="+cecli+"&FAEFAC="+fac,"Impressionfacture", "width=650, height=550, scrollbars=yes, resizable=yes, menubar=1");
        win.focus();
}

function stela_dev() {
        var win = window.open("", "StelaDev", "width=250, height=150, scrollbars=no, resizable=no");
        with(win.document) {
                write("<HTML><HEAD><TITLE>Page non-valid&eacute;e</TITLE></HEAD>");
                write("<BODY BGCOLOR=\"#c3c3c3\">");
                write("<IMG SRC=\"/styles/common/dev.jpg\" ALT=\"Annonce\"><font size=\"2\">Cette page est en cours de validation.</font>");
                write("<CENTER><BUTTON ONCLICK=\"window.close();\">Fermer</CENTER>");
                write("</BODY></HTML>");
                close();
        }
        win.focus();
}

function cecli_infos(cecli) {
        var win = window.open("../stela_getclient_infos.php?CECLI="+cecli, "InfosCeCLI", "width=700, height=350, scrollbars=no, resizable=no");
        win.focus();
}

function effacer_faq(faqId, offset, sort_mode, questionId) {
        var win = window.open("", "GroupeAlerte", "width=250, height=150, scrollbars=no, resizable=no");
        win.document.write("<HTML><HEAD><TITLE>Effacer cette FAQ ?</TITLE></HEAD>");
        win.document.write("<BODY BGCOLOR=\"#c3c3c3\">");
        win.document.write("<CENTER>");
        win.document.write("<TABLE BORDER='0' WIDTH='100%' CELLPADDING='3'>");
        win.document.write("<TR><TD><IMG SRC=\"/styles/common/Warning2.jpg\" alt=Warning!></TD><TD VALIGN=\"middle\">");
        win.document.write("<font size=\"2\">Etes-vous sur de bien vouloir effacer definitivement cette faq ?</font><BR><BR>");
        win.document.write("<button onClick=\"window.opener.location.href='tiki-faq_questions.php?faqId="+faqId+"&amp;&amp;offset="+offset+"&amp;sort_mode="+sort_mode+"&amp;remove="+questionId+"'; window.close();\"> Confirmer </button>&nbsp;");
        win.document.write("<button onClick=\"window.close();\"> Annuler </button>");
        win.document.write("</TD></TR></TABLE></CENTER>");
        win.document.write("</BODY>");
        win.document.write("</HTML>");
	    win.focus();
}


function effacer_image( galId, imgId ){
        var win = window.open("", "GroupeAlerte", "width=250, height=150, scrollbars=no, resizable=no");
        win.document.write("<HTML><HEAD><TITLE>Effacer cette image ?</TITLE></HEAD>");
        win.document.write("<BODY BGCOLOR=\"#c3c3c3\">");
        win.document.write("<CENTER>");
        win.document.write("<TABLE BORDER='0' WIDTH='100%' CELLPADDING='3'>");
        win.document.write("<TR><TD><IMG SRC=\"/styles/common/Warning2.jpg\" alt=Warning!></TD><TD VALIGN=\"middle\">");
        win.document.write("<font size=\"2\">Etes-vous sur de bien vouloir effacer definitivement cette image ?</font><BR><BR>");
        win.document.write("<button onClick=\"window.opener.location.href='tiki-browse_gallery.php?galleryId="+galId+"&amp;remove="+imgId+"'; window.close();\"> Confirmer </button>&nbsp;");
        win.document.write("<button onClick=\"window.close();\"> Annuler </button>");
        win.document.write("</TD></TR></TABLE></CENTER>");
        win.document.write("</BODY>");
        win.document.write("</HTML>");
    win.focus();
}

function file_delete(galleryId, offset, sort_mode, fileId, fileName) {
        var win = window.open("", "Effacerfic", "width=250, height=150, scrollbars=no, resizable=no");
        win.document.write("<HTML><HEAD><TITLE>Effacer un fichier ?</TITLE></HEAD>");
        win.document.write("<BODY BGCOLOR=\"#c3c3c3\">");
        win.document.write("<CENTER>");
        win.document.write("<TABLE BORDER='0' WIDTH='100%' CELLPADDING='3'>");
        win.document.write("<TR><TD><IMG SRC=\"/styles/common/Warning2.jpg\" alt=Warning!></TD><TD VALIGN=\"middle\">");
        win.document.write("<font size=\"2\">Etes-vous sur de bien vouloir effacer definitivement ce fichier <i><b>( "+fileName+" )</b></i> ?</font><BR><BR>");
        win.document.write("<button onClick=\"window.opener.location.href='tiki-list_file_gallery.php?galleryId="+galleryId+"&amp;offset="+offset+"&amp;sort_mode="+sort_mode+"&amp;update="+fileId+"&amp;remove="+fileId+"'; window.close();\"> Confirmer </button>&nbsp;");
        win.document.write("<button onClick=\"window.close();\"> Annuler </button>");
        win.document.write("</TD></TR></TABLE></CENTER>");
        win.document.write("</BODY>");
        win.document.write("</HTML>");
        win.document.close();
        win.focus();
}




function user_delete(offset, sort_mode, user) {
        var win = window.open("", "GroupeAlerte", "width=250, height=150, scrollbars=no, resizable=no");
        win.document.write("<HTML><HEAD><TITLE>Oter un Utilisateur ?</TITLE></HEAD>");
        win.document.write("<BODY BGCOLOR=\"#c3c3c3\">");
        win.document.write("<CENTER>");
        win.document.write("<TABLE BORDER='0' WIDTH='100%' CELLPADDING='3'>");
        win.document.write("<TR><TD><IMG SRC=\"/styles/common/Warning2.jpg\" alt=Warning!></TD><TD VALIGN=\"middle\">");
        win.document.write("<font size=\"2\">Etes-vous sur de bien vouloir effacer definitivement cet utilisateur <i><b>( "+user+" )</b></i> ?</font><BR><BR>");
        win.document.write("<button onClick=\"window.opener.location.href='tiki-adminusers.php?offset="+offset+"&amp;sort_mode="+sort_mode+"&amp;user="+user+"&amp;action=delete'; window.close();\"> Confirmer </button>&nbsp;");
        win.document.write("<button onClick=\"window.close();\"> Annuler </button>");
        win.document.write("</TD></TR></TABLE></CENTER>");
        win.document.write("</BODY>");
        win.document.write("</HTML>");
        win.document.close();
        win.focus();
}

function groupe_oter(offset, sort_mode, user, group, real_group) {
        var win = window.open("", "GroupeAlerte", "width=250, height=150, scrollbars=no, resizable=no");
        win.document.write("<HTML><HEAD><TITLE>Oter un groupe</TITLE></HEAD>");
        win.document.write("<BODY BGCOLOR=\"#c3c3c3\">");
        win.document.write("<CENTER>");
        win.document.write("<TABLE BORDER='0' WIDTH='100%' CELLPADDING='3'>");
        win.document.write("<TR><TD><IMG SRC=\"/styles/common/Warning2.jpg\" alt=Warning!></TD><TD VALIGN=\"middle\">");
        win.document.write("<font size=\"2\">Etes-vous sur de bien vouloir &ocirc;ter cet utilisateur <i><b>( "+user+" )</b></i> de ce groupe <b><i>( "+ group +" )</i></b> ?</font><BR><BR>");
        win.document.write("<button onClick=\"window.opener.location.href='tiki-adminusers.php?offset="+offset+"&amp;sort_mode="+sort_mode+"&amp;user="+user+"&amp;action=removegroup&amp;group="+real_group+"'; window.close();\"> Confirmer </button>&nbsp;");
        win.document.write("<button onClick=\"window.close();\"> Annuler </button>");
        win.document.write("</TD></TR></TABLE></CENTER>");
        win.document.write("</BODY>");
        win.document.write("</HTML>");
        win.document.close();
        win.focus();
}


function go_export() {
        var win = window.open("", "XMLAlerte", "width=250, height=150, scrollbars=no, resizable=no");
        win.document.write("<HTML><HEAD><TITLE>XML Alerte</TITLE></HEAD>");
        win.document.write("<BODY BGCOLOR=\"#c3c3c3\">");
        win.document.write("<CENTER>");
        win.document.write("<TABLE BORDER='0' WIDTH='100%' CELLPADDING='3'>");
        win.document.write("<TR><TD><IMG SRC=\"/styles/common/Warning.jpg\"></TD><TD VALIGN=\"middle\">");
        win.document.write("<font size=\"2\">Etes-vous sur de bien vouloir exporter la table des clients STELA ?</font><BR><BR>");
        win.document.write("<button onClick=\"window.opener.document.stela_xml_form.submit(); window.close();\"> Confirmer </button>&nbsp;");
        win.document.write("<button onClick=\"window.close();\"> Annuler </button>");
        win.document.write("</TD></TR></TABLE></CENTER>");
        win.document.write("</BODY>");
        win.document.write("</HTML>");
        win.document.close();
        win.focus();
}


// This function send a post query to the httpd
function go() {
        var win = window.open("", "XMLAlerte", "width=250, height=150, scrollbars=no, resizable=no");
        win.document.write("<HTML><HEAD><TITLE>XML Alerte</TITLE></HEAD>");
        win.document.write("<BODY BGCOLOR=\"#c3c3c3\">");
        win.document.write("<CENTER>");
        win.document.write("<TABLE BORDER='0' WIDTH='100%' CELLPADDING='3'>");
        win.document.write("<TR><TD><IMG SRC=\"/styles/common/Warning.jpg\"></TD><TD VALIGN=\"middle\">");
        win.document.write("<font size=\"2\">Etes-vous sur de bien vouloir modifier la base de donn&eacute;es existante ?</font><BR><BR>");
        win.document.write("<button onClick=\"window.opener.document.stela_xml_form.submit(); window.close();\"> Confirmer </button>&nbsp;");
        win.document.write("<button onClick=\"window.close();\"> Annuler </button>");
        win.document.write("</TD></TR></TABLE></CENTER>");
        win.document.write("</BODY>");
        win.document.write("</HTML>");
        win.document.close();
        win.focus();
}

function facture_go(fac) {
  with(document.invoices_list){
    FAEFAC.value = fac;
    submit();
  }
}

function download_file(str) {
    setTimeout("window.location.href="+str,3000);
//    window.location.href=str;
}

//check if the value is a number
function IsNumeric(sText)
{
   var ValidChars = "0123456789.";
   var sValue=sText.value;
   var Char;

 
   for (i = 0; i < sValue.length; i++) 
      { 
      Char = sValue.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
        alert('Veuillez saisir un nombre (00.00)');
        sText.focus()
         }
      }
   
}

function simulationCouts(){
var bolResult;
//return the prefered method: 'depot' OR 'rafin'

    with(document.simulation_couts){
        //Check not null
        if (raffinerie_temp.value != '' && depot_temp.value != '' && raffinerie_prix.value != '' && depot_prix.value != ''){
              ecart_temp.value = parseFloat(raffinerie_temp.value) - parseFloat(depot_temp.value);      
              ecart_prix.value = parseFloat(ecart_temp.value) * parseFloat(val_cm.value);
              moins_ecart_prix.value = parseFloat(ecart_prix.value);
              res_depot_prix.value = parseFloat(depot_prix.value);
              prix_eq_raff.value = parseFloat(res_depot_prix.value) - parseFloat(moins_ecart_prix.value);
              ecart_prix_raff.value = parseFloat(raffinerie_prix.value) - parseFloat(prix_eq_raff.value);
        }else{
            alert("Veuillez saisir des valeurs.");
        } 
    }

    // best to use rafinerie
    if (document.simulation_couts.ecart_prix_raff.value < 0)
        {bolResult = 'rafin';}
    // best to use rafinerie
    if (document.simulation_couts.ecart_prix_raff.value > 0)
        {bolResult = 'depot';}
    // No obvious choice
    if (document.simulation_couts.ecart_prix_raff.value == 0)
        {bolResult = '';}

return bolResult;
}


Number.prototype.toFixed = function(decimals)
  {
    if(isNaN(this)){
    return(NaN);
    }
    var decimals = decimals || 2; // defaults to two
    if ( decimals == 2 ) {
    
    }
    var catalyst = Math.pow(10, decimals);
    var fixedNum = Math.round(parseFloat(this) * catalyst) / catalyst;
    
    if (fixedNum % 1)
    {
      return fixedNum
    }
    
    var str = "."
    
    while(decimals--)
    {
      str += "0"
    }
    
    return fixedNum + str
  }

function initFields() {
	document.all.refacSdelaiActuel.selectedIndex=0;
	document.all.refacSdelaiNouveau.selectedIndex=0;
	document.all.delai_m3.value = document.all.refacSdelaiActuel.value;
	document.all.delai_s_m3.value = document.all.refacSdelaiNouveau.value;
}

function refacVerifDelai() {
// modif du 22/12/2008 18:58:26
// transformation en variables
// vérification de la mise en application du changement de table
// 1230764400 pour le 1er janvier
// 1238450401 pour le 31 mars
var d = new Date();
var Epoch=((d.getTime()-d.getMilliseconds())/1000);
if (Epoch > 1238450401) {
  // alert ("le 31 mars 2009 est passé de une seconde ! On prend les valeurs de la nouvelle table.<br />");
  $30j = 0.54;
  $25j = 0.53;
  $20j = 0.54;
  $15j = 0.53;
  $10j = 0.54;
  $5j = 0.32;   
}
else {
 // alert ("nous ne sommes pas encore le 31 mars, on garde les anciennes valeurs.<br />");
  $30j = 0.81;
  $25j = 0.82;
  $20j = 0.82;
  $15j = 0.82;
  $10j = 0.81;
  $5j = 0.49;   
}


	// vérifer si le nouveau délai est bien inférieur à l'ancien
	
	if (parseInt(document.all.refacSdelaiNouveau.value) > parseInt(document.all.refacSdelaiActuel.value))
	{
		alert("LE DELAI SOUHAITE DOIT ETRE INFERIEUR A VOTRE DELAI ACTUEL");
		initFields();
	}
	else
	{
		document.all.delai_m3.value = document.all.refacSdelaiActuel.value;
		document.all.delai_s_m3.value = document.all.refacSdelaiNouveau.value;
        // ci-dessous affectation d'une nouvelle valeur de réfaction selon le nouveau délai
        switch(document.all.refacSdelaiActuel.value) {
            case '30':
                switch(document.all.refacSdelaiNouveau.value) {
                    case '25':
                        document.all.var_m3.value=($30j)
                        break;
                    case '20':
                        document.all.var_m3.value=($30j+$25j);
                        break;
                    case '15':
                        document.all.var_m3.value=($30j+$25j+$20j);
                        break;
                    case '10':
                        document.all.var_m3.value=($30j+$25j+$20j+$15j);
                        break;
                    case '5':
                        document.all.var_m3.value=($30j+$25j+$20j+$15j+$10j);
                        break;
                    case '0':
                        document.all.var_m3.value=($30j+$25j+$20j+$15j+$10j+$5j);
                        break;
                    default:
                        document.all.var_m3.value=(0);
                }
                break;
            case '25':
                switch(document.all.refacSdelaiNouveau.value) {
                    case '20':
                        document.all.var_m3.value=($25j);                   
                        break;                                              
                    case '15':                                              
                        document.all.var_m3.value=($25j+$20j);              
                        break;                                              
                    case '10':                                              
                        document.all.var_m3.value=($25j+$20j+$15j);         
                        break;                                              
                    case '5':                                               
                        document.all.var_m3.value=($25j+$20j+$15j+$10j);    
                        break;                                              
                    case '0':                                               
                        document.all.var_m3.value=($25j+$20j+$15j+$10j+$5j);
                        break;
                    default:
                        document.all.var_m3.value=(0);
                }
                break;
            case '20':
                switch(document.all.refacSdelaiNouveau.value) {
                    case '15':
                        document.all.var_m3.value=($20j);              
                        break;                                         
                    case '10':                                         
                        document.all.var_m3.value=($20j+$15j);         
                        break;                                         
                    case '5':                                          
                        document.all.var_m3.value=($20j+$15j+$10j);    
                        break;                                         
                    case '0':                                          
                        document.all.var_m3.value=($20j+$15j+$10j+$5j);
                        break;
                    default:
                        document.all.var_m3.value=(0);
                }
                break;
            case '15':
                switch(document.all.refacSdelaiNouveau.value) {
                    case '10':
                        document.all.var_m3.value=($15j);         
                        break;                                    
                    case '5':                                     
                        document.all.var_m3.value=($15j+$10j);    
                        break;                                    
                    case '0':                                     
                        document.all.var_m3.value=($15j+$10j+$5j);
                        break;
                    default:
                        document.all.var_m3.value=(0);
                }
                break;
            case '10':
                switch(document.all.refacSdelaiNouveau.value) {
                    case '5':
                        document.all.var_m3.value=($10j);    
                        break;                               
                    case '0':                                
                        document.all.var_m3.value=($10j+$5j);
                        break;
                    default:
                        document.all.var_m3.value=(0);
                }
                break;
            case '5':
                switch(document.all.refacSdelaiNouveau.value) {
                    case '0':
                        document.all.var_m3.value=($5j);
                        break;
                    default:
                        document.all.var_m3.value=(0);
                }
                break;
            default:
                document.all.var_m3.value=(0);
        }
	}
}


function simulationRefaction(){
    with(document.simulation_refaction){

        //Check not null
        if (prix_htva_m3.value != '' && delai_m3.value != '' && delai_s_m3.value != '' && commande_m3.value != '') {
            //reduc_delai_m3.value     =     parseFloat(delai_s_m3.value) - parseFloat(delai_m3.value);
            //min_maj_m3.value     =     parseFloat(var_m3.value) * parseFloat(reduc_delai_m3.value);
//            reprix_m3.value     =     parseFloat(prix_htva_m3.value) + parseFloat(min_maj_m3.value);
            reprix_m3.value     =     parseFloat(prix_htva_m3.value) - parseFloat(var_m3.value);            
//            gain_perte_m3.value     =   (parseFloat(reprix_m3.value) - parseFloat(prix_htva_m3.value)) * parseFloat(commande_m3.value);
            gain_perte_m3.value     =   (parseFloat(reprix_m3.value) - parseFloat(prix_htva_m3.value)) * parseFloat(commande_m3.value);
        
        	var gain_perte_m3_cal = new Number(parseFloat(	gain_perte_m3.value ));
            var calcule = new Number(parseFloat ( parseFloat(gain_perte_m3.value) / parseFloat(prix_htva_m3.value) ) );
        
        	gain_perte_m3.value = Math.abs(parseFloat(gain_perte_m3_cal.toFixed(2)));
        	trans_litre.value = Math.abs(parseFloat(calcule.toFixed(2)) * 1000);
            trans_m3.value = Math.abs(parseFloat(calcule.toFixed(2)));
        }
        else {
            alert("Veuillez saisir des valeurs.");
        } 
    }
}


function simulationRefaction04072101(){
    with(document.simulation_refaction){

        //Check not null
        if (prix_htva_m3.value != '' && delai_m3.value != '' && delai_s_m3.value != '' && commande_m3.value != ''){

        prix_litre.value     =     parseFloat(prix_htva_m3.value) / 1000;
        delai_litre.value     =     parseFloat(delai_m3.value);
        delai_s_litre.value     =     parseFloat(delai_s_m3.value);
        reduc_delai_m3.value     =     parseFloat(delai_s_m3.value) - parseFloat(delai_m3.value);
        reduc_delai_litre.value =     parseFloat(delai_s_litre.value) - parseFloat(delai_litre.value);
        min_maj_m3.value     =     parseFloat(var_m3.value) * parseFloat(reduc_delai_m3.value);
        min_maj_litre.value     =     parseFloat(var_litre.value) * parseFloat(reduc_delai_litre.value);
        reprix_m3.value     =     parseFloat(prix_htva_m3.value) + parseFloat(min_maj_m3.value);
        reprix_litre.value     =     parseFloat(prix_litre.value) + parseFloat(min_maj_litre.value);
        commande_litre.value     =     parseFloat(commande_m3.value) * 1000;
        gain_perte_m3.value     =   (parseFloat(reprix_m3.value) - parseFloat(prix_htva_m3.value)) * parseFloat(commande_m3.value);
        gain_perte_litre.value     =    parseFloat(min_maj_m3.value);

	var gain_perte_m3_cal = new Number(parseFloat(	gain_perte_m3.value ));
	gain_perte_m3.value = parseFloat(gain_perte_m3_cal.toFixed(2));
    var calcule = new Number(parseFloat( ( parseFloat(gain_perte_m3.value) / parseFloat(prix_htva_m3.value) ) / 30));
	var calcule2 = new Number(parseFloat(gain_perte_litre.value)*30000);

    trans_m3.value = parseFloat(calcule.toFixed(2));
	trans_litre.value = parseFloat(calcule2.toFixed(2));

        //trans_m3.value =  ( parseFloat(gain_perte_m3.value) / parseFloat(prix_htva_m3.value) ) / 30;
        }else{
            alert("Veuillez saisir des valeurs.");
        } 
    }
}

function read_news( n , redir ) 
{
    with(document.stelanews)
	{
		naction.value = "read";
		news.value = n;
		if ( n == 'all' )
			naction.value = "liste";
		stela_redirect.value = redir;
        submit();
    }
}


function get_Image(){
  var win = window.open("lib/JSGetImage.php","Preview","width:50, height:350, resizable=yes, scrollbars=yes");
  win.focus();
}

function get_file(pathId){
  var win = window.open('tiki-download_file.php?fileId='+pathId,'Download','width=600, height=600, resizable=yes, scrollbars=yes');
  win.focus();
}

function PreviewHTML(o) {
    var win = window.open( "", "Preview", "width=550,height=450,resizable");    
    win.document.write("<HTML><HEAD><TITLE>Preview</TITLE><link rel=\"StyleSheet\"  href=\"styles/stela.css\" type=\"text/css\">");
    win.document.write("</HEAD><BODY>");
    win.document.write("<TABLE CLASS=\"Container\">");
    win.document.write("<TR><TD CLASS=\"News\" VALIGN=\"TOP\"><TABLE WIDTH=\"100%\"><TR><td align=\"left\" valign=\"top\" class=\"NewsTitle\"><font color=\"#465072\">Titre : </font>");
    win.document.write(document.tikiNewsEdit.title.value);
    win.document.write("</td><td align=\"right\" valign=\"top\" class=\"NewsDate\"><font color=\"#465072\">Date : </font>");
    win.document.write("date js");
    win.document.write("</td></tr></table></td></tr><tr><td class=\"NewsBody\">");
    win.document.write(document.tikiNewsEdit.body.value);
    win.document.write("</td></tr><tr><td align=\"right\"><a href=\"javascript:alert('Lien vers le contenu du futur enregistrement');\" class=\"mainrailway\">En savoir plus ...</a></td></tr></table>");
    win.document.write("</BODY></HTML>");
    win.document.close();
    win.focus();
}


function StelaConfirmRemoveNews( titre, offset, sort_mode, newsId, catnewsId )
{
    var win = window.open("", "Alerte", "width=250, height=150, scrollbars=no, resizable=no");
    win.document.open("text/html", "replace");
    win.document.write("<HTML><HEAD><TITLE>Alerte</TITLE></HEAD>");
    win.document.write("<BODY BGCOLOR=\"#c3c3c3\">");
    win.document.write("<CENTER>");
    win.document.write("<TABLE BORDER='0' WIDTH='100%' CELLPADDING='3'>");
    win.document.write("<TR><TD><IMG SRC=\"/styles/common/Warning.jpg\"></TD><TD VALIGN=\"middle\">");
    win.document.write("<font size=\"2\">Etes-vous sur de bien vouloir supprimer le document \"<I><B>"+ titre +"</B></I>\" ?</font><BR><BR>");
    win.document.write("<button onClick=\"window.opener.location.href=\'tiki-list_news.php?offset=" + offset + "&amp;sort_mode=" + sort_mode + "&amp;remove=" + newsId + "&amp;catnewsid=" + catnewsId + "\';window.close();\"> Confirmer </button>&nbsp");
    win.document.write("<button onClick=\"window.close();\"> Annuler </button>");
    win.document.write("</TD></TR></TABLE></CENTER>");
    win.document.write("</BODY>");
    win.document.write("</HTML>");
    win.document.close();
    win.focus();
}
