<CFPROCESSINGDIRECTIVE suppresswhitespace="yes">
<cfcontent type="text/javascript">
<cfparam name="lang" type="string" default="">
<cfscript>
whatsnew = createObject('component', Application.DIRECTORY & '.components.elementloader');
if (lang EQ '') element = whatsnew.load("",true,"/assets/common/whatsnew._grd");
//if (lang EQ 'fr')element = whatsnew.load("",true,"/assets/common/whatsnew_fr._grd");
</cfscript>
/* Date: <cfoutput>#element.edited_on#</cfoutput> */
var d=document;
<cfscript>
elementData = element.getRows();
elementDataLen = arraylen(elementData);

// Max number of items to show
if (elementDataLen GT 4) elementDataLen = 4;

if (elementDataLen GT 0) {

curCat = "";

writeoutput("d.writeln('<ul class=\'whatsnew\'>');#chr(13)#");
for (i=1; i LTE #elementDataLen#; i=i+1) {
cat = JSStringFormat(elementData[i].getElement('category').getValue());
title = JSStringFormat(elementData[i].getElement('title').getValue());
name = i;
name = "/whatsnew.htm###name#";
desc = JSStringFormat(elementData[i].getElement('description').getValue());
link = JSStringFormat(elementData[i].getElement('link').getFile());
linktarget = JSStringFormat(elementData[i].getElement('link').getTarget());
if (link NEQ '') name = link;
if (title EQ '' AND desc NEQ '') {
writeoutput(desc);
} else {
if (cat NEQ curCat) {
if (curCat NEQ '') {
writeoutput("d.writeln('</li>');#chr(13)#");
writeoutput("d.writeln('</ul>');#chr(13)#");
}
writeoutput("d.writeln(#chr(34)#<li>#cat##chr(34)#);#chr(13)#");
writeoutput("d.writeln('<ul>');#chr(13)#");
curCat = cat;
}
writeoutput("d.writeln(#chr(34)#<li>");
writeoutput("<a href='#name#' class='readmore'");
if (linktarget NEQ '') writeoutput(" target='#linktarget#'");
//if (desc NEQ '') writeoutput(" title='#desc#'");
//writeoutput(">" & REReplace(title,'"','\"','all') & "</a></li>#chr(34)#);#chr(13)#");
writeoutput(">" & title & "</a>");
writeoutput("</li>#chr(34)#);#chr(13)#");
}
}
if (curCat NEQ '') {
writeoutput("d.writeln('</ul>');#chr(13)#");
writeoutput("d.writeln('</li>');#chr(13)#");
}
writeoutput("d.writeln('</ul>');");

} else {
writeoutput("<!-- none found -->");
}
</cfscript>
</CFPROCESSINGDIRECTIVE>