//  functie om veilig mailadresen op de site te kunnen zetten
// aanroep <script> safemail ("emailnaam","inter@net","schermnaam") </script>

function safemail(name, domain, display) 
{
displayed=(typeof(display)=="undefined") ? name+"@"+domain : display
document.write('<a href=mailto:' + name + '@' + domain + '>' + displayed + '</a>');
}

function venster (kopje,tekst)
{ 
 parent.inhoud.document.clear();
 parent.inhoud.document.open();
 parent.inhoud.document.write('<frameset rows="120,* frameborder="NO" border="0" framespacing="0""><frame name="subkop" frameborder="NO" scrolling="no" noresize><frame name="subtekst" frameborder="NO"></frameset>');
 parent.inhoud.subkop.document.location = kopje;
 parent.inhoud.subtekst.document.location = tekst;
 document.close();
}

function naar_frame (framenaam,tekst)
{
var ouder=parent.location.href;
var kind=self.location.href;
if (ouder == kind)
  {
  alert ("Deze pagina hoort in een frame bekeken te worden.\nKlik op OK en u wordt automatisch doorverwezen naar de juiste pagina.\n"+tekst);
  window.location.href = framenaam
  }
}


function open_window(arg){
	open(arg,'window','scrollbars,resizeable=yes');
}

function popvenster(naam)
{   var venster=window.open('','VWG',  'Width=670,height=600,Top=20,left=500,status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes');
  venster.document.open();
  venster.location = naam;
  venster.document.close();
  venster.focus();
}   

// venster voor overzicht van de foto's
function popvenster_foto(naam)
{   var venster=window.open('','VWG',  'Width=600,height=300,Top=20,left=500,status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes');
  venster.document.open();
  venster.location = naam;
  venster.document.close();
  venster.focus();
}   

function popvenster_org(naam)
{   var venster=window.open('','Uitleg',  'Width=600,height=600,Top=20,left=500,status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes');
 // frame maken
  venster.document.open();
  venster.document.write('<frameset  rows="60,* frameborder="NO" border="0" framespacing="0""><frame name="kopje" style="background-color: #0066CC;"  frameborder="NO" scrolling="no" noresize><frame name="hoofd" frameborder="NO"></frameset>');
  // bovenste frame met een knopje
  venster.kopje.document.open();
  venster.kopje.document.write('<form  style="background-color: #9fc087"><center><input type="button"  style="color: #000000; background-color: #339933; font-weight: bold;" Value="Sluit venster"   onClick="top.window.close()"></center></form>');
  venster.kopje.document.close();
  // onderste frame met de tekst
  venster.hoofd.document.open();
  venster.hoofd.location = naam;
  venster.document.close();
  venster.focus();
}   

// variabel in te stellen popvenster
//
//  aanroep met bv <a href="javascript:popvenster_var( '../dir/tekst.htm',500,200);"> linktekst </a>
//  naam = het bestand, 
//  breed = breedte van het venster en hoog is hoogte van het venster
//  hoe geeft aan waar het venster verschijnt kan aangevuld worden met noresize, etc
//
function popvenster_var(naam, breed, hoog) 
{ 
  hoe= "left=600,top=50,width=" + (breed+50) + ",height=" + (hoog+50) + ",resizable=no, scrollbars=yes, status=no, menubar=no, location=no";
  venster = window.open("", "VWG", hoe);
  venster.document.open();
  venster.location = naam;
  venster.document.close();
  venster.focus();
}

