Changeset - 17e901698112
[Not reviewed]
0 0 8
Luke Hatcher - 12 years ago 2012-08-27 18:32:59
lukeman@gmail.com
add datatables and tabletools
7 files changed:
0 comments (0 inline, 0 general)
symposion/static/datatables/js/dataTables.bootstrap.js
Show inline comments
 
new file 100644
 
$(function() {
 
    /* Default class modification */
 
    $.extend( $.fn.dataTableExt.oStdClasses, {
 
        "sWrapper": "dataTables_wrapper form-inline"
 
    } );
 

	
 
    /* API method to get paging information */
 
    $.fn.dataTableExt.oApi.fnPagingInfo = function ( oSettings )
 
    {
 
        return {
 
            "iStart":         oSettings._iDisplayStart,
 
            "iEnd":           oSettings.fnDisplayEnd(),
 
            "iLength":        oSettings._iDisplayLength,
 
            "iTotal":         oSettings.fnRecordsTotal(),
 
            "iFilteredTotal": oSettings.fnRecordsDisplay(),
 
            "iPage":          Math.ceil( oSettings._iDisplayStart / oSettings._iDisplayLength ),
 
            "iTotalPages":    Math.ceil( oSettings.fnRecordsDisplay() / oSettings._iDisplayLength )
 
        };
 
    }
 

	
 
    /* Bootstrap style pagination control */
 
    $.extend( $.fn.dataTableExt.oPagination, {
 
        "bootstrap": {
 
            "fnInit": function( oSettings, nPaging, fnDraw ) {
 
                var oLang = oSettings.oLanguage.oPaginate;
 
                var fnClickHandler = function ( e ) {
 
                    e.preventDefault();
 
                    if ( oSettings.oApi._fnPageChange(oSettings, e.data.action) ) {
 
                        fnDraw( oSettings );
 
                    }
 
                };
 

	
 
                $(nPaging).addClass('pagination').append(
 
                    '<ul>'+
 
                        '<li class="prev disabled"><a href="#">&larr; '+oLang.sPrevious+'</a></li>'+
 
                        '<li class="next disabled"><a href="#">'+oLang.sNext+' &rarr; </a></li>'+
 
                    '</ul>'
 
                );
 
                var els = $('a', nPaging);
 
                $(els[0]).bind( 'click.DT', { action: "previous" }, fnClickHandler );
 
                $(els[1]).bind( 'click.DT', { action: "next" }, fnClickHandler );
 
            },
 

	
 
            "fnUpdate": function ( oSettings, fnDraw ) {
 
                var iListLength = 5;
 
                var oPaging = oSettings.oInstance.fnPagingInfo();
 
                var an = oSettings.aanFeatures.p;
 
                var i, j, sClass, iStart, iEnd, iHalf=Math.floor(iListLength/2);
 

	
 
                if ( oPaging.iTotalPages < iListLength) {
 
                    iStart = 1;
 
                    iEnd = oPaging.iTotalPages;
 
                }
 
                else if ( oPaging.iPage <= iHalf ) {
 
                    iStart = 1;
 
                    iEnd = iListLength;
 
                } else if ( oPaging.iPage >= (oPaging.iTotalPages-iHalf) ) {
 
                    iStart = oPaging.iTotalPages - iListLength + 1;
 
                    iEnd = oPaging.iTotalPages;
 
                } else {
 
                    iStart = oPaging.iPage - iHalf + 1;
 
                    iEnd = iStart + iListLength - 1;
 
                }
 

	
 
                for ( i=0, iLen=an.length ; i<iLen ; i++ ) {
 
                    // Remove the middle elements
 
                    $('li:gt(0)', an[i]).filter(':not(:last)').remove();
 

	
 
                    // Add the new list items and their event handlers
 
                    for ( j=iStart ; j<=iEnd ; j++ ) {
 
                        sClass = (j==oPaging.iPage+1) ? 'class="active"' : '';
 
                        $('<li '+sClass+'><a href="#">'+j+'</a></li>')
 
                            .insertBefore( $('li:last', an[i])[0] )
 
                            .bind('click', function (e) {
 
                                e.preventDefault();
 
                                oSettings._iDisplayStart = (parseInt($('a', this).text(),10)-1) * oPaging.iLength;
 
                                fnDraw( oSettings );
 
                            } );
 
                    }
 

	
 
                    // Add / remove disabled classes from the static elements
 
                    if ( oPaging.iPage === 0 ) {
 
                        $('li:first', an[i]).addClass('disabled');
 
                    } else {
 
                        $('li:first', an[i]).removeClass('disabled');
 
                    }
 

	
 
                    if ( oPaging.iPage === oPaging.iTotalPages-1 || oPaging.iTotalPages === 0 ) {
 
                        $('li:last', an[i]).addClass('disabled');
 
                    } else {
 
                        $('li:last', an[i]).removeClass('disabled');
 
                    }
 
                }
 
            }
 
        }
 
    } );
 

	
 
    $.extend($.fn.dataTableExt.oStdClasses, {
 
        "sWrapper": "dataTables_wrapper form-inline"
 
    });
 

	
 
    /*
 
     * TableTools Bootstrap compatibility
 
     * Required TableTools 2.1+
 
     */
 
    if ( $.fn.DataTable.TableTools ) {
 
        // Set the classes that TableTools uses to something suitable for Bootstrap
 
        $.extend( true, $.fn.DataTable.TableTools.classes, {
 
            "container": "DTTT btn-group",
 
            "buttons": {
 
                "normal": "btn",
 
                "disabled": "disabled"
 
            },
 
            "collection": {
 
                "container": "DTTT_dropdown dropdown-menu",
 
                "buttons": {
 
                    "normal": "",
 
                    "disabled": "disabled"
 
                }
 
            },
 
            "print": {
 
                "info": "DTTT_print_info modal"
 
            },
 
            "select": {
 
                "row": "active"
 
            }
 
        } );
 

	
 
        // Have the collection use a bootstrap compatible dropdown
 
        $.extend( true, $.fn.DataTable.TableTools.DEFAULTS.oTags, {
 
            "collection": {
 
                "container": "ul",
 
                "button": "li",
 
                "liner": "a"
 
            }
 
        } );
 
    }
 
});
symposion/static/datatables/js/jquery.dataTables.min.js
Show inline comments
 
new file 100644
 
/*
 
 * File:        jquery.dataTables.min.js
 
 * Version:     1.9.2
 
 * Author:      Allan Jardine (www.sprymedia.co.uk)
 
 * Info:        www.datatables.net
 
 * 
 
 * Copyright 2008-2012 Allan Jardine, all rights reserved.
 
 *
 
 * This source file is free software, under either the GPL v2 license or a
 
 * BSD style license, available at:
 
 *   http://datatables.net/license_gpl2
 
 *   http://datatables.net/license_bsd
 
 * 
 
 * This source file is distributed in the hope that it will be useful, but 
 
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
 
 * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
 
 */
 
