function setStylMenu(typ,initX,initY,buttonW,buttonH,buttonSpace){
 if(setStylMenu.arguments.length==0) {typ=0;}
 if(setStylMenu.arguments.length>1) this.pozX=initX
 if(setStylMenu.arguments.length>2) this.pozY=initY
 this.X=this.pozX
 this.Y=this.pozY
 this.mov()
 if(typ=='head') {
    this.item[0].backgroundColor='#35489e' //tło nagłówka
    this.item[0].border='1px solid #35489e' //brzeg nagłówka
    this.item[0].color='#ffffff' //kolor tekstu nagłówka
    this.item[0].fontSize=korekcjaRozdz+2 //wielkosc tekstu nagłówka
    this.item[0].textAlign='center'
    this.item[0].paddingLeft=0  //odstęp tekstu od brzegu
    this.item[0].bgOver=this.item[0].backgroundColor //tło nagłówka gdy jest nad nim mysza
    this.item[0].bgOut=this.item[0].backgroundColor //tło nagłówka gdy nie ma nad nim myszy
    this.item[0].colorOver=this.item[0].color // kolor nagłówka buttona gdy jest nad nim mysza
    this.item[0].colorOut=this.item[0].color // kolor nagłówka buttona gdy nie ma nad nim myszy
    this.item[0].borderOver=this.item[0].border //brzeg nagłówka gdy jest nad nad nim mysza
    this.item[0].borderOut=this.item[0].border //brzeg nagłówka gdy nie ma nad nim myszy
    if(this.canDrag) {this.item[0].cursor='move'} else {this.cursor='default'; this.item[0].cursor='default'}
    return
 }
 if(typ) this.type=typ;
 this.writeItem()
 if(typ==0) return
 if(this.type==1){
     if(setStylMenu.arguments.length>3) {this.buttW=buttonW;} else {this.buttW=14*korekcjaRozdz;}; //szerokość buttona
     if(setStylMenu.arguments.length>4) {this.buttH=buttonH;} else {this.buttH=parseInt(1.6*korekcjaRozdz);}; //wysokość buttona 
     this.padding=0 //margines wewnętrzny warstwy Uwaga:odczyt ma końcówkę 'px'
     this.backgroundColor='#bbbbbb' //tło warstwy
     this.border='1px solid #34489E' //brzeg warstwy
//     this.tab.cellSpacing=korekcjaRozdz05-2 //margines pomiędzy komórkami (buttonami) podmenu
     this.tab.cellSpacing=1 //margines pomiędzy komórkami (buttonami) podmenu
     this.fontSize=korekcjaRozdz //wielkosc tekstu
     this.fontFamily='Verdana, Arial'
     for (var i=0; i<this.item.length; i++) {
         this.item[i].backgroundColor='#A8F4FF' //tło buttona
         this.item[i].border='0px solid #99acc1' //brzeg bottona
         this.item[i].color='#34489e' //kolor tekstu buttona
         this.item[i].fontSize=korekcjaRozdz //wielkosc tekstu buttona
//         this.item[i].fontSize=korekcjaRozdz+korekcjaRozdz05-3 //wielkosc tekstu buttona
         this.item[i].fontWeight='bold'
         this.item[i].fontFamily='Verdana, Arial'
         this.item[i].textAlign='left'
         this.item[i].paddingLeft=korekcjaRozdz05  //odstęp tekstu od brzegu
         this.item[i].bgOver='#34489e' //tło buttona gdy jest nad nim mysza
         this.item[i].bgOut=this.item[i].backgroundColor //tło buttona gdy nie ma nad nim myszy
         this.item[i].colorOver='#f0f0f0' // kolor tekstu buttona gdy jest nad nim mysza
         this.item[i].colorOut=this.item[i].color // kolor tekstu buttona gdy nie ma nad nim myszy
         this.item[i].borderOver='1px solid #000000' //brzeg bottona gdy jest nad nad nim mysza
         this.item[i].borderOut=this.item[i].border //brzeg bottona gdy nie ma nad nim myszy
         if(setStylMenu.arguments.length<4) {this.td[i].noWrap=true;}
         this.td[i].height=this.buttH
         this.item[i].cursor='default'
     }
    if(this.canDrag) {this.cursor='crosshair';} else {this.cursor='default';}
//     this.pointScrollMenuY=this.pozY
//     this.tab.width=this.buttW
//     this.W=this.tab.offsetWidth
//     this.H=this.tab.offsetHeight
//     this.resiz();
  }
  else if(this.type==2){
     if(setStylMenu.arguments.length>3) {this.buttW=buttonW;} else {this.buttW=15*korekcjaRozdz;}; //szerokość buttona
     if(setStylMenu.arguments.length>5) {this.buttH=buttonH;} else {this.buttH=parseInt(1.8*korekcjaRozdz);}; //wysokość buttona    
     this.padding=0 //margines wewnętrzny warstwy Uwaga:odczyt ma końcówkę 'px'
     this.backgroundColor='#e8e8e8' //tło warstwy
//     this.border='1px solid #000000' //brzeg warstwy
     this.borderTop='1px solid #808080' //brzeg warstwy
     this.borderLeft='1px solid #808080' //brzeg warstwy
     this.borderRight='1px solid #ffffff' //brzeg warstwy
     this.borderBottom='1px solid #ffffff' //brzeg warstwy
     this.tab.border=1 //szerokosc brzegu tabeli
     this.tab.cellSpacing=0 //margines pomiędzy komórkami (buttonami) podmenu
     this.tabStyle.borderTop='1px solid #ffffff' //górny brzeg tabeli
     this.tabStyle.borderLeft='1px solid #ffffff' //lewy brzeg tabeli
     this.tabStyle.borderRight='1px solid #c0c0c0' //prawy brzeg tabeli
     this.tabStyle.borderBottom='1px solid #c0c0c0' //dolny brzeg tabeli
     this.tab.bgColor='#e8e8e8' //kolor tabeli
     for (var i=0; i<this.item.length; i++) {
         this.item[i].backgroundColor='#e8e8e8' //tło buttona
         this.item[i].border='1px solid #808080' //brzeg bottona
         this.item[i].color='#34489e' //kolor tekstu buttona
         this.item[i].fontSize=korekcjaRozdz+2 //wielkosc tekstu buttona
         this.item[i].fontWeight='bold'
         this.item[i].fontFamily='Verdana, Arial'
         this.item[i].textAlign='left'
         this.item[i].paddingLeft=5  //odstęp tekstu od brzegu
         this.item[i].borderTop='1px solid #ffffff' //górny brzeg bottona
         this.item[i].borderLeft='1px solid #ffffff' //lewy brzeg bottona
         this.item[i].borderRight='1px solid #a0a0a0' //prawy brzeg bottona
         this.item[i].borderBottom='1px solid #a0a0a0' //dolny brzeg bottona
         this.item[i].borderTopOver='1px solid #a0a0a0' //górny brzeg bottona gdy jest nad buttonem mysza
         this.item[i].borderLeftOver='1px solid #a0a0a0' //lewy brzeg bottona gdy jest nad buttonem mysza
         this.item[i].borderRightOver='1px solid #ffffff' //prawy brzeg bottona gdy jest nad buttonem mysza
         this.item[i].borderBottomOver='1px solid #ffffff' //dolny brzeg bottona gdy jest nad buttonem mysza
         this.item[i].borderTopOut=this.item[i].borderTop //górny brzeg bottona gdy nie ma nad buttonem myszy
         this.item[i].borderLeftOut=this.item[i].borderLeft //lewy brzeg bottona gdy nie ma nad buttonem myszy
         this.item[i].borderRightOut=this.item[i].borderRight //prawy brzeg bottona gdy nie ma nad buttonem myszy
         this.item[i].borderBottomOut=this.item[i].borderBottom //dolny brzeg bottona gdy nie ma nad buttonem myszy
         this.item[i].bgOver='#34489e' //tło buttona gdy jest nad nim mysza
         this.item[i].bgOut=this.item[i].backgroundColor //tło buttona gdy nie ma nad nim myszy
         this.item[i].colorOver='#e0e0e0' // kolor tekstu buttona gdy jest nad nim mysza
         this.item[i].colorOut=this.item[i].color // kolor tekstu buttona gdy nie ma nad nim myszy
         this.item[i].borderOver='1px solid #a0a0a0' //brzeg bottona gdy jest nad nad nim mysza
         this.item[i].borderOut=this.item[i].border //brzeg bottona gdy nie ma nad nim myszy
         if(setStylMenu.arguments.length<4) {this.td[i].noWrap=true;}
         this.td[i].height=this.buttH
         this.item[i].cursor='default'
     }
     this.cursor='default'
//     if(setStylMenu.arguments.length<4) {this.buttW=this.tab.offsetWidth+10;}
//     this.tab.width=this.buttW
//     this.W=this.tab.offsetWidth
//     this.H=this.tab.offsetHeight
//     this.resiz();
  }
  else if(this.type==3){
     if(setStylMenu.arguments.length>3) {this.buttW=buttonW;} else {this.buttW=15*korekcjaRozdz;}; //szerokość buttona
     if(setStylMenu.arguments.length>4) {this.buttH=buttonH;} else {this.buttH=parseInt(1.5*korekcjaRozdz);}; //wysokość buttona    
     this.padding=1 //margines wewnętrzny warstwy Uwaga:odczyt ma końcówkę 'px'
     this.backgroundColor='#ffffff' //tło warstwy
     this.border='1px solid #34489E' //brzeg warstwy
     this.tab.cellSpacing=1 //margines pomiędzy komórkami (buttonami) podmenu
//     this.tabStyle.borderTop='1px solid #000000' //górny brzeg tabeli
//     this.tabStyle.borderLeft='1px solid #000000' //lewy brzeg tabeli
//     this.tabStyle.borderRight='1px solid #000000' //prawy brzeg tabeli
//     this.tabStyle.borderBottom='1px solid #000000' //dolny brzeg tabeli
     this.tab.bgColor='#a8afbf' //kolor tabeli bylo  #000000  #bfcedf
     for (var i=0; i<this.item.length; i++) {
         this.item[i].backgroundColor='#e6edf8' //tło buttona  bylo c0c0c0
         this.item[i].border='1px solid #ffffff' //brzeg bottona    bylo #34489e
         this.item[i].color='#34489e' //kolor tekstu buttona
         this.item[i].fontSize=korekcjaRozdz+1 //wielkosc tekstu buttona
         this.item[i].fontWeight='bold'
         this.item[i].fontFamily='Verdana, Arial'
         this.item[i].textAlign='left'
         this.item[i].paddingLeft=korekcjaRozdz05  //odstęp tekstu od brzegu
         this.item[i].borderTop='1px solid #ffffff' //górny brzeg bottona
         this.item[i].borderLeft='1px solid #ffffff' //lewy brzeg bottona
         this.item[i].borderRight='1px solid #c7d4e4' //prawy brzeg bottona  bylo #a0a0a0
         this.item[i].borderBottom='1px solid #c7d4e4' //dolny brzeg bottona
         this.item[i].borderTopOver='1px solid #a0a0a0' //górny brzeg bottona gdy jest nad buttonem mysza
         this.item[i].borderLeftOver='1px solid #a0a0a0' //lewy brzeg bottona gdy jest nad buttonem mysza
         this.item[i].borderRightOver='1px solid #ffffff' //prawy brzeg bottona gdy jest nad buttonem mysza
         this.item[i].borderBottomOver='1px solid #ffffff' //dolny brzeg bottona gdy jest nad buttonem mysza
         this.item[i].borderTopOut=this.item[i].borderTop //górny brzeg bottona gdy nie ma nad buttonem myszy
         this.item[i].borderLeftOut=this.item[i].borderLeft //lewy brzeg bottona gdy nie ma nad buttonem myszy
         this.item[i].borderRightOut=this.item[i].borderRight //prawy brzeg bottona gdy nie ma nad buttonem myszy
         this.item[i].borderBottomOut=this.item[i].borderBottom //dolny brzeg bottona gdy nie ma nad buttonem myszy
         this.item[i].bgOver='#0066CC' //tło buttona gdy jest nad nim mysza   bylo #34489e
         this.item[i].bgOut=this.item[i].backgroundColor //tło buttona gdy nie ma nad nim myszy
         this.item[i].colorOver='#e0e0e0' // kolor tekstu buttona gdy jest nad nim mysza
         this.item[i].colorOut=this.item[i].color // kolor tekstu buttona gdy nie ma nad nim myszy
         this.item[i].borderOver='1px solid #FF0000' //brzeg bottona gdy jest nad nad nim mysza
         this.item[i].borderOut=this.item[i].border //brzeg bottona gdy nie ma nad nim myszy
         if(setStylMenu.arguments.length<4) {this.td[i].noWrap=true;}
         this.td[i].height=this.buttH
         this.item[i].cursor='default'
     }
//     this.tab.width=this.buttW
//     this.W=this.tab.offsetWidth
//     this.H=this.tab.offsetHeight
//     this.resiz();
  }
  else if(this.type==4){
     if(setStylMenu.arguments.length>3) {this.buttW=buttonW;} else {this.buttW=14*korekcjaRozdz;}; //szerokość buttona
     if(setStylMenu.arguments.length>4) {this.buttH=buttonH;} else {this.buttH=parseInt(2*korekcjaRozdz);}; //wysokość buttona    
     this.padding=0 //margines wewnętrzny warstwy Uwaga:odczyt ma końcówkę 'px'
     this.backgroundColor='#f0f0f0' //tło warstwy
     this.border='1px solid #34489e' //brzeg warstwy
     this.tab.cellSpacing=korekcjaRozdz05-1 //margines pomiędzy komórkami (buttonami) podmenu
     for (var i=0; i<this.item.length; i++) {
         this.item[i].backgroundColor='#34489e' //tło buttona
         this.item[i].border='1px solid #34489e' //brzeg bottona
         this.item[i].color='#e0e0e0' //kolor tekstu buttona
         this.item[i].fontSize=korekcjaRozdz+2 //wielkosc tekstu buttona
         this.item[i].fontWeight='bold'
         this.item[i].fontFamily='Verdana, Arial'
         this.item[i].textAlign='center'
         this.item[i].paddingLeft=0  //odstęp tekstu od brzegu
         this.item[i].bgOver='#d3ddeb' //tło buttona gdy jest nad nim mysza
         this.item[i].bgOut=this.item[i].backgroundColor //tło buttona gdy nie ma nad nim myszy
         this.item[i].colorOver='#34489e' // kolor tekstu buttona gdy jest nad nim mysza
         this.item[i].colorOut=this.item[i].color // kolor tekstu buttona gdy nie ma nad nim myszy
         this.item[i].borderOver='1px solid #34489e' //brzeg bottona gdy jest nad nad nim mysza
         this.item[i].borderOut=this.item[i].border //brzeg bottona gdy nie ma nad nim myszy
         if(setStylMenu.arguments.length<4) {this.td[i].noWrap=true;}
         this.td[i].height=this.buttH
         this.item[i].cursor='default'
     }
//     this.tab.width=this.buttW
//     this.W=this.tab.offsetWidth
//     this.H=this.tab.offsetHeight
//     this.resiz();
  }
  else if(this.type==-1){
     if(setStylMenu.arguments.length>3) {this.buttW=buttonW;} else {this.buttW=parseInt(korekcjaRozdz);}; //szerokość buttona
     if(setStylMenu.arguments.length>4) {this.buttH=buttonH;} else {this.buttH=parseInt(korekcjaRozdz);}; //wysokość buttona    
     if(setStylMenu.arguments.length>5) {this.buttSpace=buttonSpace;} else {this.buttSpace=parseInt(korekcjaRozdz05-3);}; //odległość między buttona    
     this.padding=0 //margines wewnętrzny warstwy Uwaga:odczyt ma końcówkę 'px'
     this.backgroundColor='#0066CC' //tło warstwy
     this.border='1px solid #000000' //brzeg warstwy
     for (var i=0; i<this.item.length; i++) {
         this.item[i].backgroundColor='#0066CC' //tło buttona
         this.item[i].border='1px solid #0066CC' //brzeg bottona
         this.item[i].color='#E0E0E0' //kolor tekstu buttona
         this.item[i].fontSize=korekcjaRozdz+korekcjaRozdz05 //wielkosc tekstu buttona
         this.item[i].fontWeight='bold'
         this.item[i].fontFamily='"Arial Narrow",Verdana, Arial'
         this.item[i].textAlign='center'
         this.item[i].paddingLeft=korekcjaRozdz  //odstęp tekstu od lewegp brzegu
         this.item[i].paddingRight=korekcjaRozdz  //odstęp tekstu od prawego brzegu
         this.item[i].bgOver='#e6edf8' //tło buttona gdy jest nad nim mysza   bylo #51CFFF
         this.item[i].bgOut=this.item[i].backgroundColor //tło buttona gdy nie ma nad nim myszy
         this.item[i].colorOver='#34489e' // kolor tekstu buttona gdy jest nad nim mysza
         this.item[i].colorOut=this.item[i].color // kolor tekstu buttona gdy nie ma nad nim myszy
         this.item[i].borderOver='1px solid #000000' //brzeg bottona gdy jest nad nad nim mysza bylo #FFFFFF
         this.item[i].borderOut=this.item[i].border //brzeg bottona gdy nie ma nad nim myszy
//         if(setStylMenu.arguments.length<4) {this.td[i].noWrap=true;}
         this.td[i].noWrap=true;
         this.spStyle[i].noWrap=true;
         this.td[i].width=this.buttW
         this.td[i].height=this.buttH
         this.buttStyle[i].padding=0 //szerokoć brzegu wokół komórki (buttona) w podmenu
         this.buttStyle[i].border='0px solid #34489e' //brzeg bottona
         this.buttStyle[i].backgroundColor='#e8e8e8' //tło wokół buttona
         this.spStyle[i].paddingLeft=this.buttSpace
         this.item[i].cursor='default'
     }
//     this.spStyle[0].paddingLeft=korekcjaRozdz2
     this.spStyle[0].paddingLeft=0
     this.spStyle[i].backgroundColor='#0066CC'
     this.spStyle[i].paddingLeft=0
     if(this.canDrag) {this.cursor='crosshair';} else {this.cursor='default';}
     this.pointScrollMenuY=this.pozY
  }

 if(this.type>=0){
   if(setStylMenu.arguments.length<4) {this.buttW=this.tab.offsetWidth+korekcjaRozdz;}
  this.tab.width=this.buttW
   this.W=this.tab.offsetWidth
   this.H=this.tab.offsetHeight
   this.resiz();
 } else {
  if(setStylMenu.arguments.length<4) {this.buttW=this.tab.offsetWidth+korekcjaRozdz;}
//   this.tab.height=this.buttH+parseInt(this.buttStyle[0].padding)
   this.W=this.tab.offsetWidth
   this.H=this.tab.offsetHeight
   this.resiz();
 }
}
