function checkMail(mail) {
  var regMail = /[0-9a-zA-Z\.-_]+@[0-9a-zA-Z\.-_]+/i;
  if(mail==""){
    alert("Вы забыли ввести адрес.\nВведите адрес в поле");
        document.form.email.value = " Введите e-mail";
    document.form.email.select(); return false;
  }
  else if(mail.search(regMail)) {
    alert("Такого адреса не может существовть\nВведите правильный адрес");
    document.form.email.select(); return false;
        }
  else { return true; }
}

function curOverImage(number) {
  var index = "tm" + number;
  document.images[index].src="http://avtomoika.com/images/topmain" + number + "2.gif";
}

function curOutImage(number) {
  var index = "tm" + number;
  document.images[index].src="http://avtomoika.com/images/topmain" + number + ".gif";
}

function onLoad() {
  var scrWidth, scrHeigth;
  scrWidth = window.screen.width;
  scrHeight = window.screen.height;
  if(scrWidth > 800 && scrHeight > 300) {
    document.images("logo").width = 20;
        document.images("logo").height = 20;
  }
}

function voteWindow() {
  var newWindow = window.open("", "vWindow", "width=200, height=220, left=50, top=50");
  newWindow.document.bgColor = "blue";
  return newWindow;
 }

function softPopUp(pageToShow) {
  var detailsWindow = window.open(pageToShow, "", "width=750, height=500, left=70, top=150, scrollbars");
  detailsWindow.focus();
  return false;

}

function checkFeedbackForm(tema, email, message) {
  var regMail = /[0-9a-zA-Z\.-_]+@[0-9a-zA-Z\.-_]+/i;
  if(tema==""){
    alert("Вы забыли ввести тему сообщения");
    document.feedback.tema.select();
        return false;
  }
  else if(email==""){
    alert("Вы забыли ввести адрес.\nВведите адрес в поле");
        document.feedback.email.value = " Введите e-mail";
    document.feedback.email.select();
        return false;
  }
  else if(email.search(regMail)) {
    alert("Такого адреса не может существовть\nВведите правильный адрес");
    document.feedback.email.select();
        return false;
        }
  else if(message=""){
    alert("Вы забыли ввести текст сообщения");
        document.feedback.message.select();
        return false;
  }
  else {
    return true;
  }
}

function SendWeatherForm(){
  document.cookie = "city="+document.towns.city.value+"; expires=Wed, 1 Mar 2010 00:00:00";
  document.towns.submit();
}

jsLoaded=true;