var mR = 'redacao.vocesa@abril.com.br' ;
var tbEm='';
var tbEm = new Array();
tbEm['Renata Avediani'] = "ravediani@abril.com.br";
tbEm['Murilo Ohl'] = "murilo.ohl@abril.com.br";
tbEm['José Eduardo Costa'] = "joseeduardo.costa@abril.com.br";
tbEm['Fabiana Corrêa'] = "facorrea@abril.com.br";
tbEm['Fernanda Bottoni'] = "fbottoni@abril.com.br";
tbEm['Chrystiane Silva'] = "chsilva@abril.com.br";
tbEm['Marina Izidoro'] = "redacao.vocesa@abril.com.br";
tbEm['Daniela Diniz'] = "daniela.diniz@abril.com.br";
tbEm['Gabril Penna'] = "gabriel.penna@abril.com.br";
tbEm['Amanda Salim'] = "asalim@abril.com.br";
tbEm['Joana Porto'] = "redacao.vocesa@abril.com.br";
tbEm['Bruno Vieira Feijó'] = "redacao.vocesa@abril.com.br";
tbEm['Julia de Medeiros'] =  "redacao.vocesa@abril.com.br";
tbEm['Eugenio Mussak'] = "eugenio@ssdi.com.br";
tbEm['Célia Leão'] = "etiqueta@abril.com.br";
tbEm['Luiz Carlos Cabrera'] = "redacao.vocesa@abril.com.br";
tbEm['Gustavo Cerbasi'] = "gustavo@maisdinheiro.com.br";
tbEm['Christian Barbosa'] = "redacao.vocesa@abril";
tbEm['Nina Neves'] = "nina.nevesa@abril";
tbEm['Lucas Rossi'] = "lucas.rossi@abril";
tbEm['Juliana De Mari'] = "Juliana.Demari@abril.com.br";
tbEm['Nataly Pugliesi'] = "Nataly.Pugliesi@abril.com.br";
tbEm['Luiz De França'] = "luiz.defranca@abril.com.br";


function WriteAutor(nome){
if ((tbEm || tbEm[nome]!=null) && tbEm[nome]!=undefined) {$('.autor').prepend(nome+' <a href="mailto:'+tbEm[nome]+'">('+tbEm[nome]+')</a>');}else{$('.autor').prepend(nome+' <a href="mailto:'+mR+'">('+mR+')</a>');}}
function Imprima(){window.open('/imprima-essa-pagina.shtml','Imprima','toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600');}

function salta_comentarios(tempo) {
	//var pos=$('.coments').offset().top;
	var pos=$('.fb-comments').offset().top;	
	pos = pos - 20;
	$('html,body').animate({scrollTop:pos},tempo);
}

/* BANDEIRA QUE SEGUE O MOUSE */
$(document).ready(function() {
xOffset=-20; yOffset=-150;
$(".tooltip").hover(function(e){
this.t=this.title;
$(this).removeAttr("title");
this.alt = "";
$("body").append("<p id='tooltip'>"+ this.t +"</p>");
$("#zoomcapa")
.css("top",(e.pageY - xOffset) + "px")
.css("left",(e.pageX + yOffset) + "px")
.fadeIn('fast');
},function(){
this.title = this.t;
$("#zoomcapa").remove();
});
$("*[title]").mousemove(function(e){
$("#zoomcapa")
.css("top",(e.pageY - xOffset) + "px")
.css("left",(e.pageX + yOffset) + "px");
});
});
moveContent = function(nameDivOas, nameDivOasDisplay) {
$(nameDivOas).appendTo(nameDivOasDisplay);
}

/* AMPLIAR CAPINHA */
$(document).ready(function() {
xOffset=300; yOffset=-450;
$(".zoomcapa").hover(function(e){
this.t=this.title;
$(this).removeAttr("title");
this.alt = "";
$("body").append("<p id='zoomcapa'><img src='/imagens/capas/edicaodomes.jpg'/></p>");
$("#zoomcapa")
.css("top",(e.pageY - xOffset) + "px")
.css("left",(e.pageX + yOffset) + "px")
.fadeIn('fast');
},function(){
this.title = this.t;
$("#zoomcapa").remove();
});
$("*[title]").mousemove(function(e){
$("#zoomcapa")
.css("top",(e.pageY - xOffset) + "px")
.css("left",(e.pageX + yOffset) + "px");
});
});

