/*---------------------------------------------------*/
/*-----------------Banner Function-------------------*/
/*---------------------------------------------------*/
$(function() {
	var top = 18;
	$('div.home-banner div.banner-button').each(function(index) {
		$(this).css('top', top+'px');
		top += 40;
	});
	var initanimate = setInterval("animateBanner()", 5000);
	
	$('div.block-banner div.home-banner div.banner-item').mouseover(function() {
		clearInterval(initanimate);
	});
	
	$('div.block-banner div.home-banner div.banner-item').mouseout(function() {
		initanimate = setInterval("animateBanner()", 5000);
	});
	
	$('div.block-banner div.home-banner div.banner-item').click(function() {
		window.location.href = $('div.block-banner div.home-banner div.banner-item.active div.banner-button div.text a').attr('href');
	});
	
	$('div.block-banner div.home-banner div.banner-item div.banner-button').mouseover(function() {
		if ($(this).parent().hasClass('active') == false && $(this).parent().parent().hasClass('active') == false) {
			stopAnimationBannerItem();
			clearInterval(initanimate);
			
			//Fade out active banner item
			fadeOutActiveBannerItem();
			
			//Remove the current active banner item
			$('div.block-banner div.home-banner div.banner-item.active').removeClass('active');
			
			//Set the parent of the button the mouse goes over to active
			$(this).parent().parent().addClass('active');
			//alert($(this).parent().parent().attr('id'))
			
			//Fade in the new banner item
			fadeInActiveBannerItem();
		}
	});
});

function animateBanner() {
	//Fade out active banner item
	fadeOutActiveBannerItem();
	
	//Check the next banner item and set it to active
	var activeItem = $('div.block-banner div.home-banner div.banner-item.active');
	activeItem.removeClass('active');
	if (activeItem.next().hasClass('clearer') == false) {
		activeItem.next().addClass('active');
	} else {
		$('div.block-banner div.home-banner div.banner-item.first').addClass('active');
	}
	
	//Fade in the new banner item
	fadeInActiveBannerItem();
}

function fadeOutActiveBannerItem() {
	$('div.block-banner div.home-banner div.banner-item.active div.banner-button div.top').fadeOut(1000);
	$('div.block-banner div.home-banner div.banner-item.active div.banner-button div.text a').animate({color: '#59595b'}, 1000);

	$('div.block-banner div.home-banner div.banner-item.active div.banner-image').fadeOut(1000);
	$('div.block-banner div.home-banner div.banner-item.active div.banner-content').fadeOut(1000);
}

function fadeInActiveBannerItem() {
	$('div.block-banner div.home-banner div.banner-item.active div.banner-button div.top').fadeIn(1000);
	$('div.block-banner div.home-banner div.banner-item.active div.banner-button div.text a').animate({color: '#ffffff'}, 1000);

	$('div.block-banner div.home-banner div.banner-item.active div.banner-image').fadeIn(1000);
	$('div.block-banner div.home-banner div.banner-item.active div.banner-content').fadeIn(1000);
}

function stopAnimationBannerItem() {
	$('div.block-banner div.home-banner div.banner-item.active div.banner-button div.top').stop(true,true);
	$('div.block-banner div.home-banner div.banner-item.active div.banner-button div.text a').stop(true,true);

	$('div.block-banner div.home-banner div.banner-item.active div.banner-image').stop(true,true);
	$('div.block-banner div.home-banner div.banner-item.active div.banner-content').stop(true,true);
}

/*---------------------------------------------------*/
/*-----------------Field info Function---------------*/
/*---------------------------------------------------*/
$(function() {
	$('div.fieldinfoHelp').hide();
	
	$('div.fieldinfoHelp').each(function(index) {
		var text = jQuery.trim($(this).text());
		var fieldinfoHelp = $(this);
		var formtextboxDefault = $(this).parent().parent();
		var label = formtextboxDefault.find('label');
		var inputfield = formtextboxDefault.find('div.field');
		var mouseout = false;

		if(text != "") {
			label.addClass('help-icon');
			
			label.mouseenter(function() {
				var marginTop = parseInt(inputfield.css('margin-top'));
				fieldinfoHelp.addClass('fieldinfoHelp');
				fieldinfoHelp.css("top", (inputfield.position().top+marginTop));
				fieldinfoHelp.css("left", (inputfield.position().left));
				fieldinfoHelp.show();
			}).mouseleave(function() {
				fieldinfoHelp.hide();
			});
		}
		
	});
});


