function act_top(imgName) 
{
  if (document.images)  document[imgName].src = eval(imgName + "1.src");
}

function lang()
 {
   document.flang.submit();
 }
function flash()
 {
   document.fflash.submit();
 }
function inact_top(imgName) 
{
  if (document.images)  document[imgName].src = eval(imgName + "0.src");
}
function basket(id)
   {
    var win = window.open('basket.php?id='+id,'basket','scrollbars=yes,height=250,width=680,left=0,top=0,status=no,toolbar=no,menubar=no,location=no');
   }

function act(v) 
{
  if (document.images) eval('document.getElementById(\'d'+ v +'\').style.backgroundImage = \'url(\'+pic'+v+'1.src+\')\';');
}

function inact(v) 
{
  if (document.images)  eval('document.getElementById(\'d'+ v +'\').style.backgroundImage = \'url(\'+pic'+v+'0.src+\')\';');
}


function cpop(tid, width, height)
{
  windowprops = "width="+width+",height="+height+",top=0,left=0,scrollbars=no,toolbar=no,menu=no,resizable=no";
  var win = window.open('cpop.php?tid='+tid,'tovar', windowprops);
}

function gosearch()
{
  var str=document.fs.w.value;
    var err,arr;
    if(str=='') alert('Введите параметры поиска!');
    else
     {
       if(str.length<3) alert('Слово для поиска должно содержать не менее 3-х символов!');
         else
          {
              arr=str.split(" ");
                if(arr.length > 3) alert('Число фрагментов должно быть не более 3-х!');
                else
                 {
                   err=false;
                     for(var i=0;i<arr.length;i++)
                      {
                          if(arr[i].length < 3) err=true;
                        }
                     if(err) alert('Каждый фрагмент должен содержать не менее 3-х символов!');  
                     else document.fs.submit();
                 }
            }
     } 
}

function m_act(imgName,num) 
{
  if (document.images)  document[imgName].src = eval("pic"+num+"1.src");
}

function m_inact(imgName,num) 
{
  if (document.images)  document[imgName].src = eval("pic"+num+"0.src");
}
function mail()
 {
   var win=window.open('http://mail.oao-tantal.ru');
 }   
function login()
{
  var login=document.lf.login.value;
  var pass=document.lf.pass.value;
  var err;
    if(login==''||pass=='') alert('Введите логин и пароль!');
    else document.lf.submit();
}
function logout()
{
 document.lf.logout.value = true;
 document.lf.submit();
}
