<!--
// отображение картинки в отдельном окне
function Showpic(sName, iWidth, iHeight)
{
  window.open(sName,'map','width='+iWidth+',height='+iHeight+',scrollbars=no,resizable=no');
}

// Открытие окна добавления товара в корзину 
function newWin(sVar, sType, sPrice, sDiscount)
{
  var win1;
  win1=window.open('addtobasket.php?idprod='+sVar+'&idtype='+sType+'&price='+sPrice+'&discount='+sDiscount, 'addbasket', 'width=340,height=200,scrollbars=no,resizable=no');
}

// Открытие окна выписать счет
function Account(IDor, sLang)
{ 
  if (sLang=='en')
  { msg = '../'; }
  else { msg = ''; }
  
  var win1;
  win1=window.open(msg + 'account.php?id='+IDor, 'account');
}

// Открытие окна выписать счет
function Receipt(sLang)
{
  if (sLang=='en')
  { msg = '../'; }
  else { msg = ''; }
  
  var win1;
  win1=window.open(msg + 'html/receipt.doc', 'account');
}

// Открытие окна выписать счет
function Kreditka(IDor, sLang)
{
  if (sLang=='en')
  { msg = '../'; }
  else { msg = ''; }
  
  var win1;
  win1=window.open(msg + 'credits.php?id='+IDor, 'kreditka');
}

//Кредитная карта напрямую
function Direct(IDor, sLang)
{ 
  if (sLang=='en')
  { msg = '../'; }
  else { msg = ''; }
  
  var win1;
  win1=window.open(msg + 'rbkcard.php?id='+IDor, 'direct');
}

// Открытие окна мобильного платежа
function Smska(IDor, sLang)
{
  if (sLang=='en')
  { msg = '../'; }
  else { msg = ''; }
  
  var win1;
  win1=window.open(msg + 'sms-echo.php?id='+IDor, 'smska');
}

// Проверка введено ли значение в форме
function checkbasket(sLang)
{
 if (sLang=='en')
 {
   msg1="The field has not been filled in!";
   msg2="The field has been filled in incorrectly!";
 }
 else
 {
   msg1="Значение поля количество не задано!";
   msg2="Значение поля задано неправильно!";
 }
 if (document.order.quantity.value=="")
 {alert(msg1); return 0;}
 else if (parseInt(document.order.quantity.value)<1 || isNaN(parseInt(document.order.quantity.value)))
  {alert(msg2); return 0;}
 else
 {
   document.order.cmdOK.disabled=true;
   document.order.cmdCancel.disabled=true;
   document.order.submit();
 }
}

// Проверка, что заполнено поле для индивидуального заказа
function checkIndiv(sLang)
{
  if (sLang=='en')
  { msg='Please check if you have filled in a field "What you are looking for"'; }
  else
  { msg='Не заполнено поле \"Что Вас интересует\".'; }
  if (document.invidiv.Claim.value.length<5)
  { alert(msg); }
  else
  {
   document.invidiv.cmdOK.disabled=true;
   document.invidiv.submit();
  }
}

// Работа с кнопками в корзине
function act(sVal, sLang)
{
  if (sLang=='en')
  { msg="Your order cannot be completed, your basket is empty. To complete your order please select items from the catalogue."; }
  else
  { msg="Заказ не может быть оформлен, потому что корзина пустая. Для оформления заказа необходимо выбрать товары в каталоге."; }
  
  if ((document.basket.elements.length<5)&&(sVal=='Order'))
  {
    alert(msg);
    return '';
  }
   document.basket.todo.value=sVal;
   document.basket.cmdRefresh.disabled=true;
   document.basket.cmdOrder.disabled=true;
   document.basket.submit();
}

// Работа с кнопками для сохранения заказа
function reload(sVal, sForm, sCost)
{
  document.frmMain.todo.value=sVal;
  if (sForm!=''){document.frmMain.Address.value=sForm;}
  if (sCost!=''){document.frmMain.DlCost.value=sCost;}
  document.all[sVal].disabled = true;
  document.frmMain.submit(); 
}

// Проверки в форме курьера
function courier(sLang)
{
  if (sLang=='en')
  {
    City='Please check if you have filled in a field "City, region, town".';
	Street='Please check if you have filled in a field "Street".';
	House='Please check if you have filled in a field "House".';
  }
  else
  {
    City='Необходимо заполнить поле "Город, район, населенный пункт".';
	Street='Необходимо заполнить поле "Улица".';
	House='Необходимо заполнить поле "Дом".';
  }
  if (document.frmMain.City.value=="")
  { alert(City); document.frmMain.City.focus(); return 0; }
  else if (document.frmMain.Street.value=="")
  { alert(Street); document.frmMain.Street.focus(); return 0; }
  else if (document.frmMain.House.value=="")
  { alert(House); document.frmMain.House.focus(); return 0; }
  else {reload('Continue','courier','');}
}

