/********		TEST		************/
function test(param){
alert(param);
}

function focus(param)
{
if(param)
document.getElementById(param).focus();
}

/*****	ASCENCEUR	********/
var count=0;
var defilBas;
function lanceurBas(id)
{
	defilBas=setInterval("descendre('"+id+"')",100) ;
}
function descendre(id)
{
	var pos=document.getElementById('contenuBloc2').offsetTop;
	var posCurseur=document.getElementById('curseur').offsetTop;
count-=10;
	if(pos<0)
	{
		document.getElementById(id).style.top=-count+"px";
		document.getElementById('curseur').style.top=count+"px";
	}
}

function stopDescendre()
{
clearInterval(defilBas);
}

/*******************/
var defilHaut;

function lanceurHaut(id)
{
	defilHaut=setInterval("monter('"+id+"')",100) ;
}

function monter(id)
{
var pos=document.getElementById('contenuBloc2').offsetTop;
var posCurseur=document.getElementById('curseur').offsetTop;
count+=10;

	if(pos>-324)
	{	
		count=posCurseur;
		document.getElementById(id).style.top=-count+"px";
		document.getElementById('curseur').style.top=count+"px";
	}
	if(posCurseur>310)
	{
		document.getElementById(id).style.top=-1950+"px";
	}
}

function stopMonter()
{
clearInterval(defilHaut);
}

/****	DEPLACEMENT  CURSEUR ********/
var dragged=null;
function elementDrag(event,id)
{
	dragged=document.getElementById(id);
}

function drag_mousemove(event,id)
{
count=150;
	if(dragged )
	{
		var Y=event.clientY;
		if(Y>=150 && Y<=480)
		{
			dragged.style.position="relative";
			dragged.style.top=Y-150+"px";
			document.getElementById('contenuBloc2').style.top=-Y*+4+"px";
		}
		if(Y<150)
		{
			document.getElementById('contenuBloc2').style.top=0+"px";
		}
		if(Y>480)
		{
			document.getElementById('contenuBloc2').style.top=-1950+"px";
		}
	}
}

function stopDrag()
{
	dragged=null;
}

/****	GESTION MENUS ********/
function menu(id)
{
}

function sousMenuActif(id,image)
{
	document.getElementById('bDerou').className="bDerou";
}

function menu2(id)
{
}

function lienActif(id,param,color,imgMenu,idMenu)
{

	if(param=="mg")
	{
		document.getElementById('lien'+id).className="lienActif";
	}		
	if(param=="md")
	{
		document.getElementById('lien'+id).className="titreMenuD2";
	}
	if(param=="chemin")
	{
		document.getElementById('lien'+id).className="listeLiensG2";
	}
		if(param=="dt")
	{
		document.getElementById('lien'+id).className="dernierTitre2";
	}

}

function lienActif2(id,param,colorLien,imgMenu,idMenu)
{
	if(param=="mg")
	{
		document.getElementById('lien'+id).className="lienActif2";
		document.getElementById('lienHrf'+id).style.textDecoration="none";
		document.getElementById('lienHrf'+id).style.color=colorLien;
		document.getElementById('der'+id).className="mDerouV";
		document.getElementById('bDerou').className="bDerou";
	}	
	if(param=="m1Der")
	{
		document.getElementById('m1Href'+id).style.textDecoration="underline";
	}		
	if(param=="modal")
	{
		document.getElementById('modalite').style.visibility="visible";
	}	
	if(param=="md")
	{
		document.getElementById('lien'+id).className="titreMenuD2";
	}
	if(param=="chemin")
	{
		document.getElementById('lien'+id).className="listeLiensG2";
	}
		if(param=="dt")
	{
		document.getElementById('lien'+id).className="dernierTitre2";
	}		
	if(param=="nav")
	{
		document.getElementById('txtChemin').className="txtCheminOn";
		document.getElementById('moteur').style.zIndex='1';
		// document.getElementById('modeRech').style.visibility='hidden';
	}	
	if(param=="produitRouge" || param=="listeRouge")
	{
		document.getElementById('element_'+id).className=param;
	}
	if(param=="produitBleu" || param=="listeBleu")
	{
		document.getElementById(idMenu+id).className=param;
		document.getElementById(colorLien+id).style.color="#ffffff";
	}
	if(param=="photoDRouge" || param=="promoDRouge")
	{
		document.getElementById(idMenu).className=param;
	}

}

