<!--//
//FoldOut Menu V0.56 (FO)

// If no itemtext is specified an empty line will be added
// If the itmetext is "-" then a horizontal line will be added


var version = "other"
browserName = navigator.appName;          
browserVer = parseInt(navigator.appVersion);
if (browserName == "Netscape" && browserVer >= 3) version = "n3";
else if (browserName == "Netscape" && browserVer < 3) version = "n2";
else if (browserName == "Microsoft Internet Explorer" && browserVer >= 4) version = "e4";
else if (browserName == "Microsoft Internet Explorer" && browserVer < 4) version = "e3";

//Generate Array

//rows	=	19+1;//0=empty 1..n=data


FOTest = 0;

			
function FoldOutButton(ID, ParentID, ParentIDX, HasChild, Text, Link, Target, RootRow, Level, XOrigin, YOrigin){
	this.ID 			= ID		//Must be filled by user, MUST BE UNIQUE
	this.ParentID		= ParentID	//Must be filled by user
	this.ParentIDX		= ParentIDX	//Must NOT be filled by user
	this.HasChild		= HasChild	//Must NOT be filled by user
	this.Text			= Text		//Must be filled by user
	this.Link			= Link		//May be filled by user
	this.Target			= Target	//May be filled by user
	this.RootRow		= RootRow	//Must NOT be filled by user	
	this.Level			= Level		//Must NOT be filled by user
	this.XOrigin		= XOrigin	//Must NOT be filled by user
	this.YOrigin		= YOrigin	//Must NOT be filled by user
}

function FoldOutMenuFields(HTML, HTML1){
	this.HTML			= HTML		//Must NOT be filled by user
	this.HTML1			= HTML1		//Must NOT be filled by user
}



//GlobalData
if ( typeof(top.FObutton) == "undefined" ){
//	alert('BuildArray');
	top.FObutton = new Array(top.FOrows);
	for ( i = 0; i < top.FOrows; i++ ) {
		top.FObutton[i] = new FoldOutButton("_","_",0,0,"","#","framemain",0,0,0,0);
	}
	top.FOcurrentopenmenu	= 0;
	top.FOcurrentopenitem	= 0;
	top.FOmayclose		 	= 0;
	top.FOmenuisdrawn		= 0;
//	top.FOclosetimer		= 0;
	if ( typeof(top.FOrows) != "undefined" ){
//		alert('FillArray');
		top.FOarraydata1(); //Initialize array data
	}
}

//Data root menu
FOmenudelay			=	750; //Time to close menu's
FOmenuopendelay		=   250; //Time before a menu opens
FOseperaterootmenu	=	1; //is a seperate root menu used? 0=no 1=yes
FOrootwidth			=	144;
FOrootheight		=	26;
FOxorigin			=	0;
FOyorigin			=	100;
FOhspacing			=	6;
FOvspacing			=	4;
FOhalignment		=	"right";
FOvalignment		=	"top";
FOframe				=	"frameside";
FOimagepath			=	"images/";
FObackdrop			=	"";
FOcelbackground		=	"buttonmain"; //If emty table backgrounds will be used instead
FOchildext			=	"arrow";
FOtextinactive		=	"#000000";
FOtextactive		=	"#FFFFFF";
FOtableinactive		=	"";
FOtableactive		=   "";

//Data sub menu
FOsubwidth			=	145;
FOsubheight			=	26;
FOsubxorigin		=	0;
FOsubyorigin		=	17;
FOsubhspacing		=	5;
FOsubvspacing		=	0;
//FOsubhalignment		=	"right";
//FOsubvalignment		=	"top";
FOsubframe			=	"framemain";
FOsubimagepath		=	"../images/";
FOsubbackdrop		=	"submenuback.gif";
FOsubcelbackground	=	"";
FOsubchildext		=	"arrow";
FOsubtextinactive	=	"#000000";
FOsubtextactive		=	"#FFFFFF";
FOsubtableinactive	=	"";
FOsubtableactive	=   "#936EC8";

//General Functions

function FO_img_cache(imgPath,imgTag,imgType,nameTag) {
	if (version == "n3" || version == "e4") {
		if( typeof(nameTag) != "undefined" ){
		    this[nameTag+'on'] = new Image();
			this[nameTag+'on'].src = [imgPath+imgTag+'on.'+imgType];
		    this[nameTag+'off'] = new Image();
			this[nameTag+'off'].src = [imgPath+imgTag+'off.'+imgType];
		}else{
		    this[imgTag+'on'] = new Image();
			this[imgTag+'on'].src = [imgPath+imgTag+'on.'+imgType];
		    this[imgTag+'off'] = new Image();
			this[imgTag+'off'].src = [imgPath+imgTag+'off.'+imgType];
		}
	}
    return true;
}

function FO_img_act(imgTag,nr,textcolor,cellcolor) {
	if (version == "n3" || version == "e4") {
		if ( typeof(nr) == "undefined" ){
			if ( typeof(cellcolor) != "undefined" ){
				document.all[imgTag].style.backgroundColor = cellcolor;
			}else{
				document.all[imgTag].src = this[imgTag+'on'].src;
			}
			if ( typeof(textcolor) != "undefined" ){
				document.all[imgTag+'T'].style.color = textcolor;
			}
		}else{
			if ( typeof(cellcolor) != "undefined" ){
				document.all[imgTag+nr].style.backgroundColor = cellcolor;
			}else{
				document.all[imgTag+nr].src = this[imgTag+'on'].src;
			}
			if ( typeof(textcolor) != "undefined" ){
				document.all[imgTag+nr+'T'].style.color = textcolor;
			}
		}
	}
    return true;
}

