
function FormCheck(form)
  {

  var strAlert = '';
  var strLF = '\r\n\r\n';


  if (form.CP_NAME.value == '')
    strAlert = strAlert + 'Company Name is required' + strLF ;
  else
    if ( LengthB(form.CP_NAME.value) > 100 )
      strAlert = strAlert + 'Company Name Exceed maximum length  100 characters.' + strLF ;
  if (form.TITLE.value == null) {
    mcheck_flag = false;
    for ( i=0 ; i < form.TITLE.length ; i++ ) {
      if ( form.TITLE[i].checked ) {
        mcheck_flag = true;
        break;
      }
    }
    if ( mcheck_flag == false )
      strAlert = strAlert + 'Title is required' + strLF;
  }
  else {
    if (!form.TITLE.checked)
    strAlert = strAlert + 'Title is required' + strLF;
  }
  if (form.CONTACT1.value == '')
    strAlert = strAlert + 'Contact Person is required' + strLF ;
  else
    if ( LengthB(form.CONTACT1.value) > 100 )
      strAlert = strAlert + 'Contact Person Exceed maximum length  100 characters.' + strLF ;
  if ( LengthB(form.ADDRESS.value) > 120 )
    strAlert = strAlert + 'Address  Exceed maximum length  120 characters.' + strLF ;
  if (form.Country1.value == '')
    strAlert = strAlert + 'Country is required' + strLF;
    if ( LengthB(form.TEL_INT_CODE.value) > 10 )
    strAlert = strAlert + 'Country Code  Exceed maximum length  10 characters.' + strLF ;
  if ( LengthB(form.TEL_AREA.value) > 10 )
    strAlert = strAlert + 'Area Code  Exceed maximum length  10 characters.' + strLF ;
  if ( LengthB(form.TEL1.value) > 20 )
    strAlert = strAlert + 'Tel Exceed maximum length  20 characters.' + strLF ;
  if ( LengthB(form.FTEL_INT_CODE.value) > 10 )
    strAlert = strAlert + 'FCountry Code  Exceed maximum length  10 characters.' + strLF ;
  if ( LengthB(form.FAX_AREA.value) > 10 )
    strAlert = strAlert + 'FArea Exceed maximum length  10 characters.' + strLF ;
  if ( LengthB(form.FAX1.value) > 20 )
    strAlert = strAlert + 'Fax Exceed maximum length  20 characters.' + strLF ;
  if (form.CONTACT_EMAIL.value == '')
    strAlert = strAlert + 'E-Mail is required' + strLF ;
  else
    if ( !IsValidEmail(form.CONTACT_EMAIL.value) )
      strAlert = strAlert + 'E-MailFormat Incorrect,correct format is yourname@yourdomain' + strLF ;
    if ( LengthB(form.URL.value) > 100 )
    strAlert = strAlert + 'Website Exceed maximum length  100 characters.' + strLF ;
  if (form.PURPOSE.value == null) {
    mcheck_flag = false;
    for ( i=0 ; i < form.PURPOSE.length ; i++ ) {
      if ( form.PURPOSE[i].checked ) {
        mcheck_flag = true;
        break;
      }
    }
    if ( mcheck_flag == false )
      strAlert = strAlert + 'Offer is required' + strLF;
  }
  else {
    if (!form.PURPOSE.checked)
    strAlert = strAlert + 'Offer is required' + strLF;
  }
  if (form.PROD_NAME.value == '')
    strAlert = strAlert + 'Product Name is required' + strLF ;
  else
    if ( LengthB(form.PROD_NAME.value) > 200 )
      strAlert = strAlert + 'Product Name Exceed maximum length  200 characters.' + strLF ;
  if (form.PROD_DESC.value == '')
    strAlert = strAlert + 'Product Description is required' + strLF ;
  else
    if ( LengthB(form.PROD_DESC.value) > 4000 )
      strAlert = strAlert + 'Product Description Exceed maximum length  4000 characters.' + strLF ;

  
  if (strAlert == '')
    form.submit();
  else
    alert(strAlert);
    
  }