
// Inicializa scrollBar
function ini() {
	scr_ini('taco', 'texto', 453);
	// Comprueba si hay scroll y si lo hay muestra o no el control del scroll
	if (capascroll.h > capascroll.valorclipping('b')) {
		capabarra.mostrar();
		capaflechas = new objetoCapa("barra");
		capaflechas.mostrar();
	}
}


// Abre el popup del mapa de la zona
function abreMapa() {
	v=window.open('mapa.htm','mapa','toolbar=no,location=0,directories=no,menubar=no,scrollbars=no,resizable=no,width=580,height=468,left=10,top=10');
	v.focus();
}






// Limita caracteres en una cadena
function limiteCaracteres(cadena, total) {
	var cadenaFin = cadena.substr(0, total);
	if (cadenaFin.length < cadena.length) {
		return cadenaFin + " ...";
	} else {
		return cadenaFin;
	}
}



// Abre un popup con un html y una foto dada
function abreFoto(html,foto) {
	v=window.open(html+'?foto='+foto,'popupFoto','width=10,height=10,top=5,left=5,scrollbars=no');
   	v.focus();
}

// Abre un popup con un html y una foto dada
function abreFoto2(html,foto) {
	v=window.open(html+'?foto='+foto,'popupFoto','width=800,height=600,top=5,left=5,scrollbars=yes');
   	v.focus();
}


// Funciones control ventana navegador
function wSize() {
    if(navigator.appName == "Netscape") {
      iAlto = window.innerHeight;
      iAncho = window.innerWidth;
      iScrollAncho = document.width;
      iScrollAlto = document.height;
    }

    if (navigator.appVersion.indexOf("MSIE") != -1){
      if (navigator.appVersion.indexOf("Mac") == -1){
        iAncho=document.body.clientWidth;
        iAlto=document.body.clientHeight;
        iScrollAncho = document.body.scrollWidth;
        iScrollAlto = document.body.scrollHeight;
      }
    }
    myWidth = iScrollAncho;
    myHeight = iScrollAlto;
  return [myWidth, myHeight];
}

function escalaVentana() {
	sizeTemp = wSize();
	ancho = sizeTemp[0]+10;
	alto = sizeTemp[1]+25;
	window.resizeTo(ancho,alto);
}