function lien(id,param,colorLien,idMenu)
{
	if(param=="mg")
	{
		document.getElementById('lien'+id).className="lien";
		document.getElementById('lienHrf'+id).style.color=colorLien;
		document.getElementById('der'+id).className="mDerou";
		document.getElementById('bDerou').className="bDerouHid";
	}
	if(param=="m1Der")
	{
		document.getElementById('m1Href'+id).style.textDecoration="none";
	}
	if(param=="modal")
	{
		document.getElementById('modalite').style.visibility="hidden";
	}	
	if(param=="md")
	{
		document.getElementById('lien'+id).className="titreMenuD";
	}
		if(param=="chemin")
	{
		document.getElementById('lien'+id).className="listeLiensG";
	}
		if(param=="_2")
	{
		document.getElementById(id).className="titreSFamille2";
		document.getElementById(param).className="titreSFamille2";
	}		
	
	if(param=="dt")
	{
		document.getElementById('lien'+id).className="dernierTitre";
	}
	if(param=="nav")
	{
		document.getElementById('txtChemin').className="txtCheminOff";
		document.getElementById('moteur').style.zIndex='3';
		// document.getElementById('modeRech').style.visibility='visible';
	}
	if(param=="produitRouge" || param=="produitBleu" )
	{
		document.getElementById(idMenu+id).className="produit";
		document.getElementById(colorLien+id).style.color="#000000";
	}	
	if(param=="listeRouge"  || param=="listeBleu")
	{
		document.getElementById(idMenu+id).className="elementSFamille";
		document.getElementById(colorLien+id).style.color="#000000";
	}
	if(param=="photoD"  || param=="promoD")
	{
		document.getElementById(idMenu).className=param;
	}
}

function allumer(id)
{
	document.getElementById('element'+id).className="allumer";
}

function eteindre(id)
{
	document.getElementById('element'+id).className="elementSFamille";
}

function allumerd(id)
{
	document.getElementById('element'+id).className="allumerD";
}

function eteindred(id)
{
	document.getElementById('element'+id).className="elementSFamilleD";
}
/***	ALPHA  MARQUES	*****/
function alphaOn(id)
{
	document.getElementById('m'+id).className="lienMarqueOn";
}

function alphaOff(id)
{
	document.getElementById('m'+id).className="lienMarqueOff";
}

/**** MOTEUR ***/
function textMoteur(champ)
{
	champ.style.color="#000";
	champ.style.border="1px solid #fff";
	champ.value="";
}

