var nn4=(document.layers)?true:false
var ie4=(document.all)?true:false

function nic() {
	return false
}
document.oncontextmenu=nic


p2="konto@spamer.pl"
function pomoc_adres() {
	p1='gra24h'
	p3='.pl'
	document.location='mailto:'+p1+p2.substring(5,6)+p1+p3
}

function format_liczba(liczba) {
	return Math.floor(liczba)+','+Math.round((liczba-Math.floor(liczba))*10)
}

function TableSelector(hl) {
  if (hl) {
    this.hl = hl;
  } else {
    this.hl = "#00EEEE";
  }
  this.selected_item = null;
  this.moveIn = TableSelectorMoveIn;
  this.moveOut = TableSelectorMoveOut;
  this.hlbg = null;
}

function TableSelectorMoveIn(item){
  this.hlbg = item.style.backgroundColor;
  item.style.backgroundColor = this.hl;
}

function TableSelectorMoveOut(item){
  item.style.backgroundColor = this.hlbg;
}

function spr_liczba(obiekt){
	if (isNaN(obiekt.value) || obiekt.value<0 || Math.floor(obiekt.value)!=obiekt.value){
		obiekt.value=''
	} else {
		obiekt.value=Math.floor(obiekt.value)
	}
}
	
function nowyRandom(zakres) {
   var los=Math.round(Math.random()*10*zakres)+zakres
   return Math.round(((los-zakres)*zakres)/los)
} //losuje od 0 do zakres

function marquee(myText){
    textlen=myText.length;         
	newText=myText.substring(2,textlen)+myText.substring(0,2);        
	window.status=newText;         
	setTimeout("marquee('"+newText+"')",300);         
}

function zamien(wartosc) {
  var pom=""
  pom=pom+wartosc
  if (isNaN(pom))
   {
     var z=pom.indexOf(",")
	 if (z!=-1) {pom=pom.substring(0,z)+"."+pom.substring(z+1,pom.length)}
   }
  if (!isNaN(pom)) {pom=Math.round(pom*100)/100}
  return pom
}

function usun(tekst) {
  var pom=tekst.indexOf("'",0)
  while (pom!=-1){
    {tekst=tekst.substring(0,pom-1)+'`'+tekst.substring(pom+1,tekst.length)}
    pom=tekst.indexOf("'",pom)  
  }
  return tekst  
}

function show(ident) { 
    if(nn4) { 
        document.layers[ident].visibility = "show";
    } else if(ie4) { 
        document.all[ident].style.visibility = "visible";
    }
}
function hide(ident) { 
    if(nn4) { 
        document.layers[ident].visibility = "hide";
    } else if(ie4) { 
        document.all[ident].style.visibility = "hidden";
    }
}

function setstart(obj,adres) { 
	obj.style.behavior='url(#default#homepage)'
	obj.setHomePage(adres)
}

function addbm() { 
	window.external.AddFavorite(document.location, document.title)
}

// ------------ obrazki -----------------
	function ImageArray(n) {
		this.length = n
		for (var i = 0; i<=n; i++) {
			this[i] = new Image()
		}
		return this
	}
	
	function mOver(obiekt,num) { 
		if ((over[num].src != "") ) {
			obiekt.src = over[num].src;
		}
	}

	function mOut(obiekt,num) {
		if ((off[num].src != "")) {
	  	obiekt.src = off[num].src;
		}
	}

	function przycisk(obiekt,plik) { 
		obiekt.src = plik;
	}
	
// ------------ koniec obrazki -----------------

function dataSlownie(data) {
  var pomoc=""
	dzien=data.getDay()
	if (data.getDay()==0) {dzien="Niedziela"}
	if (data.getDay()==1) {dzien="Poniedziałek"}
	if (data.getDay()==2) {dzien="Wtorek"}
	if (data.getDay()==3) {dzien="Środa"}
	if (data.getDay()==4) {dzien="Czwartek"}
	if (data.getDay()==5) {dzien="Piątek"}					
	if (data.getDay()==6) {dzien="Sobota"}

	if (data.getMonth()==0) {miesiac="stycznia"}
	if (data.getMonth()==1) {miesiac="lutego"}
	if (data.getMonth()==2) {miesiac="marca"}
	if (data.getMonth()==3) {miesiac="kwietnia"}
	if (data.getMonth()==4) {miesiac="maja"}
	if (data.getMonth()==5) {miesiac="czerwca"}
	if (data.getMonth()==6) {miesiac="lipca"}
	if (data.getMonth()==7) {miesiac="sierpnia"}
	if (data.getMonth()==8) {miesiac="września"}
	if (data.getMonth()==9) {miesiac="października"}
	if (data.getMonth()==10) {miesiac="listopada"}
	if (data.getMonth()==11) {miesiac="grudnia"}

	if (data.getYear()<1900) {rok=data.getYear()+1900} 
	else {rok=data.getYear()}

	pomoc=dzien+"<BR>"+data.getDate()+" "+miesiac+" "+rok+"r."
	
	return pomoc
}

