var ZielDatei =  "index.htm?m_index.htm";
if (!top.FramesetGeladen)
{ if(document.images)
     top.location.replace(ZielDatei); 
  else 
     top.location.href = ZielDatei;
}

function lib_bwcheck()
{ //Browsercheck (needed)
  this.ver=navigator.appVersion;
  this.agent=navigator.userAgent;
  this.dom=document.getElementById?1:0;
  this.opera5=this.agent.indexOf("Opera 5")>-1;
  this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
  this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
  this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom && !this.opera5)?1:0;
  this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
  this.ie=this.ie4||this.ie5||this.ie6||this.ie7;
  this.mac=this.agent.indexOf("Mac")>-1;
  this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
  this.ns4=(document.layers && !this.dom)?1:0;
  this.bw=(this.ie7 || this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5);
  return this
}
var bw=new lib_bwcheck();

/****
Variables to set 
****/
msgFont= "Verdana,Arial,Helvetica";	// The font for the message
msgFontSize= 12;				// Set the fontSize in pt
msgFontColor="#FFFFFF";		// Set the fontColor
msgFontColor2="#000000";		// Set the fontColor

msgWidth= "300";				// Set the width of the messageblock here for netscape 4


/********************************************************************************
You don't have to change anything below this
********************************************************************************/

//ChangeText object constructor.
function makeChangeTextObj(obj)
{
  this.css      = bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?document.layers[obj]:0;	
  this.writeref = bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?document.layers[obj].document:0;	
  this.writeIt  = b_writeIt;					
  this.art      = 0;
  this.setit    = b_setit;
}
function b_writeIt(text)
{
  if (bw.ns4)
  {
    this.writeref.write(text);
    this.writeref.close();
  }
  else 
    this.writeref.innerHTML = text;
}

function addimage(name)
{
   var txt;
         
   txt = '<tr><td><img border="0" src="images/'
   txt += name+'" width="200" height="119"></td></tr>';
   return(txt);

}

function addline(name,href,page)
{
   var txt;
   var mark;
   var refname;
   
   mark = (href==page) ? 1 : 0;
   refname = 'a_'+href;
         
   txt = '<tr><td><p ';         
   if(mark)
     txt += 'class="head2">'
   else     
     txt += 'class="head2">'
   if(mark)
     txt += name
   else     
     txt += '<a name="'+refname+'" href="javascript:loadpage(\''+href+'\')" onmouseout="fadeout2(\''+refname+'\');return true;" onmouseover="fadein2(\''+refname+'\');return true;">'+name+'</a>'
   txt += '</p></td></tr></table>';
   txt += '<table border="0" cellpadding="0" cellspacing="0" colspan="2">';
   
   return(txt);
}

function addsubline(name,href,page)
{
   var txt;
   var mark;
   var refname;
   
   mark = (href==page) ? 1 : 0;
   refname = 'a_'+href;
         
   txt = '<tr><td width="18" valign="bottom"><img border="0" src="images/pfeil.gif" width="18" height="16"></td>'
   txt +='<td><p class=';         
   if(mark)
     txt += '"heady">'
   else     
     txt += '"headn">'
   if(mark)
     txt += name
   else     
     txt += '<a name="'+refname+'" href="javascript:loadpage(\''+href+'\')" onmouseout="fadeout2(\''+refname+'\');return true;" onmouseover="fadein2(\''+refname+'\');return true;">'+name+'</a>'
   txt += '</p></td></tr>';
   return(txt);
}

function addsubsubline(name,href,page)
{
   var txt;
   var mark;
   var refname;
   
   mark = (href==page) ? 1 : 0;
   refname = 'a_'+href;

   txt = '<tr><td width="18">&nbsp;</td><td><p ';         
   if(mark)
     txt += 'class="headsuby">'
   else     
     txt += 'class="headsubn">'
   txt +='<font color="#CC6600">_</font>'
   if(mark)
     txt += name
   else     
     txt += '<a name="'+refname+'" href="javascript:loadpage(\''+href+'\')" onmouseout="fadeout2(\''+refname+'\');return true;" onmouseover="fadein2(\''+refname+'\');return true;">'+name+'</a>'
   txt += '</p></td></tr>';
   return(txt);
}
   
