function ge(n){
	return document.getElementById(n);
}

try{
	document.execCommand("BackgroundImageCache",false,true);
}
catch(e){};

new function(){
	var d = document;
	d.oncontextmenu = d.onselectstart = d.ondragstart = d.oncopy = function(){
		return false;
	}
}

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 findAncestor(o, tag){
	for(tag = tag.toLowerCase(); o = o.parentNode;)
		if(o.tagName && o.tagName.toLowerCase() == tag)
			return o;
	return null;
}

function popUp(page, w, h){
	x = (screen.width >> 1) - (w >> 1), y = (screen.height >> 1) - (h >> 1);
	var prop = "width=" + w + ",height=" + h + ",scrollbars=0,resizable=0,toolbar=0,location=0,menubar=0,status=1,directories=0,top=" + y + ",left=" + x;
	window.open(page ,"", prop);
}

function imgReplace(img_url){
	var floatimg = ge("floatimg");
	floatimg.setAttribute("src", img_url);

}

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 flashObj(id, last){
	var a, o;
	if(id)
		(o = document.getElementById(id)) && (a = o.outerHTML) && (o.outerHTML = a);
	else if(last)
		(o = document.getElementsByTagName("object")) && (a = (o = o[o.length - 1]).outerHTML) && (o.outerHTML = a);
	else
		for(var i = (o = document.getElementsByTagName("object")).length; i--;)
			(a = o[i].outerHTML) && (o[i].outerHTML = a);
}

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 simpleShowHide(o) {
	var obj = document.getElementById(o), d = obj.style.display;
	obj.style.display = d == "none" || !d ? "block" : "none";
}

function showHide(objeto,opcao) {
	var obj = document.getElementById(objeto);
	obj.style.display = opcao;
}


function fontRezise(a) {
	var min = 8, max = 17, d = 14;
	var o = getElementsByClassName('fontSize');
	for(i = o.length; i--;) {
		for(var j = o[i].getElementsByTagName("*"), 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();
}