function winop(width, height)	
{
	height = height+100;
	im = window.open('', 'addcart', 'top=40,left=40,width='+width+',height='+height+', scrollbars=yes, menu=no,status=yes,resizable=no');
	im.focus();
}
function imageopen(n,width, height)	
{
	height = height+100;
	width = width+60;
	im = window.open('', n, 'top=40,left=40,width='+width+',height='+height+', scrollbars=yes, menu=no,status=yes,resizable=yes');
	im.focus();
}

function winop2(imgurl, width, height)
{
    title = "window";
    im = window.open('', 'win','top=40,left=40,width='+width+',height='+height+', scrollbars=no, menu=no,status=no,resizable=no');
    im.focus();
    im.document.open ("text/html");
    im.document.write ('<html><title>'+title+'</title><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 bgcolor=#ffffff><table width=100% height=100% border=0 cellpadding=0 cellspacing=0><tr><td align=center><img src='+imgurl+' width='+width+' height='+height+'></td></tr></table></body></html>');
    im.document.close ();
}

function prepareNumber8(n)
{
	var s = Number(n).toFixed(12);
	s = s.substr(0, s.length - 10);
	for (var i = s.length - 6, j = n < 0 ? 1 : 0; i > j; i -= 3) s = s.substr(0, i) + "" + s.substr(i);
	return s;
}

var tOut;
var lastMenu = null;
var lastPluse = null;
var fClick = null;

function hideIt(s)
{
	punkt = document.getElementById('sub-'+s);
	
    punkt.style.visibility = "hidden";
    punkt.style.position='absolute';
}
function showObject (s, y, z)
{
	if (s != y && y != '' && fClick == null && z == 1)
	{
		lastMenu = document.getElementById('sub-'+y);
		lastPluse = document.getElementById('item-'+y);
		
		lastMenu.className = "list-submenu-none";
    	lastMenu.style.display = "none";
    	lastMenu.style.position = 'absolute';
    	lastPluse.className = "item";
		
		fClick = 1;
	}
	
	if (s != y && y != '' && fClick == null && z == 0)
	{
		lastPluse = document.getElementById('item-'+y);
		lastPluse.className = "item";
		
		fClick = 1;
	}

    if (lastMenu != null) 
    {
    	lastMenu.className = "list-submenu-none";
    	lastMenu.style.display = "none";
    	lastMenu.style.position = 'absolute';
    	lastPluse.className = "item";
    }
    
    if (s != '')
    {
    	punkt = document.getElementById('sub-'+s);
    	pluse = document.getElementById('item-'+s);
    	
    	//alert(punkt.className);
    	
    	if (lastMenu != punkt)
    	{
    		//if (punkt.className == "list-submenu-display")
    		//{
    		//	punkt.className = "list-submenu-none";
    		//	punkt.style.display = "none";
    		//	punkt.style.position = 'absolute';
    		//	pluse.src = "/images/cat-pluse.png";
   			//}
   			//else
   			//{
   				punkt.className = "list-submenu-display";
    			punkt.style.display = "inline";
    			punkt.style.position = 'static';
    			pluse.className = "item-this";		
   			//}
    	
    	lastMenu = punkt;
    	lastPluse = pluse;
    	}
    	else
    	{
    		lastMenu = null;
    		lastPluse = null;
    	}
    }
    else
    {
    	lastMenu = null;
    	lastPluse = null;
    }
}
function setLastMenu(s)
{
	lastMenu = document.getElementById('sub-'+s);
}
function hideObject(s)
{   
    tOut = window.setTimeout('this.hideIt(' + s + ');', 300);
}