/*** REDIRECTION DES PAGES D'ACCUEILS PAR THEME ***/
function redir(id,event,param)
{
	var key = window.event ? event.keyCode : event.which;
	if (key == 13 || key == 1 || key == 0) 
	{
		if(id == "recherche-" || id=="Entrez votre recherche" || id=="recherche-Rechercher")
		{
			document.getElementById('champmoteur').value="Entrez votre recherche";
		}else{
		
		id=id.replace(/ /g, "-"); 
		id = id.replace(/ê/, 'e');
		id = id.replace(/ë/, 'e');
		id = id.replace(/é/,'e');
		id = id.replace(/è/, 'e');
		// On remplace les variantes de "u"
		id = id.replace(/ù/, 'u');
		id = id.replace(/û/, 'u');
		id = id.replace(/ü/, 'u');
		// On remplace les variantes de "a"
		id = id.replace(/ä/, 'a');
		id = id.replace(/à/, 'a');
		id = id.replace(/â/, 'a');
		// On remplace les variantes de "o"
		id = id.replace(/ô/, 'o');
		// On remplace les variantes de "i"
		id = id.replace(/ï/, 'i');
		 // On remplace les variantes de "c"
		id = id.replace(/ç/, 'c');
			// location.href="http://www.vtec.fr/"+id+",1,"+param;
			location.href="http://www.vtec.fr/"+id;
			// location.href="http://www.vtec.fr/"+id;  
			// location.href="http://www.vtec.fr/vtecDrop2/"+id;  
			// location.href="http://www.drop-arcadian.com/VTEC/"+id;
		}
	}
	if(event=="telePdf")
	{
		// location.href="http://www.vtec.fr/vtecDrop2/"+id;   
		location.href="http://www.vtec.fr/"+id;   
		// location.href="http://www.drop-arcadian.com/VTEC/"+id;
	}
	if(event=="div")
	{
		// location.href="http://www.vtec.fr/vtecDrop2/"+id;   
		location.href="http://www.vtec.fr/"+id;   
		// location.href="http://www.drop-arcadian.com/VTEC/"+id;
	}	
	if(event=="divImg")
	{
		// location.href="http://www.vtec.fr/vtecDrop2/"+id;  
		location.href="http://www.vtec.fr/"+id;  
		// location.href="http://www.drop-arcadian.com/VTEC/"+id;
	}	
	if(event=="inscriPro")
	{
		// location.href="http://www.vtec.fr/vtecDrop2/"+id;  
		location.href="http://www.vtec.fr/"+id;  
		// location.href="http://www.drop-arcadian.com/VTEC/"+id;
	}	
	if(event=="inscriPart")
	{
		// location.href="http://www.vtec.fr/vtecDrop2/"+id;  
		location.href="http://www.vtec.fr/"+id;  
		// location.href="http://www.drop-arcadian.com/VTEC/"+id;
	}	
	if(event=="monPanier")
	{
		// location.href="http://www.vtec.fr/vtecDrop2/"+id;  
		location.href="http://www.vtec.fr/"+id;  
		// location.href="http://www.drop-arcadian.com/VTEC/"+id;
	}	
	if(event=="monCompte")
	{
		// location.href="http://www.vtec.fr/vtecDrop2/"+id;  
		location.href="http://www.vtec.fr/"+id;  
		// location.href="http://www.drop-arcadian.com/VTEC/"+id;
	}	
	if(event=="identification")
	{
	event="Mon-compte-Vtec";
		// location.href="http://www.vtec.fr/vtecDrop2/"+event; 	
		location.href="http://www.vtec.fr/"+event; 	
		// location.href="http://www.drop-arcadian.com/VTEC/"+event;
			
	}
	if(event=="url")
	{
		// location.href="http://www.vtec.fr/vtecDrop2/"+id;  
		location.href="http://www.vtec.fr/"+id;  
		// location.href="http://www.drop-arcadian.com/VTEC/"+id;
	}	
	if(event=="confirmer")
	{
		// location.href="http://www.vtec.fr/vtecDrop2/"+id;  
		location.href="http://www.vtec.fr/"+id;  
		// location.href="http://www.drop-arcadian.com/VTEC/"+id;
	}
}


