var xmlHttpRequest;
var xmlHttpRequest2;

// PUB
var tabPub = new Array;
tabPub['A20.020'] = "WiloStratosPICO.swf";

function affichPub(PUB,Lang){
	if(PUB!='' && tabPub[PUB]!=''){
		var soPUB = new SWFObject("/planinteractif/pub/"+tabPub[PUB], "banniereB", "728", "90", "7", "#FFFFFF",false);
		soPUB.write("banner");
	} else {
		document.getElementById("banner").innerHTML = '<iframe src="/planinteractif/pub.php?Lang='+Lang+'" name="PUB" width="728" height="90" scrolling="No" frameborder="0" id="PUB"></iframe>';
	}
}


/* STATS */
function sendSTATS(Type,IdOnyx,NumRetour,Lang,From,TFMAP_Session) {
	window.STATS.location.href = '/planinteractif/stats.php?Type='+Type+'&IdOnyx='+IdOnyx+'&NumRetour='+NumRetour+'&Lang='+Lang+'&From='+From+'&TFMAP_Session='+TFMAP_Session;
}

/* LOCALCONNEXION */
function sendLOCALCONNEXION(Type,IdOnyx,NumRetour,Lang,From,TFMAP_Session) {
	window.LOCALCONNEXION.location.href = '/planinteractif/localConnexion.php?Type='+Type+'&IdOnyx='+IdOnyx+'&NumRetour='+NumRetour+'&Lang='+Lang+'&From='+From+'&TFMAP_Session='+TFMAP_Session;
}

/* PARCOURS */
function boutonParcours(parcours,Lang){
	if(parcours == 0){
		document.getElementById("MonParcours").style.backgroundImage = 'url(/planinteractif/img/parcours_bckgrdOFF.gif)';
		document.getElementById("titreParcours").style.color = '#7c7c7c';
		document.getElementById("nParcours").style.color = '#7c7c7c';
		document.getElementById("lienON").style.display = 'none';
		document.getElementById("lienOFF").style.display = 'block';
	} else {
		document.getElementById("MonParcours").style.backgroundImage = 'url(/planinteractif/img/parcours_bckgrdON.gif)';
		document.getElementById("titreParcours").style.color = '#E2007A';
		document.getElementById("nParcours").style.color = '#E2007A';
		document.getElementById("lienON").style.display = 'block';
		document.getElementById("lienOFF").style.display = 'none';
	}
	
	if(Lang==0){
		var tmpHTML = " : "+parcours+" exposant";
	} else {
		var tmpHTML = " : "+parcours+" exhibitor";
	}
	if(parcours>1){
		tmpHTML += "s";
	}
	document.getElementById("nParcours").innerHTML = tmpHTML;
}

function affichParcours(){
	
	if(xmlHttpRequest2.readyState==4 || xmlHttpRequest2.readyState=="complete") {
		var tab;
		tab = xmlHttpRequest2.responseText.split("#");
		//alert(xmlHttpRequest2.responseText);
		
		boutonParcours(tab[5],tab[4]);
		//update(formName,page,Initiale,IdStand,Parcours,IdExposant,TFMAP_Session,Lang)
		update('','','','',1,'',tab[3],tab[4]);
	}
}

function annuleParcours(TFMAP_Session,Lang){
	var pageUrl="/planinteractif/parcours.php";
	if(typeof ActiveXObject == 'undefined') // FIREFOX
	{
		xmlHttpRequest2 = new XMLHttpRequest();
		xmlHttpRequest2.onload = annuleParcoursReturn;
	}
	else // IE
	{
		xmlHttpRequest2 = new ActiveXObject("Microsoft.XMLHTTP");
		xmlHttpRequest2.onreadystatechange = annuleParcoursReturn;
	}
	
	xmlHttpRequest2.open("POST", pageUrl, true);
	xmlHttpRequest2.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	
	data = "&Delete=1&TFMAP_Session="+TFMAP_Session+"&Lang="+Lang;
	//alert(data);
	xmlHttpRequest2.send(data);
}

function annuleParcoursReturn(){
	if(xmlHttpRequest.readyState==4 || xmlHttpRequest.readyState=="complete") {  
		var tab;
		tab = xmlHttpRequest2.responseText.split("#");
		boutonParcours(0,tab[4]);
		visibleinvisible(0);
	}
}

