// Copyright 2007 NEW3S s.a. - NEW3S.com
// Christophe LEMOINE + Michael BRICOUT

AddScene ("showroom", "http://www.new3s.com/salon_3d/showroom", "showroom.tnt");

function Add_showroom_option() {
	if (gSceneDebug > 1) { alert ("Add_showroom_option()"); }
	AddSceneOption('0','Showroom NEW3S','LoadScene("showroom")','showroom');
	AddSceneOption('1','','LoadSceneAndGo("showroom","camera1")','showroom-1');
	AddSceneOption('1','','LoadSceneAndGo("showroom","camera2")','showroom-2');
	AddSceneOption('1','','LoadSceneAndGo("showroom","camera3")','showroom-3');
	AddSceneOption('1','','LoadSceneAndGo("showroom","camera4")','showroom-4');
	AddSceneOption('1','','LoadSceneAndGo("showroom","camera5")','showroom-5');
	AddSceneOption('1','','LoadSceneAndGo("showroom","camera6")','showroom-6');
	AddSceneOption('1','','LoadSceneAndGo("showroom","camera7")','showroom-7');
	AddSceneOption('1','','LoadSceneAndGo("showroom","camera8")','showroom-8');
	AddSceneOption('1','','LoadSceneAndGo("showroom","camera9")','showroom-9');
	AddSceneOption('1','','LoadSceneAndGo("showroom","camera10")','showroom-10');
	AddSceneOption('1','','LoadSceneAndGo("showroom","camera11")','showroom-11');
	AddSceneOption('1','','LoadSceneAndGo("showroom","camera12")','showroom-12');
	AddSceneOption('1','','LoadSceneAndGo("showroom","camera13")','showroom-13');
	AddSceneOption('1','','LoadSceneAndGo("showroom","camera14")','showroom-14');
	AddSceneOption('1','','LoadSceneAndGo("showroom","camera15")','showroom-15');
	AddSceneOption('1','','LoadSceneAndGo("showroom","camera16")','showroom-16');
	AddSceneOption('1','','LoadSceneAndGo("showroom","camera17")','showroom-17');
	AddSceneOption('1','','LoadSceneAndGo("showroom","camera18")','showroom-18');
	AddSceneOption('1','','LoadSceneAndGo("showroom","camera19")','showroom-19');
	AddSceneOption('1','','LoadSceneAndGo("showroom","camera20")','showroom-20');
}

function OnLoad_showroom() {
	if (soundManager) {
		
		soundManager.createSound ( {id:'SRN3S', url:'http://www.new3s.com/salon_3d/showroom/Sounds/Showroom_New3s.mp3'} );
	}
}

function OnUnload_showroom() {
	if (soundManager) {
		soundManager.destroySound ('SR');
		soundManager.destroySound ('SRN3S');
	}
}

function OnReady_showroom() {
	window.status = "TurnTool Ready (" + gLastScene + " -> " + gCurrentScene + ")";
	switch (gLastScene) {
		case "ascenseur":
			if (soundManager) {
				soundManager.stopAll ();
				soundManager.play ('Ding', {volume: 80, onfinish:function() { soundManager.play ('SR', {volume: 100, onfinish:function() { soundManager.play ('SRN3S', {volume: 100});}}); } } );
			}
			OpenDoor(gLastScene);
			TNTDoCommand('CameraCtrl.Match("camera0",2000)'); // Sortir
			CloseDoor(gLastScene);
		break;
		default:
			soundManager.play ('SR', {volume: 100, onfinish:function() { soundManager.play ('SRN3S', {volume: 100}); } } ); 
		break;
	}
}

function OnClick_showroom(obj) {
	window.status = "Mouse click: showroom/" + obj;
	switch(obj) {
		//Liens inter-scene
		case "ascenseur":
			LoadScene(obj);
		break;
		
		//Liens sponsor
		case "pub16":
			SceneTracker("pub16", obj, "");
			window.open ("http://www.new3s.com/fiches/4/");
		break;
		case "pub15":
			SceneTracker("pub15", obj, "");
			window.open ("http://www.new3s.com/fiches/3/");
		break;
		case "pub14":
			SceneTracker("pub14", obj, "");
			window.open ("http://www.new3s.com/fiches/5/");
		break;
		case "pub13":
			SceneTracker("pub13", obj, "");
			window.open ("http://www.new3s.com/fiches/10/");
		break;
		case "pub12":
			SceneTracker("pub12", obj, "");
			window.open ("http://www.new3s.com/fiches/22/");
		break;
		case "pub11":
			SceneTracker("pub11", obj, "");
			window.open ("http://www.new3s.com/fiches/50/");
		break;
		case "pub10":
			SceneTracker("pub10", obj, "");
			window.open ("http://www.new3s.com/fiches/23/");
		break;
		case "pub09":
			SceneTracker("pub09", obj, "");
			window.open ("http://www.new3s.com/fiches/38/");
		break;
		case "pub08":
			SceneTracker("pub08", obj, "");
			window.open ("http://www.new3s.com/fiches/8/");
		break;
		case "pub07":
			SceneTracker("pub07", obj, "");
			window.open ("http://www.new3s.com/fiches/1/");
		break;
		case "pub06":
			SceneTracker("pub06", obj, "");
			window.open ("http://www.new3s.com/fiches/37/");
		break;
		case "pub05":
			SceneTracker("pub05", obj, "");
			window.open ("http://www.new3s.com/fiches/18/");
		break;
		case "pub04":
			SceneTracker("pub04", obj, "");
			window.open ("http://www.new3s.com/fiches/39/");
		break;
		case "pub03":
			SceneTracker("pub03", obj, "");
			window.open ("http://www.new3s.com/fiches/21/");
		break;
		case "pub02":
			SceneTracker("pub02", obj, "");
			window.open ("http://www.new3s.com/fiches/17/");
		break;
		case "pub01":
			SceneTracker("pub01", obj, "");
			window.open ("http://www.new3s.com/fiches/12/");
		break;

		//Lien showroom
		case "site_web20":
			SceneTracker("Stand_20", obj, "");
			window.open ("InWork.htm");
		break;
		case "poster20":
			SceneTracker("Stand_20", obj, "");
			window.open ("InWork.htm");
		break;
		case "plaquette_recto20":
			SceneTracker("Stand_20", obj, "");
			window.open ("InWork.htm");
		break;
		case "plaquette_verso20":
			SceneTracker("Stand_20", obj, "");
			window.open ("InWork.htm");
		break;
		case "video20":
			SceneTracker("Stand_20", obj, "");
			window.open ("InWork.htm");
		break;
		case "email":
			SceneTracker("Stand_20", obj, "");
			window.open ('../formcontact.asp?dest=contact@new3s.com&id=E1.H1.S2');
		break;
		case "produit20":
			SceneTracker("Stand_20", obj, "");
			window.open ("InWork.htm");
		break;
		case "audio20":
			SceneTracker("Stand_20", obj, "");
			window.open ("InWork.htm");
		break;
		case "localisation20":
			SceneTracker("Stand_20", obj, "");
			window.open ("InWork.htm");
		break;
	}
}

function OnMouseEnter_showroom(obj) {
}

function OnMouseExit_showroom(obj) {
}

function OnZoneEnter_showroom(zone, physics) {
}

function OnZoneExit_showroom(zone, physics) {
}

function OnKeyPress_showroom(keyCode, ascii) {
}

function OnKeyRelease_showroom(keyCode, ascii) {
}

// Copyright 2007 NEW3S s.a. - NEW3S.com
// Christophe LEMOINE + Michael BRICOUT
