/**
 * -------------------------------
 * 		    Javascript #1
 * -------------------------------
 */
function setObj(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 abrir(pagina, largura, altura) {
   var esquerda = (screen.width - largura)/2;
   var topo = (screen.height - altura)/2;
   window.open(pagina,'','scrollbars=yes,height=' + altura + ', width=' + largura + ', top=' + topo + ', left=' + esquerda); 
}
function randomInt(url_root)
{
	r1=Math.floor(Math.random()*99999);
	r2=Math.floor(Math.random()*50);
	randomnumber=(r1*r2)+(r1/r2);
	html='<img src="'+url_root+'captha.php?rand='+randomnumber+'"/>';
	document.getElementById('lnk').innerHTML=html;
	return false;
}
function openBoletim(c)
{
	if(c)
	{
		abrir('showBoletim.php?cod='+c, 680, 400);
	}
}
function openEditor(lnk)
{
	if(lnk)
	{
		abrir(lnk, 720, 530);
	}
}
function filesConfirmDel2(lnk,name)
{
	if(confirm('Realmente quer apagar o arquivo "'+name+'"?'))
	{
		window.location = lnk;
	}
}
function postConfirmDel2(lnk,name)
{
	if(confirm('Realmente quer apagar a postragem "'+name+'"?'))
	{
		window.location = lnk;
	}
}
function hide(i)
{
	html='';
	window.location="#"+i;
	obj = setObj('tmp');
	obj.innerHTML=html;
	obj.style.display='none';
}
function show(src,txt,i)
{
	window.location="#";	
	html='<div class="modal">&nbsp;</div><h2>'+txt+'</h2><div class="modalDiv"><a href="javascript:hide(\''+i+'\');"><img src="?src='+src+'&big=1" /></a></div>';
	html=html+'<style type="text/css">*{overflow: hidden;}</style>';
	obj = setObj('tmp');
	obj.innerHTML=html;
	obj.style.display='';
}
function showFrame(lnk,txt,i)
{
	window.location="#";	
	html='<div class="modal">&nbsp;</div><h2>'+txt+'</h2><div class="modalDiv2"><iframe width="720" height="520" src="'+lnk+'" frameborder="0" scrolling="no"></div><style type="text/css">*{overflow: hidden;}</style>';
	obj = setObj('tmp');
	obj.innerHTML=html;
	obj.style.display='';
}
function hideFrame()
{
	html='';
	obj = setObj('tmp');
	obj.innerHTML=html;
	obj.style.display='none';
}
function _swf(e,h,w) {
	document.write("<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=\""+w+"\" height=\""+h+"\" id=\"topo\" align=\"middle\">");
	document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />");
	document.write("<param name=\"allowFullScreen\" value=\"false\" />");
	document.write("<param name=\"movie\" value=\""+e+"\" />");
	document.write("<param name=\"quality\" value=\"high\" />");
	document.write("<param name=\"menu\" value=\"false\" />");
	document.write("<param name=\"wmode\" value=\"transparent\" />");
	document.write("<param name=\"bgcolor\" value=\"#ffffff\" />");
	document.write("<embed src=\""+e+"\" quality=\"high\" menu=\"false\" bgcolor=\"#ffffff\" width=\""+w+"\" height=\""+h+"\" name=\"topo\" align=\"middle\" allowScriptAccess=\"sameDomain\" wmode=\"transparent\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />");
	document.write("</object>");
}
var qm_si,qm_li,qm_lo,qm_tt,qm_th,qm_ts;
var qp="parentNode";
var qc="className";
if(window.showHelp)
{
document.write("<style type='text/css'>.menu_clear{position:absolute;clear:none !important;}</style>");
}
function qm_create(sd,v,ts,th,oc,l)
{
	var w="onmouseover";
	if(oc)
		{
		w="onclick";
		th=0;
		ts=0;
		}
	if(!l)
		{
		l=1;
		qm_th=th;
		sd=document.getElementById("qm"+sd);
	
		sd[w]=function(e)
			{
			qm_kille(e)
			};
		document[w]=qm_bo;
		sd.style.zoom=1;
		}
	sd.style.zIndex=5;
	var lsp;
	var sp=sd.childNodes;
	for(var i=0;i<sp.length;i++)
	{
	var b=sp[i];
	if(b.tagName=="A")
		{
		lsp=b;
		b[w]=qm_oo;
		b.qmts=ts;
		if(l==1&&v)
			{
			b.style.styleFloat="none";
			b.style.cssFloat="none";
			}
		}
	if(b.tagName=="DIV")
		{
		if(window.showHelp&&!window.XMLHttpRequest)
			{
			sp[i].insertAdjacentHTML("afterBegin","<span class='menu_clear'>&nbsp;</span>");
			}
		x2("qmparent",lsp,1);
		lsp.cdiv=b;
		b.idiv=lsp;
		new qm_create(b,null,ts,th,oc,l+1);
		}
	}
};
function qm_bo(e)
{
	clearTimeout(qm_tt);
	qm_tt=null;
	if(qm_li&&!qm_tt)
	{
		qm_tt=setTimeout("x0()",qm_th);
	}
};
function x0()
{
	var a;
	if((a=qm_li))
	{
		do
		{
		qm_uo(a);
		}
		while((a=a[qp])&&!qm_a(a))
	}
	qm_li=null;
};
function qm_a(a){if(a[qc].indexOf("qmmc")+1)return 1;};function qm_uo(a,go){if(!go&&a.qmtree)return;if(window.qmad&&qmad.bhide)eval(qmad.bhide);a.style.visibility="";x2("qmactive",a.idiv);}
function qm_oo(e,o,nt){if(!o)o=this;if(window.qmad&&qmad.bhover&&!nt)eval(qmad.bhover);if(window.qmwait)return;clearTimeout(qm_tt);qm_tt=null;if(!nt&&o.qmts){qm_si=o;qm_tt=setTimeout("qm_oo(new Object(),qm_si,1)",o.qmts);return;}var a=o;if(a[qp].isrun)return;var go=true;while((a=a[qp])&&!qm_a(a)){if(a==qm_li)go=false;}if(qm_li&&go){a=o;if((!a.cdiv)||(a.cdiv&&a.cdiv!=qm_li))qm_uo(qm_li);a=qm_li;while((a=a[qp])&&!qm_a(a)){if(a!=o[qp])qm_uo(a);else break;}}var b=o;if(b.cdiv){var aw=b.offsetWidth;var ah=b.offsetHeight;var ax=b.offsetLeft;var ay=b.offsetTop;if(qm_a(b[qp])&&b.style.styleFloat!="none"&&b.style.cssFloat!="none")aw=0;else ah=0;if(!b.cdiv.ismove){b.cdiv.style.left=(ax+aw)+"px";b.cdiv.style.top=(ay+ah)+"px";}x2("qmactive",o,1);if(window.qmad&&qmad.bvis)eval(qmad.bvis);b.cdiv.style.visibility="inherit";qm_li=b.cdiv;}else  if(!qm_a(b[qp]))qm_li=b[qp];else qm_li=null;qm_kille(e);};function x2(name,b,add){var a=b[qc];if(add){if(a.indexOf(name)==-1)b[qc]+=(a?' ':'')+name;}else {b[qc]=a.replace(" "+name,"");b[qc]=b[qc].replace(name,"");}};function qm_kille(e){if(!e)e=event;e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation();}