// JavaScript compositor // --------------------- // Compositing 2 files // ----------------------------------------------------------- // File 1 // music.js var musicOnloadComplete = false; function music( isOn ) { // Show or hide the player as appropriate if ( isOn ) { // If page only just loaded and music is already switched on, don't do anything if ( !musicOnloadComplete ) { musicOnloadComplete = true; document.getElementById( 'musicCtrl1' ).style.fontWeight = 'bold'; return; } // Create music player HTML html = '' + '' + '' + '' + '' + ''; } else html = ''; document.getElementById( 'music' ).innerHTML = html; // Embolden the appropriate ON/OFF control activeControl = isOn; inactiveControl = Math.abs( isOn - 1 ); document.getElementById( 'musicCtrl' + activeControl ).style.fontWeight = 'bold'; document.getElementById( 'musicCtrl' + inactiveControl ).style.fontWeight = 'normal'; // If user clicked a selection, send request to server to update status if ( musicOnloadComplete ) { hIframe = document.getElementById( 'musicPref' ); iframeLocation = '/audio/setPref.php?mode=' + isOn; if ( hIframe.contentDocument ) hIframe.contentDocument.location.href = iframeLocation; else document.frames[ 'musicPref' ].document.location.href = iframeLocation; } musicOnloadComplete = true; } // ----------------------------------------------------------- // File 2 // fader.js.php var hInterval; var colourID; var msgID; var hFader; var message = new Array( '

CHECK IT OUT

\n\n

New Video Page

\n\n

in the Gallery section - this is the 1st of many videos which we will be uploading soon...

', '

BoBo\' New

\n\n

Latin Steakhouse & Grill Menu NOW
AVAILABLE ONLINE

\n\n

Click here to view it now!

', '

BoBo\'s New

\n\n

Cocktail Menu

\n\n

Avaialable on Line

\n\n

Cocktail Menu.pdf

' ); function initFader() { msgID = 0; hFader = document.getElementById( 'fader' ); fadeInStart(); } function fadeInStart() { hFader.innerHTML = message[ msgID ]; colourID = 0; hInterval = setInterval( fadeInDo, 25 ); } function fadeInDo() { updateOpacity(); if ( colourID == 10 ) { clearInterval( hInterval ); setTimeout( fadeOutStart, 10000 ); } else colourID++; } function fadeOutStart() { hInterval = setInterval( fadeOutDo, 25 ); } function fadeOutDo() { updateOpacity(); if ( colourID == 0 ) { clearInterval( hInterval ); msgID++; if ( msgID == message.length ) msgID = 0; fadeInStart(); } else colourID--; } function updateOpacity() { cidStr = new String( colourID * 10 ); if ( document.all ) hFader.style.filter = 'alpha( opacity=' + cidStr + ' )'; else hFader.style.MozOpacity = colourID / 10 - ( 0.1 * (colourID==10)); }