// stop BackgroundImageCache voor IE				
try	{ document.execCommand("BackgroundImageCache", false, true); } catch(e) { }

/**
 * variabelen met jQuery met een $ beginnen!!!
 */
$(function()
{
	/* submenu effectje en timeout */
	Menu.apply("#menu > li");
	
	// default value bij formulieren
	$("input:text[title], textarea[title]").each(function() { 
		$(this).defaultvalue( $(this).attr("title") );
	});
	
	// Hovers
	$("#zijbalk-links .nieuws div.item,#zijbalk-rechts .projecten ul li,#content .projecten ul.overzicht li,#nieuwsoverzicht li").hoverClick()

	// Automatisch textareas vergroten
    $("form").each(function()
    {
        if( $('textarea', this).length == 1 )
        {
            $('textarea', this).css({ display: 'block' }).autoResize().hide().keydown().show();
        }
    });

    // Zoekfunctie check
    $("#zijbalk-rechts .zoeken form").submit( function() {
        if ( $("input.defaultvalue", this).val() == ( $("input.defaultvalue", this).attr('title') || "" ) )
        {
            alert('Voer een zoekwoord in om te zoeken.');
            return false;
        }
    } );

    // form focus li
    $("input, select, textarea", ".formmodule form ul li")
            .bind( 'focus', function() { $(this).closest('li').addClass('focus'); } )
            .bind( 'blur', function() { $(this).closest('li').removeClass('focus'); } );

    try {
        $("input:focus, select:focus, textarea:focus", ".formmodule form ul li").trigger('focus');
    } catch(ex) {}

	// Slideshow
    $('.slideshow').cycle({
		fx: 'fade'
	});
});
