/* 
	mapb_menu
	Copyright Miquel Angel Pintanel 2000-2001
	Last Update 1/11/2001
	Version 0.7
		
	http://perso.wanadoo.es/mapintanel/mapbdhtml/index.html      mapbdhtml@wanadoo.es
	
	This script and his components are free, but must be
	maintained this text and the copyright to use it.
	
	Version 0.2 Added autoHide feature
	Version 0.3 Fixed bug in stylesheet
	Version 0.4 Added compatibility NS6

    Version 0.6 Support frames
    Version 0.6.1 Fixed a bug
    Version 0.6.2 Previous fixed a bug makes a new bug
    Version 0.7 Added You are here feature
    Version 0.7.1 First level Items can be links now and can change color as other levels
    Version 0.7.2 Fixed a bug of last update now works fine in horizontal
 */

var NN = (document.layers ? true : false);
var hideName = (NN ? 'hide' : 'hidden');
var showName = (NN ? 'show' : 'visible');
var open_sm = new Array ();
var autoHide_pass = 10;
var autoHide_on = true;
var autoHide_var = null;
var autoHide_activate = false;
var autoHide_seconds = 1;
var idYouarehere = '';
var tempX;
var tempY;

function Menu (idMenu,m_left,m_top) {
	// PREFS
	this.m_left  = m_left; // Left position
	this.m_top  = m_top; // Top position
	this.m_vertical  = true; // If true menu is vertical
	this.sm_width  = 125; // Width of submenu items
	this.sm_height  = 20; // Height of submenu items
	this.sm_border = 0;
	this.h_offset  = -3; // Horizontal offset in relation to previous menu
	this.v_offset  = 3; // Vertical offset in relation to previous menu 
	this.l_m_color  = '#FFFAE3'; // If sm_border > 0 border color of initial menu
	this.l_sm_color  = '#FFFAE3'; // If sm_border > 0 border color of submenus
	this.m_color  = '#FFFAE3';  // Color of initial menu
	this.m_a_color  = '#FF9900';
	this.m_txt_color  = '#000000';
	this.m_txt_a_color  = '#FFFFCC';
	this.sm_color  = '#FFFAE3'; // Item color of submenus
	this.txt_color  = 'black';  // Color of initial menu
	this.txt_a_color  = '#FF9900'; // Item color of submenus
	this.sm_a_color  = '#FF9900'; // Item color when mouseOver
	this.m_dec = '&nbsp;'; // Right decoration of menu
	this.sm_sep = '<HR width="90%">'; // Separator Image
	this.sm_arrow = ''; // Arrow image
	this.sm_current = ''; // Current Image
	this.menu_back_st = (NN)?'NNmenuBackSt':'menuBackSt';               //Style variables of font
	this.submenu_back_st = (NN)?'NNsubmenuBackSt':'submenuBackSt';         //and another preferences in
	this.menu_st = 'menuSt';                        //mapb_menu_style.css
	this.submenu_st = 'submenuSt';                  //
	this.submenu_st_inactive = 'submenuStInactive'; //
	this.zIndx = 10;
	this.iconYouarehere = '';
	this.iconYouarenothere = '';
	this.activeYouarehere = false;
	
	this.frameMenu = 'noFrames';
	this.frameSubMenu = 'noFrames';
	frameMenu = this.frameMenu;
	
	//private variables
	this.idMenu = idMenu;
	this.lev = 0;
	this.pre_sm = this.idMenu + 'm';
	this.pre_td = 'td';
	this.suf_sm_a = this.idMenu + 'a';
	this.pre_l = this.idMenu + 'l';
	this.num_sm = -1;
	this.sm = new Array ();
	this.sm[0] = new Array();
	this.c_a = new Array ();
	this.c_a[this.lev] = [0,0,0,false];
	this.c_l = new Array ();
	this.c_l[this.lev] = [this.m_left,this.m_top];
	this.mn = new Array();
	this.idYouarehere = idYouarehere;
	
	//Functions
	this.addItem = addItem;
	this.doMenu = doMenu;
	this.genL = genL;
	this.endL = endL;
	this.hideL = hideL;
	this.showL = showL;
	this.refL = refL;
	this.hideMenus = hideMenus;
	this.onOut_sm = onOut_sm;
	this.onOver_sm = onOver_sm;
	this.youAreHere = youAreHere
	this.openHere = openHere;
	this.open_l = open_l;
	
	return this;
}