// Проверки в форме по почте
function post(sLang)
{
  if (sLang=='en')
  {
    Code='Please check if you have filled in a field "Zip/postcode".';
	Country='Please check if you have filled in a field "Country".';
	Region='Please check if you have filled in a field "Region" or a field "City".';
	Street='Please check if you have filled in a field "Street".';
	District = 'Please check if you have filled in following fields "Area", "City" or "Town".';
  }
  else
  {
    Code='Необходимо заполнить поле "Индекс".';
	Country='Необходимо заполнить поле "Страна".';
	Region='Необходимо заполнить поля "Регион, область" или "Город".';
	Street='Необходимо заполнить поле "Улица".';
	District = 'Поля "Район", "Город" или "Населенный пункт" должны быть заполнены.';
  }
 if (document.frmMain.Code.value=="")
  { alert(Code); document.frmMain.Code.focus(); return 0; }
 else if (document.frmMain.Country.value=="")
  { alert(Country); document.frmMain.Country.focus(); return 0; }
 else if (document.frmMain.Region.value=="" && document.frmMain.City.value=="")
  { alert(Region); document.frmMain.Region.focus(); return 0; }
 else if (document.frmMain.City.value!="" && document.frmMain.Street.value=="")
  { alert(Street); document.frmMain.Street.focus(); return 0; }
 else if ((document.frmMain.District.value=="" && document.frmMain.City.value=="" && document.frmMain.Settlement.value=="") && document.frmMain.Region.value!="")
  { alert(District); document.frmMain.District.focus(); return 0; }
 else {reload('Continue','post','');}
}

// Проверка логина и пароля при входе в систему
function checklogin(sVal, sLang)
{
  // Список сообщений, в зависимости от языка
  if (sLang=='en')
  {
    slp='Enter your login and password!';
	sl='Enter your login (E-mail)!';
	sp='Enter your password!';
  }
  else
  {
    slp='Введите ваш логин и пароль!';
	sl='Введите ваш логин (e-mail)!';
	sp='Введите ваш пароль!';
  }

  // Проверка условий
  if (document.auth.login.value=="" || document.auth.password.value=="")
  {
	if (document.auth.login.value=="" && document.auth.password.value=="")
    {alert(slp); return '';}
    else if (document.auth.login.value=="")
    {alert(sl); return '';}
    else if (document.auth.password.value=="")
    {alert(sp); return '';}
  }
  else
  {StateValueAuth(sVal);}
}

// Проверка Е-mail при напоминании пароля
function checkEmail(sLang)
{
 if (document.retrieval.Email.value=="")
 {
   var message;
   if (sLang=="en"){message="Enter your E-mail address!";}
   else {message="Введите ваш E-mail!";}
   alert(message); return 0;
 }
 else{document.retrieval.submit();}
}

// Проверка Е-mail при подписке
function СheckSubscr()
{
 var email, re;
 re=/([0-9a-zA-Z\.-_]+)@([0-9a-zA-Z-_]+)\.([a-zA-Z\.])/;
 email=document.subscription.Subscription.value; 
 if (email==""){alert("Введите ваш E-mail!");}
 else
 {
  if (email.match(re)==null)
  {
    alert("Введенный адрес E-mail содержит недопустимые или имеет неправильный формат!");
  }
  else
  {
	var win1;
	win1=window.open('subscription.php?Email='+email, 'subscription', 'width=170,height=50,scrollbars=no,resizable=no');
	document.subscription.Subscription.value="";
  }
 }
}

// Проверка при поиске
function CheckSearch(sLang)
{
 // Выводим сообщение, в зависимости от языка
 if (sLang=='en')
 {sMessage='Enter the word you wish to search.';}
 else
 {sMessage='Введите слово для поиска.';}
 
 if (document.search.tofind.value=="")
 {alert(sMessage); return 0;}
 else {document.search.submit();}
}

// Записываем путь в скрытую переменную
function StateValue(sVar)
{
  document.registration.button.disabled = true;
  x=sVar.split('?action=send');
  if (x[1] === undefined)
  { document.registration.path.value=sVar; }
  document.registration.submit();
}

function StateValueAuth(sVar)
{
  x=sVar.split('?action=send');
  if (x[1] === undefined)
  { document.auth.path.value=sVar; }
  document.auth.submit();
}
//-->