<!--


/////////////////////////////////////
//      Copyright (c) 2004 by      //
//          Marek  Wójcik          //
/////////////////////////////////////
//     marek.wojcik@wsl.edu.pl     //
/////////////////////////////////////



function lupa(img, width, height, title)
{
  pop = null;
// copyright
  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) 2004 by Marek Wójcik --><html><head><title>WSL - "+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; 1999-"+rok+" by WSL</font></p></center></body></html>");
  pop.document.close();
  pop.focus();
}


function popup(url)
{
  aw=screen.availWidth;
  ah=screen.availHeight;
  width = 560;
  height = 300;
  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_tv(url)
{
  aw=screen.availWidth;
  ah=screen.availHeight;
  width = 560;
  height = 300;
  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'); 
/*  var popup = window.open(url+"?itemname="+itemname,'WSL','left=' + (aw-width)/2 + ',top=' + (ah-height)/2 + ',width='+width+',height='+height+',resizable=yes,scrollbars=yes,menubar=yes,status=yes,toolbar=yes,location=yes,directories=yes'); */
}

//Wybór DATY
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'); 
/*  var popup = window.open(url+"?itemname="+itemname+"&initdate="+initdate,'WSL','left=' + (aw-width)/2 + ',top=' + (ah-height)/2 + ',width='+width+',height='+height+',resizable=yes,scrollbars=yes,menubar=yes,status=yes,toolbar=yes,location=yes,directories=yes'); */
}

// Podgląd tekstu
function popup3(url,width,height,inittitle,inittext)
{
  aw=screen.availWidth;
  ah=screen.availHeight;
  var popup = window.open(url+"?inittitle="+inittitle+"&inittext="+inittext,'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 Miesiace() {
this.IleDni=new Array("", 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
this.Nazwa=new Array("", "styczeń", "luty", "marzec", "kwiecień", "maj", "czerwiec", "lipiec", "sierpień", "wrzesień", "pażdziernik", "listopad", "grudzień")
this.Dzien=new Array("", "Pn", "Wt", "Śr", "Cz", "Pt", "So", "Nd");
}

function Kalendarz(){
Kolumna=0;
nTydzien=Teraz1.getDay(Teraz1.setDate(1));
nTydzien=(nTydzien==0 ? 7 : nTydzien)
Rok=Teraz.getYear()+"";
Rok=20+""+Rok.substring(Rok.length-2,Rok.length);
if (Rok%4==0) Czas.IleDni[2]=29;

document.write("<TABLE ALIGN=CENTER BORDER=0 CELLPADDING=4 CELLSPACING=1>");
document.write("<TR><TH COLSPAN=7 style=\"color: #505050; font-size: 14;\"><NOBR>&nbsp;"+Czas.Nazwa[Teraz.getMonth()+1]+"&nbsp;"+Rok+"</NOBR></TH></TR><TR>");
for (i=1; i<=7; i++) {
document.write("<TH");
if (i==7) document.write("><FONT SIZE=1 COLOR=#FFCC00");

if (i!=7) document.write("><FONT SIZE=1 COLOR=#202020");

document.write(">"+Czas.Dzien[i]+"</FONT></TH>");
}
document.write("</TR><TR>");
for (i=1; i<nTydzien; i++) {
document.write("<TD></TD>");
Kolumna++};
for (i=1; i<=Czas.IleDni[Teraz.getMonth()+1]; i++) {

document.write("<TH");
if (i==Teraz.getDate()) document.write(" BGCOLOR=#FFCC66><FONT SIZE=1 COLOR=#FFFFFF");
if (Kolumna==6) document.write(" BGCOLOR=#FFFFFF><FONT SIZE=1 COLOR=#FFCC66");
if (Kolumna!=6) document.write(" BGCOLOR=#FFFFFF><FONT SIZE=1 COLOR=#808080");
document.write(">"+i+"</FONT></TH>");
Kolumna++;
if (Kolumna==7) {
document.write("</TR><TR>");
Kolumna=0};
};
document.write("</TR></TABLE>");
}

function Kalendarz2(){
Kolumna=0;
nTydzien=Teraz1.getDay(Teraz1.setDate(1));
nTydzien=(nTydzien==0 ? 7 : nTydzien)
Rok=Teraz.getYear()+"";
Rok=20+""+Rok.substring(Rok.length-2,Rok.length);
if (Rok%4==0) Czas.IleDni[2]=29;

document.write("<TABLE ALIGN=CENTER BORDER=1 CELLPADDING=4 CELLSPACING=1>");
document.write("<TR><TH COLSPAN=7 style=\"color: #505050; font-size: 14;\"><NOBR><a href=\"#\"><</a>&nbsp;"+Czas.Nazwa[Teraz.getMonth()+1]+"&nbsp;"+Rok+"&nbsp;<a href=\"#\">></a></NOBR></TH></TR><TR>");
for (i=1; i<=7; i++) {
document.write("<TH");
if (i==7) document.write("><FONT SIZE=1 COLOR=#FFCC00");

if (i!=7) document.write("><FONT SIZE=1 COLOR=#202020");

document.write(">"+Czas.Dzien[i]+"</FONT></TH>");
}
document.write("</TR><TR>");
for (i=1; i<nTydzien; i++) {
document.write("<TD></TD>");
Kolumna++};
for (i=1; i<=Czas.IleDni[Teraz.getMonth()+1]; i++) {

document.write("<TH");
if (i==Teraz.getDate()) document.write(" BGCOLOR=#FFCC66><FONT SIZE=1 COLOR=#FFFFFF");
if (Kolumna==6) document.write(" BGCOLOR=#FFFFFF><FONT SIZE=1 COLOR=#FFCC66");
if (Kolumna!=6) document.write(" BGCOLOR=#FFFFFF><FONT SIZE=1 COLOR=#808080");
document.write(">"+i+"</FONT></TH>");
Kolumna++;
if (Kolumna==7) {
document.write("</TR><TR>");
Kolumna=0};
};
document.write("</TR></TABLE>");
}


//-->