function genL(sName, sLeft, sTop, sWdh, sHgt, sVis,sColor,copy,handlers) {
	if (NN) {
		tWidth = (!sWdh)? '' : ' WIDTH="' + sWdh + '"';
		tHeight = (!sHgt)? '' : ' HEIGHT="' + sHgt + '"';
		tHandlers = (!handlers)? '' : handlers;
		var s = '<LAYER NAME="' + sName + '" LEFT="' + sLeft;
		s += '" TOP="' + sTop + '"';
		s += tWidth;
		s += tHeight + ' VISIBILITY="' + sVis + '"';
		s += ' z-Index="' + (++this.zIndx) + '" bgcolor="' + sColor + '" ' + tHandlers + '>' + copy;
		return s;
	} else {
		tWidth = (!sWdh)? '' : ' width:' + sWdh + 'px;';
		tHeight = (!sHgt)? '' : ' height:' + sHgt + 'px;';
		tHandlers = (!handlers)? '' : handlers;
		var s = '<DIV ID="' + sName + '" STYLE="position:absolute; overflow:clip;';
		s += ' left:' + sLeft + 'px;';
		s += ' top:' + sTop + 'px;';
		s += tWidth;
		s += tHeight;
		s += ' visibility:' + sVis + '; z-Index:' + (++this.zIndx) + '; background-color:';
		s += sColor + ';' + '"' + tHandlers + '>\r' + copy;
		return s;
		}
	}

function endL (){
	if (NN){
		return '</LAYER>';
	}
	else{
		return '</DIV>';
	}
}

function hideL(name,alayer,theFrame) {
    if (NN){refL(name,alayer,theFrame).visibility = hideName} else {refL(name,alayer,theFrame).style.visibility = hideName}
}

function showL(name,alayer,theFrame) {
    if (NN){refL(name,alayer,theFrame).visibility = showName} else {refL(name,alayer,theFrame).style.visibility = showName}
}

function refL(aLayer,aLayout,theFrame) {
    theDoc = (theFrame == 'noFrames')? document : top.frames[theFrame].document;
    if (document.getElementById) {
	    return theDoc.getElementById(aLayer);
    } else if (document.layers){
	    if (aLayout != ''){
		    return theDoc.layers[aLayout].document.layers[aLayer]
	    } else {
		    return theDoc.layers[aLayer]
	    }
    } else if (document.all){
	    return eval('theDoc.all.' + aLayer);
    }
}

function searchL (searchedL) {
    var isMatch = false;
    for (i = 0;i < open_sm.length;i++){
	if (open_sm[i][0] == searchedL){
	    isMatch = true;
	    break
	}
    }
    theMatch = (isMatch)? i : -1;
    return theMatch
}

/*
mXtras: {'url':'a.html','target':'atarget','background':'acolororimg','backgroundA':'otherColororImg',
		'txtcolor':'acolor','txtacolor':'yetanotherColor','theWidth': number,'theHeight':number}
*/

