//Warstwy

/*nn4= (document.layers) ? true : false;
ie4= (document.all) ? true : false;*/


function o(n, i) {
	document.images['thumb'+n].src = 'libs/dlf/i.php?f='+i;

}

function f(n) {
	document.images['thumb'+n].src = 'libs/dlf/trans.gif';
}


function pokazUkryj2( id )
{
	el = document.getElementById( id );
	alert('lala');
	if( el.style.display == 'none' )
	{
		pokaz( id );
	} else {
		ukryj( id );
	}
}

function pokaz( id )
{
	el = document.getElementById( id );

	if( el )
	{
		el.style.display = 'block';
		return el.style.display;
	}
}

function ukryj( id )
{
	el = document.getElementById( id );

	if( el )
	{
		el.style.display = 'none';
		return el.style.display;
	}
}




	function zwinRozwin( id )
	{

			el = document.getElementById( id );
			poziom = parseInt( el.getAttribute('poziom') );

			tableRow = ( document.all ) ? 'block' : 'table-row';

			coRobimy = null;

			while( (el=el.nextSibling) != null )
			{
				if( el.nodeName.toLowerCase() != 'tr' )
					continue;

				if( parseInt( el.getAttribute('poziom') ) <= poziom )
					break;

				if( coRobimy==tableRow && parseInt( el.getAttribute('poziom') ) != poziom+1 )
					continue;

				try
				{
					if( coRobimy == null )
					{

						if( true )
						{
							if(el.style['display']=='none')
							{

								coRobimy = tableRow;
							}
							else
							{

								coRobimy = 'none';
							}
						}
						else
						{
							coRobimy = tableRow;
						}
					}

					el.style.cssText = 'display: '+ coRobimy ;

				}
				catch(e) // IE (X
				{
					wy = '';
					for( e in el )
						wy += el +' ';

					coRobimy = tableRow;
					el.style.display = coRobimy;
				}
			}
	}




function View(rok)
{
   document.all["rok10"].style.display="none";
   document.all["rok9"].style.display="none";
   document.all["rok8"].style.display="none";
   document.all["rok7"].style.display="none";
   document.all["rok6"].style.display="none";
   document.all["rok5"].style.display="none";
   document.all["rok4"].style.display="none";
   document.all["rok3"].style.display="none";
   document.all["rok2"].style.display="none";
   document.all["rok1"].style.display="none";
   document.all[rok].style.display="block";
}



function View2(rok)
{
   document.all["rok10"].style.display="none";
   document.all["rok9"].style.display="none";
   document.all[rok].style.display="block";
}

function View3(rok)
{
   document.all["rok10"].style.display="none";
   document.all["rok9"].style.display="none";
   document.all["rok8"].style.display="none";
   document.all["rok7"].style.display="none";
   document.all["rok6"].style.display="none";
   document.all["rok5"].style.display="none";
   document.all[rok].style.display="block";
}

//rozwijane drzewko

function tree(id)
{
  this.id = id;

  this.click = function ()
  {
    for (var i = 0, el_node; i < this.parentNode.childNodes.length; i++)
    {
      el_node = this.parentNode.childNodes.item(i)
      if (el_node.nodeName.toLowerCase() == 'ul')
      {
        el_node.style.display = el_node.style.display == 'none' ? 'block' : 'none';
        this.parentNode.style.backgroundImage = 'url("templates/prochem/graphics/' + (el_node.style.display == 'none' ? ' ' : ' ') + '.gif")';
        return;
      }
    }
  }

  this.start = function (el)
  {
    for (var i = 0, el_node; i < el.childNodes.length; i++)
    {
      el_node = el.childNodes.item(i);
      if (el_node.nodeName.toLowerCase() == 'a')
      {
        el_node.onclick = this.click;
        for (var j = 0; j < el_node.parentNode.childNodes.length; j++)
        {
          if (el_node.parentNode.childNodes.item(j).nodeName.toLowerCase() == 'ul')
          {
            el_node.parentNode.style.backgroundImage = 'url(" ")';
            el_node.className = (el_node.className ? el_node.className + ' ' : '') + 'folder';
            break;
          }
          if (el_node.parentNode.childNodes.item(j).nodeName.toLowerCase() == 'li') break;
        }
        if (el_node.href && unescape(el_node.href) == unescape(window.location.href))
        {
          el_node.className = 'active';
          var el_parentNode = el_node;
          do
          {
            el_parentNode = el_parentNode.parentNode;
            if (el_parentNode.nodeName.toLowerCase() == 'ul')
            {
              el_parentNode.style.display = 'block';
              if (document.getElementById(this.id) != el_parentNode) el_parentNode.parentNode.style.backgroundImage = 'url(" ")';
            }
          }
          while (document.getElementById(this.id) != el_parentNode)
        }
      }
      else if (el_node.nodeName.toLowerCase() == 'ul') el_node.style.display = 'none';
      this.start(el_node);
    }
  }

  if (document.getElementById && document.childNodes)
  {
    if (document.images)
    {
      new Image().src = ' ';
      new Image().src = ' ';
    }
    this.start(document.getElementById(this.id));
  }
}

