<!--

$(document).ready(function(){

	//Abas
	$("ul.tabs li").click(function() {

		$("ul.tabs li").removeClass("active");
		$(this).addClass("active");
		$(".tab_content").hide();

		var activeTab = $(this).find("a").attr("href");
		$(activeTab).fadeIn();
		return false;
		
	});

	$(".table").find("tr:odd").css("background-color", "#EAEAEA");
	
	(function ($) {
		
		$.selecionaOption = function(id, value) {			
			var NumOptions = $(id + ' > option');			
			for (var i=0; i < NumOptions.length; i++) {														
				var option = NumOptions.eq(i);				
				if (option.attr('value') == value)
					option.attr('selected', 'selected');
				else 
					option.removeAttr('selected');																				
			}				
		}
		
	})(jQuery);
	
	$('.inp_pvir').blur(function(){
		$(this).val($(this).val().replace(',','.'));
	});
	
	
	$('#a_top_msg').click(function(){ $(this).hide(); });
	
	$('.btn_excluir').click(function(){
		if (!confirm('Realmente deseja excluir?')) return false;
	});
	
	$('.btn_ctza').click(function(){
		if (!confirm('Realmente esta certo disso?')) return false;
	});
	
	$('#form_log').submit(function(e){
		if ($('#inp_user').val() == '' || $('#inp_pass').val() == '') {
			e.preventDefault();
			alert('Preencha corretamente os campos.');
		}							   
	});
	
	(function ($) {		
		$.loading = function(liga) {			
			if (liga) $('#loading').show();
			else $('#loading').hide();			
		}		
	})(jQuery);
	
	$('#btn_search').click(function(){
		
		$(this).hide();
		$('#searchbox').show();
		
	});
		
	$('#bnt_cli_fav').change(function(){
		location.href  = 'pgg.php?tg=5&g_id=' + $(this).val();		
	});
	
	$('#bnt_menu_nav').change(function(){
		if ($(this).val() != '0') location.href  = $(this).val();
		else return false;
	});
	
	$('#menu_fav_os').change(function(){
		if ($(this).val() != '0') location.href  = 'pgg.php?tg=4&os_id=' + $(this).val();
		else return false;
	});
		
});

//-->


