window.addEvent('domready', function() {

    //initialize menu
    if ( $( 'nav' ) )
        var frontendDropDownMenu = new MenuMatic();

    //create xhtml valid new window from hyperlink locations
    //usage example: <a href="" class="_blank"></a>
    $$( '_blank' ).each( function( href ) {
        href.addEvent( 'click', function ( element ) {
            element.stop();
            window.open( href.get( 'href' ) );
        });
    });

    var searchInputQ = $('searchInputQ');
    var defautlSearchInput = 'Type hier uw zoekterm...';
    searchInputQ.set( 'value', defautlSearchInput );
    if ( searchInputQ ) {
        searchInputQ.addEvent( 'focus', function( element ) {
            myFx = new Fx.Morph( searchInputQ, { 'duration' : 300 } );
            myFx.start( { 'width' : [210, 350] } );
            if ( searchInputQ.get( 'value' ) == defautlSearchInput )
                searchInputQ.set( 'value', '' );
        });
        searchInputQ.addEvent( 'blur', function( element ) {
            myFx = new Fx.Morph( searchInputQ, { 'duration' : 300 } );
            myFx.start( { 'width' : [350, 210] } );
            if ( !searchInputQ.get( 'value' ) )
                searchInputQ.set( 'value', defautlSearchInput );
        });
    }
});
