// Code um Seita auszublenden

function grayOut(vis, options) {
  // Pass true to gray out screen, false to ungray
  // options are optional.  This is a JSON object with the following (optional) properties
  // opacity:0-100         // Lower number = less grayout higher = more of a blackout 
  // zindex: #             // HTML elements with a higher zindex appear on top of the gray out
  // bgcolor: (#xxxxxx)    // Standard RGB Hex color code
  // grayOut(true, {'zindex':'50', 'bgcolor':'#0000FF', 'opacity':'70'});
  // Because options is JSON opacity/zindex/bgcolor are all optional and can appear
  // in any order.  Pass only the properties you need to set.
  var options = options || {}; 
  var zindex = options.zindex || 50;
  var opacity = options.opacity || 70;
  var opaque = (opacity / 100);
  var bgcolor = options.bgcolor || '#000000';
  var dark=document.getElementById('darkenScreenObject');
  if (!dark) {
    // The dark layer doesn't exist, it's never been created.  So we'll
    // create it here and apply some basic styles.
    // If you are getting errors in IE see: http://support.microsoft.com/default.aspx/kb/927917
    var tbody = document.getElementsByTagName("body")[0];
    var tnode = document.createElement('div');           // Create the layer.
        tnode.style.position='absolute';                 // Position absolutely
        tnode.style.top='0px';                           // In the top
        tnode.style.left='0px';                          // Left corner of the page
        tnode.style.overflow='hidden';                   // Try to avoid making scroll bars            
        tnode.style.display='none';                      // Start out Hidden
        tnode.id='darkenScreenObject';                   // Name it so we can find it later
    tbody.appendChild(tnode);                            // Add it to the web page
    dark=document.getElementById('darkenScreenObject');  // Get the object.
  }
  if (vis) {
    // Calculate the page width and height 
    if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) ) {
        var pageWidth = document.body.scrollWidth+'px';
        var pageHeight = document.body.scrollHeight+'px';
    } else if( document.body.offsetWidth ) {
      var pageWidth = document.body.offsetWidth+'px';
      var pageHeight = document.body.offsetHeight+'px';
    } else {
       var pageWidth='100%';
       var pageHeight='100%';
    }   
    //set the shader to cover the entire page and make it visible.
    dark.style.opacity=opaque;                      
    dark.style.MozOpacity=opaque;                   
    dark.style.filter='alpha(opacity='+opacity+')'; 
    dark.style.zIndex=zindex;        
    dark.style.backgroundColor=bgcolor;  
    dark.style.width= pageWidth;
    dark.style.height= pageHeight;
    dark.style.display='block';                          
  } else {
     dark.style.display='none';
  }
}


// Code für ToolTipp-Hilfe

//  #########  CREATES POP UP BOXES 
function link_on(b,xx,yy){;}
function link_off(){;}
// muss wieder gelöscht werden, da fehlerhaft!
// Ende ToolTipp-Hilfe




// Scroller für links (fa eintragen)
var message="Ihre Firma eintragen"
var cc_link1="ask_pw_firmeneintrag02.asp?nr=-1&aufruf=neu";
var cc_link2="kundenlogin.asp";
var neonbasecolor="#ffffff"
var neontextcolor="#ff3333"
var flashspeed=150  //in milliseconds
var n=0


function straffe(s) {
  // alle Zeilenwechsel zwischen Tags entfernen
  s = s.replace(/>(\r\n|\r|\n)</g, '><');
  // alle weiteren Zeilenwechsel durch Leerzeichen ersetzen
  s = s.replace(/(\r\n|\r|\n)/g, ' ');
  // alle überflüssigen Leerzeichen aus Tags entfernen
  s = s.replace(/\s+>/g, '>');
  // multiple Leerzeichen zusammenfassen
  s = s.replace(/\s+/g, ' ');
  // <p> </p> in <br> ändern
  s = s.replace(/<p>( |&nbsp;)*<\/p>/gi, '<br>');
  // <font><font>xx</font... zusammenfassen

  while (s.match(/<font\s.+?><font\s.+?>.+?<\/font>\s*<\/font>/gi)) {
   s = s.replace(/<font\s(.+?)><font\s(.+?)>(.+?)<\/font>\s*<\/font>/gi,'<font $1 $2>$3<\/font> ');
   }
  return s;
}


function initscrolltext()
{document.write('<a href="'+cc_link1+'">');
if (document.all||document.getElementById){
 document.write('<font color="'+neonbasecolor+'">')
 for (m=0;m<message.length;m++)
   { if(message.charAt(m)=='#')
     { document.write('</font></a></td></tr><tr align="center"><td colspan="2" class="navtabHL"><span id="neonlight'+m+'"> </span><font color="'+neonbasecolor+'"><a href="'+cc_link2+'">');
	 } else {
       document.write('<span id="neonlight'+m+'">'+message.charAt(m)+'</span>')
	 }
   }	  
 document.write('</font>')
 } else document.write(message)
document.write('</a>');
}

function crossref(number){
var crossobj=document.all? eval("document.all.neonlight"+number) : document.getElementById("neonlight"+number)
return crossobj
}

function neon(){
//Change all letters to base color
if (n==0){
 for (m=0;m<message.length;m++)
//eval("document.all.neonlight"+m).style.color=neonbasecolor
crossref(m).style.color=neonbasecolor
}

//cycle through and change individual letters to neon color
crossref(n).style.color=neontextcolor

if (n<message.length-1)
 n++
else{
 n=0
 clearInterval(flashing)
 setTimeout("beginneon()",1500)
 return
 }
}

