
Warning: file_get_contents(): Filename cannot be empty in /srv/www/htdocs/web267/html/glossary.php on line 179
var glob = '0';
var k_name = Array();
var k_title = Array();
var k_desc = Array();
var k_url = Array();
var k_siteurl = Array();

      var s=document.createElement('link');
      s.setAttribute('rel','stylesheet');
      s.setAttribute('href','http://www.PPCweb.de/glossary_css.php?key_color=gray&hint_bg_color=lightyellow&hint_color=black&hint_border_color=black');
      document.getElementsByTagName('head')[0].appendChild(s);
      function getBodyScrollTop() {
   return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || 
      (document.body && document.body.scrollTop);
}

function jsLink(i) {
   window.open(k_url[i], '', '', false);
}

function replace(stPhrase, stPattern, i) {
   var stResult = new String(stPhrase);
   
   //var wre = new RegExp("smart_text_start(.*?)smart_text_end", "img");
   //alert(stResult);
   var matches = stResult.match(/<\!--smart_text_start-->[\s\S]*<\!--smart_text_end-->/);
   /*string=document.getElementsByTagName('span');
   matches = [];
   tempStr = '';
   for (i in string) {
      if (string[i].className == 'smart_text') {
         tempStr = '<span class="smart_text">' + string[i].innerHTML + '</span>';
         matches.push(tempStr);
      }
   }*/
   //alert(matches);

   if (1 == glob) {
      var re = new RegExp("(>[^<]*\\b)(" + stPattern + ")(\\b[^>]*<)", "img");
   } else {
      var re = new RegExp("(>[^<]*\\b)(" + stPattern + ")(\\b[^>]*<)", "im");
   }
   //alert(matches.length);
   for (j = 0; j < matches.length; j++) {
      var str = new String(matches[j]);
      str = str.replace(re, "$1<span id='key_" + j +
         "' class='keyword' onMouseOver='keyword_over(" + j + ", " + j +
         ")' onMouseOut='keyword_out()' onClick='jsLink(" + j + ")'>$2</span>$3");
      stResult = stResult.replace(matches[j], str);
      if (0 == glob) {
         var str = new String(matches[j]);
         if (str.match(re)) {
            break;
         }
      }
   }


   /*var stResult = new String(stPhrase);
   if (1 == glob) {
      //var re = new RegExp("(>[^<]*\\b)(" + stPattern + ")(\\b[^>]*<)", "img");
      var re = new RegExp("(whatever>[^<]*\\b)(" + stPattern + ")(\\b[^>]*<\/whatever)", "img");
   } else {
      //var re = new RegExp("(>[^<]*\\b)(" + stPattern + ")(\\b[^>]*<)", "im");
      var re = new RegExp("(whatever>[^<]*\\b)(" + stPattern + ")(\\b[^>]*<\/whatever)", "im");
   }
   stResult = stResult.replace(re, "$1<span id='key_" + i +
      "' class='keyword' onMouseOver='keyword_over(" + i + ", " + i + 
      ")' onMouseOut='keyword_out()' onClick='jsLink(" + i + ")'>$2</span>$3");*/
   return stResult;
}

function showHint(i, j) {
   if ("mozilla" == browser) {
      table_hint = document.getElementById("table_hint");
      id_title = document.getElementById("id_title");
      id_desc = document.getElementById("id_desc");
      id_url = document.getElementById("id_url");
      clientWidth = window.innerWidth;
      clientHeight = window.innerHeight + getBodyScrollTop();
   } else {
      clientWidth  = window.document.body.clientWidth;
      clientHeight = window.document.body.clientHeight + getBodyScrollTop();
   }
   if (table_hint.name != i) {
      table_hint.name = i;
      id_title.innerHTML = "<b><span onClick='jsLink(" + i + ")' style='font-size: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif;'>" + 
         k_title[i] + "</span></b>";
      id_desc.innerHTML = "<span onClick='jsLink(" + i + ")' style='font-size: 8pt; " +
         "font-family: Verdana, Arial, Helvetica, sans-serif;'>" + k_desc[i] + "</span>";
      id_url.innerHTML = "<span style='color: gray; text-decoration: underline; font-size: 8pt; " +
         "font-family: Verdana, Arial, Helvetica, sans-serif;' onClick='jsLink(" + i + ")'>" + 
         k_siteurl[i] + "</span>";

      table_hint.style.display = "block";
      if (clientWidth > mousex + 250) {
         table_hint.style.left = mousex;
      } else {
         table_hint.style.left = mousex - 260;
      }
      if (clientHeight > mousey + 20 + table_hint.clientHeight) {
         table_hint.style.top = mousey + 20;
      } else {
         table_hint.style.top = mousey - table_hint.clientHeight;
      }
   }
   window.clearTimeout(timeoutID);
}

function hideHint() {
   if ("mozilla" == browser) {
      table_hint = document.getElementById("table_hint");
   }
   if (table_hint.style.display != "none") {
      timeoutID =
         window.setTimeout("table_hint.style.display = 'none'; table_hint.name = -1;", 200);
   }
}

function table_hint_over() {
   window.clearTimeout(timeoutID);
}

function table_hint_out() {
   hideHint();
}

function keyword_over(i, j) {
   showHint(i, j)
}

function keyword_out() {
   hideHint();
}

function writeHint() {
   document.write('<div id="table_hint" class="container" onMouseOver="table_hint_over()" onMouseOut="table_hint_out()">');
   document.write('<table class="table_hint">');
   document.write('<tr><td id="id_title" class="cell_hint"></td></tr>');
   document.write('<tr><td id="id_desc" class="cell_hint"></td></tr>');
   document.write('<tr><td id="id_url" class="cell_hint"></td></tr></table></div>');
}

function setGlossary() {
   var html_code = "<!-- -->" + document.body.innerHTML + "<!-- -->";
   for (i = 0; i < k_name.length; i++) {
      html_code = replace(html_code, k_name[i], i);
   }
   document.body.innerHTML = html_code;
}

writeHint();

var timeoutID = 0;
var id_key = -1;
var mousex = 0;
var mousey = 0;

if (document.all) {
   browser = "ie";
} else if (navigator.userAgent.indexOf("Opera")>-1) {
   browser = "opera";
} else {
   browser = "mozilla";
}

if ("mozilla" == browser) {
   document.onmousemove = function(e) {
      mousex = e.pageX;
      mousey = e.pageY;
      return true;
   }
} else {
   document.onmousemove = function() {
      mousex=event.clientX + document.body.scrollLeft;
      mousey=event.clientY + document.body.scrollTop;
      return true;
   }
}
