
function listTables() {
  var content = document.getElementById('content');
  if (content) {
    var tables = content.getElementsByTagName('table');
    len = tables.length;
    for (c=0;c<len;c++) {
      if (tables[c].tagName == 'TABLE' && tables[c].className == 'contenttable') {
        var styleWidth = tables[c].style.width;
        var reg = /(\d+)px/
  	    var widthArr = styleWidth.match(reg);
        var width = widthArr[1]-1+1;
        if (width <= 525) {
          tables[c].style.cursor = 'default';
          tables[c].style.fontSize = '11px';
        } else {
          var loopa = new Image();
          if (navigator.userAgent.indexOf('IE') != -1) {
            tables[c].outerHTML = '<caption style="text-align: left; cursor: pointer;" title="Bitte klicken Sie, um die Tabelle in einem neuen Fenster öffnen."><img src="fileadmin/templates/img/lupe.gif" width="33" height="33" style="display: block; position: relative; z-index: 2; bottom: -33px;" alt="Bitte klicken Sie, um die Tabelle in einem neuen Fenster öffnen." title="Bitte klicken Sie, um die Tabelle in einem neuen Fenster öffnen." /></caption>'+tables[c].outerHTML;
          } else {
            tables[c].innerHTML = '<caption style="text-align: left; cursor: pointer;"><img src="fileadmin/templates/img/lupe.gif" width="33" height="33" style="display: block; position: relative; z-index: 2; bottom: -33px;" alt="Bitte klicken Sie, um die Tabelle in einem neuen Fenster öffnen." title="Bitte klicken Sie, um die Tabelle in einem neuen Fenster öffnen." /></caption>'+tables[c].innerHTML;
          }
          tables[c].title = 'Bitte klicken Sie, um die Tabelle in einem neuen Fenster öffnen.';
          tables[c].onclick = tableClick;
        }
      }
    }
  }
  

}

function tableClick(event) {
  evt = (window.event) ? window.event : event;
  evt.cancelBubble = true;
  evt.preventBubble = true;
  callerElement = (evt.srcElement) ? evt.srcElement : evt.target;
  switch (callerElement.tagName) {
    case 'TD': {
      tableElement = callerElement.parentNode.parentNode.parentNode;
    break;
    }
    
    case 'TH': {
      tableElement = callerElement.parentNode.parentNode.parentNode;
    break;
    }
    
    case 'P': {
      tableElement = callerElement.parentNode.parentNode.parentNode.parentNode;
    break;
    }
    
    case 'SPAN': {
      tableElement = callerElement.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
    break;
    }
    
    case 'STRONG': {
      tableElement = callerElement.parentNode.parentNode.parentNode.parentNode.parentNode;
    break;
    }
    
    case 'IMG': {
      tableElement = callerElement.parentNode.parentNode;
    break;
    }
    
    case 'CAPTION': {
      tableElement = callerElement.parentNode;
    break;
    }
    
  }
  tableStyleWidth = tableElement.style.width;
  var reg = /(\d+)px/
	var widthArr = tableStyleWidth.match(reg);
  var tableWidth = widthArr[1]-1+56;
  
  var left = (screen.availWidth-tableWidth)/2;
  newTableWin = window.open('', 'newTableWin','width='+tableWidth+',height=700,scrollbars=no,left='+left+'');
  newTableWin.document.write('<html><head><title>Produktinformationen</title><style type="text/css">body { font-size: 11px; font-family: Verdana; } table { border-collapse: collapse; } caption { display: none; } table td, table th { border: 1px solid #b00; font-size: 11px; padding: 5px; } table td p, table th p { margin: 0; padding: 0; } table td a, table th a { color: #b00; } table td a:hover, table th a:hover { text-decoration: none; } #print .print_top { border-bottom: 4px solid #bb0000; position: relative; } #print .print_top img.logo { left: 25px; position: absolute; top: 30px; } #print .print_top .print_links { position: absolute; right: 25px; top: 39px; }  #print .print_top .print_links a.print { background: url(fileadmin/templates/img/print_red.gif) no-repeat 0 50%; margin: 0 15px 0 0; padding: 0 0 0 20px; }  #print .print_top .print_links a.close { background: url(fileadmin/templates/img/print_close.gif) no-repeat 0 50%; padding: 0 0 0 14px; } #print .print_top img.print_bg { width: 100%; } html { height: 100%; margin: 0; padding: 0; } body { color: #777; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 70%; height: 100.1%; line-height: 14px; margin: 0; padding: 0; } a { color: #bb0000; } @media print { #print .top .print_links { display: none; } } #print .bottomlink { border-top: 2px solid #a49e63; margin: 20px 0 0 0; padding: 5px 0 5px 9px; }</style></head>');
  newTableWin.document.write('<body><div id="print"><div class="print_top"><img src="fileadmin/templates/img/print_top_bg.gif" width="1" height="95" border="0" class="print_bg" alt="" title="" /><div class="print_links"><a class="print" href="javascript:print(window);">Seite drucken</a><a class="close" href="javascript:close(window);">Seite schließen</a></div><div class="print_logo"><a href="Home.1.0.html" ><img src="typo3temp/GB/1c1330ff8a.gif" width="204" height="35" border="0" class="logo" alt="Stratemeyer" title="Stratemeyer" /></a></div></div><div style="height: 15px;"></div><div id="divcontainer"></div><div class="bottomlink">© Eugen Stratemeyer GmbH & Co. KG l 2007</div></div></body></html>');
  newTableWin.document.title = 'Produktinformationen';
  var divContainer = newTableWin.document.getElementById('divcontainer');
  divContainer.innerHTML = '<table class="contenttable" id="table" align="center" style="margin: 0 auto; width: '+tableStyleWidth+';" >' + tableElement.innerHTML + '</table>';
  newTableWin.document.close();
  if (navigator.userAgent.indexOf('Safari') != -1) {
    newTableWin.resizeTo(tableWidth-10, divContainer.offsetHeight+185);
  } else if (navigator.userAgent.indexOf('IE') != -1) {
    newTableWin.resizeTo(tableWidth + 20, divContainer.offsetHeight + 220);
  } else {
    newTableWin.resizeTo(tableWidth + 10, divContainer.offsetHeight + 215);
  }

  newTableWin.focus();
}













