// Copyright 2007-2008 NEW3S s.a. - NEW3S.com
// Christophe LEMOINE + Michael BRICOUT

AddScene ("etage1_1", "etage1_1", "Scenes/etage1_a.tnt", 'SP3D_E01H01');

function Add_etage1_1_option() {
	if (gSceneDebug > 1) { alert ("Add_etage1_1_option()"); }
	AddSceneOptionWithStyle (1,"1-1 Showroom",'LoadScene("etage1_1")','SP3D_E01H01','color:#FF7200;font-weight:bold;');
	//AddSceneOptionWithStyle (2,"Stand 01",'LoadSceneAndGo("etage1_1","camera1")','SP3D_E01H01_S01','color:#669DFF;');
	//AddSceneOptionWithStyle (2,"Stand 02",'LoadSceneAndGo("etage1_1","camera2")','SP3D_E01H01_S02','color:#669DFF;');
	//AddSceneOptionWithStyle (2,"Stand 03",'LoadSceneAndGo("etage1_1","camera3")','SP3D_E01H01_S03','color:#669DFF;');
	//AddSceneOptionWithStyle (2,"Stand 04",'LoadSceneAndGo("etage1_1","camera4")','SP3D_E01H01_S04','color:#669DFF;');
	//AddSceneOptionWithStyle (2,"Stand 05",'LoadSceneAndGo("etage1_1","camera5")','SP3D_E01H01_S05','color:#669DFF;');
	//AddSceneOptionWithStyle (2,"Stand 06",'LoadSceneAndGo("etage1_1","camera6")','SP3D_E01H01_S06','color:#669DFF;');
	//AddSceneOptionWithStyle (2,"Stand 07",'LoadSceneAndGo("etage1_1","camera7")','SP3D_E01H01_S07','color:#669DFF;');
	//AddSceneOptionWithStyle (2,"Stand 08",'LoadSceneAndGo("etage1_1","camera8")','SP3D_E01H01_S08','color:#669DFF;');
	//AddSceneOptionWithStyle (2,"Stand 09",'LoadSceneAndGo("etage1_1","camera9")','SP3D_E01H01_S09','color:#669DFF;');
	//AddSceneOptionWithStyle (2,"Stand 10",'LoadSceneAndGo("etage1_1","camera10")','SP3D_E01H01_S10','color:#669DFF;');
	//AddSceneOptionWithStyle (2,"Stand 11",'LoadSceneAndGo("etage1_1","camera11")','SP3D_E01H01_S11','color:#669DFF;');
	//AddSceneOptionWithStyle (2,"Stand 12",'LoadSceneAndGo("etage1_1","camera12")','SP3D_E01H01_S12','color:#669DFF;');
	//AddSceneOptionWithStyle (2,"Stand 13",'LoadSceneAndGo("etage1_1","camera13")','SP3D_E01H01_S13','color:#669DFF;');
	//AddSceneOptionWithStyle (2,"Stand 14",'LoadSceneAndGo("etage1_1","camera14")','SP3D_E01H01_S14','color:#669DFF;');
	//AddSceneOptionWithStyle (2,"Stand 15",'LoadSceneAndGo("etage1_1","camera15")','SP3D_E01H01_S15','color:#669DFF;');
}

function OnLoad_etage1_1() {
	soundManager.createSound ( {id:'SP3D_E01H01', url:'etage1_1/Sounds/entree_hall.mp3'} );
	soundManager.createSound ( {id:'SP3D_E01H01S01_IN', url:'etage1_1/Sounds/entree_stand01.mp3'} );
	soundManager.createSound ( {id:'SP3D_E01H01S02_IN', url:'etage1_1/Sounds/entree_stand02.mp3'} );
	soundManager.createSound ( {id:'SP3D_E01H01S03_IN', url:'etage1_1/Sounds/entree_stand03.mp3'} );
	soundManager.createSound ( {id:'SP3D_E01H01S04_IN', url:'etage1_1/Sounds/entree_stand04.mp3'} );
	soundManager.createSound ( {id:'SP3D_E01H01S05_IN', url:'etage1_1/Sounds/entree_stand05.mp3'} );
	soundManager.createSound ( {id:'SP3D_E01H01S06_IN', url:'etage1_1/Sounds/entree_stand06.mp3'} );
	soundManager.createSound ( {id:'SP3D_E01H01S07_IN', url:'etage1_1/Sounds/entree_stand07.mp3'} );
	soundManager.createSound ( {id:'SP3D_E01H01S08_IN', url:'etage1_1/Sounds/entree_stand08.mp3'} );
	soundManager.createSound ( {id:'SP3D_E01H01S09_IN', url:'etage1_1/Sounds/entree_stand09.mp3'} );
	soundManager.createSound ( {id:'SP3D_E01H01S10_IN', url:'etage1_1/Sounds/entree_stand10.mp3'} );
	soundManager.createSound ( {id:'SP3D_E01H01S11_IN', url:'etage1_1/Sounds/entree_stand11.mp3'} );
	soundManager.createSound ( {id:'SP3D_E01H01S12_IN', url:'etage1_1/Sounds/entree_stand12.mp3'} );
	soundManager.createSound ( {id:'SP3D_E01H01S13_IN', url:'etage1_1/Sounds/entree_stand13.mp3'} );
	soundManager.createSound ( {id:'SP3D_E01H01S14_IN', url:'etage1_1/Sounds/entree_stand14.mp3'} );
	soundManager.createSound ( {id:'SP3D_E01H01S15_IN', url:'etage1_1/Sounds/entree_stand15.mp3'} );
}

