/* 
 * Hondsrug College - Unobstructive javascript
 * ----
 */
$(document).ready(function() { 

	try 
	{
		// Acties aan het zoekformulier binden
		$( '#zoekForm' ).focus(function()
		{
			$(this).removeClass("zoekenInactief").addClass("zoekenActief");
			if( $(this).val() == "Zoeken.." ) $(this).val("");
		});
		
		$( '#zoekForm' ).blur(function()
		{	
			if( $(this).val() == "" ) { $(this).val("Zoeken").removeClass("zoekenActief").addClass("zoekenInactief"); $( '#resultaten' ).hide(); }
		});
		
		$( '#zoekForm' ).keyup(function()
		{
			performSearch( $(this) );	
		});
		
		$( '#zoekLink' ).click(function()
		{
			$( '#resultaten' ).hide();
		});
	}
	catch( err )
	{
		alert( 'De website kon niet volledig initialiseren, onze excuses voor het ongemak.\n  Technische details: \n\n  ' + err.message );
	}	
});