function addItem (mText,mXtras,isLast) {
	var suf = '',idLayout,theText,theDecor,is_active;
	mXtras = (typeof (mXtras) == 'string')? {'url':mXtras}: mXtras;
	theColor = mXtras['background'] || this.sm_color;
	theaColor = mXtras['backgroundA'] || this.sm_a_color;
	txtcolor = mXtras['txtcolor'] || this.txt_color;
	txtAcolor = mXtras['txtacolor'] || this.txt_a_color;
	theWidth = mXtras['theWidth'] || this.sm_width;
	theHeight = mXtras['theHeight'] || this.sm_height;
	for (i=0;i <= this.lev; i++){
	    suf += '_';
	    suf += this.c_a[i][0];
	}
	if (this.c_a[this.lev][0] == 0){
	    this.num_sm++;
	    this.sm[this.num_sm] = new Array ();
	    this.c_a[this.lev][4] = this.num_sm;
	    this.mn[this.c_a[this.lev][4]] = new Array(this.c_l[this.lev][0],this.c_l[this.lev][1]);
	    this.c_a[this.lev][5] = suf;
	}
	if (mXtras['url'] == ''){
		var s = '';
		if (this.lev == 0) {
		    idLayer = this.pre_l + suf;
		    idLayout = this.c_a[this.lev][5];
		    theClass = this.menu_st;
		    theText = mText;
		    theDecor = this.m_dec;
		    is_active = true;
		    theColor = mXtras['Mnbackground'] || this.m_color;
		    theaColor = mXtras['MnAbackground'] || this.m_a_color;
		    txtcolor = mXtras['Mntxtcolor'] || this.m_txt_color;
		    txtAcolor = mXtras['Mntxtacolor'] || this.m_txt_a_color;
		} else {
		    idLayer = this.pre_l + suf;
		    idLayout = this.c_a[this.lev][5];
		    theClass = this.submenu_st;
		    theText = mText;
		    theDecor = this.sm_arrow;
		    is_active = true;
		}
		this.sm[this.c_a[this.lev][4]][this.c_a[this.lev][0]] = new Array (suf,idLayer,idLayout,theClass,theText,
		                                                                   theDecor,is_active,this.c_a[this.lev][1],
										   this.c_a[this.lev][2],
										   [theColor,theaColor,txtcolor,txtAcolor,
										   theWidth,theHeight]);
		if (isLast){
		    this.mn[this.c_a[this.lev][4]][3] = this.c_a[this.lev][2] + theHeight;
		    this.mn[this.c_a[this.lev][4]][2] = theWidth;
		    this.c_a[this.lev][3] = true;
		} else {
		    this.c_a[this.lev][3] = false;
		}
		this.lev++;
		if (this.lev == 1 && !this.m_vertical){
		    if (this.frameMenu == 'noFrames'){
			this.c_l[this.lev] = new Array(this.c_l[this.lev-1][0]+this.c_a[this.lev-1][1],this.c_l[this.lev-1][1] + theHeight);
			this.c_a[this.lev] = new Array(0,0,0,false,this.num_sm);
		    } else {
			this.c_l[this.lev] = new Array(this.c_l[this.lev-1][0]+this.c_a[this.lev-1][1],this.c_l[this.lev-1][1]);
			this.c_a[this.lev] = new Array(0,0,0,false,this.num_sm);
		    }
		} else if (this.lev == 1 && this.m_vertical){
		    if (this.frameMenu == 'noFrames'){
			this.c_l[this.lev] = new Array(this.c_l[this.lev-1][0]+theWidth,this.c_l[this.lev-1][1]+this.c_a[this.lev-1][2]);
			this.c_a[this.lev] = new Array(0,0,0,false,this.num_sm);
		    } else {
			this.c_l[this.lev] = new Array(this.c_l[this.lev-1][0],this.c_l[this.lev-1][1]+this.c_a[this.lev-1][2]);
			this.c_a[this.lev] = new Array(0,0,0,false,this.num_sm);
		    }
		} else {
		    this.c_l[this.lev] = new Array(this.c_l[this.lev-1][0]+theWidth+this.h_offset,this.c_l[this.lev-1][1]+this.c_a[this.lev-1][2] + this.v_offset);
		    this.c_a[this.lev] = new Array(0,0,0,false,this.num_sm);
		}
		if ((this.lev - 1) == 0){
			if (this.m_vertical){
			    this.c_a[this.lev-1][2] += theHeight;
			    this.c_a[this.lev-1][1] = 0
			} else {
			    this.c_a[this.lev-1][1] += theWidth;
			    this.c_a[this.lev-1][2] = 0;
			}
		} else {
		    this.c_a[this.lev-1][2] += theHeight;
		    this.c_a[this.lev-1][1] = 0
		}
	} else {
		var s;
		if (this.lev == 0){
		    theClass = this.menu_st;
		    is_active = true;
		    theDecor = '&nbsp;';
		    theColor = mXtras['Mnbackground'] || this.m_color;
		    theaColor = mXtras['MnAbackground'] || this.m_a_color;
		    txtcolor = mXtras['Mntxtcolor'] || this.m_txt_color;
		    txtAcolor = mXtras['Mntxtacolor'] || this.m_txt_a_color;
		} else {
		    theClass = this.submenu_st;
		    is_active = true;
		    theDecor = '&nbsp;';
		}
		if (mText == '-') {
		    idLayout = this.c_a[this.lev][5];
		    theText = this.sm_sep;
		    is_active = false;
		    theDecor = '&nbsp;';
		} else {
			if (mXtras['url'] == 'v'){
			    idLayer = '';
			    idLayout = this.c_a[this.lev][5];
			    theText = mText;
			    theDecor = this.sm_current;
			} else {
				if (location.href.indexOf(mXtras['url']) > -1){
				    idLayer = '';
				    idLayout = this.c_a[this.lev][5];
				    this.Iamhere = suf;
				    this.idYouarehere = this.c_a[this.lev][5];
				    theText = mText;
				    theDecor = this.iconYouarehere;
				} else if (mXtras['url'] == 'x'){
				    idLayer = '';
				    idLayout = this.c_a[this.lev][5];
				    theClass = this.submenu_st_inactive;
				    theText = mText;
				    is_active = false;
				} else {
				    idLayer = '';
				    idLayout = this.c_a[this.lev][5];
				    theTarget = (mXtras['target'])? ' target="' + mXtras['target'] + '"' : '' ;
				    theText = '<a href="'+ mXtras['url'] +'" onClick="hideMenus();"';
				    theText += theTarget + '>' + mText + '</a>';
				}
			}
		}
		this.sm[this.c_a[this.lev][4]][this.c_a[this.lev][0]] = new Array (suf,idLayer,idLayout,theClass,
		                                                                   theText,theDecor,is_active,
										   this.c_a[this.lev][1],this.c_a[this.lev][2],
										   [theColor,theaColor,txtcolor,txtAcolor,
										   theWidth,theHeight],mXtras['url'],mText);
		this.c_a[this.lev][2] += theHeight;
		if (this.lev == 0){
		    if (!this.m_vertical){
			this.c_a[this.lev][2] = 0;
			this.c_a[this.lev][1] = this.c_a[this.lev][1] + theWidth;
		    }
		}
		this.c_a[this.lev][0]++;
		if (isLast){
			this.c_a[this.lev][0] = 0;
			this.c_a[this.lev][3] = true;
			this.mn[this.c_a[this.lev][4]][2] = theWidth;
			this.mn[this.c_a[this.lev][4]][3] = this.c_a[this.lev][2];
			if (this.lev > 0){
			    this.lev--;
			}
			if (this.lev >= 0){
			    this.c_a[this.lev][0]++;
			}
			while (this.c_a[this.lev][3] == true){
				this.c_a[this.lev][0] = 0;
				this.lev--;
				if (this.lev >= 0){
					this.c_a[this.lev][0]++;
					}
				if (this.lev <= 0){
					break;
				}
			}
		} else {
		    this.c_a[this.lev][3] = false;
		}
	}
}

