function msover(name)
{	if (document.images)
	{	document.images[name].src = eval (name + "_on.src");
	}
}

function msout(name)
{	if (document.images)
	{	document.images[name].src = eval (name + "_off.src");
	}
}

			if (document.images){
				glowna_off = new Image();
				glowna_off.src = "gfx/des/butt/glowna_off.gif";
				glowna_on = new Image();
				glowna_on.src = "gfx/des/butt/glowna_on.gif";
				
				aktualnosci_off = new Image();
				aktualnosci_off.src = "gfx/des/butt/aktualnosci_off.gif";
				aktualnosci_on = new Image();
				aktualnosci_on.src = "gfx/des/butt/aktualnosci_on.gif";
				
				oferta_off = new Image();
				oferta_off.src = "gfx/des/butt/oferta_off.gif";
				oferta_on = new Image();
				oferta_on.src = "gfx/des/butt/oferta_on.gif";
				
				kadra_off = new Image();
				kadra_off.src = "gfx/des/butt/kadra_off.gif";
				kadra_on = new Image();
				kadra_on.src = "gfx/des/butt/kadra_on.gif";
				
				staz_off = new Image();
				staz_off.src = "gfx/des/butt/staz_off.gif";
				staz_on = new Image();
				staz_on.src = "gfx/des/butt/staz_on.gif";
				
				partnerzy_off = new Image();
				partnerzy_off.src = "gfx/des/butt/partnerzy_off.gif";
				partnerzy_on = new Image();
				partnerzy_on.src = "gfx/des/butt/partnerzy_on.gif";
				
				kontakt_off = new Image();
				kontakt_off.src = "gfx/des/butt/kontakt_off.gif";
				kontakt_on = new Image();
				kontakt_on.src = "gfx/des/butt/kontakt_on.gif";
				
			}
			

function EnablePopUp(url, expires)
{
   var popup = document.getElementById("popup");
   var windowWidth = document.documentElement.clientWidth;
   var windowHeight = document.documentElement.clientHeight;

   var close = document.getElementById("popupClose");
   close.setAttribute('href','#');
   
   var toCookie=document.cookie.split("; ");
   
   for (i=0; i<toCookie.length; i++) {
      if(toCookie[i].split("=")[0] == 'popup'){
        var popupCookie = true;
        break;
      }
   }
  

  if(!popupCookie){
     if(expires){
       setCookie('popup',true,expires);
     }
     
     popup.onclick = function()
   {
      if(url != '') window.open(url, '_self');
      DisablePopUp(); return false;
   }



	 popup.style.display = 'block';

	 var top = windowHeight/2 - popup.offsetHeight/2;
	 var left = windowWidth/2 - popup.offsetWidth/2;


	 close.style.zIndex = '2000';
	 close.style.left = popup.offsetWidth-30+'px';
	 popup.style.top = top+'px';
	 popup.style.left = left+'px';
 }
}
function setCookie( name, value, expires, path, domain, secure )
{
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );

/*
if the expires variable is set, make the correct
expires time, the current script below will set
it for x number of days, to make it for hours,
delete * 24, for minutes, delete * 60 * 24
*/
if ( expires )
{
expires = expires * 1000 * 60;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}

function DisablePopUp() {
   document.getElementById('popup').style.display = 'none';
}