function OnUnload_etage1_1() {
	soundManager.destroySound ('SP3D_E01H01');
	soundManager.destroySound ('SP3D_E01H01S01_IN');
	soundManager.destroySound ('SP3D_E01H01S02_IN');
	soundManager.destroySound ('SP3D_E01H01S03_IN');
	soundManager.destroySound ('SP3D_E01H01S04_IN');
	soundManager.destroySound ('SP3D_E01H01S05_IN');
	soundManager.destroySound ('SP3D_E01H01S06_IN');
	soundManager.destroySound ('SP3D_E01H01S07_IN');
	soundManager.destroySound ('SP3D_E01H01S08_IN');
	soundManager.destroySound ('SP3D_E01H01S09_IN');
	soundManager.destroySound ('SP3D_E01H01S10_IN');
	soundManager.destroySound ('SP3D_E01H01S11_IN');
	soundManager.destroySound ('SP3D_E01H01S12_IN');
	soundManager.destroySound ('SP3D_E01H01S13_IN');
	soundManager.destroySound ('SP3D_E01H01S14_IN');
	soundManager.destroySound ('SP3D_E01H01S15_IN');
}

function loadExternalTextures_etage1_1() {
	loadExternalTextures();
}

function OnReady_etage1_1() {
	//window.status = "TurnTool Ready (" + gLastScene + " -> " + gCurrentScene + ")";
	switch (gLastScene) {
		case "ascenseur":
			soundManager.stopAll ();
			soundManager.play ('Ding', {volume: 80, onfinish:function() {soundManager.play ('SP3D_E01H01', {volume: 100}); } } );
			//OpenDoor(gLastScene);
			//TNTDoCommand('CameraCtrl.Match("camera0",2000)'); // Sortir
			//CloseDoor(gLastScene);
		break;
		default:
			soundManager.play ('SP3D_E01H01', {volume: 100});
		break;
	}
	//TNTDoCommand('ObjectTree("*").PlayAnimation(0,255,true,20)');
	ResetRing_Scene (20, 200);
}

function OnClick_etage1_1(obj) {
	window.status = "Mouse click: etage1_1/" + obj;
	var scene = "SP3D_E01H01";
	switch(obj) {
		//Liens inter-scene
		case "ascenseur":
		case "hall_suivant":
		case "hall_precedent":
		case "acces_hall01":
		case "acces_hall02":
		case "acces_hall03":
		case "acces_hall04":
		case "acces_hall05":
		case "acces_hall06":
		case "acces_hall07":
		case "acces_hall08":
		case "acces_hall09":
		case "acces_hall10":
		case "acces_hall11":
		case "acces_hall12":
		case "acces_hall13":
			var precedent = "ascenseur";
			var suivant   = "etage1_2";
			ClickGotoSalon (obj, precedent, suivant, "etage1");
		break;
		
		//Liens intra-scene
		case "acces_stand01":
		case "acces_stand02":
		case "acces_stand03":
		case "acces_stand04":
		case "acces_stand05":
		case "acces_stand06":
		case "acces_stand07":
		case "acces_stand08":
		case "acces_stand09":
		case "acces_stand10":
		case "acces_stand11":
		case "acces_stand12":
		case "acces_stand13":
		case "acces_stand14":
		case "acces_stand15":
			ClickGotoStand (obj, "SP3D_E01H01");
		break;

		//Liens commun à plusieurs scenes
		case "message01": soundManager.stopAll (); soundManager.play ('message01', {volume: 100}); break;
		case "message02": soundManager.stopAll (); soundManager.play ('message02', {volume: 100}); break;
		case "message03": soundManager.stopAll (); soundManager.play ('message03', {volume: 100}); break;
		case "message04": soundManager.stopAll (); soundManager.play ('message04', {volume: 100}); break;
		case "message05": soundManager.stopAll (); soundManager.play ('message05', {volume: 100}); break;

		//Liens SPONSORS
		case "sponsors01":
		case "sponsors02":
		case "sponsors03":
		case "sponsors04":
			window.open ("media.asp?Id="+scene+"&IdMedia="+obj);
			SceneTracker("Sponsor", obj, "");
		break;
		case "coface01":
			window.open ("http://www.coface.fr/dmt/rubb_asspro/ap01_assenligne.htm");
			SceneTracker("Sponsor", obj, "");
		break;
		case "coface02":
			window.open ("http://www.coface.fr/dmt/rubb_asspro/ap01_assenligne.htm");
			SceneTracker("Sponsor", obj, "");
		break;
		case "coface03":
			window.open ("http://www.coface.fr/dmt/rubb_asspro/ap01_assenligne.htm");
			SceneTracker("Sponsor", obj, "");
		break;
		case "coface04":
			window.open ("http://www.coface.fr/dmt/rubb_asspro/ap01_assenligne.htm");
			SceneTracker("Sponsor", obj, "");
		break;
		case "coface05":
			window.open ("http://www.coface.fr/dmt/rubb_asspro/ap01_assenligne.htm");
			SceneTracker("Sponsor", obj, "");
		break;
			
		default: ClickOnStand (obj, scene); break;
	}
}

function OnMouseEnter_etage1_1(obj) {
	//alert ("OnMouseEnter_etage1_1("+obj+")");
}

function OnMouseExit_etage1_1(obj) {
}

function OnZoneEnter_etage1_1(zone, physics) {
	window.status = "Zone enter: etage1_1/" + zone + " by " + physics;
	ZoneEnterOnStand (zone, physics, "SP3D_E01H01");
}

function OnZoneExit_etage1_1(zone, physics) {
}

function OnKeyPress_etage1_1(keyCode, ascii) {
}

function OnKeyRelease_etage1_1(keyCode, ascii) {
}

// Copyright 2007-2008 NEW3S s.a. - NEW3S.com
// Christophe LEMOINE + Michael BRICOUT

