function Cnt(id,kol)
{
  k=document.getElementById(id);
  if (kol>0) k.value=parseInt(k.value)+kol;
    else k.value=parseInt(k.value)>-kol?parseInt(k.value)+kol:1;
  k.value=k.value+" шт";
}
function dst()
{
  destination=document.oform.d.options[document.oform.d.selectedIndex].value;
  if (destination) parent.location=destination+"#form";
}
function mtr()
{
  destination=document.oform.m.options[document.oform.m.selectedIndex].value;
  if (destination) parent.location=destination+"#form";
}
function dat()
{
  destination=document.oform.dt.options[document.oform.dt.selectedIndex].value;
  if (destination) parent.location=destination+"#form";
}
function byrsd()
{
  destination=document.search_form.rsd.options[document.search_form.rsd.selectedIndex].value;
  if (destination) parent.location=destination;
}
function bycat()
{
  destination=document.search_form.c.options[document.search_form.c.selectedIndex].value;
  if (destination) parent.location=destination;
}
function byat1search()
{
  destination=document.search_form.at1.options[document.search_form.at1.selectedIndex].value;
  if (destination) parent.location=destination;
}
function byat2search()
{
  destination=document.search_form.at2.options[document.search_form.at2.selectedIndex].value;
  if (destination) parent.location=destination;
}
function region()
{
  destination=document.oform.r.options[document.oform.r.selectedIndex].value;
  if (document.oform.usebns.checked) chk="&usebns=1"; else chk="";
  if (destination) parent.location=destination+chk;
}
function bymnfsw()
{
  destination=document.tvrfilt.m.options[document.tvrfilt.m.selectedIndex].value;
  if (destination) parent.location=destination;
}
function byat1()
{
  destination=document.tvrfilt.a1.options[document.tvrfilt.a1.selectedIndex].value;
  if (destination) parent.location=destination;
}
function byat2()
{
  destination=document.tvrfilt.a2.options[document.tvrfilt.a2.selectedIndex].value;
  if (destination) parent.location=destination;
}
function bytvrattr()
{
  destination=document.tvrfilt.tvrattr.options[document.tvrfilt.tvrattr.selectedIndex].value;
  if (destination) parent.location=destination;
}
function byprice()
{
  destination=document.tvrfilt.tvrpr.options[document.tvrfilt.tvrpr.selectedIndex].value;
  if (destination) parent.location=destination;
}
function coe_lnk()
{
  document.write('<a href="http://co-e.ru" class="coe">');
  document.write('<img src="img/coe.gif" style="float:none;">');
  document.write('<br>перейти в универмаг</a>');
}
function txt()
{
  document.write('');
}

var visibleVar="null";
var timeout = 500;
function init(){
if (navigator.appName == "Netscape") {
layerRef="document.layers";
styleSwitch="";
visibleVar="show";
}else{
layerRef="document.all";
styleSwitch=".style";
visibleVar="visible";
}
}
function hideAllLayers()
{
for(i=0; i<allmnu.length; i++) allmnu[i].style.visibility="hidden";
}

function showHideLayerSwitch(layerName)
{
allmnu = getElementsByNameIE("table","jsmenu_element");
hideAllLayers();
showLayer(layerName);
}

function showLayer(layerName){
eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
}

function hideLayer(layerName){
eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
}

function getElementsByNameIE(tag, name) {

     var elem = document.getElementsByTagName(tag);
     var arr = new Array();
     for(i = 0,iarr = 0; i < elem.length; i++) {
          att = elem[i].getAttribute("name");
          if(att == name) {
               arr[iarr] = elem[i];
               iarr++;
          }
     }
     return arr;
}
