var CurrentItem;

function RollOver(MenuItem)
{
  el = document.getElementById(MenuItem);
  if (el != null)
  {
    if (el != CurrentItem)
    {
      if (CurrentItem != null)
      {
        if (CurrentItem.className == "TopMenuItemActive")
          CurrentItem.style.backgroundImage = "url(/grf/topmenu-background_.gif)";
        else
          CurrentItem.style.backgroundImage = "url(/grf/topmenu-background.gif)";
      }

      CurrentItem = el;
    }

    el.style.backgroundImage = "url(/grf/topmenu-background_rollover.gif)";
  }
}

function RollOut()
{
  if (CurrentItem != null)
  {
    if (CurrentItem.className == "TopMenuItemActive")
      CurrentItem.style.backgroundImage = "url(/grf/topmenu-background_.gif)";
    else
      CurrentItem.style.backgroundImage = "url(/grf/topmenu-background.gif)";
    }

  CurrentItem = null;
}

//
//

var CurrentBoxItem;

function BoxOver(BoxItem)
{
  el = document.getElementById(BoxItem);
  if (el != null)
  {
    if (el != CurrentBoxItem)
    {
      if (CurrentBoxItem != null)
      {
        if (CurrentBoxItem.className == "articleBoxedBodyWhite")
          CurrentBoxItem.style.backgroundColor = "white";
        else
          CurrentBoxItem.style.backgroundColor = "#eaf4f5";
      }

      CurrentBoxItem = el;
    }

    el.style.backgroundColor = "#deeef0";
  }
}

function BoxOut()
{
  if (CurrentBoxItem != null)
  {
    if (CurrentBoxItem.className == "articleBoxedBodyWhite")
      CurrentBoxItem.style.backgroundColor = "white";
    else
      CurrentBoxItem.style.backgroundColor = "#eaf4f5";
  }

  CurrentBoxItem = null;
}


//
//

var CurrentChartItem;

function ChartOver(ChartItem)
{
  el = document.getElementById(ChartItem);
  if (el != null)
  {
    if (el != CurrentChartItem)
    {
      if (CurrentChartItem != null)
      {
        CurrentChartItem.style.backgroundColor = "#eaf4f5";
      }

      CurrentChartItem = el;
    }

    el.style.backgroundColor = "#deeef0";
  }
}

function ChartOut()
{
  if (CurrentChartItem != null)
  {
    if (CurrentChartItem.className == "FlowChartBoxActive")
      CurrentChartItem.style.backgroundColor = "#eaf4f5";
    else
      CurrentChartItem.style.backgroundColor = "white";
  }

  CurrentChartItem = null;
}





var FCM = null;

function SetFlowChartMarker(x1, y1, x2, y2)
{
  X = OffsetX + x1;
  Y = OffsetY + y1;
  W = OffsetW + x2 - x1;
  H = OffsetH + y2 - y1;

  el = document.getElementById("FlowChartMarker");
  if (el != null)
  {
    if (FCM != null)
      ClearFlowChartMarker();

    FCM = el;
    el.style.left = X;
    el.style.top = Y;
    el.style.width = W;
    el.style.height = H;
    el.style.visibility = "visible";
  }
}

function ClearFlowChartMarker()
{
  if (FCM != null)
    FCM.style.visibility = "hidden";
}

//
//
//

function OpenWindow(url, width, height, scrollbars)
{
  //x = window.status = 
  myWin = window.open(url, 'OriginalSizeImage', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=' + scrollbars + ',resizable=no,width=' + width + ',height=' + height + ', left=20,top=20');
}

//
//
//

function updateTextBox(id)
{
  src = document.getElementById('edit_' + id);
  dest = document.getElementById(id);
  if (src != null && dest != null)
  {
    if (dest.type == 'textarea')
      dest.innerText = src.innerHTML;
    else
      dest.value = src.innerText;
  }
}