/*---------------------------------------------------*/
/*--------------------Tab Function-------------------*/
/*---------------------------------------------------*/


// perform JavaScript after the document is scriptable. 
$(function() {
	//alert("div.tab-wrapper");
	$("div.tab-wrapper").tabs("div.block-tabs div.content-wrapper > div", { 
 
        // enable "cross-fading" effect 
        effect: 'fade', 
        fadeOutSpeed: 2
 
    // use the slideshow plugin. It accepts its own configuration 
    }).history();
});

/*---------------------------------------------------*/
/*------------------Search Function------------------*/
/*---------------------------------------------------*/
//onclick="clickclear(this, 'Typ hier uw zoekwoord')" 
function clickclear(thisfield, defaulttext) {
	if (thisfield.value == defaulttext) {
	thisfield.value = "";
	}
}

//onblur="clickrecall(this,'Typ hier uw zoekwoord')"
function clickrecall(thisfield, defaulttext) {
	if (thisfield.value == "") {
	thisfield.value = defaulttext;
	}
}

$(function(){
	$('div.block-search div.formtextbox-default input').click(function(){
		clickclear(this, 'Type hier uw zoekwoord')
	});
});

$(function(){
	$('div.block-search div.formtextbox-default input').blur(function(){
		clickrecall(this,'Type hier uw zoekwoord')
	});
});

/*---------------------------------------------------*/
/*----------------Font resize Function---------------*/
/*---------------------------------------------------*/
//IE is not compatible with a multiply statement thats 
//why we have to define hard coded font-sizes
$(function(){
	$('div.image-font').click(function(){
			
		var defaultFontSize = '11px';
		var h1FontSize = '13px';
		var h3FontSize = '12px';
		var h4FontSize = '12px';
		var breadcrumbFontSize = '9px';
		var breadcrumbMarginLeft = '110px';
		var navigationExtraFontSize = '12px';
		var navigationFirstLevelFontSize = '12px';
		var navigationSecondLevelFontSize = '11px';
		var paragraphBlueFontSize = '14px';
		var paragraphRedFontSize = '20px';
		var sitemapHeaderFontSize = '12px';
		var tabsFontSize = '10px';
		
		if(this.id == '' || this.id == 'large') {
			defaultFontSize = '14px';
			h1FontSize = '16px';
			h3FontSize = '15px';
			h4FontSize = '15px';
			breadcrumbFontSize = '12px';
			var breadcrumbMarginLeft = '135px';
			navigationExtraFontSize = '15px';
			navigationFirstLevelFontSize = '15px';
			navigationSecondLevelFontSize = '14px';
			paragraphBlueFontSize = '17px';
			paragraphRedFontSize = '23px';
			sitemapHeaderFontSize = '15px';
			tabsFontSize = '13px';
			this.id = 'small';
		}
		else if (this.id == 'small'){
			this.id = 'large';
		}
		
		$('span').css('font-size', defaultFontSize);
		$('div').css('font-size', defaultFontSize);
		
		$('h1').css('font-size', h1FontSize);
		$('h3').css('font-size', h3FontSize);
		$('h4').css('font-size', h4FontSize);
		$('h1 span').css('font-size', h1FontSize);
		$('h3 span').css('font-size', h3FontSize);
		$('h4 span').css('font-size', h4FontSize);
		
		$('div.block-paragraph div.paragraph-breadcrumb div.text').css('font-size', breadcrumbFontSize);
		$('div.path-breadcrumb span.title a').css('font-size', breadcrumbFontSize);
		$('div.path-breadcrumb ul').css('margin-left', breadcrumbMarginLeft);
		
		
		$('div.block-inzet div.pagesection-navigation-extra ul li a').css('font-size', navigationExtraFontSize);
		$('div.navigation-left span').css('font-size', navigationFirstLevelFontSize);
		$('div.navigation-left ul ul span').css('font-size', navigationSecondLevelFontSize);
		
		$('div.block-paragraph div.paragraph-blue div.h5-wrapper a').css('font-size', paragraphBlueFontSize);
		$('div.block-paragraph div.paragraph-red div.h5-wrapper a').css('font-size', paragraphRedFontSize);
		$('div.block-paragraph div.paragraph-red-left div.h5-wrapper a').css('font-size', paragraphRedFontSize);
		
		$('div.block-navigation div.navigation-sitemap-consumenten ul li a span').css('font-size', sitemapHeaderFontSize);
		$('div.block-navigation div.navigation-sitemap-bedrijven ul li a span').css('font-size', sitemapHeaderFontSize);
		$('div.block-navigation div.navigation-sitemap-zorgprofessionals ul li a span').css('font-size', sitemapHeaderFontSize);
		
		$('div.block-navigation div.navigation-sitemap-consumenten ul li ul a span').css('font-size', defaultFontSize);
		$('div.block-navigation div.navigation-sitemap-bedrijven ul li ul a span').css('font-size', defaultFontSize);
		$('div.block-navigation div.navigation-sitemap-zorgprofessionals ul li ul a span').css('font-size', defaultFontSize);
		
		$('div.tab-wrapper a').css('font-size', tabsFontSize);
		
		
		
	});
});


