/******************************************************
** lib.js version 1.01 Sep 20, 2002
*******************************************************/


/* menu item constructor */
function _Item(text, link) {
   this.text=text;
   this.link=link;
}

/* site constructor */
function _Site(text, link) {
   this.link=link;
   this.text=text;
}

/* button constructor */
function _Button(text, img, link,width,target) {
   this.link=link;
   this.img=img;
   this.text=text;
   this.width=width;
   this.target=target;
}

/* page constructor */
function _Page(text, link) {
   this.items = new Array()             /* array of menu items  */
   this.sites = new Array()             /* array of sites       */
   this.siteIdentifier = "";            /* the Site Identifier  */
   this.item  = "0";                    /* the current selected menu item, default: home */
   this.hideLeftNavigation = false;     /* parameter to control display of left navigation bar, default: false */
   this.trace = false;                  /* if true a _popup window will appear showing generated code */
   this.traceWindow;
   this.traceVar = '';
   this.commonServer='http://';
   this.buttons = new Array();

   
}

_Page.prototype.showLeftNavigator = function() {
    /* determine if we need to show left navigator */

    return(!(this.item==null ||
             this.item==""   ||
             this.hideLeftNavigation))
}

_Page.prototype.output = function(html) {
	var encoded_html;
	if (this.trace) {
		encoded_html=html.replace(/\&/g,"&amp;");
		encoded_html=encoded_html.replace(/>/g,"&gt;");
		encoded_html=encoded_html.replace(/</g,"&lt;");
		encoded_html=encoded_html.replace(/\n/g,"<br />");
		this.traceWindow.document.write(encoded_html)
	}
	document.write(html)
}

_Page.prototype.showButtons  = function() {
	var buttons_html='';

	for (i=0;i<this.buttons.length;i++) {
		buttons_html+='<a href="'+this.buttons[i].link+'">'+
									'<img src="img/'+this.buttons[i].img+
									'" height="23" alt="'+this.buttons[i].text+
									'" border="0" width="'+this.buttons[i].width+
									'" /></a>\n'+
		(i<(this.buttons.length-1)?
									'<img src="img/t.gif" width="9" height="1" alt="" />\n':'')
	}
	return(buttons_html)
}

_Page.prototype.startPage = function(item) {
	/* If no item is passed as parameter, try and lookup the current location, */
	if (item==null){
		var tmp = linkLookup(this,document.location.pathname);
		this.item=(tmp=="")?"-1":tmp;
	}else{
		if(item==""){
			this.item="-1";
		}else{
			this.item = item
		}
	}
	if((this.item=="-1"||this.item=="0") && !this.hideLeftNavigation)this.hideLeftNavigation = true;

	/* Global variables */
	var hierArr=this.item.split("_");
	var currentLevel=hierArr.length;
	var deepest=(this.items[this.item+"_1"]==null)?true:false;
	var comsvr = this.commonServer;
	var currentItem=this.items[this.item];
	this.traceVar+='current level='+currentLevel+'<br>deepest='+deepest;

	function linkLookup(page,link) {
		for (index in page.items) {
			if (link == page.items[index].link) {
				return(index)
			}
		}
		return ""
	}

	function leftNavigation (page) {
		var html='';
		var highlightJs='';

		function boldItem(thisItem,level){
			var str='';
			str='\
			  <tr>\n\
			   <td class="p-lnnavl'+level+'"'+highlightJs+'>\n\
			    <img src="'+comsvr+'/img/ln_arrow.gif" width="17" height="15" alt=""/>\n\
			    <a href="'+thisItem.link+'">'+thisItem.text+'</a>\n\
			   </td>\n\
			  </tr>\n'
  		return str;
		}

		function boldItemCur(thisItem,level){
			var str='';
			str='\
			  <tr id="p-lntrsel">\n\
			   <td class="p-lnnavl'+level+'">\n';
			//hide arrow if level1 and no child pages
			if(!(level==1 && deepest))str+='<img src="'+comsvr+'/img/ln_arrow.gif" width="17" height="15" alt=""/>\n';
			str+='\
			    <b>'+thisItem.text+'</b>\n\
			   </td>\n\
			  </tr>\n'
  		return str;
		}

		function normItem(thisItem,level,thisIndex){
			var str='';
			var level
			str='\
			  <tr class="p-lnitem">\n\
			   <td class="p-lnnavl'+level+'"'+highlightJs+'>\n';
			//show arrow if this item has child pages
			if(!(page.items[thisIndex+"_1"]==null)){
				str+='<img src="'+comsvr+'/img/ln_arrow_right.gif" width="17" height="15" alt=""/>\n';
			}
			str+='\
			    <a href="'+thisItem.link+'">'+thisItem.text+'</a>\n\
			   </td>\n\
			  </tr>\n'
  		return str;
		}

		function normItemCur(thisItem,level){
			var str='';
			str='\
			  <tr class="p-lnitem" id="p-lntrsel">\n\
			   <td class="p-lnnavl'+level+'">'+thisItem.text+'</td>\n\
			  </tr>\n'
  		return str;
		}

		function showParents(page) {
			var str='',indexStr='';
			var myItem;
			for (var i=0; i<hierArr.length-1; i++) {
				indexStr+=hierArr[i];
				myItem = page.items[indexStr];
				str+=boldItem(myItem,i+1)
				indexStr+='_';
			}
			return str;
		}

		function showChildren(index) {
			var str='', childIndex='';
			var myItem;
			var level=currentLevel+1;
			//check if this is a siblingslist or a normal child pages list
			if(deepest && currentLevel>1)level=currentLevel;

			//loop through children pages, start from 1!
			for (var i=1;!(page.items[index+"_"+i]==null);i++) {
				childIndex=index+"_"+i;
				myItem=page.items[childIndex];
				//check if current item
				if(childIndex==page.item){
					str+=normItemCur(myItem,level);
				}else{
					str+=normItem(myItem,level,childIndex);
				}
			}
			return str;
		}

		function showSiblings(index){
			var parentIndex=hierArr.slice(0,-1).join("_");
                        var str=showChildren(parentIndex);
			return str;
		}


		/*
		Build the HTML
		*/
		html+='<table width="175" border="0" cellspacing="0" cellpadding="0" id="p-lntable">\n';
		html+='	<tr id="p-lnrow1"><td>&nbsp;</td></tr>\n';
		html+=showParents(page);
		if(deepest && currentLevel>1){
			//show current item in siblings list
			html+=showSiblings(page.item);
		}else{
			//show current item
			html+=boldItemCur(currentItem,currentLevel);
			//show child pages
			html+=showChildren(page.item)
		}

		html+='</table>\n'
		return(html)
	}

	function relatedSitesLayer(obj){
		var myItem;
		var str='\
<div id="p-rsdiv" onmouseover="_stopTimer()" onmouseout="_startTimer(\'_showHideRelatedSites()\',1600);">\n\
	<div id="p-rsshadowright">\n\
		<div id="p-rsrighttopimg">\n\
			<div id="p-rsshadowbottom">\n\
				<div id="p-releftbottomimg">\n\
					<div id="p-rscontent">\n'
		for (var i=0;i<obj.sites.length; i++) {
			myItem=obj.sites[i];
			str+='				<div'+((i==0)?' id="main"':'')+' onmouseover="_stopTimer()"><a href="'+myItem.link+'">'+myItem.text+((i==0)?'<img src="img/rs_arrow.gif" width="19" height="11" alt="" class="p-syst"/>':'')+'</a></div>\n';
		}
		str+='\
					</div>\n\
				</div>\n\
			</div>\n\
		</div>\n\
	</div>\n\
</div>\n'
		return str;
	}

	function relatedSitesLink(obj){
		var str='\
<table width="130" border="0" cellspacing="0" cellpadding="0">\n\
	<tr id="p-rs-row1">\n\
		<td id="p-relatedlayerplace"><img src="img/t.gif" width="130" height="9" alt="" class="p-syst"/></td>\n\
	</tr>\n\
	<tr id="p-rs-row2">\n\
		<td align="left">';
		if (obj.sites.length==0){
			str+='&nbsp;';
		}else{
			if (obj.sites.length==1){
				str+='<a href="'+obj.sites[0].link+'">'+obj.sites[0].text+'</a>';
			}else{
				str+='<a href="#" onmouseover="_showHideRelatedSites()">'+obj.sites[0].text+'<img src="img/rs_arrow.gif" width="19" height="11" alt="" class="p-syst"/></a>';
			}
		}
		str+='\
		</td>\n\
	</tr>\n\
</table>\n'
		return str;
	}
	//alert(relatedSitesLayer(this));

	if (this.trace) {
	   this.traceWindow = window.open()
	   this.traceWindow.document.open()
	   this.traceWindow.document.write('<html><body><h1>Trace of generated HTML</h1><pre>')
	}

	var html='\
<script type="text/javascript">_createMenuLayers();</script>\n'+relatedSitesLayer(this)+'\
<table id="p-body" border="0" cellspacing="0" cellpadding="0" width="100%"> \n\
	<tr id="p-row1" class="p-bg005aff"> \n\
		<td width="10"><img src="img/t.gif" width="10" height="1" alt="" /></td>\n\
		<td width="17"><img src="img/t.gif" width="17" height="1" alt="" /></td>\n\
		<td width="158"><img src="img/t.gif" width="158" height="1" alt="" /></td>\n\
		<td width="17"><img src="img/t.gif" width="17" height="1" alt="" /></td>\n\
		<td><img src="img/t.gif" width="560" height="1" alt="" /></td>\n\
		<td width="17"><img src="img/t.gif" width="17" height="1" alt="" /></td>\n\
		<td width="10"><img src="img/t.gif" width="10" height="1" alt="" /></td>\n\
	</tr>\n\
	<tr id="p-row2" class="p-bg005aff">\n\
    <td colspan="2">&nbsp;</td>\n\
		<td colspan="3">\n\
			<table border="0" cellspacing="0" cellpadding="0" width="100%">\n\
				<tr>\n\
					<td><div align="center"><img src="vdfamilie/img/awww_dewitz.gif" width="250" height="23" alt="v. Dewitz Logo" /></div></td>\n\
					<td align="right">\n'+this.showButtons()+'\n\
					</td>\n\
				</tr>\n\
			</table>\n\
		</td>\
		<td colspan="2">&nbsp;</td>\n\
	</tr>\n\
	<tr id="p-row3" class="p-bg005aff">\n\
		<td colspan="7">&nbsp;</td>\n\
	</tr>\n\
	<tr id="p-row4">\n\
		<td id="p-onlefttop" colspan="2" >&nbsp;</td>\n\
                <td id="p-onmiddle"  colspan="3">\n\
			<table border="0" cellspacing="0" cellpadding="0" width="100%">\n\
				<tr>\n\
					<td class="p-siteidentifier">'+this.siteIdentifier+'\n\
                                        </td>\n\
					<td align="right" valign="top">\n'+relatedSitesLink(this)+'\n\
					</td>\n\
				</tr>\n\
			</table>\n\
		</td>\n\
		<td id="p-onrighttop" colspan="2">&nbsp;</td>\n\
	</tr>\n\
	<tr id="p-row5" valign="bottom">\n\
		<td id="p-lefttop">&nbsp;</td>\n';
			html+=(this.item=="0")?'		<td id="p-snlefthome">&nbsp;</td>\n':'		<td id="p-snleft" class="p-snleft" valign="top">&nbsp;</td>\n';
			html+='\
		<td id="p-snmiddle" colspan="3">&nbsp;</td>\n\
		<td id="p-snright">&nbsp;</td>\n\
		<td id="p-righttop">&nbsp;</td>\n\
	</tr>\n'

    if (this.showLeftNavigator()) {
       /* show left navigator */
       html+='\
	<tr id="p-row6" valign="top">\n\
		<td id="p-left"></td>\n\
		<td colspan="2" class="p-bgefefef">\n\
		<!-- begin left navigation -->\n';
				html+=leftNavigation(this);
				html+='\
		<!-- end left navigation -->\n\
		</td>\n\
		<td class="p-bgffffff">&nbsp;</td>\n\
		<td class="p-bgffffff">\n\
		<!-- start of content area -->\n\n'
    }
    else {
        /* hide left navigator */
        html+='\
	<tr id="p-row6" valign="top">\n\
		<td id="p-left"></td>\n\
		<td id="p-leftinside">&nbsp;</td>\n\
		<td colspan="3" class="p-bgffffff">\n\
		<!-- start of content area -->\n\n'
    }

    this.output(html)

}



