      function include(filename) {

               var js = document.createElement('script');
                   js.setAttribute('type', 'text/javascript');
                   js.setAttribute('src', filename);
                   js.setAttribute('defer', 'defer');
                   document.getElementsByTagName('HEAD')[0].appendChild(js);

               var cur_file = {};
                   cur_file[window.location.href] = 1;

                if (!window.php_js) window.php_js = {};
                if (!window.php_js.includes) window.php_js.includes = cur_file;
                if (!window.php_js.includes[filename]) {
                    window.php_js.includes[filename] = 1;
                } else {
                    window.php_js.includes[filename]++;
                }

                return window.php_js.includes[filename];
      }

      function LookWin(put,ww,hh){
               left1 = (screen.availWidth - ww)/2
               top1 = (screen.availHeight - hh)/2
               eval("window.open(\'"+put+"\',\'_blank',\'status=yes,top="+top1+",left="+left1+",toolbar=no,scrollbars=yes,directories=no,menubar=no,resizable=yes,width="+ww+",height="+hh+"\')");
      }

      function isEmpty(str) {

               for (var i = 0; i < str.length; i++)
                    if (" " != str.charAt(i))
                        return false;

               return true;
      }

      function checkStrForm(nameform,nameinput,msg){

               f = eval("document."+nameform+"."+nameinput);

               if (isEmpty(f.value)) { alert(msg); return false; }

               return true;
      }

      /////////////////////////
      function goods_price(priceGoods,percentGoods,currencyGoods,baseUnitGoods){

               rezpriceGoods = '';
               priceGoods = Math.ceil(priceGoods);
               if(percentGoods > 0){
                  oldpriceGoods = priceGoods;
                  rezpriceGoods = '<nobr><font size=-1 color=#FF2F00>Ñêèäêà '+percentGoods+'% </font></nobr><br><font color=#FF2F00>'+priceGoods+' '+currencyGoods+'</font><br>';
                  priceGoods=priceGoods-(priceGoods/100)*percentGoods;
                  priceGoods = Math.ceil(priceGoods);
                  rezpriceGoods = '<nobr><font size=-1 color=#FF2F00>Ñêèäêà '+percentGoods+'% </font></nobr><br><font color=#FF2F00>'+priceGoods+' '+currencyGoods+'</font><br><s style="color:#999999">'+oldpriceGoods+' '+currencyGoods+'</s>';
               } else {
                  rezpriceGoods = priceGoods+' '+currencyGoods;
               }

               promStr = ('<span class=tit3 style="color:#666666;font-size:18px">&nbsp;<b>'+rezpriceGoods+'</span>');

               return promStr;
      }

      var pLang = "ru";
      function form_add_cart(pagePar,addedCart,idGoods){

                    if(pLang=="ru"){
                       if(addedCart > 0) alt2="äîáàâëåí â êîðçèíó";
                       else alt2="äîáàâèòü â êîðçèíó";
                    } else {
                       if(addedCart > 0) alt2="is in cart";
                       else alt2="add cart";
                    }

                    if(addedCart > 0){
                       document.write('<Table cellPadding=0 CellSpacing=0 Border=0><Tr><Td><Img Src="images/addedcart_'+pLang+'.gif" Width=100 Height=30 Border=0 Alt="'+alt2+'"></Td></Tr></Table>');
                    } else {
                       document.write('<Table cellPadding=0 CellSpacing=0 Border=0><form action="?'+pagePar+'" method="post" name="addcart'+idGoods+'"><Tr><Td>'+
                       ' <input type=hidden name=addcart value=1>'+
                       ' <input type=hidden name=id_goods value='+idGoods+'>'+
                       ' <input type=hidden name=count_goods value=1>'+
                       ' <input type=image Src="images/addcart_'+pLang+'.gif" Width=100 Height=30 Border=0 Alt="'+alt2+'">'+
                       ' </Td></Tr></form></Table>');
                    }
           }

           function submitForm(nform,ww,hh){

	          left1 = (screen.availWidth - ww)/2;
              top1 = (screen.availHeight - hh)/2;

	          eval("window.open('about:blank', 'submit', 'top='+top1+',left='+left1+',toolbar=no,scrollbars=yes,directories=no,menubar=no,resizable=yes,width="+ww+",height="+hh+"');");
	          nform.target = 'submit';
	          nform.method = 'post';
        }

        function clickAddFormSubscr(NameF,AddEmail){

                 var f = eval("document."+NameF+".email");

                 if(f.value == AddEmail) f.value = "";

        }

        function AddFormSubscr(NameF,AddEmail,email,idsubscr){
                 if(email == '') email = AddEmail;
                   promstr  = '<Table Border=0 CellPadding=0 CellSpacing=0 class=maintext style="color:#ff2f00" Height=60><form action="subscribe.phtml" name="'+NameF+'">';
                   promstr += '<input type=hidden name=idsubscr value='+idsubscr+'>';
                   promstr += '<input type=hidden name=check value=add>';
                   promstr += '<Tr><Td style="padding-right:3px"><input type=text name="email" value="'+email+'" style="width:200px;height:25px;border:3px solid #394908;background:#485c0a;color:#b6d166" size=15 onClick="clickAddFormSubscr(\''+NameF+'\',\''+AddEmail+'\')"></Td>';
                   promstr += '<Td><input type=submit value=" ›› " onClick="submitForm(document.'+NameF+',350,200);" style="height:25px;background:#ffba07;border:3px solid #fe2a5c"></Td></Tr>';
                   promstr += '</form></Table>';

                   document.getElementById(NameF).innerHTML = promstr;
        }

        function window_clop(strParRows,strParCols,clrOk,numFr){

             if(strParRows != "") window.parent.document.all.tags('FRAMESET')[numFr].rows=strParRows;
             if(strParCols != "") window.parent.document.all.tags('FRAMESET')[numFr].cols=strParCols;

             if(clrOk > 0) document.write(" ");

       }

       function listForm(namelist,txtlist,curval,beginval,exitval){

                    document.write("<select name=\""+namelist+"\">");
                    document.write("<option value=\"0\">"+txtlist+"</option>");
                    for(i=beginval; i < exitval; i++){
                        document.write("<option value=\""+(i+1)+"\"");
                        if(i==curval-1) document.write(" selected");
                        document.write(">");
                        if(i < 9) document.write("0");
                        document.write((i+1)+"</option>");
                    }
                    document.write("</select>&nbsp;&nbsp;");
        }
      /////////////////////////