(function(i,V,l,n){var j=function(e){function o(a,b){var c=j.defaults.columns,d=a.aoColumns.length,c=i.extend({},j.models.oColumn,c,{sSortingClass:a.oClasses.sSortable,sSortingClassJUI:a.oClasses.sSortJUI,nTh:b?b:l.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mDataProp:c.mDataProp?c.oDefaults:d});a.aoColumns.push(c);if(a.aoPreSearchCols[d]===n||null===a.aoPreSearchCols[d])a.aoPreSearchCols[d]=i.extend({},j.models.oSearch);else if(c=a.aoPreSearchCols[d],
 
c.bRegex===n&&(c.bRegex=!0),c.bSmart===n&&(c.bSmart=!0),c.bCaseInsensitive===n)c.bCaseInsensitive=!0;r(a,d,null)}function r(a,b,c){b=a.aoColumns[b];c!==n&&null!==c&&(c.sType!==n&&(b.sType=c.sType,b._bAutoType=!1),i.extend(b,c),p(b,c,"sWidth","sWidthOrig"),c.iDataSort!==n&&(b.aDataSort=[c.iDataSort]),p(b,c,"aDataSort"));b.fnGetData=W(b.mDataProp);b.fnSetData=ta(b.mDataProp);a.oFeatures.bSort||(b.bSortable=!1);!b.bSortable||-1==i.inArray("asc",b.asSorting)&&-1==i.inArray("desc",b.asSorting)?(b.sSortingClass=
 
a.oClasses.sSortableNone,b.sSortingClassJUI=""):b.bSortable||-1==i.inArray("asc",b.asSorting)&&-1==i.inArray("desc",b.asSorting)?(b.sSortingClass=a.oClasses.sSortable,b.sSortingClassJUI=a.oClasses.sSortJUI):-1!=i.inArray("asc",b.asSorting)&&-1==i.inArray("desc",b.asSorting)?(b.sSortingClass=a.oClasses.sSortableAsc,b.sSortingClassJUI=a.oClasses.sSortJUIAscAllowed):-1==i.inArray("asc",b.asSorting)&&-1!=i.inArray("desc",b.asSorting)&&(b.sSortingClass=a.oClasses.sSortableDesc,b.sSortingClassJUI=a.oClasses.sSortJUIDescAllowed)}
 
function k(a){if(!1===a.oFeatures.bAutoWidth)return!1;ba(a);for(var b=0,c=a.aoColumns.length;b<c;b++)a.aoColumns[b].nTh.style.width=a.aoColumns[b].sWidth}function G(a,b){for(var c=-1,d=0;d<a.aoColumns.length;d++)if(!0===a.aoColumns[d].bVisible&&c++,c==b)return d;return null}function t(a,b){for(var c=-1,d=0;d<a.aoColumns.length;d++)if(!0===a.aoColumns[d].bVisible&&c++,d==b)return!0===a.aoColumns[d].bVisible?c:null;return null}function v(a){for(var b=0,c=0;c<a.aoColumns.length;c++)!0===a.aoColumns[c].bVisible&&
 
b++;return b}function z(a){for(var b=j.ext.aTypes,c=b.length,d=0;d<c;d++){var g=b[d](a);if(null!==g)return g}return"string"}function D(a,b){for(var c=b.split(","),d=[],g=0,f=a.aoColumns.length;g<f;g++)for(var h=0;h<f;h++)if(a.aoColumns[g].sName==c[h]){d.push(h);break}return d}function x(a){for(var b="",c=0,d=a.aoColumns.length;c<d;c++)b+=a.aoColumns[c].sName+",";return b.length==d?"":b.slice(0,-1)}function J(a,b,c,d){var g,f,h,e,s;if(b)for(g=b.length-1;0<=g;g--){var m=b[g].aTargets;i.isArray(m)||
 
E(a,1,"aTargets must be an array of targets, not a "+typeof m);f=0;for(h=m.length;f<h;f++)if("number"===typeof m[f]&&0<=m[f]){for(;a.aoColumns.length<=m[f];)o(a);d(m[f],b[g])}else if("number"===typeof m[f]&&0>m[f])d(a.aoColumns.length+m[f],b[g]);else if("string"===typeof m[f]){e=0;for(s=a.aoColumns.length;e<s;e++)("_all"==m[f]||i(a.aoColumns[e].nTh).hasClass(m[f]))&&d(e,b[g])}}if(c){g=0;for(a=c.length;g<a;g++)d(g,c[g])}}function H(a,b){var c;c=i.isArray(b)?b.slice():i.extend(!0,{},b);var d=a.aoData.length,
 
g=i.extend(!0,{},j.models.oRow);g._aData=c;a.aoData.push(g);for(var f,g=0,h=a.aoColumns.length;g<h;g++)c=a.aoColumns[g],"function"===typeof c.fnRender&&c.bUseRendered&&null!==c.mDataProp?I(a,d,g,R(a,d,g)):I(a,d,g,w(a,d,g)),c._bAutoType&&"string"!=c.sType&&(f=w(a,d,g,"type"),null!==f&&""!==f&&(f=z(f),null===c.sType?c.sType=f:c.sType!=f&&"html"!=c.sType&&(c.sType="string")));a.aiDisplayMaster.push(d);a.oFeatures.bDeferRender||ca(a,d);return d}function ua(a){var b,c,d,g,f,h,e,s,m;if(a.bDeferLoading||
 
null===a.sAjaxSource){e=a.nTBody.childNodes;b=0;for(c=e.length;b<c;b++)if("TR"==e[b].nodeName.toUpperCase()){s=a.aoData.length;e[b]._DT_RowIndex=s;a.aoData.push(i.extend(!0,{},j.models.oRow,{nTr:e[b]}));a.aiDisplayMaster.push(s);h=e[b].childNodes;d=f=0;for(g=h.length;d<g;d++)if(m=h[d].nodeName.toUpperCase(),"TD"==m||"TH"==m)I(a,s,f,i.trim(h[d].innerHTML)),f++}}e=S(a);h=[];b=0;for(c=e.length;b<c;b++){d=0;for(g=e[b].childNodes.length;d<g;d++)f=e[b].childNodes[d],m=f.nodeName.toUpperCase(),("TD"==m||
 
"TH"==m)&&h.push(f)}g=0;for(e=a.aoColumns.length;g<e;g++){m=a.aoColumns[g];null===m.sTitle&&(m.sTitle=m.nTh.innerHTML);f=m._bAutoType;s="function"===typeof m.fnRender;var o=null!==m.sClass,k=m.bVisible,n,r;if(f||s||o||!k){b=0;for(c=a.aoData.length;b<c;b++)d=a.aoData[b],n=h[b*e+g],f&&"string"!=m.sType&&(r=w(a,b,g,"type"),""!==r&&(r=z(r),null===m.sType?m.sType=r:m.sType!=r&&"html"!=m.sType&&(m.sType="string"))),"function"===typeof m.mDataProp&&(n.innerHTML=w(a,b,g,"display")),s&&(r=R(a,b,g),n.innerHTML=
 
r,m.bUseRendered&&I(a,b,g,r)),o&&(n.className+=" "+m.sClass),k?d._anHidden[g]=null:(d._anHidden[g]=n,n.parentNode.removeChild(n)),m.fnCreatedCell&&m.fnCreatedCell.call(a.oInstance,n,w(a,b,g,"display"),d._aData,b,g)}}if(0!==a.aoRowCreatedCallback.length){b=0;for(c=a.aoData.length;b<c;b++)d=a.aoData[b],C(a,"aoRowCreatedCallback",null,[d.nTr,d._aData,b])}}function K(a,b){return b._DT_RowIndex!==n?b._DT_RowIndex:null}function da(a,b,c){for(var b=L(a,b),d=0,a=a.aoColumns.length;d<a;d++)if(b[d]===c)return d;
 
return-1}function X(a,b,c){for(var d=[],g=0,f=a.aoColumns.length;g<f;g++)d.push(w(a,b,g,c));return d}function w(a,b,c,d){var g=a.aoColumns[c];if((c=g.fnGetData(a.aoData[b]._aData,d))===n)return a.iDrawError!=a.iDraw&&null===g.sDefaultContent&&(E(a,0,"Requested unknown parameter "+("function"==typeof g.mDataProp?"{mDataprop function}":"'"+g.mDataProp+"'")+" from the data source for row "+b),a.iDrawError=a.iDraw),g.sDefaultContent;if(null===c&&null!==g.sDefaultContent)c=g.sDefaultContent;else if("function"===
 
typeof c)return c();return"display"==d&&null===c?"":c}function I(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,d)}function W(a){if(null===a)return function(){return null};if("function"===typeof a)return function(b,d){return a(b,d)};if("string"===typeof a&&-1!=a.indexOf(".")){var b=a.split(".");return function(a){for(var d=0,g=b.length;d<g;d++)if(a=a[b[d]],a===n)return n;return a}}return function(b){return b[a]}}function ta(a){if(null===a)return function(){};if("function"===typeof a)return function(b,
 
d){a(b,"set",d)};if("string"===typeof a&&-1!=a.indexOf(".")){var b=a.split(".");return function(a,d){for(var g=0,f=b.length-1;g<f;g++)a[b[g]]===n&&(a[b[g]]={}),a=a[b[g]];a[b[b.length-1]]=d}}return function(b,d){b[a]=d}}function Y(a){for(var b=[],c=a.aoData.length,d=0;d<c;d++)b.push(a.aoData[d]._aData);return b}function ea(a){a.aoData.splice(0,a.aoData.length);a.aiDisplayMaster.splice(0,a.aiDisplayMaster.length);a.aiDisplay.splice(0,a.aiDisplay.length);A(a)}function fa(a,b){for(var c=-1,d=0,g=a.length;d<
 
g;d++)a[d]==b?c=d:a[d]>b&&a[d]--; -1!=c&&a.splice(c,1)}function R(a,b,c){var d=a.aoColumns[c];return d.fnRender({iDataRow:b,iDataColumn:c,oSettings:a,aData:a.aoData[b]._aData,mDataProp:d.mDataProp},w(a,b,c,"display"))}function ca(a,b){var c=a.aoData[b],d;if(null===c.nTr){c.nTr=l.createElement("tr");c.nTr._DT_RowIndex=b;c._aData.DT_RowId&&(c.nTr.id=c._aData.DT_RowId);c._aData.DT_RowClass&&i(c.nTr).addClass(c._aData.DT_RowClass);for(var g=0,f=a.aoColumns.length;g<f;g++){var h=a.aoColumns[g];d=l.createElement(h.sCellType);
 
d.innerHTML="function"===typeof h.fnRender&&(!h.bUseRendered||null===h.mDataProp)?R(a,b,g):w(a,b,g,"display");null!==h.sClass&&(d.className=h.sClass);h.bVisible?(c.nTr.appendChild(d),c._anHidden[g]=null):c._anHidden[g]=d;h.fnCreatedCell&&h.fnCreatedCell.call(a.oInstance,d,w(a,b,g,"display"),c._aData,b,g)}C(a,"aoRowCreatedCallback",null,[c.nTr,c._aData,b])}}function va(a){var b,c,d;if(0!==a.nTHead.getElementsByTagName("th").length){b=0;for(d=a.aoColumns.length;b<d;b++)if(c=a.aoColumns[b].nTh,c.setAttribute("role",
 
"columnheader"),a.aoColumns[b].bSortable&&(c.setAttribute("tabindex",a.iTabIndex),c.setAttribute("aria-controls",a.sTableId)),null!==a.aoColumns[b].sClass&&i(c).addClass(a.aoColumns[b].sClass),a.aoColumns[b].sTitle!=c.innerHTML)c.innerHTML=a.aoColumns[b].sTitle}else{var g=l.createElement("tr");b=0;for(d=a.aoColumns.length;b<d;b++)c=a.aoColumns[b].nTh,c.innerHTML=a.aoColumns[b].sTitle,c.setAttribute("tabindex","0"),null!==a.aoColumns[b].sClass&&i(c).addClass(a.aoColumns[b].sClass),g.appendChild(c);
 
i(a.nTHead).html("")[0].appendChild(g);T(a.aoHeader,a.nTHead)}i(a.nTHead).children("tr").attr("role","row");if(a.bJUI){b=0;for(d=a.aoColumns.length;b<d;b++){c=a.aoColumns[b].nTh;g=l.createElement("div");g.className=a.oClasses.sSortJUIWrapper;i(c).contents().appendTo(g);var f=l.createElement("span");f.className=a.oClasses.sSortIcon;g.appendChild(f);c.appendChild(g)}}if(a.oFeatures.bSort)for(b=0;b<a.aoColumns.length;b++)!1!==a.aoColumns[b].bSortable?ga(a,a.aoColumns[b].nTh,b):i(a.aoColumns[b].nTh).addClass(a.oClasses.sSortableNone);
 
""!==a.oClasses.sFooterTH&&i(a.nTFoot).children("tr").children("th").addClass(a.oClasses.sFooterTH);if(null!==a.nTFoot){c=O(a,null,a.aoFooter);b=0;for(d=a.aoColumns.length;b<d;b++)c[b]&&(a.aoColumns[b].nTf=c[b],a.aoColumns[b].sClass&&i(c[b]).addClass(a.aoColumns[b].sClass))}}function U(a,b,c){var d,g,f,h=[],e=[],i=a.aoColumns.length,m;c===n&&(c=!1);d=0;for(g=b.length;d<g;d++){h[d]=b[d].slice();h[d].nTr=b[d].nTr;for(f=i-1;0<=f;f--)!a.aoColumns[f].bVisible&&!c&&h[d].splice(f,1);e.push([])}d=0;for(g=
 
h.length;d<g;d++){if(a=h[d].nTr)for(;f=a.firstChild;)a.removeChild(f);f=0;for(b=h[d].length;f<b;f++)if(m=i=1,e[d][f]===n){a.appendChild(h[d][f].cell);for(e[d][f]=1;h[d+i]!==n&&h[d][f].cell==h[d+i][f].cell;)e[d+i][f]=1,i++;for(;h[d][f+m]!==n&&h[d][f].cell==h[d][f+m].cell;){for(c=0;c<i;c++)e[d+c][f+m]=1;m++}h[d][f].cell.rowSpan=i;h[d][f].cell.colSpan=m}}}function y(a){var b=C(a,"aoPreDrawCallback","preDraw",[a]);if(-1!==i.inArray(!1,b))F(a,!1);else{var c,d,b=[],g=0,f=a.asStripeClasses.length;c=a.aoOpenRows.length;
 
a.bDrawing=!0;a.iInitDisplayStart!==n&&-1!=a.iInitDisplayStart&&(a._iDisplayStart=a.oFeatures.bServerSide?a.iInitDisplayStart:a.iInitDisplayStart>=a.fnRecordsDisplay()?0:a.iInitDisplayStart,a.iInitDisplayStart=-1,A(a));if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++;else if(a.oFeatures.bServerSide){if(!a.bDestroying&&!wa(a))return}else a.iDraw++;if(0!==a.aiDisplay.length){var h=a._iDisplayStart;d=a._iDisplayEnd;a.oFeatures.bServerSide&&(h=0,d=a.aoData.length);for(;h<d;h++){var e=a.aoData[a.aiDisplay[h]];
 
null===e.nTr&&ca(a,a.aiDisplay[h]);var s=e.nTr;if(0!==f){var m=a.asStripeClasses[g%f];e._sRowStripe!=m&&(i(s).removeClass(e._sRowStripe).addClass(m),e._sRowStripe=m)}C(a,"aoRowCallback",null,[s,a.aoData[a.aiDisplay[h]]._aData,g,h]);b.push(s);g++;if(0!==c)for(e=0;e<c;e++)if(s==a.aoOpenRows[e].nParent){b.push(a.aoOpenRows[e].nTr);break}}}else b[0]=l.createElement("tr"),a.asStripeClasses[0]&&(b[0].className=a.asStripeClasses[0]),c=a.oLanguage,f=c.sZeroRecords,1==a.iDraw&&null!==a.sAjaxSource&&!a.oFeatures.bServerSide?
 
f=c.sLoadingRecords:c.sEmptyTable&&0===a.fnRecordsTotal()&&(f=c.sEmptyTable),c=l.createElement("td"),c.setAttribute("valign","top"),c.colSpan=v(a),c.className=a.oClasses.sRowEmpty,c.innerHTML=ha(a,f),b[g].appendChild(c);C(a,"aoHeaderCallback","header",[i(a.nTHead).children("tr")[0],Y(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay]);C(a,"aoFooterCallback","footer",[i(a.nTFoot).children("tr")[0],Y(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay]);g=l.createDocumentFragment();c=l.createDocumentFragment();
 
if(a.nTBody){f=a.nTBody.parentNode;c.appendChild(a.nTBody);if(!a.oScroll.bInfinite||!a._bInitComplete||a.bSorted||a.bFiltered)for(;c=a.nTBody.firstChild;)a.nTBody.removeChild(c);c=0;for(d=b.length;c<d;c++)g.appendChild(b[c]);a.nTBody.appendChild(g);null!==f&&f.appendChild(a.nTBody)}C(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1;a.oFeatures.bServerSide&&(F(a,!1),a._bInitComplete||Z(a))}}function $(a){a.oFeatures.bSort?P(a,a.oPreviousSearch):a.oFeatures.bFilter?M(a,a.oPreviousSearch):
 
(A(a),y(a))}function xa(a){var b=i("<div></div>")[0];a.nTable.parentNode.insertBefore(b,a.nTable);a.nTableWrapper=i('<div id="'+a.sTableId+'_wrapper" class="'+a.oClasses.sWrapper+'" role="grid"></div>')[0];a.nTableReinsertBefore=a.nTable.nextSibling;for(var c=a.nTableWrapper,d=a.sDom.split(""),g,f,h,e,s,m,o,k=0;k<d.length;k++){f=0;h=d[k];if("<"==h){e=i("<div></div>")[0];s=d[k+1];if("'"==s||'"'==s){m="";for(o=2;d[k+o]!=s;)m+=d[k+o],o++;"H"==m?m=a.oClasses.sJUIHeader:"F"==m&&(m=a.oClasses.sJUIFooter);
 
-1!=m.indexOf(".")?(s=m.split("."),e.id=s[0].substr(1,s[0].length-1),e.className=s[1]):"#"==m.charAt(0)?e.id=m.substr(1,m.length-1):e.className=m;k+=o}c.appendChild(e);c=e}else if(">"==h)c=c.parentNode;else if("l"==h&&a.oFeatures.bPaginate&&a.oFeatures.bLengthChange)g=ya(a),f=1;else if("f"==h&&a.oFeatures.bFilter)g=za(a),f=1;else if("r"==h&&a.oFeatures.bProcessing)g=Aa(a),f=1;else if("t"==h)g=Ba(a),f=1;else if("i"==h&&a.oFeatures.bInfo)g=Ca(a),f=1;else if("p"==h&&a.oFeatures.bPaginate)g=Da(a),f=1;
 
else if(0!==j.ext.aoFeatures.length){e=j.ext.aoFeatures;o=0;for(s=e.length;o<s;o++)if(h==e[o].cFeature){(g=e[o].fnInit(a))&&(f=1);break}}1==f&&null!==g&&("object"!==typeof a.aanFeatures[h]&&(a.aanFeatures[h]=[]),a.aanFeatures[h].push(g),c.appendChild(g))}b.parentNode.replaceChild(a.nTableWrapper,b)}function T(a,b){var c=i(b).children("tr"),d,g,f,h,e,s,m,j;a.splice(0,a.length);g=0;for(s=c.length;g<s;g++)a.push([]);g=0;for(s=c.length;g<s;g++){f=0;for(m=c[g].childNodes.length;f<m;f++)if(d=c[g].childNodes[f],
 
"TD"==d.nodeName.toUpperCase()||"TH"==d.nodeName.toUpperCase()){var o=1*d.getAttribute("colspan"),k=1*d.getAttribute("rowspan"),o=!o||0===o||1===o?1:o,k=!k||0===k||1===k?1:k;for(h=0;a[g][h];)h++;j=h;for(e=0;e<o;e++)for(h=0;h<k;h++)a[g+h][j+e]={cell:d,unique:1==o?!0:!1},a[g+h].nTr=c[g]}}}function O(a,b,c){var d=[];c||(c=a.aoHeader,b&&(c=[],T(c,b)));for(var b=0,g=c.length;b<g;b++)for(var f=0,h=c[b].length;f<h;f++)if(c[b][f].unique&&(!d[f]||!a.bSortCellsTop))d[f]=c[b][f].cell;return d}function wa(a){if(a.bAjaxDataGet){a.iDraw++;
 
F(a,!0);var b=Ea(a);ia(a,b);a.fnServerData.call(a.oInstance,a.sAjaxSource,b,function(b){Fa(a,b)},a);return!1}return!0}function Ea(a){var b=a.aoColumns.length,c=[],d,g,f,h;c.push({name:"sEcho",value:a.iDraw});c.push({name:"iColumns",value:b});c.push({name:"sColumns",value:x(a)});c.push({name:"iDisplayStart",value:a._iDisplayStart});c.push({name:"iDisplayLength",value:!1!==a.oFeatures.bPaginate?a._iDisplayLength:-1});for(f=0;f<b;f++)d=a.aoColumns[f].mDataProp,c.push({name:"mDataProp_"+f,value:"function"===
 
typeof d?"function":d});if(!1!==a.oFeatures.bFilter){c.push({name:"sSearch",value:a.oPreviousSearch.sSearch});c.push({name:"bRegex",value:a.oPreviousSearch.bRegex});for(f=0;f<b;f++)c.push({name:"sSearch_"+f,value:a.aoPreSearchCols[f].sSearch}),c.push({name:"bRegex_"+f,value:a.aoPreSearchCols[f].bRegex}),c.push({name:"bSearchable_"+f,value:a.aoColumns[f].bSearchable})}if(!1!==a.oFeatures.bSort){var e=0;d=null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(f=0;f<d.length;f++){g=
 
a.aoColumns[d[f][0]].aDataSort;for(h=0;h<g.length;h++)c.push({name:"iSortCol_"+e,value:g[h]}),c.push({name:"sSortDir_"+e,value:d[f][1]}),e++}c.push({name:"iSortingCols",value:e});for(f=0;f<b;f++)c.push({name:"bSortable_"+f,value:a.aoColumns[f].bSortable})}return c}function ia(a,b){C(a,"aoServerParams","serverParams",[b])}function Fa(a,b){if(b.sEcho!==n){if(1*b.sEcho<a.iDraw)return;a.iDraw=1*b.sEcho}(!a.oScroll.bInfinite||a.oScroll.bInfinite&&(a.bSorted||a.bFiltered))&&ea(a);a._iRecordsTotal=parseInt(b.iTotalRecords,
 
10);a._iRecordsDisplay=parseInt(b.iTotalDisplayRecords,10);var c=x(a),c=b.sColumns!==n&&""!==c&&b.sColumns!=c,d;c&&(d=D(a,b.sColumns));for(var g=W(a.sAjaxDataProp)(b),f=0,h=g.length;f<h;f++)if(c){for(var e=[],i=0,m=a.aoColumns.length;i<m;i++)e.push(g[f][d[i]]);H(a,e)}else H(a,g[f]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=!1;y(a);a.bAjaxDataGet=!0;F(a,!1)}function za(a){var b=a.oPreviousSearch,c=a.oLanguage.sSearch,c=-1!==c.indexOf("_INPUT_")?c.replace("_INPUT_",'<input type="text" />'):
 
""===c?'<input type="text" />':c+' <input type="text" />',d=l.createElement("div");d.className=a.oClasses.sFilter;d.innerHTML="<label>"+c+"</label>";a.aanFeatures.f||(d.id=a.sTableId+"_filter");c=i('input[type="text"]',d);d._DT_Input=c[0];c.val(b.sSearch.replace('"',"&quot;"));c.bind("keyup.DT",function(){for(var c=a.aanFeatures.f,d=this.value===""?"":this.value,h=0,e=c.length;h<e;h++)c[h]!=i(this).parents("div.dataTables_filter")[0]&&i(c[h]._DT_Input).val(d);d!=b.sSearch&&M(a,{sSearch:d,bRegex:b.bRegex,
 
bSmart:b.bSmart,bCaseInsensitive:b.bCaseInsensitive})});c.attr("aria-controls",a.sTableId).bind("keypress.DT",function(a){if(a.keyCode==13)return false});return d}function M(a,b,c){var d=a.oPreviousSearch,g=a.aoPreSearchCols,f=function(a){d.sSearch=a.sSearch;d.bRegex=a.bRegex;d.bSmart=a.bSmart;d.bCaseInsensitive=a.bCaseInsensitive};if(a.oFeatures.bServerSide)f(b);else{Ga(a,b.sSearch,c,b.bRegex,b.bSmart,b.bCaseInsensitive);f(b);for(b=0;b<a.aoPreSearchCols.length;b++)Ha(a,g[b].sSearch,b,g[b].bRegex,
 
g[b].bSmart,g[b].bCaseInsensitive);Ia(a)}a.bFiltered=!0;i(a.oInstance).trigger("filter",a);a._iDisplayStart=0;A(a);y(a);ja(a,0)}function Ia(a){for(var b=j.ext.afnFiltering,c=0,d=b.length;c<d;c++)for(var g=0,f=0,h=a.aiDisplay.length;f<h;f++){var e=a.aiDisplay[f-g];b[c](a,X(a,e,"filter"),e)||(a.aiDisplay.splice(f-g,1),g++)}}function Ha(a,b,c,d,g,f){if(""!==b)for(var h=0,b=ka(b,d,g,f),d=a.aiDisplay.length-1;0<=d;d--)g=la(w(a,a.aiDisplay[d],c,"filter"),a.aoColumns[c].sType),b.test(g)||(a.aiDisplay.splice(d,
 
1),h++)}function Ga(a,b,c,d,g,f){d=ka(b,d,g,f);g=a.oPreviousSearch;c||(c=0);0!==j.ext.afnFiltering.length&&(c=1);if(0>=b.length)a.aiDisplay.splice(0,a.aiDisplay.length),a.aiDisplay=a.aiDisplayMaster.slice();else if(a.aiDisplay.length==a.aiDisplayMaster.length||g.sSearch.length>b.length||1==c||0!==b.indexOf(g.sSearch)){a.aiDisplay.splice(0,a.aiDisplay.length);ja(a,1);for(b=0;b<a.aiDisplayMaster.length;b++)d.test(a.asDataSearch[b])&&a.aiDisplay.push(a.aiDisplayMaster[b])}else for(b=c=0;b<a.asDataSearch.length;b++)d.test(a.asDataSearch[b])||
 
(a.aiDisplay.splice(b-c,1),c++)}function ja(a,b){if(!a.oFeatures.bServerSide){a.asDataSearch.splice(0,a.asDataSearch.length);for(var c=b&&1===b?a.aiDisplayMaster:a.aiDisplay,d=0,g=c.length;d<g;d++)a.asDataSearch[d]=ma(a,X(a,c[d],"filter"))}}function ma(a,b){var c="";a.__nTmpFilter===n&&(a.__nTmpFilter=l.createElement("div"));for(var d=a.__nTmpFilter,g=0,f=a.aoColumns.length;g<f;g++)a.aoColumns[g].bSearchable&&(c+=la(b[g],a.aoColumns[g].sType)+"  ");-1!==c.indexOf("&")&&(d.innerHTML=c,c=d.textContent?
 
d.textContent:d.innerText,c=c.replace(/\n/g," ").replace(/\r/g,""));return c}function ka(a,b,c,d){if(c)return a=b?a.split(" "):na(a).split(" "),a="^(?=.*?"+a.join(")(?=.*?")+").*$",RegExp(a,d?"i":"");a=b?a:na(a);return RegExp(a,d?"i":"")}function la(a,b){return"function"===typeof j.ext.ofnSearch[b]?j.ext.ofnSearch[b](a):null===a?"":"html"==b?a.replace(/[\r\n]/g," ").replace(/<.*?>/g,""):"string"===typeof a?a.replace(/[\r\n]/g," "):a}function na(a){return a.replace(RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^|\\-)",
 
"g"),"\\$1")}function Ca(a){var b=l.createElement("div");b.className=a.oClasses.sInfo;a.aanFeatures.i||(a.aoDrawCallback.push({fn:Ja,sName:"information"}),b.id=a.sTableId+"_info");a.nTable.setAttribute("aria-describedby",a.sTableId+"_info");return b}function Ja(a){if(a.oFeatures.bInfo&&0!==a.aanFeatures.i.length){var b=a.oLanguage,c=a._iDisplayStart+1,d=a.fnDisplayEnd(),g=a.fnRecordsTotal(),f=a.fnRecordsDisplay(),h;h=0===f&&f==g?b.sInfoEmpty:0===f?b.sInfoEmpty+" "+b.sInfoFiltered:f==g?b.sInfo:b.sInfo+
 
" "+b.sInfoFiltered;h+=b.sInfoPostFix;h=ha(a,h);null!==b.fnInfoCallback&&(h=b.fnInfoCallback.call(a.oInstance,a,c,d,g,f,h));a=a.aanFeatures.i;b=0;for(c=a.length;b<c;b++)i(a[b]).html(h)}}function ha(a,b){var c=a.fnFormatNumber(a._iDisplayStart+1),d=a.fnDisplayEnd(),d=a.fnFormatNumber(d),g=a.fnRecordsDisplay(),g=a.fnFormatNumber(g),f=a.fnRecordsTotal(),f=a.fnFormatNumber(f);a.oScroll.bInfinite&&(c=a.fnFormatNumber(1));return b.replace("_START_",c).replace("_END_",d).replace("_TOTAL_",g).replace("_MAX_",
 
f)}function aa(a){var b,c,d=a.iInitDisplayStart;if(!1===a.bInitialised)setTimeout(function(){aa(a)},200);else{xa(a);va(a);U(a,a.aoHeader);a.nTFoot&&U(a,a.aoFooter);F(a,!0);a.oFeatures.bAutoWidth&&ba(a);b=0;for(c=a.aoColumns.length;b<c;b++)null!==a.aoColumns[b].sWidth&&(a.aoColumns[b].nTh.style.width=q(a.aoColumns[b].sWidth));a.oFeatures.bSort?P(a):a.oFeatures.bFilter?M(a,a.oPreviousSearch):(a.aiDisplay=a.aiDisplayMaster.slice(),A(a),y(a));null!==a.sAjaxSource&&!a.oFeatures.bServerSide?(c=[],ia(a,
 
c),a.fnServerData.call(a.oInstance,a.sAjaxSource,c,function(c){var f=a.sAjaxDataProp!==""?W(a.sAjaxDataProp)(c):c;for(b=0;b<f.length;b++)H(a,f[b]);a.iInitDisplayStart=d;if(a.oFeatures.bSort)P(a);else{a.aiDisplay=a.aiDisplayMaster.slice();A(a);y(a)}F(a,false);Z(a,c)},a)):a.oFeatures.bServerSide||(F(a,!1),Z(a))}}function Z(a,b){a._bInitComplete=!0;C(a,"aoInitComplete","init",[a,b])}function oa(a){var b=j.defaults.oLanguage;!a.sEmptyTable&&(a.sZeroRecords&&"No data available in table"===b.sEmptyTable)&&
 
p(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&(a.sZeroRecords&&"Loading..."===b.sLoadingRecords)&&p(a,a,"sZeroRecords","sLoadingRecords")}function ya(a){if(a.oScroll.bInfinite)return null;var b='<select size="1" '+('name="'+a.sTableId+'_length"')+">",c,d,g=a.aLengthMenu;if(2==g.length&&"object"===typeof g[0]&&"object"===typeof g[1]){c=0;for(d=g[0].length;c<d;c++)b+='<option value="'+g[0][c]+'">'+g[1][c]+"</option>"}else{c=0;for(d=g.length;c<d;c++)b+='<option value="'+g[c]+'">'+g[c]+"</option>"}b+=
 
"</select>";g=l.createElement("div");a.aanFeatures.l||(g.id=a.sTableId+"_length");g.className=a.oClasses.sLength;g.innerHTML="<label>"+a.oLanguage.sLengthMenu.replace("_MENU_",b)+"</label>";i('select option[value="'+a._iDisplayLength+'"]',g).attr("selected",!0);i("select",g).bind("change.DT",function(){var b=i(this).val(),g=a.aanFeatures.l;c=0;for(d=g.length;c<d;c++)g[c]!=this.parentNode&&i("select",g[c]).val(b);a._iDisplayLength=parseInt(b,10);A(a);if(a.fnDisplayEnd()==a.fnRecordsDisplay()){a._iDisplayStart=
 
a.fnDisplayEnd()-a._iDisplayLength;if(a._iDisplayStart<0)a._iDisplayStart=0}if(a._iDisplayLength==-1)a._iDisplayStart=0;y(a)});i("select",g).attr("aria-controls",a.sTableId);return g}function A(a){a._iDisplayEnd=!1===a.oFeatures.bPaginate?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength>a.aiDisplay.length||-1==a._iDisplayLength?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength}function Da(a){if(a.oScroll.bInfinite)return null;var b=l.createElement("div");b.className=a.oClasses.sPaging+a.sPaginationType;
 
j.ext.oPagination[a.sPaginationType].fnInit(a,b,function(a){A(a);y(a)});a.aanFeatures.p||a.aoDrawCallback.push({fn:function(a){j.ext.oPagination[a.sPaginationType].fnUpdate(a,function(a){A(a);y(a)})},sName:"pagination"});return b}function pa(a,b){var c=a._iDisplayStart;if("number"===typeof b)a._iDisplayStart=b*a._iDisplayLength,a._iDisplayStart>a.fnRecordsDisplay()&&(a._iDisplayStart=0);else if("first"==b)a._iDisplayStart=0;else if("previous"==b)a._iDisplayStart=0<=a._iDisplayLength?a._iDisplayStart-
 
a._iDisplayLength:0,0>a._iDisplayStart&&(a._iDisplayStart=0);else if("next"==b)0<=a._iDisplayLength?a._iDisplayStart+a._iDisplayLength<a.fnRecordsDisplay()&&(a._iDisplayStart+=a._iDisplayLength):a._iDisplayStart=0;else if("last"==b)if(0<=a._iDisplayLength){var d=parseInt((a.fnRecordsDisplay()-1)/a._iDisplayLength,10)+1;a._iDisplayStart=(d-1)*a._iDisplayLength}else a._iDisplayStart=0;else E(a,0,"Unknown paging action: "+b);i(a.oInstance).trigger("page",a);return c!=a._iDisplayStart}function Aa(a){var b=
 
l.createElement("div");a.aanFeatures.r||(b.id=a.sTableId+"_processing");b.innerHTML=a.oLanguage.sProcessing;b.className=a.oClasses.sProcessing;a.nTable.parentNode.insertBefore(b,a.nTable);return b}function F(a,b){if(a.oFeatures.bProcessing)for(var c=a.aanFeatures.r,d=0,g=c.length;d<g;d++)c[d].style.visibility=b?"visible":"hidden";i(a.oInstance).trigger("processing",[a,b])}function Ba(a){if(""===a.oScroll.sX&&""===a.oScroll.sY)return a.nTable;var b=l.createElement("div"),c=l.createElement("div"),d=
 
l.createElement("div"),g=l.createElement("div"),f=l.createElement("div"),h=l.createElement("div"),e=a.nTable.cloneNode(!1),j=a.nTable.cloneNode(!1),m=a.nTable.getElementsByTagName("thead")[0],o=0===a.nTable.getElementsByTagName("tfoot").length?null:a.nTable.getElementsByTagName("tfoot")[0],k=a.oClasses;c.appendChild(d);f.appendChild(h);g.appendChild(a.nTable);b.appendChild(c);b.appendChild(g);d.appendChild(e);e.appendChild(m);null!==o&&(b.appendChild(f),h.appendChild(j),j.appendChild(o));b.className=
 
k.sScrollWrapper;c.className=k.sScrollHead;d.className=k.sScrollHeadInner;g.className=k.sScrollBody;f.className=k.sScrollFoot;h.className=k.sScrollFootInner;a.oScroll.bAutoCss&&(c.style.overflow="hidden",c.style.position="relative",f.style.overflow="hidden",g.style.overflow="auto");c.style.border="0";c.style.width="100%";f.style.border="0";d.style.width=""!==a.oScroll.sXInner?a.oScroll.sXInner:"100%";e.removeAttribute("id");e.style.marginLeft="0";a.nTable.style.marginLeft="0";null!==o&&(j.removeAttribute("id"),
 
j.style.marginLeft="0");d=i(a.nTable).children("caption");0<d.length&&(d=d[0],"top"===d._captionSide?e.appendChild(d):"bottom"===d._captionSide&&o&&j.appendChild(d));""!==a.oScroll.sX&&(c.style.width=q(a.oScroll.sX),g.style.width=q(a.oScroll.sX),null!==o&&(f.style.width=q(a.oScroll.sX)),i(g).scroll(function(){c.scrollLeft=this.scrollLeft;if(o!==null)f.scrollLeft=this.scrollLeft}));""!==a.oScroll.sY&&(g.style.height=q(a.oScroll.sY));a.aoDrawCallback.push({fn:Ka,sName:"scrolling"});a.oScroll.bInfinite&&
 
i(g).scroll(function(){if(!a.bDrawing&&i(this).scrollTop()!==0&&i(this).scrollTop()+i(this).height()>i(a.nTable).height()-a.oScroll.iLoadGap&&a.fnDisplayEnd()<a.fnRecordsDisplay()){pa(a,"next");A(a);y(a)}});a.nScrollHead=c;a.nScrollFoot=f;return b}function Ka(a){var b=a.nScrollHead.getElementsByTagName("div")[0],c=b.getElementsByTagName("table")[0],d=a.nTable.parentNode,g,f,h,e,j,m,o,k,n=[],r=null!==a.nTFoot?a.nScrollFoot.getElementsByTagName("div")[0]:null,p=null!==a.nTFoot?r.getElementsByTagName("table")[0]:
 
null,l=i.browser.msie&&7>=i.browser.version;i(a.nTable).children("thead, tfoot").remove();h=i(a.nTHead).clone()[0];a.nTable.insertBefore(h,a.nTable.childNodes[0]);null!==a.nTFoot&&(j=i(a.nTFoot).clone()[0],a.nTable.insertBefore(j,a.nTable.childNodes[1]));""===a.oScroll.sX&&(d.style.width="100%",b.parentNode.style.width="100%");var t=O(a,h);g=0;for(f=t.length;g<f;g++)o=G(a,g),t[g].style.width=a.aoColumns[o].sWidth;null!==a.nTFoot&&N(function(a){a.style.width=""},j.getElementsByTagName("tr"));a.oScroll.bCollapse&&
 
""!==a.oScroll.sY&&(d.style.height=d.offsetHeight+a.nTHead.offsetHeight+"px");g=i(a.nTable).outerWidth();if(""===a.oScroll.sX){if(a.nTable.style.width="100%",l&&(i("tbody",d).height()>d.offsetHeight||"scroll"==i(d).css("overflow-y")))a.nTable.style.width=q(i(a.nTable).outerWidth()-a.oScroll.iBarWidth)}else""!==a.oScroll.sXInner?a.nTable.style.width=q(a.oScroll.sXInner):g==i(d).width()&&i(d).height()<i(a.nTable).height()?(a.nTable.style.width=q(g-a.oScroll.iBarWidth),i(a.nTable).outerWidth()>g-a.oScroll.iBarWidth&&
 
(a.nTable.style.width=q(g))):a.nTable.style.width=q(g);g=i(a.nTable).outerWidth();f=a.nTHead.getElementsByTagName("tr");h=h.getElementsByTagName("tr");N(function(a,b){m=a.style;m.paddingTop="0";m.paddingBottom="0";m.borderTopWidth="0";m.borderBottomWidth="0";m.height=0;k=i(a).width();b.style.width=q(k);n.push(k)},h,f);i(h).height(0);null!==a.nTFoot&&(e=j.getElementsByTagName("tr"),j=a.nTFoot.getElementsByTagName("tr"),N(function(a,b){m=a.style;m.paddingTop="0";m.paddingBottom="0";m.borderTopWidth=
 
"0";m.borderBottomWidth="0";m.height=0;k=i(a).width();b.style.width=q(k);n.push(k)},e,j),i(e).height(0));N(function(a){a.innerHTML="";a.style.width=q(n.shift())},h);null!==a.nTFoot&&N(function(a){a.innerHTML="";a.style.width=q(n.shift())},e);if(i(a.nTable).outerWidth()<g){e=d.scrollHeight>d.offsetHeight||"scroll"==i(d).css("overflow-y")?g+a.oScroll.iBarWidth:g;if(l&&(d.scrollHeight>d.offsetHeight||"scroll"==i(d).css("overflow-y")))a.nTable.style.width=q(e-a.oScroll.iBarWidth);d.style.width=q(e);b.parentNode.style.width=
 
q(e);null!==a.nTFoot&&(r.parentNode.style.width=q(e));""===a.oScroll.sX?E(a,1,"The table cannot fit into the current element which will cause column misalignment. The table has been drawn at its minimum possible width."):""!==a.oScroll.sXInner&&E(a,1,"The table cannot fit into the current element which will cause column misalignment. Increase the sScrollXInner value or remove it to allow automatic calculation")}else d.style.width=q("100%"),b.parentNode.style.width=q("100%"),null!==a.nTFoot&&(r.parentNode.style.width=
 
q("100%"));""===a.oScroll.sY&&l&&(d.style.height=q(a.nTable.offsetHeight+a.oScroll.iBarWidth));""!==a.oScroll.sY&&a.oScroll.bCollapse&&(d.style.height=q(a.oScroll.sY),l=""!==a.oScroll.sX&&a.nTable.offsetWidth>d.offsetWidth?a.oScroll.iBarWidth:0,a.nTable.offsetHeight<d.offsetHeight&&(d.style.height=q(a.nTable.offsetHeight+l)));l=i(a.nTable).outerWidth();c.style.width=q(l);b.style.width=q(l);c=i(a.nTable).height()>d.clientHeight||"scroll"==i(d).css("overflow-y");b.style.paddingRight=c?a.oScroll.iBarWidth+
 
"px":"0px";null!==a.nTFoot&&(p.style.width=q(l),r.style.width=q(l),r.style.paddingRight=c?a.oScroll.iBarWidth+"px":"0px");i(d).scroll();if(a.bSorted||a.bFiltered)d.scrollTop=0}function N(a,b,c){for(var d=0,g=b.length;d<g;d++)for(var f=0,h=b[d].childNodes.length;f<h;f++)1==b[d].childNodes[f].nodeType&&(c?a(b[d].childNodes[f],c[d].childNodes[f]):a(b[d].childNodes[f]))}function La(a,b){if(!a||null===a||""===a)return 0;b||(b=l.getElementsByTagName("body")[0]);var c,d=l.createElement("div");d.style.width=
 
q(a);b.appendChild(d);c=d.offsetWidth;b.removeChild(d);return c}function ba(a){var b=0,c,d=0,g=a.aoColumns.length,f,h=i("th",a.nTHead),e=a.nTable.getAttribute("width");for(f=0;f<g;f++)a.aoColumns[f].bVisible&&(d++,null!==a.aoColumns[f].sWidth&&(c=La(a.aoColumns[f].sWidthOrig,a.nTable.parentNode),null!==c&&(a.aoColumns[f].sWidth=q(c)),b++));if(g==h.length&&0===b&&d==g&&""===a.oScroll.sX&&""===a.oScroll.sY)for(f=0;f<a.aoColumns.length;f++)c=i(h[f]).width(),null!==c&&(a.aoColumns[f].sWidth=q(c));else{b=
 
a.nTable.cloneNode(!1);f=a.nTHead.cloneNode(!0);d=l.createElement("tbody");c=l.createElement("tr");b.removeAttribute("id");b.appendChild(f);null!==a.nTFoot&&(b.appendChild(a.nTFoot.cloneNode(!0)),N(function(a){a.style.width=""},b.getElementsByTagName("tr")));b.appendChild(d);d.appendChild(c);d=i("thead th",b);0===d.length&&(d=i("tbody tr:eq(0)>td",b));h=O(a,f);for(f=d=0;f<g;f++){var j=a.aoColumns[f];j.bVisible&&null!==j.sWidthOrig&&""!==j.sWidthOrig?h[f-d].style.width=q(j.sWidthOrig):j.bVisible?h[f-
 
d].style.width="":d++}for(f=0;f<g;f++)a.aoColumns[f].bVisible&&(d=Ma(a,f),null!==d&&(d=d.cloneNode(!0),""!==a.aoColumns[f].sContentPadding&&(d.innerHTML+=a.aoColumns[f].sContentPadding),c.appendChild(d)));g=a.nTable.parentNode;g.appendChild(b);""!==a.oScroll.sX&&""!==a.oScroll.sXInner?b.style.width=q(a.oScroll.sXInner):""!==a.oScroll.sX?(b.style.width="",i(b).width()<g.offsetWidth&&(b.style.width=q(g.offsetWidth))):""!==a.oScroll.sY?b.style.width=q(g.offsetWidth):e&&(b.style.width=q(e));b.style.visibility=
 
"hidden";Na(a,b);g=i("tbody tr:eq(0)",b).children();0===g.length&&(g=O(a,i("thead",b)[0]));if(""!==a.oScroll.sX){for(f=d=c=0;f<a.aoColumns.length;f++)a.aoColumns[f].bVisible&&(c=null===a.aoColumns[f].sWidthOrig?c+i(g[d]).outerWidth():c+(parseInt(a.aoColumns[f].sWidth.replace("px",""),10)+(i(g[d]).outerWidth()-i(g[d]).width())),d++);b.style.width=q(c);a.nTable.style.width=q(c)}for(f=d=0;f<a.aoColumns.length;f++)a.aoColumns[f].bVisible&&(c=i(g[d]).width(),null!==c&&0<c&&(a.aoColumns[f].sWidth=q(c)),
 
d++);g=i(b).css("width");a.nTable.style.width=-1!==g.indexOf("%")?g:q(i(b).outerWidth());b.parentNode.removeChild(b)}e&&(a.nTable.style.width=q(e))}function Na(a,b){""===a.oScroll.sX&&""!==a.oScroll.sY?(i(b).width(),b.style.width=q(i(b).outerWidth()-a.oScroll.iBarWidth)):""!==a.oScroll.sX&&(b.style.width=q(i(b).outerWidth()))}function Ma(a,b){var c=Oa(a,b);if(0>c)return null;if(null===a.aoData[c].nTr){var d=l.createElement("td");d.innerHTML=w(a,c,b,"");return d}return L(a,c)[b]}function Oa(a,b){for(var c=
 
-1,d=-1,g=0;g<a.aoData.length;g++){var f=w(a,g,b,"display")+"",f=f.replace(/<.*?>/g,"");f.length>c&&(c=f.length,d=g)}return d}function q(a){if(null===a)return"0px";if("number"==typeof a)return 0>a?"0px":a+"px";var b=a.charCodeAt(a.length-1);return 48>b||57<b?a:a+"px"}function Pa(){var a=l.createElement("p"),b=a.style;b.width="100%";b.height="200px";b.padding="0px";var c=l.createElement("div"),b=c.style;b.position="absolute";b.top="0px";b.left="0px";b.visibility="hidden";b.width="200px";b.height="150px";
 
b.padding="0px";b.overflow="hidden";c.appendChild(a);l.body.appendChild(c);b=a.offsetWidth;c.style.overflow="scroll";a=a.offsetWidth;b==a&&(a=c.clientWidth);l.body.removeChild(c);return b-a}function P(a,b){var c,d,g,f,h,e,o=[],m=[],k=j.ext.oSort,r=a.aoData,l=a.aoColumns,p=a.oLanguage.oAria;if(!a.oFeatures.bServerSide&&(0!==a.aaSorting.length||null!==a.aaSortingFixed)){o=null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(c=0;c<o.length;c++)if(d=o[c][0],g=t(a,d),f=
 
a.aoColumns[d].sSortDataType,j.ext.afnSortData[f])if(h=j.ext.afnSortData[f].call(a.oInstance,a,d,g),h.length===r.length){g=0;for(f=r.length;g<f;g++)I(a,g,d,h[g])}else E(a,0,"Returned data sort array (col "+d+") is the wrong length");c=0;for(d=a.aiDisplayMaster.length;c<d;c++)m[a.aiDisplayMaster[c]]=c;var q=o.length,G;c=0;for(d=r.length;c<d;c++)for(g=0;g<q;g++){G=l[o[g][0]].aDataSort;h=0;for(e=G.length;h<e;h++)f=l[G[h]].sType,f=k[(f?f:"string")+"-pre"],r[c]._aSortData[G[h]]=f?f(w(a,c,G[h],"sort")):
 
w(a,c,G[h],"sort")}a.aiDisplayMaster.sort(function(a,b){var c,d,g,f,h;for(c=0;c<q;c++){h=l[o[c][0]].aDataSort;d=0;for(g=h.length;d<g;d++)if(f=l[h[d]].sType,f=k[(f?f:"string")+"-"+o[c][1]](r[a]._aSortData[h[d]],r[b]._aSortData[h[d]]),0!==f)return f}return k["numeric-asc"](m[a],m[b])})}(b===n||b)&&!a.oFeatures.bDeferRender&&Q(a);c=0;for(d=a.aoColumns.length;c<d;c++)f=l[c].sTitle.replace(/<.*?>/g,""),g=l[c].nTh,g.removeAttribute("aria-sort"),g.removeAttribute("aria-label"),l[c].bSortable?0<o.length&&
 
o[0][0]==c?(g.setAttribute("aria-sort","asc"==o[0][1]?"ascending":"descending"),g.setAttribute("aria-label",f+("asc"==(l[c].asSorting[o[0][2]+1]?l[c].asSorting[o[0][2]+1]:l[c].asSorting[0])?p.sSortAscending:p.sSortDescending))):g.setAttribute("aria-label",f+("asc"==l[c].asSorting[0]?p.sSortAscending:p.sSortDescending)):g.setAttribute("aria-label",f);a.bSorted=!0;i(a.oInstance).trigger("sort",a);a.oFeatures.bFilter?M(a,a.oPreviousSearch,1):(a.aiDisplay=a.aiDisplayMaster.slice(),a._iDisplayStart=0,
 
A(a),y(a))}function ga(a,b,c,d){Qa(b,{},function(b){if(!1!==a.aoColumns[c].bSortable){var f=function(){var d,f;if(b.shiftKey){for(var e=!1,i=0;i<a.aaSorting.length;i++)if(a.aaSorting[i][0]==c){e=!0;d=a.aaSorting[i][0];f=a.aaSorting[i][2]+1;a.aoColumns[d].asSorting[f]?(a.aaSorting[i][1]=a.aoColumns[d].asSorting[f],a.aaSorting[i][2]=f):a.aaSorting.splice(i,1);break}!1===e&&a.aaSorting.push([c,a.aoColumns[c].asSorting[0],0])}else 1==a.aaSorting.length&&a.aaSorting[0][0]==c?(d=a.aaSorting[0][0],f=a.aaSorting[0][2]+
 
1,a.aoColumns[d].asSorting[f]||(f=0),a.aaSorting[0][1]=a.aoColumns[d].asSorting[f],a.aaSorting[0][2]=f):(a.aaSorting.splice(0,a.aaSorting.length),a.aaSorting.push([c,a.aoColumns[c].asSorting[0],0]));P(a)};a.oFeatures.bProcessing?(F(a,!0),setTimeout(function(){f();a.oFeatures.bServerSide||F(a,!1)},0)):f();"function"==typeof d&&d(a)}})}function Q(a){var b,c,d,g,f,h=a.aoColumns.length,e=a.oClasses;for(b=0;b<h;b++)a.aoColumns[b].bSortable&&i(a.aoColumns[b].nTh).removeClass(e.sSortAsc+" "+e.sSortDesc+
 
" "+a.aoColumns[b].sSortingClass);g=null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(b=0;b<a.aoColumns.length;b++)if(a.aoColumns[b].bSortable){f=a.aoColumns[b].sSortingClass;d=-1;for(c=0;c<g.length;c++)if(g[c][0]==b){f="asc"==g[c][1]?e.sSortAsc:e.sSortDesc;d=c;break}i(a.aoColumns[b].nTh).addClass(f);a.bJUI&&(c=i("span."+e.sSortIcon,a.aoColumns[b].nTh),c.removeClass(e.sSortJUIAsc+" "+e.sSortJUIDesc+" "+e.sSortJUI+" "+e.sSortJUIAscAllowed+" "+e.sSortJUIDescAllowed),
 
c.addClass(-1==d?a.aoColumns[b].sSortingClassJUI:"asc"==g[d][1]?e.sSortJUIAsc:e.sSortJUIDesc))}else i(a.aoColumns[b].nTh).addClass(a.aoColumns[b].sSortingClass);f=e.sSortColumn;if(a.oFeatures.bSort&&a.oFeatures.bSortClasses){d=L(a);if(a.oFeatures.bDeferRender)i(d).removeClass(f+"1 "+f+"2 "+f+"3");else if(d.length>=h)for(b=0;b<h;b++)if(-1!=d[b].className.indexOf(f+"1")){c=0;for(a=d.length/h;c<a;c++)d[h*c+b].className=i.trim(d[h*c+b].className.replace(f+"1",""))}else if(-1!=d[b].className.indexOf(f+
 
"2")){c=0;for(a=d.length/h;c<a;c++)d[h*c+b].className=i.trim(d[h*c+b].className.replace(f+"2",""))}else if(-1!=d[b].className.indexOf(f+"3")){c=0;for(a=d.length/h;c<a;c++)d[h*c+b].className=i.trim(d[h*c+b].className.replace(" "+f+"3",""))}var e=1,j;for(b=0;b<g.length;b++){j=parseInt(g[b][0],10);c=0;for(a=d.length/h;c<a;c++)d[h*c+j].className+=" "+f+e;3>e&&e++}}}function qa(a){if(a.oFeatures.bStateSave&&!a.bDestroying){var b,c;b=a.oScroll.bInfinite;var d={iCreate:(new Date).getTime(),iStart:b?0:a._iDisplayStart,
 
iEnd:b?a._iDisplayLength:a._iDisplayEnd,iLength:a._iDisplayLength,aaSorting:i.extend(!0,[],a.aaSorting),oSearch:i.extend(!0,{},a.oPreviousSearch),aoSearchCols:i.extend(!0,[],a.aoPreSearchCols),abVisCols:[]};b=0;for(c=a.aoColumns.length;b<c;b++)d.abVisCols.push(a.aoColumns[b].bVisible);C(a,"aoStateSaveParams","stateSaveParams",[a,d]);a.fnStateSave.call(a.oInstance,a,d)}}function Ra(a,b){if(a.oFeatures.bStateSave){var c=a.fnStateLoad.call(a.oInstance,a);if(c){var d=C(a,"aoStateLoadParams","stateLoadParams",
 
[a,c]);if(-1===i.inArray(!1,d)){a.oLoadedState=i.extend(!0,{},c);a._iDisplayStart=c.iStart;a.iInitDisplayStart=c.iStart;a._iDisplayEnd=c.iEnd;a._iDisplayLength=c.iLength;a.aaSorting=c.aaSorting.slice();a.saved_aaSorting=c.aaSorting.slice();i.extend(a.oPreviousSearch,c.oSearch);i.extend(!0,a.aoPreSearchCols,c.aoSearchCols);b.saved_aoColumns=[];for(d=0;d<c.abVisCols.length;d++)b.saved_aoColumns[d]={},b.saved_aoColumns[d].bVisible=c.abVisCols[d];C(a,"aoStateLoaded","stateLoaded",[a,c])}}}}function Sa(a){for(var b=
 
V.location.pathname.split("/"),a=a+"_"+b[b.length-1].replace(/[\/:]/g,"").toLowerCase()+"=",b=l.cookie.split(";"),c=0;c<b.length;c++){for(var d=b[c];" "==d.charAt(0);)d=d.substring(1,d.length);if(0===d.indexOf(a))return decodeURIComponent(d.substring(a.length,d.length))}return null}function u(a){for(var b=0;b<j.settings.length;b++)if(j.settings[b].nTable===a)return j.settings[b];return null}function S(a){for(var b=[],a=a.aoData,c=0,d=a.length;c<d;c++)null!==a[c].nTr&&b.push(a[c].nTr);return b}function L(a,
 
b){var c=[],d,g,f,e,i,j;g=0;var o=a.aoData.length;b!==n&&(g=b,o=b+1);for(f=g;f<o;f++)if(j=a.aoData[f],null!==j.nTr){g=[];e=0;for(i=j.nTr.childNodes.length;e<i;e++)d=j.nTr.childNodes[e].nodeName.toLowerCase(),("td"==d||"th"==d)&&g.push(j.nTr.childNodes[e]);e=d=0;for(i=a.aoColumns.length;e<i;e++)a.aoColumns[e].bVisible?c.push(g[e-d]):(c.push(j._anHidden[e]),d++)}return c}function E(a,b,c){a=null===a?"DataTables warning: "+c:"DataTables warning (table id = '"+a.sTableId+"'): "+c;if(0===b)if("alert"==
 
j.ext.sErrMode)alert(a);else throw Error(a);else V.console&&console.log&&console.log(a)}function p(a,b,c,d){d===n&&(d=c);b[c]!==n&&(a[d]=b[c])}function Ta(a,b){for(var c in b)b.hasOwnProperty(c)&&("object"===typeof e[c]&&!1===i.isArray(b[c])?i.extend(!0,a[c],b[c]):a[c]=b[c]);return a}function Qa(a,b,c){i(a).bind("click.DT",b,function(b){a.blur();c(b)}).bind("keypress.DT",b,function(a){13===a.which&&c(a)}).bind("selectstart.DT",function(){return!1})}function B(a,b,c,d){c&&a[b].push({fn:c,sName:d})}
 
function C(a,b,c,d){for(var b=a[b],g=[],f=b.length-1;0<=f;f--)g.push(b[f].fn.apply(a.oInstance,d));null!==c&&i(a.oInstance).trigger(c,d);return g}function Ua(a){return function(){var b=[u(this[j.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return j.ext.oApi[a].apply(this,b)}}var Va=V.JSON?JSON.stringify:function(a){var b=typeof a;if("object"!==b||null===a)return"string"===b&&(a='"'+a+'"'),a+"";var c,d,g=[],f=i.isArray(a);for(c in a)d=a[c],b=typeof d,"string"===b?d='"'+d+'"':"object"===
 
b&&null!==d&&(d=Va(d)),g.push((f?"":'"'+c+'":')+d);return(f?"[":"{")+g+(f?"]":"}")};this.$=function(a,b){var c,d,g=[],f;d=u(this[j.ext.iApiIndex]);var e=d.aoData,o=d.aiDisplay,k=d.aiDisplayMaster;b||(b={});b=i.extend({},{filter:"none",order:"current",page:"all"},b);if("current"==b.page){c=d._iDisplayStart;for(d=d.fnDisplayEnd();c<d;c++)(f=e[o[c]].nTr)&&g.push(f)}else if("current"==b.order&&"none"==b.filter){c=0;for(d=k.length;c<d;c++)(f=e[k[c]].nTr)&&g.push(f)}else if("current"==b.order&&"applied"==
 
b.filter){c=0;for(d=o.length;c<d;c++)(f=e[o[c]].nTr)&&g.push(f)}else if("original"==b.order&&"none"==b.filter){c=0;for(d=e.length;c<d;c++)(f=e[c].nTr)&&g.push(f)}else if("original"==b.order&&"applied"==b.filter){c=0;for(d=e.length;c<d;c++)f=e[c].nTr,-1!==i.inArray(c,o)&&f&&g.push(f)}else E(d,1,"Unknown selection options");g=i(g);c=g.filter(a);g=g.find(a);return i([].concat(i.makeArray(c),i.makeArray(g)))};this._=function(a,b){var c=[],d,g,e=this.$(a,b);d=0;for(g=e.length;d<g;d++)c.push(this.fnGetData(e[d]));
 
return c};this.fnAddData=function(a,b){if(0===a.length)return[];var c=[],d,g=u(this[j.ext.iApiIndex]);if("object"===typeof a[0]&&null!==a[0])for(var e=0;e<a.length;e++){d=H(g,a[e]);if(-1==d)return c;c.push(d)}else{d=H(g,a);if(-1==d)return c;c.push(d)}g.aiDisplay=g.aiDisplayMaster.slice();(b===n||b)&&$(g);return c};this.fnAdjustColumnSizing=function(a){var b=u(this[j.ext.iApiIndex]);k(b);a===n||a?this.fnDraw(!1):(""!==b.oScroll.sX||""!==b.oScroll.sY)&&this.oApi._fnScrollDraw(b)};this.fnClearTable=
 
function(a){var b=u(this[j.ext.iApiIndex]);ea(b);(a===n||a)&&y(b)};this.fnClose=function(a){for(var b=u(this[j.ext.iApiIndex]),c=0;c<b.aoOpenRows.length;c++)if(b.aoOpenRows[c].nParent==a)return(a=b.aoOpenRows[c].nTr.parentNode)&&a.removeChild(b.aoOpenRows[c].nTr),b.aoOpenRows.splice(c,1),0;return 1};this.fnDeleteRow=function(a,b,c){var d=u(this[j.ext.iApiIndex]),g,e,a="object"===typeof a?K(d,a):a,h=d.aoData.splice(a,1);g=0;for(e=d.aoData.length;g<e;g++)null!==d.aoData[g].nTr&&(d.aoData[g].nTr._DT_RowIndex=
 
g);g=i.inArray(a,d.aiDisplay);d.asDataSearch.splice(g,1);fa(d.aiDisplayMaster,a);fa(d.aiDisplay,a);"function"===typeof b&&b.call(this,d,h);d._iDisplayStart>=d.fnRecordsDisplay()&&(d._iDisplayStart-=d._iDisplayLength,0>d._iDisplayStart&&(d._iDisplayStart=0));if(c===n||c)A(d),y(d);return h};this.fnDestroy=function(a){var b=u(this[j.ext.iApiIndex]),c=b.nTableWrapper.parentNode,d=b.nTBody,g,e,a=a===n?!1:!0;b.bDestroying=!0;C(b,"aoDestroyCallback","destroy",[b]);g=0;for(e=b.aoColumns.length;g<e;g++)!1===
 
b.aoColumns[g].bVisible&&this.fnSetColumnVis(g,!0);i(b.nTableWrapper).find("*").andSelf().unbind(".DT");i("tbody>tr>td."+b.oClasses.sRowEmpty,b.nTable).parent().remove();b.nTable!=b.nTHead.parentNode&&(i(b.nTable).children("thead").remove(),b.nTable.appendChild(b.nTHead));b.nTFoot&&b.nTable!=b.nTFoot.parentNode&&(i(b.nTable).children("tfoot").remove(),b.nTable.appendChild(b.nTFoot));b.nTable.parentNode.removeChild(b.nTable);i(b.nTableWrapper).remove();b.aaSorting=[];b.aaSortingFixed=[];Q(b);i(S(b)).removeClass(b.asStripeClasses.join(" "));
 
i("th, td",b.nTHead).removeClass([b.oClasses.sSortable,b.oClasses.sSortableAsc,b.oClasses.sSortableDesc,b.oClasses.sSortableNone].join(" "));b.bJUI&&(i("th span."+b.oClasses.sSortIcon+", td span."+b.oClasses.sSortIcon,b.nTHead).remove(),i("th, td",b.nTHead).each(function(){var a=i("div."+b.oClasses.sSortJUIWrapper,this),c=a.contents();i(this).append(c);a.remove()}));!a&&b.nTableReinsertBefore?c.insertBefore(b.nTable,b.nTableReinsertBefore):a||c.appendChild(b.nTable);g=0;for(e=b.aoData.length;g<e;g++)null!==
 
b.aoData[g].nTr&&d.appendChild(b.aoData[g].nTr);!0===b.oFeatures.bAutoWidth&&(b.nTable.style.width=q(b.sDestroyWidth));i(d).children("tr:even").addClass(b.asDestroyStripes[0]);i(d).children("tr:odd").addClass(b.asDestroyStripes[1]);g=0;for(e=j.settings.length;g<e;g++)j.settings[g]==b&&j.settings.splice(g,1);b=null};this.fnDraw=function(a){var b=u(this[j.ext.iApiIndex]);!1===a?(A(b),y(b)):$(b)};this.fnFilter=function(a,b,c,d,e,f){var h=u(this[j.ext.iApiIndex]);if(h.oFeatures.bFilter){if(c===n||null===
 
c)c=!1;if(d===n||null===d)d=!0;if(e===n||null===e)e=!0;if(f===n||null===f)f=!0;if(b===n||null===b){if(M(h,{sSearch:a+"",bRegex:c,bSmart:d,bCaseInsensitive:f},1),e&&h.aanFeatures.f){b=h.aanFeatures.f;c=0;for(d=b.length;c<d;c++)i(b[c]._DT_Input).val(a)}}else i.extend(h.aoPreSearchCols[b],{sSearch:a+"",bRegex:c,bSmart:d,bCaseInsensitive:f}),M(h,h.oPreviousSearch,1)}};this.fnGetData=function(a,b){var c=u(this[j.ext.iApiIndex]);if(a!==n){var d=a;if("object"===typeof a){var e=a.nodeName.toLowerCase();"tr"===
 
e?d=K(c,a):"td"===e&&(d=K(c,a.parentNode),b=da(c,d,a))}return b!==n?w(c,d,b,""):c.aoData[d]!==n?c.aoData[d]._aData:null}return Y(c)};this.fnGetNodes=function(a){var b=u(this[j.ext.iApiIndex]);return a!==n?b.aoData[a]!==n?b.aoData[a].nTr:null:S(b)};this.fnGetPosition=function(a){var b=u(this[j.ext.iApiIndex]),c=a.nodeName.toUpperCase();return"TR"==c?K(b,a):"TD"==c||"TH"==c?(c=K(b,a.parentNode),a=da(b,c,a),[c,t(b,a),a]):null};this.fnIsOpen=function(a){for(var b=u(this[j.ext.iApiIndex]),c=0;c<b.aoOpenRows.length;c++)if(b.aoOpenRows[c].nParent==
 
a)return!0;return!1};this.fnOpen=function(a,b,c){var d=u(this[j.ext.iApiIndex]),e=S(d);if(-1!==i.inArray(a,e)){this.fnClose(a);var e=l.createElement("tr"),f=l.createElement("td");e.appendChild(f);f.className=c;f.colSpan=v(d);"string"===typeof b?f.innerHTML=b:i(f).html(b);b=i("tr",d.nTBody);-1!=i.inArray(a,b)&&i(e).insertAfter(a);d.aoOpenRows.push({nTr:e,nParent:a});return e}};this.fnPageChange=function(a,b){var c=u(this[j.ext.iApiIndex]);pa(c,a);A(c);(b===n||b)&&y(c)};this.fnSetColumnVis=function(a,
 
b,c){var d=u(this[j.ext.iApiIndex]),e,f,h=d.aoColumns,i=d.aoData,o,m;if(h[a].bVisible!=b){if(b){for(e=f=0;e<a;e++)h[e].bVisible&&f++;m=f>=v(d);if(!m)for(e=a;e<h.length;e++)if(h[e].bVisible){o=e;break}e=0;for(f=i.length;e<f;e++)null!==i[e].nTr&&(m?i[e].nTr.appendChild(i[e]._anHidden[a]):i[e].nTr.insertBefore(i[e]._anHidden[a],L(d,e)[o]))}else{e=0;for(f=i.length;e<f;e++)null!==i[e].nTr&&(o=L(d,e)[a],i[e]._anHidden[a]=o,o.parentNode.removeChild(o))}h[a].bVisible=b;U(d,d.aoHeader);d.nTFoot&&U(d,d.aoFooter);
 
e=0;for(f=d.aoOpenRows.length;e<f;e++)d.aoOpenRows[e].nTr.colSpan=v(d);if(c===n||c)k(d),y(d);qa(d)}};this.fnSettings=function(){return u(this[j.ext.iApiIndex])};this.fnSort=function(a){var b=u(this[j.ext.iApiIndex]);b.aaSorting=a;P(b)};this.fnSortListener=function(a,b,c){ga(u(this[j.ext.iApiIndex]),a,b,c)};this.fnUpdate=function(a,b,c,d,e){var f=u(this[j.ext.iApiIndex]),b="object"===typeof b?K(f,b):b;if(f.__fnUpdateDeep===n&&i.isArray(a)&&"object"===typeof a){f.aoData[b]._aData=a.slice();f.__fnUpdateDeep=
 
!0;for(c=0;c<f.aoColumns.length;c++)this.fnUpdate(w(f,b,c),b,c,!1,!1);f.__fnUpdateDeep=n}else if(f.__fnUpdateDeep===n&&null!==a&&"object"===typeof a){f.aoData[b]._aData=i.extend(!0,{},a);f.__fnUpdateDeep=!0;for(c=0;c<f.aoColumns.length;c++)this.fnUpdate(w(f,b,c),b,c,!1,!1);f.__fnUpdateDeep=n}else{I(f,b,c,a);var a=w(f,b,c,"display"),h=f.aoColumns[c];null!==h.fnRender&&(a=R(f,b,c),h.bUseRendered&&I(f,b,c,a));null!==f.aoData[b].nTr&&(L(f,b)[c].innerHTML=a)}c=i.inArray(b,f.aiDisplay);f.asDataSearch[c]=
 
ma(f,X(f,b,"filter"));(e===n||e)&&k(f);(d===n||d)&&$(f);return 0};this.fnVersionCheck=j.ext.fnVersionCheck;this.oApi={_fnExternApiFunc:Ua,_fnInitialise:aa,_fnInitComplete:Z,_fnLanguageCompat:oa,_fnAddColumn:o,_fnColumnOptions:r,_fnAddData:H,_fnCreateTr:ca,_fnGatherData:ua,_fnBuildHead:va,_fnDrawHead:U,_fnDraw:y,_fnReDraw:$,_fnAjaxUpdate:wa,_fnAjaxParameters:Ea,_fnAjaxUpdateDraw:Fa,_fnServerParams:ia,_fnAddOptionsHtml:xa,_fnFeatureHtmlTable:Ba,_fnScrollDraw:Ka,_fnAdjustColumnSizing:k,_fnFeatureHtmlFilter:za,
 
_fnFilterComplete:M,_fnFilterCustom:Ia,_fnFilterColumn:Ha,_fnFilter:Ga,_fnBuildSearchArray:ja,_fnBuildSearchRow:ma,_fnFilterCreateSearch:ka,_fnDataToSearch:la,_fnSort:P,_fnSortAttachListener:ga,_fnSortingClasses:Q,_fnFeatureHtmlPaginate:Da,_fnPageChange:pa,_fnFeatureHtmlInfo:Ca,_fnUpdateInfo:Ja,_fnFeatureHtmlLength:ya,_fnFeatureHtmlProcessing:Aa,_fnProcessingDisplay:F,_fnVisibleToColumnIndex:G,_fnColumnIndexToVisible:t,_fnNodeToDataIndex:K,_fnVisbleColumns:v,_fnCalculateEnd:A,_fnConvertToWidth:La,
 
_fnCalculateColumnWidths:ba,_fnScrollingWidthAdjust:Na,_fnGetWidestNode:Ma,_fnGetMaxLenString:Oa,_fnStringToCss:q,_fnDetectType:z,_fnSettingsFromNode:u,_fnGetDataMaster:Y,_fnGetTrNodes:S,_fnGetTdNodes:L,_fnEscapeRegex:na,_fnDeleteIndex:fa,_fnReOrderIndex:D,_fnColumnOrdering:x,_fnLog:E,_fnClearTable:ea,_fnSaveState:qa,_fnLoadState:Ra,_fnCreateCookie:function(a,b,c,d,e){var f=new Date;f.setTime(f.getTime()+1E3*c);var c=V.location.pathname.split("/"),a=a+"_"+c.pop().replace(/[\/:]/g,"").toLowerCase(),
 
h;null!==e?(h="function"===typeof i.parseJSON?i.parseJSON(b):eval("("+b+")"),b=e(a,h,f.toGMTString(),c.join("/")+"/")):b=a+"="+encodeURIComponent(b)+"; expires="+f.toGMTString()+"; path="+c.join("/")+"/";e="";f=9999999999999;if(4096<(null!==Sa(a)?l.cookie.length:b.length+l.cookie.length)+10){for(var a=l.cookie.split(";"),o=0,j=a.length;o<j;o++)if(-1!=a[o].indexOf(d)){var k=a[o].split("=");try{h=eval("("+decodeURIComponent(k[1])+")")}catch(r){continue}h.iCreate&&h.iCreate<f&&(e=k[0],f=h.iCreate)}""!==
 
e&&(l.cookie=e+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path="+c.join("/")+"/")}l.cookie=b},_fnReadCookie:Sa,_fnDetectHeader:T,_fnGetUniqueThs:O,_fnScrollBarWidth:Pa,_fnApplyToChildren:N,_fnMap:p,_fnGetRowData:X,_fnGetCellData:w,_fnSetCellData:I,_fnGetObjectDataFn:W,_fnSetObjectDataFn:ta,_fnApplyColumnDefs:J,_fnBindAction:Qa,_fnExtend:Ta,_fnCallbackReg:B,_fnCallbackFire:C,_fnJsonString:Va,_fnRender:R,_fnNodeToColumnIndex:da,_fnInfoMacros:ha};i.extend(j.ext.oApi,this.oApi);for(var ra in j.ext.oApi)ra&&
 
(this[ra]=Ua(ra));var sa=this;return this.each(function(){var a=0,b,c,d;c=this.getAttribute("id");var g=!1,f=!1;if("table"!=this.nodeName.toLowerCase())E(null,0,"Attempted to initialise DataTables on a node which is not a table: "+this.nodeName);else{a=0;for(b=j.settings.length;a<b;a++){if(j.settings[a].nTable==this){if(e===n||e.bRetrieve)return j.settings[a].oInstance;if(e.bDestroy){j.settings[a].oInstance.fnDestroy();break}else{E(j.settings[a],0,"Cannot reinitialise DataTable.\n\nTo retrieve the DataTables object for this table, pass no arguments or see the docs for bRetrieve and bDestroy");
 
return}}if(j.settings[a].sTableId==this.id){j.settings.splice(a,1);break}}if(null===c||""===c)this.id=c="DataTables_Table_"+j.ext._oExternConfig.iNextUnique++;var h=i.extend(!0,{},j.models.oSettings,{nTable:this,oApi:sa.oApi,oInit:e,sDestroyWidth:i(this).width(),sInstance:c,sTableId:c});j.settings.push(h);h.oInstance=1===sa.length?sa:i(this).dataTable();e||(e={});e.oLanguage&&oa(e.oLanguage);e=Ta(i.extend(!0,{},j.defaults),e);p(h.oFeatures,e,"bPaginate");p(h.oFeatures,e,"bLengthChange");p(h.oFeatures,
 
e,"bFilter");p(h.oFeatures,e,"bSort");p(h.oFeatures,e,"bInfo");p(h.oFeatures,e,"bProcessing");p(h.oFeatures,e,"bAutoWidth");p(h.oFeatures,e,"bSortClasses");p(h.oFeatures,e,"bServerSide");p(h.oFeatures,e,"bDeferRender");p(h.oScroll,e,"sScrollX","sX");p(h.oScroll,e,"sScrollXInner","sXInner");p(h.oScroll,e,"sScrollY","sY");p(h.oScroll,e,"bScrollCollapse","bCollapse");p(h.oScroll,e,"bScrollInfinite","bInfinite");p(h.oScroll,e,"iScrollLoadGap","iLoadGap");p(h.oScroll,e,"bScrollAutoCss","bAutoCss");p(h,
 
e,"asStripeClasses");p(h,e,"asStripClasses","asStripeClasses");p(h,e,"fnServerData");p(h,e,"fnFormatNumber");p(h,e,"sServerMethod");p(h,e,"aaSorting");p(h,e,"aaSortingFixed");p(h,e,"aLengthMenu");p(h,e,"sPaginationType");p(h,e,"sAjaxSource");p(h,e,"sAjaxDataProp");p(h,e,"iCookieDuration");p(h,e,"sCookiePrefix");p(h,e,"sDom");p(h,e,"bSortCellsTop");p(h,e,"iTabIndex");p(h,e,"oSearch","oPreviousSearch");p(h,e,"aoSearchCols","aoPreSearchCols");p(h,e,"iDisplayLength","_iDisplayLength");p(h,e,"bJQueryUI",
 
"bJUI");p(h,e,"fnCookieCallback");p(h,e,"fnStateLoad");p(h,e,"fnStateSave");p(h.oLanguage,e,"fnInfoCallback");B(h,"aoDrawCallback",e.fnDrawCallback,"user");B(h,"aoServerParams",e.fnServerParams,"user");B(h,"aoStateSaveParams",e.fnStateSaveParams,"user");B(h,"aoStateLoadParams",e.fnStateLoadParams,"user");B(h,"aoStateLoaded",e.fnStateLoaded,"user");B(h,"aoRowCallback",e.fnRowCallback,"user");B(h,"aoRowCreatedCallback",e.fnCreatedRow,"user");B(h,"aoHeaderCallback",e.fnHeaderCallback,"user");B(h,"aoFooterCallback",
 
e.fnFooterCallback,"user");B(h,"aoInitComplete",e.fnInitComplete,"user");B(h,"aoPreDrawCallback",e.fnPreDrawCallback,"user");h.oFeatures.bServerSide&&h.oFeatures.bSort&&h.oFeatures.bSortClasses?B(h,"aoDrawCallback",Q,"server_side_sort_classes"):h.oFeatures.bDeferRender&&B(h,"aoDrawCallback",Q,"defer_sort_classes");e.bJQueryUI?(i.extend(h.oClasses,j.ext.oJUIClasses),e.sDom===j.defaults.sDom&&"lfrtip"===j.defaults.sDom&&(h.sDom='<"H"lfr>t<"F"ip>')):i.extend(h.oClasses,j.ext.oStdClasses);i(this).addClass(h.oClasses.sTable);
 
if(""!==h.oScroll.sX||""!==h.oScroll.sY)h.oScroll.iBarWidth=Pa();h.iInitDisplayStart===n&&(h.iInitDisplayStart=e.iDisplayStart,h._iDisplayStart=e.iDisplayStart);e.bStateSave&&(h.oFeatures.bStateSave=!0,Ra(h,e),B(h,"aoDrawCallback",qa,"state_save"));null!==e.iDeferLoading&&(h.bDeferLoading=!0,a=i.isArray(e.iDeferLoading),h._iRecordsDisplay=a?e.iDeferLoading[0]:e.iDeferLoading,h._iRecordsTotal=a?e.iDeferLoading[1]:e.iDeferLoading);null!==e.aaData&&(f=!0);""!==e.oLanguage.sUrl?(h.oLanguage.sUrl=e.oLanguage.sUrl,
 
i.getJSON(h.oLanguage.sUrl,null,function(a){oa(a);i.extend(true,h.oLanguage,e.oLanguage,a);aa(h)}),g=!0):i.extend(!0,h.oLanguage,e.oLanguage);null===e.asStripeClasses&&(h.asStripeClasses=[h.oClasses.sStripeOdd,h.oClasses.sStripeEven]);c=!1;d=i(this).children("tbody").children("tr");a=0;for(b=h.asStripeClasses.length;a<b;a++)if(d.filter(":lt(2)").hasClass(h.asStripeClasses[a])){c=!0;break}c&&(h.asDestroyStripes=["",""],i(d[0]).hasClass(h.oClasses.sStripeOdd)&&(h.asDestroyStripes[0]+=h.oClasses.sStripeOdd+
 
" "),i(d[0]).hasClass(h.oClasses.sStripeEven)&&(h.asDestroyStripes[0]+=h.oClasses.sStripeEven),i(d[1]).hasClass(h.oClasses.sStripeOdd)&&(h.asDestroyStripes[1]+=h.oClasses.sStripeOdd+" "),i(d[1]).hasClass(h.oClasses.sStripeEven)&&(h.asDestroyStripes[1]+=h.oClasses.sStripeEven),d.removeClass(h.asStripeClasses.join(" ")));c=[];a=this.getElementsByTagName("thead");0!==a.length&&(T(h.aoHeader,a[0]),c=O(h));if(null===e.aoColumns){d=[];a=0;for(b=c.length;a<b;a++)d.push(null)}else d=e.aoColumns;a=0;for(b=
 
d.length;a<b;a++)e.saved_aoColumns!==n&&e.saved_aoColumns.length==b&&(null===d[a]&&(d[a]={}),d[a].bVisible=e.saved_aoColumns[a].bVisible),o(h,c?c[a]:null);J(h,e.aoColumnDefs,d,function(a,b){r(h,a,b)});a=0;for(b=h.aaSorting.length;a<b;a++){h.aaSorting[a][0]>=h.aoColumns.length&&(h.aaSorting[a][0]=0);var k=h.aoColumns[h.aaSorting[a][0]];h.aaSorting[a][2]===n&&(h.aaSorting[a][2]=0);e.aaSorting===n&&h.saved_aaSorting===n&&(h.aaSorting[a][1]=k.asSorting[0]);c=0;for(d=k.asSorting.length;c<d;c++)if(h.aaSorting[a][1]==
 
k.asSorting[c]){h.aaSorting[a][2]=c;break}}Q(h);a=i(this).children("caption").each(function(){this._captionSide=i(this).css("caption-side")});b=i(this).children("thead");0===b.length&&(b=[l.createElement("thead")],this.appendChild(b[0]));h.nTHead=b[0];b=i(this).children("tbody");0===b.length&&(b=[l.createElement("tbody")],this.appendChild(b[0]));h.nTBody=b[0];h.nTBody.setAttribute("role","alert");h.nTBody.setAttribute("aria-live","polite");h.nTBody.setAttribute("aria-relevant","all");b=i(this).children("tfoot");
 
if(0===b.length&&0<a.length&&(""!==h.oScroll.sX||""!==h.oScroll.sY))b=[l.createElement("tfoot")],this.appendChild(b[0]);0<b.length&&(h.nTFoot=b[0],T(h.aoFooter,h.nTFoot));if(f)for(a=0;a<e.aaData.length;a++)H(h,e.aaData[a]);else ua(h);h.aiDisplay=h.aiDisplayMaster.slice();h.bInitialised=!0;!1===g&&aa(h)}})};j.fnVersionCheck=function(e){for(var i=function(e,i){for(;e.length<i;)e+="0";return e},r=j.ext.sVersion.split("."),e=e.split("."),k="",n="",l=0,v=e.length;l<v;l++)k+=i(r[l],3),n+=i(e[l],3);return parseInt(k,
 
10)>=parseInt(n,10)};j.fnIsDataTable=function(e){for(var i=j.settings,r=0;r<i.length;r++)if(i[r].nTable===e||i[r].nScrollHead===e||i[r].nScrollFoot===e)return!0;return!1};j.fnTables=function(e){var o=[];jQuery.each(j.settings,function(j,k){(!e||!0===e&&i(k.nTable).is(":visible"))&&o.push(k.nTable)});return o};j.version="1.9.2";j.settings=[];j.models={};j.models.ext={afnFiltering:[],afnSortData:[],aoFeatures:[],aTypes:[],fnVersionCheck:j.fnVersionCheck,iApiIndex:0,ofnSearch:{},oApi:{},oStdClasses:{},
 
oJUIClasses:{},oPagination:{},oSort:{},sVersion:j.version,sErrMode:"alert",_oExternConfig:{iNextUnique:0}};j.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};j.models.oRow={nTr:null,_aData:[],_aSortData:[],_anHidden:[],_sRowStripe:""};j.models.oColumn={aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bUseRendered:null,bVisible:null,_bAutoType:!0,fnCreatedCell:null,fnGetData:null,fnRender:null,fnSetData:null,mDataProp:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,
 
sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};j.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bJQueryUI:!1,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollAutoCss:!0,bScrollCollapse:!1,bScrollInfinite:!1,bServerSide:!1,
 
bSort:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCookieCallback:null,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(e){if(1E3>e)return e;for(var i=e+"",e=i.split(""),j="",i=i.length,k=0;k<i;k++)0===k%3&&0!==k&&(j=this.oLanguage.sInfoThousands+j),j=e[i-k-1]+j;return j},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:function(e,j,n,k){k.jqXHR=i.ajax({url:e,data:j,success:function(e){i(k.oInstance).trigger("xhr",
 
k);n(e)},dataType:"json",cache:!1,type:k.sServerMethod,error:function(e,i){"parsererror"==i&&k.oApi._fnLog(k,0,"DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.")}})},fnServerParams:null,fnStateLoad:function(e){var e=this.oApi._fnReadCookie(e.sCookiePrefix+e.sInstance),j;try{j="function"===typeof i.parseJSON?i.parseJSON(e):eval("("+e+")")}catch(n){j=null}return j},fnStateLoadParams:null,fnStateLoaded:null,fnStateSave:function(e,i){this.oApi._fnCreateCookie(e.sCookiePrefix+
 
e.sInstance,this.oApi._fnJsonString(i),e.iCookieDuration,e.sCookiePrefix,e.fnCookieCallback)},fnStateSaveParams:null,iCookieDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iScrollLoadGap:100,iTabIndex:0,oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",
 
sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sInfoThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sUrl:"",sZeroRecords:"No matching records found"},oSearch:i.extend({},j.models.oSearch),sAjaxDataProp:"aaData",sAjaxSource:null,sCookiePrefix:"SpryMedia_DataTables_",sDom:"lfrtip",sPaginationType:"two_button",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET"};
 
j.defaults.columns={aDataSort:null,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bUseRendered:!0,bVisible:!0,fnCreatedCell:null,fnRender:null,iDataSort:-1,mDataProp:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};j.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortClasses:null,bStateSave:null},
 
oScroll:{bAutoCss:null,bCollapse:null,bInfinite:null,iBarWidth:0,iLoadGap:null,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aoColumns:[],aoHeader:[],aoFooter:[],asDataSearch:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:null,asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],
 
aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,sPaginationType:"two_button",iCookieDuration:0,sCookiePrefix:"",fnCookieCallback:null,aoStateSave:[],aoStateLoad:[],oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,
 
iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iDisplayEnd:10,_iRecordsTotal:0,_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsTotal,10):this.aiDisplayMaster.length},fnRecordsDisplay:function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsDisplay,10):this.aiDisplay.length},fnDisplayEnd:function(){return this.oFeatures.bServerSide?
 
!1===this.oFeatures.bPaginate||-1==this._iDisplayLength?this._iDisplayStart+this.aiDisplay.length:Math.min(this._iDisplayStart+this._iDisplayLength,this._iRecordsDisplay):this._iDisplayEnd},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null};j.ext=i.extend(!0,{},j.models.ext);i.extend(j.ext.oStdClasses,{sTable:"dataTable",sPagePrevEnabled:"paginate_enabled_previous",sPagePrevDisabled:"paginate_disabled_previous",sPageNextEnabled:"paginate_enabled_next",sPageNextDisabled:"paginate_disabled_next",
 
sPageJUINext:"",sPageJUIPrev:"",sPageButton:"paginate_button",sPageButtonActive:"paginate_active",sPageButtonStaticDisabled:"paginate_button paginate_button_disabled",sPageFirst:"first",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",
 
sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",
 
sFooterTH:"",sJUIHeader:"",sJUIFooter:""});i.extend(j.ext.oJUIClasses,j.ext.oStdClasses,{sPagePrevEnabled:"fg-button ui-button ui-state-default ui-corner-left",sPagePrevDisabled:"fg-button ui-button ui-state-default ui-corner-left ui-state-disabled",sPageNextEnabled:"fg-button ui-button ui-state-default ui-corner-right",sPageNextDisabled:"fg-button ui-button ui-state-default ui-corner-right ui-state-disabled",sPageJUINext:"ui-icon ui-icon-circle-arrow-e",sPageJUIPrev:"ui-icon ui-icon-circle-arrow-w",
 
sPageButton:"fg-button ui-button ui-state-default",sPageButtonActive:"fg-button ui-button ui-state-default ui-state-disabled",sPageButtonStaticDisabled:"fg-button ui-button ui-state-default ui-state-disabled",sPageFirst:"first ui-corner-tl ui-corner-bl",sPageLast:"last ui-corner-tr ui-corner-br",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sSortAsc:"ui-state-default",sSortDesc:"ui-state-default",sSortable:"ui-state-default",sSortableAsc:"ui-state-default",
 
sSortableDesc:"ui-state-default",sSortableNone:"ui-state-default",sSortJUIAsc:"css_right ui-icon ui-icon-triangle-1-n",sSortJUIDesc:"css_right ui-icon ui-icon-triangle-1-s",sSortJUI:"css_right ui-icon ui-icon-carat-2-n-s",sSortJUIAscAllowed:"css_right ui-icon ui-icon-carat-1-n",sSortJUIDescAllowed:"css_right ui-icon ui-icon-carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",sScrollHead:"dataTables_scrollHead ui-state-default",sScrollFoot:"dataTables_scrollFoot ui-state-default",
 
sFooterTH:"ui-state-default",sJUIHeader:"fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix",sJUIFooter:"fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"});i.extend(j.ext.oPagination,{two_button:{fnInit:function(e,j,n){var k=e.oLanguage.oPaginate,l=function(i){e.oApi._fnPageChange(e,i.data.action)&&n(e)},k=!e.bJUI?'<a class="'+e.oClasses.sPagePrevDisabled+'" tabindex="'+e.iTabIndex+'" role="button">'+k.sPrevious+'</a><a class="'+
 
e.oClasses.sPageNextDisabled+'" tabindex="'+e.iTabIndex+'" role="button">'+k.sNext+"</a>":'<a class="'+e.oClasses.sPagePrevDisabled+'" tabindex="'+e.iTabIndex+'" role="button"><span class="'+e.oClasses.sPageJUIPrev+'"></span></a><a class="'+e.oClasses.sPageNextDisabled+'" tabindex="'+e.iTabIndex+'" role="button"><span class="'+e.oClasses.sPageJUINext+'"></span></a>';i(j).append(k);var t=i("a",j),k=t[0],t=t[1];e.oApi._fnBindAction(k,{action:"previous"},l);e.oApi._fnBindAction(t,{action:"next"},l);
 
e.aanFeatures.p||(j.id=e.sTableId+"_paginate",k.id=e.sTableId+"_previous",t.id=e.sTableId+"_next",k.setAttribute("aria-controls",e.sTableId),t.setAttribute("aria-controls",e.sTableId))},fnUpdate:function(e){if(e.aanFeatures.p)for(var i=e.oClasses,j=e.aanFeatures.p,k=0,n=j.length;k<n;k++)0!==j[k].childNodes.length&&(j[k].childNodes[0].className=0===e._iDisplayStart?i.sPagePrevDisabled:i.sPagePrevEnabled,j[k].childNodes[1].className=e.fnDisplayEnd()==e.fnRecordsDisplay()?i.sPageNextDisabled:i.sPageNextEnabled)}},
 
iFullNumbersShowPages:5,full_numbers:{fnInit:function(e,j,n){var k=e.oLanguage.oPaginate,l=e.oClasses,t=function(i){e.oApi._fnPageChange(e,i.data.action)&&n(e)};i(j).append('<a  tabindex="'+e.iTabIndex+'" class="'+l.sPageButton+" "+l.sPageFirst+'">'+k.sFirst+'</a><a  tabindex="'+e.iTabIndex+'" class="'+l.sPageButton+" "+l.sPagePrevious+'">'+k.sPrevious+'</a><span></span><a tabindex="'+e.iTabIndex+'" class="'+l.sPageButton+" "+l.sPageNext+'">'+k.sNext+'</a><a tabindex="'+e.iTabIndex+'" class="'+l.sPageButton+
 
" "+l.sPageLast+'">'+k.sLast+"</a>");var v=i("a",j),k=v[0],l=v[1],z=v[2],v=v[3];e.oApi._fnBindAction(k,{action:"first"},t);e.oApi._fnBindAction(l,{action:"previous"},t);e.oApi._fnBindAction(z,{action:"next"},t);e.oApi._fnBindAction(v,{action:"last"},t);e.aanFeatures.p||(j.id=e.sTableId+"_paginate",k.id=e.sTableId+"_first",l.id=e.sTableId+"_previous",z.id=e.sTableId+"_next",v.id=e.sTableId+"_last")},fnUpdate:function(e,o){if(e.aanFeatures.p){var l=j.ext.oPagination.iFullNumbersShowPages,k=Math.floor(l/
 
2),n=Math.ceil(e.fnRecordsDisplay()/e._iDisplayLength),t=Math.ceil(e._iDisplayStart/e._iDisplayLength)+1,v="",z,D=e.oClasses,x,J=e.aanFeatures.p,H=function(i){e.oApi._fnBindAction(this,{page:i+z-1},function(i){e.oApi._fnPageChange(e,i.data.page);o(e);i.preventDefault()})};-1===e._iDisplayLength?t=k=z=1:n<l?(z=1,k=n):t<=k?(z=1,k=l):t>=n-k?(z=n-l+1,k=n):(z=t-Math.ceil(l/2)+1,k=z+l-1);for(l=z;l<=k;l++)v+=t!==l?'<a tabindex="'+e.iTabIndex+'" class="'+D.sPageButton+'">'+e.fnFormatNumber(l)+"</a>":'<a tabindex="'+
 
e.iTabIndex+'" class="'+D.sPageButtonActive+'">'+e.fnFormatNumber(l)+"</a>";l=0;for(k=J.length;l<k;l++)0!==J[l].childNodes.length&&(i("span:eq(0)",J[l]).html(v).children("a").each(H),x=J[l].getElementsByTagName("a"),x=[x[0],x[1],x[x.length-2],x[x.length-1]],i(x).removeClass(D.sPageButton+" "+D.sPageButtonActive+" "+D.sPageButtonStaticDisabled),i([x[0],x[1]]).addClass(1==t?D.sPageButtonStaticDisabled:D.sPageButton),i([x[2],x[3]]).addClass(0===n||t===n||-1===e._iDisplayLength?D.sPageButtonStaticDisabled:
 
D.sPageButton))}}}});i.extend(j.ext.oSort,{"string-pre":function(e){"string"!=typeof e&&(e=null!==e&&e.toString?e.toString():"");return e.toLowerCase()},"string-asc":function(e,i){return e<i?-1:e>i?1:0},"string-desc":function(e,i){return e<i?1:e>i?-1:0},"html-pre":function(e){return e.replace(/<.*?>/g,"").toLowerCase()},"html-asc":function(e,i){return e<i?-1:e>i?1:0},"html-desc":function(e,i){return e<i?1:e>i?-1:0},"date-pre":function(e){e=Date.parse(e);if(isNaN(e)||""===e)e=Date.parse("01/01/1970 00:00:00");
 
return e},"date-asc":function(e,i){return e-i},"date-desc":function(e,i){return i-e},"numeric-pre":function(e){return"-"==e||""===e?0:1*e},"numeric-asc":function(e,i){return e-i},"numeric-desc":function(e,i){return i-e}});i.extend(j.ext.aTypes,[function(e){if("number"===typeof e)return"numeric";if("string"!==typeof e)return null;var i,j=!1;i=e.charAt(0);if(-1=="0123456789-".indexOf(i))return null;for(var k=1;k<e.length;k++){i=e.charAt(k);if(-1=="0123456789.".indexOf(i))return null;if("."==i){if(j)return null;
 
j=!0}}return"numeric"},function(e){var i=Date.parse(e);return null!==i&&!isNaN(i)||"string"===typeof e&&0===e.length?"date":null},function(e){return"string"===typeof e&&-1!=e.indexOf("<")&&-1!=e.indexOf(">")?"html":null}]);i.fn.DataTable=j;i.fn.dataTable=j;i.fn.dataTableSettings=j.settings;i.fn.dataTableExt=j.ext})(jQuery,window,document,void 0);
symposion/static/tabletools/js/TableTools.js
Show inline comments
 
new file 100755
 
/*
 
 * File:        TableTools.js
 
 * Version:     2.1.3
 
 * Description: Tools and buttons for DataTables
 
 * Author:      Allan Jardine (www.sprymedia.co.uk)
 
 * Language:    Javascript
 
 * License:	    GPL v2 or BSD 3 point style
 
 * Project:	    DataTables
 
 * 
 
 * Copyright 2009-2012 Allan Jardine, all rights reserved.
 
 *
 
 * This source file is free software, under either the GPL v2 license or a
 
 * BSD style license, available at:
 
 *   http://datatables.net/license_gpl2
 
 *   http://datatables.net/license_bsd
 
 */
 

	
 
/* Global scope for TableTools */
 
var TableTools;
 

	
 
(function($, window, document) {
 

	
 
/** 
 
 * TableTools provides flexible buttons and other tools for a DataTables enhanced table
 
 * @class TableTools
 
 * @constructor
 
 * @param {Object} oDT DataTables instance
 
 * @param {Object} oOpts TableTools options
 
 * @param {String} oOpts.sSwfPath ZeroClipboard SWF path
 
 * @param {String} oOpts.sRowSelect Row selection options - 'none', 'single' or 'multi'
 
 * @param {Function} oOpts.fnPreRowSelect Callback function just prior to row selection
 
 * @param {Function} oOpts.fnRowSelected Callback function just after row selection
 
 * @param {Function} oOpts.fnRowDeselected Callback function when row is deselected
 
 * @param {Array} oOpts.aButtons List of buttons to be used
 
 */
 
TableTools = function( oDT, oOpts )
 
{
 
	/* Santiy check that we are a new instance */
 
	if ( ! this instanceof TableTools )
 
	{
 
		alert( "Warning: TableTools must be initialised with the keyword 'new'" );
 
	}
 
	
 
	
 
	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 
	 * Public class variables
 
	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
	
 
	/**
 
	 * @namespace Settings object which contains customisable information for TableTools instance
 
	 */
 
	this.s = {
 
		/**
 
		 * Store 'this' so the instance can be retrieved from the settings object
 
		 * @property that
 
		 * @type	 object
 
		 * @default  this
 
		 */
 
		"that": this,
 
		
 
		/** 
 
		 * DataTables settings objects
 
		 * @property dt
 
		 * @type	 object
 
		 * @default  <i>From the oDT init option</i>
 
		 */
 
		"dt": oDT.fnSettings(),
 
		
 
		/**
 
		 * @namespace Print specific information
 
		 */
 
		"print": {
 
			/** 
 
			 * DataTables draw 'start' point before the printing display was shown
 
			 *  @property saveStart
 
			 *  @type	 int
 
			 *  @default  -1
 
		 	 */
 
		  "saveStart": -1,
 
			
 
			/** 
 
			 * DataTables draw 'length' point before the printing display was shown
 
			 *  @property saveLength
 
			 *  @type	 int
 
			 *  @default  -1
 
		 	 */
 
		  "saveLength": -1,
 
		
 
			/** 
 
			 * Page scrolling point before the printing display was shown so it can be restored
 
			 *  @property saveScroll
 
			 *  @type	 int
 
			 *  @default  -1
 
		 	 */
 
		  "saveScroll": -1,
 
		
 
			/** 
 
			 * Wrapped function to end the print display (to maintain scope)
 
			 *  @property funcEnd
 
		 	 *  @type	 Function
 
			 *  @default  function () {}
 
		 	 */
 
		  "funcEnd": function () {}
 
	  },
 
	
 
		/**
 
		 * A unique ID is assigned to each button in each instance
 
		 * @property buttonCounter
 
		 *  @type	 int
 
		 * @default  0
 
		 */
 
	  "buttonCounter": 0,
 
		
 
		/**
 
		 * @namespace Select rows specific information
 
		 */
 
		"select": {
 
			/**
 
			 * Select type - can be 'none', 'single' or 'multi'
 
			 * @property type
 
			 *  @type	 string
 
			 * @default  ""
 
			 */
 
			"type": "",
 
			
 
			/**
 
			 * Array of nodes which are currently selected
 
			 *  @property selected
 
			 *  @type	 array
 
			 *  @default  []
 
			 */
 
			"selected": [],
 
			
 
			/**
 
			 * Function to run before the selection can take place. Will cancel the select if the
 
			 * function returns false
 
			 *  @property preRowSelect
 
			 *  @type	 Function
 
			 *  @default  null
 
			 */
 
			"preRowSelect": null,
 
			
 
			/**
 
			 * Function to run when a row is selected
 
			 *  @property postSelected
 
			 *  @type	 Function
 
			 *  @default  null
 
			 */
 
			"postSelected": null,
 
			
 
			/**
 
			 * Function to run when a row is deselected
 
			 *  @property postDeselected
 
			 *  @type	 Function
 
			 *  @default  null
 
			 */
 
			"postDeselected": null,
 
			
 
			/**
 
			 * Indicate if all rows are selected (needed for server-side processing)
 
			 *  @property all
 
			 *  @type	 boolean
 
			 *  @default  false
 
			 */
 
			"all": false,
 
			
 
			/**
 
			 * Class name to add to selected TR nodes
 
			 *  @property selectedClass
 
			 *  @type	 String
 
			 *  @default  ""
 
			 */
 
			"selectedClass": ""
 
		},
 
		
 
		/**
 
		 * Store of the user input customisation object
 
		 *  @property custom
 
		 *  @type	 object
 
		 *  @default  {}
 
		 */
 
		"custom": {},
 
		
 
		/**
 
		 * SWF movie path
 
		 *  @property swfPath
 
		 *  @type	 string
 
		 *  @default  ""
 
		 */
 
		"swfPath": "",
 
		
 
		/**
 
		 * Default button set
 
		 *  @property buttonSet
 
		 *  @type	 array
 
		 *  @default  []
 
		 */
 
		"buttonSet": [],
 
		
 
		/**
 
		 * When there is more than one TableTools instance for a DataTable, there must be a 
 
		 * master which controls events (row selection etc)
 
		 *  @property master
 
		 *  @type	 boolean
 
		 *  @default  false
 
		 */
 
		"master": false,
 
		
 
		/**
 
		 * Tag names that are used for creating collections and buttons
 
		 *  @namesapce
 
		 */
 
		"tags": {}
 
	};
 
	
 
	
 
	/**
 
	 * @namespace Common and useful DOM elements for the class instance
 
	 */
 
	this.dom = {
 
		/**
 
		 * DIV element that is create and all TableTools buttons (and their children) put into
 
		 *  @property container
 
		 *  @type	 node
 
		 *  @default  null
 
		 */
 
		"container": null,
 
		
 
		/**
 
		 * The table node to which TableTools will be applied
 
		 *  @property table
 
		 *  @type	 node
 
		 *  @default  null
 
		 */
 
		"table": null,
 
		
 
		/**
 
		 * @namespace Nodes used for the print display
 
		 */
 
		"print": {
 
			/**
 
			 * Nodes which have been removed from the display by setting them to display none
 
			 *  @property hidden
 
			 *  @type	 array
 
		 	 *  @default  []
 
			 */
 
		  "hidden": [],
 
			
 
			/**
 
			 * The information display saying telling the user about the print display
 
			 *  @property message
 
			 *  @type	 node
 
		 	 *  @default  null
 
			 */
 
		  "message": null
 
	  },
 
		
 
		/**
 
		 * @namespace Nodes used for a collection display. This contains the currently used collection
 
		 */
 
		"collection": {
 
			/**
 
			 * The div wrapper containing the buttons in the collection (i.e. the menu)
 
			 *  @property collection
 
			 *  @type	 node
 
		 	 *  @default  null
 
			 */
 
			"collection": null,
 
			
 
			/**
 
			 * Background display to provide focus and capture events
 
			 *  @property background
 
			 *  @type	 node
 
		 	 *  @default  null
 
			 */
 
			"background": null
 
		}
 
	};
 

	
 
	/**
 
	 * @namespace Name space for the classes that this TableTools instance will use
 
	 * @extends TableTools.classes
 
	 */
 
	this.classes = $.extend( true, {}, TableTools.classes );
 
	if ( this.s.dt.bJUI )
 
	{
 
		$.extend( true, this.classes, TableTools.classes_themeroller );
 
	}
 
	
 
	
 
	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 
	 * Public class methods
 
	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
	
 
	/**
 
	 * Retreieve the settings object from an instance
 
	 *  @method fnSettings
 
	 *  @returns {object} TableTools settings object
 
	 */
 
	this.fnSettings = function () {
 
		return this.s;
 
	};
 
	
 
	
 
	/* Constructor logic */
 
	if ( typeof oOpts == 'undefined' )
 
	{
 
		oOpts = {};
 
	}
 
	
 
	this._fnConstruct( oOpts );
 
	
 
	return this;
 
};
 

	
 

	
 

	
 
TableTools.prototype = {
 
	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 
	 * Public methods
 
	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
	
 
	/**
 
	 * Retreieve the settings object from an instance
 
	 *  @returns {array} List of TR nodes which are currently selected
 
	 */
 
	"fnGetSelected": function ()
 
	{
 
		var out=[];
 
		var data=this.s.dt.aoData;
 
		var i, iLen;
 

	
 
		for ( i=0, iLen=data.length ; i<iLen ; i++ )
 
		{
 
			if ( data[i]._DTTT_selected )
 
			{
 
				out.push( data[i].nTr );
 
			}
 
		}
 

	
 
		return out;
 
	},
 

	
 

	
 
	/**
 
	 * Get the data source objects/arrays from DataTables for the selected rows (same as
 
	 * fnGetSelected followed by fnGetData on each row from the table)
 
	 *  @returns {array} Data from the TR nodes which are currently selected
 
	 */
 
	"fnGetSelectedData": function ()
 
	{
 
		var out = [];
 
		var data=this.s.dt.aoData;
 
		var i, iLen;
 

	
 
		for ( i=0, iLen=data.length ; i<iLen ; i++ )
 
		{
 
			if ( data[i]._DTTT_selected )
 
			{
 
				out.push( this.s.dt.oInstance.fnGetData(i) );
 
			}
 
		}
 

	
 
		return out;
 
	},
 
	
 
	
 
	/**
 
	 * Check to see if a current row is selected or not
 
	 *  @param {Node} n TR node to check if it is currently selected or not
 
	 *  @returns {Boolean} true if select, false otherwise
 
	 */
 
	"fnIsSelected": function ( n )
 
	{
 
		var pos = this.s.dt.oInstance.fnGetPosition( n );
 
		return (this.s.dt.aoData[pos]._DTTT_selected===true) ? true : false;
 
	},
 

	
 
	
 
	/**
 
	 * Select all rows in the table
 
	 *  @param {boolean} [filtered=false] Select only rows which are available 
 
	 *    given the filtering applied to the table. By default this is false - 
 
	 *    i.e. all rows, regardless of filtering are selected.
 
	 */
 
	"fnSelectAll": function ( filtered )
 
	{
 
		var s = this._fnGetMasterSettings();
 
		
 
		this._fnRowSelect( (filtered === true) ?
 
			s.dt.aiDisplay :
 
			s.dt.aoData
 
		);
 
	},
 

	
 
	
 
	/**
 
	 * Deselect all rows in the table
 
	 *  @param {boolean} [filtered=false] Deselect only rows which are available 
 
	 *    given the filtering applied to the table. By default this is false - 
 
	 *    i.e. all rows, regardless of filtering are deselected.
 
	 */
 
	"fnSelectNone": function ( filtered )
 
	{
 
		var s = this._fnGetMasterSettings();
 

	
 
		this._fnRowDeselect( (filtered === true) ?
 
			s.dt.aiDisplay :
 
			s.dt.aoData
 
		);
 
	},
 

	
 
	
 
	/**
 
	 * Select row(s)
 
	 *  @param {node|object|array} n The row(s) to select. Can be a single DOM
 
	 *    TR node, an array of TR nodes or a jQuery object.
 
	 */
 
	"fnSelect": function ( n )
 
	{
 
		if ( this.s.select.type == "single" )
 
		{
 
			this.fnSelectNone();
 
			this._fnRowSelect( n );
 
		}
 
		else if ( this.s.select.type == "multi" )
 
		{
 
			this._fnRowSelect( n );
 
		}
 
	},
 

	
 
	
 
	/**
 
	 * Deselect row(s)
 
	 *  @param {node|object|array} n The row(s) to deselect. Can be a single DOM
 
	 *    TR node, an array of TR nodes or a jQuery object.
 
	 */
 
	"fnDeselect": function ( n )
 
	{
 
		this._fnRowDeselect( n );
 
	},
 
	
 
	
 
	/**
 
	 * Get the title of the document - useful for file names. The title is retrieved from either
 
	 * the configuration object's 'title' parameter, or the HTML document title
 
	 *  @param   {Object} oConfig Button configuration object
 
	 *  @returns {String} Button title
 
	 */
 
	"fnGetTitle": function( oConfig )
 
	{
 
		var sTitle = "";
 
		if ( typeof oConfig.sTitle != 'undefined' && oConfig.sTitle !== "" ) {
 
			sTitle = oConfig.sTitle;
 
		} else {
 
			var anTitle = document.getElementsByTagName('title');
 
			if ( anTitle.length > 0 )
 
			{
 
				sTitle = anTitle[0].innerHTML;
 
			}
 
		}
 
		
 
		/* Strip characters which the OS will object to - checking for UTF8 support in the scripting
 
		 * engine
 
		 */
 
		if ( "\u00A1".toString().length < 4 ) {
 
			return sTitle.replace(/[^a-zA-Z0-9_\u00A1-\uFFFF\.,\-_ !\(\)]/g, "");
 
		} else {
 
			return sTitle.replace(/[^a-zA-Z0-9_\.,\-_ !\(\)]/g, "");
 
		}
 
	},
 
	
 
	
 
	/**
 
	 * Calculate a unity array with the column width by proportion for a set of columns to be
 
	 * included for a button. This is particularly useful for PDF creation, where we can use the
 
	 * column widths calculated by the browser to size the columns in the PDF.
 
	 *  @param   {Object} oConfig Button configuration object
 
	 *  @returns {Array} Unity array of column ratios
 
	 */
 
	"fnCalcColRatios": function ( oConfig )
 
	{
 
		var
 
			aoCols = this.s.dt.aoColumns,
 
			aColumnsInc = this._fnColumnTargets( oConfig.mColumns ),
 
			aColWidths = [],
 
			iWidth = 0, iTotal = 0, i, iLen;
 
		
 
		for ( i=0, iLen=aColumnsInc.length ; i<iLen ; i++ )
 
		{
 
			if ( aColumnsInc[i] )
 
			{
 
				iWidth = aoCols[i].nTh.offsetWidth;
 
				iTotal += iWidth;
 
				aColWidths.push( iWidth );
 
			}
 
		}
 
		
 
		for ( i=0, iLen=aColWidths.length ; i<iLen ; i++ )
 
		{
 
			aColWidths[i] = aColWidths[i] / iTotal;
 
		}
 
		
 
		return aColWidths.join('\t');
 
	},
 
	
 
	
 
	/**
 
	 * Get the information contained in a table as a string
 
	 *  @param   {Object} oConfig Button configuration object
 
	 *  @returns {String} Table data as a string
 
	 */
 
	"fnGetTableData": function ( oConfig )
 
	{
 
		/* In future this could be used to get data from a plain HTML source as well as DataTables */
 
		if ( this.s.dt )
 
		{
 
			return this._fnGetDataTablesData( oConfig );
 
		}
 
	},
 
	
 
	
 
	/**
 
	 * Pass text to a flash button instance, which will be used on the button's click handler
 
	 *  @param   {Object} clip Flash button object
 
	 *  @param   {String} text Text to set
 
	 */
 
	"fnSetText": function ( clip, text )
 
	{
 
		this._fnFlashSetText( clip, text );
 
	},
 
	
 
	
 
	/**
 
	 * Resize the flash elements of the buttons attached to this TableTools instance - this is
 
	 * useful for when initialising TableTools when it is hidden (display:none) since sizes can't
 
	 * be calculated at that time.
 
	 */
 
	"fnResizeButtons": function ()
 
	{
 
		for ( var cli in ZeroClipboard_TableTools.clients )
 
		{
 
			if ( cli )
 
			{
 
				var client = ZeroClipboard_TableTools.clients[cli];
 
				if ( typeof client.domElement != 'undefined' &&
 
					 client.domElement.parentNode )
 
				{
 
					client.positionElement();
 
				}
 
			}
 
		}
 
	},
 
	
 
	
 
	/**
 
	 * Check to see if any of the ZeroClipboard client's attached need to be resized
 
	 */
 
	"fnResizeRequired": function ()
 
	{
 
		for ( var cli in ZeroClipboard_TableTools.clients )
 
		{
 
			if ( cli )
 
			{
 
				var client = ZeroClipboard_TableTools.clients[cli];
 
				if ( typeof client.domElement != 'undefined' &&
 
					 client.domElement.parentNode == this.dom.container &&
 
					 client.sized === false )
 
				{
 
					return true;
 
				}
 
			}
 
		}
 
		return false;
 
	},
 
	
 
	
 
	/**
 
	 * Programmatically enable or disable the print view
 
	 *  @param {boolean} [bView=true] Show the print view if true or not given. If false, then
 
	 *    terminate the print view and return to normal.
 
	 *  @param {object} [oConfig={}] Configuration for the print view
 
	 *  @param {boolean} [oConfig.bShowAll=false] Show all rows in the table if true
 
	 *  @param {string} [oConfig.sInfo] Information message, displayed as an overlay to the
 
	 *    user to let them know what the print view is.
 
	 *  @param {string} [oConfig.sMessage] HTML string to show at the top of the document - will
 
	 *    be included in the printed document.
 
	 */
 
	"fnPrint": function ( bView, oConfig )
 
	{
 
		if ( oConfig === undefined )
 
		{
 
			oConfig = {};
 
		}
 

	
 
		if ( bView === undefined || bView )
 
		{
 
			this._fnPrintStart( oConfig );
 
		}
 
		else
 
		{
 
			this._fnPrintEnd();
 
		}
 
	},
 
	
 
	
 
	/**
 
	 * Show a message to the end user which is nicely styled
 
	 *  @param {string} message The HTML string to show to the user
 
	 *  @param {int} time The duration the message is to be shown on screen for (mS)
 
	 */
 
	"fnInfo": function ( message, time ) {
 
		var nInfo = document.createElement( "div" );
 
		nInfo.className = this.classes.print.info;
 
		nInfo.innerHTML = message;
 

	
 
		document.body.appendChild( nInfo );
 
		
 
		setTimeout( function() {
 
			$(nInfo).fadeOut( "normal", function() {
 
				document.body.removeChild( nInfo );
 
			} );
 
		}, time );
 
	},
 
	
 
	
 
	
 
	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 
	 * Private methods (they are of course public in JS, but recommended as private)
 
	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
	
 
	/**
 
	 * Constructor logic
 
	 *  @method  _fnConstruct
 
	 *  @param   {Object} oOpts Same as TableTools constructor
 
	 *  @returns void
 
	 *  @private 
 
	 */
 
	"_fnConstruct": function ( oOpts )
 
	{
 
		var that = this;
 
		
 
		this._fnCustomiseSettings( oOpts );
 
		
 
		/* Container element */
 
		this.dom.container = document.createElement( this.s.tags.container );
 
		this.dom.container.className = this.classes.container;
 
		
 
		/* Row selection config */
 
		if ( this.s.select.type != 'none' )
 
		{
 
			this._fnRowSelectConfig();
 
		}
 
		
 
		/* Buttons */
 
		this._fnButtonDefinations( this.s.buttonSet, this.dom.container );
 
		
 
		/* Destructor - need to wipe the DOM for IE's garbage collector */
 
		this.s.dt.aoDestroyCallback.push( {
 
			"sName": "TableTools",
 
			"fn": function () {
 
				that.dom.container.innerHTML = "";
 
			}
 
		} );
 
	},
 
	
 
	
 
	/**
 
	 * Take the user defined settings and the default settings and combine them.
 
	 *  @method  _fnCustomiseSettings
 
	 *  @param   {Object} oOpts Same as TableTools constructor
 
	 *  @returns void
 
	 *  @private 
 
	 */
 
	"_fnCustomiseSettings": function ( oOpts )
 
	{
 
		/* Is this the master control instance or not? */
 
		if ( typeof this.s.dt._TableToolsInit == 'undefined' )
 
		{
 
			this.s.master = true;
 
			this.s.dt._TableToolsInit = true;
 
		}
 
		
 
		/* We can use the table node from comparisons to group controls */
 
		this.dom.table = this.s.dt.nTable;
 
		
 
		/* Clone the defaults and then the user options */
 
		this.s.custom = $.extend( {}, TableTools.DEFAULTS, oOpts );
 
		
 
		/* Flash file location */
 
		this.s.swfPath = this.s.custom.sSwfPath;
 
		if ( typeof ZeroClipboard_TableTools != 'undefined' )
 
		{
 
			ZeroClipboard_TableTools.moviePath = this.s.swfPath;
 
		}
 
		
 
		/* Table row selecting */
 
		this.s.select.type = this.s.custom.sRowSelect;
 
		this.s.select.preRowSelect = this.s.custom.fnPreRowSelect;
 
		this.s.select.postSelected = this.s.custom.fnRowSelected;
 
		this.s.select.postDeselected = this.s.custom.fnRowDeselected;
 

	
 
		// Backwards compatibility - allow the user to specify a custom class in the initialiser
 
		if ( this.s.custom.sSelectedClass )
 
		{
 
			this.classes.select.row = this.s.custom.sSelectedClass;
 
		}
 

	
 
		this.s.tags = this.s.custom.oTags;
 

	
 
		/* Button set */
 
		this.s.buttonSet = this.s.custom.aButtons;
 
	},
 
	
 
	
 
	/**
 
	 * Take the user input arrays and expand them to be fully defined, and then add them to a given
 
	 * DOM element
 
	 *  @method  _fnButtonDefinations
 
	 *  @param {array} buttonSet Set of user defined buttons
 
	 *  @param {node} wrapper Node to add the created buttons to
 
	 *  @returns void
 
	 *  @private 
 
	 */
 
	"_fnButtonDefinations": function ( buttonSet, wrapper )
 
	{
 
		var buttonDef;
 
		
 
		for ( var i=0, iLen=buttonSet.length ; i<iLen ; i++ )
 
		{
 
			if ( typeof buttonSet[i] == "string" )
 
			{
 
				if ( typeof TableTools.BUTTONS[ buttonSet[i] ] == 'undefined' )
 
				{
 
					alert( "TableTools: Warning - unknown button type: "+buttonSet[i] );
 
					continue;
 
				}
 
				buttonDef = $.extend( {}, TableTools.BUTTONS[ buttonSet[i] ], true );
 
			}
 
			else
 
			{
 
				if ( typeof TableTools.BUTTONS[ buttonSet[i].sExtends ] == 'undefined' )
 
				{
 
					alert( "TableTools: Warning - unknown button type: "+buttonSet[i].sExtends );
 
					continue;
 
				}
 
				var o = $.extend( {}, TableTools.BUTTONS[ buttonSet[i].sExtends ], true );
 
				buttonDef = $.extend( o, buttonSet[i], true );
 
			}
 
			
 
			wrapper.appendChild( this._fnCreateButton( 
 
				buttonDef, 
 
				$(wrapper).hasClass(this.classes.collection.container)
 
			) );
 
		}
 
	},
 
	
 
	
 
	/**
 
	 * Create and configure a TableTools button
 
	 *  @method  _fnCreateButton
 
	 *  @param   {Object} oConfig Button configuration object
 
	 *  @returns {Node} Button element
 
	 *  @private 
 
	 */
 
	"_fnCreateButton": function ( oConfig, bCollectionButton )
 
	{
 
	  var nButton = this._fnButtonBase( oConfig, bCollectionButton );
 
		
 
		if ( oConfig.sAction.match(/flash/) )
 
		{
 
			this._fnFlashConfig( nButton, oConfig );
 
		}
 
		else if ( oConfig.sAction == "text" )
 
		{
 
			this._fnTextConfig( nButton, oConfig );
 
		}
 
		else if ( oConfig.sAction == "div" )
 
		{
 
			this._fnTextConfig( nButton, oConfig );
 
		}
 
		else if ( oConfig.sAction == "collection" )
 
		{
 
			this._fnTextConfig( nButton, oConfig );
 
			this._fnCollectionConfig( nButton, oConfig );
 
		}
 
		
 
		return nButton;
 
	},
 
	
 
	
 
	/**
 
	 * Create the DOM needed for the button and apply some base properties. All buttons start here
 
	 *  @method  _fnButtonBase
 
	 *  @param   {o} oConfig Button configuration object
 
	 *  @returns {Node} DIV element for the button
 
	 *  @private 
 
	 */
 
	"_fnButtonBase": function ( o, bCollectionButton )
 
	{
 
		var sTag, sLiner, sClass;
 

	
 
		if ( bCollectionButton )
 
		{
 
			sTag = o.sTag !== "default" ? o.sTag : this.s.tags.collection.button;
 
			sLiner = o.sLinerTag !== "default" ? o.sLiner : this.s.tags.collection.liner;
 
			sClass = this.classes.collection.buttons.normal;
 
		}
 
		else
 
		{
 
			sTag = o.sTag !== "default" ? o.sTag : this.s.tags.button;
 
			sLiner = o.sLinerTag !== "default" ? o.sLiner : this.s.tags.liner;
 
			sClass = this.classes.buttons.normal;
 
		}
 

	
 
		var
 
		  nButton = document.createElement( sTag ),
 
		  nSpan = document.createElement( sLiner ),
 
		  masterS = this._fnGetMasterSettings();
 
		
 
		nButton.className = sClass+" "+o.sButtonClass;
 
		nButton.setAttribute('id', "ToolTables_"+this.s.dt.sInstance+"_"+masterS.buttonCounter );
 
		nButton.appendChild( nSpan );
 
		nSpan.innerHTML = o.sButtonText;
 
		
 
		masterS.buttonCounter++;
 
		
 
		return nButton;
 
	},
 
	
 
	
 
	/**
 
	 * Get the settings object for the master instance. When more than one TableTools instance is
 
	 * assigned to a DataTable, only one of them can be the 'master' (for the select rows). As such,
 
	 * we will typically want to interact with that master for global properties.
 
	 *  @method  _fnGetMasterSettings
 
	 *  @returns {Object} TableTools settings object
 
	 *  @private 
 
	 */
 
	"_fnGetMasterSettings": function ()
 
	{
 
		if ( this.s.master )
 
		{
 
			return this.s;
 
		}
 
		else
 
		{
 
			/* Look for the master which has the same DT as this one */
 
			var instances = TableTools._aInstances;
 
			for ( var i=0, iLen=instances.length ; i<iLen ; i++ )
 
			{
 
				if ( this.dom.table == instances[i].s.dt.nTable )
 
				{
 
					return instances[i].s;
 
				}
 
			}
 
		}
 
	},
 
	
 
	
 
	
 
	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 
	 * Button collection functions
 
	 */
 
	
 
	/**
 
	 * Create a collection button, when activated will present a drop down list of other buttons
 
	 *  @param   {Node} nButton Button to use for the collection activation
 
	 *  @param   {Object} oConfig Button configuration object
 
	 *  @returns void
 
	 *  @private
 
	 */
 
	"_fnCollectionConfig": function ( nButton, oConfig )
 
	{
 
		var nHidden = document.createElement( this.s.tags.collection.container );
 
		nHidden.style.display = "none";
 
		nHidden.className = this.classes.collection.container;
 
		oConfig._collection = nHidden;
 
		document.body.appendChild( nHidden );
 
		
 
		this._fnButtonDefinations( oConfig.aButtons, nHidden );
 
	},
 
	
 
	
 
	/**
 
	 * Show a button collection
 
	 *  @param   {Node} nButton Button to use for the collection
 
	 *  @param   {Object} oConfig Button configuration object
 
	 *  @returns void
 
	 *  @private
 
	 */
 
	"_fnCollectionShow": function ( nButton, oConfig )
 
	{
 
		var
 
			that = this,
 
			oPos = $(nButton).offset(),
 
			nHidden = oConfig._collection,
 
			iDivX = oPos.left,
 
			iDivY = oPos.top + $(nButton).outerHeight(),
 
			iWinHeight = $(window).height(), iDocHeight = $(document).height(),
 
		 	iWinWidth = $(window).width(), iDocWidth = $(document).width();
 
		
 
		nHidden.style.position = "absolute";
 
		nHidden.style.left = iDivX+"px";
 
		nHidden.style.top = iDivY+"px";
 
		nHidden.style.display = "block";
 
		$(nHidden).css('opacity',0);
 
		
 
		var nBackground = document.createElement('div');
 
		nBackground.style.position = "absolute";
 
		nBackground.style.left = "0px";
 
		nBackground.style.top = "0px";
 
		nBackground.style.height = ((iWinHeight>iDocHeight)? iWinHeight : iDocHeight) +"px";
 
		nBackground.style.width = ((iWinWidth>iDocWidth)? iWinWidth : iDocWidth) +"px";
 
		nBackground.className = this.classes.collection.background;
 
		$(nBackground).css('opacity',0);
 
		
 
		document.body.appendChild( nBackground );
 
		document.body.appendChild( nHidden );
 
		
 
		/* Visual corrections to try and keep the collection visible */
 
		var iDivWidth = $(nHidden).outerWidth();
 
		var iDivHeight = $(nHidden).outerHeight();
 
		
 
		if ( iDivX + iDivWidth > iDocWidth )
 
		{
 
			nHidden.style.left = (iDocWidth-iDivWidth)+"px";
 
		}
 
		
 
		if ( iDivY + iDivHeight > iDocHeight )
 
		{
 
			nHidden.style.top = (iDivY-iDivHeight-$(nButton).outerHeight())+"px";
 
		}
 
	
 
		this.dom.collection.collection = nHidden;
 
		this.dom.collection.background = nBackground;
 
		
 
		/* This results in a very small delay for the end user but it allows the animation to be
 
		 * much smoother. If you don't want the animation, then the setTimeout can be removed
 
		 */
 
		setTimeout( function () {
 
			$(nHidden).animate({"opacity": 1}, 500);
 
			$(nBackground).animate({"opacity": 0.25}, 500);
 
		}, 10 );
 

	
 
		/* Resize the buttons to the Flash contents fit */
 
		this.fnResizeButtons();
 
		
 
		/* Event handler to remove the collection display */
 
		$(nBackground).click( function () {
 
			that._fnCollectionHide.call( that, null, null );
 
		} );
 
	},
 
	
 
	
 
	/**
 
	 * Hide a button collection
 
	 *  @param   {Node} nButton Button to use for the collection
 
	 *  @param   {Object} oConfig Button configuration object
 
	 *  @returns void
 
	 *  @private
 
	 */
 
	"_fnCollectionHide": function ( nButton, oConfig )
 
	{
 
		if ( oConfig !== null && oConfig.sExtends == 'collection' )
 
		{
 
			return;
 
		}
 
		
 
		if ( this.dom.collection.collection !== null )
 
		{
 
			$(this.dom.collection.collection).animate({"opacity": 0}, 500, function (e) {
 
				this.style.display = "none";
 
			} );
 
			
 
			$(this.dom.collection.background).animate({"opacity": 0}, 500, function (e) {
 
				this.parentNode.removeChild( this );
 
			} );
 
			
 
			this.dom.collection.collection = null;
 
			this.dom.collection.background = null;
 
		}
 
	},
 
	
 
	
 
	
 
	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 
	 * Row selection functions
 
	 */
 
	
 
	/**
 
	 * Add event handlers to a table to allow for row selection
 
	 *  @method  _fnRowSelectConfig
 
	 *  @returns void
 
	 *  @private 
 
	 */
 
	"_fnRowSelectConfig": function ()
 
	{
 
		if ( this.s.master )
 
		{
 
			var
 
				that = this, 
 
				i, iLen, 
 
				dt = this.s.dt,
 
				aoOpenRows = this.s.dt.aoOpenRows;
 
			
 
			$(dt.nTable).addClass( this.classes.select.table );
 
			
 
			$('tr', dt.nTBody).live( 'click', function(e) {
 
				/* Sub-table must be ignored (odd that the selector won't do this with >) */
 
				if ( this.parentNode != dt.nTBody )
 
				{
 
					return;
 
				}
 
				
 
				/* Check that we are actually working with a DataTables controlled row */
 
				if ( dt.oInstance.fnGetData(this) === null )
 
				{
 
				    return;
 
				}
 
				
 
				/* User defined selection function */
 
				if ( that.s.select.preRowSelect !== null && !that.s.select.preRowSelect.call(that, e) )
 
				{
 
					return;
 
				}
 

	
 
				if ( that.fnIsSelected( this ) )
 
				{
 
					that._fnRowDeselect( this );
 
				}
 
				else if ( that.s.select.type == "single" )
 
				{
 
					that.fnSelectNone();
 
					that._fnRowSelect( this );
 
				}
 
				else if ( that.s.select.type == "multi" )
 
				{
 
					that._fnRowSelect( this );
 
				}
 
			} );
 

	
 
			// Bind a listener to the DataTable for when new rows are created.
 
			// This allows rows to be visually selected when they should be and
 
			// deferred rendering is used.
 
			dt.oApi._fnCallbackReg( dt, 'aoRowCreatedCallback', function (tr, data, index) {
 
				if ( dt.aoData[index]._DTTT_selected ) {
 
					$(tr).addClass( that.classes.select.row );
 
				}
 
			}, 'TableTools-SelectAll' );
 
		}
 
	},
 

	
 
	/**
 
	 * Select rows
 
	 *  @param   {*} src Rows to select - see _fnSelectData for a description of valid inputs
 
	 *  @private 
 
	 */
 
	"_fnRowSelect": function ( src )
 
	{
 
		var data = this._fnSelectData( src );
 
		var firstTr = data.length===0 ? null : data[0].nTr;
 

	
 
		for ( var i=0, iLen=data.length ; i<iLen ; i++ )
 
		{
 
			data[i]._DTTT_selected = true;
 

	
 
			if ( data[i].nTr )
 
			{
 
				$(data[i].nTr).addClass( this.classes.select.row );
 
			}
 
		}
 

	
 
		if ( this.s.select.postSelected !== null )
 
		{
 
			this.s.select.postSelected.call( this, firstTr );
 
		}
 

	
 
		TableTools._fnEventDispatch( this, 'select', firstTr );
 
	},
 

	
 
	/**
 
	 * Deselect rows
 
	 *  @param   {*} src Rows to deselect - see _fnSelectData for a description of valid inputs
 
	 *  @private 
 
	 */
 
	"_fnRowDeselect": function ( src )
 
	{
 
		var data = this._fnSelectData( src );
 
		var firstTr = data.length===0 ? null : data[0].nTr;
 

	
 
		for ( var i=0, iLen=data.length ; i<iLen ; i++ )
 
		{
 
			if ( data[i].nTr && data[i]._DTTT_selected )
 
			{
 
				$(data[i].nTr).removeClass( this.classes.select.row );
 
			}
 

	
 
			data[i]._DTTT_selected = false;
 
		}
 

	
 
		if ( this.s.select.postDeselected !== null )
 
		{
 
			this.s.select.postDeselected.call( this, firstTr );
 
		}
 

	
 
		TableTools._fnEventDispatch( this, 'select', firstTr );
 
	},
 
	
 
	/**
 
	 * Take a data source for row selection and convert it into aoData points for the DT
 
	 *   @param {*} src Can be a single DOM TR node, an array of TR nodes (including a
 
	 *     a jQuery object), a single aoData point from DataTables, an array of aoData
 
	 *     points or an array of aoData indexes
 
	 *   @returns {array} An array of aoData points
 
	 */
 
	"_fnSelectData": function ( src )
 
	{
 
		var out = [], pos, i, iLen;
 

	
 
		if ( src.nodeName )
 
		{
 
			// Single node
 
			pos = this.s.dt.oInstance.fnGetPosition( src );
 
			out.push( this.s.dt.aoData[pos] );
 
		}
 
		else if ( typeof src.length !== 'undefined' )
 
		{
 
			// jQuery object or an array of nodes, or aoData points
 
			for ( i=0, iLen=src.length ; i<iLen ; i++ )
 
			{
 
				if ( src[i].nodeName )
 
				{
 
					pos = this.s.dt.oInstance.fnGetPosition( src[i] );
 
					out.push( this.s.dt.aoData[pos] );
 
				}
 
				else if ( typeof src[i] === 'number' )
 
				{
 
					out.push( this.s.dt.aoData[ src[i] ] );
 
				}
 
				else
 
				{
 
					out.push( src[i] );
 
				}
 
			}
 

	
 
			return out;
 
		}
 
		else
 
		{
 
			// A single aoData point
 
			out.push( src );
 
		}
 

	
 
		return out;
 
	},
 
	
 
	
 
	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 
	 * Text button functions
 
	 */
 
	
 
	/**
 
	 * Configure a text based button for interaction events
 
	 *  @method  _fnTextConfig
 
	 *  @param   {Node} nButton Button element which is being considered
 
	 *  @param   {Object} oConfig Button configuration object
 
	 *  @returns void
 
	 *  @private 
 
	 */
 
	"_fnTextConfig": function ( nButton, oConfig )
 
	{
 
		var that = this;
 
		
 
		if ( oConfig.fnInit !== null )
 
		{
 
			oConfig.fnInit.call( this, nButton, oConfig );
 
		}
 
		
 
		if ( oConfig.sToolTip !== "" )
 
		{
 
			nButton.title = oConfig.sToolTip;
 
		}
 
		
 
		$(nButton).hover( function () {
 
			if ( oConfig.fnMouseover !== null )
 
			{
 
				oConfig.fnMouseover.call( this, nButton, oConfig, null );
 
			}
 
		}, function () {
 
			if ( oConfig.fnMouseout !== null )
 
			{
 
				oConfig.fnMouseout.call( this, nButton, oConfig, null );
 
			}
 
		} );
 
		
 
		if ( oConfig.fnSelect !== null )
 
		{
 
			TableTools._fnEventListen( this, 'select', function (n) {
 
				oConfig.fnSelect.call( that, nButton, oConfig, n );
 
			} );
 
		}
 
		
 
		$(nButton).click( function (e) {
 
			//e.preventDefault();
 
			
 
			if ( oConfig.fnClick !== null )
 
			{
 
				oConfig.fnClick.call( that, nButton, oConfig, null );
 
			}
 
			
 
			/* Provide a complete function to match the behaviour of the flash elements */
 
			if ( oConfig.fnComplete !== null )
 
			{
 
				oConfig.fnComplete.call( that, nButton, oConfig, null, null );
 
			}
 
			
 
			that._fnCollectionHide( nButton, oConfig );
 
		} );
 
	},
 
	
 
	
 
	
 
	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 
	 * Flash button functions
 
	 */
 
	
 
	/**
 
	 * Configure a flash based button for interaction events
 
	 *  @method  _fnFlashConfig
 
	 *  @param   {Node} nButton Button element which is being considered
 
	 *  @param   {o} oConfig Button configuration object
 
	 *  @returns void
 
	 *  @private 
 
	 */
 
	"_fnFlashConfig": function ( nButton, oConfig )
 
	{
 
		var that = this;
 
		var flash = new ZeroClipboard_TableTools.Client();
 
		
 
		if ( oConfig.fnInit !== null )
 
		{
 
			oConfig.fnInit.call( this, nButton, oConfig );
 
		}
 
		
 
		flash.setHandCursor( true );
 
		
 
		if ( oConfig.sAction == "flash_save" )
 
		{
 
			flash.setAction( 'save' );
 
			flash.setCharSet( (oConfig.sCharSet=="utf16le") ? 'UTF16LE' : 'UTF8' );
 
			flash.setBomInc( oConfig.bBomInc );
 
			flash.setFileName( oConfig.sFileName.replace('*', this.fnGetTitle(oConfig)) );
 
		}
 
		else if ( oConfig.sAction == "flash_pdf" )
 
		{
 
			flash.setAction( 'pdf' );
 
			flash.setFileName( oConfig.sFileName.replace('*', this.fnGetTitle(oConfig)) );
 
		}
 
		else
 
		{
 
			flash.setAction( 'copy' );
 
		}
 
		
 
		flash.addEventListener('mouseOver', function(client) {
 
			if ( oConfig.fnMouseover !== null )
 
			{
 
				oConfig.fnMouseover.call( that, nButton, oConfig, flash );
 
			}
 
		} );
 
		
 
		flash.addEventListener('mouseOut', function(client) {
 
			if ( oConfig.fnMouseout !== null )
 
			{
 
				oConfig.fnMouseout.call( that, nButton, oConfig, flash );
 
			}
 
		} );
 
		
 
		flash.addEventListener('mouseDown', function(client) {
 
			if ( oConfig.fnClick !== null )
 
			{
 
				oConfig.fnClick.call( that, nButton, oConfig, flash );
 
			}
 
		} );
 
		
 
		flash.addEventListener('complete', function (client, text) {
 
			if ( oConfig.fnComplete !== null )
 
			{
 
				oConfig.fnComplete.call( that, nButton, oConfig, flash, text );
 
			}
 
			that._fnCollectionHide( nButton, oConfig );
 
		} );
 
		
 
		this._fnFlashGlue( flash, nButton, oConfig.sToolTip );
 
	},
 
	
 
	
 
	/**
 
	 * Wait until the id is in the DOM before we "glue" the swf. Note that this function will call
 
	 * itself (using setTimeout) until it completes successfully
 
	 *  @method  _fnFlashGlue
 
	 *  @param   {Object} clip Zero clipboard object
 
	 *  @param   {Node} node node to glue swf to
 
	 *  @param   {String} text title of the flash movie
 
	 *  @returns void
 
	 *  @private 
 
	 */
 
	"_fnFlashGlue": function ( flash, node, text )
 
	{
 
		var that = this;
 
		var id = node.getAttribute('id');
 
		
 
		if ( document.getElementById(id) )
 
		{
 
			flash.glue( node, text );
 
		}
 
		else
 
		{
 
			setTimeout( function () {
 
				that._fnFlashGlue( flash, node, text );
 
			}, 100 );
 
		}
 
	},
 
	
 
	
 
	/**
 
	 * Set the text for the flash clip to deal with
 
	 * 
 
	 * This function is required for large information sets. There is a limit on the 
 
	 * amount of data that can be transferred between Javascript and Flash in a single call, so
 
	 * we use this method to build up the text in Flash by sending over chunks. It is estimated
 
	 * that the data limit is around 64k, although it is undocumented, and appears to be different
 
	 * between different flash versions. We chunk at 8KiB.
 
	 *  @method  _fnFlashSetText
 
	 *  @param   {Object} clip the ZeroClipboard object
 
	 *  @param   {String} sData the data to be set
 
	 *  @returns void
 
	 *  @private 
 
	 */
 
	"_fnFlashSetText": function ( clip, sData )
 
	{
 
		var asData = this._fnChunkData( sData, 8192 );
 
		
 
		clip.clearText();
 
		for ( var i=0, iLen=asData.length ; i<iLen ; i++ )
 
		{
 
			clip.appendText( asData[i] );
 
		}
 
	},
 
	
 
	
 
	
 
	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 
	 * Data retrieval functions
 
	 */
 
	
 
	/**
 
	 * Convert the mixed columns variable into a boolean array the same size as the columns, which
 
	 * indicates which columns we want to include
 
	 *  @method  _fnColumnTargets
 
	 *  @param   {String|Array} mColumns The columns to be included in data retrieval. If a string
 
	 *			 then it can take the value of "visible" or "hidden" (to include all visible or
 
	 *			 hidden columns respectively). Or an array of column indexes
 
	 *  @returns {Array} A boolean array the length of the columns of the table, which each value
 
	 *			 indicating if the column is to be included or not
 
	 *  @private 
 
	 */
 
	"_fnColumnTargets": function ( mColumns )
 
	{
 
		var aColumns = [];
 
		var dt = this.s.dt;
 
		
 
		if ( typeof mColumns == "object" )
 
		{
 
			for ( i=0, iLen=dt.aoColumns.length ; i<iLen ; i++ )
 
			{
 
				aColumns.push( false );
 
			}
 
			
 
			for ( i=0, iLen=mColumns.length ; i<iLen ; i++ )
 
			{
 
				aColumns[ mColumns[i] ] = true;
 
			}
 
		}
 
		else if ( mColumns == "visible" )
 
		{
 
			for ( i=0, iLen=dt.aoColumns.length ; i<iLen ; i++ )
 
			{
 
				aColumns.push( dt.aoColumns[i].bVisible ? true : false );
 
			}
 
		}
 
		else if ( mColumns == "hidden" )
 
		{
 
			for ( i=0, iLen=dt.aoColumns.length ; i<iLen ; i++ )
 
			{
 
				aColumns.push( dt.aoColumns[i].bVisible ? false : true );
 
			}
 
		}
 
		else if ( mColumns == "sortable" )
 
		{
 
			for ( i=0, iLen=dt.aoColumns.length ; i<iLen ; i++ )
 
			{
 
				aColumns.push( dt.aoColumns[i].bSortable ? true : false );
 
			}
 
		}
 
		else /* all */
 
		{
 
			for ( i=0, iLen=dt.aoColumns.length ; i<iLen ; i++ )
 
			{
 
				aColumns.push( true );
 
			}
 
		}
 
		
 
		return aColumns;
 
	},
 
	
 
	
 
	/**
 
	 * New line character(s) depend on the platforms
 
	 *  @method  method
 
	 *  @param   {Object} oConfig Button configuration object - only interested in oConfig.sNewLine
 
	 *  @returns {String} Newline character
 
	 */
 
	"_fnNewline": function ( oConfig )
 
	{
 
		if ( oConfig.sNewLine == "auto" )
 
		{
 
			return navigator.userAgent.match(/Windows/) ? "\r\n" : "\n";
 
		}
 
		else
 
		{
 
			return oConfig.sNewLine;
 
		}
 
	},
 
	
 
	
 
	/**
 
	 * Get data from DataTables' internals and format it for output
 
	 *  @method  _fnGetDataTablesData
 
	 *  @param   {Object} oConfig Button configuration object
 
	 *  @param   {String} oConfig.sFieldBoundary Field boundary for the data cells in the string
 
	 *  @param   {String} oConfig.sFieldSeperator Field separator for the data cells
 
	 *  @param   {String} oConfig.sNewline New line options
 
	 *  @param   {Mixed} oConfig.mColumns Which columns should be included in the output
 
	 *  @param   {Boolean} oConfig.bHeader Include the header
 
	 *  @param   {Boolean} oConfig.bFooter Include the footer
 
	 *  @param   {Boolean} oConfig.bSelectedOnly Include only the selected rows in the output
 
	 *  @returns {String} Concatenated string of data
 
	 *  @private 
 
	 */
 
	"_fnGetDataTablesData": function ( oConfig )
 
	{
 
		var i, iLen, j, jLen;
 
		var aRow, aData=[], sLoopData='', arr;
 
		var dt = this.s.dt, tr, child;
 
		var regex = new RegExp(oConfig.sFieldBoundary, "g"); /* Do it here for speed */
 
		var aColumnsInc = this._fnColumnTargets( oConfig.mColumns );
 
		var bSelectedOnly = (typeof oConfig.bSelectedOnly != 'undefined') ? oConfig.bSelectedOnly : false;
 
		
 
		/*
 
		 * Header
 
		 */
 
		if ( oConfig.bHeader )
 
		{
 
			aRow = [];
 
			
 
			for ( i=0, iLen=dt.aoColumns.length ; i<iLen ; i++ )
 
			{
 
				if ( aColumnsInc[i] )
 
				{
 
					sLoopData = dt.aoColumns[i].sTitle.replace(/\n/g," ").replace( /<.*?>/g, "" ).replace(/^\s+|\s+$/g,"");
 
					sLoopData = this._fnHtmlDecode( sLoopData );
 
					
 
					aRow.push( this._fnBoundData( sLoopData, oConfig.sFieldBoundary, regex ) );
 
				}
 
			}
 

	
 
			aData.push( aRow.join(oConfig.sFieldSeperator) );
 
		}
 
		
 
		/*
 
		 * Body
 
		 */
 
		var aDataIndex = dt.aiDisplay;
 
		var aSelected = this.fnGetSelected();
 
		if ( this.s.select.type !== "none" && bSelectedOnly && aSelected.length !== 0 )
 
		{
 
			aDataIndex = [];
 
			for ( i=0, iLen=aSelected.length ; i<iLen ; i++ )
 
			{
 
				aDataIndex.push( dt.oInstance.fnGetPosition( aSelected[i] ) );
 
			}
 
		}
 
		
 
		for ( j=0, jLen=aDataIndex.length ; j<jLen ; j++ )
 
		{
 
			tr = dt.aoData[ aDataIndex[j] ].nTr;
 
			aRow = [];
 
			
 
			/* Columns */
 
			for ( i=0, iLen=dt.aoColumns.length ; i<iLen ; i++ )
 
			{
 
				if ( aColumnsInc[i] )
 
				{
 
					/* Convert to strings (with small optimisation) */
 
					var mTypeData = dt.oApi._fnGetCellData( dt, aDataIndex[j], i, 'display' );
 
					if ( oConfig.fnCellRender )
 
					{
 
						sLoopData = oConfig.fnCellRender( mTypeData, i, tr, aDataIndex[j] )+"";
 
					}
 
					else if ( typeof mTypeData == "string" )
 
					{
 
						/* Strip newlines, replace img tags with alt attr. and finally strip html... */
 
						sLoopData = mTypeData.replace(/\n/g," ");
 
						sLoopData =
 
						 	sLoopData.replace(/<img.*?\s+alt\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s>]+)).*?>/gi,
 
						 		'$1$2$3');
 
						sLoopData = sLoopData.replace( /<.*?>/g, "" );
 
					}
 
					else
 
					{
 
						sLoopData = mTypeData+"";
 
					}
 
					
 
					/* Trim and clean the data */
 
					sLoopData = sLoopData.replace(/^\s+/, '').replace(/\s+$/, '');
 
					sLoopData = this._fnHtmlDecode( sLoopData );
 
					
 
					/* Bound it and add it to the total data */
 
					aRow.push( this._fnBoundData( sLoopData, oConfig.sFieldBoundary, regex ) );
 
				}
 
			}
 
      
 
			aData.push( aRow.join(oConfig.sFieldSeperator) );
 
      
 
			/* Details rows from fnOpen */
 
			if ( oConfig.bOpenRows )
 
			{
 
				arr = $.grep(dt.aoOpenRows, function(o) { return o.nParent === tr; });
 
				
 
				if ( arr.length === 1 )
 
				{
 
					sLoopData = this._fnBoundData( $('td', arr[0].nTr).html(), oConfig.sFieldBoundary, regex );
 
					aData.push( sLoopData );
 
				}
 
			}
 
		}
 
		
 
		/*
 
		 * Footer
 
		 */
 
		if ( oConfig.bFooter && dt.nTFoot !== null )
 
		{
 
			aRow = [];
 
			
 
			for ( i=0, iLen=dt.aoColumns.length ; i<iLen ; i++ )
 
			{
 
				if ( aColumnsInc[i] && dt.aoColumns[i].nTf !== null )
 
				{
 
					sLoopData = dt.aoColumns[i].nTf.innerHTML.replace(/\n/g," ").replace( /<.*?>/g, "" );
 
					sLoopData = this._fnHtmlDecode( sLoopData );
 
					
 
					aRow.push( this._fnBoundData( sLoopData, oConfig.sFieldBoundary, regex ) );
 
				}
 
			}
 
			
 
			aData.push( aRow.join(oConfig.sFieldSeperator) );
 
		}
 
		
 
		_sLastData = aData.join( this._fnNewline(oConfig) );
 
		return _sLastData;
 
	},
 
	
 
	
 
	/**
 
	 * Wrap data up with a boundary string
 
	 *  @method  _fnBoundData
 
	 *  @param   {String} sData data to bound
 
	 *  @param   {String} sBoundary bounding char(s)
 
	 *  @param   {RegExp} regex search for the bounding chars - constructed outside for efficiency
 
	 *			 in the loop
 
	 *  @returns {String} bound data
 
	 *  @private 
 
	 */
 
	"_fnBoundData": function ( sData, sBoundary, regex )
 
	{
 
		if ( sBoundary === "" )
 
		{
 
			return sData;
 
		}
 
		else
 
		{
 
			return sBoundary + sData.replace(regex, sBoundary+sBoundary) + sBoundary;
 
		}
 
	},
 
	
 
	
 
	/**
 
	 * Break a string up into an array of smaller strings
 
	 *  @method  _fnChunkData
 
	 *  @param   {String} sData data to be broken up
 
	 *  @param   {Int} iSize chunk size
 
	 *  @returns {Array} String array of broken up text
 
	 *  @private 
 
	 */
 
	"_fnChunkData": function ( sData, iSize )
 
	{
 
		var asReturn = [];
 
		var iStrlen = sData.length;
 
		
 
		for ( var i=0 ; i<iStrlen ; i+=iSize )
 
		{
 
			if ( i+iSize < iStrlen )
 
			{
 
				asReturn.push( sData.substring( i, i+iSize ) );
 
			}
 
			else
 
			{
 
				asReturn.push( sData.substring( i, iStrlen ) );
 
			}
 
		}
 
		
 
		return asReturn;
 
	},
 
	
 
	
 
	/**
 
	 * Decode HTML entities
 
	 *  @method  _fnHtmlDecode
 
	 *  @param   {String} sData encoded string
 
	 *  @returns {String} decoded string
 
	 *  @private 
 
	 */
 
	"_fnHtmlDecode": function ( sData )
 
	{
 
		if ( sData.indexOf('&') == -1 )
 
		{
 
			return sData;
 
		}
 
		
 
		var 
 
			aData = this._fnChunkData( sData, 2048 ),
 
			n = document.createElement('div'),
 
			i, iLen, iIndex,
 
			sReturn = "", sInner;
 
		
 
		/* nodeValue has a limit in browsers - so we chunk the data into smaller segments to build
 
		 * up the string. Note that the 'trick' here is to remember than we might have split over
 
		 * an HTML entity, so we backtrack a little to make sure this doesn't happen
 
		 */
 
		for ( i=0, iLen=aData.length ; i<iLen ; i++ )
 
		{
 
			/* Magic number 8 is because no entity is longer then strlen 8 in ISO 8859-1 */
 
			iIndex = aData[i].lastIndexOf( '&' );
 
			if ( iIndex != -1 && aData[i].length >= 8 && iIndex > aData[i].length - 8 )
 
			{
 
				sInner = aData[i].substr( iIndex );
 
				aData[i] = aData[i].substr( 0, iIndex );
 
			}
 
			
 
			n.innerHTML = aData[i];
 
			sReturn += n.childNodes[0].nodeValue;
 
		}
 
		
 
		return sReturn;
 
	},
 
	
 
	
 
	
 
	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 
	 * Printing functions
 
	 */
 
	
 
	/**
 
	 * Show print display
 
	 *  @method  _fnPrintStart
 
	 *  @param   {Event} e Event object
 
	 *  @param   {Object} oConfig Button configuration object
 
	 *  @returns void
 
	 *  @private 
 
	 */
 
	"_fnPrintStart": function ( oConfig )
 
	{
 
	  var that = this;
 
	  var oSetDT = this.s.dt;
 
	  
 
		/* Parse through the DOM hiding everything that isn't needed for the table */
 
		this._fnPrintHideNodes( oSetDT.nTable );
 
		
 
		/* Show the whole table */
 
		this.s.print.saveStart = oSetDT._iDisplayStart;
 
		this.s.print.saveLength = oSetDT._iDisplayLength;
 

	
 
		if ( oConfig.bShowAll )
 
		{
 
			oSetDT._iDisplayStart = 0;
 
			oSetDT._iDisplayLength = -1;
 
			oSetDT.oApi._fnCalculateEnd( oSetDT );
 
			oSetDT.oApi._fnDraw( oSetDT );
 
		}
 
		
 
		/* Adjust the display for scrolling which might be done by DataTables */
 
		if ( oSetDT.oScroll.sX !== "" || oSetDT.oScroll.sY !== "" )
 
		{
 
			this._fnPrintScrollStart( oSetDT );
 
		}
 
		
 
		/* Remove the other DataTables feature nodes - but leave the table! and info div */
 
		var anFeature = oSetDT.aanFeatures;
 
		for ( var cFeature in anFeature )
 
		{
 
			if ( cFeature != 'i' && cFeature != 't' && cFeature.length == 1 )
 
			{
 
				for ( var i=0, iLen=anFeature[cFeature].length ; i<iLen ; i++ )
 
				{
 
					this.dom.print.hidden.push( {
 
						"node": anFeature[cFeature][i],
 
						"display": "block"
 
					} );
 
					anFeature[cFeature][i].style.display = "none";
 
				}
 
			}
 
		}
 
		
 
		/* Print class can be used for styling */
 
		$(document.body).addClass( this.classes.print.body );
 

	
 
		/* Show information message to let the user know what is happening */
 
		if ( oConfig.sInfo !== "" )
 
		{
 
			this.fnInfo( oConfig.sInfo, 3000 );
 
		}
 

	
 
		/* Add a message at the top of the page */
 
		if ( oConfig.sMessage )
 
		{
 
			this.dom.print.message = document.createElement( "div" );
 
			this.dom.print.message.className = this.classes.print.message;
 
			this.dom.print.message.innerHTML = oConfig.sMessage;
 
			document.body.insertBefore( this.dom.print.message, document.body.childNodes[0] );
 
		}
 
		
 
		/* Cache the scrolling and the jump to the top of the page */
 
		this.s.print.saveScroll = $(window).scrollTop();
 
		window.scrollTo( 0, 0 );
 

	
 
		/* Bind a key event listener to the document for the escape key -
 
		 * it is removed in the callback
 
		 */
 
		$(document).bind( "keydown.DTTT", function(e) {
 
			/* Only interested in the escape key */
 
			if ( e.keyCode == 27 )
 
			{
 
				e.preventDefault();
 
				that._fnPrintEnd.call( that, e );
 
			}
 
		} );
 
	},
 
	
 
	
 
	/**
 
	 * Printing is finished, resume normal display
 
	 *  @method  _fnPrintEnd
 
	 *  @param   {Event} e Event object
 
	 *  @returns void
 
	 *  @private 
 
	 */
 
	"_fnPrintEnd": function ( e )
 
	{
 
		var that = this;
 
		var oSetDT = this.s.dt;
 
		var oSetPrint = this.s.print;
 
		var oDomPrint = this.dom.print;
 
		
 
		/* Show all hidden nodes */
 
		this._fnPrintShowNodes();
 
		
 
		/* Restore DataTables' scrolling */
 
		if ( oSetDT.oScroll.sX !== "" || oSetDT.oScroll.sY !== "" )
 
		{
 
			this._fnPrintScrollEnd();
 
		}
 
		
 
		/* Restore the scroll */
 
		window.scrollTo( 0, oSetPrint.saveScroll );
 
		
 
		/* Drop the print message */
 
		if ( oDomPrint.message !== null )
 
		{
 
			document.body.removeChild( oDomPrint.message );
 
			oDomPrint.message = null;
 
		}
 
		
 
		/* Styling class */
 
		$(document.body).removeClass( 'DTTT_Print' );
 
		
 
		/* Restore the table length */
 
		oSetDT._iDisplayStart = oSetPrint.saveStart;
 
		oSetDT._iDisplayLength = oSetPrint.saveLength;
 
		oSetDT.oApi._fnCalculateEnd( oSetDT );
 
		oSetDT.oApi._fnDraw( oSetDT );
 
		
 
		$(document).unbind( "keydown.DTTT" );
 
	},
 
	
 
	
 
	/**
 
	 * Take account of scrolling in DataTables by showing the full table
 
	 *  @returns void
 
	 *  @private 
 
	 */
 
	"_fnPrintScrollStart": function ()
 
	{
 
		var 
 
			oSetDT = this.s.dt,
 
			nScrollHeadInner = oSetDT.nScrollHead.getElementsByTagName('div')[0],
 
			nScrollHeadTable = nScrollHeadInner.getElementsByTagName('table')[0],
 
			nScrollBody = oSetDT.nTable.parentNode;
 

	
 
		/* Copy the header in the thead in the body table, this way we show one single table when
 
		 * in print view. Note that this section of code is more or less verbatim from DT 1.7.0
 
		 */
 
		var nTheadSize = oSetDT.nTable.getElementsByTagName('thead');
 
		if ( nTheadSize.length > 0 )
 
		{
 
			oSetDT.nTable.removeChild( nTheadSize[0] );
 
		}
 
		
 
		if ( oSetDT.nTFoot !== null )
 
		{
 
			var nTfootSize = oSetDT.nTable.getElementsByTagName('tfoot');
 
			if ( nTfootSize.length > 0 )
 
			{
 
				oSetDT.nTable.removeChild( nTfootSize[0] );
 
			}
 
		}
 
		
 
		nTheadSize = oSetDT.nTHead.cloneNode(true);
 
		oSetDT.nTable.insertBefore( nTheadSize, oSetDT.nTable.childNodes[0] );
 
		
 
		if ( oSetDT.nTFoot !== null )
 
		{
 
			nTfootSize = oSetDT.nTFoot.cloneNode(true);
 
			oSetDT.nTable.insertBefore( nTfootSize, oSetDT.nTable.childNodes[1] );
 
		}
 
		
 
		/* Now adjust the table's viewport so we can actually see it */
 
		if ( oSetDT.oScroll.sX !== "" )
 
		{
 
			oSetDT.nTable.style.width = $(oSetDT.nTable).outerWidth()+"px";
 
			nScrollBody.style.width = $(oSetDT.nTable).outerWidth()+"px";
 
			nScrollBody.style.overflow = "visible";
 
		}
 
		
 
		if ( oSetDT.oScroll.sY !== "" )
 
		{
 
			nScrollBody.style.height = $(oSetDT.nTable).outerHeight()+"px";
 
			nScrollBody.style.overflow = "visible";
 
		}
 
	},
 
	
 
	
 
	/**
 
	 * Take account of scrolling in DataTables by showing the full table. Note that the redraw of
 
	 * the DataTable that we do will actually deal with the majority of the hard work here
 
	 *  @returns void
 
	 *  @private 
 
	 */
 
	"_fnPrintScrollEnd": function ()
 
	{
 
		var 
 
			oSetDT = this.s.dt,
 
			nScrollBody = oSetDT.nTable.parentNode;
 
		
 
		if ( oSetDT.oScroll.sX !== "" )
 
		{
 
			nScrollBody.style.width = oSetDT.oApi._fnStringToCss( oSetDT.oScroll.sX );
 
			nScrollBody.style.overflow = "auto";
 
		}
 
		
 
		if ( oSetDT.oScroll.sY !== "" )
 
		{
 
			nScrollBody.style.height = oSetDT.oApi._fnStringToCss( oSetDT.oScroll.sY );
 
			nScrollBody.style.overflow = "auto";
 
		}
 
	},
 
	
 
	
 
	/**
 
	 * Resume the display of all TableTools hidden nodes
 
	 *  @method  _fnPrintShowNodes
 
	 *  @returns void
 
	 *  @private 
 
	 */
 
	"_fnPrintShowNodes": function ( )
 
	{
 
	  var anHidden = this.dom.print.hidden;
 
	  
 
		for ( var i=0, iLen=anHidden.length ; i<iLen ; i++ )
 
		{
 
			anHidden[i].node.style.display = anHidden[i].display;
 
		}
 
		anHidden.splice( 0, anHidden.length );
 
	},
 
	
 
	
 
	/**
 
	 * Hide nodes which are not needed in order to display the table. Note that this function is
 
	 * recursive
 
	 *  @method  _fnPrintHideNodes
 
	 *  @param   {Node} nNode Element which should be showing in a 'print' display
 
	 *  @returns void
 
	 *  @private 
 
	 */
 
	"_fnPrintHideNodes": function ( nNode )
 
	{
 
	  var anHidden = this.dom.print.hidden;
 
	  
 
		var nParent = nNode.parentNode;
 
		var nChildren = nParent.childNodes;
 
		for ( var i=0, iLen=nChildren.length ; i<iLen ; i++ )
 
		{
 
			if ( nChildren[i] != nNode && nChildren[i].nodeType == 1 )
 
			{
 
				/* If our node is shown (don't want to show nodes which were previously hidden) */
 
				var sDisplay = $(nChildren[i]).css("display");
 
			 	if ( sDisplay != "none" )
 
				{
 
					/* Cache the node and it's previous state so we can restore it */
 
					anHidden.push( {
 
						"node": nChildren[i],
 
						"display": sDisplay
 
					} );
 
					nChildren[i].style.display = "none";
 
				}
 
			}
 
		}
 
		
 
		if ( nParent.nodeName != "BODY" )
 
		{
 
			this._fnPrintHideNodes( nParent );
 
		}
 
	}
 
};
 

	
 

	
 

	
 
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 
 * Static variables
 
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 

	
 
