function File(href,name,type) {
  this.imageLinkOpen = 'no se usa';
  // imagen para el 2o nivel
  if (type=='raiz')
//  	this.imageLinkClose = '<img src="transp.gif" border="0" width="14">';
  	this.imageLinkClose = '<img src="transp.gif" border="0" width="3">';
  else
//  	this.imageLinkClose = '<img src="transp.gif" border="0" width="14" height="19">';
  	this.imageLinkClose = '<img src="transp.gif" border="0" width="14" height="19">';
  this.textLink = '<a href="' + href + '" class="external5">' + name + '</a>';
}

function add(obj) {
  this.Contents[this.index++] = obj;
}

function Menu(ref,name,open) {
  var href = 'javascript:openMenu(' + ref + ')';
//  var image = '<img src="menu.gif" align="absbottom" border="0" width="20" height="21">';
  var imageopen = '<img src="true.gif" align="absbottom" border="0">';
  var imageclose = '<img src="false.gif" align="absbottom" border="0">';
  
  this.textLink = '<a href="' + href + '" class="external5">' + name + '</a>';
//  this.imageLink = '<a href="' + href + '">' + image + '</a>';
  this.imageLinkOpen = '<a href="' + href + '">' + imageopen + '</a>';
  this.imageLinkClose = '<a href="' + href + '">' + imageclose + '</a>';

  this.ref  = ref;
  this.open = open;
  this.add = add;
  this.index = 0;
  this.Contents = new Object();
}

function show(obj, level, last) {

	if (level == 0)
		var output = '<ul id="cat"><ul>';
	else 
		if (obj.open) {
			colorbgaux = colorbg;
			var output =
				'<li class=catalogo><nobr>' + obj.textLink + '</nobr></li>';
			colorbg = colorbgaux
		}
		else 
			if (level == 1) {
				colorbgaux = colorbg;
				var output =
					'<li class=catalogo><nobr>' + obj.textLink + '</nobr></li>';
				colorbg = colorbgaux;
			}
			else
				if (last)
					var output =
						'<li class=catalogosub><nobr>' + obj.textLink + '</nobr></li>';
				else
					var output =
						'<li class=catalogosub><nobr>' + obj.textLink  + '</nobr></li>';

	if (obj.open)
	for (var i=0; i<obj.index; i++) {
		if ((i+1) == obj.index)
			ultimo = true;
		else
			ultimo = false;

		output += show(obj.Contents[i], level+1, ultimo);
	}
	
/*
Cuatro colores a usar
0A6EAB
0C7AB6
064C8B
022F71

#70AE97
#12481F

13542C
01732E

504C4C
737373

*/

	colorbg = '#ACA0CE';

	if (level == 0)
		return output + '</ul></ul>';
	else 
		if (level == 1)
			return output + '';
		else
			return output + '</nobr>';
	
}

function openMenu(obj) {
  obj.open = !obj.open;
  colorbg = '#ACA0CE';
  updateMenu();
}