/** AJOUT PANIER ***/	
function confirmMdp()
{
document.getElementById('confirmMdp').innerHTML='<div class="structu">Mot de passe : <form id="formPanier"><input type="text" name="passConfirm" id="passConfirm" /></form></div><div class="structu"><input onclick="ajaxPanier(\'confirmer\',\'00\',document.getElementById(\'passConfirm\').value,document.getElementById(\'choixCompte\').value);" type="image" name="confirmer" id="confirmer" src="img/logo/confirmer.png"></div>';
}
function ajouter(page,id)
{
	var scrollTop=document.body.scrollTop || document.documentElement.scrollTop;
	var hGlobal=document.getElementById('global').offsetHeight;
	var lEcran=screen.width;
	var posZoom=(lEcran-500)/2;
	document.getElementById('darkBox').className="dark";
	if(page=="pdf")
	{
		document.getElementById('lightBox').className="light2";
		document.getElementById('lightBox').style.visibility='visible';
		document.getElementById('darkBox').style.visibility='visible';
		document.getElementById('lightBox').style.top=scrollTop+150+"px";
		document.getElementById('darkBox').style.height=hGlobal+440+"px";
	}	
	if(page=="panier")
	{
		document.getElementById('lightBox').className="light2";
		document.getElementById('lightBox').style.visibility='visible';
		document.getElementById('darkBox').style.visibility='visible';
		document.getElementById('lightBox').style.top=scrollTop+300+"px";
		document.getElementById('darkBox').style.height=hGlobal+340+"px";
	}	
	if(page=="duMois")
	{
		// document.getElementById('flash').innerHTML='';
		// document.getElementById('flashGeotoile').innerHTML='';
			document.getElementById('detailBox2').className="detailBox2";
			document.getElementById('detailBox2').style.top=scrollTop+100+"px";
			document.getElementById('detailBox2').style.left=posZoom+"px";
			document.getElementById('darkBox').style.height=hGlobal+20+"px";
			document.getElementById('detailBox2').style.visibility='visible';
			document.getElementById('darkBox').style.visibility='visible';
		duMois(id,scrollTop,hGlobal,lEcran,posZoom);
	}	

	if(page=="detail" )
	{
			var image = new Image();
		image.onerror = function()
		{
			alert("Erreur lors du chargement de l'image");
		}
		image.onabort = function()
		{
			alert("Chargement interrompu");
		}
		// une fois l'image chargée :
		image.onload = function()
		{
			img = document.getElementById("imageZoom");
		// on affiche l'image
			img.src = image.src;
			document.getElementById('detailBox').className="detailBox2";
			document.getElementById('detailBox').style.top=scrollTop+100+"px";
			document.getElementById('detailBox').style.left=posZoom+"px";
			document.getElementById('darkBox').style.height=hGlobal+20+"px";
			document.getElementById('detailBox').style.visibility='visible';
			document.getElementById('darkBox').style.visibility='visible';
		}
			image.src = id;

	}

}
 function duMois(nbr)
{
	if(nbr=="stop"){
	clearTimeout(timer);
	document.getElementById('detailBox2').style.visibility='hidden';
	document.getElementById('darkBox').style.visibility='hidden';
	// document.getElementById('lightBox2').style.visibility='hidden';
	}else{
		 if(nbrImg > nbr) nbrImg = 1;
					var image = new Image();
			image.onerror = function()
			{
				alert("Erreur lors du chargement de l'image");
			}
			image.onabort = function()
			{
				alert("Chargement interrompu");
			}
			// une fois l'image chargée :
			image.onload = function()
			{
				img = document.getElementById("imageZoom2");
			// on affiche l'image
				img.src = image.src;
			}
				image.src =  "img/logo/graphisme/v2/duMois/photo/"+nbrImg+".jpg";


		 nbrImg ++;
	//	 alert(nbrImg);
		timer=setTimeout("duMois('"+nbr+"')",2000);
	}
 }
function retourDetail(param)
{
if(param=="divVacances"){
document.getElementById(param).style.visibility='hidden';
}else{
document.getElementById('detailBox').style.visibility='hidden';
document.getElementById('darkBox').style.visibility='hidden';
document.getElementById('lightBox').style.visibility='hidden';
}
// var flash = {
			// movie:"flash/FlashVtec06.swf", width:"640px", height:"130px", majorversion:"9", build:"0", minorversion:"8", bgcolor:"#fff"
			// };
			// UFO.create(flash, "flash");	
// var flashGeotoile = {
			// movie:"flash/geotoile2.swf", width:"241px", height:"200px", majorversion:"9", build:"0", minorversion:"8", bgcolor:"#fff"
			// };
			// UFO.create(flashGeotoile, "flashGeotoile");
// clearTimeout(timer);
}
/** TIMER COMMANDE PANIER **/
	 var count=0;
