function gElem(elm){
	return (document.getElementById) ? document.getElementById(elm) : (document.layers) ? document.layers[elm] : document.all[elm];
}

function fnSubmitForm(frm,act){
	var obj = gElem(frm);
	if(act) obj.action = act;
	obj.submit();
}

function fnSubmitBuscaForm(frm,ref,act){
	var obj = gElem(frm);
	var key = obj.key.value;
	key = escape(key);
	key = key.replace(/%20/g,"+");
	//if(ref && key!="") location.replace(ref+'/'+key);
	if(act) obj.action = act;
	if(key!="") obj.submit();
	//if(ref && key!="") location.replace(ref+'/'+key);
}





jQuery(function($){

	$("a.btn").click(function(){
		var content_show = $(this).attr("rel");
		$(".ativa").removeClass("ativa");
		$(this).addClass("ativa");
		$(".ativo").slideUp("fast", function(){
			$(this).removeClass("ativo");
			$("#"+content_show).fadeIn("normal", function(){ $(this).addClass("ativo");	});
		});
	});

	$("#changerDepart").change(function(){
		var sel = $("option:selected", this).attr('id');
		var opt = sel.replace(/sel_/,'shw_');

		$("#"+opt).show().siblings().hide();
	});

});