function okno_katalog(korzen,pole) {
	plik='katalog.php?korzen='+korzen+'&pole='+pole
	noweOkienko=null
	ustawienia=
	"left=0,"
	+"top=0,"
	+"screenX=0,"
	+"screenY=0,"
	+"width=420,"
//	+"height="+h+","
	+"innerWidth=420,"
//	+"innerHeight="+h+","
	+"toolbar=no,"
	+"location=no,"
	+"directories=no,"
	+"status=no,"
	+"menubar=no,"
	+"scrollbars=yes,"
	+"resizable=no"
	noweOkienko=window.open(plik,"katalog",ustawienia)
	noweOkienko.focus()
}

function okno_tresc(tresc) {
	noweOkienko=null
	ustawienia=
	"left=0,"
	+"top=0,"
	+"screenX=0,"
	+"screenY=0,"
	+"width=550,"
//	+"height="+h+","
	+"innerWidth=550,"
//	+"innerHeight="+h+","
	+"toolbar=no,"
	+"location=no,"
	+"directories=no,"
	+"status=no,"
	+"menubar=no,"
	+"scrollbars=yes,"
	+"resizable=no"
	noweOkienko=window.open("","tresc",ustawienia)
	noweOkienko.document.open()
	noweOkienko.document.clear()
	noweOkienko.document.write(
	'<HTML><HEAD>\n'
	+'<TITLE>Podgląd treści</TITLE>\n'
	+'<LINK HREF="../style.css" REL="stylesheet">\n'
	+'</HEAD>\n'
	+'<BODY>\n'
	+'<TABLE WIDTH="500" ALIGN="center" VALIGN="top"><TR><TD>\n'
	+'<DIV ALIGN="justify">\n'
	+tresc			
	+'</DIV>\n'
	+'</TD></TR></TABLE>\n'
	+'</BODY>\n'
	+"</HTML>\n"
	)
	noweOkienko.document.close()
	noweOkienko.focus()
}

function okno_banner(src,url,w,h) {
	noweOkienko=null
	if (window.screeen) {
		aw=screen.availWidth
		ah=screen.availHeight
	} else {
		aw=640
		ah=450
	}	
	
	ustawienia=
	"left="+(aw-w)/2+","
	+"top="+(ah-h)/2+","
	+"screenX="+(aw-w)/2+","
	+"screenY="+(ah-h)/2+","
	+"width="+w+","
	+"height="+h+","
	+"innerWidth="+w+","
	+"innerHeight="+h+","
	+"toolbar=no,"
	+"location=no,"
	+"directories=no,"
	+"status=no,"
	+"menubar=no,"
	+"scrollbars=no,"
	+"resizable=no"
	noweOkienko=window.open("",("obrazek_"+w+"_"+h),ustawienia)
	noweOkienko.document.open()
	noweOkienko.document.clear()
	noweOkienko.document.write(
	"<HTML><HEAD>\n"
	+"<TITLE>Proszę czekać na obrazek. . . . . . . . . . . . . . . . .  . . . . . . .</TITLE>\n"
	+"<STYLE>\n"
	+"body{\n"
	+"margin-left : 0px; \n"
	+"margin-top : 0px; \n"
	+"margin-bottom : 0px; \n"
	+"margin-right : 0px; \n"
	+"} \n"
	+"</STYLE>\n"
	+"</HEAD>\n"
	+"<BODY onclick='window.open(\""+url+"\")' BGCOLOR=#007236 STYLE=\"cursor: hand;\">\n"
	+'<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="100%" HEIGHT="100%"><TR><TD ALIGN="center" VALIGN="middle">\n'
	+'<IMG SRC="'+src+'" WIDTH="'+w+'" HEIGHT="'+h+'" BORDER="0" ALT="">\n'
	+'</TD></TR></TABLE>\n'
	+"</BODY>\n"
	+"</HTML>\n"
	)
	noweOkienko.document.close()
	noweOkienko.focus()
}

	function okno_pop(url,wysokosc){
	okno=null
	if (window.screeen) {
		aw=screen.availWidth
		ah=screen.availHeight
	} else {
		aw=400
		ah=wysokosc
	}
		ustawienia=
		"left="+(aw-400)/2+","
		+"top="+(ah-wysokosc)/2+","
		+"screenX="+(aw-400)/2+","
		+"screenY="+(ah-wysokosc)/2+","
		+"width="+400+","
		+"height="+wysokosc+","
		+"innerWidth="+400+","
		+"innerHeight="+wysokosc+","
		+"toolbar=no,"
		+"location=no,"
		+"directories=no,"
		+"status=no,"
		+"menubar=no,"
		+"scrollbars=no,"
		+"resizable=no"
		okno=window.open(url,"noweokno",ustawienia)		
		okno.focus()
}

	function okno_wiedza(url,wysokosc){
	okno=null
	if (window.screeen) {
		aw=screen.availWidth
		ah=screen.availHeight
	} else {
		aw=600
		ah=wysokosc
	}
		ustawienia=
		"left="+(aw-600)/2+","
		+"top="+(ah-wysokosc)/2+","
		+"screenX="+(aw-600)/2+","
		+"screenY="+(ah-wysokosc)/2+","
		+"width="+600+","
		+"height="+wysokosc+","
		+"innerWidth="+600+","
		+"innerHeight="+wysokosc+","
		+"toolbar=no,"
		+"location=no,"
		+"directories=no,"
		+"status=no,"
		+"menubar=no,"
		+"scrollbars=no,"
		+"resizable=no"
		okno=window.open(url,"noweokno",ustawienia)		
		okno.focus()
}

