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

    //initialize menu
    if ( $( 'nav' ) )
        var frontendDropDownMenu = new MenuMatic( { 'orientation' : 'vertical' } );

    //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' ) );
        });
    });

    //set search value
    if ( $( 'searchKeywords' ) ) {
        var searchKeywords = $( 'searchKeywords' );
        var defaultText = 'Zoeken...';
        var defaultColor = '#939393';
        searchKeywords.set( 'value', defaultText );
        searchKeywords.setStyle( 'color', defaultColor );
        searchKeywords.addEvent( 'focus', function() {
            if ( searchKeywords.get( 'value' ) == defaultText ) {
                searchKeywords.set( 'value', '' );
                searchKeywords.setStyle( 'color', '#000' );
            }
        });
        searchKeywords.addEvent( 'blur', function() {
            if ( searchKeywords.get( 'value' ) == '' ) {
                searchKeywords.set( 'value', defaultText );
                searchKeywords.setStyle( 'color', defaultColor );
            }
        });
    }
});