function popvenster_var_org(naam, breed, hoog) 
{ 
  hoe= "left=300,top=50,width=" + (breed+50) + ",height=" + (hoog+50) + ",resizable=yes, location=no, status=no, menubar=no, location=no";
  venster = window.open("", "preview", hoe);
  venster.document.open();
  venster.document.write('<frameset rows="40,* frameborder="NO" border="0" framespacing="0""><frame name="kopje" frameborder="NO" scrolling="no" noresize><frame name="hoofd" frameborder="NO"></frameset>');
  // bovenste frame met een knopje
  venster.kopje.document.open();
  venster.kopje.document.write('<form style="background-color: #9fc087"><center><input type="button"  style="color: #000000; background-color: #339933; font-weight: bold;" Value="Sluit venster"   onClick="top.window.close()"></center></form>');
  venster.kopje.document.close();
  // nu onderste frame de achtegrondkleur en tekst regelen
  venster.hoofd.document.open();
  venster.hoofd.document.write('<title> VWG Arnhem</title>');
  venster.hoofd.document.write('<body bgcolor="#9fc087">');
  venster.hoofd.location = naam;
  venster.document.close();
  venster.focus();
}

//  aanroep met bv a href="javascript:kaart( plaatje_url, 300,200);"
  //  naam = het plaatje, 
  //  breed = breedte van het venster en hoog is hoogte van het venster
  //  hoe geeft aan waar het venster verschijnt kan aangevuld worden met noresize, etc
  //
function kaart(naam, breed, hoog) 
{ 
  hoe= "left=50,top=50,width=" + (breed+50) + ",height=" + (hoog+50);
  venster = window.open("", "preview", hoe);
  venster.document.open();
  // nu ondersteframe de achtegrondkleur en plaatje regelen
  venster.document.open();
  venster.document.write('<body bgcolor="#3E87AE">');
  venster.document.write('<div align="center">');
  venster.document.write('<form><input type="button"  style="color: #000000; background-color: #f2f2f2; font-weight: bold;" Value="Sluit venster"   onClick="top.window.close()"></center></form>');
  venster.document.write('<img src='+ naam +'>');
  venster.document.write('</div></body>');
  venster.document.close();
  venster.focus();
  }

function foto(naam) 
{ //  aanroep met bv a href="javascript:kaart( plaatje_url);"
  //  naam = het plaatje, 
  //  breed = breedte van het venster en hoog is hoogte van het venster
  //  hoe geeft aan waar het venster verschijnt kan aangevuld worden met noresize, etc
  //
  hoe= "left=20,top=50,width=650,height=670, resizable=yes, status=no, menubar=no, location=no";
  venster = window.open("", "preview", hoe);
  venster.document.open();
  // nu ondersteframe de achtegrondkleur en plaatje regelen
  venster.document.open();
  venster.document.write('<body bgcolor="#3E87AE">');
  venster.document.write('<div align="center">');
  venster.document.write('<form><input type="button"  style="color: #000000; background-color: #f2f2f2; font-weight: bold;" Value="Sluit venster"   onClick="top.window.close()"></center></form>');
  venster.document.write('<img src='+ naam +'>');
  venster.document.write('</div></body>');
  venster.document.close();
  venster.focus();
  }


  function kaart_org(naam, breed, hoog) 
{ //  aanroep met bv a href="javascript:kaart( plaatje_url, 300,200);"
  //  naam = het plaatje, 
  //  breed = breedte van het venster en hoog is hoogte van het venster
  //  hoe geeft aan waar het venster verschijnt kan aangevuld worden met noresize, etc
  //
  hoe= "left=50,top=50,width=" + (breed+50) + ",height=" + (hoog+50);
  venster = window.open("", "preview", hoe);
  venster.document.open();
  venster.document.write('<frameset rows="40,* frameborder="NO" border="0" framespacing="0""><frame name="kopje" frameborder="NO" scrolling="no" noresize><frame name="hoofd" frameborder="NO"></frameset>');
  // bovenste frame met een knopje
  venster.kopje.document.open();
  venster.kopje.document.write('<form style="background-color: #9fc087"><center><input type="button"  style="color: #000000; background-color: #339933; font-weight: bold;" Value="Sluit venster"   onClick="top.window.close()"></center></form>');
  venster.kopje.document.close();
  // nu ondersteframe de achtegrondkleur en plaatje regelen
  venster.hoofd.document.open();
  venster.hoofd.document.write('<body bgcolor="#9fc087">');
  venster.hoofd.document.write('<img src='+ naam +'>');
  venster.hoofd.document.write('</body>');
  venster.hoofd.document.close();
  venster.document.close();
  venster.focus();
}

