// Browser en OS detectie

var detect = navigator.userAgent.toLowerCase();
var OS,BR,BV,total,thestring;

if (checkIt('opera')) { BR = "OP";}
else if (checkIt('msie')) { BR = "IE";}
else if (checkIt('netscape')) { BR = "NS"}

if (BR) {
temp = detect.substring(place + thestring.length-1,place + thestring.length+6);
var temp2 = temp.split('/');
if (temp2[1]) {
BV = temp2[1];
} else {
BV = temp2[0];
}
BV = zuiver(BV);
}

if (checkIt('mac')) { OS = "MAC";}
if (checkIt('win')) {OS = "WIN";}

// string binnen string zoeken

function checkIt(string) {
place = detect.indexOf(string) + 1;
thestring = string;
return place;
}

// Versienummer van browser zuiveren

function zuiver(string) {
var valid = '0123456789';
var punt = '.';
var newstr = '';
for (var i=0; i< string.length; i++) {
  if (valid.indexOf(string.charAt(i)) != -1) {
    newstr = newstr + string.charAt(i);
  }
  if ((punt.indexOf(string.charAt(i)) != -1) && (ffst != '1')) {
    var ffst = '1';
    newstr = newstr + string.charAt(i);
  }
}
return newstr;
}

// Uitgebreide flash detectie

var flashinstalled = 0;
var FV = 0;
MSDetect = "false";
if (navigator.plugins && navigator.plugins.length)
{
	x = navigator.plugins["Shockwave Flash"];
	if (x)
	{
		flashinstalled = 2;
		if (x.description)
		{
			y = x.description;
			FV = y.charAt(y.indexOf('.')-1);
		}
	}
	else
		flashinstalled = 1;
	if (navigator.plugins["Shockwave Flash 2.0"])
	{
		flashinstalled = 2;
		FV = 2;
	}
}
else if (navigator.mimeTypes && navigator.mimeTypes.length)
{
	x = navigator.mimeTypes['application/x-shockwave-flash'];
	if (x && x.enabledPlugin)
		flashinstalled = 2;
	else
		flashinstalled = 1;
}
else {
	MSDetect = "true";
}

// functies tbv communicatie tussen/naar de menu's

var movieName = "menu";

function thisMovie(movieName) {
  if (navigator.appName.indexOf ("Microsoft") !=-1) {
    return window[movieName]
  }	else {
    return document[movieName]
  }
}

function movieIsLoaded (theMovie) {
  if (typeof(theMovie) != "undefined") {
    return theMovie.PercentLoaded() == 100;
  } else {
    return false;
  }
}

function menu_goto(naam,adres) {
  if (movieIsLoaded(thisMovie(movieName))) {
    thisMovie(movieName).SetVariable("menu2",naam);
  } else {
    top.content.location = adres;
  }
}

function menu_check(welke) {
  if (movieIsLoaded(thisMovie(movieName))) {
    thisMovie(movieName).SetVariable("menu2",welke);
  }
}

function menu_DoFSCommand(command, args) { 
  if ((command == "submenu") && (bestaat("submenu"))) {
     top.content.submenu.sluiten(args);
  }
}

function bestaat(welke) {
  for (var i=0;i<top.content.frames.length;i++) {
    if (top.content.frames[i].name == welke) {
      return true;
    }
  }
  return false;
}

// functie voor nonflash menu

var activePage = '0';

function wissel(i,refresh) {

if (refresh > 0) { top.content.location = urls[i];}

  if (document.layers) {
    window.document.layers['id' + activePage].bgColor = '#4c4c4c';
    window.document.layers['id' + i].bgColor = '#ffab17';
  } else if (document.all) {
    window.document.all['id' + activePage].style.background = '#4c4c4c';
    window.document.all['id' + i].style.background = '#ffab17';
  }

activePage = i;

}