
// Abre un popup con un html y una foto dada
function abreFoto(foto) {
	v=window.open('image.asp?foto='+foto,'popupFoto','width=500,height=600,top=5,left=5,scrollbars=no');
   	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;
	}
}

// Funciones control ventana navegador
function wSize() {
	var userAgent = navigator.userAgent;
	var isFirefox = ( userAgent != null && userAgent.indexOf( "Firefox/" ) != -1 );

	if(navigator.appName == "Netscape") {
		iAlto = window.innerHeight;
		iAncho = window.innerWidth;
		iScrollAncho = document.width + 12;
		iScrollAlto = document.height + 30;
		
		if (isFirefox) {
			if (document.images['foto']) {
				iScrollAncho = (document.images['foto'].width) + 10;
				iScrollAlto = (document.images['foto'].height) + 55;
			} else {
				iScrollAncho = screen.width;
				iScrollAlto = screen.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 + 12;
			iScrollAlto = document.body.scrollHeight + 30;
		}
 	}
	myWidth = iScrollAncho;
	myHeight = iScrollAlto;
	return [myWidth, myHeight];
}

function escalaVentana() {
	sizeTemp = wSize();
	ancho = sizeTemp[0];
	alto = sizeTemp[1];
	window.resizeTo(ancho,alto);
}



