<% 
'id_zbozi
'darek
'darek_typ
'ajax


	'dárek ke zboží
	Set rs2 = CreateObject("ADODB.RecordSet")
	strSQL = "SELECT nazev_zbozi2, popis1, zbozi.odkaz AS odkaz, zbozi_kat.odkaz_strom AS odkaz_kat, foto_pocet, id_zbozi FROM zbozi, s_zbozi, zbozi_kat WHERE zbozi.id_zbozi IN (" & darek & ") AND s_zbozi.id_s_zbozi = zbozi.id_s_zbozi AND zbozi.id_zbozi_kat = zbozi_kat.id_zbozi_kat"
	rs2.Open strSQL, conn, 1, 1
	if not rs2.eof then
 %>		<TABLE CELLSPACING="12" CELLPADDING="0" ID="darek">
		<TR><TD COLSPAN="2"><SPAN CLASS="nadpis-darek"><% if darek_typ = 0 or darek_typ = 3 then %>Dárky pro Vás k tomuto zboží<% else %>Vyberte si dárek k tomuto zboží<% end if %></SPAN></TD></TR>
<% 
		do while not rs2.eof
			s = s + 1
 %>		<TR>
		<TD VALIGN="top">
		<% if darek_typ = 1 then %>
			<INPUT<% if ajax = true then %> ONCLICK="kosik_darky(this.form.name); if(document.location.pathname.substring(document.location.pathname.lastIndexOf('/')+1) == 'kosik-obj5.asp')document.location.reload()"<% end if %> STYLE="vertical-align: middle; height: auto" TYPE="radio" NAME="darek<%= id_zbozi %>" VALUE="<%= rs2("id_zbozi") %>"<% if (instr(session("kosik_darky" & id_zbozi),"_" & rs2("id_zbozi")) & "," > 0 and ajax = true) or (ajax = false and s = 1) then %> CHECKED<% end if %>>
		<% elseif darek_typ = 2 then %>
			<INPUT<% if ajax = true then %> ONCLICK="kosik_darky(this.form.name); if(document.location.pathname.substring(document.location.pathname.lastIndexOf('/')+1) == 'kosik-obj5.asp')document.location.reload()"<% end if %> STYLE="vertical-align: middle; height: auto" TYPE="checkbox" NAME="darek<%= id_zbozi %>" VALUE="<%= rs2("id_zbozi") %>"<% if (instr(session("kosik_darky" & id_zbozi),"_" & rs2("id_zbozi")) & "," > 0 and ajax = true) then %> CHECKED<% end if %>>
		<% elseif darek_typ = 0 or darek_typ = 3 then %>
			<% 	darky = darky & rs2("id_zbozi") & "," %>
		<% end if %>
		<% if darek_typ = 3 then %>
			<B><%= rs2("nazev_zbozi2") %></B>
			<% if rs2("popis1") <> "" then %><BR><%= left(rs2("popis1"),100) %><% if len(rs2("popis1")) > 100 then %> ...<% end if %><% end if %>
		<% else %>
			<B><A TITLE="<%= rs2("nazev_zbozi2") %>" HREF="<%= session("cesta_web") %><%= rs2("odkaz_kat") %><%= rs2("odkaz") %>.htm" TARGET="_blank"><%= rs2("nazev_zbozi2") %></A></B>
			<% if rs2("popis1") <> "" then %><BR><%= left(rs2("popis1"),100) %><% if len(rs2("popis1")) > 100 then %> ...<% end if %><% end if %>
		<% end if %>
		</TD>
		</TR>
<% 
			rs2.movenext
		loop
		if darky <> "" then
			darky = left(darky,len(darky) - 1)
		end if
 %>		</TABLE>
 		<% if darek_typ = 0 or darek_typ = 3 then %>
			<INPUT TYPE="hidden" NAME="darek<%= id_zbozi %>" VALUE="<%= darky %>">
		<% end if %>
		<BR>
		<DIV ID="kosik-data-darky"></DIV>
<% 
	end if
	rs2.close
 %>