function professores(address){
    $("#mostrarProf").load(address);
}

function getdinamicContent(address,titulo){
    $("#titulo h2").html(titulo);
    $("#dinamicContentPituba").load(address);
}

function insertDinamicContent(address,titulo,div){
    $("#titulo").html(titulo);
    $(div).load(address);
}

function galeria(address){
    $("#dinamicContent").load(address);
}

/*
function pager(start){
    //$("#galleryPager").load(address);
    $.ajax({
        type: "GET",
        url: "eventos/pag.php",
        data: "start="+start,
        success: function(msg){
            $("#galleryPager").html(msg);
        }
    });
}*/
function pager(address){
    $("#galleryPager").load(address);
}

function openGallery(year,gallery){
    $("#dinamicContent").load("eventos/"+year+"/"+gallery+"/galeria.php");
}

function testandoGaleria(eve_in_codigo, ste_st_url, img_st_diretorio){
    $.ajax({
        type: "GET",
        url: "eventos/noticias.php",
        data: "eve_in_codigo="+eve_in_codigo+"&ste_st_url="+ste_st_url+"&img_st_diretorio="+img_st_diretorio,
        success: function(msg){
            $("#dinamicContent").html(msg);
        }
    });
}


/*      RECEBE AS VARIAVEIS PASSADAS VIA GET DA INDEX DO PORTAL E EFETUA A REQUISIÇÃO ABRINDO O EVENTO      */
$(document).ready(function() {
    function getUrlVars()
    {
        var vars = [], hash;
        var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');

        for(var i = 0; i < hashes.length; i++)
        {
            hash = hashes[i].split('=');
            hash[1] = unescape(hash[1]);
            vars.push(hash[0]);
            vars[hash[0]] = hash[1];
        }

        return vars;
    }

    var pedaco = getUrlVars();

    /*if(pedaco['y'] != undefined && pedaco['g'] != undefined){
        $("#dinamicContent").load("eventos/"+pedaco['y']+"/"+pedaco['g']+"/galeria.php");
    }*/
    if(pedaco['eve_in_codigo'] != undefined && pedaco['ste_st_url'] != undefined && pedaco['img_st_diretorio'] != undefined){
        $.ajax({
            type: "GET",
            url: "eventos/galeria.php",
            data: "eve_in_codigo="+pedaco['eve_in_codigo']+"&ste_st_url="+pedaco['ste_st_url']+"&img_st_diretorio="+pedaco['img_st_diretorio'],
            success: function(msg){
                $("#dinamicContent").html(msg);
            }
        });
    }
});
