
function ltrim(cadena){
	while (cadena.substring(0, 1) == ' ')
		cadena = cadena.substring(1, cadena.length);
	return cadena;		
}

function getIdioma(){
	var tmp="";
	tmp = document.location.href;
	TheParametersArray = tmp.split("/");
	return TheParametersArray[TheParametersArray.length-4];
}	

function getSeccion(){
	var tmp="";
	tmp = document.location.href;
	TheParametersArray = tmp.split("/");
	return TheParametersArray[TheParametersArray.length-2];
}	

function getPagina(){
	var tmp="";
	tmp = document.location.href;
	TheParametersArray = tmp.split("/");
	return TheParametersArray[TheParametersArray.length-1];
}

function estamosIndex(){
	if (getPagina()=="inicio.html")
		return true;
	else
		return false;
}


function parametros(){	
	params = document.location.search.substring(1,255) 
	
	TheParametersArray = params.split ("&") 
	valor=""
	u = TheParametersArray.length 
	for (f= 0 ; f < u; f++) {
		elem = unescape(TheParametersArray[f]);
		if (elem!="")
			valor=(elem.split("="))[1];
	}
	return valor;
}




function popUp(URL,ancho,alto){
	abrepop(URL, 'hacer', ancho, alto, 'auto');
}

function escribir(texto){
	document.write(texto);
}

function recorrer(){
	theelements = document.getElementsByTagName("TD");
    
    for (i = 0; i < theelements.length; i++) {
        var obj = theelements[i];
        if (obj.id != ""){
        	alert (obj.id)
        }
    }
}





pag = getPagina();
sec = getSeccion();

