// JavaScript Document
var browserType;

if (document.layers) {browserType = "nn4"}
if (document.all) {browserType = "ie"}
if (window.navigator.userAgent.toLowerCase().match("gecko")) {browserType= "gecko"}

//Functie om een div layer zichtbaar en onzichtbaar te maken

function hide(divName) {
  if (browserType == "gecko" )
     document.poppedLayer = eval('document.getElementById(divName)');
  else if (browserType == "ie")
     document.poppedLayer = eval('document.all[divName]');
  else
     document.poppedLayer = eval('document.layers[divName]');
  document.poppedLayer.style.visibility = "hidden";
  document.poppedLayer.style.display = "none";
}

function show(divName) {
  if (browserType == "gecko" )
     document.poppedLayer = eval('document.getElementById(divName)');
  else if (browserType == "ie")
     document.poppedLayer = eval('document.all[divName]');
  else
     document.poppedLayer = eval('document.layers[divName]');
  document.poppedLayer.style.visibility = "visible";
  document.poppedLayer.style.display = "";
}


// Flash
/*function flash(swf, w, h)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+w+'" height="'+h+'">');
	document.write('<param name="allowScriptAccess" value="always"><param name="wmode" value="transparent"><param name="movie" value="'+swf+'"><embed src="'+swf+'" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'"></embed></object>');
}*/

function flash(swf, w, h, wmode, id)
{
	if(!wmode) wmode="transparent";
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" id="'+id+'" width="'+w+'" height="'+h+'">');
	document.write('<param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="'+swf+'" /><param name="wmode" value="'+wmode+'" /><embed src="'+swf+'" id="'+id+'" name="'+id+'" wmode="'+wmode+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'" swLiveConnect=true allowScriptAccess="sameDomain" /></object>');
}

// TextCounter
function textCounter(field, countfield, maxlimit) {
	if (field.value.length > maxlimit){
		field.value = field.value.substring(0, maxlimit);
	}else{
		countfield.value = maxlimit - field.value.length;
	}
}