var nb_ban=2; // Nombre de banniere

var ban=Math.floor(Math.random()*nb_ban);

function change(){
	ban++; if (ban>=nb_ban) {ban=0;}
	switch (ban) {

		case0:
			document.getElementById('pub_flash_gif').innerHTML= "<a href='http://www.biessefrance.fr/' target='_blank'><img src='/ExposiumCms/cms_sites/SITE_530001/images530001/Pub/biesse-france1.gif' border='0'  onclick='return xt_click(this,'C','17','PUB_biesse_france','N');></a>";
			setTimeout("change()",10*1000);
		break;
	
		case 1:

document.getElementById('pub_flash_gif').innerHTML= "<a href='http://www.compte-r.com' target='_blank'><img src='/ExposiumCms/cms_sites/SITE_530001/images530001/Pub/Compte-r_bann200x600.gif' border='0'  onclick='return xt_click(this,'C','17','PUB_Compte-r','N');></a>";
			setTimeout("change()",10*1000);
		break;
	}

}
/*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 != 'en.expobois.fr') { 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();
change();
}