_Page.prototype.endPage = function() {
	var ln = (this.showLeftNavigator()?"-ln":"");

	var html='\n\n\
		<!-- end of content area -->\n\
                </td>\n\
		<td id="p-rightinside">&nbsp;</td>\n\
		<td id="p-right">&nbsp;</td>\n\
	</tr>\n\
	<tr id="p-row7">\n\
		<td id="p-bottomleft">&nbsp;</td>\n\
		<td id="p-bottomleftcorner'+ln+'">&nbsp;</td>\n\
                <td id="p-bottom'+ln+'">&nbsp;</td>\n\
		<td id="p-bottom" colspan="2">&nbsp;</td>\n\
		<td id="p-bottomrightcorner">&nbsp;</td>\n\
                <td id="p-bottomright">&nbsp;</td>\n\
	</tr>\n\
</table>\n\
\n';

	this.output(html)

	if (this.trace) {
	   this.traceWindow.document.write('</pre><hr>'+this.traceVar+'<hr>')
	   this.traceWindow.document.write('</body></html>')
	   this.traceWindow.document.close()
	}

}

_Page.prototype.printVersion = function(cellid){
	var docTitle=window.document.title;
	var docHead=document.getElementsByTagName("head")[0].innerHTML;
        
	var docContent=document.getElementById(cellid).innerHTML;
	var prWindow;

	prWindow = window.open('','thePrWindow','width=603,height=480,menubar,resizable,toolbar,scrollbars')
  prWindow.document.open()
  prWindow.document.write('\
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">\n\
<html>\n\
	<head>'+docHead+'</head>\n\
	<body class="p-printversion">\n\
	<table width="100%" cellpadding="0" cellspacing="0">\n\
	<tr id="p-row1" class="p-bg005aff">\n\
		<td width="20"><img src="img/t.gif" width="20" height="1" alt="" /></td>\n\
		<td></td>\n\
		<td width="20"><img src="img/t.gif" width="20" height="1" alt="" /></td>\n\
	</tr>\n\
	<tr id="p-row2" class="p-bg005aff">\n\
    <td>&nbsp;</td>\n\
		<td>\n\
			<table border="0" cellspacing="0" cellpadding="0" width="100%">\n\
				<tr>\n\
					<td><img src="img/www_dewitz.gif" width="100" height="23" alt="Internet Homepage der Familie von Dewitz" /></td>\n\
				</tr>\n\
			</table>\n\
		</td>\n\
		<td>&nbsp;</td>\n\
	</tr>\n\
	<tr id="p-row3" class="p-bg005aff">\n\
		<td colspan="3">&nbsp;</td>\n\
	</tr>\n\
	<tr id="p-carow1">\n\
		<td colspan="3">&nbsp;</td>\n\
	</tr>\n\
	<tr>\n\
    <td>&nbsp;</td>\n\
    <td>\n'+docContent+'</td>\n\
    <td>&nbsp;</td>\n\
    </tr>\n\
    <tr id="p-carow1">\n\
      <td colspan="3">&nbsp;</td>\n\
    </tr>\n\
    </table></body>\n</html>')

    prWindow.document.close()
}


/*
We need only a single instance of _Page class.
 */
var _page = new _Page();

var debugString='';
function _debugWindow(html){
	var encoded_html;
	var traceWindow;

	encoded_html=html.replace(/\&/g,"&amp;");
	encoded_html=encoded_html.replace(/>/g,"&gt;");
	encoded_html=encoded_html.replace(/</g,"&lt;");
	encoded_html=encoded_html.replace(/\n/g,"<br />");
	traceWindow = window.open()
  traceWindow.document.open()
  traceWindow.document.write('<html><body><h1>Debug Trace</h1><pre>')
	traceWindow.document.write(encoded_html)
	traceWindow.document.write('</pre></body></html>')
	traceWindow.document.close()
}



//////////////////////////////
// Begin Fold Out Menu Code //
/////////////////////////////
function _getflta(ap){try{if(ap.filters){_flta=1}}catch(e){}}

// The following line is critical for menu operation, and must appear only once.
var _menunum=0;
var _menus=new Array();
var _d=document;

function _addmenu(){_menunum++;_menus[_menunum]=menu;}
function _dumpmenus(){mt="";for(a=1;a<_menus.length;a++){mt+=" menu"+a+"=_menus["+a+"];"};eval(mt)}

////////////////////////////////////
// Editable properties START here //
////////////////////////////////////


_effect = ""// Special _effect string for IE5.5 or above please visit http://www.milonic.co.uk/menu/filters_sample.php for more filters

_subMenuYOffset=1;	//Extra offset for the submenu fold-outs
_timegap=1600			// The time delay for _menus to remain visible
_followspeed=5			// Follow Scrolling speed
_followrate=40			// Follow Scrolling Rate
_suboffset_top=0;		// Sub menu offset Top position
_suboffset_left=5;		// Sub menu offset Left position

