var delayhide;


function nike() {return}

function show5(){
if (!document.layers&&!document.all)
return
var Digital=new Date()
var hours=Digital.getHours()
var minutes=Digital.getMinutes()
var seconds=Digital.getSeconds()
var rok=Digital.getYear()
var dzien=Digital.getDate()
var licz_dzien=Digital.getDay()
var miesiac=Digital.getMonth() + 1

if (licz_dzien==0) {tekst_dzien="Niedziela"}
if (licz_dzien==1) {tekst_dzien="Poniedziałek"}
if (licz_dzien==2) {tekst_dzien="Wtorek"}
if (licz_dzien==3) {tekst_dzien="roda"}
if (licz_dzien==4) {tekst_dzien="Czwartek"}
if (licz_dzien==5) {tekst_dzien="Pištek"}
if (licz_dzien==6) {tekst_dzien="Sobota"}
if (miesiac==1) {tekst_miesiac="styczeń"}
if (miesiac==2) {tekst_miesiac="luty"}
if (miesiac==3) {tekst_miesiac="marzec"}
if (miesiac==4) {tekst_miesiac="kwiecień"}
if (miesiac==5) {tekst_miesiac="maj"}
if (miesiac==6) {tekst_miesiac="czerwiec"}
if (miesiac==7) {tekst_miesiac="lipiec"}
if (miesiac==8) {tekst_miesiac="sierpień"}
if (miesiac==9) {tekst_miesiac="wrzesień"}
if (miesiac==10) {tekst_miesiac="padziernik"}
if (miesiac==11) {tekst_miesiac="listopad"}
if (miesiac==12) {tekst_miesiac="grudzień"}


if ((rok>=00) && (rok<=1900)) rok=1900+rok
if (miesiac < 10) miesiac="0"+miesiac
if (dzien < 10) dzien="0"+dzien

if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
myclock="<font face=Tahoma size=1 color=#FFFFFF><b>&nbsp;" + tekst_dzien + ", " + dzien + " " + tekst_miesiac + " "+rok+"</b></font><br><font face='Verdana,Tahoma' size=3 color=#FFFFFF><b>"+hours+":"+minutes+":"+seconds+"</b></font>"
if (document.layers){
document.layers.liveclock.document.write(myclock)
document.layers.liveclock.document.close()
}
else if (document.all)
liveclock.innerHTML=myclock
setTimeout("show5()",1000)
}




function zapytaj(text)
{
if (!confirm(text)) return false; else return true;
}


var win = null;

function NewWindow(mypage,myname,w,h,scroll){

//alert(win);

//if (win) if (win.window.closed) win = null;
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+', resizable, status'
//alert(win);
//if (win == true || win == null)
win = window.open(mypage,myname,settings);
//else if (win) {if (win.window.closed) win = window.open(mypage,myname,settings)}
//else win.window.focus();
//alert(win+' '+win.window.closed);
//if (win.window.focus)
	//{
win.window.focus()
	//}
//alert(toSource(win));
//win = null;
//alert(win);
}

var current_color;

function setPointer(theRow, thePointerColor){
   if(typeof(theRow.style) == 'undefined' || typeof(theRow.cells) == 'undefined') {
      return false;
   }
   var row_cells_cnt = theRow.cells.length;
   current_color = theRow.cells[0].style.backgroundColor;
   for(var c = 0; c < row_cells_cnt; c++) {
      theRow.cells[c].style.backgroundColor = thePointerColor;
   }
   return true;
}

function unsetPointer(theRow){
   var row_cells_cnt = theRow.cells.length;
   for(var c = 0; c < row_cells_cnt; c++) {
      theRow.cells[c].style.backgroundColor = current_color;
   }
}

function setPointer2(theRow, thePointerColor){
   if(typeof(theRow.style) == 'undefined' || typeof(theRow.cells) == 'undefined') {
      return false;
   }
   var row_cells_cnt = theRow.cells.length;
   current_color = theRow.cells[1].style.backgroundColor;
   for(var c = 1; c < row_cells_cnt; c++) {
      theRow.cells[c].style.backgroundColor = thePointerColor;
   }
   return true;
}

