function ws_panel_BuildSystemDiagram(aLang, aCurProduct)
{
  var lRet = "";
  
  lRet += ws_panel_BuildDemo(aLang, "images/workflow.swf", 800, 600)
  
  lRet += "<br /><br />";
  lRet += "<span id='waitmsg' style='font-family:Arial; font-size:10px; color:#ffffff'>&nbsp;</span>";
  
  return lRet;
}

// ----------------------------------------------------------------------------
function ws_panel_BuildDemo(aLang, aFlashFile, aWidth, aHeight)
{
  var lRet = "";
  
  lRet += "<object width=\"" + aWidth + "\" height=\"" + aHeight + "\" align=\"top\" id=\"objDemo\" data=\"" + aFlashFile + "\" type=\"application/x-shockwave-flash\" style=\"border-top:solid 1px #999999; border-left:solid 1px #999999; border-right:solid 1px #444444; border-bottom:solid 1px #444444; background-color:#333333\">";
    lRet += "<param name=\"movie\" value=\"" + aFlashFile + "\" />";
    lRet += "<param name=\"quality\" value=\"high\" />";
    lRet += "<param name=\"pluginspage\" value=\"https://www.macromedia.com/go/getflashplayer\" />";
    lRet += "<param name=\"play\" value=\"true\" />";
    lRet += "<param name=\"loop\" value=\"false\" />";
    lRet += "<param name=\"scale\" value=\"exactfit\" />";
    lRet += "<param name=\"wmode\" value=\"transparent\" />";
    lRet += "<param name=\"devicefont\" value=\"false\" />";
    lRet += "<param name=\"bgcolor\" value=\"#000000\" />";
    lRet += "<param name=\"menu\" value=\"false\" />";
    lRet += "<param name=\"allowScriptAccess\" value=\"sameDomain\" />";
  lRet += "</object>";
  
  lRet += "<br /><br />";
  lRet += "<input type=\"button\" value=\"Close\" onclick=\"ws_panel_ClearContent(); ws_panel_HideHiddenPanel();\" /><br />";
  
  var lMsg = "Loading, please wait ...";
  if(aLang == "FR")
  {
    lMsg = "Chargement, un instant ...";
  }
  else if(aLang == "ES")
  {
    lMsg = "Cargando, espere por favor ...";
  }
  lRet += "<span id='waitmsg' style='font-family:Arial; font-size:10px; color:#ffffff'>" + lMsg + "</span>";
  
  return lRet;
}

// ----------------------------------------------------------------------------
function ws_panel_ShowHiddenPanel()
{
  var lPanel = window.document.getElementById("pnlHidden");
  if(lPanel)
  {
    lPanel.style.visibility = "visible";
  }
}

// ----------------------------------------------------------------------------
function ws_panel_HideHiddenPanel()
{
  var lPanel = window.document.getElementById("pnlHidden");
  if(lPanel)
  {
    lPanel.style.visibility = "hidden";
  }
}

// ----------------------------------------------------------------------------
function ws_panel_SetHiddenPanelContent(aContent)
{
  var lHeight = ws_panel_GetWindowInnerHeight();
  
  var lObject = null;
  
  lObject = window.document.getElementById("pnlHidden");
  if(lObject)
  {
    lObject.style.height = lHeight + "px";
  }
  
  lObject = window.document.getElementById("tblHidden");
  if(lObject)
  {
    lObject.style.height = lHeight + "px";
  }
  
  lObject = window.document.getElementById("tblHiddenContent");
  if(lObject)
  {
    lObject.innerHTML = aContent;
  }
  
  window.setTimeout(ws_HideWaitMsg, 8000);
}

// ----------------------------------------------------------------------------
function ws_HideWaitMsg()
{
  var lSpan = window.document.getElementById("waitmsg");
  if(lSpan)
  {
    lSpan.innerHTML = "&nbsp;";
  }
}

// ----------------------------------------------------------------------------
function ws_panel_ClearContent()
{
  var lObject = window.document.getElementById("tblHiddenContent");
  if(lObject)
  {
    lObject.innerHTML = "&nbsp;";
  }
}

// ----------------------------------------------------------------------------
function ws_panel_GetWindowInnerHeight()
{
  var myHeight = 0;
  
  if( typeof( window.innerWidth ) == 'number' )
  {
    // Non-IE
    myHeight = window.innerHeight;
  }
  else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
  {
    // IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  }
  else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
  {
    // IE 4 compatible
    myHeight = document.body.clientHeight;
  }
  
  return myHeight;
}

// ----------------------------------------------------------------------------
function ws_panel_GetWindowInnerWidth()
{
  var myWidth = 0;
  
  if( typeof( window.innerWidth ) == 'number' )
  {
    // Non-IE
    myWidth = window.innerWidth;
  }
  else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
  {
    // IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  }
  else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
  {
    // IE 4 compatible
    myWidth = document.body.clientWidth;
  }
  
  return myWidth;
}
