var aIds = Array( 'pg_0ee912f872' );
function ChangePage( to_hide, to_show )
{
   var tbl_hide = document.getElementById( aIds[to_hide] );
   var tbl_show = document.getElementById( aIds[to_show] );

   if ( typeof(tbl_hide)=='object' && tbl_hide!=null )
    if ( typeof(tbl_show)=='object' && tbl_show!=null )
    {
       tbl_hide.style.display = 'none';
       tbl_show.style.display = '';
    }
}
function NotEmpty( old_res, id, field_title )
{
   if ( old_res==0 )
   {
      var el = document.getElementById( id );
      if ( typeof(el)=='object' && el!=null )
        if ( el.value=='' )
        {
           alert( 'You should fill "' + field_title + '"' );
           return 1;
        }
   }
   return 0;
}
function Email( old_res, id, field_title )
{ 
   if ( old_res==0 )
   {
      var el = document.getElementById( id );
      if ( typeof(el)=='object' && el!=null )
      {
         var re = /^[a-zA-Z0-9_\.\-]+@([a-zA-Z0-9][a-zA-Z0-9-]+\.)+[a-zA-Z]{2,6}$/;

         if (el.value.search(re) != -1 )  return 0;
         else
         {
            alert( '"'+field_title+'" must be email' );
            return 1;
         }
      }
   }
   return 0;
}
function NumbersOnly( old_res, id, field_title )
{
   if ( old_res==0 )
   {
      var el = document.getElementById( id );
      if ( typeof(el)=='object' && el!=null )
      {
         var re = /^[0-9]+$/;
         if (el.value.search(re) == -1 )
         {
            alert( '"' + field_title + '" must be a number' );
            return 1;
         }
      }
   }
   return 0;
}
function ChEqualOpts( old_res, nom, field_title, num, ids )
{
   if ( old_res==0 )
   {
      var nActive = 0;
      var it = null;

      for ( i=0; i<ids.length; i++ )
      {
         it = document.getElementById( ids[i] );
         if ( it!=null && it.checked ) nActive++;
      }

      if ( nActive != num )
      {
         alert( 'Please tick box to agree Terms and Conditions' );
         return 1;
      }
   }
   return 0;
}

function CheckPage0ee912f872()
{
   var nResult = 0;
   nResult += NotEmpty( nResult, 'fld_d2f56936c0','Contact name:' );
   nResult += Email( nResult, 'fld_c705eddeba','Email address:' );
   nResult += NotEmpty( nResult, 'fld_11f2d31813','Telephone number:' );
   nResult += NotEmpty( nResult, 'fld_a68865e2d4','Company name:' );
   nResult += NotEmpty( nResult, 'fld_7a5fc76890','Company address:' );
   nResult += ChEqualOpts( nResult, 'fld_1015a66616','Agree Terms and Conditions:',1, Array('cf3a5281cc') );

   if ( nResult == 0 )
   {
   
   
     var val = document.getElementById('fld_67597eff83').value;
      if (val=="Select when you require the course")
      {
        alert("Select required date");
        exit;
      } 
   
   
   
      if (1)
      {
         var el = document.getElementById( 'frm_75a71b8e3e' );
         if ( typeof(el)=='object' && el != null ) el.submit();
      }
      else ChangePage( 0, 1 );
   }
}
