/**	Speler 2 Javascript - Input fixer
 *	Sommige <input>'s moeten standaard een tekst hebben
 *	die verdwijnen wanneer er op wordt geklikt. Als deze
 *	<input>'s nog leeg zijn als de focus verdwijnt, moet
 *	de standaard tekst weer verschijnen...
 **/

function fixInputs()
{
	
	allInputs = document.getElementsByTagName('input');
	
	for( i=0; i<allInputs.length; i++ )
	{
		curInput = allInputs[i];
		
		if( curInput.id.substring(0, 5) == 'auto_' )
		{
			curInput.onfocus = function()
			{
				if( this.value == this.title )
				{
					this.value = '';
				}
			}
			
			curInput.onblur = function()
			{
				if( this.value == '' )
				{
					this.value = this.title;
				}
			}
		}
	}
	
	allTextareas = document.getElementsByTagName('textarea');
	
	for( i=0; i<allTextareas.length; i++ )
	{
		curTextarea = allTextareas[i];
		
		if( curTextarea.id.substring(0, 5) == 'auto_' )
		{
			curTextarea.onfocus = function()
			{
				if( this.value == this.title )
				{
					this.value = '';
				}
			}
			
			curTextarea.onblur = function()
			{
				if( this.value == '' )
				{
					this.value = this.title;
				}
			}
		}
	}
	
}
 
// voeg de handler toe
if( window.addEventListener )
{
	window.addEventListener("load", fixInputs, false);
}
else if( window.attachEvent )
{
	window.attachEvent("onload", fixInputs);
}