IE4 = (document.all) ? 1 : 0;
NS4 = (document.layers) ? 1 : 0;
VERSION4 = (IE4 | NS4) ? 1 : 0;
if (!VERSION4) event = null;

function helpGetOffset(obj, coord) {
var val = obj["offset"+coord] ;
if (coord == "Top") val += obj.offsetHeight;
while ((obj = obj.offsetParent )!=null) {
val += obj["offset"+coord];
if (obj.border && obj.border != 0) val++;
}
return val;
}

function helpDown () {
if (IE4) document.all.helpBox.style.visibility = "hidden";
if (NS4) document.helpBox.visibility = "hidden";
}

function helpOver (event,texte) {
if (!VERSION4) return;

var ptrObj, ptrLayer;
if (IE4) {
ptrObj = event.srcElement;
ptrLayer = document.all.helpBox;
}
if (NS4) {
ptrObj = event.target;
ptrLayer = document.helpBox;
}

if (!ptrObj.onmouseout) ptrObj.onmouseout = helpDown;

var str = '<DIV CLASS="helpBoxDIV">'+texte+'</DIV>';
if (IE4) {
ptrLayer.innerHTML = str;
ptrLayer.style.top = helpGetOffset (ptrObj,"Top") + 2;
ptrLayer.style.left = helpGetOffset (ptrObj,"Left");
ptrLayer.style.visibility = "visible";
}
if (NS4) {
ptrLayer.document.write (str);
ptrLayer.document.close ();
ptrLayer.document.bgColor = "yellow";
ptrLayer.top = ptrObj.y + 20;
ptrLayer.left = ptrObj.x;
ptrLayer.visibility = "show";
}
}
// -->
function toggleLayer(whichLayer)
{
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
style2.display = style2.display? "":"block";
}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display? "":"block";
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display? "":"block";
}
}

function Node(obRef)
{
this.obRef=obRef;
this.timeRef=null;
}
myNodes=new Array();

function isParent(kind, ouder)
{
oudere=kind.parentNode;
do
{
oudere=oudere.parentNode;
if (oudere==ouder)
{
return true;
}
}
while (oudere.nodeName!='BODY')
return false;
}

function showSub(showNode)
{
if (isNaN(showNode.rIndex))
{
showNode.rIndex=myNodes.length;
myNodes[showNode.rIndex]=new Node(showNode);
}
else
{
clearTimeout(myNodes[showNode.rIndex].timeRef);
}
temp='';
for (i in myNodes)
{
if (!isParent(myNodes[i].obRef, showNode))
{
clearTimeout(myNodes[i].timeRef);
doHide(myNodes[i].obRef);
}
}
for (i in showNode.childNodes)
{
if (showNode.childNodes[i].nodeType==1)
{
showNode.childNodes[i].style.display='block';
}
}
}

function hideSub(hideNode)
{
myNodes[hideNode.rIndex].timeRef=setTimeout('doHide(myNodes['+hideNode.rIndex+'].obRef)', 500);
}

function doHide(doNode)
{
for (i in doNode.childNodes)
{
if (doNode.childNodes[i].nodeType==1 && doNode.childNodes[i].nodeName=='UL')
{
doNode.childNodes[i].style.display='none';
}
}
}
window.onload=function()
{
var li = document.getElementById('menu').getElementsByTagName('li');
var ul;
for (i in li)
{
if(!isNaN(i))
{
ul = li[i].childNodes;
for(j in ul)
{
if(ul[j].nodeName == 'UL')
{
ul[j].className = li[i].className = 'sub';
li[i].onmouseover = function ()
{
showSub(this);
}
li[i].onmouseout = function ()
{
hideSub(this);
}
}
}
}
}
}

// hier de snelheid van de slideshow  (in milliseconden)
var SlideShowSpeed = 7000;

// duur van de crossfade (in seconden)
var CrossFadeDuration = 3;

var Picture = new Array(); //
var Caption = new Array(); //

// hieonder kun je meer images tovoegen
// ze moeten echter gelijk zijn aan het aantal captions daaronder

Picture[1]  = './images/ad/lunch.gif';
Picture[2]  = './images/ad/twentesport.gif';
Picture[3]  = './images/ad/schijven.gif';

// teksten bij de plaatjes ( aantal moet gelijk zijn aan aantal plaatjes hierboven )

Caption[1]  = "";
Caption[2]  = "";
Caption[3]  = "";


// =====================================
// verander hieronder niets meer

var tss;
var iss;
var jss = 1;
var pss = Picture.length-1;

var preLoad = new Array();
for (iss = 1; iss < pss+1; iss++){
preLoad[iss] = new Image();
preLoad[iss].src = Picture[iss];}

function runSlideShow(){
if (document.all){
document.images.PictureBox.style.filter="blendTrans(duration=2)";
document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
document.images.PictureBox.filters.blendTrans.Apply();}
document.images.PictureBox.src = preLoad[jss].src;
if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];
if (document.all) document.images.PictureBox.filters.blendTrans.Play();
jss = jss + 1;
if (jss > (pss)) jss=1;
tss = setTimeout('runSlideShow()', SlideShowSpeed);
}


function openplayer()
{
window.open("Twente FM Livestream","openplayer","toolbar=no,scrollbars=no,directories=no, status=no,menubar=no,resizable=no,width=350,height=200");
}

function opencam()
{
window.open("Twente FM Webcam","opencam","toolbar=no,scrollbars=no,directories=no, status=no,menubar=no,resizable=no,width=363,height=331");
}

function opengemist()
{
window.open("Twente FM Iets gemist ?","openplayer","toolbar=no,scrollbars=no,directories=no, status=no,menubar=no,resizable=no,width=350,height=250");
}