window.PrdListBlkD4_init_ = function (jsvMsgXmlID, Parent0, ColN, RowN, W, H, Gap, Amt, Buy) { var jPrdList = $('#meMsg_'+jsvMsgXmlID+' #PrdListBlk_'+Parent0); jPrdList.find('.PrdCell').css('width', W); jPrdList.find('.PrdCell').css('height', H); var GapAy = Gap.split(','), GapI = 0; var n = parseInt(jPrdList.attr('n')), col=1, row=1, jAmt='', text=''; jPrdList.find('.PrdCell').each(function(i){ if (row>RowN || $(this).css('display')=='none') $(this).hide(); else { if (Buy!='') $(this).find('.PrdBtn').html(''); if (col==1) $(this).addClass('liLeft'); else if (col==ColN) $(this).addClass('liRight'); else $(this).addClass('liCenter'); if (col < ColN && GapAy[GapI]!='0' && GapAy[GapI]!='') $(this).css('margin-right', GapAy[GapI]+'px'); if (row < RowN && GapAy[0]!='0' && GapAy[0]!='') $(this).css('margin-bottom', GapAy[0]+'px'); GapI++; if (GapI>=GapAy.length) GapI = 0; col++; if (col>ColN) { col = 1; GapI = 0; row++; } jAmt = $(this).find('.PrdPrice'); text = Amt.replace('%price%', jAmt.html()); jAmt.html(text); text = jAmt.text(); text = $(this).find('.PrdTitle').text()+' '+text; $(this).attr('title', text); ns_applyTemplate_(this.getAttribute('xi'), 'PrdCell_'+this.getAttribute('cn')+'_'+this.getAttribute('xi'), 'msgPrdListBlk'); } }); }