// JavaScript Document
function playFlash(url, width, height) {
	var fullURL = "demos/" + url;
	var params = 'width='+width+',height='+height+'status=no,toolbar=no,menubar=no,location=no,titlebar=no,resizable=0,directories=no;'
	var popup;
	popup = window.open(fullURL, null, params);
	popup.focus();
	return true;
}

function transcript(demo) {
	var params = 'width=400'+',height=410'+'status=no,toolbar=no,menubar=no,location=no,titlebar=no,resizable=0,directories=no;'
	var popup;
	popup = window.open('transcript.html', null, params);
	popup.focus();
	
	if (demo == "dir1") {
		popup.document.write("<font face='trebuchet ms, tahoma' size=2>This is a simple ball-rolling demo for director.<br><br>The application reads in the pitch and roll values, which go from -90 to 90, and provides visual feedback on the right side.<br><br>On the left, there is a ball rolling using simple physics, based on the X and Y acceleration values coming from the Wiimote.</font>");
	}
	
	if (demo == "dir2") {
		popup.document.write("<font face='trebuchet ms, tahoma' size=2>This is a Ripples demo for director.<br><br>The program reads in IR values from the left and right Wiimotes, and positions the sprite accordingly on the stage. If you press the A button, it creates ripples on the stage.</font>");
	}
	
	if (demo == "dir3") {
		popup.document.write("<font face='trebuchet ms, tahoma' size=2>This is a Pong demo for Director based on the Ripples demo.<br><br>Only the Y-axis IR values are needed for this demo. The player on the right presses the A button to start the game and launch the ball. Move the Wiimote up and down to control your paddle. When the ball hits the paddle, the impact can be felt through the Wiimote's rumble feature, and the ball increases in speed.<br><br>When the ball is reset on a paddle, press A to re-launch the ball.</font>");
	}
	
	if (demo == "wii1") {
		popup.document.write("<font face='trebuchet ms, tahoma' size=2>This is the WiiPaint 1 demo featuring two Wiimotes.<br><br>The left Wiimote is the style brush. If you rotate the Wiimote, it changes the color of the brush. You can press A to lock the color, the + and - buttons change the brush size, and the Home button to reset the brush size.<br><br>The right wiimote is the paint brush. To draw, you press the A button, and B clears the canvas.<br><br>This demo can be collaborative; one person can control the style brush, and the other can draw, or one person can control the entire canvas. The cool part about this demo is that you can change color as you draw.</font>");
	}
	
	if (demo == "wii2") {
		popup.document.write("<font face='trebuchet ms, tahoma' size=2>This is the WiiPaint 2 demo, another collaborative art application.<br><br>As you may have seen in the first demo, the brush is split into two brushes; the style brush and the paint brush.<br><br>In this demo, those features are combined into one brush, so two people can draw at the same time.<br><br>You can change the color by pressing the home button to either lock or unlock the color, and rotating the Wiimote, and the Home button to lock the color. The A button starts the drawing. You can use the 1 button to undo the last stroke, or the B button to clear the canvas.</font>");
	}
	
	if (demo == "wii3") {
		popup.document.write("<font face='trebuchet ms, tahoma' size=2>This is the WiiPaint 3 demo.<br><br>The brush has the same function as in WiiPaint 2. You can change the color of the brush by pressing the home button to lock or unlock the color, and rotating the Wiimote to change the color.<br><br>In WiiPaint 3, Pressing the B button does not clear the canvas, but undoes strokes one by one. The 1 button clears the canvas.<br><br>This version only has one brush, and we will see why in a second. First, we added some basic shape recognition so you can draw lines, triangles, and squares.<br><br>The second brush is used as a locking brush. If you press A on an existing stroke, it will be moveable, but if you place both brushes within this rectangle, for example, you can press A to lock the second Wiimote, and then move them away from each other to scale the shape.<br><br>As you can see, the recognition algorithm is really rough and basic, but you can get an idea of what this is supposed to do.</font>");
	}
	
	if (demo == "sem") {
		popup.document.write("<font face='trebuchet ms, tahoma' size=2>This is a Semaphore signals demo to emulate some simple gesture recognition.<br><br>To do this demo, you should hold both Wiimotes in your hands, with the thumb and forefinger on the A and B buttons. Let your hands relax at your sides, and move them according to the letter you want to make.<br><br>The program reads in the roll, pitch, and yaw of the Wiimotes as you are holding them, and translates that into a letter. As you can see, it highlights the flag signal that it thinks you are trying to make.<br><br>Sometimes, you will get more than one signal highlighted. This is because the recognition for one of the directions is similar to another. This can be fixed by calibrating the movements to different users to get a more precise range of values for these gestures.</font>");
	}
	
	return true;
}
