	function MM_preloadImages() 
	{ //v3.0
  		var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}

	function MM_swapImgRestore() 
	{ //v3.0
  		var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}

	function MM_findObj(n, d) 
	{ //v4.0
  		var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  		if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  		for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  		if(!x && document.getElementById) x=document.getElementById(n); return x;
	}

	function MM_swapImage() 
	{ //v3.0
  		var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   		if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}

	function MM_openBrWindow(theURL,winName,features) 
	{ //v2.0
  		window.open(theURL,winName,features);
	}


	function getHeight() 
	{ 
  		var myWidth = 0, myHeight = 0; 
  		
		if( typeof( window.innerWidth ) == 'number' ) 
		{ 
    			//Non-IE 
    			myWidth = window.innerWidth; 
    			myHeight = window.innerHeight; 
  		} 
		else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
		{ 
    			//IE 6+ in 'standards compliant mode' 
    			myWidth = document.documentElement.clientWidth; 
    			myHeight = document.documentElement.clientHeight; 
  		} 
		else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
		{ 
    			//IE 4 compatible 
    			myWidth = document.body.clientWidth; 
    			myHeight = document.body.clientHeight; 
  		} 
  		
		return myHeight; 
	} 

	function getObj(name)
	{     
    		if (document.getElementById)
		{         
        		this.obj = document.getElementById(name);         
        		this.style = document.getElementById(name).style;     
    		}     
    		else if (document.all)
		{         
        		this.obj = document.all[name];         
        		this.style = document.all[name].style;     
    		} 
	} 

	function resize() 
	{                                
    		var oContent = new getObj('container');     
    		var height = getHeight();     
     
    		oContent.style.height = height - 158;      
	} 


	

	// Helpline messages
	b_help = "Vette tekst: [b]tekst[/b]  (alt+b)";
	i_help = "Schuine tekst: [i]tekst[/i]  (alt+i)";
	u_help = "Onderlijnde tekst: [u]tekst[/u]  (alt+u)";
	l_help = "Lijst: [list][*]tekst1[*]tekst2[/list] (alt+l)";
	o_help = "Geordende lijst: [list=1] of [list=a][*]tekst1[*]tekst2[/list]  (alt+o)";
	p_help = "Afbeelding: [img]http://image_url[/img]  (alt+p)";
	w_help = "Link: [url=http://www.jeugdvoormuziek.be]www.jeugdvoormuziek.be[/url]  (alt+w)";
	s_help = "Kleur tekst: [color=red]text[/color]  Tip: Je kan ook [color=#FF0000] gebruiken";
	f_help = "Grootte tekst: [size=7]kleine tekst[/size]";
	r_help = "Sluit alle tags (alt+r)";

	function addtext(text) 
	{
		document.gast.bericht.value += text;
		document.gast.bericht.focus();
	}

	function bold() 
	{
		if (document.gast.vet.value == "b")
		{
			document.gast.vet.value = "b *"
			document.gast.bericht.value += "[b]";
			document.gast.bericht.focus();
		}
		else
		{
			document.gast.vet.value = "b"
			document.gast.bericht.value += "[/b]";
			document.gast.bericht.focus();
		}
	}

	function italic() 
	{
		if (document.gast.schuin.value == "i")
		{
			document.gast.schuin.value = "i *"
			document.gast.bericht.value += "[i]";
			document.gast.bericht.focus();
		}
		else
		{
			document.gast.schuin.value = "i"
			document.gast.bericht.value += "[/i]";
			document.gast.bericht.focus();
		}
	}

	function underline() 
	{
		if (document.gast.onderlijn.value == "u")
		{
			document.gast.onderlijn.value = "u *"
			document.gast.bericht.value += "[u]";
			document.gast.bericht.focus();
		}
		else
		{
			document.gast.onderlijn.value = "u"
			document.gast.bericht.value += "[/u]";
			document.gast.bericht.focus();
		}
	}

	function unorderedlist() 
	{
		if (document.gast.lijst.value == " lijst ")
		{
			document.gast.lijst.value = " lijst * "
			document.gast.bericht.value += "[list]";
			document.gast.bericht.focus();
		}
		else
		{
			document.gast.lijst.value = " lijst "
			document.gast.bericht.value += "[/list]";
			document.gast.bericht.focus();
		}
	}
	
	function orderedlist() 
	{
		if (document.gast.geordendelijst.value == " lijst= ")
		{
			document.gast.geordendelijst.value = " lijst= * "
			document.gast.bericht.value += "[list=]";
			document.gast.bericht.focus();
		}	
		else
		{
			document.gast.geordendelijst.value = " lijst= "
			document.gast.bericht.value += "[/list]";
			document.gast.bericht.focus();
		}
	}

	function image() 
	{
		if (document.gast.afbeelding.value == " img ")
		{
			document.gast.afbeelding.value = " img * "
			document.gast.bericht.value += "[img]";
			document.gast.bericht.focus();
		}
		else
		{
			document.gast.afbeelding.value = " img "
			document.gast.bericht.value += "[/img]";
			document.gast.bericht.focus();
		}
	}

	function link() 
	{
		if (document.gast.url.value == " url ")
		{
			document.gast.url.value = " url * "
			document.gast.bericht.value += "[url=]";
			document.gast.bericht.focus();
		}
		else
		{
			document.gast.url.value = " url "
			document.gast.bericht.value += "[/url]";
			document.gast.bericht.focus();
		}
	}	
	
	function sluitTags() 
	{
		if (document.gast.vet.value == "b *")
		{
			document.gast.vet.value = "b";
			document.gast.bericht.value += "[/b]";
		}
		if (document.gast.schuin.value == "i *")
		{
			document.gast.schuin.value = "i";
			document.gast.bericht.value += "[/i]";
		}

		if (document.gast.onderlijn.value == "u *")
		{
			document.gast.onderlijn.value = "u";
			document.gast.bericht.value += "[/u]";
		}

		if (document.gast.lijst.value == " lijst * ")
		{
			document.gast.lijst.value = " lijst ";
			document.gast.bericht.value += "[/list]";
		}

		if (document.gast.geordendelijst.value == " lijst= * ")
		{
			document.gast.geordendelijst.value = " lijst= ";
			document.gast.bericht.value += "[/list]";
		}
		
		if (document.gast.afbeelding.value == " img * ")
		{
			document.gast.afbeelding.value = " img ";
			document.gast.bericht.value += "[/img]";
		}

		if (document.gast.url.value == " url * ")
		{
			document.gast.url.value = " url ";
			document.gast.bericht.value += "[/url]";
		}
		document.gast.bericht.focus();

	}

	// Shows the help messages in the helpline window
	function helpline(help) 
	{
		document.gast.help.value = eval(help + "_help");
	}

	function fontKleur() 
	{		
		var temp = '[color=' + document.gast.kleur.options[document.gast.kleur.selectedIndex].value + '] [/color]';
		document.gast.bericht.value += temp;
		document.gast.bericht.focus();
	}

	function fontGrootte() 
	{
		var temp = '[size=' + document.gast.grootte.options[document.gast.grootte.selectedIndex].value + '] [/size]';
		document.gast.bericht.value += temp;
		document.gast.bericht.focus();
	}


