//// JavaScript Document
/* ------------------ Version 0.1 : 02 juin 2006 12:11 -- TOPH **/




var Choix = 0;
var AcienChoix = 0;

var MenuSelect = 0;
var AncienMenuSelect = 0;
var menusurvole;

var AncienClass = 0;

var menuSelected = 0;



function Teste_Navigateur()
{

		Nom_Browser = navigator.appName;
		
		Version_Browser = navigator.appVersion;
		
		if ( Nom_Browser == "Netscape" )
		{
			return 1;
		}
		if ( Nom_Browser == "Microsoft Internet Explorer" )
		{
			return 2;
		}
		return 2;
}

//******************************  FONCTION AJAX ********************************/

function OnLoadTEST1(DATA)
{
	Charge_HTML( 'SUPPORTPAGES' , DATA );	
	RedimIframe( document );
}

function Charge_Page( url )
{
	
	var iNav = Teste_Navigateur();

	
	if( iNav == 1)
	{
	
		var obj = document.getElementById('iframe');
		if( obj != null ) obj.setAttribute('src', 'templates/'+url);
		
	}
	if( iNav == 2)//ie
	{
		var obj = document.getElementById('iframe');
		if( obj != null ) obj.src = 'templates/'+url ;
		
	}
}
/*******************************    fonction redimIframe  **********************/

//// mise a taille de l'iframe
/// FONCTION DE MISE A TAILLE
function RedimIframe( Objet, SOURCE, CIBLE )
{
	//var Taille = 600;
	Taille = Objet.getElementById(SOURCE).clientHeight;

	var iNav = Teste_Navigateur();

	if (Taille < 500 ){  Taille = 500;  }
	
	if( iNav == 1)
	{
	
		var obj = document.getElementById(CIBLE);
		if( obj != null ) obj.setAttribute('style','height:'+Taille+'px; border:0px; width:750px;');
		
	}
	if( iNav == 2)//ie
	{
		var obj = document.getElementById(CIBLE);
		if( obj != null ) obj.style.height = Taille+25 ;
		
	}
}

/**********************    fonction changement de la couleur des liens des rubriques selectionnées   **********************/

function test()
{
	alert("test");	
}

function changeStyle(id, evenement,dd,nomfich)
{

	var iNav = Teste_Navigateur()
		//alert(iNav);

	if( iNav == 1) //safari firefox
		{
			if (evenement == 'rollover')
			{
					if(AncienMenuSelect == id)
					{
						/// pas de changement
					}
					else if(AncienMenuSelect != id)
					{
						if(menusurvole == id)
						{
							var obj = document.getElementById(id);
							if( obj != null ) obj.setAttribute('class','RUBRIQUE');
							menusurvole = null;
						}
						else if(menusurvole != id)
						{
							var obj = document.getElementById(id);
							if( obj != null ) obj.setAttribute('class','RUBRIQUE_SELECTED');
							menusurvole = id;
						}
					}
			}
			if (evenement == 'click')
			{
					if(AncienMenuSelect == id)
						{
							
							var obj = document.getElementById('SSmenu_'+id);
							if( obj != null ) obj.setAttribute('class','SOUS-RUBRIQUE');
							
							var obj = document.getElementById(AncienMenuSelect);
							if( obj != null ) obj.setAttribute('class','RUBRIQUE');
							Charge_Page('bienvenue.php');
							
							AncienMenuSelect = null;
						}	
					else if(AncienMenuSelect != id)
						{
							var obj = document.getElementById(id);
							if( obj != null ) obj.setAttribute('class','RUBRIQUE_SELECTED');
							
							var obj = document.getElementById('SSmenu_'+id);
							if( obj != null ) obj.setAttribute('class','SOUS-RUBRIQUE-SELECTED');
							
							// reinitialisation de l'ancien menu selectionné
							var obj = document.getElementById(AncienMenuSelect);
							if( obj != null ) obj.setAttribute('class','RUBRIQUE');
							
							
							var obj = document.getElementById('SSmenu_'+AncienMenuSelect);
							if( obj != null ) obj.setAttribute('class','SOUS-RUBRIQUE');
							Charge_Page(nomfich+'?ID='+dd);
							AncienMenuSelect = id;
						}
			
			
			}
		}

	if( iNav == 2)//ie
	    {
			if (evenement == 'rollover')
			{
					if(AncienMenuSelect == id)
					{
						/// pas de changement
					}
					else if(AncienMenuSelect != id)
					{
						if(menusurvole == id)
						{
							var obj = document.getElementById(id);
							if( obj != null ) obj.className = 'RUBRIQUE';
							menusurvole = null;
						}
						else if(menusurvole != id)
						{
							var obj = document.getElementById(id);
							if( obj != null ) obj.className = 'RUBRIQUE_SELECTED';
							menusurvole = id;
						}
					}
			}
			if (evenement == 'click')
			{
					if(AncienMenuSelect == id)
						{
							var obj = document.getElementById('SSmenu_'+id);
							if( obj != null ) obj.style.display = 'none';
							
							var obj = document.getElementById(AncienMenuSelect);
							if( obj != null ) obj.className = 'RUBRIQUE';
							Charge_Page('bienvenue.php');
							AncienMenuSelect = null;
						}	
					else if(AncienMenuSelect != id)
						{
							var obj = document.getElementById(id);
							if( obj != null ) obj.className = 'RUBRIQUE_SELECTED';
							
							var obj = document.getElementById('SSmenu_'+id);
							if( obj != null ) obj.style.display = 'block';
							// reinitialisation de l'ancien menu selectionné
							var obj = document.getElementById(AncienMenuSelect);
							if( obj != null ) obj.className = 'RUBRIQUE';
							
							
							var obj = document.getElementById('SSmenu_'+AncienMenuSelect);
							if( obj != null ) obj.style.display = 'none';
							Charge_Page(nomfich+'?ID='+dd);
							AncienMenuSelect = id;
						}
			
			
			}
		
		}

}





function Change_Class(	id, courant, nouveau, type)
{
	var iNav = Teste_Navigateur()
	
	if( iNav == 1) //safari
		{
			
			var obj = document.getElementById(id);
			if( obj != null ) obj.setAttribute('class', nouveau  );
			/// réinitialisation du menu précedement selectionné
			if(AncienMenuSelect != id)
			{
				var obj = document.getElementById(AncienMenuSelect);
				if( obj != null ) obj.setAttribute('class', AncienClass  );	
			}
			
			
		}
	if( iNav == 2)//ie
	    {
			var obj = document.getElementById(id);
			if( obj != null ) obj.className = nouveau;
			/// réinitialisation du menu précedement selectionné	
			if(AncienMenuSelect != id)
			{
				var obj = document.getElementById(AncienMenuSelect);
				if( obj != null ) obj.className = AncienClass;
			}
		}
	///  transformation du menus selectionné en ancien menu selectionné
	
	if(type != 'clique' && menuSelected !=id)
	{
					AncienMenuSelect = id ;
					AncienClass = courant;
	}
	else if(type == 'clique')
	{
				if( iNav == 1)//ie
	    		{
					var obj = document.getElementById(menuSelected);
					if( obj != null ) obj.setAttribute('class', AncienClass  );
				}
				if( iNav == 2)//ie
	    		{
					var obj = document.getElementById(menuSelected);
					if( obj != null ) obj.className = AncienClass;
				}
					AncienMenuSelect = null ;
					AncienClass = null;
					menuSelected = id;
	}

}
///// changement du titre dans l'animation flash