/*---------------------------------------------------*/
/*-----------------Corner Function-------------------*/
/*---------------------------------------------------*/

$(function(){
	/*.block-inzet.pagesection-3column.wrapper*/	
	$('.pagesection-3column').corner();
	
	$('div.eccolumns-block-two-third div.column.column-right').corner({
		  tl: { radius: 0 },
		  tr: { radius: 0 },
		  bl: { radius: 8 },
		  br: { radius: 8 }}); 
	
	$('div.eccolumns-right-block div.column.column-right').corner({
		  tl: { radius: 0 },
		  tr: { radius: 0 },
		  bl: { radius: 8 },
		  br: { radius: 8 }}); 

	$('div.eccolumns-left-block div.column.column-right').corner({
		  tl: { radius: 0 },
		  tr: { radius: 0 },
		  bl: { radius: 8 },
		  br: { radius: 8 }}); 
	
	$('div.eccolumns-small-right-block div.column.column-right').corner({
		  tl: { radius: 0 },
		  tr: { radius: 0 },
		  bl: { radius: 8 },
		  br: { radius: 8 }}); 
	
	$('div.eccolumns-block div.column.column-right').corner({
		  tl: { radius: 0 },
		  tr: { radius: 0 },
		  bl: { radius: 8 },
		  br: { radius: 8 }}); 
	
	$('.poll-border').corner({
		  tl: { radius: 12 },
		  tr: { radius: 12 },
		  bl: { radius: 12 },
		  br: { radius: 12 }}); 
	
	$('div.ectabs-default div.content-wrapper').corner({
		  tl: { radius: 0 },
		  tr: { radius: 0 },
		  bl: { radius: 8 },
		  br: { radius: 8 }});
	
	$('.ectabs-border').corner();
	
	$('.navigation-sitemap-consumenten').corner();
	$('.navigation-sitemap-bedrijven').corner();
	$('.navigation-sitemap-zorgprofessionals').corner();
	
	
});



/*---------------------------------------------------*/
/*------------------FAQ Function---------------------*/
/*---------------------------------------------------*/


