/*
-------------------------------------------------------------------------
DFM2HTML v3.4 JavaScript Library

Copyright 2003-2009 Jörg Kiegeland. All rights reserved.

This javascript library is generated by the DFM2HTML tool.
You may adapt this script for your Web pages, provided these opening credit
lines (down to the lower dividing line) are kept intact.
You may not reprint or redistribute this code without permission.

Visit http://www.dfm2html.com
-------------------------------------------------------------------------  
*/

var LinkTimer; //used for delayed menu popup
var ToOpen; //menuitem for which to open submenu next
var glSelCompo; //element over which mouse is over
var TailSubMenu; //deepest opened submenu
var glEventObj; //manage event bubbling
var IE=navigator.appName=="Microsoft Internet Explorer";

/**
 * Diese Funktion prüft, ob der aktuelle Browser ein
 * Internet Explorer mit einer Version kleiner 7 ist
 */
function isIElte6(){
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
		var v=new Number(RegExp.$1)
		return v<7;
	}
	return false;
}

function isIElte7(){
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
		var v=new Number(RegExp.$1)
		return v<8;
	}
	return false;
}

function UpdateImm(Self) {
	var oldvis=Self.style.visibility; //IE doesnt update immediately, force update
	Self.style.visibility="hidden";
	Self.style.visibility=oldvis;
}

function OpenMenu() {
	var Self=ToOpen;
	ToOpen=null;
	if (Self.style.display!="none") return;
	TailSubMenu=Self;
	if (!Self.IsInline) {
		var ox=Number(Self.getAttribute("menuleft"));;
		var oy=Number(Self.getAttribute("menutop"));
		for (var p=Self.FParentMenuItem; p && p!=Self.offsetParent; p=p.offsetParent) {
			oy+=p.offsetTop;
			ox+=p.offsetLeft;
		}
		Self.style.top=oy+"px";
		Self.style.left=ox+"px";
		Self.style.position="absolute";
	}
	if (Self.filters) {
		if (Self.filters.blendTrans) Self.filters.blendTrans.Apply();
		if (Self.filters.revealTrans) Self.filters.revealTrans.Apply();
	}
	Self.style.display = "";
	setTimeout("if (TailSubMenu) UpdateImm(TailSubMenu);",1);
	if (Self.filters) {
		if (Self.filters.blendTrans) Self.filters.blendTrans.Play();
		if (Self.filters.revealTrans) Self.filters.revealTrans.Play();
	}
	Self.FParentMenuItem.parentNode.FOpenMenuItem=Self.FParentMenuItem;
	CheckDesignState(Self.FParentMenuItem);
}

function glCheckClose(CloseItem) {
	var p=TailSubMenu;
	while (p) {
		TailSubMenu=p;
		if (VirParent(TailSubMenu,ToOpen)) break;
		if (!ToOpen && VirParent(TailSubMenu,glSelCompo) && !(CloseItem && VirParent(CloseItem,TailSubMenu))) break;
		p.style.display = "none";
		TailSubMenu=null;
		p.FParentMenuItem.parentNode.FOpenMenuItem=null;
		CheckDesignState(p.FParentMenuItem);
		p=p.FParentMenuItem.parentNode;
		for (p; p && !p.FParentMenuItem ; p=p.parentNode);
	}
	if (ToOpen) OpenMenu();
}

