/* begin Page */
list = new Array();

function oeffnefenster (url) {
 fenster = window.open(url, "fenster1", "width=300,height=300,status=yes,scrollbars=yes,resizable=yes");
 fenster.focus();
}

function init() {
    if (arguments.callee.done) return;
    arguments.callee.done = true;
    for (var i = 0; i < list.length; i++) list[i]();
};

if (document.addEventListener) {
    document.addEventListener("DOMContentLoaded", init, false);
}
/*@cc_on @*/
/*@if (@_win32)
document.write('<script id="__ie_onload" defer="defer" src="javascript:void(0)"><\/script>');
var script = document.getElementById("__ie_onload");
script.onreadystatechange = function() {
    if (this.readyState == "complete") {
     init();
    }
};
/*@end @*/
if (/WebKit/i.test(navigator.userAgent)) {
    var _timer = setInterval(function() {
        if (/loaded|complete/.test(document.readyState)) {
            clearInterval(_timer);
            init();
        }
    }, 10);
}
window.onload = init;

// fix ie blinking
var m = document.uniqueID
&& document.compatMode
&& !window.XMLHttpRequest
&& document.execCommand;

try{
     if(!!m)
{
         m("BackgroundImageCache", false, true)
      }
}
catch(oh){};

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.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_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 xGetElementsByClassName(clsName, parentEle, tagName) {
	var elements = null;
	var found = new Array();
	var slash = String.fromCharCode(92);
	var re = new RegExp(slash + "b" + clsName + slash + "b");
	if (!parentEle) parentEle = document;
	if (!tagName) tagName = '*';
	elements = parentEle.getElementsByTagName(tagName);
	if (elements) {
		for (var i = 0; i < elements.length; ++i) {
			if (elements[i].className.search(re) != -1) {
				found[found.length] = elements[i];
			}
		}
	}
	return found;
}

function jsHover() {
    var elements=xGetElementsByClassName("btn",document, "span");
    
	for (var i=0; i<elements.length; i++) {
	     if (!elements[i].tagName) continue;
		elements[i].parentNode.onmouseover=function() {
            this.getElementsByTagName("span")[0].className+=" hover";
        }
        elements[i].parentNode.onmouseout=function() {
            this.getElementsByTagName("span")[0].className=
            this.getElementsByTagName("span")[0].className.replace(/hover/, "");
        }
		
	}
}
list.push(jsHover);/* end Page */

/* begin Menu */
function Insert_Separators()
{   
    var menus = xGetElementsByClassName("menu", document);
    for (var i = 0; i < menus.length; i++) {
        var menu = menus[i];
        var childs = menu.childNodes;
        var listItems = [];
        for (var j = 0; j < childs.length; j++){
            var el = childs[j];
            if (String(el.tagName).toLowerCase() == "li")listItems.push(el);
        }
        for (var j = 0; j < listItems.length - 1; j++){
            var span = document.createElement('span');
            span.className = 'separator';
            var li = document.createElement('li');
            li.appendChild(span);
            listItems[j].parentNode.insertBefore(li, listItems[j].nextSibling);
        }
    }
}
list.push(Insert_Separators);

function Menu_IE6Setup() {
    var isIE6 = navigator.userAgent.toLowerCase().indexOf("msie") != -1 
		            && navigator.userAgent.toLowerCase().indexOf("msie 7") == -1;
	if (!isIE6) return;
	var aTmp2, i, j, oLI, aUL, aA;
	var aTmp = xGetElementsByClassName("menu", document, "ul");
	for (i=0;i<aTmp.length;i++) {
		aTmp2 = aTmp[i].getElementsByTagName("li");
		for (j=0;j<aTmp2.length;j++) {
			oLI = aTmp2[j];
			aUL = oLI.getElementsByTagName("ul");
			if (aUL && aUL.length) {
				oLI.UL = aUL[0];
				aA = oLI.getElementsByTagName("a");
				if (aA && aA.length)
					oLI.A = aA[0];
				oLI.onmouseenter = function() {
					this.className += " menuhover";
					this.UL.className += " menuhoverUL";
					if (this.A) this.A.className += " menuhoverA";
				};
				oLI.onmouseleave = function() {
					this.className = this.className.replace(/menuhover/,"");
					this.UL.className = this.UL.className.replace(/menuhoverUL/,"");
					if (this.A) this.A.className = this.A.className.replace(/menuhoverA/,"");
				};
			}
		}
	}
}
list.push(Menu_IE6Setup);
/* end Menu */

