function okno(){
	if(nn4){
		oknoW=window.innerWidth-16;
		oknoH=window.innerHeight
	}else if(ie4){
		oknoW=document.body.offsetWidth-20;
		oknoH=document.body.offsetHeight
	}
}

function moveBy(ident,dx,dy){
	if(nn4){
		document.layers[ident].left=document.layers[ident].left+dx;
		document.layers[ident].top=document.layers[ident].top+dy+7
	}else if(ie4){
			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(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;
	}
}


function show(ident){
	if(nn4){
		document.layers[ident].visibility="show"
	}else if(ie4){
		document.all[ident].style.visibility="visible"
	}
}

function hide(ident){
	if(nn4){
		document.layers[ident].visibility="hide"
	}else if(ie4){
		document.all[ident].style.visibility="hidden"
	}
}

function hideIt(){
	if(ie4 || nn4){
		if(nn4) document.layers[divLoadCont].visibility="hide"
		else divLoadCont.style.visibility="hidden"
	}
}

function moveIt() {
   if(document.layers) {
      document.ptaki.left += 1;
      if (document.ptaki.left >800) {
	document.ptaki.left = -300;

      }
   } else if (document.all) {
      ptaki.style.left = parseInt(ptaki.style.left) + 1;
      if (parseInt(ptaki.style.left) > 800) {
	ptaki.style.left = -300;

      }
   }
   if ((document.layers) || (document.all)) {
     setTimeout('moveIt()', 20);
   } 
}

// zamiana obrazków  
function ChangeImage(imgname, imgSrc) {
		document[imgname].src = "images/" + imgSrc + ".gif";
};

function clipTo(ident, t, r, b, l) {
	if(nn4) {
		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(ie4) {
    		document.all[ident].style.clip = 
				"rect(" + t + " " + r + " " + b + " " + l + ")";
	}
}

function clipBy(ident, t, r, b, l) {
	if(nn4) {
		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(ie4) {
		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 pozycja(ident) {
	if(nn4) {
		l = document.layers[ident].left;
		t = document.layers[ident].top;
	} else if(ie4) {
		l = document.all[ident].style.pixelLeft;
		t = document.all[ident].style.pixelTop;
	}
}

function wysokosc(ident) {
	if(nn4) {
		h = document.layers[ident].document.height;
	} else if(ie4) {
		h = document.all[ident].scrollHeight;	
	}
	return h;
}