language="en";
kwaliteit=1;

// Handle all the the FSCommand messages from Shockwave Flash movies!!

function SwitchImg()
{ //start
  var rem, keep=0, store, obj, switcher=new Array, history=document.Data;
    for (rem=0; rem < (SwitchImg.arguments.length-2); rem+=3) {
    	store = SwitchImg.arguments[(navigator.appName == 'Netscape')?rem:rem+1];
    if ((store.indexOf('document.layers[')==0 && document.layers==null) ||
        (store.indexOf('document.all[')==0 && document.all==null))
         store = 'document'+store.substring(store.lastIndexOf('.'),store.length);
         obj = eval(store);
    if (obj != null) {
   	   switcher[keep++] = obj;
      switcher[keep++] = (history==null || history[keep-1]!=obj)?obj.src:history[keep];
      obj.src = SwitchImg.arguments[rem+2];
  } }
  document.Data = switcher;
} //end

function RestoreImg()
{ //start
  if (document.Data != null)
    for (var rem=0; rem<(document.Data.length-1); rem+=2)
      document.Data[rem].src=document.Data[rem+1];
} //end

function GoPlay(seconds) 
{
	var videoplayer = InternetExplorer ? video : document.videoplayer;
	if(videoplayer==null)
	{
		videoplayer = InternetExplorer ? document.all['videoplayer'] : document.getElementById('videoplayer');
	}
	//WM_Stop();
	if(series9)
	{
		videoplayer.settings.currentPosition=seconds;
	}else
	{
		if (activeX)
		{
			videoplayer.CurrentPosition=seconds;
		}else
		{
			videoplayer.SetCurrentPosition(seconds);
		}
	}
}


function Help()
{
  info=window.open("../help/help_en.htm","info","width=796,height=540,menubar=no,toolbar=no,scrollbars=no");
}


function hideLayer(whichLayer) {

if (document.getElementById) {
// this is the way the standards work
document.getElementById(whichLayer).style.visibility = "hidden";
}
else if (document.all) {
// this is the way old msie versions work
document.all[whichlayer].style.visibility = "hidden";
}
else if (document.layers) {
// this is the way nn4 works
document.layers[whichLayer].visibility = "hidden";
}

}

function showLayer(whichLayer) {

if (document.getElementById) {
// this is the way the standards work
document.getElementById(whichLayer).style.visibility = "visible";
}
else if (document.all) {
// this is the way old msie versions work
document.all[whichlayer].style.visibility = "visible";
}
else if (document.layers) {
// this is the way nn4 works
document.layers[whichLayer].visibility = "visible";
}

}


function setClass (whichLayer){

if (document.getElementById) {
// this is the way the standards work
document.getElementById(whichLayer).className = "keuzebutton";
}
else if (document.all) {
// this is the way old msie versions work
document.all[whichlayer].style.className = "keuzebutton";
}
else if (document.layers) {
// this is the way nn4 works
document.layers[whichLayer].className = "keuzebutton";
}
}

function setClassSelected (whichLayer){

if (document.getElementById) {
// this is the way the standards work
document.getElementById(whichLayer).className = "keuzebutton-selected";
}
else if (document.all) {
// this is the way old msie versions work
document.all[whichlayer].style.className = "keuzebutton-selected";
}
else if (document.layers) {
// this is the way nn4 works
document.layers[whichLayer].className = "keuzebutton-selected";
}
}



/*
function ShowInfo() 
{
showLayer("information");
hideLayer("transscript");
document.swap1.src='images/button-up.jpg';
document.swap2.src='images/button-down.jpg';
setClassSelected("keuze2");
setClass("keuze1");
}

function ShowTranscript() 
{
showLayer("transscript");
hideLayer("information");
document.swap1.src='images/button-down.jpg';
document.swap2.src='images/button-up.jpg';
setClassSelected("keuze1");
setClass("keuze2");
}

*/


function ShowInfo() 
{
showLayer("information");
hideLayer("downloads");
hideLayer("chapters");
hideLayer("transscript");
document.swap1.src='images/button-up.jpg';
document.swap2.src='images/button-down.jpg';
document.swap3.src='images/button-up.jpg';
document.swap4.src='images/button-up.jpg';
setClassSelected("keuze2");
setClass("keuze1");
setClass("keuze3");
setClass("keuze4");
}

function ShowTranscript() 
{
showLayer("transscript");
hideLayer("information");
hideLayer("downloads");
hideLayer("chapters");
document.swap1.src='images/button-down.jpg';
document.swap2.src='images/button-up.jpg';
document.swap3.src='images/button-up.jpg';
document.swap4.src='images/button-up.jpg';
setClassSelected("keuze1");
setClass("keuze2");
setClass("keuze3");
setClass("keuze4");
}


function ShowChapters() 
{
hideLayer("transscript");
hideLayer("information");
hideLayer("downloads");
showLayer("chapters");
document.swap1.src='images/button-up.jpg';
document.swap2.src='images/button-up.jpg';
document.swap3.src='images/button-down.jpg';
document.swap4.src='images/button-up.jpg';
setClassSelected("keuze3");
setClass("keuze2");
setClass("keuze1");
setClass("keuze4");
}

function ShowDownloads() 
{
hideLayer("transscript");
hideLayer("information");
showLayer("downloads");
hideLayer("chapters");
document.swap1.src='images/button-up.jpg';
document.swap2.src='images/button-up.jpg';
document.swap3.src='images/button-up.jpg';
document.swap4.src='images/button-down.jpg';
setClassSelected("keuze4");
setClass("keuze2");
setClass("keuze3");
setClass("keuze1");
}



function info_DoFSCommand(command, args) 
{
    var powersliderObj = InternetExplorer ? powerslider : document.powerslider;



	if(command == "GetCookies")
	{
	  // distributes the LANGUAGE to the flash objects, in this case only one!
      powersliderObj.SetVariable("language", language );
	  return; // return to prevent default from executing
	}
	if(command == "Refresh")
	{
		location.href=location.href;
	}
	if(command == "StopStream")
	{
		//WM_Stop();
	}
	if(command == "StartStream")
	{
		// When every flash-object is loaded it gives the command to connect to the stream!
		var runTime = new Date();
		var clicktime = runTime.getTime ();
		
		
		//GoPlay(0);

		// after the movie starts playing, we refresh the time variable in the flash-objects!
		// every second!
	   RefreshPointer = setInterval("doRefresh()",1000); // milliseconds!

	   return; // return to prevent default from executing
	}
}
// Functions to give Powerslider data it needs!

var RefreshPointer=null;
function doRefresh() 
{
	// this function is called repeatedly by setinterval..
	// It asks the current movieobject its current-position and 
	// sets this value as a variable (time) in the powerslider flash-movie..

	var powersliderObj = InternetExplorer ? powerslider : document.powerslider;

	time=WM_GetCurrentPos();
	powersliderObj.SetVariable("time", time );

    return false; // keeps it on going!
}

// this last section reroutes all FScommands either from VBscript of Javascript to one function!

function powerslider_DoFSCommand(command, args) 
{
	info_DoFSCommand(command, args);
}




// Hook for Internet Explorer 
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
	  navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) 
{
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('Sub powerslider_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call info_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	document.write('</SCRIPT\>');
}