/**
 
 * Store of all instances that have been created of TableTools, so one can look up other (when
 
 * there is need of a master)
 
 *  @property _aInstances
 
 *  @type	 Array
 
 *  @default  []
 
 *  @private
 
 */
 
TableTools._aInstances = [];
 

	
 

	
 
/**
 
 * Store of all listeners and their callback functions
 
 *  @property _aListeners
 
 *  @type	 Array
 
 *  @default  []
 
 */
 
TableTools._aListeners = [];
 

	
 

	
 

	
 
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 
 * Static methods
 
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 

	
 
/**
 
 * Get an array of all the master instances
 
 *  @method  fnGetMasters
 
 *  @returns {Array} List of master TableTools instances
 
 *  @static
 
 */
 
TableTools.fnGetMasters = function ()
 
{
 
	var a = [];
 
	for ( var i=0, iLen=TableTools._aInstances.length ; i<iLen ; i++ )
 
	{
 
		if ( TableTools._aInstances[i].s.master )
 
		{
 
			a.push( TableTools._aInstances[i] );
 
		}
 
	}
 
	return a;
 
};
 

	
 
/**
 
 * Get the master instance for a table node (or id if a string is given)
 
 *  @method  fnGetInstance
 
 *  @returns {Object} ID of table OR table node, for which we want the TableTools instance
 
 *  @static
 
 */
 