function UpdateOver(Self,IsOver,Clicked) {
if (!(glEventObj && RealParent(Self,glEventObj))) {
	var _glSelCompo=glSelCompo;
	glSelCompo=null;
	if (IsOver) glSelCompo=Self;
	if (Self.FSubMenu && Self.FSubMenu.getAttribute("clicktoopen")) {
		if (Self.FSubMenu && Self.FSubMenu.style.display!="none") {
			if (Clicked) glCheckClose(Self);
		} else
		if (Clicked && !Self.FSubMenu.getAttribute("onlybyurl") || IsOver && Self.FSubMenu && Self.FSubMenu.getAttribute("resumeopen") && Self.parentNode.FOpenMenuItem) {
			ToOpen=Self.FSubMenu;
			glCheckClose();
		}
	} else {
		Self.IsDown=Clicked;
		if (IsOver) ToOpen=Self.FSubMenu;
		if (Clicked) glCheckClose(); else
		if (IsOver && glSelCompo.FSubMenu)
		if (Self.FSubMenu.getAttribute("resumeopen") && Self.parentNode.FOpenMenuItem) {glCheckClose();} else  {
			clearTimeout(LinkTimer);
			LinkTimer=setTimeout("glCheckClose();",glSelCompo.FSubMenu.FReactionTime);
		}
	}
	if (_glSelCompo==glSelCompo) _glSelCompo=null;
	if (_glSelCompo) CheckDesignState(_glSelCompo);

	if (Self.parentNode.FOpenMenuItem) CheckDesignState(Self.parentNode.FOpenMenuItem);
	CheckDesignState(Self);
}
glEventObj=Self;
}

function CheckDesignState(Self) {
	var base=Self.getAttribute("cbase");
    if (base==null || base=="") return;
	var s=base+"_nm";
	IsDown=(Self.getAttribute("down") ||
		Self.FPC && Self.FPC.FURLAnchor==Self && !Self.getAttribute("notifurl") || 
		Self.getAttribute("ifover") && Self==glSelCompo ||
		!Self.FSubMenu && Self.IsDown && !Self.getAttribute("notifmouse") || 
		Self.FSubMenu && Self.FSubMenu.style.display!="none" && !Self.getAttribute("notifmenu"));		
	if (Self==glSelCompo && !(IsDown && Self.getAttribute("noover"))) {
		 if (IsDown) 
		 		s+=" "+base+"_dn"+" "+base+"_ov"+" "+base+"_od"+" dn ov od"; else
				s+=" "+base+"_ov"+" ov";
	} else
	if (IsDown) s+=" "+base+"_dn"+" dn";
	if (s==Self.className) return;
	var blend= Self.filters && s!=base+"_nm" && Self.childNodes.length<=1;
	if (blend) {
		if (Self.filters.blendTrans) Self.filters.blendTrans.Apply();
		if (Self.filters.revealTrans) Self.filters.revealTrans.Apply();
	}
	Self.className=s;
	if (blend) {
		if (Self.filters.blendTrans) Self.filters.blendTrans.Play();
		if (Self.filters.revealTrans) Self.filters.revealTrans.Play();
	} 
	adjPos(Self);
}

function GotoSlide(n) {
	n.style.display="block";
	var act=n.parentNode.act;
	if (act && act!=n) {
		n.offsetHeight;act.offsetHeight;//for KHTML
		var diff=n.offsetHeight-act.offsetHeight;
		act.style.display="none";
		var h;
		for (var p=n.offsetParent; p && p.style && !(p.style.top && p.style.bottom) && !(p.style.overflow=="scroll" || p.style.overflow=="auto"); p=p.offsetParent)
		{h=p.style.height.replace(/px/,""); if (isNaN(h) || !h) break; p.style.height=Number(h)+diff+"px";}
	}
	n.parentNode.act=n;
}

function MouseOutEvent() {
	UpdateOver(this,false,false);
}

function MouseOverEvent() {
	if (glSelCompo!=this) UpdateOver(this,true,false);
}

function MouseDownEvent() {
	if (IE && (this.style.overflow=="scroll" || this.style.overflow=="auto")){
		var t=document.body.createTextRange();
		t.moveToElementText(this);
		var d=document.selection.createRange();
		if (d.parentElement().tagName!="INPUT" && d.parentElement().tagName!="TEXTAREA" && d.compareEndPoints("StartToStart",t)==-1) document.selection.empty();
	}
	UpdateOver(this,true,true);
	return true;
}


function ChildPos(c) {
	for (var i=0; i<=c.parentNode.childNodes.length-1; i++) if (c.parentNode.childNodes[i]==c) return i;
} 

function VirParent(p,c) {
	for (c; c ; c=(c.FParentMenuItem?c.FParentMenuItem:c.parentNode)) if (p==c) return true;
	return false;
} 
function RealParent(p,c) {
	for (c=c.parentNode; c ; c=c.parentNode) if (p==c) return true;
	return false;
} 

