(function($){$.extend({tabs:{remoteCount:0}});$.fn.tabs=function(initial,settings){if(typeof initial=="object"){settings=initial;}settings=$.extend({initial:(initial&&typeof initial=="number"&&initial>0)?--initial:0,disabled:null,bookmarkable:$.ajaxHistory?true:false,remote:false,spinner:"Loading&#8230;",hashPrefix:"remote-tab-",fxFade:null,fxSlide:null,fxShow:null,fxHide:null,fxSpeed:"normal",fxShowSpeed:null,fxHideSpeed:null,fxAutoHeight:false,onClick:null,onHide:null,onShow:null,navClass:"tabs-nav",selectedClass:"tabs-selected",disabledClass:"tabs-disabled",containerClass:"tabs-container",hideClass:"tabs-hide",loadingClass:"tabs-loading",tabStruct:"div"},settings||{});$.browser.msie6=$.browser.msie&&($.browser.version&&$.browser.version<7||/MSIE 6.0/.test(navigator.userAgent));function unFocus(){scrollTo(0,0);}return this.each(function(){var container=this;var nav=$("ul."+settings.navClass,container);nav=nav.size()&&nav||$(">ul:eq(0)",container);var tabs=$("a",nav);if(settings.remote){tabs.each(function(){var id=settings.hashPrefix+(++$.tabs.remoteCount),hash="#"+id,url=this.href;this.href=hash;$('<div id="'+id+'" class="'+settings.containerClass+'"></div>').appendTo(container);$(this).bind("loadRemoteTab",function(e,callback){var $$=$(this).addClass(settings.loadingClass),span=$("span",this)[0],tabTitle=span.innerHTML;if(settings.spinner){span.innerHTML="<em>"+settings.spinner+"</em>";}setTimeout(function(){$(hash).load(url,function(){if(settings.spinner){span.innerHTML=tabTitle;}$$.removeClass(settings.loadingClass);callback&&callback();});},0);});});}var containers=$("div."+settings.containerClass,container);containers=containers.size()&&containers||$(">"+settings.tabStruct,container);nav.is("."+settings.navClass)||nav.addClass(settings.navClass);containers.each(function(){var $$=$(this);$$.is("."+settings.containerClass)||$$.addClass(settings.containerClass);});var hasSelectedClass=$("li",nav).index($("li."+settings.selectedClass,nav)[0]);if(hasSelectedClass>=0){settings.initial=hasSelectedClass;}if(location.hash){tabs.each(function(i){if(this.hash==location.hash){settings.initial=i;if(($.browser.msie||$.browser.opera)&&!settings.remote){var toShow=$(location.hash);var toShowId=toShow.attr("id");toShow.attr("id","");setTimeout(function(){toShow.attr("id",toShowId);},500);}unFocus();return false;}});}if($.browser.msie){unFocus();}containers.filter(":eq("+settings.initial+")").show().end().not(":eq("+settings.initial+")").addClass(settings.hideClass);$("li",nav).removeClass(settings.selectedClass).eq(settings.initial).addClass(settings.selectedClass);tabs.eq(settings.initial).trigger("loadRemoteTab").end();if(settings.fxAutoHeight){var _setAutoHeight=function(reset){var heights=$.map(containers.get(),function(el){var h,jq=$(el);if(reset){if($.browser.msie6){el.style.removeExpression("behaviour");el.style.height="";el.minHeight=null;}h=jq.css({"min-height":""}).height();}else{h=jq.height();}return h;}).sort(function(a,b){return b-a;});if($.browser.msie6){containers.each(function(){this.minHeight=heights[0]+"px";this.style.setExpression("behaviour",'this.style.height = this.minHeight ? this.minHeight : "1px"');});}else{containers.css({"min-height":heights[0]+"px"});}};_setAutoHeight();var cachedWidth=container.offsetWidth;var cachedHeight=container.offsetHeight;var watchFontSize=$("#tabs-watch-font-size").get(0)||$('<span id="tabs-watch-font-size">M</span>').css({display:"block",position:"absolute",visibility:"hidden"}).appendTo(document.body).get(0);var cachedFontSize=watchFontSize.offsetHeight;setInterval(function(){var currentWidth=container.offsetWidth;var currentHeight=container.offsetHeight;var currentFontSize=watchFontSize.offsetHeight;if(currentHeight>cachedHeight||currentWidth!=cachedWidth||currentFontSize!=cachedFontSize){_setAutoHeight((currentWidth>cachedWidth||currentFontSize<cachedFontSize));cachedWidth=currentWidth;cachedHeight=currentHeight;cachedFontSize=currentFontSize;}},50);}var showAnim={},hideAnim={},showSpeed=settings.fxShowSpeed||settings.fxSpeed,hideSpeed=settings.fxHideSpeed||settings.fxSpeed;if(settings.fxSlide||settings.fxFade){if(settings.fxSlide){showAnim.height="show";hideAnim.height="hide";}if(settings.fxFade){showAnim.opacity="show";hideAnim.opacity="hide";}}else{if(settings.fxShow){showAnim=settings.fxShow;}else{showAnim["min-width"]=0;showSpeed=1;}if(settings.fxHide){hideAnim=settings.fxHide;}else{hideAnim["min-width"]=0;hideSpeed=1;}}var onClick=settings.onClick,onHide=settings.onHide,onShow=settings.onShow;tabs.bind("triggerTab",function(){var li=$(this).parents("li:eq(0)");if(container.locked||li.is("."+settings.selectedClass)||li.is("."+settings.disabledClass)){return false;}var hash=this.hash;if($.browser.msie){$(this).trigger("click");if(settings.bookmarkable){$.ajaxHistory.update(hash);location.hash=hash.replace("#","");}}else{if($.browser.safari){var tempForm=$('<form action="'+hash+'"><div><input type="submit" value="h" /></div></form>').get(0);tempForm.submit();$(this).trigger("click");if(settings.bookmarkable){$.ajaxHistory.update(hash);}}else{if(settings.bookmarkable){location.hash=hash.replace("#","");}else{$(this).trigger("click");}}}});tabs.bind("disableTab",function(){var li=$(this).parents("li:eq(0)");if($.browser.safari){li.animate({opacity:0},1,function(){li.css({opacity:""});});}li.addClass(settings.disabledClass);});if(settings.disabled&&settings.disabled.length){for(var i=0,k=settings.disabled.length;i<k;i++){tabs.eq(--settings.disabled[i]).trigger("disableTab").end();}}tabs.bind("enableTab",function(){var li=$(this).parents("li:eq(0)");li.removeClass(settings.disabledClass);if($.browser.safari){li.animate({opacity:1},1,function(){li.css({opacity:""});});}});tabs.bind("click",function(e){var trueClick=e.clientX;var clicked=this,li=$(this).parents("li:eq(0)"),toShow=$(this.hash),toHide=containers.filter(":visible");if(container.locked||li.is("."+settings.selectedClass)||li.is("."+settings.disabledClass)||typeof onClick=="function"&&onClick(this,toShow[0],toHide[0])===false){this.blur();return false;}container.locked=true;if(toShow.size()){if($.browser.msie&&settings.bookmarkable){var toShowId=this.hash.replace("#","");toShow.attr("id","");setTimeout(function(){toShow.attr("id",toShowId);},0);}var resetCSS={display:"",overflow:"",height:""};if(!$.browser.msie){resetCSS.opacity="";}function switchTab(){if(settings.bookmarkable&&trueClick){$.ajaxHistory.update(clicked.hash);}toHide.animate(hideAnim,hideSpeed,function(){$(clicked).parents("li:eq(0)").addClass(settings.selectedClass).siblings().removeClass(settings.selectedClass);toHide.addClass(settings.hideClass).css(resetCSS);if(typeof onHide=="function"){onHide(clicked,toShow[0],toHide[0]);}if(!(settings.fxSlide||settings.fxFade||settings.fxShow)){toShow.css("display","block");}toShow.animate(showAnim,showSpeed,function(){toShow.removeClass(settings.hideClass).css(resetCSS);if($.browser.msie){toHide[0].style.filter="";toShow[0].style.filter="";}if(typeof onShow=="function"){onShow(clicked,toShow[0],toHide[0]);}container.locked=null;});});}if(!settings.remote){switchTab();}else{$(clicked).trigger("loadRemoteTab",[switchTab]);}}else{alert("There is no such container.");}var scrollX=window.pageXOffset||document.documentElement&&document.documentElement.scrollLeft||document.body.scrollLeft||0;var scrollY=window.pageYOffset||document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop||0;setTimeout(function(){window.scrollTo(scrollX,scrollY);},0);this.blur();return settings.bookmarkable&&!!trueClick;});if(settings.bookmarkable){$.ajaxHistory.initialize(function(){tabs.eq(settings.initial).trigger("click").end();});}});};var tabEvents=["triggerTab","disableTab","enableTab"];for(var i=0;i<tabEvents.length;i++){$.fn[tabEvents[i]]=(function(tabEvent){return function(tab){return this.each(function(){var nav=$("ul.tabs-nav",this);nav=nav.size()&&nav||$(">ul:eq(0)",this);var a;if(!tab||typeof tab=="number"){a=$("li a",nav).eq((tab&&tab>0&&tab-1||0));}else{if(typeof tab=="string"){a=$('li a[@href$="#'+tab+'"]',nav);}}a.trigger(tabEvent);});};})(tabEvents[i]);}$.fn.activeTab=function(){var selectedTabs=[];this.each(function(){var nav=$("ul.tabs-nav",this);nav=nav.size()&&nav||$(">ul:eq(0)",this);var lis=$("li",nav);selectedTabs.push(lis.index(lis.filter(".tabs-selected")[0])+1);});return selectedTabs[0];};})(jQuery);(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:"eu",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($){$.extend({tablesorterPager:new function(){function updatePageDisplay(c){var s=$(c.cssPageDisplay,c.container).val((c.page+1)+c.seperator+c.totalPages);}function setPageSize(table,size){var c=table.config;c.size=size;c.totalPages=Math.ceil(c.totalRows/c.size);c.pagerPositionSet=false;moveToPage(table);fixPosition(table);}function fixPosition(table){var c=table.config;if(!c.pagerPositionSet&&c.positionFixed){var c=table.config,o=$(table);if(o.offset){c.container.css({top:o.offset().top+o.height()+"px",position:"relative"});}c.pagerPositionSet=true;}}function moveToFirstPage(table){var c=table.config;c.page=0;moveToPage(table);}function moveToLastPage(table){var c=table.config;c.page=(c.totalPages-1);moveToPage(table);}function moveToNextPage(table){var c=table.config;c.page++;if(c.page>=(c.totalPages-1)){c.page=(c.totalPages-1);}moveToPage(table);}function moveToPrevPage(table){var c=table.config;c.page--;if(c.page<=0){c.page=0;}moveToPage(table);}function moveToPage(table){var c=table.config;if(c.page<0||c.page>(c.totalPages-1)){c.page=0;}renderTable(table,c.rowsCopy);}function renderTable(table,rows){var c=table.config;var l=rows.length;var s=(c.page*c.size);var e=(s+c.size);if(e>rows.length){e=rows.length;}var tableBody=$(table.tBodies[0]);$.tablesorter.clearTableBody(table);for(var i=s;i<e;i++){var o=rows[i];var l=o.length;for(var j=0;j<l;j++){tableBody[0].appendChild(o[j]);}}fixPosition(table,tableBody);$(table).trigger("applyWidgets");if(c.page>=c.totalPages){moveToLastPage(table);}updatePageDisplay(c);}this.appender=function(table,rows){var c=table.config;c.rowsCopy=rows;c.totalRows=rows.length;c.totalPages=Math.ceil(c.totalRows/c.size);renderTable(table,rows);};this.defaults={size:10,offset:0,page:0,totalRows:0,totalPages:0,container:null,cssNext:".next",cssPrev:".prev",cssFirst:".first",cssLast:".last",cssPageDisplay:".pagedisplay",cssPageSize:".pagesize",seperator:"/",positionFixed:true,appender:this.appender};this.construct=function(settings){return this.each(function(){config=$.extend(this.config,$.tablesorterPager.defaults,settings);var table=this,pager=config.container;$(this).trigger("appendCache");config.size=parseInt($(".pagesize",pager).val());$(config.cssFirst,pager).click(function(){moveToFirstPage(table);return false;});$(config.cssNext,pager).click(function(){moveToNextPage(table);return false;});$(config.cssPrev,pager).click(function(){moveToPrevPage(table);return false;});$(config.cssLast,pager).click(function(){moveToLastPage(table);return false;});$(config.cssPageSize,pager).change(function(){setPageSize(table,parseInt($(this).val()));return false;});});};}});$.fn.extend({tablesorterPager:$.tablesorterPager.construct});})(jQuery);(function($){$.extend({metadata:{defaults:{type:"class",name:"metadata",cre:/({.*})/,single:"metadata"},setType:function(type,name){this.defaults.type=type;this.defaults.name=name;},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length){settings.single="metadata";}var data=$.data(elem,settings.single);if(data){return data;}data="{}";if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m){data=m[1];}}else{if(settings.type=="elem"){if(!elem.getElementsByTagName){return undefined;}var e=elem.getElementsByTagName(settings.name);if(e.length){data=$.trim(e[0].innerHTML);}}else{if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr){data=attr;}}}}if(data.indexOf("{")<0){data="{"+data+"}";}data=eval("("+data+")");$.data(elem,settings.single,data);return data;}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts);};})(jQuery);eval(function(p,a,c,k,e,r){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36));};if(!"".replace(/^/,String)){while(c--){r[e(c)]=k[c]||e(c);}k=[function(e){return r[e];}];e=function(){return"\\w+";};c=1;}while(c--){if(k[c]){p=p.replace(new RegExp("\\b"+e(c)+"\\b","g"),k[c]);}}return p;}(";(8($){j e={},9,m,B,A=$.2u.2g&&/29\\s(5\\.5|6\\.)/.1M(1H.2t),M=12;$.k={w:12,1h:{Z:25,r:12,1d:19,X:\"\",G:15,E:15,16:\"k\"},2s:8(){$.k.w=!$.k.w}};$.N.1v({k:8(a){a=$.1v({},$.k.1h,a);1q(a);g 2.F(8(){$.1j(2,\"k\",a);2.11=e.3.n(\"1g\");2.13=2.m;$(2).24(\"m\");2.22=\"\"}).21(1e).1U(q).1S(q)},H:A?8(){g 2.F(8(){j b=$(2).n('Y');4(b.1J(/^o\\([\"']?(.*\\.1I)[\"']?\\)$/i)){b=1F.$1;$(2).n({'Y':'1D','1B':\"2r:2q.2m.2l(2j=19, 2i=2h, 1p='\"+b+\"')\"}).F(8(){j a=$(2).n('1o');4(a!='2f'&&a!='1u')$(2).n('1o','1u')})}})}:8(){g 2},1l:A?8(){g 2.F(8(){$(2).n({'1B':'',Y:''})})}:8(){g 2},1x:8(){g 2.F(8(){$(2)[$(2).D()?\"l\":\"q\"]()})},o:8(){g 2.1k('28')||2.1k('1p')}});8 1q(a){4(e.3)g;e.3=$('<t 16=\"'+a.16+'\"><10></10><t 1i=\"f\"></t><t 1i=\"o\"></t></t>').27(K.f).q();4($.N.L)e.3.L();e.m=$('10',e.3);e.f=$('t.f',e.3);e.o=$('t.o',e.3)}8 7(a){g $.1j(a,\"k\")}8 1f(a){4(7(2).Z)B=26(l,7(2).Z);p l();M=!!7(2).M;$(K.f).23('W',u);u(a)}8 1e(){4($.k.w||2==9||(!2.13&&!7(2).U))g;9=2;m=2.13;4(7(2).U){e.m.q();j a=7(2).U.1Z(2);4(a.1Y||a.1V){e.f.1c().T(a)}p{e.f.D(a)}e.f.l()}p 4(7(2).18){j b=m.1T(7(2).18);e.m.D(b.1R()).l();e.f.1c();1Q(j i=0,R;(R=b[i]);i++){4(i>0)e.f.T(\"<1P/>\");e.f.T(R)}e.f.1x()}p{e.m.D(m).l();e.f.q()}4(7(2).1d&&$(2).o())e.o.D($(2).o().1O('1N://','')).l();p e.o.q();e.3.P(7(2).X);4(7(2).H)e.3.H();1f.1L(2,1K)}8 l(){B=S;4((!A||!$.N.L)&&7(9).r){4(e.3.I(\":17\"))e.3.Q().l().O(7(9).r,9.11);p e.3.I(':1a')?e.3.O(7(9).r,9.11):e.3.1G(7(9).r)}p{e.3.l()}u()}8 u(c){4($.k.w)g;4(c&&c.1W.1X==\"1E\"){g}4(!M&&e.3.I(\":1a\")){$(K.f).1b('W',u)}4(9==S){$(K.f).1b('W',u);g}e.3.V(\"z-14\").V(\"z-1A\");j b=e.3[0].1z;j a=e.3[0].1y;4(c){b=c.2o+7(9).E;a=c.2n+7(9).G;j d='1w';4(7(9).2k){d=$(C).1r()-b;b='1w'}e.3.n({E:b,14:d,G:a})}j v=z(),h=e.3[0];4(v.x+v.1s<h.1z+h.1n){b-=h.1n+20+7(9).E;e.3.n({E:b+'1C'}).P(\"z-14\")}4(v.y+v.1t<h.1y+h.1m){a-=h.1m+20+7(9).G;e.3.n({G:a+'1C'}).P(\"z-1A\")}}8 z(){g{x:$(C).2e(),y:$(C).2d(),1s:$(C).1r(),1t:$(C).2p()}}8 q(a){4($.k.w)g;4(B)2c(B);9=S;j b=7(2);8 J(){e.3.V(b.X).q().n(\"1g\",\"\")}4((!A||!$.N.L)&&b.r){4(e.3.I(':17'))e.3.Q().O(b.r,0,J);p e.3.Q().2b(b.r,J)}p J();4(7(2).H)e.3.1l()}})(2a);",62,155,"||this|parent|if|||settings|function|current||||||body|return|||var|tooltip|show|title|css|url|else|hide|fade||div|update||blocked|||viewport|IE|tID|window|html|left|each|top|fixPNG|is|complete|document|bgiframe|track|fn|fadeTo|addClass|stop|part|null|append|bodyHandler|removeClass|mousemove|extraClass|backgroundImage|delay|h3|tOpacity|false|tooltipText|right||id|animated|showBody|true|visible|unbind|empty|showURL|save|handle|opacity|defaults|class|data|attr|unfixPNG|offsetHeight|offsetWidth|position|src|createHelper|width|cx|cy|relative|extend|auto|hideWhenEmpty|offsetTop|offsetLeft|bottom|filter|px|none|OPTION|RegExp|fadeIn|navigator|png|match|arguments|apply|test|http|replace|br|for|shift|click|split|mouseout|jquery|target|tagName|nodeType|call||mouseover|alt|bind|removeAttr|200|setTimeout|appendTo|href|MSIE|jQuery|fadeOut|clearTimeout|scrollTop|scrollLeft|absolute|msie|crop|sizingMethod|enabled|positionLeft|AlphaImageLoader|Microsoft|pageY|pageX|height|DXImageTransform|progid|block|userAgent|browser".split("|"),0,{}));var datePickerController=(function datePickerController(){var languageInfo=navigator.language?navigator.language.toLowerCase().replace(/-[a-z]+$/,""):navigator.userLanguage?navigator.userLanguage.toLowerCase().replace(/-[a-z]+$/,""):"en",datePickers={},uniqueId=0,weeksInYearCache={},localeImport=false,nbsp=String.fromCharCode(160),nodrag=false,buttonTabIndex=true,returnLocaleDate=false,splitAppend=["-dd","-mm"],cellFormat="d-sp-F-sp-Y",titleFormat="F-sp-d-cc-sp-Y",formatParts=["placeholder","sp-F-sp-Y"],formatMasks=["Y-sl-m-sl-d","m-sl-d-sl-Y","d-sl-m-sl-Y","Y-ds-m-ds-d","m-ds-d-ds-Y","d-ds-m-ds-Y","d-ds-m-ds-y","d-sl-m-sl-y"];void function(){var scriptFiles=document.getElementsByTagName("head")[0].getElementsByTagName("script"),scriptInner=scriptFiles[scriptFiles.length-1].innerHTML.replace(/[\n\r\s\t]+/g," ").replace(/^\s+/,"").replace(/\s+$/,""),json=parseJSON(scriptInner);if(typeof json==="object"&&!("err" in json)){affectJSON(json);}if(typeof(fdLocale)!="object"){var loc=scriptFiles[scriptFiles.length-1].src.substr(0,scriptFiles[scriptFiles.length-1].src.lastIndexOf("/"))+"/lang/nb.js",script=document.createElement("script");script.type="text/javascript";script.src=loc;script.setAttribute("charset","iso-8859-1");
/*@cc_on
                        /*@if(@_win32)
                        var bases = document.getElementsByTagName('base');
                        if (bases.length && bases[0].childNodes.length) {
                                bases[0].appendChild(script);
                        } else {
                                document.getElementsByTagName('head')[0].appendChild(script);
                        };
                        bases = null;
                        @else @*/
document.getElementsByTagName("head")[0].appendChild(script);
/*@end
                        @*/
script=null;}else{returnLocaleDate=true;}}();function affectJSON(json){if(typeof json!=="object"){return;}for(key in json){value=json[key];switch(key.toLowerCase()){case"lang":if(value.search(/^[a-z]{2}$/i)!=-1){languageInfo=value;returnLocaleDate=true;}break;case"split":if(typeof value==="object"){if(value.length&&value.length==2){splitAppend=value;}}break;case"formats":if(typeof value==="object"){if(value.length){var tmpMasks=[];for(var m=0,msk;msk=value[m];m++){if(msk.match(/((sp|dt|sl|ds|cc)|([d|D|l|j|N|w|S|W|M|F|m|n|t|Y|o|y|O|p]))(-((sp|dt|sl|ds|cc)|([d|D|l|j|N|w|S|W|M|F|m|n|t|Y|o|y|O|p])))+/)){tmpMasks.push(msk);}}if(tmpMasks.length){formatMasks=tmpMasks;}}}break;case"nodrag":nodrag=!!value;break;case"buttontabindex":buttonTabIndex=!!value;break;case"cellformat":if(typeof value=="string"&&value.match(/^((sp|dt|sl|ds|cc)|([d|D|l|j|N|w|S|W|M|F|m|n|t|Y|o|y|O|p]))(-((sp|dt|sl|ds|cc)|([d|D|l|j|N|w|S|W|M|F|m|n|t|Y|o|y|O|p])))+$/)){parseCellFormat(value);}break;case"titleformat":if(value.match(/((sp|dt|sl|ds|cc)|([d|D|l|j|N|w|S|W|M|F|m|n|t|Y|o|y|O|p]))(-((sp|dt|sl|ds|cc)|([d|D|l|j|N|w|S|W|M|F|m|n|t|Y|o|y|O|p])))+/)){titleFormat=value;}}}}function parseCellFormat(value){var parts=value.split("-"),fullParts=[],tmpParts=[],part;for(var pt=0;pt<parts.length;pt++){part=parts[pt];if(part=="j"||part=="d"){if(tmpParts.length){fullParts.push(tmpParts.join("-"));tmpParts=[];}fullParts.push("placeholder");}else{tmpParts.push(part);}}if(tmpParts.length){fullParts.push(tmpParts.join("-"));}if(!fullParts.length||fullParts.length>3){formatParts=window.opera?["placeholder"]:["placeholder","sp-F-sp-Y"];cellFormat="j-sp-F-sp-Y";return;}formatParts=window.opera?["placeholder"]:fullParts;cellFormat=window.opera?"j-sp-F-sp-Y":value;}function pad(value,length){length=length||2;return"0000".substr(0,length-Math.min(String(value).length,length))+value;}function addEvent(obj,type,fn){try{if(obj.attachEvent){obj["e"+type+fn]=fn;obj[type+fn]=function(){obj["e"+type+fn](window.event);};obj.attachEvent("on"+type,obj[type+fn]);}else{obj.addEventListener(type,fn,true);}}catch(err){alert(obj+" "+type+" "+fn);}}function removeEvent(obj,type,fn){try{if(obj.detachEvent){obj.detachEvent("on"+type,obj[type+fn]);obj[type+fn]=null;}else{obj.removeEventListener(type,fn,true);}}catch(err){}}function stopEvent(e){e=e||document.parentWindow.event;if(e.stopPropagation){e.stopPropagation();e.preventDefault();}
/*@cc_on
                @if(@_win32)
                e.cancelBubble = true;
                e.returnValue = false;
                @end
                @*/
return false;}function parseJSON(str){if(typeof str!=="string"||str==""){return{};}try{if("JSON" in window&&"parse" in window.JSON&&typeof window.JSON.parse=="function"){return window.JSON.parse(str);}else{if(/lang|split|formats|nodrag/.test(str.toLowerCase())){var f=Function(["var document,top,self,window,parent,Number,Date,Object,Function,","Array,String,Math,RegExp,Image,ActiveXObject;","return (",str.replace(/<\!--.+-->/gim,"").replace(/\bfunction\b/g,"function"),");"].join(""));return f();}}}catch(e){}return{err:"Trouble parsing JSON object"};}function setARIARole(element,role){if(element&&element.tagName){element.setAttribute("role",role);}}function setARIAProperty(element,property,value){if(element&&element.tagName){element.setAttribute("aria-"+property,value);}}function datePicker(options){this.dateSet=null;this.timerSet=false;this.visible=false;this.fadeTimer=null;this.timer=null;this.yearInc=0;this.monthInc=0;this.dayInc=0;this.mx=0;this.my=0;this.x=0;this.y=0;this.date=new Date();this.defaults={};this.created=false;this.disabled=false;this.id=options.id;this.opacity=0;this.firstDayOfWeek=localeImport.firstDayOfWeek;this.buttonWrapper="buttonWrapper" in options?options.buttonWrapper:false;this.staticPos="staticPos" in options?!!options.staticPos:false;this.disabledDays="disabledDays" in options&&options.disabledDays.length?options.disabledDays:[0,0,0,0,0,0,0];this.disabledDates="disabledDates" in options?options.disabledDates:{};this.enabledDates="enabledDates" in options?options.enabledDates:{};this.showWeeks="showWeeks" in options?!!options.showWeeks:false;this.low=options.low||"";this.high=options.high||"";this.dragDisabled=nodrag?true:("dragDisabled" in options?!!options.dragDisabled:false);this.positioned="positioned" in options?options.positioned:false;this.hideInput=this.staticPos?false:"hideInput" in options?!!options.hideInput:false;this.splitDate="splitDate" in options?!!options.splitDate:false;this.format=options.format||"d-sl-m-sl-Y";this.statusFormat=options.statusFormat||"";this.highlightDays=options.highlightDays&&options.highlightDays.length?options.highlightDays:[0,0,0,0,0,1,1];this.noFadeEffect="noFadeEffect" in options?!!options.noFadeEffect:false;this.opacityTo=this.noFadeEffect||this.staticPos?99:90;this.callbacks={};this.fillGrid=!!options.fillGrid;this.noToday=!!options.noToday;this.labelledBy="labelledBy" in options?options.labelledBy:"";this.constrainSelection=this.fillGrid&&!!options.constrainSelection;this.finalOpacity=!this.staticPos&&"finalOpacity" in options?+options.finalOpacity:90;this.dynDisabledDates={};this.inUpdate=false;this.noFocus=true;this.kbEventsAdded=false;this.fullCreate=false;this.selectedTD=null;this.cursorTD=null;this.addSpans=this.staticPos;this.spansAdded=false;
/*@cc_on
                @if(@_win32)
                this.interval            = new Date();
                this.iePopUp             = null;
                this.isIE7               = false;                 
                @end
                @*/
/*@cc_on
                @if(@_jscript_version <= 5.7)
                this.isIE7               = document.documentElement && typeof document.documentElement.style.maxHeight != "undefined";
                @end
                @*/
for(var thing in options.callbacks){this.callbacks[thing]=options.callbacks[thing];}this.date.setHours(12);this.changeHandler=function(){o.setDateFromInput();if(o.created){o.updateTable();}};this.getScrollOffsets=function(){if(typeof(window.pageYOffset)=="number"){return[window.pageXOffset,window.pageYOffset];}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){return[document.body.scrollLeft,document.body.scrollTop];}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){return[document.documentElement.scrollLeft,document.documentElement.scrollTop];}}}return[0,0];};this.reposition=function(){if(!o.created||!o.getElem()||o.staticPos){return;}o.div.style.visibility="hidden";o.div.style.left=o.div.style.top="0px";o.div.style.display="block";var osh=o.div.offsetHeight,osw=o.div.offsetWidth,elem=document.getElementById("fd-but-"+o.id),pos=o.truePosition(elem),trueBody=(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body,sOffsets=o.getScrollOffsets(),scrollTop=sOffsets[1],scrollLeft=sOffsets[0];o.div.style.visibility="visible";o.div.style.left=Number(parseInt(trueBody.clientWidth+scrollLeft)<parseInt(osw+pos[0])?Math.abs(parseInt((trueBody.clientWidth+scrollLeft)-osw)):pos[0])+"px";o.div.style.top=Number(parseInt(trueBody.clientHeight+scrollTop)<parseInt(osh+pos[1]+elem.offsetHeight+2)?Math.abs(parseInt(pos[1]-(osh+2))):Math.abs(parseInt(pos[1]+elem.offsetHeight+2)))+"px";
/*@cc_on
                        @if(@_jscript_version <= 5.7)
                        if(o.isIE7) return;
                        o.iePopUp.style.top    = o.div.style.top;
                        o.iePopUp.style.left   = o.div.style.left;
                        o.iePopUp.style.width  = osw + "px";
                        o.iePopUp.style.height = (osh - 2) + "px";
                        @end
                        @*/
};this.removeOldFocus=function(){var td=document.getElementById(o.id+"-date-picker-hover");if(td){try{td.setAttribute(!
/*@cc_on!@*/
false?"tabIndex":"tabindex","-1");td.tabIndex=-1;td.className=td.className.replace(/date-picker-hover/,"");td.id="";}catch(err){}}};this.setNewFocus=function(){var td=document.getElementById(o.id+"-date-picker-hover");if(td){try{td.setAttribute(!
/*@cc_on!@*/
false?"tabIndex":"tabindex","0");td.tabIndex=0;td.className=td.className.replace(/date-picker-hover/,"")+" date-picker-hover";if(!this.noFocus){setTimeout(function(){try{td.focus();}catch(err){}},0);}}catch(err){}}};this.updateTable=function(noCallback){if(o.inUpdate){return;}o.inUpdate=true;o.removeOldFocus();if(o.timerSet){o.date.setDate(Math.min(o.date.getDate()+o.dayInc,daysInMonth(o.date.getMonth()+o.monthInc,o.date.getFullYear()+o.yearInc)));o.date.setMonth(o.date.getMonth()+o.monthInc);o.date.setFullYear(o.date.getFullYear()+o.yearInc);}o.outOfRange();if(!o.noToday){o.disableTodayButton();}o.showHideButtons(o.date);var cd=o.date.getDate(),cm=o.date.getMonth(),cy=o.date.getFullYear(),cursorDate=(String(cy)+pad(cm+1)+pad(cd)),tmpDate=new Date(cy,cm,1);tmpDate.setHours(5);var dt,cName,td,i,currentDate,cellAdded,col,currentStub,abbr,bespokeRenderClass,spnC,weekDayC=(tmpDate.getDay()+6)%7,firstColIndex=(((weekDayC-o.firstDayOfWeek)+7)%7)-1,dpm=daysInMonth(cm,cy),today=new Date(),dateSetD=(o.dateSet!=null)?o.dateSet.getFullYear()+pad(o.dateSet.getMonth()+1)+pad(o.dateSet.getDate()):false,stub=String(tmpDate.getFullYear())+pad(tmpDate.getMonth()+1),cellAdded=[4,4,4,4,4,4],lm=new Date(cy,cm-1,1),nm=new Date(cy,cm+1,1),daySub=daysInMonth(lm.getMonth(),lm.getFullYear()),stubN=String(nm.getFullYear())+pad(nm.getMonth()+1),stubP=String(lm.getFullYear())+pad(lm.getMonth()+1),weekDayN=(nm.getDay()+6)%7,weekDayP=(lm.getDay()+6)%7,today=today.getFullYear()+pad(today.getMonth()+1)+pad(today.getDate()),spn=document.createElement("span");o.firstDateShown=!o.constrainSelection&&o.fillGrid&&(0-firstColIndex<1)?String(stubP)+(daySub+(0-firstColIndex)):stub+"01";o.lastDateShown=!o.constrainSelection&&o.fillGrid?stubN+pad(41-firstColIndex-dpm):stub+String(dpm);o.currentYYYYMM=stub;bespokeRenderClass=o.callback("redraw",{id:o.id,dd:pad(cd),mm:pad(cm+1),yyyy:cy,firstDateDisplayed:o.firstDateShown,lastDateDisplayed:o.lastDateShown})||{};o.dynDisabledDates=o.getDisabledDates(cy,cm+1);spn.className="fd-screen-reader";if(this.selectedTD!=null){setARIAProperty(this.selectedTD,"selected",false);this.selectedTD=null;}for(var curr=0;curr<42;curr++){row=Math.floor(curr/7);td=o.tds[curr];spnC=spn.cloneNode(false);while(td.firstChild){td.removeChild(td.firstChild);}if((curr>firstColIndex&&curr<=(firstColIndex+dpm))||o.fillGrid){currentStub=stub;weekDay=weekDayC;dt=curr-firstColIndex;cName=[];selectable=true;if(dt<1){dt=daySub+dt;currentStub=stubP;weekDay=weekDayP;selectable=!o.constrainSelection;cName.push("month-out");}else{if(dt>dpm){dt-=dpm;currentStub=stubN;weekDay=weekDayN;selectable=!o.constrainSelection;cName.push("month-out");}}weekDay=(weekDay+dt+6)%7;cName.push("day-"+localeDefaults.dayAbbrs[weekDay].toLowerCase());currentDate=currentStub+String(dt<10?"0":"")+dt;if(o.low&&+currentDate<+o.low||o.high&&+currentDate>+o.high){td.className="out-of-range";td.title="";td.appendChild(document.createTextNode(dt));if(o.showWeeks){cellAdded[row]=Math.min(cellAdded[row],2);}}else{if(selectable){td.title=titleFormat?printFormattedDate(new Date(+String(currentStub).substr(0,4),+String(currentStub).substr(4,2)-1,+dt),titleFormat,true):"";cName.push("cd-"+currentDate+" yyyymm-"+currentStub+" mmdd-"+currentStub.substr(4,2)+pad(dt));}else{td.title=titleFormat?getTitleTranslation(13)+" "+printFormattedDate(new Date(+String(currentStub).substr(0,4),+String(currentStub).substr(4,2)-1,+dt),titleFormat,true):"";cName.push("yyyymm-"+currentStub+" mmdd-"+currentStub.substr(4,2)+pad(dt)+" not-selectable");}if(currentDate==today){cName.push("date-picker-today");}if(dateSetD==currentDate){cName.push("date-picker-selected-date");setARIAProperty(td,"selected","true");this.selectedTD=td;}if(o.disabledDays[weekDay]||currentDate in o.dynDisabledDates){cName.push("day-disabled");if(titleFormat&&selectable){td.title=getTitleTranslation(13)+" "+td.title;}}if(currentDate in bespokeRenderClass){cName.push(bespokeRenderClass[currentDate]);}if(o.highlightDays[weekDay]){cName.push("date-picker-highlight");}if(cursorDate==currentDate){td.id=o.id+"-date-picker-hover";}td.className=cName.join(" ");if(o.kbEventsAdded||o.addSpans){for(var pt=0,part;part=formatParts[pt];pt++){if(part=="placeholder"){td.appendChild(document.createTextNode(dt));}else{spnC=spn.cloneNode(spn);spnC.appendChild(document.createTextNode(printFormattedDate(new Date(+String(currentStub).substr(0,4),+String(currentStub).substr(4,2)-1,+dt),part,true)));td.appendChild(spnC);}}}else{td.appendChild(document.createTextNode(dt));}if(o.showWeeks){cellAdded[row]=Math.min(cName[0]=="month-out"?3:1,cellAdded[row]);}}}else{td.className="date-picker-unused";td.appendChild(document.createTextNode(nbsp));td.title="";}if(o.showWeeks&&curr-(row*7)==6){while(o.wkThs[row].firstChild){o.wkThs[row].removeChild(o.wkThs[row].firstChild);}o.wkThs[row].appendChild(document.createTextNode(cellAdded[row]==4&&!o.fillGrid?nbsp:getWeekNumber(cy,cm,curr-firstColIndex-6)));o.wkThs[row].className="date-picker-week-header"+(["",""," out-of-range"," month-out",""][cellAdded[row]]);}}o.spansAdded=o.kbEventsAdded||o.addSpans;var span=o.titleBar.getElementsByTagName("span");while(span[0].firstChild){span[0].removeChild(span[0].firstChild);}while(span[1].firstChild){span[1].removeChild(span[1].firstChild);}span[0].appendChild(document.createTextNode(getMonthTranslation(cm,false)+nbsp));span[1].appendChild(document.createTextNode(cy));if(o.timerSet){o.timerInc=50+Math.round(((o.timerInc-50)/1.8));o.timer=window.setTimeout(o.updateTable,o.timerInc);}o.inUpdate=false;o.setNewFocus();};this.show=function(autoFocus){if(this.staticPos){return;}var elem=this.getElem();if(!elem||(elem&&elem.disabled)){return;}this.noFocus=true;if(!document.getElementById("fd-"+this.id)){this.created=false;this.fullCreate=false;this.create();this.fullCreate=true;}else{this.setDateFromInput();this.reposition();}this.noFocus=!!!autoFocus;if(this.noFocus){addEvent(document,"mousedown",this.onmousedown);}this.updateTable();this.opacityTo=this.finalOpacity;this.div.style.display="block";
/*@cc_on
                        @if(@_jscript_version <= 5.7)
                        
                        if(!o.isIE7) {
                                this.iePopUp.style.width = this.div.offsetWidth + "px";
                                this.iePopUp.style.height = this.div.offsetHeight + "px";
                                this.iePopUp.style.display = "block";
                        };
                        
                        @end
                        @*/
this.setNewFocus();this.fade();var butt=document.getElementById("fd-but-"+this.id);if(butt){butt.className=butt.className.replace("dp-button-active","")+" dp-button-active";}};this.hide=function(){if(!this.visible||!this.created||!document.getElementById("fd-"+this.id)){return;}this.stopTimer();this.removeFocusEvents();if(this.staticPos){return;}var butt=document.getElementById("fd-but-"+this.id);if(butt){butt.className=butt.className.replace("dp-button-active","");}removeEvent(document,"mousedown",this.onmousedown);
/*@cc_on
                        @if(@_jscript_version <= 5.7)
                        if(!this.isIE7) { this.iePopUp.style.display = "none"; };
                        @end
                        @*/
this.opacityTo=0;this.fade();this.div.className=this.div.className.replace("datepicker-focus","");if(this.statusBar){this.updateStatus(getTitleTranslation(9));}};this.destroy=function(){if(document.getElementById("fd-but-"+this.id)){document.getElementById("fd-but-"+this.id).parentNode.removeChild(document.getElementById("fd-but-"+this.id));}if(!this.created){return;}removeEvent(this.table,"mousedown",o.onmousedown);removeEvent(this.table,"mouseover",o.onmouseover);removeEvent(this.table,"mouseout",o.onmouseout);removeEvent(document,"mousedown",o.onmousedown);removeEvent(document,"mouseup",o.clearTimer);o.removeFocusEvents();clearTimeout(o.fadeTimer);clearTimeout(o.timer);
/*@cc_on
                        @if(@_jscript_version <= 5.7)                         
                        if(!o.staticPos && !o.isIE7) {
                                try {
                                        o.iePopUp.parentNode.removeChild(o.iePopUp);
                                        o.iePopUp = null;
                                } catch(err) {};
                        };
                        @end
                        @*/
if(this.div&&this.div.parentNode){this.div.parentNode.removeChild(this.div);}o=null;};this.resizeInlineDiv=function(){o.div.style.width=o.table.offsetWidth+"px";o.div.style.height=o.table.offsetHeight+"px";};this.create=function(){if(this.created){return;}this.noFocus=true;function createTH(details){var th=document.createElement("th");if(details.thClassName){th.className=details.thClassName;}if(details.colspan){
/*@cc_on
                                        /*@if (@_win32)
                                        th.setAttribute('colSpan',details.colspan);
                                        @else @*/
th.setAttribute("colspan",details.colspan);
/*@end
                                        @*/
}
/*@cc_on
                                /*@if (@_win32)
                                th.unselectable = "on";
                                /*@end@*/
return th;}function createThAndButton(tr,obj){for(var i=0,details;details=obj[i];i++){var th=createTH(details);tr.appendChild(th);var but=document.createElement("span");but.className=details.className;but.id=o.id+details.id;but.appendChild(document.createTextNode(details.text||o.nbsp));but.title=details.title||"";
/*@cc_on
                                        /*@if(@_win32)
                                        th.unselectable = but.unselectable = "on";
                                        /*@end@*/
th.appendChild(but);}}this.div=document.createElement("div");this.div.id="fd-"+this.id;this.div.className="datePicker";this.div.style.visibility="hidden";this.div.style.display="none";if(document.getElementById("fd-datepicker-aria-describedby")){setARIAProperty(this.div,"describedby","fd-datepicker-aria-describedby");}if(this.labelledBy){setARIAProperty(this.div,"labelledby",this.labelledBy.id);}var tr,row,col,tableHead,tableBody,tableFoot;this.table=document.createElement("table");this.table.className="datePickerTable";this.table.onmouseover=this.onmouseover;this.table.onmouseout=this.onmouseout;this.table.onclick=this.onclick;if(this.staticPos){this.table.onmousedown=this.onmousedown;}this.div.appendChild(this.table);var dragEnabledCN=!this.dragDisabled?" drag-enabled":"";if(!this.staticPos){this.div.style.visibility="hidden";this.div.className+=dragEnabledCN;document.getElementsByTagName("body")[0].appendChild(this.div);
/*@cc_on
                                @if(@_jscript_version <= 5.7) 
                                
                                if(!this.isIE7) {                                         
                                        this.iePopUp = document.createElement('iframe');
                                        this.iePopUp.src = "javascript:'<html></html>';";
                                        this.iePopUp.setAttribute('className','iehack');
                                        // Remove iFrame from tabIndex                                        
			                this.iePopUp.setAttribute("tabIndex", -1);  			                
                                        // Hide it from ARIA aware technologies
			                setARIARole(this.iePopUp, "presentation");
                                        setARIAProperty(this.iePopUp, "hidden", "true"); 			                
                                        this.iePopUp.scrolling = "no";
                                        this.iePopUp.frameBorder = "0";
                                        this.iePopUp.name = this.iePopUp.id = this.id + "-iePopUpHack";
                                        document.body.appendChild(this.iePopUp);                                        
                                };
                                
                                @end
                                @*/
setARIAProperty(this.div,"hidden","true");}else{elem=this.positioned?document.getElementById(this.positioned):this.getElem();if(!elem){this.div=null;throw this.positioned?"Could not locate a datePickers associated parent element with an id:"+this.positioned:"Could not locate a datePickers associated input with an id:"+this.id;}this.div.className+=" static-datepicker";if(this.positioned){elem.appendChild(this.div);}else{elem.parentNode.insertBefore(this.div,elem.nextSibling);}if(this.hideInput){var elemList=[elem];if(this.splitDate){elemList[elemList.length]=document.getElementById(this.id+splitAppend[1]);elemList[elemList.length]=document.getElementById(this.id+splitAppend[0]);}for(var i=0;i<elemList.length;i++){if(elemList[i].tagName){elemList[i].className+=" fd-hidden-input";}}}setTimeout(this.resizeInlineDiv,300);}setARIARole(this.div,"grid");if(this.statusFormat){tableFoot=document.createElement("tfoot");this.table.appendChild(tableFoot);tr=document.createElement("tr");tr.className="date-picker-tfoot";tableFoot.appendChild(tr);this.statusBar=createTH({thClassName:"date-picker-statusbar"+dragEnabledCN,colspan:this.showWeeks?8:7});tr.appendChild(this.statusBar);this.updateStatus();}tableHead=document.createElement("thead");this.table.appendChild(tableHead);tr=document.createElement("tr");setARIARole(tr,"presentation");tableHead.appendChild(tr);this.titleBar=createTH({thClassName:"date-picker-title"+dragEnabledCN,colspan:this.showWeeks?8:7});tr.appendChild(this.titleBar);tr=null;var span=document.createElement("span");span.appendChild(document.createTextNode(nbsp));span.className="month-display"+dragEnabledCN;this.titleBar.appendChild(span);span=document.createElement("span");span.appendChild(document.createTextNode(nbsp));span.className="year-display"+dragEnabledCN;this.titleBar.appendChild(span);span=null;tr=document.createElement("tr");setARIARole(tr,"presentation");tableHead.appendChild(tr);createThAndButton(tr,[{className:"prev-but prev-year",id:"-prev-year-but",text:"\u00AB",title:getTitleTranslation(2)},{className:"prev-but prev-month",id:"-prev-month-but",text:"\u2039",title:getTitleTranslation(0)},{colspan:this.showWeeks?4:3,className:"today-but",id:"-today-but",text:getTitleTranslation(4)},{className:"next-but next-month",id:"-next-month-but",text:"\u203A",title:getTitleTranslation(1)},{className:"next-but next-year",id:"-next-year-but",text:"\u00BB",title:getTitleTranslation(3)}]);tableBody=document.createElement("tbody");this.table.appendChild(tableBody);var colspanTotal=this.showWeeks?8:7,colOffset=this.showWeeks?0:-1,but,abbr;for(var rows=0;rows<7;rows++){row=document.createElement("tr");if(rows!=0){setARIARole(row,"row");tableBody.appendChild(row);}else{tableHead.appendChild(row);}for(var cols=0;cols<colspanTotal;cols++){if(rows===0||(this.showWeeks&&cols===0)){col=document.createElement("th");}else{col=document.createElement("td");col.onblur=this.onblur;col.onfocus=this.onfocus;setARIAProperty(col,"describedby",this.id+"-col-"+cols+(this.showWeeks?" "+this.id+"-row-"+rows:""));setARIAProperty(col,"selected","false");}
/*@cc_on@*/
/*@if(@_win32)
                                        col.unselectable = "on";
                                        /*@end@*/
row.appendChild(col);if((this.showWeeks&&cols>0&&rows>0)||(!this.showWeeks&&rows>0)){setARIARole(col,"gridcell");}else{if(rows===0&&cols>colOffset){col.className="date-picker-day-header";col.scope="col";setARIARole(col,"columnheader");col.id=this.id+"-col-"+cols;}else{col.className="date-picker-week-header";col.scope="row";setARIARole(col,"rowheader");col.id=this.id+"-row-"+rows;}}}}col=row=null;this.ths=this.table.getElementsByTagName("thead")[0].getElementsByTagName("tr")[2].getElementsByTagName("th");for(var y=0;y<colspanTotal;y++){if(y==0&&this.showWeeks){this.ths[y].appendChild(document.createTextNode(getTitleTranslation(6)));this.ths[y].title=getTitleTranslation(8);continue;}if(y>(this.showWeeks?0:-1)){but=document.createElement("span");but.className="fd-day-header";
/*@cc_on@*/
/*@if(@_win32)
                                        but.unselectable = "on";
                                        /*@end@*/
this.ths[y].appendChild(but);}}but=null;this.trs=this.table.getElementsByTagName("tbody")[0].getElementsByTagName("tr");this.tds=this.table.getElementsByTagName("tbody")[0].getElementsByTagName("td");this.butPrevYear=document.getElementById(this.id+"-prev-year-but");this.butPrevMonth=document.getElementById(this.id+"-prev-month-but");this.butToday=document.getElementById(this.id+"-today-but");this.butNextYear=document.getElementById(this.id+"-next-year-but");this.butNextMonth=document.getElementById(this.id+"-next-month-but");if(this.noToday){this.butToday.style.display="none";}if(this.showWeeks){this.wkThs=this.table.getElementsByTagName("tbody")[0].getElementsByTagName("th");this.div.className+=" weeks-displayed";}tableBody=tableHead=tr=createThAndButton=createTH=null;if(this.low&&this.high&&(this.high-this.low<7)){this.equaliseDates();}this.setDateFromInput();this.updateTableHeaders();this.created=true;this.callback("create",{id:this.id});this.updateTable();if(this.staticPos){this.visible=true;this.opacity=this.opacityTo;this.div.style.visibility="visible";this.div.style.display="block";this.noFocus=true;this.fade();}else{this.reposition();this.div.style.visibility="visible";this.fade();this.noFocus=true;}this.addSpans=false;};this.fade=function(){window.clearTimeout(o.fadeTimer);o.fadeTimer=null;var diff=Math.round(o.opacity+((o.opacityTo-o.opacity)/4));o.setOpacity(diff);if(Math.abs(o.opacityTo-diff)>3&&!o.noFadeEffect){o.fadeTimer=window.setTimeout(o.fade,50);}else{o.setOpacity(o.opacityTo);if(o.opacityTo==0){o.div.style.display="none";o.div.style.visibility="hidden";setARIAProperty(o.div,"hidden","true");o.visible=false;}else{setARIAProperty(o.div,"hidden","false");o.visible=true;}}};this.trackDrag=function(e){e=e||window.event;var diffx=(e.pageX?e.pageX:e.clientX?e.clientX:e.x)-o.mx;var diffy=(e.pageY?e.pageY:e.clientY?e.clientY:e.Y)-o.my;o.div.style.left=Math.round(o.x+diffx)>0?Math.round(o.x+diffx)+"px":"0px";o.div.style.top=Math.round(o.y+diffy)>0?Math.round(o.y+diffy)+"px":"0px";
/*@cc_on
                        @if(@_jscript_version <= 5.7)                         
                        if(o.staticPos || o.isIE7) return;
                        o.iePopUp.style.top    = o.div.style.top;
                        o.iePopUp.style.left   = o.div.style.left;
                        @end
                        @*/
};this.stopDrag=function(e){removeEvent(document,"mousemove",o.trackDrag,false);removeEvent(document,"mouseup",o.stopDrag,false);o.div.style.zIndex=9999;};this.onmousedown=function(e){e=e||document.parentWindow.event;var el=e.target!=null?e.target:e.srcElement,origEl=el,hideDP=true,reg=new RegExp("^fd-(but-)?"+o.id+"$");o.mouseDownElem=null;while(el){if(el.id&&el.id.length&&el.id.search(reg)!=-1){hideDP=false;break;}try{el=el.parentNode;}catch(err){break;}}if(hideDP){hideAll();return true;}if((o.div.className+origEl.className).search("fd-disabled")!=-1){return true;}if(origEl.id.search(new RegExp("^"+o.id+"(-prev-year-but|-prev-month-but|-next-month-but|-next-year-but)$"))!=-1){o.mouseDownElem=origEl;addEvent(document,"mouseup",o.clearTimer);addEvent(origEl,"mouseout",o.clearTimer);var incs={"-prev-year-but":[0,-1,0],"-prev-month-but":[0,0,-1],"-next-year-but":[0,1,0],"-next-month-but":[0,0,1]},check=origEl.id.replace(o.id,""),dateYYYYMM=Number(o.date.getFullYear()+pad(o.date.getMonth()+1));o.timerInc=(o.currentYYYYMM>dateYYYYMM||o.currentYYYYMM<dateYYYYMM)?1600:800;o.timerSet=true;o.dayInc=incs[check][0];o.yearInc=incs[check][1];o.monthInc=incs[check][2];o.addSpans=false;o.updateTable();}else{if(el.className.search("drag-enabled")!=-1){o.mx=e.pageX?e.pageX:e.clientX?e.clientX:e.x;o.my=e.pageY?e.pageY:e.clientY?e.clientY:e.Y;o.x=parseInt(o.div.style.left);o.y=parseInt(o.div.style.top);addEvent(document,"mousemove",o.trackDrag,false);addEvent(document,"mouseup",o.stopDrag,false);o.div.style.zIndex=10000;}}return true;};this.onclick=function(e){if(o.opacity!=o.opacityTo||o.disabled){return stopEvent(e);}e=e||document.parentWindow.event;var el=e.target!=null?e.target:e.srcElement;while(el.parentNode){if(el.tagName&&el.tagName.toLowerCase()=="td"){if(el.className.search(/cd-([0-9]{8})/)==-1||el.className.search(/date-picker-unused|out-of-range|day-disabled|no-selection|not-selectable/)!=-1){return stopEvent(e);}var cellDate=el.className.match(/cd-([0-9]{8})/)[1];o.date=new Date(cellDate.substr(0,4),cellDate.substr(4,2)-1,cellDate.substr(6,2));o.dateSet=new Date(o.date);o.noFocus=true;o.returnFormattedDate();o.hide();o.stopTimer();break;}else{if(el.id&&el.id==o.id+"-today-but"){o.date=new Date();o.updateTable();o.stopTimer();break;}else{if(el.className.search(/date-picker-day-header/)!=-1){var cnt=o.showWeeks?-1:0,elem=el;while(elem.previousSibling){elem=elem.previousSibling;if(elem.tagName.toLowerCase()=="th"){cnt++;}}o.firstDayOfWeek=(o.firstDayOfWeek+cnt)%7;o.updateTableHeaders();break;}}}try{el=el.parentNode;}catch(err){break;}}return stopEvent(e);};this.onblur=function(e){e=e||document.parentWindow.event;var el=e.target!=null?e.target:e.srcElement;while(el.parentNode){if(el.id&&el.id=="fd-"+o.id){return true;}try{el=el.parentNode;}catch(err){break;}}if(o.kbEventsAdded){o.removeFocusEvents();}o.div.className=o.div.className.replace("datepicker-focus","");o.noFocus=true;o.addSpans=false;o.hide();if(o.statusBar){o.updateStatus(getTitleTranslation(9));}};this.onfocus=function(e){if(o.staticPos){o.noFocus=false;if(!o.spansAdded){o.addSpans=true;o.updateTable();}}o.addFocusEvents();o.noFocus=false;};this.onkeydown=function(e){o.stopTimer();if(!o.visible){return false;}if(e==null){e=document.parentWindow.event;}var kc=e.keyCode?e.keyCode:e.charCode;if(kc==13){var td=document.getElementById(o.id+"-date-picker-hover");if(!td||td.className.search(/cd-([0-9]{8})/)==-1||td.className.search(/no-selection|out-of-range|day-disabled/)!=-1){return stopEvent(e);}o.dateSet=new Date(o.date);o.returnFormattedDate();o.hide();return stopEvent(e);}else{if(kc==27){o.hide();return stopEvent(e);}else{if(kc==32||kc==0){o.date=new Date();o.updateTable();return stopEvent(e);}}}
/*@cc_on
                        @if(@_win32)                                 
                        if(new Date().getTime() - o.interval.getTime() < 50) { return stopEvent(e); }; 
                        o.interval = new Date();                                 
                        @end
                        @*/
if((kc>49&&kc<56)||(kc>97&&kc<104)){if(kc>96){kc-=(96-48);}kc-=49;o.firstDayOfWeek=(o.firstDayOfWeek+kc)%7;o.updateTableHeaders();return stopEvent(e);}if(kc<33||kc>40){return true;}var d=new Date(o.date),tmp,cursorYYYYMM=o.date.getFullYear()+pad(o.date.getMonth()+1);if(kc==36){d.setDate(1);}else{if(kc==35){d.setDate(daysInMonth(d.getMonth(),d.getFullYear()));}else{if(kc==33||kc==34){var add=(kc==34)?1:-1;if(e.ctrlKey){d.setFullYear(d.getFullYear()+add);}else{if(!((kc==33&&o.currentYYYYMM>cursorYYYYMM)||(kc==34&&o.currentYYYYMM<cursorYYYYMM))){tmp=new Date(d);tmp.setDate(2);tmp.setMonth(d.getMonth()+add);d.setDate(Math.min(d.getDate(),daysInMonth(tmp.getMonth(),tmp.getFullYear())));d.setMonth(d.getMonth()+add);}}}else{if(kc==37){d=new Date(o.date.getFullYear(),o.date.getMonth(),o.date.getDate()-1);}else{if(kc==39||kc==34){d=new Date(o.date.getFullYear(),o.date.getMonth(),o.date.getDate()+1);}else{if(kc==38){d=new Date(o.date.getFullYear(),o.date.getMonth(),o.date.getDate()-7);}else{if(kc==40){d=new Date(o.date.getFullYear(),o.date.getMonth(),o.date.getDate()+7);}}}}}}}if(o.outOfRange(d)){return stopEvent(e);}o.date=d;if(o.statusBar){o.updateStatus(printFormattedDate(o.date,o.statusFormat,true));}var t=String(o.date.getFullYear())+pad(o.date.getMonth()+1)+pad(o.date.getDate());if(e.ctrlKey||(kc==33||kc==34)||t<o.firstDateShown||t>o.lastDateShown){o.updateTable();
/*@cc_on
                                @if(@_win32)
                                o.interval = new Date();                        
                                @end
                                @*/
}else{if(!o.noToday){o.disableTodayButton();}o.removeOldFocus();var dt="cd-"+o.date.getFullYear()+pad(o.date.getMonth()+1)+pad(o.date.getDate());for(var i=0,td;td=o.tds[i];i++){if(td.className.search(dt)==-1){continue;}o.showHideButtons(o.date);td.id=o.id+"-date-picker-hover";o.setNewFocus();break;}}return stopEvent(e);};this.onmouseout=function(e){e=e||document.parentWindow.event;var p=e.toElement||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}if(o.currentTR){o.currentTR.className="";o.currentTR=null;}if(o.statusBar){o.updateStatus(printFormattedDate(o.date,o.statusFormat,true));}};this.onmouseover=function(e){e=e||document.parentWindow.event;var el=e.target!=null?e.target:e.srcElement;while(el.nodeType!=1){el=el.parentNode;}if(!el||!el.tagName){return;}var statusText=getTitleTranslation(9);switch(el.tagName.toLowerCase()){case"td":if(el.className.search(/date-picker-unused|out-of-range/)!=-1){statusText=getTitleTranslation(9);}if(el.className.search(/cd-([0-9]{8})/)!=-1){o.stopTimer();var cellDate=el.className.match(/cd-([0-9]{8})/)[1];o.removeOldFocus();el.id=o.id+"-date-picker-hover";o.setNewFocus();o.date=new Date(+cellDate.substr(0,4),+cellDate.substr(4,2)-1,+cellDate.substr(6,2));if(!o.noToday){o.disableTodayButton();}statusText=printFormattedDate(o.date,o.statusFormat,true);}break;case"th":if(!o.statusBar){break;}if(el.className.search(/drag-enabled/)!=-1){statusText=getTitleTranslation(10);}else{if(el.className.search(/date-picker-week-header/)!=-1){var txt=el.firstChild?el.firstChild.nodeValue:"";statusText=txt.search(/^(\d+)$/)!=-1?getTitleTranslation(7,[txt,txt<3&&o.date.getMonth()==11?getWeeksInYear(o.date.getFullYear())+1:getWeeksInYear(o.date.getFullYear())]):getTitleTranslation(9);}}break;case"span":if(!o.statusBar){break;}if(el.className.search(/drag-enabled/)!=-1){statusText=getTitleTranslation(10);}else{if(el.className.search(/day-([0-6])/)!=-1){var day=el.className.match(/day-([0-6])/)[1];statusText=getTitleTranslation(11,[getDayTranslation(day,false)]);}else{if(el.className.search(/prev-year/)!=-1){statusText=getTitleTranslation(2);}else{if(el.className.search(/prev-month/)!=-1){statusText=getTitleTranslation(0);}else{if(el.className.search(/next-year/)!=-1){statusText=getTitleTranslation(3);}else{if(el.className.search(/next-month/)!=-1){statusText=getTitleTranslation(1);}else{if(el.className.search(/today-but/)!=-1&&el.className.search(/disabled/)==-1){statusText=getTitleTranslation(12);}}}}}}}break;default:statusText="";}while(el.parentNode){el=el.parentNode;if(el.nodeType==1&&el.tagName.toLowerCase()=="tr"){if(o.currentTR){if(el==o.currentTR){break;}o.currentTR.className="";}el.className="dp-row-highlight";o.currentTR=el;break;}}if(o.statusBar&&statusText){o.updateStatus(statusText);}};this.clearTimer=function(){o.stopTimer();o.timerInc=800;o.yearInc=0;o.monthInc=0;o.dayInc=0;removeEvent(document,"mouseup",o.clearTimer);if(o.mouseDownElem!=null){removeEvent(o.mouseDownElem,"mouseout",o.clearTimer);}o.mouseDownElem=null;};var o=this;if(this.staticPos){this.create();}else{this.createButton();}this.setDateFromInput();(function(){var elem=o.getElem();if(elem&&elem.tagName&&elem.tagName.search(/select|input/i)!=-1){addEvent(elem,"change",o.changeHandler);if(this.splitDate){addEvent(document.getElementById(o.id+splitAppend[1]),"change",o.changeHandler);addEvent(document.getElementById(o.id+splitAppend[0]),"change",o.changeHandler);}}if(!elem||elem.disabled==true){o.disableDatePicker();}})();this.fullCreate=true;}datePicker.prototype.addButtonEvents=function(but){but.onkeydown=but.onclick=function(e){e=e||window.event;var inpId=this.id.replace("fd-but-",""),dpVisible=isVisible(inpId),autoFocus=false;if(e.type=="keydown"){var kc=e.keyCode!=null?e.keyCode:e.charCode;if(kc!=13){return true;}if(dpVisible){this.className=this.className.replace("dp-button-active","");hideAll();return false;}autoFocus=true;}this.className=this.className.replace("dp-button-active","");if(!dpVisible){this.className+=" dp-button-active";hideAll(inpId);showDatePicker(inpId,autoFocus);}else{hideAll();}return false;};if(!buttonTabIndex){but.setAttribute(!
/*@cc_on!@*/
false?"tabIndex":"tabindex","-1");but.tabIndex=-1;but.onkeydown=null;}else{but.setAttribute(!
/*@cc_on!@*/
false?"tabIndex":"tabindex","0");but.tabIndex=0;}};datePicker.prototype.createButton=function(){if(this.staticPos||document.getElementById("fd-but-"+this.id)){return;}var inp=this.getElem(),span=document.createElement("span"),but=document.createElement("a");but.href="#"+this.id;but.className="date-picker-control";but.title=getTitleTranslation(5);but.id="fd-but-"+this.id;span.appendChild(document.createTextNode(nbsp));but.appendChild(span);span=document.createElement("span");span.className="fd-screen-reader";span.appendChild(document.createTextNode(but.title));but.appendChild(span);setARIARole(but,"button");setARIAProperty(but,"haspopup",true);if(this.buttonWrapper&&document.getElementById(this.buttonWrapper)){document.getElementById(this.buttonWrapper).appendChild(but);}else{if(inp.nextSibling){inp.parentNode.insertBefore(but,inp.nextSibling);}else{inp.parentNode.appendChild(but);}}this.addButtonEvents(but);but=null;};datePicker.prototype.setRangeLow=function(range){this.low=(String(range).search(/^(\d\d\d\d)(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$/)==-1)?false:range;this.checkSelectedDate();if(this.created){this.updateTable();}};datePicker.prototype.setRangeHigh=function(range){this.high=(String(range).search(/^(\d\d\d\d)(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$/)==-1)?false:range;this.checkSelectedDate();if(this.created){this.updateTable();}};datePicker.prototype.setDisabledDays=function(dayArray){this.disabledDays=dayArray;this.checkSelectedDate();if(this.created){this.updateTable();}};datePicker.prototype.setDisabledDates=function(dateArray){this.disabledDates={};this.addDisabledDates(dateArray);};datePicker.prototype.addDisabledDates=function(dateArray){var disabledDateObj={};if(typeof dateArray!=="object"){dateArray=[dateArray];}for(var i=dateArray.length;i--;){if(dateArray[i].match(/^(\d\d\d\d|\*\*\*\*)(0[1-9]|1[012]|\*\*)(0[1-9]|[12][0-9]|3[01])$/)!=-1){this.disabledDates[dateArray[i]]=1;}}this.checkSelectedDate();if(this.created){this.updateTable();}};datePicker.prototype.checkSelectedDate=function(){if(!this.dateSet){return;}if(!this.canDateBeSelected(this.dateSet)){this.dateSet=null;}};datePicker.prototype.addFocusEvents=function(){if(this.kbEventsAdded||this.noFocus){return;}this.div.className=this.div.className.replace(/datepicker-focus/,"")+" datepicker-focus";addEvent(document,"keypress",this.onkeydown);addEvent(document,"mousedown",this.onmousedown);
/*@cc_on
                @if(@_win32)
                removeEvent(document, "keypress", this.onkeydown);
                addEvent(document, "keydown", this.onkeydown);                 
                @end
                @*/
if(window.devicePixelRatio){removeEvent(document,"keypress",this.onkeydown);addEvent(document,"keydown",this.onkeydown);}this.noFocus=false;this.kbEventsAdded=true;};datePicker.prototype.removeFocusEvents=function(){if(!this.kbEventsAdded){return;}this.div.className=this.div.className.replace(/datepicker-focus/,"");removeEvent(document,"keypress",this.onkeydown);removeEvent(document,"keydown",this.onkeydown);removeEvent(document,"mousedown",this.onmousedown);this.noFocus=true;this.kbEventsAdded=false;};datePicker.prototype.stopTimer=function(){this.timerSet=false;window.clearTimeout(this.timer);};datePicker.prototype.setOpacity=function(op){this.div.style.opacity=op/100;this.div.style.filter="alpha(opacity="+op+")";this.opacity=op;};datePicker.prototype.getElem=function(){return document.getElementById(this.id.replace(/^fd-/,""))||false;};datePicker.prototype.getDisabledDates=function(y,m){m=pad(m);var obj={},lower=this.firstDateShown,upper=this.lastDateShown,dt1,dt2,rngLower,rngUpper;if(!upper||!lower){lower=this.firstDateShown=y+pad(m)+"01";upper=this.lastDateShown=y+pad(m)+pad(daysInMonth(m,y));}for(var dt in this.disabledDates){dt1=dt.replace(/^(\*\*\*\*)/,y).replace(/^(\d\d\d\d)(\*\*)/,"$1"+m);dt2=this.disabledDates[dt];if(dt2==1){if(+lower<=+dt1&&+upper>=+dt1){obj[dt1]=1;}continue;}if(Number(dt1.substr(0,6))<=+String(this.firstDateShown).substr(0,6)&&Number(dt2.substr(0,6))>=+String(this.lastDateShown).substr(0,6)){if(Number(dt1.substr(0,6))==Number(dt2.substr(0,6))){for(var i=dt1;i<=dt2;i++){obj[i]=1;}continue;}rngLower=Number(dt1.substr(0,6))==+String(this.firstDateShown).substr(0,6)?dt1:lower;rngUpper=Number(dt2.substr(0,6))==+String(this.lastDateShown).substr(0,6)?dt2:upper;for(var i=+rngLower;i<=+rngUpper;i++){obj[i]=1;}}}for(dt in this.enabledDates){dt1=dt.replace(/^(\*\*\*\*)/,y).replace(/^(\d\d\d\d)(\*\*)/,"$1"+m);dt2=this.enabledDates[dt];if(dt2==1){if(dt1 in obj){obj[dt1]=null;delete obj[dt1];}continue;}if(Number(dt1.substr(0,6))<=+String(this.firstDateShown).substr(0,6)&&Number(dt2.substr(0,6))>=+String(this.lastDateShown).substr(0,6)){if(Number(dt1.substr(0,6))==Number(dt2.substr(0,6))){for(var i=dt1;i<=dt2;i++){if(i in obj){obj[i]=null;delete obj[i];}}continue;}rngLower=Number(dt1.substr(0,6))==+String(this.firstDateShown).substr(0,6)?dt1:lower;rngUpper=Number(dt2.substr(0,6))==+String(this.lastDateShown).substr(0,6)?dt2:upper;for(var i=+rngLower;i<=+rngUpper;i++){if(i in obj){obj[i]=null;delete obj[i];}}}}return obj;};datePicker.prototype.truePosition=function(element){var pos=this.cumulativeOffset(element);if(window.opera){return pos;}var iebody=(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body,dsocleft=document.all?iebody.scrollLeft:window.pageXOffset,dsoctop=document.all?iebody.scrollTop:window.pageYOffset,posReal=this.realOffset(element);return[pos[0]-posReal[0]+dsocleft,pos[1]-posReal[1]+dsoctop];};datePicker.prototype.realOffset=function(element){var t=0,l=0;do{t+=element.scrollTop||0;l+=element.scrollLeft||0;element=element.parentNode;}while(element);return[l,t];};datePicker.prototype.cumulativeOffset=function(element){var t=0,l=0;do{t+=element.offsetTop||0;l+=element.offsetLeft||0;element=element.offsetParent;}while(element);return[l,t];};datePicker.prototype.equaliseDates=function(){var clearDayFound=false,tmpDate;for(var i=this.low;i<=this.high;i++){tmpDate=String(i);if(!this.disabledDays[new Date(tmpDate.substr(0,4),tmpDate.substr(6,2),tmpDate.substr(4,2)).getDay()-1]){clearDayFound=true;break;}}if(!clearDayFound){this.disabledDays=[0,0,0,0,0,0,0];}};datePicker.prototype.outOfRange=function(tmpDate){if(!this.low&&!this.high){return false;}var level=false;if(!tmpDate){level=true;tmpDate=this.date;}var d=pad(tmpDate.getDate()),m=pad(tmpDate.getMonth()+1),y=tmpDate.getFullYear(),dt=String(y)+String(m)+String(d);if(this.low&&+dt<+this.low){if(!level){return true;}this.date=new Date(this.low.substr(0,4),this.low.substr(4,2)-1,this.low.substr(6,2),5,0,0);return false;}if(this.high&&+dt>+this.high){if(!level){return true;}this.date=new Date(this.high.substr(0,4),this.high.substr(4,2)-1,this.high.substr(6,2),5,0,0);}return false;};datePicker.prototype.canDateBeSelected=function(tmpDate){if(!tmpDate){return false;}var d=pad(tmpDate.getDate()),m=pad(tmpDate.getMonth()+1),y=tmpDate.getFullYear(),dt=String(y)+String(m)+String(d),dd=this.getDisabledDates(+y,+m),wd=printFormattedDate(tmpDate,"N");if((this.low&&+dt<+this.low)||(this.high&&+dt>+this.high)||(dt in dd)||this.disabledDays[wd-1]){return false;}return true;};datePicker.prototype.updateStatus=function(msg){while(this.statusBar.firstChild){this.statusBar.removeChild(this.statusBar.firstChild);}if(msg&&this.statusFormat.search(/-S|S-/)!=-1&&msg.search(/([0-9]{1,2})(st|nd|rd|th)/)!=-1){msg=msg.replace(/([0-9]{1,2})(st|nd|rd|th)/,"$1<sup>$2</sup>").split(/<sup>|<\/sup>/);var dc=document.createDocumentFragment();for(var i=0,nd;nd=msg[i];i++){if(/^(st|nd|rd|th)$/.test(nd)){var sup=document.createElement("sup");sup.appendChild(document.createTextNode(nd));dc.appendChild(sup);}else{dc.appendChild(document.createTextNode(nd));}}this.statusBar.appendChild(dc);}else{this.statusBar.appendChild(document.createTextNode(msg?msg:getTitleTranslation(9)));}};datePicker.prototype.setDateFromInput=function(){this.dateSet=null;var elem=this.getElem(),upd=false,dt;if(!elem||elem.tagName.search(/select|input/i)==-1){return;}if(!this.splitDate&&elem.value.replace(/\s/g,"")!==""){var dynFormatMasks=formatMasks.concat([this.format]).reverse();for(var i=0,fmt;fmt=dynFormatMasks[i];i++){dt=parseDateString(elem.value,fmt);if(dt){upd=true;break;}}}else{if(this.splitDate){var mmN=document.getElementById(this.id+splitAppend[1]),ddN=document.getElementById(this.id+splitAppend[0]),tm=parseInt(mmN.tagName.toLowerCase()=="input"?mmN.value:mmN.options[mmN.selectedIndex||0].value,10),td=parseInt(ddN.tagName.toLowerCase()=="input"?ddN.value:ddN.options[ddN.selectedIndex||0].value,10),ty=parseInt(elem.tagName.toLowerCase()=="input"?elem.value:elem.options[elem.selectedIndex||0].value,10);if(!(/\d\d\d\d/.test(ty))||!(/^(0?[1-9]|1[012])$/.test(tm))||!(/^(0?[1-9]|[12][0-9]|3[01])$/.test(td))){dt=false;}else{if(+td>daysInMonth(+tm-1,+ty)){upd=true;td=daysInMonth(+tm-1,+ty);dt=new Date(ty,tm-1,td);}else{dt=new Date(ty,tm-1,td);}}}}if(!dt||isNaN(dt)){this.date=new Date();this.date.setHours(5);this.outOfRange();return;}dt.setHours(5);this.date=new Date(dt);this.outOfRange();if(dt.getTime()==this.date.getTime()&&this.canDateBeSelected(this.date)){this.dateSet=new Date(this.date);}if(upd){this.returnFormattedDate(true);}};datePicker.prototype.setSelectIndex=function(elem,indx){for(var opt=elem.options.length-1;opt>=0;opt--){if(elem.options[opt].value==+indx){elem.selectedIndex=opt;return;}}};datePicker.prototype.returnFormattedDate=function(noFocus){var elem=this.getElem();if(!elem||this.dateSet==null){return;}noFocus=!!noFocus;var d=pad(this.date.getDate()),m=pad(this.date.getMonth()+1),yyyy=this.date.getFullYear(),disabledDates=this.getDisabledDates(+yyyy,+m),weekDay=(this.date.getDay()+6)%7;if(!(this.disabledDays[weekDay]||String(yyyy)+m+d in this.disabledDates)){if(this.splitDate){var ddE=document.getElementById(this.id+splitAppend[0]),mmE=document.getElementById(this.id+splitAppend[1]),tY=elem.value,tM=mmE.value,tD=ddE.value;if(+tY==+yyyy&&+tM==+m&&+tD==+d){return;}if(ddE.tagName.toLowerCase()=="input"){ddE.value=d;}else{this.setSelectIndex(ddE,d);}if(mmE.tagName.toLowerCase()=="input"){mmE.value=m;}else{this.setSelectIndex(mmE,m);}if(elem.tagName.toLowerCase()=="input"){elem.value=yyyy;}else{this.setSelectIndex(elem,yyyy);}}else{if(elem.tagName.toLowerCase()=="input"){var oldVal=elem.value,newVal=printFormattedDate(this.date,this.format,returnLocaleDate);if(oldVal==newVal){return;}elem.value=newVal;}}if(this.staticPos){this.noFocus=true;this.updateTable();this.noFocus=false;}if(this.fullCreate){if(elem.type&&elem.type!="hidden"&&!noFocus){elem.focus();}this.callback("dateselect",{id:this.id,date:this.dateSet,dd:d,mm:m,yyyy:yyyy});}}};datePicker.prototype.disableDatePicker=function(){if(this.disabled){return;}if(this.staticPos){this.removeFocusEvents();this.noFocus=true;this.div.className=this.div.className.replace(/dp-disabled/,"")+" dp-disabled";this.table.onmouseover=this.table.onclick=this.table.onmouseout=this.table.onmousedown=null;removeEvent(document,"mousedown",this.onmousedown);removeEvent(document,"mouseup",this.clearTimer);}else{if(this.visible){this.hide();}var but=document.getElementById("fd-but-"+this.id);if(but){but.className=but.className.replace(/dp-disabled/,"")+" dp-disabled";setARIAProperty(but,"disabled",true);but.onkeydown=but.onclick=function(){return false;};but.setAttribute(!
/*@cc_on!@*/
false?"tabIndex":"tabindex","-1");but.tabIndex=-1;}}clearTimeout(this.timer);this.disabled=true;};datePicker.prototype.enableDatePicker=function(){if(!this.disabled){return;}if(this.staticPos){this.removeOldFocus();this.noFocus=true;this.addSpans=true;this.updateTable();this.div.className=this.div.className.replace(/dp-disabled/,"");this.disabled=false;this.table.onmouseover=this.onmouseover;this.table.onmouseout=this.onmouseout;this.table.onclick=this.onclick;this.table.onmousedown=this.onmousedown;}else{var but=document.getElementById("fd-but-"+this.id);if(but){but.className=but.className.replace(/dp-disabled/,"");setARIAProperty(but,"disabled",false);this.addButtonEvents(but);}}this.disabled=false;};datePicker.prototype.disableTodayButton=function(){var today=new Date();this.butToday.className=this.butToday.className.replace("fd-disabled","");if(this.outOfRange(today)||(this.date.getDate()==today.getDate()&&this.date.getMonth()==today.getMonth()&&this.date.getFullYear()==today.getFullYear())){this.butToday.className+=" fd-disabled";}};datePicker.prototype.updateTableHeaders=function(){var colspanTotal=this.showWeeks?8:7,colOffset=this.showWeeks?1:0,d,but;for(var col=colOffset;col<colspanTotal;col++){d=(this.firstDayOfWeek+(col-colOffset))%7;this.ths[col].title=getDayTranslation(d,false);if(col>colOffset){but=this.ths[col].getElementsByTagName("span")[0];while(but.firstChild){but.removeChild(but.firstChild);}but.appendChild(document.createTextNode(getDayTranslation(d,true)));but.title=this.ths[col].title;but.className=but.className.replace(/day-([0-6])/,"")+" day-"+d;but=null;}else{while(this.ths[col].firstChild){this.ths[col].removeChild(this.ths[col].firstChild);}this.ths[col].appendChild(document.createTextNode(getDayTranslation(d,true)));}this.ths[col].className=this.ths[col].className.replace(/date-picker-highlight/g,"");if(this.highlightDays[d]){this.ths[col].className+=" date-picker-highlight";}}if(this.created){this.updateTable();}};datePicker.prototype.callback=function(type,args){if(!type||!(type in this.callbacks)){return false;}var ret=false;for(var func=0;func<this.callbacks[type].length;func++){ret=this.callbacks[type][func](args||this.id);if(!ret){return false;}}return ret;};datePicker.prototype.showHideButtons=function(tmpDate){var tdm=tmpDate.getMonth(),tdy=tmpDate.getFullYear();this.butPrevYear.className=this.butPrevYear.className.replace("fd-disabled","");if(this.outOfRange(new Date((tdy-1),tdm,daysInMonth(+tdm,tdy-1)))){this.butPrevYear.className+=" fd-disabled";if(this.yearInc==-1){this.stopTimer();}}this.butPrevMonth.className=this.butPrevMonth.className.replace("fd-disabled","");if(this.outOfRange(new Date(tdy,(+tdm-1),daysInMonth(+tdm-1,tdy)))){this.butPrevMonth.className+=" fd-disabled";if(this.monthInc==-1){this.stopTimer();}}this.butNextYear.className=this.butNextYear.className.replace("fd-disabled","");if(this.outOfRange(new Date((tdy+1),+tdm,1))){this.butNextYear.className+=" fd-disabled";if(this.yearInc==1){this.stopTimer();}}this.butNextMonth.className=this.butNextMonth.className.replace("fd-disabled","");if(this.outOfRange(new Date(tdy,+tdm+1,1))){this.butNextMonth.className+=" fd-disabled";if(this.monthInc==1){this.stopTimer();}}};var localeDefaults={fullMonths:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],monthAbbrs:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],fullDays:["Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],dayAbbrs:["Man","Tir","Ons","Tor","Fre","Lør","Søn"],titles:["Forrige Måned","Neste Måned","Forrige År","Neste År","I Dag","","Uke","Uke [[%0%]] av [[%1%]]","Uke","Velg en dato","Klikk \u0026 Dra For Å Flytte","Vis \u201C[[%0%]]\u201D Første","Gå Til I Dag\u2019s Dato","Deaktivert Dato"],firstDayOfWeek:0,imported:false};var grepRangeLimits=function(sel){var range=[];for(var i=0;i<sel.options.length;i++){if(sel.options[i].value.search(/^\d\d\d\d$/)==-1){continue;}if(!range[0]||Number(sel.options[i].value)<range[0]){range[0]=Number(sel.options[i].value);}if(!range[1]||Number(sel.options[i].value)>range[1]){range[1]=Number(sel.options[i].value);}}return range;};var joinNodeLists=function(){if(!arguments.length){return[];}var nodeList=[];for(var i=0;i<arguments.length;i++){for(var j=0,item;item=arguments[i][j];j++){nodeList[nodeList.length]=item;}}return nodeList;};var cleanUp=function(){var dp;for(dp in datePickers){if(!document.getElementById(datePickers[dp].id)){datePickers[dp].destroy();datePickers[dp]=null;delete datePickers[dp];}}};var hideAll=function(exception){var dp;for(dp in datePickers){if(!datePickers[dp].created||(exception&&exception==datePickers[dp].id)){continue;}datePickers[dp].hide();}};var hideDatePicker=function(inpID){if(inpID in datePickers){if(!datePickers[inpID].created||datePickers[inpID].staticPos){return;}datePickers[inpID].hide();}};var showDatePicker=function(inpID,autoFocus){if(!(inpID in datePickers)){return false;}datePickers[inpID].show(autoFocus);return true;};var destroy=function(){for(dp in datePickers){datePickers[dp].destroy();datePickers[dp]=null;delete datePickers[dp];}datePickers=null;removeEvent(window,"load",datePickerController.create);removeEvent(window,"unload",datePickerController.destroy);};var destroySingleDatePicker=function(id){if(id&&(id in datePickers)){datePickers[id].destroy();datePickers[id]=null;delete datePickers[id];}};var getTitleTranslation=function(num,replacements){replacements=replacements||[];if(localeImport.titles.length>num){var txt=localeImport.titles[num];if(replacements&&replacements.length){for(var i=0;i<replacements.length;i++){txt=txt.replace("[[%"+i+"%]]",replacements[i]);}}return txt.replace(/[[%(\d)%]]/g,"");}return"";};var getDayTranslation=function(day,abbreviation){var titles=localeImport[abbreviation?"dayAbbrs":"fullDays"];return titles.length&&titles.length>day?titles[day]:"";};var getMonthTranslation=function(month,abbreviation){var titles=localeImport[abbreviation?"monthAbbrs":"fullMonths"];return titles.length&&titles.length>month?titles[month]:"";};var daysInMonth=function(nMonth,nYear){nMonth=(nMonth+12)%12;return(((0==(nYear%4))&&((0!=(nYear%100))||(0==(nYear%400))))&&nMonth==1)?29:[31,28,31,30,31,30,31,31,30,31,30,31][nMonth];};var getWeeksInYear=function(Y){if(Y in weeksInYearCache){return weeksInYearCache[Y];}var X1,X2,NW;with(X1=new Date(Y,0,4)){setDate(getDate()-(6+getDay())%7);}with(X2=new Date(Y,11,28)){setDate(getDate()+(7-getDay())%7);}weeksInYearCache[Y]=Math.round((X2-X1)/604800000);return weeksInYearCache[Y];};var parseRangeFromString=function(str){if(!str){return"";}var low=str.search(/^range-low-/)!=-1;str=str.replace(/range-(low|high)-/,"");if(str.search(/^(\d\d\d\d)(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$/)!=-1){return str;}var tmpDate=new Date();if(str.search(/^today$/)!=-1){return tmpDate.getFullYear()+pad(tmpDate.getMonth()+1)+pad(tmpDate.getDate());}var regExp=/^(\d)-(day|week|month|year)$/;if(str.search(regExp)!=-1){var parts=str.match(regExp),acc={day:0,week:0,month:0,year:0};acc[parts[2]]=low?-(+parts[1]):+parts[1];tmpDate.setFullYear(tmpDate.getFullYear()+ +acc.year);tmpDate.setMonth(tmpDate.getMonth()+ +acc.month);tmpDate.setDate(tmpDate.getDate()+ +acc.day+(7*+acc.week));return !tmpDate||isNaN(tmpDate)?"":tmpDate.getFullYear()+pad(tmpDate.getMonth()+1)+pad(tmpDate.getDate());}return"";};var getWeekNumber=function(y,m,d){var d=new Date(y,m,d,0,0,0);var DoW=d.getDay();d.setDate(d.getDate()-(DoW+6)%7+3);var ms=d.valueOf();d.setMonth(0);d.setDate(4);return Math.round((ms-d.valueOf())/(7*86400000))+1;};var printFormattedDate=function(date,fmt,useImportedLocale){if(!date||isNaN(date)){return"";}var parts=fmt.split("-"),str=[],d=date.getDate(),D=date.getDay(),m=date.getMonth(),y=date.getFullYear(),flags={sp:" ",dt:".",sl:"/",ds:"-",cc:",",d:pad(d),D:useImportedLocale?localeImport.dayAbbrs[D==0?6:D-1]:localeDefaults.dayAbbrs[D==0?6:D-1],l:useImportedLocale?localeImport.fullDays[D==0?6:D-1]:localeDefaults.fullDays[D==0?6:D-1],j:d,N:D==0?7:D,w:D,W:getWeekNumber(date),M:useImportedLocale?localeImport.monthAbbrs[m]:localeDefaults.monthAbbrs[m],F:useImportedLocale?localeImport.fullMonths[m]:localeDefaults.fullMonths[m],m:pad(m+1),n:m+1,t:daysInMonth(m+1,y),Y:y,o:y,y:String(y).substr(2,2),S:["th","st","nd","rd"][d%10>3?0:(d%100-d%10!=10)*d%10]};for(var pt=0,part;part=parts[pt];pt++){str.push(!(part in flags)?"":flags[part]);}return str.join("");};var parseDateString=function(str,fmt){var d=false,m=false,y=false,now=new Date(),parts=fmt.replace(/-sp(-sp)+/g,"-sp").split("-"),divds={dt:".",sl:"/",ds:"-",cc:","};loopLabel:for(var pt=0,part;part=parts[pt];pt++){if(str.length==0){return false;}switch(part){case"sp":if(str.charAt(0).search(/\s/)!=-1){while(str.charAt(0).search(/\s/)!=-1){str=str.substr(1);}break;}else{return"";}case"dt":case"sl":case"ds":case"cc":if(str.charAt(0)==divds[part]){str=str.substr(1);break;}else{return"";}case"d":case"j":if(str.search(/^(3[01]|[12][0-9]|0?[1-9])/)!=-1){d=+str.match(/^(3[01]|[12][0-9]|0?[1-9])/)[0];str=str.substr(str.match(/^(3[01]|[12][0-9]|0?[1-9])/)[0].length);break;}else{return"";}case"D":case"l":l=part=="D"?localeDefaults.dayAbbrs:localeDefaults.fullDays;for(var i=0;i<7;i++){if(new RegExp("^"+l[i],"i").test(str)){str=str.substr(l[i].length);continue loopLabel;}}return"";case"N":case"w":if(str.search(part=="N"?/^([1-7])/:/^([0-6])/)!=-1){str=str.substr(1);break;}else{return"";}case"S":if(str.search(/^(st|nd|rd|th)/i)!=-1){str=str.substr(2);break;}else{return"";}case"z":if(str.search(/^([0-9]|[1-9][0-9]|[12][0-9]{2}|3[0-5][0-9]|36[0-5])/)!=-1){str=str.substr(str.match(/^([0-9]|[1-9][0-9]|[12][0-9]{2}|3[0-5][0-9]|36[0-5])/)[0].length);break;}else{return"";}case"W":if(str.search(/^([1-9]|[1234[0-9]|5[0-3])/)!=-1){str=str.substr(str.match(/^([1-9]|[1234[0-9]|5[0-3])/)[0].length);break;}else{return"";}case"M":case"F":l=localeDefaults.fullMonths.concat(localeDefaults.monthAbbrs);for(var i=0;i<24;i++){if(str.search(new RegExp("^"+l[i],"i"))!=-1){str=str.substr(l[i].length);m=((i+12)%12);continue loopLabel;}}return"";case"m":case"n":l=/^(1[012]|0?[1-9])/;if(str.search(l)!=-1){m=+str.match(l)[0]-1;str=str.substr(str.match(l)[0].length);break;}else{return"";}case"t":if(str.search(/2[89]|3[01]/)!=-1){str=str.substr(2);break;}else{return"";}case"Y":case"o":if(str.search(/^(\d{4})/)!=-1){y=str.substr(0,4);str=str.substr(4);break;}else{return"";}case"y":if(str.search(/^(\d{4})/)!=-1){y=str.substr(0,4);str=str.substr(4);break;}else{if(str.search(/^(0[0-9]|[1-9][0-9])/)!=-1){y=str.substr(0,2);y=+y<50?"20"+String(y):"19"+String(y);str=str.substr(2);break;}else{return"";}}default:return"";}}d=d===false?now.getDate():d;m=m===false?now.getMonth()-1:m;y=y===false?now.getFullYear():y;var tmpDate=new Date(y,m,d);return isNaN(tmpDate)?"":tmpDate;};var repositionDatePickers=function(e){for(dp in datePickers){if(!datePickers[dp].created||datePickers[dp].staticPos||(!datePickers[dp].staticPos&&!datePickers[dp].dragDisabled)){continue;}datePickers[dp].reposition();}};var findLabelForElement=function(element){var label;if(element.parentNode&&element.parentNode.tagName.toLowerCase()=="label"){lebel=element.parentNode;}else{var labelList=document.getElementsByTagName("label");for(var lbl=0;lbl<labelList.length;lbl++){if((labelList[lbl]["htmlFor"]&&labelList[lbl]["htmlFor"]==element.id)||(labelList[lbl].getAttribute("for")==element.id)){label=labelList[lbl];break;}}}if(label&&!label.id){label.id=element.id+"_label";}return label;};var addDatePicker=function(options){if(!options.id){throw"A datePicker requires an associated element with an id attribute";}if(options.id in datePickers){return;}var elem=document.getElementById(options.id);if(!elem){throw"Cannot locate a datePicker's associated form element with an id of: "+options.id;}if(elem.tagName.search(/select|input/i)==-1){if(!("callbacks" in options)||!("dateselect" in options.callbacks)){throw"A 'dateselect' callback function is required for datePickers not associated with a form element";}options.staticPos=true;options.splitDate=false;options.hideInput=false;options.noFadeEffect=true;options.dragDisabled=true;options.positioned=false;}else{if(!options.staticPos){options.hideInput=false;}else{options.noFadeEffect=true;options.dragDisabled=true;}}datePickers[options.id]=new datePicker(options);};var parseCallbacks=function(cbs){if(cbs==null){return{};}var func,type,cbObj={},parts,obj;for(var i=0,fn;fn=cbs[i];i++){type=fn.match(/(cb_(dateselect|redraw|create)_)([^\s|$]+)/i)[1].replace(/^cb_/i,"").replace(/_$/,"");fn=fn.replace(/cb_(dateselect|redraw|create)_/i,"").replace(/-/g,".");try{if(fn.indexOf(".")!=-1){parts=fn.split(".");obj=window;for(var x=0,part;part=obj[parts[x]];x++){if(part instanceof Function){(function(){var method=part;func=function(data){method.apply(obj,[data]);};})();}else{obj=part;}}}else{func=window[fn];}if(!(func instanceof Function)){continue;}if(!(type in cbObj)){cbObj[type]=[];}cbObj[type][cbObj[type].length]=func;}catch(err){}}return cbObj;};var isVisible=function(id){return(!id||!(id in datePickers))?false:datePickers[id].visible;};var create=function(inp){if(!(typeof document.createElement!="undefined"&&typeof document.documentElement!="undefined"&&typeof document.documentElement.offsetWidth=="number")){return;}if(typeof(fdLocale)=="object"&&!localeImport){localeImport={titles:fdLocale.titles,fullMonths:fdLocale.fullMonths,monthAbbrs:fdLocale.monthAbbrs,fullDays:fdLocale.fullDays,dayAbbrs:fdLocale.dayAbbrs,firstDayOfWeek:("firstDayOfWeek" in fdLocale)?fdLocale.firstDayOfWeek:0,imported:true};}else{if(!localeImport){localeImport=localeDefaults;}}var formElements=(inp&&inp.tagName)?[inp]:joinNodeLists(document.getElementsByTagName("input"),document.getElementsByTagName("select")),disableDays=/disable-days-([1-7]){1,6}/g,highlight=/highlight-days-([1-7]{1,7})/,rangeLow=/range-low-(((\d\d\d\d)(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01]))|((\d)-(day|week|month|year))|(today))/,rangeHigh=/range-high-(((\d\d\d\d)(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01]))|((\d)-(day|week|month|year))|(today))/,dateFormat=/dateformat(-((sp|dt|sl|ds|cc)|([d|D|l|j|N|w|S|W|M|F|m|n|t|Y|o|y|O|p])))+/,statusFormat=/statusformat(-((sp|dt|sl|ds|cc)|([d|D|l|j|N|w|S|W|M|F|m|n|t|Y|o|y|O|p])))+/,disableDates=/disable((-(\d\d\d\d)(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])){2}|(-((\d\d\d\d)|(xxxx))((0[1-9]|1[012])|(xx))(0[1-9]|[12][0-9]|3[01])))/g,enableDates=/enable((-(\d\d\d\d)(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])){2}|(-((\d\d\d\d)|(xxxx))((0[1-9]|1[012])|(xx))(0[1-9]|[12][0-9]|3[01])))/g,callbacks=/((cb_(dateselect|redraw|create)_)([^\s|$]+))/ig,positioned=/display-inline-([^\s|$]+)/i,bPositioned=/button-([^\s|$]+)/i,range,tmp,j,t,options,dts,parts;for(var i=0,elem;elem=formElements[i];i++){if(elem.className&&(elem.className.search(dateFormat)!=-1||elem.className.search(/split-date/)!=-1)&&((elem.tagName.toLowerCase()=="input"&&(elem.type=="text"||elem.type=="hidden"))||elem.tagName.toLowerCase()=="select")){if(elem.id&&elem.id in datePickers){if(!datePickers[elem.id].staticPos){datePickers[elem.id].createButton();}else{if(!document.getElementById("fd-"+elem.id)){datePickers[elem.id].created=false;datePickers[elem.id].create();}else{if(inp){datePickers[elem.id].setDateFromInput();datePickers[elem.id].updateTable();}}}continue;}if(!elem.id){elem.id="fdDatePickerInput-"+uniqueId++;}options={id:elem.id,low:"",high:"",format:"d-sl-m-sl-Y",statusFormat:"",highlightDays:[0,0,0,0,0,1,1],disabledDays:[0,0,0,0,0,0,0],disabledDates:{},enabledDates:{},noFadeEffect:elem.className.search(/no-animation/i)!=-1,staticPos:elem.className.search(/display-inline/i)!=-1,hideInput:elem.className.search(/hide-input/i)!=-1,noToday:elem.className.search(/no-today-button/i)!=-1,showWeeks:elem.className.search(/show-week/i)!=-1,dragDisabled:nodrag?true:elem.className.search(/disable-drag/i)!=-1,positioned:false,firstDayOfWeek:localeImport.firstDayOfWeek,fillGrid:elem.className.search(/fill-grid/i)!=-1,constrainSelection:elem.className.search(/fill-grid-no-select/i)!=-1,callbacks:parseCallbacks(elem.className.match(callbacks)),buttonWrapper:"",labelledBy:findLabelForElement(elem)};if(options.staticPos&&elem.className.search(positioned)!=-1){options.positioned=elem.className.match(positioned)[1];}if(!options.staticPos&&elem.className.search(bPositioned)!=-1){options.buttonWrapper=elem.className.match(bPositioned)[1];}if(!options.staticPos){options.finalOpacity=elem.className.search(/opacity-([1-9]{1}[0-9]{1})/i)!=-1?elem.className.match(/opacity-([1-9]{1}[0-9]{1})/i)[1]:90;}dts=elem.className.match(disableDates);if(dts){for(t=0;t<dts.length;t++){parts=dts[t].replace(/xxxx/,"****").replace(/xx/,"**").replace("disable-","").split("-");options.disabledDates[parts[0]]=(parts.length&&parts.length==2)?parts[1]:1;}}dts=elem.className.match(enableDates);if(dts){for(t=0;t<dts.length;t++){parts=dts[t].replace(/xxxx/,"****").replace(/xx/,"**").replace("enable-","").split("-");options.enabledDates[parts[0]]=(parts.length&&parts.length==2)?parts[1]:1;}}options.splitDate=(elem.className.search(/split-date/)!=-1&&document.getElementById(elem.id+splitAppend[0])&&document.getElementById(elem.id+splitAppend[1])&&document.getElementById(elem.id+splitAppend[0]).tagName.search(/input|select/i)!=-1&&document.getElementById(elem.id+splitAppend[1]).tagName.search(/input|select/i)!=-1);if(!options.splitDate&&elem.className.search(dateFormat)!=-1){options.format=elem.className.match(dateFormat)[0].replace("dateformat-","");}if(elem.className.search(statusFormat)!=-1){options.statusFormat=elem.className.match(statusFormat)[0].replace("statusformat-","");}if(elem.className.search(highlight)!=-1){tmp=elem.className.match(highlight)[0].replace(/highlight-days-/,"");options.highlightDays=[0,0,0,0,0,0,0];for(j=0;j<tmp.length;j++){options.highlightDays[tmp.charAt(j)-1]=1;}}if(elem.className.search(disableDays)!=-1){tmp=elem.className.match(disableDays)[0].replace(/disable-days-/,"");options.disabledDays=[0,0,0,0,0,0,0];for(j=0;j<tmp.length;j++){options.disabledDays[tmp.charAt(j)-1]=1;}}if(elem.className.search(rangeLow)!=-1){options.low=parseRangeFromString(elem.className.match(rangeLow)[0]);}if(elem.className.search(rangeHigh)!=-1){options.high=parseRangeFromString(elem.className.match(rangeHigh)[0]);}if(elem.tagName.search(/select/i)!=-1){range=grepRangeLimits(elem);options.low=options.low?range[0]+String(options.low).substr(4,4):range[0]+"0101";options.high=options.high?range[1]+String(options.high).substr(4,4):range[1]+"1231";}addDatePicker(options);}}};addEvent(window,"load",create);addEvent(window,"unload",destroy);addEvent(window,"resize",repositionDatePickers);return{addEvent:function(obj,type,fn){return addEvent(obj,type,fn);},removeEvent:function(obj,type,fn){return removeEvent(obj,type,fn);},stopEvent:function(e){return stopEvent(e);},show:function(inpID){return showDatePicker(inpID,false);},hide:function(inpID){return hideDatePicker(inpID);},create:function(inp){create(inp);},destroyDatePicker:function(inpID){destroySingleDatePicker(inpID);},cleanUp:function(){cleanUp();},repositionDatePickers:function(){repositionDatePickers();},printFormattedDate:function(dt,fmt,useImportedLocale){return printFormattedDate(dt,fmt,useImportedLocale);},setDateFromInput:function(inpID){if(!inpID||!(inpID in datePickers)||!datePickers[inpID].created){return false;}datePickers[inpID].setDateFromInput();},setRangeLow:function(inpID,yyyymmdd){if(!inpID||!(inpID in datePickers)){return false;}datePickers[inpID].setRangeLow(yyyymmdd);},setRangeHigh:function(inpID,yyyymmdd){if(!inpID||!(inpID in datePickers)){return false;}datePickers[inpID].setRangeHigh(yyyymmdd);},parseDateString:function(str,format){return parseDateString(str,format);},setGlobalVars:function(json){affectJSON(json);},dateValidForSelection:function(inpID,dt){if(!inpID||!(inpID in datePickers)){return false;}datePickers[inpID].canDateBeSelected(dt);},addDisabledDates:function(inpID,dts){if(!inpID||!(inpID in datePickers)){return false;}datePickers[inpID].addDisabledDates(dts);},setDisabledDates:function(inpID,dts){if(!inpID||!(inpID in datePickers)){return false;}datePickers[inpID].setDisabledDates(dts);},disable:function(inpID){if(!inpID||!(inpID in datePickers)){return false;}datePickers[inpID].disableDatePicker();},enable:function(inpID){if(!inpID||!(inpID in datePickers)){return false;}datePickers[inpID].enableDatePicker();}};})();
