function strpos( haystack, needle, offset){
    // http://kevin.vanzonneveld.net
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Onno Marsman    
    // +   bugfixed by: Daniel Esteban
    // *     example 1: strpos('Kevin van Zonneveld', 'e', 5);
    // *     returns 1: 14
 
    var i = (haystack+'').indexOf(needle, (offset ? offset : 0));
    return i === -1 ? false : i;
}

function check_form() {
var email = document.forms.getmix.email.value;

  if( email.length < 5 ) {
  alert('Введите Ваш E-mail!');
  exit;
  } else {
    if ( strpos(email, '@', 0) < 1 ) {
    alert('Введите Ваш E-mail!');
    exit;    
    } else {
      if ( strpos(email, '.', 0) < 1 ) {
      alert('Введите Ваш E-mail!');
      exit;    
      }
    }
  }
  
var city = document.forms.getmix.city.value;
  
  if( city.length < 5 ) {
  alert('Введите Ваш город!');
  exit;
  }

  document.forms.getmix.is_check.value = 1;

  if ( document.forms.getmix.is_check.value > 0 ) {
  document.getmix.submit()
  }
}