function positionnement()
{
}


function stop()
{
	clearInterval(pos);
}


function livraisonCache()
{
	 document.getElementById('tarifLivr').className="tarifCache";
}

var affiche;
function lancerAficher()
{
document.getElementById('blocConnexion2').className="afficherBloc";
stopMail();
}

function afficher(id)
{
	if(id=='tarifLivr')
	{
		 document.getElementById('tarifLivr').className="tarifVu";
	}
	if(id=='creationAd')
	{
		 document.getElementById('creationAd').className="fieldAd";
	}	
if(id=='modifierAd')
	{
		 document.getElementById('modifierAd').className="fieldAd";
	}
		if(id=='nvoCompte')
	{
		var verif=/^[a-zA-Z0-9âêûôéèàùëäç._-]+@[a-zA-z0-9âêûôéèàùëäç]{2,}[.][a-zA-Z]{2,3}$/
		var mail=document.formConnexion.emailC2.value;
		if(verif.exec(mail)!=null)
		{
			affiche=setInterval("lancerAficher()",500) ;
		}
	}
}


function cacherForm(id)
{
if(id=='creationAd')
		
	{
	 document.getElementById(id).style.height=15+"px";
		document.getElementById(id).style.overflow="hidden";
		document.getElementById(id).style.cursor="pointer";
	}	
	if(id=='modifierAd')
	{
	 document.getElementById(id).style.height=15+"px";
		document.getElementById(id).style.overflow="hidden";
		document.getElementById(id).style.cursor="pointer";
	}
}

function stopMail()
{
clearInterval(affiche);
}

/** FOCUS ONLOAD **/
function curseur()
{
	document.formConnexion.emailC2.focus();
}

/** ZOOM PHOTO **/
function openWindow(id,idImg)
{
var src=document.images['photoDetail'].src;
var longu=src.length;
var slsh=src.lastIndexOf('/',longu);
var ext=src.substr(slsh+1,longu);
var point=src.lastIndexOf('.',longu)
var extFichier=src.substr(point,longu);
var idImage=src.substring(slsh+1,point);
var image=idImg+idImage+extFichier;
var win=window.open(id+'?add='+image,'','directories =no,location =no,menubar =no,resizable =no,scrollbars =no,status =no,toolbar =no,width=600,height=400');
win.moveTo((screen.width)/2-300,(screen.height)/2-200); 
}

