function SetMinWidth() {
  function getInt(s) {
    var i = parseInt(s);
    return isNaN(i) ? 0 : i;
  }
  var cw,w,pl,pr,ml,mr,br,bl,ad,theDiv = document.targetDiv;
  var g = document.getElementById(theDiv);
  w = parseInt(document.minWidth);
  var iw = document.getElementById("inner_wrapper");
  var mc = document.getElementById("maincontent");
  if (g && document.body && document.body.clientWidth)
  {
    gs = g.currentStyle ? g.currentStyle : window.getComputedStyle(g, null);
    cw = getInt(document.body.clientWidth);
    pl = getInt(gs.paddingLeft);
    pr = getInt(gs.paddingRight);
    ml = getInt(gs.marginLeft);
    mr = getInt(gs.marginRight);
    bl = getInt(gs.borderLeftWidth);
    br = getInt(gs.borderRightWidth);
    ad = pl + pr + ml + mr + bl + br;
    if (cw <= w)
    {
      w -= ad;
      g.style.width = w + "px";
      iw.style.width = w + "px";
    }
    else
    {
      g.style.width = "auto";
      iw.style.width = "auto";
    }
  }
}

document.targetDiv = 'total_wrapper';
document.minWidth = 1000;
addListener(window, "load", SetMinWidth);
addListener(window, "resize", SetMinWidth);

function changeImage(image, suffix) {
  var img = typeof image == "string" ? document.images[image] : image;
  if (img) {
    var s = img.src;
    if (s) {
      var suffixEnd = s.lastIndexOf('.');
      img.src = s.substr(0, s.lastIndexOf('_', suffixEnd) + 1) + suffix + s.substr(suffixEnd);
    }
  }
}

function showInNewWindow(url) {
    window.open(url, 'ano', "width=750,height=700,top=30,left=230,toolbar=1,menubar=1,resizable=1,scrollbars=yes");
}

function onCitMgrSubmit() {
    var frm = document.forms['frmCitmgr'];
    frm.target = frm.direct.checked ? "_self" : "_black";
}