
function fInitPageLayer(pAlignLeft,pAlignTop,pWidth,pHeight,pIndex) {
  page = new Object();
  content = new fSetLayerParams(null,"displayUserLayer",pAlignLeft,pAlignTop,pIndex,"visible");
  fSetLayerSize(content,pWidth,pHeight);
}

function fSetLayerSize(obj,width,height) {
  if(ns4) {
    obj.clip.right = width;
    obj.clip.bottom = height;
  } else {
    obj.width = (w3dom) ? width  + "px" : width;
    obj.height = (w3dom) ? height + "px" : height;
  }
}

function fSetLayerParams(parent,id,left,top,zindex,visibility) {
  if(ns4) {
    this.obj = (parent != null) ? parent.document[id] : document[id];
    this.obj.htm = (parent != null) ? parent.document[id].document : document[id].document;
  } else if(ie4 ||ie5) {
    this.obj = document.all[id].style;
    this.obj.htm = document.all[id];
  } else if(w3dom) {
    this.obj = document.getElementById(id).style;
    this.obj.htm  = document.getElementById(id);
  }
  this.obj.left = (w3dom) ? left + "px" : left;
  this.obj.top = (w3dom) ? top  + "px" : top;
  this.obj.zIndex = zindex;
  this.obj.visibility = visibility;
  return this.obj;
}

function fDisplayPageLayer() {
  var args = fDisplayPageLayer.arguments;	// args: pActionLabel,pContent,pTop,pWidth
  switch(args[0]) {
    case "load_page" :
	content.top = (w3dom) ? args[2]  + "px": args[2];
      if(ie4) {
        document.frames["UserFrameData"].document.location = args[1];
      }
      if(w3dom) {
        document.getElementById("UserFrameData").src = args[1];
      }
      if(ns4) {
        content.load(args[1],args[3]);
      }
    break;
    case "page_is_loaded" :
      if(ns4) {
        fSetLayerSize(content,args[3],content.htm.height);
      }
      clearTimeout(page_timer);
      page_timer = setTimeout("fDisplayPageLayer('display_page')",500);
    break;
    case "display_page" :
      if(ie4) {
        content.htm.innerHTML = document.frames['UserFrameData'].document.MailUserbody.innerHTML;
      } else if(w3dom) {
	  	content.htm.innerHTML = window.frames.UserFrameData.window.document.getElementById('MailUserbody').innerHTML;
      }
    break;
  }
}

ns4 = (document.layers);
ns6 = (!document.all && document.getElementById);
ie4 = (document.all && !document.getElementById && !window.opera);
ie5 = (document.all && !document.fireEvent && !window.opera);
op7 = (window.opera && document.createComment) ;
w3dom = (document.getElementById || op7);
var page_timer = null;
content = "";
  