// JavaScript Document
/*
commentaires
*/
var usingCamera01 = true;
function WalkInside()
{
	TNTDoCommand('SceneGraph.ObjectTree(Piéton).StopAnimation()');
	TNTDoCommand('SceneGraph.ObjectTree(Piéton).SetFrame(0)');
	TNTDoCommand('SceneGraph.ObjectTree(Piéton).SetEnable(false)');
	TNTDoCommand('SceneGraph.ObjectTree(PhysSphere).SetEnable(true)');
	TNTDoCommand('CameraCtrl.SetCurrent("Piéton")');
	usingCamera01 = false;
	TNTDoCommand('SceneGraph.Physics.Reset()');
	element("TNTCtrl").focus();
}
function LookOutside()
{
    if (usingCamera01 == false)
	{	TNTDoCommand('SceneGraph.ObjectTree(Cam_Aérienne).SetEnable(true)');
		TNTDoCommand('SceneGraph.ObjectTree(PhysSphere).SetEnable(false)');
    	TNTDoCommand('CameraCtrl.SetCurrent("Cam_Aérienne")');
		usingCamera01 = true;
    }
	TNTDoCommand('CameraCtrl.Match("Cam_Aérienne",2000)');
}

function maison_01()
{
    if (usingCamera01 == false)
	{	TNTDoCommand('SceneGraph.ObjectTree(Jujubier).SetEnable(true)');
		TNTDoCommand('SceneGraph.ObjectTree(PhysSphere).SetEnable(false)');
    	TNTDoCommand('CameraCtrl.SetCurrent("Jujubier")');
		usingCamera01 = true;
    }
	TNTDoCommand('CameraCtrl.Match("Jujubier",2000)');
}
function maison_02()
{
    if (usingCamera01 == false)
	{	TNTDoCommand('SceneGraph.ObjectTree(Caroubier).SetEnable(true)');
		TNTDoCommand('SceneGraph.ObjectTree(PhysSphere).SetEnable(false)');
    	TNTDoCommand('CameraCtrl.SetCurrent("Caroubier")');
		usingCamera01 = true;
    }
	TNTDoCommand('CameraCtrl.Match("Caroubier",2000)');
}
function maison_03()
{
    if (usingCamera01 == false)
	{	TNTDoCommand('SceneGraph.ObjectTree(Colatier).SetEnable(true)');
		TNTDoCommand('SceneGraph.ObjectTree(PhysSphere).SetEnable(false)');
    	TNTDoCommand('CameraCtrl.SetCurrent("Colatier")');
		usingCamera01 = true;
    }
	TNTDoCommand('CameraCtrl.Match("Colatier",2000)');
}
function maison_04()
{
    if (usingCamera01 == false)
	{	TNTDoCommand('SceneGraph.ObjectTree(Bardane).SetEnable(true)');
		TNTDoCommand('SceneGraph.ObjectTree(PhysSphere).SetEnable(false)');
    	TNTDoCommand('CameraCtrl.SetCurrent("Bardane")');
		usingCamera01 = true;
    }
	TNTDoCommand('CameraCtrl.Match("Bardane",2000)');
}
function maison_05()
{
    if (usingCamera01 == false)
	{	TNTDoCommand('SceneGraph.ObjectTree(Badiane).SetEnable(true)');
		TNTDoCommand('SceneGraph.ObjectTree(PhysSphere).SetEnable(false)');
    	TNTDoCommand('CameraCtrl.SetCurrent("Badiane")');
		usingCamera01 = true;		
    }
	TNTDoCommand('CameraCtrl.Match("Badiane",2000)');
}
function maison_06()
{
    if (usingCamera01 == false)
	{	TNTDoCommand('SceneGraph.ObjectTree(Astragale).SetEnable(true)');
		TNTDoCommand('SceneGraph.ObjectTree(PhysSphere).SetEnable(false)');
    	TNTDoCommand('CameraCtrl.SetCurrent("Astragale")');
		usingCamera01 = true;		
    }
	TNTDoCommand('CameraCtrl.Match("Astragale",2000)');
}
function maison_07()
{
    if (usingCamera01 == false)
	{	TNTDoCommand('SceneGraph.ObjectTree(Aloes).SetEnable(true)');
		TNTDoCommand('SceneGraph.ObjectTree(PhysSphere).SetEnable(false)');
    	TNTDoCommand('CameraCtrl.SetCurrent("Aloes")');
		usingCamera01 = true;		
    }
	TNTDoCommand('CameraCtrl.Match("Aloes",2000)');
}
function point01()
{
    if (usingCamera01 == false)
	{	TNTDoCommand('SceneGraph.ObjectTree(Information01).SetEnable(true)');
		TNTDoCommand('SceneGraph.ObjectTree(PhysSphere).SetEnable(false)');
    	TNTDoCommand('CameraCtrl.SetCurrent("Information01")');
		usingCamera01 = true;
    }
	TNTDoCommand('CameraCtrl.Match("Information01",2000)');
}
function point02()
{
    if (usingCamera01 == false)
	{	TNTDoCommand('SceneGraph.ObjectTree(Information02).SetEnable(true)');
		TNTDoCommand('SceneGraph.ObjectTree(PhysSphere).SetEnable(false)');
    	TNTDoCommand('CameraCtrl.SetCurrent("Information02")');
		usingCamera01 = true;
    }
	TNTDoCommand('CameraCtrl.Match("Information02",2000)');
}
function point03()
{
    if (usingCamera01 == false)
	{	TNTDoCommand('SceneGraph.ObjectTree(Information03).SetEnable(true)');
		TNTDoCommand('SceneGraph.ObjectTree(PhysSphere).SetEnable(false)');
    	TNTDoCommand('CameraCtrl.SetCurrent("Information03")');
		usingCamera01 = true;		
    }
	TNTDoCommand('CameraCtrl.Match("Information03",2000)');
}
function point04()
{
    if (usingCamera01 == false)
	{	TNTDoCommand('SceneGraph.ObjectTree(Information04).SetEnable(true)');
		TNTDoCommand('SceneGraph.ObjectTree(PhysSphere).SetEnable(false)');
    	TNTDoCommand('CameraCtrl.SetCurrent("Information04")');
		usingCamera01 = true;		
    }
	TNTDoCommand('CameraCtrl.Match("Information04",2000)');
}
function point05()
{
    if (usingCamera01 == false)
	{	TNTDoCommand('SceneGraph.ObjectTree(Information05).SetEnable(true)');
		TNTDoCommand('SceneGraph.ObjectTree(PhysSphere).SetEnable(false)');
    	TNTDoCommand('CameraCtrl.SetCurrent("Information05")');
		usingCamera01 = true;		
    }
	TNTDoCommand('CameraCtrl.Match("Information05",2000)');
}
function point06()
{
    if (usingCamera01 == false)
	{	TNTDoCommand('SceneGraph.ObjectTree(Information06).SetEnable(true)');
		TNTDoCommand('SceneGraph.ObjectTree(PhysSphere).SetEnable(false)');
    	TNTDoCommand('CameraCtrl.SetCurrent("Information06")');
		usingCamera01 = true;		
    }
	TNTDoCommand('CameraCtrl.Match("Information06",2000)');
}

