// JavaScript Document
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;
}
//// recuperation de position d'objets dans la page
function getOffsetPosition(inID, inTYPE)
{
 var iVal = 0;
 var oObj = document.getElementById(inID);
 var sType = 'oObj.offset' + inTYPE;
 while (oObj && oObj.tagName != 'BODY') {
  iVal += eval(sType);
  oObj = oObj.offsetParent;
 }
 return iVal;
}
function window_onscroll() {
			//window.document.getElementById("boite_deplacable").top = window.document.body.scrollTop;
			//alert(window.document.body.scrollTop);
			//document.getElementById('positionscroll').innerHTML = window.document.body.scrollTop;
	
		}
//// fanction javascript to flash
function doPassVar(Valeur)
{
		   //var sendText = args.value;
		   window.document.Viewer.SetVariable("myVar", Valeur);
}

////////////////////////////////      FONCTIONS SPOTLIGTH   ///////////////////////////////////
////////////////////////////////      FONCTIONS SPOTLIGTH   ///////////////////////////////////
var spotLigthVisible = false;
var IdVoiture;
function confirmEnvoi()
{
	alert('Votre message nous à bien été envoyé.\nNous allons vous répondre dès que possible.');	
}
var positionSouris = 'in';

function initOver(position)
{
	positionSouris = position;
		
}



function AfficheSpotLight(Iddiv)
{
	
	
	
	document.getElementById('spotlight').setAttribute('class','spotlightOn');
	document.getElementById('spotlight').setAttribute('className','spotlightOn');
	///// affichage du div d'arrière plan
	document.getElementById('SousSpotlight').setAttribute('class','SousSpotlightOn');
	document.getElementById('SousSpotlight').setAttribute('className','SousSpotlightOn');
	
	
	
	var iNav = Teste_Navigateur();
			if( iNav == 1)/// gecko
			{
				obj = document.getElementById('supportSite');
				if( obj != null ) obj.setAttribute('style', 'visibility:hidden;');
				///if( obj != null ) obj.setAttribute('style', 'display:none;');
			}
			if(iNav == 2)// ie
			{
				var obj = document.getElementById('supportSite');
				if( obj != null ) obj.style.visibility = 'hidden';
				
				var obj = document.getElementById('spotlight');
				if( obj != null ) obj.style.visibility = 'visible';
				if( obj != null ) obj.style.display = 'block';
				
				var obj = document.getElementById('SousSpotlight');
				if( obj != null ) obj.style.visibility = 'visible';
				if( obj != null ) obj.style.display = 'block';
				
			}
	
	spotLigthVisible = 'visible';
	repositionneSpotLigth(Iddiv);
	
	alert("Cliquez à l'extérieur du plan pour retourner sur le site");
	
}

function repositionneSpotLigth(Iddiv)
{
	if(spotLigthVisible == 'visible')
	{
		
		
		//// positionnement du div
		var POSY_1 = getOffsetPosition('spotlight', 'Top');
		var Scroll = window.document.body.scrollTop;
		//var hauteurduDiv = POSY_1 - Scroll;
		var Largeur = document.body.clientWidth;
		var Hauteur = document.body.clientHeight;
		
		//alert(Hauteur);
		
		var iNav = Teste_Navigateur();
			if( iNav == 1)/// gecko
			{
				var obj = document.getElementById('spotlight');
				if( obj != null ) obj.setAttribute('style', 'visibility:visible; display:block; position:absolute; left:0px;  width:'+Largeur+'px; height:'+Hauteur+'px; bottom:0px; top:'+Scroll+'px; z-index: 999; text-align:center;' );
				
				
				var obj = document.getElementById('SousSpotlight');
				//if( obj != null ) obj.setAttribute('style', 'visibility:visible; display:block; position:absolute; left:0px;  width:'+Largeur+'px; height:'+Hauteur+'px; bottom:0px; top:'+Scroll+'px; z-index: 995;  background:#000000; opacity : 0.5;  filter : alpha(opacity=50); ' );
				
				if( obj != null ) obj.setAttribute('style', 'visibility:visible; display:block; position:absolute; left:0px;  width:4000px; height:4000px; bottom:0px; top:'+Scroll+'px; z-index: 995;  background:#000000; opacity : 0.5;  filter : alpha(opacity=50); ' );
				
				
				
			}
			if(iNav == 2)// ie
			{
				
				var obj = document.getElementById('spotlight');
				if( obj != null ) obj.style.height = Hauteur+'px';
				if( obj != null ) obj.style.width = Largeur+'px';
				if( obj != null ) obj.style.top = Scroll+'px';
				
				var obj = document.getElementById('SousSpotlight');
				if( obj != null ) obj.style.height = '4000px';
				if( obj != null ) obj.style.width = '4000px';
				if( obj != null ) obj.style.background = '#000000';
				
			}
			
			 
		var htmlElement = document.getElementsByTagName('html')[0];
		htmlElement.style.overflow = 'hidden';

	}
}
function masqueSpotlight()
{
	var iNav = Teste_Navigateur();
	
	if(positionSouris == 'out'){
			if( iNav == 1)/// gecko
			{
				var obj = document.getElementById('spotlight');
				if( obj != null ) obj.setAttribute('style', 'visibility:hidden; display:none;' );
				spotLigthVisible = 'hidden';
				
				var obj = document.getElementById('SousSpotlight');
				if( obj != null ) obj.setAttribute('style', 'visibility:hidden; display:none;' );
				
				var obj = document.getElementById('supportSite');
				if( obj != null ) obj.setAttribute('style', 'visibility:visible;' );
				//if( obj != null ) obj.setAttribute('style', 'display:block;' );
				
				
			}
			if(iNav == 2)// ie
			{
				var obj = document.getElementById('spotlight');
				if( obj != null ) obj.style.top = document.body.clientHeight;
				if( obj != null ) obj.style.height = '0px';
				if( obj != null ) obj.style.display = 'none';
				spotLigthVisible = 'hidden';
				
				var obj = document.getElementById('SousSpotlight');
				if( obj != null ) obj.style.top = document.body.clientHeight;
				if( obj != null ) obj.style.height = '0px';
				if( obj != null ) obj.style.display = 'none';
				spotLigthVisible = 'hidden';
				
				var obj = document.getElementById('supportSite');
				if( obj != null ) obj.style.visibility = 'visible';
				if( obj != null ) obj.style.display = 'block';

				
			}
			
			
			var htmlElement = document.getElementsByTagName('html')[0];
		htmlElement.style.overflow = 'scroll';
		
	}
			
}
////////////////////////////////  FIN FONCTIONS SPOTLIGTH   ///////////////////////////////////
////////////////////////////////  FIN FONCTIONS SPOTLIGTH   ///////////////////////////////////
