$(document).ready(function(){
	
	// Flash
	/*$('#header').flash({
	    src: '_swf/header.swf',
	    width: 970,
	    height: 187,
		wmode: 'transparent'
	});	*/
	
	//COMPORTAMENTO MENU PRODUTOS
	$('#list-prods li a').click(function(){		
		$('#list-prods li a').removeClass('active_prod');
		$(this).addClass('active_prod');
	});
	
	 $(document).pngFix();
	
	$('#table_access tr').mouseover(function(){		
		$(this).addClass('act');		
	});
	$('#table_access tr').mouseout(function(){		
		$(this).removeClass('act');		
	});
	$('#table_access tr').click(function(){	
		var url = $(this).attr('rel');
		$(this).children('a').attr('href',url);
		$('#table_access tr').removeClass('act2');
		$(this).addClass('act2');	
	});	
	
	// SCROOLL TO: MENU PRODUTOS
	var $pane4 = $('#content');
	$pane4.jScrollPane({animateTo:true});
	$('a.scroll-to').bind(
		'click',
		function()
		{
			var targetElementSelectorString = $(this).attr('rel');
			$pane4[0].scrollTo(targetElementSelectorString);
			return false;
		}
	);		
	
	var $pane5 = $('#forum');
	$pane5.jScrollPane({animateTo:true});
	$('a.scroll-to').bind(
		'click',
		function()
		{
			var targetElementSelectorString = $(this).attr('rel');
			$pane4[0].scrollTo(targetElementSelectorString);
			return false;
		}
	);		
	
	$('.list-not').jScrollPane({showArrows:true, animateTo: true, animateInterval: 10, animateStep: 3 });		
	$('.list-topic').jScrollPane({showArrows:true, animateTo: true, animateInterval: 10, animateStep: 3 });		
	

	
	//VALIDAÇÃO FORMULARIO ÁREA DO RESTRITA
	$('#form_area').bind('submit',function(){
		
		var erro = '';
		if(!$('#usuario').val())
		{			
			erro++;
			$('#usuario').css({border:' 1px solid red'});
		}
		else
		{
			$('#usuario').css({border:' 1px solid #a5acb2'});
		}
		if(!$('#senha').val())
		{
			$('#senha').css({border:'1px solid red'});
			erro++
		}
		else
		{
			$('#senha').css({border:'1px solid #a5acb2'});
		}
		
		if(erro)
		{
			$('#alert').html('Informe os campos destacados.');
			return false;
		}
		
	});
	
	//VALIDAÇÃO FORMULARIO ÁREA DO RESTRITA
	$('#suport').bind('submit',function(){
		
		var erro = '';
		if(!$('#nome').val())
		{			
			erro++;
			$('#nome').css({border:' 1px solid red'});
		}
		else
		{
			$('#nome').css({border:' 1px solid #a5acb2'});
		}
		if(!$('#email').val())
		{			
			erro++;
			$('#email').css({border:' 1px solid red'});
		}	
		else{
			$('#email').css({border:' 1px solid #a5acb2'});
		}
		if(!$('#mensagem').val())
		{			
			erro++;
			$('#mensagem').css({border:' 1px solid red'});
		}	
		else{
			$('#mensagem').css({border:' 1px solid #a5acb2'});
		}			
		if(erro)
		{
			$('#alert').html('Informe os campos destacados.');
			return false;
		}
		
	});	
	
/*
	// SCROLLBAR AREA PRODUTOS	
	$('#content').jScrollPane({showArrows:true, animateTo: true, animateInterval: 10, animateStep: 3 });
	$('.listaProdutos a').click(function(){
		var destinationSelector = $(this).attr('href');
		$('#content h2').each(function(){
			this.scrollTo(destinationSelector);
		});
		//return false;
	});
	
	// SCROLLBAR NOTICIAS
	$('#content').jScrollPane({showArrows:true, animateTo: true, animateInterval: 10, animateStep: 3 });
	$('.list-not a').click(function(){
		var destinationSelector = $(this).attr('href');
		$('#content p').each(function(){
			this.scrollTo(destinationSelector);
		});
		//return false;
	});*/
	
	// SCROLLBAR AREA PRODUTOS	
	/*$('.listaProdutos').jScrollPane({showArrows:true, animateTo: true, animateInterval: 10, animateStep: 3 });
	$('.listaProdutos a').click(function(){
		var destinationSelector = $(this).attr('href');
		$('#content').each(function(){
			this.scrollTo(destinationSelector);
		});
		//return false;
	});
	
	// SCROLLBAR NOTICIAS
	$('.list-not').jScrollPane({showArrows:true, animateTo: true, animateInterval: 10, animateStep: 3 });
	$('#content a').click(function(){
		var destinationSelector = $(this).attr('href');
		$('#content').each(function(){
			this.scrollTo(destinationSelector);
		});
		//return false;
	});
	
	// anmima div com o conteudo
	var $pane4 = $('#content');
	$pane4.jScrollPane({animateTo:true});	
	
	
	$('#content').jScrollPane({ showArrows:true, animateTo: true, animateInterval: 10, animateStep: 3 });
	$('#list-prods a').click(function(){
		var destinationSelector = $(this).attr('href');
		$('#content').each(function(){
			this.scrollTo(destinationSelector);
		});
		//return false;
	});
	
		$('a.scroll-to-element-demo').bind(
		'click',
		function()
		{
			var targetElementSelectorString = $(this).attr('rel');
			$pane4[0].scrollTo(targetElementSelectorString);
			return false;
		}
	);	*/
	
	
	

	
});	