function getVMCgotoF() {
    return '<scr' + 'ipt src="http:\/\/www.virtualmuseum.ca\/Logo_Script\/francais.js">' + '<\/script>';
}

function ImagePopupFrench(LargeImage,AltText) {

AltText = replaceSubstring(AltText,"@01","&#8220;")
AltText = replaceSubstring(AltText,"@02","&#8221;")
AltText = replaceSubstring(AltText,"@03","&#8211;")
AltText = replaceSubstring(AltText,"@04","&ccedil;")
AltText = replaceSubstring(AltText,"@05","&eacute;")
AltText = replaceSubstring(AltText,"@06","&#8217;")
AltText = replaceSubstring(AltText,"@07","&ecirc;")
AltText = replaceSubstring(AltText,"@08","&egrave;")
AltText = replaceSubstring(AltText,"@09","&agrave;")
AltText = replaceSubstring(AltText,"@10","&acirc;")
AltText = replaceSubstring(AltText,"@11","&Eacute;")
AltText = replaceSubstring(AltText,"@12","&ocirc;")

windowprops = "left=50,top=50,width=465,height=480";

text = "<html><head><title>Traditions vivantes</title><link rel='stylesheet' href='../naig.css' type='text/css'></head><body bgcolor='#CCD0C1' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0' onBlur='self.close()'>";
text += "<center><table><tr>";
text += "<td align='center' class='default'><img src='" + LargeImage + "' alt='" + AltText + "' border='1' vspace='2'>";
text += "<br>" + AltText + "</td>";
text += "<td><img src='Images/spacer.gif' width='1' height='465'></td>";
text += "</tr></table>";
text += "</center></body></html>";

preview = window.open("", "preview", windowprops);
preview.document.open();
preview.document.write(text);
preview.document.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

