﻿
// Set Active Nav
function ActiveNav(Main,Sub) {
  document.getElementById(Main).className = 'MainNavActive';
  if (Sub && Sub.length > 0) {
  	document.getElementById(Sub).className = 'SubNavActive';	
	}
}

// Flash Titel
function FlashTitel(TekstVar,TekstSizeVar,ColorVar,WidthVar,HeightVar) {
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='"+WidthVar+"' height='"+HeightVar+"' id='FlashTitel'>");
	document.write("<param name=allowScriptAccess value='always' />");
	document.write("<param name=movie value='flash/Header.swf' />");
	document.write("<param name=quality value=high />");
	document.write("<param name=wmode value=transparent />");
	document.write("<param name=FlashVars value='TekstVar="+TekstVar+"&TekstSizeVar="+TekstSizeVar+"&ColorVar="+ColorVar+"&WidthVar="+WidthVar+"&HeightVar="+HeightVar+"' />");
	document.write("<embed FlashVars='TekstVar="+TekstVar+"&TekstSizeVar="+TekstSizeVar+"&ColorVar="+ColorVar+"&WidthVar="+WidthVar+"&HeightVar="+HeightVar+"' src='flash/Header.swf' quality='high' wmode='transparent' width='"+WidthVar+"' height='"+HeightVar+"' name='FlashTitel' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed>");
	document.write("</object>");
}

// formcheck
function submit_onclick(object){
	var form=document.forms[object];
	var msg='';
	for(i=0;i<form.elements.length;i++){
		if(form.elements[i].id!=''){
			if(form.elements[i].value==''){
				msg = msg + "- " + form.elements[i].id + ".\n";
				form.elements[i].style.backgroundColor = "#0099CC";
		    }			
       	    else if (form.elements[i].id=='Email'){
				if(form.elements[i].value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1){
					msg = msg + "- " + form.elements[i].id + ".\n";
					form.elements[i].style.backgroundColor = "#0099CC";
				}
			}
		}
	}
	if(msg!='') {
		//alert("De volgende velden zijn verplicht:\n" + msg);
	}
	else {
	 	form.submit();
	}
}

// Flash Detect
function FlashDetect(FlashCheck) {
	if(FlashCheck=="FlashEnabled"){
		clearTimeout(t);
		// Generate Flash
		var embed = document.createElement("embed");
		embed.setAttribute("type", "application/x-shockwave-flash");
		embed.setAttribute("pluginspage", "http://www.macromedia.com/go/getflashplayer");
		embed.setAttribute("src", "flash/IntroAnimatie.swf");
		embed.setAttribute("quality", "high");
		embed.setAttribute("bgcolor", "#ffffff");	
		embed.setAttribute("width", "761");
		embed.setAttribute("height", "240");
		document.getElementById("FlashBlok").appendChild(embed);
	} else if (FlashCheck == "FlashDisabled") {
		// Show image
		var img = document.createElement("img");
		img.setAttribute("id", "FlashAlt");
		img.setAttribute("src", "img/FlashAlt.jpg");
		document.getElementById("FlashBlok").appendChild(img);
	}
}