function bouw_scherm(pagina_1,pagina_2,pagina_3)
   {document.close();
    eval("top.klikmenu.location='"+pagina_1+"'");
    eval("top.titel.location='"+pagina_2+"'");
    eval("top.tekst.location='"+pagina_3+"'");
    return;
   }

// schermwisselingen voor slechts twee frames; het linkerframe (menu) blijft staan zoals het gevuld is.
// pagina_2 is de kop
// pagina_3 is de inhoud
// pagina_1 is het linkermenu en wordt niet gewiijzigd.
//
function bouw_scherm_twee(pagina_2,pagina_3)
   {document.close();
    eval("top.titel.location='"+pagina_2+"'");
    eval("top.tekst.location='"+pagina_3+"'");
    return;
   }
   
// schermwisselingen voor drie frames; de kolom met foto's roept steeds hetzelfde aan
// wordt gebruikt in de hoofditems van het menu.
// pagina_2 is de kop
// pagina_3 is de inhoud
// wissel is de wisselkolom met plaatjes
// pagina_1 is het linkermenu en wordt niet gewiijzigd.
//
function bouw_scherm_wissel(pagina_2,pagina_3,wissel)
   {document.close();
    eval("top.wissel.location='"+wissel+"'");
    eval("top.titel.location='"+pagina_2+"'");
    eval("top.tekst.location='"+pagina_3+"'");
    return;
   }
   
   function bouw_scherm_twee_top(pagina_2,pagina_3)
   {document.close();
    eval("top.titel.location='"+pagina_2+"'");
    eval("top.tekst.location='"+pagina_3+"'");
    return;
   }

// alles voor het menu

//Default browsercheck, added to all scripts!
function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}
bw=new checkBrowser()
/************************************************************************************
Making cross-browser objects
************************************************************************************/
function makeMenuObj(obj,nest,img,offimage,onimage){
	nest=(!nest) ? '':'document.'+nest+'.'										
   	this.css=bw.dom? document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+"document.layers." +obj):0;		
	this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;	
	this.ref=bw.dom || bw.ie4? document:bw.ns4?this.css.document:0;		
	this.x=(bw.ns4 || bw.ns5)? this.css.left:this.css.offsetLeft;
	this.y=(bw.ns4 || bw.ns5)? this.css.top:this.css.offsetTop;		
	this.height=bw.ns4?this.ref.height:this.el.offsetHeight;		
	this.hideIt=b_hideIt; this.showIt=b_showIt; this.movey=b_movey
	this.status=0;	
	this.swap=b_swap
	if(onimage)this.onimage=onimage.src
	this.offimage=offimage
	if(img)this.img=this.ref.images[img]
	return this
}
function b_showIt(){this.css.visibility="visible"; this.status=1}
function b_hideIt(){this.css.visibility="hidden"; this.status=0}
function b_movey(y){this.y=y; this.css.top=this.y}	
function b_swap(on){
	if(this.onimage && on){	
		this.img.src=this.onimage
	}else if(this.onimage && !on){
		this.img.src=this.offimage
	}
}

/********************************************************************************
Making menuobjects
********************************************************************************/
function foldoutMenuObj(name){
	this.menus=new Array()
	this.name=name;
	this.makeStyle=fold_style
	this.make=fold_make
	this.construct=fold_construct
	this.fold=fold
	this.foldstay=fold_stay
	this.foldsub=fold_sub
	this.foldsubstay=fold_sub_stay
	this.foldsub2=fold_sub2
	this.foldsub2stay=fold_sub2_stay
	this.foldsub3=fold_sub3
	this.foldsub3stay=fold_sub3_stay
	this.foldsub4=fold_sub4
	this.foldsub4stay=fold_sub4_stay
	this.placeAll=fold_placeAll;
	this.menus=new Array()
	this.a=0; this.b; this.c; this.d; this.e; this.f
	this.initexec=''
	this.opn=fold_opn;
}


