function PhotoCadre_over()
{
	
var LeDivPhoto = document.getElementById('PhotoCadre');	
LeDivPhoto.style.display = 'block';
	
   CacheContenu_resize(0); 
   ResizePage(); 
   AffLeDiv('FlchHaut','open');  
   AffLeDiv('FlchGauche','open'); 
   VoirPlaceDIV ('MasqueCadrePhoto', 'none', '', '');  
   ZIndexD ('IMGMenuGauche','5'); 
   FondTrame('1'); 
   RefreshPhoto();
} 
    
function PhotoCadre_out()
{
var LeDivPhoto = document.getElementById('PhotoCadre');	
LeDivPhoto.style.display = 'none';

	FondTrame('0');  
    VoirPlaceDIV ('MasqueCadrePhoto', 'block', '', ''); 
    ZIndexD ('IMGMenuGauche','0'); 
    AffLeDiv('FlchGauche',''); 
    AffLeDiv('FlchHaut',''); 
    CacheContenu_resize(1); 
    ResizePage();
}    


function AddFermer2DivOuvrants()
{
	var TousDIVs = document.getElementsByTagName('div');
	
	var NavName = navigator.appName;
	var RgExpO = new RegExp ("(Internet Explorer)|(msie)","gi");
	
//			var LaREGX = '\\(?<a[^>]+AffLeDiv ?\\([^">]*'+IDduDIV+'[^">]*[^>]*>((</a){0}.)*<\/a>\\)?';
																				 
	var ie = 0;															 
	if(NavName.match(RgExpO) != null)
		ie = 1;

	for (i=0;i<TousDIVs.length;i++)
	{



		if(ie == 1)
		{
			if (TousDIVs[i].id == 'InfosPage')
			{
				var CetInfoBulle = TousDIVs[i].innerHTML;
				var WidB = TousDIVs[i].offsetWidth;
				var HeiB = TousDIVs[i].offsetHeight;
				var lestyWH = '';
				
				var RefStyles = TousDIVs[i].style;
				
				if (WidB > 0 && HeiB > 0)
				{
					
					RefStyles.width = WidB+'px';
					RefStyles.height = HeiB+'px';
				
					lestyWH = 'style="width:'+WidB+'px; height:'+HeiB+'px; top:0px;"';
					//alert(WidB+'px x '+HeiB+'px');
					
				}
				
				TousDIVs[i].innerHTML = '<div '+lestyWH+' >'+TousDIVs[i].innerHTML+'</div>';
				TousDIVs[i].style.width = WidB+'px';
				TousDIVs[i].style.height = (HeiB+2)+'px';
				TousDIVs[i].style.marginBottom = '-3px';
				TousDIVs[i].style.marginTop = '3px';
				//TousDIVs[i].style = RefStyles;
				
				
				
			}
		}





		if (TousDIVs[i].style.display == 'none' || TousDIVs[i].className == 'DivOuvrant')
		{
			var ContHTM = '';
			ContHTM = TousDIVs[i].innerHTML;
			
			
			
			
			var IDduDIV = TousDIVs[i].id;
			
		// alert (IDduDIV);




				var LaREGX = '\\(?<a[^>]+AffLeDiv ?\\( ?\''+IDduDIV+'[^)o]+\\)([^>]*)>((<\/a){0}.)*<\/a>\\)?';


			var LaREGXAFuncs = '^.+AffLeDiv[^;]+;([^>]+)>.+$';
		//	var LaREGX = 'AffLeDiv';
		
			var RgExp = new RegExp (LaREGX,"gi");
			var RgExpAF = new RegExp (LaREGXAFuncs,"i");
		
			var ReZA = new RegExp('^(.|\s)+AffLeDiv ?\\( ?\''+IDduDIV+'[^)o]+\\) ?;', '');				
		


			var FermerLink = ContHTM.match(RgExp);
			
//			alert (IDduDIV);
		
			if (FermerLink != null && FermerLink.length > 0)
			{

//			alert(FermerLink.join(' --- '));

				var FClassHaut = 'Fermer_Haut';
				var FClassBas = 'Fermer_Bas';
				
				if(ie == 1)
				{
					var PourChFunc = ContHTM.replace(/\r/g," ");				
					PourChFunc = PourChFunc.replace(/\n/g," ");				
				}
				else
				{
					var PourChFunc = ContHTM.replace(/\s|\r|\n/g," ");				
				}
				var PourNCHTM = PourChFunc;
				
				
			//	alert(PourChFunc);
			//	alert(PourChFunc.replace(/.+AffLeDiv ?\\( ?\''+IDduDIV+'[^)o]+\\) ?;/g, ''));
				
			//	var RestFuncsz = PourChFunc.replace(/^.+AffLeDiv ?\\( ?\''+IDduDIV+'[^)o]+\\) ?;/, '');
				var RestFuncsz = '';
				RestFuncsz = PourChFunc.replace(ReZA, '');
				
				RestFuncsAr = RestFuncsz.split('"');
				var RestFuncs = RestFuncsAr[0];

				// alert ('-'+RestFuncsz+'-'+IDduDIV);

				var LinkForClose = '<a href="#"  onclick="AffLeDiv(\''+IDduDIV+'\',\'\');'+RestFuncs+'"><img src="'+LBase+'Image/spacer.gif" width="35" height="35" border="0" /></a>';

				

				if(ie == 1)
				{
			//	var LaREGX = '(\\()?<a[^>]+AffLeDiv ?\\( ?\''+IDduDIV+'\'((</a){0}.)+</a ?> ?(\\))?';


				var LaREGX = '(\\()?<a[^>]+AffLeDiv ?\\( ?\''+IDduDIV+'\'[^>]+> ?(\\))?';
				var LaREGX = '(\\()?<a[^>]+AffLeDiv ?\\( ?\''+IDduDIV+'\'((</a){0}.)+</a ?> ?(\\))?';
				var LaREGX = '(\\()? ?<a[^>]+AffLeDiv ?\\( ?\''+IDduDIV+'\'[^>]+>';
				
				
			//	var LaREGX = '(\\()?<a[^>]+AffLeDiv[^>]+>.+/a ?>(.+)';
																 
																 
														  
														  
	//			var lesA = 	NewContHTM.getElementsByTagName('a');
				
	//			var exprLesA = new RegExp ('AffLeDiv ?\\( ?\''+IDduDIV+'\'', 'gi');
														 
		/*		for (iii=0; iii<2; iii++)
				{
//var AttributeNode = objet.getAttributeNode("href");

//alert(AttributeNode.name+"/" +AttributeNode.value+"/" +AttributeNode.specified);

					if (lesA[iii].getAttribute('onClick'))
					{
						if (lesA[iii].getAttribute('onClick').match(exprLesA))
							NewContHTM.getElementsByTagName('a')[iii].innerHTML = '';
						
					}
				}
			*/											  
			//	var LaREGX = 'AffLeDiv';
				
					var RgExp2 = new RegExp (LaREGX,"gi");
					var RgExp3 = new RegExp ('<\\/a ?> ?\\)?','i');
					
					var forNewContH = PourNCHTM.split(RgExp2);
					
					for (tt=0; tt<forNewContH.length; tt++)
					{
						
						if (tt == 0)
						{
							var NewContHTM = forNewContH[tt];	
						}
						else
						{
							
							var forAddNewCont = forNewContH[tt].split(RgExp3);
							
							for (ttt=1; ttt<forAddNewCont.length; ttt++)
							{
								// alert(forAddNewCont[ttt]+' '+ttt);
								NewContHTM += forAddNewCont[ttt];
								if (ttt < (forAddNewCont.length-1))
									NewContHTM += '</a> ';
							}
							
						}
						
					}
					
					
				
					//var NewContHTM = PourNCHTM.replace(RgExp2,'');
					
					
			//		alert ('lalala :::::: '+NewContHTM);
			//		alert ('lalala :::::: '+PourNCHTM.match(RgExp2));
								
								
					
				}
				else
				{
					var RgExp2 = new RegExp (LaREGX,"gi");
					var NewContHTM = ContHTM.replace(RgExp2,'');
				}
				

			//	alert('TRAAAAA ::::: '+NewContHTM);

				var OKHTMV = '<div class="'+FClassHaut+'">'+LinkForClose+'</div>'+NewContHTM+'<div class="'+FClassBas+'">'+LinkForClose+'</div>';
				
				document.getElementById(IDduDIV).innerHTML = OKHTMV;

}
		}
	}
	
}
function ResizePGDim ()
{
//	window.event.addEventListener('','','false');	
	
	
	if (window.addEventListener)
	{
	  window.addEventListener('onresize', ResizePage, false);
	} 
	else if (window.attachEvent) 
	{
	  window.attachEvent('onresize', ResizePage);
	}	
	
}

