// BROWSERTEST
var DHTML = 0, DOM = 0, MS = 0, NS = 0, OP = 0;

if(document.getElementById) {
  DHTML = 1;
  DOM = 1;
}
if (window.opera) {
  OP = 1;
}
if(document.all && !OP) {
  DHTML = 1;
  MS = 1;
}
if(document.layers && !OP) {
  DHTML = 1;
  NS = 1;
}

// Hauptmenue
menu_aktuell_over = null;

function menuOver(name) {
  if (name == top.menu_aktuell_on) return;
  if (menu_aktuell_over) menuOut(menu_aktuell_over);
  if (top.menu_aktuell_on) menuOut(top.menu_aktuell_on);
  
  this.document.images[name].src = "images/"+top.lang+"/"+name+"_on.gif";
  menu_aktuell_over = name;
}

function menuOut(name) {
  if (name == menu_aktuell_over) menu_aktuell_over = null; 
  if (name != top.menu_aktuell_on)
    this.document.images[name].src = "images/"+top.lang+"/"+name+".gif";
}

function menuOn(name) {
  tmp = top.menu_aktuell_on;
  top.menu_aktuell_on = name;
  if (tmp) menuOut(tmp);
  //document.location.href = name+".html";
}


// Untermenues
sub_aktuell_over = null;
sub_aktuell_on = null;

function subMenuOver(name) {
  if (name == sub_aktuell_on) return;
  if (sub_aktuell_over) subMenuOut(sub_aktuell_over);
  if (sub_aktuell_on) subMenuOut(sub_aktuell_on);
  
  this.document.images[name].src = "images/"+name+"_on.gif";
  sub_aktuell_over = name;
}

function subMenuOut(name) {
  if (name == sub_aktuell_over) sub_aktuell_over = null; 
  if (name != sub_aktuell_on)
    this.document.images[name].src = "images/"+name+".gif";
}

function subMenuOn(name) {
  if (sub_aktuell_over && sub_aktuell_over != name) subMenuOut(sub_aktuell_over);
  if (sub_aktuell_on && sub_aktuell_on != name) 
    this.document.images[sub_aktuell_on].src = "images/"+sub_aktuell_on+".gif";
  
  this.document.images[name].src = "images/"+name+"_on.gif";
  sub_aktuell_on = name;
}

function getElement(id) {
  if(DOM) return document.getElementById(id);
  else if(MS) return document[id];
  else if(NS) return document[id];
  else return void(0);
}

function writeElement(id, text, top) {
  var x;
	if (DOM){
		x = document.getElementById(id);
		x.innerHTML = text;
	} else if (MS) {
		x = document.all[id];
		x.innerHTML = text;
	}	else if (NS)	{
		x = document.layers[id];
		text2 = '<P CLASS="testclass">' + text + '</P>';
		x.document.open();
		x.document.write(text2);
		x.document.close();
	}
  if (top) x.style.top = top;
}

var content_top = 238;
var scrollTimer = null;
function verScroll(element, dir, spd, my, del) {
  miny = 0;
  delay = 1;
  direction = dir;
  speed = parseInt(spd);
  if (del) delay = parseInt(del);
  if (my) miny = parseInt(my);
  scrollTimer = null;
  page = getElement(element).style;
  var y_pos = parseInt(page.top);
  if (direction == "dn") {
    page.top = (y_pos - (speed));
  } else if (direction == "up" && y_pos < content_top) {
    page.top = (y_pos + (speed));
  }
  scrollTimer = setTimeout("verScroll(element,direction,speed,miny,delay)", delay);
}

function stopScroll() {
  if (scrollTimer) clearTimeout(scrollTimer);
  scrollTimer = null;
}


// Aufruf: changeFrames(url, frame, url, frame, url, frame, ...)
function changeFrames() {
  for (i = 0; i < changeFrames.arguments.length; i++){
    dsturl = changeFrames.arguments[i++];
    dstframe = changeFrames.arguments[i];
    
    if (parent.frames[dstframe]) {
      if (parent.frames[dstframe].location.href.indexOf(dsturl) < 0)
        parent.frames[dstframe].location.href = dsturl;
    }
    
    if (top.frames[dstframe]) {
      if (top.frames[dstframe].location.href.indexOf(dsturl) < 0)
        top.frames[dstframe].location.href = dsturl;
    }
  }
}

