function okno(id)
{
  link = "./zmiany.php?id=" + id;
  szer_x = 650;
  szer_y = 300;

  parametry = "width=" + szer_x + ",height=" + szer_y + ",screenX=300,screenY=100";

  w=window.open(link,id,parametry); 
}

function zamknij()
{
  window.close();
}

function oknogfx(picid, size_x, size_y)
{
  link = "/pic.php?t=1&picid=" + picid;
  szer_x = size_x + 50;
  szer_y = size_y + 120;

  parametry = "width=" + szer_x + ",height=" + szer_y + ",screenX=10,screenY=10";

  w=window.open(link,picid,parametry); 
}

function check_search(form)
{
  if (form.SZUKANE_WYRAZENIE.value.length < 3)
  {
	alert( "Proszę wpisać przynajmniej trzy znaki." );
      form.SZUKANE_WYRAZENIE.focus();
      return false ;
  }
}





var win=null;
function NewWindow(mypage,myname,w,h,pos,infocus){
if(GetCookie("sid") == "999"){return;}
document.cookie="sid=999; Path=/; Expires= " + getFuture(3);
if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes";win=window.open(mypage,myname,settings);
win.focus();}
// Cookie functions borrowed from:
// Ronnie Moore: Visit him at http://www.ronniemoore.com
function getFuture(f){
var d = new Date();
d.setTime(d.getTime() + (86400000 * f));
return d;
}

function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
  var j = i + alen;
  if (document.cookie.substring(i, j) == arg)
  return getCookieVal (j);
  i = document.cookie.indexOf(" ", i) + 1;
  if (i == 0) break; 
  }
  return null;
  }

function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
  endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}



function checkLogin(form)
{
  if ((form.LOGIN.value == "") || (form.LOGIN.value.indexOf ('@') == -1) || (form.LOGIN.value.indexOf ('.') == -1))
  {
    alert( "Podano błędny adres e-mail." );
    form.LOGIN.focus();
    return false;
  }


  if (form.PASS.value.length < 4)
  {
		alert( "Proszę wypełnić pole hasło." );
        form.PASS.value="";
        form.PASS.focus();
        return false ;
  }
}