function b_setit(page)
{
  var txt;

  if( bw.bw )
  {
     txt = "";
     switch(this.art)
     {
       case 2:
        txt  = '<table border="0" cellpadding="0" cellspacing="0">';

        switch(page)
        {
        case 'm_home':
              txt += addimage('punkte.gif');
              break;
        case 'm_kontakt':
        case 'u_kont_form':
        case 'u_kont_anfahrt':
              txt += addline('Kontakt','m_kontakt',page);
              txt += addsubline('Kontaktaufnahme','u_kont_form',page);
              txt += addsubline('Anfahrt','u_kont_anfahrt',page);
              break;
        case 'm_sitemap':
              txt += addline('Sitemap','m_sitemap',page);
              break;  
        case 'm_impressum':
        case 'u_impr_agb':
              txt += addline('Impressum','m_impressum',page);
              txt += addsubline('AGB','u_impr_agb',page);
              break;  
              
        case 'm_unternehmen':
        case 'll_bk':
        case 'll_mm':
        case 'll_ar':
        case 'll_ms':
        case 'u_unt_profil':
        case 'u_unt_historie':
        case 'u_unt_news':
        case 'u_unt_news20031104':
        case 'u_unt_news20031029':
        case 'u_unt_news20030801':
              txt += addline('Unternehmen','m_unternehmen',page);
              txt += addsubline('Profil', 'u_unt_profil',page);
              txt += addsubline('Historie',  'u_unt_historie',page);
              txt += addsubline('News','u_unt_news',page);
              break;
        case 'm_produkte':
        case 'u_prod_cm':
        case 'u_prod_wawi':
        case 'u_prod_cm_webavhg':
        case 'u_prod_cm_cswebdav':
        case 'u_prod_cm_csrm':
        case 'u_prod_wawi_imp3':
              txt += addline('Produkte','m_produkte',page);
              txt += addsubline('Content Management', 'u_prod_cm',page);
              txt += addsubsubline('CS WebDAV', 'u_prod_cm_cswebdav',page);
              txt += addsubsubline('CS Repository Manager', 'u_prod_cm_csrm',page);
              txt += addsubline('Warenwirtschaft','u_prod_wawi',page);
              txt += addsubsubline('CS IMP/3','u_prod_wawi_imp3',page);
              break;
        case 'm_referenzen':
        case 'u_ref_cm':
        case 'u_ref_wawi':
              txt += addline('Referenzen','m_referenzen',page);
              txt += addsubline('Content Management','u_ref_cm',page);
              txt += addsubline('Warenwirtschaft','u_ref_wawi',page);
              break;   
        case 'm_partner':
        case 'u_part_integration':
        case 'u_part_int_foxray':
        case 'u_part_int_ottemeier':
        case 'u_part_int_wichmann':
        case 'u_part_technologie':
        case 'u_part_tech_banctec':
        case 'u_part_tech_emc':
        case 'u_part_tech_point':
        case 'u_part_tech_filenet':
        case 'u_part_tech_fibunet':
        case 'u_part_tech_microsoft':
        case 'u_part_form':
              txt += addline('Partner','m_partner',page);
              txt += addsubline('Integrationspartner','u_part_integration',page);
              txt += addsubline('Technologiepartner','u_part_technologie',page);
              txt += addsubline('Partnerformular','u_part_form',page);
              break;   
        case 'm_service':
        case 'u_serv_down':
        case 'u_serv_link':
        case 'u_serv_demo':
              txt += addline('Service','m_service',page);
              txt += addsubline('Download','u_serv_down',page);
              txt += addsubline('Links','u_serv_link',page);
              txt += addsubline('Demo','u_serv_demo',page);
              break;
        }
        txt += '</table>';
        break;                    
     }
     this.writeIt(txt);
  }
}