TableTools.fnGetInstance = function ( node )
 
{
 
	if ( typeof node != 'object' )
 
	{
 
		node = document.getElementById(node);
 
	}
 
	
 
	for ( var i=0, iLen=TableTools._aInstances.length ; i<iLen ; i++ )
 
	{
 
		if ( TableTools._aInstances[i].s.master && TableTools._aInstances[i].dom.table == node )
 
		{
 
			return TableTools._aInstances[i];
 
		}
 
	}
 
	return null;
 
};
 

	
 

	
 
/**
 
 * Add a listener for a specific event
 
 *  @method  _fnEventListen
 
 *  @param   {Object} that Scope of the listening function (i.e. 'this' in the caller)
 
 *  @param   {String} type Event type
 
 *  @param   {Function} fn Function
 
 *  @returns void
 
 *  @private
 
 *  @static
 
 */
 
TableTools._fnEventListen = function ( that, type, fn )
 
{
 
	TableTools._aListeners.push( {
 
		"that": that,
 
		"type": type,
 
		"fn": fn
 
	} );
 
};
 
	
 

	
 
/**
 
 * An event has occurred - look up every listener and fire it off. We check that the event we are
 
 * going to fire is attached to the same table (using the table node as reference) before firing
 
 *  @method  _fnEventDispatch
 
 *  @param   {Object} that Scope of the listening function (i.e. 'this' in the caller)
 
 *  @param   {String} type Event type
 
 *  @param   {Node} node Element that the event occurred on (may be null)
 
 *  @returns void
 
 *  @private
 
 *  @static
 
 */
 
TableTools._fnEventDispatch = function ( that, type, node )
 
{
 
	var listeners = TableTools._aListeners;
 
	for ( var i=0, iLen=listeners.length ; i<iLen ; i++ )
 
	{
 
		if ( that.dom.table == listeners[i].that.dom.table && listeners[i].type == type )
 
		{
 
			listeners[i].fn( node );
 
		}
 
	}
 
};
 

	
 

	
 

	
 

	
 

	
 

	
 
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 
 * Constants
 
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 

	
 

	
 

	
 
TableTools.buttonBase = {
 
	// Button base
 
	"sAction": "text",
 
	"sTag": "default",
 
	"sLinerTag": "default",
 
	"sButtonClass": "DTTT_button_text",
 
	"sButtonText": "Button text",
 
	"sTitle": "",
 
	"sToolTip": "",
 

	
 
	// Common button specific options
 
	"sCharSet": "utf8",
 
	"bBomInc": false,
 
	"sFileName": "*.csv",
 
	"sFieldBoundary": "",
 
	"sFieldSeperator": "\t",
 
	"sNewLine": "auto",
 
	"mColumns": "all", /* "all", "visible", "hidden" or array of column integers */
 
	"bHeader": true,
 
	"bFooter": true,
 
	"bOpenRows": false,
 
	"bSelectedOnly": false,
 

	
 
	// Callbacks
 
	"fnMouseover": null,
 
	"fnMouseout": null,
 
	"fnClick": null,
 
	"fnSelect": null,
 
	"fnComplete": null,
 
	"fnInit": null,
 
	"fnCellRender": null
 
};
 

	
 

	
 
