var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
jsVersion = 1.1;
// JavaScript helper required to detect Flash Player PlugIn version information
function JSGetSwfVer(){
  // NS/Opera version >= 3 check for Flash plugin in plugin array
  var flashVer = 1;
  if (navigator.plugins != null && navigator.plugins.length > 0) {
    if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
      var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
          var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
      descArray = flashDescription.split(" ");
      tempArrayMajor = descArray[2].split(".");
      versionMajor = tempArrayMajor[0];
      versionMinor = tempArrayMajor[1];
      if ( descArray[3] != "" ) {
        tempArrayMinor = descArray[3].split("r");
      } else {
        tempArrayMinor = descArray[4].split("r");
      }
          versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
            flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
        } else {
      flashVer = -1;
    }
  }

  return flashVer;
}


function flashInstalled()
{
  versionStr = JSGetSwfVer();
  if (versionStr == -1 ) return false;
  return true;
}

function replaceFlash(id, width, color)
{
  if(!flashInstalled()) return;
  var title = document.getElementById(id);
  if(title == 'undefined') return;
  //title.style.display = 'none';
  var txt = title.innerHTML.toUpperCase();
  txt = txt.split("&amp;").join("%26");

  var nodeFlash = document.createElement("embed");
  nodeFlash.setAttribute("id", title.id);
  nodeFlash.setAttribute("src", '/design/main/images/swf/font.swf');
  var sVars="txt=" + txt + "&textsize=23&w=" + width + "&h=35&id=92&textalign=left&textcolor=" + color;
  nodeFlash.setAttribute("flashvars", sVars);
  nodeFlash.setAttribute("type", "application/x-shockwave-flash");
  nodeFlash.setAttribute("pluginspage", "http://www.macromedia.com/go/getflashplayer");
  nodeFlash.setAttribute("wmode", 'transparent');
  nodeFlash.setAttribute("quality", 'best');
  nodeFlash.setAttribute("width", width);
  nodeFlash.setAttribute("height", 20);

  title.innerHTML = '';
  title.appendChild(nodeFlash);
}
