// stop BackgroundImageCache voor IE				
try	{ document.execCommand("BackgroundImageCache", false, true); } catch(e) { }


Cufon.replace("h1, h2, #content .header span");

/**
 * 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") );
	});
	
	// Automatisch textareas vergroten
    $("form").each(function()
    {
        if( $('textarea', this).length == 1 ) {
            $('textarea', this).css({ display: 'block' }).autoResize().hide().keydown().show();
        }
    });


    $("#zijbalk .nieuws li").hoverClick();


    (function()
    {
        var speed = 1200,
            interval = 4000,
            zIndex = 1,
            container = $('#content .header'),
            walkInterval;

        if($("li", container).length === 1)
            return false;

        // hide other items
        $("li:not(:first)", container).hide();

        // walk items
        function cycle()
        {
            var current = $("li:visible", container);
            var next = $("li:visible + li", container);

            if(!next.length)
                next = $("li:first", container);

            next.css({ opacity: 0, zIndex: zIndex++ }).show().animate({ opacity: 1 }, speed, function()
            {
                current.hide();
            });
        }

        // start walking the items
        walkInterval = setInterval(cycle, interval);
    })();

});