function RefreshPhoto()
{
	
	var IsRefresh = document.getElementById('RefreshPhoto');
	
	if ( IsRefresh.value == "")
	{
		var PhotoID = window.frames['Photos']; 
		var PhotoSRC = PhotoID.location; 
		var LaLocat = new String (PhotoSRC);
		var PhotV = LaLocat.search(/FotoVoulue=/); 
		if (PhotV == -1)  
			PhotoID.location = PhotoSRC;
		IsRefresh.value = "OK";
	}
	
}
function CacheContenu_resize(OuiOuNon)
{
	var leContenu = document.getElementById('contenu');	
	
	if (leContenu)
	{
		if (OuiOuNon == 1)
		{
			leContenu.style.display = 'block';
		}
		else
		{
			leContenu.style.display = 'none';
		}
		
	}
}

function VoirIMG(ElementID,YorN)
{
	if (document.getElementById(ElementID))
	{
		var Lelm = document.getElementById(ElementID);	
	
		Larg = Lelm.offsetWidth;
		Haute = Lelm.offsetHeight;
	//	alert (Haute+' HxL '+Larg);
		
		if (YorN == '1')
		{
			Lelm.style.display = 'inline';
			
		}
		else
		{
			Lelm.style.display = 'none';
		}
	}
}

function VoirPlaceDIV (DIVvoulu, StyleDisplay, top, left)
{
	var Lelmo = '';
	var StyleVisible = '';
	
	Lelmo = document.getElementById(DIVvoulu);
	
	if (Lelmo)
	{
		if (StyleDisplay == '') StyleDisplay = 'block';
		
		
		if (document.all)
		{
			if (StyleDisplay == 'block') StyleVisible = 'visible';
			else if (StyleDisplay == 'none') StyleVisible = 'hidden';
			
			Lelmo.style.visibility = StyleVisible;
			Lelmo.style.display = StyleDisplay;
		}
		else
		{
			Lelmo.style.display = StyleDisplay;
			//alert (appna+' NON match ');
		}
		
		Lelmo.style.marginTop = top;
		Lelmo.style.marginLeft = left;
	}
	
}


