// escreve o .css correspondente ao browser
writeCSS('http://tecnologia.uol.com.br/');

// configuraï¿½ï¿½es da barra
var NumBar = 25;
var ColorBar1 = '#7E7E7E'; // cor clara
var ColorBar2 = '#244256'; // cor escura

// ï¿½cone para bookmark
dC.write('<link rel="SHORTCUT ICON" HREF="http://home.img.uol.com.br/favicon.ico">');

// configuraï¿½ï¿½es do menu
var menu_tag;

if(!menu_tag) {
	var aux = dC.cookie.split(/enu_tag=|;/,2);
	if (typeof(aux[1])!='undefined')
		menu_tag = aux[1];
	else
		menu_tag = "ultnot";
	}
else dC.cookie = 'menu_tag='+menu_tag;

// GetMethodParserJS ::: fermads @ uol
var L=location.href;
var d=L.substring(L.indexOf("?")+1);
var c=v=new Array(); c=d.split("&");
for(i=0;i<c.length&&c.length>0;i++) {
v=c[i].split("="); if(v.length>1)
eval(v[0]+"=unescape('"+v[1].replace(/\+/g," ")+"')");}


// menu fechado (que se abre ao clicar)
mt = menu_tag.split(',');
dC.write("<style type=text/css>"+
"#menu div { display:none; }"+
"#menu a.head { background-color:#244256;color:white;font-weight:bold; }"+
"#menu a.head:hover { background-color:#506D80; }"+
"#menu #"+mt[0]+" { background-color:#A3B0B9; }"+ // head active
"#menu #"+mt[1]+" { background-color:#E5E8EB;font-weight:bold; }"+  // item active
"#menu #"+mt[0]+"_i { display:block; }"+
"#menu #"+mt[0]+" { background:url(http://te.i.uol.com.br/botao-background-novo.gif);color:#fff; }"+
"</style>");

// funcao para redimensionar iframe
function adjustIframeHeight( obj ) {
  var tamanho = obj.document.getElementsByTagName("body")[0].offsetHeight + "px";
}

// funcao para trocar class da aba
function changeAba( obj ) {
  var ul = obj.parentNode.parentNode;
  var li = ul.getElementsByTagName("li");

  for(var i=0; i<li.length; i++ ) {
    removeClass( li[i], "ativo" );
  }
  addClass( obj.parentNode, "ativo" );  
}

// funï¿½ï¿½o para a busca do radar
function RaD()
{
Rq=escape(dC.radar.q.value);
Rf="";
if(Rq=="") { alert("Digitar uma palavra para fazer a busca."); }
else
	{
	R1="http://busca.uol.com.br/";
	Ra=new Array("uol/index.html?q="+Rq,"br/index.html?q="+Rq,"www/index.html?q="+Rq);
	Ra[3]=Ra[0]+"&id=8&rd=1"; // trocar pelo id da estaï¿½ï¿½o
	R2=dC.radar.l[dC.radar.l.selectedIndex].value;
	Rf=R1+Ra[R2];
	raD=window.open(Rf,"_blank");
	}
}

