// JavaScript created by www.webszok.net
function popup_no_scrolls_print(url, name, width, height) {
	var x = (screen.availWidth - width)/0;
	var y = (screen.availHeight - height)/0;
	win = window.open(url, name, 'width='+width+',height='+height+',left='+x+',top='+y+',toolbar=0,menubar=0,scrollbars=1,resizable=0');
	win.focus();
}
function popup_no_scrolls(url, name, width, height) {
	var x = (screen.availWidth - width)/2;
	var y = (screen.availHeight - height)/2;
	win = window.open(url, name, 'width='+width+',height='+height+',left='+x+',top='+y+',toolbar=0,menubar=0,scrollbars=0,resizable=0');
	win.focus();
}
function popup_scrolls(url, name, width, height) {
	var x = (screen.availWidth - width)/2;
	var y = (screen.availHeight - height)/2;
	win = window.open(url, name, 'width='+width+',height='+height+',left='+x+',top='+y+',toolbar=0,menubar=0,scrollbars=1,resizable=0');	win.focus();
}function openf(file,width,height,typ,prze,lang) {
	widthjava=width+40;
	heightjava=height+70;
	win = window.open('obf.php?file='+file+'&typ='+typ+'&lang='+lang, 'new', 'width='+widthjava+',height='+heightjava+',left=20,top=40,toolbar=0,menubar=0,scrollbars='+prze+',resizable=1,dependent=yes,alwaysRaised=yes');
	win.focus();
}function openfh(file) {
	width=500;	height=500;	widthjava=width+40;
	heightjava=height+70;
	win = window.open('obf.php?file='+file+'&typ=1', 'contentfoto', 'width='+widthjava+',height='+heightjava+',left=20,top=40,toolbar=0,menubar=0,scrollbars=0,resizable=1,dependent=yes,alwaysRaised=yes');
	win.focus();
}function openhh(file) {
	width=800;	height=600;	widthjava=width+40;
	heightjava=height+70;
	win = window.open(file, 'contenthtml', 'width='+widthjava+',height='+heightjava+',left=20,top=40,toolbar=1,menubar=0,scrollbars=1,resizable=1,dependent=yes,alwaysRaised=yes');
	win.focus();
}function openfg(file,width,height,typ,prze,res,lang,desc) {
	widthjava=width+40;
	heightjava=height+100;
	var win=window.open('obfg.php?file='+file+'&typ='+typ+'&desc='+desc+'&lang='+lang, 'gallery', 'width='+widthjava+',height='+heightjava+',left=20,top=40,toolbar=0,menubar=0,scrollbars='+prze+',resizable='+res+',dependent=yes,alwaysRaised=yes');
	win.focus();
}function ulubione(url, name) {
	if (window.sidebar && window.sidebar.addPanel) {		// window.sidebar.addPanel(name,url,'');			} else if (window.external || window.external.addFavorite) {		window.external.addFavorite(url,name);	}}function szukaj() {		var sz = document.forms["search"].elements["word"].value;	if(sz.length < 4){
		alert('Szukany text musi zawierać conajmniej 4 znaki.');	return false;	
	} else if (sz == 'szukaj...' || sz == 'suche...' || sz == 'search...'){
		alert('Wpisz szukaną frazę.');
	return false;	}
	else{
		document.search.submit();	return true;
	}}// newsletter
function dodaj(){
var elem = document.getElementById('newsletter');	if ( validate() ){		with(elem) {
			location='?id=slist&activ=add&newsletteremail='+(newsletteremail.value)+'&lang='+(newsletterlang.value)+'';
		}		}
}


function usun(){
var elem = document.getElementById('newsletter');
	if ( validate() ){
		with(elem) {			location='?id=slist&activ=del&newsletteremail='+(newsletteremail.value)+'&lang='+(newsletterlang.value)+'';
		}		}
}


function validate(){
	var rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-zA-Z]{2,4}$");
	var errors = "";
	if (document.getElementById("newsletteremail").value == "" || !rx.test(document.getElementById("newsletteremail").value)) {
		errors += "Nie wypełniono pola e-mail lub podano nieprawidłowy adres e-mail\n\n";
	}
	if (errors == "") {
		return true;
	} else {
		alert("Błąd: "+errors);
		return false;
	}
}