function FO_img_inact(imgTag,nr,textcolor,cellcolor) {
		if ( typeof(nr) == "undefined" ){
			if ( typeof(cellcolor) != "undefined" ){
				document.all[imgTag].style.backgroundColor = cellcolor;
			}else{
				document.all[imgTag].src = this[imgTag+'off'].src;
			}
			if ( typeof(textcolor) != "undefined" ){
				document.all[imgTag+'T'].style.color = textcolor;
			}
		}else{
			if ( typeof(cellcolor) != "undefined" ){
				document.all[imgTag+nr].style.backgroundColor = cellcolor;
			}else{
				document.all[imgTag+nr].src = this[imgTag+'off'].src;
			}
			if ( typeof(textcolor) != "undefined" ){
				document.all[imgTag+nr+'T'].style.color = textcolor;
			}
		}
		return true;
}

function FO_sel_but(ButtonIDX){
	if ( top.FObutton[ButtonIDX].Link != "" ){
		var rootstr	=	"";
	   	FO_hide_menu(0);
		//alert('Click='+top.FObutton[ButtonIDX].Text+' - HREF=\"'+top.FObutton[ButtonIDX].Link+'\" Target=\"'+top.FObutton[ButtonIDX].Target+'\"');
		if ( top.FObutton[ButtonIDX].Link.substr(0,3) == "htt" ){
//			eval("top.location.href = top.FObutton["+ButtonIDX+"].Link;");
			top.location.href = top.FObutton[ButtonIDX].Link;
		}else{
			if ( top.FObutton[ButtonIDX].ParentID == "_" ){
				rootstr = "./";
			}else{
				rootstr = "../";
			}
			if ( top.FObutton[ButtonIDX].Target == "" ){
//				eval("top."+FOsubframe+".location.href = rootstr+top.FObutton["+ButtonIDX+"].Link;");
				top[FOsubframe].location.href = rootstr+top.FObutton[ButtonIDX].Link;
			}else{
//				eval("top."+top.FObutton[ButtonIDX].Target+".location.href = rootstr+top.FObutton["+ButtonIDX+"].Link;");
				top[top.FObutton[ButtonIDX].Target].location.href = rootstr+top.FObutton[ButtonIDX].Link;
			}
		}
//		alert(top.framemain.location.href);
	}
}

function FO_show_menu(MenuIDX,ButtonIDX,Recall){
//top.FOmayclose	= 0;
	if ( typeof(Recall) == "undefined"){
		top.FOmayclose			= 0;
		top.FOmayopen = MenuIDX;
		top.frameside.setTimeout('FO_show_menu('+MenuIDX+','+ButtonIDX+',1);',FOmenuopendelay);
	}else{
		if ( MenuIDX == top.FOmayopen){
//			top.FOmayclose = 0;
			var	parentcorrection	= 0;
			var heightcorrection	= 0;

			FO_hide_menu(MenuIDX);
		
			if ( FOseperaterootmenu == 1 ){
				if ( top.FObutton[MenuIDX].HasChild == 1 ){
		
					
					if ( typeof(top[FOsubframe]['FOsubmenu'+top.FObutton[MenuIDX].ID]) != "undefined" ){
						if ( top.FObutton[MenuIDX].ParentID != "_" ){
							parentcorrection = (parseInt(top[FOsubframe]['FOsubmenu'+top.FObutton[top.FObutton[MenuIDX].ParentIDX].ID].style.top)-parseInt(top[FOsubframe]['FOsubmenu'+top.FObutton[top.FObutton[MenuIDX].ParentIDX].ID].style.toporigin)-top[FOsubframe].document.body.scrollTop);
						}else{
							parentcorrection = 0;
						}
						heightcorrection = (top[FOsubframe].document.body.clientHeight-(parseInt(top[FOsubframe]['FOsubmenu'+top.FObutton[MenuIDX].ID].style.toporigin)+top[FOsubframe]['FOsubmenu'+top.FObutton[MenuIDX].ID].offsetHeight))-parentcorrection;
						if ( heightcorrection > 0 ){
							heightcorrection = 0;
						}
		

						top[FOsubframe]['FOsubmenu'+top.FObutton[MenuIDX].ID].style.top = ((parseInt(top[FOsubframe]['FOsubmenu'+top.FObutton[MenuIDX].ID].style.toporigin)+top[FOsubframe].document.body.scrollTop)+heightcorrection+parentcorrection);	//Internet Explorer
						top[FOsubframe]['FOsubmenu'+top.FObutton[MenuIDX].ID].style.left = (parseInt(top[FOsubframe]['FOsubmenu'+top.FObutton[MenuIDX].ID].style.leftorigin)+top[FOsubframe].document.body.scrollLeft);	//Internet Explorer
						top[FOsubframe]['FOsubmenu'+top.FObutton[MenuIDX].ID].style.visibility = "visible";	//Internet Explorer
						top[FOsubframe]['FOsubmenu'+top.FObutton[MenuIDX].ID+'T'].style.top = ((parseInt(top[FOsubframe]['FOsubmenu'+top.FObutton[MenuIDX].ID].style.toporigin)+top[FOsubframe].document.body.scrollTop)+heightcorrection+parentcorrection);	//Internet Explorer
						top[FOsubframe]['FOsubmenu'+top.FObutton[MenuIDX].ID+'T'].style.left = (parseInt(top[FOsubframe]['FOsubmenu'+top.FObutton[MenuIDX].ID].style.leftorigin)+top[FOsubframe].document.body.scrollLeft);	//Internet Explorer
						top[FOsubframe]['FOsubmenu'+top.FObutton[MenuIDX].ID+'T'].style.visibility = "visible";	//Internet Explorer
					}



				}
			}else{
		
			}
			top.FOcurrentopenmenu = MenuIDX;
			top.FOcurrentopenitem = ButtonIDX;
		}
	}
}