function unsetPointer2(theRow){
   var row_cells_cnt = theRow.cells.length;
   for(var c = 1; c < row_cells_cnt; c++) {
      theRow.cells[c].style.backgroundColor = current_color;
   }
}



mynn4 = (document.layers)? true:false
myie4 = (document.all)? true:false


var current_shown = -1;

var t_div = new Array;
var t_div_text = new Array;

function shownext() {
if (current_shown < t_div.length - 1) current_shown++;
//writeTo('menudiv10',current_shown);
writeTo(t_div[current_shown], t_div_text[current_shown]);
show(t_div[current_shown]);
}

function hideprev() {
if (current_shown > -1)
{
	writeTo(t_div[current_shown],'');
	//hide(t_div[current_shown]);
	current_shown--;
	//writeTo('menudiv10',current_shown);
}
}

function writeTo(ident, tekst) {
	if(mynn4) {
		document.layers[ident].document.open();
		document.layers[ident].document.write(tekst);
		document.layers[ident].document.close();
	} else if(myie4) {
		document.all[ident].innerHTML = tekst;
	}
}
	function clipTo(ident, t, r, b, l) {
		if(mynn4) {
    		document.layers[ident].clip.top = t;
		    document.layers[ident].clip.right = r;
    		document.layers[ident].clip.bottom = b;
	    	document.layers[ident].clip.left = l;
		} else if(myie4) {
    		document.all[ident].style.clip =
				"rect(" + t + " " + r + " " + b + " " + l + ")";
		}
	}

	function clipBy(ident, t, r, b, l) {
		if(mynn4) {
			document.layers[ident].clip.top += t;
			document.layers[ident].clip.right += r;
			document.layers[ident].clip.bottom += b;
			document.layers[ident].clip.left += l;
		} else if(myie4) {
			ie_clip = document.all[ident].style.clip;
			ie_clip = ie_clip.substring(5, ie_clip.length-1);
			ie_clip_wart = ie_clip.split("px");

			t += parseInt(ie_clip_wart [0]);
			r += parseInt(ie_clip_wart [1]);
			b += parseInt(ie_clip_wart [2]);
			l += parseInt(ie_clip_wart [3]);

			document.all[ident].style.clip =
				"rect(" + t + "px " + r + "px " + b + "px " + l + "px)";
		}
	}

	function moveBy(ident,dx,dy) {
	if(mynn4) {		// przeglądarką jest Navigator
		document.layers[ident].left = document.layers[ident].left  + dx;
		document.layers[ident].top = document.layers[ident].top + dy;
	} else if(myie4) {	// przeglądarką jest Explorer
		document.all[ident].style.left = document.all[ident].offsetLeft  + dx;
		document.all[ident].style.top = document.all[ident].offsetTop + dy;
	}
}

	function moveTo(ident,x,y) {
		if(mynn4) {		// przeglądarką jest Navigator
			document.layers[ident].left = x;
			document.layers[ident].top = y;
		} else if(myie4) {	// przeglądarką jest Explorer
			document.all[ident].style.left = x;
			document.all[ident].style.top = y;
		}
	}

	function show(ident) {
	//	hideall();
		if(mynn4) {		// przeglądarką jest Navigator
			document.layers[ident].visibility = "show";
		} else if(myie4) {	// przeglądarką jest Explorer
			//alert('ok');
			document.all[ident].style.visibility = "visible";
		}
	}

	function hide(ident) {
		if(mynn4) {		// przeglądarką jest Navigator
			document.layers[ident].visibility = "hide";
		} else if(myie4) {	// przeglądarką jest Explorer
			document.all[ident].style.visibility = "hidden";
		}
	}

	function pozycja(ident) {
		if(mynn4) {		// przeglądarką jest Navigator
			l = document.layers[ident].left;
			t = document.layers[ident].top;
		} else if(myie4) {	// przeglądarką jest Explorer
			l = document.all[ident].style.pixelLeft;
			t = document.all[ident].style.pixelTop;
		}
		alert('Położenie ' + ident + ': od lewej = ' + l + ', od góry = ' + t);
	}


function hide_all(pref, max)
{
for (f=0;f<max;f++){
name = pref + f
hide(name)
}
}