function ZIndexD (DivV,IndZ , Positio)
{

	var NavName = navigator.appName;
	var RgExpO = new RegExp ("(Internet Explorer)|(msie)","gi");

	if (document.getElementById(DivV))
	{
		if (document.getElementById(DivV+'Div') != null /*&& NavName.match(RgExpO) != null*/)
		{
			
			var LeDVou = document.getElementById(DivV+'Div');
			var LeDVouStyle = LeDVou.style;

			LeDVouStyle.zIndex = IndZ;
			
			var LaPositionVar = 'Posit_'+DivV;
			
/**/
			if (window[LaPositionVar] == null )
				window[LaPositionVar] = LeDVouStyle.position;
			
			if ( IndZ == 0 )
			{
				LeDVouStyle.position = 'absolute';
			}
			else
			{
				if ( window[LaPositionVar] != null  && window[LaPositionVar])
				{
					LeDVouStyle.position = window[LaPositionVar];
				}
				
			}

			// LeDVou.border = '#552233 thin solid';
			// alert ('IE \n Div : '+DivV+'\n zIndex : '+IndZ+'\n Window-LaPositionVar- :  '+window[LaPositionVar]+'\n LeDVouStyle:position : '+LeDVouStyle.position+'\n LaPositionVar : '+LaPositionVar);
/**/
		}
	}

	var LeDIVVou = document.getElementById(DivV);
	var LeDIVVouStyl = LeDIVVou.style;
	LeDIVVouStyl.zIndex = IndZ;



}