function FO_hide_menu(ButtonIDX){
//	alert(top.FObutton[ButtonIDX].Level+" COM: "+top.FObutton[top.FOcurrentopenmenu].Level);
//	alert("Index: "+ButtonIDX+" COM: "+top.FOcurrentopenmenu);
	if ( top.FOcurrentopenmenu != 0 ){

		//alert(typeof(top[FOsubframe]['FOsubmenu'+top.FObutton[top.FOcurrentopenmenu].ID]));
	
		if ( typeof(top[FOsubframe]['FOsubmenu'+top.FObutton[top.FOcurrentopenmenu].ID]) == "undefined" ){
			//When the item doesn't exist we don't have to close it anyway		
		}else{
			if ( top.FObutton[ButtonIDX].Level < top.FObutton[top.FOcurrentopenmenu].Level ){
				top[FOsubframe]['FOsubmenu'+top.FObutton[top.FOcurrentopenmenu].ID].style.visibility = "hidden";	//Internet Explorer
				top[FOsubframe]['FOsubmenu'+top.FObutton[top.FOcurrentopenmenu].ID+'T'].style.visibility = "hidden";	//Internet Explorer
				top.FOcurrentopenmenu=top.FObutton[top.FOcurrentopenmenu].ParentIDX;
				FO_hide_menu(ButtonIDX);
			}else{
				if ( top.FObutton[ButtonIDX].Level == top.FObutton[top.FOcurrentopenmenu].Level ){
					top[FOsubframe]['FOsubmenu'+top.FObutton[top.FOcurrentopenmenu].ID].style.visibility = "hidden";	//Internet Explorer
					top[FOsubframe]['FOsubmenu'+top.FObutton[top.FOcurrentopenmenu].ID+'T'].style.visibility = "hidden";	//Internet Explorer
				}
			}
		}
	}	
}

function FO_hide_all (ButtonIDX,Recall){
//	alert("hide");
	if ( typeof(Recall) == "undefined" ){
		top.FOmayclose = 1;
	 	top.frameside.setTimeout('FO_hide_all('+ButtonIDX+',1);',FOmenudelay);
	}else{
//		alert("mayclose="+top.FOmayclose+" Recall="+Recall+" closetimer="+top.FOclosetimer);
		if ( top.FOmayclose == 1 && ButtonIDX == top.FOcurrentopenitem ){
	    	FO_hide_menu(0);
		}
	}	
}








//Ad an item to the data array
function FO_add_item ( ID, ParentID, Text, Link, Target ){
// This function can't be used after a menu has been created. Use this function to add items before the menu is drawn	
	if ( top.FOmenuisdrawn == 0 ){
//		alert(top.FObutton.length);
		top.FObutton.push(new FoldOutButton("_","_",0,0,"","#","framemain",0,0,0,0));
		top.FObutton[top.FObutton.length-1].ID          =  ID;
		top.FObutton[top.FObutton.length-1].ParentID    =  ParentID;
		top.FObutton[top.FObutton.length-1].Text        =  Text;
		top.FObutton[top.FObutton.length-1].Link        =  Link;
		top.FObutton[top.FObutton.length-1].Target      =  Target;
	}
}

