var aIds = Array( 'pg_ec65d937c3' );
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 CheckPageec65d937c3()
{
   var nResult = 0;
   nResult += NotEmpty( nResult, 'fld_41aaae13cf','Full name:' );
   nResult += Email( nResult, 'fld_16868a919e','Email address:' );
   nResult += NotEmpty( nResult, 'fld_2ad07bfef6','Telephone number:' );
   nResult += NotEmpty( nResult, 'fld_a8901a4d93','Make of vehicle:' );
   nResult += NotEmpty( nResult, 'fld_28eefb9e08','Model of vehicle:' );
    nResult += NotEmpty( nResult, 'fld_a305bef42b','Year of vehicle:' );

   if ( nResult == 0 )
   {
     
	   var val = document.getElementById('fld_2e4f14b032').value;
      if (val=="Please select")
      {
        alert("Quote required");
        exit;
      } 
	  
	  
	    var val = document.getElementById('fld_5293b6d4cd').value;
      if (val=="Please select")
      {
        alert("Fuel type");
        exit;
      } 
	  
	  
	    var val = document.getElementById('fld_f6e14a413c').value;
      if (val=="Please select")
      {
        alert("Transmission type");
        exit;
      } 
	  
	  
	    var val = document.getElementById('fld_cdd1fdd820').value;
      if (val=="Please select")
      {
        alert("Air conditioning");
        exit;
      } 
	  
	  
	    var val = document.getElementById('fld_19671799a9').value;
      if (val=="Please select")
      {
        alert("Existing dual controls");
        exit;
      } 
	  
	  
	    var val = document.getElementById('fld_690dec17a8').value;
      if (val=="Please select")
      {
        alert("Location of fitting");
        exit;
      } 
	 
	 	 
	 
	  if (1)
      {
         var el = document.getElementById( 'frm_5393606061' );
         if ( typeof(el)=='object' && el != null ) el.submit();
      }
      else ChangePage( 0, 1 );
   }
}