function doMenu (theWindow){
    var theL = '';
    for (i=0;i < this.sm.length;i++){
	var m;
	if (i == 0){
	    if (!this.m_vertical){
		    theClass = this.menu_back_st;
		    h = ' class="' + theClass + '"';
		    m = '<table border="0" cellpadding="0" cellspacing="0" width="'+ this.mn[i][2] +'" height="' + this.mn[i][3] + '">';
		    m += '<tr><td>'
	    } else {
		    theClass = this.menu_back_st;
		    h = ' class="' + theClass + '"';
		    m = '<table border="0" cellpadding="0" cellspacing="0" width="' + this.mn[i][2] + '" height="' + this.mn[i][3] + '">';
		    m += '<tr><td>'
	    }
	    theL += this.genL (this.pre_l + this.sm[i][0][0],this.mn[i][0],this.mn[i][1],false,false,showName,this.l_m_color,m,h);
	} else {
	    h = ' class="' + this.submenu_back_st + '"';
	    m = '<table border="0" cellpadding="0" cellspacing="0" width="'+ this.mn[i][2] +'" height="' + this.mn[i][3] + '">';
	    m += '<tr><td>';
	    theL += this.genL (this.pre_l + this.sm[i][0][0],this.mn[i][0],this.mn[i][1],false,false,hideName,this.l_sm_color,m,h);
	}
	for (j=0;j < this.sm[i].length;j++){
	    f = (this.sm[i][j][3] == this.menu_st)? this.frameMenu : this.frameSubMenu;
	    t = (this.frameMenu == 'noFrames')? '': 'parent.';
	    if (theWindow == this.frameSubMenu){
		if(top.frames[this.frameSubMenu].location.href.indexOf(this.sm[i][j][10]) > -1){
		    this.sm[i][j][4] = this.sm[i][j][11];
		    this.sm[i][j][5] = this.iconYouarehere;
		    this.Iamhere = this.sm[i][j][2];
		    this.idYouarehere = this.sm[i][j][2];
		}
	    }
	    xTras ='';
	    for (lm in this.sm[i][j][9]){
		xTras += ',\'' + this.sm[i][j][9][lm] + '\''
	    }
	    h = ' onMouseOver="' + t + this.idMenu + '.onOver_sm(\'' + this.pre_sm + this.sm[i][j][0] +'\',\'';
	    h += this.sm[i][j][1] + '\',\'' + this.pre_l + this.sm[i][j][2] + '\',' + this.sm[i][j][6] + ',\''+ f + '\'';
	    h += xTras + ');"';
	    h += ' onMouseOut="' + t + this.idMenu + '.onOut_sm(\'' + this.pre_sm + this.sm[i][j][0] + '\',\'' + this.pre_l + this.sm[i][j][2] + '\',' + this.sm[i][j][6] + ',\''+ f + '\'';
	    h += xTras + ');"';
	    m = '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="' + this.sm[i][j][3] + '" width="' + this.mn[i][2] + '" height="' + this.sm[i][j][9][5] + '" id="' + this.pre_td + this.pre_sm + this.sm[i][j][0] + '"';
	    m += ' name="' + this.pre_td + this.pre_sm + this.sm[i][j][0] + '">' + this.sm[i][j][4] + '</td>';
	    m += '<td class="' + this.sm[i][j][3] + '">' + this.sm[i][j][5] + '</td></tr></table>';
	    layerName = this.pre_sm + this.sm[i][j][0];
	    theL += this.genL (layerName,this.sm[i][j][7],this.sm[i][j][8],this.sm[i][j][9][4],this.sm[i][j][9][5],'inherit',this.sm[i][j][9][0],m,h);
	    theL += endL();
	}
	theL += '</td></tr>';
	theL += '</table>';
	theL += endL();
	if (this.frameMenu == 'noFrames'){
		document.writeln(theL);
	} else {
	    if (this.sm[i][0][3] == this.menu_st && theWindow == this.frameMenu){
		top.frames[this.frameMenu].document.writeln(theL);
	    } else if (this.sm[i][0][3] == this.submenu_st && theWindow == this.frameSubMenu){
		top.frames[this.frameSubMenu].document.writeln(theL);
	    }
	}
	theL = '';
    }
}

