var track=0;
var mpwindow = new Object;
mpwindow.closed = true;
var URL=window.location.href;
dpath=""
if (URL.lastIndexOf("/act/")!=-1) {dpath=URL.substring(0,URL.lastIndexOf("/act/"))+"/act/xxxxxxxx/";}
if (URL.lastIndexOf("/asp/")!=-1) {dpath=URL.substring(0,URL.lastIndexOf("/asp/"))+"/act/xxxxxxxx/";}
if (URL.lastIndexOf("/songwriter/")!=-1) {dpath=URL.substring(0,URL.lastIndexOf("/songwriter/"))+"/act/xxxxxxxx/";}

function mplayer(trk) {
 track = trk;
 if (mpwindow.closed==false) {mpwindow.focus(); mpwindow.location.reload(true);}
 if (mpwindow.closed) {
 xpos=screen.width/2-169; xpos=0;
 ypos=screen.height/2-159; ypos=0;
mpwindow=window.open("../../scripts/mplayer.htm","Showcase","height=308,width=338,top="+ypos+",left="+xpos+",toolbar=no,status=no,menubar=no,scrollbars=no,resizeable=no");}}

function mpwindowclose() {if (mpwindow.closed==false) mpwindow.close();}

function header(artistesname) {header0(); header1(artistesname);}

function header0() {
 headercommon();
 document.write('<TABLE WIDTH=80% CELLPADDING=3 CELLSPACING=2>');}

function headermms(artistesname) {
 headercommon(); 
 document.write('<TABLE WIDTH=80% BORDER=0 CELLPADDING=8 CELLSPACING=0>');
 header1(artistesname);}

function headercommon() {
 document.write('<FONT SIZE=5 COLOR=#0099FF><A NAME=mms><\/A><B>MULTI-MEDIA SHOWCASE'+
 '<\/B><\/FONT><BR><FONT SIZE=1 COLOR=#FFFFFF>REQUIRES ... WINDOWS MEDIA PLAYER version 6.x or better'+
 '<\/FONT><BR>&nbsp;<BR>');}

function header1(artistesname) {
document.write('<TR><TD COLSPAN=2 ALIGN=CENTER BGCOLOR=#333366><FONT SIZE=2><B>');
if (artistesname.substring(0,1)=="#") {document.write('<FONT SIZE=5><A HREF=../'+artistesname.substring(artistesname.lastIndexOf("#")+1)+'/index.htm>'+artistesname.substring(1,artistesname.lastIndexOf("#"))+'<\/A><\/FONT>');}
if (artistesname.substring(0,1)=="~") {document.write('<FONT SIZE=5><A HREF=../../songwriter/'+artistesname.substring(artistesname.lastIndexOf("#")+1)+'/index.htm>'+artistesname.substring(1,artistesname.lastIndexOf("#"))+'<\/A><\/FONT>');}
if (artistesname.substring(0,1)!="#" && artistesname.substring(0,1)!="~") {document.write('<FONT COLOR=#FF95CA>'+artistesname+'<\/FONT>');}
document.write('<\/B><\/FONT><BR><FONT SIZE=1>Click on a Title below.<\/FONT>');}

function txtbox(txt,colour) {
 if (txt=="") {txt="&nbsp"};
 if (colour=="") {document.write('<TR>');}
 else {document.write('<TR BGCOLOR="#'+colour+'">');}
 document.write('<TD COLSPAN=2 ALIGN=CENTER WIDTH=80%>'+
 '<FONT SIZE=2>'+txt+'<\/FONT><\/TD><\/TR>');}

function separator() {
 txtbox("",""); txtbox("","");}

function tracks1(filename1,title1) {
 document.write('<TR BGCOLOR=#666666><TD COLSPAN=2 ALIGN=CENTER WIDTH=80%><FONT SIZE=2>'+
 '<A HREF=# ONCLICK="mplayer('+filename1+'); return false">'+title1+'<\/A><\/FONT><\/TD><\/TR>');}

function tracks2(filenameleft,titleleft,filenameright,titleright) {
 if (titleright=="") {titleright="&nbsp"};
 document.write('<TR BGCOLOR=#666666><TD WIDTH=50%><FONT SIZE=2>'+
 '<A HREF=# ONCLICK="mplayer('+filenameleft+'); return false">'+titleleft+'<\/A><\/FONT><\/TD><TD WIDTH=50%>'+
 '<FONT SIZE=2><A HREF=# ONCLICK="mplayer('+filenameright+'); return false">'+titleright+'<\/A><\/FONT><\/TD><\/TR>');}

function footer() {
 document.write('<\/TABLE><P><FONT SIZE=2 COLOR=#FFFF99>'+
 'If you have any problems playing the above Media Files,<BR><A HREF=../../mplayer2.htm>'+
 'Click here<\/A> to download the Latest Windows Media Player from Microsoft.<\/FONT><\/P><\/TD><\/TR><TR>');}

function footernomedia() {
 document.write('<\/TABLE><P>&nbsp<\/P><\/TD><\/TR><TR>');}
