function expansivelOver() {
	document.getElementById('banner_topo').style.height = '250px';
}

function expansivelOut() {
	document.getElementById('banner_topo').style.height = '90px';	
}

function newCaptcha(){
	thesrc = $("captcha").src;
	thesrc = thesrc.substring(0,thesrc.lastIndexOf(".")+4);
	document.getElementById("captcha").src = thesrc+"?"+Math.round(Math.random()*100000);
}

function changeMaisTabs(tab){
	var els = $('botoes_lidas_comentadas').getElementsByTagName('h1');
	
	for(var i=0; i<els.length; i++){	
		var obj = els[i];
		var classe = obj.className;
		var pos = classe.indexOf('_');
		classe = classe.substr((pos+1), classe.length);
		
		$('envolve_'+classe).style.display = 'none';
		obj.className = 'selecionado_'+classe;
		
		if(obj.className.indexOf(tab) > 0){
			$('envolve_'+tab).style.display = 'block';
			obj.className = 'deselecionado_'+tab;
		}		
	}
	
	return false;
}

function contarCaracteres(entrada, saida, texto, chars) {
var entradaObj = $(entrada); var saidaObj = $(saida);
var tam = chars - entradaObj.value.length;
if(tam <= 0) { tam = 0;
texto = '<span class="disable"> '+texto+' </span>';
entradaObj.value = entradaObj.value.substr(0,chars); }
saidaObj.innerHTML = texto.replace("{CHAR}",tam);
}

function fechaZoom(){
	$('pop-dimmer').style.visibility = 'hidden';
	$('fotoBox').style.visibility = 'hidden';
}

function pop(url, obj) {
	x = $('pop-dimmer');
	var arrayPageSize = getPageSize();
	var arrayPageScroll = getPageScroll();
	var totalHeight = arrayPageSize[1]+'px';
	
	x.style.height = (totalHeight);
	if (x && x.className!='hide') {x.className = 'hide';} else {x.className = 'show';}
	
	d = $('fotoBox');
	d.style.visibility = 'visible';
	d.style.top = arrayPageScroll[1]+'px';
	d.innerHTML = '<div align="right"><a href="javascript:;" onClick="fechaZoom();return false;">X FECHAR</a></div><img src="_INC/thumbs.php?src='+url+'&wmax=400&hmax=400&cut=false">';

	return false;
}

function showVideo(url, yPos){
	d = document.getElementById('videoBox');	
    d.innerHTML = '<embed id="globalnav-embed" src="' + url + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="loc=en_US&htmlApp=false&gatewayURL=gwurl" menu="false" align="middle" quality="high" scale="noscale" id="video" width="400" height="320" ></embed>';
}

function zoomText(acao, el){
obj=$(el);	
if (obj.style.fontSize=="")	obj.style.fontSize="13px";
atual=parseInt(obj.style.fontSize);
inc=2; maxVal = 19; minVal = 9;
if(acao=="reestablecer"){ obj.style.fontSize="1em" }	
if(acao=="aumentar"){ val=atual+inc; if(val <= maxVal) obj.style.fontSize=val+"px" }	
if(acao=="diminuir"){ val=atual-inc; if(val >= minVal) obj.style.fontSize=val+"px"; }
} 

function GeraSWF(arquivo,largura,altura,id,transp){
var incTransp = '';
document.writeln('<object align="middle" id="globalnav-object" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+largura+'" height="'+altura+'" id="'+id+'" name="'+id+'">');
if(transp == "yes"){ document.writeln('<param name="wmode" value="transparent" />'); incTransp = 'wmode="transparent"'; }
document.writeln('<param name="allowScriptAccess" value="always" />');
document.writeln('<param name="quality" value="high" />');
document.writeln('<param name="salign " value="tl" />');
document.writeln('<param name="align " value="tl" />');
document.writeln('<param name="scale" value="noborder" />');
document.writeln('<param name="menu" value="false" />');
document.writeln('<param name="movie" value="'+arquivo+'" />');
document.writeln('<embed id="globalnav-embed" src="'+arquivo+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="loc=en_US&htmlApp=false&gatewayURL=gwurl" menu="false" align="middle" quality="high" allowscriptacess="always" salign="tl" align="tl" scale="noborder" id="'+id+'" width="'+largura+'" height="'+altura+'" '+incTransp+'></embed>');
document.writeln('</object>');
}

function hideLayer(obj, timeOut){ setTimeout("showHideLayers('"+obj+"','','hide')", timeOut); }

var flg1 = true; var flg2 = true; var txtorig1; var txtorig2;

function inn(txt,i) {
if (eval('flg'+i)){ eval('txtorig'+i+'=txt.value;'); eval('flg'+i+'=false;');}	
if (txt.value == eval('txtorig'+i)) txt.value = '';
}

function out(txt,i) { if (txt.value == '') txt.value = eval('txtorig'+i); }

function newWindow(mypage, w, h, scroll) {
var winl = (screen.width - w) / 2; var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',status=yes, resizable';
win = window.open(mypage, '', winprops);
if (parseInt(navigator.appVersion) >= 4) win.window.focus();
}

function MM_changeProp(objName,x,theProp,theValue) {
var obj = MM_findObj(objName);
if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
if (theValue == true || theValue == false) eval("obj."+theProp+"="+theValue);
else eval("obj."+theProp+"='"+theValue+"'");}
}

function MM_findObj(n, d) {
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_jumpMenu(targ,selObj,restore){
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}

function setCookie(n, v, p, t){
  now = new Date();
  now.setTime(Date.parse(now) + t);
  document.cookie =  n+'='+escape(v)+';PATH='+p+';EXPIRES='+now.toUTCString();
}

function showHideLayers() {
today = new Date();
setCookie('flutuante', 1, '/', today.getTime() + 60*3600);
var i,p,v,obj,args=showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) 
if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v}
obj.visibility=v;}
}