function fill_window(fname, fx, fy, fwidth, fheight)
{
  var winProps="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + fwidth + ",height=" + fheight + ",screenX=" + fx + ",screenY=" + fy + ",left=" + fx + ",top=" + fy
  var windowVar=window.open(fname,"tempWin",winProps)
  return false
}

function get_cookie(name) {
  var start = document.cookie.indexOf(name+"=")
  var len = start+name.length+1
  if ((!start) && (name != document.cookie.substring(0,name.length))) return null
  if (start == -1) return null
  var end = document.cookie.indexOf(";",len)
  if (end == -1) end = document.cookie.length
  return unescape(document.cookie.substring(len,end))
}

function do_popup(fname, fx, fy, fwidth, fheight) {
  if (parseInt(navigator.appVersion) >= 4) {
    var cookiestatus = get_cookie("Popup")
//    if (false) {
    if (!cookiestatus) {
      document.cookie = "Popup=true;path=/"
      // Check if cookie was accepted
      if (get_cookie("Popup")) {
        var windowVar=window.open(fname,"popWin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=" + fwidth + ",height=" + fheight + ",screenX=" + fx + ",screenY=" + fy + ",left=" + fx + ",top=" + fy)
      }
    }
  }
}