function xSelect(cd)
{
 selectListStep=20;
 selectCurrentY=0;
 selectX=0;
 if(!cd) code='728381';
 else code=cd;
 preload("selectUp",root+"graph/bt_up.gif");
 preload("selectUp_ov",root+"graph/bt_up_ov.gif");
 preload("selectUp_dn",root+"graph/bt_up_down.gif");
 preload("selectDown",root+"graph/bt_down.gif");
 preload("selectDown_ov",root+"graph/bt_down_ov.gif");
 preload("selectDown_dn",root+"graph/bt_down_down.gif");
 /*
 preload("selectUp_r",root+"graph/bt_rollup_red.gif");
 preload("selectUp_r_ov",root+"graph/bt_rollup_red_ov.gif");
 preload("selectUp_r_dn",root+"graph/bt_rollup_red_dn.gif");
 preload("selectDown_r",root+"graph/bt_rolldown_red.gif");
 preload("selectDown_r_ov",root+"graph/bt_rolldown_red_ov.gif");
 preload("selectDown_r_dn",root+"graph/bt_rolldown_red_dn.gif");
 
 preload("selectUp_g",root+"graph/bt_rollup_grey.gif");
 preload("selectUp_g_ov",root+"graph/bt_rollup_grey_ov.gif");
 preload("selectUp_g_dn",root+"graph/bt_rollup_grey_down.gif");
 preload("selectDown_g",root+"graph/bt_rolldown_grey.gif");
 preload("selectDown_g_ov",root+"graph/bt_rolldown_grey_ov.gif");
 preload("selectDown_g_dn",root+"graph/bt_rolldown_grey_dn.gif");
 */
 preload("selectZipDown",root+"graph/bt_pasek_down.gif");
 preload("selectZipDown_ov",root+"graph/bt_down_ov.gif");
 preload("selectZipDown_down",root+"graph/bt_down_down.gif");
 preload("selectZipUp",root+"graph/bt_pasek_up.gif");
 preload("selectZipUp_ov",root+"graph/bt_up_ov.gif");
 preload("selectZipUp_down",root+"graph/bt_up_down.gif");
 
 this.selectColor=function(id, c)
 {
  bg=new Array;
  bg[1]='bg_pole.gif';
  bg[2]='bg_pole_zolte.gif';
  bg[3]='bg_pole_rozowe.gif';
  bg[4]='bg_pole_biale.gif';
  bg[5]='bg_pole_czerwone.gif';
  bColor=new Array;
  bColor[1]='#fff799';
  bColor[2]='#f3e000';
  bColor[3]='#ffcbd2';
  bColor[4]='#f0f0f0';
  bColor[5]='#ff0000';
  tColor=new Array;
  tColor[1]='#000000';
  tColor[2]='#000000';
  tColor[3]='#000000';
  tColor[4]='#787878';
  tColor[5]='#ffffff';
  document.getElementById('xsColor'+id+code).style.backgroundImage='url('+root+'graph/'+bg[c]+')';
  document.getElementById('selectInput'+id+code).style.color=tColor[c];
  
  if(c==1)
  {
   document.getElementById('selectBtImg'+id+code).src=selectDown.src;
   document.getElementById('selectButton'+id+code).onmouseover=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=selectDown_ov.src;};
   document.getElementById('selectButton'+id+code).onmouseout=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=selectDown.src;};
   document.getElementById('selectButton'+id+code).onmousedown=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=selectDown_dn.src;};
   document.getElementById('selectButton'+id+code).onmouseup=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=selectDown_ov.src;};
  }
  else if(c==4)
  {
   document.getElementById('selectBtImg'+id+code).src=selectDown_g.src;
   document.getElementById('selectButton'+id+code).onmouseover=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=selectDown_g_ov.src;};
   document.getElementById('selectButton'+id+code).onmouseout=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=selectDown_g.src;};
   document.getElementById('selectButton'+id+code).onmousedown=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=selectDown_g_dn.src;};
   document.getElementById('selectButton'+id+code).onmouseup=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=selectDown_g_ov.src;};
  }
  else if(c==5)
  {
   document.getElementById('selectBtImg'+id+code).src=selectDown_r.src;
   document.getElementById('selectButton'+id+code).onmouseover=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=selectDown_r_ov.src;};
   document.getElementById('selectButton'+id+code).onmouseout=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=selectDown_r.src;};
   document.getElementById('selectButton'+id+code).onmousedown=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=selectDown_r_dn.src;};
   document.getElementById('selectButton'+id+code).onmouseup=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=selectDown_r_ov.src;};
  }
 };
 
 function selectShowList()
 {
  x=this.id.replace('selectListOut', '');
  x=x.replace('selectButton', '');
  selectX=x;
  sList=document.getElementById('selectListOut'+x);
  
  if(sList.style.display=='block')
  {
   imgO=document.getElementById('selectBtImg'+x).src.replace('_', '').replace('bt', '').replace('rollup', '').replace('ov', '').replace('.gif', '').replace('_', '').replace('_', '').replace('_', '');
   imgTmp=imgO.split('/');
   imgO=imgTmp[(imgTmp.length-1)];
   if(imgO=='red') col='_r';
   else if(imgO=='grey') col='_g';
   else col='';
  
   document.getElementById('selectBtImg'+x).src=eval('selectDown'+col+'_ov.src');
   document.getElementById('selectButton'+x).onmouseover=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=eval('selectDown'+col+'_ov.src');};
   document.getElementById('selectButton'+x).onmouseout=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=eval('selectDown'+col+'.src');};
   document.getElementById('selectButton'+x).onmousedown=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=eval('selectDown'+col+'_dn.src');};
   document.getElementById('selectButton'+x).onmouseup=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=eval('selectDown'+col+'_ov.src');};
   document.getElementById('selectItems'+x).scrollTop='0px';
   sList.style.display='none';
  }
  else
  {
   imgO=document.getElementById('selectBtImg'+x).src.replace('_', '').replace('bt', '').replace('rolldown', '').replace('ov', '').replace('.gif', '').replace('_', '').replace('_', '').replace('_', '');
   imgTmp=imgO.split('/');
   imgO=imgTmp[(imgTmp.length-1)];
   if(imgO=='red') col='_r';
   else if(imgO=='grey') col='_g';
   else col='';
  
   document.getElementById('selectBtImg'+x).src=eval('selectUp'+col+'_ov.src');
   document.getElementById('selectButton'+x).onmouseover=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=eval('selectUp'+col+'_ov.src');};
   document.getElementById('selectButton'+x).onmouseout=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=eval('selectUp'+col+'.src');};
   document.getElementById('selectButton'+x).onmousedown=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=eval('selectUp'+col+'_dn.src');};
   document.getElementById('selectButton'+x).onmouseup=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=eval('selectUp'+col+'_ov.src');};
   
   sList.style.display='block';
   document.getElementById('selectDown'+x).onclick=selectListDown;
   document.getElementById('selectUp'+x).onclick=selectListUp;
   document.getElementById('selectScroll'+x).onmousedown=selectScrollMoveStart;
   document.onmouseup=selectScrollMoveEnd;
   //document.getElementById('selectScroll'+x).onmouseout=selectScrollMoveEnd;
  
   var i=0;
   while(sObj=document.getElementById('selectItem'+x+'_'+i))
   {
    sObj2=document.getElementById('selectItem2'+x+'_'+i);
    sObj2.onmouseover=function (){this.style.backgroundColor='#bceeff'};
    sObj2.onmouseout=function (){this.style.backgroundColor=''; this.style.color='#000000';};
    sObj.onclick=selectChoose;
    i++;
   }
  }
  selectScrollSize(x);
  selectScrollPosition(x);
 }
  
 function selectChoose()
 {
  var x_tmp=this.id.split('_');
  var x=x_tmp[0].replace('selectItem', '');
  
  imgO=document.getElementById('selectBtImg'+x).src.replace('_', '').replace('bt', '').replace('rollup', '').replace('ov', '').replace('.gif', '').replace('_', '').replace('_', '').replace('_', '');
  imgTmp=imgO.split('/');
  imgO=imgTmp[(imgTmp.length-1)];
  if(imgO=='red') col='_r';
  else if(imgO=='grey') col='_g';
  else col='';
  
  document.getElementById('selectBtImg'+x).src=eval('selectDown'+col+'.src');
  document.getElementById('selectButton'+x).onmouseover=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=eval('selectDown'+col+'_ov.src');};
  document.getElementById('selectButton'+x).onmouseout=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=eval('selectDown'+col+'.src');};
  document.getElementById('selectButton'+x).onmousedown=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=eval('selectDown'+col+'_dn.src');};
  document.getElementById('selectButton'+x).onmouseup=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=eval('selectDown'+col+'_ov.src');};
  
  document.getElementById('selectItems'+x).scrollTop='0px';
  document.getElementById('selectInput'+x).value=this.innerHTML;
  //setVal(gEBI('selectItemValue'+this.id.replace('selectItem', '')).innerHTML);
  sList=document.getElementById('selectListOut'+x).style.display='none';
  document.getElementById(x.replace(code, '')).value=document.getElementById('selectItemValue'+this.id.replace('selectItem', '')).innerHTML;
  try
  {
   selectEvent(x);
  }
  catch(e)
  {}
 }

 function selectListUp()
 {
  x=this.id.replace('selectUp', '');
  document.getElementById('selectItems'+x).scrollTop=document.getElementById('selectItems'+x).scrollTop-selectListStep;
  selectScrollPosition(x);
 }

 function selectListDown()
 {
  x=this.id.replace('selectDown', '');
  document.getElementById('selectItems'+x).scrollTop=document.getElementById('selectItems'+x).scrollTop+selectListStep;
  selectScrollPosition(x);
 }

 function selectScrollSize(x)
 {
  zip=document.getElementById('selectScroll'+x);
  zip2=document.getElementById('selectScroll2'+x);
  scrollItemsHeight=document.getElementById('selectItems'+x).offsetHeight;
  scrollItemsHeightFull=document.getElementById('selectItems'+x).scrollHeight;
  scrollAreaHeight=scrollItemsHeight-(2+document.getElementById('selectUp'+x).offsetHeight+document.getElementById('selectDown'+x).offsetHeight);
  scrollZipHeight=(scrollItemsHeight/scrollItemsHeightFull)*scrollAreaHeight;
  if(scrollZipHeight<scrollAreaHeight)
  {
   zip.style.display='block';
   zip.style.height=scrollZipHeight+'px';
   zip2.style.height=scrollZipHeight+'px';
  }
  else
  {
   zip.style.display='none';
  }
 }

 function selectScrollPosition(x)
 {
  zip=document.getElementById('selectScroll'+x);
  scrollItemsHeight=document.getElementById('selectItems'+x).offsetHeight;
  scrollItemsScroll=document.getElementById('selectItems'+x).scrollTop;
  scrollItemsHeightFull=document.getElementById('selectItems'+x).scrollHeight-scrollItemsHeight;
  scrollAreaHeight=scrollItemsHeight-(0+document.getElementById('selectUp'+x).offsetHeight+document.getElementById('selectDown'+x).offsetHeight);
  scrollZipHeight=document.getElementById('selectScroll'+x).offsetHeight;
 
  scrollPercent=scrollItemsScroll/scrollItemsHeightFull;
  scrollAreaHeight=scrollAreaHeight-scrollZipHeight;
  sMargin=2+document.getElementById('selectUp'+x).offsetHeight+(scrollPercent*scrollAreaHeight);
  if(!isNaN(sMargin)) zip.style.marginTop=sMargin;
 }

 function selectPositionScroll(x)
 {
  zip=document.getElementById('selectScroll'+x);
  scrollItemsHeight=document.getElementById('selectItems'+x).offsetHeight;
  scrollItemsScroll=document.getElementById('selectItems'+x).scrollTop;
  scrollItemsHeightFull=document.getElementById('selectItems'+x).scrollHeight-scrollItemsHeight;
  scrollAreaHeight=scrollItemsHeight-(2+document.getElementById('selectUp'+x).offsetHeight+document.getElementById('selectDown'+x).offsetHeight);
  scrollZipHeight=document.getElementById('selectScroll'+x).offsetHeight;
  scrollAreaHeight=scrollAreaHeight-scrollZipHeight;
  scrollMargin=parseInt(zip.style.marginTop.replace('px', ''))-(4+document.getElementById('selectUp'+x).offsetHeight);
  scrollPercent=scrollMargin/scrollAreaHeight;
 
  document.getElementById('selectItems'+x).scrollTop=scrollItemsHeightFull*scrollPercent;
 }

 function selectScrollMoveStart(e)
 {
  var IE=document.all?true:false;
  if(IE)
  {
   tempY=event.clientY+document.body.scrollTop;
  }
  else
  {
   tempY=e.pageY;
  }   
  if(tempY<0) tempY=0;
  selectCurrentY=tempY;
  x=parseInt(this.id.replace('selectScroll', ''));
  selectX=x;
  document.onmousemove=getMouseY;
 }

 function selectScrollMoveEnd()
 {
  document.onmousemove=null;
 }

 function getMouseY(e)
 {
  x=selectX;
  var IE=document.all?true:false;
  if(IE)
  {
   tempY=event.clientY+document.body.scrollTop;
  }
  else
  {
   tempY=e.pageY;
  }   
  if(tempY<0) tempY=0;
  selectMove=tempY-selectCurrentY;
  selectCurrentMargin=parseInt(document.getElementById('selectScroll'+x).style.marginTop.replace('px', ''));
  selectMargin=selectCurrentMargin+selectMove;
  if(selectMargin<(2+document.getElementById('selectUp'+x).offsetHeight)) selectMargin=2+document.getElementById('selectUp'+x).offsetHeight;
  if(selectMargin>(document.getElementById('selectItems'+x).offsetHeight-(-3+document.getElementById('selectDown'+x).offsetHeight+document.getElementById('selectScroll'+x).offsetHeight))) selectMargin=document.getElementById('selectItems'+x).offsetHeight-(-3+document.getElementById('selectDown'+x).offsetHeight+document.getElementById('selectScroll'+x).offsetHeight);
  document.getElementById('selectScroll'+x).style.marginTop=selectMargin+'px';
  selectCurrentY=tempY;
  selectPositionScroll(x);
  return true;
 }

 this.selectCreate=function (sIdh, sItems, divId, width)
 {
  sId=sIdh+code;
  
  sHTML='<div id="xsColor'+sId+'" style="width: '+(width-30)+'px; height: 23px; background-color: #959595">';
  sHTML=sHTML+'<div style="height: 1px; width: 1px"><div><!-- --></div></div>';
  sHTML=sHTML+'<div style="margin-left: 1px; width: '+(width-32)+'px; height: 21px; background-image: url('+root+'graph/bg_textarea.gif)">';
  sHTML=sHTML+'<input type="hidden" id="'+sIdh+'" value="" /><input type="hidden" id="close'+sIdh+'" value="" />';
  
  
  sHTML=sHTML+'<input class="xInput" type="text" readonly="readonly" style="width: '+(width-9)+'px; height: 18px; position: absolute; margin-left: 7px; margin-top: 4px;" value="'+sItems[0]+'" id="selectInput'+sId+'" />';
  sHTML=sHTML+'<div style="position: absolute; margin-left: '+(width-27)+'px; margin-top: 0px" id="selectButton'+sId+'"><img src="'+root+'graph/bt_down.gif" width="27" height="23" alt="" id="selectBtImg'+sId+'" style="position: relative; top: -1px" /></div>';
  sHTML=sHTML+'<div style="width: '+(width-31)+'px; height: 105px; background-color: #959595; position: absolute; margin-left: 0px; margin-top: 28px; display: none; z-index: 2000" id="selectListOut'+sId+'">';
  sHTML=sHTML+'<div style="display: block; width: 21px; height: 21px; position: absolute; margin-left: '+(width-27)+'px; margin-top: 0px; z-index: 3" id="selectUp'+sId+'"><img src="'+root+'graph/bt_pasek_up.gif" width="27" height="23" alt="" id="imgUp'+sId+'" /></div>';
  sHTML=sHTML+'<div style="display: block; width: 21px; height: 21px; position: absolute; margin-left: '+(width-27)+'px; margin-top: 82px; z-index: 3" id="selectDown'+sId+'"><img src="'+root+'graph/bt_pasek_down.gif" width="27" height="23" alt="" id="imgDown'+sId+'" /></div>';
  
  //sHTML=sHTML+'<div style="width: 22px; height: 13px; position: absolute; margin-left: '+(width-24)+'px; margin-top: 10px; background-image: url('+root+'graph/bt_lista_suwak.gif); z-index: 1" id="selectScroll'+sId+'"><!-- --></div>';
  sHTML=sHTML+'<div style="width: 21px; height: 13px; position: absolute; margin-left: '+(width-27)+'px; margin-top: 10px; z-index: 1" id="selectScroll'+sId+'"><div id="selectScroll2'+sId+'" style="position: absolute; width: 21px; height: 13px"><!-- --></div><table border="0" cellpadding="0" cellspacing="0" style="height: 100%"><tr><td><div style="width: 27px; height: 3px; background-image: url('+root+'/graph/gr_suwak_top.gif)"><!-- --></div></td></tr><tr><td height="100%" style="background-image: url('+root+'/graph/gr_suwak_center.gif)"></td></tr><tr><td><div style="width: 27px; height: 3px; background-image: url('+root+'/graph/gr_suwak_bottom.gif)"><!-- --></div></td></tr></table></div>';
  
  
  sHTML=sHTML+'<div style="width: 27px; height: 99px; position: absolute; margin-left: '+(width-27)+'px; margin-top: 4px; background-image: url('+root+'graph/bg_pasekprzewijania); z-index: 0" id="selectListOut2'+sId+'"><!-- --></div>';
  
  sHTML=sHTML+'<div style="width: '+(width-33)+'px; z-index: 10; height: 104px; background-color: #f2f2f2; position: absolute; margin-left: 1px; margin-top: 0px; overflow: hidden; background-image: url('+root+'graph/bg_textarea.gif); background-repeat: repeat-x" id="selectList'+sId+'">';
  sHTML=sHTML+'<div style="height: 3px"><!-- --></div>';
  sHTML=sHTML+'<div style="width: '+(width-30)+'px; height: 100px; overflow: hidden;" id="selectItems'+sId+'">';
  var j=0;
  for(var i=1; i<sItems.length; i++)
  {
   if(i>1) sHTML=sHTML+'<div style="height: 1px; width: '+(width-30)+'px; background-color: #d0d0d0"><!-- --></div>';
   sHTML=sHTML+'<div id="selectItem2'+sId+'_'+j+'">';
   sHTML=sHTML+'<div style="height: 4px"><!-- --></div>';
   if(sItems[i]=='*')
   sHTML=sHTML+'<div style="height: 1px; width: '+(width-30)+'px; margin-left: 4px; background-image: url('+root+'graph/rp_kropkowanie.gif)"><!-- --></div>';
   else if(sItems[i].charAt(0)=='*')
   sHTML=sHTML+'<div style="cursor: default; color: #7c7c7c; font-family: Arial; font-size: 9px; margin-left: 5px; margin-top: 2px; margin-bottom: 2px">'+sItems[i].replace('*', '')+'</div>';
   else
   {
    itemTmp=sItems[i].split('|');
    label=itemTmp[0];
    value=itemTmp[1];
    sHTML=sHTML+'<div id="selectItemValue'+sId+'_'+j+'" style="display: none">'+value+'</div><div id="selectItem'+sId+'_'+j+'" style="width: '+(width-50)+'px; cursor: default; color: #000000; font-family: Arial; font-size: 11px; margin-left: 5px; padding-left: 1px; margin-top: 0px; margin-bottom: 0px">'+label+'</div>';    j++;
    sHTML=sHTML+'<div style="height: 2px"><!-- --></div>';
   }
   sHTML=sHTML+'</div>';
  }
  sHTML=sHTML+'</div>';
  sHTML=sHTML+'</div>';
  sHTML=sHTML+'</div>';
  sHTML=sHTML+'</div>';
  sHTML=sHTML+'</div>';
  document.getElementById(divId).innerHTML=sHTML;
  document.getElementById('selectButton'+sId).onclick=selectShowList;
  document.getElementById('selectButton'+sId).onmouseover=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=selectDown_ov.src;};
  document.getElementById('selectButton'+sId).onmouseout=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=selectDown.src;};
  document.getElementById('selectButton'+sId).onmousedown=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=selectDown_dn.src;};
  document.getElementById('selectButton'+sId).onmouseup=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=selectDown_ov.src;};
  
  document.getElementById('imgUp'+sId).onmouseover=function(){this.src=selectZipUp_ov.src;};
  document.getElementById('imgUp'+sId).onmouseout=function(){this.src=selectZipUp.src;};
  document.getElementById('imgUp'+sId).onmousedown=function(){this.src=selectZipUp_down.src;};
  document.getElementById('imgUp'+sId).onmouseup=function(){this.src=selectZipUp_ov.src;};
  document.getElementById('imgDown'+sId).onmouseover=function(){this.src=selectZipDown_ov.src;};
  document.getElementById('imgDown'+sId).onmouseout=function(){this.src=selectZipDown.src;};
  document.getElementById('imgDown'+sId).onmousedown=function(){this.src=selectZipDown_down.src;};
  document.getElementById('imgDown'+sId).onmouseup=function(){this.src=selectZipDown_ov.src;};
  
  document.getElementById('selectListOut'+sId).onmouseover=function(){document.getElementById('close'+sIdh).value=''};
  document.getElementById('selectListOut'+sId).onmouseout=function(){document.getElementById('close'+sIdh).value='true'; setTimeout('if(document.getElementById(\'close'+sIdh+'\').value==\'true\'){document.getElementById(\''+this.id+'\').style.display=\'none\'; document.getElementById(\''+this.id.replace('selectListOut', 'selectBtImg')+'\').src=selectDown.src; document.getElementById(\''+this.id.replace('selectListOut', 'selectButton')+'\').onmouseover=function(){document.getElementById(\''+this.id.replace('selectListOut', 'selectBtImg')+'\').src=\''+selectDown_ov.src+'\'; }; document.getElementById(\''+this.id.replace('selectListOut', 'selectButton')+'\').onmouseout=function(){document.getElementById(\''+this.id.replace('selectListOut', 'selectBtImg')+'\').src=\''+selectDown.src+'\'; }; }', 800)};
  //document.getElementById('xsColor'+sId).onmouseout=function(){document.getElementById('close'+sIdh).value='true'; setTimeout('if(document.getElementById(\'close'+sIdh+'\').value==\'true\'){alert(document.getElementById(\'selectListOut'+sId+'\').style.display)}', 1000)};
  //document.getElementById('xsColor'+sId).onmouseout=function(){document.getElementById('close'+sIdh).value='true'; setTimeout('if(document.getElementById(\'close'+sIdh+'\').value==\'true\'){alert(\'aaa\');}', 1000)};
  //document.getElementById('xsColor'+sId).onmouseout=function(){alert('if(document.getElementById(\'close'+sIdh+'\').value==\'true\'){document.getElementById(\'selectListOut\''+sId+').style.display=\'none\';}')};
 };
 
 this.selectOff=function(id)
 {
  sId=id+code;
  sList=document.getElementById('selectListOut'+sId);
  if(sList.style.display=='block')
  {
   document.getElementById('selectBtImg'+sId).src=selectDown_ov.src;
   document.getElementById('selectButton'+sId).onmouseover=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=selectDown_ov.src;};
   document.getElementById('selectButton'+sId).onmouseout=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=selectDown.src;};
   document.getElementById('selectItems'+sId).scrollTop='0px';
   sList.style.display='none';
  }
  
  this.selectColor(id, 4);
  document.getElementById('selectButton'+sId).onclick=function(){null;};
  document.getElementById('selectButton'+sId).onmouseover=function(){null;};
  document.getElementById('selectButton'+sId).onmouseout=function(){null;};
  document.getElementById('selectButton'+sId).onmousedown=function(){null;};
  document.getElementById('selectButton'+sId).onmouseup=function(){null;};
 };
 
 this.selectOn=function(id)
 {
  sId=id+code;
  this.selectColor(id, 1);
  document.getElementById('selectButton'+sId).onclick=selectShowList;
  document.getElementById('selectButton'+sId).onmouseover=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=selectDown_ov.src;};
  document.getElementById('selectButton'+sId).onmouseout=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=selectDown.src;};
  document.getElementById('selectButton'+sId).onmousedown=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=selectDown_dn.src;};
  document.getElementById('selectButton'+sId).onmouseup=function(){img=document.getElementById(this.id.replace('selectButton', 'selectBtImg')); img.src=selectDown_ov.src;};
 }
}