var ns = document.layers;
var ie = document.all;
var w3c = document.documentElement;

function GalerieOeffnen(x)
	{
		open("galerie" + x + ".htm", "galerie", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=420,screenX=30,screenY=30");

	}
	
function login()
	{
		if(document.loginform.pwd.value == "intra")
			window.location = "http://www.cfnen.org.na/intra";
		else
			alert("password incorrect!");
	}
	
function loginOnSubmit()
	{
		if(document.loginform.pwd.value == "intra")
		{
			return true;
		}
		else
		{
			alert("password incorrect!");
			return false;
		}
	}

function get_element(name) {
  if(w3c) {
    return document.getElementById(name);
	}
	else if(ns) {
	return eval("document." + name);
	}
	else if(ie) {
	return eval("document.all." + name);
	}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function ref(name,farbe) {
  get_element(name).style.backgroundColor = farbe;
  altname=name;
}

function rem() {
  get_element(altname).style.backgroundColor = "#E8EAF5";
}

function rem2() {
  get_element(altname).style.backgroundColor = "#003399";
}

var menOpen = false;
timerOn = false;

function checkTimer() {
	if (timerOn) {
		clearTimeout(timerOn);
		timerOn = false;
	}
}

function startTimer() {
	timerOn = setTimeout("show();", 300);
}

function weg() {
	if (menOpen) {
 		checkTimer();
		if ((ns)&&(document.layers[menOpen])) {
			document.layers[menOpen].visibility = "hide";
		  }
		if ((!ns)&&(get_element(menOpen))) { 
		get_element(menOpen).style.visibility = "hidden";
		  }
		menOpen = false;
	}
}

function show(welches){
	weg();
	if (welches) {
		if ((ns)&&(document.layers[welches])) {
			document.layers[welches].visibility = "show";
		}
		if ((!ns)&&(get_element(welches))) {
			get_element(welches).style.visibility = "visible";
		}
		if (get_element(welches)) {
			get_element(welches).onmouseover = checkTimer;
			get_element(welches).onmouseout = startTimer;
		}
		menOpen = welches;
	}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

/* Bereich fuer die Schriftgroessenaenderung (Anfang) */
function FontSize(_size, _targets, _exceptions) {
  this.size = _size || 12;
  this.min = 9;
  this.max = 16;
  this.targets = _targets || ['fsTextbody1','fsTextbody2','fsHeadnormal'];
  this.exceptions = _exceptions || 'haferbrei#hirsebrei#';
  this.lucky = this.checkBrowser();
}
FontSize.prototype = { 
  larger : function() {
    (this.size < this.max) ? ++this.size : this.size;
    if (this.lucky) this.scale();
  },
  smaller : function() {
    (this.size > this.min) ? --this.size : this.size + 'px';
    if (this.lucky) this.scale();
  },
  scale : function() {
    var oTarget = null;
    for (var k = 0; k < this.targets.length; k++) {
      oTarget = document.getElementById(this.targets[k]);
      if (oTarget) this.changeSize(oTarget);
    }
  },
  changeSize : function(oo) {
    if (oo.style) {
      oo.style.fontSize = this.size + 'px';
      oo.style.lineHeight = '1.3em';
    }
    for (var k = 0; k < oo.childNodes.length; k++) if (this.exceptions.indexOf((oo.childNodes[k].id || '#') + '#') == -1) this.changeSize(oo.childNodes[k]);
  },
  checkBrowser : function() {
    if (document.all && document.getElementById) return true;
    if (navigator.userAgent.indexOf('Netscape6/') >= 0 || navigator.userAgent.indexOf('Gecko') >= 0) return true;
    return false;
  },
  inc : function(oo) {
    this.larger();
    if (oo) oo.blur();
    return false;
  },
  dec : function(oo) {
    this.smaller();
    if (oo) oo.blur();
    return false;
  }
}
font_size = new FontSize();
/* Bereich fuer die Schriftgroessenaenderung (Ende) */