bb=-1;
function changePic()
{
if(bb<newpics.length)
{bb=bb+1;}
 if(document.images)
   {document.images["bildchange"].src= "images/intelli/bildwechsel/"+newpics[bb];}
 tid = setTimeout("changePic()",3000);
 if(bb==newpics.length)
 {clearTimeout(tid);bb=-1;changePic();}
}


function checkthisform(a)
{
z = a.elements.length;

for(x=0;x<z;x++)
{
if(a.elements[x].name.indexOf("*")>-1 && a.elements[x].value=="")
{
 feld = a.elements[x].name;
 alert(feld+" ist leer oder nicht korrekt eingetragen!");
 return false;
}
}
}


 browser = navigator.appName;
 version = navigator.appVersion;
 browser_version = navigator.userAgent.toLowerCase();
 os = navigator.platform;
 ie = "Microsoft Internet Explorer";
 nn = "Netscape";



function check()
{
var str = document.form.email.value
if (document.form.email.value.indexOf ('@', 0) == -1 || str.length < 6 || str.length > 30 || document.form.email.value.indexOf ('.',0) == -1){
alert("\nBitte geben Sie eine gueltige e-Mail-Adresse ein!");
document.form.email.select();
document.form.email.focus();
return false;
}
}


NS4 = (document.layers) ? true : false;
IE4 = (document.all && !document.getElementById) ? true : false;
IE5 = (document.all && document.getElementById) ? true : false;
NS6 = (!document.all && document.getElementById) ? true : false;
IE7 = ((version.indexOf('MSIE') > -1 && version.indexOf('MSIE 5') < 0 && version.indexOf('MSIE 6') < 0) && (document.getElementById)) ? true : false;
    
is_firefox = (browser_version.indexOf('firefox') > -1 && (document.getElementById)) ? true : false;
is_chrome  = (browser_version.indexOf('chrome') > -1 && (document.getElementById))  ? true : false;
is_safari  = (browser_version.indexOf('safari') > -1 && browser_version.indexOf('chrome') < 0 && (document.getElementById))  ? true : false;
is_opera   = (browser_version.indexOf('opera') > -1 && (document.getElementById))  ? true : false;
var a;



function mOver(cell,color,hoverClass){

   if(IE5 || NS6){
       cell.setAttribute("bgColor",color);
       cell.style.cursor = 'pointer';
       if(cell.tagName=="TD"){
          subcell = cell;
       }else{
          subcell = cell.rows[0].cells[0];
       }
       if(subcell.childNodes[0].tagName!="A"){
          subcell = cell.rows[0].cells[1];
       }
       if(NS6){
          subcell.childNodes[0].setAttribute("class",hoverClass);
       }else{
          subcell.childNodes[0].setAttribute("className",hoverClass);
       }
   }
}

function mOut(cell,color,outClass)
{
 if(IE5 || NS6){
       cell.setAttribute("bgColor",color);
       cell.style.cursor = 'default';
       if(cell.tagName=="TD"){
          subcell = cell;
       }else{
         subcell = cell.rows[0].cells[0];
       }
       if(subcell.childNodes[0].tagName!="A"){
          subcell = cell.rows[0].cells[1];
       }
       if(NS6){
          subcell.childNodes[0].setAttribute("class",outClass);
       }else{
          subcell.childNodes[0].setAttribute("className",outClass);
       }
    }
}

function mClick(cell,color){
    if(IE5 || NS6){
       tName = cell.tagName;
       if (tName=="TABLE"){
           subcell = cell.rows[0].cells[0];
           chillds = subcell.childNodes.length-1;
           if(subcell.childNodes[chillds].tagName == "A"){
             hrefs   = subcell.childNodes[chillds].href;
           }else{
              subcell = cell.rows[0].cells[1];
              chillds = subcell.childNodes.length-1;
              hrefs   = subcell.childNodes[chillds].href;
           }
           targets = subcell.childNodes[chillds].target;
           if(targets!="" && targets!="_self"){
             window.open(hrefs,'');
           }else{
               window.location.href=hrefs;
           }
       } else{
           chillds = cell.childNodes.length-1;
           hrefs   = cell.childNodes[chillds].href;
           window.location.href=hrefs;
         }
     }
}



function logwin(){
   x=screen.availHeight;
   y=screen.availWidth
   windo = window.open('','fenster','width=700,height=550,left=0,top=0,scrollbars=yes');
}

function locMail(addr,subj){
   addr = addr.replace("79",".");
   addr = addr.replace("89","@");
   location.href= "mailto:"+addr+"?subject="+subj;
}

function mailer(s){
   location.href=s;
}

function firmMail(message){
   location.href= "mailto:info@folag.com?subject="+message;
}


function scroll(){
   g = document.getElementById("bottom_menu1");
   z= g.offsetTop;
   hoehe_scroll = document.body.scrollHeight;
   unterschied = hoehe_scroll-xx;
}