/**
 
 * @namespace Default button configurations
 
 */
 
TableTools.BUTTONS = {
 
	"csv": $.extend( {}, TableTools.buttonBase, {
 
		"sAction": "flash_save",
 
		"sButtonClass": "DTTT_button_csv",
 
		"sButtonText": "CSV",
 
		"sFieldBoundary": '"',
 
		"sFieldSeperator": ",",
 
		"fnClick": function( nButton, oConfig, flash ) {
 
			this.fnSetText( flash, this.fnGetTableData(oConfig) );
 
		}
 
	} ),
 

	
 
	"xls": $.extend( {}, TableTools.buttonBase, {
 
		"sAction": "flash_save",
 
		"sCharSet": "utf16le",
 
		"bBomInc": true,
 
		"sButtonClass": "DTTT_button_xls",
 
		"sButtonText": "Excel",
 
		"fnClick": function( nButton, oConfig, flash ) {
 
			this.fnSetText( flash, this.fnGetTableData(oConfig) );
 
		}
 
	} ),
 

	
 
	"copy": $.extend( {}, TableTools.buttonBase, {
 
		"sAction": "flash_copy",
 
		"sButtonClass": "DTTT_button_copy",
 
		"sButtonText": "Copy",
 
		"fnClick": function( nButton, oConfig, flash ) {
 
			this.fnSetText( flash, this.fnGetTableData(oConfig) );
 
		},
 
		"fnComplete": function(nButton, oConfig, flash, text) {
 
			var
 
				lines = text.split('\n').length,
 
				len = this.s.dt.nTFoot === null ? lines-1 : lines-2,
 
				plural = (len==1) ? "" : "s";
 
			this.fnInfo( '<h6>Table copied</h6>'+
 
				'<p>Copied '+len+' row'+plural+' to the clipboard.</p>',
 
				1500
 
			);
 
		}
 
	} ),
 

	
 
	"pdf": $.extend( {}, TableTools.buttonBase, {
 
		"sAction": "flash_pdf",
 
		"sNewLine": "\n",
 
		"sFileName": "*.pdf",
 
		"sButtonClass": "DTTT_button_pdf",
 
		"sButtonText": "PDF",
 
		"sPdfOrientation": "portrait",
 
		"sPdfSize": "A4",
 
		"sPdfMessage": "",
 
		"fnClick": function( nButton, oConfig, flash ) {
 
			this.fnSetText( flash, 
 
				"title:"+ this.fnGetTitle(oConfig) +"\n"+
 
				"message:"+ oConfig.sPdfMessage +"\n"+
 
				"colWidth:"+ this.fnCalcColRatios(oConfig) +"\n"+
 
				"orientation:"+ oConfig.sPdfOrientation +"\n"+
 
				"size:"+ oConfig.sPdfSize +"\n"+
 
				"--/TableToolsOpts--\n" +
 
				this.fnGetTableData(oConfig)
 
			);
 
		}
 
	} ),
 

	
 
	"print": $.extend( {}, TableTools.buttonBase, {
 
		"sInfo": "<h6>Print view</h6><p>Please use your browser's print function to "+
 
		  "print this table. Press escape when finished.",
 
		"sMessage": null,
 
		"bShowAll": true,
 
		"sToolTip": "View print view",
 
		"sButtonClass": "DTTT_button_print",
 
		"sButtonText": "Print",
 
		"fnClick": function ( nButton, oConfig ) {
 
			this.fnPrint( true, oConfig );
 
		}
 
	} ),
 

	
 
	"text": $.extend( {}, TableTools.buttonBase ),
 

	
 
	"select": $.extend( {}, TableTools.buttonBase, {
 
		"sButtonText": "Select button",
 
		"fnSelect": function( nButton, oConfig ) {
 
			if ( this.fnGetSelected().length !== 0 ) {
 
				$(nButton).removeClass( this.classes.buttons.disabled );
 
			} else {
 
				$(nButton).addClass( this.classes.buttons.disabled );
 
			}
 
		},
 
		"fnInit": function( nButton, oConfig ) {
 
			$(nButton).addClass( this.classes.buttons.disabled );
 
		}
 
	} ),
 

	
 
	"select_single": $.extend( {}, TableTools.buttonBase, {
 
		"sButtonText": "Select button",
 
		"fnSelect": function( nButton, oConfig ) {
 
			var iSelected = this.fnGetSelected().length;
 
			if ( iSelected == 1 ) {
 
				$(nButton).removeClass( this.classes.buttons.disabled );
 
			} else {
 
				$(nButton).addClass( this.classes.buttons.disabled );
 
			}
 
		},
 
		"fnInit": function( nButton, oConfig ) {
 
			$(nButton).addClass( this.classes.buttons.disabled );
 
		}
 
	} ),
 

	
 
	"select_all": $.extend( {}, TableTools.buttonBase, {
 
		"sButtonText": "Select all",
 
		"fnClick": function( nButton, oConfig ) {
 
			this.fnSelectAll();
 
		},
 
		"fnSelect": function( nButton, oConfig ) {
 
			if ( this.fnGetSelected().length == this.s.dt.fnRecordsDisplay() ) {
 
				$(nButton).addClass( this.classes.buttons.disabled );
 
			} else {
 
				$(nButton).removeClass( this.classes.buttons.disabled );
 
			}
 
		}
 
	} ),
 

	
 
	"select_none": $.extend( {}, TableTools.buttonBase, {
 
		"sButtonText": "Deselect all",
 
		"fnClick": function( nButton, oConfig ) {
 
			this.fnSelectNone();
 
		},
 
		"fnSelect": function( nButton, oConfig ) {
 
			if ( this.fnGetSelected().length !== 0 ) {
 
				$(nButton).removeClass( this.classes.buttons.disabled );
 
			} else {
 
				$(nButton).addClass( this.classes.buttons.disabled );
 
			}
 
		},
 
		"fnInit": function( nButton, oConfig ) {
 
			$(nButton).addClass( this.classes.buttons.disabled );
 
		}
 
	} ),
 

	
 
	"ajax": $.extend( {}, TableTools.buttonBase, {
 
		"sAjaxUrl": "/xhr.php",
 
		"sButtonText": "Ajax button",
 
		"fnClick": function( nButton, oConfig ) {
 
			var sData = this.fnGetTableData(oConfig);
 
			$.ajax( {
 
				"url": oConfig.sAjaxUrl,
 
				"data": [
 
					{ "name": "tableData", "value": sData }
 
				],
 
				"success": oConfig.fnAjaxComplete,
 
				"dataType": "json",
 
				"type": "POST", 
 
				"cache": false,
 
				"error": function () {
 
					alert( "Error detected when sending table data to server" );
 
				}
 
			} );
 
		},
 
		"fnAjaxComplete": function( json ) {
 
			alert( 'Ajax complete' );
 
		}
 
	} ),
 

	
 
	"div": $.extend( {}, TableTools.buttonBase, {
 
		"sAction": "div",
 
		"sTag": "div",
 
		"sButtonClass": "DTTT_nonbutton",
 
		"sButtonText": "Text button"
 
	} ),
 

	
 
	"collection": $.extend( {}, TableTools.buttonBase, {
 
		"sAction": "collection",
 
		"sButtonClass": "DTTT_button_collection",
 
		"sButtonText": "Collection",
 
		"fnClick": function( nButton, oConfig ) {
 
			this._fnCollectionShow(nButton, oConfig);
 
		}
 
	} )
 
};
 
