// Copyright 04 Nov 1998, Cavalry Outpost Publications.

// This program loads and plays an audio file in a background mode which
// continues to play after leaving (unLoading) the WebSite that started
// the audio file. The playing may be stopped by "clicking" on the [Close]
// button located on the "Pop Up Window" or the [Stop] button located in 
// main window.

// *********************************************************************
// **********     Program Name = Music_RV.js Rev 03.11.29     **********
// **********   "Ride of the Valkyries - Franz Wagner 1870    **********
// **********          "Theme song of Apolalypse Now"         **********
// *********************************************************************

// 1.0 TURN ON AUDIO MODULE

function Turn_On_Audio() {

// 1.1 Define Screen Coordinates

        var ScrollbarWidth = 22;
        var AudioFrameWidth = 6;
        var xMax = screen.availWidth;

// 1.2 Define Screen and AudioParameters

        var AudioWidth = 215, AudioHeight = 100;
        var xOffset = ((xMax - ScrollbarWidth) - (AudioWidth + 2*AudioFrameWidth))/2;
        var AudioParameters = 'width='+AudioWidth+',height='+AudioHeight+',screenX='+xOffset+',left='+xOffset+',screenY=0,top=0';

// 1.3 Open Remote Audio Window

        Audio_On = window.open('','Remote_Audio_Control', AudioParameters);
        Audio_On.document.open();                     
        Audio_On.document.write('<HTML>');
        Audio_On.document.write('<HEAD><TITLE>Remote Audio Control</TITLE></HEAD>');
        Audio_On.document.write('<BODY BACKGROUND="bkgd_rv.gif" BGCOLOR="AFFFFF" TEXT="000000">');
        Audio_On.document.write('<CENTER>');

// 1.4 Insert Animated GIF with the "Title of the Song" and Message Image here
        Audio_On.document.write('<IMG SRC="title_rv.gif" WIDTH="195" HEIGHT="20" HSPACE="0" VSPACE="0"<BR>');

// 1.5 Insert WaveFront GIFs, separated by an "Transparent" GIF here
        Audio_On.document.write('<IMG SRC="sound_l.gif" WIDTH="75" HEIGHT="50" HSPACE="0" VSPACE="0">');
        Audio_On.document.write('<IMG SRC="tabspace.gif" WIDTH="45" HEIGHT="50" HSPACE="0" VSPACE="0">');
        Audio_On.document.write('<IMG SRC="sound_r.gif" WIDTH="75" HEIGHT="50" HSPACE="0" VSPACE="0">');
        Audio_On.document.write('<BR CLEAR="ALL">');

// 1.6 Insert "Transparent" GIF to protect "BackGround" Image
        Audio_On.document.write('<IMG SRC="tabspace.gif" WIDTH="195" HEIGHT="22" HSPACE="0" VSPACE="0"');

// 1.7 Start Load Audio File (specify file name, two places)
        Audio_On.document.write('<NOEMDED><BGSOUND SRC="music_rv.mid" LOOP="INFINITE"><\/NOEMDED>');
        if(navigator.appName != "Microsoft Internet Explorer") {
                Audio_On.document.write('<EMBED SRC="music_rv.mid" AUTOSTART="TRUE" HIDDEN="TRUE" LOOP="TRUE"><\/EMBED>'); 
        }

// 1.8 End Load Audio File
        Audio_On.document.write('</BODY></HTML>');
        Audio_On.document.close();
}

// 2.0 TURN OFF AUDIO MODULE

function Turn_Off_Audio() {
        var sLocType
        if (Audio_On) {
                if (!Audio_On.closed) {
                        sLocType = typeof Audio_On.location;
                        if (sLocType == 'object') {
                        Audio_On.close();
                        }
                }
        }
}

