 is_gecko  = (navigator.product == "Gecko");

 function ToggleSubmenu(cell_id,submenu_id,n)
 {
   var cell = $("#"+cell_id);
   var h = n*24;
   var t = n*175;
	      
   if(is_gecko)
   {
   	   if(parseInt(cell.css("height"))>0)
   	   {
   	   	 $("#"+submenu_id).hide();
   	   	 cell.hide();
   	   	 cell.css("height","0px");
   	   }
   	   else
   	   {
   	     cell.show();
   	     $("#"+submenu_id).show();
   	     cell.css("height",h+"px");
   	   }
   }
   else
   {
	   if(parseInt(cell.css("height"))>0)
	     {$("#"+submenu_id).hide(); cell.animate({height:0},t,function(){cell.hide();});}
	   else
	     {cell.show(); cell.animate({height:h},t,function(){$("#"+submenu_id).show();});}
   }
 }

 function FindModel(url,qs)
 {
   qs=qs.replace("model", "ignore");

   var fm = $("#find_model").val();
   if(fm.length<=3)
     alert("Вы ввели слишком короткий код модели.");
   else
     location.href=url+"?model="+fm+(qs!='' ? "&"+qs : "");
 }

 function onModelEnter(event)
 {
   ecode = (event.keyCode ? event.keyCode : event.which ? event.which : null);
   if(ecode==13)
     document.getElementById("ModelGo").onclick();
     //$("#ModelGo").click;
 }