function timeri(s){
   if(IE4){
      elm = document.all[s];if(elm)elm.style.visibility="hidden";
   }
   if(IE5 || NS6){
      elm = document.getElementById(s);if(elm)elm.style.visibility="hidden";
      if(elm2){
         elm2.style.visibility = 'hidden';
      }
   }
}

function showDisplay(s){
   if(IE5 || NS6){
      elm = document.getElementById(s);
      if(elm.style.display=="none"){
         elm.style.display = "block";
      }
      else{
         elm.style.display ="none";
      }
   }
}

function newWindow(href,name,settings){
   window.open(href,name,settings);
}


function grossbild(t,u,v,y,x){
  if(NS4 || IE4 || (IE5 && !IE7)){
     grossbild2(t,u,v,y,x);
  }
  else{
      bild = "images/intelli/"+t;
      load_img = new Image();
      load_img.src = bild;
      grossbildNew(t,u,v,y,x)
  }
}

function grossbildNew(t,u,v,y,x){
   bild = "images/intelli/"+t;
   weite = parseInt(y);
   hoehe = parseInt(x)+20;

   elm   = document.getElementById("showImageLayer");
   elm2  = document.getElementById("showBgLayer");

   if(u==""){u="Bild";}

   elm.style.visibility = 'hidden';
   elm.style.height = 1;
   elm.style.width  = 1;


   if(IE7 || NS6){
      shad = '<table border=0 width=100% height=100% cellspacing=0 cellpadding=0><tr><td><div id=imageHead style=float:left;background-image:url(images/picTitleBg.jpg);background-color:#CCCCCC;height:18;width:8;>&nbsp;</div></td><td><div id=imageHead style=float:left;background-image:url(images/picTitleBg.jpg);background-color:#CCCCCC;height:18><span style="color:white;float:left;padding: 3 0 0 0;" class=title>'+u+'</span><div style="text-align: center;float: right;font-size: 13px;font-weight: bold;height: 18px;background-color: #E2E2E2;color: #5F5F5F;cursor: pointer;" onclick=timeri("showImageLayer")><img src="images/closePic.gif" name="closerGif" id="closerGif" style="display:none;" border=0 onclick=timeri("showImageLayer")></div></div></td><td><img src="images/intelli/backgrounds/eor.png" border="0" alt=""></td></tr><tr height=100%><td></td><td></td><td background="images/intelli/backgrounds/bgr.png"></td></tr><tr><td><img src="images/intelli/backgrounds/eul.png" width="8" height="11" border="0" alt=""></td><td width=100% background="images/intelli/backgrounds/bgu.png"></td><td><img src="images/intelli/backgrounds/eur.png" border="0" alt=""></td></tr></table>';
   }else{
      shad = '<table border=0 width=100% height=100% cellspacing=0 cellpadding=0><tr><td valign=top width=8><div id=imageHead style="float:left;background-color:#CCCCCC;height:18;width:8;">&nbsp;</div></td><td valign=top><div id=imageHead style="float:left;background-color:#CCCCCC;height:18;display:inline"><div style="color:white;float:left;padding: 3 0 0 0;" class=title>'+u+'</div><div style="text-align:center;float:right;font-size:13px;font-weight:bold;padding: 3 0 0 0;width:17;height:18;background-color:#E2E2E2;color:#5F5F5F;cursor:pointer;" onclick=timeri("showImageLayer")>X</div></div></td></tr></table>';
   }

   elm.innerHTML = shad;
   elm.onmousedown = doMove;
   elm.onmouseup   = stopMove;

   elm.style.backgroundImage = "url('"+ bild +"')";

   Left = elm.offsetLeft;
   Top  = elm.offsetTop;

   elm2.style.visibility = 'visible';
   elm2.style.height = document.body.scrollHeight;

   document.onmousemove = FirstPos;
   document.onclick     = FirstPos;
   elm.style.height = hoehe;
   elm.style.width  = weite;

}



