// script para aumentar/disminuir tamaņo de letra
	var max_size = 120;
	var min_size =60;
	var tamagnoLetras = 80;
	
	function dzIncreaseFontSize(idElemento) {
		if (document.all || document.getElementById) {	
			var elemento = document.all ? document.all[idElemento] : document.getElementById(idElemento);
			if (elemento) {	
				// el valor est&aacute; indicado en porcentaje:
				if(tamagnoLetras >= max_size){
					alert("No es posible aumentar mas el texto")
				}else{
					tamagnoLetras += 10;
					if (elemento.length) 
						for (i=0; i<elemento.length; i++) {
							elemento[i].style.fontSize = (tamagnoLetras+'%');
							}
					else
						elemento.style.fontSize = (tamagnoLetras+'%');				
				}
			}
		}
	}
	
	function dzDecreaseFontSize(idElemento) {
		if (document.all || document.getElementById) {	
			var elemento = document.all ? document.all[idElemento] : document.getElementById(idElemento);
			if (elemento) {	
				// el valor est&aacute; indicado en porcentaje:
				if(tamagnoLetras <= min_size){
					alert("No se puede disminuir mas el texto")
				}else{
					tamagnoLetras -= 10;
					if (elemento.length) 
						for (i=0; i<elemento.length; i++) {
							elemento[i].style.fontSize = (tamagnoLetras+'%');
						}
					else
						elemento.style.fontSize = (tamagnoLetras+'%');				
				}
			}
		}
	}
	
	function dzResetFontSize(idElemento) {
		var elemento = document.all[idElemento];
		elemento.body.style.fontSize = '100%';
	//	document.body.style.fontSize = '100%';
	}
	
function abrirMultimedia(archivo,ancho,alto,texto) {
	
	if (ancho==0 || typeof(ancho)=='undefined'){
		ancho=450;
	}
	
	if (alto==0 || typeof(alto)=='undefined'){
		alto=391;
	}

	if (texto==0 || typeof(texto)=='undefined'){
		texto='EMOL';
	}
	
	if (archivo=='') {
		alert("Debe especificar un archivo a reproducir");
		return false;
	} else {
		archivo = '/mediaplayer/reproductor_multimedia.asp?strArchivo='+archivo+'&strAlto='+alto+'&strAncho='+ancho+'&strTexto='+texto;
	}
	//alert(archivo);
	window.open(archivo, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=680,height=486,left=0, top=0');
}

function abrirMultimediaSelf(archivo,texto) {
	
	if (texto==0 || typeof(texto)=='undefined'){
		texto='EMOL';
	}
	
	if (archivo=='') {
		alert("Debe especificar un archivo a reproducir");
		return false;
	} else {
		archivo = '/mediaplayer/reproductor_multimedia.asp?strArchivo='+archivo+'&strAlto=391&strAncho=450&strTexto='+texto;
	}
	//alert(archivo);
	location.href=archivo;
}


// usada por el clima
function goLink(url,value) {
  if (value == 0) {
	return false;
  } else {
	document.location.href=url;
  }
}

/*Funcion para activacion de caja fotonoticias */
var galerias = new Array("fotonotic","mundografico");
var botonesGalOn = new Array("/imagenes/fotos_emol_on.gif","/imagenes/mundograficoon.gif");
var botonesGalOff = new Array("/imagenes/fotos_emol_off.gif","/imagenes/mundograficooff.gif");
var nombresImagGal = new Array("Image9","Image10");
var numGalAux;
var numGalAct=-1;

function cargaFotoGaleria(){
var tabActivGal=document.getElementById("galeract").value;
for( var i=0; i < galerias.length; i++ )
{
if (galerias[i] != "fotonotic") { document.getElementById(galerias[i]).style.visibility="hidden";
document.getElementById (galerias[i]).style.position="absolute";
}
else {document.getElementById(galerias[i]).style.position="relative";}
}

if(tabActivGal=='fotonotic'){imgGalOn('Image9',0);muestraGaleria('fotonotic','Image9',0)}
else if(tabActivGal=='mundografico'){imgGalOn('Image10',1);muestraGaleria('mundografico','Image10',1)}
else {imgGalOn('Image9',0);muestraGaleria('fotonotic','Image9',0)}
}

function imgGalOn(imgName,numOn) {
if ( (document.images) && (numOn != numGalAct) ) {
document[imgName].src = botonesGalOn[numOn];
}
}
function imgGalOff(imgName,numOff) {
if ( (document.images) && (numOff != numGalAct) ) {
document[imgName].src = botonesGalOff[numOff];
}
}
function muestraGaleria(solicitud,imgName,numGalAux){
numGalAct=numGalAux;
imgGalOn(imgName,numGalAux);
for( var nu=0; nu < galerias.length; nu++ )
{
if (nu != numGalAux){document.getElementById(nombresImagGal[nu]).src = botonesGalOff[nu];}
}
for( var j=0; j < galerias.length; j++ )
{
if (galerias[j] != solicitud){document.getElementById(galerias[j]).style.visibility="hidden";
document.getElementById(galerias[j]).style.position="absolute";
}
else { document.getElementById(galerias[j]).style.visibility="visible";
document.getElementById(galerias[j]).style.position="relative";
}
}
}

function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
else 
countfield.value = maxlimit - field.value.length;
}