_style1=[				// _style1 is an array of properties. You can have as many property arrays as you need. This means that _menus can have their own style.
"000066",				// Mouse Off Font Color
"DFDFDF",				// Mouse Off Background Color
"FF6600",				// Mouse On Font Color
"EFEFEF",				// Mouse On Background Color
"FFFFFF",				// Menu Border Color
11,						// Font Size in pixels
"normal",				// Font Style (italic or normal)
"bold",					// Font Weight (bold or normal)
"Verdana, Arial",		// Font Name
6,						// Menu Item Padding
"img/foldout_arrow.gif",	// Sub Menu Image (Leave this blank if not needed)
,						// 3D Border & Separator bar
,						// 3D High Color
,						// 3D Low Color
"000066",				// Current Page Item Font Color (leave this blank to disable)
"EFEFEF",				// Current Page Item Background Color (leave this blank to disable)
"",						// Top Bar image (Leave this blank to disable)
"000000",				// Menu Header Font Color (Leave blank if headers are not needed)
"cccccc",				// Menu Header Background Color (Leave blank if headers are not needed)
]

var _mainItemHighlight='';
var _hArr=new Array();
var _l1items=0;
var _menuNamesTrail=new Array();

function _createMenuData(){
	var currentIndex='';
	var currentUrl='';
	var mainStartStr='_addmenu(menu=["mainmenu",78,21,,,,_style1,1,"left",_effect,0,1,0,,,,,,,," ",';
	var mainItemsStr='';
	var endStr=']);';
	var subItemsStr='';
	var parentIndex='';
	var childIndex='';
	var moreChildren=false;
	var myItem;
	var l='',u='';
	var parentsArray=new Array();
	var parentsArrayStr="";
	var t=0;
	var menuCounter=2;
	var menuString="", oldmenuString="";
	var tempArr=new Array();
	var oldLevel=0, newLevel=0;

	//if "" is passed to startpage function -or- if no match is found using the document.location act as home page
	currentIndex=_page.item;

	//find items that have child pages
	for (index in _page.items) {
		if (!(_page.items[index+"_1"]==null)){
			parentsArray[t]=index;
			newLevel=index.split("_").length;
			if(newLevel == oldLevel){
				if(oldmenuString!="")oldmenuString+="-";
				menuString=oldmenuString+"menu"+menuCounter;
			}
			if(newLevel > oldLevel){
				oldmenuString=menuString;
				if(menuString!="")menuString+="-";
				menuString+="menu"+menuCounter;
			}			
			if(newLevel < oldLevel){
				tempArr=menuString.split("-");
				oldmenuString="";
				for (var i=0; i<(newLevel-1); i++) {
					oldmenuString+=tempArr[i]+"-";
				}
				menuString=oldmenuString+"menu"+menuCounter;				
			}
			menuCounter++
			oldLevel=newLevel;
			_menuNamesTrail[t]=menuString;
			t++			
		}
	}
	//menu1,menu
	parentsArrayStr=parentsArray.join();
	parentsArrayStr=","+parentsArrayStr+",";
	
	//alert("parentsArray="+parentsArray.join()+" - .length="+parentsArray.length+"\n_menuNamesTrail = "+_Menunamestrail.join())
	//create top level menu
	for (i=0;!(_page.items[String(i)]==null);i++) {
		l=_page.items[String(i)].text;
		u=_page.items[String(i)].link;
		mainItemsStr+=',"'+((i==0)?'':'&nbsp;&nbsp;')+l+'&nbsp;&nbsp;&nbsp;",';
		//check if this main item should contain a _popup menu
		mainItemsStr+=(parentsArrayStr.indexOf(","+i+",")!=-1)?'"show-menu='+i+'","'+u+'"':'"'+u+'",""';
		mainItemsStr+=',"",1\n';
		_l1items++;
	}

	//only pages that contain child elements require submenu's
	for (i=0; i<parentsArray.length; i++) {
		parentIndex=parentsArray[i];
		_hArr=parentIndex.split("_");
		subItemsStr+='_addmenu(menu=["'+parentIndex+'",,,130,1,,_style1,,"left",_effect,,,,,,,,,,,"-'+_page.items[_hArr[0]].text+'-",\n';

		//loop through child elements
		for (var j=1;!(_page.items[parentIndex+"_"+j]==null);j++) {
			childIndex=parentIndex+'_'+j;
			myItem=_page.items[childIndex];
			//see if this child contains any child pages
			if (!(_page.items[childIndex+"_1"]==null)){moreChildren=true}

			if(moreChildren){
				subItemsStr+=',"&nbsp;'+myItem.text+'", "show-menu='+childIndex+'","'+myItem.link+'",,1\n';
			}else{
				subItemsStr+=',"&nbsp;'+myItem.text+'", "'+myItem.link+'",,,1\n';
			}
			moreChildren=false;
		}
		subItemsStr+=endStr+'\n';
	}
	
	//alert(subItemsStr);
	eval(mainStartStr+mainItemsStr+endStr);
	eval(subItemsStr);

	//current menu
	_hArr=currentIndex.split("_");
	if(currentIndex!='-1'){
	_mainItemHighlight=_page.items[_hArr[0]].link;
	}else{
	_mainItemHighlight='x';
	}
}

/*
 DHTML Menu version 3.3.18
 Written by Andy Woolley
 Copyright 2002 (c) Milonic Solutions. All Rights Reserved.
 Vist http://www.milonic.co.uk/menu or Email menu3@milonic.com
 You may use this menu on your web site free of charge as long as you inform us of your intentions with your URL AND
 You place a link to http://www.milonic.co.uk/menu AND ALL copyright notices remain in place in all files including your home page
 Comercial licenses and support contracts are available on request.
 This script featured on Dynamic Drive (http://www.dynamicdrive.com)
*/

var _firstItem=false;
var _Mtimer;
var _ns4, _ns6, _mac, _opera, _ns61, _ie4, _konq;
var _mp, _oatop, _aleft, _oaleft, _osy, _oww, _owh, _frs, _fre, _nsmatch;
var _a, _am, _oa, _om, _flta;
var _hlarr=new Array();
var _hlcnt, _hll;
var _Mname=new Array();
var _parr=new Array();
var _imar=new Array();
var _tmenu=new Array();
var _timo, el, _nshl, _omv, _df, im, _ofrac, _omnu, _ac, _m, _sy, _ShM, _ww, _wh;
var _mr="";
var _cgm, _bgt;
var _prevLyr="menu1";
var _offsetl=0;

_Mtimer=setTimeout("_sis()",9999);_d=document;smc=-1;MLoaded=0;
_ns4=(_d.layers)?true:false
_ns6=(navigator.userAgent.indexOf("Gecko")!=-1)?true:false
_mac=(navigator.appVersion.indexOf("_mac")!=-1)?true:false
if(_ns6||_ns4)_mac=false
_opera=(navigator.userAgent.indexOf("_opera")!=-1)?true:false
_ns61=(parseInt(navigator.productSub)>=20010726)?true:false
_ie4=(!_d.getElementById&&_d.all)?true:false;
_konq=(navigator.userAgent.indexOf("Konqueror")!=-1)?true:false
_mp=(_ns6)?"pointer":"hand";_oatop=0;_aleft=0;_oaleft=1;_osy=0;_oww=-1;_owh=-1;_frs=0;_fre=0;_nsmatch=0;
_hlcnt=0;_hll=0;
_timo=0;el=0;_nshl=0;_omv=0;_df=1;im=0;_ofrac=0;_omnu=0;_ac=22;_m=1;_sy=1;_ShM=0;_ww=0;_wh=0;_mr=",";
if(!_opera)_bgt="Color";
_cgm=0;