function beginneon(){
 if (document.all||document.getElementById)
  flashing=setInterval("neon()",flashspeed)
}

//beginneon()



// onlyisdf Menü
lastmenu='';
function menu(m)
{ MM_showHideLayers('men1','','hide');
MM_showHideLayers('men2','','hide');
MM_showHideLayers('men3','','hide');
MM_showHideLayers('men4','','hide');
MM_showHideLayers('men5','','hide');
MM_showHideLayers('men6','','hide');
MM_showHideLayers('men7','','hide');
MM_showHideLayers('men8','','hide');
if(lastmenu!=m)
 {MM_showHideLayers(m,'','show');
 lastmenu=m;
 } else lastmenu='';
}

//Routinen für den Scroller rechts
function scrollObject(objName, main, width, height, bkgcol, direct, deccel, begin, speed, pause, classname) {

  this.objName = objName;
  this.main = main;
  this.one = main + "Block1";
  this.two = main + "Block2";
  this.block = new Array();
  this.blockup = 1;
  this.divup = 1;
  this.height = height;
  this.width = width;
 
  this.bkgcol = bkgcol;
  this.direct = direct;
//  this.deccel = Math.max(deccel, 1);
  this.deccel = Math.max(0.9, 0.9);
  this.begin = Math.max(Math.min(begin, (direct == "up" || direct == "down") ? height : width), 1);
//  this.speed = speed;
  this.speed = 40;
//  this.pause = pause;
  this.pause = 15000;
  this.slide = ((direct == "up" || direct == "down") ? height : width) / this.begin;
//  this.table = "<table class=\"xxx\" cellpadding=\"0\" cellspacing=\"0\" border=\"1\"><tr><td class=\"" + classname + "\" style=\"width:" + (width-10) + "px;height:" + height + "px;\">";
  this.table = "<table class=\"scrollerinnen\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td class=\"" + classname + "\">";
  this.scroll = scroll;
  this.scrollLoop = scrollLoop;
}

function scroll() {if (!document.getElementById) return false;
  document.getElementById(this.main).innerHTML = "<div id=\"" + this.one + "\"></div><div id=\"" + this.two + "\"></div>";
  var divList = [document.getElementById(this.main), document.getElementById(this.one), document.getElementById(this.two)];
  for (var i = 0; i <= 2; i++) {
    if (i > 0) {
      divList[i].style.position = "absolute";
      if (this.direct == "up" || this.direct == "down") {
        divList[i].style.left = "0px";
        divList[i].style.top = (i == 1) ? "0px" : ((this.direct == "up") ? "" : "-") + this.height + "px";
      } else {
        divList[i].style.left = (i == 1) ? "0px" : ((this.direct == "left") ? "" : "-") + this.width + "%";
        divList[i].style.top = "0px";
      } divList[i].innerHTML = this.table + this.block[i - 1] + "</td></tr></table>";
    } else {
      divList[i].style.position = "relative";
      divList[i].style.background = this.bkgcol;
    }
    divList[i].style.width = this.width + "%";
    divList[i].style.height = this.height + "px";
    divList[i].style.overflow = "hidden";
  } setTimeout(this.objName + ".scrollLoop();", this.pause);
}

function scrollLoop() {
  var divList = [document.getElementById(this.main), document.getElementById(this.one), document.getElementById(this.two)];
  this.slide = Math.max(this.slide / this.deccel, 1);
  var slideInc = (this.direct == "up" || this.direct == "left") ? -parseInt(this.slide) : parseInt(this.slide);
  if ((this.direct == "up" && Math.max(parseInt(divList[1].style.top) + slideInc, parseInt(divList[2].style.top) + slideInc) <= 0) ||
      (this.direct == "down" && Math.min(parseInt(divList[1].style.top) + slideInc, parseInt(divList[2].style.top) + slideInc) >= 0) ||
      (this.direct == "left" && Math.max(parseInt(divList[1].style.left) + slideInc, parseInt(divList[2].style.left) + slideInc) <= 0) ||
      (this.direct == "right" && Math.min(parseInt(divList[1].style.left) + slideInc, parseInt(divList[2].style.left) + slideInc) >= 0)) {
    this.slide = ((this.direct == "up" || this.direct == "down") ? this.height : this.width) / this.begin;
    if (++this.blockup >= this.block.length) this.blockup = 0;
    this.divup = (this.divup == 1) ? 2 : 1;
    if (this.direct == "up" || this.direct == "down") {
      divList[3 - this.divup].style.top = ((this.direct == "down") ? "-" : "") + this.height + "px";
      divList[this.divup].style.top = "0px";
    } else {
      divList[3 - this.divup].style.left = ((this.direct == "right") ? "-" : "") + this.width + "%";
      divList[this.divup].style.left = "0px";
    } divList[3 - this.divup].innerHTML = this.table + this.block[this.blockup] + "</td></tr></table>";
    setTimeout(this.objName + ".scrollLoop();", this.pause);
  } else {
    for (var j = 1; j <= 2; j++) {
      if (this.direct == "up" || this.direct == "down") {
        divList[j].style.top = (parseInt(divList[j].style.top) + slideInc) + "px";
      } else divList[j].style.left = (parseInt(divList[j].style.left) + slideInc) + "px";
    } setTimeout(this.objName + ".scrollLoop();", this.speed);
  }
}

// Ende Scroller rechts

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}


function nop(){;}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

