

function chBlock(id)
{
	if(esBlock('rama'+id))
	{
		chStyleById('tocon'+id,'menuElementClose');
		menuNone('rama'+id);
	}

	else
		{
			chStyleById('tocon'+id,'menuElementOpen');
			menuBlock('rama'+id);
		}
	}

	function menuBlock(id)
	{
		if (document.layers)
		document.layers[''+id+''].display = "block"
		else if (document.all)
			document.all[''+id+''].style.display = "block"
			else if (document.getElementById)
				document.getElementById(''+id+'').style.display = "block"
			}

			function menuNone(id)
			{
				if (document.layers)
				document.layers[''+id+''].display = "none"
				else if (document.all)
					document.all[''+id+''].style.display = "none"
					else if (document.getElementById)
						document.getElementById(''+id+'').style.display = "none"
					}

					function esBlock(id)
					{
						if (document.layers)
						{
							if (document.layers[''+id+''].display == "none")
							return false;
							else
								return true;
							}

							else if (document.all)
								{
									if(document.all[''+id+''].style.display == "none")
									return false;
									else
										return true;
									}

									else if (document.getElementById)
										{
											if(document.getElementById(''+id+'').style.display == "none")
											return false;
											else
												return true;
											}

										}

										function cambiaBlock(id)
										{
											if(esBlock(id))
											{
												menuNone(id);
											}

											else
												{
													menuBlock(id);
												}
											}

											function chstylepreg(tag,patron,styl)
											{
												var exp_reg = new RegExp(patron);
												var aux=document.getElementsByTagName(tag);

												for(var i=0; i<aux.length; i++)
												{
													if(exp_reg.test(aux[i].id))
													{
														aux[i].className=styl;
													}
												}
											}

											function chstyle(ele,styl)
											{
												var aux=document.getElementsByTagName(ele).className=styl;
											}

											function chStyleById(id,styl)
											{
												var aux=document.getElementById(id).className=styl;
											}


											function chAll(open)
											{
												var tag = 'ul';
												var patron = /^rama.*/;
												var exp_reg = new RegExp(patron);
												var aux=document.getElementsByTagName(tag);
												for(var i=0; i<aux.length; i++)
												{
													if(exp_reg.test(aux[i].id))
													{
														var id = aux[i].id.substr(aux[i].id.search(/(\d+)/));
														if(open)
														{
															chStyleById('tocon'+id,'menuElementOpen');
															menuBlock(aux[i].id);
														}
														else
															{
																chStyleById('tocon'+id,'menuElementClose');
																menuNone(aux[i].id);
															}

														}
													}
												}
