  
           function WindowOpen(url,ww,hh){
                    left1 = (screen.availWidth - ww)/2;
                    top1 = (screen.availHeight - hh)/2;
              
                    eval("window.open('"+url+"', 'win', 'top='+top1+',left='+left1+',toolbar=no,scrollbars=yes,directories=no,menubar=no,resizable=yes,width="+ww+",height="+hh+"');");
           }
   
   
           function one_str_catalog(idCat,nameCat){
                    document.write(''+           
                    '<Tr><Td Height=3><Img Src="images/pixel.gif" Border=0 Width=3 Height=3 Alt=""></Td></Tr>'+
                    '<Tr><Td><A Href="?id_categories='+idCat+'" class=gray>'+nameCat+'</A></Td></Tr>'+
                    '<Tr BgColor=#DFDEC Height=1><Td><Img Src="images/pixel.gif" Border=0 Width=1 Height=1 Alt=""></Td></Tr>');
           }
           
           function start_catalog(ImgList,nameCatalog){
                    
                    if(!ImgList) ImgList=1;
                    
                    document.write(''+           
                    '<br>'+
                    '<Table Width=170 Border=0 CellPadding=0 CellSpacing=0 BackGround="images/catalog_bg.gif">'+
                    '<Tr>'+
                    '<Td VAlign=top Width=20><Img Src="clipart/'+ImgList+'.gif" Border=0 Width=14 Height=19 title="'+nameCatalog+'"></Td>'+
                    '<Td class=titred>'+nameCatalog+'</Td>'+
                    '</Tr>'+
                    '<Tr>'+
                    '<Td>&nbsp;</Td>'+
                    '<Td>'+
                    '<Table Width=100% Border=0 CellPadding=0 CellSpacing=0 class=listgray>');
           }
           function end_catalog(){
                    document.write(''+
                    '</Table>'+
                    '<Tr><Td ColSpan=2 Height=9><Img Src="images/pixel.gif" Border=0 Width=9 Height=9 Alt=""></Td></Tr>'+
                    '</Table>');
           }
           //////
           function start_arrow_list(styleList){
                    document.write(''+           
                    '<Table Width=100% Border=0 CellPadding=0 CellSpacing=0 class='+styleList+'>');
           }
           function one_str_arrow_list(nameCat,strPar){
                    document.write(''+           
                    '<Tr><Td Height=3 ColSpan=2><Img Src="images/pixel.gif" Border=0 Width=3 Height=3 Alt=""></Td></Tr>'+
                    '<Tr><Td Width=13 Valign=top><Img Src="images/bullet_arrow.gif" Border=0 Width=8 Height=7 Alt="" VSpace=3></Td><Td><A href="'+strPar+'" class=red>'+nameCat+'</A></Td></Tr>'+
                    '<Tr BgColor=#DFDEC Height=1><Td ColSpan=2><Img Src="images/pixel.gif" Border=0 Width=1 Height=1 Alt=""></Td></Tr>');
           }
           function end_arrow_list(){
                    document.write(''+
                    '<Tr><Td ColSpan=2 Height=9><Img Src="images/pixel.gif" Border=0 Width=9 Height=9 Alt=""></Td></Tr>'+
                    '</Table>');
           }
           //////
           function rm_title(colorRm,imgRm,nameRm){
                    document.write(''+           
                    '<Table Width=185 Border=0 Height=4 CellPadding=0 CellSpacing=0><Tr><Td><Img Src="images/pixel.gif" Width=185 Height=4 Border=0 Alt=""></Td></Tr></Table>'+
                    '<Table Width=185 Border=0 Height=29 CellPadding=0 CellSpacing=0 BackGround="images/rm_'+colorRm+'_bg.gif" class=titred>'+
                    '<Tr>'+
                    '<Td Width=45 Align=right VAlign=bottom><Img Src="images/rm_bullet_'+imgRm+'.gif" Border=0 Width=22 Height=22 title="'+nameRm+'" HSpace=10 VSpace=3></Td>'+
                    '<Td><Img Src="images/pixel.gif" Border=0 Width=15 Height=5 Alt=""><br>'+nameRm+'</Td>'+
                    '</Tr>'+
                    '</Table>');
           }           
           //////
           
           function myround(chislo){
            
            var strchislo = ""+chislo;
            var drob = 0;
                drob = strchislo.indexOf(".",0);
            
            
            if(drob){

               var celoe = strchislo.substring(0,drob);
               var rezdrob = strchislo.substring(drob+1);
               
               if(rezdrob.length > 3) rezdrob = rezdrob.substring(0,2);
               if(rezdrob.length == 1) rezdrob += "0";
               
               return celoe+"."+rezdrob;
               
            } else {
               return parseInt(chislo)+".00";
            }
            
           }
           function one_goods_small(tNew,pagePar,addedCart,pLang,idGoods,numPrice,nameImg,nameGoods,priceSale,priceGoods){
           
                    if(nameImg == "") nameImg="images/nophoto.gif";
                    if(pLang=="ru"){
                       alt1="купить сейчас";
                    } else {
                       alt1="buy now";
                    }
                    
                    document.write(''+
                    '<Table Align=center Width=85% CellPadding=0 CellSpacing=0 Border=0><Tr><Td class=titorange><Img Src="images/bullet_graybox.gif" Border=0 Width=2 Height=7 Alt="">&nbsp;&nbsp;');
                    if(tNew) document.write('<Img Src="images/new.gif" Border=0 Width=26 Height=12 title="NEW">&nbsp;');
                    document.write('<A Href="?check=lookgoods&id_goods='+idGoods+'" class=orange>'+nameGoods+'</A><br><Img Src="images/pixel.gif" Border=0 Width=50 Height=5 Alt=""></Td></Tr></Table>'+
                    '<Table Align=center Width=75% CellPadding=0 CellSpacing=0 Border=0>'+
                    '<Tr>'+
                    '  <Td><Table Width=97% Height=150 CellPadding=0 CellSpacing=0 Border=0>'+
                    '  <Tr Height=120><Th ColSpan=2><Table CellPadding=0 CellSpacing=0 Border=0><Tr><Th Width=1><Img Src="images/pixel.gif" Border=0 Width=1 Height=120></Th><Th><A Href="?check=lookgoods&id_goods='+idGoods+'"><Img Src="'+nameImg+'" Border=0 title="'+nameGoods+'"></A></Th></Tr></Table></Th></Tr>'+
                    '  <Tr><Th ColSpan=3><hr size=1 color=#CECDB9></Th></Tr>'+
                    '  <Tr><Td Width=44 ColSpan=2>'+
                    '  <A Href="?check=fastorder&id_goods='+idGoods+'"><Img Src="images/but_buy_now_'+pLang+'.gif" Height=11 Border=0 title="'+alt1+'" VSpace=5></A><br>');
                    form_add_cart(pagePar,addedCart,pLang,idGoods,numPrice);
                    document.write(''+
                    '  </Td><Td Align=right Valign=top class=listgray1><Img Src="images/pixel.gif" Border=0 Width=50 Height=1 Alt=""><br>');
                    
                    if(priceSale > 0) {
                       document.write('<span class=listsale>UAH <s>'+priceGoods+' ($ '+myround(priceGoods/DollCurs)+')</s></span><br>');
                       priceGoods=priceGoods-(priceGoods/100)*priceSale;
                     }  
                    
                    document.write(''+
                    '  UAH<b> '+priceGoods+' <br>($ '+myround(priceGoods/DollCurs)+')</b>'+
                    '  </Td></Tr>'+                    
                    '  </Table>'+
                    '</Td></Tr>'+
                    '</Table>');
                    
           }
           
           function but_back(pLang){
                    document.write('<A Href="javascript:history.back()"><Img Src="images/but_back_'+pLang+'.gif" Border=0 Height=12');
                    if(pLang=="ru") document.write('Width=35 title="назад"');
                    else document.write('Width=29 title="back"');
                    document.write(' VSpace=10></A>');
                    
           }
           
           function form_add_cart(pagePar,addedCart,pLang,idGoods,numPrice){
                    
                    if(pLang=="ru"){
                       if(addedCart) alt2="добавлен в корзину";
                       else alt2="добавить в корзину";
                    } else {
                       if(addedCart) alt2="is in cart";
                       else alt2="add cart";
                    }
                    
                    if(addedCart){
                       document.write('<Table cellPadding=0 CellSpacing=0 Border=0><Tr><Td><Img Src="images/but_addedcart_'+pLang+'.gif" Width=74 Height=20 Border=0 title="'+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=numprice value='+numPrice+'>'+
                       ' <input type=image Src="images/but_addcart_'+pLang+'.gif" Width=74 Height=20 Border=0 title="'+alt2+'">'+
                       ' </Td></Tr></form></Table>');
                    }            
           }
           
           ///////
              var ZoomId = 1;
              var StartW = 0;
              function ZoomPhoto(){
                      
                         if(ZoomId) ZoomKoef = 50;
                         else ZoomKoef = -50;
                         
                         if(!StartW) StartW = document.images.GoodsPhoto.width;
                         if(document.images.GoodsPhoto.width == StartW+100) ZoomId = 0;
                         if(document.images.GoodsPhoto.width == StartW + 50) ZoomId = 1;
                         eval("document.images.ZoomImg.src='images/zoom"+ZoomId+".gif';");
                         
                         OldW = document.images.GoodsPhoto.width;
                         OldH = document.images.GoodsPhoto.height;
                         NewW = document.images.GoodsPhoto.width + ZoomKoef;
                      
                         document.images.GoodsPhoto.width = NewW;
                         document.images.GoodsPhoto.height = Math.ceil((NewW*OldH)/OldW); 
                     
             }
           ///////
           function TrimStr(Str){
           
                    while(Str.substr(0,1) == " "){
                          Str = Str.substr(1);
                    }
           
                    return Str;
           }
           
           function CheckFormOrder(pLang){
                    eval("ff = document.forms.formorder");
           
                    if(TrimStr(ff.r_name.value) == "") {
                       if(pLang == "ru") alert("Вы забыли указать имя поучателя!");
                       else alert("You have forgotten to indicate recipient name!");
                       return false;
                    } else {
                       if(TrimStr(ff.r_addr.value) == "") {
                          if(pLang == "ru") alert("Вы забыли указать адрес поучателя!");
                          else alert("You have forgotten to indicate recipient address!");
                          return false;
                       } else {
                          if(TrimStr(ff.city.value) == "") {
                             if(pLang == "ru") alert("Вы забыли указать город поучателя!");
                             else alert("You have forgotten to indicate recipient city!");
                             return false;
                          } else {
                             if(TrimStr(ff.s_name.value) == "") {
                                if(pLang == "ru") alert("Вы забыли указать имя отправителя!");
                                else alert("You have forgotten to indicate sender name!");
                                return false;
                             } else {
                                if(TrimStr(ff.s_name.value) == "") {
                                   if(pLang == "ru") alert("Вы забыли указать email отправителя!");
                                   else alert("You have forgotten to indicate sender email!");
                                   return false;
                                }
                             }
                          }
                       } 
                    }
                    return true;
           }
           
           function add_swf(nameMov,bgMov,wwMov,hhMov,varsMov){

              document.writeln('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" '+
                               'WIDTH="'+wwMov+'" HEIGHT="'+hhMov+'" id="'+nameMov+'" ALIGN=""> '+
                               '<PARAM NAME=movie VALUE="'+nameMov+'"> ');                                
              if(varsMov != "")  document.writeln('<PARAM NAME=FlashVars VALUE="'+varsMov+'"> ');  
              document.writeln('<PARAM NAME=quality VALUE=high> '+
                               '<PARAM NAME=wmode VALUE=transparent> '+
                               '<PARAM NAME=wmode VALUE=opaque> '+
                               '<PARAM NAME=bgcolor VALUE=#'+bgMov+'> '+
                               '<EMBED src="'+nameMov+'"> '); 
              if(varsMov != "") document.writeln('FlashVars = "'+varsMov+'" ');
              document.writeln('quality=high '+
                               'wmode=transparent '+
                               'bgcolor=#'+bgMov+' NAME="" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED> '+
                               '</OBJECT>');
           }