//function FO_generate_root(xorigin,yorigin,hspacing,vspacing,alignment,menuframe,backdrop,imagefolder,celbackground){
function FO_generate_root(){
	var i				=	0;
	var j				=	0;
	var xorigincel		=	"";
	top.FOmenuisdrawn	=	1;
	HTML				=	"";
	HTML1				=	"";

	if ( FOcelbackground != "" ){
		//Cache (Root)Menu buttons
		FO_img_cache(FOimagepath,FOcelbackground+FOchildext,"gif",'FObuttonIDC');
		FO_img_cache(FOimagepath,FOcelbackground,"gif",'FObuttonID');
		FObuttonIDoff.width 	= FOrootwidth;
		FObuttonIDoff.height 	= FOrootheight;
	}
		
	HTML = HTML + "<div id=\"FOrootmenu\" style=\"position:absolute; left:"+FOxorigin+"; top:"+FOyorigin+"; width: "+FOrootwidth+"; visibility:visible; z-index: "+3+"; filter: alpha(opacity='50',enabled=0);\">"; //Start DIV
	HTML = HTML + "<table width=\""+FOrootwidth+"\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"left\""; // Start table
	HTML1= HTML1+ "<div id=\"FOsubmenuT\" style=\"position:absolute; left:"+FOxorigin+"; top:"+(FOyorigin+4)+"; width: "+FOrootwidth+"; visibility:visible; z-index: "+4+";\">"; //Start DIV
	HTML1= HTML1+ "<table width=\""+FOrootwidth+"\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"left\""; // Start table

	i = 1; 
	while ( i < top.FObutton.length ){
		if ( top.FObutton[i].ParentID == "_" ){
			top.FObutton[i].HasChild 	= 0;
			j			= 1;
			while ( (top.FObutton[i].HasChild != 1) && (j < top.FObutton.length) ){
				if ( top.FObutton[i].ID == top.FObutton[j].ParentID ){
					top.FObutton[i].HasChild = 1;
				}
				j++;
			}

			if ( FOcelbackground != "" ){
				if ( top.FObutton[i].HasChild == 1 ){
					HTML = HTML + "<tr><td class=\"menuitem\" nowrap><img src=\""+FOimagepath+FOcelbackground+FOchildext+"off.gif\" width=\""+FOrootwidth+"\" height=\""+FOrootheight+"\" border=\"0\" hspace=\"0\" vspace=\"0\" id=\"FObuttonIDC"+top.FObutton[i].ID+"\"></td></tr>"; //Button+child
					HTML1= HTML1+ "<tr><td class=\"menuitem\" nowrap width=\""+FOrootwidth+"\" height=\""+FOrootheight+"\" valign=\"top\" class=\"menuitem\" id=\"FObuttonIDC"+top.FObutton[i].ID+"T\" onMouseOver=\"FO_img_act('FObuttonIDC',"+top.FObutton[i].ID+",'"+FOtextactive+"'); FO_show_menu("+i+","+i+")\" onMouseOut=\"FO_img_inact('FObuttonIDC',"+top.FObutton[i].ID+",'"+FOtextinactive+"'); FO_hide_all("+i+");\" OnClick=\"FO_sel_but("+i+");\"><img src=\"images/filler.gif\" width=\""+FOhspacing+"\" height=\"1\" border=\"0\" hspace=\"0\" vspace=\"0\">"+top.FObutton[i].Text+"</td></tr>"; //Button+child
				}else{
					HTML = HTML + "<tr><td class=\"menuitem\" nowrap width=\""+FOrootwidth+"\" height=\""+FOrootheight+"\" valign=\"top\"><img src=\""+FOimagepath+FOcelbackground+"off.gif\" width=\""+FOrootwidth+"\" height=\""+FOrootheight+"\" border=\"0\" hspace=\"0\" vspace=\"0\" id=\"FObuttonID"+top.FObutton[i].ID+"\"></td></tr>"; //Button+child
					if ( top.FObutton[i].Text == "" || top.FObutton[i].Text == "-" ){
						if ( top.FObutton[i].Text == "" ){
							HTML1= HTML1+ "<tr><td class=\"menuitem\" nowrap width=\""+FOrootwidth+"\" height=\""+FOrootheight+"\" valign=\"top\" class=\"menuitem\" id=\"FObuttonID"+top.FObutton[i].ID+"T\" onMouseOut=\"FO_hide_all("+i+");\"><img src=\"images/filler.gif\" width=\""+FOhspacing+"\" height=\"1\" border=\"0\" hspace=\"0\" vspace=\"0\">"+top.FObutton[i].Text+"</td></tr>"; //Button+child
						}else{
							HTML1= HTML1+ "<tr><td class=\"menuitem\" nowrap width=\""+FOrootwidth+"\" height=\""+FOrootheight+"\" valign=\"top\" class=\"menuitem\" id=\"FObuttonID"+top.FObutton[i].ID+"T\" onMouseOut=\"FO_hide_all("+i+");\"><img src=\"images/filler.gif\" width=\""+FOhspacing+"\" height=\"1\" border=\"0\" hspace=\"0\" vspace=\"0\"><hr width=\"100%\" size=\"1\" color=\"#000000\" noshade\"></td></tr>"; //Button+child
						}
					}else{
						HTML1= HTML1+ "<tr><td class=\"menuitem\" nowrap width=\""+FOrootwidth+"\" height=\""+FOrootheight+"\" valign=\"top\" class=\"menuitem\" id=\"FObuttonID"+top.FObutton[i].ID+"T\" onMouseOver=\"FO_img_act('FObuttonID',"+top.FObutton[i].ID+",'"+FOtextactive+"');\" onMouseOut=\"FO_img_inact('FObuttonID',"+top.FObutton[i].ID+",'"+FOtextinactive+"'); FO_hide_all("+i+");\" OnClick=\"FO_sel_but("+i+");\"><img src=\"images/filler.gif\" width=\""+FOhspacing+"\" height=\"1\" border=\"0\" hspace=\"0\" vspace=\"0\">"+top.FObutton[i].Text+"</td></tr>"; //Button+child
					}
				}
				if ( FOvspacing > 0 ) {
					HTML = HTML + "<tr><td class=\"menuitem\" nowrap width=\"1\" height=\""+FOvspacing+"\"><img src=\"images/filler.gif\" width=\"1\" height=\""+FOvspacing+"\" hspace=\"0\" vspace=\"0\" border=\"0\"></td></tr>"; //Spacer
					HTML1= HTML1+ "<tr><td class=\"menuitem\" nowrap width=\"1\" height=\""+FOvspacing+"\"><img src=\"images/filler.gif\" width=\"1\" height=\""+FOvspacing+"\" hspace=\"0\" vspace=\"0\" border=\"0\"></td></tr>"; //Spacer
				}
			}else{
				if ( top.FObutton[i].HasChild == 1 ){
					HTML = HTML + "<tr><td class=\"menuitem\" nowrap style=\"background-color: "+FOtableinactive+";\" width=\""+FOrootwidth+"\" height=\""+FOrootheight+"\" id=\"FObuttonIDC"+top.FObutton[i].ID+"\" align=\"right\"><img src=\"images/arrow.gif\" width=\"16\" height=\"16\" hspace=\"3\" vspace=\"0\" border=\"0\"></td></tr>"; //Button+child
					HTML1= HTML1+ "<tr><td class=\"menuitem\" nowrap width=\""+FOrootwidth+"\" height=\""+FOrootheight+"\" valign=\"middle\" class=\"menuitem\" id=\"FObuttonIDC"+top.FObutton[i].ID+"T\" onMouseOver=\"FO_img_act('FObuttonIDC',"+top.FObutton[i].ID+",'"+FOtextactive+"','"+FOtableactive+"'); FO_show_menu("+i+","+i+")\" onMouseOut=\"FO_img_inact('FObuttonIDC',"+top.FObutton[i].ID+",'"+FOtextinactive+"','"+FOtableinactive+"'); FO_hide_all("+i+");\" OnClick=\"FO_sel_but("+i+");\"><img src=\"images/filler.gif\" width=\""+FOhspacing+"\" height=\"1\" border=\"0\" hspace=\"0\" vspace=\"0\">"+top.FObutton[i].Text+"</td></tr>"; //Button+child
				}else{
					HTML = HTML + "<tr><td nowrap style=\"background-color: "+FOtableinactive+";\" width=\""+FOrootwidth+"\" height=\""+FOrootheight+"\" id=\"FObuttonID"+top.FObutton[i].ID+"\"></td></tr>"; //Button+child
					if ( top.FObutton[i].Text == "" || top.FObutton[i].Text == "-" ){
						if ( top.FObutton[i].Text == "" ){
							HTML1= HTML1+ "<tr><td class=\"menuitem\" nowrap width=\""+FOrootwidth+"\" height=\""+FOrootheight+"\" valign=\"middle\" class=\"menuitem\" id=\"FObuttonID"+top.FObutton[i].ID+"T\" onMouseOver=\"FO_show_menu("+top.FObutton[i].ParentIDX+","+i+")\" onMouseOut=\"FO_hide_all("+i+");\"><img src=\"images/filler.gif\" width=\""+FOhspacing+"\" height=\"1\" border=\"0\" hspace=\"0\" vspace=\"0\">"+top.FObutton[i].Text+"</td></tr>"; //Button+child
						}else{
							HTML1= HTML1+ "<tr><td class=\"menuitem\" nowrap width=\""+FOrootwidth+"\" height=\""+FOrootheight+"\" valign=\"middle\" class=\"menuitem\" id=\"FObuttonID"+top.FObutton[i].ID+"T\" onMouseOver=\"FO_show_menu("+top.FObutton[i].ParentIDX+","+i+")\" onMouseOut=\"FO_hide_all("+i+");\"><hr width=\"100%\" size=\"1\" color=\"#000000\" noshade\"></td></tr>"; //Button+child
						}
					}else{
						HTML1= HTML1+ "<tr><td class=\"menuitem\" nowrap width=\""+FOrootwidth+"\" height=\""+FOrootheight+"\" valign=\"middle\" class=\"menuitem\" id=\"FObuttonID"+top.FObutton[i].ID+"T\" onMouseOver=\"FO_img_act('FObuttonID',"+top.FObutton[i].ID+",'"+FOtextactive+"','"+FOtableactive+"'); FO_show_menu("+top.FObutton[i].ParentIDX+","+i+")\" onMouseOut=\"FO_img_inact('FObuttonID',"+top.FObutton[i].ID+",'"+FOtextinactive+"','"+FOtableinactive+"'); FO_hide_all("+i+");\" OnClick=\"FO_sel_but("+i+");\"><img src=\"images/filler.gif\" width=\""+FOhspacing+"\" height=\"1\" border=\"0\" hspace=\"0\" vspace=\"0\">"+top.FObutton[i].Text+"</td></tr>"; //Button+child
					}
				}
				if ( FOvspacing > 0 ) {
					HTML = HTML + "<tr><td class=\"menuitem\" nowrap width=\"1\" height=\""+FOvspacing+"\"><img src=\"images/filler.gif\" width=\"1\" height=\""+FOvspacing+"\" hspace=\"0\" vspace=\"0\" border=\"0\"></td></tr>"; //Spacer
					HTML1= HTML1+ "<tr><td class=\"menuitem\" nowrap width=\"1\" height=\""+FOvspacing+"\"><img src=\"images/filler.gif\" width=\"1\" height=\""+FOvspacing+"\" hspace=\"0\" vspace=\"0\" border=\"0\"></td></tr>"; //Spacer
				}
			}
		}
		i++;
	}

	HTML = HTML + "</table>"; //End table
	HTML = HTML + "</div>"; //End DIV
	HTML1= HTML1+ "</table>"; //End table
	HTML1= HTML1+ "</div>"; //End DIV
	return HTML+"<BR>"+HTML1;

}

