LePointRollCourant=0;
LePointClicCourant=0;
LeTableauRef=new Array("images/visiteent/IMG/PARVIS/","images/visiteent/IMG/HALL/","images/visiteent/IMG/FOYER/","images/visiteent/IMG/SALLE/");
LeTableauRefImage=new Array(2,5,2,4);

/* ************************************************************* */ 
function CheckFLImage()
{
	if(CurImage==NbImage)
		EtatFLD="hidden";
	else
		EtatFLD="visible";
	if(CurImage==1)
		EtatFLG="hidden";
	else
		EtatFLG="visible";
	
	
		$(document).ready(function () 
		{
			$("#FLG").css({ visibility:EtatFLG});
			$("#FLD").css({ visibility:EtatFLD});
		});
}
/* ************************************************************* */ 
function LockClic() {
	IsLocClick=true;
}
/* ************************************************************* */ 
function UnLockClic() {
	IsLocClick=false;
}
/* ************************************************************* */ 
function FinScroll() {
	UnLockClic();
	CheckFLImage();
}

/* ************************************************************* */  
function ClicD() {
	if(!IsLocClick)
	{
		LockClic();
		CurImage++;
		$(document).ready(
			function () 
			{
		
				$("#DEFILEIMAGE").animate({ marginLeft: 0, marginTop: 0,top:0, left: (CurImage-1)*(-500) },function(){FinScroll();});
			}
		);	
	}
}
/* ************************************************************* */ 
function ClicG() {
	if(!IsLocClick)
	{
		LockClic();
		CurImage--;
		$(document).ready(
			function () 
			{
		
				$("#DEFILEIMAGE").animate({ marginLeft: 0, marginTop: 0,top:0, left: (CurImage-1)*(-500) },function(){FinScroll();});
			}
		);	
	}
}
/* ************************************************************* */ 
function MontrePoint(LePoint) {
	if(LePointRollCourant!="")
	{
		if((LePointRollCourant!=LePoint)&&(LePointClicCourant!=LePoint))
		{
			$(document).ready(
				function () 
				{
			
					$('#POINT'+LePointRollCourant).css({ visibility: 'hidden' });
				}
			);				
		}
	}
	
	LeCheminImage='<img src="'+LeTableauRef[LePoint-1]+'PREVIEW.jpg" width="77" height="79">';
	LePointRollCourant=LePoint;
	$(document).ready(
		function () 
		{
	
			$('#POINT'+LePoint).css({ visibility: 'visible' });
			$("#PREVIEW").html('<img src="images/loadinfo.gif" width="24" height="24">');
			$("#PREVIEW").html(LeCheminImage);
		}
	);		
}
/* ************************************************************* */ 
function CachePoint(LePoint) {
	
	if((LePointClicCourant!=LePoint))
	{
		$(document).ready(
			function () 
			{
		
				$('#POINT'+LePoint).css({ visibility: 'hidden' });
				if(LePointClicCourant!="")
				{
					LeCheminImage='<img src="'+LeTableauRef[LePointClicCourant-1]+'PREVIEW.jpg" width="77" height="79">';
					$("#PREVIEW").html('<img src="images/loadinfo.gif" width="24" height="24">');
					$("#PREVIEW").html(LeCheminImage);					
				}
				else
					$("#PREVIEW").html('<img src="images/giftransparent.gif" width="77" height="79">');
			}
		);		
	}
	if(LePointRollCourant==LePoint)
		LePointRollCourant="";
}
/* ************************************************************* */ 
function ChangeZone(LePoint) {
	
	if(LePointClicCourant!=LePoint)
	{
		if(LePointClicCourant!="")
		{
			$(document).ready(
				function () 
				{
			
					$('#POINT'+LePointClicCourant).css({ visibility: 'hidden' });
				}
			);			
		}
		$(document).ready(
			function () 
			{
		
				$('#POINT'+LePoint).css({ visibility: 'visible' });			
				$("#ZOOMIMAGE").html('<table width="500" height="355" border="0" cellspacing="0" cellpadding="0"><tr><td valign="center" align="center"><img src="images/loadinfo.gif" width="24" height="24"></td></tr></table>');
				$("#DRIVEZOOMIMAGE").html("");
				$.post("phpgabarit/visiteent/visite"+LePoint+".php",{ISIMG:1,ISTXT:0},
        function success(data)
				{
					$("#ZOOMIMAGE").html(data);
				});
				$.post("phpgabarit/visiteent/visite"+LePoint+".php",{ISIMG:0,ISTXT:1},
        function success(data)
				{
					$("#DRIVEZOOMIMAGE").html(data);
					NbImage=LeTableauRefImage[LePoint-1];
					CurImage=1;
					IsLocClick=false;
					CheckFLImage();
				});
			}
		);		
		LePointClicCourant=LePoint;	
	
	}
}
/* ************************************************************* */ 