var ddaccordion={
	
	contentclassname:{}, //object to store corresponding contentclass name based on headerclass

	expandone:function(headerclass, selected){ //PUBLIC function to expand a particular header
		this.toggleone(headerclass, selected, "expand")
	},

	collapseone:function(headerclass, selected){ //PUBLIC function to collapse a particular header
		this.toggleone(headerclass, selected, "collapse")
	},

	expandall:function(headerclass){ //PUBLIC function to expand all headers based on their shared CSS classname
		var $=jQuery
		var $headers=$('.'+headerclass)
		$('.'+this.contentclassname[headerclass]+':hidden').each(function(){
			$headers.eq(parseInt($(this).attr('contentindex'))).trigger("evt_accordion")
		})
	},

	collapseall:function(headerclass){ //PUBLIC function to collapse all headers based on their shared CSS classname
		var $=jQuery
		var $headers=$('.'+headerclass)
		$('.'+this.contentclassname[headerclass]+':visible').each(function(){
			$headers.eq(parseInt($(this).attr('contentindex'))).trigger("evt_accordion")
		})
	},

	toggleone:function(headerclass, selected, optstate){ //PUBLIC function to expand/ collapse a particular header
		var $=jQuery
		var $targetHeader=$('.'+headerclass).eq(selected)
		var $subcontent=$('.'+this.contentclassname[headerclass]).eq(selected)
		if (typeof optstate=="undefined" || optstate=="expand" && $subcontent.is(":hidden") || optstate=="collapse" && $subcontent.is(":visible"))
			$targetHeader.trigger("evt_accordion")
	},

	expandit:function($targetHeader, $targetContent, config, useractivated, directclick){
		this.transformHeader($targetHeader, config, "expand")
		$targetContent.slideDown(config.animatespeed, function(){
			config.onopenclose($targetHeader.get(0), parseInt($targetHeader.attr('headerindex')), $targetContent.css('display'), useractivated)
			if (config.postreveal=="gotourl" && directclick){ //if revealtype is "Go to Header URL upon click", and this is a direct click on the header
				var targetLink=($targetHeader.is("a"))? $targetHeader.get(0) : $targetHeader.find('a:eq(0)').get(0)
				if (targetLink) //if this header is a link
					setTimeout(function(){location=targetLink.href}, 200) //ignore link target, as window.open(targetLink, targetLink.target) doesn't work in FF if popup blocker enabled
			}
		})
	},

	collapseit:function($targetHeader, $targetContent, config, isuseractivated){
		this.transformHeader($targetHeader, config, "collapse")
		$targetContent.slideUp(config.animatespeed, function(){config.onopenclose($targetHeader.get(0), parseInt($targetHeader.attr('headerindex')), $targetContent.css('display'), isuseractivated)})
	},

	transformHeader:function($targetHeader, config, state){
		$targetHeader.addClass((state=="expand")? config.cssclass.expand : config.cssclass.collapse) //alternate btw "expand" and "collapse" CSS classes
		.removeClass((state=="expand")? config.cssclass.collapse : config.cssclass.expand)
		if (config.htmlsetting.location=='src'){ //Change header image (assuming header is an image)?
			$targetHeader=($targetHeader.is("img"))? $targetHeader : $targetHeader.find('img').eq(0) //Set target to either header itself, or first image within header
			$targetHeader.attr('src', (state=="expand")? config.htmlsetting.expand : config.htmlsetting.collapse) //change header image
		}
		else if (config.htmlsetting.location=="prefix") //if change "prefix" HTML, locate dynamically added ".accordprefix" span tag and change it
			$targetHeader.find('.accordprefix').html((state=="expand")? config.htmlsetting.expand : config.htmlsetting.collapse)
		else if (config.htmlsetting.location=="suffix")
			$targetHeader.find('.accordsuffix').html((state=="expand")? config.htmlsetting.expand : config.htmlsetting.collapse)
	},

	urlparamselect:function(headerclass){
		var result=window.location.search.match(new RegExp(headerclass+"=((\\d+)(,(\\d+))*)", "i")) //check for "?headerclass=2,3,4" in URL
		if (result!=null)
			result=RegExp.$1.split(',')
		return result //returns null, [index], or [index1,index2,etc], where index are the desired selected header indices
	},

	getCookie:function(Name){ 
		var re=new RegExp(Name+"=[^;]+", "i") //construct RE to search for target name/value pair
		if (document.cookie.match(re)) //if cookie found
			return document.cookie.match(re)[0].split("=")[1] //return its value
		return null
	},

	setCookie:function(name, value){
		document.cookie = name + "=" + value + "; path=/"
	},

	init:function(config){
	document.write('<style type="text/css">\n')
	document.write('.'+config.contentclass+'{display: none}\n') //generate CSS to hide contents
	document.write('<\/style>')
	jQuery(document).ready(function($){
		ddaccordion.urlparamselect(config.headerclass)
		var persistedheaders=ddaccordion.getCookie(config.headerclass)
		ddaccordion.contentclassname[config.headerclass]=config.contentclass //remember contentclass name based on headerclass
		config.cssclass={collapse: config.toggleclass[0], expand: config.toggleclass[1]} //store expand and contract CSS classes as object properties
		config.revealtype=config.revealtype || "click"
		config.revealtype=config.revealtype.replace(/mouseover/i, "mouseenter")
		if (config.revealtype=="clickgo"){
			config.postreveal="gotourl" //remember added action
			config.revealtype="click" //overwrite revealtype to "click" keyword
		}
		if (typeof config.togglehtml=="undefined")
			config.htmlsetting={location: "none"}
		else
			config.htmlsetting={location: config.togglehtml[0], collapse: config.togglehtml[1], expand: config.togglehtml[2]} //store HTML settings as object properties
		config.oninit=(typeof config.oninit=="undefined")? function(){} : config.oninit //attach custom "oninit" event handler
		config.onopenclose=(typeof config.onopenclose=="undefined")? function(){} : config.onopenclose //attach custom "onopenclose" event handler
		var lastexpanded={} //object to hold reference to last expanded header and content (jquery objects)
		var expandedindices=ddaccordion.urlparamselect(config.headerclass) || ((config.persiststate && persistedheaders!=null)? persistedheaders : config.defaultexpanded)
		if (typeof expandedindices=='string') //test for string value (exception is config.defaultexpanded, which is an array)
			expandedindices=expandedindices.replace(/c/ig, '').split(',') //transform string value to an array (ie: "c1,c2,c3" becomes [1,2,3]
		var $subcontents=$('.'+config["contentclass"])
		if (expandedindices.length==1 && expandedindices[0]=="-1") //check for expandedindices value of [-1], indicating persistence is on and no content expanded
			expandedindices=[]
		if (config["collapseprev"] && expandedindices.length>1) //only allow one content open?
			expandedindices=[expandedindices.pop()] //return last array element as an array (for sake of jQuery.inArray())
		if (config["onemustopen"] && expandedindices.length==0) //if at least one content should be open at all times and none are, open 1st header
			expandedindices=[0]
		$('.'+config["headerclass"]).each(function(index){ //loop through all headers
			if (/(prefix)|(suffix)/i.test(config.htmlsetting.location) && $(this).html()!=""){ //add a SPAN element to header depending on user setting and if header is a container tag
				$('<span class="accordprefix"></span>').prependTo(this)
				$('<span class="accordsuffix"></span>').appendTo(this)
			}
			$(this).attr('headerindex', index+'h') //store position of this header relative to its peers
			$subcontents.eq(index).attr('contentindex', index+'c') //store position of this content relative to its peers
			var $subcontent=$subcontents.eq(index)
			var needle=(typeof expandedindices[0]=="number")? index : index+'' //check for data type within expandedindices array- index should match that type
			if (jQuery.inArray(needle, expandedindices)!=-1){ //check for headers that should be expanded automatically (convert index to string first)
				if (config.animatedefault==false)
					$subcontent.show()
				ddaccordion.expandit($(this), $subcontent, config, false) //Last param sets 'isuseractivated' parameter
				lastexpanded={$header:$(this), $content:$subcontent}
			}  //end check
			else{
				$subcontent.hide()
				config.onopenclose($(this).get(0), parseInt($(this).attr('headerindex')), $subcontent.css('display'), false) //Last Boolean value sets 'isuseractivated' parameter
				ddaccordion.transformHeader($(this), config, "collapse")
			}
		})
		$('.'+config["headerclass"]).bind("evt_accordion", function(e, isdirectclick){ //assign custom event handler that expands/ contacts a header
				var $subcontent=$subcontents.eq(parseInt($(this).attr('headerindex'))) //get subcontent that should be expanded/collapsed
				if ($subcontent.css('display')=="none"){
					ddaccordion.expandit($(this), $subcontent, config, true, isdirectclick) //2nd last param sets 'isuseractivated' parameter
					if (config["collapseprev"] && lastexpanded.$header && $(this).get(0)!=lastexpanded.$header.get(0)){ //collapse previous content?
						ddaccordion.collapseit(lastexpanded.$header, lastexpanded.$content, config, true) //Last Boolean value sets 'isuseractivated' parameter
					}
					lastexpanded={$header:$(this), $content:$subcontent}
				}
				else if (!config["onemustopen"] || config["onemustopen"] && lastexpanded.$header && $(this).get(0)!=lastexpanded.$header.get(0)){
					ddaccordion.collapseit($(this), $subcontent, config, true) //Last Boolean value sets 'isuseractivated' parameter
				}
		})
		$('.'+config["headerclass"]).bind(config.revealtype, function(){
			if (config.revealtype=="mouseenter"){
				clearTimeout(config.revealdelay)
				var headerindex=parseInt($(this).attr("headerindex"))
				config.revealdelay=setTimeout(function(){ddaccordion.expandone(config["headerclass"], headerindex)}, config.mouseoverdelay || 0)
			}
			else{
				$(this).trigger("evt_accordion", [true])
				return false //cancel default click behavior
			}
		})
		$('.'+config["headerclass"]).bind("mouseleave", function(){
			clearTimeout(config.revealdelay)
		})
		config.oninit($('.'+config["headerclass"]).get(), expandedindices)
		$(window).bind('unload', function(){ //clean up and persist on page unload
			$('.'+config["headerclass"]).unbind()
			var expandedindices=[]
			$('.'+config["contentclass"]+":visible").each(function(index){ //get indices of expanded headers
				expandedindices.push($(this).attr('contentindex'))
			})
			if (config.persiststate==true && $('.'+config["headerclass"]).length>0){ //persist state?
				expandedindices=(expandedindices.length==0)? '-1c' : expandedindices //No contents expanded, indicate that with dummy '-1c' value?
				ddaccordion.setCookie(config.headerclass, expandedindices)
			}
		})
	})
	}
}


