<!--
//  Copyright © 2004 Siti Tous droits réservés
function VersionNavigateur(Netscape, Explorer)
{
  if (( (navigator.appVersion.substring(0,3) >= Netscape) && (navigator.appName == 'Netscape')) ||
  ( (navigator.appVersion.substring(0,3) >= Explorer) && (navigator.appName.substring(0,9) == 'Microsoft') ))
      return true;
  else return false;
}


function fenetre(url,name,features)
{
  window.open(url,name,features);
}
function resizescreen()
{
    window.resizeTo(screen.width,screen.height);
}

// confirmer

function ConfirmPopupForm(form,mess)
{
    if (window.confirm(mess))
    {
        form.submit();
    }

}

function ChangeImageBanner(n)
{

    if (document.getElementById)
    {
        document.getElementById(['banner']).src = banner[n];
        document.getElementById(['bannerhref']).href = bannerhref[n];
    }
    else if (document.all)
    {
      document.all['banner'].src = banner[n];
      document.all['bannerhref'].href = bannerhref [n];
    }
    else
    {
      document.layers['banner'].src = banner[n];
      document.layers['bannerhref'].href = bannerhref[n];
    }

}

function changebanner()
{
delay = 10;    // Secondes avant

ChangeImageBanner(i);
timer = setTimeout('changebanner()', delay*1000);
i++;
if (i >= number) i= 0;
};

function imp_image(win,img,w,h,design)
{
    var toth = h + 30 + 40;
    var totw = w + 30;
    var smallwindow = win.open('','_blank',"toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width="+totw+",height="+toth);
    var doc = smallwindow.document;
    doc.clear();
    doc.write("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1 \"><title>Coupon</title>");
    doc.write("</head>");
    doc.write("<body background=\"#FFFFFF\" >\n") ;
    doc.write("<div align=\"center\"><center><table border=\"0\" width=\"100%\" cellspacing=\"2\" cellpadding=\"2\" height=\"100%\">");
    doc.write("<tr>");
    doc.write("<td colspan=\"2\" width=\""+w+"\" height=\""+h+"\"><img src=\"");
    doc.write(img);
    doc.write("\" width=\""+w+"\" height=\""+h+"\"></td>");
    doc.write("</tr>");
    doc.write("<tr>");
    doc.write("<td width=\"30%\" height=\"30\">");
    doc.write("<a href=\"javascript:window.close()\"><img name=\"Imgfermer\" align=\"absmiddle\" border=0 src=\""+design+"/bt_quit.png\" width=\"20\" height=\"20\"></a>");
    doc.write("&nbsp;<a href=\"javascript:window.print()\"><IMG src=\""+design+"/admin_imprim.png\" width=\"35\" height=\"35\" border=\"0\" alt=\"Imprimer\" align=\"absmiddle\"></a>");
    doc.write("</td>");
    doc.write("<td width=\"70%\" height=\"30\">");
    doc.write("<font size=\"2\" face=\"Verdana\">&nbsp;</font>");
    doc.write("</td>");
    doc.write("</tr>");
    doc.write("</table>");
    doc.write("</center></div>");
    doc.write("</body>");
    doc.write("</html>");
    doc.close();
    smallwindow.focus();
}
function fenetre_image(win,img,w,h)
{
    var toth = h + 30 ;
    var totw = w + 30;
    var smallwindow = win.open('','_blank',"toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width="+totw+",height="+toth);
    var doc = smallwindow.document;
    doc.clear();
    doc.write("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1 \"><title>Zoom Image</title>");
    doc.write("</head>");
    doc.write("<body background=\"#FFFFFF\" >\n") ;
    doc.write("<div align=\"center\"><center><table border=\"0\" width=\"100%\" cellspacing=\"2\" cellpadding=\"2\" height=\"100%\">");
    doc.write("<tr>");
    doc.write("<td colspan=\"2\" width=\""+w+"\" height=\""+h+"\"><img src=\"");
    doc.write(img);
    doc.write("\" width=\""+w+"\" height=\""+h+"\"></td>");
    doc.write("</tr>");
    doc.write("</table>");
    doc.write("</center></div>");
    doc.write("</body>");
    doc.write("</html>");
    doc.close()
}

var textischanged = false;

function OnChangeText(form)
{
    //form.Reserver.disabled = true;
    textischanged = true;
}

function ContinueCommande()
{
    if (!textischanged)
        document.continueform.submit()
    else alert('Vous devez valider les modifications avant de pouvoir continuer');
}

function CompteCar(txtarea,max) {

  var txt=txtarea.value;
  var nb=txt.length;
  if (nb>max) {
    alert("Pas plus de "+max+" caractères dans ce champ");
    txtarea.value=txt.substring(0,max);
    nb=max;
  }
}

function EnvoyerDate(col,day,month,year)
{
    //window.opener.document.forms["mainform"].elements[col + "_year"].value=year;
    //window.opener.document.forms["mainform"].elements[col + "_mon"].value=month;
    //window.opener.document.forms["mainform"].elements[col + "_day"].value=day;
    ChangeSelect(col + "_DAY",day);
    ChangeSelect(col + "_MON",month);
    ChangeSelect(col + "_YEAR",year);

    window.close();
}

function ChangeSelect(col,val)
{
    var opt;
    model = window.opener.mainform.elements[col];
    bfound = false;
    for (i = 0; i < model.options.length; i++)
    {
            if (model.options[i].value == val)
            {
               model.options[i].selected = true;
               bfound = true;
               break;
            }
    }
}
//-->


