// Funciones de Menú

function sobre(src,Color) {
    if (!src.contains(event.fromElement)) {
	  src.style.cursor = 'hand';
	  src.bgColor = Color;}}
function fuera(src,Color2) {
	if (!src.contains(event.toElement)) {
	  src.style.cursor = 'default';
	  src.bgColor = Color2;}}
function pulsar(src) {
    if(event.srcElement.tagName=='TD'){
	  src.children.tags('A')[0].click();}}

function BeginMenu(ancho, color_borde) {
 document.write('<table width="'+ancho+'" border="0" cellspacing="1" cellpadding="0" bgcolor="#'+color_borde+'">');
}

function ItemMenu(nombre, url, target, img_url, img_width, img_height, label, color_celda, color_link, fuente, tamany, color_letra){
 document.write('<tr><td onClick="pulsar(this)" onMouseOut="fuera(this,');
 document.write("'#");
 document.write(color_celda);
 document.write("'");
 document.write(');" onMouseOver="sobre(this,');
 document.write("'#");
 document.write(color_link);
 document.write("'");
 document.write(');" bgcolor="#'+color_celda+'"><a class="menu" href="');
 document.write(url+'"');
 if (target == "_blank") { document.write('target="'+target+'"'); }
 document.write('><font face="'+fuente+'" size="'+tamany+'" color="#'+color_letra+'">');
 if (label != "") { document.write('<acronym title="'+label+'">'); }
 if (img_url != "") { document.write('<img src="'+img_url+'" width="'+img_width+'" height="'+img_height+'" border="0">'); }
 document.write(' ' + nombre);
 if (label != "") { document.write('</acronym>'); }
 document.write('</font></a></td></tr>');
}

function EndMenu(columnes){
 document.write('<td colspan="' + columnes + '"><hr width="100%"></td></tr></table>');
}


function BeginBarra(titulo, color_borde, color_taula, columnes, ample, canto, sp, pd) {
if (!color_borde) {vcolor_borde=''}else{vcolor_borde=' bordercolor="#'+ color_borde+'"'}
if (!color_taula) {vcolor_taula=''}else{vcolor_taula=' bgcolor="#'+ color_taula +'"'}
if (!ample) {vample=''}else{vample=' width="'+ ample +'"'}
if (!canto) {vcanto=''}else{vcanto=' border="'+ canto+'"'}
if (!sp) {vsp=''}else{vsp=' cellspacing="'+ sp+'"'}
if (!pd) {vpd=''}else{vpd=' cellpadding="'+ pd+'"'}

document.write('<table' + vample + vcanto + vsp + vpd + vcolor_taula + vcolor_borde + '><tr>');
 if (! titulo) { 
document.write('');
}else{
document.write('<td valign="bottom" bgcolor="#'+color_taula+'" colspan="' + columnes + '">'+titulo+'</td></tr><tr>');

 }
}

function ItemBarra(nombre, url, target, anchocelda, img_url, img_width, img_height, label, color_celda, color_link, fuente, tamany, color_letra){
 document.write('<td onClick="pulsar(this)" onMouseOut="fuera(this,');
 document.write("'#");
 document.write(color_celda);
 document.write("'");
 document.write(');" onMouseOver="sobre(this,');
 document.write("'#");
 document.write(color_link);
 document.write("'");
 document.write(');" bgcolor="#'+color_celda+'" width="'+anchocelda+'"><div align="center"><a class="menu" href="');
 document.write(url+'"');
 if (target == "_blank") { document.write('target="'+target+'"'); }
 document.write('><font face="'+fuente+'" size="'+tamany+'" color="#'+color_letra+'">');

 if (label != "") { document.write('<acronym title="'+label+'">'); }
 if (img_url != "") { document.write('<img src="'+img_url+'" width="'+img_width+'" height="'+img_height+'" border="0">'); }
 document.write(' ' + nombre);
 if (label != "") { document.write('</acronym>'); }
 document.write('</font></a></div></td>');
}

function EndBarra(barra, columnes){
if (!barra){
 document.write('</tr></table>');
}else{
 document.write('<tr><td colspan="' + columnes + '"><hr width="100%"></td></tr></table>');
}}

