// JavaScript Document

// JavaScript Document


/*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 != 'www.intermat.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();
}


/* Fin XTMED */

	//Envoyer à un ami

function envoyer_ami() {
 var url = document.location;
 location.href = "mailto:?subject=Un ami vous recommande le site INTERMAT 2009&body=Bonjour,%0aJe vous invite a visiter le site du salon www.intermat.fr."
}


	//Ajouter aux Favoris
function favoris() {
if ( navigator.appName != 'Microsoft Internet Explorer' )
{ window.sidebar.addPanel("Salon professionnel INTERMAT","http://www.intermat.fr/",""); }
else { window.external.AddFavorite("http://www.intermat.fr/","Salon professionnel INTERMAT"); } }



//Affichage du contact selon le pays

function ouvrir(nom_bloc)
	{
	if (document.getElementById)
		{
	// on ferme tous les blocs
	div = document.getElementById('allemagne');
	div.className = "masque";
	div = document.getElementById('belgique');
	div.className = "masque";
	div = document.getElementById('canada');
	div.className = "masque";
	div = document.getElementById('chine');
	div.className = "masque";
	div = document.getElementById('coree');
	div.className = "masque";
	div = document.getElementById('danemark');
	div.className = "masque";
	div = document.getElementById('espagne');
	div.className = "masque";
	div = document.getElementById('usa');
	div.className = "masque";
	div = document.getElementById('finlande');
	div.className = "masque";
	div = document.getElementById('grande-bretagne');
	div.className = "masque";
	div = document.getElementById('inde');
	div.className = "masque";
	div = document.getElementById('italie');
	div.className = "masque";
	div = document.getElementById('japon');
	div.className = "masque";
	div = document.getElementById('paysbas');
	div.className = "masque";
	div = document.getElementById('tcheque');
	div.className = "masque";
	div = document.getElementById('suede');
	div.className = "masque";
	div = document.getElementById('taiwan');
	div.className = "masque";	
	div = document.getElementById('turquie');
	div.className = "masque";


	// on ouvre le bloc concerné
              document.getElementById('tab_contact').className = "visible";	
	div = document.getElementById(nom_bloc);
	div.className = "visible";
 
		}
	}


//Affichage du bloc Actus

function ouvrir(nom_bloc2)
	{
	if (document.getElementById)
		{
	// on ferme tous les blocs
	div = document.getElementById('actu1');
	div.className = "masque";
	div = document.getElementById('actu2');
	div.className = "masque";
	div = document.getElementById('actu3');
	div.className = "masque";
	div = document.getElementById('actu4');

	// on ouvre le bloc concerné
              document.getElementById('tab_actus').className = "visible";	
	div = document.getElementById(nom_bloc2);
	div.className = "visible";
 
		}
	}


/*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 */


/*Debut Script Diaporama*/

if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){
if(!document.createElement||!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion(this.getAttribute("version"),_7);
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){_16.push(key+"="+_18[key]);}
return _16;
},getSWFHTML:function(){
var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}
_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}
return _19;},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();return true;
}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};
deconcept.SWFObjectUtil.getPlayerVersion=function(_23,_24){
var _25=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_25=new deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
for(var i=3;axo!=null;i++){axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);_25=new deconcept.PlayerVersion([i,0,0]);}}
catch(e){}
if(_23&&_25.major>_23.major){return _25;}
if(!_23||((_23.minor!=0||_23.rev!=0)&&_25.major==_23.major)||_25.major!=6||_24){
try{_25=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}
catch(e){}}}return _25;};
deconcept.PlayerVersion=function(_29){
this.major=parseInt(_29[0])!=null?parseInt(_29[0]):0;
this.minor=parseInt(_29[1])||0;
this.rev=parseInt(_29[2])||0;};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){return false;}return true;};
deconcept.util={getRequestParameter:function(_2b){
var q=document.location.search||document.location.hash;
if(q){var _2d=q.indexOf(_2b+"=");
var _2e=(q.indexOf("&",_2d)>-1)?q.indexOf("&",_2d):q.length;
if(q.length>1&&_2d>-1){return q.substring(q.indexOf("=",_2d)+1,_2e);}}
return "";}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){
var _2f=document.getElementsByTagName("OBJECT");
for(var i=0;i<_2f.length;i++){
for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=null;}}}};
if(typeof window.onunload=="function"){
var oldunload=window.onunload;
window.onunload=function(){deconcept.SWFObjectUtil.cleanupSWFs();oldunload();};
}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}
if(Array.prototype.push==null){
Array.prototype.push=function(_32){
this[this.length]=_32;
return this.length;};}
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; // for backwards compatibility
var SWFObject = deconcept.SWFObject;

/*Fin Script Diaporama*/


