function swtch( num,imgname )
 {
 if ( document.images ) document[ imgname ].src=img[ num ].src; 
 }
 
imgsrc = new Array();
imgsrc[0]="pic/d_m_p1.png";
imgsrc[1]="pic/d_m_p1n.png";
imgsrc[2]="pic/d_m_p2.png";
imgsrc[3]="pic/d_m_p2n.png";
imgsrc[4]="pic/d_m_p3.png";
imgsrc[5]="pic/d_m_p3n.png";
imgsrc[6]="pic/d_m_p4.png";
imgsrc[7]="pic/d_m_p4n.png";
imgsrc[8]="pic/d_m_p5.png";
imgsrc[9]="pic/d_m_p5n.png";
imgsrc[10]="pic/d_m_p6.png";
imgsrc[11]="pic/d_m_p6n.png";

if (document.images != null)
 {
 img = new Array();
 for (i = 0; i < imgsrc.length; i++)
  {
  img[i] = new Image();
  if ( imgsrc[i] ) img[i].src = imgsrc[i];
  }
 }

// (c) 2000-2004 MWD, Dariusz Andryka
var
 liczba_spacji=30,start_x=0,start_y=0,odlicz,ktory_jest=0,i_ost=-1,nr,pozb=false;
 
function pisz_menu( nr )
 {
 txt="<DIV ID='menu"+nr+"DIV'><TABLE CELLSPACING=0 CELLPADDING=1 BORDER=0 ALIGN=LEFT>\n<TR>\n<TD ALIGN=RIGHT BGCOLOR=#000000><TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=158 BGCOLOR=#FFFFFF>\n";
 for ( i=0;i<menu[nr].length;i++ )
  {
  txt+="<TR>\n<TD CLASS=\"c\"";
  if (ie4 || mo) txt+=" onMouseOver=\"bgColor='"+kolory[nr*2-1]+"'\" onMouseOut=\"bgColor='"+kolory[nr*2-2]+"'\">";
  else if (nn4) txt+="><ILAYER><LAYER WIDTH=100%  onMouseOver=\"bgColor='"+kolory[nr*2-1]+"'\" onMouseOut=\"bgColor='"+kolory[nr*2-2]+"'\">";
  txt+="<NOBR>&nbsp;&nbsp;<A CLASS='cz' HREF="+menu[nr][i];
  roznica=liczba_spacji-(menu[nr][i].length-menu[nr][i].lastIndexOf(">"));
  for ( j=0;j<roznica;j++ ) txt+="&nbsp;";
  txt+="</A></NOBR>";
  if (nn4) txt+="</LAYER></ILAYER>";
  txt+="</TD>\n</TR>\n";
  }
 txt+="</TABLE></TD>\n</TR>\n</TABLE></DIV>\n";
 document.write( txt );
 }

function pokaz( nr )
 {
 ident="menu"+nr+"DIV";
 ktory_jest=nr;
 i_ost=-1;
 if ( nn4 ) 
  {
  document.layers[ident].visibility="show";
  document.layers[ident].onmouseout=koncz;
  document.layers[ident].onmouseover=nie_koncz;
  }
  else if ( ie4 )
   {
   document.all[ident].style.visibility = "visible";
   document.all[ident].onmouseout=koncz;
   document.all[ident].onmouseover=nie_koncz;
   }
   else if ( mo )
    {
    document.getElementById(ident).style.visibility = 'visible';
    document.getElementById(ident).addEventListener( "mouseout", koncz, true );
    document.getElementById(ident).addEventListener( "mouseover", nie_koncz, true );
    }
 }

function ukryj( ident )
 {
 if( nn4 ) document.layers[ident].visibility = "hide";
  else if ( ie4 ) document.all[ident].style.visibility = "hidden";
   else if ( mo ) document.getElementById(ident).style.visibility = "hidden";
 }

function przesun( nr,x,y )
 {
 ident="menu"+nr+"DIV";
 if ( nn4 )
  {
  document.layers[ident].left = x;
  document.layers[ident].top = y;
  }
  else if ( ie4 )
   {
   document.all[ident].style.left = x;
   document.all[ident].style.top = y;
   }
   else if ( mo )
    {
    document.getElementById(ident).style.left = x;
    document.getElementById(ident).style.top = y;
    }
 }

function koncz( zdarz )
 {
 odlicz=setTimeout( "koniec()",200 );
 }

function nie_koncz( zdarz )
 {
 clearTimeout( odlicz );
 }

function poczatek( nr,x,y ) // rozwinięcie menu
 {
 idnt="dest1DIV";
 if ( !pozb )
	{
	if ( nn4 )
		{
		start_x = document.layers[idnt].pageX; start_y = document.layers[idnt].pageY;
		}
	if ( ie4 )
		{
		start_x = document.all[idnt].offsetLeft; start_y = document.all[idnt].offsetTop;
		}
	if ( mo )
		{
		start_x = document.getElementById(idnt).offsetLeft; start_y = document.getElementById(idnt).offsetTop;
		}
	pozb=true;
	}
 koniec();
 nie_koncz(); 
 przesun( nr,start_x+x,start_y+y );
 pokaz( nr );
 return false;
 }

function koniec( zdarz ) // zwinięcie menu
 {
 if ( ktory_jest!=0 )
  {
  ukryj( "menu"+ktory_jest+"DIV" );
  }
 }

function adr( adres ) // odpalenie serwisu 'Leki'
 {
 window.open( adres );
 }

//-->
