//uit funcs.js gehaald
// 060215 a3 sendtofriend stuurt PID mee
function getObj(name)
{
	var RetVal = null;
	if (document.getElementById)
	{
		RetVal = document.getElementById(name);
	}
	else if (document.all)
	{
		RetVal = document.all[name];
	}
	else if (document.layers)
	{
		RetVal = getObjNN4(document,name);
		RetVal.style = RetVal;
	}
	return RetVal;
};


	<!-- Begin
	// quick browser tests
var ns4 = (document.layers) ? true : false;
var ie4 = (document.all && !document.getElementById) ? true : false;
var ie5 = (document.all && document.getElementById) ? true : false;
var ns6 = (!document.all && document.getElementById) ? true : false;
var activeMenuID = -1;
var CatArray = new Array(5);
CatArray[0] = "national";
CatArray[1] = "international";
CatArray[2] = "sport";
CatArray[3] = "culture";
CatArray[4] = "insolite";

function toggleOtherDivs(aVal,aID,aCount)
{
	for(var i=1;i<aCount;i++)
	{
		if (i != aID)
		{
			aElm = getObj('allvids'+i);
			aElm.style.display = aVal;
			aElm = getObj('lst'+i);
			aElm.style.display = 'none';
		}
	}
}

function toggleOtherDivsLaLibre(aVal,aID,aCount)
{
	var aIdent;
	//alert ("subdir " + SubDirLalibreOrDHNet);
	for(var i=1;i<aCount;i++)
	{
		if (i != aID)
		{
			aElm = getObj('allvids'+i);
			aElm.style.display = aVal;
			aElm = getObj('lst'+i);
			aElm.style.display = 'none';
			aIdent = CatArray[i-1];
			MM_swapImageEx(aIdent,'','images/'+SubDirLalibreOrDHNet+'/'+aIdent+'_off.gif',1);
		}
	}
}

function toggleDiv(aID,aCount)
{
	if (typeof display_aktuell != "undefined") {
			if	(display_aktuell == true) toggleAkt(0,'none'); 
	}
	
//alert("id " + aID + " , " + aCount);
	if (!aCount)
	{
		aCount = 8;
	}
	var aElm = null;
	aElm = getObj('lst'+aID);

	activeMenuID = aID;
	if ((aElm.style.display == "") || (aElm.style.display == "none"))
	{
		aElm.style.display = 'block';
		aElm = getObj('allvids'+aID);
		aElm.style.display = 'block';
		toggleOtherDivs('none',aID,aCount);
		toggleResetButton('block');
	}
	else
	{
		aElm.style.display = 'none';
		aElm = getObj('allvids'+aID);
		aElm.style.display = 'block';
		toggleOtherDivs('block',aID,aCount);
		toggleResetButton('none');
	}
}

//060424 - a3 code om actuell te laten zien 
//
var display_aktuell = "test";  //global var voor togglediv 

function toggleAkt(count,style) {	
	var aElm = null;
	aElm = getObj('aktuell');
	if (style == "none") { aElm.style.display = "none"; return; }
	
	if ((aElm.style.display == "") || (aElm.style.display == "none"))	{
		aElm.style.display = "block";
		toggleOtherDivs('none',0,count);
		display_aktuell = true;  // uitgeklapt en togglediv kan dat nu checken
	}
	else	{
		aElm.style.display = "none";
		toggleOtherDivs('block',0,count);
	}	
}

function toggleResetButton(aState)
{
	var aElm = getObj('resetButton');
	if (aElm != null)
	{
		aElm.style.display = aState;
	}
}

function toggleDivLaLibre(aID)
{
	var aElm = null;
	aElm = getObj('lst'+aID);
	activeMenuID = aID;
	if ((aElm.style.display == "") || (aElm.style.display == "none"))
	{
		aElm.style.display = 'block';
		toggleImage(aElm,aID);
		aElm = getObj('allvids'+aID);
		aElm.style.display = 'block';
		toggleOtherDivsLaLibre('none',aID,6);
		aElm = getObj('resetButton');
		aElm.style.display = 'block';
	}
	else
	{
		aElm.style.display = 'none';
		toggleImage(aElm,aID);
		aElm = getObj('allvids'+aID);
		aElm.style.display = 'block';
		toggleOtherDivsLaLibre('block',aID,6);
		activeMenuID = -1;
		aElm = getObj('resetButton');
		aElm.style.display = 'none';
	}
}

function swapOnOffImage(aIdent,turnOn)
{
	var aState = (turnOn) ? "on2" : "on";
	MM_swapImageEx(aIdent,'','images/'+SubDirLalibreOrDHNet+'/'+aIdent+'_'+aState+'.gif',1);
}

function toggleImage(aElm,aID)
{
	var aState = (aElm.style.display == 'none') ? false : true;
	aID = aID-1;
	var aIndent = CatArray[aID];
	swapOnOffImage(aIndent,aState);
}

function show(sw,obj)
{
	//alert ("obj = " + obj);
	// show/hide the divisions
	if (sw && (ie4 || ie5) )
	{
		document.all[obj].style.visibility = 'visible';
	}
	else if (!sw && (ie4 || ie5) )
	{
		document.all[obj].style.visibility = 'hidden';
	}
	else if (sw && ns4)
	{
		document.layers[obj].visibility = 'visible';
	}
	else if (!sw && ns4)
	{
		document.layers[obj].visibility = 'hidden';
	}
	else
	{
		document.getElementById(obj).style.visibility = (sw) ? "visible" : "hidden";
	}
}
	// End -->

function popupje(mylink) {
	window.open(mylink,'ftvwindow','toolbar=no,width=277,height=160,top=80,left=90,directories=no,status=no,scrollbars=no,resizable=no,menubar=no');
}
function popupje2(mylink) {
	window.open(mylink,'ftvwindow','toolbar=no,width=640,height=480,top=80,left=90,directories=no,status=no,scrollbars=no,resizable=no,menubar=no');
}

function sendToFriend(lang,id)
{
	// pid wordt gezet in aanroepende script
	//alert('pid = ' + pid);
	if (typeof pid == "undefined") pid = 'FTV';
	window.open('index.cfm?fuseaction=sendToFriend&language='+lang+'&video_id='+id+'&pid='+pid,'MTC_window2','toolbar=no,width=329,height=450,top=80,left=90,directories=no,status=no,scrollbars=no,resizable=no,menubar=no');
}

function restartGif(){
	for(var i=0; i<document.images.length; i++){
		var img = document.images[i];
		var imgName = img.src.toUpperCase();
		if (imgName.substring(imgName.length-3, imgName.length) == "GIF"){
			img.src = img.src;
		}
	}
}
function RunCDA()
{
   document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="320" height="240" id="cdacomm" align="middle">\n');
   document.write(' <param name="movie" value="320x240_harmen.swf" />\n');
   document.write('<param name="quality" value="high" />\n');
   document.write('<param name="loop" value="false" />\n');
   document.write('<param name="allowScriptAccess" value="always" />\n');
   document.write('<embed src="320x240_harmen.swf" loop="false" quality="high" name="cdacomm" align="middle" allowScriptAccess="always"  pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="320" height="240"></embed>\n');
   document.write('</object>\n');
}


function stopError() {
  return true;
}

window.onerror = stopError;