function salon()
{
    if (usingCamera01 == false)
	{	TNTDoCommand('SceneGraph.ObjectTree(vue_salon).SetEnable(true)');
		TNTDoCommand('SceneGraph.ObjectTree(PhysSphere).SetEnable(false)');
    	TNTDoCommand('CameraCtrl.SetCurrent("vue_salon")');
		usingCamera01 = true;		
    }
	TNTDoCommand('CameraCtrl.Match("vue_salon",2000)');
}
function terrasse()
{
    if (usingCamera01 == false)
	{	TNTDoCommand('SceneGraph.ObjectTree(vue_terrasse).SetEnable(true)');
		TNTDoCommand('SceneGraph.ObjectTree(PhysSphere).SetEnable(false)');
    	TNTDoCommand('CameraCtrl.SetCurrent("vue_terrasse")');
		usingCamera01 = true;		
    }
	TNTDoCommand('CameraCtrl.Match("vue_terrasse",2000)');
}
function sejour()
{
    if (usingCamera01 == false)
	{	TNTDoCommand('SceneGraph.ObjectTree(vue_sejour).SetEnable(true)');
		TNTDoCommand('SceneGraph.ObjectTree(PhysSphere).SetEnable(false)');
    	TNTDoCommand('CameraCtrl.SetCurrent("vue_sejour")');
		usingCamera01 = true;		
    }
	TNTDoCommand('CameraCtrl.Match("vue_sejour",2000)');
}

