function writeFlash(id,theFile,align,width,height,bgColor) {
  document.getElementById(id).innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ' +
          'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" ' +
          'width="' + width + '" height="' + height + '" wmode="transparent" id="' + theFile  + '" align="' +
          align + '">' +
          '<param name="wmode" value="transparent">' +
          '<param name="allowScriptAccess" value="sameDomain" />' +
          '<param name="allowFullScreen" value="false" />' +
          '<param name="movie" value="' + theFile + '.swf" />' +
          '<param name="loop" value="false" />' +
          '<param name="menu" value="false" />' +
          '<param name="quality" value="high" />' +
          '<param name="scale" value="showall" />' +
          '<param name="salign" value="m" />' +
          '<param name="bgcolor" value="' + bgColor + '" />' +
          '<embed src="' + theFile + '.swf" loop="false" menu="false" quality="high" ' +
          'scale="scale" salign="m" width="' + width + '" height="' + height + '" wmode="transparent" ' +
          'name="' + theFile + '" ' + 'align="' + align + '" allowScriptAccess="sameDomain" ' +
          'allowFullScreen="false" type="application/x-shockwave-flash" bgcolor="' + bgColor + '" ' +
          'pluginspage="http://www.macromedia.com/go/getflashplayer" />' +
          '</object>';
}
function showGesFin(blockPreFix,maxNum,num2show) {
  for (i=1; i<=maxNum; i++) {
    var boxid = blockPreFix + i.toString();
    var theblock = document.getElementById(boxid);
    if (theblock.style.display == "")
      { theblock.style.display = "none"; }
    if (i == num2show)
      { theblock.style.display  = ""; fadeMsg(boxid); }
  }
}

function showHoverBlock(blockPreFix,maxNum,num2show) {
  var colors = new Array();
  colors[0] = '#00246A';
  colors[1] = '#003895';
  colors[2] = '#0033A9';
  colors[3] = '#1A75CE';
  colors[4] = '#5889D6';
  for (i=1; i<=maxNum; i++) {
    var boxid = blockPreFix + i.toString();
    var tabid = 'tab' + i.toString();
    var theblock = document.getElementById(boxid);
    var theTab   = document.getElementById(tabid);
    //var theBox   = document.getElementById('textBox');
    if (theblock.style.display == "")
      { theblock.style.display = "none"; }
    if (i == num2show) {
      theTab.style.color = "#404040";
      theTab.style.backgroundColor = "white";
      theblock.style.display  = "";
    }
    else {
       theTab.style.color = "white";
       theTab.style.backgroundColor = colors[i-1];
    }
  }
  return(true);
}

function fadeMsg(theid) {
    fadeElem = document.getElementById(theid);
    setOpacity(fadeElem, 0);
    fadeStep = 0;
    fadeIn();
}

function fadeIn() {
    if (fadeStep > fadeSteps)
       { return; }
    setOpacity(fadeElem, (fadeStep/fadeSteps));
    fadeStep++;
    window.setTimeout('fadeIn()', fadeDelay);
}

function setOpacity( el, opacity) {
    if (el.style.opacity != undefined)
       { el.style.opacity = opacity; }
    else if ( el.style.MozOpacity != undefined)
       { el.style.MozOpacity = opacity; }
    else if ( el.style.filter != undefined)
       { el.style.filter="alpha(opacity=" + Math.round(opacity * 100) + ")"; }
}
function showMenu(id,symbol) {
  var theblock = document.getElementById(id);
  var thesymbol = document.getElementById(symbol);
  if (theblock.style.display == "") {
    theblock.style.display = "none";
    thesymbol.innerHTML = '+';
  }
  else {
    theblock.style.display = "";
    thesymbol.innerHTML = '&nbsp;-';
  }
  return;
}
function validate_required(field,alerttxt) {
  with (field) {
    if (value==null||value=="")
      { alert(alerttxt); return false; }
    else
      { return true }
  }
}
