$(document).ready(function(){
	//<!-- ICON SOCIALNETWORKS -->
	$("#facebookicon , #twittericon").mouseover(function(){$(this).stop().animate({ left: 930 }, 'fast');});
	$("#facebookicon, #twittericon").mouseout(function(){$(this).stop().animate({ left: 910 }, 'fast');});
	
	//<!-- CORNER -->
	$('#dica').corner("rounded 5px");$('.dataitembg').corner("rounded 9px");$('.btnveralbum').corner("rounded 9px");
	
	//<!-- COIN-SLIDER -->
        $('slideshow_home').coinslider({ width: 696, height: 225, navigation: false, delay: 3000 });

	
	//<!-- SLIDEPROMO -->
	$('#slidepromo').coinslider({ width: 235, height: 175,  navigation: false, delay: 5000 });
//<!-- SLIDEPROMO -->
	$('#slideshowsidebar').coinslider({ width: 230, height: 125,  navigation: false, delay: 5000 });





	$(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'slow',theme:'light_square',slideshow:2000, autoplay_slideshow: true});
			$(".gallery:gt(0) a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'fast',slideshow:10000});
			
			$("#custom_content a[rel^='prettyPhoto']:first").prettyPhoto({
				custom_markup: '<div id="map_canvas" style="width:260px; height:265px"></div>',
				changepicturecallback: function(){ initialize(); }
			});

			$("#custom_content a[rel^='prettyPhoto']:last").prettyPhoto({
				custom_markup: '<div id="bsap_1237859" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6" style="height:260px"></div><div id="bsap_1251710" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6"></div>',
				changepicturecallback: function(){ _bsap.exec(); }
			});

	//<!-- NAV | ACCORDION -->	
	var atual = window.location.search.split("?");
	if (atual.length == 1)
		atual = "#nav-oinstituto";
	else
	{
		atual = atual[1].split("=");
		atual = atual[1];
		if (atual =="institucional"
		||	atual =="equipe"
			||	atual =="equipe-diretoria"
			||	atual =="equipe-colaboradores"
			||	atual =="equipe-professores"
			||	atual =="equipe-assessores"
		||	atual =="cursos"
		||	atual =="noticias"
		||	atual =="informativos"
		||	atual =="livros indicados"
		||	atual =="formasdepagamento"
		||	atual =="consultoriasepalestras"
		||	atual =="galeria"
		||	atual =="noticiasler	"
		||	atual =="contato")
			atual = "#nav-oinstituto";
			else
				if (atual == "sobreocarlosandre"
				||	atual == "livrosdoprofessor"
				||	atual == "artigosdoprofessor"
				||	atual == "artigos"
					||	atual == "artigos&idartigo"
				||	atual == "galeria")
					atual = "#nav-oprofessor";
				else
					if (atual == "cursos_concursos"
					||	atual == "cursos_atualizacao"
					||	atual == "cursos_vestibulares"
					||	atual == "cursos_raciociniologico"
					||	atual == "cursos_portugues_para_advogados"
					||  atual == "cursos_cursodeferias")
						atual = "#nav-cursos";
				
					else
						if (atual == "aluno/login"
						||	atual == "aluno/arquivos"
						||	atual == "aluno/resgatarsenha")
							atual = "#nav-meumenu";
	}
	
	$('#menu').css('height', 'auto');
	$('#menu ul').hide();
	$('#menu h3').removeClass("corrente");
	$(atual).addClass("corrente").next("ul").show();
	$('#menu h3').click(function(){
		$('#menu h3').removeClass("corrente");
		var top = $(document.body).scrollTop();
		var $ul = $(this).toggleClass("corrente").next();
		var diferenca = $ul.slideToggle(1000).siblings('ul:visible').slideUp(600).height();
		
		if ($.browser.msie)
			$("html").animate({scrollTop:top-diferenca},600);
		else
			$(document.body).animate({scrollTop:top-diferenca},600);
	});
});

// GALLERY - CYCLE ( JSORGALLA )
function mycarousel_initCallback(carousel)
{
// Disable autoscrolling if the user clicks the prev or next button.
carousel.buttonNext.bind('click', function() {carousel.startAuto(0);});
carousel.buttonPrev.bind('click', function() {carousel.startAuto(0);});
// Pause autoscrolling if the user moves with the cursor over the clip.
carousel.clip.hover(function() {carousel.stopAuto();}, function() {carousel.startAuto();});};jQuery(document).ready(function() {
jQuery('#mycarousel').jcarousel({auto: 60,wrap: 'last',initCallback: mycarousel_initCallback});
});


$(document).ready(function(){

	$("#naviconsfooter ul:last").css("marginRight","0");
	$("a[rel^='prettyPhoto']").prettyPhoto();
});
