﻿function toggleMenu(menu) {
    var obj = document.getElementById(menu);
    obj.style.display = (obj.style.display == 'block' || obj.style.display == '') ? 'none' : 'block' ;
}

function toggleSearch(menu) {
    var obj = document.getElementById(menu);
    obj.style.display = (obj.style.display == 'block') ? 'none' : 'block' ;
}

function toggleDiv(div) {
    document.getElementById(div).style.display = (document.getElementById(div).style.display == 'block') ? '' : 'block';
}

function toggleExperienceDiv(div,obj) {
    document.getElementById(div).style.display = (obj.checked) ? 'block' : 'none';
}

function changeHeadColor(div,color) {
    document.getElementById(div).style.backgroundColor = color;
}

var FlashRenderer = {        
    RenderGenericFlash: function(strSrc, version, strWidth, strHeight, transparent) {
        AC_FL_RunContent('codebase','http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+version+',0,0,0','width',strWidth,'height',strHeight,'align','middle','src',strSrc,'quality','highest','bgcolor','#ffffff','allowscriptaccess','sameDomain','pluginspage','http://www.macromedia.com/go/getflashplayer','movie', strSrc, 'wmode', transparent?'transparent':'window' );    
    }
}

function openWindow(theURL,winName,features) { 
  	var win = window.open(theURL,winName,features);
  	win.focus();
}

function conf(txt) {
    return confirm(txt);
}

function organisationsnummer(nr){
	this.valid=false;
	if(!nr.match(/^(\d{1})(\d{5})\-(\d{4})$/)){ return false; }
	this.group=RegExp.$1;
	this.controldigits=RegExp.$3;
	this.alldigits=this.group+RegExp.$2+this.controldigits;
	if(this.alldigits.substring(2,3)<2){ return false }
	var nn="";
	for(var n=0;n<this.alldigits.length;n++){ nn+=((((n+1)%2)+1)*this.alldigits.substring(n,n+1)); }
	this.checksum=0;
	for(var n=0;n<nn.length;n++){ this.checksum+=nn.substring(n,n+1)*1; }
	this.valid=(this.checksum%10==0)?true:false;
}