function FO_generate_sub(){
	zindex				=	2; 		//First usable Z-Index
	HTML				=	"";	
	HTML1				=	"";
	Numberofmenus		=   0;	
	top.FOmenuisdrawn	=	1;

	if ( FOsubcelbackground != "" ){
		//Cache (Sub)Menu buttons
		FO_img_cache(FOsubimagepath,FOsubcelbackground+FOsubchildext,"gif",'FOsubbuttonIDC');
		FO_img_cache(FOsubimagepath,FOsubcelbackground,"gif",'FOsubbuttonID');
		FOsubbuttonIDoff.width 	= FOsubwidth;
		FOsubbuttonIDoff.height	= FOsubheight;
	}
		
	if ( typeof(top.FOsubmenuHTML) == "undefined" ){
		j=0;
		l=0;

		FOnumberofparents 	= new Array(top.FObutton.length);

		FO_recurse(-1,0,0,"_",0,0);

		for ( i=1; i < top.FObutton.length; i++ ){ // Generate items
			if ( top.FObutton[i].ParentID != "_" ){
				if ( FOsubcelbackground != "" ){
					if (top.FObutton[i].HasChild == 1){
						top["TMPHTML"+top.FObutton[i].ParentID].HTML	= top["TMPHTML"+top.FObutton[i].ParentID].HTML + "<tr><td class=\"menuitem\" nowrap width=\""+FOsubwidth+"\" height=\""+FOsubheight+"\" valign=\"top\" class=\"menuitem\"><img src=\""+FOsubimagepath+FOsubcelbackground+FOsubchildext+"off.gif\" width=\""+FOsubwidth+"\" height=\""+FOsubheight+"\" border=\"0\" hspace=\"0\" vspace=\"0\" id=\"FOsubbuttonIDC"+top.FObutton[i].ID+"\"></td></tr>";
						top["TMPHTML"+top.FObutton[i].ParentID].HTML1	= top["TMPHTML"+top.FObutton[i].ParentID].HTML1+ "<tr><td class=\"menuitem\" nowrap width=\""+FOsubwidth+"\" height=\""+FOsubheight+"\" valign=\"top\" class=\"menuitem\" id=\"FOsubbuttonIDC"+top.FObutton[i].ID+"T\" onMouseOver=\"FO_img_act('FOsubbuttonIDC','"+top.FObutton[i].ID+"','"+FOsubtextactive+"'); FO_show_menu("+i+","+i+")\" onMouseOut=\"FO_img_inact('FOsubbuttonIDC','"+top.FObutton[i].ID+"','"+FOsubtextinactive+"'); FO_hide_all("+i+");\" OnClick=\"FO_sel_but("+i+");\"><img src=\"images/filler.gif\" width=\""+FOsubhspacing+"\" height=\"1\" border=\"0\" hspace=\"0\" vspace=\"0\"><span style=\"top: 2px; position: relative;\">"+top.FObutton[i].Text+"</span></td></tr>";
					}else{
						top["TMPHTML"+top.FObutton[i].ParentID].HTML	= top["TMPHTML"+top.FObutton[i].ParentID].HTML + "<tr><td class=\"menuitem\" nowrap width=\""+FOsubwidth+"\" height=\""+FOsubheight+"\" valign=\"top\" class=\"menuitem\"><img src=\""+FOsubimagepath+FOsubcelbackground+"off.gif\" width=\""+FOsubwidth+"\" height=\""+FOsubheight+"\" border=\"0\" hspace=\"0\" vspace=\"0\" id=\"FOsubbuttonID"+top.FObutton[i].ID+"\"></td></tr>";
						if ( top.FObutton[i].Text == "" || top.FObutton[i].Text == "-" ){
							if ( top.FObutton[i].Text == "" ){
								top["TMPHTML"+top.FObutton[i].ParentID].HTML1	= top["TMPHTML"+top.FObutton[i].ParentID].HTML1+ "<tr><td class=\"menuitem\" nowrap width=\""+FOsubwidth+"\" height=\""+FOsubheight+"\" valign=\"top\" class=\"menuitem\" id=\"FOsubbuttonID"+top.FObutton[i].ID+"T\" onMouseOver=\"FO_show_menu("+top.FObutton[i].ParentIDX+","+i+")\" onMouseOut=\"FO_hide_all("+i+");\"><img src=\"images/filler.gif\" width=\""+FOsubhspacing+"\" height=\"1\" border=\"0\" hspace=\"0\" vspace=\"0\">"+top.FObutton[i].Text+"</td></tr>";
							}else{
								top["TMPHTML"+top.FObutton[i].ParentID].HTML1	= top["TMPHTML"+top.FObutton[i].ParentID].HTML1+ "<tr><td class=\"menuitem\" nowrap width=\""+FOsubwidth+"\" height=\""+FOsubheight+"\" valign=\"middle\" class=\"menuitem\" id=\"FOsubbuttonID"+top.FObutton[i].ID+"T\" onMouseOver=\"FO_show_menu("+top.FObutton[i].ParentIDX+","+i+")\" onMouseOut=\"FO_hide_all("+i+");\"><hr width=\"100%\" size=\"1\" color=\"#000000\" noshade style=\"left: 1px; position: relative;\"></td></tr>";
							}
						}else{
							top["TMPHTML"+top.FObutton[i].ParentID].HTML1	= top["TMPHTML"+top.FObutton[i].ParentID].HTML1+ "<tr><td class=\"menuitem\" nowrap width=\""+FOsubwidth+"\" height=\""+FOsubheight+"\" valign=\"top\" class=\"menuitem\" id=\"FOsubbuttonID"+top.FObutton[i].ID+"T\" onMouseOver=\"FO_img_act('FOsubbuttonID','"+top.FObutton[i].ID+"','"+FOsubtextactive+"'); FO_show_menu("+top.FObutton[i].ParentIDX+","+i+")\" onMouseOut=\"FO_img_inact('FOsubbuttonID','"+top.FObutton[i].ID+"','"+FOsubtextinactive+"'); FO_hide_all("+i+");\" OnClick=\"FO_sel_but("+i+");\"><img src=\"images/filler.gif\" width=\""+FOsubhspacing+"\" height=\"1\" border=\"0\" hspace=\"0\" vspace=\"0\"><span style=\"top: 2px; position: relative;\">"+top.FObutton[i].Text+"</span></td></tr>";
						}
					}
				}else{
					if (top.FObutton[i].HasChild == 1){
						top["TMPHTML"+top.FObutton[i].ParentID].HTML	= top["TMPHTML"+top.FObutton[i].ParentID].HTML + "<tr><td class=\"menuitem\" nowrap style=\"background-color: "+FOsubtableinactive+"; filter: alpha(opacity='70',enabled=1);\" width=\""+FOsubwidth+"\" height=\""+FOsubheight+"\" valign=\"middle\" id=\"FOsubbuttonIDC"+top.FObutton[i].ID+"\" align=\"right\"><img src=\"../images/arrow.gif\" width=\"16\" height=\"16\" hspace=\"3\" vspace=\"0\" border=\"0\"></td></tr>";
						top["TMPHTML"+top.FObutton[i].ParentID].HTML1	= top["TMPHTML"+top.FObutton[i].ParentID].HTML1+ "<tr><td class=\"menuitem\" nowrap width=\""+FOsubwidth+"\" height=\""+FOsubheight+"\" valign=\"top\" class=\"menuitem\" id=\"FOsubbuttonIDC"+top.FObutton[i].ID+"T\" onMouseOver=\"FO_img_act('FOsubbuttonIDC','"+top.FObutton[i].ID+"','"+FOsubtextactive+"','"+FOsubtableactive+"'); FO_show_menu("+i+","+i+")\" onMouseOut=\"FO_img_inact('FOsubbuttonIDC','"+top.FObutton[i].ID+"','"+FOsubtextinactive+"','"+FOsubtableinactive+"'); FO_hide_all("+i+");\" OnClick=\"FO_sel_but("+i+");\"><img src=\"images/filler.gif\" width=\""+FOsubhspacing+"\" height=\"1\" border=\"0\" hspace=\"0\" vspace=\"0\"><span style=\"top: 4px; position: relative;\">"+top.FObutton[i].Text+"</span></td></tr>";
					}else{
						top["TMPHTML"+top.FObutton[i].ParentID].HTML	= top["TMPHTML"+top.FObutton[i].ParentID].HTML + "<tr><td class=\"menuitem\" nowrap style=\"background-color: "+FOsubtableinactive+"; filter: alpha(opacity='70',enabled=1);\" width=\""+FOsubwidth+"\" height=\""+FOsubheight+"\" valign=\"top\" id=\"FOsubbuttonID"+top.FObutton[i].ID+"\" align=\"right\"></td></tr>";
						if ( top.FObutton[i].Text == "" || top.FObutton[i].Text == "-" ){
							if ( top.FObutton[i].Text == "" ){
								top["TMPHTML"+top.FObutton[i].ParentID].HTML1	= top["TMPHTML"+top.FObutton[i].ParentID].HTML1+ "<tr><td class=\"menuitem\" nowrap width=\""+FOsubwidth+"\" height=\""+FOsubheight+"\" valign=\"top\" class=\"menuitem\" id=\"FOsubbuttonID"+top.FObutton[i].ID+"T\" onMouseOver=\"FO_show_menu("+top.FObutton[i].ParentIDX+","+i+")\" onMouseOut=\"FO_hide_all("+i+");\"><img src=\"images/filler.gif\" width=\""+FOsubhspacing+"\" height=\"1\" border=\"0\" hspace=\"0\" vspace=\"0\">"+top.FObutton[i].Text+"</td></tr>";
							}else{
								top["TMPHTML"+top.FObutton[i].ParentID].HTML1	= top["TMPHTML"+top.FObutton[i].ParentID].HTML1+ "<tr><td class=\"menuitem\" nowrap width=\""+FOsubwidth+"\" height=\""+FOsubheight+"\" valign=\"middle\" class=\"menuitem\" id=\"FOsubbuttonID"+top.FObutton[i].ID+"T\" onMouseOver=\"FO_show_menu("+top.FObutton[i].ParentIDX+","+i+")\" onMouseOut=\"FO_hide_all("+i+");\"><hr width=\"100%\" size=\"1\" color=\"#000000\" noshade style=\"left: 1px; position: relative;\"></td></tr>";
							}
						}else{
							top["TMPHTML"+top.FObutton[i].ParentID].HTML1	= top["TMPHTML"+top.FObutton[i].ParentID].HTML1+ "<tr><td class=\"menuitem\" nowrap width=\""+FOsubwidth+"\" height=\""+FOsubheight+"\" valign=\"top\" class=\"menuitem\" id=\"FOsubbuttonID"+top.FObutton[i].ID+"T\" onMouseOver=\"FO_img_act('FOsubbuttonID','"+top.FObutton[i].ID+"','"+FOsubtextactive+"','"+FOsubtableactive+"'); FO_show_menu("+top.FObutton[i].ParentIDX+","+i+")\" onMouseOut=\"FO_img_inact('FOsubbuttonID','"+top.FObutton[i].ID+"','"+FOsubtextinactive+"','"+FOsubtableinactive+"'); FO_hide_all("+i+");\" OnClick=\"FO_sel_but("+i+");\"><img src=\"images/filler.gif\" width=\""+FOsubhspacing+"\" height=\"1\" border=\"0\" hspace=\"0\" vspace=\"0\"><span style=\"top: 4px; position: relative;\">"+top.FObutton[i].Text+"</span></td></tr>";
						}
					}
				}
			}
//				this["TMPHTML"+top.FObutton[i].ParentID].HTML	= this["TMPHTML"+top.FObutton[i].ParentID].HTML	+ "0";
//				this["TMPHTML"+top.FObutton[i].ParentID].HTML1	= this["TMPHTML"+top.FObutton[i].ParentID].HTML1	+ "1";
		}
		
		for ( i=0; i < Numberofmenus; i++ ){
			HTML  = HTML  + top["TMPHTML"+FOnumberofparents[i]].HTML  + "</table></div>";
			HTML1 = HTML1 + top["TMPHTML"+FOnumberofparents[i]].HTML1 + "</table></div>";
			delete top["TMPHTML"+FOnumberofparents[i]].HTML;
			delete top["TMPHTML"+FOnumberofparents[i]].HTML1;
		}
		top.FOsubmenuHTML = HTML+"<BR>"+HTML1;
	}
	return top.FOsubmenuHTML;
}