/***********/
/**  AJAX **/
/***********/
function getXhr(){
  var xhr = null; 
  if(window.XMLHttpRequest) // Firefox et autres
    xhr = new XMLHttpRequest(); 
  else if(window.ActiveXObject){ // Internet Explorer 
    try {
    xhr = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
    xhr = new ActiveXObject("Microsoft.XMLHTTP");
    }
  }else { // XMLHttpRequest non supporté par le navigateur 
    alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
    xhr = false; 
  } 
  return xhr;
}
/** PANIER	**/
function ajaxPanier(param,id,passe,login,frais)
{
// alert("param : "+param);
// alert("id : "+id);
// alert("passe : "+passe);
// alert("login : "+login);
// alert("frais : "+frais);
if(param=='ajouter' || param=='confirmer' || param=='ajoutColoris' || param=='pdf'|| param=='verifMail'|| param=='centrePdf' || param=='invitSalon' || param=='verifMailSalon')
{
var traitement='inc/ajout_panier.php';
}
if(param=='enrPArt')
{
var traitement='inc/traitInscription.php';
}
if(param=='enrPro')
{
var traitement='inc/traitInscriptionPro.php';
}
if(param=='enrPdf')
{
var traitement='inc/traitInscriptionPdf.php';
}
if(param=='continuer' || param=='panier' || param=='calculer')
{
var traitement='inc/panier.php';
}
if(param=='commander' || param=='livraison')
{
var traitement='inc/livraison.php';
}
if(param=='paiement' || param=='confirPaiement')
{
var traitement='inc/paiement.php';
}
if(param=='confirmation' || param=="confirCommande")
{
var traitement='inc/confirmer.php';
}
if(param=='adrsFactu' )
{
var traitement='inc/adrsFactu.php';
}
if( param=='moncompte' || param=='moncompte2')
{
var traitement='inc/traitCompte.php';
}
if( param=='mdpPerdu' )
{
var traitement='inc/moncompte.php';
}
var xhr = getXhr();
xhr.onreadystatechange = function()
{
	if(xhr.readyState == 4 && xhr.status == 200)
	{
	document.getElementById('lightBox2').style.display='none';
		if(param=='mdpPerdu')
		{
		document.getElementById(id).innerHTML=passe;
		document.getElementById('infoChercheMdp').innerHTML=login;
		}	
		if(param=='moncompte')
		{
			if(id=='compteSup')
			{
			location.href="http://www.vtec.fr/vtecDrop2/";    
			}else{
			document.getElementById('blok'+passe).innerHTML=xhr.responseText;
			}
		}
		if(param=='moncompte2')
		{
		document.getElementById('blok'+id).innerHTML=xhr.responseText;
		}			
		if(param=='ajouter' || param=='ajoutColoris')
		{
		lienImg=passe;
		ajouter('panier',id);
		document.getElementById('lightBox').innerHTML=xhr.responseText;
		document.getElementById('hidPanier').value=lienImg;
		}
		
		if(param=='pdf'|| param=='verifMail'|| param=='centrePdf' || param=='invitSalon' || param=='verifMailSalon')
		{
		ajouter('pdf',id);
		document.getElementById('lightBox').innerHTML=xhr.responseText;
		}	
		
		if(param=='confirmer')
		{
		lienImg=passe;
		ajouter('panier',id);
		 document.getElementById('lightBox').innerHTML=xhr.responseText;
		 document.getElementById('hidPanier').value=lienImg;
		}		
		if(param=='panier')
		{
			// location.href="http://www.vtec.fr/vtecDrop2/"+param;    
			location.href="http://www.vtec.fr/"+param;    
			// location.href="http://www.drop-arcadian.com/VTEC/"+param;
		}		
		if(param=='calculer')
		{
		var longXhr=(xhr.responseText).length;
		var derOccu=(xhr.responseText).lastIndexOf(">");
			 var blok=(xhr.responseText).substring(0, derOccu+1)
			 var panier=(xhr.responseText).substring(derOccu+1, longXhr);
			document.getElementById('blok').innerHTML=blok;
			document.getElementById('panier').innerHTML=panier;

		}		
			
		if(param=='continuer')
		{
		esspace=" ";
		tiret="-";
		slash="/";
		virg=",";
		while(passe.indexOf(esspace)>-1){passe=passe.replace(esspace,tiret)}
		while(passe.indexOf(slash)>-1){passe=passe.replace(slash,virg)}
			// location.href="http://www.vtec.fr/vtecDrop2/"+passe;  
			location.href="http://www.vtec.fr/"+passe;  
			// location.href="http://www.drop-arcadian.com/VTEC/"+passe;
		}		
		if(param=='enrPArt' || param=='enrPro' || param=='enrPdf')
		{
		 document.getElementById('formPanier').innerHTML=xhr.responseText;
		}		
		if(param=='commander')
		{
			// location.href="http://www.vtec.fr/vtecDrop2/"+param;  
			location.href="http://www.vtec.fr/"+param;  
			// location.href="http://www.drop-arcadian.com/VTEC/"+param;
		}
		if(param=='livraison')
		{
		 document.getElementById('blok').innerHTML=xhr.responseText;
		}		
		if(param=='confirPaiement')
		{
		 document.getElementById('blok').innerHTML=xhr.responseText;
		}		
		if(param=='paiement')
		{
		 // location.href="http://www.vtec.fr/vtecDrop2/"+param;  
		 location.href="http://www.vtec.fr/"+param;  
		 // location.href="http://www.drop-arcadian.com/VTEC/"+param;
		}		
		if(param=='confirmation')
		{
		 // location.href="http://www.vtec.fr/vtecDrop2/"+param;  
		 location.href="http://www.vtec.fr/"+param;  
		 // location.href="http://www.drop-arcadian.com/VTEC/"+param;
		}
		
		if(param=='confirCommande')
		{
			
		 document.getElementById('detailPanier').innerHTML=xhr.responseText;
			if(id=='finconfirm')
			{
				document.getElementById('terrasse').innerHTML=xhr.responseText;
			}
		}		
		if(param=='adrsFactu')
		{
		 document.getElementById('messModif').innerHTML=xhr.responseText;
		}
	}else if (xhr.readyState < 4){
	var ahEcran=screen.availHeight;
	var hEcran=screen.height;
	var alEcran=screen.availWidth ;
	var lEcran=screen.width ;
	var scrollTop=document.body.scrollTop || document.documentElement.scrollTop;
	document.getElementById('lightBox2').className="light";
	document.getElementById('lightBox2').style.display='block';
	document.getElementById('lightBox2').style.top=scrollTop+400+"px";
	document.getElementById('lightBox2').innerHTML='<img src="img/logo/tempo/tempo1.gif" />';
	}
};
xhr.open("POST",traitement,true);
xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
xhr.send('param='+param+'&id='+id+'&passe='+passe+'&log='+login+'&frais='+frais);
}

