var isMsie=(navigator.appVersion.indexOf("MSIE") == -1) ? false : true;

var mainpath = 'http://www.nowa-ama.pl/';
var applname = 'NowaAMA';

function show(photo, width, height)
{
 scWidth = (screen.availWidth-width)/2;
 scHeight = (screen.availHeight-height)/2;
 PopUp = window.open('','Photo','toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,width='+width+',height='+height+',top='+scHeight+',left='+scWidth);
 PopUp.document.write('<HTML><HEAD><TITLE>Nowa Ama</TITLE></HEAD><BODY onblur="javascript: self.close()" bgcolor="white" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0"><img style="cursor: hand;" src="'+photo+'" Alt="Kliknij aby zamkn±ć" onclick="javascript: self.close()"></BODY></HTML>');
 PopUp.document.close();
}

function popwnd(url, width, height)
{
	 scWidth = (screen.availWidth-width)/2;
	 scHeight = (screen.availHeight-height)/2;
	 PopUp = window.open(url,'','toolbar=no,location=no,directories=no,status=no,scrollbars=1,resizable=1,width='+width+',height='+height+',top='+scHeight+',left='+scWidth);
	 return false;
}

function insstart() {
if(isMsie) document.writeln('<td align=right valign=center><span style="font-family:Arial; font-size:11px; background:#C8D8FF"><A HREF=#. onClick="this.style.behavior=\'url(#default#homepage)\'; this.setHomePage(\''+mainpath+'\');">Ustaw jako startow&#261;</A></span></td>');
};

function testemail(_email) {
if(_email == "") { alert("Proszę podać adres e-mail"); return false; };
var posat = _email.indexOf('@');
var posdot = _email.indexOf('.');
var possp = _email.indexOf(' ');
var lastch = _email.length-1;
if((posat <= 0) || (posat == lastch) || (posdot < 0) || (posdot == lastch) || (possp >= 0)) { alert("Proszę poprawić adres e-mail"); return false; };
return true;
}

function submitezine(f) {
	if(!testemail(f.email.value)) return false;
}

function submitezine_minus(f) {
	if(!testemail(f.email.value)) return false;
	f.email.value = '-minus- '+f.email.value;
}

function submitpageinfo(f) {
	if(!testemail(f.email.value)) return false;
	if(f.from.value == "") { alert("Proszę podać swoje imię i nazwisko"); return false; };
	if(f.subject.value == "") f.subject.value = parent.document.title;
}

function send_quest(_form) {
  if(_form.Pytanie.value == "") {
    alert("Brak tresci pytania");
	return;
  }
  if(_form.Podpis.value == "") {
    alert("Prosze podac imie i/lub nazwisko");
	return;
  }
  if(!test_email(_form.Email.value)) return;
  var wnd = window.open('','','toolbar=0, scrollbars=1, resizable=1, width=300, height=180');
  wnd.name = '_redirect';
  wnd.document.writeln("<b>Prosz&#281; czeka&#263;.<br>Wysy&#322;anie w toku...</b>");
  wnd.document.close();
  _form.submit();
};

function onm(txt) {
  if(!txt || (txt=="")) self.status=applname;
  else self.status=txt;
  return true;
};

function popimg() {
	var imgbig = document.getElementById('popimgobj');
	imgbig.style.display = 'inline';
};
function hideimg() {
	var imgbig = document.getElementById('popimgobj');
	imgbig.style.display = 'none';
};


