function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else var expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}


function showWindow(page, title, w, h) {
  var showWindow = window.open(page, title, 'top=20,left=40,width='+w+',height='+h+',scrollbars=yes, resizable=yes ');
  if(showWindow)
  	showWindow.focus();
}

function openPopup()
{
  //if (readCookie('popupcookie') == null)
  //{
    t = screen.availHeight/2-150;
    l = screen.availWidth/2-125;
    w = window.open('/popup/index.htm', 'akcje', 'top='+t+', left='+l+', width=297, height=297, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no');
    if(w){
    	w.focus();
    }
    
    //createCookie('popupcookie', '1', 7);
  //}
}

function show(name){
  if(document.getElementById(name)) {
  	//document.getElementById(name).style.visibility = 'visible';
  	document.getElementById(name).style.display = 'block';
  }
}
function hide(name){
	if(document.getElementById(name)) {
  		//document.getElementById(name).style.visibility = 'hidden';
  		document.getElementById(name).style.display = 'none';
  	}
}