/********************************************************************************
Initiating page, making objects..
********************************************************************************/
function fold_construct(){
	this.container=new makeMenuObj('div'+this.name+'Cont')
	this.menu=new Array()
	menuheight=0; 
	for(i=0;i<this.menus.length;i++){
		this.menu[i]=new makeMenuObj('div'+this.name+i,'div'+this.name+'Cont',this.menus[i].img,this.menus[i].offimage,this.menus[i].onimage)
		this.menu[i].subs=this.menus[i].subs
		this.menu[i].sub=new Array()
		for(j=0;j<this.menu[i].subs;j++){
			this.menu[i].sub[j]=new makeMenuObj('div'+this.name+i+"_"+j,'div'+this.name+'Cont',this.menus[i][j].img,this.menus[i][j].offimage,this.menus[i][j].onimage)
			this.menu[i].sub[j].subs=this.menus[i][j].subs
			this.menu[i].sub[j].sub=new Array()
			for(a=0;a<this.menu[i].sub[j].subs;a++){
				this.menu[i].sub[j].sub[a]=new makeMenuObj('div'+this.name+i+"_"+j+"_"+a,'div'+this.name+'Cont',this.menus[i][j][a].img,this.menus[i][j][a].offimage,this.menus[i][j][a].onimage)
				this.menu[i].sub[j].sub[a].subs=this.menus[i][j][a].subs
				this.menu[i].sub[j].sub[a].sub=new Array()
				for(o=0;o<this.menu[i].sub[j].sub[a].subs;o++){
					this.menu[i].sub[j].sub[a].sub[o]=new makeMenuObj('div'+this.name+i+"_"+j+"_"+a+"_"+o,'div'+this.name+'Cont',this.menus[i][j][a][o].img,this.menus[i][j][a][o].offimage,this.menus[i][j][a][o].onimage)
					this.menu[i].sub[j].sub[a].sub[o].subs=this.menus[i][j][a][o].subs
					this.menu[i].sub[j].sub[a].sub[o].sub=new Array()
					for(p=0;p<this.menu[i].sub[j].sub[a].sub[o].subs;p++){
						this.menu[i].sub[j].sub[a].sub[o].sub[p]=new makeMenuObj('div'+this.name+i+"_"+j+"_"+a+"_"+o+"_"+p,'div'+this.name+'Cont',this.menus[i][j][a][o][p].img,this.menus[i][j][a][o][p].offimage,this.menus[i][j][a][o][p].onimage)
						this.menu[i].sub[j].sub[a].sub[o].sub[p].subs=this.menus[i][j][a][o][p].subs
						this.menu[i].sub[j].sub[a].sub[o].sub[p].sub=new Array()
						for(z=0;z<this.menu[i].sub[j].sub[a].sub[o].sub[p].subs;z++){
							this.menu[i].sub[j].sub[a].sub[o].sub[p].sub[z]=new makeMenuObj('div'+this.name+i+"_"+j+"_"+a+"_"+o+"_"+p+"_"+z,'div'+this.name+'Cont')
						}
					}
				}
			}
		}
	}
	this.menus=""
	if(this.initexec) eval(this.initexec)
	else this.placeAll()
	this.container.showIt()
}
function fold_opn(a,b,c,d,e,f){
    if(a>-1) this.initexec+="this.fold("+a+","+this.substay+");"
	if(b>-1) this.initexec+="this.foldsub("+a+","+b+","+this.sub2stay+");"
	if(c>-1) this.initexec+="this.foldsub2("+a+","+b+","+c+","+this.sub3stay+");"
	if(d>-1) this.initexec+="this.foldsub3("+a+","+b+","+c+","+d+","+this.sub4stay+");"
	if(e>-1) this.initexec+="this.foldsub4("+a+","+b+","+c+","+d+","+e+","+this.sub5stay+");"
	if(f>-1) this.initexec+="this.foldsub5("+a+","+b+","+c+","+d+","+e+","+f+","+this.sub6stay+");"
}
/********************************************************************************
The first sub menus
********************************************************************************/
function fold_stay(a){
	for(z=0;z<this.menu.length;z++){
		if(z!=a) this.fold(z,1,1)
	}
	this.fold(a,1,0)
}
function fold(a,fromtop,noplace){	
	if(fromtop){
		for(b=0;b<this.menu[a].subs;b++){
			if(this.menu[a].sub[b].status || noplace){
				this.menu[a].sub[b].hideIt()
				this.menu[a].swap(0)
				this.foldsub(a,b,1,1)
			}else{
				this.menu[a].sub[b].showIt()
				this.menu[a].swap(1)
			}
		}
		if(!noplace) this.placeAll()
	}else this.foldstay(a)
}
/********************************************************************************
The second sub level menus
********************************************************************************/
function fold_sub_stay(a,b){
	for(z=0;z<this.menu[a].subs;z++){
		if(b!=z) this.foldsub(a,z,1,1)
	}
	this.foldsub(a,b,1,0)
}
function fold_sub(a,b,fromtop,noplace){	
	if(fromtop){
		for(c=0;c<this.menu[a].sub[b].subs;c++){
			if(this.menu[a].sub[b].sub[c].status || noplace){
				this.menu[a].sub[b].sub[c].hideIt()
				this.menu[a].sub[b].swap(0)
				this.foldsub2(a,b,c,1,1)
			}else{
				this.menu[a].sub[b].sub[c].showIt()
				this.menu[a].sub[b].swap(1)
			}
		}
		if(!noplace) this.placeAll()
	}else this.foldsubstay(a,b)
}
/********************************************************************************
The third sub level menus
********************************************************************************/
function fold_sub2_stay(a,b,c){
	for(z=0;z<this.menu[a].sub[b].subs;z++){
		if(c!=z) this.foldsub2(a,b,z,1,1)
	}
	this.foldsub2(a,b,c,1,0)
}
function fold_sub2(a,b,c,fromtop,noplace){
	if(fromtop){
		for(d=0;d<this.menu[a].sub[b].sub[c].subs;d++){
			if(this.menu[a].sub[b].sub[c].sub[d].status || noplace){
				this.menu[a].sub[b].sub[c].sub[d].hideIt()
				this.menu[a].sub[b].sub[c].swap(0)
				this.foldsub3(a,b,c,d,1,1)
			}else{
				this.menu[a].sub[b].sub[c].sub[d].showIt()
				this.menu[a].sub[b].sub[c].swap(1)
			}
		}
		if(!noplace) this.placeAll()
	}else this.foldsub2stay(a,b,c)
}
/********************************************************************************
The fourth sub level menus
********************************************************************************/
function fold_sub3_stay(a,b,c,d){
	for(z=0;z<this.menu[a].sub[b].sub[c].subs;z++){
		if(z!=d) this.foldsub3(a,b,c,z,1,1)
	}
	this.foldsub3(a,b,c,d,1,0)
}
function fold_sub3(a,b,c,d,fromtop,noplace){
	if(fromtop){
		for(e=0;e<this.menu[a].sub[b].sub[c].sub[d].subs;e++){
			if(this.menu[a].sub[b].sub[c].sub[d].sub[e].status || noplace){
				this.menu[a].sub[b].sub[c].sub[d].sub[e].hideIt()
				this.menu[a].sub[b].sub[c].sub[d].swap(0)
				this.foldsub4(a,b,c,d,e,1,1)
			}else{
				this.menu[a].sub[b].sub[c].sub[d].sub[e].showIt()
				this.menu[a].sub[b].sub[c].sub[d].swap(1)	
			}	
		}
		if(!noplace) this.placeAll()
	}else this.foldsub3stay(a,b,c,d)
}
/********************************************************************************
The fifth sub level menus
********************************************************************************/
function fold_sub4_stay(a,b,c,d,e){
	for(z=0;z<this.menu[a].sub[b].sub[c].sub[d].subs;z++){
		if(z!=e) this.foldsub4(a,b,c,d,z,1,1)
	}
	this.foldsub4(a,b,c,d,e,1,0)
}
function fold_sub4(a,b,c,d,e,fromtop,noplace){
	if(fromtop){
		for(f=0;f<this.menu[a].sub[b].sub[c].sub[d].sub[e].subs;f++){
			if(this.menu[a].sub[b].sub[c].sub[d].sub[e].sub[f].status || noplace){
				this.menu[a].sub[b].sub[c].sub[d].sub[e].sub[f].hideIt()
				this.menu[a].sub[b].sub[c].sub[d].sub[e].swap(0)
			}else{
				this.menu[a].sub[b].sub[c].sub[d].sub[e].sub[f].showIt()
				this.menu[a].sub[b].sub[c].sub[d].sub[e].swap(1)
			}
		}
		if(!noplace) this.placeAll()
	}else this.foldsub4stay(a,b,c,d,e)
}
/********************************************************************************
Placing all layers correctly
********************************************************************************/
function fold_placeAll(){
	menuheight=0;
	for(i=0;i<this.menu.length;i++){
		this.menu[i].movey(menuheight)
		menuheight+=this.menu[i].height+this.menubetween
		for(j=0;j<this.menu[i].subs;j++){
			this.menu[i].sub[j].movey(menuheight)
			if(this.menu[i].sub[j].status) menuheight+=this.menu[i].sub[j].height+this.menubetween
			for(a=0;a<this.menu[i].sub[j].subs;a++){
				this.menu[i].sub[j].sub[a].movey(menuheight)
				if(this.menu[i].sub[j].sub[a].status) menuheight+=this.menu[i].sub[j].sub[a].height+this.menubetween
				for(o=0;o<this.menu[i].sub[j].sub[a].subs;o++){
					this.menu[i].sub[j].sub[a].sub[o].movey(menuheight)
					if(this.menu[i].sub[j].sub[a].sub[o].status) menuheight+=this.menu[i].sub[j].sub[a].sub[o].height+this.menubetween
					for(p=0;p<this.menu[i].sub[j].sub[a].sub[o].subs;p++){
						this.menu[i].sub[j].sub[a].sub[o].sub[p].movey(menuheight)
						if(this.menu[i].sub[j].sub[a].sub[o].sub[p].status) menuheight+=this.menu[i].sub[j].sub[a].sub[o].sub[p].height+this.menubetween
						for(z=0;z<this.menu[i].sub[j].sub[a].sub[o].sub[p].subs;z++){
							this.menu[i].sub[j].sub[a].sub[o].sub[p].sub[z].movey(menuheight)
							if(this.menu[i].sub[j].sub[a].sub[o].sub[p].sub[z].status) menuheight+=this.menu[i].sub[j].sub[a].sub[o].sub[p].sub[z].height+this.menubetween
						}
					}
				}
			}
		}
	}
}

