/*
	(c) An�lisis, Dise�o e Implementaci�n Software, S.L. <adisoftware.com>
	(2005/02/26) Juanfran Calder�n.
*/
function id2Obj(id) {
	return (document.getElementById) ? document.getElementById(id) : ((document.all) ? document.all[id] : document.layers[id]);
} // id2Obj

function getX(obj) {
	var R = obj.offsetLeft;
	while (obj = obj.offsetParent) {
		R += obj.offsetLeft;
	} // while
	return R;
} // getX

function getY(obj) {
	var R = obj.offsetTop;
	while (obj = obj.offsetParent) {
		R += obj.offsetTop;
	} // while
	return R;
} // getY

var GENERAL_htmlZoom_ETIQS = new Array('div', 'td', 'tr', 'a', 'p'); // Specify affected tags. Add or remove from list
var titulos_htmlZoom_ETIQS = new  Array('h1', 'h2', 'big'); //Titulos genericos de todas las páginas
var titulos_gce_htmlZoom_ETIQS = new  Array( 'small'); // Titulos de gran canaria emprende que son más pequeños
//Para tratar los títulos con un tamaño específico

function htmlZoom(id_etiq, zoom,zoom_titulo,zoom_titulo_gce) {
	var objX, iX, objTags, iTags;
	//
	if (!(objX = id2Obj(id_etiq))) {
		objX = document.getElementsByTagName(id_etiq)[0];
	}
	objX.style.fontSize = zoom;
	for (iX = 0; iX < GENERAL_htmlZoom_ETIQS.length; iX++) {
		objTags = objX.getElementsByTagName(GENERAL_htmlZoom_ETIQS[iX]);
		for (iTags = 0; iTags < objTags.length; iTags++) {
			objTags[iTags].style.fontSize = zoom;
			
		} // for
		
	} // for
	
	for (iX = 0; iX < titulos_htmlZoom_ETIQS.length; iX++) {
		objTags = objX.getElementsByTagName(titulos_htmlZoom_ETIQS[iX]);
		for (iTags = 0; iTags < objTags.length; iTags++) {
			objTags[iTags].style.fontSize = zoom_titulo;
			}
	  }		



	for (iX = 0; iX < titulos_gce_htmlZoom_ETIQS.length; iX++) {
		objTags = objX.getElementsByTagName(titulos_gce_htmlZoom_ETIQS[iX]);
		for (iTags = 0; iTags < objTags.length; iTags++) {
			objTags[iTags].style.fontSize = zoom_titulo_gce;
			}
	  }		
} // htmlZoom




function randomInt(limInf, limSup) {
	limInf = parseInt(limInf);
	return Math.floor(Math.random() * (parseInt(limSup) - limInf + 1)) + limInf;
} // randomInt

var GENERAL_MONTHS = new Array("enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre");
function getMyDate() {
	var dtNow = new Date();
	return dtNow.getDate() + " de " + GENERAL_MONTHS[dtNow.getMonth()] + ", " + dtNow.getFullYear();
} // getMyDate