function _gmobj(mtxt){if(_d.getElementById){_m=_d.getElementById(mtxt)}else if(_d.all){_m=_d.all[mtxt]}else if(_d.layers){_m=_d.layers[mtxt]}return _m;}
function _gmstyle(mtxt){_m=_gmobj(mtxt);if(!_ns4){if(_m)_m=_m.style;}return _m;}
function _spos(gm,t_,l_,h_,w_){px="px";if(_ns4){px="";gms=gm;if(w_!=null)gms.clip.width=w_;if(h_!=null)gms.clip.height=h_;}else if(_opera){px="";gms=gm.style;if(w_!=null)gms.pixelWidth=w_;if(h_!=null)gms.pixelHeight=h_}else{gms=gm.style;if(w_!=null)gms.width=w_+px;if(h_!=null)gms.height=h_+px;}if(t_!=null){if(gm.id.indexOf("hel")>-1){t_=t_;}else{t_=t_+1;}gms.top=t_+px;}if(l_!=null)gms.left=l_+px}
function _gpos(gm){if(_ns4){t_=gm.top;l_=gm.left;h_=gm.clip.height;w_=gm.clip.width;}else if(_opera){t_=gm.style.pixelTop;l_=gm.style.pixelLeft;h_=gm.style.pixelHeight;w_=gm.style.pixelWidth;}else if(_ns6){t_=gm.offsetTop;l_=gm.offsetLeft;h_=gm.offsetHeight;w_=gm.offsetWidth}else{if(_mac){topM=gm.offsetParent.topMargin;if(!topM)topM=0;leftM=gm.offsetParent.leftMargin;if(!leftM)leftM=0;t_=parseInt(topM)+gm.offsetTop;l_=parseInt(leftM)+gm.offsetLeft;}else{t_=gm.offsetTop;l_=gm.offsetLeft;}h_=gm.offsetHeight;w_=gm.offsetWidth;}if(_konq){w_=parseInt(gm.style.width);h_=parseInt(gm.style.height);}/*added by BPi for extra offset of the level2 sub menu items...*/if(gm.id=="menu1"){t_=t_+_subMenuYOffset;}else{t_=t_-1;}var gpa=new Array();gpa[0]=t_;gpa[1]=l_;gpa[2]=h_;gpa[3]=w_;return(gpa)}
function _getMouseXY(e){if(_ns4||_ns6){MouseX=e.pageX;MouseY=e.pageY;}else{MouseX=event.clientX;MouseY=event.clientY}if(!_opera&&_d.all){MouseX=MouseX+_d.body.scrollLeft;MouseY=MouseY+_d.body.scrollTop;if(_d.compatMode=="CSS1Compat")MouseY=MouseY+_sy}return true}
function _parseLink(txt,what){txt=txt.replace(/&quot;/gi,"'");txt=txt+";";lt="";if(what=="link"){sp=txt.indexOf(" ");lt=txt.substr(0,sp);}else{sp=txt.indexOf(what)+what.length+1;if(sp>what.length+1){lt=txt.substr(sp,999);lt=lt.substr(0,lt.indexOf(";"))}}return lt.replace("/ /",lt);}
function _cHexColor(_c){if(_c.length==6){_c=_c.toUpperCase();x=0;while(x<6){hsh="#";if(_c.charCodeAt(x)>70){hsh="";x=6}x++}_c=hsh+_c}return _c}
function _stch(ms){window.status=ms;return true}
function _SDiv(nm,sh){if(_ns4&&nm.indexOf(".")>0)tD=eval(nm); else tD=_gmstyle(nm);if(tD)if(sh)tD.visibility="visible";else tD.visibility="hidden"}
function _close_el(){for(xa=_hlarr.length-1;xa>=0;xa--){ti=_hlarr[xa].split("_");_tmenu=eval(ti[0]);if(_ns4){_shl(ti[0],ti[1],'hide');}else{arg=_gmobj("el"+ti[1]);arg.style.backgroundColor=ti[2];if(_opera)arg.style.background=ti[2];arg.style.color=""+ti[3];}if(ti[0]==_hll){if(_ns4)_shl(ti[0],hel,'show');return}}_hlcnt=0;_hlarr=new Array()}
function _closeallmenus(){gmi=41;_ShM=0;_om="";_hll="";_close_el();if(_ns4){_omv.visibility="hide"}for(_a=1;_a<_menus;_a++){menu=eval("menu"+_a);if(menu[17]&&MLoaded){_SDiv(menu[17],1)}if (menu[7]!=1){_SDiv("menu"+_a,0)}else{_am=""}}}
function _rep_img(){if(_timo){_timo.src=o_img};}
function _popdn(){arg=_popdn.arguments;if(arg[0]){if(arg[3].substr(0,5)!="show-"){if(_ns4){_shl(arg[2],arg[1],"hide")}else{arg[0].style.backgroundColor=arg[4];if(_opera)arg[0].style.background=arg[4];arg[0].style.color=arg[5]}}else{if(_ns4)_omv=0;_hlarr[_hlcnt]=arg[2]+"_"+arg[1]+"_"+arg[4]+"_"+arg[5];_hlcnt++;}menu=eval(arg[2]);if(!menu[12]){_Mtimer=setTimeout("_closeallmenus()",_timegap);}}else{_Mtimer=setTimeout("_closeallmenus()",_timegap);}}
function _dc(){if(_nshl.indexOf("show-menu=")>-1)return;tr=ltarg.split("=");if(tr[1])parent.frames[tr[1]].location.href=_nshl;else location.href=_nshl;}
function _getMenuByName(mn){mn=mn.toLowerCase();for(_a=1;_a<_menus;_a++){if(mn==_Mname[_a])mn=_a}return mn;}
function _sis(){for(_a=1;_a<_imar.length;_a++){tim=_imar[_a].split("_");if(tim[4]){tim[3]=tim[3]+"_"+tim[4]}menu=eval(window.tim[3]);if(_ns4){im=_d.layers[tim[3]].document.layers.eval("el"+tim[2]);imp=_gpos(im);eln="";for(x=0;x<2;x++){imo=_d.layers[tim[3]].document.layers.eval(eln+"el"+tim[2]).document.layers[_imar[_a]];imop=_gpos(imo);imL=imp[3]-(imop[3]);imT=(imp[2]/2)-(imop[2]/2);if(menu[13]=="left")imL=1;if(menu[13]=="center")imL=(imp[3]/2);eln="_m";_spos(imo,imT,imL,null,null);}}else{imo=_gmobj(_imar[_a]);imop=_gpos(imo);im=_gmobj("el"+tim[2]);imp=_gpos(im);if(menu[11]){imco=_gpos(_gmobj("hel"+tim[2]));imc=imco[1];}else {imc=0}imT=imp[0]+(imp[2]/2)-(imop[2]/2);imL=imc+imp[3]-(imop[3]);if(menu[13]=="left")imL=imc;if(menu[13]=="center")imL=imc+(imp[3]/2);if(_ns6&&!_ns61){nsC=_gpos(_gmobj(tim[3]));imT=imT-nsC[0];imL=imL-nsC[1]}_spos(imo,imT,imL,null,null);}}}
function _fixb(mnu)
{
	menu=eval(mnu);
	ic=(menu.length-_ac)/5;
	menu[21][2]=1;
	m42=menu[4]*2;
	mn=_gmobj(mnu);
	if(_ns4)
	{
		if(menu[11])
		{
			mn.clip.width=mn.clip.width+menu[4]
		}
		return
	}
	_mp=_gpos(mn);
	el=menu[21][1];
	if(_ns4)
	{
		ml=_d.layers[mnu].document.layers.eval("el"+(el-1))
	}
	else
	{
		ml=_gmobj("el"+(el-1))
	}
	mlp=_gpos(ml);
	tw=null;
	th=null;
	if(menu[11])
	{
		lf=0;
		tc=0;
		for(y=el-ic;y<el;y++)
		{
			tc++;
			ty=_gmobj("el"+y);
			typ=_gpos(ty);
			thy=_gmobj("hel"+y);
			thyp=_gpos(thy);
			if(_mac&&!menu[3])
			{
				thy.style.width=1+"px";
				ty.style.width=thy.offsetWidth+menu[6][9]+"px";
				typ[3]=thy.offsetWidth
			}
			if(_opera)
			{
				ty.style.top=menu[4];
				if(lf==0)lf=menu[4];
				typ[2]=typ[2]+(m42);
				if(menu[3])_spos(ty,null,0,null,typ[3]);
		}
		_spos(thy,0,lf,typ[2],typ[3]);
		lfL=0;
		if(menu[_ac-1+(tc*5)]>0)lfL=menu[_ac-1+(tc*5)];
		lf=lf+typ[3]+lfL;
	}
	tw=lf-lfL;
	th=typ[2];
	if(_d.compatMode=="CSS1Compat")
	{}
	else
	{
		if(_mac)
		{
			if(!_d.doctype)
			{
				th=th+(m42);
				tw=tw+m42}
			}
			else if(_d.all&&!_opera){tw=tw+(m42);th=th+(m42)}}if(_opera)tw=tw+(menu[4])}else{if(_ns6)tw=_mp[3]-(menu[4]*4);if(_opera)tw=_mp[3]+(menu[6][9]*2)-(m42);}_spos(mn,null,null,th,tw);}
