/**********************************************************
 *             Popup Window Definition Part                *
 *                                                         *
 * To add a popup window, add a string definition below.   *
 * To include the item in the printing friendly page,      *
 * modify the longStr by adding the item to it.            *
 * Don't change anything else.                             *
 **********************************************************/

var htmlOpener = "<html><head><title>Cliff Richard Song Database - Song Details</title>"+
                 "</head><body bgcolor='#DDFFFF'><p>"+
                 "<font face='Arial'>"
var htmlCloser = "</font>"+
                 "</body></html>"

 xSingASongOfFreedomRepriseTokyoJapanOctober1974_popupstats = "<center><b>Barrie Guard Orchestra and Band - <i>Sing A Song Of Freedom (Reprise) (Tokyo, Japan - October 1974)</i></b></center><p><ul><li>RT:1:05<li>RD:October 7 & 8 1974<li>RL:Shinjuku Koseinenkin, Tokyo, Japan<li>WB:Guy Fletcher & Doug Flett<li>PB:Unknown<li>EB:Unknown<li>FB:Cliff Richard (VCL), Brian Lewis (GTR, backing VCL), Kevin Peek (classical GTR), Alan Tarney (bass, backing VCL), Trevor Spencer (drums), Cliff Hall (piano), Bruce Welch (GTR, backing VCL), Barrie Guard (piano, orchestra conductor), The Barrie Guard Orchestra/Shambles Symphonet (orchestra)<p><li>RO:<br><ul><li><u>Japan Tour '74</u> LP album (1975 July 5 — Japan — EMI EMS-67037 38)<li><u>Japan Tour '74</u> CD album (2009 April 6 — UK — EMI 5099926843728)</ul><br>"


/****END OF STRING DEFINITION*****/

 var popupWin
 var wholeWin
  function popup(term)  // write corresponding content to the popup window
  {
    popupWin = window.open("", "puWin",  "width=800,height=620,scrollBars,dependent,resizable");
   popupWin.document.write(htmlOpener);
   term = replaceSubstring(term, "RT:", "Running Time: ");
   term = replaceSubstring(term, "RD:", "Record Date: ");
   term = replaceSubstring(term, "RL:", "Record Location: ");
   term = replaceSubstring(term, "WB:", "Written By: ");
   term = replaceSubstring(term, "PB:", "Produced By: ");
   term = replaceSubstring(term, "FB:", "Performed By: ");
   term = replaceSubstring(term, "EB:", "Engineered By: ");
   term = replaceSubstring(term, "OLD:", "Original Release Date: ");
   term = replaceSubstring(term, "ORO:", "Originally Released On: ");
   term = replaceSubstring(term, "ARO:", "Also Released On: ");
   term = replaceSubstring(term, "RO:", "Released On: ");
   term = replaceSubstring(term, "UK:", "Top UK Chart Position: ");
   term = replaceSubstring(term, "US:", "Top US Chart Position: ");
   term = replaceSubstring(term, "COV:", "Cover Versions: ");
   term = replaceSubstring(term, "MOV:", "Used in the Film or TV Program: ");
   term = replaceSubstring(term, "BBV", "Bev Bevan");
   term = replaceSubstring(term, "RTN", "Richard Tandy");
   term = replaceSubstring(term, "VCL", "vocals");
   term = replaceSubstring(term, "GTR", "guitar");
   term = replaceSubstring(term, "UNEX", "Patrik Guttenbacher, Marc Haines, & Alexander von Petersdorff (1996 <u>Unexpected Messages</u>)");
   term = replaceSubstring(term, "JL", "Jeff Lynne");
   term = replaceSubstring(term, "UNL", "Unreleased");
   popupWin.document.write(term);
   popupWin.document.write(htmlCloser);
   popupWin.document.close();  // close layout stream
   popupWin.focus();  // bring the popup window to the front
  }

  function closeDep() {
  if (popupWin && popupWin.open && !popupWin.closed) popupWin.close();
  if (wholeWin && wholeWin.open && !wholeWin.closed) wholeWin.close();

  }

