function poz(j,k)
{
   var t = 'x'+j;
   var nodes = document.getElementById(t).childNodes;
   for (var i = 0; i < nodes.length; i++)
   {
     	var act=(i==k) ? 'block' : 'none';
     	nodes[i].style.display = act;
	}
}


function winopen(plik, w, h) {
	if(window.screen) {
	aw=screen.availwidth;
	ah=screen.availheight;
	}else{
	aw=700;
	ah=480;
	}
	ustawienia=
	"left="+(aw-w)/2+","
	+"top="+(ah-h)/2+","
	+"screenX="+(aw-w)/2+","
	+"screenY="+(ah-h)/2+","
	+"width="+w+","
	+"height="+h+","
	+"toolbar=no,"
	+"location=no,"
	+"directories=no,"
	+"status=no,"
	+"menubar=no,"
	+"scrollbars=yes,"
	+"resizable=no"
	noweokno=window.open(plik,'Karta',ustawienia);
	noweokno.focus();
}

function ntos(n){
    n=n.toString(16);
    if (n.length == 1) n="0"+n;
    n="%"+n;
    return unescape(n);
}

function codder(str){
    str = str.replace(new RegExp("s/[^0-9a-zA-Z]//g"));
    var result = "";
    var nextchar = "";
    for (var i=0; i<str.length; i++){
        nextchar += str.charAt(i);
        if (nextchar.length == 2){
            result += ntos(eval('0x'+nextchar));
            nextchar = "";
        }
    }
    location.href=result;

}

function newWindowCal(co) {
	mywindow=open('/kalendarz.php?pole='+co,'Kalendarz','resizable=no,width=250,height=170, left=100, top=100');
}


function showFlash(flash_plik,sub_plik,szer,wys) {

	var width = szer;
	var height = wys;
	var flash = flash_plik;
	var plik = sub_plik;
		
	if (!plik) {

		document.write('<object type="application/x-shockwave-flash" width="'+width+'" height="'+height+'" data="'+flash+'">');
		document.write('<param name="movie" value="'+flash+'" />');
		document.write('<param name="wmode" value="transparent"/>');
		document.write('</object>');
	
	} else {
		document.write('<div><img src="'+plik+'" width="'+width+'" height="'+height+'" alt="obrazek"/></div>');
	
	}

}