
function wstawSwf(fileName,w,h){
	document.write('<object classid="CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000" ');
	document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" ');
	document.write('width='+w+' height='+h+' type="application/x-shockwave-flash">');
	document.write('	<param name="MOVIE" value="'+fileName+'"/>');
	document.write('	<embed src="'+fileName+'" width='+w+' height='+h+' pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" ');
	document.write('type="application/x-shockwave-flash">');
	document.write('	</embed>');
	document.writeln('</object>');
}

function Keys(KEv, KMa)
{
	var key;
	if (window.Event) key = KEv.which;  else key = KEv.keyCode;
	//document.getElementById('test').innerHTML= key ;
	if (key == 0 || key == 8 || key == 13 ) return true;
	key = String.fromCharCode(key);
	if (KMa.indexOf(key) == -1) return false;
	//zmiana(this.value);
	else return true;
}



function checkForm(forma){
	forma.elements["nazwisko_xx"].style.backgroundColor="#fff";
	forma.elements["ulica_xx"].style.backgroundColor="#fff";
	forma.elements["kod_xx"].style.backgroundColor="#fff";
	forma.elements["miejscowosc_xx"].style.backgroundColor="#fff";
	//forma.elements["telefon_xx"].style.backgroundColor="#fff";
	forma.elements["email_xx"].style.backgroundColor="#fff";
	forma.elements["ilosc_xx"].style.backgroundColor="#fff";

	if(forma.elements["nazwisko_xx"].value.length<1){
		alert("Pole \"Imię Nazwisko\" jest wymagane. Proszę uzupełnić");
		forma.elements["nazwisko_xx"].style.backgroundColor="#fdd";
		return false;
	}
	if(forma.elements["ulica_xx"].value.length<1){
		alert("Pole \"Ulica\" jest wymagane. Proszę uzupełnić");
		forma.elements["ulica_xx"].style.backgroundColor="#fdd";
		return false;
	}
	if(forma.elements["kod_xx"].value.length<1){
		alert("Pole \"Kod pocztowy\" jest wymagane. Proszę uzupełnić");
		forma.elements["kod_xx"].style.backgroundColor="#fdd";
		return false;
	}
	if(forma.elements["miejscowosc_xx"].value.length<1){
		alert("Pole \"Miejscowść\" jest wymagane. Proszę uzupełnić");
		forma.elements["miejscowosc_xx"].style.backgroundColor="#fdd";
		return false;
	}
	/*if(forma.elements["telefon_xx"].value.length<1){
		alert("Pole \"numer telefonu\" jest wymagane. Proszę uzupełnić");
		forma.elements["telefon_xx"].style.backgroundColor="#fdd";
		return false;
	}*/
	if(forma.elements["email_xx"].value.length<1){
		alert("Pole \"adres e-mail\" jest wymagane. Proszę uzupełnić");
		forma.elements["email_xx"].style.backgroundColor="#fdd";
		return false;
	}
	if(forma.elements["ilosc_xx"].value<1){
		alert("Pole \"ilość\" jest wymagane. Proszę uzupełnić");
		forma.elements["ilosc_xx"].style.backgroundColor="#fdd";
		return false;
	}
	return true;
}

function zmiana(co){
	var linia;
	var jedensl=90;
	var jedenprz=6.0;
	var slowniki=0;
	var przesylka=0;
	var razem=0;
	var z;
	if(co>0){
		if( document.forms["ZAMOWIENIE"].elements["sposob_xx"][0].checked )	jedenprz=13.00;
		else	jedenprz=21.50;
		slowniki = jedensl*co;
		if(co>=1  && co<=3 )przesylka=jedenprz;
		if(co>=4  && co<=9 )przesylka=jedenprz*2;
		if(co>=10 && co<=19)przesylka=jedenprz*3;
		if(co>=20 && co<=49)przesylka=jedenprz*5;
		if(co>=50 && co<=99)przesylka=jedenprz*5;
		razem = przesylka + slowniki;
		linia="";
		linia+="Wartość zamówienia: <strong>"+slowniki+".00 zł</strong><br/>";
		linia+="Koszt wysyłki: <strong>";
		linia+=przesylka.toString();
		linia+=(przesylka.toString().indexOf('.')==-1)?".00":"0";
		linia+="zł</strong><br/>";
		linia+="Łączna kwota do zapłaty: <strong>";
		linia+=razem.toString();
		linia+=(razem.toString().indexOf('.')==-1)?".00":"0";
		linia+="zł</strong>";
	}else linia="";
	document.getElementById('cena').innerHTML= linia ;
	if(co<2)document.getElementById('egzemplarz').innerHTML= "egzemplarz" ;
	if(co>=2&&co<=4)document.getElementById('egzemplarz').innerHTML= "egzemplarze" ;
	if(co>=5)document.getElementById('egzemplarz').innerHTML= "egzemplarzy" ;
}












