/******************************************************************
function createBtn

title: 			tekst op de butoon
url: 			link waarnaartoe de button doorverwijst

bgBaseColor: 	achtergrondkleur (hex-kleurcode zonder # ervoor)
txtBaseColor: 	tekstkleur (hex-kleurcode zonder # ervoor)
imgBase: 		achtergrondplaatje (bestandsnaam van PNG. De PNG's moeten in de map <root>/flash/ staan)

bgHoverColor: 	achtergrondkleur bij mouse-over 
txtHoverColor: 	tekstkleur bij mouse-over
imgHover: 		achtergrondplaatje bij mouse-over

txtOffsetLeft: 	positie van de tekst (int, pixels vanaf de linkerkant)
txtOffsetTop: 	positie van de tekst (int, pixels vanaf de bovenkant)

marginRight: 	1 of 0 (moet er rechts van de button een marge van 10px komen)
******************************************************************/
function createBtn(title, url, bgBaseColor, txtBaseColor, imgBase, bgHoverColor, txtHoverColor, imgHover, txtOffsetLeft, txtOffsetTop, marginRight){

	imgHover = "flash/" + imgHover;
	imgBase = "flash/" + imgBase;
	if (marginRight == true){
		document.writeln('<div class="flashButton" style="margin-right: 10px">');
	} else {
		document.writeln('<div class="flashButton">');
	}		
	document.writeln('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"');
	document.writeln('codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"');
	document.writeln('width="275" height="40" id="ad_button_' + title + '">');
	document.writeln('		<param name="allowScriptAccess" value="sameDomain" />');
	document.writeln('		<param name="movie" value="flash/ad_button.swf" />');
	document.writeln('		<param name="quality" value="high" />');
	document.writeln('		<param name="menu" value="false" />');
	document.writeln('		<param name="bgcolor" value="#' + bgBaseColor + '" />');
	document.writeln('		<param name="FlashVars" VALUE="title=' + title + '&url=' + url + '&bgBaseColor=' + bgBaseColor + '&txtBaseColor=' + txtBaseColor + '&imgBase=' + imgBase + '&bgHoverColor=' + bgHoverColor + '&txtHoverColor=' + txtHoverColor + '&imgHover=' + imgHover + '&txtOffsetLeft=' + txtOffsetLeft + '&txtOffsetTop=' + txtOffsetTop + '" />');

	if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) {
		document.writeln('<embed src="flash/ad_button.swf"');
		document.writeln(' quality="high"');
		document.writeln(' bgcolor="#' + bgBaseColor + '"');
		document.writeln(' width="275" height="40"');
		document.writeln(' name="ad_button"');
		document.writeln(' allowScriptAccess="sameDomain"');
		document.writeln(' type="application/x-shockwave-flash"');
		document.writeln(' pluginspage="http://www.macromedia.com/go/getflashplayer"');
		document.writeln(' FlashVars="title=' + title + '&url=' + url + '&bgBaseColor=' + bgBaseColor + '&txtBaseColor=' + txtBaseColor + '&imgBase=' + imgBase + '&bgHoverColor=' + bgHoverColor + '&txtHoverColor=' + txtHoverColor + '&imgHover=' + imgHover + '&txtOffsetLeft=' + txtOffsetLeft + '&txtOffsetTop=' + txtOffsetTop + '" />');
	} else {
        document.writeln('	<a href="'+ url + '">' + title + '</a>');
	} // if..else

	document.writeln('	</object>');
	document.writeln('</div>');

}

// Controleren of de gebruiker een keyword heeft ingevuld
function submitSearch(){
	obj = document.getElementById('keyword');
	
	if(obj.value == '' || obj.value == 'trefwoord'){
		//
		alert('Vul a.u.b. een trefwoord in');
		obj.value = '';
		obj.focus();
	} else {
		document.search.submit();
	}
}

// wordt aangeroepen via een select box: surf naar de gekozen url
function goto_url(object) {
	if(object.options[object.selectedIndex].value != ''){
	    window.location.href = object.options[object.selectedIndex].value;
	}
}

// deze functie format een postcode zodanig dat FormHandler hem goedkeurt
function formatPostcode(elementId){
	postcode = 	document.getElementById(elementId).value;
	
	postcode = postcode.toUpperCase(); // hoofdletters
	postcode = postcode.replace(" ",""); // spaties verwijderen
	
	document.getElementById(elementId).value = postcode;
}