function isEmail(s) {
	return s != "" 	&& s.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/);	
}

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;
}



var delayhide;
function sel_visibility(object)
{
	pokazuj();
	div = document.getElementById(object);
	if (div.style.visibility=='visible')
	{
		div.style.visibility='hidden';
    	div.style.display = "none";
	}
	else
	{
		div.style.visibility='visible';
		div.style.display = "block";
	}
}

    

	
	
function pokazuj(object)
{
	if (window.delayhide)
		clearTimeout(delayhide)
}

var uk;
function zmien(object)
{
	if (window.delayhide)
		clearTimeout(delayhide)
		
	div = document.getElementById(object);
	div = object;
	var uk = 0;
	if (div.className=='zmien_on')
		div.className='zmien_off';
	else
		div.className='zmien_on';
}



function sel_hide(object)
{
	div = document.getElementById(object);
	div.style.visibility='hidden';
}

function ukryj(object)
{
	delayhide=setTimeout(function() {sel_hide(object)},150)
}


		function mySend(f)
		{
			if (!CheckEMail(f.email.value))
			{
				alert("Podaj poprawnie adres e-mail...");
				f.email.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;
		}

function ex(el) {
	alert(el)
}
/*
var bV=parseInt(navigator.appVersion);
NS4=(document.layers) ? true : false;
IE4=((document.all)&&(bV>=4)) ? true : false;
DOM=(!document.layers && !document.all && bV>=4) ? true : false; // A hack to guess if the browser supports the DOM
capable = (NS4 || IE4 || DOM) ? true : false;

function initIt(el){
  if (NS4) {
    whichEl = eval("document." + el);
	whichEl.visibility = "hide";
    }
    arrange();
  } else if(IE4) {
    whichEl = eval(el);
	whichEl.style.display = "none"
  } else if(DOM) {
    whichEl = document.getElementById(el);
	whichEl.style.visibility = "hidden";
    }
  }
}



function expandIt(el) {

if (!capable) return;
  if (IE4) {
	alert(el);
 } else if(NS4) {
    expandNS(el);
  } else if(DOM) {
    expandDOM(el);
  }
}

function expandIE(el) {
  whichEl = eval(el);

  if (whichEl.style.display == "none") {
    whichEl.style.display = "block";
  }
  else {
    whichEl.style.display = "none";
  }
}

function expandNS(el) {
  whichEl = eval("document." + el);
  if (whichEl.visibility == "hide") {
    whichEl.visibility = "show";
  }
  else {
    whichEl.visibility = "hide";
  }
  arrange();
}

function expandDOM(el) {

  whichEl = document.getElementById(el);

  if (whichEl.style.visibility != "visible") {
    whichEl.style.visibility = "visible";
  } else {
    whichEl.style.visibility = "hidden";
  }

}
*/