function FondTrame(Qr)
{
	var NavName = navigator.userAgent;
	
	var RgExpO = new RegExp ("(msie)","gi");
	var RgExp1 = new RegExp ("(msie 7\.)","gi");
	
	var GSB = document.getElementById('Masque');
	
	var LesTables = document.getElementsByTagName('table');
	var FON = LesTables[0];
	
	HAU = FON.offsetHeight;	
	LAR = FON.offsetWidth;
	
	if (Qr=='')
	{
		if (GSB.style.display == 'none')
			var VouC = 'vois';
		else
			var VouC = 'cache';
	}
	else if (Qr=='1')
	{
			var VouC = 'vois';
	}
	else
	{
			var VouC = 'cache';
	}

	if (VouC == 'vois')
	{
		// alert('boo: '+LAR+' x '+HAU);
		GSB.style.position = 'absolute';
		GSB.style.zIndex = '2';
		GSB.style.display = 'block';
		GSB.style.top = '0px';
		GSB.style.left = '0px';
		GSB.style.width = LAR+'px';
		GSB.style.height = HAU+'px';
		GSB.style.backgroundImage = 'url(Image/oToGraf/FondTRAME.png)';
		

		if (NavName.match(RgExpO) != null && NavName.match(RgExp1) == null)
			GSB.style.backgroundImage = 'url(Image/oToGraf/FondTRAME.gif)';
	
		GSB.style.backgroundRepeat = 'repeat';
		GSB.style.backgroundPosition = 'left top';
	}
	else
	{
		GSB.style.display = 'none';
	}
}
function ChangeTailleBouBa()
{
	var GSB = document.getElementById('TailleVoul');
	var GBouHBa = document.getElementById('oTGr_BouchBas');
	
	GBouHBa.style.height = GSB.value;
}

function Reload_PageImages ()
{
	if (document.getElementById('oTo_GrisSousBouche'))
	{
		var GSB = document.getElementById('oTo_GrisSousBouche');
		var FON = document.getElementById('oTGr_FondPg');
	
		var GBouHBa = document.getElementById('oTGr_BouchBas');
		var MasQ = document.getElementById('Masque');
		
		var DispMasque = 'none';
		if (MasQ.style.display != null && MasQ.style.display != '')
			DispMasque = MasQ.style.display;
		
		var DimTot = GSB.offsetHeight;	
		var DimGSB = GBouHBa.offsetHeight;
		
		
		
	//   alert (DimGSB+' '+DimTot);
		
		FON.style.height = DimGSB;
		
		
	//	GBouHBa.style.backgroundAttachment = 'fixed';
	
		if (DimGSB < 830)
		{
			GSB.style.backgroundImage = 'url(Image/oToGraf/oTo_SousBouche.gif)';
			GSB.style.backgroundRepeat = 'no-repeat';
			GSB.style.backgroundPosition = 'center top';
			GSB.style.backgroundAttachment = 'scroll';
		}
		else
		{
			GSB.style.backgroundImage = 'url(Image/oToGraf/oTo_GrisSousBouche.gif)';
			GSB.style.backgroundRepeat = 'no-repeat';
			GSB.style.backgroundPosition = 'center bottom';
			GSB.style.backgroundAttachment = 'scroll';
		}
		MasQ.style.display = DispMasque;
		GBouHBa.style.backgroundAttachment = 'scroll';
	}
//	alert (DimGSB+' '+GSB.style.backgroundImage);
	
}


function SizeGooRech ()
{
	var divGo = document.getElementById('RchGoo');
	var TayDG = divGo.offsetHeight;
	
	var LeDivContenant = document.getElementById('DRechG');
	LeDivContenant.style.height = TayDG-100;
	//alert (TayDG);
}

function MakeAdresse()
{
    var ListElmts = new Array('Dest','Att','rue1','rue2','CPVille','Pays','tel');

	var LAdress = '';
	LAdress += '___Dest___ --- ';
	LAdress += '___Att___ (___tel___) --- ';
	LAdress += '___rue1___ --- ';
	LAdress += '___rue2___ --- ';
	LAdress += '___CPVille___ --- ';
	LAdress += '___Pays___ --- ';

	var PourVoir= '';
    var ChampADRESS = document.getElementById('AdresseAS');
    var RecapAdress = document.getElementById('NouvAdrsExpG');
	
	
	
    
    for (oi=0; oi<ListElmts.length; oi++)
    {
    	var LePsot = ListElmts[oi];
        
		if (document.getElementById(LePsot))
       	{
			var ChAddr = document.getElementById(LePsot);
			
			var regcetelement = new RegExp ('___'+LePsot+'___', 'gi');
			
        
			LAdress = LAdress.replace(regcetelement, ChAddr.value);
		}
        
        
    }
  //  alert (LAdress);
    ChampADRESS.value = LAdress;
	
	var BoutonModif = '<input name="adressVALIDE" type="button" class="TxtGras" id="adressVALIDE" value="modifier cette adresse" onclick="javascript:AffLeDiv(\'NouvAdrsExp\',\'open\');" />';
 
 	var regStLg = new RegExp('( --- )+', 'gi');
	PourVoir = LAdress.replace(regStLg, '<br/>');
 
 	RecapAdress.innerHTML = PourVoir+BoutonModif;
	
}

