/*  */
 var lengthAX = new Array( 15, -1 );
 var lengthMC = new Array( 16, -1 );
 var lengthVI = new Array( 13, 16 );
 function submitChecked()
 {
  var shopForm = document.forms['shopForm'];
  var anzahlSelected = false;
  var elements = $(shopForm).find(":select[name*=anzahl_art]")
  
  jQuery.each(elements, function(){
	  var select = $(this);
	  if (select.val() != '---') {
		anzahlSelected = true;
	  }
  });

 if (!anzahlSelected)
 //if (shopForm.anz_art1[shopForm.anz_art1.selectedIndex].value == '---' && shopForm.anz_art2[shopForm.anz_art2.selectedIndex].value == '---' && shopForm.anz_art3[shopForm.anz_art3.selectedIndex].value == '---' && shopForm.anz_art4[shopForm.anz_art4.selectedIndex].value == '---' && shopForm.anz_art5[shopForm.anz_art5.selectedIndex].value == '---' && shopForm.anz_art6[shopForm.anz_art6.selectedIndex].value == '---')
  {
   alert( "Bitte geben Sie mindestens einen Artikel an." );
   return;
  }
  if( ( shopForm.salutation.value == null ) || ( shopForm.salutation.value == '' ) )
  {
   alert( "Bitte wählen Sie einen Titel." );
   return;
  }
  if (shopForm.agency_name) {
      if( ( shopForm.agency_name.value == null ) || ( shopForm.agency_name.value == '' ) )
      {
       alert( "Bitte geben Sie Ihren Agenturnamen ein." );
       return;
      }
//      if( ( shopForm.agency_number.value == null ) || ( shopForm.agency_number.value == '' ) )
//      {
//       alert( "Bitte geben Sie Ihre Agenturnummer ein." );
//       return;
//      }
  }
  if( ( shopForm.firstname.value == null ) || ( shopForm.firstname.value == '' ) )
  {
   alert( "Bitte geben Sie Ihren Vornamen ein." );
   return;
  }
  if( ( shopForm.lastname.value == null ) || ( shopForm.lastname.value == '' ) )
  {
   alert( "Bitte geben Sie Ihren Nachnamen ein." );
   return;
  }
  if( ( shopForm.email.value == null ) ||( shopForm.email.value == '' ) || ( shopForm.email.value.indexOf( '@' ) < 0 ) || ( shopForm.email.value.indexOf( '.' ) < 0 ) || ( ( shopForm.email.value.lastIndexOf( '.' ) - shopForm.email.value.indexOf( '@' ) ) <2 ) || ( shopForm.email.value.substr( shopForm.email.value.lastIndexOf( '.' ) ).length < 2 ) || ( shopForm.email.value.substr( shopForm.email.value.lastIndexOf( '.' ) ).length > 4 ) )
  {
   alert( "Bitte geben Sie eine gültige Email-Adresse ein." );
   return;
  }
  if( ( shopForm.street.value == null ) || ( shopForm.street.value.length == '' ) )
  {
   alert( "Bitte geben Sie Ihre Straße ein." );
   return;
  }
  if( ( shopForm.street_no.value == null ) || ( shopForm.street_no.value.length == '' ) )
  {
   alert( "Bitte geben Sie Ihre Hausnummer ein." );
   return;
  }
  /*
if( ( shopForm.zip.value == null ) || ( shopForm.zip.value.length != 5 ))
  {
   alert( "Bitte geben Sie eine Postleitzahl ein." );
   return;
  }
*/
  if( ( shopForm.location.value == null ) || ( shopForm.location.value == '' ) )
  {
   alert( "Bitte geben Sie einen Ort ein." );
   return;
  }
  if( ( shopForm.phone_prefix.value == null ) || ( shopForm.phone_prefix.value == '' ) )
  {
   alert( "Bitte geben Sie eine Vorwahl ein." );
   return;
  }
  if( ( shopForm.phone_number.value == null ) || ( shopForm.phone_number.value == '' ) )
  {
   alert( "Bitte geben Sie eine Telefonnummer ein." );
   return;
  }
  if(document.forms['shopForm'].elements['clauses'].checked==false)
   {
    alert("Bitte bestätigen Sie unsere AGB.");
    return;
   }  
  alert( "Vielen Dank! Ihre Bestellung wird nun ausgeführt.\n" +"Bitte drücken Sie während dieses Vorgangs nicht auf 'Aktualisieren'.");
  switchFormToDynamic(document.shopForm);
  shopForm.submit();
}
// 
//