var editor = null;
var x      = 0;
var headerfotos = new Array;
var headernr = 0;
var verboden_dagen = new Array;

function popUp(URL, breed, hoog) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width=" + breed + ",height=" + hoog + ",left=150,top=150');");
}

function popUpcontent(name, inhoud, breed, hoog) {
  var generator=window.open(name,'popup','height=' + hoog + ',width=' + breed + 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,left=150,top=150');
  generator.document.write('<html><head><title>' + name + '</title><link rel="stylesheet" href="/css/site_popup.css" type="text/css"/></head><body>');
  generator.document.write(inhoud);
  generator.document.write('</body></html>');
  generator.document.close();
}

function htmlarealaden () {
	if (typeof (velden) == "object") {
		for (x=0; x < velden.length; x++) { 
        var oFCKeditor = new FCKeditor( velden[x] ) ;
        oFCKeditor.BasePath = webadres + "jsf/fckeditor/" ;
        oFCKeditor.Height	= 400;
				oFCKeditor.Width = 600;
//				oFCKeditor.ToolbarSet = 'Custom';
				oFCKeditor.ToolbarSet = 'Default';				
        //oFCKeditor.Config['ToolbarStartExpanded'] = false ;								
        oFCKeditor.ReplaceTextarea();		
		}
	}
}

function putfocus (formInst, elementInst) {
	if (document.forms.length > 0) {
		document.forms[formInst].elements[elementInst].focus();
		document.forms[formInst].elements[elementInst].select();
	}
}

function isset(variable_name)
{
try
{
if (typeof(eval(variable_name)) != 'undefined')
if (eval(variable_name) != null)
return true;
} catch(e) { }

return false;
}



function parsepagina () {
	htmlarealaden();	
}

window.onload = parsepagina;

function in_array(my_array,my_value){
	caseSensitive = in_array.arguments.length<3?0:in_array.arguments[2];

	for(i=0;i<my_array.length;i++){
		if((caseSensitive==0?my_array[i]:my_array[i].toUpperCase())==(caseSensitive==0?my_value:my_value.toUpperCase())){
			return true;
		}
	}

	return false;
}

function hasOptions(obj) {if (obj!=null && obj.options!=null) { return true; }	return false;}
function swapOptions(obj,i,j) {	var o = obj.options;	var i_selected = o[i].selected;	var j_selected = o[j].selected;	var temp = new Option(o[i].text, o[i].value, o[i].defaultSelected, o[i].selected);var temp2= new Option(o[j].text, o[j].value, o[j].defaultSelected, o[j].selected);	o[i] = temp2;o[j] = temp;o[i].selected = j_selected;o[j].selected = i_selected;}
function moveOptionUp(obj) {if (!hasOptions(obj)) { return; }	for (i=0; i<obj.options.length; i++) {if (obj.options[i].selected) {if (i != 0 && !obj.options[i-1].selected) { swapOptions(obj,i,i-1);	obj.options[i-1].selected = true;}}} volgordeclasses ();}
function moveOptionDown(obj) {if (!hasOptions(obj)) { return; }	for (i=obj.options.length-1; i>=0; i--) {if (obj.options[i].selected) {if (i != (obj.options.length-1) && ! obj.options[i+1].selected) { swapOptions(obj,i,i+1);	obj.options[i+1].selected = true; }}} volgordeclasses ();}
function submitForm(url, veld) { var	list = document.getElementById(veld); 	var velden = '';	for (i = 0; i <= list.options.length - 1; i++) { 	velden = velden + '_SPLIT_' + list.options[i].value;}	window.location.href = url + velden; }
function volgordeclasses () {
	list		= document.getElementById('volgorde');
	var	kleur	= 'nee';

	for (i = 0; i <= list.options.length - 1; i++) {
		if (kleur == 'ja') {
			list.options[i].className = 'een';
			kleur = 'nee';
		} else {
			list.options[i].className = 'twee';
			kleur = 'ja';
		}

		if (typeof(volgordetitel) == "object") {
			for (a=0;a < volgordetitel.length;a++) {
				if (volgordetitel[a] == list.options[i].value) {
						list.options[i].style.color = 'red';
				}
			}
		}
	}
}

function agenda_kies () {
  select1 = document.getElementById('agenda_jaar');
	
	document.location.href = webadres + 'agenda/' + select1.value;
}

function agenda_kies2 () {
  select1 = document.getElementById('agenda_jaar');
	select2 = document.getElementById('agenda_maand');
	
	document.location.href = webadres + 'agenda/' + select1.value + '/' + select2.value;
}

function weergeefSWF(src, width, height) {
		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="' + width + '" height="' + height + '">');
		document.write('  <param name="movie" value="' + src + '">');
		document.write('  <param name=quality value=high>');
		document.write('  <param name="allowScriptAccess" value="always" />');
		document.write('  <param name="wmode" value="transparent" /><param name="SCALE" value="exactfit">');
		document.write('  <embed wmode="transparent" src="' + src + '" width="' + width + '" height="' + height + '" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" scale="exactfit"></embed>');
		document.write('</object>');
}

function weergeefLogo() {
		//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="950" height="210">');
	//	document.write('  <param name="movie" value="' + webadres + 'swf/header.swf">');
		//document.write('  <param name=quality value=high>');
		//document.write('  <param name="allowScriptAccess" value="always" />');
		//document.write('  <param name="wmode" value="transparent" /><param name="SCALE" value="exactfit">');
		//document.write('  <embed wmode="transparent" src="' + webadres + 'swf/header.swf" width="950" height="210" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" scale="exactfit"></embed>');
		//document.write('</object>');
}

function weergeefLandkaart() {
		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="205" height="286">');
		document.write('   <param name="movie" value="/swf/kaart.swf">');
		document.write('   <param name="quality" value="high">');
		document.write('  <param name="wmode" value="transparent" />');		
		document.write('   <embed wmode="transparent" src="/swf/kaart.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="205" height="286"></embed>');
		document.write('</object>');
}

function displayBlock(id)
{
	if (document.getElementById)
	{ // DOM3 = IE5, NS6
		document.getElementById(id).style.visibility = 'visible';
		document.getElementById(id).style.display = 'block';
	}
}

function hideBlock(id)
{
	if (document.getElementById)
	{ // DOM3 = IE5, NS6
		document.getElementById('id').style.visibility = 'hidden';
	}
} 