﻿/// <reference path="includes/jquery.intelisense.js" />
$(document).ready(function() {
    inicioNoticia();
});

function inicioNoticia() {
    carregarNoticias();
}


function carregarNoticias() {
    WebService("ws/wsNoticia.asmx/listarNoticia", listarNoticia_CallBack);
}
function listarNoticia_CallBack(json) {
    var strGrid = "";
    if (json.length > 0) {
        $(json).each(function() {
            strGrid += "<li><a href='http://www3.unip.br/comunicacao/exibe_noticia.asp?id=" + this.codigo + "' target='_blank'>" + this.titulo + "</a></li>";
        });
    }
    $("#listaNoticias").html(strGrid);
}

function formataDataAgenda(data) {
    dt = data.split(" ");
    hora = dt[1].substring(0, 5);
    arrHora = hora.split(":");
    minuto = arrHora[1];

    if (minuto == "00")
        horaExibir = arrHora[0]
    else
        horaExibir = hora;
    return dt[0] + " - " + horaExibir + "h";
}
