function check_form(form_obj){
	nr=0;
	flag=true;

	for(f=0;f<form_obj.length;f++){       
	    obj=form_obj.elements[f];
// empty symbol
		if (obj.name == 'symbol' && (obj.value == '' || obj.value == '  ' || obj.value == '    ' || obj.value == '     ')){
				flag=false;
				nr=1;
				obj.focus();
				obj.select();
				break
		}
// empty fields 
		if (obj.value == '' || obj.value == '  ' || obj.value == '    ' || obj.value == '     '){
				flag=false;
				nr=2;
				obj.focus();
				break
		}
// check period of time 
		if(obj.name == 'to_year'){
			if(parseInt(obj.options[obj.selectedIndex].value) < parseInt(obj.form.from_year.options[obj.form.from_year.selectedIndex].value)){
				flag=false;
				nr=3;
				obj.focus();
				break
			} else if(parseInt(obj.options[obj.selectedIndex].value) == parseInt(obj.form.from_year.options[obj.form.from_year.selectedIndex].value) && parseInt(obj.form.from_month.options[obj.form.from_month.selectedIndex].value) > parseInt(obj.form.to_month.options[obj.form.to_month.selectedIndex].value)){
				flag=false;
				nr=3;
				obj.form.to_month.focus();
				break
			} else if(parseInt(obj.options[obj.selectedIndex].value) == parseInt(obj.form.from_year.options[obj.form.from_year.selectedIndex].value) && parseInt(obj.form.to_month.options[obj.form.to_month.selectedIndex].value) == parseInt(obj.form.from_month.options[obj.form.from_month.selectedIndex].value) && parseInt(obj.form.to_day.options[obj.form.to_day.selectedIndex].value) < parseInt(obj.form.from_day.options[obj.form.from_day.selectedIndex].value)){
				flag=false;
				nr=3;
				obj.form.to_day.focus();
				break
			}
		}
	} // end for

	if(flag){
		obj.form.symbol.value = obj.form.symbol.value.toUpperCase();
//		if(!hasSVGSupport) obj.form.viewer.value = 'HTML';
//		return true	// ==> submit
		if(screen.width >= 1024) obj.form.userScreen.value = 1024;


		obj.form.submit();
	}
	if(nr==3) alert("Incorrect period of time!");
  	if(nr==2) alert('You have empty fields!');
  	if(nr==1) alert('Please select a company symbol first\nand then press on the Next button.');

	return false
}
