// Prototype
// # $('ID') voor het vinden van een element ID
// # $F('ID') voor de waar de van een input veld ID
// -

// Init
function init() {
}
// -

//- Popup CMS
function CMSPopUp(url, wi, he, winm) {
	if (winm == 0) {
		window.open(url, '', 'toolbar=0,location=0,directories=0,menubar=0,scrollbars=0,resizable=no,width=' + wi + ',height=' + he);
	} else {
		window.open(url, '', 'toolbar=1,location=1,directories=1,menubar=1,scrollbars=1,resizable=yes,width=' + (wi + 16) + ',height=' + he);
	}
}
// -

// Set Flash
// # element ID waar de Flash in geplaatst wordt
// # parameters : 'movie:"movie.swf", width:"100", height:"100"'
function setFlash(element, parameters) {
	eval('array = {' + parameters + '}');
	
	html = '<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="' + array.width + '" height="' + array.height + '">';
	html = html + '<param name="allowScriptAccess" value="sameDomain" />';
	html = html + '<param name="movie" value="' + array.movie + '" />';
	html = html + '<param name="quality" value="high" />';
	html = html + '<param name="scale" value="noscale" />';
	html = html + '<param name="wmode" value="transparent" />';
	html = html + '<param name="menu" value="false" />';
	html = html + '<param name="bgcolor" value="#ffffff" />';
	html = html + '<embed src="' + array.movie + '" quality="high" scale="noscale" wmode="transparent" bgcolor="#ffffff"  width="' + array.width + '" height="' + array.height + '" allowScriptAccess="sameDomain" menu="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	html = html + '</object>';
	
	$(element).innerHTML = html;
}
// -

// Open Close
// # element ID
var onmenu = 0;

function menuOpenClose(elm, show) {
	element = $('menu_' + elm);
	if (element) {
		if (show == 1) {
			if (element.style.display == 'none') {
				elems = $('showfields').elements;
				for (i = 0; i < elems.length; i++) {
					element_tmp = $(elems[i].name.replace('show', ''));
					if (element_tmp) {
						element_tmp.style.display = 'none';
					}
				}
				element.style.display = '';
				theTimer = setTimeout("menuOpenClose('" + elm + "', 0, 0)", 1000);
			}
		} else {
			if (onmenu == 0) {
				element.style.display = 'none';
				theTimer = null;
			} else {
				theTimer = setTimeout("menuOpenClose('" + elm + "', 0, 0)", 1000);
			}
		}
	}
}
// -