// JavaScript Document

// JavaScript Document

var flash2Installed = false;	// wahr wenn flash 2 installiert ist
var flash3Installed = false;	
var flash4Installed = false;	
var flash5Installed = false;	
var flash6Installed = false;	
var flash7Installed = false;	
var flash8Installed = false;	
var flash9Installed = false;	
var maxVersion 		  = 9;		  // die Version die momentan maximal gecheckt wird
var actualVersion 	= 0;		  // die version die der User hat
var hasRightVersion = false;	// wahr wenn der User die richtige Version hat
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;    	// TRUE wenn IE
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false; // TRUE wenn auf Windows
/* VB-Script Detection beim MsIe auf Windows, da MsIe bei Windows
-- regular JavaScript Plugins nicht unterstützt
-------------------------------------------------------------------*/
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('flash9Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');
	document.write('</SCR' + 'IPT\> \n');
}
/* Detect Flash
---------------*/
function detectFlash(flV) {
	// existiert navigator.plugins
	if (navigator.plugins) {
		// check für flash 2 oder flash 3+
		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;
		//alert("Flash plugin description: " + flashDescription);
			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;
			flash9Installed 		= flashVersion >= 9;
		}
	}
	for (var i = 2; i <= maxVersion; i++) {
		if (eval("flash" + i + "Installed") == true) actualVersion = i;
	}
	if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 3;
	//alert("version detected: " + actualVersion);
	if (actualVersion >= flV) {
		hasRightVersion = true;
	} else {
		hasRightVersion = false;
	}
}
/* Schreibe Flash
-----------------*/
function writeFlash(strFlash, strNoFlash, flVersion) {
	/* steht in "strFlash" im object-Tag eine Version und diese ist ungleich
	** mit der bereits angegebenen Version in "flVersion" dann wird "flVersion"
	** auf die Version aus dem object-Tag gesetzt
	--------------------------------------------------------------------------*/
	var posVersion = strFlash.search(/#version=.+/);
	if (posVersion != -1) {
		var objectTagVersion = strFlash.substring(posVersion+9,posVersion+10);
		if (objectTagVersion != flVersion) {
			flVersion = objectTagVersion;
		}
	}
	//alert(flVersion);
	// detect flash version
	detectFlash(flVersion);
	if(hasRightVersion) {
		// schreibe flash-string
		document.write(strFlash);
		return true;
	} else {
		// schreibe kein-Flash-String
		document.write(strNoFlash);
		return false;
	}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must be a valid emain address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is a required field.\n'; }
  } if (errors) alert('Following error/s appeared:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function show_contacts (elemId) {
	document.getElementById("contact_main").style.display = 'none';	
	document.getElementById("contact_benelux").style.display = 'none';	
	document.getElementById("contact_germany").style.display = 'none';	
	document.getElementById("contact_france").style.display = 'none';	
	document.getElementById("contact_gb").style.display = 'none';	
	document.getElementById("contact_hongkong").style.display = 'none';	
	document.getElementById("contact_italy").style.display = 'none';	
	document.getElementById("contact_japan").style.display = 'none';	
	document.getElementById("contact_austria").style.display = 'none';	
	document.getElementById("contact_poland").style.display = 'none';	
	document.getElementById("contact_slowakia").style.display = 'none';	
	document.getElementById("contact_skandinavia").style.display = 'none';	
	document.getElementById("contact_spain").style.display = 'none';	
	document.getElementById("contact_usa").style.display = 'none';	

	document.getElementById(elemId).style.display = 'block';	
}