An error occurred while processing the template.
The following has evaluated to null or missing:
==> url404  [in template "10154#10192#153411738" at line 57, column 32]

----
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----

----
FTL stack trace ("~" means nesting-related):
	- Failed at: ${url404}  [in template "10154#10192#153411738" at line 57, column 30]
----
1<#assign utilServ = (serviceLocator.findService("com.elan.crc.utilites.service.CRCRemoteServiceService"))! /> 
2<#assign oadURL = propsUtil.get('elan.oad.url') > 
3<#assign url = themeDisplay.getURLCurrent() > 
4<#assign qstringmap = httpUtil.getParameterMap(httpUtil.getQueryString(url))> 
5<#-- <#assign url404 = '/error/404.html'> --> 
6<#assign oadURL_TC = 'https://online1.elancard.com/oad/terms.controller' > 
7<#assign environment = url?replace('/index.*','','r')> 
8<#assign prcaURL = propsUtil.get('elan.prca.url')> 
9<#assign useprcaValue = "" > 
10<#assign applicationType = "saa" > 
11<#assign text_to_apply_source = "vanity url" > 
12<#if qstringmap["sms"]?has_content> 
13    <#assign sms = 1 > 
14    <#assign text_to_apply_source = "sms" > 
15</#if> 
16<#if qstringmap["qrCode"]?has_content> 
17    <#assign text_to_apply_source = "qr code" > 
18</#if> 
19 
20<#if qstringmap["ecid"]?has_content> 
21    <#assign ecidExt = qstringmap["ecid"]?first> 
22    <#assign ecidExt = htmlUtil.escape(ecidExt)> 
23    <#assign ecidExt = htmlUtil.escapeJS(ecidExt)> 
24    <#assign ecidExt = "&ecid=" + ecidExt> 
25    
26    <#assign campaignId = qstringmap["ecid"]?first > 
27    <#assign campaignId  = htmlUtil.escape(campaignId)> 
28    <#assign campaignId  = htmlUtil.escapeJS(campaignId)> 
29<#else> 
30    <#assign ecidExt=""> 
31    <#assign campaignId = "" > 
32</#if> 
33<#--  check bankercode validity  --> 
34<#if oadURL?contains("uat-")> 
35    <#assign oadURL_TC = 'https://uat-online1.elancard.com/oad/terms.controller' > 
36<#else> 
37    <#assign oadURL_TC = 'https://online1.elancard.com/oad/terms.controller' > 
38</#if> 
39<#if qstringmap["bankercode"]?has_content> 
40    <#assign bCode= qstringmap["bankercode"]?first> 
41    <#assign bCode= htmlUtil.escapeJS(bCode)> 
42    <#assign bCode= htmlUtil.escape(bCode)> 
43    <#assign isEmployee = false> 
44 
45    <#assign fiData= utilServ.makeCall('crcDDCBankerAssistedAppSql','0&'+bCode)> 
46    <#if fiData?first?has_content> 
47        <#assign fi = fiData?first> 
48        <#if ((fi.projectId == "12") || (fi.projectId == "13") || (fi.projectId == "14") || (fi.projectId == "15"))> 
49            <#assign subbu_special = fi.offerId> 
50        </#if> 
51        <#if fi.projectType == "emp"> 
52            <#assign isEmployee = true> 
53        </#if> 
54    <#else> 
55        <script> 
56            console.log("fiData missing"); 
57            location.href = '${url404}'; 
58        </script> 
59    </#if> 
60 
61    <#assign bData = utilServ.makeCall('crcDDCBankerAssistedAppDetailSql','0&'+bCode)> 
62    <#if !bData?first?has_content> 
63        <script> 
64            console.log("bData missing"); 
65            location.href = '${url404}'; 
66        </script> 
67    </#if> 
68    <#list bData as b>      
69        <#assign lc = b.locationcode > 
70        <#assign bName = b.branch > 
71        <#assign bPhone = b.businessphone > 
72        <#assign boeid = b.oeid?trim> 
73        <#assign fName = b.firstname?trim> 
74        <#assign lName = b.lastname?trim> 
75        <#assign rLC = b.reallocationcode > 
76        <#assign mappedLC = b.mappedLocationCode > 
77    </#list>  
78<#else> 
79    <script> 
80        console.log("MainProductBcode missing"); 
81        location.href = '${url404}'; 
82    </script> 
83</#if> 
84 
85<#if bCode?starts_with("amp") && (url?contains("11t1m"))> 
86    <#assign ameriprise = true> 
87<#else> 
88    <#assign ameriprise = false> 
89</#if> 
90<#if mappedLC?has_content && !ameriprise> 
91    <#assign lc = mappedLC > 
92</#if> 
93 
94           
95<#if lc?has_content> 
96    <#assign firstNameLength = fName?length > 
97    <#assign lastNameLength = lName?length > 
98    <#if firstNameLength + lastNameLength &gt; 19 > 
99        <#if lastNameLength &gt; 18 > 
100            <#assign bLName = lName?substring(0,18)> 
101        <#else> 
102            <#assign bLName = lName> 
103        </#if> 
104        <#assign maxFirstName = 19 - bLName?length > 
105        <#if firstNameLength &gt; maxFirstName > 
106            <#assign bFName = fName?substring(0,maxFirstName)> 
107        <#else> 
108            <#assign bFName = fName> 
109        </#if> 
110    <#else> 
111        <#assign bFName = fName> 
112        <#assign bLName = lName> 
113    </#if>  
114 
115    <#assign prefix = "00000" > 
116    <#assign lcWithPrefix = prefix + lc > 
117    <#assign withPrefixLength = lcWithPrefix?length > 
118    <#assign startHere = withPrefixLength - 5> 
119    <#assign lc = lcWithPrefix?substring(startHere)>   
120    <#assign clientProfileService = (serviceLocator.findService("com.elan.crc.user.service.CrcClientProfileLocalService"))! /> 
121    <#assign clientProfileList = clientProfileService.findByLocationCode(lc)> 
122    <#if (clientProfileList?first?has_content)> 
123        <#assign clientProfile = clientProfileList?first> 
124        <#assign partnerName = clientProfile.getMarketingNameLong()> 
125        <#assign pbu = clientProfile.getPbu()> 
126        <#assign subbu = clientProfile.getSUBBRANDBUNBR()>          
127        <#assign cdnCardArtUrl = (propsUtil.get('rackspace.cdn.cardart.url'))!>  
128        <#if (subbu_special?has_content)> 
129            <#assign fiCardsData = utilServ.makeCall('crcTier3GetPbuData','0&' + pbu + '&' + subbu_special)>  
130        <#else> 
131            <#assign fiCardsData = utilServ.makeCall('crcTier3GetPbuData','0&' + pbu + '&' + subbu)>  
132        </#if> 
133		 
134		<#assign fultonBankpbu = "0727491"> 
135		<#if pbu == fultonBankpbu> 
136			<style> 
137				#hideFultonInfo { 
138					display: none; 
139
140			</style> 
141		</#if> 
142 
143        <#-- Begin: filter cards by sourceCode and offerId and remove duplicated cards--> 
144        <#assign temp = []> 
145        <#assign consumerCards = []> 
146        <#assign businessCards = []>  
147        <#assign offerTypeList = []>  
148        <#assign consumerOfferTypes =['104', '101', '103', '108', '109', '115', '141', '147', '138', '154']> 
149        <#assign businessOfferTypes =['144', '128', '143', '121']>     
150        <#assign index = 0> 
151        <#list fiCardsData as fib> 
152            <#if (fib.offerType?has_content && !(offerTypeList?seq_contains(fib.offerType)))>   
153                <#assign offerTypeList = offerTypeList + [fib.offerType]> 
154                <#assign temp = temp + fiCardsData[index..index]>   
155                <#if consumerOfferTypes?seq_contains(fib.offerType)> 
156                    <#assign consumerCards = consumerCards + fiCardsData[index..index]> 
157                <#elseif (businessOfferTypes?seq_contains(fib.offerType))> 
158                    <#assign businessCards = businessCards + fiCardsData[index..index]> 
159                </#if>                 
160            </#if>  
161            <#assign index = index + 1>                
162        </#list>  
163 
164        <#assign fiCardsData = temp> 
165 
166        <#if (fiCardsData?size > 0)>   
167            <#if (subbu_special?has_content)> 
168                <#assign lc_used = fiCardsData?first.WebLocationCode>   
169            <#else> 
170                <#if ameriprise> 
171                    <#assign lc_used = mappedLC>  
172                <#else> 
173                    <#assign lc_used = lc>  
174                </#if> 
175            </#if>  
176        </#if>  
177 
178        <#assign offerId = ""> 
179        <#assign empOfferId = "">  
180        <#if consumerCards[0]?has_content> 
181            <#assign empOfferId = consumerCards[0].empofferId!""> 
182        </#if> 
183        <#assign marketingChannel = 'SAT2A'> 
184        <#if isEmployee> 
185				<#assign marketingChannel = 'EMPL'> 
186				<#assign offerId = empOfferId> 
187				<#assign consumerCardsEmployee = []> 
188				<#list consumerCards as card> 
189					<#if card.empofferId?has_content> 
190						<#assign consumerCardsEmployee = consumerCardsEmployee + [card]> 
191					</#if> 
192				</#list> 
193				<#assign consumerCards = consumerCardsEmployee /> 
194			</#if> 
195        
196        <#if (consumerCards?size > 0 || businessCards?size > 0)>  
197         
198            <div class="content-container content-container-main jn-consumer-content" id="product-display"> 
199                <#if ((consumerCards?size > 0) && (businessCards?size > 0) && (isEmployee == false))> 
200                    <nav class="jn-primary-nav two-tabs"> 
201                        <ul> 
202                            <li title="${partnerName!''} - Personal products"> 
203                                <a href="#" class="tab-nav active" id="consumerTab"><span>Personal</span></a> 
204                            </li> 
205                            <li title="${partnerName!''} - Business products"> 
206                                <a href="#" class="tab-nav" id="businessTab"><span>Business</span></a> 
207                            </li> 
208                        </ul> 
209                    </nav> 
210                <#else> 
211                    <#if (consumerCards?size > 0)> 
212                        <nav class="jn-primary-nav" title="${partnerName!''} - Personal products"> 
213                            <ul> 
214                                <li> 
215                                    <p class="tab-nav" id="consumerTab"><span>Personal</span></p> 
216                                </li> 
217                            </ul> 
218                        </nav> 
219                    </#if> 
220                    <#if (businessCards?size > 0 && (isEmployee == false))> 
221                        <nav class="jn-primary-nav" title="${partnerName!''} - Business products"> 
222                            <ul> 
223                                <li> 
224                                    <p class="tab-nav" id="businessTab"><span>Business</span></p> 
225                                </li> 
226                            </ul> 
227                        </nav> 
228                    </#if> 
229                </#if> 
230                <#if (consumerCards?size > 0)> 
231                    <div class="tab-more-wrapper"> 
232                        <div class="jn-consumer-content-wrapper jn-tab-content active transition-start" data-id="consumerTab" title="${partnerName!''} - Personal products"> 
233                            <#list consumerCards as fib> 
234							    <#assign useprcaValue = fib.useprca!"">  
235                                <#assign cardArtImage = cdnCardArtUrl + "/" + fib.filename + ".png" > 
236                                <#assign cardArtImageAlt = cdnCardArtUrl + "/"+fib.filename+".jpg">      
237                                <#assign hasBalanceTransferCalculator = false>    
238                                <#assign offerId = fib.saaofferId> 
239                                <#if isEmployee> 
240                                    <#assign offerId = fib.empofferId!""> 
241                                </#if> 
242 
243                                <#if ameriprise>                                
244                                    <#if (fib.offerType == "101")> 
245                                            <#assign productName = "premier-visa-signature"> 
246                                            <#assign product="Premier Visa Signature"> 
247                                            <#assign cardIndex = 0> 
248                                    <#elseif (fib.offerType == "103")> 
249                                            <#assign productName = "visa-signature"> 
250                                            <#assign product="Visa Signature"> 
251                                            <#assign cardIndex = 1> 
252                                    </#if> 
253                                    <#assign titleText = consumerTitle.getSiblings()[cardIndex].Title.getData()> 
254                                    <#assign titleText = titleText?replace('<[^>]+>','','r')> 
255                                <#else> 
256                                    <#switch fib.offerType> 
257                                        <#case "101"> 
258                                            <#assign productName = "consumer-edr2112"> 
259                                            <#assign product="Everyday Rewards+"> 
260                                            <#assign cardIndex = 0> 
261                                            <#break> 
262                                        <#case "108"> 
263                                            <#assign productName = "consumer-platinum2103"> 
264                                            <#assign product="Platinum"> 
265                                            <#assign cardIndex = 2> 
266                                            <#assign hasBalanceTransferCalculator = true>  
267                                            <#break> 
268                                        <#case "109"> 
269                                            <#assign productName = "consumer-platinum2103"> 
270                                            <#assign product="Platinum"> 
271                                            <#assign cardIndex = 2> 
272                                            <#assign hasBalanceTransferCalculator = true>  
273                                            <#break>                                            
274                                        <#case "115"> 
275                                            <#assign productName = "secured"> 
276                                            <#assign product="Secured"> 
277                                            <#assign cardIndex = 5> 
278                                            <#break> 
279                                        <#case "104"> 
280                                            <#assign productName = "max-cash"> 
281                                            <#assign product="Max Cash Preferred"> 
282                                            <#assign cardIndex = 1> 
283                                            <#break> 
284                                        <#case "147"> 
285                                            <#assign productName = "max-cash-secured"> 
286                                            <#assign product="Max Cash Secured"> 
287                                            <#assign cardIndex = 4> 
288                                            <#break> 
289                                        <#case "141"> 
290                                            <#assign productName = "college-real-rewards"> 
291                                            <#assign product="College Real Rewards"> 
292                                            <#assign cardIndex = 3> 
293                                            <#break> 
294                                        <#case "138"> 
295                                            <#assign productName = "travel-rewards-plus"> 
296                                            <#assign product="Travel Rewards+"> 
297                                            <#assign cardIndex = 10> 
298                                            <#break> 
299                                        <#case "154"> 
300                                            <#assign productName = "reserve-rewards-plus"> 
301                                            <#assign product="Reserve Rewards+"> 
302                                            <#assign cardIndex = 11> 
303                                            <#break> 
304                                        <#default> 
305                                    </#switch> 
306 
307                                    <#assign newTag = ""> 
308                                    <#if (consumerTitle.getSiblings()[cardIndex].addNewTag?has_content && consumerTitle.getSiblings()[cardIndex].addNewTag.getData() == "true")> 
309                                        <#assign newTag = "with-new-tag"> 
310                                    </#if> 
311                                     
312                                    <#assign titleText = consumerTitle.getSiblings()[cardIndex].Title.getData()> 
313                                    <#assign titleText = titleText?replace('<[^>]+>','','r')> 
314                                     
315 
316                                    <#assign APR=""> 
317                                    <#assign AMF=""> 
318                                    <#assign BAL=""> 
319                                     
320 
321                                    <#assign scrapedData = utilServ.makeCall('crcDDCGetSchumerBox', offerId + '&'+ fib.sourceCode)> 
322                                    <#if (scrapedData?size > 0)> 
323                                        <#list scrapedData as sItem> 
324                                            <#if ((sItem.scrapedLabel?contains("Annual Percentage Rate (APR) for Purchases")) && (sItem.scrapedValue?has_content)) > 
325                                                <#assign APR = sItem.scrapedValue> 
326                                            <#elseif ((sItem.scrapedLabel?contains("Annual Membership Fee")) && (sItem.scrapedValue?has_content)) > 
327                                                <#assign AMF = sItem.scrapedValue> 
328                                            <#elseif ((sItem.scrapedLabel?contains("APR for Balance Transfers")) && (sItem.scrapedValue?has_content)) > 
329                                                <#assign BAL = sItem.scrapedValue> 
330                                            </#if> 
331                                            <#if (APR?has_content && AMF?has_content && BAL?has_content)> 
332                                                <#break> 
333                                            </#if> 
334                                        </#list> 
335                                    </#if> 
336                                </#if> 
337                                <#if ameriprise> 
338                                    <#assign rollover_text =  partnerName + " " + product + " " + " Card"> 
339                                <#else> 
340                                    <#assign rollover_text =  partnerName + " " + product + " " + " Credit Card"> 
341                                </#if>                             
342                                <div class="${newTag} jn-consumer-item item-${fib.offerType}" title="${rollover_text!''}"> 
343                                    <div class="tag-container"> 
344                                        <div class="tag-corner"> 
345                                            <div class="tag-label">NEW</div> 
346                                        </div> 
347                                    </div> 
348                                    <div class="consumer-card-heading hide-desktop"> 
349                                        <div class="consumer-card-heading__subheading">${consumerTitle.getSiblings()[cardIndex].Title.getData()}</div> 
350                                        ${consumerTitle.getSiblings()[cardIndex].headlineText.getData()} 
351                                    </div> 
352                                    <div class="jn-consumer-card-image"> 
353                                        <img src="${cardArtImage!''}" alt="${rollover_text!''}"  class="jn-img-responsive" onerror="this.onerror=null;this.src='${cardArtImageAlt!''}'"> 
354 
355                                        <#if (consumerTitle.getSiblings()[cardIndex].cardArtDescription?has_content) > 
356                                            <p class="jn-card-art-description">${consumerTitle.getSiblings()[cardIndex].cardArtDescription.getData()}</p> 
357                                        </#if> 
358                                        <#if (hasBalanceTransferCalculator)> 
359                                            <a style="display: block; text-align: center; max-width: 285px; margin: auto;" href="javascript:void(0);" data-micromodal-trigger="modal-2">See how much you could save with a balance transfer</a> 
360                                        </#if> 
361                                    </div> 
362 
363                                    <div class="jn-consumer-card-info"> 
364                                        <div class="consumer-card-heading hide-mobile"> 
365                                            <div class="consumer-card-heading__subheading">${consumerTitle.getSiblings()[cardIndex].Title.getData()}</div> 
366                                            ${consumerTitle.getSiblings()[cardIndex].headlineText.getData()} 
367                                        </div> 
368                                        <div class="jn-additional"> 
369                                            <ul class="${fib.offerType}"> 
370                                                <#if !ameriprise>                                            
371                                                    <#if (fib.offerType == "104")> 
372                                                        <li class="${fib.offerType}"> 
373                                                            <p> 
374                                                                <strong>APR for Purchases: </strong> 
375                                                                ${APR!''} 
376                                                                <a href="${oadURL_TC}?step=display&amp;offerId=${offerId}&amp;locationCode=${lc_used}" target="_blank"> 
377                                                                    <span class="screen-reader-only">${partnerName!''} ${product!''} Card </span>See terms &amp; conditions 
378                                                                </a> 
379                                                            </p>                                                             
380                                                        </li> 
381                                                        <li class="${fib.offerType}"> 
382                                                            <p> 
383                                                                <strong>Intro APR<sup>*</sup> for Balance Transfers: </strong> 
384                                                                ${BAL!''}  
385                                                                <a href="${oadURL_TC}?step=display&amp;offerId=${offerId}&amp;locationCode=${lc_used}" target="_blank"> 
386                                                                    <span class="screen-reader-only">${partnerName!''} ${product!''} Card </span>See terms &amp; conditions 
387                                                                </a> 
388                                                            </p> 
389                                                        </li> 
390                                                    <#else> 
391                                                        <li class="${fib.offerType}"> 
392                                                            <p> 
393                                                                <#if (fib.offerType == "147" || fib.offerType== "115" || fib.offerType== "138" || fib.offerType== "154")> 
394                                                                    <strong>APR for Purchases and Balance Transfers: </strong> 
395                                                                <#elseif (fib.offerType== "101")> 
396                                                                    <strong>INTRO APR<sup>*</sup> for Purchases and Balance Transfers: </strong> 
397                                                                <#else> 
398                                                                    <strong>Intro APR<sup>*</sup> for Purchases and Balance Transfers: </strong> 
399                                                                </#if> 
400 
401                                                                ${APR!''}  
402                                                                <a href="${oadURL_TC}?step=display&amp;offerId=${offerId}&amp;locationCode=${lc_used}" target="_blank"> 
403                                                                    <span class="screen-reader-only">${partnerName!''} ${product!''} Card </span>See terms &amp; conditions 
404                                                                </a> 
405                                                            </p> 
406                                                        </li> 
407                                                    </#if> 
408                                                </#if> 
409                                                <#if isEmployee && consumerTitle.getSiblings()[cardIndex].employeeAdditionalInfo.getData()?has_content> 
410                                                    <#if  consumerTitle.getSiblings()[cardIndex].employeeAdditionalInfo.getSiblings()?has_content> 
411                                                        <#list consumerTitle.getSiblings()[cardIndex].employeeAdditionalInfo.getSiblings() as marketingInfo> 
412                                                            <li>${marketingInfo.getData()}</li> 
413                                                        </#list> 
414                                                    </#if> 
415                                                <#elseif consumerTitle.getSiblings()[cardIndex].additionalInfo.getData()?has_content> 
416                                                    <#if consumerTitle.getSiblings()[cardIndex].additionalInfo.getSiblings()?has_content> 
417                                                        <#list consumerTitle.getSiblings()[cardIndex].additionalInfo.getSiblings() as marketingInfo> 
418                                                            <li>${marketingInfo.getData()}</li> 
419                                                        </#list> 
420                                                    </#if> 
421                                                </#if> 
422                                                <#if !ameriprise> 
423                                                    <li> 
424                                                        <p> 
425                                                            Annual Fee: ${AMF!''}  
426                                                            <a  href="${oadURL_TC}?step=display&amp;offerId=${offerId}&amp;locationCode=${lc_used}"  target="_blank"> 
427                                                                <span class="screen-reader-only">${partnerName!''} ${product!''} Card </span>See terms &amp; conditions 
428                                                            </a> 
429                                                        </p> 
430                                                    </li> 
431                                                </#if> 
432                                            </ul> 
433                                        </div> 
434                                        <ul class="actions"> 
435                                            <li> 
436											<#if (useprcaValue == "1")> 
437                                                <form action="${prcaURL}?locationCode=${lc_used}&amp;offerId=${offerId}&amp;preparerType=customer&amp;mktChl=${marketingChannel}&amp;applicationType=${applicationType}" method="post" class="BAAForm" id="BAAForm"> 
438                                                    <label for="appDataBAA-${offerId}" style="position:absolute; clip:rect(0 0 0 0);">Application Data</label> 
439                                                    <textarea rows="20" cols="100" name="applicationData" id="appDataBAA-${offerId}" class="appDataBAA" style="display:none;" title="application data"></textarea> 
440                                                    <a  
441                                                        class="applyNowLink apply-now-button"  
442                                                        href="${prcaURL}?locationCode=${lc_used}&amp;offerId=${offerId}&amp;preparerType=customer&amp;mktChl=${marketingChannel}&amp;applicationType=${applicationType}" 
443                                                        data-button-name="apply-now-link"  
444                                                        data-product-name="${productName}"                 
445
446                                                            ${consumerTitle.getSiblings()[cardIndex].applyNow.getData()}<span class="screen-reader-only"> for ${partnerName!''} ${product!''} Card </span> 
447                                                    </a> 
448                                                </form> 
449												<#else> 
450													<form action="${oadURL}?locationCode=${lc_used}&amp;offerId=${offerId}&amp;preparerType=customer&amp;mktChl=${marketingChannel}" method="post" class="BAAForm" id="BAAForm"> 
451                                                    <label for="appDataBAA-${offerId}" style="position:absolute; clip:rect(0 0 0 0);">Application Data</label> 
452                                                    <textarea rows="20" cols="100" name="applicationData" id="appDataBAA-${offerId}" class="appDataBAA" style="display:none;" title="application data"></textarea> 
453                                                    <a  
454                                                        class="applyNowLink apply-now-button"  
455                                                        href="${oadURL}?locationCode=${lc_used}&amp;offerId=${offerId}&amp;preparerType=customer&amp;mktChl=${marketingChannel}" 
456                                                        data-button-name="apply-now-link"  
457                                                        data-product-name="${productName}"                 
458
459                                                            ${consumerTitle.getSiblings()[cardIndex].applyNow.getData()}<span class="screen-reader-only"> for ${partnerName!''} ${product!''} Card </span> 
460                                                    </a> 
461                                                </form> 
462												</#if> 
463                                            </li> 
464                                            <li> 
465                                            <#if ameriprise> 
466                                                <a href="${environment}/${productName}?bankercode=${bCode}&ecdma-lc=${lc_used}${ecidExt}"> 
467                                                    ${consumerTitle.getSiblings()[cardIndex].LearnMore.getData()}<span class="screen-reader-only"> about ${partnerName!''} ${product!''} Card </span> 
468                                                </a> 
469                                            <#else> 
470                                                <a href="${environment}/${productName}?bankercode=${bCode}&ecdma-lc=${lc}${ecidExt}"> 
471                                                    ${consumerTitle.getSiblings()[cardIndex].LearnMore.getData()}<span class="screen-reader-only">about ${partnerName!''} ${product!''} Card </span> 
472                                                </a> 
473                                            </#if> 
474                                            </li> 
475                                        </ul> 
476                                    </div>                             
477                                </div> 
478                            </#list> 
479                        </div> 
480                    </div>                 
481                </#if> 
482                <#if ((businessCards?size > 0) && (isEmployee == false))>  
483                    <div class="tab-more-wrapper">    
484                        <div class="jn-consumer-content-wrapper jn-tab-content transition-start" data-id="businessTab" title="${partnerName!''} - Business products"> 
485                             
486                            <#list businessCards as fib> 
487							       <#assign useprcaValue = fib.useprca!"">  
488                                    <#assign cardArtImage = cdnCardArtUrl + "/" + fib.filename + ".png"> 
489                                    <#assign cardArtImageAlt = cdnCardArtUrl + "/"+fib.filename+".jpg"> 
490                                    <#switch fib.offerType>                                   
491                                        <#case "144"> 
492                                            <#assign productName = "smart-business-rewards"> 
493                                            <#assign product="Smart Business Rewards"> 
494                                            <#assign cardIndex = 8> 
495                                            <#break> 
496                                        <#case "128"> 
497                                            <#assign productName = "business-cash-preferred"> 
498                                            <#assign product="Business Cash Preferred"> 
499                                            <#assign cardIndex = 6>   
500                                            <#break> 
501                                        <#case "143"> 
502                                            <#assign productName = "business-real-rewards"> 
503                                            <#assign product="Business Real Rewards"> 
504                                            <#assign cardIndex = 9> 
505                                            <#break> 
506                                        <#case "121"> 
507                                            <#assign productName = "business-platinum2103"> 
508                                            <#assign product="Business Card"> 
509                                            <#assign cardIndex = 7> 
510                                            <#break> 
511                                        <#default> 
512                                    </#switch> 
513                                    <!-- bussiness cards offerId dose not check for isEmployee because employees can't have business cards --> 
514                                    <#assign offerId = fib.saaofferId> 
515 
516                                    <#assign newTag = ""> 
517                                    <#if (consumerTitle.getSiblings()[cardIndex].addNewTag?has_content && consumerTitle.getSiblings()[cardIndex].addNewTag.getData() == "true")> 
518                                        <#assign newTag = "with-new-tag"> 
519                                    </#if> 
520                                    <#assign APR=""> 
521                                    <#assign AMF=""> 
522                                    <#assign scrapedData = utilServ.makeCall('crcDDCGetSchumerBox', offerId + '&'+ fib.sourceCode)> 
523                                    <#if (scrapedData?size > 0)> 
524                                        <#list scrapedData as sItem> 
525                                            <#if ((sItem.scrapedLabel?contains("Annual Percentage Rate (APR) for Purchases")) && (sItem.scrapedValue?has_content)) > 
526                                                <#assign APR = sItem.scrapedValue> 
527                                            <#elseif ((sItem.scrapedLabel?contains("Annual Membership Fee")) && (sItem.scrapedValue?has_content)) > 
528                                                <#assign AMF = sItem.scrapedValue> 
529                                            </#if> 
530                                            <#if (APR?has_content && AMF?has_content)> 
531                                                <#break> 
532                                            </#if> 
533                                        </#list> 
534                                    </#if> 
535                                     
536                                <div class="${newTag} jn-consumer-item item-${fib.offerType}" title="${partnerName!''} ${product!''} Credit Card"> 
537                                    <div class="tag-container"> 
538                                        <div class="tag-corner"> 
539                                            <div class="tag-label">NEW</div> 
540                                        </div> 
541                                    </div> 
542                                    <div class="consumer-card-heading hide-desktop"> 
543                                        <div class="consumer-card-heading__subheading">${consumerTitle.getSiblings()[cardIndex].Title.getData()}</div> 
544                                        ${consumerTitle.getSiblings()[cardIndex].headlineText.getData()} 
545                                    </div> 
546                                    <div class="jn-consumer-card-image"> 
547                                        <img src="${cardArtImage!''}" alt="${rollover_text!''}"  class="jn-img-responsive" onerror="this.onerror=null;this.src='${cardArtImageAlt!''}'"> 
548                                 
549                                        <#if (consumerTitle.getSiblings()[cardIndex].cardArtDescription?has_content) > 
550                                            <p class="jn-card-art-description">${consumerTitle.getSiblings()[cardIndex].cardArtDescription.getData()}</p> 
551                                        </#if> 
552                                    </div> 
553 
554                                    <div class="jn-consumer-card-info"> 
555                                        <div class="consumer-card-heading hide-mobile"> 
556                                            <div class="consumer-card-heading__subheading">${consumerTitle.getSiblings()[cardIndex].Title.getData()}</div> 
557                                            ${consumerTitle.getSiblings()[cardIndex].headlineText.getData()} 
558                                        </div> 
559                                        <div class="jn-additional"> 
560                                            <ul> 
561                                                <li class="${fib.offerType}"> 
562                                                    <p> 
563                                                        <#if (fib.offerType == "144")> 
564                                                            <strong>APR for Purchases and Balance Transfers: </strong> 
565                                                        <#else> 
566                                                            <strong>Intro APR<sup>*</sup> for Purchases and Balance Transfers: </strong> 
567                                                        </#if> 
568 
569                                                        ${APR!''} 
570                                                        <a href="${oadURL_TC}?step=display&amp;offerId=${offerId}&amp;locationCode=${lc_used}" target="_blank"> 
571                                                            <span class="screen-reader-only">${partnerName!''} ${product!''} Card </span>See terms &amp; conditions 
572                                                        </a> 
573                                                    </p> 
574                                                </li> 
575                                                <#if isEmployee && consumerTitle.getSiblings()[cardIndex].employeeAdditionalInfo.getData()?has_content> 
576                                                    <#if  consumerTitle.getSiblings()[cardIndex].employeeAdditionalInfo.getSiblings()?has_content> 
577                                                        <#list consumerTitle.getSiblings()[cardIndex].employeeAdditionalInfo.getSiblings() as marketingInfo> 
578                                                            <li>${marketingInfo.getData()}</li> 
579                                                        </#list> 
580                                                    </#if> 
581                                                <#elseif consumerTitle.getSiblings()[cardIndex].additionalInfo.getData()?has_content> 
582                                                    <#if consumerTitle.getSiblings()[cardIndex].additionalInfo.getSiblings()?has_content> 
583                                                        <#list consumerTitle.getSiblings()[cardIndex].additionalInfo.getSiblings() as marketingInfo> 
584                                                            <li>${marketingInfo.getData()}</li> 
585                                                        </#list> 
586                                                    </#if> 
587                                                </#if> 
588                                                <li> 
589                                                    <p> 
590                                                        Annual Fee: ${AMF!''} <a 
591                                                        href="${oadURL_TC}?step=display&amp;offerId=${offerId}&amp;locationCode=${lc_used}" target="_blank"> 
592                                                            <span class="screen-reader-only">${partnerName!''} ${product!''} Card </span>See terms &amp; conditions 
593                                                        </a> 
594                                                    </p> 
595                                                </li> 
596                                            </ul> 
597                                        </div> 
598                                        <ul class="actions">                                     
599                                            <li> 
600											<#if (useprcaValue == "1")> 
601                                                <form action="${prcaURL}?locationCode=${lc_used}&amp;offerId=${offerId}&amp;preparerType=customer&amp;mktChl=${marketingChannel}&amp;applicationType=${applicationType}" method="post" class="BAAForm"> 
602                                                    <label for="appDataBAA-${offerId}" style="position:absolute; clip:rect(0 0 0 0);">Application Data</label> 
603                                                    <textarea rows="20" cols="100" name="applicationData" id="appDataBAA-${offerId}" class="appDataBAA" style="display:none;" title="application data"></textarea>                                         
604                                                    <a  
605                                                        class="applyNowLink apply-now-button"  
606                                                        href="${prcaURL}?locationCode=${lc_used}&amp;offerId=${offerId}&amp;preparerType=customer&amp;mktChl=${marketingChannel}&amp;applicationType=${applicationType}"  
607                                                        data-button-name="apply-now-link"  
608                                                        data-product-name="${productName}" 
609
610                                                        ${consumerTitle.getSiblings()[cardIndex].applyNow.getData()} 
611                                                        <span class="screen-reader-only"> for ${partnerName!''} ${product!''} Card </span> 
612                                                    </a> 
613                                                </form> 
614												<#else> 
615													<form action="${oadURL}?locationCode=${lc_used}&amp;offerId=${offerId}&amp;preparerType=customer&amp;mktChl=${marketingChannel}" method="post" class="BAAForm"> 
616                                                    <label for="appDataBAA-${offerId}" style="position:absolute; clip:rect(0 0 0 0);">Application Data</label> 
617                                                    <textarea rows="20" cols="100" name="applicationData" id="appDataBAA-${offerId}" class="appDataBAA" style="display:none;" title="application data"></textarea>                                         
618                                                    <a  
619                                                        class="applyNowLink apply-now-button"  
620                                                        href="${oadURL}?locationCode=${lc_used}&amp;offerId=${offerId}&amp;preparerType=customer&amp;mktChl=${marketingChannel}"  
621                                                        data-button-name="apply-now-link"  
622                                                        data-product-name="${productName}" 
623
624                                                        ${consumerTitle.getSiblings()[cardIndex].applyNow.getData()} 
625                                                        <span class="screen-reader-only"> for ${partnerName!''} ${product!''} Card </span> 
626                                                    </a> 
627                                                </form> 
628												</#if> 
629												 
630												 
631                                            </li> 
632                                            <li> 
633                                                <a href="${environment}/${productName}?bankercode=${bCode}&ecdma-lc=${lc}${ecidExt}"> 
634                                                    ${consumerTitle.getSiblings()[cardIndex].LearnMore.getData()}<span class="screen-reader-only">about ${partnerName!''} ${product!''} Card </span> 
635                                                </a> 
636                                            </li> 
637                                        </ul> 
638                                    </div> 
639                                </div> 
640                                 
641                            </#list> 
642                             
643                        </div> 
644                    </div> 
645                </#if>  
646            </div> 
647            <script> 
648                var consumerSelector = '.jn-consumer-content-wrapper.jn-tab-content[data-id="consumerTab"]'; 
649                var businessSelector = '.jn-consumer-content-wrapper.jn-tab-content[data-id="businessTab"]'; 
650                 $(document).ready(function () { 
651                    var banker_code = "${bCode!''}"; 
652                    var tabs=$('.tab-nav'); 
653                    var slideDiv = $('.jn-tab-content.active');                    
654                    var screenWidthMobile = 768; 
655                    var screenWidth = window.innerWidth; 
656 
657                    if (tabs.length == 1) { 
658                        if ($(consumerSelector).length > 0) { 
659                            if(banker_code && (banker_code.indexOf("amp") == 0) && (banker_code.length > 6)) { 
660                                $("nav.jn-primary-nav").hide(); 
661                                changeCardLayout(consumerSelector); 
662                                createMetaTag("consumer"); 
663                            } else { 
664                                hideHeroAndDisclaimer('business'); 
665                                showHeroAndDisclaimer('consumer'); 
666                                changeCardLayout(consumerSelector); 
667                                renumberFootnote("consumer"); 
668                                createMetaTag("consumer");  
669
670                        }  
671                        if ($(businessSelector).length > 0) { 
672                            $(businessSelector).addClass('active'); 
673                            hideHeroAndDisclaimer('consumer'); 
674                            showHeroAndDisclaimer('business'); 
675                            changeCardLayout(businessSelector); 
676                            renumberFootnote("business"); 
677                            createMetaTag("business");  
678
679
680                    if (tabs.length == 2) { 
681                        renumberFootnote("consumer"); 
682                        renumberFootnote("business"); 
683                        createMetaTag("consumer"); 
684                        if ($(consumerSelector + ' .jn-consumer-item').length < 3) { 
685                            changeCardLayout(consumerSelector); 
686
687                        if ($(businessSelector + ' .jn-consumer-item').length < 3) { 
688                            changeCardLayout(businessSelector); 
689
690                             
691                        var tabsNav = document.querySelectorAll('.tab-nav'); 
692                        togglePrimaryNav(tabsNav); 
693 
694                        if(window.location.href.indexOf('#business') > -1 ) { 
695                            $(consumerSelector).removeClass('active'); 
696                            $(businessSelector).addClass('active'); 
697                            $('#consumerTab').removeClass('active'); 
698                            $('#businessTab').addClass('active'); 
699                            hideHeroAndDisclaimer('consumer'); 
700                            showHeroAndDisclaimer('business'); 
701                            changeCardLayout(businessSelector); 
702                            renumberFootnote("business"); 
703                            createMetaTag("business"); 
704 
705                            $(tabs).click(function(){ 
706                                if ($(this).attr('id') === "consumerTab") { 
707                                    var newUrl = window.location.toString(); 
708                                    window.location = newUrl.replace(/#business/, '#consumer'); 
709
710                                if ($(this).attr('id') === "businessTab") { 
711                                    var url = window.location.toString(); 
712                                    window.location = url.replace(/#consumer/, '#business'); 
713
714                            }); 
715
716
717                     
718                }); 
719                // Primary Nav function 
720                 
721                function togglePrimaryNav(elem) { 
722                    for (var i = 0; i < elem.length; i++) { 
723                        elem[i].addEventListener("click", function(e) { 
724 
725                            var current = this, 
726                                allSections = document.querySelectorAll('[data-id]'), 
727                                section = document.querySelector("[data-id='"+ current.id +"']"); 
728 
729                            for (var a = 0; a < allSections.length; a++) { 
730                                allSections[a].classList.remove('active'); 
731
732                            for (var c = 0; c < elem.length; c++) { 
733                                if (current != elem[c]) { 
734                                    elem[c].classList.remove('active'); 
735                                } else { 
736                                    current.classList.add('active'); 
737                                    section.classList.add('active'); 
738                                    hideHeroAndDisclaimer('consumer'); 
739                                    hideHeroAndDisclaimer('business'); 
740                                    if(current.getAttribute('id') === "consumerTab"){ 
741                                        showHeroAndDisclaimer('consumer'); 
742                                    } else if(current.getAttribute('id') === "businessTab"){ 
743                                        showHeroAndDisclaimer('business'); 
744
745
746
747                            e.preventDefault(); 
748                        }); 
749
750
751 
752                function renumberFootnote(type) { 
753                    var discriptionSelector = '.jn-consumer-content-wrapper.jn-tab-content' + '[data-id="' + type + 'Tab"]'; 
754                    var disclaimerSelector = '.tier1-disclaimer-landing-' + type; 
755                    var heroSelector = '.tier1-hero-landing-' + type; 
756                    var numOfFootnote = $(disclaimerSelector + ' sup').length; 
757                    var showList = []; 
758                    var hideList=[]; 
759                    for (var i = 1; i <= numOfFootnote; i++) { 
760                    var cssClass="tag-" + i; 
761                    if ($(discriptionSelector + ' sup').hasClass(cssClass) || $(heroSelector + ' sup').hasClass(cssClass)) { 
762                        showList.push(i);      
763                    } else { 
764                        hideList.push(i); 
765
766                    }  
767                    /* 
768                    for (var i = 1; i < showList.length + 1; i++) { 
769                        if(showList[i-1] != i) { 
770                            var className="tag-" + showList[i-1]; 
771                            $(heroSelector).find("." +  className).html(i); 
772                            // $(discriptionSelector).find("." +  className).html(i); 
773                            $(disclaimerSelector).find("." +  className).html(i); 
774
775
776                    */ 
777                    for (var i = 0; i <hideList.length; i++) { 
778                        var cname="tag-" + hideList[i]; 
779                        $(disclaimerSelector).find("." + cname).parent().hide(); 
780                    }    
781
782 
783                function changeCardLayout(cssSelector) { 
784                    var numOfCards = $(cssSelector + ' .jn-consumer-item').length; 
785                    if(numOfCards == 1) { 
786                        $(cssSelector).addClass('one-card'); 
787                    } else if (numOfCards == 2) { 
788                        $(cssSelector).addClass('two-card'); 
789                    }   
790
791                function hideHeroAndDisclaimer(type) { 
792                    try { 
793                        document.querySelector('.tier1-hero-landing-'+ type).classList.remove('show'); 
794                        document.querySelector('.tier1-hero-landing-'+ type).classList.add('hide'); 
795                    } catch (e) { 
796                        console.log(e); 
797
798 
799                    try { 
800                        document.querySelector('.tier1-disclaimer-landing-'+ type).classList.remove('show'); 
801                        document.querySelector('.tier1-disclaimer-landing-'+ type).classList.add('hide');  
802                    } catch (e) { 
803                        console.log(e); 
804
805 
806
807                function showHeroAndDisclaimer(type) { 
808                    try { 
809                        document.querySelector('.tier1-hero-landing-'+ type).classList.add('show'); 
810                        document.querySelector('.tier1-hero-landing-'+ type).classList.remove('hide'); 
811                    } catch (e) { 
812                        console.log(e); 
813
814                     
815                    try { 
816                        document.querySelector('.tier1-disclaimer-landing-'+ type).classList.add('show'); 
817                        document.querySelector('.tier1-disclaimer-landing-'+ type).classList.remove('hide');  
818                    } catch (e) { 
819                        console.log(e); 
820
821 
822
823                function createMetaTag(type) { 
824                    var partnerName = "${partnerName!0}"; 
825                    var product_name = $('.jn-hero-container .jn-button').data('product-name'); 
826                    var metaDesc = ""; 
827                    if (type == "consumer") {     
828                        if(location.pathname.indexOf("11t1m") != -1) { 
829                            metaDesc = "Apply Today for an Ameriprise Financial Credit Card. Earn Rewards Points worth $375 cash value when deposited into an eligible account after spending $3,000 in eligible net purchases within the first 90 days of account opening." 
830                        } else {                                    
831                            if(product_name ==  "consumer-platinum2103") { 
832                                metaDesc = "Apply Today for a "+partnerName+" Credit Card. Limited Time Offer. 0% Intro APR on Purchases and Balance Transfers for 20 Billing Cycles Consolidate your Balances with the "+partnerName+" Intro APR Card."; 
833                            } else if(product_name ==  "real-rewards") { 
834                                metaDesc = "Apply Today for a "+partnerName+" Credit Card. Take home 2,500 bonus points after your first purchase."; 
835                            } else if(product_name ==  "secured") { 
836                                metaDesc = "Apply Today for a "+partnerName+" Credit Card. Use this card as a solid foundation to build your credit."; 
837                            } else if(product_name ==  "max-cash") { 
838                                if('${isEmployee?string("yes", "no")}' == "yes") { 
839                                    metaDesc = "Apply Today for a "+partnerName+" Credit Card. Earn a $200 Bonus and 5% cash back on the two categories you select."; 
840                                } else { 
841                                    metaDesc = "Apply Today for a "+partnerName+" Credit Card. Earn a $150 Bonus and 5% cash back on the two categories you select."; 
842
843
844
845 
846                    } else if (type == "business") { 
847                        if(product_name ==  "business-cashback") {               
848                            metaDesc = "Apply Today for a "+partnerName+" Credit Card. Earn Cash back on common business expenses."; 
849                        } else if(product_name ==  "business-real-rewards") { 
850                            metaDesc = "Apply Today for a "+partnerName+" Credit Card. Get more rewards in the categories you spend the most on."; 
851                        } else if(product_name ==  "business-visa") { 
852                            metaDesc = "Apply Today for a "+partnerName+" Business Card. 0% Intro APR on Purchases and Balance Transfers for 15 Billing Cycles"; 
853                        } else if(product_name ==  "smart-business-rewards") { 
854                            metaDesc = "Apply Today for a "+partnerName+" Credit Card. More choices. More value for your business. Earn a $200 Bonus and 2x Rewards on your top 2 spend categories each month with the "+partnerName+" Credit Card."; 
855
856
857                    var m = document.createElement('meta');  
858                    m.name = 'description';  
859                    m.content = metaDesc;  
860                    document.head.appendChild(m); 
861
862                function goToByScroll(id) { 
863                    var element = document.getElementById(id); 
864                    element.scrollIntoView(true); 
865
866                 
867            </script> 
868            <script> 
869                var reportingData = window.reportingData || {}; 
870                document.addEventListener('DOMContentLoaded', function() {                    
871                    var page = location.pathname.split('/')[location.pathname.split('/').length-1]; 
872                    var hostName = location.hostname;                                     
873                    function getDomainFromHostname(hostname) { 
874                        var parts = hostname.split('.'); 
875                        return parts.length === 3 ? parts[1] : parts[0]; 
876
877                    var domain = getDomainFromHostname(hostName); 
878                    var partnerName = "${partnerName!0}"; 
879                    var ameriprise = '${ameriprise?string("yes", "no")}'; 
880                    var locationCode = "${rLC!lc}"; 
881                    var eidAmp = ""; 
882                    var heroCardImgs = document.querySelectorAll('.jn-consumer-card-image img, .cardArtImg img'); 
883                    for (var index = 0; index < heroCardImgs.length; index++) { 
884                        var heroCardImg = heroCardImgs[index]; 
885                        var heroCardSrc = heroCardImg.getAttribute("src"); 
886                        if(heroCardSrc != "") { 
887                            resizeImg(heroCardImg); 
888
889
890                    if (ameriprise == "yes") { 
891                        var bankercode_amp = '${bCode}'; 
892                        eidAmp = bankercode_amp.substring(3); 
893                        locationCode =""; 
894                        document.title = "Ameriprise Financial Credit Card Overview Page"; 
895                    } else { 
896                        document.title = partnerName + " Credit Card Index Page"; 
897
898                     
899                    var lc = '${lc!0}'; 
900 
901                    var regex = /\d+/g; 
902                    var bdNumber = "${bPhone!''}"; 
903                    var phoneNum = bdNumber.match(regex); 
904                    var areaCode = ""; 
905                    var exchangeCode = ""; 
906                    var num = ""; 
907                    if(phoneNum != null) { 
908                        phoneNum = phoneNum.join(""); 
909                        areaCode = phoneNum.substring(0,3); 
910                        exchangeCode = phoneNum.substring(3,6); 
911                        num = phoneNum.substring(6,10); 
912
913                     
914                        /* update SiteCatalyst data object */ 
915                    reportingData.current_page = "microsite:${partnerName}:" + domain + ':' + page.replace('-',' '); 
916                    reportingData.page_type = 'product';  
917                    reportingData.site_section = 'credit cards'; 
918                    reportingData.platform = 'microsite'; 
919                    reportingData.campaign_id = '${campaignId}'; 
920                    reportingData.location_code = '${rLC!0}'; 
921                    reportingData.partner_name = "${partnerName}"; 
922                    reportingData.product = 'All Cards'; 
923                    reportingData.text_to_apply_source = '${text_to_apply_source}'; 
924                    reportingData.visitor_type = 'prospect';         
925                    reportingData.Banker_id = '${boeid}'; 
926                    reportingData.Banker_code = '${bCode}'; 
927 
928                                                     
929                    /* SiteCatalyst  pageView tracking */ 
930                    AUI().ready(function() { 
931                        if (window.publisherFW) {                            
932                            window.publisherFW.publishEvent("pageView", reportingData); 
933
934                    });  
935                                   
936                    $('.jn-button').removeAttr('disabled'); 
937                    $('.jn-button').removeClass('jn-disabled'); 
938 
939                    jQuery('.applyNowLink').on('click', function(e) { 
940                        $(this).closest('.BAAForm').submit(); 
941                        const bankerId = '${boeid}'; 
942                        const employeeId = ""; 
943                        let visitorId = bankerId; 
944                         
945                        if('${isEmployee?string("yes", "no")}' == "yes") { 
946                            visitorId = employeeId; 
947
948                        const htmlElementName = e.target.nodeName; 
949                        const isButton = (htmlElementName ==='BUTTON'); 
950                        // gets href of clicked anchor tag 
951                        let href = e.target.href; 
952 
953                        // get action url of form submit button  
954                        if(isButton) { 
955                            href = document.getElementById('BAAForm').action; 
956
957 
958                        const urlParams = new URLSearchParams(href);                    
959                        let offerId = ""; 
960 
961                        if(urlParams.has('offerid')) { 
962                            offerId = urlParams.get('offerid'); 
963
964 
965                        if(urlParams.has('offerId')) { 
966                            offerId = urlParams.get('offerId'); 
967
968                         
969                        window.dataLayer.push({ 
970                            'event' : 'apply_payload', 
971                            'location_code': locationCode, 
972                            'banker_code': '${bCode}', 
973                            'offer_id': offerId, 
974                            'visitor_id': visitorId, 
975                        }); 
976                        return false; 
977                    }); 
978                    jQuery(".BAAForm").on("submit", function(e){ 
979                        e.preventDefault();                         
980                        var xmlData; 
981                        if('${isEmployee?string("yes", "no")}' == "yes") { 
982
983                        if(ameriprise == "yes") { 
984                            xmlData = '<?xml version="1.0"?>'+ 
985                                "<prefillData>"+  
986                                    "<versionNumber>1.0</versionNumber>"+  
987                                    "<applicationData>"+  
988                                        "<referral>" +  
989                                            "<employeeId>" + eidAmp + "</employeeId>" + 
990                                            "<storeNumber>"+"${bName!'0'}"+"</storeNumber>"+ 
991                                            "<divisionNumber></divisionNumber>"+ 
992                                        "</referral>" +  
993                                        "<bankerInformation>"+  
994                                            "<locationCode>" + locationCode + "</locationCode>"+ 
995                                            "<originatingBranchNumber>"+"${bName!'0'}"+"</originatingBranchNumber>"+ 
996                                            "<employeeID>${boeid!0}</employeeID>"+ 
997                                            "<name>" + 
998                                            "<first>${bFName!'0'}</first>" + 
999                                            "<last>${bLName!'0'}</last>" + 
1000                                            "</name>"+ 
1001                                            "<phone>"+ 
1002                                            "<areaCode>"+areaCode+"</areaCode>"+  
1003                                            "<exchange>"+exchangeCode+"</exchange>"+ 
1004                                            "<number>"+num+"</number>"+  
1005                                            "</phone>"+  
1006                                        "</bankerInformation>"+  
1007                                    "</applicationData>"+  
1008                                "</prefillData>" 
1009                        } else if ('${isEmployee?string("yes", "no")}' == "yes") {  
1010                            xmlData = '<?xml version="1.0"?>'+ 
1011                                "<prefillData>"+  
1012                                    "<versionNumber>1.0</versionNumber>"+  
1013                                    "<applicationData>"+                                         
1014                                        "<bankerInformation>"+  
1015                                            "<employeeFullName>Employee Product</employeeFullName>"+ 
1016                                            "<employeeId>EMPPROD</employeeId>"+ 
1017                                            "<employeePhoneNumber></employeePhoneNumber>"+ 
1018                                            "<locationCode>" + locationCode + "</locationCode>"+ 
1019                                            "<originatingBranchNumber>"+"${bName!'0'}"+"</originatingBranchNumber>"+ 
1020                                            "<originatingBranchId></originatingBranchId>"+ 
1021                                            "<name>" + 
1022                                                "<first>${bFName!'0'}</first>" + 
1023                                                "<last>${bLName!'0'}</last>" + 
1024                                            "</name>"+ 
1025                                            "<phone>"+ 
1026                                                "<areaCode>" + areaCode + "</areaCode>"+  
1027                                                "<exchange>" + exchangeCode + "</exchange>"+ 
1028                                                "<number>" + num + "</number>"+  
1029                                            "</phone>"+  
1030                                        "</bankerInformation>"+  
1031                                        "<referral>" +  
1032                                            "<divisionNumber></divisionNumber>" +       
1033                                            "<partnerLocationID>" + locationCode + "</partnerLocationID>" +                          
1034                                            "<referralId>EMPPROD</referralId>" + 
1035                                        "</referral>" +  
1036                                    "</applicationData>"+  
1037                                "</prefillData>";                             
1038                        } else { 
1039                            xmlData = '<?xml version="1.0"?>'+ 
1040                                "<prefillData>"+  
1041                                    "<versionNumber>1.0</versionNumber>"+  
1042                                    "<applicationData>"+  
1043                                        "<bankerInformation>"+  
1044                                            "<locationCode>" + locationCode + "</locationCode>"+ 
1045                                            "<originatingBranchNumber>"+"${bName!'0'}"+"</originatingBranchNumber>"+ 
1046                                            "<employeeID>${boeid!0}</employeeID>"+ 
1047                                            "<name>" + 
1048                                                "<first>${bFName!'0'}</first>" + 
1049                                                "<last>${bLName!'0'}</last>" + 
1050                                            "</name>"+ 
1051                                            "<phone>"+ 
1052                                                "<areaCode>"+areaCode+"</areaCode>"+  
1053                                                "<exchange>"+exchangeCode+"</exchange>"+ 
1054                                                "<number>"+num+"</number>"+  
1055                                            "</phone>"+  
1056                                        "</bankerInformation>"+  
1057                                    "</applicationData>"+  
1058                                "</prefillData>" 
1059
1060                        console.log("useprcaValue---->"+${useprcaValue}) 
1061						if('${useprcaValue}' =='1'){ 
1062                          if('${isEmployee?string("yes", "no")}' == "yes"){   						 
1063							var employeeFullName = "${fName!'0'}" + ' ' + "${lName!'0'}"; 
1064							var firstName = "${fName!'0'}".trim(); 
1065							var lastName = "${lName!'0'}".trim(); 
1066							var fullName = employeeFullName.trim();  
1067								 
1068							if (fullName.length <= 19) { 
1069								employeeFullName = fullName;  
1070							} else if (firstName.charAt(0) + ' ' + lastName.length <= 19) { 
1071								employeeFullName = firstName.charAt(0) + ' ' + lastName;  
1072							} else { 
1073								employeeFullName = firstName.charAt(0) + ' ' + lastName.substring(0, 17); 
1074							}							 
1075							 var applicationJsonData = { 
1076												  "prefillData": { 
1077													"versionNumber": "1.0", 
1078													"applicationData": { 
1079													  "bankerInformation": { 
1080														"locationCode": locationCode, 
1081														"originatingBranchId": "${bName!'0'}", 
1082														"employeeId": "EMPPROD", 
1083														"employeeFullName": "Employee Product", 
1084														"employeePhoneNumber": phoneNum 
1085
1086
1087
1088												}; 
1089                            }else{ 
1090							var employeeFullName = "${fName!'0'}" + ' ' + "${lName!'0'}"; 
1091							var firstName = "${fName!'0'}".trim(); 
1092							var lastName = "${lName!'0'}".trim(); 
1093							var fullName = employeeFullName.trim();  
1094								 
1095							if (fullName.length <= 19) { 
1096								employeeFullName = fullName;  
1097							} else if (firstName.charAt(0) + ' ' + lastName.length <= 19) { 
1098								employeeFullName = firstName.charAt(0) + ' ' + lastName;  
1099							} else { 
1100								employeeFullName = firstName.charAt(0) + ' ' + lastName.substring(0, 17); 
1101							}							 
1102							 var applicationJsonData = { 
1103												  "prefillData": { 
1104													"versionNumber": "1.0", 
1105													"applicationData": { 
1106													  "bankerInformation": { 
1107														"locationCode": locationCode, 
1108														"originatingBranchId": "${bName!'0'}", 
1109														"employeeId": "${boeid!0}", 
1110														"employeeFullName": employeeFullName, 
1111														"employeePhoneNumber": phoneNum 
1112
1113
1114
1115												}; 
1116
1117							var jsonData = JSON.stringify(applicationJsonData); 
1118							$(this).children(".appDataBAA").val(jsonData); 
1119						}else{ 
1120						  $(this).children(".appDataBAA").val(xmlData); 
1121
1122                         
1123                        var buttonName = $(this).find(".apply-now-button").data("button-name"); 
1124                        var productName = $(this).find(".apply-now-button").data("product-name"); 
1125                        /* SiteCatalyst  onClick tracking */ 
1126                        reportingData.apply_button = buttonName; 
1127                        reportingData.product = productName; 
1128 
1129                        if (window.publisherFW) {                            
1130                            window.publisherFW.publishEvent("onClick", reportingData); 
1131
1132                        var paramString = '${bCode}' + "&" + xmlData + "&" + '${htmlUtil.escapeURL(htmlUtil.escapeJS(url))}'; 
1133                            /* CRC service call */ 
1134                            Liferay.Service( 
1135                                '/crc-utilities-portlet#crcremote/make-call', 
1136
1137                                    storedProcedure: 'crcDDCTextApplyLog', 
1138                                    parameters: paramString 
1139                                }, 
1140                                function(obj){                                   
1141
1142                            ); 
1143 
1144                        this.submit();                   
1145                    });                                                                                   
1146                }); 
1147                function resizeImg(img) { 
1148                    img.addEventListener("load", function() { 
1149                        var cardImgWidth = img.width; 
1150                        var cardImgHeight = img.height; 
1151                        if(cardImgWidth > cardImgHeight) { 
1152                            img.style.width = "285px"; 
1153                        } else { 
1154                            img.style.width = "150px"; 
1155
1156                    }); 
1157
1158            </script>                    
1159                 
1160        </#if>  
1161    </#if> 
1162</#if>