        var bV=parseInt(navigator.appVersion);
        NS4=(document.layers) ? true : false;
        IE4=((document.all)&&(bV>=4))?true:false;
        ver4 = (NS4 || IE4) ? true : false;
  
        function expandIt() {
            return
        }

        isExpanded = false;
    
        function initIt() {
            tempColl = document.getElementsByTagName("DIV");
            for (i=0; i<tempColl.length; i++) {
                if (tempColl[i].className == "child") tempColl[i].style.display = "none";
            }
        }
    
        function CloseIt() { 
            tempColl = document.getElementsByTagName("DIV");
            for (i=0; i<tempColl.length; i++) {
                if (tempColl[i].className == "child") tempColl[i].style.display = "none";
                if (tempColl[i].className == "childo") tempColl[i].style.display = "none";
             }
        }
      
        function expandIt(el) {
//            if (!ver4) return true;
            expandIE(el);
        
            return false;
        }
    
        function expandIE(el) {
  	      whichEl = document.getElementById(el + "Child");
        
            CloseIt();
        
            if (whichEl.style.display == "none") {
				if(IE4)
	                whichEl.style.display = "block";
				else
	                whichEl.style.display = "table-row";
            } else {
                whichEl.style.display = "none";
            }
    
        }
    
//        onload = initIt;

        function open_cart(url)
        {
             var w = window.open(url, 'shopping_ru_cart','width=550,height=400,scrollbars');
             w.focus();
        } 

        function add_to_cart_from_form(form)
        {
            id = form.id.value;
            size = form.size.value;
		nanesenie_str = '';

		if(form.add_nanesenie && form.id_nanesenie_product && form.id_nanesenie_txt)
		{
			add_nanesenie = form.add_nanesenie.checked;
			if(form.id_nanesenie_product.type == 'radio'){
				id_nanesenie_product = form.id_nanesenie_product.value;
			}
			else{
				for(i=0;i<form.id_nanesenie_product.length;i++){
					if(form.id_nanesenie_product[i].checked){
						id_nanesenie_product = form.id_nanesenie_product[i].value;
						break;
					}
				}
			}
			if(form.id_nanesenie_txt.value!='Ваш вариант')
				nanesenie_txt = form.id_nanesenie_txt.value;
			else
				nanesenie_txt = 'Номер:' + form.nanesenie_own_text_n.value + ' Фамилия:' + form.nanesenie_own_text_s.value;
			if(add_nanesenie)
				nanesenie_str = encodeURI('&id_nanesenie_product='+id_nanesenie_product + '&id_nanesenie_txt='+nanesenie_txt);
		}
		if(form["patches[]"])
		{
			for(i=0;i<form["patches[]"].length;i++)
			{
				if(form["patches[]"][i].checked)
					nanesenie_str += '&patches[]='+form["patches[]"][i].value;
			}
		}
		if(form.chest_patch && form.chest_patch.checked)
		{
			nanesenie_str+='&id_chest_product=' + form.chest_patch.value;
		}
            open_cart('/shopping/cart_view_new.php?func=add&id='+id+'&size='+size+nanesenie_str);
        }

        function notify_from_form(form)
        {
            id = form.id.value;
            size = form.size.value;

            window.open('<?=$CFG->wwwroot?>/shopping/product_add_notify.php?id='+id);
        }

        function show_big_image( id, img_width, img_height ) {
            var show_window = window.open(
                'show_big_image.php?id=' + id + '&w=' + img_width + '&h=' + img_height, '',
                'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,'+
                'width='+(img_width)+',height='+(img_height)
            );
        }
		