|
code
Here is the javascript code
var ggWinSound;
var fontface = "Tahoma";
var fontsize = 2;
soundbit.general = ["Cavatina", "Meditation", "1st Arabesque", "I Dreamed a Dream"];
soundbit.wedding = ["Trumpet Voluntary", "Arrival of the Queen of Sheba", "Flower Duet", "Spring", "Canon", "Someone To Watch Over Me"];
soundbit.type = ["General Repertoire", "Music for Weddings"];
function soundbit(song, p_WinSound, song_type, song_file) {
this.songfile = song_file;
this.gWinSound = ggWinSound;
if (p_WinSound == null)
this.gWinSound = ggWinSound;
else
this.gWinSound = p_WinSound;
if (song_type == 0) {
this.soundbname = soundbit.get_general(song);
} else {
this.soundbname = soundbit.get_wedding(song);
}
this.songtype = soundbit.get_type(song_type);
this.gBGColor = "white";
this.gFGColor = "black";
this.gTextColor = "black";
this.gHeaderColor = "black";
}
soundbit.get_type = soundb_get_type;
soundbit.get_general = soundb_get_general;
soundbit.get_wedding = soundb_get_wedding;
new soundbit();
function soundb_get_type(monthNo) {
return soundbit.type[monthNo];
}
function soundb_get_general(monthNo) {
return soundbit.general[monthNo];
}
function soundb_get_wedding(monthNo) {
return soundbit.wedding[monthNo];
}
soundbit.prototype.show = function() {
var vCode = "";
this.gWinSound.document.open();
// Setup the page...
this.wwrite("<html>");
this.wwrite("<head><title>Sound Bites</title>");
this.wwrite("</head>");
this.wwrite("<body bgcolor=\"#FFFFFF\" " +
"link=\"" + this.gLinkColor + "\" " +
"vlink=\"" + this.gLinkColor + "\" " +
"alink=\"" + this.gLinkColor + "\" " +
"text=\"" + this.gTextColor + "\">");
this.wwrite("<P align=\"center\"> ");
this.wwrite("<OBJECT ID=\"MediaPlayer\" WIDTH=200 HEIGHT=42 ");
this.wwrite("CLASSID=\"CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95\" ");
this.wwrite("STANDBY=\"Loading Windows Media Player components...\" ");
this.wwrite(" TYPE=\"application/x-oleobject\">");
this.wwrite("<PARAM NAME=\"Autostart\" VALUE=\"False\" >");
this.wwrite("<PARAM NAME=\"Filename\" VALUE=\"sounds/" + this.songfile + "\">");
this.wwrite("<EMBED TYPE=\"application/x-mplayer2\" src=\"sounds/" + this.songfile + "\" NAME=\"MediaPlayer\" autostart=0 WIDTH=200 HEIGHT=42></EMBED>");
this.wwrite("</OBJECT>");
this.wwrite("</p>");
this.wwrite("<p align=\"center\"><font face=\"Tahoma\" size=\"4\">" + this.songtype + " </font>");
this.wwrite("<p align=\"center\"><font face=\"Tahoma\" size=\"3\">" + this.soundbname + "</font></p>");
this.wwrite("</body></html>");
this.gWinSound.document.close();
}
soundbit.prototype.wwrite = function(wtext) {
this.gWinSound.document.writeln(wtext);
}
soundbit.prototype.wwriteA = function(wtext) {
this.gWinSound.document.write(wtext);
}
function Build(song, song_type, song_file) {
var p_WinSound = ggWinSound;
gSound = new soundbit(song, p_WinSound, song_type, song_file);
// Customize Window here.
gSound.gBGColor="white";
gSound.gLinkColor="black";
gSound.gTextColor="black";
gSound.gHeaderColor="darkgreen";
gSound.show();
}
function show_song() {
/*
Song
*/
song = arguments[0];
song_type = arguments[1];
song_file = arguments[2];
vWinSound = window.open("", "Soundbites",
"width=250,height=250,status=no,resizable=no,top=200,left=200 ");
vWinSound.opener = self;
ggWinSound = vWinSound;
if (!vWinSound.opener) vWinSound.opener = self;
Build(song, song_type, song_file);
if (!vWinSound.opener) vWinSound.opener = self;
}
|