//fonction d'impression
function printit(){
var NS = (navigator.appName == "Netscape");
if (NS) {
    window.print() ;
} else {
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";
}
}

//ouverture window center
function windowCenter(url,w,h,lift) {
var tailleecranX=parseInt(screen.width);
var tailleecranY=parseInt(screen.height);
positionX=tailleecranX-w;
positionX=Math.round(positionX/2);
positionY=tailleecranY-h;
positionY=Math.round(positionY/2);
chaine = 'width='+w+',height='+h+',resizable=yes,scrollbars='+lift+',top='+positionY+',left=' + positionX;
var laFenetre = window.open(url,'adminPopup',chaine);
laFenetre.focus();
}

//check form commande
function commandeTest(tagada){
founderrors = false
erreurs = ''
var radioSelected = false;
for (i=0;i<tagada.courtesy_title.length;i++) {
        if (tagada.courtesy_title[i].checked)
                radioSelected = true;
}
if (!radioSelected) {
founderrors = true;
erreurs = erreurs + "Choisir un titre\n"
}
if (tagada.last_name.value.length == 0) {
founderrors = true;
erreurs = erreurs + "Saisir nom\n"
}
if (tagada.first_name.value.length == 0) {
founderrors = true;
erreurs = erreurs + "Saisir prénom\n"
}
if (tagada.company.value.length == 0) {
founderrors = true;
erreurs = erreurs + "Saisir société\n"
}
if (tagada.address1.value.length == 0) {
founderrors = true;
erreurs = erreurs + "Saisir adresse\n"
}
if (tagada.cp_ville.value.length == 0) {
founderrors = true;
erreurs = erreurs + "Saisir CP/Ville\n"
}
if (tagada.pays.value.length == 0) {
founderrors = true;
erreurs = erreurs + "Saisir le Pays\n"
}
var radioSelected = false;
for (i=0;i<tagada.profileForm.length;i++) {
        if (tagada.profileForm[i].checked)
                radioSelected = true;
}
if (!radioSelected) {
founderrors = true;
erreurs = erreurs + "Choisir un profil\n"
}
if (founderrors == true) {
        window.alert(erreurs);return false;
} else {
        return true;
}
}