

function voidCambiarIdioma()
{
	var s;

	if (document.all.sPathInfo == undefined)
	{
		s=document.location.href;
		s=IrURL(document.location.href,34,44)
		if (document.location.href == s)
		{
			s=IrURL(document.location.href,44,34)
			if (document.location.href == s)
			{
				s = reemplazarCadena(s, "iIdioma=" + 44, "iIdioma=" + 34);
				if (document.location.href == s)
				{
					s = reemplazarCadena(s, "iIdioma=" + 34, "iIdioma=" + 44);
				}
			}			
			document.location.href = s
		}
		else
		{
			document.location.href = s
		}
	}
	else
	{
		document.location.href = document.all.sPathInfo.value + "?iIdioma=" + (document.all.iIdioma.value==34?44:34);
	}
}

function IrURL(sURL, iIdiomaOrigen, iIdiomaDestino)
{
	return reemplazarCadena(sURL, "/" + iIdiomaOrigen + "/", "/" + iIdiomaDestino + "/");
}
/*
function voidCambiarIdioma()
{
	document.location.href = document.all.sPathInfo.value + "?iIdioma=" + (document.all.iIdioma.value==34?44:34);
}
*/
function voidIrURL(sURL)
{
	document.location.href = reemplazarCadena(sURL, "/idIdioma/", "/" + document.all.iIdioma.value + "/");
}

function reemplazarCadena(sDonde, sBuscar, sSustituir)
{
	var oRE = new RegExp(sBuscar, "g");
	return sDonde.replace(oRE, sSustituir);
}
