function fotogaleria(theURL) {
  window.open(theURL,'','toolbar=no,statusbar=no,scrollbars=no,width=720,height=615');
}

function printVersion(theURL) {
  window.open(theURL,'','scrollbars=yes,width=510,height=560');
}

function reload(theURL) {
	window.location.href = theURL;
}

function MM_openBrWindow(theURL,winName,features) {
	window.open(theURL,winName,features);
}

var fuente = 13;
var minimo = 12;
var maximo = 20;

function aumentarTexto(texto) {
	fuente = (fuente >= maximo) ? maximo : fuente + 1;
	var lay = document.getElementById(texto);
	lay.style.fontSize = fuente;
	lay.style.lineHeight = (fuente + 3) + "px";
}

function achicarTexto(texto) {
	fuente = (fuente <= minimo) ? minimo : fuente - 1;
	var lay = document.getElementById(texto);
	lay.style.fontSize = fuente;
	lay.style.lineHeight = (fuente + 3) + "px";
}

// Take content in a div with id="defer-xyz" and move it to a div with id="xyz"
function relocateDeferredContent() {
	var divs=document.getElementsByTagName("div");
	var replacements=new Array();
	for(var i=0;i<divs.length;i++) {
		var deferredContent = divs[i];
		if (deferredContent.id.indexOf("defer-") == 0) {
			var placeHolder = document.getElementById(deferredContent.id.slice(6));
			replacements.push([deferredContent, placeHolder]);
		}
	}
	for(i=0;i<replacements.length;i++) {
		replacements[i][0].parentNode.removeChild(replacements[i][0]);
		replacements[i][1].parentNode.replaceChild(replacements[i][0], replacements[i][1]);
		replacements[i][0].style.display = "block";
	}
	return true;
}

//Menu & Navegacion

function overlapOut() {
	if (document.getElementById(_frid)) with (document.getElementById(_frid).style) { width = 0; height = 0; top = 0; left = 0; }
}
function overlapFix(o) {
	o.style.zIndex=100;
	if (!document.getElementById(_frid)) {
		var i = document.createElement("iFrame");
		i.setAttribute("id", _frid);
		i.setAttribute("scrolling", "no");
		i.setAttribute ("frameborder", "0");
		document.body.appendChild(i);
	}
	with (document.getElementById(_frid).style) {
		opacity = "0"; filter= "alpha(Opacity=0)";
		position = "absolute";
		width = o.offsetWidth; height = o.offsetHeight;
		top = o.offsetTop; left = o.offsetLeft;
		zIndex = o.style.zIndex - 1;
		display = o.style.display;
	}
}
function sfHover() {
	if (document.getElementById("nav")) {
		var sfEls = document.getElementById("nav").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
				var u=this.getElementsByTagName("UL");
				if (u.length>0) {
					overlapFix(u[0]);
				}
			}
			sfEls[i].onmouseout=function() {
				this.className="";
				overlapOut();
			}
		}
	} else {
		setTimeout("sfHover()", 5);
	}
}

// Codigo de visualizacion generico
function outliner() {
	// Obtener elemento hijo.
	var child = document.all[event.srcElement.getAttribute("title",false)];
	// Si el elemento hijo existe, expandirlo o colapsarlo.
	if (null != child) child.className = child.className == "collapsed" ? "expanded" : "collapsed";
}
