var initialwidth;
var initialheight;
var ie5 = document.all && document.getElementById;
var ns6 = document.getElementById && !document.all;

function iecompattest() {
  return (!window.opera && document.compatMode && document.compatMode!="BackCompat") ? document.documentElement : document.body;
}

function loadwindow(url) {
  var width = 600;
  var height = 600;
  document.getElementById("dwindow").style.display = '';
  document.getElementById("dwindow").style.width = initialwidth = width + "px";
  document.getElementById("dwindow").style.height = initialheight = height + "px";
  document.getElementById("dwindow").style.left = "30px";
  document.getElementById("dwindow").style.top = ns6 ? window.pageYOffset * 1 + 30 + "px" : iecompattest().scrollTop * 1 + 30 + "px";
  document.getElementById("dframe").src = url;

  document.getElementById("dwindow").style.width = ns6 ? window.innerWidth - 20 + "px" : iecompattest().clientWidth + "px";
  document.getElementById("dwindow").style.left = ns6 ? window.pageXOffset + "px" : iecompattest().scrollLeft + "px";
  document.getElementById("dwindow").style.top = ns6 ? window.pageYOffset + "px" : iecompattest().scrollTop + "px";
}

function close() {
  document.getElementById("dwindow").style.display = "none";
}

function switchMenu(obj) {
  var e = document.getElementById(obj);
  if (e.style.display != "none")
    e.style.display = "none";
  else
    e.style.display = "";
}
