function czyscNewsletter(AInput) {
	if (AInput.value == 'wpisz adres e-mail') {
		AInput.value = '';
		}
    return true;
}

function czyscPole(AInput, tresc) {
	AInput.value = '';
    return true;
}

function popup(url, width, height) {
		width1=width/2;
		height1=height/2;
		x=screen.availWidth/2-width1;
		y=screen.availHeight/2-height1;
        var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes, menubar=no, left='+x+', top='+y );
};



function okienko(url, width, height) {
		width1=width/2;
		height1=height/2;
		x=screen.availWidth/2-width1;
		y=screen.availHeight/2-height1;
        var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes, menubar=no, left='+x+', top='+y );
		Win.resizeTo(width, height);
		Win.focus();
};

function okienko_s(url, width, height) {
		width1=width/2;
		height1=height/2;
		x=screen.availWidth/2-width1;
		y=screen.availHeight/2-height1;
        var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=no, menubar=no, left='+x+', top='+y );
		Win.resizeTo(width, height);
		Win.focus();
};

function przelacz(id) {
	ukryj_wszystkie();
	var myHeader = document.getElementById('n' + id);
	var myContent = document.getElementById('t' + id);
	var myLink = document.getElementById('l' + id);
	myHeader.style.display = 'block';
	myContent.style.display = 'block';
	myLink.style.color = '#124197';
	return false;
}

function ukryj_wszystkie() {
	for (i = 1; i <= 18; i++) {
		var cl_header = document.getElementById('n' + i);
		var cl_content = document.getElementById('t' + i);
		var cl_myLink = document.getElementById('l' + i);
		cl_header.style.display = 'none';
		cl_content.style.display = 'none';
		cl_myLink.style.color = '#458FD3';
		}
	return 0;
}

function przelaczA(id) {
	ukryj_wszystkieA();
	var myHeader = document.getElementById('n' + id);
	var myContent = document.getElementById('t' + id);
	var myLink = document.getElementById('l' + id);
	var myImg = document.getElementById('i' + id);
	myHeader.style.display = 'block';
	myContent.style.display = 'block';
	myLink.style.color = '#267D00';
	myImg.style.display = 'block';
	return false;
}

function ukryj_wszystkieA() {
	for (i = 1; i <= 24; i++) {
		var cl_header = document.getElementById('n' + i);
		var cl_content = document.getElementById('t' + i);
		var cl_myLink = document.getElementById('l' + i);
		var cl_myImg = document.getElementById('i' + i);
		cl_header.style.display = 'none';
		cl_content.style.display = 'none';
		cl_myLink.style.color = '#63AE42';
		cl_myImg.style.display = 'none';
		}
	return 0;
}

function przelaczZ(id) {
	ukryj_wszystkieZ();
	var myContent = document.getElementById('t' + id);
	var myLink = document.getElementById('l' + id);
	myContent.style.display = 'block';
	myLink.style.color = '#267D00';
	return false;
}

function ukryj_wszystkieZ() {
	for (i = 1; i <= 5; i++) {
		var cl_content = document.getElementById('t' + i);
		var cl_myLink = document.getElementById('l' + i);
		cl_content.style.display = 'none';
		cl_myLink.style.color = '#63AE42';
		}
	return 0;
}

function druk(szerokosc, wysokosc, obrazekDoDruku) {
	var w = szerokosc;
	var h = wysokosc;
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	var sciezka = 'druk.php?obrazek=' + obrazekDoDruku;
	//alert(sciezka);
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=yes, resizable=yes'
	win = window.open(sciezka,'druk', winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function show(szerokosc, wysokosc, obrazekDoDruku) {
	var w = szerokosc;
	var h = wysokosc;
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	var sciezka = 'show.php?obrazek=' + obrazekDoDruku;
	//alert(sciezka);
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=yes, resizable=yes'
	win = window.open(sciezka,'druk', winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function random_popup() {
		//var myRandomNumber = get_random();
		var myRandomNumber = 2;
		var url = "popup_" + myRandomNumber + ".php";
				
		width = 0;
		height = 0;
		
		if (myRandomNumber == 1) {
			width = 450;
			height = 450;
			}
		else if (myRandomNumber == 2) {
				width = 800;
				height = 700;
				}
		
		width1 = width / 2;
		height1 = height / 2;
		x = screen.availWidth / 2 - width1;
		y = screen.availHeight / 2 - height1;
		
        var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=no, menubar=no, left='+x+', top='+y );
        
		Win.resizeTo(width, height);
		Win.focus();
		
		return false;
		}

function get_random() {
    var ranNum = Math.round(Math.random() * 2);
    if (ranNum)
    	return ranNum;
    else return 1;
}

function przekieruj_1() {
	window.opener.location.href='index_mam3latka.php?id=czYxbWs4MGJwMTg0Nw%3D%3D';
	window.close();
}

function przekieruj_2() {
	window.opener.location.href='index_danonki.php?id=czYybWs4MWJwMTg3Ng%3D%3D';
	window.close();
}