function _sm(v1){menu=eval(v1);if(_opera||_ns6)if(!menu[7]&&!menu[21][2])_fixb(v1);ap=_gmobj(v1);if(_flta)if(ap.filters[0])ap.filters[0].Apply();gmi++;if(!_ns4)aps=ap.style; else aps=ap;aps.zIndex=gmi;aps.visibility='visible';if(_flta)if(ap.filters[0])ap.filters[0].Play();if(menu[17])_SDiv(menu[17],0)}
function _popup(mn,mpos){if(_ns4)_d.captureEvents(Event.MOUSEMOVE);_d.onmousemove=_getMouseXY;if(isNaN(mn)){for(_a=1;_a<_menus;_a++){if(mn==_Mname[_a])mn=_a}}_setpos();_omv.visibility='hide';clearTimeout(_Mtimer);_closeallmenus();mtxt='menu'+mn;mi=_gmstyle(mtxt);if(mpos){mn=_gmobj(mtxt);_spos(mn,MouseY+2,MouseX+2,null,null);}_flta=0;if((_d.all&&_d.getElementById)&&!_mac){ap=_gmobj(mtxt);_getflta(ap);}_sm(mtxt);_am=mn}
function _shl(lyr,el,s){clearTimeout(_Mtimer);mt=_d.layers[lyr].document.layers.eval("el"+el);_omv.visibility="hide";menu=eval(lyr);mt.visibility=s;_omv=mt}
function _popi(v1,lyr,el)
{
	//BPi 6-8-2002 When the user starts at the top level the variable is reset.
	//In this way the check for the right border is done all over again.
	_thisTrailNumber=-1;
	for(_a=0; _a<_menuNamesTrail.length; _a++){
		if(_menuNamesTrail[_a].substr(_menuNamesTrail[_a].lastIndexOf("-")+1,  _menuNamesTrail[_a].length)==lyr){
			_thisTrailNumber=_a;
			break;
		}
	}
	
	if(_thisTrailNumber==-1) {
		_offsetl=0;
	}else{
		if(_menuNamesTrail[_thisTrailNumber].indexOf(_prevLyr)==-1){
			_offsetl=0;
		}
	}
	_prevLyr=lyr;
	subfound=0;
	nv1=v1
	for(_a=1;_a<_menus;_a++)
	{
		if(v1.substring(10,99)==_Mname[_a])
		{
			v1="show-menu"+_a;
			subfound=1;
			_a=999
		}
	}
	sel="smenu="+el+"#";
	if(!_om)_om=lyr;
	clearTimeout(_Mtimer);
	if(_ns4)
	{
		_timo=_d.layers[lyr].document.layers.eval("el"+el).document.images[0]
	}
	else
	{
		_timo=_gmobj("im"+el)
	}
	o_img="";

	if (_timo)
	{
		o_img=_timo.src;
		ima=o_img.split(".");
		enD=ima.length;
		if(ima[enD-2].indexOf("_over")==-1)ima[enD-2]=ima[enD-2]+"_over";
		nsrc="";
		for(eD=0;eD<enD;eD++)
		{
			nsrc=nsrc+ima[eD]+"."
		}
		nsrc=nsrc.substring(0,nsrc.length-1);
		ta=_om.split(",");
		NI1=new Image;
		NI1.src=nsrc;
		if(_d.all){if(NI1.complete)_timo.src=nsrc}else{if(NI1.width>0)_timo.src=nsrc}
	}
	container=eval(lyr);
	if(subfound)
	{
		v1=v1.substring(5,99);
		menu=eval(v1);
		_omnu=v1;
		mi=_gmobj(v1);
		gp=_gpos(_gmobj(lyr));
		h3="";
		if(container[11])h3="h";
		if(_ns4){tel=_gpos(_d.layers[lyr].document.layers.eval("el"+el))}else{tel=_gpos(_gmobj(h3+"el"+el))}
		np=_gpos(mi);
		if(container[11])
		{
			if(!container[5])container[5]="";
			if(!_opera&&_d.all&&!_mac)gp[1]=gp[1]+container[4];
			if(_ns6)
			{
				if(_ns61)
				{
					gp[1]=gp[1]+container[4];
				}
				else
				{
					gp[1]=-1;gp[0]=gp[0]-container[4]
				}
			}
			if(_mac)gp[0]=gp[0]-container[4];
			if(container[5].indexOf("bottom")>=0)
			{
				tvar=container[1]
				if(!tvar)tvar=0;
				gp[0]=gp[0]-np[2]-tel[2]
			}
			if(tel[1]+gp[1]+np[3]>_ww){gp[1]=_ww-np[3]-tel[1];if(!_d.all)gp[1]=gp[1]-14} //Past de positie aan van het te vallen menu
			mtop=gp[0]+gp[2]-1;
			mleft=tel[1]+gp[1];
			if(container[15])mleft=mleft-np[3]+tel[3]+(container[4]*2)
			m1=menu[1];
			if(m1)
			{
				m1=m1+"";
				if(m1.indexOf("offset=")==0)
				{
					os=m1.substr(7,99);
					mtop=(parseInt(os)+mtop);
				}
				else
				{
						if(m1)mtop=parseInt(m1);
				}
			}
			m2=menu[2];
			if(m2){m2=m2+"";
			if(m2.indexOf("offset=")==0)
			{
				os=menu[2].substr(7,99);
				mleft=(parseInt(os)+mleft);
			}
			else
			{
				if(m2)mleft=m2;
			}
		}
		_spos(mi,mtop,mleft-1,null,null);
		}
		else
		{
			if(!_ns61&&_ns6)tel[0]=tel[0]-gp[0];
			nt=tel[0]+gp[0]+_suboffset_top;
			nl=gp[1]+tel[3]-_suboffset_left;
			if((gp[1]+gp[3]+np[3])>=_ww){
				nl=gp[1]-np[3]+_suboffset_left;
				//BPi 6-8-2002 When the right border is reached a variable is set.
				_offsetl = 1
			}else{
				//
				//_offsetl = 0
			}
			//BPi 6-8-2002 When the variable is set the menu continues to the left.
			if(_offsetl==1) {
				nl=gp[1]-np[3]+_suboffset_left;
			}
			//alert(nl);
			if(nt+np[2]>_wh+_sy){nt=_wh-np[2]+_sy;}
			if(menu[1]>=0)nt=menu[1]
			if(menu[2]>=0)nl=menu[2]
			_spos(mi,nt,nl,null,null);
		}
		_om+=","+v1;
		if(_ShM==1)
		{
			_sm(v1);
			if(!_ns4)mi.style.visibility="visible";
		}
	}
	else
	{
		frt=v1.indexOf(" ")
		if(frt>0&&v1.indexOf("show-menu=")>-1)
		{
			lt=_parseLink(v1, "target");
			if(lt)
			{
				v1=v1.substring(10,frt);
				pf=parent[lt];
				pf.mn=pf._gmobj("menu"+pf._getMenuByName(v1));
				menu=eval(lyr);
				gp=_gpos(_gmobj(lyr));
				h3="";
				if(container[11])h3="h";
				if(_ns4){_mp=_gpos(_d.layers[lyr].document.layers.eval("el"+el))}else{_mp=_gpos(_gmobj(h3+"el"+el))}
				if(menu[11])
				{
					fTop=pf._sy;
					fLeft=gp[1]+_mp[1]+Frames_Top_Offset;
				}
				else
				{
					fTop=pf._sy+gp[0]+_mp[0];
					fLeft=100
				}
				pf._spos(pf.mn,fTop,fLeft-100,null,null);
				pf._popup(v1);
				_closeallmenus();
			}
		}
	}
	ta=_om.split(",")
	strt=0;
	for(_a=0;_a<ta.length;_a++)
	{
		if (ta[_a]==v1)strt=0;
		if (strt)
		{
			if(ta[_a])
			{
				_hll=lyr;
				hel=el;
				_close_el(el);
				tmnu=eval(ta[_a])
				if(tmnu[17])_SDiv(tmnu[17],1)
				_SDiv(ta[_a],0)
			}
		ta[_a]=""
		}
		if(ta[_a]==lyr)strt=1;
	}
	mmenu=eval(lyr)
	if(mmenu[7]&&lyr!=ta[0])
	{
		ogmi=gmi;
		_closeallmenus();
		gmi=ogmi;
		if(v1==ta[ta.length-1])
		{
			if(_ns4)_shl(lyr,el,'show');
			tmnu=eval(v1)
			if(tmnu[17])_SDiv(tmnu[17],0)
			_SDiv(v1,1)
		}
		if(nv1.indexOf("target=")>0)
		{
		}
		else
		{
			_popi(nv1,lyr,el);
			return
		}
	}
	_om=""
	mdisp=0
	for(_a=0;_a<ta.length;_a++)
	{
		if(ta[_a]==lyr)_frs=_a
		if(ta[_a]==v1)_fre=_a
		if (mdisp||(_a>_frs&&_a<_fre))
		{
			if (ta[_a]&&ta[_a]!=v1)
			{
				_SDiv(ta[_a],0)
				_close_el(el);
				if(_ns4)_shl(lyr,el,'hide');
			}
		}
		else
		{
			if(ta[_a])_om+=ta[_a]+",";
		}
		if (v1==ta[_a])mdisp=1
	}
}