/** LISTE DEROULANTE	FORMULIARE **/	
function ajax(param,id)
{
//alert(id);
var xhr = getXhr();
	xhr.onreadystatechange = function()
	{
		if(xhr.readyState == 4 && xhr.status == 200)
		{
        document.getElementById(id).innerHTML=xhr.responseText;
      }else{
//document.getElementById('blok').innerHTML='<img src="img/logo/tempo/tempo1.gif" />';
	}
    };
	xhr.open("POST","ajax.php",true);
	xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	xhr.send('identifiant='+param+'&table='+id);
}

/** FORMULIARE **/	
function ajaxForm(thisForm)
{
var longForm=thisForm.length;
var champInput='';
var champFile='';
var champTextarea='';
var champRadio='';
var nomChampInput='';
var nomChampTextarea='';
var nomChampFile='';

for(var i=0; i<longForm; i++)
{
		if(thisForm.elements[i].value=="")
		{
			champInput+="vide"+"||";
		}else{
			champInput+=thisForm.elements[i].value+"||";
		}
		nomChampInput+=thisForm.elements[i].name+"||";
}

var xhr = getXhr();
	xhr.onreadystatechange = function()
	{
		if(xhr.readyState == 4 && xhr.status == 200)
		{
	document.getElementById('lightBox2').style.display='none';
    var tab = xhr.responseText.split("--");
    var compteur=tab[0].split("|-|");//array recupere le nombre d'élément de responseText
    var imgIcone=tab[1].split("|-|");//array recupere le nombre d'élément image icone
    var vide=tab[2].split("|-|");//array recupere le nombre d'élément verif ----->  utilisé pour les test
	document.getElementById('espace').innerHTML=tab[4];
    var nbrimgIcone=imgIcone.length;
    var nbrCompteur=(compteur.length)-2;
		  for(var c=1; c<nbrCompteur; c++)
		  {
			  document.getElementById('icone'+c).innerHTML="<img src='img/logo/"+imgIcone[c-1]+"' alt='' />";
		  }
      }else{
		var ahEcran=screen.availHeight;
		var hEcran=screen.height;
		var alEcran=screen.availWidth ;
		var lEcran=screen.width ;
		var scrollTop=document.body.scrollTop || document.documentElement.scrollTop;
		document.getElementById('lightBox2').className="light";
		document.getElementById('lightBox2').style.display='block';
		document.getElementById('lightBox2').style.top=scrollTop+300+"px";
		document.getElementById('lightBox2').innerHTML='<img src="img/logo/tempo/tempo1.gif" />';  
		}
    };
	xhr.open("POST","inc/traitForm.php",true);
	xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	xhr.send('champInput='+champInput+'&champTextarea='+champTextarea+'&champFile='+champFile+'&nomChampInput='+nomChampInput+'&nomChampTextarea='+nomChampTextarea+'&=nomChampFile'+nomChampFile);

}
/******************	PHOTOTEQUE ****************/
var opac;
var opacit=0;
function fototekOn(id)
{
	document.getElementById('photoD').style.opacity =opacit;
	document.getElementById('photoD').style.MozOpacity =opacit;
	document.getElementById('photoD').style.KhtmlOpacity =opacit;
	document.getElementById('photoD').style.filter = 'alpha(opacity='+opacit+')';
	opac=setInterval("timer()",100);
	var img=new Image;
	img=id;
	document.images['photoDetail'].src=img;
}