function hideMenus () {
	for (var i = 0;i < open_sm.length;i++){
	    if (open_sm[i][1] != 'noFrames'){
		if (document.all){
		    refL(open_sm[i][0],'',open_sm[i][1]).style.pixelTop = open_sm[i][2];
		    refL(open_sm[i][0],'',open_sm[i][1]).style.pixelLeft = open_sm[i][3]
		} else if (NN){
		    refL(open_sm[i][0],'',open_sm[i][1]).top = open_sm[i][2];
		    refL(open_sm[i][0],'',open_sm[i][1]).left = open_sm[i][3]
		}
	    }
	    hideL(open_sm[i][0],'',open_sm[i][1]);
	}
	clearInterval (autoHide_var);
	autoHide_on = false;
}

function onOver_sm (what_sm,what_l,parentL,sm_active,theFrame,smColor,smaColor,txtcolor,txtAcolor) {
	if (sm_active){
		if (NN){
			refL(what_sm,parentL,theFrame).bgColor = (smaColor > '')? smaColor : this.sm_a_color;
		} else {
			refL(what_sm,'',theFrame).style.background = (smaColor > '')? smaColor : this.sm_a_color;
			refL(this.pre_td + what_sm,'',theFrame).style.color = (txtAcolor > '')? txtAcolor : this.txt_a_color;
		}
	}
	this.open_l (what_sm,what_l)
}

