
if (window.Event)
   document.captureEvents(Event.MOUSEUP);
document.onmouseup = checkdb;
var query = "";
var lastquery = "";
var ok = 0;
var bildurl = "";
function checkdb(e)
{
    if (document.getSelection)
      {
      query = document.getSelection();
      ok = 1;
      }
    else if (document.selection && document.selection.createRange)
      {
      var range = document.selection.createRange();
      query = range.text;
      ok = 1;
      }
      query = query.replace(/[ ]{1,}$/,"").replace(/^[ ]{1,}/,"");
      if(query.length < 2)
      {
      	window.status = 'Suchwörter haben eine Minimallänge von 2 Zeichen.';
      	setTimeout("window.status=''", 10000);
      	ok = 0;      	
      }
      if(query.length >= 50)
      {
      	window.status = 'Sie haben zuviel Text für unser Lexikon markiert.';
      	setTimeout("window.status=''", 10000);
      	ok = 0;      	
      }
      if(query != "" && query != lastquery && ok == 1)
      {
        lastquery = query;
        bildurl = "http://www.leximed.de/vet/checkdb.pl?sid=996122JzbuX8&query="+query;
	document.senda.src=bildurl;
	window.status = "Suche...";
      }
      else
      {
      if(query == lastquery){lastquery = "";}
      }
}

function timeout()
{
	setTimeout("window.status=''", 5000);
}

function zeigeintrag()
{
var newWin = "";
window.status = "";
if(query != "")
{
var url = "http://www.leximed.de/vet/printdb.pl?tpl=1&sid=996122JzbuX8&query="+query;
newWin = self.window.open(url,"Lexikon","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,height=380,width=460,top=15,left=300");
}
}
self.document.writeln("<img src=\"http://www.leximed.de/vet/ja.gif\" onload=\"zeigeintrag()\" onerror=\"window.status='Es konnte leider keine Beschreibung für Ihren Suchbegriff gefunden werden.';timeout();\" onabort=\"window.status='Abgebrochen'\" name=\"senda\" height=\"1\" width=\"1\" >");

var str='';
if(document.all) {str= '<div id="dictionary" style="position:absolute;top:-200;left:-100;visibility:hidden;z-index:10">';}

else {str= '<div id="dictionary" style="position:fixed; left:780px; bottom:0px; z-index:10;">';}

str+='<a href="#" id="Nada" onmouseover="showhelp();" onmouseout="hidehelp();"><img src="http://www.leximed.de/vet/templates/hundefutter-welt/lex.gif" border="0" width="21" height="21"></a></div>';

if(document.all) {str+= '<div id="lexhelp" style="position:absolute;visibility:hidden;z-index:9">';}

else {str+= '<div id="lexhelp" style="position:fixed; left:552px; bottom:20px; visibility:hidden; z-index:9;">';}

str+='<table border="1" width="230" bgcolor="red"><tr><td><div style="text-align:center; vertical-align:middle; font-family:Arial,Helvetica,sans-serif; font-size:15px; font-weight:bold;">Fressi-Fressi-<img src="http://www.leximed.de/vet/templates/hundefutter-welt/lex.gif" border="0" width="21" height="21" style="vertical-align:middle">exikon</div><span style="font-family:arial,helvetica,sans-serif; font-size:13px;">Diese Website hat ein "unsichtbares" Lexikon. Verwendung: Entweder <b>doppelklicken</b> Sie auf ein Einzel-Wort oder Sie markieren Begriffe aus mehreren Wörtern mit der Maus durch <b>Anklicken und Ziehen der Maus bei gedrückt gehaltener Maustaste</b>. Ist eine Erklärung vorhanden, öffnet sich ein neues Fenster.</span></td></tr></table></div>';


document.write(str);
setInterval('IEXCorrectPosition()',50);
if(document.all) {document.getElementById('dictionary').style.visibility="visible";}

function showhelp(){
  if(document.layers){document.layers['lexhelp'].visibility="show";}
  else {document.getElementById('lexhelp').style.visibility="visible";}}

function hidehelp(){
  if(document.layers){document.layers['lexhelp'].visibility="hide";}
  else {document.getElementById('lexhelp').style.visibility="hidden";}}

function IEXCorrectPosition(){
	if(document.all){
    document.getElementById('dictionary').style.left=784;
    document.getElementById('dictionary').style.top=document.body.offsetHeight+document.body.scrollTop-24;
    document.getElementById('lexhelp').style.left=552;
    document.getElementById('lexhelp').style.top=document.body.offsetHeight+document.body.scrollTop-210;}
}
// compatibility mode => document.body gegen document.documentElement austauschen (IEx)

