$(document).ready(function() { 
        
		$('ul.topnav').superfish({ 
            delay:       800,                            
            animation:   {height:'show'}, 
            speed:       '700'                        
        });
		
		$('ul.intranet-nav').superfish({ 
            delay:       800,                            
            animation:   {height:'show'}, 
            speed:       '700'                        
        });
		
		if ( printable ) {
				
				/*
				setTimeout( function() {
						window.print();		
				}, 1000 );
				*/
				
				function check_flashes( limit ) {
					if ( limit == undefined ) {
						limit = 0;	
					}
					
					
						var all_flashes_loaded = true;
						for ( var flash_id in flashes ) {
							if ( flashes[ flash_id ] == false ) {
								all_flashes_loaded = false;
								break;				
							} else if ( flashes[ flash_id ].IsPlaying() ){
								all_flashes_loaded = false;
								break;				
							}
						}
						
						if ( all_flashes_loaded ) {
							window.print();
						} else if ( limit < 10 ) {
							limit++;
							setTimeout( function() {
								check_flashes( limit );	
							}, 500 );
						}
				}
				
				check_flashes();				
		}
}); 
function setZ(elem, newZ){
    elem.css('z-index', newZ);
}

function print_document( url ) {
	window.open( url );
}

function musicPlayerEvent (ident) {
    if (ident == 'open') {
        setZ($('#music'), '102');
    } else if (ident == 'close') {
        setZ($('#music'), '101');
    }
}

