var t;
function timeMsg(){
	t=setTimeout("alertMsg()",500);
}
function alertMsg(){
	$(".caixa").fadeOut();	
}
function stopTimer(){
	clearTimeout(t);	
}

$(function() {
	$('.scroll-pane').jScrollPane(
		{
			autoReinitialise: true
		}
	);		   

	if(menuGeral == true){
		$(".drop").mouseover(function(){
			var index = $(".drop").index(this);	
			
			$(".caixa").hide();	
			
			if($(".caixa").eq(index).is(":hidden")){
				$(".caixa").eq(index).fadeIn();		
			}
			stopTimer();
		});	
		$(".drop").mouseout(function(){
			var index = $(".drop").index(this);	
			
			$(".caixa").hide();	
			
			if($(".caixa").eq(index).is(":hidden")){
				$(".caixa").eq(index).show();		
			}							 
			timeMsg();						 
		});		
		
		$(".caixa, .caixa p, .caixa p a, .caixa ul").mouseover(function(){
			stopTimer();
			var index = $(".drop").index(this);	
			
			$(".caixa").ep(index).show();	
					  
		});		
		$(".caixa").mouseout(function(){
			timeMsg();
		});		
	}
	
	
	$('#slide').cycle({
		fx:'fade',
		speed:  1000,
		timeout: 4000,
		next: '#next', 
		prev: '#prev'
		//pagerEvent: 'mouseover'
	});
	$('#pause').show();
	$('#play').hide();	
	$('#pause').click(function() {
		$('#slide').cycle('pause');
		$('#pause').hide();
		$('#play').show();
	});
	$('#play').click(function() {
		$('#slide').cycle('resume');
		$('#pause').show();
		$('#play').hide();		
	});	
	
	$('.c-slide div:first').removeClass('gradient')
	$('.c-slide div:first').addClass('gradient');
	
	
});


  