function OnClick( obj )
{
	if(obj=='Sticker_info_20') // click sur le Sticker 20
	{
		information_00();
	}
	if(obj=='Sticker_info_21') // click sur le Sticker 21
	{
		information_01();
	}
	if(obj=='Sticker_info_22') // click sur le Sticker 22
	{
		information_02();
	}
	if(obj=='Sticker_info_23') // click sur le Sticker 23
	{
		information_03();
	}
	if(obj=='close') // click sur le Sticker 23
	{
		information_03();
	}
	//window.status = "Object clicked: " + obj;	
}

var openSwitch1 = false;
var openSwitch2 = false;

function Close()
 {
 	if(openSwitch1==false)
 	{
 		TNTDoCommand('Objects(infos_close).PlayAnimation(0,20)'); 
		openSwitch1 = true;
		
		changeCamera('Camera01');
		
		if (openSwitch2==true)
			{
			TNTDoCommand('Objects(infos_close).PlayAnimation(20,30)');
			openSwitch2 = false; 
			} 		
		
 	}
 	else
 	{
 		TNTDoCommand('Objects(infos_close).PlayAnimation(20,30)');
 		//element('Button').value = "Open";
 		openSwitch1 = false;
		
		changeCamera('Camera01');
 	}
 }

function information_00()
 {
 	if(openSwitch2==false)
 	{
 		TNTDoCommand('Objects(panneau_information00).PlayAnimation(0,20)');TNTDoCommand('Objects(infos_close).PlayAnimation(0,20)');
 		//element('Button').value = "Close";
 		openSwitch2 = true;
		
		changeCamera('Camera_ecoute');
		
		if (openSwitch1==true)
			{
			TNTDoCommand('Objects(panneau_information00).PlayAnimation(20,30)');
			openSwitch1 = false;
			} 		
 	}
 	else
 	{
 		TNTDoCommand('Objects(panneau_information00).PlayAnimation(20,30)');
		
 		//element('Button').value = "Open";
 		openSwitch2 = false;
		
		changeCamera('Camera01');
 	}
 }
function information_01()
 {
 	if(openSwitch2==false)
 	{
 		TNTDoCommand('Objects(panneau_information01).PlayAnimation(0,20)');TNTDoCommand('Objects(infos_close).PlayAnimation(0,20)');
 		//element('Button').value = "Close";
 		openSwitch2 = true;
		
		changeCamera('Camera_bome');
		
		if (openSwitch1==true)
			{
			TNTDoCommand('Objects(panneau_information01).PlayAnimation(20,30)');
			openSwitch1 = false;
			} 		
 	}
 	else
 	{
 		TNTDoCommand('Objects(panneau_information01).PlayAnimation(20,30)');
		
 		//element('Button').value = "Open";
 		openSwitch2 = false;
		
		changeCamera('Camera01');
 	}
 }
function information_02()
 {
 	if(openSwitch2==false)
 	{
 		TNTDoCommand('Objects(panneau_information02).PlayAnimation(0,20)');TNTDoCommand('Objects(infos_close).PlayAnimation(0,20)');
 		//element('Button').value = "Close";
 		openSwitch2 = true;
		
		changeCamera('Camera_ecoute');
		
		if (openSwitch1==true)
			{
			TNTDoCommand('Objects(panneau_information02).PlayAnimation(20,30)');
			openSwitch1 = false;
			} 		
 	}
 	else
 	{
 		TNTDoCommand('Objects(panneau_information02).PlayAnimation(20,30)');
		
 		//element('Button').value = "Open";
 		openSwitch2 = false;
		
		changeCamera('Camera01');
 	}
 }