function zoom(id,numIm)
{
	document.images['photoDetail'].src=id;
	document.getElementById('numIm').value=numIm;
}
function timer()
{
	var opaDiv=document.getElementById('photoD').style.opacity;
	opacit+=0.1;
	if(opaDiv<1)
	{
		// alert(opac);	
		document.getElementById('photoD').style.opacity =opacit;
        document.getElementById('photoD').style.MozOpacity =opacit;
        document.getElementById('photoD').style.KhtmlOpacity =opacit;
        document.getElementById('photoD').style.filter = 'alpha(opacity='+opacit+')';
	}
	if(opaDiv==1)
	{
		stopOpac();
	}
	
}
function fototekOff()
{
	var img=new Image;
	img="img/table/TableRec300-172.jpg";
	document.images['photoDetail'].src=img;
	var hautDiv = document.getElementById('photoD').offsetHeight;
	var W=document.images['photoDetail'].width;
	var H=document.images['photoDetail'].height;
	var posX=(hautDiv-H)/2;
	document.getElementById('photoImg').style.width=W+"px";
	document.getElementById('photoImg').style.height=H+"px";
	document.getElementById('photoImg').style.marginLeft="auto";
	document.getElementById('photoImg').style.marginRight="auto";
	document.getElementById('photoImg').style.marginTop=posX+"px"
}

function tofDetail()
{
	var hautDiv = document.getElementById('photoD').offsetHeight;
	var W=document.images['photoDetail'].width;
	var H=document.images['photoDetail'].height;
	var posX=(hautDiv-H)/2;
	document.getElementById('photoImg').style.width=W+"px";
	document.getElementById('photoImg').style.height=H+"px";
	document.getElementById('photoImg').style.marginLeft="auto";
	document.getElementById('photoImg').style.marginRight="auto";
	document.getElementById('photoImg').style.marginTop=posX+"px"
}

function stopOpac()
{
	clearInterval(opac);
	opacit=0;
}

/*****	IMGACCUEIL	****/
function imgAccueilOver(id)
{
document.getElementById("ligne"+id).className="ligneAccueilOn";
document.getElementById("imgAccueil"+id).style.cursor="pointer";
}
function imgAccueilOut(id)
{
document.getElementById("ligne"+id).className="ligneAccueilOff";
}

function radio(valueRadio,byId) {
  document.getElementById(byId).value=valueRadio;
}
