
/*
Display Capas según expresion regular contra el id
*/
function nonecapas(tag,patron)
{
	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))
		{
			capaNone(aux[i].id);
		}
	}
}


function capaBlock(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 capaNone(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))
										{
											capaNone(id);
										}
										else
											{
												capaBlock(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)
										{
											document.getElementsByTagName(ele).className=styl;
										}

										function chstyleById(ele,styl)
										{
											document.getElementById(ele).className=styl;
										}
										
function cambioImg(id,img,pathDestino,pathOrigen)
		{
			
		if(esBlock(id))
		{
			
		if (document.layers) document.layers[''+id+''].src=pathOrigen;
		else if (document.getElementById) document.getElementById(img).src=pathOrigen;
		else if (document.all) document.all[''+id+''].src=pathOrigen;		
		}
		else
		{
		if (document.layers) document.layers[''+id+''].src=pathDestino;		
		else if (document.getElementById) document.getElementById(img).src=pathDestino;
		else if (document.all) document.all[''+id+''].src=pathDestino;
			
		}
		}