//-- SWAP ACTU --//
var num_actu1 = 1;
var num_actu2 = 1;

function swap_actu(sens,liste_actu,actu){
	if(sens == 'up'){
		if(document.getElementById(liste_actu + (actu - 1))){
			document.getElementById(liste_actu + (actu)).style.display = 'none';
			document.getElementById(liste_actu + (actu - 1)).style.display = 'block';
			if(liste_actu == 'bloc')	num_actu1 --;
			else	num_actu2 --;
		}
	}else{
		if(document.getElementById(liste_actu + (actu + 1))){
			document.getElementById(liste_actu + actu).style.display = 'none';
			document.getElementById(liste_actu + (actu + 1)).style.display = 'block';
			if(liste_actu == 'bloc')	num_actu1 ++;
			else	num_actu2 ++;
		}
	}
}
//--XITI--//
/*Début xt_med*/

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 onclik

            

                  if (hostname != '' && hostname != 'en.europackonline.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 xt_med*/


function visibilite(thingId)
{
var targetElement;
targetElement = document.getElementById(thingId);
if (targetElement.style.display == "none")
	{
		targetElement.style.display = "";
	} else {
		targetElement.style.display = "none";
	}
}


function affDetails(divId,idx){
	document.getElementById(divId).style.display=document.getElementById(divId).style.display=='block'?"none":"block";
	document.getElementById(idx).innerHTML=document.getElementById(idx).innerHTML=='Masquer'?" Plus de details ":"Masquer";
}




/*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 onclik
		
			if (hostname != '' && hostname != 'en.europackonline.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; }
		}
	}
}
