function OpenSmallWinWithScrool(h, v, url) {
	var params="menubar=no,location=no,resizable=yes,scrollbars=yes,status=no,width="+h+",height="+v;
	window.open(url, 'add', params);
	}
function OpenSmallWinWithOutScrool(h, v, url) {
	var params="menubar=no,location=no,resizable=yes,scrollbars=no,status=no,width="+h+",height="+v;
	window.open(url, 'add', params);
	}
function OpenNewSmallWinWithScrool(h, v, url) {
	var params="menubar=no,location=no,resizable=yes,scrollbars=yes,status=no,width="+h+",height="+v;
	window.open(url, "_blank", params);
	}


function enable_add()
{
	document.forms.add_buy.add.disabled=false;
}


function StartList() 
{
	/*
	if (document.all&&document.getElementById) 
	{
		navRoot = document.getElementById("shopmenu");
		for (i=0; i<navRoot.childNodes.length; i++) 
		{
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") 
			{
				node.onmouseover=function() 
				{
					this.className+=" over";
				}
				node.onmouseout=function() 
				{
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}*/
}

function checkFinish()
{
	var noc=0, nop=0, i, chDeliver=0;
	noc=document.forms.cart.deliver_id.length;	
	
	if(document.forms.cart.deliver_id.value && document.forms.cart.deliver_id.checked)
	{
		chDeliver=1;
	}
	else
	{
		for(i=0; i<noc; i++)
		{	
			if(document.forms.cart.deliver_id[i].checked)
			{
				chDeliver=1;
			}
		}
	}


	if(document.forms.cart.region_id.value>0 && chDeliver==1)
		document.forms.cart.finish.disabled=false;
	else
		document.forms.cart.finish.disabled=true;
}

startMainMenu = function() 
{
      if (document.all&&document.getElementById) {
            navRoot = document.getElementById("mainmenu");
            for (i=0; i<navRoot.childNodes.length; i++) {
                  node = navRoot.childNodes[i];
                  if (node.nodeName=="LI") {
                        node.onmouseover=function() {
                              this.className+=" over";
                        }
                        node.onmouseout=function() {
                              this.className=this.className.replace(" over", "");
                        }
                  }
            }
      }
}

function checkAmount()
{
	var noc=0, i=0, amount=0;
	noc=document.forms.add_buy.length;
	varname=new String;
	for(i=0; i<noc; i++)
	{
		varname=document.forms.add_buy[i].name;
		if(varname.indexOf("color_id")>-1 && document.forms.add_buy[i].value>0)
			amount=1;
	}
	if(!amount)	
	{
		alert("Укажите необходимое количество товара!");		
	}
	else
	{
		document.forms.add_buy.submit();
	}
}

function switchMenu(obj_name, pic_name)
{
	var item;
	item=new getObj(obj_name);
	if(item.style.display=="block")
	{
		item.style.display="none";
		document.images[pic_name].src="/i/plus.gif";
	}
	else
	{
		item.style.display="block";
		document.images[pic_name].src="/i/minus.gif";
	}
}

