function ge(n){
	return document.getElementById(n);
}
var getOffset = function(o){
	for(var r = {x: o.offsetLeft, y: o.offsetTop, h: o.offsetHeight, w: o.offsetWidth}; o = o.offsetParent; r.x += o.offsetLeft, r.y += o.offsetTop);
	return r;
}
function getElementsByClassName(name, parent){
	for(var o = [], n = new RegExp("\\b" + name.replace(/([(){}|*+?.,^$\[\]\\])/g, "\\\$1") + "\\b"), l = (parent || document).getElementsByTagName("*"), i = l.length; i--;)
		n.test(l[i].className) && (o[o.length] = l[i]);
	return o;
}
function getElementsInClassName(name, elements){
	for(var o = [], n = new RegExp("\\b" + name.replace(/([(){}|*+?.,^$\[\]\\])/g, "\\\$1") + "\\b"), l = elements, i = l.length; i--;)
		n.test(l[i].className) && (o[o.length] = l[i]);
	return o;
}
function findAncestor(o, tag, limit){
	for(tag = tag.toLowerCase(); o = o.parentNode;)
		if(o.tagName && o.tagName.toLowerCase() == tag)
			return o;
		else if(limit && o == limit)
			return null;
	return null;
}
function findNext(o, tag, limit){
	for(tag = tag.toLowerCase(); o = o.nextSibling;)
		if(o.tagName && o.tagName.toLowerCase() == tag)
			return o;
		else if(limit && o == limit)
			return null;
	return null;
}
function findPrevious(o, tag, limit){
	for(tag = tag.toLowerCase(); o = o.previousSibling;)
		if(o.tagName && o.tagName.toLowerCase() == tag)
			return o;
		else if(limit && o == limit)
			return null;
	return null;
}

function fontRezise(a, padrao, min, max) {
	var min = min || 8, max = max || 17, d = padrao || 14;
	var o = getElementsByClassName('fontSize');
	for(i = o.length; i--;) {
		for(var j = o[i].getElementsByTagName("p"), c = j.length; c--;) {
			var e = j[c], s = e.style.fontSize ? +e.style.fontSize.replace("px","") : d;
			a && (s < max) ? s++ : !a && (s > min && s--);
			e.style.fontSize = s + "px";
		}
	}
	window.SimpleScroll && window.SimpleScroll.refresh();
}

function addFavorite(){
	if (window.sidebar) { // Mozilla
		window.sidebar.addPanel(document.title, location.href,"");
	}else if(window.external) {
		window.external.AddFavorite(location.href, document.title);
	}
}

function simpleShowHide(o) {
	var obj = document.getElementById(o), d = obj.style.display;
	obj.style.display = d == "none" || !d ? "block" : "none";
}