var G__dB_Color = '';
var G__dB_BgColor = '';
var G__dB_tD_BgColor = new Array();



// ********************************
function dB_Light1( Obj_, Status_, Color_ )
{
var tColor_ = new Array();
tColor_[0] = '#ffde01';
tColor_[1] = '#e3e7ea';

Color_ = ( typeof(Color_) != 'number' ) ? 0 : Color_;


if ( Obj_ )
  {
  if ( Status_ == 1 )
    {
    G__dB_BgColor = Obj_.style.backgroundColor;
    Obj_.style.backgroundColor = tColor_[Color_];

    G__dB_Color = Obj_.style.color;    
    Obj_.style.color = '#000000';    
    }

   else
    {
    Obj_.style.backgroundColor = G__dB_BgColor;
    Obj_.style.color = G__dB_Color;    
  }   
}  

return true;
} // koniec dB_Light1()




// ********************************
function dB_Light2( Obj_, Status_, Color_ )
{
var tColor_ = new Array();
tColor_[0] = '#ffde01';
tColor_[1] = '#fcbc83';

Color_ = ( typeof(Color_) != 'number' ) ? 0 : Color_;


if ( Obj_ )
  {
  if ( Status_ == 1 )
    {
    oTd_ = Obj_.childNodes;
    G__dB_tD_BgColor = new Array();
    for ( var i=0 ; i< oTd_.length ; i ++)
      {
      G__dB_tD_BgColor[i] = oTd_[i].style.backgroundColor;
      oTd_[i].style.backgroundColor = tColor_[Color_];
    }  

    }

   else
    {
    oTd_ = Obj_.childNodes;    
    for ( var i=0 ; i< oTd_.length ; i ++)
      {
      oTd_[i].style.backgroundColor = G__dB_tD_BgColor[i];
    }  
  }   
}  

return true;
} // koniec dB_Light2()




/// sortowanie
// ********************************
function dB_Sort( Navi_, Param_ )
{
var Navi_ = ( typeof(Navi_) != 'string' ) ? 'dB' : Navi_;

document.getElementById('FormDataBrowser_'+Navi_+'_Sort').value = Param_;
document.getElementById('FormDataBrowser_'+Navi_+'_Page').value = 1;
document.getElementById('FormDataBrowser_'+Navi_).submit();

return false;
} // koniec dB_Sort()



/// nowy nr strony
// ********************************
function dB_Page1( Navi_, Param_ )
{
var Navi_ = ( typeof(Navi_) != 'string' ) ? 'dB' : Navi_;

document.getElementById('FormDataBrowser_'+Navi_+'_Page').value = Param_;
document.getElementById('FormDataBrowser_'+Navi_).submit();

return false;
} // koniec dB_Page1()



/// nowy nr strony
// ********************************
function dB_Page2(Navi_, Param_,Max_)
{
var Navi_ = ( typeof(Navi_) != 'string' ) ? 'dB' : Navi_;

Param_ = Round(Param_,0);
Param_ = Math.max(1,Param_);
Param_ = Math.min(Param_,Max_);

dB_Page1( Navi_, Param_ );

return false;
} // koniec dB_Page2()



/// wykonaj akcje
// ********************************
function dB_Action( Navi_, Id_, Action_, Info_ )
{
var OK_ = true;
var Info_ = ( typeof(Info_) != 'string' ) ? '' : Info_;
var Navi_ = ( typeof(Navi_) != 'string' ) ? 'dB' : Navi_;

if ( Info_ != '' )
  {
  OK_ = confirm(Info_); 
}  


if ( OK_ )
  {
  document.getElementById('FormDataBrowser_'+Navi_+'_Action').value = Action_;
  document.getElementById('FormDataBrowser_'+Navi_+'_Id').value = Id_;
  document.getElementById('FormDataBrowser_'+Navi_).submit();
}

return false;
} // koniec dB_Action()



/// wykonaj wyszukiwanie
// ********************************
function dB_Search(Navi_)
{
var Navi_ = ( typeof(Navi_) != 'string' ) ? 'dB' : Navi_;

if ( document.getElementById('FormDataBrowser_Search_'+Navi_+'_Value').value != '' )
  {
  document.getElementById('FormDataBrowser_'+Navi_+'_Search').value = document.getElementById('FormDataBrowser_Search_'+Navi_+'_Value').value;
  document.getElementById('FormDataBrowser_'+Navi_+'_Range').value = document.getElementById('FormDataBrowser_Range_'+Navi_+'_Id').value;
  document.getElementById('FormDataBrowser_'+Navi_+'_Page').value = 1;
  document.getElementById('FormDataBrowser_'+Navi_).submit();
}
return false;
} // koniec dB_Search()




/// wykonaj wyszukiwanie
// ********************************
function dB_SearchShow(Navi_)
{
var Navi_ = ( typeof(Navi_) != 'string' ) ? 'dB' : Navi_;

if ( document.getElementById('FormDataBrowser_Search_'+Navi_+'_Panel').style.display == 'none' )
  {
  document.getElementById('FormDataBrowser_Search_'+Navi_+'_Panel').style.display = GetCssStyle('TR');
  document.getElementById('FormDataBrowser_'+Navi_+'_Show').value = 1;    
  }
 else
  {
  document.getElementById('FormDataBrowser_Search_'+Navi_+'_Panel').style.display = 'none';
  document.getElementById('FormDataBrowser_'+Navi_+'_Show').value = 0;
  
  dB_SearchClear(Navi_);    
}     

return false;
} // koniec dB_Search()




/// wyczysc wyszukiwanie
// ********************************
function dB_SearchClear(Navi_)
{
var Navi_ = ( typeof(Navi_) != 'string' ) ? 'dB' : Navi_;

if ( document.getElementById('FormDataBrowser_'+Navi_+'_Search').value != '' )
  {
  document.getElementById('FormDataBrowser_'+Navi_+'_Search').value = '';
  document.getElementById('FormDataBrowser_'+Navi_+'_Range').value = 0;
  document.getElementById('FormDataBrowser_'+Navi_+'_Page').value = 1;
  document.getElementById('FormDataBrowser_'+Navi_).submit();
}
return false;
} // koniec dB_SearchClear()





/// zmiana ilości na stronie
// ********************************
function dB_ChangePagin(Navi_)
{
var Navi_ = ( typeof(Navi_) != 'string' ) ? 'dB' : Navi_;

document.getElementById('FormDataBrowser_'+Navi_+'_Page').value = 1;
document.getElementById('FormDataBrowser_'+Navi_+'_Pagin').value = document.getElementById('FormDataBrowser_Pagin_'+Navi_+'_Id').value;
document.getElementById('FormDataBrowser_'+Navi_).submit();

return false;
} // koniec dB_ChangePagin()




/// nacisnieto Enter
// **********************************************
function dB_SubmitEnter( e )
{
var KeyCode_;
var OK_ = false;

if (window.event)
  {
  KeyCode_ = window.event.keyCode;
  }  
else if (e)
  {
  KeyCode_ = e.which;
}  

if ( KeyCode_ == 13 )
  {
  OK_ = true;
}

return OK_;
} // dB_SubmitEnter




/// wykonaj wyszukiwanie
// ********************************
function dB_Select(Navi_)
{
var Navi_ = ( typeof(Navi_) != 'string' ) ? 'dB' : Navi_;

document.getElementById('FormDataBrowser_'+Navi_+'_Page').value = 1;
document.getElementById('FormDataBrowser_'+Navi_).submit();

return false;
} // koniec dB_Search()



