function toggle(item2, stan) {
	var item = document.getElementById(item2);
	if (stan==1) item.style.display = '';
	else if (stan==2) item.style.display = 'none';
	else {
		if (item.style.display == '') {
			item.style.display = 'none';
		} else {
			item.style.display = '';
		}
	}
}

var ucal_isopen=0;
var ucal_isclosing=0;
var ucal_timer;
var ucal_cpwidth=0;
var ucal_cpheight=0;

function ucalOpen(which) {
   var pname = "Image1";
   if (which) pname = "ucal_crange2";
   if (ucal_isclosing) return;
   if (ucal_isopen) { 
	   ucalClose(); return; 
	}
   var mye1,mye2,mye3;
   if ((mye1 = document.getElementById("szukaj_pop")) == null) return ;
   if ((mye2 = document.getElementById(pname)) == null) return ;

   var startx = 0;
   var starty = 0;
   for(var p = mye2; p && p.tagName!='BODY'; p = p.offsetParent){
      startx += p.offsetLeft;
      starty += p.offsetTop;
   }
   ucal_isopen=1;

   mye1.style.position = "absolute";
   mye1.style.left = (startx)+"px";
   mye1.style.top = (starty)+"px";

   mye1.style.width = 0;
  // mye1.style.height = 0;
   mye1.style.display = "";
   ucal_cpwidth = 0;
   //ucal_cpheight = 0;
   ucal_timer = setInterval("ucalAnimateOpen("+startx+")",30);

   ucal_which = which;
   //unavOptClose(unav_copt);
   return;
}
function ucalClose() {
   if (!ucal_isopen) return;
   ucal_isclosing=1;
   var mye;
   if ((mye = document.getElementById("szukaj_pop")) == null) reutrn ;

   ucal_cpwidth = 270;
  // ucal_cpheight = 150;
   ucal_timer = setInterval("ucalAnimateClose("+poczx+")",10);

   ucal_isopen=0;
}
function ucalAnimateOpen(x) {
   ucal_cpwidth += 20;
   ucal_cpheight += 10;

   if (ucal_cpwidth >= 260) { clearInterval(ucal_timer); ucal_timer=0; }
   if ((mye = document.getElementById("szukaj_pop")) == null) return;
      
   if (ucal_timer==0) { 
      if (isns6 && !isSaf) {
         mye.style.width = "";
       //  mye.style.height = "auto";
      } else if (isOp) {
         mye.style.width = "";
      //   mye.style.height = "auto";
      } else {
         mye.style.width = "auto";
       //  mye.style.height = "auto";
      }
   } else {
      mye.style.width = ucal_cpwidth+"px";
      mye.style.left = (x-ucal_cpwidth+23)+"px";
    //  mye.style.height = ucal_cpheight+"px";
   }
}
function ucalAnimateClose(x) {
   ucal_cpwidth -= 20;
   ucal_cpheight -= 10;

   if (ucal_cpwidth <= 23) { clearInterval(ucal_timer); ucal_timer=0;}

   if ((mye = document.getElementById("szukaj_pop")) == null) return;
   if (ucal_timer==0) { 
      //mye.style.display = "none";
      mye.style.width = 23;
      mye.style.left = (x)+"px";
    //  mye.style.height = "auto";
   } else {
      mye.style.width = ucal_cpwidth+"px";
      mye.style.left = (x-ucal_cpwidth+23)+"px";
    //  mye.style.height = ucal_cpheight+"px";
   }
   ucal_isclosing=0;
}