var thePosition = 0

function getClient() {
    // convert all characters to lowercase to simplify testing
    var agt=navigator.userAgent.toLowerCase()
    var apv=navigator.appVersion.toLowerCase()
    this.major = parseInt(navigator.appVersion)
    this.minor = parseFloat(navigator.appVersion)
    // browserversion
    this.ns  = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1)))
    this.mo = (agt.indexOf('mozilla')!=-1)
    this.ns4 = (this.ns && (this.minor >= 4.03) && (this.major < 5))
	this.ns6 = (this.ns && (this.major == 5))
	this.gecko = (this.ns && (this.major >= 5))
    this.ie   = (agt.indexOf("msie") != -1)
    this.ie4  = (this.ie && (this.major == 3))
	this.ie45 = (agt.indexOf('msie 4.5') != -1);
    this.ie5  = (this.ie && (this.major == 4))
    // platform
	this.mac = (apv.indexOf("macintosh")>0);
	this.win = (apv.indexOf("win")>0);	
    // compatible browsers
	this.ie4comp = ((this.ie4 && !this.mac) || this.ie45 || this.ie5)
	this.ns4comp = (this.ns4);
	this.ns6comp = (this.gecko || this.ns6);
	this.comp = (this.ie4comp || this.ns4comp || this.ns6comp);
	return (this)
}
var is = new getClient();



function getPosition(){
  var thePosition = 0
  {
	  thePosition = ( document.videoplayer.CurrentPosition )  
  }
  return thePosition;
}

var teller = 0;
var seconds = 0;


function SetTransscript()
{
	if (is.ie)
	{
	//WriteDIVText() 
	WriteDIVText() 
	}	
	else
	{
	WriteMOZText()
	}
}




function WriteDIVText()
{
var dS = getPosition();
dS = Math.round(dS);
if (tijdcode[teller] <= dS)
	{
	if (document.getElementById) 
		{
		// this is the way the standards work
		document.getElementById("transscript").innerHTML = message[teller];
		}
		else if (document.all) 
		{
		// this is the way old msie versions work
		document.all["transscript"].innerHTML = message[teller];
		}
		else if (document.layers) 
		{
		// this is the way nn4 works
		document.layers["transscript"].innerHTML = message[teller];
		}
	teller ++;
	}
var t = window.setTimeout( "WriteDIVText()", 1000 );
}


var waitforit = 0;

function WriteMOZText()
{
	var dS = seconds;
	//document.write(dS);
	if (tijdcode[teller] <= dS)
		{
		if (document.getElementById) 
			{
			// this is the way the standards work
			document.getElementById("transscript").innerHTML = message[teller];
			}
			else if (document.all) 
			{
			// this is the way old msie versions work
			document.all["transscript"].innerHTML = message[teller];
			}
			else if (document.layers) 
			{
			// this is the way nn4 works
			document.layers["transscript"].innerHTML = message[teller];
			}
		teller ++;
		}
	seconds ++;
	var t = window.setTimeout( "WriteMOZText()", 1000 );
	
	if (waitforit == 1)
	{
	seconds = 0;
	}
}



function SetTime( time )
{
seconds = time;
}



function PauseSeconds()
{
tempseconds = seconds;
waitforit = 1;
videoplayer.Stop();

}

function PlaySeconds()
{
//seconds = tempseconds;
seconds = 0;
waitforit = 0;
videoplayer.Play();

}

function FfwdSeconds()
{
tempseconds = seconds;
waitforit = 1;
videoplayer.FastForward();
}

function RewSeconds()
{
tempseconds = seconds;
waitforit = 1;
videoplayer.FastReverse();
}

