

/* -------------------------------------------------- */
/* SOURCE CODE                                        */
/* -------------------------------------------------- */

$().ready(function() {
/* -------------------------------------------------- */
/* home                                               */
/* -------------------------------------------------- */
	if ($("#banner").length > 0)
	{
		$("#slide").easySlider({
			auto: true,
			continuous: true,
			numeric: true
		});

		// Inicia a exibi��o das manchetes
		slideShow(5000);

		// Pr�xima manchete
		$('#btn-next').click(function () {
			gallery(0);
			return false;
		});

		// Manchete anterior
		$('#btn-prev').click(function () {
			gallery(1);
			return false;
		});
	}
/* -------------------------------------------------- */
/* extensao                                           */
/* -------------------------------------------------- */
	if ($("#extensao").length > 0)
	{
		// Inicia a exibi��o das manchetes
		slideShow(5000);

		// Pr�xima manchete
		$('#btn-next').click(function () {
			gallery(0);
			return false;
		});

		// Manchete anterior
		$('#btn-prev').click(function () {
			gallery(1);
			return false;
		});
	}
/* -------------------------------------------------- */
/* graduacao                                          */
/* -------------------------------------------------- */
	if ($("#graduacao").length > 0)
	{
		// Inicia a exibi��o das manchetes
		slideShow(5000);

		// Próxima manchete
		$('#btn-next').click(function () {
			gallery(0);
			return false;
		});

		// Manchete anterior
		$('#btn-prev').click(function () {
			gallery(1);
			return false;
		});

		// Cursos por área
		$('ul.cursos-por-area li a').click(function () {
			// Pega o nome da área clicada
			area = $(this).attr('href').slice(1);

			// Carrega a listagem de cursos da área
			$.get("/portal/system/modules/br.unitoledo/elementos/include_cursos_graduacao.jsp", { area: area }, function(data) {
				$('.box.curso').html(data);
			});
		});

		// Curso
		$('ul.cursos li a').live('click', function () {
			// Pega o nome da área clicada
			curso = $(this).attr('href').slice(1);

			// Carrega a listagem de cursos da área
			$.get("/portal/system/modules/br.unitoledo/elementos/include_cursos_graduacao_detalhes.jsp", { curso: curso }, function(data) {
				$('.box.curso').html(data);
			});
		});		
		
	}
/* -------------------------------------------------- */
/* noticias                                           */
/* -------------------------------------------------- */
	if ($("#noticias").length > 0)
	{
		$(".noticias-destaques ul li a").mouseover(function(){
			// Acha o nome da noticia
			noticia = $(this).parent().attr("class").split(" ");
			noticia = noticia[0];
			// Oculta todas as not�cias
			$(".noticia ul li").css("display", "none");
			// Mostra a not�cia selecionada
			$(".noticia ul li." + noticia).css("display", "block");
		});
	}
/* -------------------------------------------------- */
/* pesquisa                                           */
/* -------------------------------------------------- */
	if ($("#pesquisa").length > 0)
	{
		// Inicia a exibi��o das manchetes
		slideShow(5000);

		// Pr�xima manchete
		$('#btn-next').click(function () {
			gallery(0);
			return false;
		});

		// Manchete anterior
		$('#btn-prev').click(function () {
			gallery(1);
			return false;
		});
	}
/* -------------------------------------------------- */
/* posgraduacao                                       */
/* -------------------------------------------------- */
	if ($("#posgraduacao").length > 0)
	{
		// Inicia a exibi��o das manchetes
		slideShow(5000);

		// Pr�xima manchete
		$('#btn-next').click(function () {
			gallery(0);
			return false;
		});

		// Manchete anterior
		$('#btn-prev').click(function () {
			gallery(1);
			return false;
		});

		// Cursos por �rea
		$('ul.cursos-por-area li a').click(function () {
			// Pega o nome da �rea clicada
			area = $(this).attr('href').slice(1);

			// Carrega a listagem de cursos da �rea
			$.get("/portal/system/modules/br.unitoledo/elementos/ajax_cursos_pos.jsp", { area: area }, function(data) {
				$('.box.curso').html(data);
			});
		});

		// Curso
		$('ul.cursos li a').live('click', function () {
			// Pega o nome da �rea clicada
			curso = $(this).attr('href').slice(1);

			// Carrega a listagem de cursos da �rea
			$.get("/portal/system/modules/br.unitoledo/elementos/ajax_cursos_pos_detalhes.jsp", { curso: curso }, function(data) {
				$('.box.curso').html(data);
			});
		});
	}
/* -------------------------------------------------- */
});
