function loadLoginBox(url,came_from) {
//url = "http://pcworld.uol.com.br";
nome = readCookie('nome');
if (nome != null){
    html = '<a>Ol&aacute;, '+nome+'!</a>';
    html = html + ' <a rel="nofollow" href="'+url+'/logout" title="Logout">Logout</a> <a rel="nofollow" href="'+url+'/central_newsletter" title="Newsletter">Newsletter</a>';
}
else{
    html = '<a rel="nofollow" href="'+url+'/login_form?'+came_from+'" title="Login">Login</a> <a rel="nofollow" href="'+url+'/central_newsletter?cadastro_novo" title="Registro">Registro</a> <a rel="nofollow" href="'+url+'/login_form?came_from='+url+'/central_newsletter" title="Newsletter">Newsletter</a>';
}
document.getElementById('portal-login').innerHTML = html;
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return unescape(c.substring(nameEQ.length,c.length).replace(/"/g, ''));
	}
	return null;
}