/* TRATATAMENTO DE ACENTUAÇÃO PARA BUSCA */
bsctest = function(obj, path){
  url = 'http://vocesa.abril.com.br/busca/busca.shtml';
  dest = escape(obj.qu.value);
  location.href = url + "?qu=" + dest
return false
}

/* BARRA DE COMPARTILHAMENTO */
function barra_share(url,titulo,resumo) {
var html_exe = "", imagem="";
url = encodeURIComponent(url);

html_exe += "<ul id=\"icones-barra-share\">";

//comando de imprimir a pagina
html_exe += "<li class=\"icone-impressora\">";
html_exe += "<img src=\"../../../css/img/print.png\" onclick=\"window.print();\" class=\"cursor-link\" alt=\"Imprimir\" title=\"Imprimir\" />";
html_exe += "</li>";

//descola a barra de rolagem até os comentários
html_exe += "<li class=\"icone-comentarios\">";
html_exe += "<img src=\"../../../css/img/comment.png\" onclick=\"salta_comentarios(900)\" class=\"cursor-link\" alt=\"Comentários\" title=\"Comentários\" />";
html_exe += "</li>";

/*
html_exe += "<li class=\"icone-facebook\">";
html_exe += "<iframe src=\"http://www.facebook.com/plugins/like.php?href="+url+"&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;action=like&amp;font=trebuchet+ms&amp;colorscheme=light&amp;height=20\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:90px; height:20px;\" allowTransparency=\"true\"></iframe>";
html_exe += "</li>";

html_exe += "<li class=\"icone-facebook-enviar\">";
html_exe += "<div class=\"fb-send\" data-href=\""+url+"\" data-font=\"trebuchet ms\"></div>";
html_exe += "<div id=\"fb-root\"></div>";
html_exe += "<script>(function(d, s, id) {";
html_exe += "  var js, fjs = d.getElementsByTagName(s)[0];";
html_exe += "  if (d.getElementById(id)) {return;}";
html_exe += "  js = d.createElement(s); js.id = id;";
html_exe += "  js.src = \"//connect.facebook.net/pt_BR/all.js#xfbml=1\";";
html_exe += "  fjs.parentNode.insertBefore(js, fjs);";
html_exe += "}(document, 'script', 'facebook-jssdk'));</script>";
html_exe += "</li>";
*/

//facebook like send
html_exe += "<li class=\"icone-facebook-like-send\">";
html_exe += "<div class=\"fb-like\" data-send=\"true\" data-layout=\"button_count\" data-width=\"460\" data-show-faces=\"false\" data-font=\"trebuchet ms\" data-action=\"recommend\"></div>";
html_exe += "<div id=\"fb-root\"></div>";
html_exe += "<script>(function(d, s, id) {";
html_exe += "  var js, fjs = d.getElementsByTagName(s)[0];";
html_exe += "  if (d.getElementById(id)) {return;}";
html_exe += "  js = d.createElement(s); js.id = id;";
html_exe += "  js.src = \"//connect.facebook.net/pt_BR/all.js#xfbml=1\";";
html_exe += "  fjs.parentNode.insertBefore(js, fjs);";
html_exe += "}(document, 'script', 'facebook-jssdk'));</script>";
html_exe += "</li>";

//google plus 1
html_exe += "<li class=\"icone-plusone\">"
html_exe += "<g:plusone size=\"medium\" href=\""+url+"\"></g:plusone>";
html_exe += "</li>";

//twitter share
html_exe += "<li class=\"icone-twitter\">";
html_exe += "<a href=\"http://twitter.com/share\" class=\"twitter-share-button\" data-url=\""+url+"\" data-count=\"horizontal\" data-lang=\"pt\" data-via=\"vocesa\">Tweetar</a>";
html_exe += "<script type=\"text/javascript\" src=\"http://platform.twitter.com/widgets.js\"></script>";
html_exe += "</li>";
/*
//twitter follow
html_exe += "<li class=\"icone-twitter-follow\">";
html_exe += "<iframe allowtransparency=\"true\" frameborder=\"0\" scrolling=\"no\" src=\"http://platform.twitter.com/widgets/follow_button.html?screen_name=vocesa&lang=pt&show_count=false\" style=\"width:120px; height:20px;\"></iframe>";
html_exe += "</li>";

//tumblr
html_exe += "<li class=\"icone-tumblr\">";
html_exe += "<span id=\"tumblr_button_abc123\"></span>";
html_exe += "<script type=\"text/javascript\">";
html_exe += "var tumblr_link_url = \""+url+"\";";
html_exe += "var tumblr_link_name = \""+titulo+"\";";
html_exe += "var tumblr_link_description = \""+resumo+"\";";
html_exe += "</script>";
html_exe += "<script type=\"text/javascript\">";
html_exe += "var tumblr_button = document.createElement(\"a\");";
html_exe += "tumblr_button.setAttribute(\"href\", \"http://www.tumblr.com/share/link?url=\" + encodeURIComponent(tumblr_link_url) + \"&name=\" + encodeURIComponent(tumblr_link_name) + \"&description=\" + encodeURIComponent(tumblr_link_description));";
html_exe += "tumblr_button.setAttribute(\"target\", \"_blank\");";
html_exe += "tumblr_button.setAttribute(\"title\", \"Compartilhe no Tumblr\");";
html_exe += "tumblr_button.setAttribute(\"style\", \"display:inline-block; text-indent:-9999px; overflow:hidden; width:20px; height:20px; background:url('http://platform.tumblr.com/v1/share_4.png') top left no-repeat transparent;\");";
html_exe += "tumblr_button.innerHTML = \"Share on Tumblr\";";
html_exe += "document.getElementById(\"tumblr_button_abc123\").appendChild(tumblr_button);";
html_exe += "</script>";
html_exe += "</li>";
*/
//orkut
html_exe += "<li class=\"icone-orkut\">";
html_exe += "	<div id=\"orkut_share\" style=\"width:100%;\"></div>";
html_exe += "	<script type=\"text/javascript\">";
html_exe += "	google.load('orkut.share', '1');";
html_exe += "	google.setOnLoadCallback(function(){new google.orkut.share.Button({style:'mini',";
html_exe += "	title:'"+titulo+"',";
html_exe += "	summary:'"+resumo+"',";
html_exe += "	thumbnail:'"+imagem+"',";
html_exe += "	destination:'"+url+"'}).draw('orkut_share');}, true);";
html_exe += "	</script>";
html_exe += "</li>";


//linkedin
html_exe += "<li id=\"compartilhe-linkedin\" class=\"icone-linkedin\">";
html_exe += "<script type=\"text/javascript\">";
html_exe += "var oNode=document.createElement(\"script\");";
html_exe += "document.getElementById(\"compartilhe-linkedin\").appendChild(oNode);";
html_exe += "oNode.setAttribute(\"type\", \"IN/Share\", 0);";
html_exe += "oNode.setAttribute(\"data-url\", \""+url+"\", 0);";
html_exe += "oNode.setAttribute(\"data-counter\", \"right\", 0);";
html_exe += "var oNode=document.createElement(\"script\");";
html_exe += "document.getElementById(\"compartilhe-linkedin\").appendChild(oNode);";
html_exe += "oNode.setAttribute(\"type\", \"text/javascript\", 0);";
html_exe += "oNode.setAttribute(\"src\", \"http://platform.linkedin.com/in.js\", 0);";
html_exe += "</script>";
html_exe += "</li>";

html_exe += "</ul>";
$('#barra-share').html(html_exe);

var t=setTimeout("barra_share_rodape()",3000);
}