/********************************************************************************
Functions to write out the layers...Should be moved server-side
********************************************************************************/

function fold_style(){
	str='\n<style type="text/css">\n'
	str+='\tDIV.cl'+this.name+'{position:absolute; '+ this.clFold +'; width:'+this.width+'; height:18}\n'
	str+='\tDIV.cl'+this.name+'Sub{position:absolute; '+ this.clSub +';height:10; width:'+this.width+'; visibility:hidden}\n'
	str+='\tDIV.cl'+this.name+'Sub2{position:absolute; '+ this.clSub2 +';height:10; width:'+this.width+'; visibility:hidden}\n'
	str+='\tDIV.cl'+this.name+'Sub3{position:absolute; '+ this.clSub3 +';height:10; width:'+this.width+'; visibility:hidden}\n'
	str+='\tDIV.cl'+this.name+'Sub4{position:absolute; '+ this.clSub4 +';height:10; width:'+this.width+'; visibility:hidden}\n'
	str+='\tDIV.cl'+this.name+'Sub5{position:absolute; '+ this.clSub5 +';height:10; width:'+this.width+'; visibility:hidden}\n'
	str+='\t#div'+this.name+'Cont{'+this.clCont+'; left:'+this.left+'; top:'+this.top+'; height:'+this.maxheight+'; width:'+this.width+'; visibility:hidden}\n'
	str+='\tA.cl'+this.name+'Links{'+this.clFoldLinks+'}\n'
	str+='\tA.cl'+this.name+'1Links{'+this.clSubLinks+'}\n'
	str+='\tA.cl'+this.name+'2Links{'+this.clSub2Links+'}\n'
	str+='\tA.cl'+this.name+'3Links{'+this.clSub3Links+'}\n'
	str+='\tA.cl'+this.name+'4Links{'+this.clSub4Links+'}\n'
	str+='\tA.cl'+this.name+'5Links{'+this.clSub5Links+'}\n'
	str+='</style>\n\n\n'
	document.write(str)
}
function fold_make_link(text,lnk,target,offimage,id,cl,ev,acl){
	str2='\t<div id="div'+id+'" class="cl'+cl+'"><a href="'
	if(lnk)	str2+=lnk+'" '
	else str2+='#" '
	if(!lnk || target){
		str2+='onclick="'+ev+'; if(bw.ie5 || bw.ie4) this.blur()'
		if(!target) str2+='; return false'; str2+='"'
	} 
	if(target) str2+=' target="'+target+'"'; str2+=' class="cl'+acl+'Links">'
	if(offimage) str2+='<img src="'+offimage+'" name="img'+id+'" border="0">'
	str2+=text+'</a><br></div>\n'
	return str2
}

