//I obviously do not know the jquery shortcuts yet.

/****************************

instead of onload,  this could (and will) be changed to a function that receives an flv file name via a pulldown or clickable object on the stage.

****************************/

function loadVideo(file) {

	var playerFlv = new SWFObject("player.swf","myplayer2","839","559","9"); //must be in the same dir as the html file holding the video
	playerFlv.addVariable("screencolor","white");
	//playerFlv.addVariable("image","preview.jpg");
	playerFlv.addVariable("file","web_video/"+file);
	playerFlv.addVariable("controlbar","none");
	playerFlv.addVariable("autostart","true");
	playerFlv.write("player2");
	//create a javascript object to allow us send events to the flash player
	var player2 = document.getElementById("myplayer2");
	document.getElementById('pausebutton').innerHTML = '<a id="pause2" style="cursor: pointer;" onclick="pause2();"><img src="web_images/pause.png" border="0" alt="pause" title="pause" id="play" /></a>';

}

function pause2() {
	var player2 = document.getElementById("myplayer2");
	player2.sendEvent("PLAY","false");
	document.getElementById('pausebutton').innerHTML = '<a id="play2" style="cursor: pointer;" onclick="play2();"><img src="web_images/play.png" border="0" alt="play" title="play" id="play" /></a>';
}

function play2() {
	var player2 = document.getElementById("myplayer2");
	player2.sendEvent("PLAY","true");
	document.getElementById('pausebutton').innerHTML = '<a id="pause2" style="cursor: pointer;" onclick="pause2();"><img src="web_images/pause.png" border="0" alt="pause" title="pause" id="play" /></a>';
}

/******************************************
no sane way to get duration of a video, so we start at 0 and seek/reverse based on that var.
******************************************/
var position = 0;
function seek() {
	var player2 = document.getElementById("myplayer2");
	position = position + 5;
	player2.sendEvent("SEEK", position);
}
function rev() {
	var player2 = document.getElementById("myplayer2");
	position = position - 5;
	player2.sendEvent("SEEK", position);
}
