var m = document.uniqueID
&& document.compatMode
&& !window.XMLHttpRequest
&& document.execCommand;

try {
  if(!!m) {
    m("BackgroundImageCache", false, true)
  }
}
catch(oh){};

function checkNumber(id)
{
  if (document.getElementById('quantity' + id).value.match(/^[0-9]+$/i)) return true;
  else
  {
    document.getElementById('quantity' + id).focus();
    alert('Введите количество');
  }
  return false;
}

function checkSearch()
{
  if (document.getElementById('ProductTitle').value.length < 3)
  {
    alert('Длина поискового запроса должна быть не менее 3 символов.')
    document.getElementById('ProductTitle').focus();
    return false;
  }
  if (document.getElementById('ProductTitle').value.length > 32)
  {
    alert('Длина поискового запроса должна быть не более 32 символов.')
    document.getElementById('ProductTitle').focus();
    return false;
  }
  return true;
}

function checkCatalogSearch()
{
  if (document.getElementById('pt').value.length < 3)
  {
    alert('Длина поискового запроса должна быть не менее 3 символов.')
    document.getElementById('pt').focus();
    return false;
  }
  if (document.getElementById('pt').value.length > 32)
  {
    alert('Длина поискового запроса должна быть не более 32 символов.')
    document.getElementById('pt').focus();
    return false;
  }
  return true;
}

function openwnd(url, target, param, wnd , default_param)
{
  default_param = 'width=800,height=640,top=20,left=20,screenY=20,screenX=20,menubar,scrollbars,toolbar=0,status=0';
  param = (param) ? ','+param : '';
  param =  default_param + param;
  wnd=open( url, target, param );
  wnd.focus();
  return wnd;
}

function tableruler(tblClassName)
{
  if (!tblClassName) tblClassName = 'ruler';
  if (document.getElementById && document.createTextNode)
  {
    var tables=document.getElementsByTagName('table');
    for (var i=0;i<tables.length;i++)
    {
      if(tables[i].className==tblClassName)
      {
        var trs=tables[i].getElementsByTagName('tr');
        for(var j=0;j<trs.length;j++)
        {
          trs[j].onmouseover=function(){this.className='ruled';return false}
          trs[j].onmouseout=function(){this.className='';return false}
        }
      }
    }
  }
}