//************************************************************************
//						GESTION PUBS FLASH - rayons
//************************************************************************
// Auteur : Abiotik / jean luc COSTAGLIOLA
// tous droits réservés
// contact : 04 67 57 03 72
//************************************************************************
// --------------------------------------- copyright abiotik 2009




//--------------------------------------- designation rub
	
/*	TABLEAU DE CORRESPONDANCE

UNIVERS / RAYONS
****************************
>> SONO
----------------------------
141	Sono portable		1
21	Micros				2
201	Ampli				3
341 Traitement du son	4
151 Enceintes			5
181	Pack sono			6
1	Platine vinyle		7
211 Platine CD			8
221	Public Adresse		9


>> ECLAIRAGE
----------------------------
231	Acces. Ecalairage	21
161	Eclairage soiree	22
261	Eclairage ext.		23
271	Eclairage scene		24
281	Eclairage Boite 	25	
171	Machine fumee ...	26
291 Deco LED			27


>> DJ /MUSICIEN
----------------------------
101 Espace DJ			31
11	Espace musicien		32

>> CABLES / CONNECTIQUES
----------------------------
81	Cables				41
331 Multi./bobines		42
301 Connect./adapt.		43

>> FLIGHT CASE / DIVERS
----------------------------
191 Flight case			51
321 Valises & acces.	52

*/

	
//--------------------------------------------------------------------------	
// detection accueil pour modif chemin images
//--------------------------------------------------------------------------
	var cheminImage= "../site/";
	var recup = window.document.location;
	var chaine = recup.toString();
	var resultat = chaine.indexOf('iframeRayon');
	if(resultat>0)
		cheminImage= "../../";

//**************************************************************************************************
// gestion FLASH
//**************************************************************************************************

var memo=2;
var timeout;

function initFlash(){
	with (document.getElementById("fleche1").style)
		backgroundImage="url("+cheminImage+"gestionClient/images/flecheActive.gif)";
	with (document.getElementById("vf1").style)
		visibility="visible";
	temps();
}


function afficheVF(numVF){
	for(a=1; a<=4; a++){
		with (document.getElementById("vf" + a).style)
			visibility="hidden";				
		with (document.getElementById("fleche" + a).style)
			backgroundImage="url("+cheminImage+"gestionClient/images/flecheFixe.gif)";
	}	
	with (document.getElementById("vf" + numVF).style)
		visibility="visible";	
	with (document.getElementById("fleche" + numVF).style)
		backgroundImage="url("+cheminImage+"gestionClient/images/flecheActive.gif)";
	
	
	clearTimeout(timeout);
}



// Fonctions tourne calque
//--------------------------
function tourneVF(numVF){
	for(a=1; a<=4; a++){
		with (document.getElementById("vf" + a).style)
			visibility="hidden";		
		with (document.getElementById("fleche" + a).style)
			backgroundImage="url("+cheminImage+"gestionClient/images/flecheFixe.gif)";	
	}
	with (document.getElementById("vf" + numVF).style)
		visibility="visible";
	with (document.getElementById("fleche" + numVF).style)
		backgroundImage="url("+cheminImage+"gestionClient/images/flecheActive.gif)";	
	
	
	memo++;
	if (memo==5)memo=1;
	clearTimeout(timeout);
	temps();
}

// Fonctions gestion temps
//--------------------------
function temps(){
	timeout = setTimeout('tourneVF(memo)',3000);
}




//fonction d'écriture BLOC FLASH
//---------------------------------

var affichagePubsFlash;
var BlocFlash_PM;
var BlocFlash_GM;
var DestinationFLASH;

function affichBlocFlash(){
  	if(document.getElementById('affichBlocFlash') && affichageBlocFlash==1){	    
		DestinationFLASH = document.getElementById('affichBlocFlash'); 
		ecritureBlocFlash()
	}
}