function initdiv(div)
{
  var odiv;
  //Fixing the browsercheck for opera... this can be removed if the browsercheck has been updated!!
  bw.opera5 = (navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?true:false;
  if (bw.opera5) bw.ns6 = 0;
  odiv  = new makeChangeTextObj(div);
  //Both layers are hidden by default to prevent users from mousing over them and creating errors while the page loads.
  odiv.css.visibility = "visible";
  return(odiv);
}

function initheader()
{
    var o;
    o=initdiv('divheader');
    o.art = 1;
    if(top.oObj)
    {
       top.oObj.oHeader = o;
    }
}     
function initnavbar()
{
    var o;
    o=initdiv('divnavbar');
    o.art = 2;
    if(top.oObj)
    {
       top.oObj.oNavBar = o;
    }
}     

function loadpage(page)
{
   if(top.oObj)
   {
     top.oObj.loadPage(page+".htm");
/*
  document.getElementById("t-bild").src = "images/"+page+".jpg";
  document.getElementById("Bild").title = page;
*/
   }   
}   

function SetMainPage(page)
{
   if(top.oObj)
   {
      top.oObj.initMainPage(page);
   }        
}   

function openkontakt(sel)
{
   if(top.oObj)
   {
      top.oObj.loadkontakt(sel);
   }
   return(true);
}   

function GetPageName()
{
   var url   = document.URL;
   var f     = "";
   var i     = 0;
   var c     = "";
   for(i=0;i<url.length;i++)
   {
      c = url.substr(i,1);
      switch(c)
      {
        case '\\':
        case '/': f="";
                  break;
        default : f+=c;
                  break;
      }            
   }               
   i = f.indexOf('.');
   if(i>0)
      f = f.substring(0,i);
   f = f.toLowerCase();   
   return(f);
}   

function InitPage()
{
  var fname = GetPageName();
  switch(fname)
  {
    case 'topnav': 
    case 'lnav'  : initheader();
                   initnavbar();break;
    case 'm_kontakt2':
                   if( top.oObj )
                   {
                       if(top.oObj.kontaktsel!="")
                          document.dataForm.Thema.value=top.oObj.kontaktsel;
                   }
                   SetMainPage(fname);
                   break;
    default:       SetMainPage(fname);break;
  }
  
  var i;
  
  for(i=0;i<document.links.length;i+=1)
     if( !document.links[i].onmouseover )
     {
         document.links[i].onmouseover = lnk_onmouseover;
         document.links[i].onmouseout  = lnk_onmouseout;
     }  
     
}
  
function lnk_onmouseover()  
{
  if(this.title)
     status=this.title;
  else
     status="";
}        
function lnk_onmouseout()  
{
  status="";
}        

////////////// FADE //////////////////////

function makearray(n) {
    this.length = n;
    for(var i = 1; i <= n; i++)
        this[i] = 0;
    return this;
}

hexa = new makearray(16);
for(var i = 0; i < 10; i++)
    hexa[i] = i;
hexa[10]="a"; hexa[11]="b"; hexa[12]="c";
hexa[13]="d"; hexa[14]="e"; hexa[15]="f";

function hex(i) {
    if (i < 0)
        return "00";
    else if (i > 255)
        return "ff";
    else
       return "" + hexa[Math.floor(i/16)] + hexa[i%16];}

function setbgColor(r, g, b, element) 
{
      var hr = hex(r); var hg = hex(g); var hb = hex(b);
      element.style.color = "#"+hr+hg+hb;
}


function fade(sr, sg, sb, er, eg, eb, step, direction, element)
{
    for(var i = 0; i <= step; i++) 
    {
        setTimeout("setbgColor(Math.floor(" +sr+ " *(( " +step+ " - " +i+ " )/ " +step+ " ) + " +er+ " * (" +i+ "/" +step+ ")),Math.floor(" +sg+ " * (( " +step+ " - " +i+ " )/ " +step+ " ) + " +eg+ " * (" +i+ "/" +step+ ")),Math.floor(" +sb+ " * ((" +step+ "-" +i+ ")/" +step+ ") + " +eb+ " * (" +i+ "/" +step+ ")),"+element+");",i*step);
    }
}


function fadein1(element) 
{
  if( document.all)
      fade(192,192,192,255,255,255, 15, 1, element);
}
function fadeout1(element) 
{
  if( document.all)
      fade(255,255,255, 192,192,192, 15, 1, element);
}

function fadein2(element) 
{
  if( document.all)
      fade(128,128,128,204,102,0, 15, 1, element);
}
function fadeout2(element) 
{
  if( document.all)
      fade(204,102,0, 128,128,128, 15, 1, element);
}

