var timer = null;
var link = false;

$(document).ready( function( ) {
    
    $( '#searchbutton' ).click( function( ) {
        
        $(this).parent().parent().submit();
        
    } );
    
    $('#languages').css('left',$('#lang_dropdown').position().left);
    
    $( '#lang_dropdown, #languages' ).hover( function( ) { 
        
        clearTimeout( timer );
        $( '#languages' ).fadeIn( );
        $( '#lang_dropdown' ).parent().addClass( 'active' );
        
    }, function( ) {
        
        timer = setTimeout( function( ) {
            $( '#languages' ).hide( );
            $( '#lang_dropdown' ).parent().removeClass( 'active' );
        }, 500 );
        
    } );
    
    $( '#languages li' ).hover( function( ) {
        
        if( $(this).hasClass( 'clear' ) ) return;
        
        $(this).addClass( 'hover' );
        
    }, function( ) {
        
        if( $(this).hasClass( 'clear' ) ) return;
        
        $(this).removeClass( 'hover' );
        
    } );
    
    $( '#languages li:not(a)' ).click( function( ) {
        
        document.location.href = $(this).find( 'a' ).attr( 'href' );
                
    } );

} );

    $(function() {
        $("div#slide_controller").jFlow({
            slides: "#referentie",
            width: "365px",
            height: "250px",
            duration: 600
        });
    });

Cufon.replace('.cufon');
