text: var TableTools;!function(a,b,c){var d=function(d,e){"use strict";var f={version:"1.0.4-TableTools2",clients:{},moviePath:"",nextId:1,$:function(a){return"string"==typeof a&&(a=b.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(new RegExp("\\s*"+a+"\\s*")," ").replace(/^\s+/,"").replace(/\s+$/,"")},a.hasClass=function(a){return!!this.className.match(new RegExp("\\s*"+a+"\\s*"))}),a},setMoviePath:function(a){this.moviePath=a},dispatch:function(a,b,c){var d=this.clients[a];d&&d.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};for(""!==a.style.width&&(b.width=a.style.width.replace("px","")),""!==a.style.height&&(b.height=a.style.height.replace("px",""));a;)b.left+=a.offsetLeft,b.top+=a.offsetTop,a=a.offsetParent;return b},Client:function(a){this.handlers={},this.id=f.nextId++,this.movieId="ZeroClipboard_TableToolsMovie_"+this.id,f.register(this.id,this),a&&this.glue(a)}};return f.Client.prototype={id:0,ready:!1,movie:null,clipText:"",fileName:"",action:"copy",handCursorEnabled:!0,cssEffects:!0,handlers:null,sized:!1,glue:function(a,c){this.domElement=f.$(a);var d=99;this.domElement.style.zIndex&&(d=parseInt(this.domElement.style.zIndex,10)+1);var e=f.getDOMObjectPosition(this.domElement);this.div=b.createElement("div");var g=this.div.style;g.position="absolute",g.left="0px",g.top="0px",g.width=e.width+"px",g.height=e.height+"px",g.zIndex=d,"undefined"!=typeof c&&""!==c&&(this.div.title=c),0!==e.width&&0!==e.height&&(this.sized=!0),this.domElement&&(this.domElement.appendChild(this.div),this.div.innerHTML=this.getHTML(e.width,e.height).replace(/&/g,"&amp;"))},positionElement:function(){var a=f.getDOMObjectPosition(this.domElement),b=this.div.style;if(b.position="absolute",b.width=a.width+"px",b.height=a.height+"px",0!==a.width&&0!==a.height){this.sized=!0;var c=this.div.childNodes[0];c.width=a.width,c.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+='<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="'+f.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="'+f.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=b.getElementsByTagName("body")[0];try{a.removeChild(this.div)}catch(a){}this.domElement=null,this.div=null}},reposition:function(a){if(a&&(this.domElement=f.$(a),this.domElement||this.hide()),this.domElement&&this.div){var b=f.getDOMObjectPosition(this.domElement),c=this.div.style;c.left=""+b.left+"px",c.top=""+b.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(c,d){var e;switch(c=c.toString().toLowerCase().replace(/^on/,"")){case"load":if(this.movie=b.getElementById(this.movieId),!this.movie)return e=this,void setTimeout(function(){e.receiveEvent("load",null)},1);if(!this.ready&&navigator.userAgent.match(/Firefox/)&&navigator.userAgent.match(/Windows/))return e=this,setTimeout(function(){e.receiveEvent("load",null)},100),void(this.ready=!0);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[c])for(var f=0,g=this.handlers[c].length;f<g;f++){var h=this.handlers[c][f];"function"==typeof h?h(this,d):"object"==typeof h&&2==h.length?h[0][h[1]](this,d):"string"==typeof h&&a[h](this,d)}}},a.ZeroClipboard_TableTools=f,function(a,b,d){TableTools=function(b,c){!this instanceof TableTools&&alert("Warning: TableTools must be initialised with the keyword 'new'");var d=a.fn.dataTable.Api?new a.fn.dataTable.Api(b).settings()[0]:b.fnSettings();return this.s={that:this,dt:d,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=a.extend(!0,{},TableTools.classes),this.s.dt.bJUI&&a.extend(!0,this.classes,TableTools.classes_themeroller),this.fnSettings=function(){return this.s},"undefined"==typeof c&&(c={}),TableTools._aInstances.push(this),this._fnConstruct(c),this},TableTools.prototype={fnGetSelected:function(a){var e,f,b=[],c=this.s.dt.aoData,d=this.s.dt.aiDisplay;if(a)for(e=0,f=d.length;e<f;e++)c[d[e]]._DTTT_selected&&b.push(c[d[e]].nTr);else for(e=0,f=c.length;e<f;e++)c[e]._DTTT_selected&&b.push(c[e].nTr);return b},fnGetSelectedData:function(){var c,d,a=[],b=this.s.dt.aoData;for(c=0,d=b.length;c<d;c++)b[c]._DTTT_selected&&a.push(this.s.dt.oInstance.fnGetData(c));return a},fnGetSelectedIndexes:function(a){var e,f,b=[],c=this.s.dt.aoData,d=this.s.dt.aiDisplay;if(a)for(e=0,f=d.length;e<f;e++)c[d[e]]._DTTT_selected&&b.push(d[e]);else for(e=0,f=c.length;e<f;e++)c[e]._DTTT_selected&&b.push(e);return b},fnIsSelected:function(a){var b=this.s.dt.oInstance.fnGetPosition(a);return this.s.dt.aoData[b]._DTTT_selected===!0},fnSelectAll:function(a){this._fnRowSelect(a?this.s.dt.aiDisplay:this.s.dt.aoData)},fnSelectNone:function(a){this._fnRowDeselect(this.fnGetSelectedIndexes(a))},fnSelect:function(a){"single"==this.s.select.type?(this.fnSelectNone(),this._fnRowSelect(a)):this._fnRowSelect(a)},fnDeselect:function(a){this._fnRowDeselect(a)},fnGetTitle:function(a){var b="";if("undefined"!=typeof a.sTitle&&""!==a.sTitle)b=a.sTitle;else{var c=d.getElementsByTagName("title");c.length>0&&(b=c[0].innerHTML)}return"¡".toString().length<4?b.replace(/[^a-zA-Z0-9_\u00A1-\uFFFF\.,\-_ !\(\)]/g,""):b.replace(/[^a-zA-Z0-9_\.,\-_ !\(\)]/g,"")},fnCalcColRatios:function(a){var g,h,b=this.s.dt.aoColumns,c=this._fnColumnTargets(a.mColumns),d=[],e=0,f=0;for(g=0,h=c.length;g<h;g++)c[g]&&(e=b[g].nTh.offsetWidth,f+=e,d.push(e));for(g=0,h=d.length;g<h;g++)d[g]=d[g]/f;return d.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 f.clients)if(a){var b=f.clients[a];"undefined"!=typeof b.domElement&&b.domElement.parentNode&&b.positionElement()}},fnResizeRequired:function(){for(var a in f.clients)if(a){var b=f.clients[a];if("undefined"!=typeof b.domElement&&b.domElement.parentNode==this.dom.container&&b.sized===!1)return!0}return!1},fnPrint:function(a,b){b===c&&(b={}),a===c||a?this._fnPrintStart(b):this._fnPrintEnd()},fnInfo:function(b,c){var d=a("<div/>").addClass(this.classes.print.info).html(b).appendTo("body");setTimeout(function(){d.fadeOut("normal",function(){d.remove()})},c)},fnContainer:function(){return this.dom.container},_fnConstruct:function(b){var c=this;this._fnCustomiseSettings(b),this.dom.container=d.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(){a(c.s.dt.nTBody).off("click.DTTT_Select","tr"),a(c.dom.container).empty();var b=a.inArray(c,TableTools._aInstances);b!==-1&&TableTools._aInstances.splice(b,1)}})},_fnCustomiseSettings:function(b){"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=a.extend({},TableTools.DEFAULTS,b),this.s.swfPath=this.s.custom.sSwfPath,"undefined"!=typeof f&&(f.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(b,c){for(var d,e=0,f=b.length;e<f;e++){if("string"==typeof b[e]){if("undefined"==typeof TableTools.BUTTONS[b[e]]){alert("TableTools: Warning - unknown button type: "+b[e]);continue}d=a.extend({},TableTools.BUTTONS[b[e]],!0)}else{if("undefined"==typeof TableTools.BUTTONS[b[e].sExtends]){alert("TableTools: Warning - unknown button type: "+b[e].sExtends);continue}var g=a.extend({},TableTools.BUTTONS[b[e].sExtends],!0);d=a.extend(g,b[e],!0)}var h=this._fnCreateButton(d,a(c).hasClass(this.classes.collection.container));h&&c.appendChild(h)}},_fnCreateButton:function(b,c){var d=this._fnButtonBase(b,c);if(b.sAction.match(/flash/)){if(!this._fnHasFlash())return!1;this._fnFlashConfig(d,b)}else"text"==b.sAction?this._fnTextConfig(d,b):"div"==b.sAction?this._fnTextConfig(d,b):"collection"==b.sAction&&(this._fnTextConfig(d,b),this._fnCollectionConfig(d,b));return this.s.dt.iTabIndex!==-1&&a(d).attr("tabindex",this.s.dt.iTabIndex).attr("aria-controls",this.s.dt.sTableId).on("keyup.DTTT",function(b){13===b.keyCode&&(b.stopPropagation(),a(this).trigger("click"))}).on("mousedown.DTTT",function(a){b.sAction.match(/flash/)||a.preventDefault()}),d},_fnButtonBase:function(a,b){var c,e,f;b?(c=a.sTag&&"default"!==a.sTag?a.sTag:this.s.tags.collection.button,e=a.sLinerTag&&"default"!==a.sLinerTag?a.sLiner:this.s.tags.collection.liner,f=this.classes.collection.buttons.normal):(c=a.sTag&&"default"!==a.sTag?a.sTag:this.s.tags.button,e=a.sLinerTag&&"default"!==a.sLinerTag?a.sLiner:this.s.tags.liner,f=this.classes.buttons.normal);var g=d.createElement(c),h=d.createElement(e),i=this._fnGetMasterSettings();return g.className=f+" "+a.sButtonClass,g.setAttribute("id","ToolTables_"+this.s.dt.sInstance+"_"+i.buttonCounter),g.appendChild(h),h.innerHTML=a.sButtonText,i.buttonCounter++,g},_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=d.createElement(this.s.tags.collection.container);c.style.display="none",c.className=this.classes.collection.container,b._collection=c,d.body.appendChild(c),this._fnButtonDefinations(b.aButtons,c)},_fnCollectionShow:function(c,e){var f=this,g=a(c).offset(),h=e._collection,i=g.left,j=g.top+a(c).outerHeight(),k=a(b).height(),l=a(d).height(),m=a(b).width(),n=a(d).width();h.style.position="absolute",h.style.left=i+"px",h.style.top=j+"px",h.style.display="block",a(h).css("opacity",0);var o=d.createElement("div");o.style.position="absolute",o.style.left="0px",o.style.top="0px",o.style.height=(k>l?k:l)+"px",o.style.width=(m>n?m:n)+"px",o.className=this.classes.collection.background,a(o).css("opacity",0),d.body.appendChild(o),d.body.appendChild(h);var p=a(h).outerWidth(),q=a(h).outerHeight();i+p>n&&(h.style.left=n-p+"px"),j+q>l&&(h.style.top=j-q-a(c).outerHeight()+"px"),this.dom.collection.collection=h,this.dom.collection.background=o,setTimeout(function(){a(h).animate({opacity:1},500),a(o).animate({opacity:.25},500)},10),this.fnResizeButtons(),a(o).click(function(){f._fnCollectionHide.call(f,null,null)})},_fnCollectionHide:function(b,c){null!==c&&"collection"==c.sExtends||null!==this.dom.collection.collection&&(a(this.dom.collection.collection).animate({opacity:0},500,function(a){this.style.display="none"}),a(this.dom.collection.background).animate({opacity:0},500,function(a){this.parentNode.removeChild(this)}),this.dom.collection.collection=null,this.dom.collection.background=null)},_fnRowSelectConfig:function(){if(this.s.master){var b=this,e=this.s.dt;this.s.dt.aoOpenRows;a(e.nTable).addClass(this.classes.select.table),"os"===this.s.select.type&&(a(e.nTBody).on("mousedown.DTTT_Select","tr",function(b){b.shiftKey&&a(e.nTBody).css("-moz-user-select","none").one("selectstart.DTTT_Select","tr",function(){return!1})}),a(e.nTBody).on("mouseup.DTTT_Select","tr",function(b){a(e.nTBody).css("-moz-user-select","")})),a(e.nTBody).on("click.DTTT_Select",this.s.custom.sRowSelector,function(c){var d="tr"===this.nodeName.toLowerCase()?this:a(this).parents("tr")[0],f=b.s.select,g=b.s.dt.oInstance.fnGetPosition(d);if(d.parentNode==e.nTBody&&null!==e.oInstance.fnGetData(d)){if("os"==f.type)if(c.ctrlKey||c.metaKey)b.fnIsSelected(d)?b._fnRowDeselect(d,c):b._fnRowSelect(d,c);else if(c.shiftKey){var h=b.s.dt.aiDisplay.slice(),i=a.inArray(f.lastRow,h),j=a.inArray(g,h);if(0===b.fnGetSelected().length||i===-1)h.splice(a.inArray(g,h)+1,h.length);else{if(i>j){var k=j;j=i,i=k}h.splice(j+1,h.length),h.splice(0,i)}b.fnIsSelected(d)?(h.splice(a.inArray(g,h),1),b._fnRowDeselect(h,c)):b._fnRowSelect(h,c)}else b.fnIsSelected(d)&&1===b.fnGetSelected().length?b._fnRowDeselect(d,c):(b.fnSelectNone(),b._fnRowSelect(d,c));else b.fnIsSelected(d)?b._fnRowDeselect(d,c):"single"==f.type?(b.fnSelectNone(),b._fnRowSelect(d,c)):"multi"==f.type&&b._fnRowSelect(d,c);f.lastRow=g}}),e.oApi._fnCallbackReg(e,"aoRowCreatedCallback",function(c,d,f){e.aoData[f]._DTTT_selected&&a(c).addClass(b.classes.select.row)},"TableTools-SelectAll")}},_fnRowSelect:function(b,c){var h,i,d=this,e=this._fnSelectData(b),g=(0===e.length?null:e[0].nTr,[]);for(h=0,i=e.length;h<i;h++)e[h].nTr&&g.push(e[h].nTr);if(null===this.s.select.preRowSelect||this.s.select.preRowSelect.call(this,c,g,!0)){for(h=0,i=e.length;h<i;h++)e[h]._DTTT_selected=!0,e[h].nTr&&a(e[h].nTr).addClass(d.classes.select.row);null!==this.s.select.postSelected&&this.s.select.postSelected.call(this,g),TableTools._fnEventDispatch(this,"select",g,!0)}},_fnRowDeselect:function(b,c){var h,i,d=this,e=this._fnSelectData(b),g=(0===e.length?null:e[0].nTr,[]);for(h=0,i=e.length;h<i;h++)e[h].nTr&&g.push(e[h].nTr);if(null===this.s.select.preRowSelect||this.s.select.preRowSelect.call(this,c,g,!1)){for(h=0,i=e.length;h<i;h++)e[h]._DTTT_selected=!1,e[h].nTr&&a(e[h].nTr).removeClass(d.classes.select.row);null!==this.s.select.postDeselected&&this.s.select.postDeselected.call(this,g),TableTools._fnEventDispatch(this,"select",g,!1)}},_fnSelectData:function(a){var c,d,e,b=[];if(a.nodeName)c=this.s.dt.oInstance.fnGetPosition(a),b.push(this.s.dt.aoData[c]);else{if("undefined"!=typeof a.length){for(d=0,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]);return b}b.push(a)}return b},_fnTextConfig:function(b,c){var d=this;null!==c.fnInit&&c.fnInit.call(this,b,c),""!==c.sToolTip&&(b.title=c.sToolTip),a(b).hover(function(){null!==c.fnMouseover&&c.fnMouseover.call(this,b,c,null)},function(){null!==c.fnMouseout&&c.fnMouseout.call(this,b,c,null)}),null!==c.fnSelect&&TableTools._fnEventListen(this,"select",function(a){c.fnSelect.call(d,b,c,a)}),a(b).click(function(a){null!==c.fnClick&&c.fnClick.call(d,b,c,null,a),null!==c.fnComplete&&c.fnComplete.call(d,b,c,null,null),d._fnCollectionHide(b,c)})},_fnHasFlash:function(){try{var a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(a)return!0}catch(a){if(navigator.mimeTypes&&navigator.mimeTypes["application/x-shockwave-flash"]!==c&&navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)return!0}return!1},_fnFlashConfig:function(a,b){var c=this,d=new f.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(e){null!==b.fnMouseover&&b.fnMouseover.call(c,a,b,d)}),d.addEventListener("mouseOut",function(e){null!==b.fnMouseout&&b.fnMouseout.call(c,a,b,d)}),d.addEventListener("mouseDown",function(e){null!==b.fnClick&&b.fnClick.call(c,a,b,d)}),d.addEventListener("complete",function(e,f){null!==b.fnComplete&&b.fnComplete.call(c,a,b,d,f),c._fnCollectionHide(a,b)}),this._fnFlashGlue(d,a,b.sToolTip)},_fnFlashGlue:function(a,b,c){var e=this,f=b.getAttribute("id");d.getElementById(f)?a.glue(b,c):setTimeout(function(){e._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(b){var e,f,c=[],d=this.s.dt,g=d.aoColumns,h=g.length;if("function"==typeof b){var i=b.call(this,d);for(e=0,f=h;e<f;e++)c.push(a.inArray(e,i)!==-1)}else if("object"==typeof b){for(e=0,f=h;e<f;e++)c.push(!1);for(e=0,f=b.length;e<f;e++)c[b[e]]=!0}else if("visible"==b)for(e=0,f=h;e<f;e++)c.push(!!g[e].bVisible);else if("hidden"==b)for(e=0,f=h;e<f;e++)c.push(!g[e].bVisible);else if("sortable"==b)for(e=0,f=h;e<f;e++)c.push(!!g[e].bSortable);else for(e=0,f=h;e<f;e++)c.push(!0);return c},_fnNewline:function(a){return"auto"==a.sNewLine?navigator.userAgent.match(/Windows/)?"\r\n":"\n":a.sNewLine},_fnGetDataTablesData:function(b){var c,d,f,g,h,k,m,i=[],j="",l=this.s.dt,o=new RegExp(b.sFieldBoundary,"g"),p=this._fnColumnTargets(b.mColumns),q="undefined"!=typeof b.bSelectedOnly&&b.bSelectedOnly;if(b.bHeader){for(h=[],c=0,d=l.aoColumns.length;c<d;c++)p[c]&&(j=l.aoColumns[c].sTitle.replace(/\n/g," ").replace(/<.*?>/g,"").replace(/^\s+|\s+$/g,""),j=this._fnHtmlDecode(j),h.push(this._fnBoundData(j,b.sFieldBoundary,o)));i.push(h.join(b.sFieldSeperator))}q=!0;var r,s=this.fnGetSelectedIndexes();for(q="none"!==this.s.select.type&&q&&0!==s.length,r=q?s:e.Api?new e.Api(l).rows(b.oSelectorOpts).indexes().flatten().toArray():l.oInstance.$("tr",b.oSelectorOpts).map(function(a,b){return l.oInstance.fnGetPosition(b)}).get(),f=0,g=r.length;f<g;f++){for(m=l.aoData[r[f]].nTr,h=[],c=0,d=l.aoColumns.length;c<d;c++)if(p[c]){var t=l.oApi._fnGetCellData(l,r[f],c,"display");b.fnCellRender?j=b.fnCellRender(t,c,m,r[f])+"":"string"==typeof t?(j=t.replace(/\n/g," "),j=j.replace(/<img.*?\s+alt\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s>]+)).*?>/gi,"$1$2$3"),j=j.replace(/<.*?>/g,"")):j=t+"",j=j.replace(/^\s+/,"").replace(/\s+$/,""),j=this._fnHtmlDecode(j),h.push(this._fnBoundData(j,b.sFieldBoundary,o))}i.push(h.join(b.sFieldSeperator)),b.bOpenRows&&(k=a.grep(l.aoOpenRows,function(a){return a.nParent===m}),1===k.length&&(j=this._fnBoundData(a("td",k[0].nTr).html(),b.sFieldBoundary,o),i.push(j)))}if(b.bFooter&&null!==l.nTFoot){for(h=[],c=0,d=l.aoColumns.length;c<d;c++)p[c]&&null!==l.aoColumns[c].nTf&&(j=l.aoColumns[c].nTf.innerHTML.replace(/\n/g," ").replace(/<.*?>/g,""),j=this._fnHtmlDecode(j),h.push(this._fnBoundData(j,b.sFieldBoundary,o)));i.push(h.join(b.sFieldSeperator))}var u=i.join(this._fnNewline(b));return u},_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(a.indexOf("&")===-1)return a;var b=d.createElement("div");return a.replace(/&([^\s]*?);/g,function(a,c){return"#"===a.substr(1,1)?String.fromCharCode(Number(c.substr(1))):(b.innerHTML=a,b.childNodes[0].nodeValue)})},_fnPrintStart:function(c){var e=this,f=this.s.dt;this._fnPrintHideNodes(f.nTable),this.s.print.saveStart=f._iDisplayStart,this.s.print.saveLength=f._iDisplayLength,c.bShowAll&&(f._iDisplayStart=0,f._iDisplayLength=-1,f.oApi._fnCalculateEnd&&f.oApi._fnCalculateEnd(f),f.oApi._fnDraw(f)),""===f.oScroll.sX&&""===f.oScroll.sY||(this._fnPrintScrollStart(f),a(this.s.dt.nTable).bind("draw.DTTT_Print",function(){e._fnPrintScrollStart(f)}));var g=f.aanFeatures;for(var h in g)if("i"!=h&&"t"!=h&&1==h.length)for(var i=0,j=g[h].length;i<j;i++)this.dom.print.hidden.push({node:g[h][i],display:"block"}),g[h][i].style.display="none";a(d.body).addClass(this.classes.print.body),""!==c.sInfo&&this.fnInfo(c.sInfo,3e3),c.sMessage&&a("<div/>").addClass(this.classes.print.message).html(c.sMessage).prependTo("body"),this.s.print.saveScroll=a(b).scrollTop(),b.scrollTo(0,0),a(d).bind("keydown.DTTT",function(a){27==a.keyCode&&(a.preventDefault(),e._fnPrintEnd.call(e,a))})},_fnPrintEnd:function(c){var f=this.s.dt,g=this.s.print;this.dom.print;this._fnPrintShowNodes(),""===f.oScroll.sX&&""===f.oScroll.sY||(a(this.s.dt.nTable).unbind("draw.DTTT_Print"),this._fnPrintScrollEnd()),b.scrollTo(0,g.saveScroll),a("div."+this.classes.print.message).remove(),a(d.body).removeClass("DTTT_Print"),f._iDisplayStart=g.saveStart,f._iDisplayLength=g.saveLength,f.oApi._fnCalculateEnd&&f.oApi._fnCalculateEnd(f),f.oApi._fnDraw(f),a(d).unbind("keydown.DTTT")},_fnPrintScrollStart:function(){var f,g,b=this.s.dt,c=b.nScrollHead.getElementsByTagName("div")[0],e=(c.getElementsByTagName("table")[0],b.nTable.parentNode);f=b.nTable.getElementsByTagName("thead"),f.length>0&&b.nTable.removeChild(f[0]),null!==b.nTFoot&&(g=b.nTable.getElementsByTagName("tfoot"),g.length>0&&b.nTable.removeChild(g[0])),f=b.nTHead.cloneNode(!0),b.nTable.insertBefore(f,b.nTable.childNodes[0]),null!==b.nTFoot&&(g=b.nTFoot.cloneNode(!0),b.nTable.insertBefore(g,b.nTable.childNodes[1])),""!==b.oScroll.sX&&(b.nTable.style.width=a(b.nTable).outerWidth()+"px",e.style.width=a(b.nTable).outerWidth()+"px",e.style.overflow="visible"),""!==b.oScroll.sY&&(e.style.height=a(b.nTable).outerHeight()+"px",e.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(b){for(var c=this.dom.print.hidden,d=b.parentNode,e=d.childNodes,f=0,g=e.length;f<g;f++)if(e[f]!=b&&1==e[f].nodeType){var h=a(e[f]).css("display");"none"!=h&&(c.push({node:e[f],display:h}),e[f].style.display="none")}"BODY"!=d.nodeName.toUpperCase()&&this._fnPrintHideNodes(d)}},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=d.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,d){for(var e=TableTools._aListeners,f=0,g=e.length;f<g;f++)a.dom.table==e[f].that.dom.table&&e[f].type==b&&e[f].fn(c,d)},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,oSelectorOpts:c,fnMouseover:null,fnMouseout:null,fnClick:null,fnSelect:null,fnComplete:null,fnInit:null,fnCellRender:null},TableTools.BUTTONS={csv:a.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:a.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:a.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){var e=d.split("\n").length;b.bHeader&&e--,null!==this.s.dt.nTFoot&&b.bFooter&&e--;var f=1==e?"":"s";this.fnInfo("<h6>Table copied</h6><p>Copied "+e+" row"+f+" to the clipboard.</p>",1500)}}),pdf:a.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:a.extend({},TableTools.buttonBase,{sInfo:"<h6>Print view</h6><p>Please use your browser's print function to print this table. Press escape when finished.</p>",sMessage:null,bShowAll:!0,sToolTip:"View print view",sButtonClass:"DTTT_button_print",sButtonText:"Print",fnClick:function(a,b){this.fnPrint(!0,b)}}),text:a.extend({},TableTools.buttonBase),select:a.extend({},TableTools.buttonBase,{sButtonText:"Select button",fnSelect:function(b,c){0!==this.fnGetSelected().length?a(b).removeClass(this.classes.buttons.disabled):a(b).addClass(this.classes.buttons.disabled)},fnInit:function(b,c){a(b).addClass(this.classes.buttons.disabled)}}),select_single:a.extend({},TableTools.buttonBase,{sButtonText:"Select button",fnSelect:function(b,c){var d=this.fnGetSelected().length;1==d?a(b).removeClass(this.classes.buttons.disabled):a(b).addClass(this.classes.buttons.disabled)},fnInit:function(b,c){a(b).addClass(this.classes.buttons.disabled)}}),select_all:a.extend({},TableTools.buttonBase,{sButtonText:"Select all",fnClick:function(a,b){this.fnSelectAll()},fnSelect:function(b,c){this.fnGetSelected().length==this.s.dt.fnRecordsDisplay()?a(b).addClass(this.classes.buttons.disabled):a(b).removeClass(this.classes.buttons.disabled)}}),select_none:a.extend({},TableTools.buttonBase,{sButtonText:"Deselect all",fnClick:function(a,b){this.fnSelectNone()},fnSelect:function(b,c){0!==this.fnGetSelected().length?a(b).removeClass(this.classes.buttons.disabled):a(b).addClass(this.classes.buttons.disabled)},fnInit:function(b,c){a(b).addClass(this.classes.buttons.disabled)}}),ajax:a.extend({},TableTools.buttonBase,{sAjaxUrl:"/xhr.php",sButtonText:"Ajax button",fnClick:function(b,c){var d=this.fnGetTableData(c);a.ajax({url:c.sAjaxUrl,data:[{name:"tableData",value:d}],success:c.fnAjaxComplete,dataType:"json",type:"POST",cache:!1,error:function(){alert("Error detected when sending table data to server")}})},fnAjaxComplete:function(a){alert("Ajax complete")}}),div:a.extend({},TableTools.buttonBase,{sAction:"div",sTag:"div",sButtonClass:"DTTT_nonbutton",sButtonText:"Text button"}),collection:a.extend({},TableTools.buttonBase,{sAction:"collection",sButtonClass:"DTTT_button_collection",sButtonText:"Collection",fnClick:function(a,b){this._fnCollectionShow(a,b)}})},TableTools.buttons=TableTools.BUTTONS,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 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:"../swf/copy_csv_xls_pdf.swf",sRowSelect:"none",sRowSelector:"tr",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.defaults=TableTools.DEFAULTS,TableTools.prototype.CLASS="TableTools",TableTools.version="2.2.3",a.fn.dataTable.Api&&a.fn.dataTable.Api.register("tabletools()",function(){var a=null;return this.context.length>0&&(a=TableTools.fnGetInstance(this.context[0].nTable)),a}),"function"==typeof a.fn.dataTable&&"function"==typeof a.fn.dataTableExt.fnVersionCheck&&a.fn.dataTableExt.fnVersionCheck("1.9.0")?a.fn.dataTableExt.aoFeatures.push({fnInit:function(a){var b=a.oInit,c=b?b.tableTools||b.oTableTools||{}:{};return new TableTools(a.oInstance,c).dom.container},cFeature:"T",sFeature:"TableTools"}):alert("Warning: TableTools requires DataTables 1.9.0 or newer - www.datatables.net/download"),a.fn.DataTable.TableTools=TableTools}(jQuery,a,b),"function"==typeof d.fn.dataTable&&"function"==typeof d.fn.dataTableExt.fnVersionCheck&&d.fn.dataTableExt.fnVersionCheck("1.9.0")?d.fn.dataTableExt.aoFeatures.push({fnInit:function(a){var b="undefined"!=typeof a.oInit.oTableTools?a.oInit.oTableTools:{},c=new TableTools(a.oInstance,b);return TableTools._aInstances.push(c),c.dom.container},cFeature:"T",sFeature:"TableTools"}):alert("Warning: TableTools 2 requires DataTables 1.9.0 or newer - www.datatables.net/download"),d.fn.dataTable.TableTools=TableTools,d.fn.DataTable.TableTools=TableTools,TableTools};"function"==typeof define&&define.amd?define(["jquery","datatables"],d):"object"==typeof exports?d(require("jquery"),require("datatables")):jQuery&&!jQuery.fn.dataTable.TableTools&&d(jQuery,jQuery.fn.dataTable)}(window,document);