/*
 
 *  on* callback parameters:
 
 *  	1. node - button element
 
 *  	2. object - configuration object for this button
 
 *  	3. object - ZeroClipboard reference (flash button only)
 
 *  	4. string - Returned string from Flash (flash button only - and only on 'complete')
 
 */
 

	
 

	
 

	
 
/**
 
 * @namespace Classes used by TableTools - allows the styles to be override easily.
 
 *   Note that when TableTools initialises it will take a copy of the classes object
 
 *   and will use its internal copy for the remainder of its run time.
 
 */
 
TableTools.classes = {
 
	"container": "DTTT_container",
 
	"buttons": {
 
		"normal": "DTTT_button",
 
		"disabled": "DTTT_disabled"
 
	},
 
	"collection": {
 
		"container": "DTTT_collection",
 
		"background": "DTTT_collection_background",
 
		"buttons": {
 
			"normal": "DTTT_button",
 
			"disabled": "DTTT_disabled"
 
		}
 
	},
 
	"select": {
 
		"table": "DTTT_selectable",
 
		"row": "DTTT_selected"
 
	},
 
	"print": {
 
		"body": "DTTT_Print",
 
		"info": "DTTT_print_info",
 
		"message": "DTTT_PrintMessage"
 
	}
 
};
 

	
 

	
 
/**
 
 * @namespace ThemeRoller classes - built in for compatibility with DataTables' 
 
 *   bJQueryUI option.
 
 */
 
TableTools.classes_themeroller = {
 
	"container": "DTTT_container ui-buttonset ui-buttonset-multi",
 
	"buttons": {
 
		"normal": "DTTT_button ui-button ui-state-default"
 
	},
 
	"collection": {
 
		"container": "DTTT_collection ui-buttonset ui-buttonset-multi"
 
	}
 
};
 

	
 

	
 
/**
 
 * @namespace TableTools default settings for initialisation
 
 */
 
TableTools.DEFAULTS = {
 
	"sSwfPath":        "media/swf/copy_csv_xls_pdf.swf",
 
	"sRowSelect":      "none",
 
	"sSelectedClass":  null,
 
	"fnPreRowSelect":  null,
 
	"fnRowSelected":   null,
 
	"fnRowDeselected": null,
 
	"aButtons":        [ "copy", "csv", "xls", "pdf", "print" ],
 
	"oTags": {
 
		"container": "div",
 
		"button": "a", // We really want to use buttons here, but Firefox and IE ignore the
 
		                 // click on the Flash element in the button (but not mouse[in|out]).
 
		"liner": "span",
 
		"collection": {
 
			"container": "div",
 
			"button": "a",
 
			"liner": "span"
 
		}
 
	}
 
};
 

	
 

	
 
/**
 
 * Name of this class
 
 *  @constant CLASS
 
 *  @type	 String
 
 *  @default  TableTools
 
 */
 
TableTools.prototype.CLASS = "TableTools";
 

	
 

	
 
/**
 
 * TableTools version
 
 *  @constant  VERSION
 
 *  @type	  String
 
 *  @default   See code
 
 */
 
TableTools.VERSION = "2.1.3";
 
TableTools.prototype.VERSION = TableTools.VERSION;
 

	
 

	
 

	
 

	
 
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 
 * Initialisation
 
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 

	
 
/*
 
 * Register a new feature with DataTables
 
 */
 
if ( typeof $.fn.dataTable == "function" &&
 
	 typeof $.fn.dataTableExt.fnVersionCheck == "function" &&
 
	 $.fn.dataTableExt.fnVersionCheck('1.9.0') )
 
{
 
	$.fn.dataTableExt.aoFeatures.push( {
 
		"fnInit": function( oDTSettings ) {
 
			var oOpts = typeof oDTSettings.oInit.oTableTools != 'undefined' ? 
 
				oDTSettings.oInit.oTableTools : {};
 
			
 
			var oTT = new TableTools( oDTSettings.oInstance, oOpts );
 
			TableTools._aInstances.push( oTT );
 
			
 
			return oTT.dom.container;
 
		},
 
		"cFeature": "T",
 
		"sFeature": "TableTools"
 
	} );
 
}
 
else
 
{
 
	alert( "Warning: TableTools 2 requires DataTables 1.9.0 or newer - www.datatables.net/download");
 
}
 

	
 
$.fn.DataTable.TableTools = TableTools;
 

	
 
})(jQuery, window, document);
symposion/static/tabletools/js/TableTools.min.js
Show inline comments
 
new file 100644
 
// Simple Set Clipboard System
 
// Author: Joseph Huckaby
 
var ZeroClipboard_TableTools={version:"1.0.4-TableTools2",clients:{},moviePath:"",nextId:1,$:function(a){"string"==typeof a&&(a=document.getElementById(a));a.addClass||(a.hide=function(){this.style.display="none"},a.show=function(){this.style.display=""},a.addClass=function(a){this.removeClass(a);this.className+=" "+a},a.removeClass=function(a){this.className=this.className.replace(RegExp("\\s*"+a+"\\s*")," ").replace(/^\s+/,"").replace(/\s+$/,"")},a.hasClass=function(a){return!!this.className.match(RegExp("\\s*"+
 
a+"\\s*"))});return a},setMoviePath:function(a){this.moviePath=a},dispatch:function(a,b,c){(a=this.clients[a])&&a.receiveEvent(b,c)},register:function(a,b){this.clients[a]=b},getDOMObjectPosition:function(a){var b={left:0,top:0,width:a.width?a.width:a.offsetWidth,height:a.height?a.height:a.offsetHeight};""!=a.style.width&&(b.width=a.style.width.replace("px",""));""!=a.style.height&&(b.height=a.style.height.replace("px",""));for(;a;)b.left+=a.offsetLeft,b.top+=a.offsetTop,a=a.offsetParent;return b},
 
Client:function(a){this.handlers={};this.id=ZeroClipboard_TableTools.nextId++;this.movieId="ZeroClipboard_TableToolsMovie_"+this.id;ZeroClipboard_TableTools.register(this.id,this);a&&this.glue(a)}};
 
ZeroClipboard_TableTools.Client.prototype={id:0,ready:!1,movie:null,clipText:"",fileName:"",action:"copy",handCursorEnabled:!0,cssEffects:!0,handlers:null,sized:!1,glue:function(a,b){this.domElement=ZeroClipboard_TableTools.$(a);var c=99;this.domElement.style.zIndex&&(c=parseInt(this.domElement.style.zIndex)+1);var d=ZeroClipboard_TableTools.getDOMObjectPosition(this.domElement);this.div=document.createElement("div");var e=this.div.style;e.position="absolute";e.left="0px";e.top="0px";e.width=d.width+
 
"px";e.height=d.height+"px";e.zIndex=c;"undefined"!=typeof b&&""!=b&&(this.div.title=b);0!=d.width&&0!=d.height&&(this.sized=!0);this.domElement&&(this.domElement.appendChild(this.div),this.div.innerHTML=this.getHTML(d.width,d.height))},positionElement:function(){var a=ZeroClipboard_TableTools.getDOMObjectPosition(this.domElement),b=this.div.style;b.position="absolute";b.width=a.width+"px";b.height=a.height+"px";0!=a.width&&0!=a.height&&(this.sized=!0,b=this.div.childNodes[0],b.width=a.width,b.height=
 
a.height)},getHTML:function(a,b){var c="",d="id="+this.id+"&width="+a+"&height="+b;if(navigator.userAgent.match(/MSIE/))var e=location.href.match(/^https/i)?"https://":"http://",c=c+('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+e+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="'+a+'" height="'+b+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+
 
ZeroClipboard_TableTools.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+d+'"/><param name="wmode" value="transparent"/></object>');else c+='<embed id="'+this.movieId+'" src="'+ZeroClipboard_TableTools.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+a+'" height="'+b+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+
 
d+'" wmode="transparent" />';return c},hide:function(){this.div&&(this.div.style.left="-2000px")},show:function(){this.reposition()},destroy:function(){if(this.domElement&&this.div){this.hide();this.div.innerHTML="";var a=document.getElementsByTagName("body")[0];try{a.removeChild(this.div)}catch(b){}this.div=this.domElement=null}},reposition:function(a){a&&((this.domElement=ZeroClipboard_TableTools.$(a))||this.hide());if(this.domElement&&this.div){var a=ZeroClipboard_TableTools.getDOMObjectPosition(this.domElement),
 
b=this.div.style;b.left=""+a.left+"px";b.top=""+a.top+"px"}},clearText:function(){this.clipText="";this.ready&&this.movie.clearText()},appendText:function(a){this.clipText+=a;this.ready&&this.movie.appendText(a)},setText:function(a){this.clipText=a;this.ready&&this.movie.setText(a)},setCharSet:function(a){this.charSet=a;this.ready&&this.movie.setCharSet(a)},setBomInc:function(a){this.incBom=a;this.ready&&this.movie.setBomInc(a)},setFileName:function(a){this.fileName=a;this.ready&&this.movie.setFileName(a)},
 
setAction:function(a){this.action=a;this.ready&&this.movie.setAction(a)},addEventListener:function(a,b){a=a.toString().toLowerCase().replace(/^on/,"");this.handlers[a]||(this.handlers[a]=[]);this.handlers[a].push(b)},setHandCursor:function(a){this.handCursorEnabled=a;this.ready&&this.movie.setHandCursor(a)},setCSSEffects:function(a){this.cssEffects=!!a},receiveEvent:function(a,b){a=a.toString().toLowerCase().replace(/^on/,"");switch(a){case "load":this.movie=document.getElementById(this.movieId);
 
if(!this.movie){var c=this;setTimeout(function(){c.receiveEvent("load",null)},1);return}if(!this.ready&&navigator.userAgent.match(/Firefox/)&&navigator.userAgent.match(/Windows/)){c=this;setTimeout(function(){c.receiveEvent("load",null)},100);this.ready=!0;return}this.ready=!0;this.movie.clearText();this.movie.appendText(this.clipText);this.movie.setFileName(this.fileName);this.movie.setAction(this.action);this.movie.setCharSet(this.charSet);this.movie.setBomInc(this.incBom);this.movie.setHandCursor(this.handCursorEnabled);
 
break;case "mouseover":this.domElement&&this.cssEffects&&this.recoverActive&&this.domElement.addClass("active");break;case "mouseout":this.domElement&&this.cssEffects&&(this.recoverActive=!1,this.domElement.hasClass("active")&&(this.domElement.removeClass("active"),this.recoverActive=!0));break;case "mousedown":this.domElement&&this.cssEffects&&this.domElement.addClass("active");break;case "mouseup":this.domElement&&this.cssEffects&&(this.domElement.removeClass("active"),this.recoverActive=!1)}if(this.handlers[a])for(var d=
 
0,e=this.handlers[a].length;d<e;d++){var f=this.handlers[a][d];if("function"==typeof f)f(this,b);else if("object"==typeof f&&2==f.length)f[0][f[1]](this,b);else if("string"==typeof f)window[f](this,b)}}};
 

	
 

	
 
/*
 
 * File:        TableTools.min.js
 
 * Version:     2.1.3
 
 * Author:      Allan Jardine (www.sprymedia.co.uk)
 
 * 
 
 * Copyright 2009-2012 Allan Jardine, all rights reserved.
 
 *
 
 * This source file is free software, under either the GPL v2 license or a
 
 * BSD (3 point) style license, as supplied with this software.
 
 * 
 
 * This source file is distributed in the hope that it will be useful, but 
 
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
 
 * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
 
 */
 
var TableTools;
 
(function(e,m,f){TableTools=function(a,b){!this instanceof TableTools&&alert("Warning: TableTools must be initialised with the keyword 'new'");this.s={that:this,dt:a.fnSettings(),print:{saveStart:-1,saveLength:-1,saveScroll:-1,funcEnd:function(){}},buttonCounter:0,select:{type:"",selected:[],preRowSelect:null,postSelected:null,postDeselected:null,all:!1,selectedClass:""},custom:{},swfPath:"",buttonSet:[],master:!1,tags:{}};this.dom={container:null,table:null,print:{hidden:[],message:null},collection:{collection:null,
 
background:null}};this.classes=e.extend(!0,{},TableTools.classes);this.s.dt.bJUI&&e.extend(!0,this.classes,TableTools.classes_themeroller);this.fnSettings=function(){return this.s};"undefined"==typeof b&&(b={});this._fnConstruct(b);return this};TableTools.prototype={fnGetSelected:function(){var a=[],b=this.s.dt.aoData,c,d;c=0;for(d=b.length;c<d;c++)b[c]._DTTT_selected&&a.push(b[c].nTr);return a},fnGetSelectedData:function(){var a=[],b=this.s.dt.aoData,c,d;c=0;for(d=b.length;c<d;c++)b[c]._DTTT_selected&&
 
a.push(this.s.dt.oInstance.fnGetData(c));return a},fnIsSelected:function(a){a=this.s.dt.oInstance.fnGetPosition(a);return!0===this.s.dt.aoData[a]._DTTT_selected?!0:!1},fnSelectAll:function(a){var b=this._fnGetMasterSettings();this._fnRowSelect(!0===a?b.dt.aiDisplay:b.dt.aoData)},fnSelectNone:function(a){var b=this._fnGetMasterSettings();this._fnRowDeselect(!0===a?b.dt.aiDisplay:b.dt.aoData)},fnSelect:function(a){"single"==this.s.select.type?(this.fnSelectNone(),this._fnRowSelect(a)):"multi"==this.s.select.type&&
 
this._fnRowSelect(a)},fnDeselect:function(a){this._fnRowDeselect(a)},fnGetTitle:function(a){var b="";"undefined"!=typeof a.sTitle&&""!==a.sTitle?b=a.sTitle:(a=f.getElementsByTagName("title"),0<a.length&&(b=a[0].innerHTML));return 4>"\u00a1".toString().length?b.replace(/[^a-zA-Z0-9_\u00A1-\uFFFF\.,\-_ !\(\)]/g,""):b.replace(/[^a-zA-Z0-9_\.,\-_ !\(\)]/g,"")},fnCalcColRatios:function(a){var b=this.s.dt.aoColumns,a=this._fnColumnTargets(a.mColumns),c=[],d=0,e=0,h,f;h=0;for(f=a.length;h<f;h++)a[h]&&(d=
 
b[h].nTh.offsetWidth,e+=d,c.push(d));h=0;for(f=c.length;h<f;h++)c[h]/=e;return c.join("\t")},fnGetTableData:function(a){if(this.s.dt)return this._fnGetDataTablesData(a)},fnSetText:function(a,b){this._fnFlashSetText(a,b)},fnResizeButtons:function(){for(var a in ZeroClipboard_TableTools.clients)if(a){var b=ZeroClipboard_TableTools.clients[a];"undefined"!=typeof b.domElement&&b.domElement.parentNode&&b.positionElement()}},fnResizeRequired:function(){for(var a in ZeroClipboard_TableTools.clients)if(a){var b=
 
ZeroClipboard_TableTools.clients[a];if("undefined"!=typeof b.domElement&&b.domElement.parentNode==this.dom.container&&!1===b.sized)return!0}return!1},fnPrint:function(a,b){void 0===b&&(b={});void 0===a||a?this._fnPrintStart(b):this._fnPrintEnd()},fnInfo:function(a,b){var c=f.createElement("div");c.className=this.classes.print.info;c.innerHTML=a;f.body.appendChild(c);setTimeout(function(){e(c).fadeOut("normal",function(){f.body.removeChild(c)})},b)},_fnConstruct:function(a){var b=this;this._fnCustomiseSettings(a);
 
this.dom.container=f.createElement(this.s.tags.container);this.dom.container.className=this.classes.container;"none"!=this.s.select.type&&this._fnRowSelectConfig();this._fnButtonDefinations(this.s.buttonSet,this.dom.container);this.s.dt.aoDestroyCallback.push({sName:"TableTools",fn:function(){b.dom.container.innerHTML=""}})},_fnCustomiseSettings:function(a){"undefined"==typeof this.s.dt._TableToolsInit&&(this.s.master=!0,this.s.dt._TableToolsInit=!0);this.dom.table=this.s.dt.nTable;this.s.custom=
 
e.extend({},TableTools.DEFAULTS,a);this.s.swfPath=this.s.custom.sSwfPath;"undefined"!=typeof ZeroClipboard_TableTools&&(ZeroClipboard_TableTools.moviePath=this.s.swfPath);this.s.select.type=this.s.custom.sRowSelect;this.s.select.preRowSelect=this.s.custom.fnPreRowSelect;this.s.select.postSelected=this.s.custom.fnRowSelected;this.s.select.postDeselected=this.s.custom.fnRowDeselected;this.s.custom.sSelectedClass&&(this.classes.select.row=this.s.custom.sSelectedClass);this.s.tags=this.s.custom.oTags;
 
this.s.buttonSet=this.s.custom.aButtons},_fnButtonDefinations:function(a,b){for(var c,d=0,g=a.length;d<g;d++){if("string"==typeof a[d]){if("undefined"==typeof TableTools.BUTTONS[a[d]]){alert("TableTools: Warning - unknown button type: "+a[d]);continue}c=e.extend({},TableTools.BUTTONS[a[d]],!0)}else{if("undefined"==typeof TableTools.BUTTONS[a[d].sExtends]){alert("TableTools: Warning - unknown button type: "+a[d].sExtends);continue}c=e.extend({},TableTools.BUTTONS[a[d].sExtends],!0);c=e.extend(c,a[d],
 
!0)}b.appendChild(this._fnCreateButton(c,e(b).hasClass(this.classes.collection.container)))}},_fnCreateButton:function(a,b){var c=this._fnButtonBase(a,b);a.sAction.match(/flash/)?this._fnFlashConfig(c,a):"text"==a.sAction?this._fnTextConfig(c,a):"div"==a.sAction?this._fnTextConfig(c,a):"collection"==a.sAction&&(this._fnTextConfig(c,a),this._fnCollectionConfig(c,a));return c},_fnButtonBase:function(a,b){var c,d,e;b?(c="default"!==a.sTag?a.sTag:this.s.tags.collection.button,d="default"!==a.sLinerTag?
 
a.sLiner:this.s.tags.collection.liner,e=this.classes.collection.buttons.normal):(c="default"!==a.sTag?a.sTag:this.s.tags.button,d="default"!==a.sLinerTag?a.sLiner:this.s.tags.liner,e=this.classes.buttons.normal);c=f.createElement(c);d=f.createElement(d);var h=this._fnGetMasterSettings();c.className=e+" "+a.sButtonClass;c.setAttribute("id","ToolTables_"+this.s.dt.sInstance+"_"+h.buttonCounter);c.appendChild(d);d.innerHTML=a.sButtonText;h.buttonCounter++;return c},_fnGetMasterSettings:function(){if(this.s.master)return this.s;
 
for(var a=TableTools._aInstances,b=0,c=a.length;b<c;b++)if(this.dom.table==a[b].s.dt.nTable)return a[b].s},_fnCollectionConfig:function(a,b){var c=f.createElement(this.s.tags.collection.container);c.style.display="none";c.className=this.classes.collection.container;b._collection=c;f.body.appendChild(c);this._fnButtonDefinations(b.aButtons,c)},_fnCollectionShow:function(a,b){var c=this,d=e(a).offset(),g=b._collection,h=d.left,d=d.top+e(a).outerHeight(),p=e(m).height(),j=e(f).height(),k=e(m).width(),
 
n=e(f).width();g.style.position="absolute";g.style.left=h+"px";g.style.top=d+"px";g.style.display="block";e(g).css("opacity",0);var l=f.createElement("div");l.style.position="absolute";l.style.left="0px";l.style.top="0px";l.style.height=(p>j?p:j)+"px";l.style.width=(k>n?k:n)+"px";l.className=this.classes.collection.background;e(l).css("opacity",0);f.body.appendChild(l);f.body.appendChild(g);p=e(g).outerWidth();k=e(g).outerHeight();h+p>n&&(g.style.left=n-p+"px");d+k>j&&(g.style.top=d-k-e(a).outerHeight()+
 
"px");this.dom.collection.collection=g;this.dom.collection.background=l;setTimeout(function(){e(g).animate({opacity:1},500);e(l).animate({opacity:0.25},500)},10);this.fnResizeButtons();e(l).click(function(){c._fnCollectionHide.call(c,null,null)})},_fnCollectionHide:function(a,b){!(null!==b&&"collection"==b.sExtends)&&null!==this.dom.collection.collection&&(e(this.dom.collection.collection).animate({opacity:0},500,function(){this.style.display="none"}),e(this.dom.collection.background).animate({opacity:0},
 
500,function(){this.parentNode.removeChild(this)}),this.dom.collection.collection=null,this.dom.collection.background=null)},_fnRowSelectConfig:function(){if(this.s.master){var a=this,b=this.s.dt;e(b.nTable).addClass(this.classes.select.table);e("tr",b.nTBody).live("click",function(c){if(this.parentNode==b.nTBody&&null!==b.oInstance.fnGetData(this)&&(null===a.s.select.preRowSelect||a.s.select.preRowSelect.call(a,c)))a.fnIsSelected(this)?a._fnRowDeselect(this):"single"==a.s.select.type?(a.fnSelectNone(),
 
a._fnRowSelect(this)):"multi"==a.s.select.type&&a._fnRowSelect(this)});b.oApi._fnCallbackReg(b,"aoRowCreatedCallback",function(c,d,g){b.aoData[g]._DTTT_selected&&e(c).addClass(a.classes.select.row)},"TableTools-SelectAll")}},_fnRowSelect:function(a){for(var a=this._fnSelectData(a),b=0===a.length?null:a[0].nTr,c=0,d=a.length;c<d;c++)a[c]._DTTT_selected=!0,a[c].nTr&&e(a[c].nTr).addClass(this.classes.select.row);null!==this.s.select.postSelected&&this.s.select.postSelected.call(this,b);TableTools._fnEventDispatch(this,
 
"select",b)},_fnRowDeselect:function(a){for(var a=this._fnSelectData(a),b=0===a.length?null:a[0].nTr,c=0,d=a.length;c<d;c++)a[c].nTr&&a[c]._DTTT_selected&&e(a[c].nTr).removeClass(this.classes.select.row),a[c]._DTTT_selected=!1;null!==this.s.select.postDeselected&&this.s.select.postDeselected.call(this,b);TableTools._fnEventDispatch(this,"select",b)},_fnSelectData:function(a){var b=[],c,d,e;if(a.nodeName)c=this.s.dt.oInstance.fnGetPosition(a),b.push(this.s.dt.aoData[c]);else if("undefined"!==typeof a.length){d=
 
0;for(e=a.length;d<e;d++)a[d].nodeName?(c=this.s.dt.oInstance.fnGetPosition(a[d]),b.push(this.s.dt.aoData[c])):"number"===typeof a[d]?b.push(this.s.dt.aoData[a[d]]):b.push(a[d])}else b.push(a);return b},_fnTextConfig:function(a,b){var c=this;null!==b.fnInit&&b.fnInit.call(this,a,b);""!==b.sToolTip&&(a.title=b.sToolTip);e(a).hover(function(){b.fnMouseover!==null&&b.fnMouseover.call(this,a,b,null)},function(){b.fnMouseout!==null&&b.fnMouseout.call(this,a,b,null)});null!==b.fnSelect&&TableTools._fnEventListen(this,
 
"select",function(d){b.fnSelect.call(c,a,b,d)});e(a).click(function(){b.fnClick!==null&&b.fnClick.call(c,a,b,null);b.fnComplete!==null&&b.fnComplete.call(c,a,b,null,null);c._fnCollectionHide(a,b)})},_fnFlashConfig:function(a,b){var c=this,d=new ZeroClipboard_TableTools.Client;null!==b.fnInit&&b.fnInit.call(this,a,b);d.setHandCursor(!0);"flash_save"==b.sAction?(d.setAction("save"),d.setCharSet("utf16le"==b.sCharSet?"UTF16LE":"UTF8"),d.setBomInc(b.bBomInc),d.setFileName(b.sFileName.replace("*",this.fnGetTitle(b)))):
 
"flash_pdf"==b.sAction?(d.setAction("pdf"),d.setFileName(b.sFileName.replace("*",this.fnGetTitle(b)))):d.setAction("copy");d.addEventListener("mouseOver",function(){b.fnMouseover!==null&&b.fnMouseover.call(c,a,b,d)});d.addEventListener("mouseOut",function(){b.fnMouseout!==null&&b.fnMouseout.call(c,a,b,d)});d.addEventListener("mouseDown",function(){b.fnClick!==null&&b.fnClick.call(c,a,b,d)});d.addEventListener("complete",function(e,h){b.fnComplete!==null&&b.fnComplete.call(c,a,b,d,h);c._fnCollectionHide(a,
 
b)});this._fnFlashGlue(d,a,b.sToolTip)},_fnFlashGlue:function(a,b,c){var d=this,e=b.getAttribute("id");f.getElementById(e)?a.glue(b,c):setTimeout(function(){d._fnFlashGlue(a,b,c)},100)},_fnFlashSetText:function(a,b){var c=this._fnChunkData(b,8192);a.clearText();for(var d=0,e=c.length;d<e;d++)a.appendText(c[d])},_fnColumnTargets:function(a){var b=[],c=this.s.dt;if("object"==typeof a){i=0;for(iLen=c.aoColumns.length;i<iLen;i++)b.push(!1);i=0;for(iLen=a.length;i<iLen;i++)b[a[i]]=!0}else if("visible"==
 
a){i=0;for(iLen=c.aoColumns.length;i<iLen;i++)b.push(c.aoColumns[i].bVisible?!0:!1)}else if("hidden"==a){i=0;for(iLen=c.aoColumns.length;i<iLen;i++)b.push(c.aoColumns[i].bVisible?!1:!0)}else if("sortable"==a){i=0;for(iLen=c.aoColumns.length;i<iLen;i++)b.push(c.aoColumns[i].bSortable?!0:!1)}else{i=0;for(iLen=c.aoColumns.length;i<iLen;i++)b.push(!0)}return b},_fnNewline:function(a){return"auto"==a.sNewLine?navigator.userAgent.match(/Windows/)?"\r\n":"\n":a.sNewLine},_fnGetDataTablesData:function(a){var b,
 
c,d,g,h,f=[],j="",k=this.s.dt,n,l=RegExp(a.sFieldBoundary,"g"),m=this._fnColumnTargets(a.mColumns);d="undefined"!=typeof a.bSelectedOnly?a.bSelectedOnly:!1;if(a.bHeader){h=[];b=0;for(c=k.aoColumns.length;b<c;b++)m[b]&&(j=k.aoColumns[b].sTitle.replace(/\n/g," ").replace(/<.*?>/g,"").replace(/^\s+|\s+$/g,""),j=this._fnHtmlDecode(j),h.push(this._fnBoundData(j,a.sFieldBoundary,l)));f.push(h.join(a.sFieldSeperator))}var o=k.aiDisplay;g=this.fnGetSelected();if("none"!==this.s.select.type&&d&&0!==g.length){o=
 
[];b=0;for(c=g.length;b<c;b++)o.push(k.oInstance.fnGetPosition(g[b]))}d=0;for(g=o.length;d<g;d++){n=k.aoData[o[d]].nTr;h=[];b=0;for(c=k.aoColumns.length;b<c;b++)m[b]&&(j=k.oApi._fnGetCellData(k,o[d],b,"display"),a.fnCellRender?j=a.fnCellRender(j,b,n,o[d])+"":"string"==typeof j?(j=j.replace(/\n/g," "),j=j.replace(/<img.*?\s+alt\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s>]+)).*?>/gi,"$1$2$3"),j=j.replace(/<.*?>/g,"")):j+="",j=j.replace(/^\s+/,"").replace(/\s+$/,""),j=this._fnHtmlDecode(j),h.push(this._fnBoundData(j,
 
a.sFieldBoundary,l)));f.push(h.join(a.sFieldSeperator));a.bOpenRows&&(b=e.grep(k.aoOpenRows,function(a){return a.nParent===n}),1===b.length&&(j=this._fnBoundData(e("td",b[0].nTr).html(),a.sFieldBoundary,l),f.push(j)))}if(a.bFooter&&null!==k.nTFoot){h=[];b=0;for(c=k.aoColumns.length;b<c;b++)m[b]&&null!==k.aoColumns[b].nTf&&(j=k.aoColumns[b].nTf.innerHTML.replace(/\n/g," ").replace(/<.*?>/g,""),j=this._fnHtmlDecode(j),h.push(this._fnBoundData(j,a.sFieldBoundary,l)));f.push(h.join(a.sFieldSeperator))}return _sLastData=
 
f.join(this._fnNewline(a))},_fnBoundData:function(a,b,c){return""===b?a:b+a.replace(c,b+b)+b},_fnChunkData:function(a,b){for(var c=[],d=a.length,e=0;e<d;e+=b)e+b<d?c.push(a.substring(e,e+b)):c.push(a.substring(e,d));return c},_fnHtmlDecode:function(a){if(-1==a.indexOf("&"))return a;var a=this._fnChunkData(a,2048),b=f.createElement("div"),c,d,e,h="";c=0;for(d=a.length;c<d;c++)e=a[c].lastIndexOf("&"),-1!=e&&(8<=a[c].length&&e>a[c].length-8)&&(a[c].substr(e),a[c]=a[c].substr(0,e)),b.innerHTML=a[c],h+=
 
b.childNodes[0].nodeValue;return h},_fnPrintStart:function(a){var b=this,c=this.s.dt;this._fnPrintHideNodes(c.nTable);this.s.print.saveStart=c._iDisplayStart;this.s.print.saveLength=c._iDisplayLength;a.bShowAll&&(c._iDisplayStart=0,c._iDisplayLength=-1,c.oApi._fnCalculateEnd(c),c.oApi._fnDraw(c));(""!==c.oScroll.sX||""!==c.oScroll.sY)&&this._fnPrintScrollStart(c);var c=c.aanFeatures,d;for(d in c)if("i"!=d&&"t"!=d&&1==d.length)for(var g=0,h=c[d].length;g<h;g++)this.dom.print.hidden.push({node:c[d][g],
 
display:"block"}),c[d][g].style.display="none";e(f.body).addClass(this.classes.print.body);""!==a.sInfo&&this.fnInfo(a.sInfo,3E3);a.sMessage&&(this.dom.print.message=f.createElement("div"),this.dom.print.message.className=this.classes.print.message,this.dom.print.message.innerHTML=a.sMessage,f.body.insertBefore(this.dom.print.message,f.body.childNodes[0]));this.s.print.saveScroll=e(m).scrollTop();m.scrollTo(0,0);e(f).bind("keydown.DTTT",function(a){if(a.keyCode==27){a.preventDefault();b._fnPrintEnd.call(b,
 
a)}})},_fnPrintEnd:function(){var a=this.s.dt,b=this.s.print,c=this.dom.print;this._fnPrintShowNodes();(""!==a.oScroll.sX||""!==a.oScroll.sY)&&this._fnPrintScrollEnd();m.scrollTo(0,b.saveScroll);null!==c.message&&(f.body.removeChild(c.message),c.message=null);e(f.body).removeClass("DTTT_Print");a._iDisplayStart=b.saveStart;a._iDisplayLength=b.saveLength;a.oApi._fnCalculateEnd(a);a.oApi._fnDraw(a);e(f).unbind("keydown.DTTT")},_fnPrintScrollStart:function(){var a=this.s.dt;a.nScrollHead.getElementsByTagName("div")[0].getElementsByTagName("table");
 
var b=a.nTable.parentNode,c=a.nTable.getElementsByTagName("thead");0<c.length&&a.nTable.removeChild(c[0]);null!==a.nTFoot&&(c=a.nTable.getElementsByTagName("tfoot"),0<c.length&&a.nTable.removeChild(c[0]));c=a.nTHead.cloneNode(!0);a.nTable.insertBefore(c,a.nTable.childNodes[0]);null!==a.nTFoot&&(c=a.nTFoot.cloneNode(!0),a.nTable.insertBefore(c,a.nTable.childNodes[1]));""!==a.oScroll.sX&&(a.nTable.style.width=e(a.nTable).outerWidth()+"px",b.style.width=e(a.nTable).outerWidth()+"px",b.style.overflow=
 
"visible");""!==a.oScroll.sY&&(b.style.height=e(a.nTable).outerHeight()+"px",b.style.overflow="visible")},_fnPrintScrollEnd:function(){var a=this.s.dt,b=a.nTable.parentNode;""!==a.oScroll.sX&&(b.style.width=a.oApi._fnStringToCss(a.oScroll.sX),b.style.overflow="auto");""!==a.oScroll.sY&&(b.style.height=a.oApi._fnStringToCss(a.oScroll.sY),b.style.overflow="auto")},_fnPrintShowNodes:function(){for(var a=this.dom.print.hidden,b=0,c=a.length;b<c;b++)a[b].node.style.display=a[b].display;a.splice(0,a.length)},
 
