var stribe_tech     = function() {}
var events_feat     = function() {}
var img_map_changer = function() {}

var bilder          = new Array();
var aktuell         = 0;
var anyIE           = 0;
var olderIE         = 0;
var newwindow       = 0;

if((document.all)&&(!self.opera))
{
   anyIE       = 1;
   var index   = navigator.appVersion.indexOf('MSIE');
   var version = parseInt(navigator.appVersion.substring(index+5));

   if(version < 7)
   {
      olderIE = 1;
   }
}


function displayjpg(bild,width,height)
{
   var newwindow;

   var iwidth  = width;
   var iheight = height;

   width+=8;
   height+=8;

   var l = (screen.availWidth - width) / 2;
   var t = (screen.availHeight - height) / 2;

   if(document.all)                              // IE or opera
   {
      if(self.opera)                             // opera uses this relative to main window
      {
         l = (self.outerWidth  - width) / 2;
         t = (self.outerHeight - height) / 2;
      }
      else
      {
         if(document.documentElement.clientWidth)// IE >= 6 and standard conform
         {
            l = (document.documentElement.clientWidth-width)   / 2;
            t = (document.documentElement.clientHeight-height) / 2;
            if(t > 64) t-=64;                    // title and status estimated
         }
         else
         {
            l = (document.body.clientWidth -width)   / 2;
            t = (document.body.clientHeight-height) / 2;
            if(t > 64) t-=64;                    // title and status  estimated
         }
                                                 // ie don't works with different monitor resolutions
                                                 // and negavie coordinates
         l += self.screenLeft;
         t += self.screenTop;
      }
   }
   else
   {                                             // firefox and safari >= 3.1 handle this correctly
      l = (self.outerWidth  - width) / 2;
      t = (self.outerHeight - height) / 2;
      l += self.screenX;
      t += self.screenY;
   }

   if(newwindow)
   {
      newwindow.close();
      newwindow = 0;
   }

   if(height > screen.availHeight)               // we need scrolling
   {
      t      = 0;
      height = screen.availHeight;
      width += 32;                               // scrollbar estimated
      newwindow = window.open("","newwindow","width="+width+",height=" +height+",screenX="+l+",screenY="+t+",left=" +l+",top="+t+",scrollbars=yes,resizable=no,menubar=no");
   }
   else
   {
      newwindow = window.open("","newwindow","width="+width+",height=" +height+",screenX="+l+",screenY="+t+",left=" +l+",top="+t+",scrollbars=no,resizable=no,menubar=no");
   }

   if(newwindow)
   {
      newwindow.document.open();

      newwindow.document.writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"');
      newwindow.document.writeln('  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
      newwindow.document.writeln('<html xmlns="http://www.w3.org/1999/xhtml">');
      newwindow.document.writeln('<head>');
      newwindow.document.writeln('<title>'+document.title+'</title>');
      newwindow.document.writeln('<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />');
      newwindow.document.writeln('<meta http-equiv="imagetoolbar" content="yes" />');
      newwindow.document.writeln('<link rel="stylesheet" href="../product.css" type="text/css" />');
      newwindow.document.writeln('</head>');
      newwindow.document.writeln('<body>');
      newwindow.document.writeln('<div class="full"><table class="pic" summary="centred layout"><tr>');
      newwindow.document.writeln('<td class="dim"><a title="Close" href="javascript:window.close()"><img src="pro/'+bild+'.jpg" width="'+iwidth+'" height="'+iheight+'" alt="Close" /></a></td>');
      newwindow.document.writeln('</tr></table></div>');
      newwindow.document.writeln('</body>');
      newwindow.document.writeln('</html>');

      newwindow.document.close();

      newwindow.focus();
   }
}

function displayimg(bild,explane,width,height)
{
   var newwindow;

   var iwidth  = width;
   var iheight = height;

   width +=8;
   height+=8;

   if(explane != "")
   {
      height += 32;
   }

   var l = (screen.availWidth - width) / 2;
   var t = (screen.availHeight - height) / 2;

   if(document.all)                              // IE or opera
   {
      if(self.opera)                             // opera uses this relative to main window
      {
         l = (self.outerWidth  - width) / 2;
         t = (self.outerHeight - height) / 2;
      }
      else
      {
         if(document.documentElement.clientWidth)// IE >= 6 and standard conform
         {
            l = (document.documentElement.clientWidth-width)   / 2;
            t = (document.documentElement.clientHeight-height) / 2;
            if(t > 64) t-=64;                    // title and status estimated
         }
         else
         {
            l = (document.body.clientWidth -width)   / 2;
            t = (document.body.clientHeight-height) / 2;
            if(t > 64) t-=64;                    // title and status  estimated
         }
                                                 // ie don't works with different monitor resolutions
                                                 // and negavie coordinates
         l += self.screenLeft;
         t += self.screenTop;
      }
   }
   else
   {                                             // firefox and safari >= 3.1 handle this correctly
      l = (self.outerWidth  - width) / 2;
      t = (self.outerHeight - height) / 2;
      l += self.screenX;
      t += self.screenY;
   }

   if(newwindow)
   {
      newwindow.close();
      newwindow = 0;
   }

   if(height > screen.availHeight)               // we need scrolling
   {
      t      = 0;
      height = screen.availHeight;
      width += 32;                               // scrollbar estimated
      newwindow = window.open("","newwindow","width="+width+",height=" +height+",screenX="+l+",screenY="+t+",left=" +l+",top="+t+",scrollbars=yes,resizable=no,menubar=no");
   }
   else
   {
      newwindow = window.open("","newwindow","width="+width+",height=" +height+",screenX="+l+",screenY="+t+",left=" +l+",top="+t+",scrollbars=no,resizable=no,menubar=no");
   }

   if(newwindow)
   {
      newwindow.document.open();

      newwindow.document.writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"');
      newwindow.document.writeln('  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
      newwindow.document.writeln('<html xmlns="http://www.w3.org/1999/xhtml">');
      newwindow.document.writeln('<head>');
      newwindow.document.writeln('<title>'+document.title+'</title>');
      newwindow.document.writeln('<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />');
      newwindow.document.writeln('<meta http-equiv="imagetoolbar" content="yes" />');
      newwindow.document.writeln('<link rel="stylesheet" href="../product.css" type="text/css" />');
      newwindow.document.writeln('</head>');
      newwindow.document.writeln('<body>');
      newwindow.document.writeln('<div class="full"><table class="pic" summary="centred layout"><tr>');

      if(explane != "") newwindow.document.writeln('<td class="dim"><small>'+document.title+explane+'</small><br/><br/>');
      else newwindow.document.write('<td class="dim">');
      newwindow.document.writeln('<a title="Close" href="javascript:window.close()"><img src="pro/'+bild+'" width="'+iwidth+'" height="'+iheight+'" alt="Close" /></a></td>');
      newwindow.document.writeln('</tr></table></div>');
      newwindow.document.writeln('</body>');
      newwindow.document.writeln('</html>');

      newwindow.document.close();

      newwindow.focus();
   }
}

function displayrelimg2(bild,explane,width,height)
{
   var newwindow;

   var iwidth  = width;
   var iheight = height;

   width +=8;
   height+=8;

   if(explane != "")
   {
      height += 32+20;
   }

   var l = (screen.availWidth - width) / 2;
   var t = (screen.availHeight - height) / 2;

   if(document.all)                              // IE or opera
   {
      if(self.opera)                             // opera uses this relative to main window
      {
         l = (self.outerWidth  - width) / 2;
         t = (self.outerHeight - height) / 2;
      }
      else
      {
         if(document.documentElement.clientWidth)// IE >= 6 and standard conform
         {
            l = (document.documentElement.clientWidth-width)   / 2;
            t = (document.documentElement.clientHeight-height) / 2;
            if(t > 64) t-=64;                    // title and status estimated
         }
         else
         {
            l = (document.body.clientWidth -width)   / 2;
            t = (document.body.clientHeight-height) / 2;
            if(t > 64) t-=64;                    // title and status  estimated
         }
                                                 // ie don't works with different monitor resolutions
                                                 // and negavie coordinates
         l += self.screenLeft;
         t += self.screenTop;
      }
   }
   else
   {                                             // firefox and safari >= 3.1 handle this correctly
      l = (self.outerWidth  - width) / 2;
      t = (self.outerHeight - height) / 2;
      l += self.screenX;
      t += self.screenY;
   }

   if(newwindow)
   {
      newwindow.close();
      newwindow = 0;
   }

   if(height > screen.availHeight)               // we need scrolling
   {
      t      = 0;
      height = screen.availHeight;
      width += 32;                               // scrollbar estimated
      newwindow = window.open("","newwindow","width="+width+",height=" +height+",screenX="+l+",screenY="+t+",left=" +l+",top="+t+",scrollbars=yes,resizable=no,menubar=no");
   }
   else
   {
      newwindow = window.open("","newwindow","width="+width+",height=" +height+",screenX="+l+",screenY="+t+",left=" +l+",top="+t+",scrollbars=no,resizable=no,menubar=no");
   }

   if(newwindow)
   {
      newwindow.document.open();

      newwindow.document.writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"');
      newwindow.document.writeln('  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
      newwindow.document.writeln('<html xmlns="http://www.w3.org/1999/xhtml">');
      newwindow.document.writeln('<head>');
      newwindow.document.writeln('<title>'+document.title+'</title>');
      newwindow.document.writeln('<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />');
      newwindow.document.writeln('<meta http-equiv="imagetoolbar" content="yes" />');
      newwindow.document.writeln('<link rel="stylesheet" href="../product.css" type="text/css" />');
      newwindow.document.writeln('</head>');
      newwindow.document.writeln('<body>');
      newwindow.document.writeln('<div class="full"><table class="pic" summary="centred layout"><tr>');

      if(explane != "") newwindow.document.writeln('<td class="dim"><small>'+explane+'</small><br/><br/>');
      else newwindow.document.write('<td class="dim">');
      newwindow.document.writeln('<a title="Close" href="javascript:window.close()"><img src="'+bild+'" width="'+iwidth+'" height="'+iheight+'" alt="Close" /></a></td>');
      newwindow.document.writeln('</tr></table></div>');
      newwindow.document.writeln('</body>');
      newwindow.document.writeln('</html>');

      newwindow.document.close();

      newwindow.focus();
   }
}



function openact()
{
   if((aktuell >= 0) && (aktuell < ausf_html.length))
   {
      displayjpg(ausf_html[aktuell][0],ausf_html[aktuell][1],ausf_html[aktuell][2]);
   }
}

function preload()
{
   var j=0;

   for(var i=0;i<quellen.length;i++)
   {
      bilder[j]     = new Image();
      bilder[j].src = '../features/'+quellen[i]+'.jpg';
      j++;
      bilder[j]     = new Image();
      bilder[j].src = '../features/'+quellen[i]+'_b.jpg';
      j++;
   }
}

function setzeausf()
{
   var sel;

   try
   {
      sel = document.auswahl.ausf;
      if(sel)
      {
         aktuell = sel.selectedIndex;

         if((aktuell >= 0) && (aktuell < ausf_jpeg.length))
         {
            document.images[0].src = 'pro/'+ausf_jpeg[aktuell]+'.jpg';
         }
      }
   }
   catch (e)
   {
   }
}

function setzeausfbox(setindex)
{
   if((setindex >= 0) && (setindex < ausf_jpeg.length))
   {
      try
      {
         if(document.auswahl)
         {
            document.auswahl.ausf.selectedIndex = setindex;
         }
      }
      catch (e)
      {
      }
   }
}


function init()
{
   setzeausfbox(0);
   stribe_tech();
   events_feat();
}

var stribe_tech = function()
{
   var tables = document.getElementsByTagName("table");

   for(var x=0;x!=tables.length;x++)
   {
      var table = tables[x];

      if(table.className=="tech")
      {
         var tbodies = table.getElementsByTagName("tbody");

         for (var h = 0; h < tbodies.length; h++)
         {
            var even = true;
             var trs = tbodies[h].getElementsByTagName("tr");

             for (var i = 0; i < trs.length; i++)
             {
                if(trs[i].className != "inner")
                {
                   if(even)
                       trs[i].className += " even";
                   else
                       trs[i].className += " odd";

                   even = !even;
                }
             }
          }
      }
   }
}

function event_over(item)
{
   if(item.id != "")
   {
      var index = 2*parseInt(item.id.substring(1)) + 1;
      item.childNodes[0].childNodes[0].src = bilder[index].src;
   }
}

function event_out(item)
{
   if(item.id != "")
   {
      var index = 2*parseInt(item.id.substring(1));
      item.childNodes[0].childNodes[0].src = bilder[index].src;
   }
}

function ieover()
{
   event_over(this);
}

function ieout()
{
   event_out(this);
}



var events_feat = function()
{
   img_map_changer();

   var tables = document.getElementsByTagName("table");

   var max = document.images.length;

   for(var x=0;x!=tables.length;x++)
   {
      var table = tables[x];

      if(table.className=="feat")
      {
         var tbodies = table.getElementsByTagName("tbody");

         for (var h = 0; h < tbodies.length; h++)
         {
             var tds   = tbodies[h].getElementsByTagName("td");

             for (var i = 0; i < tds.length; i++)
             {
               if(anyIE)
               {
                  tds[i].onmouseout  = ieout;
                  tds[i].onmouseover = ieover;
                }
                else
                {
                     tds[i].setAttribute('onmouseout' ,'event_out(this)');
                     tds[i].setAttribute('onmouseover','event_over(this)');
                }
            }
         }
      }
   }
}