function replaceSubstring(inputString, fromString, toString) {
   // Goes through the inputString and replaces every occurrence of fromString with toString
   var temp = inputString;
   if (fromString == "") {
      return inputString;
   }
   if (toString.indexOf(fromString) == -1) { // If the string being replaced is not a part of the replacement string (normal situation)
      while (temp.indexOf(fromString) != -1) {
         var toTheLeft = temp.substring(0, temp.indexOf(fromString));
         var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length);
         temp = toTheLeft + toString + toTheRight;
      }
   } else { // String being replaced is part of replacement string (like "+" being replaced with "++") - prevent an infinite loop
      var midStrings = new Array("~", "`", "_", "^", "#");
      var midStringLen = 1;
      var midString = "";
      // Find a string that doesn't exist in the inputString to be used
      // as an "inbetween" string
      while (midString == "") {
         for (var i=0; i < midStrings.length; i++) {
            var tempMidString = "";
            for (var j=0; j < midStringLen; j++) { tempMidString += midStrings[i]; }
            if (fromString.indexOf(tempMidString) == -1) {
               midString = tempMidString;
               i = midStrings.length + 1;
            }
         }
      } // Keep on going until we build an "inbetween" string that doesn't exist
      // Now go through and do two replaces - first, replace the "fromString" with the "inbetween" string
      while (temp.indexOf(fromString) != -1) {
         var toTheLeft = temp.substring(0, temp.indexOf(fromString));
         var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length);
         temp = toTheLeft + midString + toTheRight;
      }
      // Next, replace the "inbetween" string with the "toString"
      while (temp.indexOf(midString) != -1) {
         var toTheLeft = temp.substring(0, temp.indexOf(midString));
         var toTheRight = temp.substring(temp.indexOf(midString)+midString.length, temp.length);
         temp = toTheLeft + toString + toTheRight;
      }
   } // Ends the check to see if the string being replaced is part of the replacement string or not
   return temp; // Send the updated string back to the user
} // Ends the "replaceSubstring" function

/***********************END OF FUNCTION POPUP******************************/

  function printwhole()
  {
        longStr ="<center><h2>Annotated Output for Proc Univariate</h2></center>";
        longStr += demo1 + demo2 + demo3;

        wholeWin = window.open("","wWin", "width=800,height=500,dependent=yes,scrollbars=yes,resizable=yes,toolbar=yes,menubar=yes");
        wholeWin.document.open("text/html","replace");
        wholeWin.document.write(htmlOpener);
        wholeWin.document.write(longStr);
        wholeWin.document.write(htmlCloser);
        wholeWin.document.close();
        wholeWin.focus();}

/*******End of popup window stuff*********/


/***************************Tooltip Part Begins***************************/
  var style = ((NS4 && document.test) || IE4) ? 1 : 0;
  var timerID = null;
  var padding = 3; // < 4 recommended
  var bgcolor = "beige";
  var borWid = 1; // for no border, assign null
  var borCol = "#0000cc";
  var borSty = "solid";
  var str = "<STYLE TYPE='text/css'>";

  str += ".crscrip7 {";
  str += "position: absolute;";
  str += "visibility: hidden;";
  str += "left: 0; top: 0;";

  if (borWid > 0) { // if a border is specified

  str += "border-width: " + borWid + ";";
  str += "border-color: " + borCol + ";";
  str += "border-style: " + borSty + ";";

}

  if (NS4) {

  if (borWid > 0 && padding <= 3) {
    str += "padding: 0;";
    str += "layer-background-color: " + bgcolor + ";"; }

    else if (borWid > 0 && padding > 3) {
    str += "padding: " + (padding - 3) + ";";
    str += "background-color: " + bgcolor + ";";

  } else if (borWid == 0) {
    str += "padding: " + padding + ";";
    str += "layer-background-color: " + bgcolor + ";";

  }

} else {
  str += "padding: " + padding + ";";
  str += "background-color: " + bgcolor + ";";
}

  str += "}";
  str += "</STYLE>";


  if (style) {
  document.write(str);
  if (NS4) window.onload = init;
}

/**************************************************
*        Making your tooltip text here            *
* This is the only place that need to be modified.*
* The first argument is the name of the tooltip.  *
* The second argument is the width and last one   *
* is the content of the tooltip.                  *
**************************************************/


