/*function certificationWrapperScroll( div_object ) {
}
function initCertificationForm() {
	$( 'certification_wrapper' ).onScroll = function() {
		certificationWrapperScroll( this );
	};
}
Event.observe( window, 'load', initCertificationForm );*/

function validateCertificationForm() {
	var main_form = $( 'postAddForm' ), error_msg_list = new Array();
	if( !main_form.course_done.checked ) {
		error_msg_list.push( '- You must done with the course to Print Certificate' );
	}
	var text_input_list = main_form.getInputs( 'text' );
	var empty_field_error = false;
	for( var i = 0; i < text_input_list.length; i++ ) {
		if( text_input_list[ i ].value.blank() ) {
			if( !empty_field_error ) {
				error_msg_list.push( '- All the Buyer Information Fields are Required' );
				empty_field_error = true;
			}
			text_input_list[ i ].style.backgroundColor = '#B88A01';
		} else {
			text_input_list[ i ].style.backgroundColor = '';
		}
	}
	if( $( 'buyer_state' ).selectedIndex == 0 ) {
		error_msg_list.push( '- Select a State' );
		$( 'buyer_state' ).style.backgroundColor = '#B88A01';
	} else {
		$( 'buyer_state' ).style.backgroundColor = '';
	}
	if( error_msg_list.length > 0 ) {
		alert( 'The Following Errors has been Found: \n' + error_msg_list.join( '\n' ) );
	} else {
		main_form.submit();
	}
}