function fold_make(type,text,lnk,target,offimage,onimage,fc,opn,end){
	str="" ; fc=fc?fc+'; ':'';
	if(!offimage) offimage=""; if(!onimage) onimage=""
	if(this.a==0) str='<div id="div'+this.name+'Cont">\n'
	if(type=="top"){
		id=this.name+this.a
		str+=fold_make_link(text,lnk,target,offimage,this.name+this.a,this.name,fc+this.name+'.fold('+this.a+','+this.name+'.substay)',this.name)
		this.menus[this.a]=new Array()
		this.menus[this.a].subs=0
		if(onimage){ this.menus[this.a].onimage=new Image(); this.menus[this.a].onimage.src=onimage; this.menus[this.a].offimage=offimage; this.menus[this.a].img='img'+id} 
		this.a++; this.b=0; if(opn) this.opn(this.a)
	}else if(type=="sub"){
		id=this.name+(this.a-1)+'_'+(this.b),this.name+'Sub'
		str+=fold_make_link(text,lnk,target,offimage,id,this.name+'Sub',fc+this.name+'.foldsub('+(this.a-1)+','+(this.b)+','+this.name+'.sub2stay)',this.name+'1')
		if(opn) this.opn(this.a-1,this.b)
		this.menus[this.a-1][this.b]=new Array()
		if(onimage){ this.menus[this.a-1][this.b].onimage=new Image(); this.menus[this.a-1][this.b].onimage.src=onimage; this.menus[this.a-1][this.b].offimage=offimage; this.menus[this.a-1][this.b].img='img'+id} 
		this.b++; this.menus[this.a-1].subs=this.b; this.c=0
	}else if(type=="sub2"){
		id=this.name+(this.a-1)+'_'+(this.b-1)+'_'+(this.c)
		str+=fold_make_link(text,lnk,target,offimage,id,this.name+'Sub2',fc+this.name+'.foldsub2('+(this.a-1)+','+(this.b-1)+','+(this.c)+','+this.name+'.sub3stay)',this.name+'2')
		if(opn) this.opn(this.a-1,this.b-1,this.c)
		this.menus[this.a-1][this.b-1][this.c]=new Array()
		if(onimage){ this.menus[this.a-1][this.b-1][this.c].onimage=new Image(); this.menus[this.a-1][this.b-1][this.c].onimage.src=onimage; this.menus[this.a-1][this.b-1][this.c].offimage=offimage; this.menus[this.a-1][this.b-1][this.c].img='img'+id} 
		this.c++; this.menus[this.a-1][this.b-1].subs=this.c; this.d=0
	}else if(type=="sub3"){
		id=this.name+(this.a-1)+'_'+(this.b-1)+'_'+(this.c-1)+'_'+(this.d)
		str+=fold_make_link(text,lnk,target,offimage,id,this.name+'Sub3',fc+this.name+'.foldsub3('+(this.a-1)+','+(this.b-1)+','+(this.c-1)+','+this.d+','+this.name+'.sub4stay)',this.name+'3')
		if(opn) this.opn(this.a-1,this.b-1,this.c-1,this.d)
		this.menus[this.a-1][this.b-1][this.c-1][this.d]=new Array()
		if(onimage){ this.menus[this.a-1][this.b-1][this.c-1][this.d].onimage=new Image(); this.menus[this.a-1][this.b-1][this.c-1][this.d].onimage.src=onimage; this.menus[this.a-1][this.b-1][this.c-1][this.d].offimage=offimage; this.menus[this.a-1][this.b-1][this.c-1][this.d].img='img'+id} 
		this.d++; this.menus[this.a-1][this.b-1][this.c-1].subs=this.d; this.e=0
	}else if(type=="sub4"){
		id=this.name+(this.a-1)+'_'+(this.b-1)+'_'+(this.c-1)+'_'+(this.d-1)+'_'+(this.e)
		str+=fold_make_link(text,lnk,target,offimage,id,this.name+'Sub4',fc+this.name+'.foldsub4('+(this.a-1)+','+(this.b-1)+','+(this.c-1)+','+(this.d-1)+','+this.e+','+this.name+'.sub5stay)',this.name+'4')
		if(opn) this.opn(this.a-1,this.b-1,this.c-1,this.d-1,this.e)
		this.menus[this.a-1][this.b-1][this.c-1][this.d-1][this.e]=new Array()
		if(onimage){ this.menus[this.a-1][this.b-1][this.c-1][this.d-1][this.e].onimage=new Image(); this.menus[this.a-1][this.b-1][this.c-1][this.d-1][this.e].onimage.src=onimage; this.menus[this.a-1][this.b-1][this.c-1][this.d-1][this.e].offimage=offimage; this.menus[this.a-1][this.b-1][this.c-1][this.d-1][this.e].img='img'+id} 
		this.e++; this.menus[this.a-1][this.b-1][this.c-1][this.d-1].subs=this.e; this.f=0
	}else if(type=="sub5"){
		str+='\t\t\t<div id="div'+this.name+(this.a-1)+'_'+(this.b-1)+'_'+(this.c-1)+'_'+(this.d-1)+'_'+(this.e-1)+'_'+(this.f)+'" class="cl'+this.name+'Sub5"><a href="'+lnk+'" onclick="'+fc+'" class="cl'+this.name+'5Links"'
		if(target) str+=' target="+target+"'
		str+='>'+text+'</a><br></div>\n'
		if(opn) this.opn(this.a-1,this.b-1,this.c-1,this.d-1,this.e-1,this.f)
		this.f++; this.menus[this.a-1][this.b-1][this.c-1][this.d-1][this.e-1].subs=this.f
	}
	if(end) str+="</div>"
	document.write(str)
}
//  popup


/***********************************************
* Cool DHTML tooltip script- ? Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var offsetxpoint=-60 //Customize x offset of tooltip
var offsetypoint=20 //Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thecolor, thewidth){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
else if (curX<leftedge)
tipobj.style.left="5px"
else
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetxpoint+"px"

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
tipobj.style.top=curY+offsetypoint+"px"
tipobj.style.visibility="visible"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip


