`*[foxpro]
Lparameters sss_pict_rules,sss_id_pict,sss_id_html,sss_align,sss_gener_ssil
*RETURN ""

Local ssss_align

If Pcount()=4

	If sss_align=.T.
		ssss_align='CENTER'
	Else
		ssss_align='LEFT'
	Endif

Else
	ssss_align='LEFT'
Endif

*If kolpara

*,sss_sl
*sst_image=a_picture_gen(1,a_ppn_table_news.pict_rules,a_ppn_table_news.id_pict,"")
	Local nn_select_n

	nn_select_n=Select()


	Local ppkk,zz_sst,zzt_dop
	ppkk=nacal_dire+"\maple4_ru_projects\"+Alltrim(vp_tek_folder)+"\a_ppn_table_picture"
	Select * From (ppkk) Where id_=sss_id_pict Into Cursor zz_pictures
	If Reccount()=0
		Use
		Return ""
	Endif


	ppkk=nacal_dire+"\a_rules_picture"
	Select * From (ppkk) Where Alltrim(name_)=sss_pict_rules Into Cursor zz_rules
	If Reccount()=0
		Use
		Return ""
	Endif

	zzt_dop=""
	zz_sst=""

	If Not(Empty(Alltr(zz_pictures.pict1namef)))
		zzt_dop=""
		If zz_rules.t1_vmax=.T.
			If zz_rules.t1_vmaxwh=1
				If zz_pictures.width_>zz_rules.t1_vmaxsz
					zzt_dop="width="+Alltr(Str(zz_rules.t1_vmaxsz))
				Else
					zzt_dop="height="+Alltr(Str(zz_pictures.height_))+"  "+"width="+Alltr(Str(zz_pictures.width_))
				Endif
			Else
				If zz_pictures.height_>zz_rules.t1_vmaxsz
					zzt_dop="height="+Alltr(Str(zz_rules.t1_vmaxsz))
				Else
					zzt_dop="height="+Alltr(Str(zz_pictures.height_))+"  "+"width="+Alltr(Str(zz_pictures.width_))
				Endif
			Endif
		Else
			zzt_dop="height="+Alltr(Str(zz_pictures.height_))+"  "+"width="+Alltr(Str(zz_pictures.width_))
		Endif


		If sss_gener_ssil=.f.
			dd_sst_href='<A HREF="'+www_+"i_news_page_"+padl(sss_id_html,15,"0")+'.html" target=_blank'+'>'
			dd_sst_href_='</A>'
		Else
			dd_sst_href='<A HREF="'+Alltr(zz_pictures.pict1namef)+'" target=_blank'+'>'
			dd_sst_href_='</A>'
		Endif



		zz_sst=zz_sst+dd_sst_href+'<IMG '+zzt_dop+'  src="'+Alltr(zz_pictures.pict1namef)+'" align='+ssss_align+' border=0>'+dd_sst_href_+'<BR>'

		Select a_ppn_file_picture
		Seek zz_pictures.pict1namef
		If Not Found()
			Append Blank
			Replace name_ With Alltr(zz_pictures.pict1namef)
			Replace file_ With zz_pictures.pict1
		Endif
	Endif

	If nn_select_n<>0
		Select (nn_select_n)
	Endif

	Return zz_sst
`