function onOut_sm (what_sm,what_l,sm_active,theFrame,smColor,smaColor,txtcolor,txtAcolor){
    if (sm_active){
	if (NN){
		refL(what_sm,what_l,theFrame).bgColor = (smColor > '')? smColor : this.sm_color;
	} else {
		refL(what_sm,'',theFrame).style.background = (smColor >'')? smColor : this.sm_color;
		refL(this.pre_td + what_sm,'',theFrame).style.color = (txtcolor > '')? txtcolor : this.txt_color
	}
    }
}

function open_l (what_sm,what_l){
    if (autoHide_activate){
	if (!autoHide_on){
	    autoHide_on = true;
	    autoHide_var = setInterval ("autoHide ()",1000);
	} else {
	    autoHide_pass = 1;
	}
    }
    if (what_l != ''){
	var initialY,initialX;
	if (this.frameMenu != 'noFrames'){
	    if (document.all){
		tempY = eval(this.frameSubMenu + '.document.body.scrollTop');
		tempX = eval(this.frameSubMenu + '.document.body.scrollLeft');
		thePos = searchL (what_l+'_0');
		if (thePos > -1){
		    initialY = open_sm[thePos][2];
		    initialX = open_sm[thePos][3]
		} else {
		    initialY = refL(what_l+'_0','',this.frameSubMenu).style.pixelTop;
		    initialX = refL(what_l+'_0','',this.frameSubMenu).style.pixelLeft;
		}
		refL(what_l+'_0','',this.frameSubMenu).style.pixelTop = initialY + tempY;
		refL(what_l+'_0','',this.frameSubMenu).style.pixelLeft = initialX + tempX
	    } else if (NN || document.getElementById){
		tempY = eval(this.frameSubMenu + '.pageYOffset');
		tempX = eval(this.frameSubMenu + '.pageXOffset');
		thePos = searchL (what_l+'_0');
		if (thePos > -1){
		    initialY = open_sm[thePos][2];
		    initialX = open_sm[thePos][3]
		} else {
		    initialY = refL(what_l+'_0','',this.frameSubMenu).top;
		    initialX = refL(what_l+'_0','',this.frameSubMenu).left;
		    refL(what_l+'_0','',this.frameSubMenu).width = 300;
		}
		refL(what_l+'_0','',this.frameSubMenu).top = initialY + tempY;
		refL(what_l+'_0','',this.frameSubMenu).left = initialX + tempX
	    }
	}
	showL (what_l+'_0','',this.frameSubMenu);
	theLength = open_sm.length;
	open_sm[theLength] = new Array (what_l+'_0',this.frameSubMenu,initialY,initialX)
    }
    var tempA = new Array ();
    for (this.i = 0;this.i < open_sm.length;this.i++){
	    if (open_sm[this.i][0].length > what_sm.length && open_sm[this.i][0].indexOf(this.pre_l + what_sm.substr(this.pre_sm.length)) == -1){
		hideL (open_sm[this.i][0],'',this.frameSubMenu);
		if (this.frameMenu != 'noFrames'){
		    if (document.all){
			refL(open_sm[this.i][0],'',this.frameSubMenu).style.pixelTop = open_sm[this.i][2];
			refL(open_sm[this.i][0],'',this.frameSubMenu).style.pixelLeft = open_sm[this.i][3]
		    } else if (NN || document.getElementById){
			refL(open_sm[this.i][0],'',this.frameSubMenu).top = open_sm[this.i][2];
			refL(open_sm[this.i][0],'',this.frameSubMenu).left = open_sm[this.i][3]
		    }
		}
	    } else {
		tempA[tempA.length] = open_sm[this.i];
	    }
    }
    open_sm = tempA;
}


