var xmlHttp = createXmlHttpRequestObject(); 
function createXmlHttpRequestObject() 
{
  var xmlHttp;
  if(window.ActiveXObject)
  {
    try
    {
      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch (e) 
    {
      xmlHttp = false;
    }
  }
  else
  {
    try 
    {
      xmlHttp = new XMLHttpRequest();
    }
    catch (e) 
    {
      xmlHttp = false;
    }
  }
  if (!xmlHttp)
    alert("Blad podczas tworzenia obiektu XMLHttpRequest.");
  else 
    return xmlHttp;
}

function sprawdzemail(idd) {
show_progressbar('czyemailok');
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
	xmlHttp.open("GET", "javascript/php/phpjs.php?idd=" + idd + "&ic=sprawdzemail", true);  
    xmlHttp.onreadystatechange = function() {
		
	  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      helloMessage = xmlHttp.responseText;
      document.getElementById("czyemailok").innerHTML = helloMessage;
    } 
    else 
    {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
	
    xmlHttp.send(null);	
  }
}

function logowanie() {
document.getElementById('jsokienko2').style.display='block';
show_progressbar('jscontent2');
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
	xmlHttp.open("GET", "javascript/php/phpjs.php?ic=logowanie", true);  
    xmlHttp.onreadystatechange = function() {
		
	  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      helloMessage = xmlHttp.responseText;
      document.getElementById("jscontent2").innerHTML = helloMessage;
    } 
    else 
    {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
	
    xmlHttp.send(null);	
  }
}

function zaloguj(idd,nnr) {
document.getElementById('jsokienko').style.display='block';
show_progressbar('jscontent');
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
	xmlHttp.open("GET", "javascript/php/phpjs.php?idd=" + idd + "&nnr=" + nnr + "&ic=zalogowany", true);  
    xmlHttp.onreadystatechange = function() {
	  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      helloMessage = xmlHttp.responseText;
      document.getElementById("jscontent").innerHTML = helloMessage;
	  document.getElementById('jsokienko').style.display='none';
	  window.location.href = "?ac=";

    } 
    else 
    {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
	
    xmlHttp.send(null);	
  }
}

function wyloguj(idd) {
document.getElementById('jsokienko').style.display='block';
show_progressbar('jscontent');
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
	xmlHttp.open("GET", "javascript/php/phpjs.php?idd=" + idd + "&ic=wyloguj", true);  
    xmlHttp.onreadystatechange = function() {
	var idd=idd;	
	  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      helloMessage = xmlHttp.responseText;
      document.getElementById("jscontent").innerHTML = helloMessage;
	  document.getElementById('jsokienko').style.display='none';
	  window.location.href = "?ac=";
    } 
    else 
    {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
	
    xmlHttp.send(null);	
  }
}

function zapiszkomentarz(idk,idt,idu,komentarz) {
document.getElementById('jsokienko').style.display='block';
show_progressbar('jscontent');
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
	xmlHttp.open("GET", "javascript/php/phpjs.php?idd=" + idk + "&nnr=" + idt + "&uss=" + idu + "&komm=" + encodeURIComponent(komentarz) + "&ic=zapiszkomentarz", true);  
    xmlHttp.onreadystatechange = function() {
	var idd=idd;	
	  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      helloMessage = xmlHttp.responseText;
      document.getElementById("skomentowanetresci").innerHTML = helloMessage;
	  document.getElementById('jsokienko').style.display='none';
    } 
    else 
    {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
	
    xmlHttp.send(null);	
  }
}

function edytujkomentarz(idk) {
show_progressbar('kommen'+idk);
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
	xmlHttp.open("GET", "javascript/php/phpjs.php?idd=" + idk + "&ic=edytujkomentarz", true);  
    xmlHttp.onreadystatechange = function() {
	var idd=idd;	
	  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      helloMessage = xmlHttp.responseText;
      document.getElementById("kommen"+idk).innerHTML = helloMessage;
    } 
    else 
    {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
	
    xmlHttp.send(null);	
  }
}

function zapiszeditkomentarz(idk,komentarz) {
show_progressbar('kommen'+idk);
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
	xmlHttp.open("GET", "javascript/php/phpjs.php?idd=" + idk + "&komm=" + encodeURIComponent(komentarz) + "&ic=zapiszeditkomentarz", true);  
    xmlHttp.onreadystatechange = function() {
	var idd=idd;	
	  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      helloMessage = xmlHttp.responseText;
      document.getElementById("kommen"+idk).innerHTML = helloMessage;
    } 
    else 
    {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
	
    xmlHttp.send(null);	
  }
}

function usunkomentarz(idk) {
show_progressbar('kommen'+idk);
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
	xmlHttp.open("GET", "javascript/php/phpjs.php?idd=" + idk + "&ic=usunkomentarz", true);  
    xmlHttp.onreadystatechange = function() {
	var idd=idd;	
	  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      helloMessage = xmlHttp.responseText;
      document.getElementById("kommen"+idk).innerHTML = helloMessage;
    } 
    else 
    {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
	
    xmlHttp.send(null);	
  }
}

function przydzielrolewgrupie(idk,idt) {
show_progressbar("rolawgrupie" + idk + idt);
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
	xmlHttp.open("GET", "javascript/php/phpjs.php?idd=" + idk + "&nnr=" + idt + "&ic=przydzielrolewgrupie", true);  
    xmlHttp.onreadystatechange = function() {
	var idd=idd;	
	  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      helloMessage = xmlHttp.responseText;
      document.getElementById("rolawgrupie" + idk + idt).innerHTML = helloMessage;
    } 
    else 
    {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
	
    xmlHttp.send(null);	
  }
}


function zapiszrolewgrupie(idk,idt,komentarz) {
show_progressbar("rolawgrupie" + idk + idt);
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
	xmlHttp.open("GET", "javascript/php/phpjs.php?idd=" + idk + "&nnr=" + idt + "&komm=" + encodeURIComponent(komentarz) + "&ic=zapiszrolewgrupie", true);  
    xmlHttp.onreadystatechange = function() {
	var idd=idd;	
	  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      helloMessage = xmlHttp.responseText;
      document.getElementById("rolawgrupie" + idk + idt).innerHTML = helloMessage;
    } 
    else 
    {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
	
    xmlHttp.send(null);	
  }
}


function zapiszzadanie(idk,idt,idu,zadanie) {
document.getElementById('jsokienko').style.display='block';
show_progressbar('jscontent');
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
	xmlHttp.open("GET", "javascript/php/phpjs.php?idd=" + idk + "&nnr=" + idt + "&uss=" + idu + "&komm=" + encodeURIComponent(zadanie) + "&ic=zapiszzadanie", true);  
    xmlHttp.onreadystatechange = function() {
	var idd=idd;	
	  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      helloMessage = xmlHttp.responseText;
      document.getElementById("formzadaniedomowe").innerHTML = helloMessage;
	  document.getElementById('jsokienko').style.display='none';
    } 
    else 
    {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
	
    xmlHttp.send(null);	
  }
}


function zatwierdzzadanieform(idk,idt) {
document.getElementById('jsokienko2').style.display='block';
show_progressbar('jscontent2');
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
	xmlHttp.open("GET", "javascript/php/phpjs.php?idd=" + idk + "&nnr=" + idt + "&ic=zatwierdzzadanieform", true);  
    xmlHttp.onreadystatechange = function() {	
	  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      helloMessage = xmlHttp.responseText;
      document.getElementById("jscontent2").innerHTML = helloMessage;
    } 
    else 
    {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
	
    xmlHttp.send(null);	
  }
}

function zatwierdzzadanie(idk,idt,komm) {
document.getElementById('jsokienko2').style.display='none';
document.getElementById('jsokienko').style.display='block';
show_progressbar('jscontent');
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
	xmlHttp.open("GET", "javascript/php/phpjs.php?idd=" + idk + "&nnr=" + idt + "&komm=" + encodeURIComponent(komm) + "&ic=zatwierdzzadanie", true);  
    xmlHttp.onreadystatechange = function() {	
	  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      helloMessage = xmlHttp.responseText;
      document.getElementById("listazadanuser"+idk).innerHTML = helloMessage;
	  document.getElementById('jsokienko').style.display='none';
    } 
    else 
    {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
	
    xmlHttp.send(null);	
  }
}


function niezatwierdzzadanieform(idk,idt) {
document.getElementById('jsokienko2').style.display='block';
show_progressbar('jscontent2');
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
	xmlHttp.open("GET", "javascript/php/phpjs.php?idd=" + idk + "&nnr=" + idt + "&ic=niezatwierdzzadanieform", true);  
    xmlHttp.onreadystatechange = function() {	
	  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      helloMessage = xmlHttp.responseText;
      document.getElementById("jscontent2").innerHTML = helloMessage;
    } 
    else 
    {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
	
    xmlHttp.send(null);	
  }
}

function niezatwierdzzadanie(idk,idt,komm) {
document.getElementById('jsokienko2').style.display='none';
document.getElementById('jsokienko').style.display='block';
show_progressbar('jscontent');
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
	xmlHttp.open("GET", "javascript/php/phpjs.php?idd=" + idk + "&nnr=" + idt + "&komm=" + encodeURIComponent(komm) + "&ic=niezatwierdzzadanie", true);  
    xmlHttp.onreadystatechange = function() {	
	  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      helloMessage = xmlHttp.responseText;
      document.getElementById("listazadanuser"+idk).innerHTML = helloMessage;
	  document.getElementById('jsokienko').style.display='none';
    } 
    else 
    {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
	
    xmlHttp.send(null);	
  }
}

function zobaczzadanie(idk) {
document.getElementById('jsokienko2').style.display='block';
show_progressbar('jscontent2');
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
	xmlHttp.open("GET", "javascript/php/phpjs.php?idd=" + idk + "&ic=zobaczzadanie", true);  
    xmlHttp.onreadystatechange = function() {
	  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      helloMessage = xmlHttp.responseText;
      document.getElementById("jscontent2").innerHTML = helloMessage;
    } 
    else 
    {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
	
    xmlHttp.send(null);	
  }
}

function przyznajodznake(uss,nnr,idk) {
document.getElementById('jsokienko2').style.display='block';
show_progressbar('jscontent2');
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
	xmlHttp.open("GET", "javascript/php/phpjs.php?uss=" + uss + "&nnr=" + nnr + "&idd=" + idk + "&ic=przyznajodznake", true);  
    xmlHttp.onreadystatechange = function() {
	  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      helloMessage = xmlHttp.responseText;
      document.getElementById("jscontent2").innerHTML = helloMessage;
    } 
    else 
    {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
	
    xmlHttp.send(null);	
  }
}

function ForumDodajtemat(idk,idu,temat) {
document.getElementById('forumdodajtematform').style.display='block';
show_progressbar('forumdodajtematform');
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
	xmlHttp.open("GET", "javascript/php/phpjs.php?idd=" + idk + "&uss=" + idu + "&komm=" + encodeURIComponent(temat) + "&ic=forumdodajtemat", true);  
    xmlHttp.onreadystatechange = function() {	
	  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      helloMessage = xmlHttp.responseText;
      document.getElementById("forumlistatematow").innerHTML = helloMessage;
	  ForumShowHide('forumdodajtematform','schowaj','forumdodajtematbutton','forum-dodajtemat');
    } 
    else 
    {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
	
    xmlHttp.send(null);	
  }
}

function ForumDodajwatek(idk,idu,idt,watek) {
document.getElementById('forumdodajwatekform').style.display='block';
show_progressbar("listawatkow" + idt);
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
	xmlHttp.open("GET", "javascript/php/phpjs.php?idd=" + idk + "&uss=" + idu + "&nnr=" + idt + "&komm=" + encodeURIComponent(watek) + "&ic=forumdodajwatek", true);  
    xmlHttp.onreadystatechange = function() {
	  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      helloMessage = xmlHttp.responseText;
      document.getElementById("listawatkow" + idt).innerHTML = helloMessage;
	  ForumShowHide('forumdodajwatekform','schowaj','forumdodajwatekbutton','forum-dodajwatek','forum-zwinform2');
    } 
    else 
    {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
	
    xmlHttp.send(null);	
  }
}

function ForumDodajwpis(idk,idu,idt,ido,wpis) {
document.getElementById('forumdodajwpisform').style.display='block';
show_progressbar("wpisydowatku");
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
	xmlHttp.open("GET", "javascript/php/phpjs.php?idd=" + idk + "&uss=" + idu + "&nnr=" + idt + "&ido=" + ido + "&komm=" + encodeURIComponent(wpis) + "&ic=forumdodajwpis", true);  
    xmlHttp.onreadystatechange = function() {	
	  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      helloMessage = xmlHttp.responseText;
      document.getElementById("wpisydowatku").innerHTML = helloMessage;
	  ForumShowHide('forumdodajwpisform','schowaj','forumdodajwpisbutton','forum-napisz','forum-zwinform3');
    } 
    else 
    {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
	
    xmlHttp.send(null);	
  }
}


function zatwierdzmodul(idk,idu,idt,ido,ador) {
show_progressbar("listaukonczylimodul"+idk);
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
	xmlHttp.open("GET", "javascript/php/phpjs.php?idd=" + idk + "&uss=" + idt + "&nnr=" + idu + "&ido=" + ido + "&komm=" + ador + "&ic=zatwierdzmodul", true);  
    xmlHttp.onreadystatechange = function() {	
	  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      helloMessage = xmlHttp.responseText;
      document.getElementById("listaukonczylimodul"+idk).innerHTML = helloMessage;
    } 
    else 
    {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
	
    xmlHttp.send(null);	
  }
}

/* FORMULARZ WYSYLANIA WIADOMOSCI E-MAIL */
function wyslijemail(idk,idt,ido) {
document.getElementById('jsokienko2').style.display='block';
show_progressbar('jscontent2');
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
	xmlHttp.open("GET", "javascript/php/phpjs.php?idd=" + idk + "&uss=" + idt + "&ido=" + ido + "&ic=wyslijemail", true);  
    xmlHttp.onreadystatechange = function() {	
	  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      helloMessage = xmlHttp.responseText;
      document.getElementById("jscontent2").innerHTML = helloMessage;
    } 
    else 
    {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
	
    xmlHttp.send(null);	
  }
}

/* WYSYLANIE WIADOMOSCI E-MAIL */
function poslijemail(idk,idu,ido,idt,wpis) {
document.getElementById('jsokienko2').style.display='block';
show_progressbar('jscontent2');
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0) {
	xmlHttp.open("GET", "javascript/php/phpjs.php?idd=" + idk + "&uss=" + idu + "&ido=" + ido + "&nnr=" + encodeURIComponent(idt) + "&komm=" + encodeURIComponent(wpis) + "&ic=poslijemail", true);  
    xmlHttp.onreadystatechange = function() {	
	  if (xmlHttp.readyState == 4) {
    if (xmlHttp.status == 200) {
      helloMessage = xmlHttp.responseText;
      document.getElementById("jscontent2").innerHTML = helloMessage;
    } else {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
    xmlHttp.send(null);	
  }
}

/* OKIENKO POWIADOMIEN */
function powiadomienia(idk,idu) {
document.getElementById('powiadomienia').style.display='block';
show_progressbar('powiadomienia');
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0) {
	xmlHttp.open("GET", "javascript/php/phpjs.php?idd=" + idk + "&uss=" + idu + "&ic=powiadomienia", true);  
    xmlHttp.onreadystatechange = function() {	
	  if (xmlHttp.readyState == 4) {
    if (xmlHttp.status == 200) {
      helloMessage = xmlHttp.responseText;
      document.getElementById("powiadomienia").innerHTML = helloMessage;
    } else {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
    xmlHttp.send(null);	
  }
}

/* WYMIANA ODZNAK */
function wymienodznaki(idk,idu,idt) {
show_progressbar('odznakipanel');
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0) {
	xmlHttp.open("GET", "javascript/php/phpjs.php?idd=" + idk + "&uss=" + idu + "&nnr=" + idt + "&ic=wymienodznaki", true);  
    xmlHttp.onreadystatechange = function() {	
	  if (xmlHttp.readyState == 4) {
    if (xmlHttp.status == 200) {
      helloMessage = xmlHttp.responseText;
      document.getElementById("odznakipanel").innerHTML = helloMessage;
    } else {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
    xmlHttp.send(null);	
  }
}

/* pokaz okienko */
function pokazokienko(komm) {
document.getElementById('jsokienko2').style.display='block';
show_progressbar('jscontent2');
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
	xmlHttp.open("GET", "javascript/php/phpjs.php?komm=" + encodeURIComponent(komm) + "&ic=pokazokienko", true);  
    xmlHttp.onreadystatechange = function() {
	var idd=idd;	
	  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      helloMessage = xmlHttp.responseText;
      document.getElementById("jscontent2").innerHTML = helloMessage;
    } 
    else 
    {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
	
    xmlHttp.send(null);	
  }
}


function pokazdymek(zdarzenie,idm) {
  obj = document.getElementById("slownikpojec");
  obj.style.visibility = "visible";
  zdarzenie = (zdarzenie)?zdarzenie:((window.event)?event:null);
  if (window.scrollX>=0) { // przesuniecie i wymiar okna dla Netscape, Firefox
    przesX = window.scrollX;
    przesY = window.scrollY;
    ekranX = window.innerWidth;
    ekranY = window.innerHeight;
  } else { // dla IE, Opery
    przesX = document.body.scrollLeft
    przesY = document.body.scrollTop
    ekranX = document.body.clientWidth;
    ekranY = document.body.clientHeight;
  }
  x = zdarzenie.clientX+przesX;
  y = zdarzenie.clientY+przesY;
 
  obj.style.left=przesX+Math.min(x,ekranX-obj.clientWidth)+"px";
  if (y<przesY+ekranY-obj.clientHeight) obj.style.top = y+"px";
  else obj.style.top = y-obj.clientHeight+"px";
  
show_progressbar('slownikpojec');
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
	xmlHttp.open("GET", "javascript/php/phpjs.php?idd=" + idm + "&ic=slownik", true); 
    xmlHttp.onreadystatechange = function() {
		
	  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      helloMessage = xmlHttp.responseText;
      document.getElementById("slownikpojec").innerHTML = helloMessage;
    } 
    else 
    {
      alert("Wystapil blad podczas uzyskiwania dostepu do serwera: " + xmlHttp.statusText);
    }
  }	
	}
	
    xmlHttp.send(null);	
  }
}  


/* ZALACZNIK PRACY DOMOWEJ */
function extCheck() {
var elem= document.getElementById("zalacznikzad");
if(elem.value!="") {
show_progressbar('zalacznikzadinfo');
var re_text = /\.pdf|\.doc|\.rtf|\.xls|\.ppt|\.docx|\.odt|\.ods|\.odp|\.txt/i;
if (elem.value.search(re_text) == -1)
    {
document.getElementById("zalacznikzadinfo").innerHTML = "";
document.getElementById("zalacznikzadinfo1").style.display = "none";
document.getElementById("zalacznikzadinfo2").style.display = "block";
file.form.reset();
return false;
    } else {
document.getElementById("zalacznikzadinfo").innerHTML = "";
document.getElementById("zalacznikzadinfo1").style.display = "block";
document.getElementById("zalacznikzadinfo2").style.display = "none";
return true;
}
} else return true;
}


function dymekstop() {
    obj = document.getElementById("slownikpojec");
    obj.style.visibility = "hidden"
}


function replace_html(coz, content) {
document.getElementById(coz).innerHTML = content;
}
function show_progressbar(coz) {
replace_html(coz, '<img src="../img/loader4.gif" border="0" alt="Trwa ladowanie danych..." />');
}
var progress_bar = new Image();
progress_bar.src = '../img/loader4.gif';


function przekieruj(url)
{
window.location.href = url;
}

function zamknijdiv(jakisd) {
document.getElementById(jakisd).style.display='none';
}

function ShowHide(layer_open, layer_close, layer_ikona) {
        if (layer_open != '') {
            expandLayer(layer_open,layer_ikona);
        }
        if (layer_close != '') {
            expandLayer(layer_close,layer_ikona);
        }
    }

    function expandLayer(name,ikona) {
        var itm = null;

        if (document.getElementById) {
            itm = document.getElementById(name);
        } else if (document.all) {
            itm = document.all[name];
        } else if (document.layers) {
            itm = document.layers[name];
        }

        if (!itm) {
        } else if (itm.style) {
            if (itm.style.display == "none") {
                itm.style.display = "";
				document.getElementById(ikona).innerHTML = '<img src="img/dzwin.png" alt="zwin" />';
            } else {
                itm.style.display = "none";
				document.getElementById(ikona).innerHTML = '<img src="img/drozwin.png" alt="rozwin" />';
            }
        } else {
            itm.visibility = "show";
        }
}

function ForumShowHide(layer_open, layer_close, layer_ikona, layer_obrazek, layer_obrazekzam) {
        if (layer_open != '') {
            ForumExpandLayer(layer_open,layer_ikona,layer_obrazek,layer_obrazekzam);
        }
        if (layer_close != '') {
            ForumExpandLayer(layer_close,layer_ikona,layer_obrazek,layer_obrazekzam);
        }
    }

    function ForumExpandLayer(name,ikona,obrazek,obrazekzam) {
        var itm = null;

        if (document.getElementById) {
            itm = document.getElementById(name);
        } else if (document.all) {
            itm = document.all[name];
        } else if (document.layers) {
            itm = document.layers[name];
        }

        if (!itm) {
        } else if (itm.style) {
            if (itm.style.display == "none") {
                itm.style.display = "";
				document.getElementById(ikona).innerHTML = "<img src=\"img/" + obrazekzam + ".png\" alt=\"rozwin\" />";
            } else {
                itm.style.display = "none";
				document.getElementById(ikona).innerHTML = "<img src=\"img/" + obrazek + ".png\" alt=\"rozwin\" />";
            }
        } else {
            itm.visibility = "show";
        }
}



/* when the DOM is ready 
window.addEvent('domready', function() {

		var sb = new Sortables('sortable-list', {

			clone:true,
			revert: true,

			initialize: function() { 
				
			},

			onStart: function(el) { 
				el.setStyle('background','#add8e6');
			},

			onComplete: function(el) {
				el.setStyle('background','#ddd');
				//build a string of the order
				var sort_order = '';
      $$('#sortable-list li').each(function(li) { sort_order = sort_order +  li.get('alt')  + '|'; });
      $('sort_order').value = sort_order;
	  var sort_order2 = '';
      $$('#sortable-list2 li').each(function(li) { sort_order2 = sort_order2 +  li.get('alt')  + '|'; });
      $('sort_order2').value = sort_order2;
			}
		});
});
*/
