// PopUp 4 Out
//
// Permet d'ouvrir des liens dans une nouvelle fenetre 
// sans utiliser le target=_blank en dur dans le template
//
// Syntaxe ds le template : 
// <a onclick="window.open(this.href); return false;" href="url_du_lien">Lien</a>


      function popup4out() {
          var links = document.getElementsByTagName('a');
          for (var i=0; i<links.length; i++)
          {
             // url vers autre domaine ou vers une ressource
             // if ( (links[i].href.indexOf('http://', 0) == 0 && links[i].href.indexOf(location.hostname, 7) == -1) || links[i].className.indexOf('LinkFile') != -1)
						 
						 // url vers un autre domaine seulement
						 if ( (links[i].href.indexOf('http://', 0) == 0 && links[i].href.indexOf(location.hostname, 7) == -1))
              {
                  // passe en popup
                  links[i].onclick = function() {
                      window.open(this.href, '_blank'); return false;
                 }
              }
          }
      }
      function init(){
        popup4out();
      }
      window.onload=init;
      if (window.attachEvent) window.attachEvent("onload", init);

// FIN ./PopUp 4 Out