function barra_share_rodape() {
	if($('#barra-share-rodape').html()=="" && $('#barra-share-rodape').val()=="") {
		$('#barra-share-rodape').html($('#barra-share').clone());
	}
}

/* BARRA DE COMPARTILHAMENTO */
function materias_bs(url,titulo,resumo) {
var html_exe = "", imagem="";
url = encodeURIComponent(url);

html_exe += "<ul id=\"icones-barra-share\">";

//comando de imprimir a pagina
html_exe += "<li class=\"icone-impressora\">";
html_exe += "<img src=\"../../../css/img/print.png\" onclick=\"window.print();\" class=\"cursor-link\" alt=\"Imprimir\" title=\"Imprimir\" />";
html_exe += "</li>";

//descola a barra de rolagem até os comentários
html_exe += "<li class=\"icone-comentarios\">";
html_exe += "<img src=\"../../../css/img/comment.png\" onclick=\"salta_comentarios(900)\" class=\"cursor-link\" alt=\"Comentários\" title=\"Comentários\" />";
html_exe += "</li>";


/*
html_exe += "<li class=\"icone-facebook\">";
html_exe += "<div class=\"fb-like\" data-send=\"false\" data-layout=\"button_count\" data-width=\"460\" data-show-faces=\"false\" data-font=\"trebuchet ms\" data-action=\"like\"></div>";
html_exe += "</li>";

html_exe += "<li class=\"icone-facebook-enviar\">";
html_exe += "<div class=\"fb-send\" data-href=\""+url+"\" data-font=\"trebuchet ms\"></div>";
html_exe += "</li>";
*/

//facebook like send
html_exe += "<li class=\"icone-facebook-like-send\">";
html_exe += "<div class=\"fb-like\" data-send=\"true\" data-layout=\"button_count\" data-width=\"460\" data-show-faces=\"false\" data-font=\"trebuchet ms\" data-action=\"recommend\"></div>";
html_exe += "</li>";

//google plus 1
html_exe += "<li class=\"icone-plusone\">"
html_exe += "<g:plusone size=\"medium\" href=\""+url+"\"></g:plusone>";
html_exe += "</li>";

//twitter share
html_exe += "<li class=\"icone-twitter\">";
html_exe += "<a href=\"http://twitter.com/share\" class=\"twitter-share-button\" data-url=\""+url+"\" data-count=\"horizontal\" data-lang=\"pt\" data-via=\"vocesa\">Tweetar</a>";
html_exe += "<script type=\"text/javascript\" src=\"http://platform.twitter.com/widgets.js\"></script>";
html_exe += "</li>";
/*
//twitter follow
html_exe += "<li class=\"icone-twitter-follow\">";
html_exe += "<iframe allowtransparency=\"true\" frameborder=\"0\" scrolling=\"no\" src=\"http://platform.twitter.com/widgets/follow_button.html?screen_name=vocesa&lang=pt&show_count=false\" style=\"width:120px; height:20px;\"></iframe>";
html_exe += "</li>";

//tumblr
html_exe += "<li class=\"icone-tumblr\">";
html_exe += "<span id=\"tumblr_button_abc123\"></span>";
html_exe += "<script type=\"text/javascript\">";
html_exe += "var tumblr_link_url = \""+url+"\";";
html_exe += "var tumblr_link_name = \""+titulo+"\";";
html_exe += "var tumblr_link_description = \""+resumo+"\";";
html_exe += "</script>";
html_exe += "<script type=\"text/javascript\">";
html_exe += "var tumblr_button = document.createElement(\"a\");";
html_exe += "tumblr_button.setAttribute(\"href\", \"http://www.tumblr.com/share/link?url=\" + encodeURIComponent(tumblr_link_url) + \"&name=\" + encodeURIComponent(tumblr_link_name) + \"&description=\" + encodeURIComponent(tumblr_link_description));";
html_exe += "tumblr_button.setAttribute(\"target\", \"_blank\");";
html_exe += "tumblr_button.setAttribute(\"title\", \"Compartilhe no Tumblr\");";
html_exe += "tumblr_button.setAttribute(\"style\", \"display:inline-block; text-indent:-9999px; overflow:hidden; width:20px; height:20px; background:url('http://platform.tumblr.com/v1/share_4.png') top left no-repeat transparent;\");";
html_exe += "tumblr_button.innerHTML = \"Share on Tumblr\";";
html_exe += "document.getElementById(\"tumblr_button_abc123\").appendChild(tumblr_button);";
html_exe += "</script>";
html_exe += "</li>";
*/
//orkut
html_exe += "<li class=\"icone-orkut\" data-id=\"orkut_share\">";
html_exe += "	<div id=\"orkut_share\" style=\"width:100%;\"></div>";
html_exe += "</li>";


//linkedin
html_exe += "<li id=\"compartilhe-linkedin\" class=\"icone-linkedin\">";
html_exe += "<script type=\"IN/Share\" data-url=\""+url+"\" data-counter=\"right\"></script>";
html_exe += "</li>";

html_exe += "</ul>";
$('#barra-share').html(html_exe);

var t=setTimeout("barra_share_rodape()",3000);
}

function publicidade_oculta() {
	$('[id^="publicidade"]').each(function(){
	  $(this).addClass('publicidade-oculta');
	})
}

function publicidade_exibe() {
	$('[id^="publicidade"]').each(function(){
	  $(this).removeClass('publicidade-oculta');
	})
}

