var dw_Event={add:function(D,C,A,B){B=B||false;if(D.addEventListener){D.addEventListener(C,A,B)}else{if(D.attachEvent){D.attachEvent("on"+C,A)}}},remove:function(D,C,A,B){B=B||false;if(D.removeEventListener){D.removeEventListener(C,A,B)}else{if(D.detachEvent){D.detachEvent("on"+C,A)}}},DOMit:function(A){A=A?A:window.event;if(!A.target){A.target=A.srcElement}if(!A.preventDefault){A.preventDefault=function(){A.returnValue=false;return false}}if(!A.stopPropagation){A.stopPropagation=function(){A.cancelBubble=true}}return A},getTarget:function(A){A=dw_Event.DOMit(A);var B=A.target;if(B.nodeType!=1){B=B.parentNode}return B}};function addLoadEvent(A){var B=window.onload?window.onload:function(){};window.onload=function(){B();A()}};var dw_Viewport={getWinWidth:function(){this.width=0;if(window.innerWidth){this.width=window.innerWidth-18}else{if(document.documentElement&&document.documentElement.clientWidth){this.width=document.documentElement.clientWidth}else{if(document.body&&document.body.clientWidth){this.width=document.body.clientWidth}}}return this.width},getWinHeight:function(){this.height=0;if(window.innerHeight){this.height=window.innerHeight-18}else{if(document.documentElement&&document.documentElement.clientHeight){this.height=document.documentElement.clientHeight}else{if(document.body&&document.body.clientHeight){this.height=document.body.clientHeight}}}return this.height},getScrollX:function(){this.scrollX=0;if(typeof window.pageXOffset=="number"){this.scrollX=window.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollLeft){this.scrollX=document.documentElement.scrollLeft}else{if(document.body&&document.body.scrollLeft){this.scrollX=document.body.scrollLeft}else{if(window.scrollX){this.scrollX=window.scrollX}}}}return this.scrollX},getScrollY:function(){this.scrollY=0;if(typeof window.pageYOffset=="number"){this.scrollY=window.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){this.scrollY=document.documentElement.scrollTop}else{if(document.body&&document.body.scrollTop){this.scrollY=document.body.scrollTop}else{if(window.scrollY){this.scrollY=window.scrollY}}}}return this.scrollY},getAll:function(){this.getWinWidth();this.getWinHeight();this.getScrollX();this.getScrollY()}};var dw_Tooltip={offX:12,offY:12,showDelay:100,hideDelay:100,hoverDelay:500,tipID:"tipDiv",actuatorClass:"showTip",maxLoops:2,activateOnfocus:true,tip:null,shim:null,timer:0,hoverTimer:0,active:false,actuator:null,resetFlag:false,restored:true,on_show:function(){},on_position:function(){},on_hide:function(){},init:function(){var B=dw_Tooltip;if(document.createElement&&document.body&&typeof document.body.appendChild!="undefined"){var A=document.createElement("div");A.id=B.tipID;A.style.position="absolute";A.style.visibility="hidden";A.style.zIndex=10000;document.body.appendChild(A);B.tip=document.getElementById(B.tipID);B.setDefaults();if(B.checkOverlaySupport()){B.prepOverlay()}B.setPosition(0,0)}},setDefaults:function(){if(!this.defaultProps){this.defaultProps={}}var B=[["followMouse","boolean",true],["sticky","boolean",false],["klass","string",""],["hoverable","boolean",false],["duration","number",0],["jumpAbove","boolean",true],["jumpLeft","boolean",true],["Left","boolean",false],["Above","boolean",false],["positionFn","function",this.positionRelEvent],["wrapFn","function",function(C){return C}]];for(var A=0;B[A];A++){this[B[A][0]]=(typeof this.defaultProps[B[A][0]]==B[A][1])?this.defaultProps[B[A][0]]:B[A][2]}this.tip.className=this.klass;this.coordinateOptions()},activate:function(A,E,B,D){var C=dw_Tooltip;if(!C.tip){return }C.clearTimer("timer");C.clearTimer("hoverTimer");if(!C.restored){C.handleRestore()}C.actuator=E;dw_Viewport.getAll();C.getContent(A,E,B,D);C.restored=false;if(!C.tip.innerHTML){return }C.active=true;C.handleOptions(A);C.positionFn(A,E);C.adjust();C.timer=setTimeout(C.show,C.showDelay)},getContent:function(C,F,D,E){D=D||"";if(E&&!D){var B=(E&&this.content_vars&&this.content_vars[E])?this.content_vars[E]:false;if(typeof B=="string"){D=B}else{if(typeof B=="object"){this.checkForProps(B);if(B.content){D=B.content}else{if(B.html_id){var A=document.getElementById(B.html_id);if(A){D=A.innerHTML}}else{D=B}}}}}this.writeTip(D)},writeTip:function(B,A){if(this.pendingReq&&this.respRecd&&!A){return }B=this.wrapFn(B);this.tip.innerHTML=B},positionRelEvent:function(B,E){var D=dw_Tooltip;if(typeof B=="object"){if(B.type=="mouseover"||B.type=="mousemove"){D.evX=D.getMouseEventX(B);D.evY=D.getMouseEventY(B)}else{var C=dw_getPageOffsets(E);D.evX=C.x;D.evY=C.y}}var A=D.calcPosCoords(B,E);D.setPosition(A.x,A.y)},calcPosCoords:function(L,E){var O=this.evX;var N=this.evY;var C,F;var B=this.getMaxX();var A=this.getMaxY();var H=O+this.offX;var K=O-(this.width+this.offX);var M=O-dw_Viewport.scrollX>dw_Viewport.width/2;if(typeof L=="object"&&L.type&&(L.type=="focus"||L.type=="focusin")){var J=E.offsetWidth;if(H+J<B){O=this.evX=O+J;H+=J}else{if(H+20<B){O=this.evX=O+20;H+=20}}N=this.evY=N+10}var G=N+this.offY;var I=N-(this.height+this.offY);var D=N-dw_Viewport.scrollY>dw_Viewport.height/2;if(!this.Left&&H<B){O=H}else{if((this.Left&&K>=dw_Viewport.scrollX)||(this.jumpLeft&&H>=B&&K>=dw_Viewport.scrollX)){O=K}else{if((this.Left&&K<dw_Viewport.scrollX)||(!this.Left&&this.jumpLeft&&K<dw_Viewport.scrollX&&M)){O=dw_Viewport.scrollX;C="Left"}else{if(!this.Left&&H>=B&&(!this.jumpLeft||(this.jumpLeft&&K<dw_Viewport.scrollX&&!M))){O=B;C="Right"}}}}if(!this.Above&&G<A){N=G}else{if((this.Above&&I>=dw_Viewport.scrollY)||(this.jumpAbove&&G>=A&&I>=dw_Viewport.scrollY)){N=I}else{if((this.Above&&I<dw_Viewport.scrollY)||(!this.Above&&this.jumpAbove&&I<dw_Viewport.scrollY&&D)){N=dw_Viewport.scrollY;F="Above"}else{if(!this.Above&&G>=A&&(!this.jumpAbove||(this.jumpAbove&&I<dw_Viewport.scrollY&&!D))){N=A;F="Below"}}}}if(C&&F){var Q=(C=="Left")?dw_Viewport.scrollX-K:H-B;var P=(F=="Above")?dw_Viewport.scrollY-I:G-A;if(Q<=P){O=(C=="Left")?K:H}else{N=(F=="Above")?I:G}}return{x:O,y:N}},adjust:function(){var D=dw_Tooltip;var C=D.tip.getElementsByTagName("img");var A=C.length?C[C.length-1]:null;B();function B(){if(!D.active){return }D.positionFn();if(A&&!A.complete){setTimeout(B,50)}}},setPosition:function(A,B){this.tip.style.left=A+"px";this.tip.style.top=B+"px";this.setOverlay();this.on_position()},show:function(){var A=dw_Tooltip;A.tip.style.visibility="visible";if(A.shim){A.shim.style.visibility="visible"}A.on_show()},deactivate:function(A){var B=dw_Tooltip;if(!B.tip||!B.active||B.sticky){return }A=A?A:window.event;if(A.type&&A.type=="mouseout"&&!dw_mouseleave(A,B.actuator)){return }B.clearTimer("timer");B.clearTimer("hoverTimer");if(B.hoverable){B.hoverTimer=setTimeout(B.hide,B.hoverDelay);return }if(B.duration){B.timer=setTimeout(B.hide,B.duration);return }B.timer=setTimeout(B.hide,B.hideDelay)},hide:function(){var A=dw_Tooltip;if(!A.tip){return }A.tip.style.visibility="hidden";if(A.shim){A.shim.style.visibility="hidden"}A.handleRestore();A.on_hide()},handleOptions:function(A){this.coordinateOptions();if(this.klass){this.tip.className=this.klass}if(this.hoverable){this.tip.onmouseout=dw_Tooltip.tipOutCheck;this.tip.onmouseover=function(){dw_Tooltip.clearTimer("hoverTimer")}}if(this.followMouse&&!this.hoverable&&!(A.type=="focus"||A.type=="focusin")){dw_Event.add(document,"mousemove",this.positionRelEvent)}if(this.sticky||this.duration){dw_Event.add(document,"mouseup",dw_Tooltip.checkDocClick)}},coordinateOptions:function(){if(this.sticky||this.hoverable||this.duration){this.followMouse=false}if(this.sticky){this.hoverable=false;this.duration=0}if(this.hoverable){this.duration=0}if(this.positionFn!=this.positionRelEvent){this.followMouse=false}},handleRestore:function(){if(this.followMouse){dw_Event.remove(document,"mousemove",this.positionRelEvent)}if(this.sticky||this.duration){dw_Event.remove(document,"mouseup",dw_Tooltip.checkDocClick,false)}this.tip.onmouseover=this.tip.onmouseout=function(){};if(this.resetFlag){this.setDefaults()}this.writeTip("");this.active=false;this.actuator=null;this.tip.style.width="";this.restored=true},getTipClass:function(A){if(!A){return""}var C="";var B=A.split(/\s+/);if(B[0]==this.actuatorClass&&B[1]){C=B[1]}return C},checkForProps:function(C){var B=["jumpAbove","jumpLeft","Above","Left","sticky","duration","hoverable","followMouse","klass","positionFn","wrapFn"];for(var A=0;B[A];A++){if(typeof C[B[A]]!="undefined"){this[B[A]]=C[B[A]];this.resetFlag=true}}},tipOutCheck:function(B){var C=dw_Tooltip;B=dw_Event.DOMit(B);var A=this;if(dw_mouseleave(B,A)){C.timer=setTimeout(C.hide,C.hideDelay)}},checkEscKey:function(A){A=A?A:window.event;if(A.keyCode==27){dw_Tooltip.hide()}},checkDocClick:function(B){if(!dw_Tooltip.active){return }var C=dw_Event.getTarget(B);var A=document.getElementById(dw_Tooltip.tipID);if(C==A||dw_contained(C,A)){if(C.tagName&&C.tagName.toLowerCase()=="img"){C=C.parentNode}if(C.tagName.toLowerCase()!="a"||C.href.indexOf("dw_Tooltip.hide")!=-1){return }}dw_Tooltip.timer=setTimeout(dw_Tooltip.hide,50)},checkOverlaySupport:function(){if(navigator.userAgent.indexOf("Windows")!=-1&&typeof document.body!="undefined"&&typeof document.body.insertAdjacentHTML!="undefined"&&!window.opera&&navigator.appVersion.indexOf("MSIE 5.0")==-1){return true}return false},prepOverlay:function(){document.body.insertAdjacentHTML("beforeEnd",'<iframe id="tipShim" src="javascript: false" style="position:absolute; left:0; top:0; z-index:500; visibility:hidden" scrolling="no" frameborder="0"></iframe>');this.shim=document.getElementById("tipShim");if(this.shim&&this.tip){this.shim.style.width=this.tip.offsetWidth+"px";this.shim.style.height=this.tip.offsetHeight+"px"}},setOverlay:function(){if(this.shim){this.shim.style.left=this.tip.style.left;this.shim.style.top=this.tip.style.top;this.shim.style.width=this.tip.offsetWidth+"px";this.shim.style.height=this.tip.offsetHeight+"px"}},clearTimer:function(A){if(dw_Tooltip[A]){clearTimeout(dw_Tooltip[A]);dw_Tooltip[A]=0}},getWidth:function(){return this.width=this.tip.offsetWidth},getHeight:function(){return this.height=this.tip.offsetHeight},getMaxX:function(){return dw_Viewport.width+dw_Viewport.scrollX-this.getWidth()-1},getMaxY:function(){return dw_Viewport.height+dw_Viewport.scrollY-this.getHeight()-1},getMouseEventX:function(A){return A.pageX?A.pageX:A.clientX+dw_Viewport.scrollX},getMouseEventY:function(A){return A.pageY?A.pageY:A.clientY+dw_Viewport.scrollY}};dw_Tooltip.initHandlers=function(){dw_Event.add(document,"mouseover",dw_Tooltip.checkActuatorMouseover);dw_Event.add(document,"keydown",dw_Tooltip.checkEscKey,true);dw_Event.add(window,"blur",dw_Tooltip.deactivate,true);dw_Event.add(window,"unload",dw_Tooltip.deactivate,true);if(dw_Tooltip.activateOnfocus){document.onfocusin=dw_Tooltip.checkActuatorFocus;if(window.addEventListener){dw_Event.add(document,"focus",dw_Tooltip.checkActuatorFocus,true)}}};dw_Tooltip.checkActuatorMouseover=function(D){var G=dw_Event.getTarget(D);var A=null;var C=0;var B=dw_Tooltip.maxLoops;do{if(A=dw_Tooltip.getActuatorInfo(G)){var E=A.msg;var F=A.id;dw_Tooltip.activate(D,G,E,F);if(window.attachEvent){dw_Event.remove(G,"mouseout",dw_Tooltip.deactivate)}dw_Event.add(G,"mouseout",dw_Tooltip.deactivate);break}C++}while(C<B&&(G=G.parentNode))};dw_Tooltip.checkActuatorFocus=function(B){B=B?B:window.event;var A=null;var E=dw_Event.getTarget(B);if(E&&(A=dw_Tooltip.getActuatorInfo(E))){if(dw_Tooltip.active&&E==dw_Tooltip.actuator){return }var C=A.msg;var D=A.id;dw_Tooltip.activate(B,E,C,D);if(window.attachEvent){E.onfocusout=dw_Tooltip.deactivate}else{dw_Event.add(E,"blur",dw_Tooltip.deactivate,true)}}};dw_Tooltip.getActuatorInfo=function(F){var G=dw_Tooltip.defaultProps.actuatorQual||"actuatorClass";var A=dw_Tooltip.defaultProps.content_source||"content_vars";var E="",B="";dw_Tooltip.resetReqFlags();switch(G){case"actuatorClass":var I=dw_Tooltip.getTipClass(F.className);if(!I){break}if(A=="content_vars"){B=(dw_Tooltip.content_vars&&dw_Tooltip.content_vars[I])?I:""}else{if(A=="class_id"){var C=document.getElementById(I);if(C){E=C.innerHTML}}}break;case"queryVal":var H=dw_Tooltip.defaultProps.queryVal;var D=H?dw_getValueFromQueryString(H,F):"";B=(D&&dw_Tooltip.content_vars&&dw_Tooltip.content_vars[D])?D:"";if(D&&A=="ajax"&&!B){E="Retrieving info ...";dw_Tooltip.pendingReq=true;var J=encodeURIComponent(H)+"="+encodeURIComponent(D);dw_TooltipRequest(J,D)}break;case"id":B=(F.id&&dw_Tooltip.content_vars&&dw_Tooltip.content_vars[F.id])?F.id:"";break}if(B||E){return{msg:E,id:B}}return false};dw_Tooltip.resetReqFlags=function(){this.respRecd=false;this.pendingReq=false};function dw_mouseleave(B,C){B=dw_Event.DOMit(B);var A=B.relatedTarget?B.relatedTarget:B.toElement?B.toElement:null;if(C!=A&&!dw_contained(A,C)){return true}return false}function dw_contained(B,A){if(!B){return }while(B=B.parentNode){if(B==A){return true}}return false}function dw_getPageOffsets(A){var C=0,B=0;do{C+=A.offsetLeft;B+=A.offsetTop}while(A=A.offsetParent);return{x:C,y:B}}function dw_getValueFromQueryString(A,D){D=D?D:window.location;if(D.search&&D.search.indexOf(A!=-1)){var C=D.search.slice(1).split("&");var E;for(var B=0;C[B];B++){E=C[B].split("=");if(E[0]==A&&E[1]){return E[1]}}}return""};dw_Tooltip.writeStyleRule=function(){if(document.createElement&&document.getElementsByTagName&&(document.addEventListener||document.attachEvent)){document.write('<style type="text/css" media="screen">.tipContent { display:none; }</style>')}};dw_Event.add(window,"load",dw_Tooltip.init);dw_Event.add(window,"load",dw_Tooltip.initHandlers);function dw_initShowTip(){}function dw_TooltipRequest(){}dw_Tooltip.positionWindowCenter=function(){var A=Math.round((dw_Viewport.width-dw_Tooltip.tip.offsetWidth)/2)+dw_Viewport.scrollX;var B=Math.round((dw_Viewport.height-dw_Tooltip.tip.offsetHeight)/2)+dw_Viewport.scrollY;dw_Tooltip.setPosition(A,B)};dw_Tooltip.wrapSticky=function(D,C){C=C||"";var B=dw_Tooltip.defaultProps.closeBoxImage;var A='<table id="stickyTable" border="0" cellpadding="0" cellspacing="0" width="100%"><tr class="stickyBar"><td><div class="stickyTitle">'+C+'</div></td><td style="text-align:right"><a href="javascript: void dw_Tooltip.hide()"><img style="float:right" src="'+B+'" border="0" /></a></td></tr><tr><td colspan="2"><div class="stickyContent">'+D+"</div></td></tr></table>";return A};dw_Tooltip.wrapToWidth=function(B){if(!B){return""}var C=B.str;var A=B.caption||"";if(this.sticky&&this.defaultProps.showCloseBox){C=dw_Tooltip.wrapSticky(C,A)}else{if(A){C='<div class="caption">'+B.caption+"</div>"+C}}if(B.w){this.setTipWidth(B.w)}return C};dw_Tooltip.wrapImageToWidth=function(C){if(!C){return""}dw_getImage(C.img);var B=C.caption||"";var A=C.w;var D='<img src="'+C.img+'" width="'+A+'" height="'+C.h+'" alt="">';if(this.sticky&&this.defaultProps.showCloseBox){D=dw_Tooltip.wrapSticky(D,B);A+=8}else{if(B){D='<div class="caption">'+C.caption+"</div>"+D}}if(A){this.setTipWidth(A)}return D};dw_Tooltip.wrapTextByImage=function(B){if(!B){return""}dw_getImage(B.img);var A=B.caption||"";var C='<table cellpadding="0" cellspacing="0" border="0"><tr><td><div class="txt">'+B.txt+'</div></td><td><div class="img"><img src="'+B.img+'" /></div></td></tr></table>';if(this.sticky&&this.defaultProps.showCloseBox){C=dw_Tooltip.wrapSticky(C,A)}else{if(A){C='<div class="caption">'+B.caption+"</div>"+C}}if(B.w){this.setTipWidth(B.w)}return C};dw_Tooltip.wrapImageOverText=function(B){if(!B){return""}dw_getImage(B.img);var A=B.caption||"";var C='<div class="img"><img src="'+B.img+'" /></div><div class="txt">'+B.txt+"</div>";if(this.sticky&&this.defaultProps.showCloseBox){C=dw_Tooltip.wrapSticky(C,A)}else{if(A){C='<div class="caption">'+B.caption+"</div>"+C}}if(B.w){this.setTipWidth(B.w)}return C};dw_Tooltip.wrapTextOverImage=function(B){if(!B){return""}dw_getImage(B.img);var A=B.caption||"";var C='<div class="txt">'+B.txt+'</div><div class="img"><img src="'+B.img+'" /></div>';if(this.sticky&&this.defaultProps.showCloseBox){C=dw_Tooltip.wrapSticky(C,A)}else{if(A){C='<div class="caption">'+B.caption+"</div>"+C}}if(B.w){this.setTipWidth(B.w)}return C};dw_Tooltip.setTipWidth=function(A){A+=dw_backCompatWidth(this.tip);this.tip.style.width=A+"px"};function dw_getImage(B){var A=new Image();A.src=B}function dw_backCompatWidth(B){var D=0;if(B.currentStyle&&!window.opera&&(document.compatMode==null||document.compatMode=="BackCompat")){var C=parseInt(dw_getCurrentStyle(B,"paddingLeft"))+parseInt(dw_getCurrentStyle(B,"paddingRight"));var A=parseInt(dw_getCurrentStyle(B,"borderLeftWidth"))+parseInt(dw_getCurrentStyle(B,"borderRightWidth"));D=C+A}return D}function dw_getCurrentStyle(C,E){var D="";if(document.defaultView&&document.defaultView.getComputedStyle){D=document.defaultView.getComputedStyle(C,null)[E]}else{if(C.currentStyle){D=C.currentStyle[E];if(!/^\d+(px)?$/i.test(D)&&/^\d/.test(D)){var B=C.style.left;var A=C.runtimeStyle.left;C.runtimeStyle.left=C.currentStyle.left;C.style.left=D||0;D=C.style.pixelLeft+"px";C.style.left=B;C.runtimeStyle.left=A}}}return D};dw_Tooltip.defaultProps={content_source:"class_id"};dw_Tooltip.writeStyleRule();var FadeDurationMS=1000;function SetOpacity(A,B){A.style.filter="alpha(opacity="+B+")";A.style.MozOpacity=B/100;A.style.opacity=B/100}function ChangeOpacity(H,G,B,F,E){var D=document.getElementById(H);var A=(new Date()).getTime();var C=F+(E-F)*(A-B)/G;if(C>=100){SetOpacity(D,100);D.timer=undefined}else{if(C<=0){SetOpacity(D,0);D.timer=undefined}else{SetOpacity(D,C);D.timer=window.setTimeout("ChangeOpacity('"+H+"',"+G+","+B+","+F+","+E+")",10)}}}function FadeInImage(D,F,A){var E=document.getElementById(D);if(E.timer){window.clearTimeout(E.timer)}if(A){var C=document.getElementById(A);if(C){if(C.src){E.src=C.src;SetOpacity(E,100)}C.src=F;C.style.backgroundImage="url("+F+")";C.style.backgroundRepeat="no-repeat";var B=(new Date()).getTime();E.timer=window.setTimeout("ChangeOpacity('"+D+"',"+FadeDurationMS+","+B+",100,0)",10)}}else{E.src=F}}var slideCache=new Array();function RunSlideShow(E,A,C,B){var G=C.indexOf(";");var D=C.substring(0,G);if(slideCache[D]&&slideCache[D].loaded){FadeInImage(E,D,A);var F=C.substring(G+1,C.length)+";"+D;setTimeout("RunSlideShow('"+E+"','"+A+"','"+F+"',"+B+")",B*1000);G=F.indexOf(";");D=F.substring(0,G)}else{setTimeout("RunSlideShow('"+E+"','"+A+"','"+C+"',"+B+")",250)}if(slideCache[D]==null){slideCache[D]=new Image;slideCache[D].loaded=false;slideCache[D].onload=function(){this.loaded=true};slideCache[D].src=D}};jQuery(document).ready(function(){jQuery(".scroll").click(function(E){E.preventDefault();var B=this.href;var F=B.split("#");var A=F[1];var D=jQuery("#"+A).offset();var C=D.top;jQuery("html, body").animate({scrollTop:C},500)})});jQuery(document).ready(function(){if(jQuery(".togglebox")!=null){jQuery(".togglebox").hide();jQuery("a.trigger").click(function(){jQuery(this).next(".togglebox").slideToggle("slow");return true})}});(function($){$.extend({tablesorter:new function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:".",debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms")}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s)}else{alert(s)}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug=""}var rows=table.tBodies[0].rows;if(table.tBodies[0].rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i<l;i++){var p=false;if($.metadata&&($($headers[i]).metadata()&&$($headers[i]).metadata().sorter)){p=getParserById($($headers[i]).metadata().sorter)}else{if((table.config.headers[i]&&table.config.headers[i].sorter)){p=getParserById(table.config.headers[i].sorter)}}if(!p){p=detectParserForColumn(table,cells[i])}if(table.config.debug){parsersDebug+="column:"+i+" parser:"+p.id+"\n"}list.push(p)}}if(table.config.debug){log(parsersDebug)}return list}function detectParserForColumn(table,node){var l=parsers.length;for(var i=1;i<l;i++){if(parsers[i].is($.trim(getElementText(table.config,node)),table,node)){return parsers[i]}}return parsers[0]}function getParserById(name){var l=parsers.length;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==name.toLowerCase()){return parsers[i]}}return false}function buildCache(table){if(table.config.debug){var cacheTime=new Date()}var totalRows=(table.tBodies[0]&&table.tBodies[0].rows.length)||0,totalCells=(table.tBodies[0].rows[0]&&table.tBodies[0].rows[0].cells.length)||0,parsers=table.config.parsers,cache={row:[],normalized:[]};for(var i=0;i<totalRows;++i){var c=table.tBodies[0].rows[i],cols=[];cache.row.push($(c));for(var j=0;j<totalCells;++j){cols.push(parsers[j].format(getElementText(table.config,c.cells[j]),table,c.cells[j]))}cols.push(i);cache.normalized.push(cols);cols=null}if(table.config.debug){benchmark("Building cache for "+totalRows+" rows:",cacheTime)}return cache}function getElementText(config,node){if(!node){return""}var t="";if(config.textExtraction=="simple"){if(node.childNodes[0]&&node.childNodes[0].hasChildNodes()){t=node.childNodes[0].innerHTML}else{t=node.innerHTML}}else{if(typeof (config.textExtraction)=="function"){t=config.textExtraction(node)}else{t=$(node).text()}}return t}function appendToTable(table,cache){if(table.config.debug){var appendTime=new Date()}var c=cache,r=c.row,n=c.normalized,totalRows=n.length,checkCell=(n[0].length-1),tableBody=$(table.tBodies[0]),rows=[];for(var i=0;i<totalRows;i++){rows.push(r[n[i][checkCell]]);if(!table.config.appender){var o=r[n[i][checkCell]];var l=o.length;for(var j=0;j<l;j++){tableBody[0].appendChild(o[j])}}}if(table.config.appender){table.config.appender(table,rows)}rows=null;if(table.config.debug){benchmark("Rebuilt table:",appendTime)}applyWidget(table);setTimeout(function(){$(table).trigger("sortEnd")},0)}function buildHeaders(table){if(table.config.debug){var time=new Date()}var meta=($.metadata)?true:false,tableHeadersRows=[];for(var i=0;i<table.tHead.rows.length;i++){tableHeadersRows[i]=0}$tableHeaders=$("thead th",table);$tableHeaders.each(function(index){this.count=0;this.column=index;this.order=formatSortingOrder(table.config.sortInitialOrder);if(checkHeaderMetadata(this)||checkHeaderOptions(table,index)){this.sortDisabled=true}if(!this.sortDisabled){$(this).addClass(table.config.cssHeader)}table.config.headerList[index]=this});if(table.config.debug){benchmark("Built headers:",time);log($tableHeaders)}return $tableHeaders}function checkCellColSpan(table,rows,row){var arr=[],r=table.tHead.rows,c=r[row].cells;for(var i=0;i<c.length;i++){var cell=c[i];if(cell.colSpan>1){arr=arr.concat(checkCellColSpan(table,headerArr,row++))}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell)}}}return arr}function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true}return false}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true}return false}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i<l;i++){getWidgetById(c[i]).format(table)}}function getWidgetById(name){var l=widgets.length;for(var i=0;i<l;i++){if(widgets[i].id.toLowerCase()==name.toLowerCase()){return widgets[i]}}}function formatSortingOrder(v){if(typeof (v)!="Number"){i=(v.toLowerCase()=="desc")?1:0}else{i=(v==(0||1))?v:0}return i}function isValueInArray(v,a){var l=a.length;for(var i=0;i<l;i++){if(a[i][0]==v){return true}}return false}function setHeadersCss(table,$headers,list,css){$headers.removeClass(css[0]).removeClass(css[1]);var h=[];$headers.each(function(offset){if(!this.sortDisabled){h[this.column]=$(this)}});var l=list.length;for(var i=0;i<l;i++){h[list[i][0]].addClass(css[list[i][1]])}}function fixColumnWidth(table,$headers){var c=table.config;if(c.widthFixed){var colgroup=$("<colgroup>");$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($("<col>").css("width",$(this).width()))});$(table).prepend(colgroup)}}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;i<l;i++){var s=sortList[i],o=c.headerList[s[0]];o.count=s[1];o.count++}}function multisort(table,sortList,cache){if(table.config.debug){var sortTime=new Date()}var dynamicExp="var sortWrapper = function(a,b) {",l=sortList.length;for(var i=0;i<l;i++){var c=sortList[i][0];var order=sortList[i][1];var s=(getCachedSortType(table.config.parsers,c)=="text")?((order==0)?"sortText":"sortTextDesc"):((order==0)?"sortNumeric":"sortNumericDesc");var e="e"+i;dynamicExp+="var "+e+" = "+s+"(a["+c+"],b["+c+"]); ";dynamicExp+="if("+e+") { return "+e+"; } ";dynamicExp+="else { "}var orgOrderCol=cache.normalized[0].length-1;dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(var i=0;i<l;i++){dynamicExp+="}; "}dynamicExp+="return 0; ";dynamicExp+="}; ";eval(dynamicExp);cache.normalized.sort(sortWrapper);if(table.config.debug){benchmark("Sorting on "+sortList.toString()+" and dir "+order+" time:",sortTime)}return cache}function sortText(a,b){return((a<b)?-1:((a>b)?1:0))}function sortTextDesc(a,b){return((b<a)?-1:((b>a)?1:0))}function sortNumeric(a,b){return a-b}function sortNumericDesc(a,b){return b-a}function getCachedSortType(parsers,i){return parsers[i].type}this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies){return }var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){$this.trigger("sortStart");var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){var $cell=$(this);var i=this.column;this.order=this.count++%2;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j<a.length;j++){if(a[j][0]!=i){config.sortList.push(a[j])}}}config.sortList.push([i,this.order])}else{if(isValueInArray(i,config.sortList)){for(var j=0;j<config.sortList.length;j++){var s=config.sortList[j],o=config.headerList[s[0]];if(s[0]==i){o.count=s[1];o.count++;s[1]=o.count%2}}}else{config.sortList.push([i,this.order])}}setTimeout(function(){setHeadersCss($this[0],$headers,config.sortList,sortCSS);appendToTable($this[0],multisort($this[0],config.sortList,cache))},1);return false}}).mousedown(function(){if(config.cancelSelection){this.onselectstart=function(){return false};return false}});$this.bind("update",function(){this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this)}).bind("sorton",function(e,list){$(this).trigger("sortStart");config.sortList=list;var sortList=config.sortList;updateHeaderSortCount(this,sortList);setHeadersCss(this,$headers,sortList,sortCSS);appendToTable(this,multisort(this,sortList,cache))}).bind("appendCache",function(){appendToTable(this,cache)}).bind("applyWidgetId",function(e,id){getWidgetById(id).format(this)}).bind("applyWidgets",function(){applyWidget(this)});if($.metadata&&($(this).metadata()&&$(this).metadata().sortlist)){config.sortList=$(this).metadata().sortlist}if(config.sortList.length>0){$this.trigger("sorton",[config.sortList])}applyWidget(this)})};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==parser.id.toLowerCase()){a=false}}if(a){parsers.push(parser)}};this.addWidget=function(widget){widgets.push(widget)};this.formatFloat=function(s){var i=parseFloat(s);return(isNaN(i))?0:i};this.formatInt=function(s){var i=parseInt(s);return(isNaN(i))?0:i};this.isDigit=function(s,config){var DECIMAL="\\"+config.decimal;var exp="/(^[+]?0("+DECIMAL+"0+)?$)|(^([-+]?[1-9][0-9]*)$)|(^([-+]?((0?|[1-9][0-9]*)"+DECIMAL+"(0*[1-9][0-9]*)))$)|(^[-+]?[1-9]+[0-9]*"+DECIMAL+"0+$)/";return RegExp(exp).test($.trim(s))};this.clearTableBody=function(table){if($.browser.msie){function empty(){while(this.firstChild){this.removeChild(this.firstChild)}}empty.apply(table.tBodies[0])}else{table.tBodies[0].innerHTML=""}}}});$.fn.extend({tablesorter:$.tablesorter.construct});var ts=$.tablesorter;ts.addParser({id:"text",is:function(s){return true},format:function(s){return $.trim(s.toLowerCase())},type:"text"});ts.addParser({id:"digit",is:function(s,table){var c=table.config;return $.tablesorter.isDigit(s,c)},format:function(s){return $.tablesorter.formatFloat(s)},type:"numeric"});ts.addParser({id:"currency",is:function(s){return/^[£$€?.]/.test(s)},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/[^0-9.]/g),""))},type:"numeric"});ts.addParser({id:"ipAddress",is:function(s){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s)},format:function(s){var a=s.split("."),r="",l=a.length;for(var i=0;i<l;i++){var item=a[i];if(item.length==2){r+="0"+item}else{r+=item}}return $.tablesorter.formatFloat(r)},type:"numeric"});ts.addParser({id:"url",is:function(s){return/^(https?|ftp|file):\/\/$/.test(s)},format:function(s){return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),""))},type:"text"});ts.addParser({id:"isoDate",is:function(s){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s)},format:function(s){return $.tablesorter.formatFloat((s!="")?new Date(s.replace(new RegExp(/-/g),"/")).getTime():"0")},type:"numeric"});ts.addParser({id:"percent",is:function(s){return/\%$/.test($.trim(s))},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""))},type:"numeric"});ts.addParser({id:"usLongDate",is:function(s){return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/))},format:function(s){return $.tablesorter.formatFloat(new Date(s).getTime())},type:"numeric"});ts.addParser({id:"shortDate",is:function(s){return/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s)},format:function(s,table){var c=table.config;s=s.replace(/\-/g,"/");if(c.dateFormat=="us"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$1/$2")}else{if(c.dateFormat=="uk"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$2/$1")}else{if(c.dateFormat=="dd/mm/yy"||c.dateFormat=="dd-mm-yy"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3")}}}return $.tablesorter.formatFloat(new Date(s).getTime())},type:"numeric"});ts.addParser({id:"time",is:function(s){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s)},format:function(s){return $.tablesorter.formatFloat(new Date("2000/01/01 "+s).getTime())},type:"numeric"});ts.addParser({id:"metadata",is:function(s){return false},format:function(s,table,cell){var c=table.config,p=(!c.parserMetadataName)?"sortValue":c.parserMetadataName;return $(cell).metadata()[p]},type:"numeric"});ts.addWidget({id:"zebra",format:function(table){if(table.config.debug){var time=new Date()}$("tr:visible",table.tBodies[0]).filter(":even").removeClass(table.config.widgetZebra.css[1]).addClass(table.config.widgetZebra.css[0]).end().filter(":odd").removeClass(table.config.widgetZebra.css[0]).addClass(table.config.widgetZebra.css[1]);if(table.config.debug){$.tablesorter.benchmark("Applying Zebra widget",time)}}})})(jQuery);(function(A){A.fn.rssfeed=function(B,C){C=A.extend({limit:10,header:false,date:true,showDayMonthOnly:false,content:true,snippet:true,showerror:true,errormsg:"",dateFormat:"mmm dd, yyyy hh:mm:ssa",key:"ABQIAAAAcZ89aAiQZ0ME82WHrG0kPhSQv7HnCgfuuLDILnLIkqljlYCN3xT6bh9oIAXUKNEJLJii9a96yGkGUQ"},C);return this.each(function(E,D){var F=A(D);if(B==null){return false}F="http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&callback=?&q="+B;if(C.limit!=null){F+="&num="+C.limit}if(C.key!=null){F+="&key="+C.key}A.getJSON(F,function(L){if(L.responseStatus==200){L=L.responseData.feed;var K=C;if(L){var H="";if(K.header){H+='<div class="rssHeader"><a href="'+L.link+'" title="'+L.description+'" target="_blank">'+L.title+"</a></div>"}for(var J=0;J<L.entries.length;J++){H+='<dl class="sPost">';var I=L.entries[J],G=(new Date(I.publishedDate)).format(K.dateFormat);H+='<dt class="postHeadline"><a href="'+I.link+'" title="View this feed at '+L.title+'" target="_blank">'+I.title+"</a></dt>";if(K.date){H+='<dd class="postDate">'+G+"</dd>"}if(K.content){H+='<dd class="postBody">'+(K.snippet&&I.contentSnippet!=""?I.contentSnippet.replace("...",'... <a href="'+I.link+'" target="_blank">read more</a>'):I.content)+"</dd>"}H+="</dl>"}A(D).html(H)}}else{if(C.showerror){K=C.errormsg!=""?C.errormsg:L.responseDetails}A(D).html('<div class="rssError"><p>'+K+"</p></div>")}})})}})(jQuery);var dateFormat=function(){var C=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,A=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,D=/[^-+\dA-Z]/g,B=function(E,F){E=String(E);for(F=F||2;E.length<F;){E="0"+E}return"<span>"+E+"</span>"};return function(Q,O,N){var M=dateFormat;if(arguments.length==1&&Object.prototype.toString.call(Q)=="[object String]"&&!/\d/.test(Q)){O=Q;Q=undefined}Q=Q?new Date(Q):new Date;if(isNaN(Q)){throw SyntaxError("invalid date")}O=String(M.masks[O]||O||M.masks["default"]);if(O.slice(0,4)=="UTC:"){O=O.slice(4);N=true}var P=N?"getUTC":"get",L=Q[P+"Date"](),K=Q[P+"Day"](),I=Q[P+"Month"](),G=Q[P+"FullYear"](),J=Q[P+"Hours"](),F=Q[P+"Minutes"](),E=Q[P+"Seconds"]();P=Q[P+"Milliseconds"]();var H=N?0:Q.getTimezoneOffset(),R={d:"<span>"+L+"</span>",dd:B(L),ddd:M.i18n.dayNames[K],dddd:M.i18n.dayNames[K+7],m:I+1,mm:B(I+1),mmm:M.i18n.monthNames[I],mmmm:M.i18n.monthNames[I+12],yy:String(G).slice(2),yyyy:G,h:J%12||12,hh:B(J%12||12),H:J,HH:B(J),M:F,MM:B(F),s:E,ss:B(E),l:B(P,3),L:B(P>99?Math.round(P/10):P),t:J<12?"a":"p",tt:J<12?"am":"pm",T:J<12?"A":"P",TT:J<12?"AM":"PM",Z:N?"UTC":(String(Q).match(A)||[""]).pop().replace(D,""),o:(H>0?"-":"+")+B(Math.floor(Math.abs(H)/60)*100+Math.abs(H)%60,4),S:["th","st","nd","rd"][L%10>3?0:(L%100-L%10!=10)*L%10]};return O.replace(C,function(S){return S in R?R[S]:S.slice(1,S.length-1)})}}();dateFormat.masks={"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"};dateFormat.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]};Date.prototype.format=function(B,A){return dateFormat(this,B,A)};