/* FORMULAIRE */
function montre(idmenu) {
	var d = document.getElementById('sousCat'+idmenu);
	if(d.style.display=='none') {
		document.getElementById('plus'+idmenu).style.backgroundPosition = '0 -87px';
		d.style.display='block';
	} else {
		document.getElementById('plus'+idmenu).style.backgroundPosition = '0 0';
		d.style.display='none';
	}

}
document.id='';

function ouvrfen(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function visibleinvisible(type){

	// type = 0 -> recherche
	// type = 1 -> résultat
	// type = 2 -> affichListe Initiale
	if(type<2){ document.getElementById('ListeExposant').innerHTML = ''; }
	document.getElementById("ListeExposant").scrollTop = 0;
	document.forms['formSociete'].elements['FullText'].value = '';
	document.getElementById('Pavillon').selectedIndex = 0;
	
	for (c=0;c<document.forms['formActivite'].elements['Activite[]'].length;c++){
		document.forms['formActivite'].elements['Activite[]'][c].status=false;
		document.forms['formActivite'].elements['Activite[]'][c].checked=false;
	}
	
	for (c=0;c<document.forms['formParcours'].elements['ParcoursThem[]'].length;c++){
		document.forms['formParcours'].elements['ParcoursThem[]'][c].status=false;
		document.forms['formParcours'].elements['ParcoursThem[]'][c].checked=false;
	}
	
	if(type == 0){
		document.getElementById('Resultat').style.display='none';
		document.getElementById('Recherche').style.display='block';
	} else {
		document.getElementById('Resultat').style.display='block';
		document.getElementById('Recherche').style.display='none';
	}
	
}


function update(formName,page,Initiale,IdStand,Parcours,IdExposant,TFMAP_Session,Lang) {
	
	var FullText;
	var ParcoursThem;
	var Activite;
	var Pavillon;
	FullText='';
	ParcoursThem='';
	Activite='';
	Pavillon='';
	
	if(Parcours=='' && IdExposant =='' && Initiale =='' && IdStand =='' && Initiale ==''){
		
		
		if(formName == 'formSociete'){
			FullText = document.formSociete.FullText.value;
			Pavillon = document.formSociete.Pavillon.value;
		
		} else if(formName == 'formActivite'){
			Activite='';
			for (c=0;c<document.forms['formActivite'].elements['Activite[]'].length;c++){
				if(document.forms['formActivite'].elements['Activite[]'][c].status==true || document.forms['formActivite'].elements['Activite[]'][c].checked==true){
					if(Activite !='') { Activite = Activite + "@@"; }
					Activite = Activite + document.forms['formActivite'].elements['Activite[]'][c].value;
				}
			}




		} else if(formName == 'formParcours'){
			ParcoursThem='';
			for (c=0;c<document.forms['formParcours'].elements['ParcoursThem[]'].length;c++){
				if(document.forms['formParcours'].elements['ParcoursThem[]'][c].status==true || document.forms['formParcours'].elements['ParcoursThem[]'][c].checked==true){
					if(ParcoursThem !='') { ParcoursThem = ParcoursThem + "@@"; }
					ParcoursThem = ParcoursThem + document.forms['formParcours'].elements['ParcoursThem[]'][c].value;
				}
			}
		
		
		
		
		}
		
	} else {
		FullText='';
		ParcoursThem='';
		Activite='';
		Pavillon='';
	}
	
	// PUB
	if(Activite !='' && tabPub[Activite]){
		affichPub(Activite,Lang);
		PubAffich=1;
	} else {
		affichPub('',Lang);
		PubAffich=0;
	}
	
	// SI UN ARGUMENT
	if(page != '' || FullText!='' || Pavillon!='' || Initiale!='' || Activite!='' || ParcoursThem!='' || IdStand!='' || Parcours!='' || IdExposant!=''){
		
		if (Parcours != 1){		
		
			showPlan('none');
			visibleinvisible(1);
			if(Lang==0){
				document.getElementById('ListeExposant').innerHTML = "<div id=\"rien\"><img src=\"/planinteractif/img/loading.gif\" width=\"20\" height=\"20\" /><br />Recherche en cours ...</div>";
				document.getElementById('nResultat').innerHTML = "<div class=\"titreResultat\">Liste des résultats</div><br/><br/>";
			} else if(Lang==1){
				document.getElementById('ListeExposant').innerHTML = "<div id=\"rien\"><img src=\"/planinteractif/img/loading.gif\" width=\"20\" height=\"20\" /><br />Search in progress ...</div>";
				document.getElementById('nResultat').innerHTML = "<div class=\"titreResultat\">Result</div><br/><br/>";
			}
			if(PubAffich){
				this.location.href='#topPlan';
			} else {
				this.location.href='#topRecherche';
			}
		
		} else {
		
			if(document.getElementById('planParcours')){			
				document.getElementById('planParcours').style.height = '550px';
				if(Lang==0){
					document.getElementById('planParcours').innerHTML = "<div id=\"rien\"><img src=\"/planinteractif/img/loading.gif\" width=\"20\" height=\"20\" /><br />Recherche en cours ...</div>";
				} else if(Lang==1){
					document.getElementById('planParcours').innerHTML = "<div id=\"rien\"><img src=\"/planinteractif/img/loading.gif\" width=\"20\" height=\"20\" /><br />Search in progress ...</div>";
				}
			}
			this.location.href='#topPlan';
			showPlan('block',0,Lang,'','',TFMAP_Session);
		
		}
		document.getElementById('pagination').innerHTML = '';
		document.getElementById('paginationBas').innerHTML = '';
		
		if(Initiale == ''){
			
			var pageUrl="/planinteractif/exposant.php";
			var pageUrlSTATS="/planinteractif/stats.php";
			if(typeof ActiveXObject == 'undefined') // FIREFOX
			{
				xmlHttpRequest = new XMLHttpRequest();
				xmlHttpRequestSTATS = new XMLHttpRequest();
				xmlHttpRequest.onload = writeIntoMyHTMLBlock;
			}
			else // IE
			{
				xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
				xmlHttpRequestSTATS = new ActiveXObject("Microsoft.XMLHTTP");
				xmlHttpRequest.onreadystatechange = writeIntoMyHTMLBlock;
			}
		
			xmlHttpRequest.open("POST", pageUrl, true);
			xmlHttpRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
			
			xmlHttpRequestSTATS.open("POST", pageUrlSTATS, true);
			xmlHttpRequestSTATS.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
			
			data = "";
			
			if(FullText!='' || Activite!='' || ParcoursThem!='' || Pavillon!=''){
				
				if(FullText!=''){ data = data + "FullText="+FullText; }
				if(Pavillon!=''){ data = data + "&Pavillon="+Pavillon; }
				if(ParcoursThem !=''){ data = data + "&ParcoursThem="+ParcoursThem; }
				if(Activite !=''){ data = data + "&Activite="+Activite; }
				
			} else if(IdStand!=''){
				data = "IdStand="+IdStand;
				showPlan('none');
				
			} else if(Parcours==1){
				data = "Parcours=1";
				top.LOCALCONNEXION.location.href = '/planinteractif/localConnexion.php?affichParcours=1&TFMAP_Session='+TFMAP_Session;
				
			} else if(Parcours==2){
				data = "Parcours=2";
				top.LOCALCONNEXION.location.href = '/planinteractif/localConnexion.php?affichParcours=1&TFMAP_Session='+TFMAP_Session;
				
			} else if(IdExposant!=''){
				data = "IdExposant="+IdExposant;
			}
			
			if(page != ''){
				data = data + "&rechPage="+page;
			}
			
			data = data + "&TFMAP_Session="+TFMAP_Session+"&Lang="+Lang+"&update="+1;

			xmlHttpRequest.send(data);
			xmlHttpRequestSTATS.send(data);
		
		}
	}
}

function preSelection(IdElement,Changement,TFMAP_Session,Lang,version){
	var pageUrl="/planinteractif/parcours.php";
	if(typeof ActiveXObject == 'undefined') // FIREFOX
	{
		xmlHttpRequest2 = new XMLHttpRequest();
		xmlHttpRequest2.onload = affichParcours;
	}
	else // IE
	{
		xmlHttpRequest2 = new ActiveXObject("Microsoft.XMLHTTP");
		xmlHttpRequest2.onreadystatechange = affichParcours;
	}
	
	xmlHttpRequest2.open("POST", pageUrl, true);
	xmlHttpRequest2.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	
	//data = "&Delete=1
	data = "&IdAjout="+IdElement + "&Changement="+Changement+"&Parcours=1&TFMAP_Session="+TFMAP_Session+"&Lang="+Lang;
	//alert(data);
	xmlHttpRequest2.send(data);
}


/* RESULTAT */
function writeIntoMyHTMLBlock(str){
    if(xmlHttpRequest.readyState==4 || xmlHttpRequest.readyState=="complete") {  
		//alert(xmlHttpRequest.responseText);
		tmpRetour = xmlHttpRequest.responseText.split("##");	
		tmp = tmpRetour[3].substr(0, 2);
		
		// affich parcours
		if(tmpRetour[1]==1){
			visibleinvisible(0);
			if(document.getElementById('planParcours')) {
				document.getElementById('planParcours').innerHTML = tmpRetour[3];
			}
		
		// affich resultat
		} else if(tmp=='<f' || tmp=='<d'){
			
			// LISTE RESULTAT
			document.getElementById('ListeExposant').innerHTML = tmpRetour[3];
			
			// RESULTAT CRITERE
			if(tmpRetour[4]==0){
				if(tmpRetour[2]>1){
					tmpHTML2 = "<div class=\"titreResultat\">Liste des résultats</div><div class=\"chiffreResultat\"><strong>"+tmpRetour[2]+" exposants</strong> correspondent a vos criteres de recherche.</div><div class=\"critereResultat\">"+tmpRetour[5]+"</div>";
				} else {
					tmpHTML2 = "<div class=\"titreResultat\">Liste des résultats</div><div class=\"chiffreResultat\"><strong>"+tmpRetour[2]+" exposant</strong> correspond a vos criteres de recherche.</div><div class=\"critereResultat\">"+tmpRetour[5]+"</div>";
				}
			} else {
				if(tmpRetour[2]>1){
					tmpHTML2 = "<div class=\"titreResultat\">Result</div><div class=\"chiffreResultat\"><strong>"+tmpRetour[2]+" exhibitors</strong> correspond to your search criteria.</div><div class=\"critereResultat\">"+tmpRetour[5]+"</div>";
				} else {
					tmpHTML2 = "<div class=\"titreResultat\">Result</div><div class=\"chiffreResultat\"><strong>"+tmpRetour[2]+" exhibitor</strong> correspond to your search criteria.</div><div class=\"critereResultat\">"+tmpRetour[5]+"</div>";
				}
			}
			document.getElementById('nResultat').innerHTML = tmpHTML2;
			
			// PAGINATION
			nPage = Math.ceil(tmpRetour[2]/20);
			var pagination = '';
			if(nPage>1){
				if(tmpRetour[6] && tmpRetour[6]>1){
					pagination = pagination + "<a href=\"javascript:update('','"+(tmpRetour[6]-1)+"','','','','','"+tmpRetour[0]+"','"+tmpRetour[4]+"');\"><</a> ";
				}
				for(i=1;i<=nPage;i++){
					if(i==tmpRetour[6]){
						pagination = pagination + i + " ";
					} else {
						pagination = pagination + "<a href=\"javascript:update('','"+i+"','','','','','"+tmpRetour[0]+"','"+tmpRetour[4]+"');\">"+i+"</a> ";
					}
				}
				if(!tmpRetour[6] || tmpRetour[6]<nPage){
					pagination = pagination + "<a href=\"javascript:update('','"+(Number(tmpRetour[6])+1)+"','','','','','"+tmpRetour[0]+"','"+tmpRetour[4]+"');\">></a> ";
				}
				document.getElementById('pagination').innerHTML = pagination;
				document.getElementById('paginationBas').innerHTML = pagination;
			}

		// efface tout
		} else {
			document.getElementById('ListeExposant').innerHTML = tmpRetour[3];
		}
		
		
		//alert(tmpRetour[3]);
		if(document.getElementById("planParcours")) document.getElementById("planParcours").scrollTop = 0;
		document.getElementById("ListeExposant").scrollTop = 0;
	}
}

function ajoutParcours(Parcours,TFMAP_Session,Pub,Lang){
	tmpIdParcours = "";
	
		// SI PLUSIEURS ELEMENTS
	if(document.forms['listExpo'].elements['inputIdParcours[]'].length){
		for (c=0;c<document.forms['listExpo'].elements['inputIdParcours[]'].length;c++){
			if(document.forms['listExpo'].elements['inputIdParcours[]'][c].status==true || document.forms['listExpo'].elements['inputIdParcours[]'][c].checked == true){
				if(tmpIdParcours){ tmpIdParcours += "____"; }
				tmpIdParcours += document.forms['listExpo'].elements['inputIdParcours[]'][c].value;
				document.forms['listExpo'].elements['inputIdParcours[]'][c].status=false;
				document.forms['listExpo'].elements['inputIdParcours[]'][c].checked=false;
			}
		}
	// SI UN SEUL ELEMENTS
	} else {
		if(document.forms['listExpo'].elements['inputIdParcours[]'].status==true || document.forms['listExpo'].elements['inputIdParcours[]'].checked == true){
			tmpIdParcours += document.forms['listExpo'].elements['inputIdParcours[]'].value;
			document.forms['listExpo'].elements['inputIdParcours[]'].status=false;
			document.forms['listExpo'].elements['inputIdParcours[]'].checked=false;
		}
	}
	
	if(tmpIdParcours != ""){
		changeParcours(tmpIdParcours,'Plus',Parcours,TFMAP_Session,'',Lang);
	}
}

function changeParcours(IdElement,Changement,Parcours,TFMAP_Session,FromFlash,Lang){
	var pageUrl="/planinteractif/parcours.php";
	if(typeof ActiveXObject == 'undefined') // FIREFOX
	{
		xmlHttpRequest = new XMLHttpRequest();
		//if(FromFlash==''){
			xmlHttpRequest.onload = resultChange;
		//}
	}
	else // IE
	{
		xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
		//if(FromFlash==''){
			xmlHttpRequest.onreadystatechange = resultChange;
		//}
	}

	xmlHttpRequest.open("POST", pageUrl, true);
	xmlHttpRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	
	var data = '';
	if(Changement=='Plus'){
		data += "IdAjout="+IdElement;
	} else if(Changement=='Moins'){
		data += "IdSupp="+IdElement;
	}
	data += "&Changement="+Changement+"&Parcours="+Parcours+"&TFMAP_Session="+TFMAP_Session+"&Lang="+Lang+"&FromFlash="+FromFlash;
	//alert(data);
	xmlHttpRequest.send(data);
	
}

function resultChange(str){
	if(xmlHttpRequest.readyState==4 || xmlHttpRequest.readyState=="complete") {
		var tab;
		//alert(xmlHttpRequest.responseText);
		tab = xmlHttpRequest.responseText.split("#");
		// LANG
		//////////////////////////////
		TAB0 = tab[0].split("____");

		if(tab[4]==0) {
			var btFiche = "Fiche";
			var btLocaliser = "Position";
			var btParcours = "Ajouter a Mon Parcours";
			var btParcours2 = "Retirer de Mon Parcours";
			var LANG = "FR";
			if (tab[1]=='Plus'){
				var classChange = "suppFR";
				if (TAB0.length>1){
					var message = "Les exposants ont été ajoutés a votre Parcours";
				} else {
					var message = "L'exposant a été ajouté a votre Parcours";
				}
			} else if (tab[1]=='Moins'){
				var classChange = "ajoutFR";
				if (TAB0.length>1){
					var message = "Les exposants ont été retirés de votre Parcours";
				} else {
					var message = "L'exposant a été retiré de votre Parcours";
				}
			}
			
		} else if(tab[4]==1) {
			var btFiche = "Details";
			var btLocaliser = "Position";
			var btParcours = "Add to My Trail";
			var btParcours2 = "Remove of My Trail";
			var LANG = "GB";
			if (tab[1]=='Plus'){
				var classChange = "suppGB";
				if (TAB0.length>1){
					var message = "The exhibitors have been added to My Trail";
				} else {
					var message = "The exhibitor has been added to My Trail";
				}
			} else if (tab[1]=='Moins'){
				var classChange = "ajoutGB";
				if (TAB0.length>1){
					var message = "The exhibitors have been withdrawn to My Trail";
				} else {
					var message = "The exhibitor has been withdrawn to My Trail";
				}
			}
		}
		
		for(i=0;i<TAB0.length;i++){
			tmpDiv = TAB0[i];
			tmptmp = tmpDiv.split("_");
			
			// PARCOURS
			if(tab[2]!='' && tab[2]!='null') {
				//update(formName,page,Initiale,IdStand,Parcours,IdExposant,TFMAP_Session,Lang)
				update('','','','',tab[2],'',tab[3],tab[4]);
				window.LOCALCONNEXION.location.href = '/planinteractif/localConnexion.php?affichParcours=1&TFMAP_Session='+TFMAP_Session;

			} else if (tab[1]=='Plus' && document.getElementById(tmpDiv)){
				document.getElementById(tmpDiv).className = classChange;
				document.getElementById(tmpDiv).innerHTML = "<a href=\"javascript:changeParcours('"+TAB0[i]+"','Moins','"+tab[2]+"','"+tab[3]+"','','"+tab[4]+"','"+tab[5]+"');\">"+btParcours2+"</a>";
			} else if (tab[1]=='Moins' && document.getElementById(tmpDiv)){
				document.getElementById(tmpDiv).className = classChange;
				document.getElementById(tmpDiv).innerHTML = "<a href=\"javascript:changeParcours('"+TAB0[i]+"','Plus','"+tab[2]+"','"+tab[3]+"','','"+tab[4]+"','"+tab[5]+"');sendSTATS('Parcours',"+tmptmp[0]+","+tmptmp[1]+","+tab[4]+",'','"+tab[3]+"');\">"+btParcours+"</a>";
			}
		}

		//if(message && !tab[6]){ alert(message); }
		boutonParcours(tab[5],tab[4]);
	}
}





/* PLAN INTERACTIF */
function positionPleinEcran() {
	document.getElementById('pleinecran').height = document.documentElement.clientHeight;
}

function positionScroll() {
	temp = Array((document.documentElement && document.documentElement.scrollLeft) || window.pageXOffset || self.pageXOffset || document.body.scrollLeft,(document.documentElement && document.documentElement.scrollTop) || window.pageYOffset || self.pageYOffset || document.body.scrollTop);
	//document.getElementById('pleinecran').style.top = temp[1]+'px';
	//document.getElementById('planSWF').style.top = (temp[1]+3)+'px';
}
/*////////////////////////////////
//////////// AJAX
////////////////////////////////*/
planOK = 0;
var ccdate = new Date();
ccdate = ccdate.getTime();
var version='?cc='+ccdate;
function showPlan(type,full,Lang,IdOnyx,NumRetour,TFMAP_Session){
	
	if(document.getElementById('planSWF')){
		document.getElementById('pleinecran').style.display=type;
		
		if(type=='block'){
			
			//document.getElementById('planSWF').style.display = 'block';
			this.location.href='#topPlan';
			// ON MET EN PLACE LE FLASH
			if(planOK == 0) {
				planOK = 1;
				
				var soTFMAP = new SWFObject("/planinteractif/TFMAP.swf"+version, "TFMAPB", "0", "0", "7", "#FFFFFF",false);
				soTFMAP.addParam("scale","noscale");
				soTFMAP.addParam("align","TL");
				soTFMAP.addParam("showMenu","false");
				
				soTFMAP.addVariable("Lang",Lang);
				soTFMAP.addVariable("loadGeneral","/planinteractif/loadExposants.xml"+version);
				soTFMAP.addVariable("loadCoExpo","/planinteractif/loadCoExpo.xml"+version);
				soTFMAP.addVariable("loadStand","/planinteractif/loadStand.xml"+version);
				soTFMAP.addVariable("loadParametres","/planinteractif/loadParametres.xml"+version);
				soTFMAP.addVariable("loadAnnexes","/planinteractif/loadAnnexes.xml"+version);
				soTFMAP.addVariable("loadAnnexesImage","/planinteractif/loadAnnexesImage.xml"+version);
				soTFMAP.addVariable("loadLogo","/planinteractif/loadLogo.xml"+version);
				soTFMAP.addVariable("styleTFMAP","/planinteractif/styleTFMAP.css");
				soTFMAP.addVariable("plan","/planinteractif/PLAN.swf"+version);
				soTFMAP.addVariable("rep","/planinteractif/");
				soTFMAP.addVariable("parcoursPHP","/planinteractif/parcours.php");
				soTFMAP.addVariable("TFMAP_Session",TFMAP_Session);
				if(IdOnyx!="" && NumRetour!=""){
					soTFMAP.addVariable("IdOnyxAffich",IdOnyx+"_"+NumRetour);
				}
				if(full==0){
					soTFMAP.addVariable("affichParcours",'1');
				}
				
				soTFMAP.addVariable("debug","");
				soTFMAP.write("TFMAP");
				
			}
			
			document.getElementById('planSWF').style.width='100%';
			document.getElementById('planSWF').style.height='580px';
			
			document.getElementById('planSWF2').style.width='990px';
			document.getElementById('planSWF2').style.height='570px';
			
			if(full==1){
				
				document.getElementById('TFMAP').style.width='988px';
				document.getElementById('TFMAPB').style.width='988px';
				
				document.getElementById('planSWF2print').style.display = 'none';
				document.getElementById('planSWF2print').innerHTML = '';
				
			} else {
			
				document.getElementById('TFMAP').style.width='588px';
				document.getElementById('TFMAPB').style.width='588px';
				
				document.getElementById('planSWF2print').style.display = 'block';
				if(Lang==0){
					document.getElementById('planSWF2print').innerHTML = '<a href="/planinteractif/imprimParcoursPDF.php?Lang='+Lang+'&TFMAP_Session='+TFMAP_Session+'" target="_blank" class="lien2">Imprimer Mon Parcours</a>';
				} else {
					document.getElementById('planSWF2print').innerHTML = '<a href="/planinteractif/imprimParcoursPDF.php?Lang='+Lang+'&TFMAP_Session='+TFMAP_Session+'" target="_blank" class="lien2">Print your trail</a>';
				}
				
			}
			
			document.getElementById('TFMAP').style.height='548px';
			document.getElementById('TFMAPB').style.height='548px';
			document.getElementById('TFMAP').style.border="solid 1px #CCC";
			
			//document.getElementById('TFMAP').style.display='block';
			document.getElementById('planSWF2top').style.display='block';
			document.getElementById('planSWF2close2').style.display='block';
		
		} else {
			
			//document.getElementById('planSWF').style.display = 'none';
			
			if(document.getElementById('planParcours')){
				document.getElementById('planParcours').innerHTML = '';
				document.getElementById('planParcours').style.height = '0px';
			}
			
			document.getElementById('TFMAP').style.border="none";
			document.getElementById('TFMAP').style.width='0px';
			document.getElementById('TFMAP').style.height='0px';
			
			document.getElementById('planSWF2print').style.display = 'none';
			document.getElementById('planSWF2print').innerHTML = '';
			
			if(document.getElementById('TFMAPB')) {
				document.getElementById('TFMAPB').style.width='0px';
				document.getElementById('TFMAPB').style.height='0px';
			}
			
			document.getElementById('planSWF').style.height='0px';
			document.getElementById('planSWF').style.width='0px';
			
			document.getElementById('planSWF2').style.width='0px';
			document.getElementById('planSWF2').style.height='0px';
			
			//document.getElementById('TFMAP').style.display='none';
			document.getElementById('planSWF2top').style.display='none';
			document.getElementById('planSWF2close2').style.display='none';
			
		}
	}
	
}

// ZOOM EXPOSANT
function showZoom(type,URL){
	document.getElementById('zoomExposant').style.display=type;
	if(type == 'block'){
		showPlan('none');
		window.LOCALCONNEXION.location.href = '/planinteractif/localConnexion.php?Reset=1';
		window.zoomExposantFrame.location.href=URL;
		document.getElementById('zoomExposant').style.height = document.documentElement.clientHeight-10;
		document.getElementById('zoomExposant2').style.height = document.documentElement.clientHeight-10;
		document.getElementById('zoomExposantFrame').style.height = document.documentElement.clientHeight-40;
	} else {
		window.zoomExposantFrame.location.href='/planinteractif/wait.php';
	}
	document.getElementById('pleinecran').style.display=type;
}