function isEmail(s) {
	return s != "" 	&& s.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/);	
}

function zmien (foto)
{
	pom = document.getElementById('bigfoto');
	pom.src = foto;
}


function powieksz(el, fname, s, w)
{
	wys = w + 5;
	szer = s + 25;

	  if(window.screen){
		aw=screen.availWidth;
		ah=screen.availHeight;
	  }else{
		aw=640;
		ah=450;
	  }

	  if (szer>810) szer = 810;
	  if (wys>610) wys = 610;

	str = "foto.php?dir="+escape(el)+"&ph="+escape(fname);
	var win = window.open(str,"zoom","width="+szer+", height="+wys+", left="+(aw-szer)/2+", top="+ (ah-wys)/2+", titlebar=no, status=no, toolbar=no, menubar=no, location=no, resizable=yes, scrollbars=yes, fullscreen=no");
	win.focus();

}


noweOkienko = null;
function wnd(src, nazwa, w, h)
{
  if(window.screen){
    aw=screen.availWidth;
	ah=screen.availHeight;
  }else{
    aw=800;
    ah=600;
  }
  
	w = w > aw ? aw : w;
  	h = h > ah ? ah : h;
  
  //if(noweOkienko==null || noweOkienko.closed){
    ustawienia=
     "left=" + (aw-w)/2 + ", "
    +"top=" + (ah-h)/2 + ", "
    +"screenX=" + (aw-w)/2 + ", "
    +"screenY=" + (ah-h)/2 + ", "
    +"width=" + w + ", "
    +"height=" + h + ", "
    +"innerWidth=" + w + ", "
    +"innerHeight=" + h + ", "
    +"toolbar=no, "
    +"location=no, "
    +"directories=no, "
    +"status=no, "
    +"menubar=no, "
    +"resizable=yes, "
	+"status=no";
   if( w == aw || h == ah ) ustawienia += ", scrollbars=yes ";
	
	noweOkienko = window.open(src,nazwa,ustawienia);

  //}
  noweOkienko.focus();
  return noweOkienko;
}


function Print(patch)
{
	w=750;
	h=350;
  if(window.screen){
    aw=screen.availWidth;
    ah=screen.availHeight;
  }else{
    aw=640;
    ah=450;
  }
  //if(noweOkienko==null || noweOkienko.closed){
    ustawienia=
     "left=" + (aw-w)/2 + ", "
    +"top=" + (ah-h)/2 + ", "
    +"screenX=" + (aw-w)/2 + ", "
    +"screenY=" + (ah-h)/2 + ", "
    +"width=" + w + ", "
    +"height=" + h + ", "
    +"innerWidth=" + w + ", "
    +"innerHeight=" + h + ", "
    +"toolbar=yes, "
    +"location=no, "
    +"directories=no, "
    +"status=no, "
    +"menubar=yes, "
    +"scrollbars=yes, "
    +"resizable=yes, "
	+"status=no";
	noweOkienko = window.open(patch, "print", ustawienia);

  //}
  return noweOkienko;
}


// SELECT DIV
var delayhide;
var uk;

function div_visibility(object)
{
	pom = document.getElementById('ls');

	if (pom) 
	{ 
		
		img = document.getElementById('obrazek_'+object);
		img.src = "img/bull_2.gif";

		if (pom.value) 
		{
			div_hide('opis_'+pom.value);
			img = document.getElementById('obrazek_'+pom.value);
			img.src = "img/bull.gif";
		}
		
		pom.value = object;
	}


	div = document.getElementById('opis_'+object);
	div.style.visibility='visible';
	
}

function div_hide(object)
{
	div = document.getElementById(object);
	div.style.visibility='hidden';
}

/////////////////////



		function mySend(f)
		{
			if (!CheckEMail(f.ml.value))
			{
				alert("Podaj poprawnie adres e-mail...");
				f.ml.focus();
				return;
			}
			return true;
		}

		function CheckEMail(adres)
		{
			if (adres.indexOf('@') == -1)
				return false;
			if (adres.length < 4)
				return false;
			if (adres.indexOf('@') != adres.lastIndexOf('@'))
				return false;
			if (adres.indexOf(' ') != -1)
				return false;
			return true;
		}

