/* 
This JS customization is to display the CustomNavFlag1 instead of page name (DisplayName)
(changed in the database to be displayed as 'CustomDisplayName' in XML format)
Since the filter block retrieves the Page name as default, in order to dynamically retrieve both the names, 
different classes have been defined in the custom XSL. 

Refer: 'aggregationv2blocksinglecustomname.xsl' and make changes too for this JS to work.
Have added classes 'baseName' and 'customName' with the a#linkBaseName in case <h> element is not used.

Add this javascript in the desired page layout's titan snippets and the XSL to the filter block.

Use the custom filter block and set the page layout with the JS added. Also refer to 'filterblockSliderArrows.js'

*/

$(function() {
    var filterTitles = new Array();

    var $customName = $('#topContentContainer .OneCol DIV H4 .baseName');
    $customName.each(function() {       
            filterTitles[filterTitles.length] = $(this).text();  
    });

    $('#topContentContainer .OneCol').before('<div id="nav">').cycle({ fx: 'fade', speed: 'slow', timeout: 10000, pager: '#nav' });

    $('#nav a').each(function() {
        var pageVal = parseInt($(this).html());
        $(this).text(filterTitles[pageVal - 1]);

    });
});


