function popPage(name)
{
 if (name == 'addmark')
  w = window.open('/popup/add_model.php?opener='+escape(window.location.href), 'addmark', 'width=350,height=350,scrollbars=0,resizable=0,toolbar=0,status=0');
 if (name == 'addmodel')
  w = window.open('/popup/add_model.php?opener='+escape(window.location.href), 'addmodel', 'width=350,height=350,scrollbars=0,resizable=0,toolbar=0,status=0');
 if (name == 'addtyres')
  w = window.open('/popup/add_tyres.php?opener='+escape(window.location.href), 'addtyres', 'width=350,height=350,scrollbars=0,resizable=0,toolbar=0,status=0');
 if (name == 'addwheelsmanufacturer')
  w = window.open('/popup/add_wheels_manufacturer.php?opener='+escape(window.location.href), 'addwheelsmanufacturer', 'width=350,height=350,scrollbars=0,resizable=0,toolbar=0,status=0');
 if (name == 'admin')
  w = window.open('/popup/admin_letter.php?opener='+escape(window.location.href), 'admin', 'width=350,height=350,scrollbars=0,resizable=0,toolbar=0,status=0');
 if (name == 'advert')
  w = window.open('/popup/advert_letter.php?opener='+escape(window.location.href), 'advert', 'width=350,height=350,scrollbars=0,resizable=0,toolbar=0,status=0');
 if (name == 'vipauto')
  w = window.open('/popup/vip/auto.php?opener='+escape(window.location.href), 'vipauto', 'width=350,height=350,scrollbars=0,resizable=0,toolbar=0,status=0');
 w.focus();
 return false;
}
function popPageLinkToFriend(link)
{
 w = window.open('/popup/tofriend.php?link='+escape(link)+'&opener='+escape(window.location.href), 'tofriend', 'width=400,height=400,scrollbars=0,resizable=0,toolbar=0,status=0');
 w.focus();
 return false;
}
function loginFieldView(id_field, event, field)
{
 if ((event == 'onfocus'))
     document.getElementById(id_field).style.background = '#FFF';

 if ((event == 'onblur') && (document.getElementById(id_field).value == ''))
     document.getElementById(id_field).style.background = '#FFF url(/images/loginfield_bg_'+field+'.gif) left center';
}
function CheckLoginForm()
{
  notice = '';
  if ((document.getElementById('id_user_login').value == ' Логин: ') || (document.getElementById('id_user_login').value.length == 0))
    notice += 'Введите Ваш логин для входа на сайт\n';
  if ((document.getElementById('id_user_password').value == ' Пароль: ') || (document.getElementById('id_user_password').value.length == 0))
    notice += 'Введите Ваш пароль\n';
  if (notice)
  {
    alert (notice);
    return false;
  }
  return true;
}