function ecritureBlocFlash(){
	affichagePubsFlash="";
	BlocFlash_PM="";
	BlocFlash_GM="";	
	
	affichagePubsFlash='<br><table width="580" border="0" cellspacing="0" cellpadding="0" align="center"><tr><td>'
    	+'<div class="titrePubs_v2">'+titreFlash+'</div>'
		+'<div class="pointH_v2"><img src="'+cheminImage+'graph/images/espaceur.gif"></div>'
		+'<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"><tr>'
		+'<td width="1" background="'+cheminImage+'gestionClient/images/tiret_v.gif"><img src="'+cheminImage+'graph/images/espaceur.gif"></td>'
		+'<td width="190" style="padding-bottom: 5px;">';


	// ecriture PM
	for	 (i=1;i<=4;i++){
		
		BlocFlash_PM= BlocFlash_PM + '<div onmouseover="afficheVF('+i+')">'
			+'<table width="100%" border="0" cellspacing="0" cellpadding="0" style=" margin-top: 5px;"><tr><td>'
			+'<table  class="SupportPM" width="165" border="0" cellspacing="0" cellpadding="0"><tr>'
			+'<td><img src="'+cheminImage+'gestionClient/flash/'+designChemin+'/images/flash_imgPM'+i+'.gif" border="0" width="54" height="50"></td>'
			+'<td width="100%">'
			+'<div class="txtFlash2_PM">'+eval("flash_pub"+i).txt_PM
			+'<div class="prixFlash_PM" style="margin-top: 3px;">'+eval("flash_pub"+i).prix+'&nbsp;&nbsp;<span class="prixFlashBarre_PM">'
			+eval("flash_pub"+i).prixBarre+'</span></div>'
			+'</div>'
			+'</td></tr></table></td>'
			+'<td><div id="fleche'+i+'" class="flecheFlash">'+i+'</div></td>'
			+' </tr></table></div>';
	} 
	 
	// ecriture GM
	for	 (i=1;i<=4;i++){
		BlocFlash_GM= BlocFlash_GM + '<div id="vf'+i+'" class="cadrePubFlash_GM">' 
			+'<table border="0" cellspacing="0" cellpadding="0" width="300"><tr>'
			+'<td><a href="'+eval("flash_pub"+i).lien+'"  target="_parent"><img src="'+cheminImage+'gestionClient/flash/'+designChemin+'/images/flash_img'+i+'.jpg" border="0" width="165" height="213"></a></td>'
			+'<td valign="top">'
			+'<div class="txtFlash2">'
			+'<a href="'+eval("flash_pub"+i).lien+'"  target="_parent"><img src="'+cheminImage+'gestionClient/flash/'+designChemin+'/images/flash_prix'+i+'.gif" border="0" width="219" height="42"><br>'
			+'<span class="titreFlash2"><div><img src="'+cheminImage+'graph/images/espaceur.gif" height="3" border="0"></div>'
			+eval("flash_pub"+i).titre
			+'</span><div><img src="'+cheminImage+'graph/images/espaceur.gif" height="5" border="0"></div>'
			+eval("flash_pub"+i).txt
			+'</a>'
			+'</div>'
			+'</td></tr></table></div>'
	
	
	}

	affichagePubsFlash= affichagePubsFlash + BlocFlash_PM + '</td><td valign="top"><div>' + BlocFlash_GM
		+'</div>&nbsp;</td>'
		+'<td width="1" background="'+cheminImage+'gestionClient/images/tiret_v.gif"><img src="'+cheminImage+'graph/images/espaceur.gif"></td></tr></table>'
		+'<div style="background-image: url('+cheminImage+'gestionClient/images/tiret_h.gif); height: 1px;"><img src="'+cheminImage+'graph/images/espaceur.gif"></div>'
		+'</td></tr></table>'


		//document.getElementById('affichBlocFlash').style.display = "block";
		DestinationFLASH.innerHTML= affichagePubsFlash;
		
		initFlash();
}




//**************************************************************************************************
// Ecriture Top Produit RAYON
//**************************************************************************************************

function affichBlocTopProd(){
  	if(document.getElementById('affichTopProduit') && affichageTopProduit==1){	    
		DestinationTOP = document.getElementById('affichTopProduit'); 
		ecritureTopProduit();
	}
}


function ecritureTopProduit(){		

		affichageTopProduit='<table width="580" border="0" cellspacing="0" cellpadding="0" align="center"><tr><td>'
			+'<div style="margin-bottom: 10px; background-color: #FF0000; height: 1px;"><img src="../../graph/images/espaceur.gif"></div>'	
			+'<table width="100%" border="0" cellspacing="0" cellpadding="0" style="background-color: #FF0000"><tr>'
			+'<td><img src="../../gestionClient/images/titre_topProduit.gif"></td>'
			+'<td align="right"><img src="../../gestionClient/flash/'+designChemin+'/images/flash_prix'+designTopProd+'.gif" border="0"></td>'
			+'</tr></table>'
			+'<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>'
			+'<td><a href="'+eval("flash_pub"+designTopProd).lien+'" target="_parent"><img src="../../gestionClient/flash/'+designChemin+'/images/flash_img'+designTopProd+'.jpg" border="0"></a></td>'
			+'<td>'
			+'<div  class="txtTopProduitRayon">' 
			+'<a href="'+eval("flash_pub"+designTopProd).lien+'"  target="_parent">'
			+'<span class="titreTopProduitRayon"> '+eval("flash_pub"+designTopProd).titre+' </span>'
			+'<div><img src="../../graph/images/espaceur.gif" height="8" border="0"></div>'
			+eval("flash_pub"+designTopProd).txt
			+'</a></div>'
			+'</td></tr></table>'
			+'<div style="margin-bottom: 20px; background-color: #FF0000; height: 1px;"><img src="../../graph/images/espaceur.gif"></div>'
			+'</td></tr></table>';

		DestinationTOP.innerHTML= affichageTopProduit;
}

//**************************************************************************************************
// Ecriture 3 pubs images
//**************************************************************************************************


	function affichage3Pubs(){
		if(afficheLigneImages == 1){
			document.write('<table width="580" border="0" cellspacing="0" cellpadding="0" align="center"><tr align="center">'
  				+'<td><a href="'+eval(eval(GifCentre)[0]).lien+'" target="_self"><img src="http://www.abiotik.com/platine-center/pubs/images/'+eval(eval(GifCentre)[0]).image+'" border="0"></a></td>'
 	 			+'<td><a href="'+eval(eval(GifCentre)[1]).lien+'" target="_parent"><img src="http://www.abiotik.com/platine-center/pubs/images/'+eval(eval(GifCentre)[1]).image+'" border="0"></a></td>'
  				+'<td><a href="'+eval(eval(GifCentre)[2]).lien+'" target="_parent"><img src="http://www.abiotik.com/platine-center/pubs/images/'+eval(eval(GifCentre)[2]).image+'" border="0"></a></td>'						
  				+'</tr></table><br>');
		}
	}
        