function AffElDiv(KelDiv, KelAff)
{
		AffLeDiv(KelDiv, KelAff);
}

function FrameBCRedim(QuelFram,HautNorm)
{


	var ra=window.frames[QuelFram].document.getElementById('TheFormFile').offsetHeight; 
	var ro=window.frames[QuelFram].document.innerHeight; 
	
	if (  Math.abs(ro) >= 0)
		var ok = 'ok';
	else
		var ro = window.frames[QuelFram].document.body.clientHeight;

//	alert('Le IF est OK '+ro+' '+ra);
	
	
	var raGd = ra+5;
	var LaFrams = document.getElementById(QuelFram+'_frame');
	
	// parent.document.getElementById('<? echo $_GET['nf']; ?>_frame');
	
	//alert (ro+' '+ra);

	if (ro >= ra ) 
	{
		LaFrams.style.height = HautNorm+'px';
		LaFrams.style.border = 'none';
		LaFrams.style.margin = '0px';
		// lra.style.bgColor = 'none';
	}
	else 
	{
		LaFrams.style.height = raGd+'px';
		//  LaFrams.style.border = '1px solid #0000AA';
		LaFrams.style.margin = '0px 0px 0px 0px';
		// lra.style.bgColor = '#DDDDDD';
	}
			
	
	
	
}

function doTheFrameBCRedim(QuelFram, HautNorm)
{
	
	FrameBCRedim(QuelFram,HautNorm);
}



function patientez(subform)
{
	
bou= window.document.getElementById(subform); 
AttentHTM = '<div style=\'z-index:10; position:absolute; \' > <table width=' + bou.offsetWidth + ' height=' + bou.offsetHeight + ' cellpadding=0 cellspacing=0>';
AttentHTM += '<tr valign=top><td class=TableHaut></td> </tr> <tr> <td class=TableFdBleu align=left valign=bottom style=\'padding-left:50px;\'>';
AttentHTM += '<img src=Image/oToGraf/Waiting_03.gif />';
AttentHTM += '</td> </tr> <tr> <td align=left class=TableBas>';
AttentHTM += '<span class=SousTitre>Chargement en cours,</span> <br />Veuillez patientez...</td> </tr> </table>  </div>'; 
LeHTMLForm = bou.innerHTML; 
bou.innerHTML = AttentHTM + LeHTMLForm ; 
return false();
}



function ParrainPartner(ledivbon)
{
	var PostDesDivs = document.getElementById('PostADiv'); 
	var DivsList = PostDesDivs.value;
	var MoyPar = DivsList.split(',');
	for (u=0;u<MoyPar.length;u++)
	{
		LequelDiv = MoyPar[u];
		CeDivGo = document.getElementById(LequelDiv);
		if (LequelDiv != ledivbon)
			CeDivGo.style.display = 'none';
		else
			CeDivGo.style.display = 'block';
	}
}


function MenuGauche(){
  if (window.document.getElementById('MenuGauche'))
  {
	  var LIG = window.document.getElementById('MenuGauche').getElementsByTagName('li');
	  nLIG = LIG.length;
	  for(p=0; p < nLIG; p++)
	  {
		LIG[p].onmouseover = function(){ hover(this); }
		LIG[p].onmouseout = function(){ hover(this); }
	  }
  }
}

function MenuHaut(){
  if (window.document.getElementById('MenuHaut'))
  {
	var LITR = window.document.getElementById('MenuHaut').getElementsByTagName('li'); 
	nLITR = LITR.length; 
	for(y=0; y < nLITR; y++)
	{ 
		LITR[y].onmouseover = function(){ hover(this); } 
		LITR[y].onmouseout = function(){ hover(this); } 
	}
  }
}





function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

//-->

function windowVoir(URL,Titre,larg,haut)
{ 
	var wino = window.open(URL,Titre,'scrollbars=yes,height='+haut+',width='+larg+', resizable=yes');
	wino.moveTo(5,5);
	wino.focus();
}

function goToAaff(quelIDvalue, quelValue)
{
	window.document.getElementById(quelIDvalue).value = quelValue;	
	window.document.forms[0].submit();
}
