function URLDecode (encodedString) {
  var output = encodedString;
  var binVal, thisString;
  var myregexp = /(%[^%]{2})/;
  while ((match = myregexp.exec(output)) != null
             && match.length > 1
             && match[1] != '') {
    binVal = parseInt(match[1].substr(1),16);
    thisString = String.fromCharCode(binVal);
    output = output.replace(match[1], thisString);
  }
  return output;
}

function openFlash(htmlFile,htmlWidth,htmlHeight)
{
  str = 'resizable=0,toolbar=0,menubar=0,';
  str = str + 'scrollbars=0,status=0,location=0,directory=0,width=350,height=200';

  version=Math.round(parseFloat(navigator.appVersion) * 1000);

  if(navigator.appName.indexOf("Konqueror")!=-1) // konqueror
  {
    htmlWidth+=5;
    htmlHeight+=105;
  }

  if(navigator.appName.indexOf("Netscape")!=-1)
  {
    if(version>=5000)
    {
      if(navigator.appVersion.indexOf("Mac")!=-1) // Netscape 6+ on Mac
      {
        htmlHeight+=5;
      }
    }
  }
	
  if(navigator.appName.indexOf("Microsoft")!=-1)
  {
	if(navigator.appVersion.indexOf("Mac")!=-1) // IE on Mac
	{
	 htmlWidth -= 11;
	 htmlHeight -= 11;
	}
  }

  var strTitle;
  var pos = htmlFile.lastIndexOf('/');
  
  if(pos != -1)
  	strTitle = htmlFile.substr(pos + 1);
  else
  	strTitle = htmlFile;
  
  // window.open doesn't like spaces in the sName
  // Might be related to this:
	// Reference: http://thedesignspace.net/MT2archives/000483.html
  strTitle = URLDecode(strTitle);
  strTitle = strTitle.replace(/ /g, "");

  strTitle = strTitle.replace(/\./g, "");
  
  window.open(htmlFile, strTitle,'width='+htmlWidth+',height='+htmlHeight+',top=10,left=20');
}