function FO_recurse(Level,Row,RootRow,ParentID,ParentIDX,CurrentIDX){

	if ( top.FObutton[CurrentIDX].ParentID=="_" ){
		RootRow=Row;
	}		     
	if ((Level > 0 || FOseperaterootmenu!=1) && CurrentIDX>=0){
//		alert("CurrentIDX: "+CurrentIDX+" ParentIDX: "+ParentIDX+" Item: '"+top.FObutton[CurrentIDX].Text +"' Level: "+Level+" Rootrow: "+RootRow+" Row: "+Row);

		top.FObutton[CurrentIDX].RootRow=RootRow;
		top.FObutton[CurrentIDX].ParentIDX=ParentIDX;
		top.FObutton[CurrentIDX].Level=Level;
		top.FObutton[ParentIDX].HasChild=1;


		if ( typeof( top["TMPHTML"+top.FObutton[CurrentIDX].ParentID]) == "undefined" ){ // Header generation
			top["TMPHTML"+top.FObutton[CurrentIDX].ParentID] = new FoldOutMenuFields( "", "");
			FOnumberofparents[Numberofmenus] = top.FObutton[CurrentIDX].ParentID;
//			alert("Create header");
			zindex++;
			top["TMPHTML"+top.FObutton[CurrentIDX].ParentID].HTML	= top["TMPHTML"+top.FObutton[CurrentIDX].ParentID].HTML + "<div id=\"FOsubmenu"+top.FObutton[CurrentIDX].ParentID+"\" style=\"position:absolute; left:0; leftorigin:"+((Level-FOseperaterootmenu)*FOsubwidth+FOsubxorigin)+"; top:0; toporigin:"+(Row*FOsubheight+FOsubyorigin+(RootRow*FOvspacing))+"; width: "+FOsubwidth+"; visibility:hidden; z-index: "+zindex+"; background-position: bottom; background-image: url(../images/submenuback.jpg);\">";  //Header DIV
			top["TMPHTML"+top.FObutton[CurrentIDX].ParentID].HTML	= top["TMPHTML"+top.FObutton[CurrentIDX].ParentID].HTML + "<table width=\""+FOsubwidth+"\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"left\" style=\"border: 1px solid #000000;\">"; // Header table
			zindex++;
			top["TMPHTML"+top.FObutton[CurrentIDX].ParentID].HTML1	= top["TMPHTML"+top.FObutton[CurrentIDX].ParentID].HTML1+ "<div id=\"FOsubmenu"+top.FObutton[CurrentIDX].ParentID+"T\" style=\"position:absolute; left:0; leftorigin:"+((Level-FOseperaterootmenu)*FOsubwidth+FOsubxorigin)+"; top:0; toporigin:"+(Row*FOsubheight+FOsubyorigin+(RootRow*FOvspacing))+"; width: "+FOsubwidth+"; visibility:hidden; z-index: "+zindex+";\">";  //Header DIV
			top["TMPHTML"+top.FObutton[CurrentIDX].ParentID].HTML1	= top["TMPHTML"+top.FObutton[CurrentIDX].ParentID].HTML1+ "<table width=\""+FOsubwidth+"\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"left\">";   //Header table
			Numberofmenus++;

		}

	}

	//The recursive bit
	for (var i = 1; i < top.FObutton.length; i++ ){
		if ( top.FObutton[i].ParentID == ParentID ){
			Row++;
			FO_recurse(Level+1,Row-1,RootRow,top.FObutton[i].ID,CurrentIDX,i);
		}
	}
}

//-->