/*---------------------------------------------------*/
/*-----------------FAQ Function Extra----------------*/
/*---------------------------------------------------*/


ddaccordion.init({
	headerclass: "question", //Shared CSS class name of headers group
	contentclass: "answer", //Shared CSS class name of contents group
	revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseover"
	mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
	collapseprev: false, //Collapse previous content (so only one open at any time)? true/false 
	defaultexpanded: [], //index of content(s) open by default [index1, index2, etc]. [] denotes no content.
	onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
	animatedefault: false, //Should contents open by default be animated into view?
	persiststate: false, //persist state of opened contents within browser session?
	toggleclass: ["closedanswer", "openanswer"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
	animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
	oninit:function(expandedindices){ //custom code to run when headers have initalized
		//do nothing
	},
	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
		//do nothing
	}
});


var requiredVersion = 5; 
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 flash9Installed = false;
var flash10Installed = false;

var maxVersion = 10;   
var actualVersion = 0;    
var hasRightVersion = false;  
var jsVersion = 1.0;    

var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;   // true if we're on ie
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false; // true if we're on windows

if(isIE && isWin){ // don't write vbscript tags on anything but ie win
  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('flash10Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.10"))) \n');
  document.write('</SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script
}

jsVersion = 1.1;
detectFlash = function(){
  if (navigator.plugins) {  // does navigator.plugins exist?
    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;
    flash9Installed = flashVersion == 9;
    flash10Installed = flashVersion == 0;
    }
  }

  for (var i = 2; i <= maxVersion; i++) {
    if (eval("flash" + i + "Installed") == true) actualVersion = i;
  }

  if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 2;

  if (actualVersion >= requiredVersion) {
    hasRightVersion = true;
    if (useRedirect) {
      if(jsVersion > 1.0) {
        window.location.replace(flashPage);
      } else {
        window.location = flashPage;
      }
    }
  } else {  
    if (useRedirect) {    
      if(jsVersion > 1.0) { 
        window.location.replace((actualVersion >= 2) ? upgradePage : noFlashPage);
      } else {
        window.location = (actualVersion >= 2) ? upgradePage : noFlashPage;
      }
    }
  }
}
 
writeFlash = function(s,w,h,a) {
  
  var alternateContent = a;
  if (alternateContent == '') {
    alternateContent = 'Voor deze site heeft u <a target="_blank" href="http://www.microsoft.com/download/">Microsoft Internet Explorer</a> versie 5.5 (of hoger) en de <a target="_blank" href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&P5_Language=English">Macromedia Flash plugin</a> versie ' + requiredVersion + ' (of hoger) nodig.'
  }

  var flashContent = '<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" WIDTH="'+w+'" HEIGHT="'+h+'" CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
  + '<PARAM NAME="MOVIE" VALUE="'+s+'">'
  + '<PARAM NAME="PLAY" VALUE="true">'
  + '<PARAM NAME="LOOP" VALUE="true">'
  + '<PARAM NAME="QUALITY" VALUE="high">'
  + '<PARAM NAME="MENU" VALUE="false">'
  + '<EMBED SRC="'+s+'" WIDTH="'+w+'" HEIGHT="'+h+'" PLAY="true" LOOP="true" QUALITY="high" MENU="false" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>'
  + '<NOEMBED>' + alternateContent + '</NOEMBED></OBJECT>';

  if (hasRightVersion) {
    document.write(flashContent);
  } else {
    document.write(alternateContent);
  }
}
