﻿String.prototype.replaceAll = function(needed, replacement){ 
	return this.split(needed).join(replacement); 
};

function Class(){};
function ComponentesClass(){
	this.montarBannerX5 = function (editoria, subeditoria, idPagina, target){
		OAS_AD('x05');
	};
};
var Componentes = new ComponentesClass();

function showUltimasFotos(){
	$.get( urlUltimasFotos, function( data ){
		$("#ultimasFotos .ultimasCorpo").html( data + '<div class="clear"><hr /></div>');
	});
};

function showTags(){
	$("#abaUT #abaCorpoUltimas").hide("fast");
	$("#abaUT #abaCorpoTags").show("fast");
	$("#abaUT .header UL LI A").removeClass("selected");
	$("#abaUT .header #abaTags").addClass("selected");
};

function showTotalComentarios(qtde, url){
	$("#totComentManchete").html("");
	if (qtde > 0){
		$("#totComentManchete").attr({
			href: url,
			title: qtde + " Comentários"
		});
		$("#totComentManchete").text(qtde);
		$("#totComentManchete").addClass("totComentManchete");
	}else{
		$("#totComentManchete").attr({
			href: url,
			title: "Comente"
		});
		$("#totComentManchete").text("");
		$("#totComentManchete").addClass("totComentarManchete");
	}
};

function showUltimas(){
	$("#abaUT #abaCorpoTags").hide("fast");
	$("#abaUT #abaCorpoUltimas").show("fast");
	$("#abaUT .header UL LI A").removeClass("selected");
	$("#abaUT .header #abaUltimas").addClass("selected");
};

$(document).ready( function(){
	$("a").bind("focus", function(){ this.blur(); });
	
	if(Cookies.get('PORTAL_AUTH')){
		$("#linkLogin a").attr("href", "javascript: void(0)").bind("click",function(){
			Cookies.remove('PORTAL_AUTH', null, '/', '.estadao.com.br');
			document.location.reload();
		}).children('img').attr("src", "/img/topbar/bt_logoff.gif");
	}else{
		$("#linkLogin a").unbind("click").attr("href", "http://www.estadao.com.br/interatividade/ME/home.action").children("img").attr("src", "/img/topbar/bt_login.gif");
	};
});