﻿function noPostBack() {

    PageMethods.noReloadPostback();
}

function onUpdating() {
    var RDateVisite = document.getElementById('M_thisReguleDateVisite');
    var RDateVente = document.getElementById('M_thisReguleDateVente');
    if (RDateVisite.style.visibility == 'hidden' && RDateVente.style.visibility == 'hidden') {
        var aspnetForm = $get("aspnetForm");
        aspnetForm.style.cursor = "wait";


        var btntrouver = $get("M_BoBtntrouver");
        btntrouver.value = "En cours...";

        var divWait = $get("M_divWait");
        divWait.style.visibility = "hidden";
        var thisdatapager = $get("ctl00_ContentPlaceHolder1_DataPager1");
        if (thisdatapager != null) {


        }
    }
}

function TesteAcrobat() {
    var acrobat = new Object();

    acrobat.installed = false;
    acrobat.version = '0.0';

    if (navigator.plugins && navigator.plugins.length) {
        for (var x = 0, l = navigator.plugins.length; x < l; ++x) {
            if (navigator.plugins[x].description.indexOf('Adobe Acrobat') != -1) {
                acrobat.version = parseFloat(navigator.plugins[x].description.split('Version ')[1]);

                if (acrobat.version.toString().length == 1) acrobat.version += '.0';

                acrobat.installed = true;
                break;
            }
        }
    }
    else if (window.ActiveXObject) {
        for (x = 2; x < 10; x++) {
            try {
                oAcro = eval("new ActiveXObject('PDF.PdfCtrl." + x + "');");
                if (oAcro) {
                    acrobat.installed = true;
                    acrobat.version = x + '.0';
                }
            }
            catch (e) { }
        }

        try {
            oAcro4 = new ActiveXObject('PDF.PdfCtrl.1');
            if (oAcro4) {
                acrobat.installed = true;
                acrobat.version = '4.0';
            }
        }
        catch (e) { }

        try {
            oAcro7 = new ActiveXObject('AcroPDF.PDF.1');
            if (oAcro7) {
                acrobat.installed = true;
                acrobat.version = '7.0';
            }
        }
        catch (e) { }

    }

    if (acrobat.version < 7) {
        if (confirm("Attention pour afficher les documents vous devez posséder une version acrobat 7 ou supérieur.\r\n\r\nCliquez sur OK pour mettre à jour votre version Acrobat.")) {
            window.open("http://get.adobe.com/fr/reader/");
        }
    }


}




//function onUpdated() {
//    var aspnetForm = $get("aspnetForm");
//    aspnetForm.style.cursor = "default";
//    var divWait = $get("ctl00_divWait");
//    divWait.style.visibility = "hidden";
//    
//}