function currentOff(){
	var ularr = document.getElementsByTagName('ul');
	var liarr;
	for(var i=0;i < ularr.length;i++){
		if(ularr[i].className == 'more'){
			liarr = ularr[i].getElementsByTagName('li');
		}
	}
	for(var i=0; i < liarr.length;i++){
		liarr[i].className = '';
	}
}

function toCurrent(n){
	currentOff();
	var pn = n.parentNode;
	pn.className = 'current';
	n.blur();
}

function changeRangoFechas(time)
{
	document.getElementById('diffy').value = time;
	document.getElementById('catp02Form').submit();
}

function selectCurrent(diffy)
{
	// Por defecto se marca la opcion de todos
	var current = document.getElementById('pes_aant');

	// Si no, en funcion de la fechaeMin seleccionada se muestra uno u otro
	if (diffy == '4')
		current = document.getElementById('pes_a5');
	if (diffy == '3')
		current = document.getElementById('pes_a4');
	if (diffy == '2')
		current = document.getElementById('pes_a3');
	if (diffy == '1')
		current = document.getElementById('pes_a2');
	if (diffy == '0')
		current = document.getElementById('pes_a1');
	toCurrent(current);
	current.href = "javascript:void(0)";
}

function changeRangoMeses(time)
{
	document.getElementById('diffm').value = time;
	document.getElementById('catp02Form').submit();
}
function selectCurrentMes(diffm)
{
	// Por defecto se marca la opcion
	var current = document.getElementById('pes_mant');

	// Si no, en funcion de la fechaeMin seleccionada se muestra uno u otro

	if (diffm == '12')
		current = document.getElementById('pes_12m');
	if (diffm == '6')
		current = document.getElementById('pes_6m');
	if (diffm == '3')
		current = document.getElementById('pes_3m');
	if (diffm == '1')
		current = document.getElementById('pes_1m');
	toCurrent(current);
	current.href = "javascript:void(0)";
}

