function lupa(img, width, height, title)
{
  pop = null;
	
  today=new Date();
  rok=today.getFullYear();			
	
  width1=width+30;
  height1=height+30;
  aw=screen.availWidth;
  ah=screen.availHeight;
  if(pop==null || pop.closed){
    if (height1 > ah) {
      height1 = ah - 200;
      width1 = aw - 50;
      pop = window.open('','Lupa',"left=" + (aw-width1)/2 + "," +"top=" + (ah-height1)/2 + "," +"screenX=" + (aw-width1)/2 + "," +"screenY=" + (ah-height1)/2 + "," +"width=" + width1 + "," +"height=" + height1 + "," +"innerWidth=" + width1 + "," +"innerHeight=" + height1 +"," +"toolbar=no," +"location=no," +"directories=no," +"status=no," +"menubar=no," +"scrollbars=yes," +"resizable=no");
    } else {
      pop = window.open('','Lupa',"left=" + (aw-width1)/2 + "," +"top=" + (ah-height1)/2 + "," +"screenX=" + (aw-width1)/2 + "," +"screenY=" + (ah-height1)/2 + "," +"width=" + width1 + "," +"height=" + height1 + "," +"innerWidth=" + width1 + "," +"innerHeight=" + height1 +"," +"toolbar=no," +"location=no," +"directories=no," +"status=no," +"menubar=no," +"scrollbars=no," +"resizable=no");
    }
  }
  pop.document.open();
  pop.document.clear();
  pop.document.write("<!-- Copyright (c) "+rok+" by wasiu --><html><head><title>wasiu.eu - "+title+"</title></head><body marginwidth=0 marginheight=0  topmargin=0 leftmargin=0  bgcolor=#E1E1E1><center><font face=\"Verdana, Arial, Helvetica\" color=#30445A  size=1><b>"+title+"</b></font><br /><a href=\"javascript:window.close()\"><img src=\""+img+"\"  width="+width+" height="+height+" border=0 style=\"border: 1 solid #30445A\" alt=\"Kliknij by zamkn±æ  okienko\"></a><p style=\"margin-top: 0\"><font face=\"Verdana, Arial, Helvetica\" color=#30445A size=1>Copyright &copy; 2003-"+rok+" by wasiu</font></p></center></body></html>");
  pop.document.close();
  pop.focus();
}


function popup(url)
{
  aw=screen.availWidth;
  ah=screen.availHeight;
  width = 1024;
  height = 768;
  var popup = window.open(url,"popup",'left=' + (aw-width)/2 + ',top=' + (ah-height)/2 + ',width='+width+',height='+height+',resizable=yes,scrollbars=yes,menubar=no' );
}

function popup_next(url)
{
  aw=screen.availWidth;
  ah=screen.availHeight;
  width = 560;
  height = 300;
  var popup_next = window.open(url,"popup_next",'left=' + (aw-width)/2 + ',top=' + (ah-height)/2 + ',width='+width+',height='+height+',resizable=yes,scrollbars=yes,menubar=no' );
}

function popup1(url,width,height,itemname)
{
  aw=screen.availWidth;
  ah=screen.availHeight;
  var popup = window.open(url+"?itemname="+itemname,'popup1','left=' + (aw-width)/2 + ',top=' + (ah-height)/2 + ',width='+width+',height='+height+',resizable=no,scrollbars=no,menubar=no,status=no,toolbar=no,location=no,directories=no'); 
}


function popup2(url,width,height,itemname,initdate)
{
  aw=screen.availWidth;
  ah=screen.availHeight;
  var popup = window.open(url+"?itemname="+itemname+"&initdate="+initdate,'popup2','left=' + (aw-width)/2 + ',top=' + (ah-height)/2 + ',width='+width+',height='+height+',resizable=no,scrollbars=no,menubar=no,status=no,toolbar=no,location=no,directories=no'); 
}


function img_change(img_name,img)
{
  img_name.src = img.src;
}

function write_status(text)
{
  window.status=text;
}

function confirm_delete(link, dzial, text)
{
  var is_confirmed = confirm('Usuwasz ' + dzial + ' :\n' + text + '\n\nJeste¶ pewien tego co robisz ???');
  if (is_confirmed) {
    link.href += '&is_confirmed=1';
  }
  return is_confirmed;
}


function confirm_action(link, action)
{
  var is_confirmed = confirm('Czy na pewno chcesz\n' + action + ' ???');
  if (is_confirmed) {
    link.href += '&is_confirmed=1';
  }
  return is_confirmed;
}


function highlight_row(row, new_color)
{
  cells = row.cells;
  cellscnt  = cells.length; 
  for (i = 0; i < cellscnt; i++)  {
    cells[i].style.backgroundColor = new_color;
  } 
}


function get_cookie(name) {
  var start = document.cookie.indexOf(name+"=");
  var len = start+name.length+1;
  if ((!start) && (name != document.cookie.substring(0,name.length))) return "";
  if (start == -1) return "";
  var end = document.cookie.indexOf(";",len);
  if (end == -1) end = document.cookie.length;
  return unescape(document.cookie.substring(len,end));
}


function set_cookie(name,value,expires,path,domain,secure) {
  document.cookie = name + "=" +escape(value) +
    ( (expires) ? ";expires=" + expires.toGMTString() : "") +
    ( (path) ? ";path=" + path : "") + 
    ( (domain) ? ";domain=" + domain : "") +
    ( (secure) ? ";secure" : "");
}


function clear_input(obj)  {
  obj.value="";
  return;
}

function setfocus(obj) {
  obj.focus();
  return;
}

function bookmarkit()
{
window.external.addFavorite('http://www.wasiu.eu/','wasiu.eu - skydiving. freefly. kamermen. kaski.')
}
