function yg_Browser(){d = document;var nav=navigator; this.agt=nav.userAgent.toLowerCase(); this.major = parseInt(nav.appVersion); this.ns=(d.layers); this.dom=(d.getElementById)?1:0; this.ns4up=(this.ns && this.major >=4); this.ns6=(this.agt.indexOf("Netscape6")!=-1); this.op=(window.opera? 1:0); this.ie=(d.all); this.ie5=(d.all&&this.dom); this.fb=(this.agt.indexOf("firebird")!=-1); this.sf=(this.agt.indexOf("safari")!=-1); this.win=((this.agt.indexOf("win")!=-1) || (this.agt.indexOf("16bit")!=-1)); this.mac=(this.agt.indexOf("mac")!=-1);}
var oBw = new yg_Browser();
function yg_getW(o) { var w=0; w=(oBw.op)? o.style.pixelWidth:o.offsetWidth; return w; }
function yg_getH(o) { var h=0; h=(oBw.op)? o.style.pixelHeight:o.offsetHeight; return h; }
function yg_getPageX(o) { if (oBw.op) {  var x=0; while(eval(o)) { x+=o.style.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 yg_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.style.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 yg_show(o,disp) { (!disp)? 0:o.style.display=disp; o.style.visibility='visible'; }
function yg_hide(o,disp) { (!disp)? 0:o.style.display=disp; o.style.visibility='hidden'; }
function yg_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 yg_remEvt(o,e,f) { if(o.removeEventListener)o.removeEventListener(e,f,false);else if(o.detachEvent)o.detachEvent('on'+e,f); }
function yshp_setPageX(o,x) { if(oBw.op) o.style.pixelLeft=x; else o.style.left=x;}
function yshp_setPageY(o,y) { if(oBw.op) o.style.pixelTop=y; else o.style.top=y;}
function yg_setZ(o,z) { if(oBw.ns)o.zIndex=z;else o.style.zIndex=z; }



var timeouts = new Array();
var triggerPrefix = "pop_";
var popupPrefix = "m_";
function genPopups() {
  if (!document.getElementById) {return false;}
  if( oBw.mac == 1 && oBw.ie5 == 1 ) {var isMacIE = 1; }
  var trigs = 0;
  var tr = null;
  while (tr = document.getElementById(triggerPrefix + trigs)) {
    var popup = document.getElementById(popupPrefix + trigs);
    if( isMacIE ) {return;}
    else {
      popup.style.top = (yg_getPageY(tr) - 100) + "px";
      //popup.style.left = (yg_getPageX(tr) - 500 ) + "px";
      popup.style.left = (document.body.clientWidth - 600 ) + "px";
    }

    yg_addEvt(tr,     "mouseover",  genShow(popup.id), true);
    yg_addEvt(popup,  "mouseover",  genShow(popup.id), true);
    yg_addEvt(tr,     "mouseout",   genHide(popup.id));
    yg_addEvt(popup,  "mouseout",   genHide(popup.id));
    trigs++;
  }
  return true;
}
function genShow(id) {
  return new Function("clearTimeout(timeouts['"+id+"']); timeouts['"+id+"'] = setTimeout(\"show('"+id+"');\", 300);");
}
function genHide(id) {
  return new Function("clearTimeout(timeouts['"+id+"']); timeouts['"+id+"'] = setTimeout(\"hide('"+id+"');\", 300);");
}
function show(id) {
  hide(timeouts['lastshown']);
  timeouts['lastshown'] = id;
  var el = document.getElementById(id);
  if (el) {el.style.visibility = "visible";}
}
function hide(id) {
  var el = document.getElementById(id);
  if (el) {el.style.visibility = "hidden";}
}

window.onresize = function winResize() {if( document.body.clientWidth != origWidth || document.body.clientHeight != origHeight ) {origWidth = document.body.clientWidth;origHeight = document.body.clientHeight;genPopups();}}
origWidth = document.body.clientWidth;origHeight = document.body.clientHeight;
