function ge(id) {
	return document.getElementById(id);
}

function showTypes(media) {
	if (media == 'magazine') {
		ge('magazinetype').style.display = 'block';
	} else {
		ge('magazinetype').style.display = 'none';
	}
}

function swapModelImage (img) {
	ge('modelimgsrc').src = img;
}


function openSwf() {
	var movie = window.document.splash;
	movie.GotoFrame(2);
}

function closeSwf(taal) {
	var movie = window.document.splash;
	movie.SetVariable("taal", taal);
	movie.GotoFrame(4);
}

function rolloutSwf(taal) {
	var movie = window.document.splash;
	movie.GotoFrame(3);
}

function setFlashHeight(divid, newH){
	
	if (document.getElementById("movie")) {
		newH += "px";
		document.getElementById("movie").style.height = newH;
		document.getElementById("flash").style.height = newH;
	}
	
}

function displayMenu() {

	if (hasRightVersion) {
		ge('flash').style.display = 'block';
	} else {
		ge('htmlmenu').style.display = 'block';
	}
	
}

function displayModel() {
	if (hasRightVersion) {
		ge('submenumodel').style.display = 'none';
		ge('contentmodel').style.display = 'none';
	} else {
		ge('img').style.display = 'none';
		ge('submenumodel').style.display = 'block';
		ge('contentmodel').style.display = 'block';
	}
}

function displaySplash() {
	if (hasRightVersion) {
		ge('splashswf').style.display = 'block';
		ge('splashimg').style.display = 'none';
	} else {
		ge('splashswf').style.display = 'none';
		ge('splashimg').style.display = 'block';
	}
}

function displayKaart() {

	if (ge('flashkaart')) {

		if (hasRightVersion) {
			ge('flashkaart').style.display = 'block';
			ge('htmlkaart').style.display = 'none';
		} else {
			ge('flashkaart').style.display = 'none';
			ge('htmlkaart').style.display = 'block';
		}

	}
}

function chooseContinent(continent) {
	fquick.continent.value = continent;
	fquick.submit();
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		Worldmap_01_North_America_over = newImage("images/Worldmap_01-North-America_o.gif");
		Worldmap_01_Latin_America_over = newImage("images/Worldmap_01-Latin-America_o.gif");
		Worldmap_01_Middle_East_over = newImage("images/Worldmap_01-Middle-East_ove.gif");
		Worldmap_01_Africa_over = newImage("images/Worldmap_01-Africa_over.gif");
		Worldmap_01_Asia_over = newImage("images/Worldmap_01-Asia_over.gif");
		Worldmap_01_Europe___Russia_over = newImage("images/Worldmap_01-Europe-%26-Russia.gif");
		Worldmap_01_Australie_over = newImage("images/Worldmap_01-Australie_over.gif");
		preloadFlag = true;
	}
}


// flash detectie
var requiredVersion = 7;
var useRedirect = false;

var flash2Installed = false;
var flash3Installed = false;
var flash4Installed = false;
var flash5Installed = false;
var flash6Installed = false;
var flash7Installed = false;
var flash8Installed = false;
var maxVersion = 8;
var actualVersion = 0;
var hasRightVersion = false;
var jsVersion = 1.0;

var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;

jsVersion = 1.1;

if(isIE && isWin){
  document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
  document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
  document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
  document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
  document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');
  document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
  document.write('flash8Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
  document.write('</SCR' + 'IPT\> \n');
}

function detectFlash() {
	
  if (navigator.plugins) {
    if (navigator.plugins["Shockwave Flash 2.0"]
        || navigator.plugins["Shockwave Flash"]) {

      var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;

      var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));


      flash2Installed = flashVersion == 2;
      flash3Installed = flashVersion == 3;
      flash4Installed = flashVersion == 4;
      flash5Installed = flashVersion == 5;
      flash6Installed = flashVersion == 6;
      flash7Installed = flashVersion >= 7;
      flash8Installed = flashVersion >= 8;

    }
  }

  for (var i = 2; i <= maxVersion; i++) {
    if (eval("flash" + i + "Installed") == true) actualVersion = i;
  }

  if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 3;

  if (actualVersion >= requiredVersion) {

     hasRightVersion = true;

  } else {

     hasRightVersion = false;

  }
}

detectFlash();
//hasRightVersion = false;