nw=0;
nh=0;
function slideIt(){

  if(IE5 || IE7){
     if(elm.offsetHeight > document.body.offsetHeight){
        elm.style.top = document.body.scrollTop;
     }
     if(elm.offsetWidth > document.body.offsetWidth){
        elm.style.left = document.body.offsetWidth - elm.offsetWidth;
     }
     if(elm.offsetHeight < document.body.offsetHeight && elm.offsetWidth < document.body.offsetWidth){
        elm.style.top = document.body.scrollTop + (document.body.clientHeight / 2) - (hoehe/2);
        elm.style.left = document.body.scrollLeft + (document.body.clientWidth / 2) - (weite/2);
      }
        elm2.style.height = document.body.scrollTop + document.body.clientHeight;
  }
  if(NS6){
     //elm.style.top = mouseTop - hoehe;
     //elm.style.left = mouseLeft - (weite/2);
     if(elm.offsetHeight > window.innerHeight){
        elm.style.top = 20;
     }
     if(elm.offsetWidth > window.innerWidth){
        elm.style.left = window.innerWidth - elm.offsetWidth;
     }
     if(elm.offsetHeight < window.innerHeight && elm.offsetWidth < window.innerWidth){
        elm.style.top = (parseFloat(window.innerHeight) + parseFloat(window.pageYOffset)) - (window.innerHeight/2) - (hoehe/2);
        elm.style.left = (parseFloat(window.innerWidth) + parseFloat(window.pageXOffset)) - (window.innerWidth/2) - (weite/2);
     }

     elm2.style.height = (parseFloat(window.innerHeight) + parseFloat(window.pageYOffset));
  }
 /*
  if(weite > hoehe){
     faktor = Math.ceil(weite/hoehe);
     fw = 20;
     hw = Math.ceil(fw/faktor)+1;
  }else if(hoehe > weite){
     faktor = Math.ceil(hoehe/weite);
     hw = 20;
     fw = Math.ceil(hw/faktor)+1;
  }
  else{
     fw = 20;
     hw = 20;
  }

  if(nw < weite){
    aw=nw+fw;
    nw=nw+fw;
  }
  if(nh < hoehe){
    nh=nh+hw;
    ah=nh+hw;
  }
  elm.style.width = aw;
  elm.style.height= ah;

  timeouter = setTimeout("slideIt()",1);  */
  noslide = "true";
  if(nw >=weite && nh >= hoehe || noslide=="true"){
     /*clearTimeout(timeouter);nw=0;nh=0;*/

     if(IE5){
        elm.style.width = weite;
        elm.style.height= hoehe;
        //document.getElementById("closerGif").style.display='block';
        elm2.style.height = document.body.scrollHeight;
     }
     if(IE7 || NS6){
        elm.style.width = weite+12;
        elm.style.height= hoehe+8;
        document.getElementById("closerGif").style.display='block';
        elm2.style.height = document.body.scrollHeight;

     }
  }

}

 function FirstPos(evt){
    document.onmousemove = '';
    document.onclick = '';
    elm.style.visibility = 'visible';
    if(IE7 || IE5){
       mouseTop  = event.clientY;
       mouseLeft = event.clientX;
    }
    if(NS6){
       mouseTop  = evt.pageY;
       mouseLeft = evt.pageX;
    }
    slideIt(evt);
 }


function makePos(evt){
      if(IE5 || IE7){
         if(elm.offsetLeft < document.body.clientWidth - elm.offsetWidth){
            elm.style.left = event.clientX + Left - InitLeft;
            elm.style.top  = event.clientY+Top-InitTop;
         }
         else{
            elm.style.left= document.body.clientWidth-elm.offsetWidth-1;
            }
      }
      if(NS6){
         elm.style.left = evt.pageX + Left - InitLeft;
         elm.style.top  = evt.pageY + Top - InitTop;
      }
      elm2.style.height = document.body.scrollHeight;
 }


 function stopMove(){
   document.onmousemove = '';
 }

 function doMove(evt){
    document.onmousemove = makePos;
    if(IE5 || NS6){
       elm.style.left = elm.offsetLeft;
       elm.style.top  = elm.offsetTop;
       if(IE5 || IE4){
          InitLeft= event.clientX;
          InitTop = event.clientY;
       }
       if(NS6){
          InitLeft= evt.pageX;
          InitTop = evt.pageY;
       }
       Left = elm.offsetLeft;
       Top  = elm.offsetTop;
       makePos(evt);
    }
 }




function grossbild2(t,u,v,y,x){
   if(IE4){
      weite = parseInt(y)+8;
      hoehe = parseInt(x)+47;
   }
   else{
      weite = parseInt(y)+10;
      hoehe = parseInt(x)+30;
   }
   w = window.open('','fenster','width='+ weite +',height='+ hoehe+',resizable=yes,statusbar=no');
   w.resizeTo(weite,hoehe);
   if(u==""){u="Bild";}
   w.document.open();
   w.document.write('<html><head><title>'+u+'</title><link rel=stylesheet href=intellisite_css.php></head><body style="border: 0px; margin: 0px 0px 0px 0px;" scroll="auto" scrolling="auto">');
   w.document.write('<div align="center"><img src="images/intelli/'+ t +'" width="'+ y +'" height="'+ x +'" alt="'+ u +'" border="'+ v +'">');
   w.document.write('</div><script language=JavaScript>window.focus()</script></body></html>');
   w.document.close();
}

function go_url(theurl,ziel){
   if(ziel=="1")
   {w = window.open();}
   if(ziel=="0")
   {top.location.href='theurl';}
}

function formchecking(form){
   str = form.elements['search'].value;
   if(str==""){
      alert("Bitte geben Sie einen Suchbegriff ein");return false;
   }
}

function tab_id(){}
function tdd(){}
