//-- 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 ++;
		}
	}
}
//-- CUSTOM ON LOAD --//
function customOnLoad(){
	//--- Lock menuacces ---//
	if(document.getElementById('menuacces'+menuacces)){
		document.getElementById('menuacces'+menuacces).className = "on";
	}
}


/*Début XTMED */

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.graphitec.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 XTMED */

            //Envoyer à un ami

function envoyer_ami() {
 var url = document.location;
 location.href = "mailto:?subject=A friend recommends you the web site Graphitec-Convertec 2009&body=Hello, I invite you to visit the web site of the exhibition http://www.graphitec.com."
}



/*Début FONCTION BANNIERE PUB */

function disp(txt) {document.write(txt);}
// ne pas changer le nom 'banniere'
var banniere=new CreerBan('Cliquez sur les bannières...');
// Definition des bannières Add(url de l'image, adresse associée à l'image, target, delai en secondes)
// target est une chaine de caractères qui est soit : 
//  1- le nom de la frame qui va recevoir le site de la bannière
//  2- "_blank" pour ouvrir une nouvelle fenêtre
//  3- "_self" pour remplacer la bannière par son site
//  4- "_top"  pour supprimer toutes les frames et afficher le site en pleine page 
// Remarque : toutes les images ont la dimension de la première image affichée (sous netscape)
//            Il est préférable d'avoir toutes les images au meme format.


function CreerBan(alt) {
	this.nb=0;
	this.no=0;
	this.alt=alt;

	this.Add=AddBan;
	this.Init=InitBan;
}
function AddBan(img,href,target,delai,texte_xiti) {
	var ban=new Object;
		ban.img=img;
		ban.href=href;
		ban.target=target;
		ban.delai=delai;
		ban.texte_xiti=texte_xiti;
	this[this.nb]=ban;
	this.nb++;
}
function InitBan(num_dep) {
banniere.no = Math.floor(Math.random()*banniere.nb);
	var aff="";
	if (document.images) { for(var i=0;i<this.nb;i++){var gif=new preload(this[i].img)}}
	disp(aff+"<BR><A href='javascript:tjsgo()' ><IMG name='tjsimg' border='0' src='"+this[banniere.no].img+"' alt='"+this.alt+"'></A>");
	setTimeout("rotation()",this[0].delai*1000);
}
function rotation() {
	banniere.no++; var no=banniere.no; if (no>=banniere.nb) {banniere.no=0; no=0}
//	alert(no+" "+banniere[no].img+" ------"+document.anchors["tjsban"].href)
	document.images["tjsimg"].src=banniere[no].img;
	setTimeout("rotation()",banniere[no].delai*1000);
}
function tjsgo() {
	with(banniere[banniere.no]) {
		if(target=="_blank"){window.open(href,"")} else {
			if(target=="_top"){parent.window.location=href} else {
				if(target=="_self"){window.location=href} else {
				parent.frames[target].window.location=href}
				
			}
		}
	}
xtn2b = xtn2.split("=");
xt_med('C',xtn2b[1],banniere[banniere.no].texte_xiti,'S');

}
function preload() {
	this.length = preload.arguments.length;
	for (var i = 0; i < this.length; i++) {
		this[i+1] = new Image();
		this[i+1].src = preload.arguments[i];
	}
}


/* Fin Fonction Banniere Pub */