// -- EXTRA VARS -- //
var playing = false;
var video_show = false;

function showVideo() {
	document.getElementById('video').setAttribute('style', '');
	document.getElementById('videotext').setAttribute('style', 'visibility:hidden;');
	video_show = true;
}

function hideVideo() {
	document.getElementById('video').setAttribute('style', 'visibility:hidden;');
	document.getElementById('videotext').setAttribute('style', '');
	video_show = false;
}



function playPause() {
	if (!playing && !video_show) {
		showVideo();
		setTimeout('playPause()', 100);
	}
	else if (!playing) {
		playing = true;
		play();
	}
	else {
		playing = false;
		pause();
	}
}

function play() {
	document.video.Play();
	document.getElementById('playpause').setAttribute('src', 'includes/img/pause.gif');
}

function pause() {
	document.video.Stop();
	document.getElementById('playpause').setAttribute('src', 'includes/img/play.gif');
}

function fforward() {
	document.video.Step(50);
	if (playing) document.video.Play();
}

function frewind() {
	document.video.Step(-50);
	if (playing) document.video.Play();
	if (!playing && document.video.GetTime()==0) hideVideo();
}

function doShrink(element) {
	element.style.size='90%';
}

function unShrink(element) {
	element.style.size='100%';
}