// HAUPTNAVIGATION

startList = function() {

	
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav_main");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
					
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
					
				}
			}
		}
	}
}


/*
// Iframe Höhenanpassung

function content_size_iframe_obj(iframe,minheight) {
			if (!window.opera && iframe) {
				var height = 0;
				if (iframe.contentDocument && iframe.contentDocument.body && iframe.contentDocument.body.offsetHeight) { //ns6 syntax
						height = iframe.contentDocument.body.offsetHeight * 1.05;
				} else if (iframe.Document && iframe.Document.body && iframe.Document.body.scrollHeight) { //ie5+ syntax
						height = iframe.Document.body.scrollHeight;
					} else {
						// use initial height then
						if (! minheight && iframe.height > 0 ) minheight=iframe.height;

				}
				if (minheight) height = Math.max(minheight, height);
				if (height) iframe.style.height = height+35+"px";
				}
		}

*/



// Zebrastripes

// this function is needed to work around 
// a bug in IE related to element attributes
function hasClass(obj) {
	var result = false;
	if (obj.getAttributeNode("class") != null) {
		result = obj.getAttributeNode("class").value;
	}
	return result;
}   

function stripe(id) {

	// the flag we'll use to keep track of 
	// whether the current row is odd or even
	var even = false;
  
	// if arguments are provided to specify the colours
	// of the even & odd rows, then use the them;
	// otherwise use the following defaults:
	var evenColor = arguments[1] ? arguments[1] : "#fff";
	var oddColor = arguments[2] ? arguments[2] : "#eee";
  
	// obtain a reference to the desired table
	// if no such table exists, abort
	var list = document.getElementById(id);
	if (! list) { return; }
	
	// by definition, tables can have more than one tbody
	// element, so we'll have to get the list of child
	// &lt;tbody&gt;s 
	var listitems = list.getElementsByTagName("li");

	// and iterate through them...
	for (var h = 0; h < listitems.length; h++) {
	
		var myli = listitems[h];
		myli.style.background =
		even ? evenColor : oddColor;
		
		// flip from odd to even, or vice-versa
		even =  ! even;
	}
}








// ALLE FUNKTIONEN STARTEN


function start() {
	startList();
	stripe('event_container', '#f2f5f7', '#ffffff')
}

window.onload=start;





// Verschlüsselte eMail Adresse

    function CryptMailto()
    {
        var n = 0;
        var r = "";
        var s = "mailto:"+document.forms[0].emailField.value;
        var e = document.forms[0].emailField.value;

        e = e.replace( /@/, " [at] ");
        e = e.replace( /\./g, " [dot] ");

        for( var i=0; i < s.length; i++ )
        {
            n = s.charCodeAt( i );
            if( n >= 8364 )
            {
                n = 128;
            }
            r += String.fromCharCode(n+1);
        }
        document.forms[0].cyptedEmailField.value = r;
        document.forms[0].HTMLCyptedEmailField.value = "<a href=\"javascript:Security_gfbCode('"+ r +"');\">"+ e +"</a>";
    }

    function gfbCode( s )
    {
        var n = 0;
        var r = "";
        for( var i = 0; i < s.length; i++)
        {
            n = s.charCodeAt( i );
            if( n >= 8364 )
            {
                n = 128;
            }
            r += String.fromCharCode( n - 1 );
        }
        return r;
    }

    function Security_gfbCode( s )
    {
        location.href=gfbCode( s );
    }



// FixFooter Funktion Workaround für Safari 2.0

function fixFooter() {
document.getElementById('footer').style.bottom = "0px";
}