function MouseUpEvent() {
	if (this.FLinkPage) GotoSlide(this.FLinkPage);
	Linked(this);
	UpdateOver(this,true,false);
}

function adjChildPos(p) {
	for (var c=p.firstChild; c!=null; c=c.nextSibling) adjPos(c);
}

function adjFullChildPos(p) {
	adjPos(p);
	for (var c=p.firstChild; c!=null; c=c.nextSibling) adjFullChildPos(c);
	adjBody(p);
}

function ResizeEvent() {
	var p=(this==window?document.body:this);
	adjPos(p);
	adjChildPos(p);
	adjBody(p);
}

function adjBody(p) {
	if (isIElte6() && p==document.body) {
		var x=0;
		var y=0;	
		for (var c=p.firstChild; c!=null; c=c.nextSibling) if (c.offsetLeft!=null) {
			x=Math.max(x,c.offsetLeft+c.offsetWidth);
			y=Math.max(y,c.offsetTop+c.offsetHeight);
		}
		document.body.style.width=Math.max(0,x-getNumber(document.body.currentStyle.paddingRight)-getNumber(document.body.currentStyle.paddingLeft))+"px";
		document.body.style.height=Math.max(0,y-getNumber(document.body.currentStyle.paddingTop)-getNumber(document.body.currentStyle.paddingBottom))+"px";
	}
}

function adjPos(e) {
	if (!e.style) return;
	var p=(e.parentNode==document.body?e.parentNode.parentNode:e.parentNode);
	if (e.centerH) e.style.left=Math.max(0,p.clientWidth/2-(e.offsetWidth+mb(e,'Left')+mb(e,'Right'))/2);
	if (e.dynWidth) e.style.width=Math.max(1,p.clientWidth-mb(e,'Left',true)-mb(e,'Right',true)+(-getNumber(e.currentStyle.left)-getNumber(e.currentStyle.right)));
	if (e.dynBlockWidth) e.style.width=Math.max(1,p.clientWidth-mb(e,'Left',true)-mb(e,'Right',true)+(-getNumber(e.parentNode.currentStyle.paddingLeft)-getNumber(e.parentNode.currentStyle.paddingRight)));
	if (e.dynHeight) e.style.height=Math.max(1,p.clientHeight-mb(e,'Top',true)-mb(e,'Bottom',true)+(-getNumber(e.currentStyle.top)-getNumber(e.currentStyle.bottom)));
	if (e.dynLeft) e.style.left=p.clientWidth-mb(e,'Left')-mb(e,'Right')-e.offsetWidth+(-getNumber(e.currentStyle.right));
	if (e.dynTop) e.style.top=p.clientHeight-mb(e,'Top')-mb(e,'Bottom')-e.offsetHeight+(-getNumber(e.currentStyle.bottom));
}

function Linked(Self){
	if (Self.FPC) {
		var OldAnchor=Self.FPC.FURLAnchor;
		Self.FPC.FURLAnchor=Self;
		if (OldAnchor) CheckDesignState(OldAnchor);
	}
	CheckDesignState(Self);
}

function scrollFragment(sv) {
	var v=document.getElementById(sv.substr(sv.indexOf("#")+1));
	if (v) {v.scrollIntoView(true); if (v.parentNode==document.body) window.scrollTo(v.offsetLeft,v.offsetTop); }
}

function getNumber(n) {
	var h=n.replace(/px/,""); if (isNaN(h) || !h) return 0; return Number(h);
}

function isPx(n) {
	var h=n.replace(/px/,""); return !isNaN(h) && h;
}

function mb(e,s,p) {
	return getNumber(e.currentStyle.getAttribute("margin"+s))+(!p||e.type=="button"||e.type=="submit"||e.type=="reset"||e.tagName=="SELECT"?0:(e.currentStyle.getAttribute("border"+s+"Style")!="none"?getNumber(e.currentStyle.getAttribute("border"+s+"Width")):0)+getNumber(e.currentStyle.getAttribute("padding"+s)));
}

