function Browser(){
 d=document;
 this.agt=navigator.userAgent.toLowerCase();
 this.major = parseInt(navigator.appVersion);
 this.dom=(d.getElementById)?1:0;
 this.ns=(d.layers);
 this.ns4up=(this.ns && this.major >=4);
 this.ns6=(this.dom&&navigator.appName=="Netscape");
 this.op=(window.opera? 1:0);
 this.ie=(d.all);
 this.ie4=(d.all&&!this.dom)?1:0;
 this.ie4up=(this.ie && this.major >= 4);
 this.ie5=(d.all&&this.dom);
 this.win=((this.agt.indexOf("win")!=-1) || (this.agt.indexOf("16bit")!=-1));
 this.mac=(this.agt.indexOf("mac")!=-1);
}
var oBw = new Browser();
function getObj(id,d) {
  var i,x;  if(!d) d=document; 
  if(!(x=d[id])&&d.all) x=d.all[id]; 
  for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][id];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=getObj(id,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(id); 
  return x;
}
// 1k DHTML API http://www.dithered.com/experiments/1kdhtml/index.html
function getH(o) { var h=0; if (oBw.ns) { h=(o.height)? o.height:o.clip.height; return h; } h=(oBw.op)? o.style.pixelHeight:o.offsetHeight; return h; }
function setH(o,h) { if(oBw.ns) {if(o.clip) o.clip.bottom=h;}else if(oBw.op)o.style.pixelHeight=h;else o.style.height=h; }
function getW(o) { var w=0; if(oBw.ns) { w=(o.width)? o.width:o.clip.width; return w; } w=(oBw.op)? o.style.pixelWidth:o.offsetWidth; return w; }
function setW(o,w) { if(oBw.ns) {if(o.clip) o.clip.right=w;}else if(oBw.op)o.style.pixelWidth=w;else o.style.width=w; }
function getX(o) { var x=(oBw.ns)? o.left:(oBw.op)? o.style.pixelLeft:o.offsetLeft; return x;}
function setX(o,x) { (oBw.ns)? o.left=x:(oBw.op)? o.style.pixelLeft=x:o.style.left=x; }
function getPageX(o) { if(oBw.ns) { var x=(o.pageX)? o.pageX:o.x; return x; } else if (oBw.op) {  var x=0; while(eval(o)) { x+=o.stylo.pixelLeft; e=o.offsetParent; } return x; } else { var m=(oBw.mac&&oBw.ie)? document.body.leftMargin:0; var x=0; while(eval(o)) { x+=o.offsetLeft; o=o.offsetParent; } return parseInt(x)+parseInt(m) } }
function getY(o) {  var y=(oBw.ns)? o.top:(oBw.op)? o.style.pixelTop:o.offsetTop; return y;}
function setY(o,y) { (oBw.ie||oBw.dom)? o.style.top=y:(oBw.ns)? o.top=y:o.style.pixelTop=y; }
function getPageY(o) { if(oBw.ns) { var y=(o.pageY)? o.pageY:o.y; return y; } else if (oBw.op) {  var y=0; while(eval(o)) { y+=o.stylo.pixelTop; o=o.offsetParent; } return y; }  else { var m = (oBw.mac&&oBw.ie)? document.body.topMargin:0; var y=0; while(eval(o)) { y+=o.offsetTop; o=o.offsetParent; }  return parseInt(y)+parseInt(m); } }
function moveTo(o,x,y) { setX(o,x);setY(o,y); }
function moveBy(o,x,y) { setX(o,getPageX(o)+x);setY(o,getPageY(o)+y); }
function setZ(o,z) { if(oBw.ns)o.zIndex=z;else o.style.zIndex=z; }
function setStyle(o,s,v) { if(oBw.ie5||oBw.dom) eval("o.style."+s+" = '" + v +"'"); }
function getStyle(o,s) { if(oBw.ie5||oBw.dom) return eval("o.style."+s); }
function addEvt(o,e,f,c){ if(o.addEventListener)o.addEventListener(e,f,c);else if(o.attachEvent)o.attachEvent("on"+e,f);else eval("o.on"+e+"="+f)}
function insertHTML(o,h,w) {
  if (oBw.op) return;
  if (o.insertAdjacentHTML) { o.insertAdjacentHTML(w,h); return; }
  var r = o.ownerDocument.createRange();
  r.setStartBefore(o);
  var frag = r.createContextualFragment(h);
  o.appendChild(frag); 
  return;
}
function show(id){if(oBw.ns){document.layers[id].visibility = "show";}else{setStyle(getObj(id),"display","block")};}
function hide(id){if(oBw.ns){document.layers[id].visibility = "hide";}else{setStyle(getObj(id),"display","none")};}
if (oBw.ns){document.write("<style>.bxh{position:absolute;visibility:hide;}</style>");}
else{document.write("<style>.bxh{display:none;}</style>");}
if(oBw.ns){spacingwidth="screenX";spacingheight="screenY";}
else{isie = true;spacingwidth="left";spacingheight="top";}
function linkto(locin){location.href = locin;}
function insertText(textin,fieldin){
	//document.PostTopic.Message
    if (fieldin.createTextRange && fieldin.caretPos){
        var caretPos = fieldin.caretPos;
        caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? textin + ' ' : textin;
        fieldin.focus();
    } else {
		fieldin.value+=textin;
        fieldin.focus();
    }
}
function storeCaret(ftext){
	if (ftext.createTextRange) {
		ftext.caretPos = document.selection.createRange().duplicate();
	}
}