function WinOpen(loct,nazwa) {
msg=window.open(loct,"DisplayWindow","height=295,width=424,top=100,left=100,toolbar=no,scrollbars=no,menubar=no,resizable=yes");
msg.document.write("<HEAD><TITLE>Referencje</TITLE><link rel=stylesheet type=text/css href=templates/prochem/styl.css><script type=text/javascript language=JavaScript>function clickIE() { if (document.all) { return false; } } function clickNS(e) { if (document.layers||(document.getElementById&&!document.all)) { if (e.which==2||e.which==3) { return false; } } } if (document.layers){ document.captureEvents(Event.MOUSEDOWN); document.onmousedown=clickNS; } else { document.onmouseup=clickNS; document.oncontextmenu=clickIE; }</script></HEAD><body leftmargin=0 marginwidth=0 topmargin=0 marginheight=0 bgcolor=#F0F0F0>");
msg.document.write("<center><img SRC="+loct+" border=0 height=254 width=424><br><font><b>"+nazwa+"</b></font></CENTER></BODY>");

}




function openWin(loct,b1,b2,nazwa) {
var re = "width=";//wzorzec
var ka = b2.search(re);
ka = ka + 6;
var a = b2.substr(ka,3);
width = parseInt(a);
width = width - 20;
var re2 = "height=";//wzorzec
var ka2 = b2.search(re2);
ka2 = ka2 + 7;
var a2 = b2.substr(ka2);
height = parseInt(a2);
height = height - 20;
height2 = height +60;

msg=window.open(loct,"DisplayWindow","height="+height2+",width="+width+",top=10,left=10,toolbar=no,scrollbars=no,menubar=no,resizable=yes");
msg.document.write("<HEAD><TITLE>Referencje</TITLE><link rel=stylesheet type=text/css href=templates/prochem/styl.css><script type=text/javascript language=JavaScript>function clickIE() { if (document.all) { return false; } } function clickNS(e) { if (document.layers||(document.getElementById&&!document.all)) { if (e.which==2||e.which==3) { return false; } } } if (document.layers){ document.captureEvents(Event.MOUSEDOWN); document.onmousedown=clickNS; } else { document.onmouseup=clickNS; document.oncontextmenu=clickIE; }</script></HEAD><body leftmargin=0 marginwidth=0 topmargin=0 marginheight=0 bgcolor=#F0F0F0>");
msg.document.write("<center><img SRC="+loct+" border=0 width="+width+" height="+height+"><br><p><font><b>"+nazwa+"</b></font></p></CENTER></BODY>");

}

		function podglad(idm,id,lang,year) {
 window.open('index.php?idm='+idm+'&id='+id+'&year='+year+'&print=true&lang='+lang,'wydruk','width=700,height=650,left=150,top=10,scrollbars=yes,resizable=yes');
 }

		function sprawdz(f) {
			if (f.imie.value=='') {
				alert('Nie podałe¶/a¶ swojego imienia\n---------------------------------------------------------\n');
				return false;
			}
			if (f.nazwisko.value=='') {
				alert('Nie podałe¶/a¶ swojego nazwiska\n---------------------------------------------------------\n');
				return false;
			}
			if (f.data_ur.value=='') {
				alert('Nie podałe¶/a¶ daty urodzenia\n---------------------------------------------------------\n');
				return false;
			}
			if (f.ulica.value=='') {
				alert('Nie podałe¶/a¶ ulicy\n---------------------------------------------------------\n');
				return false;
			}
			if (f.miejscowosc.value=='') {
				alert('Nie podałe¶/a¶ nazwy miejscowo¶ci\n---------------------------------------------------------\n');
				return false;
			}
			if (f.kod.value=='') {
				alert('Nie podałe¶/a¶ kodu pocztowego\n---------------------------------------------------------\n');
				return false;
			}
			if (f.mail.value=='') {
				alert('Nie podałe¶/a¶ adresu e-mail\n---------------------------------------------------------\n');
				return false;
			}
			if (f.zawod	.value=='') {
				alert('Nie podałe¶/a¶ nazwy zawodu\n---------------------------------------------------------\n');
				return false;
			}
			else  {
				return true;
			}
	}
