<!--
var tiptext;
var tiptextprom;
var tipwait = null;
var tipev = null;
var tipdoc = null;
var tipurl = null;
var tipwait = null;
var tipwaitsum = false;
var tipshow = false;
var tipdiv;
var tipy;
var tipabstand = 15;
var tipbgcol = "#FFFFE0";
var tipbordercol = "#000000"
var tipwidth = 390;//430
var tipswidth = 390;//430
var tipns6 = ((!document.all) && (document.getElementById))? true:false
var tipns4 = (document.layers)? true:false
var tipie4 = (document.all)? true:false
var tipmx;
var tipmy;
var tipww;
var tipwh;
var tipth;
var tipoffsy;


function loadSource(id,nestref,url){
 if (tipns4) {
  var lyr = (nestref)? eval('document.'+nestref+'.document.'+id) : document.layers[id]
  lyr.load(url,lyr.clip.width)
 } else {
  tiptext = "&nbsp";
  tiptextprom = "<font color=\"#ffffff\">Metafer-Summarizer link preview in progress..........</font>";
  METSumFrame.document.location = url
  ShowTip(tipdoc);
 }
 tipwaitsum = true;
}
function loadSourceFinish(id,hd,txt){
 if (tipshow) {
  tiptext = txt;
  tiptextprom = hd;
  ShowTip(tipdoc);
 }
 tipwaitsum = false;
}
function PrepareTip(doc, e){
 tipwidth = tipswidth;
 if(tipie4) {
  tipdiv = doc.all.tooltipdiv.style;
 } else if(tipns6) {
  tipdiv = doc.getElementById("tooltipdiv").style;
 } else if(tipns4) {
  tipdiv = doc.layers['tooltipdiv'];
 }
 if (tipns6 || tipns4) {
  tipmx = e.pageX;
  tipmy = e.pageY;
  tipww = window.innerWidth;
  tipwh = window.innerHeight;
  if (tipww < tipwidth) {
   tipwidth = tipww - 20;
  }

  tipx = e.pageX - (tipwidth/10);
  if(tipx<window.pageXOffset) tipx=15;
  else if(tipx>(window.innerWidth-tipwidth)) tipx = window.innerWidth-tipwidth-15 + window.pageXOffset;
  tipdiv.top   = e.pageY + tipabstand;
  tipy = e.pageY + tipabstand;
  tipoffsy = window.pageYOffset;
 } else { // tipie4
  tipmx = doc.body.scrollLeft + e.x;
  tipmy = e.clientY;
  tipww = doc.body.clientWidth;
  //wh = document.all.tags("body")[0].offsetHeight;
  tipwh = doc.body.clientHeight;
  if (tipww < tipwidth) {
   tipwidth = tipww - 20;
  }

  //st = "mx= " + tipmx + "\nmy= " + tipmy + "\nww= " + tipww + "\nwh= " + tipwh + "\nth= " + tipth + "\ntipwidth= " + tipwidth;
  //alert(st);

  tipx = doc.body.scrollLeft + e.x - (tipwidth/10);
  if(tipx<doc.body.scrollLeft) tipx=doc.body.scrollLeft + 15;
  else if(tipx>(doc.body.clientWidth-tipwidth)) tipx = doc.body.clientWidth-tipwidth-15 + doc.body.scrollLeft;
  tipdiv.top   = doc.body.scrollTop + e.clientY + tipabstand;
  tipy = doc.body.scrollTop + e.clientY + tipabstand;
  tipoffsy = doc.body.scrollTop;
 }
 tipdiv.left  = tipx;
 tipdiv.width = tipwidth;
 tipwait = window.setTimeout("MetRun()",1000);
}



