// JavaScript Document

/* init [start] */
function init(rightid){
	writeNavRight();
	if(rightid>0){
		if(document.getElementById("rightNav"+rightid)){document.getElementById("rightNav"+rightid).className = "rightlight";}
	}
	removeFocus();
}

/* remove focus [start] */
function removeFocus(){
	var allLinks = document.getElementsByTagName('a');
	for (var i=0;i<allLinks.length;i++) {allLinks[i].onfocus = function () {if(this.blur)this.blur();}}
}


/* close ad [start] */
function closeAd(id) {
	document.getElementById('ad'+id).style.display = "none";
}
/* close ad [stop] */

/* ad [start] */
function Ad(id) {
	document.getElementById('ad'+id).style.display = "block";
}
function popup(page) {
window.open(page,'', 'top=113, left=256, width=490, height=281, resizable=yes, toolbar=no, scrollbars=no, status=yes');
}
/* ad [stop] */

/*Début*/

function splitURL(urlStr)

{

urlStr = urlStr.replace(/\\/g,'/');

res = /^(.*):\/\/([^\/]+)(\/?.*)\/(.+)\.(\w*)$/.exec(urlStr);

if(res)

{ 

urlBits = new Object();

urlBits.domain = res[2];

urlBits.path = res[3];

urlBits.file = res[4];

urlBits.extension = res[5];

return urlBits;

}

return null;

} 

 

function click_out() {

  xtn2b = xtn2.split("=");

   if (splitURL(this.href)) {

          texte_xiti = "Lien "+splitURL(this.href).extension.toUpperCase()+" - Fichier : "+splitURL(this.href).file;

          xt_med('C',xtn2b[1],texte_xiti,'T');

      } else {

          texte_xiti = "Lien vers le domaine : "+this.href;                 

           xt_med('C',xtn2b[1],texte_xiti,'S');

           }

}

 

function a_test() {     

      for (i = 0; i < document.links.length; i++) {

              hostname = document.links[i].hostname;

              path = document.links[i].pathname; 

            if (document.links[i].onclick == null ) { //test la presence d'un onclick            

                  if (hostname != '' && hostname != 'www.manutention.com') { document.links[i].onclick = click_out; }

                  if (path.indexOf(".pdf") !=-1) { document.links[i].onclick = click_out; }
                  if (path.indexOf(".xls") !=-1) { document.links[i].onclick = click_out; }
                  if (path.indexOf(".doc") !=-1) { document.links[i].onclick = click_out; }
                  if (path.indexOf(".zip") !=-1) { document.links[i].onclick = click_out; }
            }
      }
}

 

function customOnLoad() {

   a_test();

}

/* Fin */
