<!--
function toggle( div )
{
	var ele = document.getElementById( div);
	if(ele.style.display == "block") {
    		ele.style.display = "none";
  	}
	else {
		ele.style.display = "block";
	}
}

function check_prereg_form( form )
{
  var all_fields = ( form[ 'name_first' ].value != '' ) && ( form[ 'name_last' ].value != "" ) && ( form[ 'email' ].value != "" );
  var any_fields = ( form[ 'name_first' ].value != '' ) || ( form[ 'name_last' ].value != "" ) || ( form[ 'email' ].value != "" );

  if ( any_fields && !all_fields )
  {
    alert( 'Please enter your first AND last name AND email address.' );
    return false;
  }
  else if ( form[ 'event' ].selectedIndex == 0 )
  {
    alert( 'Please select an event to register for.' );
    return false;
  }
  else
  {
    return true;
  }
}

function check_provisional( form ) {

  if ( form[ 'scca_class' ].selectedIndex == 40 ) {
    form[ 'comp_category' ].selectedIndex = 3;
    form[ 'comp_category' ].disabled = true;
    alert( "Participants wanting to run in SMF for the Fall Series must run in Open as there is no PAX factor yet for the new, provisional class." );
  } else if ( form[ 'scca_class' ].selectedIndex == 41 ) {
    form[ 'comp_category' ].selectedIndex = 3;
    form[ 'comp_category' ].disabled = true;
    alert( "Participants wanting to run in STR for the Fall Series must run in Open as there is no PAX factor yet for the new, provisional class." );
  } else {
    form[ 'comp_category' ].disabled = false;
  }

}

function check_registration_form( form )
{
  var num_text_fields = 9;
  var text_fields = new Array( num_text_fields );
  text_fields[  0 ] = 'name_first';
  text_fields[  1 ] = 'name_last';
  text_fields[  2 ] = 'email';
  text_fields[  3 ] = 'car_year';
  text_fields[  4 ] = 'car_make';
  text_fields[  5 ] = 'car_model';
  text_fields[  6 ] = 'car_engine';
  text_fields[  7 ] = 'car_color';
  text_fields[  8 ] = 'tires_manuf';
  
  var ndx;
  for( ndx=0; ndx< num_text_fields; ndx++ )
  {
    if ( form[ text_fields[ ndx ] ].value == "" )
    {
      alert( "Your registration information is incomplete.\nPlease be sure all the required fields are filled in.\nRequired fields are indicated in bold.\n" );
      return false;
    }
  }

  var num_select_fields = 3;
  var select_fields = new Array( num_select_fields );
  select_fields[  0 ] = 'work_pos_1';
  select_fields[  1 ] = 'scca_class';
  select_fields[  2 ] = 'comp_category';

  for( ndx=0; ndx<num_select_fields; ndx++ )
  {
    if ( form[ select_fields[ ndx ] ].selectedIndex == 0 )
    {
      alert( "Your registration information is incomplete.\nPlease be sure all the required fields are filled in.\nRequired fields are indicated in bold.\n" );
      return false;
    }
  }

  if ( form[ 'class_and_category' ].value == "invalid" ) {
    alert( "The combination of class and category you have selected is not valid." );
    return false;
  }


  if ( form[ 'accept_regs' ].checked == "" )
  {
    alert( "You must read and accept the special event rules and regulations before registering.\n\nPlease read the paragraph at the bottom of the page and check the box next to 'I have read and understood all the regulations stated above, and agree to abide by them.'" );
    return false;
  }

  return true;
}

function details( item )
{
  var url = "details.php";
  window.open( url, 'details', 'status=0,toolbar=0,location=0,menubar=0,directories=0,resizeable=0,scrollbars=0,height=465,width=645' );
}

function edit_form( form )
{
  if( form[ 'delete' ].checked )
    return confirm( "Are you sure you would like to delete this item?" )
}

function admin_refresh( url )
{
  if ( url != "" ) {
    window.location=url;
  }
}
-->