function show_option(elem,pref,ndx,max)
{
hide_all(pref,max)
ndxval = document.forma.elements[ndx].options[document.forma.elements[ndx].selectedIndex].value
//alert(ndxval);
//moveBy(pref+ndxval,0,-11)
show(pref+ndxval)
}

function set_activ(element)
{
if (document.forma.elements[element].disabled == true)
 document.forma.elements[element].disabled = false;
 else
 document.forma.elements[element].disabled = true;
}

function set_activ1(element)
{
if (window.document.forma.elements[element].disabled == true)
 window.document.forma.elements[element].disabled = false;
 else
 window.document.forma.elements[element].disabled = true;
}

function set_activ_11(nr1, nr2)
{
if (window.document.forma.elements[nr1].disabled == true)
window.document.forma.elements[nr1].disabled = false;
else
window.document.forma.elements[nr1].disabled = true;

if (window.document.forma.elements[nr2].disabled == true)
window.document.forma.elements[nr2].disabled = false;
else
window.document.forma.elements[nr2].disabled = true;
}





//Pop-it menu- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//This credit MUST stay intact for use

var linkset=new Array()
//SPECIFY MENU SETS AND THEIR LINKS. FOLLOW SYNTAX LAID OUT


////No need to edit beyond here

var ie4_mnu=document.all&&navigator.userAgent.indexOf("Opera")==-1
var ns6_mnu=document.getElementById&&!document.all
var ns4_mnu=document.layers

function showmenu(e,which){

if (!document.all&&!document.getElementById&&!document.layers)
return

clearhidemenu()

menuobj=ie4_mnu? document.all.popmenu : ns6_mnu? document.getElementById("popmenu") : ns4_mnu? document.popmenu : ""
menuobj.thestyle=(ie4_mnu||ns6_mnu)? menuobj.style : menuobj

if (ie4_mnu||ns6_mnu)
menuobj.innerHTML=which
else{
menuobj.document.write('<layer name=gui bgColor=#E6E6E6 width=225 onmouseover="delayhidemenu()" onmouseout="hidemenu()">'+which+'</layer>')
menuobj.document.close()
}

menuobj.contentwidth=(ie4_mnu||ns6_mnu)? menuobj.offsetWidth : menuobj.document.gui.document.width
menuobj.contentheight=(ie4_mnu||ns6_mnu)? menuobj.offsetHeight : menuobj.document.gui.document.height
eventX = ie4_mnu? event.clientX : ns6_mnu? e.clientX : e.x
eventY = ie4_mnu? event.clientY : ns6_mnu? e.clientY : e.y
eventY = eventY + 70

//Find out how close the mouse is to the corner of the window
var rightedge=ie4_mnu? document.body.clientWidth-eventX : window.innerWidth-eventX
var bottomedge=ie4_mnu? document.body.clientHeight-eventY : window.innerHeight-eventY

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<menuobj.contentwidth)
//move the horizontal position of the menu to the left by it's width
menuobj.thestyle.left=ie4_mnu? document.body.scrollLeft+eventX-menuobj.contentwidth-10 : ns6_mnu? window.pageXOffset+eventX-menuobj.contentwidth-10 : eventX-menuobj.contentwidth-10
else
//position the horizontal position of the menu where the mouse was clicked
menuobj.thestyle.left=ie4_mnu? document.body.scrollLeft+eventX-50 : ns6_mnu? window.pageXOffset+eventX-50 : eventX-50

//same concept with the vertical position
if (bottomedge<menuobj.contentheight)
menuobj.thestyle.top=ie4_mnu? document.body.scrollTop+eventY-menuobj.contentheight+30 : ns6_mnu? window.pageYOffset+eventY-menuobj.contentheight+30 : eventY-menuobj.contentheight+30
else
menuobj.thestyle.top=ie4_mnu? document.body.scrollTop+event.clientY+3 : ns6_mnu? window.pageYOffset+eventY+3 : eventY+3
menuobj.thestyle.visibility="visible"

return false
}

