//
// score.js
//
// Used to insert and manage multiple Myriad scores
// (using the plugin) using just one plugin window
// (so you need to scroll down forever), when the
// user is using IE or Opera.

//place the first score on the page. Subsequent scores
//will replace this one.
//
function insertScore(scoreName)
{
  template = ' <div id="Myriad" style="height:700px; width:525px; padding-left: 5px">' +
      ' <object classid="CLSID:07000E2B-6AAD-497D-8E5B-5976560AD429"' +
                 ' border="0"' +
                 ' height="700"' +
                 ' width="525"' +
                 ' codebase="http:\/\/www.myriad-online.com\/cgi-bin\/mmplug.pl">' +
                 ' <param name="look" value="moon" \/>' +
                 ' <param name="src" value="' + scoreName + '" \/>' +
                 ' <param name="height" value="700" \/>' +
                 ' <param name="width" value="525" \/>' +
                 ' <param name="type" value="application\/x-myriad-music" \/>' +
                 ' <param name="pluginspage" value="http:\/\/www.myriad-online.com\/cgi-bin\/mmplug.pl" \/>' +
                 ' <param name="save" value="off" \/>' +
                 ' <param name="zoom" value="off" \/>' +
                 ' <param name="transp" value="off" \/>' +
                 ' <param name="fullscreen" value="off" \/>' +
                 ' <param name="purge" value="on" \/>' +
      ' <\/object><\/div>';
 
  //doesn't work if you just start with the div only. You have to put *everything* in first with innerHTML. 
  //template = '<div id="Myriad" style="height:700px; width:525px; padding-left: 5px"><b>loading</b><\/div>';
  //also doesn't work if you try to just replace the "src" param tag by giving it an ID. Have to replace
  //everything. IE is buggy folks. outerHTML is tiny less buggier than innerHTML.
  
  OpenWindow.document.writeln(template);

}//end insertScore()

//
// openPage(scoreName): load the score called scoreName into a new window
//
function openPage(scoreName)
{
//  OpenWindow=window.open("", "newwin", config="height=730, width=555, toolbar=no, scrollbars=no, resizable=no, menubar=no, location=no, directories=no, status=no");
  OpenWindow=window.open("", "", config="height=730, width=555, toolbar=no, scrollbars=no, resizable=no, menubar=no, location=no, directories=no, status=no");
  OpenWindow.document.write("<TITLE>Mike Matloff -- Music -- " + scoreName + "</TITLE>")
  OpenWindow.document.write("<BODY>")
  insertScore(scoreName);
  OpenWindow.document.write("</BODY>")
  OpenWindow.document.write("</HTML>")
  OpenWindow.document.close()
  self.name="main"
  OpenWindow.document.focus();
}

//
// replacePage(scoreName): load the score called scoreName into an existing window
//
function replacePage(scoreName)
{
  newwin.close();
  openPage(scorename);
}

