
addListenner(window, "load", load_specialLinksActions, true);



/**
 * load_specialLinksActions
 */
 function load_specialLinksActions()
 {
    if(document.getElementsByTagName) {
       var elementList = document.getElementsByTagName('a');
       for (var i=0; i < elementList.length; i++) {
          if (/lien-externe/.test(elementList[i].className) || /external/.test(elementList[i].rel)) {
             elementList[i].removeAttribute('target'); 
             elementList[i].onclick = function () {
                 var popup = window.open(this.href, '_blank');
                 //popup.document.close();
                 return false;
             };
             
             
          } else if(elementList[i].className.indexOf('impressionZone') >= 0) {
              elementList[i].onclick = function () {
                  var className = this.className;
                  var targetId = className.split('impressionZone ');
                  if (targetId[1]) {
                      targetId = targetId[1].split(' ')[0];
                      
                      //alert('targetId = "' + targetId + '"');
                      printDoc(targetId);
                      return false;
                  }
              };
              
              
          } else if (/boutonSubmit/.test(elementList[i].className)) {
                 elementList[i].onclick = function () {
                     var node = this.parentNode;
                     while (!node.submit && node.nodeName != 'FORM' && node.parentNode) {
                         node = node.parentNode;
                     }
                     if (node.submit || node.nodeName == 'FORM') {
                         var boutonSubmit = document.getElementById('boutonSubmitField');
                         if (boutonSubmit) {
                             if (this.id) {
                                 boutonSubmit.value = this.id;
                             } else {
                                boutonSubmit.value = this.className.replace('boutonSubmit', '');
                             }
                         }
                         node.submit();
                     }
                     return false;
                 };
              }
           } // end for (parcours des liens)


       var elementList = document.getElementsByTagName('input');
       for (var i=0; i < elementList.length; i++) {
          if (/demander-confirmation/.test(elementList[i].className)) {
             elementList[i].onclick = function () {
               if (this.id) {
                   var Msg = document.getElementById(this.id + '-confirm');
                   if (Msg && Msg.innerHTML) {
                       return confirm(Msg.innerHTML);
                   }
               }
               return confirm(this.value);
             };
          }
       } // end for (parcours des boutons)

       
       
    } // end if (vérification dom dispo)






 } // end of "load_specialLinksActions()"




