//jQuery.noConflict();

//jQuery(function(){

//	//PREENCHIMENTO AUTOMÁTICO DE DATAS
//	jQuery.fn.dateAutoFill();
//	
//	//PESQUISA - Outra rendibiliadade
//	if(jQuery("select[name=rendibilidade]").val()!='outra') jQuery("div.outra").hide();
//	jQuery("select[name=rendibilidade]").change(function(){
//		if(jQuery(this).val()=='outra') jQuery("div.outra").fadeIn('normal');
//		else jQuery("div.outra").fadeOut('fast');
//	});

//	/* PESQUISA QUADRO RENDIBILIDADES */
//	jQuery("form[name='filtro_quadro_rendibilidades']").find(".fundos_tipo, .valor").hide();
//	jQuery("form[name='filtro_quadro_rendibilidades']").find("input[name='fundos_tipo']").change(function(){
//		jQuery(".fundos_tipo").hide();
//		jQuery("."+$(this).val()).show();
//	});
//	jQuery("form[name='filtro_quadro_rendibilidades']").find("select[name='fundos_rendibilidade'], select[name='fundos_risco']").change(function(){
//		if(jQuery(this).val()=="escolher") jQuery(".valor").show();
//		else jQuery(".valor").hide();
//	});

//});

jQuery.noConflict();

jQuery(function(){

	//PREENCHIMENTO AUTOMÁTICO DE DATAS
	jQuery.fn.dateAutoFill();
	
	//PESQUISA - Outra rendibiliadade
	if(jQuery("select[name=rendibilidade]").val()!='outra') jQuery("div.outra").hide();
	jQuery("select[name=rendibilidade]").change(function(){
		if(jQuery(this).val()=='outra') jQuery("div.outra").fadeIn('normal');
		else jQuery("div.outra").fadeOut('fast');
	});

	/* PESQUISA QUADRO RENDIBILIDADES */
	//jQuery("form[name='filtro_quadro_rendibilidades']")
	jQuery("form[name='" + document.forms[0].name + "']").find(".fundos_tipo, .valor").hide();
	jQuery("form[name='" + document.forms[0].name + "']").find("input[ClientID='fundos_tipo']").click(function(){
		jQuery(".fundos_tipo").hide();
		jQuery("."+jQuery(this).val()).show();
		if (jQuery("select[ClientID='fundos_"+jQuery(this).val()+"']").val()=="escolher")
		    jQuery(".valor").show();
		else 
		    jQuery(".valor").hide();	    
	});
	jQuery("form[name='" + document.forms[0].name + "']").find("select[ClientID='fundos_rendibilidade'], select[ClientID='fundos_risco']").change(function(){
		if(jQuery(this).val()=="escolher") 
		    jQuery(".valor").show();
		else 
		    jQuery(".valor").hide();
	});
	
	jQuery("div." + jQuery("input[ClientID='fundos_tipo']:checked").val()).show();
	
	if(jQuery("select[ClientID='fundos_" + jQuery("input[ClientID='fundos_tipo']:checked").val() + "']").val()=="escolher") 
	    jQuery(".valor").show();
    else 
	    jQuery(".valor").hide();
	
});