function tekstWyczysc(input) {
	if ( input.value == input.defaultValue ) {
		input.value = "";
	}
}

function tekstPowrot(input) {
	if ( input.value == "" ) {
		input.value = input.defaultValue;
	}
}

function opis(idkonto) {
	w=500
	h=500
	if (window.screeen) {
		aw=screeen.availWidth
		ah=screeen.availHeight
	} else {
		aw=640
		ah=450
	}
	noweOkienko=null
		ustawienia=
		"left="+(aw-w)/2+","
		+"top="+(ah-h)/2+","
		+"screenX="+(aw-w)/2+","
		+"screenY="+(ah-h)/2+","
		+"width="+w+","
		+"height="+h+","
		+"innerWidth="+w+","
		+"innerHeight="+h+","
		+"toolbar=no,"
		+"location=no,"
		+"directories=no,"
		+"status=no,"
		+"menubar=no,"
		+"scrollbars=yes,"
		+"resizable=no"
		noweOkienko=window.open("profil_lista_opis.php?idkonto="+idkonto,("obrazek_"+w+"_"+h),ustawienia)
		noweOkienko.focus()
}	

	function sprawdz_subskrybcja(obiekt,typ) {
		var blad=false
		var tekst=""
		obiekt.typ.value=typ
	 if (obiekt.e_mail.value=="" || obiekt.e_mail.value.indexOf("@",1)==-1 || obiekt.e_mail.value.indexOf(".",1)==-1 || obiekt.e_mail.value.indexOf("Podaj",0)!=-1) {
	   blad=true
		 tekst=tekst+ " błędny e-mail\n"		 
	 }    
	 if (blad) {
	   window.alert("Nie można wysłać subskrybcji ze wzgledu na błędną daną\nWykryte błędy:\n"+tekst)
	 }
	 if (!blad) {
		obiekt.submit()
	}   
	}

	function sprawdz_logowanie(obiekt) {
		var blad=false
		var tekst=""
	 if (obiekt.id.value=="" || isNaN(obiekt.id.value) || obiekt.id.value<=0 || obiekt.id.value!=Math.round(obiekt.id.value)) {
	   blad=true
		 tekst=tekst+ " błędny numer ID ( numer ID to nie nazwa !!! )\n"		 
	 }    
	 if (obiekt.haslo.value=="" || obiekt.haslo.value=="Podaj swoje hasło") {
	   blad=true
		 tekst=tekst+ " błędne hasło ID\n"		 
	 }    
	 if (blad) {
	   window.alert("Nie można zalogować się ze wzgledu na błędną daną\nWykryte błędy:\n"+tekst)
	 }
	 if (!blad) {
		obiekt.submit()
	}   
	}
	
	function sprawdz_powiadomienie(obiekt) {
		var blad=false
		var tekst=""		
	 if (obiekt.e_mail.value=="" || obiekt.e_mail.value.indexOf("@",1)==-1 || obiekt.e_mail.value.indexOf(".",1)==-1 || obiekt.e_mail.value.indexOf("Podaj",0)!=-1) {
	   blad=true
		 tekst=tekst+ " błędny twój e-mail\n"		 
	 }    
	 if (obiekt.e_mail_znajomy.value=="" || obiekt.e_mail_znajomy.value.indexOf("@",1)==-1 || obiekt.e_mail_znajomy.value.indexOf(".",1)==-1 || obiekt.e_mail_znajomy.value.indexOf("Podaj",0)!=-1) {
	   blad=true
		 tekst=tekst+ " błędny e-mail znajomego\n"		 
	 }    
	 
	 if (blad) {
	   window.alert("Nie można wysłać powiadomienia ze wzgledu na błędną daną\nWykryte błędy:\n"+tekst)
	 }
	 if (!blad) {
		obiekt.submit()
	}   
	}