function autoHide () {
	if (autoHide_pass > autoHide_seconds) {
	    hideMenus ();
	} else {
	    autoHide_pass++;
	}
}

function youAreHere (myname,my_left, my_top, my_width, my_height,theText,my_color){
	if(this.frameSubMenu == 'noFrames'){
	    if (this.idYouarehere == ''){
		my_aText = '<table border="0" cellspacing="0" width="' + my_width + '"><tr><td align="right">';
		my_aText += this.iconYouarenothere;
		my_aText += '</td><td align="left" style="color: gray; font-size: 11px;font-family: sans-serif;">'+ theText +'</td></tr></table>';
		aText = genL(myname,my_left,my_top,my_width,my_height,showName,my_color,my_aText);
		aText +=  endL();
	    } else {
		my_aText = '<table border="0" cellspacing="0" width="' + my_width + '"><tr><td align="right">';
		my_aText += this.iconYouarehere;
		my_aText += '</td><td align="left" style="font-size: 11px;font-family: sans-serif;">'+ theText +'</td></tr></table>';
		aHand = ' onMouseOver="' + this.idMenu + '.openHere ()"';
		aText = genL(myname,my_left,my_top,my_width,my_height,showName,my_color,my_aText,aHand);
		aText +=  endL();
	    }
	    document.writeln (aText)
	} else {
	    if (this.idYouarehere == ''){
		my_aText = '<table border="0" cellspacing="0" width="' + my_width + '"><tr><td align="right">';
		my_aText += this.iconYouarenothere;
		my_aText += '</td><td align="left" style="color: gray; font-size: 11px;font-family: sans-serif;">'+ theText +'</td></tr></table>';
		aText = genL(myname,my_left,my_top,my_width,my_height,showName,my_color,my_aText);
		aText +=  endL();
	    } else {
		my_aText = '<table border="0" cellspacing="0" width="' + my_width + '"><tr><td align="right">';
		my_aText += this.iconYouarehere;
		my_aText += '</td><td align="left" style="font-size: 11px;font-family: sans-serif;">'+ theText +'</td></tr></table>';
		aHand = ' onMouseOver="parent.' + this.idMenu + '.openHere ()"';
		aText = genL(myname,my_left,my_top,my_width,my_height,showName,my_color,my_aText,aHand);
		aText +=  endL();
	    }
	    top.frames[this.frameSubMenu].document.writeln (aText)
	}
}

function openHere (){
    hideMenus ();
    aLength = this.idYouarehere.length - 2;
    sinceOpen = this.pre_sm + this.idYouarehere;
    for (u = 2; u <= aLength; u += 2){
	whatOpen = this.pre_l + this.idYouarehere.substr(0,u);
	this.open_l (sinceOpen,whatOpen);
    }
}