_fnPrintHideNodes:function(a){for(var b=this.dom.print.hidden,c=a.parentNode,d=c.childNodes,g=0,h=d.length;g<h;g++)if(d[g]!=a&&1==d[g].nodeType){var f=e(d[g]).css("display");"none"!=f&&(b.push({node:d[g],display:f}),d[g].style.display="none")}"BODY"!=c.nodeName&&this._fnPrintHideNodes(c)}};TableTools._aInstances=[];TableTools._aListeners=[];TableTools.fnGetMasters=function(){for(var a=[],b=0,c=TableTools._aInstances.length;b<c;b++)TableTools._aInstances[b].s.master&&a.push(TableTools._aInstances[b]);
 
return a};TableTools.fnGetInstance=function(a){"object"!=typeof a&&(a=f.getElementById(a));for(var b=0,c=TableTools._aInstances.length;b<c;b++)if(TableTools._aInstances[b].s.master&&TableTools._aInstances[b].dom.table==a)return TableTools._aInstances[b];return null};TableTools._fnEventListen=function(a,b,c){TableTools._aListeners.push({that:a,type:b,fn:c})};TableTools._fnEventDispatch=function(a,b,c){for(var d=TableTools._aListeners,e=0,f=d.length;e<f;e++)a.dom.table==d[e].that.dom.table&&d[e].type==
 
b&&d[e].fn(c)};TableTools.buttonBase={sAction:"text",sTag:"default",sLinerTag:"default",sButtonClass:"DTTT_button_text",sButtonText:"Button text",sTitle:"",sToolTip:"",sCharSet:"utf8",bBomInc:!1,sFileName:"*.csv",sFieldBoundary:"",sFieldSeperator:"\t",sNewLine:"auto",mColumns:"all",bHeader:!0,bFooter:!0,bOpenRows:!1,bSelectedOnly:!1,fnMouseover:null,fnMouseout:null,fnClick:null,fnSelect:null,fnComplete:null,fnInit:null,fnCellRender:null};TableTools.BUTTONS={csv:e.extend({},TableTools.buttonBase,{sAction:"flash_save",
 
sButtonClass:"DTTT_button_csv",sButtonText:"CSV",sFieldBoundary:'"',sFieldSeperator:",",fnClick:function(a,b,c){this.fnSetText(c,this.fnGetTableData(b))}}),xls:e.extend({},TableTools.buttonBase,{sAction:"flash_save",sCharSet:"utf16le",bBomInc:!0,sButtonClass:"DTTT_button_xls",sButtonText:"Excel",fnClick:function(a,b,c){this.fnSetText(c,this.fnGetTableData(b))}}),copy:e.extend({},TableTools.buttonBase,{sAction:"flash_copy",sButtonClass:"DTTT_button_copy",sButtonText:"Copy",fnClick:function(a,b,c){this.fnSetText(c,
 
this.fnGetTableData(b))},fnComplete:function(a,b,c,d){a=d.split("\n").length;a=null===this.s.dt.nTFoot?a-1:a-2;this.fnInfo("<h6>Table copied</h6><p>Copied "+a+" row"+(1==a?"":"s")+" to the clipboard.</p>",1500)}}),pdf:e.extend({},TableTools.buttonBase,{sAction:"flash_pdf",sNewLine:"\n",sFileName:"*.pdf",sButtonClass:"DTTT_button_pdf",sButtonText:"PDF",sPdfOrientation:"portrait",sPdfSize:"A4",sPdfMessage:"",fnClick:function(a,b,c){this.fnSetText(c,"title:"+this.fnGetTitle(b)+"\nmessage:"+b.sPdfMessage+
 
"\ncolWidth:"+this.fnCalcColRatios(b)+"\norientation:"+b.sPdfOrientation+"\nsize:"+b.sPdfSize+"\n--/TableToolsOpts--\n"+this.fnGetTableData(b))}}),print:e.extend({},TableTools.buttonBase,{sInfo:"<h6>Print view</h6><p>Please use your browser's print function to print this table. Press escape when finished.",sMessage:null,bShowAll:!0,sToolTip:"View print view",sButtonClass:"DTTT_button_print",sButtonText:"Print",fnClick:function(a,b){this.fnPrint(!0,b)}}),text:e.extend({},TableTools.buttonBase),select:e.extend({},
 
TableTools.buttonBase,{sButtonText:"Select button",fnSelect:function(a){0!==this.fnGetSelected().length?e(a).removeClass(this.classes.buttons.disabled):e(a).addClass(this.classes.buttons.disabled)},fnInit:function(a){e(a).addClass(this.classes.buttons.disabled)}}),select_single:e.extend({},TableTools.buttonBase,{sButtonText:"Select button",fnSelect:function(a){1==this.fnGetSelected().length?e(a).removeClass(this.classes.buttons.disabled):e(a).addClass(this.classes.buttons.disabled)},fnInit:function(a){e(a).addClass(this.classes.buttons.disabled)}}),
 
select_all:e.extend({},TableTools.buttonBase,{sButtonText:"Select all",fnClick:function(){this.fnSelectAll()},fnSelect:function(a){this.fnGetSelected().length==this.s.dt.fnRecordsDisplay()?e(a).addClass(this.classes.buttons.disabled):e(a).removeClass(this.classes.buttons.disabled)}}),select_none:e.extend({},TableTools.buttonBase,{sButtonText:"Deselect all",fnClick:function(){this.fnSelectNone()},fnSelect:function(a){0!==this.fnGetSelected().length?e(a).removeClass(this.classes.buttons.disabled):e(a).addClass(this.classes.buttons.disabled)},
 
fnInit:function(a){e(a).addClass(this.classes.buttons.disabled)}}),ajax:e.extend({},TableTools.buttonBase,{sAjaxUrl:"/xhr.php",sButtonText:"Ajax button",fnClick:function(a,b){var c=this.fnGetTableData(b);e.ajax({url:b.sAjaxUrl,data:[{name:"tableData",value:c}],success:b.fnAjaxComplete,dataType:"json",type:"POST",cache:!1,error:function(){alert("Error detected when sending table data to server")}})},fnAjaxComplete:function(){alert("Ajax complete")}}),div:e.extend({},TableTools.buttonBase,{sAction:"div",
 
sTag:"div",sButtonClass:"DTTT_nonbutton",sButtonText:"Text button"}),collection:e.extend({},TableTools.buttonBase,{sAction:"collection",sButtonClass:"DTTT_button_collection",sButtonText:"Collection",fnClick:function(a,b){this._fnCollectionShow(a,b)}})};TableTools.classes={container:"DTTT_container",buttons:{normal:"DTTT_button",disabled:"DTTT_disabled"},collection:{container:"DTTT_collection",background:"DTTT_collection_background",buttons:{normal:"DTTT_button",disabled:"DTTT_disabled"}},select:{table:"DTTT_selectable",
 
row:"DTTT_selected"},print:{body:"DTTT_Print",info:"DTTT_print_info",message:"DTTT_PrintMessage"}};TableTools.classes_themeroller={container:"DTTT_container ui-buttonset ui-buttonset-multi",buttons:{normal:"DTTT_button ui-button ui-state-default"},collection:{container:"DTTT_collection ui-buttonset ui-buttonset-multi"}};TableTools.DEFAULTS={sSwfPath:"media/swf/copy_csv_xls_pdf.swf",sRowSelect:"none",sSelectedClass:null,fnPreRowSelect:null,fnRowSelected:null,fnRowDeselected:null,aButtons:["copy","csv",
 
"xls","pdf","print"],oTags:{container:"div",button:"a",liner:"span",collection:{container:"div",button:"a",liner:"span"}}};TableTools.prototype.CLASS="TableTools";TableTools.VERSION="2.1.3";TableTools.prototype.VERSION=TableTools.VERSION;"function"==typeof e.fn.dataTable&&"function"==typeof e.fn.dataTableExt.fnVersionCheck&&e.fn.dataTableExt.fnVersionCheck("1.9.0")?e.fn.dataTableExt.aoFeatures.push({fnInit:function(a){a=new TableTools(a.oInstance,"undefined"!=typeof a.oInit.oTableTools?a.oInit.oTableTools:
 
{});TableTools._aInstances.push(a);return a.dom.container},cFeature:"T",sFeature:"TableTools"}):alert("Warning: TableTools 2 requires DataTables 1.9.0 or newer - www.datatables.net/download");e.fn.DataTable.TableTools=TableTools})(jQuery,window,document);
symposion/static/tabletools/js/TableTools.min.js.gz
Show inline comments
 
new file 100644
 
binary diff not shown
symposion/static/tabletools/js/ZeroClipboard.js
Show inline comments
 
new file 100755
 
// Simple Set Clipboard System
 
// Author: Joseph Huckaby
 

	
 
var ZeroClipboard_TableTools = {
 
	
 
	version: "1.0.4-TableTools2",
 
	clients: {}, // registered upload clients on page, indexed by id
 
	moviePath: '', // URL to movie
 
	nextId: 1, // ID of next movie
 
	
 
	$: function(thingy) {
 
		// simple DOM lookup utility function
 
		if (typeof(thingy) == 'string') thingy = document.getElementById(thingy);
 
		if (!thingy.addClass) {
 
			// extend element with a few useful methods
 
			thingy.hide = function() { this.style.display = 'none'; };
 
			thingy.show = function() { this.style.display = ''; };
 
			thingy.addClass = function(name) { this.removeClass(name); this.className += ' ' + name; };
 
			thingy.removeClass = function(name) {
 
				this.className = this.className.replace( new RegExp("\\s*" + name + "\\s*"), " ").replace(/^\s+/, '').replace(/\s+$/, '');
 
			};
 
			thingy.hasClass = function(name) {
 
				return !!this.className.match( new RegExp("\\s*" + name + "\\s*") );
 
			}
 
		}
 
		return thingy;
 
	},
 
	
 
	setMoviePath: function(path) {
 
		// set path to ZeroClipboard.swf
 
		this.moviePath = path;
 
	},
 
	
 
	dispatch: function(id, eventName, args) {
 
		// receive event from flash movie, send to client		
 
		var client = this.clients[id];
 
		if (client) {
 
			client.receiveEvent(eventName, args);
 
		}
 
	},
 
	
 
	register: function(id, client) {
 
		// register new client to receive events
 
		this.clients[id] = client;
 
	},
 
	
 
	getDOMObjectPosition: function(obj) {
 
		// get absolute coordinates for dom element
 
		var info = {
 
			left: 0, 
 
			top: 0, 
 
			width: obj.width ? obj.width : obj.offsetWidth, 
 
			height: obj.height ? obj.height : obj.offsetHeight
 
		};
 
		
 
		if ( obj.style.width != "" )
 
			info.width = obj.style.width.replace("px","");
 
		
 
		if ( obj.style.height != "" )
 
			info.height = obj.style.height.replace("px","");
 

	
 
		while (obj) {
 
			info.left += obj.offsetLeft;
 
			info.top += obj.offsetTop;
 
			obj = obj.offsetParent;
 
		}
 

	
 
		return info;
 
	},
 
	
 
	Client: function(elem) {
 
		// constructor for new simple upload client
 
		this.handlers = {};
 
		
 
		// unique ID
 
		this.id = ZeroClipboard_TableTools.nextId++;
 
		this.movieId = 'ZeroClipboard_TableToolsMovie_' + this.id;
 
		
 
		// register client with singleton to receive flash events
 
		ZeroClipboard_TableTools.register(this.id, this);
 
		
 
		// create movie
 
		if (elem) this.glue(elem);
 
	}
 
};
 

	
 
ZeroClipboard_TableTools.Client.prototype = {
 
	
 
	id: 0, // unique ID for us
 
	ready: false, // whether movie is ready to receive events or not
 
	movie: null, // reference to movie object
 
	clipText: '', // text to copy to clipboard
 
	fileName: '', // default file save name
 
	action: 'copy', // action to perform
 
	handCursorEnabled: true, // whether to show hand cursor, or default pointer cursor
 
	cssEffects: true, // enable CSS mouse effects on dom container
 
	handlers: null, // user event handlers
 
	sized: false,
 
	
 
	glue: function(elem, title) {
 
		// glue to DOM element
 
		// elem can be ID or actual DOM element object
 
		this.domElement = ZeroClipboard_TableTools.$(elem);
 
		
 
		// float just above object, or zIndex 99 if dom element isn't set
 
		var zIndex = 99;
 
		if (this.domElement.style.zIndex) {
 
			zIndex = parseInt(this.domElement.style.zIndex) + 1;
 
		}
 
		
 
		// find X/Y position of domElement
 
		var box = ZeroClipboard_TableTools.getDOMObjectPosition(this.domElement);
 
		
 
		// create floating DIV above element
 
		this.div = document.createElement('div');
 
		var style = this.div.style;
 
		style.position = 'absolute';
 
		style.left = '0px';
 
		style.top = '0px';
 
		style.width = (box.width) + 'px';
 
		style.height = box.height + 'px';
 
		style.zIndex = zIndex;
 
		
 
		if ( typeof title != "undefined" && title != "" ) {
 
			this.div.title = title;
 
		}
 
		if ( box.width != 0 && box.height != 0 ) {
 
			this.sized = true;
 
		}
 
		
 
		// style.backgroundColor = '#f00'; // debug
 
		if ( this.domElement ) {
 
			this.domElement.appendChild(this.div);
 
			this.div.innerHTML = this.getHTML( box.width, box.height );
 
		}
 
	},
 
	
 
	positionElement: function() {
 
		var box = ZeroClipboard_TableTools.getDOMObjectPosition(this.domElement);
 
		var style = this.div.style;
 
		
 
		style.position = 'absolute';
 
		//style.left = (this.domElement.offsetLeft)+'px';
 
		//style.top = this.domElement.offsetTop+'px';
 
		style.width = box.width + 'px';
 
		style.height = box.height + 'px';
 
		
 
		if ( box.width != 0 && box.height != 0 ) {
 
			this.sized = true;
 
		} else {
 
			return;
 
		}
 
		
 
		var flash = this.div.childNodes[0];
 
		flash.width = box.width;
 
		flash.height = box.height;
 
	},
 
	
 
	getHTML: function(width, height) {
 
		// return HTML for movie
 
		var html = '';
 
		var flashvars = 'id=' + this.id + 
 
			'&width=' + width + 
 
			'&height=' + height;
 
			
 
		if (navigator.userAgent.match(/MSIE/)) {
 
			// IE gets an OBJECT tag
 
			var protocol = location.href.match(/^https/i) ? 'https://' : 'http://';
 
			html += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+protocol+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="'+width+'" height="'+height+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroClipboard_TableTools.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+flashvars+'"/><param name="wmode" value="transparent"/></object>';
 
		}
 
		else {
 
			// all other browsers get an EMBED tag
 
			html += '<embed id="'+this.movieId+'" src="'+ZeroClipboard_TableTools.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+flashvars+'" wmode="transparent" />';
 
		}
 
		return html;
 
	},
 
	
 
	hide: function() {
 
		// temporarily hide floater offscreen
 
		if (this.div) {
 
			this.div.style.left = '-2000px';
 
		}
 
	},
 
	
 
	show: function() {
 
		// show ourselves after a call to hide()
 
		this.reposition();
 
	},
 
	
 
	destroy: function() {
 
		// destroy control and floater
 
		if (this.domElement && this.div) {
 
			this.hide();
 
			this.div.innerHTML = '';
 
			
 
			var body = document.getElementsByTagName('body')[0];
 
			try { body.removeChild( this.div ); } catch(e) {;}
 
			
 
			this.domElement = null;
 
			this.div = null;
 
		}
 
	},
 
	
 
	reposition: function(elem) {
 
		// reposition our floating div, optionally to new container
 
		// warning: container CANNOT change size, only position
 
		if (elem) {
 
			this.domElement = ZeroClipboard_TableTools.$(elem);
 
			if (!this.domElement) this.hide();
 
		}
 
		
 
		if (this.domElement && this.div) {
 
			var box = ZeroClipboard_TableTools.getDOMObjectPosition(this.domElement);
 
			var style = this.div.style;
 
			style.left = '' + box.left + 'px';
 
			style.top = '' + box.top + 'px';
 
		}
 
	},
 
	
 
	clearText: function() {
 
		// clear the text to be copy / saved
 
		this.clipText = '';
 
		if (this.ready) this.movie.clearText();
 
	},
 
	
 
	appendText: function(newText) {
 
		// append text to that which is to be copied / saved
 
		this.clipText += newText;
 
		if (this.ready) { this.movie.appendText(newText) ;}
 
	},
 
	
 
	setText: function(newText) {
 
		// set text to be copied to be copied / saved
 
		this.clipText = newText;
 
		if (this.ready) { this.movie.setText(newText) ;}
 
	},
 
	
 
	setCharSet: function(charSet) {
 
		// set the character set (UTF16LE or UTF8)
 
		this.charSet = charSet;
 
		if (this.ready) { this.movie.setCharSet(charSet) ;}
 
	},
 
	
 
	setBomInc: function(bomInc) {
 
		// set if the BOM should be included or not
 
		this.incBom = bomInc;
 
		if (this.ready) { this.movie.setBomInc(bomInc) ;}
 
	},
 
	
 
	setFileName: function(newText) {
 
		// set the file name
 
		this.fileName = newText;
 
		if (this.ready) this.movie.setFileName(newText);
 
	},
 
	
 
	setAction: function(newText) {
 
		// set action (save or copy)
 
		this.action = newText;
 
		if (this.ready) this.movie.setAction(newText);
 
	},
 
	
 
	addEventListener: function(eventName, func) {
 
		// add user event listener for event
 
		// event types: load, queueStart, fileStart, fileComplete, queueComplete, progress, error, cancel
 
		eventName = eventName.toString().toLowerCase().replace(/^on/, '');
 
		if (!this.handlers[eventName]) this.handlers[eventName] = [];
 
		this.handlers[eventName].push(func);
 
	},
 
	
 
	setHandCursor: function(enabled) {
 
		// enable hand cursor (true), or default arrow cursor (false)
 
		this.handCursorEnabled = enabled;
 
		if (this.ready) this.movie.setHandCursor(enabled);
 
	},
 
	
 
	setCSSEffects: function(enabled) {
 
		// enable or disable CSS effects on DOM container
 
		this.cssEffects = !!enabled;
 
	},
 
	
 
	receiveEvent: function(eventName, args) {
 
		// receive event from flash
 
		eventName = eventName.toString().toLowerCase().replace(/^on/, '');
 
		
 
		// special behavior for certain events
 
		switch (eventName) {
 
			case 'load':
 
				// movie claims it is ready, but in IE this isn't always the case...
 
				// bug fix: Cannot extend EMBED DOM elements in Firefox, must use traditional function
 
				this.movie = document.getElementById(this.movieId);
 
				if (!this.movie) {
 
					var self = this;
 
					setTimeout( function() { self.receiveEvent('load', null); }, 1 );
 
					return;
 
				}
 
				
 
				// firefox on pc needs a "kick" in order to set these in certain cases
 
				if (!this.ready && navigator.userAgent.match(/Firefox/) && navigator.userAgent.match(/Windows/)) {
 
					var self = this;
 
					setTimeout( function() { self.receiveEvent('load', null); }, 100 );
 
					this.ready = true;
 
					return;
 
				}
 
				
 
				this.ready = true;
 
				this.movie.clearText();
 
				this.movie.appendText( this.clipText );
 
				this.movie.setFileName( this.fileName );
 
				this.movie.setAction( this.action );
 
				this.movie.setCharSet( this.charSet );
 
				this.movie.setBomInc( this.incBom );
 
				this.movie.setHandCursor( this.handCursorEnabled );
 
				break;
 
			
 
			case 'mouseover':
 
				if (this.domElement && this.cssEffects) {
 
					//this.domElement.addClass('hover');
 
					if (this.recoverActive) this.domElement.addClass('active');
 
				}
 
				break;
 
			
 
			case 'mouseout':
 
				if (this.domElement && this.cssEffects) {
 
					this.recoverActive = false;
 
					if (this.domElement.hasClass('active')) {
 
						this.domElement.removeClass('active');
 
						this.recoverActive = true;
 
					}
 
					//this.domElement.removeClass('hover');
 
				}
 
				break;
 
			
 
			case 'mousedown':
 
				if (this.domElement && this.cssEffects) {
 
					this.domElement.addClass('active');
 
				}
 
				break;
 
			
 
			case 'mouseup':
 
				if (this.domElement && this.cssEffects) {
 
					this.domElement.removeClass('active');
 
					this.recoverActive = false;
 
				}
 
				break;
 
		} // switch eventName
 
		
 
		if (this.handlers[eventName]) {
 
			for (var idx = 0, len = this.handlers[eventName].length; idx < len; idx++) {
 
				var func = this.handlers[eventName][idx];
 
			
 
				if (typeof(func) == 'function') {
 
					// actual function reference
 
					func(this, args);
 
				}
 
				else if ((typeof(func) == 'object') && (func.length == 2)) {
 
					// PHP style object + method, i.e. [myObject, 'myMethod']
 
					func[0][ func[1] ](this, args);
 
				}
 
				else if (typeof(func) == 'string') {
 
					// name of function
 
					window[func](this, args);
 
				}
 
			} // foreach event handler defined
 
		} // user defined handler for event
 
	}
 
	
 
};
symposion/static/tabletools/swf/copy_csv_xls.swf
Show inline comments
 
new file 100644
 
binary diff not shown

Changeset was too big and was cut off... Show full diff anyway

0 comments (0 inline, 0 general)