function search() { document.location = 'http://hsinvestimentos.com.br/institutoleo/index.php/portal/busca/'+$("#search_text").val(); } function search2() { document.location = 'http://hsinvestimentos.com.br/institutoleo/index.php/portal/busca/'+$("#search_text2").val(); } // CONTA DO TWEETER var tweetUsers = ['institutoleo']; var buildString = ""; $(document).ready(function() { var get_arr = $("#array_days").html(); var dateList = get_arr.split(","); if($("#ini_date").html() != "0") { loadContent('http://hsinvestimentos.com.br/institutoleo/index.php/portal/conteudo_agenda/'+$("#ini_date").html()); } $("a[rel='photos_gallery']").colorbox({transition:"fade", opacity:.5}); $("a[rel='video_gallery']").colorbox({transition:"fade", opacity:.5, iframe:true, innerWidth:425, innerHeight:244}); $("#calendar").datepicker({ //ADICIONAMOS A FUNÇÃO PELO ID DO CONTAINER beforeShowDay: function(dateToShow) { return [($.inArray($.datepicker.formatDate('yymmdd', dateToShow),dateList) >= 0), ""]; //FORMATA A DATA A E PEGA OS DIAS A SEREM MOSTRADOS }, onSelect: function(dateText, inst) { if($.inArray(dateText,dateList)) //ADICIONA UMA AÇÃO AO DIA { var formatDate = dateText.split("/").join("_"); document.location = 'http://hsinvestimentos.com.br/institutoleo/index.php/portal/agenda/'+formatDate; } } }); for(var i=0;i


carregando..."); $("#content").load(urlHtml); } function votar() { $.post("http://hsinvestimentos.com.br/institutoleo/index.php/portal/compute_vote", { value:$("input[@name='vodeButton']:checked").val() }, function(data){ if(data == "true") { alert("Voto processado."); }else{ alert("Erro ao votar"); } }); } function cadastra_email() { $.post("http://hsinvestimentos.com.br/institutoleo/index.php/portal/cadastra_email", { email:$("#email_newsletter").val() }, function(data){ if(data == "true") { $("#email_newsletter").val(""); alert("Email cadastrado."); }else{ alert("Erro ao cadastrar"); } }); } function TweetTick(ob) { var i = 0; var max = 7; var container=$('#tweet-container'); container.html(''); $(ob.results).each(function(el){ if( i != max ) { var str = '
\
'+this.from_user+'
\
'+formatTwitString(this.text)+'
\
'; container.append(str); i++; } }); container.jScrollPane(); } function formatTwitString(str) { str=' '+str; str = str.replace(/((ftp|https?):\/\/([-\w\.]+)+(:\d+)?(\/([\w/_\.]*(\?\S+)?)?)?)/gm,'$1'); str = str.replace(/([^\w])\@([\w\-]+)/gm,'$1@$2'); str = str.replace(/([^\w])\#([\w\-]+)/gm,'$1#$2'); return str; } function relativeTime(pastTime) { var origStamp = Date.parse(pastTime); var curDate = new Date(); var currentStamp = curDate.getTime(); var difference = parseInt((currentStamp - origStamp)/1000); if(difference < 0) return false; if(difference <= 5) return "Just now"; if(difference <= 20) return "Seconds ago"; if(difference <= 60) return "A minute ago"; if(difference < 3600) return parseInt(difference/60)+" minutes ago"; if(difference <= 1.5*3600) return "One hour ago"; if(difference < 23.5*3600) return Math.round(difference/3600)+" hours ago"; if(difference < 1.5*24*3600) return "One day ago"; var dateArr = pastTime.split(' '); return dateArr[4].replace(/\:\d+$/,'')+' '+dateArr[2]+' '+dateArr[1]+(dateArr[3]!=curDate.getFullYear()?' '+dateArr[3]:''); } function getDivTwitter( text) { var output = ''; output += '
'; output += '
kk
'; output += '
jkjkjfhskjdhfksj jkj sfklklfks sdfklklksdf sfsdklk lkmlfsd dhfkjsdhfjshdfksjd
'; output += '
'; } $(document).ready( function() { if($("#form_share_content")) { $("#form_share_content").validate({ // Define as regras rules:{ nome:{ required: true, minlength: 3 }, email:{ required: true, minlength: 3, email:true }, email_amigo:{ required: true, minlength: 3, email:true } } }); } }); function share_content() { if($("#form_share_content")) { if($("#form_share_content").valid()) { var currentURL = $('#base_url', window.parent.document).html(); $.post("http://hsinvestimentos.com.br/institutoleo/index.php/portal/share_content", {nome:$("#nome").val(), email:$("#email").val(), email_amigo:$("#email_amigo").val(), url:currentURL }, function(data){ if(data == "true") { document.getElementById('form_share_content').reset(); alert('E-mail enviado.'); }else{ alert('Erro ao enviar o e-mail.'); } }); } } }