var EffectSpeed = 200;



/**
*	Standaard alle links met # false laten returnen zodat er niet naar boven gegaan wordt
*/

$(document).ready(function()
{
	$("a[href=#]").click(function()
	{
		return false;
	})

	$("a[rel=external]").click(function()
	{
		$(this).attr("target", "_blank");
	})
	
	$("form[rel=external]").click(function()
	{
		$(this).attr("target", "_blank");
	})
});


function limitText(limitField, limitCount, limitNum)
{
	if (limitField.value.length > limitNum)
	{
		limitField.value = limitField.value.substring(0, limitNum);
	}
	else
	{
		limitCount.value = limitNum - limitField.value.length;
	}
}

//-- Voor nieuwsbrief pagina
function calcHeight()
{
	//find the height of the internal page
	var the_height=document.getElementById('newsletterpreview').contentWindow.document.body.scrollHeight;

	//change the height of the iframe
	document.getElementById('newsletterpreview').height=the_height;
}

//-- Submit form via ajax
$(document).ready(function()
{
	$("form[id^=frm][class!=no-submit]").submit(function(){
		CheckForm($(this));
		return false;
	});
})

//you tube filmpjes
function writeFlash(p) {
	writeEmbed(
		'D27CDB6E-AE6D-11cf-96B8-444553540000',
		'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
		'application/x-shockwave-flash',
		p
	);
}

function writeEmbed(cls, cb, mt, p) {
	var h = '', n;

	h += '<div style="width:100%;text-align:center;"><object classid="clsid:' + cls + '" codebase="' + cb + '"';
	h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';
	h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';
	h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';
	h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';
	h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';
	h += '>';

	for (n in p)
		h += '<param name="' + n + '" value="' + p[n] + '">';

	h += '<param name="wmode" value="opaque">';
	h += '<embed  wmode="opaque" type="' + mt + '"';

	for (n in p)
		h += n + '="' + p[n] + '" ';

	h += '></embed></object></div>';

	document.write(h);
}

function html_entity_decode(str)
{
	try
	{
		var  tarea=document.createElement('textarea');
		tarea.innerHTML = str;
		return tarea.value;
		tarea.parentNode.removeChild(tarea);
	}
	catch(e)
	{
		//for IE add<div id="htmlconverter" style="display:none;"></div> to the page
		document.getElementById("htmlconverter").innerHTML = '<textarea id="innerConverter">' + str + '</textarea>';
		var content = document.getElementById("innerConverter").value;
		document.getElementById("htmlconverter").innerHTML = "";
		return content;
	}
}

//-- hoogte van divs even hoog maken 

