function rozwin(id){
	var stan = document.getElementById(id).style.display;
	if(stan == 'block')
	{
		stan = document.getElementById(id).style.display = 'none';
	}
	else
	{
		stan = document.getElementById(id).style.display = 'block';
	}
}

// Autorem skryptu jest: SŁAWOMIR KOKŁOWSKI
// www.kurshtml.boo.pl
// Jeśli chcesz wykorzystać ten skrypt na swojej stronie, nie usuwaj tego komentarza!

function przycisk(podstawowy, wskazany, klikniety, tekst)
{
  if (document.images)
  {
    this.name = "img" + przyciski.length;
    if (podstawowy) { this.normal = new Image(); this.normal.src = podstawowy }
    if (wskazany) { this.over = new Image(); this.over.src = wskazany }
    if (klikniety) { this.down = new Image(); this.down.src = klikniety }
  }
  if (tekst) this.opis = tekst;

  this.normalizuj = normalizuj;
  this.podswietl = podswietl;
  this.kliknij = kliknij;

  return this;
     
  function normalizuj() { if (document.images) document.images[this.name].src = this.normal.src; window.status = "" }
  function podswietl() { if (document.images && this.over) document.images[this.name].src = this.over.src; if (this.opis) window.status = this.opis }
  function kliknij() { if (document.images) document.images[this.name].src = this.down.src }
}

function show(adres, div_id) {
	if (window.ActiveXObject) 
		zadanie = new ActiveXObject("Microsoft.XMLHTTP");
	else if (window.XMLHttpRequest)
		zadanie = new XMLHttpRequest();
	else
		alert('Twoja przegladarka nie obsluguje AJAX-u');
	
	zadanie.onreadystatechange = function() {
		otworz_strone(zadanie, div_id);
	}
		if (zadanie.overrideMimeType)
	//	zadanie.overrideMimeType('text/xml; charset=windows-1250');
		zadanie.overrideMimeType('text/xml; charset=iso-8859-2'); 
	zadanie.open('GET', adres, true);
	zadanie.send(null);
}

function otworz_strone(zadanie, div_id) {
	if (zadanie.readyState == 4) {
		if (zadanie.status == 200 || window.location.href.indexOf("http") == -1)
			document.getElementById(div_id).innerHTML = zadanie.responseText;
		else
			alert('Wystapil blad przy polaczeniu z serwerem');
	}
}

function displayWindow(url, width,height) {
        var Win = window.open(url,"displayWindow", 'width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,menubar=no' );
}
function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features).focus();
}
function email(e)
{
	if(e.indexOf('@') >=0)
		return true;
	else
		return false;
}

function dodaj(adres)
{
	if(email(document.forms['newsletter']['email'].value)) {
		MM_openBrWindow('http://www.prawnicypolscy.pl/newsletter.php?email='+document.forms['newsletter']['email'].value
			+"&do=add",'newsletter','width=200,height=130');
	}
	else
		alert("Niepoprawny adres e-mail");
}

function usun()
{
	if(email(document.forms['newsletter']['email'].value)) {
		MM_openBrWindow('http://localhost/prawnicy/www/newsletter.php?email='+document.forms['newsletter']['email'].value
			+"&do=remove",'newsletter','width=200,height=130');
	}
	else
		alert("Niepoprawny adres e-mail");
}
function print_email(user) {
  site = "prawnicypolscy.pl";
  document.write('<a class="news" href=\"mailto:' + user + '@' + site + '\">');
  document.write(user+'@'+site+'</a>');
}