function findBlur(t)
{
	if (t.value=='') t.value='поиск...';
}
function findFocus(t)
{
	t.value='';
}

var isIE = (document.all) ? 1 : 0;

function keyFilter(e, strPattern)
{
   var chr = (isIE) ? e.keyCode : e.which;
   var ch = String.fromCharCode(chr);

   if (chr != 13 && chr != 8 && chr != 0)
   {
      var re = new RegExp(strPattern);

      if (ch.search(re) == -1)
      {
         if(isIE)
          e.returnValue = false;
         else
          e.preventDefault();
      }
   }
}


function totalcalc(f)
{
	var allsumm=0,summ=0;
	var id=0,count=0,sena=0;
	
	for (var n=0; n < f.elements.length; n++) 
	{
		el=f.elements[n];
		if (el.id.indexOf('ids_')!=-1)
		{
			id=el.value;
			count=parseInt(document.getElementById('count_'+id).value);
			if (!isNaN(count)) 
			{
				sena=document.getElementById('hidsena_'+id).value;
				summ=parseFloat(count)*parseFloat(sena);
				allsumm+=summ;
				//document.getElementById('summa_'+id).innerHTML=summ;
			}
		}
	}
	
	document.getElementById('totSumma').innerHTML=allsumm;
	document.getElementById('BlockCartSumma').innerHTML=allsumm;
}

function openimg(s)
{
 	window.open(s,'','width=800,height=662, scrollbars=0,resizable=0,status=0,toolbar=0,menubar=0,location=0');
}

function lmenuvh(id,zid)
{
	var d,dz;
	if (d=document.getElementById('lmenu'+id))
	{	
		if (document.getElementsByTagName("div")!=null) 
		{
    		for (i=0; i<document.getElementsByTagName("div").length; i++) 
			{
				dz=document.getElementsByTagName("div")[i];
				if (dz.className=='lmenuhid') dz.style.display='none';
			}
		}
		
		if (d.style.display=='block') d.style.display='none'; else d.style.display='block';	
	}	
	return void(0);
}