function ShowTip(doc){
 buf  = "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html;CHARSET=utf-8\">";

 buf += "<table width='" + tipwidth + "' bgcolor='#b0a0c0' border=0 cellpadding=0 cellspacing=0>";
 buf += "<tr>";
 buf += "<td align=CENTER valign=MIDDLE>";

 buf += "<table width='100%' bgcolor='#000000' border=0 cellpadding=1 cellspacing=0>";
 buf += "<tr>";
 buf += "<td align=CENTER valign=MIDDLE  colspan='2'>";
 buf += "  <table width='100%' bgcolor='#FFFFFF' border=0 cellpadding=4 cellspacing=0>";
 buf += "<tr><td bgcolor=#7060a0>";
 if(tipns4) {
   buf += "<font style='FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 9pt' color=#ffffff>";
 } else {
   buf += "<font style='FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 8pt' color=#ffffff>";
 }
 buf += tiptextprom;
 buf += "</font>";
 buf += "</td></tr>";
 buf += "<tr><td>";
 if(tipns4) {
   buf += "<font style='FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 9pt'>";
 } else {
   buf += "<font style='FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 8pt'>";
 }
// buf += "<font size='2'>";
 buf += tiptext;
 buf += "</font>";
 buf += "</td></tr>";
 buf += "</table>";
 buf += "</td>";
 buf += "</tr>";
 buf += "</table>";

 buf += "<td  bgcolor='#c0c0c0' width='2' valign='top'>";
 buf += "<IMG align=left alt='' border=0 height=3 hspace=0 src='http://www.metafer.de/de/images/whitehor.gif' width=3>";
 buf += "</td>";
 buf += "</tr>";
 buf += "<tr>";
 buf += "<td>";
 buf += "<IMG align=left alt='' border=0 height=3 hspace=0 src='http://www.metafer.de/de/images/whitehor.gif' width=3>";
 buf += "</td>";
 buf += "<td  bgcolor='#b0a0c0' width='2' valign='top'>";
 buf += "</td>";
 buf += "</tr>";
 buf += "</table>";
 if(tipie4 || tipns6) {
  if(tipie4) {
   doc.all.tooltipdiv.innerHTML = buf;
//   doc.all.tooltipdiv2.innerHTML = tiptext;
   tipth = doc.all.tooltipdiv.offsetHeight;
   if ((tipy-tipoffsy) > (tipwh - tipwh/3)) {
    if ((tipmy + tipth) > tipwh) {
     tipdiv.top   = tipy - tipth - 25;
    }
   }
   doc.all.tooltipdiv.style.visibility = 'visible';
  } else {
   doc.getElementById("tooltipdiv").innerHTML = buf;

   if(tipns6) {
      tipth = doc.getElementById("tooltipdiv").offsetHeight;
   } else {
      tipth = doc.layers['tooltipdiv'].document.height;
   }
   if ((tipy-tipoffsy) > (tipwh - tipwh/3)) {
     if ((tipmy + tipth) > tipwh) {
       tipdiv.top   = tipy - tipth - 25;
     }
   }
   doc.getElementById("tooltipdiv").style.visibility = 'visible';
  }
 } else if(tipns4) {
  //  doc.layers['tooltipdiv'].document.write("<table width='" + tipwidth + "' bgcolor='" + tipbordercol + "' border=0 cellpadding=0 cellspacing=0><tr><td align=CENTER valign=MIDDLE><table width='" + tipwidth + "' bgcolor='" + tipbgcol + "' border=0 cellpadding=4 cellspacing=1>\n<tr><td>");
  //  doc.layers['tooltipdiv'].document.write(tiptext +"<br>\n");
  //  doc.layers['tooltipdiv'].document.write("</td></tr>\n</table>\n</td></tr>\n</table>");
  doc.layers['tooltipdiv'].document.write(buf);
  doc.layers['tooltipdiv'].document.close();

  if(tipns6) {
   tipth = doc.getElementById("tooltipdiv").offsetHeight;
  } else {
   tipth = doc.layers['tooltipdiv'].document.height;
  }
  if ((tipy-tipoffsy) > (tipwh - tipwh/3)) {
   if ((tipmy + tipth) > tipwh) {
    tipdiv.top   = tipy - tipth - 25;
   }
  }
  doc.layers['tooltipdiv'].visibility = 'show';
 }
}
function MetRun(){
 tipwait = null;
// if (!tipwaitsum) 
 {
  tipshow = true;
//  loadSource('METSumContent',null,"source3-buffer-text.html")
  loadSource('METSumContent',null,tipurl);
 }
}
function MetToolTipTClose(){
 if(tipie4) {
  tipdoc.all.tooltipdiv.style.visibility = 'hidden';
 } else if(tipns6) {
  tipdoc.getElementById("tooltipdiv").style.visibility = 'hidden';
 } else if(tipns4) {
  tipdoc.layers['tooltipdiv'].visibility = 'hide';
 }
 tipshow = false;
 if (tipwait != null) {
  clearTimeout(tipwait);
  tipwait = null;
 }
}
function MetToolTipT(cgi,url,evt){
// if (!tipwaitsum) 
 {
  tipdoc = document;
  if (tipie4) {
    tipev = event;
  } else {
    tipev = evt;
  }
  tipurl = cgi + "?http://www.metafer.de/cgi-bin/mettooltip2.pl?url=" + url + "&rurl=" + document.URL + "&ref=" + document.referrer;
  PrepareTip(tipdoc,tipev);
 }
}
//-->