function getRelativeBefore(e) {
	for (var p=e.previousSibling; p; p=p.previousSibling) if (p.style!=null && p.style.position=="relative") return p;
	return null;
}

function dhtml() {

var everything=document.all;
if (!everything) everything=document.getElementsByTagName("*");
for(var i=0; i<everything.length; i++) {
	var e=everything[i];
	if (e.nodeType!=1) continue;
	var s=e.tagName;
	if (!IE && (e.getAttribute("scroll")=="yes" || e.getAttribute("scrolling")=="yes")) {
		e.style.overflowX="auto";
		e.style.overflowY="scroll";
	}
	if (isIElte7() && IE) {
		e.onresize=ResizeEvent; 
		e.centerH=isIElte7() && e.style.marginLeft=="auto" && e.style.marginRight=="auto";
		e.dynWidth=isIElte6() && !e.centerH && isPx(e.currentStyle.left) && isPx(e.currentStyle.right);
		e.dynBlockWidth=isIElte6() && e.style.position=="relative" && !isPx(e.currentStyle.width) && e.parentNode && (e.tagName=="A" || e.tagName=="DIV");
		e.dynHeight=isIElte6() && isPx(e.currentStyle.top) && isPx(e.currentStyle.bottom);
		e.dynLeft=isIElte6() && !isPx(e.currentStyle.left) && isPx(e.currentStyle.right);
		e.dynTop=isIElte6() && !isPx(e.currentStyle.top) && isPx(e.currentStyle.bottom);
		if (isIElte6() && e.style.position=="relative" && !getRelativeBefore(e)) {var d=document.createElement("div"); d.style.position="relative"; d.style.overflow="hidden";  d.style.height="0px"; e.parentNode.insertBefore(d,e); }
	}
	if (!(s=="IMG" || s=="img" || s=="A" || s=="a" || s=="DIV" || s=="div" || s=="BODY" || s=="body" || s=="BUTTON" || s=="button" || s=="INPUT" || s=="input")) continue;
	if (s=e.getAttribute("cbottom")) e.style.bottom=Number(s);
	if (s=e.getAttribute("parentmenuitem")) {
		e.FParentMenuItem=document.getElementById(s);
		if (!e.FParentMenuItem) continue;
		e.FParentMenuItem.FSubMenu=e;
		e.IsInline=e.FParentMenuItem && e.parentNode==e.FParentMenuItem.parentNode && e.parentNode!=document.body;
		if (s=e.getAttribute("reactiontime")) e.FReactionTime=Number(s); else e.FReactionTime=1;
	}
       	e.onmouseout=MouseOutEvent;
	e.onmouseover=MouseOverEvent;
	e.onmousedown=MouseDownEvent;
	e.onmouseup=MouseUpEvent;
	if ((s=e.getAttribute("target")) && s.substr(0,1)!="_") e.FPC=document.getElementById(s);
	if (s=e.getAttribute("linkpage")) { e.FLinkPage=document.getElementById(s); e.FPC=e.FLinkPage.parentNode;}
	if (e.getAttribute("pageselected")) GotoSlide(e);
	if (e.getAttribute("linked")) Linked(e);
}

if (window.opera){
	var ori_onload=document.body.onload;
	document.body.onload = function (){
		top.document.body.style.display="none";
		top.document.body.style.display="";
		if (ori_onload) ori_onload();
	}
	document.body.onresize = function (){
		document.body.style.display="none";
		document.body.style.display="";
	}
}


if (isIElte6() && IE) document.body.style.display="";

scrollFragment(document.URL);

if (isIElte7() && IE) adjFullChildPos(document.body);
if (isIElte7() && IE) setTimeout("adjFullChildPos(document.body);",0);

}

function preload() {
	var p=document.prel; if(!p){p=new Array();document.prel=p}var i;for(i=0; i<preload.arguments.length; i++) {p[i]=new Image; p[i].src=preload.arguments[i]; }
}

if (isIElte6() && IE) { document.body.style.display="none"; }