/*** Flash object ***/

function InsertObject()
{
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="350" height="260" id="logo" align="middle">');
document.write('<param name="allowScriptAccess" value="sameDomain" />');
document.write('<param name="movie" value="flash/logo.swf" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="wmode" value="transparent" />');
document.write('<param name="bgcolor" value="#ffffff" />');
document.write('<embed src="flash/logo.swf" quality="high" wmode="transparent" name="wmode" value="transparent" bgcolor="#ffffff" width="350" height="260" name="logo" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');
}

//* Меню сверху
var menu=function(){
	var t=15,z=50,s=6,a;
	function dd(n){this.n=n; this.h=[]; this.c=[]}
	dd.prototype.init=function(p,c){
		a=c; var w=document.getElementById(p), s=w.getElementsByTagName('ul'), l=s.length, i=0;
		for(i;i<l;i++){
			var h=s[i].parentNode; this.h[i]=h; this.c[i]=s[i];
			h.onmouseover=new Function(this.n+'.st('+i+',true)');
			h.onmouseout=new Function(this.n+'.st('+i+')');
		}
	}
	dd.prototype.st=function(x,f){
		var c=this.c[x], h=this.h[x], p=h.getElementsByTagName('a')[0];
		clearInterval(c.t); c.style.overflow='hidden';
		if(f){
			p.className+=' '+a;
			if(!c.mh){c.style.display='block'; c.style.height=''; c.mh=c.offsetHeight; c.style.height=0}
			if(c.mh==c.offsetHeight){c.style.overflow='visible'}
			else{c.style.zIndex=z; z++; c.t=setInterval(function(){sl(c,1)},t)}
		}else{p.className=p.className.replace(a,''); c.t=setInterval(function(){sl(c,-1)},t)}
	}
	function sl(c,f){
		var h=c.offsetHeight;
		if((h<=0&&f!=1)||(h>=c.mh&&f==1)){
			if(f==1){c.style.filter=''; c.style.opacity=1; c.style.overflow='visible'}
			clearInterval(c.t); return
		}
		var d=(f==1)?Math.ceil((c.mh-h)/s):Math.ceil(h/s), o=h/c.mh;
		c.style.opacity=o; c.style.filter='alpha(opacity='+(o*100)+')';
		c.style.height=h+(d*f)+'px'
	}
	return{dd:dd}
}();

//* Меню слева
$j = jQuery.noConflict();
$j(document).ready( function () {
    $j("ul.submenu:not('.open')").hide();
    $j("ul.submenu2:not('.open')").hide();
	
	$j("#navigation li.toggleSubMenu > a").click( function (event){
		$j("#navigation > li").removeClass("active");
		$j(this).parent().addClass("active");
		if ($j(this).next("ul.submenu:visible").length != 0){
			return true;
		}else{
			$j("#navigation li.active").removeClass("active")
			$j("#navigation ul.submenu").slideUp("normal", function () {  } );
			$j(this).parent().addClass("active")
			$j(this).next("ul.submenu").slideDown("normal", function () {  } );
		}
		return false;
	});

	$j("li.toggleSubMenu2 > a").click( function (event){

		$j("li.toggleSubMenu2").removeClass("active");
		$j(this).parent().addClass("active");

		if ($j(this).next("ul.submenu2:visible").length != 0){
			return true;
		}else{
			$j("li.toggleSubMenu2 li.active").removeClass("active")
			$j("li.toggleSubMenu2 ul.submenu2").slideUp("normal", function () {  } );

			$j(this).addClass("active");
			$j(this).next("ul.submenu2").slideDown("normal", function () {  } );
		}
		return false;
	});

});	

function exposeItem(id)
{    
   obj = document.getElementById(id);
   if (obj != null)
    obj.style.display = (obj.style.display == "" ? "none" : "");            
}

//-->

function ShowFilling() {
     var obj_id = document.getElementById("filling");
     var option = obj_id.options[obj_id.options.selectedIndex].value;
     if((option==1)||(option==2))
        {
             document.getElementById("fillingfield").style.display='block'    
        }
      else
            document.getElementById("fillingfield").style.display='none'       
}

function openNewWin(url, name, scr, w, h)
{
	var w1 = window.open(url, name, 'toolbar=no,location=no,status=no,menubar=no,resizable=no,directories=no,scrollbars=yes,width='+w+',height='+h+'');
	w1.focus();
}

function Calculate()
{
 res = Math.round( document.getElementById("quanitity").value * 0.15 * 100) / 100;
 if (res == 0)
  return;

 document.getElementById("txtKG").value = res;
 document.getElementById("lKG").innerText = (res+ " кг");
}
//-->