// JavaScript for the Showroom

var movieName = "command";

	function getFlashMovieObject(movieName) {
		//alert(window.document);
		// Browsers refer to the movie object differently.
		// This function returns the appropriate syntax depending on the browser.	
		if (window.document[movieName]) {
			return window.document[movieName];
		} else {
			if (navigator.appName.indexOf("Microsoft Internet")==-1) {
				if (document.embeds && document.embeds[movieName]) return document.embeds[movieName]; 
			} else // if (navigator.appName.indexOf("Microsoft Internet")!=-1) 
				return document.getElementById(movieName);
		}
	} 

	// Checks if movie is completely loaded.
	// Returns true if yes, false if no.
	function movieIsLoaded (theMovie) {
		if (typeof(theMovie) != "undefined") {
			return theMovie.PercentLoaded() == 100;
		} else {
			return false;
		}
	}
	
	function golabel(target) {
		newTarget = "dolabel('"+target+"')";
		id = setTimeout(newTarget,500);
	}
	
	function clearlabel(target) {
		clearTimeout(id);
	}

	function dolabel(target) {			
		if (movieIsLoaded(getFlashMovieObject(movieName))) {
	   		getFlashMovieObject(movieName).SetVariable("interacted", true);
	    	getFlashMovieObject(movieName).SetVariable("chosenModel", target);
			getFlashMovieObject(movieName).TGotoLabel("_level0/", "go");
	  	}	
	}