function information_03()
 {
 	if(openSwitch2==false)
 	{
 		TNTDoCommand('Objects(panneau_information03).PlayAnimation(0,20)');TNTDoCommand('Objects(infos_close).PlayAnimation(0,20)');
 		//element('Button').value = "Close";
 		openSwitch2 = true;
		
		changeCamera('Camera_mat');
		
		if (openSwitch1==true)
			{
			TNTDoCommand('Objects(panneau_information03).PlayAnimation(20,30)');
			openSwitch1 = false;
			} 		
 	}
 	else
 	{
 		TNTDoCommand('Objects(panneau_information03).PlayAnimation(20,30)');
		
 		//element('Button').value = "Open";
 		openSwitch2 = false;
		
		changeCamera('Camera01');
 	}
 }
function Activate3()
 {
 	if(openSwitch2==false)
 	{
 		TNTDoCommand('Objects(Maison_Base_Sol).PlayAnimation(0,20)');
		TNTDoCommand('Objects(Dalle_RDC).PlayAnimation(0,20)');
		TNTDoCommand('Objects(Murs_Plan_Niveau_RDC).PlayAnimation(0,20)');
		TNTDoCommand('Objects(Cloison01_RDC).PlayAnimation(0,20)');
		TNTDoCommand('Objects(Cloison01_RDC01).PlayAnimation(0,20)');
		TNTDoCommand('Objects(Cloison01_RDC02).PlayAnimation(0,20)');
		TNTDoCommand('Objects(Cloison01_RDC03).PlayAnimation(0,20)');
		TNTDoCommand('Objects(Text03).PlayAnimation(20,40)');
		TNTDoCommand('Objects(Text04).PlayAnimation(20,40)');
		TNTDoCommand('Objects(Text05).PlayAnimation(20,40)');
		TNTDoCommand('Objects(Text06).PlayAnimation(20,40)');
		TNTDoCommand('Objects(Box01).PlayAnimation(0,20)');
 		//element('Button').value = "Close";
 		openSwitch2 = true;
		
		changeCamera('Vue_ensemble');
		
		if (openSwitch1==true)
			{
			TNTDoCommand('Objects(Maison_Base_Sol).PlayAnimation(20,0)');
			openSwitch1 = false;
			} 		
 	}
 	else
 	{
 		TNTDoCommand('Objects(Maison_Base_Sol).PlayAnimation(20,0)');
		TNTDoCommand('Objects(Dalle_RDC).PlayAnimation(20,0)');
		TNTDoCommand('Objects(Murs_Plan_Niveau_RDC).PlayAnimation(20,0)');
		TNTDoCommand('Objects(Cloison01_RDC).PlayAnimation(20,0)');
		TNTDoCommand('Objects(Cloison01_RDC01).PlayAnimation(20,0)');
		TNTDoCommand('Objects(Cloison01_RDC02).PlayAnimation(20,0)');
		TNTDoCommand('Objects(Cloison01_RDC03).PlayAnimation(20,0)');
		TNTDoCommand('Objects(Text03).PlayAnimation(40,20)');
		TNTDoCommand('Objects(Text04).PlayAnimation(40,20)');
		TNTDoCommand('Objects(Text05).PlayAnimation(40,20)');
		TNTDoCommand('Objects(Text06).PlayAnimation(40,20)');
		TNTDoCommand('Objects(Box01).PlayAnimation(20,0)');
		
 		//element('Button').value = "Open";
 		openSwitch2 = false;
		
		changeCamera('Piéton');
 	}
 }

/*
function OnMouseEnter() 
{ 
   TNTDoCommand('Objects('Layer\:_mur_sud').SetDiffuseColor(#b6d900)');   
}
*/
/*
function OnMouseEnter( obj ) 
{ 
   TNTDoCommand('Objects(' + obj + ').SetDiffuseColor(#FF0000)'); 
   if (obj == 'Teapot01') 
   { 
      element('ToolTip').innerHTML = '<b>You now have your mouse on a Teapot</b>'; 
   } 
   else if (obj == 'Torus01') 
   { 
      element('ToolTip').innerHTML = '<b>You now have your mouse on a Torus</b>'; 
   } 
   else if (obj == 'Cylinder01') 
   { 
      element('ToolTip').innerHTML = '<b>You now have your mouse on a Cylinder</b>'; 
   } 
   window.status = "Mouse Entered: " + obj;    
} 

*/