function contains_ns6_mnu(a, b) {
//Determines if 1 element in contained in another- by Brainjar.com
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function hidemenu(){
if (window.menuobj)
menuobj.thestyle.visibility=(ie4_mnu||ns6_mnu)? "hidden" : "hide"
}

function dynamichide(e){
if (ie4_mnu&&!menuobj.contains(e.toElement))
hidemenu()
else if (ns6_mnu&&e.currentTarget!= e.relatedTarget&& !contains_ns6_mnu(e.currentTarget, e.relatedTarget))
hidemenu()
}

function delayhidemenu(){
if (ie4_mnu||ns6_mnu||ns4_mnu)
delayhide=setTimeout("hidemenu()",5500)
}

function clearhidemenu(){
if (window.delayhide)
clearTimeout(delayhide)
}

function highlightmenu(e,state){
if (document.all)
source_el=event.srcElement
else if (document.getElementById)
source_el=e.target
if (source_el.className=="menuitems"){
source_el.id=(state=="on")? "mouseoverstyle" : ""
}
else{
while(source_el.id!="popmenu"){
source_el=document.getElementById? source_el.parentNode : source_el.parentElement
if (source_el.className=="menuitems"){
source_el.id=(state=="on")? "mouseoverstyle" : ""
}
}
}
}

//if (ie4_mnu||ns6_mnu)
//document.onclick=hidemenu




function kPoz( kier, kolod, koldo ) {
sl = document.forma[kolod].selectedIndex;
if (sl != -1) {
 oText = document.forma[kolod].options[sl].text;
 oValue = document.forma[kolod].options[sl].value;
 if (sl > 0 && kier == "gora") {
  document.forma[kolod].options[sl].text = document.forma[kolod].options[sl-1].text;
  document.forma[kolod].options[sl].value = document.forma[kolod].options[sl-1].value;
  document.forma[kolod].options[sl-1].text = oText;
  document.forma[kolod].options[sl-1].value = oValue;
  document.forma[kolod].selectedIndex--;
 } else if (sl < document.forma[kolod].length-1 && kier == "dol") {
  document.forma[kolod].options[sl].text = document.forma[kolod].options[sl+1].text;
  document.forma[kolod].options[sl].value = document.forma[kolod].options[sl+1].value;
  document.forma[kolod].options[sl+1].text = oText;
  document.forma[kolod].options[sl+1].value = oValue;
  document.forma[kolod].selectedIndex++;
 } else if (kier == "lewo" || kier == "prawo" || kier == "swap" ) {
  max = document.forma[koldo].length;
  document.forma[koldo].options[max]=new Option(oText,oValue,0,0)
  document.forma[kolod].options[sl] = null;
  document.forma[kolod].selectedIndex++;
 }
} else {
 alert("Wybierz pozycję");
}
return false;
}
function sprawdzMaxLimit() {
  len = document.forma["klewa"].length+1;
  if (len <= 5) {
    return true;
  } else {
    alert("Przekroczony limit 5 pozycji!");
    return false;
  }
}
function sprawdzMinLimit() {
  len = document.forma["klewa"].length;
  if (len >= 2) {
    return true;
  } else {
    alert("Musisz wybrać jakąś kategorię!");
    return false;
  }
}

function doSubmit(elem, zmienna) {
//alert (zmienna + ' ' + elem);
//alert (doSubKol(elem));
 document.forma[zmienna].value = doSubKol(elem);
 // document.forma["prawa"].value = doSubKol("kprawa");
//alert ('dosubmit 1');
 return true;
}
function doSubKol(od) {
val = "";
for (i=0;i<document.forma[od].length;i++) {
 if (i!=0) { val += "|"; }
 val += document.forma[od].options[i].value;
}
//alert (val);
return val;
}



function showit(which){
clear_delayhide()
thecontent=(which==-1)? precontent : submenu[which]
if (document.getElementById||document.all)
menuobj.innerHTML=thecontent
else if (document.layers){
menuobj.document.write(thecontent)
menuobj.document.close()
}
}

function resetit(e){
// var delayhide; bo znika menu
if (document.all&&!menuobj.contains(e.toElement))
delayhide=setTimeout("showit(-1)",delay_hide)
else if (document.getElementById&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhide=setTimeout("showit(-1)",delay_hide)
}

function clear_delayhide(){
if (window.delayhide)
clearTimeout(delayhide)
//document.searchform.txt.focus()
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function hasClass(obj) {
var result = false;
if (obj.getAttributeNode("class") != null) {
  result = obj.getAttributeNode("class").value;
  }
return result;
}


function stripe(id) {

    // the flag we'll use to keep track of
    // whether the current row is odd or even
    var even = false;

    // if arguments are provided to specify the colours
    // of the even & odd rows, then use the them;
    // otherwise use the following defaults:
    var evenColor = arguments[1] ? arguments[1] : "#fff";
    var oddColor = arguments[2] ? arguments[2] : "#eee";

    // obtain a reference to the desired table
    // if no such table exists, abort
    var table = document.getElementById(id);
    if (! table) { return; }

    // by definition, tables can have more than one tbody
    // element, so we'll have to get the list of child
    // &lt;tbody&gt;s
    var tbodies = table.getElementsByTagName("tbody");

    // and iterate through them...
    for (var h = 0; h < tbodies.length; h++) {

     // find all the &lt;tr&gt; elements...
      var trs = tbodies[h].getElementsByTagName("tr");

      // ... and iterate through them
      for (var i = 0; i < trs.length; i++) {

	    // avoid rows that have a class attribute
        // or backgroundColor style
	    if (!hasClass(trs[i]) && ! trs[i].style.backgroundColor) {
		if (! trs[i].style.backgroundColor) {

         // get all the cells in this row...
          var tds = trs[i].getElementsByTagName("td");

          // and iterate through them...
          for (var j = 0; j < tds.length; j++) {

            var mytd = tds[j];

            // avoid cells that have a class attribute
            // or backgroundColor style
	        if (! mytd.style.backgroundColor) {
        		if (! hasClass(mytd) && ! mytd.style.backgroundColor) {
		      mytd.style.backgroundColor = even ? evenColor : oddColor;
            }
            }
          }

        // flip from odd to even, or vice-versa
        even =  ! even;
      } }  }

    }
  }


function tableruler()
{
	if (document.getElementById && document.createTextNode)
	{
		var tables=document.getElementsByTagName('table');
		for (var i=0;i<tables.length;i++)
		{
			if(tables[i].className=='ruler')
			{
				var trs=tables[i].getElementsByTagName('tr');
				for(var j=0;j<trs.length;j++)
				{
					if(trs[j].parentNode.nodeName=='TBODY')
					{
						trs[j].onmouseover=function(){this.className='ruled';return false}
						trs[j].onmouseout=function(){this.className='';return false}
					}
				}
			}
		}
	}
}







/*

COOKIE SET

   name - name of the cookie
   value - value of the cookie
   [expires] - expiration date of the cookie
     (defaults to end of current session)
   [path] - path for which the cookie is valid
     (defaults to path of calling document)
   [domain] - domain for which the cookie is valid
     (defaults to domain of calling document)
   [secure] - Boolean value indicating if the cookie transmission requires
     a secure transmission
   * an argument defaults when it is assigned null as a placeholder
   * a null placeholder is not required for trailing omitted arguments
*/

function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}


/*
  name - name of the desired cookie
  return string containing value of specified cookie or null
  if cookie does not exist
*/

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}


/*
   name - name of the cookie
   [path] - path of the cookie (must be same as path used to create cookie)
   [domain] - domain of the cookie (must be same as domain used to
     create cookie)
   path and domain default if assigned null or omitted if no explicit
     argument proceeds
*/

function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

// date - any instance of the Date object
// * hand all instances of the Date object to this function for "repairs"

function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}




function getRefToElemByID(divID) {
    if( document.layers ) { //Netscape layers
        return document.layers[divID]; }
    if( document.getElementById ) { //DOM; IE5, NS6, Mozilla, Opera
        return document.getElementById(divID); }
    if( document.all ) { //Proprietary DOM; IE4
        return document.all[divID]; }
    if( document[divID] ) { //Netscape alternative
        return document[divID]; }
    return false;
}

function displayWindow(url, width, height) {
 var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=no,menubar=no' );
}

