// JavaScript Document

function check_validate_paso_1() {

	var respuesta = true;

	$('error_operacion').style.display = 'none';

	$('error_ano').style.display = 'none';

	

	// For Default OK

	if (!$('importacion').checked && !$('exportacion').checked) { 

		respuesta = false;

		$('error_operacion').style.display = '';

	}

	// For Default OK

	if (!$('ano1').checked && !$('ano2').checked && !$('ano3').checked && !$('ano4').checked && !$('ano5').checked && !$('ano6').checked && !$('ano7').checked && !$('ano8').checked && !$('ano9').checked && !$('ano10').checked && !$('ano11').checked && !$('ano12').checked && !$('ano13').checked) { 

		respuesta = false;

		$('error_ano').style.display = '';

	}	

	

	if (respuesta == true)

		cargarPaso('paso2',$('formulario').serialize());

	

	return false;

}

function check_validate_paso_2() {

	var respuesta = false;

	$('error_almost').style.display = 'none';

	for(i=1 ; i < 10; i++) { 

		if ($('continentesExport' + i)) { 

			if ($('continentesExport' + i).checked) { respuesta = true;	}

		}

	}

	for(i=1 ; i < 10; i++) { 

		if ($('regionesExport' + i)) { 

			if ($('regionesExport' + i).checked) { respuesta = true;	}

		}

	}	

	if ($('paisesExport1').selectedIndex > 0) { respuesta = true;	}

	if ($('totalExport').checked) { respuesta = true;	}	

	

	if (respuesta == true) { 

		cargarPaso('paso3',$('formulario').serialize());

	} else {

			$('error_almost').style.display = '';

	}

	return false;

}

function check_validate_paso_3() {

	var respuesta = false;

	$('error_almost').style.display = 'none';

	for(i=1 ; i < 10; i++) { 

		if ($('continentesImport' + i)) { 

			if ($('continentesImport' + i).checked) { respuesta = true;	}

		}

	}

	for(i=1 ; i < 10; i++) { 

		if ($('regionesImport' + i)) { 

			if ($('regionesImport' + i).checked) { respuesta = true;	}

		}

	}	

	if ($('paisesImport1').selectedIndex > 0) { respuesta = true;	}

	if ($('totalImport').checked) { respuesta = true;	}	

	

	if (respuesta == true) { 

		cargarPaso('paso4',$('formulario').serialize());

	} else {

			$('error_almost').style.display = '';

	}

	return false;

}

function check_validate_paso_4() {

	var respuesta = false;

	$('error_almost').style.display = 'none';

	

	for(i=1 ; i < 40; i++) { 

		if ($('sector' + i) != null) { 

			if ($('sector' + i).checked) { respuesta = true;	}

		}

	}	

	for(i=1 ; i < 60; i++) { 

		if ($('tipoproducto' + i) != null) { 

			if ($('tipoproducto' + i).checked) { respuesta = true;	}

		}

	}	

	for(i=1 ; i < 60; i++) { 

		if ($('categoria' + i) != null) { 

			if ($('categoria' + i).checked) { respuesta = true;	}

		}

	}		

	

	if (respuesta == true) { 

		cargarPaso('resultados',$('formulario').serialize());

	} else {

		$('error_almost').style.display = '';

	}

	return false;

}


