try{
	document.execCommand("BackgroundImageCache", false, true);
}
catch(e){
}

function ge(n){
	return document.getElementById(n);
}

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 setFontClass(c){
	var l = arguments.callee.last = arguments.callee.last || "content_text";
	if(c == l)
		return;
	for(var o = getElementsByClassName(l, ge("Content")), i = o.length; i--; o[i].className = o[i].className.split(l).join(c));
	arguments.callee.last = c;
}

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 writeWMV(url, w, h, r) {
	var s = '<object id="player" ';
	if(navigator.userAgent.indexOf("MSIE") + 1)
		s += 'classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"';
	else if(navigator.userAgent.indexOf("Firefox") + 1)
		s += ' type="application/x-ms-wmp"';

	s += 'height="'+h+'" width="'+w+'">\
		<param name="URL" value = "'+url+'">\
		<param name="ShowControls" value="0">\
		<param name="ShowDisplay" value="0">\
		<param name="ShowStatusbar" value="1">\
		<param name="AutoSize" value="0">\
		<param name="autostart" value="false" >\
	</object>';
	return r ? s : document.write(s);
}

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 getPosition(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 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 imgPreview2(foto){
	$('foto_preview').innerHTML = "<center><img src='"+foto+"' /></center>";
	var $as = $('thumb_gallery').getElementsByTagName('a');
	for ($i=0;$i<$as.length;$i++){
		if($as[$i] == foto)
			setclasse($as[$i],"active");
		else
			setclasse($as[$i],"");
		
	}
	return false;
}