function _hl()
{
	arg=_hl.arguments;
	hlnk=arg[1];
	_am=" "+_a;_am=_am.length-1;subimg="";arg[0]+=""
	if(_ns6){dwd=arg[2][9]*2}else{dwd=0}
	if(_ns4){if(el==0){st="<style type=\"text/css\">A._m{text-decoration:none;}</style>";_d.write(st);_oatop=atop;}else{mtl=_d.layers[_omnu].document.layers.eval("el"+(el-1));
	if(_oatop==atop){atop+=mtl.clip.height}else{atop=menu[4];}_oatop=atop}if(menu[11]){atop=menu[4];if(_oaleft==_aleft){_aleft+=mtl.clip.width+arg[8]}else{_aleft=menu[4];_oaleft=_aleft}_oaleft=_aleft}else{_aleft=menu[4];}}
	if(hlnk.substring(0,5)=="show-"){arg[1]=arg[1].toLowerCase();if(arg[7]==hlnk) if(arg[6])arg[7]=arg[6];else arg[7]="";hlnk="#";if (arg[6]+" "!="undefined ")hlnk=arg[6];}
	pI="_popi('"+arg[1]+"','"+arg[5]+"',"+el+");"
//image arrow
	if(arg[1].substring(0,5)=="show-"&&(!menu[11]||menu[6][16])&&(menu[11]||menu[6][10])){im++;ims="im"+im+"_"+_a+"_"+el+"_"+arg[5];ti=arg[2][10];if(menu[6][16]&&menu[11])ti=menu[6][16];if(_ns4){sti="<img border=0 src="+ti+">";subimg="<layer id="+ims+">"+sti+"</layer>";}else{subimg="<img id="+ims+" style=\"position:absolute;\" onmouseover=\"_gmobj('el"+el+"').onmouseover();\" onmouseout=\"_gmobj('el"+el+"').onmouseout();\" border=0 src="+ti+">"};_imar[im]=ims;}omp=_mp;ofc=arg[2][0];ofb=arg[2][1];onc=arg[2][2];onb=arg[2][3];ltarg=" ";lOnfunc="";lOffunc="";ltype="";lalign=menu[8];if(!lalign)lalign="left"
	if(hlnk.indexOf(" ")>0)
	{
		_al=_parseLink(hlnk,"align");if(_al)lalign=_al;
		ltarg=_parseLink(hlnk,"target");
		if(ltarg)ltarg=" target="+ltarg
		lOnfunc=_parseLink(hlnk,"onfunction")+";";
		lOffunc=_parseLink(hlnk,"offfunction")+";";
		ltype=_parseLink(hlnk,"type");
		tofc=_parseLink(hlnk,"offfontcolor");if(tofc)(ofc=_cHexColor(tofc))
		tofb=_parseLink(hlnk,"offbackcolor");if(tofb)(ofb=_cHexColor(tofb))
		tonc=_parseLink(hlnk,"onfontcolor");if(tonc)(onc=_cHexColor(tonc))
		tonb=_parseLink(hlnk,"onbackcolor");if(tonb)(onb=_cHexColor(tonb))
		hlnk=_parseLink(hlnk,"link");
	}
	if(arg[7]+""=="undefined"){arg[7]=hlnk}
	if(ltype=="form"){onc=ofc;onb=ofb;_mp="default"}
	if(ltype=="header"&&arg[2][17]){ofc=arg[2][17];ofb=arg[2][18];onc=arg[2][17];onb=arg[2][18];_mp="default"}
	smO="_ShM=1;";smC="";
	if(menu[16]==1){smO="";hlnk="javascript:_ShM=1;"+pI}
	if(hlp[14])if(location.href.indexOf(hlnk)>0&&(hlnk.substr(-1,1)!="/"))smc=el
	if(hlnk!="#"&&smc==el&&arg[2][14]){ofc=arg[2][14];ofb=arg[2][15];}
	if(ltype=="form"||hlnk=="#"||ltype=="header"){_mp="default";if(_ns4){hlnk="<a ";}else{hlnk=" "}}else{if(_ns4){hlnk="<a href=\""+hlnk+"\" "+ltarg}else{hlnk="<a href=\""+hlnk+"\" "+ltarg + " style='text-decoration:none;'>"}}
	pd="_popdn(this," + el + ", '" + arg[5] + "', '"+arg[1]+"', '"+ofb+"', '"+ofc+"');"
	if(arg[0].indexOf("<img")>=0)
	{
		ipos=arg[0].indexOf("<img");
		arg[0]=arg[0].substr(0,ipos+4)+" onclick=\"_gmobj('el"+el+"').click()\" id=im"+el+" "+ arg[0].substr(ipos+5,900);
	}
	if(!isNaN(arg[2][5]))arg[2][5]+="px"
	if(_ns4){
		rsp=""

		tdwd=" width="+menu[3]
		if(lalign=="left")tdwd=""
		if (lalign=="right") rsp="<td height=-1></td>"
		ls="<table cellpadding="+(arg[2][9]/2)+" cellspacing=0><tr><td height=-1 align="+lalign+tdwd+">"+hlnk+" style='color:"
		le=";text-decoration:none;font-size:"+arg[2][5]+";font-weight:"+arg[2][7]+";font-family:"+arg[2][8]+"' onmouseover=\"status='"+arg[7]+"';\">"+arg[0]+"</a>"+subimg+"</td>"+rsp+"</tr></table></layer>"
		if(menu[11])nswid=menu[3]; else nswid=(menu[3]-(menu[4]*2))
		lv=" left="+_aleft+" width="+nswid+" top="+atop
		nsofb="";if(ofb)nsofb=" BGColor="+ofb
		nsonb="";if(onb)nsonb=" BGColor="+onb
		mt="<layer id=mel"+el+lv+" "+nsofb+" onmouseover=\""+smO+"_shl('"+arg[5]+"',"+el+",'show');"+pI+" "+lOnfunc+";return _stch('"+arg[7]+"');\">"+ls+ofc+le
		mt+="<layer id=el"+el+lv+" "+nsonb+" onmouseover=\"clearTimeout(_Mtimer);"+pI+"ltarg='"+ltarg+"'; _nshl='"+arg[1]+"'; this.captureEvents(Event.CLICK); this.onClick=_dc;\" onmouseout=\""+pd+"; "+lOffunc+"; return _stch('');\" visibility=hidden >"+ls+onc+le
	}else{
		mt="";
		if(menu[11]){bgc=hlp[4];if(hlp[11])bgc=hlp[12];
		mt+="<div id=hel"+el+" style=\"background-color:'"+onb+"';width:"+(menu[3]-menu[4])+"px;position:absolute;top:0;left:"+dlft+";\">";dlft=dlft+menu[3]-(menu[4]*2)+menu[4]}
		rsp=0;if (lalign=="right") rsp=7;
		//disable the link if level==1 and this is the highlighted item
		var jitem=arg[6];
		if (jitem=='')jitem=arg[1];
		if(!(jitem==_mainItemHighlight && _hArr.length==1))mt+=hlnk;
		dw=(menu[3]-(2*menu[4]+dwd))
		if(dw+" "=="NaN "){dw=""}else{dw="width:"+dw+"px"}
		if(!menu[3]&&_ie4)dw="width:1px";
		if(menu[11]&&_opera){dw="position:absolute;"}
		if(isNaN(arg[2][9]))
		{
			padd=arg[2][9]
		}
		else
		{
			psp=arg[2][9]+"px "
			padd=psp+psp+psp+psp
		}

		if(menu[11]&&menu[3]>0)dw="position:absolute;width:"+menu[3]+"px"
		//highlight the main item
		kk='';
		for (var t=0; t<arg.length; t++) {kk+='arg['+t+'] = '+arg[t]+'\n';}
		//alert(kk+"\n\n\n"+el);

		/*	Build the divs for the items */
		if(arg[5]=='menu1'){
			//level 1 menu items
			var extraJsMouseOvr='';
			var extraJsMouseOut='';
			//last item
			var extraStyle='';
			if(el==(_l1items-1))extraStyle=' border-color: #FFFFFF #FFFFFF ##CACACA; border-style: solid; border-width: 0px 1px 1px 0px;';
			if(jitem==_mainItemHighlight){
				//item that should be highlighted
				mt+="<div valign=top align="+lalign+" id=el"+el+" class=\"p-topnavh\" style=\""+dw+extraStyle+";\"";
				if(_hArr.length==1){
					//disable mouse pointer
					mt+=" onMouseOver=\"style.color='"+onc+"';"+smO+"; "+pI+";"+lOnfunc+";return _stch('"+arg[7]+"');\""
				}else{
					mt+=" onMouseOver=\"style.color='"+onc+"';this.style.cursor='"+_mp+"';"+smO+"; "+pI+";"+lOnfunc+";return _stch('"+arg[7]+"');\""
				}
				//replace the default colors when the sub menu layer disappears
				pd=pd.replace('#DFDFDF','#FFFFFF');
				pd=pd.replace('#000066','#FF6600');
				mt+=" onMouseOut=\"this.style.background='#FFFFFF';style.color='#FF6600';_rep_img(); "+pd+";"+lOffunc+"; return _stch('');\">"
			}else{
				//normal level 1 items
				if(arg[0]==_page.items["0"].text+"&nbsp;&nbsp;&nbsp;"){
					extraJsMouseOvr="document.getElementById(\'p-snleft\').className=\'p-snlefthover\';";
					extraJsMouseOut="document.getElementById(\'p-snleft\').className=\'p-snleft\';";
				};
				mt+="<div valign=top align="+lalign+" id=el"+el+" class=\"p-topnavn\" style=\""+dw+extraStyle+";\"";
				mt+=" onMouseOver=\""+extraJsMouseOvr+"this.style.background"+_bgt+"='"+onb+"';style.color='"+onc+"';this.style.cursor='"+_mp+"';"+smO+"; "+pI+";"+lOnfunc+";return _stch('"+arg[7]+"');\""
				mt+=" onMouseOut=\""+extraJsMouseOut+"_rep_img(); "+pd+";"+lOffunc+"; return _stch('');\">"
			}
		}else{
			//other menu items
			if(_firstItem)_firstItem=false;
			mt+="<div valign=top class=\"p-topnavsub\" align="+lalign+" id=el"+el+" style=\""+dw+";padding:"+padd+";font-weight:"+arg[2][7]+";font-style:"+arg[2][6]+";font-family:"+arg[2][8]+";font-size:"+arg[2][5]+";color:"+ofc+";background-color:"+ofb+";\""
			mt+=" onMouseOver=\"this.style.background"+_bgt+"='"+onb+"';style.color='"+onc+"';this.style.cursor='"+_mp+"';"+smO+"; "+pI+";"+lOnfunc+";return _stch('"+arg[7]+"');\""
			mt+=" onMouseOut=\"style.color='#000066';_rep_img(); "+pd+";"+lOffunc+"; return _stch('');\">"
		}
		mt+=arg[0]+"</div>";
		if(!(arg[6]==_mainItemHighlight && _hArr.length==1))mt+="</a>";
		if (menu[11]){mt+="</div>"};
		//alert(subimg);
		mt+=subimg
	}
	_mp=omp
	_d.write(mt);el++;
/*
Debug
*/
debugString+=mt+'\n\n';
}


