// Browser Check
function browserCheck() {
  var agt = navigator.userAgent.toLowerCase();
  this.ie4 = (document.all) ? true : false;
  this.ns4 = (document.layers) ? true : false;
  this.dom2 = (document.getElementById) ? true : false;
  this.ie5 = (this.ie4 && this.dom2) ? true : false;
  this.ns6 = (!this.ie4 && this.dom2) ? true : false;
  this.win = (agt.indexOf("win") != -1) ? true : false;
  this.mac = (agt.indexOf("mac") != -1) ? true : false;
}


// Popup Fenster
window.onerror=null
function popup(name,file,x,y,scroll) {
  var popup =  window.open(file,name,"width="+x+",height="+y+",screenX=200,screenY=200,scrollbars="+scroll+"");
  if(popup != null) popup.focus() //brings window to top
}
//this.window.focus();


// Farbwechsel
function sensitiveCell( element, mouse_in, color, bg) {
  if( mouse_in) {
    element.style.backgroundColor = color;
    if ( bg ) {
      element.style.backgroundImage = "url(img/" + bg + ")";
    }
  } else {
    element.style.backgroundColor = "#7AC5A0";
    if ( bg ) {
      element.style.backgroundImage = "url(img/" + bg + ")";
    }
  }
}

function clickMenue( link ) {
  this.location.href = link;
}

function hideLayer(whichLayer) {
  if (document.getElementById) {
    document.getElementById(whichLayer).style.visibility = "hidden";
  } else if (document.all) {
    document.all[whichlayer].style.visibility = "hidden";
  } else if (document.layers) {
    document.layers[whichLayer].visibility = "hidden";
  }
}

function showLayer(whichLayer) {
  if (document.getElementById) {
    document.getElementById(whichLayer).style.visibility = "visible";
  } else if (document.all) {
    document.all[whichlayer].style.visibility = "visible";
  } else if (document.layers) {
    document.layers[whichLayer].visibility = "visible";
  }
}

function handleClick(whichClick, name) {
  var teile= name.split(",");
  if (whichClick == "hide it") {
    for (i=0;i<teile.length;i++) hideLayer(teile[i]);
  } else if (whichClick == "show it") {
    for (i=0;i<teile.length;i++) showLayer(teile[i]);
  }
}


function marquee() {
  var i,k,msg="    Das ist ein News-Ticker vom Einkaufszentrum Schöneweide.  ";
  k=(75/msg.length)+1;
  for(i=0;i<=k;i++) msg+=" "+msg;
  document.marqueeform.marquee.value=msg.substring(position,position+120);
  if(position++==69) position=0;
  id=setTimeout("marquee()",1000/10);
}


function action() {
  if(!pause) {
    clearTimeout(id);
    pause=1;
  } else {
    marquee();
    pause=0;
  }
}