{{foreach from=$galleries item=v kye=k name=n}}
	
	{{getCollectionByCategory CollectionID=81 ColumnID=5 Value=$v.Collection_80_ID OrderColumn=6 var=Gphotos}}
	$('#gallery-{{$v.Collection_80_ID}}').click(function(){
		
		{{assign var=gimg value=''}}
		{{assign var=galbum value=''}}
		{{assign var=gtitles value=''}}
		{{assign var=gdesc value=''}}
		
		{{assign var=quottmp value="&ac"|concat:"ute;"}}
		
		{{foreach from=$Gphotos item=vv key=kk name=nn}}
				{{if $smarty.foreach.nn.index gt 0}}
						{{assign var=gimg value=$gimg|concat:','}}
						{{assign var=galbum value=$galbum|concat:','}}
						{{assign var=gtitles value=$gtitles|concat:','}}
						{{assign var=gdesc value=$gdesc|concat:','}}
				{{/if}}
				
				{{assign var=theValue value=$vv.Collection_81_2|replace:"'":$quottmp}}{{assign var=gimg value=$gimg|concat:"'"|concat:$theValue|concat:"'"}}
				{{assign var=theValue value=$v.Collection_80_1|replace:"'":$quottmp}}{{assign var=galbum value=$galbum|concat:"'"|concat:$theValue|concat:"'"}}
				{{assign var=theValue value=$vv.Collection_81_1|replace:"'":$quottmp}}{{assign var=gtitles value=$gtitles|concat:"'"|concat:$theValue|concat:"'"}}
				{{assign var=theValue value=$vv.Collection_81_4|replace:"'":$quottmp}}{{assign var=gdesc value=$gdesc|concat:"'"|concat:$theValue|concat:"'"}}
		
		{{/foreach}}
	
        gallery_{{$v.Collection_80_ID}}_images = [{{$gimg}}]
        gallery_{{$v.Collection_80_ID}}_album = [{{$galbum}}];
        gallery_{{$v.Collection_80_ID}}_titles = [{{$gtitles}}];
        gallery_{{$v.Collection_80_ID}}_desc = [{{$gdesc}}];
        $.prettyPhoto.open(gallery_{{$v.Collection_80_ID}}_images,gallery_{{$v.Collection_80_ID}}_album,gallery_{{$v.Collection_80_ID}}_titles,gallery_{{$v.Collection_80_ID}}_desc);
        return false;
      });
{{/foreach}}