function _dmenu(mnu){
	menu=eval(mnu);
	menu[21]=new Array()
	if(menu[7]){_parr[_parr.length]=mnu.substr(4,3);}
	atop=menu[4];
	if(!atop)atop=0;
	hlp=menu[6];
	if(!menu[4])menu[4]=0;
	if(_ns4)eq="="; else eq=":"
	for(z=0;z<19;z++)
	{
		if(z==5)z=12;
		if(z==16)z++;
		if(hlp[z]&&hlp[z].charAt(0)!="#")hlp[z]=_cHexColor(hlp[z]);
	}

	if(el)ns6c=3;else ns6c=2;ns6w=0;if(menu[8]=="right"&&_ns6)ns6w=7;
	if (menu[3]<1)menu[3]="undefined"
	if(_ns4)
	{
		thw=menu[3]
		if(menu[11])
		{
			ic=(menu.length-_ac)/5;
			thw=(menu[3]*ic)-(menu[4]*ic)+menu[4]
		}
		bgc="";
		if(hlp[4])bgc="bgColor="+hlp[4]
		if (hlp[11])
		{
			bgc="bgColor="+hlp[13]
		}
		mt="<layer z-index=40 visibility=hidden "+bgc+" id="+mnu+" top="+menu[1]+" left="+menu[2]+" width="+thw+">"

		if (hlp[11])
		{
			mt+="<layer bgcolor="+hlp[12]+" top=0 left=0 height=2 width=100%></layer>"
		}
		mt+="<layer id="+mnu+"3d bgcolor="+hlp[12]+" top=0 left=0 height=0 width=2></layer>"
	}
	else
	{
		iedf="";if(!_opera&&!_mac&&_d.all&&menu[9])
		{
		iedf=" filter:";flt=menu[9].split("\;");for(fx=0;fx<flt.length;fx++){iedf+=" progid:DXImageTransform.Microsoft."+flt[fx]}}
		if (hlp[11]){
			brd = "border:solid "+menu[4]+"px; border-left-color:"+hlp[12]+";border-top-color:"+hlp[12]+";border-bottom-color:"+hlp[13]+";border-right-color:"+hlp[13]+";"}else{brd = "border:solid "+menu[4]+"px; border-left-color:"+hlp[4]+";border-top-color:"+hlp[4]+";border-bottom-color:"+hlp[4]+";border-right-color:"+hlp[4]+";"
		}
		//reset _firstItem

		if (mnu=="menu1"){
			mt="<div class=\"p-topnav\" id="+mnu+" style=\""+iedf+"; z-index: 40; position: absolute;visibility:hidden;width:"+(menu[3]+ns6w)+"px;left:"+menu[2]+"px;top:"+menu[1]+"px;\">"
		}else{
			_firstItem=true;
			brd = "border: 1px solid; border-color: #b5b5b5 #666666 #666666 #b5b5b5;";
			mt="<div id="+mnu+" style=\""+iedf+";z-index:40;visibility:hidden;"+brd+"position:absolute;background-Color:"+hlp[4]+";width:"+(menu[3]+ns6w+2)+"px;left:"+menu[2]+"px;top:"+menu[1]+"px;\">"
			mt+="<div style=\"width: auto; border-color: #ffffff #a0a0a0 #a0a0a0 #ffffff\; border-style: solid\; border-width: 1px 1px 1px 1px\">";
		}
	}

	_d.write(mt)
/*
Debug
*/
debugString+=mt+'\n\n';
	x=0;
	dlft=0
	_aleft=0;
	for(b=_ac;b<menu.length;b++)
	{
		b=b+4
		if(menu[b-3]==""){menu[b-3]="#"}
		menu[b-3]=menu[b-3].replace(/\"/gi, "&quot;")
		if(!menu[b])menu[b]=0
		_hl(menu[b-4], menu[b-3],hlp,100,100,mnu,menu[b-2],menu[b-1],menu[b-5])
		txt="";
		if(_ns4)
		{
			if (!menu[11])
			{
				if (menu[b]&&b<menu.length-1)
				{
					mt=_d.layers[mnu].document.layers.eval("el"+(el-1))
					x=atop+mt.clip.height
					if(!hlp[11])x++
					txt="<layer top="+(x-2)+" left="+menu[4]+" height=1 "+bgc+" width="+mt.clip.width+" onmouseover=\"clearTimeout(_Mtimer)\" ></layer>"
					if(hlp[11]) {txt+="<layer top="+(x-1)+" left="+menu[4]+" height=1 bgcolor="+hlp[12]+" width="+mt.clip.width+"></layer>"
					}
				}
			}
		}
		else
		{
			mbw=menu[b];bc=hlp[4];bl="";oc="";if(_opera){bl="left:0;";oc="_d.getElementById('el"+el+"').style.background='"+hlp[1]+"';_d.getElementById('el"+el+"').style.color='"+hlp[0]+"'";if(_opera&&mbw==0){mbw=1;bc=hlp[1];bl+="width:"+menu[3]-menu[4]+"px"}else{if(menu[4]==1)ocv=4;bl+="width:"+(menu[3]+(menu[6][9]*2)-menu[4])+"px"}}
			if(b+1==menu.length)mbw=0;
			if(mbw>0)
			{
				if (!menu[11])
				{
					dwid=(menu[3]-(menu[4]*2))
					if((_d.all&&_d.compatMode=="CSS1Compat")||(_mac&&_d.doctype))
					{
						dwid=menu[3]+(menu[6][9]*2)-(menu[4]*2)

					}
					//if(el==2)alert(_d.doctype)

					if (hlp[11]&&mbw==1)
					{
						txt="<div onmouseout=\""+oc+"\" onmouseover=\"clearTimeout(_Mtimer)\" style=\"position:relative\">"
						txt+="<div style=\"border-top:1px solid "+hlp[13]+"; background-color:"+hlp[12]+"; width:"+dwid+"px;position:absolute;clip:rect(0 100% 2px 0);height:1px;"+bl+"\">"
						txt+="</div>\n</div>"
					}
					else
					{
						txt="<div style=\"position:relative;\">"
						txt+="<div onmouseout=\"_popdn();"+oc+"\" onmouseover=\"clearTimeout(_Mtimer)\" style=\"background-color:"+bc+";width:"+dwid+"px;position:absolute;"
						txt+="clip:rect(0 100% "+mbw+"px 0);height:"+mbw+"px;"+bl+"\">"
						txt+="</div>"
						txt+="</div>"
					}
				}
			}

		}
		_d.write(txt);
/*
Debug
*/
debugString+='\n\n'+txt+'\n\n';
		_omnu=mnu;
		mt=""
	}
	_oatop=-1;
	if (_ns4){mt="</layer>"}else{mt+="</div>\n</div>\n"}
	_d.write(mt)
/*
Debug
*/
debugString+=mt+'\n\n';
	if (_ns4)
	{
		ml=_gmobj(mnu)
		ml.clip.height += menu[4]
		ml3d=_d.layers[mnu].document.layers.eval(mnu+"3d")
		if (hlp[11])ml3d.clip.height=ml.clip.height
	}
	menu[21][1]=el
}

function _checs(e){stopchec=1;for(_a=1;_a<_menus;_a++){menu=eval("menu"+_a);if(menu[10]>0){stopchec=0;if (_df!=0||_osy!=_sy){mi=_gmobj("menu"+_a);tm=_gpos(mi);mit=tm[0];if(isNaN(menu[1]))menu[1]=0;_df=parseInt(menu[1])+_sy-mit;nt=_df/_followspeed;of1=nt.toString();ofr=of1.split("\.");if(ofr[1]+" "=="undefined ")ofr[1]=0;_ofrac=_ofrac+parseInt(ofr[1]);if(_mac&&parseInt(nt)==0){clearTimeout(pu);return;}if(_ofrac>10){_ofrac=_ofrac-10;if(_df>=0){nt++}else{nt--}}_spos(mi,mit+nt,null,null,null)}else{clearTimeout(pu);return;}_osy=_sy}}if(stopchec){_osy=_sy;return}pu=setTimeout('_checs()',_followrate);}
function _PlaceMenu(mn){if(_ns4||_ns6)pos="relative";else pos="absolute";mnt="<div id=\""+mn+"DIV\" style=\"position:"+pos+"\"></div>";menu=eval("menu"+_getMenuByName(mn));menu[21][0]=mn+"DIV";_d.write(mnt);debugString+=mnt+'\n\n';}
function _setpos(){
	for(_a=1;_a<_menus;_a++)
	{
		menu=eval("menu"+_a);
		if(menu[21][0])
		{
			gm=_gmobj(menu[21][0]);
			if(_ns4)
			{
				ntp=gm.pageY;
				nlp=gm.pageX
			}
			else
			{

				gp=_gpos(gm);
				ntp=gp[0];
				nlp=gp[1]
			}
			mn=_gmobj("menu"+_a);
			mnp=_gpos(mn);

			if(menu[5].indexOf("right")!=-1)nlp=nlp-mnp[3]
			if(menu[5].indexOf("center")!=-1)nlp=nlp-(mnp[3]/2)

			if(ntp==0)ntp=null;
			if(nlp==0)nlp=null;
			_spos(mn,ntp,nlp,null,null);
		}
		else
		{
			if(!menu[5])menu[5]="";
			if (menu[5].indexOf("left")!=-1||menu[5].indexOf("center")!=-1||menu[5].indexOf("right")!=-1)
			{
				mn=_gmobj("menu"+_a);
				mnp=_gpos(mn);
				mnw=mnp[3];
				nlp=((_ww-mnw)/2);
				if(menu[5].indexOf("right")!=-1)nlp=_ww-mnw;
				if(menu[5].indexOf("left")!=-1)nlp=1;
				ts=menu[2]+"";
				if(ts.indexOf("offset=")==0){os=ts.substr(7,99);
				nlp=nlp+parseInt(os)}_spos(mn,null,nlp,null,null)
			}
			if(menu[5].indexOf("top")!=-1||menu[5].indexOf("bottom")!=-1||menu[5].indexOf("middle")!=-1)
			{
				mn=_gmobj("menu"+_a);
				mnp=_gpos(mn);
				mnh=mnp[2];
				if(_opera)mnh=mn.style.pixelHeight;
				nlp=_wh-mnh;
				if(menu[5].indexOf("middle")!=-1)nlp=((_wh-mnh)/2);
				if(menu[5].indexOf("top")!=-1)nlp=1;
				ts=menu[1]+"";
				if(ts.indexOf("offset=")==0)
				{
					os=ts.substr(7,99);
					mnp=_gpos(mn);
					nlp=nlp+parseInt(os)
				}
				if(menu[10])
				{
					menu[1]=nlp;nlp=nlp+_sy
				}
				_spos(mn,nlp,null,null,null)
			}
		}
	}
}
function _MScan(){_sy=self.pageYOffset;if(_opera){_ww=window.innerWidth;_wh=window.innerHeight}else if(_d.all){_sy=_d.body.scrollTop;if(_sy==0&&!_ie4&&!_mac)_sy=_d.documentElement.scrollTop;if(_d.compatMode=="CSS1Compat"){_ww=document.documentElement.clientWidth;_wh= document.documentElement.clientHeight}else{_ww=_d.body.clientWidth;_wh=_d.body.clientHeight}}else{_sy=pageYOffset;if(_ns4){_ww=self.innerWidth-16;_wh=self.innerHeight-17}else{_ww=_d.body.offsetWidth;if(!_ww)_ww=self.innerWidth-15;_ww--;_wh=self.innerHeight;}}if(MLoaded>1&&_oww>0&&(_ns4||_opera)&&(_owh!=_wh||_oww!=_ww)){if(_nsmatch)location.reload()}if(MLoaded==1&&_owh==_wh&&_oww==_ww)_nsmatch=1;if(_opera)_nsmatch=1;if(_sy!=_osy)_checs();if(MLoaded==1||(_owh!=_wh||_oww!=_ww)){_setpos();_sis();MLoaded=2;}if(MLoaded){_oww=_ww;_owh=_wh;}mspu=setTimeout('_MScan()',250)}


function _Minit()
{
	el=0;_df=-1;
	for(x=0;x<_parr.length;x++){_popup(_parr[x]);_fixb("menu"+_parr[x])}
	if(!_opera)_MScan();
	if(_ns4)_d.captureEvents(Event.MOUSEMOVE);_d.onmousemove=_getMouseXY;
}

function _mOL(){
	if(!_ns61&&_ns6){
		_Minit()
	}
	MLoaded=1;
	_MScan()
}

function _createMenuLayers(){
	//this function writes all the div's for the top menu to the document
	_createMenuData();
	_dumpmenus();
	while(eval("window.menu"+_m)){_mr+="menu"+_m+",";_tmenu=eval("menu"+_m);_Mname[_m]=_tmenu[0].toLowerCase();_m++}
	_mr=_mr+" ";
	_mr=_mr.split("\,");
	_menus=_mr.length-1;_bgt="";
	for(_a=1;_a<_menus;_a++){_dmenu("menu"+_a)}

}


function _initiateTopMenu(){
	//this function initiates the top menu
	if(!_ns61&&_ns6){
		_mOL();
	}else{
		_Minit();
		_mOL();
	}
	//_debugWindow(debugString);
}



////////////////////////////
// End Fold Out Menu Code //
////////////////////////////

var _hide  = true;
var _layerTimer;

function _showhide(obj)
{
	_hide = !_hide;
	obj.style.visibility = (_hide) ? 'hidden' : 'visible';
}

function _setLyr(obj,lyr)
{
	var newX = _findCoordinates(obj,'x');
	var newY = _findCoordinates(obj,'y');
	if (lyr == 'rsdiv')newX -= 0;newY += 11;
	var x = new _getObj(lyr);
	x.style.top = newY+'px';
	x.style.left = newX+'px';
}

function _findCoordinates(obj,axis)
{
	var pos = 0;
	if (document.getElementById || document.all)
	{
		while (obj.offsetParent)
		{
			pos += (axis=='y')?obj.offsetTop:obj.offsetLeft;
			obj = obj.offsetParent;
		}
	}
	else if (document.layers)
		pos += (axis=='y')?obj.y:obj.x;
	return pos;
}

function _getObj(name)
{
 if (document.getElementById)
 {
 	   this.obj = document.getElementById(name);
	   this.style = document.getElementById(name).style;
 }
 else if (document.all)
 {
	   this.obj = document.all[name];
	   this.style = document.all[name].style;
 }
 else if (document.layers)
 {
	   if (document.layers[name])
	   {
	   	this.obj = document.layers[name];
	   	this.style = document.layers[name];
	   }
	   else
	   {
	    this.obj = document.layers.testP.layers[name];
	    this.style = document.layers.testP.layers[name];
	   }
 }
}

function _startTimer(f,t){_layerTimer=window.setTimeout(f, t);}

function _stopTimer(){window.clearTimeout(_layerTimer);}

function _placeRelatedSitesLayer(){
	var imgObj=new _getObj('p-relatedlayerplace');
	_setLyr(imgObj.obj,'p-rsdiv');
}

function _showHideRelatedSites(){
	var theLayer= new _getObj('p-rsdiv');
	_showhide(theLayer.obj);
}

function _doOnLoad(){
    if(document.getElementsByTagName('body')[0].className!="p-printversion") {
	_initiateTopMenu();
	_placeRelatedSitesLayer();
    }
}

function _doOnResize(){
    if(document.getElementsByTagName('body')[0].className!="p-printversion") {
	_placeRelatedSitesLayer();
    }
}



window.onload = _doOnLoad;
window.onresize = _doOnResize;