function checkaddr(f) {
var email=/^[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*@[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*\.([A-Za-z]){2,5}$/i;
if (!email.test(f.email.value)) {
  alert("Podaj poprawny adres email!");
  f.email.focus();
  return (false);
}}

photowindow_op = null;
function photowindow(url, width, height, scroll){
  if (photowindow_op) photowindow_op.close();
	params = "status=no, menubar=no, resizeable=no, toolbar=no, location=no, directories=no, left=20, top=20, width=" + width + ", height=" + height;	
  photowindow_op = window.open('/picture_big.php'+url, "photo", params);
  photowindow_op.focus();
}

function visibility_toggle(object, showit) {
  visvalue = showit ? 'visible' : 'hidden';

  if (document.getElementById) {
    document.getElementById(object).style.visibility = visvalue;
  }

  else if (document.layers && document.layers[object] != null) {
    document.layers[object].visibility = visvalue;
  }

  else if (document.all) {
    document.all[object].style.visibility = visvalue;
  }

  return false;
}


/* -------------------------------------------------------------------- */
/** Script for usefull block following vertical scrollbar position 
	author: Kamil Szot

	usage:
		do something like this when you'r html loads (for ex. in body onLoad):
			
			document.przesuwak = new JScroller(left,'przesuwak')

			przesuwak can be replaced by other identifier, if you have many 
			blocks in one page than every one should have unique identifier

			left is an id of block element that is being moved
			it should have style="position: relative;"

*/
  	function JScrollerPos(elem) {

			var p,elem;

			p = {x: 0.0, y: 0.0};

			while(elem && elem != document.body) {

				p.x+=elem.offsetLeft;

				p.y+=elem.offsetTop;


				elem=elem.offsetParent;

			}


			return p;

	}

	function JScrollerScrollIt() {
		this.wh = this.miernota.offsetHeight;
		this.wx = document.body.scrollTop - JScrollerPos(this.element.parentNode).y;
		this.h  = this.element.offsetHeight;
		this.ch = this.element.parentNode.offsetHeight;

		if(this.wh<this.h) {
			if(this.wx < this.x) {
				this.dest = this.wx;
				if(this.dest < 0) this.dest = 0;
			} else if(this.wx+this.wh > this.x + this.h) {
				this.dest = this.wx + this.wh - this.h;
				if(this.dest+this.h > this.ch) this.dest = this.ch - this.h;
			}
		} else {
			this.dest = this.wx;
			if(this.dest < 0) this.dest = 0;
			if(this.dest+this.h > this.ch) this.dest = this.ch - this.h;
		}
		this.x += (this.dest - this.x);//16;
		this.element.style.top = this.x+"px";

/*
		dbg = "x = "+this.x+"<br>";
		dbg+= "wx = "+this.wx+"<br>";
		dbg+= "h = "+this.h+"<br>";
		dbg+= "wh = "+this.wh+"<br>";
		dbg+= "ch = "+this.ch+"<br>";
		dbg+= "x = "+this.x+"<br>";
		dbg+= "dest = "+this.dest+"<br>";
		this.element.innerHTML = dbg;
*/
	}

	function JScroller(element, name_of_this_object) {
		// create element for measuring window
		this.miernota=document.createElement("DIV");
		this.miernota.style.visibility = 'hidden';
		this.miernota.style.height = '100%';
		this.miernota.style.left = '0px';
		this.miernota.style.top = '0px';
		this.miernota.style.position = 'absolute';
		document.body.appendChild(this.miernota);

		this.element = element;
		this.x  = 0;


		this.scrollIt = JScrollerScrollIt;

		setInterval('document.'+name_of_this_object+'.scrollIt()',20);
	}
/* -------------------------------------------------------------------- */