function osoba_pub(obrazek,dostepna,idsytuacja,imie,data_urodzania,wyksztalcenie,hobby,data_start) {
document.write('<TABLE>')
document.write('<TR>')
document.write('	<TD VALIGN="top">')
document.write('	<TABLE WIDTH="130" HEIGHT="160" BORDER="0" CELLSPACING="0" CELLPADDING="0" BACKGROUND="foto/'+obrazek+'">')
document.write('	<TR>')
document.write('		<TD BACKGROUND="img/t_lewa_gora.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
document.write('		<TD BACKGROUND="img/t_gora.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
document.write('		<TD BACKGROUND="img/t_prawa_gora.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
document.write('	</TR>')
document.write('	<TR>')
document.write('		<TD BACKGROUND="img/t_lewa.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
if (dostepna) {
	document.write('		<TD><A HREF="sytuacja.php?idsytuacja_start='+idsytuacja+'"><IMG SRC="img/nic.gif" WIDTH="90" HEIGHT="120" BORDER="0" ALT=""></A></TD>')
} else {
	document.write('	<TD><IMG SRC="img/nic.gif" WIDTH="90" HEIGHT="120" BORDER="0" ALT=""></TD>')
}
document.write('		<TD BACKGROUND="img/t_prawa.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
document.write('	</TR>')
document.write('	<TR>')
document.write('		<TD BACKGROUND="img/t_lewa_dol.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
document.write('		<TD BACKGROUND="img/t_dol.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
document.write('		<TD BACKGROUND="img/t_prawa_dol.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
document.write('	</TR>')
document.write('	</TABLE>')
document.write('</TD>')
document.write('<TD VALIGN="top">')
document.write('	<TABLE WIDTH="300" BORDER="0" CELLSPACING="0" CELLPADDING="0" BGCOLOR="#FFFFFF">')
document.write('	<TR>')
document.write('		<TD BACKGROUND="img/t_lewa_gora.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
document.write('		<TD BACKGROUND="img/t_gora.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
document.write('		<TD BACKGROUND="img/t_prawa_gora.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
document.write('	</TR>')
document.write('	<TR>')
document.write('		<TD BACKGROUND="img/t_lewa.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
document.write('		<TD WIDTH="260" VALIGN="top" STYLE="color: #000000;">')
document.write('		<DIV><B>'+imie+'</B></DIV>')
document.write('		<DIV>Data urodzenia: <I>'+data_urodzania+'</I></DIV>')
document.write('		<DIV>Wykształcenie: <I>'+wyksztalcenie+'</I></DIV>')
document.write('		<DIV>Hobby: <I>'+hobby+'</I></DIV>')
document.write('		</TD>')
document.write('		<TD BACKGROUND="img/t_prawa.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
document.write('	</TR>')
document.write('	<TR>')
document.write('		<TD BACKGROUND="img/t_lewa_dol.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
document.write('		<TD BACKGROUND="img/t_dol.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
document.write('		<TD BACKGROUND="img/t_prawa_dol.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
document.write('	</TR>')
document.write('	</TABLE>')
if (dostepna) {
	document.write('		<A HREF="sytuacja.php?idsytuacja_start='+idsytuacja+'">Podejdź do osoby >></A>')
} else {
	document.write('		Osoba dostępna od '+data_start)
}
document.write('	<BR><BR>')
document.write('	</TD>')
document.write('</TR>')
document.write('</TABLE>')
}

function a_prawa(idzalogowany,nazwa,kredyt,ilosc,e_mail) {
	document.write('</TD>')
	document.write('<TD WIDTH="100" HEIGHT="100%" ALIGN="center" VALIGN="top" STYLE="border: 2px solid #F4B756; background-color: Gray;">')
	
	document.write('<DIV STYLE="text-align: center; font-size: 14px; color: Black; font-weight: bolder; width: 100px; height: 60px; background-image: url(img/logo.gif); vertical-align: middle;">')
	document.write('<FONT COLOR="#DD00DD">ONA</FONT> <SPAN CLASS="small">i</SPAN> <FONT COLOR="#0000DD">ON</FONT>')
	document.write('<BR>Spotkania<BR>on-line')
	document.write('</DIV>')
	if (idzalogowany!=0) {
		document.write('	<TABLE WIDTH="100%" HEIGHT="20" BORDER="0">')
		document.write('	<TR><TD ALIGN="center" STYLE="border: 0px solid #FF0000; background-color: #555555;"><DIV STYLE="color: #00000;"><B>'+nazwa+'</B></DIV></TD></TR>')
		document.write('	<TR><TD ALIGN="center" STYLE="border: 0px solid #FF0000; background-color: #FFFFFF;"><DIV STYLE="color: #000000;"><B>Stan kredytów</B><BR><SPAN ID="kredyt_stan">'+kredyt+'</SPAN> $<br><a href="budynek_kantor.php" style="font-size: 10px; color: #4169E1;">dodaj kredyty >></a></DIV></TD></TR>')
		document.write('	</TABLE>')
		document.write('	<FORM NAME="menu">')
		document.write('	<INPUT TYPE="button" VALUE="Dzielnica" CLASS="button" STYLE="width=95 px;" onClick="document.location=\'dzielnica.php\'"><BR>')
		document.write('	<INPUT TYPE="button" VALUE="Schowek" CLASS="button" STYLE="width=95 px;" onClick="document.location=\'schowek.php\'"><BR>')
		document.write('	<INPUT TYPE="button" VALUE="Wiedza" CLASS="button" STYLE="width=95 px;" onClick="document.location=\'wiedza.php\'"><BR>')
		document.write('	<INPUT TYPE="button" VALUE="Kontakty" CLASS="button" STYLE="width=95 px;" onClick="document.location=\'kontakty.php\'"><BR>')
		document.write('	<INPUT TYPE="button" VALUE="Wyloguj" CLASS="button" STYLE="width=95 px;" onClick="document.location=\'logowanie_skrypt.php?komenda=wyloguj\'"><BR>')
		document.write('	<INPUT TYPE="button" VALUE="Regulamin" CLASS="button" STYLE="width=95 px;" onClick="document.location=\'regulamin.php\'">')
		document.write('	</FORM>')
	} else {
		document.write('	<FORM ACTION="" NAME="menu" ID="menu">')
		document.write('	<INPUT TYPE="button" VALUE="Dzielnica" CLASS="button" STYLE="width=95 px;" onClick="document.location=\'dzielnica.php\'"><BR>')
		document.write('	<INPUT TYPE="button" VALUE="Nowe konto" CLASS="button" STYLE="width=95 px;" onClick="document.location=\'konto_edycja.php?komenda=dodaj\'"><BR>')
		document.write('	<INPUT TYPE="button" VALUE="Logowanie" CLASS="button" STYLE="width=95 px;" onClick="document.location=\'logowanie.php\'"><BR>')
		document.write('	<INPUT TYPE="button" VALUE="Regulamin" CLASS="button" STYLE="width=95 px;" onClick="document.location=\'regulamin.php\'">')
		document.write('	</FORM>')
	}
//	document.write('<HR>Aktualna ilość zarejestrowanych graczy: <B>'+ilosc+'</B>')
	document.write('<HR><TABLE WIDTH="100%" BORDER="0">')
	document.write('	<TR>')
	document.write('		<FORM ACTION="logowanie_skrypt.php" METHOD="post">')
	document.write('		<A NAME="logowanie"></A>')
	document.write('		<TD ALIGN="center">')
	document.write('		<DIV><B>LOGOWANIE</B></DIV>')
	document.write('		<DIV ALIGN="center" CLASS="small">Wejście do gry</DIV>')
	document.write('		<INPUT TYPE="hidden" NAME="komenda" VALUE="zaloguj">')
	document.write('		<INPUT TYPE="text" NAME="id" VALUE="Podaj numer ID" STYLE="font-size: 10px; font-family: Arial; width: 95px; color: #000000; border: 1px solid #000000;" onFocus="tekstWyczysc(this)" onBlur="tekstPowrot(this)"><BR>')
	document.write('		<INPUT TYPE="password" NAME="haslo" VALUE="Podaj swoje hasło" STYLE="font-size: 10px; font-family: Arial; width: 95px; color: #000000; border: 1px solid #000000;" onFocus="tekstWyczysc(this)" onBlur="tekstPowrot(this)"><BR>')
	document.write('		<IMG SRC="img/nic.gif" WIDTH="10" HEIGHT="5" ALT="" BORDER="0"><BR>')
	document.write('		<INPUT TYPE="button" VALUE="Loguj" CLASS="button" STYLE="width: 50px; height: 20px;" onClick="sprawdz_logowanie(this.form)">')
	document.write('		<DIV ALIGN="left">')
	document.write('		<A HREF="konto_edycja.php?komenda=dodaj" Class="small">&lt;&lt; nowe konto</A><BR>')
	document.write('		<A HREF="logowanie.php#przypominacz" Class="small">&lt;&lt; zapomniałem ID</A><BR>')
	document.write('		</DIV>')
	document.write('		</TD>')
	document.write('		</FORM>')
	document.write('	</TR>')
	document.write('</TABLE>')
	document.write('<HR>')
	document.write('<A HREF="http://www.gry-www.pl" TARGET="_top"><IMG SRC="http://www.gry-www.pl/logoGra24h_small.gif" ALT="Gra24h - gry online" WIDTH="69" HEIGHT="20" BORDER="0" TITLE="Gra24h - gry online"></A>')
	document.write('<HR>')
	document.write('<SMALL>')
	document.write('TopLista gier on-line')
	document.write('<a href="http://graonline.toplista.pl/?we=gra2"><img src="img/button.gif" width="100" height="33" border="0" alt="Gry on-line. Najlepsze gry w Internecie"></a><BR>')
	document.write('</SMALL>')
	document.write('	<HR>')
	document.write('	<TABLE WIDTH="100%" BORDER="0"><TR><TD ALIGN="center">')
	document.write('		<DIV><B>KONTAKT</B></DIV>')
	document.write('		<DIV CLASS="small"><A HREF="javascript:pomoc_adres()">gra24h<span class="szary">[at]</span>gra24h.pl</A></DIV>')
	document.write('		<DIV CLASS="small">Prosimy wysyłać do nas wszystkie pytania, opinie i uwagi na temat gry</DIV>')
	document.write('	</TD></TR></TABLE>')
	document.write('	</TD>')
	document.write('</TR>')
	document.write('</TABLE>')
}

function rysuj_akcja(data_min,data_max) {
	for (i=0;i<t1.length;i++) {
		document.write('<B>'+nazwa1[i+1]+'</B><BR>')
		document.write('<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="0">')
		document.write('<TR ALIGN="center" VALIGN="bottom">')
		for (j=0;j<t1[i].length;j++) {
			document.write('<TD><IMG SRC="img/nic.gif" WIDTH="3" STYLE="background-color: #0000FF;" HEIGHT="'+t1[i][j]+'" BORDER="0"></TD>')
		}
		document.write('</TR>')
		document.write('<TR>')
		document.write('<TD COLSPAN="'+t1[0].length/2+'" ALIGN="left"><SMALL>'+data_min+'<</SMALL></TD>')
		document.write('<TD COLSPAN="'+t1[0].length/2+'" ALIGN="right"><SMALL>>'+data_max+'</SMALL></TD>')
		document.write('</TR>')
		document.write('</TABLE>')
		document.write('<BR><BR>')
	}
}

function przedmiot_sklep(przedmiot_rodzaj,idprzedmiot_rodzaj,cena,obrazek) {
	document.write('<TABLE><TR>')
	document.write('	<TD VALIGN="top">')
	document.write('	<TABLE WIDTH="130" HEIGHT="160" BORDER="0" CELLSPACING="0" CELLPADDING="0" BACKGROUND="foto/'+obrazek+'">')
	document.write('	<TR>')
	document.write('		<TD BACKGROUND="img/t_lewa_gora.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD BACKGROUND="img/t_gora.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD BACKGROUND="img/t_prawa_gora.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('	</TR>')
	document.write('	<TR>')
	document.write('		<TD BACKGROUND="img/t_lewa.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD><IMG SRC="img/nic.gif" WIDTH="90" HEIGHT="120" BORDER="0" ALT=""></TD>')
	document.write('		<TD BACKGROUND="img/t_prawa.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('	</TR>')
	document.write('	<TR>')
	document.write('		<TD BACKGROUND="img/t_lewa_dol.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD BACKGROUND="img/t_dol.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD BACKGROUND="img/t_prawa_dol.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('	</TR>')
	document.write('	</TABLE>')
	document.write('</TD>')
	document.write('<TD VALIGN="top">')
	document.write('	<TABLE WIDTH="300" BORDER="0" CELLSPACING="0" CELLPADDING="0" BGCOLOR="#FFFFFF">')
	document.write('	<TR>')
	document.write('		<TD BACKGROUND="img/t_lewa_gora.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD BACKGROUND="img/t_gora.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD BACKGROUND="img/t_prawa_gora.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('	</TR>')
	document.write('	<TR>')
	document.write('		<TD BACKGROUND="img/t_lewa.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD WIDTH="260" VALIGN="top" STYLE="color: #000000;">')
	document.write('		<DIV><B>'+przedmiot_rodzaj+'</B></DIV>')
	wyswietlone=false;
	if (towar_promocja==idprzedmiot_rodzaj) {
		wyswietlone=true;
		cena_nowa=cena*0.8;
		document.write('<SPAN CLASS="alert"><B>PROMOCJA !!! TANIEJ !!!</B></SPAN>')
		document.write('<DIV>Cena: <I><B>'+format_liczba(cena_nowa)+' $</B></I> <SMALL>stara cena:<I>'+cena+' $</I></SMALL></DIV>')
	}
	if (towar_drozszy==idprzedmiot_rodzaj) {
		wyswietlone=true;
		cena_nowa=cena*1.2;			
		document.write('<SPAN CLASS="alert"><B>TOWAR NA WYCZERPANIU !!! DROŻEJ !!!</B></SPAN>')
		document.write('<DIV>Cena: <I><B>'+format_liczba(cena_nowa)+' $</B></I> <SMALL>stara cena:<I>'+cena+' $</I></SMALL></DIV>')
	}
	if (towar_niedostepny==idprzedmiot_rodzaj) {
		wyswietlone=true;
		document.write('<SPAN CLASS="alert"><B>TOWAR CHWILOWO NIEDOSTĘPNY !!! </B></SPAN>')
		document.write('<DIV>Chwilowo brak towaru w magazynie.<BR> Spróbuj innym razem.</DIV>')
	}
	if (!wyswietlone) {
		cena_nowa=cena;			
		document.write('<DIV>Cena: <I>'+format_liczba(cena_nowa)+' $</I></DIV>')
	}
	if (towar_niedostepny!=idprzedmiot_rodzaj) {		
		document.write('<FORM ACTION="schowek.php?" METHOD="post">')
		document.write('<INPUT TYPE="hidden" NAME="kod" VALUE="">')
		document.write('<INPUT TYPE="hidden" NAME="komenda" VALUE="dodaj_sklep">')
		document.write('<INPUT TYPE="hidden" NAME="idprzedmiot_rodzaj" VALUE="'+idprzedmiot_rodzaj+'">')
		if (cena_nowa<=kredyt) {
			document.write('<INPUT TYPE="button" VALUE=" Kupuj " CLASS="button" onClick="if (confirm(\'Czy na pewno chcesz kupić ?\')) {submit()}">')
		} else {
			document.write('Za mało kredytów do kupna')
		}
		document.write('</FORM>')
	}
	document.write('</TD>')
	document.write('<TD BACKGROUND="img/t_prawa.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('</TR>')
	document.write('<TR>')
	document.write('<TD BACKGROUND="img/t_lewa_dol.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('<TD BACKGROUND="img/t_dol.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('<TD BACKGROUND="img/t_prawa_dol.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('</TR></TABLE></TD></TR></TABLE>')
}

function przedmiot_gielda(przedmiot_rodzaj,cena,idgielda,ilosc,obrazek) {
	document.write('<TABLE><TR><TD VALIGN="top">')
	document.write('	<TABLE WIDTH="130" HEIGHT="160" BORDER="0" CELLSPACING="0" CELLPADDING="0" BACKGROUND="foto/'+obrazek+'">')
	document.write('	<TR>')
	document.write('		<TD BACKGROUND="img/t_lewa_gora.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD BACKGROUND="img/t_gora.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD BACKGROUND="img/t_prawa_gora.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('	</TR><TR>')
	document.write('		<TD BACKGROUND="img/t_lewa.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD><IMG SRC="img/nic.gif" WIDTH="90" HEIGHT="120" BORDER="0" ALT=""></TD>')
	document.write('		<TD BACKGROUND="img/t_prawa.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('	</TR><TR>')
	document.write('		<TD BACKGROUND="img/t_lewa_dol.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD BACKGROUND="img/t_dol.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD BACKGROUND="img/t_prawa_dol.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('	</TR></TABLE>')
	document.write('</TD><TD VALIGN="top">')
	document.write('	<TABLE WIDTH="300" BORDER="0" CELLSPACING="0" CELLPADDING="0" BGCOLOR="#FFFFFF">')
	document.write('	<TR>')
	document.write('		<TD BACKGROUND="img/t_lewa_gora.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD BACKGROUND="img/t_gora.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD BACKGROUND="img/t_prawa_gora.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('	</TR><TR>')
	document.write('		<TD BACKGROUND="img/t_lewa.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD WIDTH="260" VALIGN="top" STYLE="color: #000000;">')
	document.write('		<DIV><B>'+przedmiot_rodzaj+'</B></DIV>')
	document.write('		<DIV>Cena: <I>'+format_liczba(cena*1.1)+' $</I></DIV>')
	document.write('		<FORM ACTION="schowek.php?" METHOD="post">')
	document.write('		<INPUT TYPE="hidden" NAME="kod" VALUE="">')
	document.write('		<INPUT TYPE="hidden" NAME="komenda" VALUE="dodaj_gielda">')
	document.write('		<INPUT TYPE="hidden" NAME="idgielda" VALUE="'+idgielda+'">')
	if (cena*1.1<kredyt && kredyt>20) {
		document.write('<INPUT TYPE="button" VALUE=" Kupuj " CLASS="button" onClick="if (confirm(\'Czy na pewno chcesz kupić ?\')) {submit()}">')
	} else {
		document.write('Za mało kredytów do kupna')
	}
	document.write('		</FORM>')
	document.write('		</TD>')
	document.write('		<TD BACKGROUND="img/t_prawa.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('	</TR><TR>')
	document.write('		<TD BACKGROUND="img/t_lewa_dol.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD BACKGROUND="img/t_dol.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD BACKGROUND="img/t_prawa_dol.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('	</TR></TABLE>')
	if (ilosc-1>0) {
		document.write('Pozostała ilość przedmiotów tego rodzaju na giełdzie: '+(ilosc-1))
	}
	document.write('</TD></TR></TABLE>')
}

function przedmiot_schowek(przedmiot_rodzaj,ilosc,obrazek) {
	document.write('<TABLE>')
	document.write('<TR>')
	document.write('	<TD VALIGN="top">')
	document.write('	<TABLE WIDTH="130" HEIGHT="160" BORDER="0" CELLSPACING="0" CELLPADDING="0" BACKGROUND="foto/'+obrazek+'">')
	document.write('	<TR>')
	document.write('		<TD BACKGROUND="img/t_lewa_gora.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD BACKGROUND="img/t_gora.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD BACKGROUND="img/t_prawa_gora.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('	</TR><TR>')
	document.write('		<TD BACKGROUND="img/t_lewa.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD><IMG SRC="img/nic.gif" WIDTH="90" HEIGHT="120" BORDER="0" ALT=""></TD>')
	document.write('		<TD BACKGROUND="img/t_prawa.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('	</TR><TR>')
	document.write('		<TD BACKGROUND="img/t_lewa_dol.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD BACKGROUND="img/t_dol.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD BACKGROUND="img/t_prawa_dol.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('	</TR></TABLE>')
	document.write('</TD>')
	document.write('<TD VALIGN="top">')
	document.write('	<TABLE WIDTH="300" BORDER="0" CELLSPACING="0" CELLPADDING="0" BGCOLOR="#FFFFFF">')
	document.write('	<TR>')
	document.write('		<TD BACKGROUND="img/t_lewa_gora.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD BACKGROUND="img/t_gora.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD BACKGROUND="img/t_prawa_gora.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('	</TR><TR>')
	document.write('		<TD BACKGROUND="img/t_lewa.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD WIDTH="260" VALIGN="top" STYLE="color: #000000;">')
	document.write('		<DIV><B>'+przedmiot_rodzaj+'</B></DIV>')
	document.write('		<DIV>Ilość: <I>'+ilosc+'</I></DIV>')
	document.write('		</TD>')
	document.write('		<TD BACKGROUND="img/t_prawa.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('	</TR><TR>')
	document.write('		<TD BACKGROUND="img/t_lewa_dol.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD BACKGROUND="img/t_dol.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('		<TD BACKGROUND="img/t_prawa_dol.gif"><IMG SRC="img/nic.gif" WIDTH="20" HEIGHT="20"></TD>')
	document.write('	</TR>')
	document.write('	</TABLE></TD></TR>')
	document.write('</TABLE>')
}
