function addLoadEvent(func) {
	//Add functions to window.onload
	//Thank you, Simon Willison (See http://simon.incutio.com/archive/2004/05/26/addLoadEvent)

	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
		if (oldonload) {
			oldonload();
			}
		func();
		}
	}
}
/* --------------------------------------------------------------------------------- */
function getElementsByClassName(clsName) {
	var arr = new Array();
	var elems = document.getElementsByTagName("*");
	for ( var cls, i = 0; ( elem = elems[i] ); i++ ) {
		if ( elem.className == clsName ) {
			arr[arr.length] = elem;
		}
	}
	return arr;
}
/* --------------------------------------------------------------------------------- */
function alternateRowColors() {
	var className = 'rowcolors';
	var defaultrowcolor = '#fefdfb';
	var rowcolor  = '#f6f6f6';
	var rows, row;
	var tables = document.getElementsByTagName("table");
	var rowCount = 0;
	for(var i=0;i<tables.length;i++) {
		
		if(tables[i].className.indexOf(className) > 0){
		//if(tables[i].className == className) {
			
			atable = tables[i];
			
			rows = atable.getElementsByTagName("tr");
			for(var j=0;j<rows.length;j++) {
				row = rows[j];
				if(row.nodeName == "TR") {
					row.onmouseover =  function(){this.style.backgroundColor="#eeeeee"};
					if(rowCount % 2) {
						row.style.backgroundColor = rowcolor;
						row.onmouseout = function(){this.style.backgroundColor=rowcolor;}
					} else {
						// default case
						row.style.backgroundColor = defaultrowcolor;
						row.onmouseout = function(){this.style.backgroundColor=defaultrowcolor;}
					}
					rowCount++;
				}
			}
			rowCount = 0;
			
		}
	}
}

/* --------------------------------------------------------------------------------- */
function toggle(classname) {

	var e = document.getElementsByClassName(classname);

	for(var i=0;i<e.length;i++) {
		element = e[i];
		
		if ((element.style.display == 'none') || (element.style.display == '')) {
			element.style.display = 'block';
			}else{
			element.style.display = 'none';
		}

	}
}

/* --------------------------------------------------------------------------------- */
function toggleOff(id){
	var e = document.getElementById(id);
	if(e){ e.style.display = 'none'; }
}

function toggleOn(id){
	var e = document.getElementById(id);
	if(e){ e.style.display = 'block'; }
}

/* --------------------------------------------------------------------------------- */

function toggleProvince(id){

	toggleOff('klik'); 
	
	//first hide all provinces
	toggleOff('Drenthe');
	toggleOff('Flevoland');
	toggleOff('Friesland');
	toggleOff('Gelderland');
	toggleOff('Groningen');
	toggleOff('Limburg');
	toggleOff('Noord-Brabant');
	toggleOff('Noord-Holland');
	toggleOff('Overijssel');
	toggleOff('Utrecht');
	toggleOff('Zeeland');
	toggleOff('Zuid-Holland');

	//now show 1 province
	toggleOn(id);

}

function toggleSector(id){
	
	toggleOff('klik'); 
	
	//first hide all sectors
	toggleOff('sectora');
	toggleOff('sectorb');
	toggleOff('sectorc');
	toggleOff('sectord');
	toggleOff('sectore');
	toggleOff('sectorf');
	toggleOff('sectorg');
	toggleOff('sectorh');
	toggleOff('sectori');
	toggleOff('sectorj');
	toggleOff('sectork');

	//now show 1 sector
	toggleOn(id);

}


/* --------------------------------------------------------------------------------- */
function setsubmitter(xxx){
	var e = document.getElementById('submitter');
	e.value = xxx;
}

/* --------------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------------- */