// funï¿½ï¿½o que deixa as colunas (esquerda, centro, direita) com a mesma altura
function resizeCols()
{
if(dC.getElementById) altura = dC.getElementById('td2').style.height = dC.getElementById('td3').style.height = dC.getElementById('tablebottom').offsetTop - dC.getElementById('tabletop').offsetTop;
dC.getElementById('td1').style.height = altura + 50;
}
function resizeCols1()
{
if(dC.getElementById) altura = dC.getElementById('td2').style.height = dC.getElementById('tablebottom').offsetTop - dC.getElementById('tabletop').offsetTop;
dC.getElementById('td1').style.height = altura + 30;
}
function resizeCols2()
{
if(dC.getElementById) altura = dC.getElementById('td2').style.height = dC.getElementById('tablebottom').offsetTop - dC.getElementById('tabletop').offsetTop;
dC.getElementById('td1').style.height = altura + 80;
}
function resizeCols3()
{
if(dC.getElementById) altura = dC.getElementById('td1').style.height = dC.getElementById('tablebottom').offsetTop - dC.getElementById('tabletop').offsetTop;
if(dC.getElementById('td2')) dC.getElementById('td2').style.height = altura - 43;
if(dC.getElementById('td3')) dC.getElementById('td3').style.height = altura - 43;
}
function resizeCols4(){
if(dC.getElementById) altura = dC.getElementById('td1').style.height = dC.getElementById('tablebottom').offsetTop - dC.getElementById('tabletop').offsetTop;
if(dC.getElementById('td2')) dC.getElementById('td2').style.height = altura - 81;
if(dC.getElementById('td3')) dC.getElementById('td3').style.height = altura - 43;
}
function resizeCols5(){
if(dC.getElementById) altura = dC.getElementById('td1').style.height = dC.getElementById('td3').style.height = dC.getElementById('tablebottom').offsetTop - dC.getElementById('tabletop').offsetTop;
dC.getElementById('td2').style.height = altura - 81;
}
function resizeCols6(){
if(dC.getElementById)
altura = dC.getElementById('td1').style.height = dC.getElementById('tablebottom').offsetTop - dC.getElementById('tabletop').offsetTop;
dC.getElementById('td2').style.height = altura - 81;
dC.getElementById('td3').style.height = altura - 183 - dC.getElementById('div3').style.height;
}
function resizeCols7()
{
if(dC.getElementById) altura = dC.getElementById('td1').style.height = dC.getElementById('tablebottom').offsetTop - dC.getElementById('tabletop').offsetTop;
dC.getElementById('td2').style.height = altura - 43;
}

// Window Open Parceiros
function wO(url){
if(url!=''){window.open(url);}
}

function getSubchan() {
	var dir = [ '', 'album', 'blogs', 'ultnot', 'proteja' ];
	var canal = [ 'capa', 'tecalbum', 'blogmundi', 'ultnotmd', 'protmicro' ];
	for(var i=0;i<dir.length;i++) 
		if (location.href.indexOf('noticias.uol.com.br/economia/'+dir[i]) != -1)
			return canal[i];
	return 'outros';
}

// funcao para os banners
DEd=document;
// config banners
var DEpopcfg ="POPmund"; // Popup
var DEsite="uolbr";		// Site, este valor tambem ï¿½ usado no parametro affiliate
var DEchan="mundigi";	// Canal
var DEsubc=getSubchan();		// Subcanal
var Expble=1;					// Alterar para 0 se nï¿½o houver 240 pixels de espaï¿½o abaixo do 468x60 atï¿½ o final da pagina ou dentro de um frame.

// mostra banners //
var DEt=new Date(); DEt=DEt.getTime(); DErand=Math.floor(DEt*1000*Math.random());
var scw=0,sch=0; if(screen.height){scw=screen.width;sch=screen.height;}
function DEshow(ad,pos){
	var DEconn=document.body; DEconn.style.behavior='url(#default#clientCaps)'; DEconn=(DEconn.connectionType=='lan')?1:0;
	document.write('<'+'scr'+'ipt type="text/javascript" src="http://bn.uol.com.br/js.ng/site='+DEsite+'&amp;chan='+DEchan+'&amp;subchan='+DEsubc+'&amp;affiliate='+DEsite+DEchan+'&amp;size='+ad+'&amp;page='+pos+'&amp;conntype='+DEconn+'&amp;expble='+Expble+'&amp;reso='+scw+'x'+sch+'&amp;tile='+DErand+'?"><\/scr'+'ipt>');
}

// funÃ§Ã£o para checar se estÃ¡ em iFrame no novo ultnot
function checkFramesTec(hashvar){
  if (top.location==document.location) {
    document.write("<meta http-equiv=\"refresh\" content=\"1;url=http://tecnologia.uol.com.br/#"+ hashvar +"\">");
    location.replace("http://tecnologia.uol.com.br/ultnot/#"+ hashvar +""); 
  } else {
	parent.scrollTo(0,0);
  }
}

/**
 * Gerar iFrame com conteúdo
 * @param {String} sourcevar Variável com o arquivo que deve carregar no iFrame
 * @param {String} hashvar O hash que vai pro endereço quando carregado (#variável)
 */
function geraIframe(sourcevar, hashvar) {
//	top.document.getElementById("iframe_content").innerHTML = '<iframe src="'+ sourcevar +'" name="frame_principal" id="frame_principal" onload="resizeFrame(this);" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" style="width:600px;"></iframe>';
	top.document.location.hash = hashvar;
	top.scrollTo(0,0);
//	return false;
}














