function mudaMes(valor,ano,periodo){
	var mes='eventos.asp?valor='+valor+'&ano='+ano;
	parent.document.getElementById("frameCalendario").src=mes;}

function abreEvento(id,lang){
	var evento='evento_detalhe.asp?eve_id='+id+'&lan='+lang;
	parent.document.getElementById("frameEventosD").src=evento;}

function irPara(lang) {
	var mes=document.form_c.mes.value;
	var ano=document.form_c.ano.value;
	document.location.href="calendario.asp?valor="+mes+"&ano="+ano+"&lan="+lang;
	mudaMes(mes,ano,lang);}

function setPeriodo() {
	var data_inicio=document.getElementById("pac_validade_inicio").value;
	var data_fim=document.getElementById("pac_validade_fim").value;
	var valor=document.getElementById("valor_c").value;
	var ano=document.getElementById("ano_c").value;
	var str_aux="";
	if (data_inicio!=""&&data_fim!=""){
		str_aux=data_inicio.split("/");
		data_inicio=str_aux[0]+"a"+str_aux[1]+"a"+str_aux[2];
		str_aux=data_fim.split("/");
		data_fim=str_aux[0]+"a"+str_aux[1]+"a"+str_aux[2];
		var calendario='calendario.asp?periodo='+data_inicio+','+data_fim+'&valor='+valor+'&ano='+ano;
	parent.document.getElementById("frame_calendario").src=calendario;
	}
}

function setPeriodoBack() {
	var data_inicio=document.getElementById("pac_validade_inicio").value;
	var data_fim=document.getElementById("pac_validade_fim").value;
	var str_aux="";
	if (data_inicio!=""&&data_fim!=""){
		str_aux=data_inicio.split("/");
		data_inicio=str_aux[0]+"a"+str_aux[1]+"a"+str_aux[2];
		str_aux=data_fim.split("/");
		data_fim=str_aux[0]+"a"+str_aux[1]+"a"+str_aux[2];
		var calendario='calendario.asp?periodo='+data_inicio+','+data_fim;
	parent.document.getElementById("frame_calendario").src=calendario;
	}
}
