// JavaScript Document
function pozycje(){
	var UA, OPERApos, MSIEpos, Name, Version, wys;
	var wysokosci=new Array;
	var szerokosci=new Array;
	wys = 708;
	szer = 776;
	UA = window.navigator.userAgent;
	OPERApos = UA.indexOf("Opera");
	MSIEpos = UA.indexOf("MSIE");
	if (OPERApos >= 0) {
		Name = "Opera";
	} else if (MSIEpos >= 0) {
		Name = "mie";
	} else {
		Name = UA.substring(0, UA.indexOf("/"));
	}
	if (Name == 'NN4') { 
		wysokosci[wysokosci.length]=document.layers["zawartosc"].document.height; 
		wysokosci[wysokosci.length]=screen.height;
		szerokosci[szerokosci.length]=document.layers["backround"].document.width;
	} 
	if (Name == 'mie') { 
		wysokosci[wysokosci.length]= zawartosc.scrollHeight;
		wysokosci[wysokosci.length]=screen.height;
		szerokosci[szerokosci.length]=document.body.offsetWidth;
	}
	if (Name == 'Opera') { 
		wysokosci[wysokosci.length]=document.all["zawartosc"].scrollHeight;
		wysokosci[wysokosci.length]= zawartosc.scrollHeight;
		wysokosci[wysokosci.length]=screen.height;
		szerokosci[szerokosci.length]=document.all["backround"].scrollWidth;
		szerokosci[szerokosci.length]=backround.scrollWidth;
		szerokosci[szerokosci.length]=document.body.clientWidth;
	}
	if (Name == 'Mozilla') {
		wysokosci[wysokosci.length]=document.documentElement.scrollHeight;
		wysokosci[wysokosci.length]=screen.height;
		szerokosci[szerokosci.length]=document.documentElement.scrollWidth;
	}
	/*wybieranie najwiekszej wartosci*/
	for(i=0; i<wysokosci.length; i++){
		if(wys<wysokosci[i]){
			wys=wysokosci[i];
		}
	}
	for(i=0; i<szerokosci.length; i++){
		if(szer<szerokosci[i]){
			szer=szerokosci[i];
		}
	}
	if(Name == 'NN4'){
		document.getElementById("tresc_stronki").style.height = wys+"px";
		document.getElementById("linia_prawa").style.height = wys+120+"px";
		document.getElementById("linia_lewa").style.height = wys-460+"px";
		document.getElementById("tlo").style.height = wys+120+"px";
		document.getElementById("zawartosc").style.height = wys+90+"px";
		document.getElementById("stopka").style.top = wys+293+"px";
		document.getElementById("stopka").style.width = szer+"px";
		document.getElementById("stopka").style.left = "-"+(szer-776)/2+"px";
		document.getElementById("backround").style.height = wys+83+"px";
		document.getElementById("backround").style.width = szer+"px";
		document.getElementById("tlo_menu_stopki").style.left = ((szer-776)/2)+204+"px";
	}
	if(Name == 'mie'){
		document.getElementById("tresc_stronki").style.height = wys+"px";
		document.getElementById("linia_prawa").style.height = wys+120+"px";
		document.getElementById("linia_lewa").style.height = wys-506+"px";
		document.getElementById("tlo").style.height = wys+120+"px";
		document.getElementById("zawartosc").style.height = wys+88+"px";
		document.getElementById("stopka").style.top = wys+83+"px";
		document.getElementById("stopka").style.width = szer+"px";
		document.getElementById("stopka").style.left = "-"+(szer-776)/2+"px";
		document.getElementById("backround").style.height = wys+83+"px";
		document.getElementById("backround").style.width = szer+"px";
		document.getElementById("tlo_menu_stopki").style.left = ((szer-776)/2)+204+"px";
	}
	if(Name == 'Opera'){
		document.getElementById("tresc_stronki").style.height = wys+"px";
		document.getElementById("linia_prawa").style.height = wys+120+"px";
		document.getElementById("linia_lewa").style.height = wys-508+"px";
		document.getElementById("tlo").style.height = wys+120+"px";
		document.getElementById("zawartosc").style.height = wys+85+"px";
		document.getElementById("stopka").style.top = wys+90+"px";
		document.getElementById("stopka").style.width = szer+"px";
		document.getElementById("stopka").style.left = "-"+(szer-776)/2+"px";
		document.getElementById("backround").style.height = wys+90+"px";
		document.getElementById("backround").style.width = szer+"px";
		document.getElementById("tlo_menu_stopki").style.left = ((szer-776)/2)+204+"px";
	}
	if(Name == 'Mozilla'){
		document.getElementById("tresc_stronki").style.height = wys-230+"px";
		document.getElementById("linia_prawa").style.height = wys-130+"px";
		document.getElementById("linia_lewa").style.height = wys-730+"px";
		document.getElementById("tlo").style.height = wys-100+"px";
		document.getElementById("zawartosc").style.height = wys-133+"px";
		document.getElementById("stopka").style.top = wys-138+"px";
		document.getElementById("stopka").style.width = szer+"px";
		document.getElementById("stopka").style.left = "-"+(szer-776)/2+"px";
		document.getElementById("backround").style.height = wys-138+"px";
		document.getElementById("backround").style.width = szer+"px";
		document.getElementById("tlo_menu_stopki").style.left = ((szer-776)/2)+204+"px";
	}
}
function pozycje_og(){
	var UA, OPERApos, MSIEpos, Name, Version, wys;
	var wysokosci=new Array;
	var szerokosci=new Array;
	wys = 580;
	szer = 776;
	UA = window.navigator.userAgent;
	OPERApos = UA.indexOf("Opera");
	MSIEpos = UA.indexOf("MSIE");
	if (OPERApos >= 0) {
		Name = "Opera";
	} else if (MSIEpos >= 0) {
		Name = "mie";
	} else {
		Name = UA.substring(0, UA.indexOf("/"));
	}
	if (Name == 'NN4') { 
		wysokosci[wysokosci.length]=document.layers["zawartosc"].document.height; 
		wysokosci[wysokosci.length]=screen.height;
		szerokosci[szerokosci.length]=document.layers["backround"].document.width;
	} 
	if (Name == 'mie') { 
		wysokosci[wysokosci.length]= zawartosc.scrollHeight;
		wysokosci[wysokosci.length]=screen.height;
		szerokosci[szerokosci.length]=document.body.offsetWidth;
	}
	if (Name == 'Opera') { 
		wysokosci[wysokosci.length]=document.all["zawartosc"].scrollHeight;
		wysokosci[wysokosci.length]= zawartosc.scrollHeight;
		wysokosci[wysokosci.length]=screen.height;
		szerokosci[szerokosci.length]=document.all["backround"].scrollWidth;
		szerokosci[szerokosci.length]=backround.scrollWidth;
		szerokosci[szerokosci.length]=document.body.clientWidth;
	}
	if (Name == 'Mozilla') {
		wysokosci[wysokosci.length]=document.documentElement.scrollHeight;
		wysokosci[wysokosci.length]=screen.height;
		szerokosci[szerokosci.length]=document.documentElement.scrollWidth;
		szerokosci[szerokosci.length]=document.body.clientWidth;
	}
	/*wybieranie najwiekszej wartosci*/
	for(i=0; i<wysokosci.length; i++){
		if(wys<wysokosci[i]){
			wys=wysokosci[i];
		}
	}
	for(i=0; i<szerokosci.length; i++){
		if(szer<szerokosci[i]){
			szer=szerokosci[i];
		}
	}
	if(Name == 'NN4'){
		document.getElementById("tresc_stronki").style.height = wys+"px";
		document.getElementById("linia_prawa").style.height = wys+120+"px";
		document.getElementById("linia_lewa_og").style.height = wys-480+"px";
		document.getElementById("tlo").style.height = wys+120+"px";
		document.getElementById("zawartosc").style.height = wys+90+"px";
		document.getElementById("stopka").style.top = wys+293+"px";
		document.getElementById("stopka").style.width = szer+"px";
		document.getElementById("stopka").style.left = "-"+(szer-776)/2+"px";
		document.getElementById("backround").style.height = wys+83+"px";
		document.getElementById("backround").style.width = szer+"px";
		document.getElementById("tlo_menu_stopki").style.left = ((szer-776)/2)+204+"px";
	}
	if(Name == 'mie'){
		document.getElementById("tresc_stronki").style.height = wys+"px";
		document.getElementById("linia_prawa").style.height = wys+120+"px";
		document.getElementById("linia_lewa_og").style.height = wys-226+"px";
		document.getElementById("tlo").style.height = wys+120+"px";
		document.getElementById("zawartosc").style.height = wys+88+"px";
		document.getElementById("stopka").style.top = wys+83+"px";
		document.getElementById("stopka").style.width = szer+"px";
		document.getElementById("stopka").style.left = "-"+(szer-776)/2+"px";
		document.getElementById("backround").style.height = wys+83+"px";
		document.getElementById("backround").style.width = szer+"px";
		document.getElementById("tlo_menu_stopki").style.left = ((szer-776)/2)+204+"px";
	}
	if(Name == 'Opera'){
		document.getElementById("tresc_stronki").style.height = wys+"px";
		document.getElementById("linia_prawa").style.height = wys+150+"px";
		document.getElementById("linia_lewa_og").style.height = wys-180+"px";
		document.getElementById("tlo").style.height = wys+120+"px";
		document.getElementById("zawartosc").style.height = wys+85+"px";
		document.getElementById("stopka").style.top = wys+150+"px";
		document.getElementById("stopka").style.width = szer+"px";
		document.getElementById("stopka").style.left = "-"+(szer-776)/2+"px";
		document.getElementById("backround").style.height = wys+150+"px";
		document.getElementById("backround").style.width = szer+"px";
		document.getElementById("tlo_menu_stopki").style.left = ((szer-776)/2)+204+"px";
	}
	if(Name == 'Mozilla'){
		document.getElementById("tresc_stronki").style.height = wys-220+"px";
		document.getElementById("linia_prawa").style.height = wys-100+"px";
		document.getElementById("linia_lewa_og").style.height = wys-446+"px";
		document.getElementById("tlo").style.height = wys-100+"px";
		document.getElementById("zawartosc").style.height = wys-133+"px";
		document.getElementById("stopka").style.top = wys-138+"px";
		document.getElementById("stopka").style.left = "-"+(szer-776)/2+"px";
		document.getElementById("backround").style.height = wys-138+"px";
		if (szer == 1024) {
		document.getElementById("stopka").style.width = szer-8+"px";
		document.getElementById("backround").style.width = szer-16+"px";
		} else {
		document.getElementById("stopka").style.width = szer+"px";
		document.getElementById("backround").style.width = szer+"px";
		}
		document.getElementById("tlo_menu_stopki").style.left = ((szer-776)/2)+204+"px";
	}
}
function wyczysc_form(warstwa1, warstwa2, warstwa3, warstwa4, warstwa5) {
	document.getElementById(warstwa1).value = "";
	document.getElementById(warstwa2).value = "";
	document.getElementById(warstwa3).value = "";
	document.getElementById(warstwa4).value = "";
	document.getElementById(warstwa5).value = "";
	return false;
}
function wyczysc_form_rej(warstwa1, warstwa2, warstwa3, warstwa4, warstwa5, warstwa6, warstwa7, warstwa8, warstwa9, warstwa10) {
	document.getElementById(warstwa1).value = "";
	document.getElementById(warstwa2).value = "";
	document.getElementById(warstwa3).value = "";
	document.getElementById(warstwa4).value = "";
	document.getElementById(warstwa5).value = "";
	document.getElementById(warstwa6).value = "";
	document.getElementById(warstwa7).value = "";
	document.getElementById(warstwa8).value = "";
	document.getElementById(warstwa9).value = "";
	document.getElementById(warstwa10).value = "";
	//document.getElementById(warstwa11).value = "";
	//document.getElementById(warstwa12).value = "";
	//document.getElementById(warstwa13).value = "";
	return false;
}
function wyczysc_polec(warstwa1, warstwa2, warstwa3, warstwa4) {
	document.getElementById(warstwa1).value = "Witaj, polecam Ci stronę polonit.pl.";
	document.getElementById(warstwa2).value = "";
	document.getElementById(warstwa3).value = "";
	document.getElementById(warstwa4).value = "";
	return false;
}
function wyczysc_log(warstwa1) {
	document.getElementById(warstwa1).value = "";
	//document.getElementById(warstwa2).value = "";
	return false;
}
function drukuj() {
	var content = document.getElementById("tresc_stronki").innerHTML;
	with (open ('', 'druk', 'menubar=no, toolbar=no, location=no, scrollbars=yes, resizable=no, status=no, width=542, height=450, left=100, top=50')) {
		document.write('<html><head><META HTTP-EQUIV="imagetoolbar" CONTENT="no"><title>Wersja do druku</title><link href="print.css" rel="stylesheet" type="text/css" /></head><body><center><a href="" onclick="window.close()">zamknij to okienko</a></center><br /><br />'+content+'<br /><br /><center><a href="" onclick="window.close()">zamknij to okienko</a></center></body></html>');
		window.print();
		document.close();
	 } 
}
//formularze i pola numerowane od 0
//pole tablica z id pola
//nazwa tablica z nazwa pola dowolny tekst
//formid numer formularza na stronie
function valide(pole, nazwa, formid) {
	formularz = document.forms[formid];
	dlugosc = formularz.elements.length;
	for(i=0; i<dlugosc; i++) {
		for (j=0; j<pole.length; j++) {
			if(i == pole[j]) {
				wartosc = formularz.elements[i].value;
				if( isNaN(wartosc) || wartosc == '') {
					alert('W pole '+nazwa[j]+' prosimy wpisywaa tylko liczby, bez znaków.');
					return false;
				}
			}
		}
	}
	formularz.submit();
}
