function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

  function ukryj(a) {
  document.getElementById(a).style.visibility="hidden";
  document.getElementById(a).style.display="none";
  }
  function pokaz(a) {
  document.getElementById(a).style.visibility="visible";
  document.getElementById(a).style.display="block";
  }

  function pokaz_onas(){
	//adjPosition();
//	alert(document.body.scrollTop);
    ukryj("menu_dlaczegowarto");
    pokaz("menu_onas");
    ukryj("menu_corobimy");
	}

  function pokaz_corobimy(){
	//adjPosition();
//	alert(document.body.scrollTop);
    ukryj("menu_dlaczegowarto");
    ukryj("menu_onas");
    pokaz("menu_corobimy");
	}
	
  function pokaz_dlaczegowarto(){
	//adjPosition();
//	alert(document.body.scrollTop);
    pokaz("menu_dlaczegowarto");
    ukryj("menu_onas");
    ukryj("menu_corobimy");
	}

  function closeSubnav(event){
	x=findPosX(document.getElementById("gora"));
	y=findPosY(document.getElementById("gora"));
	if ((event.clientY<y+0)||(event.clientY>y+330)) {
    document.getElementById("menu_dlaczegowarto").style.visibility="hidden";
    document.getElementById("menu_onas").style.visibility="hidden";
    document.getElementById("menu_corobimy").style.visibility="hidden";
	}
  }
  
  function adjPosition() {
document.getElementById("menu_corobimy").style.left=findPosX(document.getElementById("gorna"))+270+"px";
document.getElementById("menu_corobimy").style.left=findPosX(document.getElementById("gorna"))+200+"px";
document.getElementById("menu_corobimy").style.top=findPosY(document.getElementById("gorna"))+20+"px";
document.getElementById("menu_corobimy").style.top=findPosY(document.getElementById("gorna"))+20+"px";
	}

   function rozwin() {
    //document.getElementById("news").style.height="505px";
	document.getElementById("gorna").style.top="-195px";
    document.getElementById("dol").style.visibility="visible";

   }