// JavaScript Document

function seleccionSolicitud(urlBase){
	if (document.getElementById('seleccionSolicitud').options[document.getElementById('seleccionSolicitud').selectedIndex].value != "0"){
		var seleccion = document.getElementById('seleccionSolicitud').options[document.getElementById('seleccionSolicitud').selectedIndex].value;
		switch (seleccion){
			case 'letrasVivas':
				location.href = urlBase + '/modulos/letrasVivas/index.php';
				break;
			case 'bibliotecasIlustradas':
				location.href = urlBase + '/modulos/bibliotecasIlustradas/index.php';
				break;
			case 'ciclobibliotecas':
				location.href = urlBase + '/modulos/ciclobibliotecas/index.php';
				break;
			case 'exposicionsItinerantes':
				location.href = urlBase + '/modulos/exposicionsItinerantes/index.php';
				break;
			case 'lendoEspero':
				location.href = urlBase + '/modulos/lendoEspero/index.php';
				break;
			case 'semanasLibroLectura':
				location.href = urlBase + '/modulos/semanasLibroLectura/index.php';
				break;
		}
	}
}

function popup(url,anchoVentana,altoVentana){
	var posicionIzquierda = ( screen.width - anchoVentana ) / 2;
	var posicionArriba = (screen.height - altoVentana) / 2;
	var ventana=window.open(url,'ventana','width=' + anchoVentana + ',height=' + altoVentana + ',left=' + posicionIzquierda + ',top=' + posicionArriba + ',scrollbars=1,resizable=no');
}

function viewPic(img) {
	picfile=new Image(); picfile.src=(img); fileCheck(img); 
}

function fileCheck(img) {
	if((picfile.width!=0)&&(picfile.height!=0)) {
		makeWindow(img); }
	else {
		funzione="fileCheck('"+img+"')"; intervallo=setTimeout(funzione,10); 
	 }
}

function makeWindow(img) {
	ht=picfile.height+30; wd=picfile.width+20; 
	var args="height="+ht+",innerHeight="+ht;
	args+=",width="+wd+",innerWidth="+wd;
	if (window.screen) { 
		var avht=screen.availHeight; var avwd=screen.availWidth;
		var xcen=(avwd-wd)/2; var ycen=(avht-ht)/2;
		args+=",left="+xcen+",screenX="+xcen;
		args+=",top="+ycen+",screenY="+ycen+",resizable=yes";
	}
	return window.open(img,'',args);
}