function _KeyotiFilterControlInit(n,t,i,r){var f,u;if(n.ksqControlElement=t,n.filter=i,n.ksqControlElement.empty(),typeof i.definition.OptionLabelFormat!="undefined")for(u=0;u<i.definition.Options.length;u++)f=i.getRequestDefinition([i.definition.Options[u].value]),i.definition.Options[u].label=String._KeyotiFormat(i.definition.OptionLabelFormat,f[0][0],f[0][1]);else for(u=0;u<i.definition.Options.length;u++)i.definition.Options[u].label=i.definition.Options[u].value;n.ksqControlElement.kjson2html(i.definition,r);n.isGetLiveDataFromServer=function(){return typeof this.filter.definition.GetLiveDataFromServer!="undefined"&&this.filter.definition.GetLiveDataFromServer.toLowerCase()=="true"}}function KeyotiCalendarRangeFilterControl(n,t){this.filterTransform={tag:"div",html:'<!--${controlDefinition}-->${Label}<br/><input type="text" class="sew_filterFromDate" size="10" /> to <input type="text" class="sew_filterToDate" size="10" />'};_KeyotiFilterControlInit(this,n,t,this.filterTransform);var i={changeFirstDay:!1,prevText:"<",nextText:">",onSelect:function(){keyotiSearch.onFilterChange()}};t.definition.Options.length>0&&(i.minDate=t.definition.Options[0].toLowerCase()=="today"?Date.now():KSQ.datepicker.parseDate("yy-mm-dd",t.definition.Options[0]));t.definition.Options.length==2&&(i.maxDate=t.definition.Options[1].toLowerCase()=="today"?"0":KSQ.datepicker.parseDate("yy-mm-dd",t.definition.Options[1]));KSQ(".sew_filterFromDate",t.control).datepicker(i);KSQ(".sew_filterToDate",t.control).datepicker(i);this.isFilterUsed=function(){var n=KSQ.datepicker.formatDate("yy-mm-dd",KSQ(".sew_filterFromDate",this.ksqControlElement).datepicker("getDate")),t=KSQ.datepicker.formatDate("yy-mm-dd",KSQ(".sew_filterToDate",this.ksqControlElement).datepicker("getDate"));return n!=null&&n.length>0||t!=null&&t.length>0||this.isGetLiveDataFromServer()};this.getRequestFilter=function(){var n=KSQ.datepicker.formatDate("yy-mm-dd",KSQ(".sew_filterFromDate",this.ksqControlElement).datepicker("getDate")),i=KSQ.datepicker.formatDate("yy-mm-dd",KSQ(".sew_filterToDate",this.ksqControlElement).datepicker("getDate"));return{Type:this.filter.definition.Type,Filter:t.getRequestDefinition([n,i]),FieldName:this.filter.definition.FieldName,NeedLiveData:this.isGetLiveDataFromServer()}};this.setSelectedValues=function(n){if(typeof n!="undefined"&&n!=null){var t=KSQ.datepicker.parseDate("yy-mm-dd",n.Filter[0][0]),i=KSQ.datepicker.parseDate("yy-mm-dd",n.Filter[0][1]);KSQ(".sew_filterFromDate",this.ksqControlElement).datepicker("setDate",t);KSQ(".sew_filterToDate",this.ksqControlElement).datepicker("setDate",i)}else KSQ(".sew_filterFromDate",this.ksqControlElement).datepicker("setDate",""),KSQ(".sew_filterToDate",this.ksqControlElement).datepicker("setDate","")};this.updateWithLiveData=function(){}}function KeyotiCheckboxesFilterControl(n,t){this.filterTransform={tag:"div",html:"<!--${controlDefinition}-->${Label}<br/>",children:function(){return kjson2html.transform(this.Options,{tag:"span",html:'<label><input type="checkbox" value="${value}"/>${label}<\/label><br/>'})}};_KeyotiFilterControlInit(this,n,t,this.filterTransform);n.bind(KSQ.browser.msie?"click":"change",function(){keyotiSearch.onFilterChange()});this.isFilterUsed=function(){var n=KSQ("input:checked",this.ksqControlElement);return n!=null&&n.length>0||this.isGetLiveDataFromServer()};this.getRequestFilter=function(){for(var t=KSQ("input:checked",this.ksqControlElement),i=[],n=0;n<t.length;n++)i[n]=t[n].value;return{Type:this.filter.definition.Type,Filter:this.filter.getRequestDefinition(i),FieldName:this.filter.definition.FieldName,NeedLiveData:this.isGetLiveDataFromServer()}};this.setSelectedValues=function(n){function r(n,t){for(var i=0;i<n.Filter.length;i++)if(n.Filter[i][0]==t)return!0;return!1}var i,t;if(typeof n!="undefined")for(i=KSQ("input[type=checkbox]",this.ksqControlElement),t=0;t<i.length;t++)i[t].checked=n!=null&&r(n,i[t].value)};this.updateWithLiveData=function(t){var u=KSQ("input:checked",this.ksqControlElement),r,i;if(u.length==0){for(typeof this.filter.preprocessDataSample=="function"&&(t=this.filter.preprocessDataSample(t)),r=[],i=0;i<t.length;i++)r[i]={value:t[i]};this.filter.definition.Options=r;_KeyotiFilterControlInit(this,n,this.filter,this.filterTransform)}}}function KeyotiCheckboxesIntRangeFilterControl(n,t){this.base=new KeyotiCheckboxesFilterControl(n,t);this.filterTransform=this.base.filterTransform;this.isFilterUsed=this.base.isFilterUsed;this.getRequestFilter=this.base.getRequestFilter;this.setSelectedValues=function(n){function r(n,t){for(var i=0;i<n.Filter.length;i++)if(n.Filter[i][0]+"-"+n.Filter[i][1]==t)return!0;return!1}var i,t;if(typeof n!="undefined")for(i=KSQ("input[type=checkbox]",this.ksqControlElement),t=0;t<i.length;t++)i[t].checked=n!=null&&r(n,i[t].value)};this.filter=this.base.filter;this.ksqControlElement=this.base.ksqControlElement;this.isGetLiveDataFromServer=this.base.isGetLiveDataFromServer;this.isValueInRange=function(n,t){var i=t.split("-"),r=parseInt(n);return parseInt(i[0])<=r&&r<parseInt(i[1])?!0:!1};this.updateWithLiveData=function(t){var f=KSQ("input:checked",this.ksqControlElement),i,u,r;if(f.length==0){for(typeof this.filter.preprocessDataSample=="function"&&(t=this.filter.preprocessDataSample(t)),this.filter.definition.Options=this.filter.definition.OriginalOptions.slice(),i=0;i<this.filter.definition.Options.length;i++){for(u=!1,r=0;r<t.length;r++)this.isValueInRange(t[r],this.filter.definition.Options[i].value)&&(u=!0);u||(this.base.filter.definition.Options.splice(i,1),i--)}_KeyotiFilterControlInit(this,n,this.base.filter,this.base.filterTransform)}}}function KeyotiTextboxesIntRangeFilterControl(n,t){this.filterTransform={tag:"div",html:'<!--${controlDefinition}-->${Label} <input type="text" size="2" /> - <input type="text" size="2" />'};_KeyotiFilterControlInit(this,n,t,this.filterTransform);n.bind(KSQ.browser.msie?"click":"change",function(){keyotiSearch.onFilterChange()});this.isFilterUsed=function(){var n=KSQ("input[type=text]",this.ksqControlElement).val();return n!=null&&n.length>0||this.isGetLiveDataFromServer()};this.getRequestFilter=function(){for(var t=KSQ("input[type=text]",this.ksqControlElement),i=[],n=0;n<t.length;n++)i[n]=t[n].value;return{Type:this.filter.definition.Type,Filter:this.filter.getRequestDefinition(i),FieldName:this.filter.definition.FieldName,NeedLiveData:this.isGetLiveDataFromServer()}};this.setSelectedValues=function(n){var t=KSQ("input[type=text]",this.ksqControlElement);n==null?(t[0].value="",t[1].value=""):n.Filter.length>0&&(t[0].value=n.Filter[0][0],t[1].value=n.Filter[0][1])};this.updateWithLiveData=function(){}}function KeyotiDropdownFilterControl(n,t){this.defaultEntry=" ";t.definition.Options.splice(0,0,this.defaultEntry);this.filterTransform={tag:"div",html:"<!--${controlDefinition}-->${Label}<br/>",children:function(){return"<select>"+kjson2html.transform(this.Options,{tag:"",html:'<option value="${value}">${value}<\/option>'})+"<\/select>"}};_KeyotiFilterControlInit(this,n,t,this.filterTransform);n.bind(KSQ.browser.msie?"click":"change",function(){keyotiSearch.onFilterChange()});this.isFilterUsed=function(){var n=KSQ("select",this.ksqControlElement).val();return n!=null&&n.length>0||this.isGetLiveDataFromServer()};this.getRequestFilter=function(){var n=KSQ("select",this.ksqControlElement).val();return{Type:this.filter.definition.Type,Filter:t.getRequestDefinition([n,n]),FieldName:this.filter.definition.FieldName,NeedLiveData:this.isGetLiveDataFromServer()}};this.setSelectedValues=function(n){typeof n!="undefined"&&n!=null?KSQ("select",this.ksqControlElement).val(n.Filter[0][0]):KSQ("select",this.ksqControlElement).val(this.defaultEntry)};this.updateWithLiveData=function(n){var t=KSQ("select",this.ksqControlElement).val(),i=!0,r=KSQ("select",this.ksqControlElement);(t==null||t.length==0||t==this.defaultEntry)&&(typeof this.filter.preprocessDataSample=="function"&&(n=this.filter.preprocessDataSample(n)),KSQ("select option:gt(0)",this.ksqControlElement).remove(),i=!1,KSQ.each(n,function(n,u){u==t&&(i=!0);r.append(KSQ("<option><\/option>").attr("value",u).text(u))}));!i&&t!=null&&t.length>0&&t!=this.defaultEntry&&r.append(KSQ("<option><\/option>").attr("value",t).text(t));KSQ("select",this.ksqControlElement).val(t)}}function KeyotiIntFilter(n){this.definition=n;this.getRequestDefinition=function(n){for(var t=[],i=0;i<n.length;i++)typeof n[i]=="string"&&n[i].indexOf("-")>-1?t[t.length]=n[i].split("-"):(t[t.length]=[],t[t.length-1][0]=n[i],i+1<n.length&&(t[t.length-1][1]=n[++i]));return t}}function KeyotiDateFilter(n){this.definition=n;this.getRequestDefinition=function(n){return[[n[0],n[1]]]}}function KeyotiStringFilter(n){this.definition=n;this.getRequestDefinition=function(n){for(var t=0;t<n.length;t++)n[t]=[n[t]];return n}}function KeyotiStringListFilter(n){this.definition=n;this.getRequestDefinition=function(n){for(var t=0;t<n.length;t++)n[t]=[n[t]];return n};this.preprocessDataSample=function(n){for(var u,r,i=[],t=0;t<n.length;t++)for(u=n[t].split(","),r=0;r<u.length;r++)i[i.length]=u[r];for(i.sort(),t=1;t<i.length;t++)i[t-1]==i[t]&&(i.splice(t,1),t--);return i}}function sew_copyComputedStyle(n,t,i){var u,r;if(t.currentStyle)u=t.currentStyle;else if(document.defaultView&&document.defaultView.getComputedStyle)u=document.defaultView.getComputedStyle(t,null);else return;for(sp in u)try{(sp.indexOf("font")>-1||sp.indexOf("text")>-1||sp=="color"&&i!="nocolor")&&(r=sew_getStyleProperty(t,sp),sp=="color"&&keyotiSearchAutocomplete.sew_OC[t.id]!=null&&(r=keyotiSearchAutocomplete.sew_OC[t.id]),typeof r!="undefined"&&r!=""&&n.css(sp,r))}catch(f){}}function sew_getStyleProperty(n,t){return n.currentStyle?n.currentStyle[t]:document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(n,null)[t]:null}function sew_toggleResultPreview(n,t,i,r){sew_currentPreviewDIV=KSQ(n).next();n.sew_opened==!0?(sew_currentPreviewDIV.hide("fast"),n.src=i,n.sew_opened=!1):(n.src=r,n.sew_opened=!0,sew_currentPreviewDIV.show("slow"),KSQ.get(sew_appPath+"Keyoti.SearchEngine.Web.CallBackHandler.ashx?cl=SRP&u="+encodeURIComponent(t)+"&id="+encodeURIComponent(sew_indexDirectory)+"&p="+(sew_previewLoadPlugin?"1":"0")+"&mx="+sew_maxCharLength,function(u){var f,e;if(sew_currentPreviewDIV!=null){for(typeof sew_OnResultPreviewTextLoaded=="function"&&(dataOut=sew_OnResultPreviewTextLoaded(t,u,n,i,r),dataOut!=null&&(u=dataOut)),f=u.replace(/</g,"&lt;"),f=f.replace(/>/g,"&gt;"),f=f.replace(/\n/g,"<br /><br />"),e=0;e<sew_keywords.length;e++)f=f.replace(new RegExp("\\b("+sew_keywords[e]+")\\b","gi"),sew_keyword_highlightPattern.replace("{0}","$1"));sew_currentPreviewDIV.html(f);sew_currentPreviewDIV=null}}))}var keyotiSearchResultPreviewer,kjson2html,keyotiSearchHighlighter,sew_highlighterOldOnLoad;(function(){function w(n,t){t.src?KSQ.ajax({url:t.src,async:!1,dataType:"script"}):KSQ.globalEval(t.text||t.textContent||t.innerHTML||"");t.parentNode&&t.parentNode.removeChild(t)}function r(){return+new Date}function i(n,t){return n[0]&&parseInt(KSQ.curCSS(n[0],t,!0),10)||0}function a(){if(!s){if(s=!0,document.addEventListener&&!KSQ.browser.opera&&document.addEventListener("DOMContentLoaded",KSQ.ready,!1),KSQ.browser.msie&&window==top&&function(){if(!KSQ.isReady){try{document.documentElement.doScroll("left")}catch(n){setTimeout(arguments.callee,0);return}KSQ.ready()}}(),KSQ.browser.opera&&document.addEventListener("DOMContentLoaded",function(){if(!KSQ.isReady){for(var n=0;n<document.styleSheets.length;n++)if(document.styleSheets[n].disabled){setTimeout(arguments.callee,0);return}KSQ.ready()}},!1),KSQ.browser.safari){var t;(function(){if(!KSQ.isReady){if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return}if(t===n&&(t=KSQ("style, link[rel=stylesheet]").length),document.styleSheets.length!=t){setTimeout(arguments.callee,0);return}KSQ.ready()}})()}KSQ.event.add(window,"load",KSQ.ready)}}var y=window.KSQ,KSQ=window.KSQ=function(n,t){return new KSQ.fn.init(n,t)},p=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,c=/^.[^:#\[\.]*$/,n,userAgent,f,s,h,v,u;KSQ.fn=KSQ.prototype={init:function(n,t){var i,r;if(n=n||document,n.nodeType)return this[0]=n,this.length=1,this;if(typeof n=="string")if(i=p.exec(n),i&&(i[1]||!t))if(i[1])n=KSQ.clean([i[1]],t);else{if(r=document.getElementById(i[3]),r)return r.id!=i[3]?KSQ().find(n):KSQ(r);n=[]}else return KSQ(t).find(n);else if(KSQ.isFunction(n))return KSQ(document)[KSQ.fn.ready?"ready":"load"](n);return this.setArray(KSQ.makeArray(n))},KSQ:"1.2.6",size:function(){return this.length},length:0,get:function(t){return t==n?KSQ.makeArray(this):this[t]},pushStack:function(n){var t=KSQ(n);return t.prevObject=this,t},setArray:function(n){return this.length=0,Array.prototype.push.apply(this,n),this},each:function(n,t){return KSQ.each(this,n,t)},index:function(n){return KSQ.inArray(n&&n.KSQ?n[0]:n,this)},attr:function(t,i,r){var u=t;if(t.constructor==String){if(i===n)return this[0]&&KSQ[r||"attr"](this[0],t);u={};u[t]=i}return this.each(function(n){for(t in u)KSQ.attr(r?this.style:this,t,KSQ.prop(this,u[t],r,n,t))})},css:function(t,i){return(t=="width"||t=="height")&&parseFloat(i)<0&&(i=n),this.attr(t,i,"curCSS")},text:function(n){if(typeof n!="object"&&n!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(n));var t="";return KSQ.each(n||this,function(){KSQ.each(this.childNodes,function(){this.nodeType!=8&&(t+=this.nodeType!=1?this.nodeValue:KSQ.fn.text([this]))})}),t},wrapAll:function(n){return this[0]&&KSQ(n,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){for(var n=this;n.firstChild;)n=n.firstChild;return n}).append(this),this},wrapInner:function(n){return this.each(function(){KSQ(this).contents().wrapAll(n)})},wrap:function(n){return this.each(function(){KSQ(this).wrapAll(n)})},append:function(){return this.domManip(arguments,!0,!1,function(n){this.nodeType==1&&this.appendChild(n)})},prepend:function(){return this.domManip(arguments,!0,!0,function(n){this.nodeType==1&&this.insertBefore(n,this.firstChild)})},before:function(){return this.domManip(arguments,!1,!1,function(n){this.parentNode.insertBefore(n,this)})},after:function(){return this.domManip(arguments,!1,!0,function(n){this.parentNode.insertBefore(n,this.nextSibling)})},end:function(){return this.prevObject||KSQ([])},find:function(n){var t=KSQ.map(this,function(t){return KSQ.find(n,t)});return this.pushStack(/[^+>] [^+>]/.test(n)||n.indexOf("..")>-1?KSQ.unique(t):t)},clone:function(i){var r=this.map(function(){if(KSQ.browser.msie&&!KSQ.isXMLDoc(this)){var t=this.cloneNode(!0),n=document.createElement("div");return n.appendChild(t),KSQ.clean([n.innerHTML])[0]}return this.cloneNode(!0)}),u=r.find("*").andSelf().each(function(){this[t]!=n&&(this[t]=null)});return i===!0&&this.find("*").andSelf().each(function(n){var t,i,r;if(this.nodeType!=3){t=KSQ.data(this,"events");for(i in t)for(r in t[i])KSQ.event.add(u[n],i,t[i][r],t[i][r].data)}}),r},filter:function(n){return this.pushStack(KSQ.isFunction(n)&&KSQ.grep(this,function(t,i){return n.call(t,i)})||KSQ.multiFilter(n,this))},not:function(t){if(t.constructor==String){if(c.test(t))return this.pushStack(KSQ.multiFilter(t,this,!0));t=KSQ.multiFilter(t,this)}var i=t.length&&t[t.length-1]!==n&&!t.nodeType;return this.filter(function(){return i?KSQ.inArray(this,t)<0:this!=t})},add:function(n){return this.pushStack(KSQ.unique(KSQ.merge(this.get(),typeof n=="string"?KSQ(n):KSQ.makeArray(n))))},is:function(n){return!!n&&KSQ.multiFilter(n,this).length>0},hasClass:function(n){return this.is("."+n)},val:function(t){var i,u,h,r;if(t==n){if(this.length){if(i=this[0],KSQ.nodeName(i,"select")){var f=i.selectedIndex,o=[],s=i.options,e=i.type=="select-one";if(f<0)return null;for(u=e?f:0,h=e?f+1:s.length;u<h;u++)if(r=s[u],r.selected){if(t=KSQ.browser.msie&&!r.attributes.value.specified?r.text:r.value,e)return t;o.push(t)}return o}return(this[0].value||"").replace(/\r/g,"")}return n}return t.constructor==Number&&(t+=""),this.each(function(){if(this.nodeType==1)if(t.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=KSQ.inArray(this.value,t)>=0||KSQ.inArray(this.name,t)>=0;else if(KSQ.nodeName(this,"select")){var n=KSQ.makeArray(t);KSQ("option",this).each(function(){this.selected=KSQ.inArray(this.value,n)>=0||KSQ.inArray(this.text,n)>=0});n.length||(this.selectedIndex=-1)}else this.value=t})},html:function(t){return t==n?this[0]?this[0].innerHTML:null:this.empty().append(t)},replaceWith:function(n){return this.after(n).remove()},eq:function(n){return this.slice(n,n+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments))},map:function(n){return this.pushStack(KSQ.map(this,function(t,i){return n.call(t,i,t)}))},andSelf:function(){return this.add(this.prevObject)},data:function(t,i){var r=t.split("."),u;return r[1]=r[1]?"."+r[1]:"",i===n?(u=this.triggerHandler("getData"+r[1]+"!",[r[0]]),u===n&&this.length&&(u=KSQ.data(this[0],t)),u===n&&r[1]?this.data(r[0]):u):this.trigger("setData"+r[1]+"!",[r[0],i]).each(function(){KSQ.data(this,t,i)})},removeData:function(n){return this.each(function(){KSQ.removeData(this,n)})},domManip:function(n,t,i,r){var f=this.length>1,u;return this.each(function(){var o,e;u||(u=KSQ.clean(n,this.ownerDocument),i&&u.reverse());o=this;t&&KSQ.nodeName(this,"table")&&KSQ.nodeName(u[0],"tr")&&(o=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody")));e=KSQ([]);KSQ.each(u,function(){var n=f?KSQ(this).clone(!0)[0]:this;KSQ.nodeName(n,"script")?e=e.add(n):(n.nodeType==1&&(e=e.add(KSQ("script",n).remove())),r.call(o,n))});e.each(w)})}};KSQ.fn.init.prototype=KSQ.fn;KSQ.extend=KSQ.fn.extend=function(){var t=arguments[0]||{},r=1,o=arguments.length,f=!1,e,u,s,i;for(t.constructor==Boolean&&(f=t,t=arguments[1]||{},r=2),typeof t!="object"&&typeof t!="function"&&(t={}),o==r&&(t=this,--r);r<o;r++)if((e=arguments[r])!=null)for(u in e)(s=t[u],i=e[u],t!==i)&&(f&&i&&typeof i=="object"&&!i.nodeType?t[u]=KSQ.extend(f,s||(i.length!=null?[]:{}),i):i!==n&&(t[u]=i));return t};var t="KSQ"+r(),b=0,l={},k=/z-?index|font-?weight|opacity|zoom|line-?height/i,o=document.defaultView||{};KSQ.extend({noConflict:function(n){return window.$=_$,n&&(window.KSQ=y),KSQ},isFunction:function(n){return!!n&&typeof n!="string"&&!n.nodeName&&n.constructor!=Array&&/^[\s[]?function/.test(n+"")},isXMLDoc:function(n){return n.documentElement&&!n.body||n.tagName&&n.ownerDocument&&!n.ownerDocument.body},globalEval:function(n){if(n=KSQ.trim(n),n){var i=document.getElementsByTagName("head")[0]||document.documentElement,t=document.createElement("script");t.type="text/javascript";KSQ.browser.msie?t.text=n:t.appendChild(document.createTextNode(n));i.insertBefore(t,i.firstChild);i.removeChild(t)}},nodeName:function(n,t){return n.nodeName&&n.nodeName.toUpperCase()==t.toUpperCase()},cache:{},data:function(i,r,u){i=i==window?l:i;var f=i[t];return f||(f=i[t]=++b),r&&!KSQ.cache[f]&&(KSQ.cache[f]={}),u!==n&&(KSQ.cache[f][r]=u),r?KSQ.cache[f][r]:f},removeData:function(n,i){n=n==window?l:n;var r=n[t];if(i){if(KSQ.cache[r]){delete KSQ.cache[r][i];i="";for(i in KSQ.cache[r])break;i||KSQ.removeData(n)}}else{try{delete n[t]}catch(u){n.removeAttribute&&n.removeAttribute(t)}delete KSQ.cache[r]}},each:function(t,i,r){var u,f=0,e=t.length,o;if(r){if(e==n){for(u in t)if(i.apply(t[u],r)===!1)break}else for(;f<e;)if(i.apply(t[f++],r)===!1)break}else if(e==n){for(u in t)if(i.call(t[u],u,t[u])===!1)break}else for(o=t[0];f<e&&i.call(o,f,o)!==!1;o=t[++f]);return t},prop:function(n,t,i,r,u){return KSQ.isFunction(t)&&(t=t.call(n,r)),t&&t.constructor==Number&&i=="curCSS"&&!k.test(u)?t+"px":t},className:{add:function(n,t){KSQ.each((t||"").split(/\s+/),function(t,i){n.nodeType!=1||KSQ.className.has(n.className,i)||(n.className+=(n.className?" ":"")+i)})},remove:function(t,i){t.nodeType==1&&(t.className=i!=n?KSQ.grep(t.className.split(/\s+/),function(n){return!KSQ.className.has(i,n)}).join(" "):"")},has:function(n,t){return KSQ.inArray(t,(n.className||n).toString().split(/\s+/))>-1}},swap:function(n,t,i){var u={};for(var r in t)u[r]=n.style[r],n.style[r]=t[r];i.call(n);for(r in t)n.style[r]=u[r]},css:function(n,t,i){if(t=="width"||t=="height"){var r,f={position:"absolute",visibility:"hidden",display:"block"},e=t=="width"?["Left","Right"]:["Top","Bottom"];function u(){r=t=="width"?n.offsetWidth:n.offsetHeight;var i=0,u=0;KSQ.each(e,function(){i+=parseFloat(KSQ.curCSS(n,"padding"+this,!0))||0;u+=parseFloat(KSQ.curCSS(n,"border"+this+"Width",!0))||0});r-=Math.round(i+u)}return KSQ(n).is(":visible")?u():KSQ.swap(n,f,u),Math.max(0,r)}return KSQ.curCSS(n,t,i)},curCSS:function(n,t,i){function a(n){if(!KSQ.browser.safari)return!1;var t=o.getComputedStyle(n,null);return!t||t.getPropertyValue("color")==""}var r,e=n.style,v,h,y,p,w;if(t=="opacity"&&KSQ.browser.msie)return r=KSQ.attr(e,"opacity"),r==""?"1":r;if(KSQ.browser.opera&&t=="display"&&(v=e.outline,e.outline="0 solid black",e.outline=v),t.match(/float/i)&&(t=f),!i&&e&&e[t])r=e[t];else if(o.getComputedStyle){if(t.match(/float/i)&&(t="float"),t=t.replace(/([A-Z])/g,"-$1").toLowerCase(),h=o.getComputedStyle(n,null),h&&!a(n))r=h.getPropertyValue(t);else{for(var c=[],s=[],l=n,u=0;l&&a(l);l=l.parentNode)s.unshift(l);for(;u<s.length;u++)a(s[u])&&(c[u]=s[u].style.display,s[u].style.display="block");for(r=t=="display"&&c[s.length-1]!=null?"none":h&&h.getPropertyValue(t)||"",u=0;u<c.length;u++)c[u]!=null&&(s[u].style.display=c[u])}t=="opacity"&&r==""&&(r="1")}else n.currentStyle&&(y=t.replace(/\-(\w)/g,function(n,t){return t.toUpperCase()}),r=n.currentStyle[t]||n.currentStyle[y],!/^\d+(px)?$/i.test(r)&&/^\d/.test(r)&&(p=e.left,w=n.runtimeStyle.left,n.runtimeStyle.left=n.currentStyle.left,e.left=r||0,r=e.pixelLeft+"px",e.left=p,n.runtimeStyle.left=w));return r},clean:function(t,i){var r=[];return i=i||document,typeof i.createElement=="undefined"&&(i=i.ownerDocument||i[0]&&i[0].ownerDocument||document),KSQ.each(t,function(t,u){var s,o;if(u){if(u.constructor==Number&&(u+=""),typeof u=="string"){u=u.replace(/(<(\w+)[^>]*?)\/>/g,function(n,t,i){return i.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?n:t+"><\/"+i+">"});var f=KSQ.trim(u).toLowerCase(),e=i.createElement("div"),h=!f.indexOf("<opt")&&[1,"<select multiple='multiple'>","<\/select>"]||!f.indexOf("<leg")&&[1,"<fieldset>","<\/fieldset>"]||f.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","<\/table>"]||!f.indexOf("<tr")&&[2,"<table><tbody>","<\/tbody><\/table>"]||(!f.indexOf("<td")||!f.indexOf("<th"))&&[3,"<table><tbody><tr>","<\/tr><\/tbody><\/table>"]||!f.indexOf("<col")&&[2,"<table><tbody><\/tbody><colgroup>","<\/colgroup><\/table>"]||KSQ.browser.msie&&[1,"div<div>","<\/div>"]||[0,"",""];for(e.innerHTML=h[1]+u+h[2];h[0]--;)e=e.lastChild;if(KSQ.browser.msie){for(s=!f.indexOf("<table")&&f.indexOf("<tbody")<0?e.firstChild&&e.firstChild.childNodes:h[1]=="<table>"&&f.indexOf("<tbody")<0?e.childNodes:[],o=s.length-1;o>=0;--o)KSQ.nodeName(s[o],"tbody")&&!s[o].childNodes.length&&s[o].parentNode.removeChild(s[o]);/^\s/.test(u)&&e.insertBefore(i.createTextNode(u.match(/^\s*/)[0]),e.firstChild)}u=KSQ.makeArray(e.childNodes)}(u.length!==0||KSQ.nodeName(u,"form")||KSQ.nodeName(u,"select"))&&(u[0]==n||KSQ.nodeName(u,"form")||u.options?r.push(u):r=KSQ.merge(r,u))}}),r},attr:function(t,i,r){var o,s;if(!t||t.nodeType==3||t.nodeType==8)return n;var u=!KSQ.isXMLDoc(t),f=r!==n,e=KSQ.browser.msie;if(i=u&&KSQ.props[i]||i,t.tagName){if(o=/href|src|style/.test(i),i=="selected"&&KSQ.browser.safari&&t.parentNode.selectedIndex,i in t&&u&&!o){if(f){if(i=="type"&&KSQ.nodeName(t,"input")&&t.parentNode)throw"type property can't be changed";t[i]=r}return KSQ.nodeName(t,"form")&&t.getAttributeNode(i)?t.getAttributeNode(i).nodeValue:t[i]}return e&&u&&i=="style"?KSQ.attr(t.style,"cssText",r):(f&&t.setAttribute(i,""+r),s=e&&u&&o?t.getAttribute(i,2):t.getAttribute(i),s===null?n:s)}return e&&i=="opacity"?(f&&(t.zoom=1,t.filter=(t.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(r)+""=="NaN"?"":"alpha(opacity="+r*100+")")),t.filter&&t.filter.indexOf("opacity=")>=0?parseFloat(t.filter.match(/opacity=([^)]*)/)[1])/100+"":""):(i=i.replace(/-([a-z])/gi,function(n,t){return t.toUpperCase()}),f&&(t[i]=r),t[i])},trim:function(n){return(n||"").replace(/^\s+|\s+$/g,"")},makeArray:function(n){var i=[],t;if(n!=null)if(t=n.length,t==null||n.split||n.setInterval||n.call)i[0]=n;else while(t)i[--t]=n[t];return i},inArray:function(n,t){for(var i=0,r=t.length;i<r;i++)if(t[i]===n)return i;return-1},merge:function(n,t){var r=0,i,u=n.length;if(KSQ.browser.msie)while(i=t[r++])i.nodeType!=8&&(n[u++]=i);else while(i=t[r++])n[u++]=i;return n},unique:function(n){var i=[],u={},t,f,r;try{for(t=0,f=n.length;t<f;t++)r=KSQ.data(n[t]),u[r]||(u[r]=!0,i.push(n[t]))}catch(e){i=n}return i},grep:function(n,t,i){for(var u=[],r=0,f=n.length;r<f;r++)!i!=!t(n[r],r)&&u.push(n[r]);return u},map:function(n,t){for(var u,i=[],r=0,f=n.length;r<f;r++)u=t(n[r],r),u!=null&&(i[i.length]=u);return i.concat.apply([],i)}});userAgent=navigator.userAgent.toLowerCase();KSQ.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};f=KSQ.browser.msie?"styleFloat":"cssFloat";KSQ.extend({boxModel:!KSQ.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className",float:f,cssFloat:f,styleFloat:f,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});KSQ.each({parent:function(n){return n.parentNode},parents:function(n){return KSQ.dir(n,"parentNode")},next:function(n){return KSQ.nth(n,2,"nextSibling")},prev:function(n){return KSQ.nth(n,2,"previousSibling")},nextAll:function(n){return KSQ.dir(n,"nextSibling")},prevAll:function(n){return KSQ.dir(n,"previousSibling")},siblings:function(n){return KSQ.sibling(n.parentNode.firstChild,n)},children:function(n){return KSQ.sibling(n.firstChild)},contents:function(n){return KSQ.nodeName(n,"iframe")?n.contentDocument||n.contentWindow.document:KSQ.makeArray(n.childNodes)}},function(n,t){KSQ.fn[n]=function(n){var i=KSQ.map(this,t);return n&&typeof n=="string"&&(i=KSQ.multiFilter(n,i)),this.pushStack(KSQ.unique(i))}});KSQ.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(n,t){KSQ.fn[n]=function(){var n=arguments;return this.each(function(){for(var i=0,r=n.length;i<r;i++)KSQ(n[i])[t](this)})}});KSQ.each({removeAttr:function(n){KSQ.attr(this,n,"");this.nodeType==1&&this.removeAttribute(n)},addClass:function(n){KSQ.className.add(this,n)},removeClass:function(n){KSQ.className.remove(this,n)},toggleClass:function(n){KSQ.className[KSQ.className.has(this,n)?"remove":"add"](this,n)},remove:function(n){(!n||KSQ.filter(n,[this]).r.length)&&(KSQ("*",this).add(this).each(function(){KSQ.event.remove(this);KSQ.removeData(this)}),this.parentNode&&this.parentNode.removeChild(this))},empty:function(){for(KSQ(">*",this).remove();this.firstChild;)this.removeChild(this.firstChild)}},function(n,t){KSQ.fn[n]=function(){return this.each(t,arguments)}});KSQ.each(["Height","Width"],function(t,i){var r=i.toLowerCase();KSQ.fn[r]=function(t){return this[0]==window?KSQ.browser.opera&&document.body["client"+i]||KSQ.browser.safari&&window["inner"+i]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+i]||document.body["client"+i]:this[0]==document?Math.max(Math.max(document.body["scroll"+i],document.documentElement["scroll"+i]),Math.max(document.body["offset"+i],document.documentElement["offset"+i])):t==n?this.length?KSQ.css(this[0],r):null:this.css(r,t.constructor==String?t:t+"px")}});var e=KSQ.browser.safari&&parseInt(KSQ.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\wĨ-￿*_-]|\\\\.)",d=new RegExp("^>\\s*("+e+"+)"),g=new RegExp("^("+e+"+)(#)("+e+"+)"),nt=new RegExp("^([#.]?)("+e+"*)");KSQ.extend({expr:{"":function(n,t,i){return i[2]=="*"||KSQ.nodeName(n,i[2])},"#":function(n,t,i){return n.getAttribute("id")==i[2]},":":{lt:function(n,t,i){return t<i[3]-0},gt:function(n,t,i){return t>i[3]-0},nth:function(n,t,i){return i[3]-0==t},eq:function(n,t,i){return i[3]-0==t},first:function(n,t){return t==0},last:function(n,t,i,r){return t==r.length-1},even:function(n,t){return t%2==0},odd:function(n,t){return t%2},"first-child":function(n){return n.parentNode.getElementsByTagName("*")[0]==n},"last-child":function(n){return KSQ.nth(n.parentNode.lastChild,1,"previousSibling")==n},"only-child":function(n){return!KSQ.nth(n.parentNode.lastChild,2,"previousSibling")},parent:function(n){return n.firstChild},empty:function(n){return!n.firstChild},contains:function(n,t,i){return(n.textContent||n.innerText||KSQ(n).text()||"").indexOf(i[3])>=0},visible:function(n){return"hidden"!=n.type&&KSQ.css(n,"display")!="none"&&KSQ.css(n,"visibility")!="hidden"},hidden:function(n){return"hidden"==n.type||KSQ.css(n,"display")=="none"||KSQ.css(n,"visibility")=="hidden"},enabled:function(n){return!n.disabled},disabled:function(n){return n.disabled},checked:function(n){return n.checked},selected:function(n){return n.selected||KSQ.attr(n,"selected")},text:function(n){return"text"==n.type},radio:function(n){return"radio"==n.type},checkbox:function(n){return"checkbox"==n.type},file:function(n){return"file"==n.type},password:function(n){return"password"==n.type},submit:function(n){return"submit"==n.type},image:function(n){return"image"==n.type},reset:function(n){return"reset"==n.type},button:function(n){return"button"==n.type||KSQ.nodeName(n,"button")},input:function(n){return/input|select|textarea|button/i.test(n.nodeName)},has:function(n,t,i){return KSQ.find(i[3],n).length},header:function(n){return/h\d/i.test(n.nodeName)},animated:function(n){return KSQ.grep(KSQ.timers,function(t){return n==t.elem}).length}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+e+"+)")],multiFilter:function(n,t,i){for(var f,u=[],r;n&&n!=f;)f=n,r=KSQ.filter(n,t,i),n=r.t.replace(/^\s*,\s*/,""),u=i?t=r.r:KSQ.merge(u,r.r);return u},find:function(n,t){var r,y,rt,h,u,s,b,a,ut,e,k,v,i,c,o,p,tt,f,it;if(typeof n!="string")return[n];if(t&&t.nodeType!=1&&t.nodeType!=9)return[];for(t=t||document,r=[t],y=[];n&&rt!=n;){u=[];rt=n;n=KSQ.trim(n);var w=!1,l=d,i=l.exec(n);if(i){for(h=i[1].toUpperCase(),f=0;r[f];f++)for(s=r[f].firstChild;s;s=s.nextSibling)s.nodeType==1&&(h=="*"||s.nodeName.toUpperCase()==h)&&u.push(s);if(r=u,n=n.replace(l,""),n.indexOf(" ")==0)continue;w=!0}else if(l=/^([>+~])\s*(\w*)/i,(i=l.exec(n))!=null){for(u=[],b={},h=i[2].toUpperCase(),i=i[1],a=0,ut=r.length;a<ut;a++)for(e=i=="~"||i=="+"?r[a].nextSibling:r[a].firstChild;e;e=e.nextSibling)if(e.nodeType==1){if(k=KSQ.data(e),i=="~"&&b[k])break;if(h&&e.nodeName.toUpperCase()!=h||(i=="~"&&(b[k]=!0),u.push(e)),i=="+")break}r=u;n=KSQ.trim(n.replace(l,""));w=!0}if(n&&!w)if(n.indexOf(",")){if(v=g,i=v.exec(n),i?i=[0,i[2],i[3],i[1]]:(v=nt,i=v.exec(n)),i[2]=i[2].replace(/\\/g,""),c=r[r.length-1],i[1]=="#"&&c&&c.getElementById&&!KSQ.isXMLDoc(c))o=c.getElementById(i[2]),(KSQ.browser.msie||KSQ.browser.opera)&&o&&typeof o.id=="string"&&o.id!=i[2]&&(o=KSQ('[@id="'+i[2]+'"]',c)[0]),r=u=o&&(!i[3]||KSQ.nodeName(o,i[3]))?[o]:[];else{for(f=0;r[f];f++)p=i[1]=="#"&&i[3]?i[3]:i[1]!=""||i[0]==""?"*":i[2],p=="*"&&r[f].nodeName.toLowerCase()=="object"&&(p="param"),u=KSQ.merge(u,r[f].getElementsByTagName(p));if(i[1]=="."&&(u=KSQ.classFilter(u,i[2])),i[1]=="#"){for(tt=[],f=0;u[f];f++)if(u[f].getAttribute("id")==i[2]){tt=[u[f]];break}u=tt}r=u}n=n.replace(v,"")}else t==r[0]&&r.shift(),y=KSQ.merge(y,r),u=r=[t],n=" "+n.substr(1,n.length);n&&(it=KSQ.filter(n,u),r=u=it.r,n=KSQ.trim(it.t))}return n&&(r=[]),r&&t==r[0]&&r.shift(),KSQ.merge(y,r)},classFilter:function(n,t,i){var u,r,f;for(t=" "+t+" ",u=[],r=0;n[r];r++)f=(" "+n[r].className+" ").indexOf(t)>=0,(!i&&f||i&&!f)&&u.push(n[r]);return u},filter:function(t,r,not){for(var last,p,m,tmp,type,a,z,i,rl,c,n,add,fn;t&&t!=last;){for(last=t,p=KSQ.parse,i=0;p[i];i++)if(m=p[i].exec(t),m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break}if(!m)break;if(m[1]==":"&&m[2]=="not")r=c.test(m[3])?KSQ.filter(m[3],r,!0).r:KSQ(r).not(m[3]);else if(m[1]==".")r=KSQ.classFilter(r,m[2],not);else if(m[1]=="["){for(tmp=[],type=m[3],i=0,rl=r.length;i<rl;i++)a=r[i],z=a[KSQ.props[m[2]]||m[2]],(z==null||/href|src|selected/.test(m[2]))&&(z=KSQ.attr(a,m[2])||""),(type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not&&tmp.push(a);r=tmp}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=test[1]+(test[2]||1)-0,last=test[3]-0;for(i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=KSQ.data(parentNode);if(!merge[id]){for(c=1,n=parentNode.firstChild;n;n=n.nextSibling)n.nodeType==1&&(n.nodeIndex=c++);merge[id]=!0}add=!1;first==0?node.nodeIndex==last&&(add=!0):(node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0&&(add=!0);add^not&&tmp.push(node)}r=tmp}else fn=KSQ.expr[m[1]],typeof fn=="object"&&(fn=fn[m[2]]),typeof fn=="string"&&(fn=eval("false||function(a,i){return "+fn+";}")),r=KSQ.grep(r,function(n,t){return fn(n,t,m,r)},not)}return{r:r,t:t}},dir:function(n,t){for(var r=[],i=n[t];i&&i!=document;)i.nodeType==1&&r.push(i),i=i[t];return r},nth:function(n,t,i){t=t||1;for(var r=0;n;n=n[i])if(n.nodeType==1&&++r==t)break;return n},sibling:function(n,t){for(var i=[];n;n=n.nextSibling)n.nodeType==1&&n!=t&&i.push(n);return i}});KSQ.event={add:function(t,i,r,u){var e,o,f;t.nodeType!=3&&t.nodeType!=8&&(KSQ.browser.msie&&t.setInterval&&(t=window),r.guid||(r.guid=this.guid++),u!=n&&(e=r,r=this.proxy(e,function(){return e.apply(this,arguments)}),r.data=u),o=KSQ.data(t,"events")||KSQ.data(t,"events",{}),f=KSQ.data(t,"handle")||KSQ.data(t,"handle",function(){if(typeof KSQ!="undefined"&&!KSQ.event.triggered)return KSQ.event.handle.apply(arguments.callee.elem,arguments)}),f.elem=t,KSQ.each(i.split(/\s+/),function(n,i){var e=i.split("."),u;i=e[0];r.type=e[1];u=o[i];u||(u=o[i]={},KSQ.event.special[i]&&KSQ.event.special[i].setup.call(t)!==!1||(t.addEventListener?t.addEventListener(i,f,!1):t.attachEvent&&t.attachEvent("on"+i,f)));u[r.guid]=r;KSQ.event.global[i]=!0}),t=null)},guid:1,global:{},remove:function(t,i,r){var u,f,o,e;if(t.nodeType!=3&&t.nodeType!=8&&(u=KSQ.data(t,"events"),u)){if(i==n||typeof i=="string"&&i.charAt(0)==".")for(o in u)this.remove(t,o+(i||""));else i.type&&(r=i.handler,i=i.type),KSQ.each(i.split(/\s+/),function(n,i){var e=i.split(".");if(i=e[0],u[i]){if(r)delete u[i][r.guid];else for(r in u[i])e[1]&&u[i][r].type!=e[1]||delete u[i][r];for(f in u[i])break;f||(KSQ.event.special[i]&&KSQ.event.special[i].teardown.call(t)!==!1||(t.removeEventListener?t.removeEventListener(i,KSQ.data(t,"handle"),!1):t.detachEvent&&t.detachEvent("on"+i,KSQ.data(t,"handle"))),f=null,delete u[i])}});for(f in u)break;f||(e=KSQ.data(t,"handle"),e&&(e.elem=null),KSQ.removeData(t,"events"),KSQ.removeData(t,"handle"))}},trigger:function(i,u,f,e,o){var v,s,h,c,l,a;if(u=KSQ.makeArray(u),i.indexOf("!")>=0&&(i=i.slice(0,-1),v=!0),f){if(f.nodeType==3||f.nodeType==8)return n;if(c=KSQ.isFunction(f[i]||null),l=!u[0]||!u[0].preventDefault,l&&(u.unshift({type:i,target:f,preventDefault:function(){},stopPropagation:function(){},timeStamp:r()}),u[0][t]=!0),u[0].type=i,v&&(u[0].exclusive=!0),a=KSQ.data(f,"handle"),a&&(s=a.apply(f,u)),(!c||KSQ.nodeName(f,"a")&&i=="click")&&f["on"+i]&&f["on"+i].apply(f,u)===!1&&(s=!1),l&&u.shift(),o&&KSQ.isFunction(o)&&(h=o.apply(f,s==null?u:u.concat(s)),h!==n&&(s=h)),c&&e!==!1&&s!==!1&&!(KSQ.nodeName(f,"a")&&i=="click")){this.triggered=!0;try{f[i]()}catch(y){}}this.triggered=!1}else this.global[i]&&KSQ("*").add([window,document]).trigger(i,u);return s},handle:function(n){var r,u,t,e,f,o,i;n=arguments[0]=KSQ.event.fix(n||window.event);t=n.type.split(".");n.type=t[0];t=t[1];e=!t&&!n.exclusive;f=(KSQ.data(this,"events")||{})[n.type];for(o in f)i=f[o],(e||i.type==t)&&(n.handler=i,n.data=i.data,u=i.apply(this,arguments),r!==!1&&(r=u),u===!1&&(n.preventDefault(),n.stopPropagation()));return r},fix:function(n){var i,o,f,u,e;if(n[t]==!0)return n;for(i=n,n={originalEvent:i},o="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" "),f=o.length;f;f--)n[o[f]]=i[o[f]];return n[t]=!0,n.preventDefault=function(){i.preventDefault&&i.preventDefault();i.returnValue=!1},n.stopPropagation=function(){i.stopPropagation&&i.stopPropagation();i.cancelBubble=!0},n.timeStamp=n.timeStamp||r(),n.target||(n.target=n.srcElement||document),n.target.nodeType==3&&(n.target=n.target.parentNode),!n.relatedTarget&&n.fromElement&&(n.relatedTarget=n.fromElement==n.target?n.toElement:n.fromElement),n.pageX==null&&n.clientX!=null&&(u=document.documentElement,e=document.body,n.pageX=n.clientX+(u&&u.scrollLeft||e&&e.scrollLeft||0)-(u.clientLeft||0),n.pageY=n.clientY+(u&&u.scrollTop||e&&e.scrollTop||0)-(u.clientTop||0)),!n.which&&(n.charCode||n.charCode===0?n.charCode:n.keyCode)&&(n.which=n.charCode||n.keyCode),!n.metaKey&&n.ctrlKey&&(n.metaKey=n.ctrlKey),!n.which&&n.button&&(n.which=n.button&1?1:n.button&2?3:n.button&4?2:0),n},proxy:function(n,t){return t.guid=n.guid=n.guid||t.guid||this.guid++,t},special:{ready:{setup:function(){a();return},teardown:function(){return}},mouseenter:{setup:function(){return KSQ.browser.msie?!1:(KSQ(this).bind("mouseover",KSQ.event.special.mouseenter.handler),!0)},teardown:function(){return KSQ.browser.msie?!1:(KSQ(this).unbind("mouseover",KSQ.event.special.mouseenter.handler),!0)},handler:function(n){return h(n,this)?!0:(n.type="mouseenter",KSQ.event.handle.apply(this,arguments))}},mouseleave:{setup:function(){return KSQ.browser.msie?!1:(KSQ(this).bind("mouseout",KSQ.event.special.mouseleave.handler),!0)},teardown:function(){return KSQ.browser.msie?!1:(KSQ(this).unbind("mouseout",KSQ.event.special.mouseleave.handler),!0)},handler:function(n){return h(n,this)?!0:(n.type="mouseleave",KSQ.event.handle.apply(this,arguments))}}}};KSQ.fn.extend({bind:function(n,t,i){return n=="unload"?this.one(n,t,i):this.each(function(){KSQ.event.add(this,n,i||t,i&&t)})},one:function(n,t,i){var r=KSQ.event.proxy(i||t,function(n){return KSQ(this).unbind(n,r),(i||t).apply(this,arguments)});return this.each(function(){KSQ.event.add(this,n,r,i&&t)})},unbind:function(n,t){return this.each(function(){KSQ.event.remove(this,n,t)})},trigger:function(n,t,i){return this.each(function(){KSQ.event.trigger(n,t,this,!0,i)})},triggerHandler:function(n,t,i){return this[0]&&KSQ.event.trigger(n,t,this[0],!1,i)},toggle:function(n){for(var t=arguments,i=1;i<t.length;)KSQ.event.proxy(n,t[i++]);return this.click(KSQ.event.proxy(n,function(n){return this.lastToggle=(this.lastToggle||0)%i,n.preventDefault(),t[this.lastToggle++].apply(this,arguments)||!1}))},hover:function(n,t){return this.bind("mouseenter",n).bind("mouseleave",t)},ready:function(n){return a(),KSQ.isReady?n.call(document,KSQ):KSQ.readyList.push(function(){return n.call(this,KSQ)}),this}});KSQ.extend({isReady:!1,readyList:[],ready:function(){KSQ.isReady||(KSQ.isReady=!0,KSQ.readyList&&(KSQ.each(KSQ.readyList,function(){this.call(document)}),KSQ.readyList=null),KSQ(document).triggerHandler("ready"))}});s=!1;KSQ.each("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,change,select,submit,keydown,keypress,keyup,error".split(","),function(n,t){KSQ.fn[t]=function(n){return n?this.bind(t,n):this.trigger(t)}});h=function(n,t){for(var i=n.relatedTarget;i&&i!=t;)try{i=i.parentNode}catch(r){i=t}return i==t};KSQ(window).bind("unload",function(){KSQ("*").add(document).unbind()});KSQ.fn.extend({_load:KSQ.fn.load,load:function(n,t,i){var r,u,f,e;return typeof n!="string"?this._load(n):(r=n.indexOf(" "),r>=0&&(u=n.slice(r,n.length),n=n.slice(0,r)),i=i||function(){},f="GET",t&&(KSQ.isFunction(t)?(i=t,t=null):(t=KSQ.param(t),f="POST")),e=this,KSQ.ajax({url:n,type:f,dataType:"html",data:t,complete:function(n,t){(t=="success"||t=="notmodified")&&e.html(u?KSQ("<div/>").append(n.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(u):n.responseText);e.each(i,[n.responseText,t,n])}}),this)},serialize:function(){return KSQ.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return KSQ.nodeName(this,"form")?KSQ.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))}).map(function(n,t){var i=KSQ(this).val();return i==null?null:i.constructor==Array?KSQ.map(i,function(n){return{name:t.name,value:n}}):{name:t.name,value:i}}).get()}});KSQ.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(n,t){KSQ.fn[t]=function(n){return this.bind(t,n)}});v=r();KSQ.extend({get:function(n,t,i,r){return KSQ.isFunction(t)&&(i=t,t=null),KSQ.ajax({type:"GET",url:n,data:t,success:i,dataType:r})},getScript:function(n,t){return KSQ.get(n,null,t,"script")},getJSON:function(n,t,i){return KSQ.get(n,t,i,"json")},post:function(n,t,i,r){return KSQ.isFunction(t)&&(i=t,t={}),KSQ.ajax({type:"POST",url:n,data:t,success:i,dataType:r})},ajaxSetup:function(n){KSQ.extend(KSQ.ajaxSettings,n)},ajaxSettings:{url:location.href,global:!0,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(t){function d(){t.success&&t.success(y,o);t.global&&KSQ.event.trigger("ajaxSuccess",[i,t])}function g(){t.complete&&t.complete(i,o);t.global&&KSQ.event.trigger("ajaxComplete",[i,t]);t.global&&!--KSQ.active&&KSQ.event.trigger("ajaxStop")}var u,e,o,y,s,p,w,b,h,f,k,c,i,l,a;if(t=KSQ.extend(!0,t,KSQ.extend(!0,{},KSQ.ajaxSettings,t)),e=/=\?(&|$)/g,s=t.type.toUpperCase(),t.data&&t.processData&&typeof t.data!="string"&&(t.data=KSQ.param(t.data)),t.dataType=="jsonp"&&(s=="GET"?t.url.match(e)||(t.url+=(t.url.match(/\?/)?"&":"?")+(t.jsonp||"callback")+"=?"):t.data&&t.data.match(e)||(t.data=(t.data?t.data+"&":"")+(t.jsonp||"callback")+"=?"),t.dataType="json"),t.dataType=="json"&&(t.data&&t.data.match(e)||t.url.match(e))&&(u="jsonp"+v++,t.data&&(t.data=(t.data+"").replace(e,"="+u+"$1")),t.url=t.url.replace(e,"="+u+"$1"),t.dataType="script",window[u]=function(t){y=t;d();g();window[u]=n;try{delete window[u]}catch(i){}h&&h.removeChild(f)}),t.dataType=="script"&&t.cache==null&&(t.cache=!1),t.cache===!1&&s=="GET"&&(p=r(),w=t.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+p+"$2"),t.url=w+(w==t.url?(t.url.match(/\?/)?"&":"?")+"_="+p:"")),t.data&&s=="GET"&&(t.url+=(t.url.match(/\?/)?"&":"?")+t.data,t.data=null),t.global&&!KSQ.active++&&KSQ.event.trigger("ajaxStart"),b=/^(?:\w+:)?\/\/([^\/?#]+)/,t.dataType=="script"&&s=="GET"&&b.test(t.url)&&b.exec(t.url)[1]!=location.host)return h=document.getElementsByTagName("head")[0],f=document.createElement("script"),f.src=t.url,t.scriptCharset&&(f.charset=t.scriptCharset),u||(k=!1,f.onload=f.onreadystatechange=function(){k||this.readyState&&this.readyState!="loaded"&&this.readyState!="complete"||(k=!0,d(),g(),h.removeChild(f))}),h.appendChild(f),n;c=!1;i=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest;t.username?i.open(s,t.url,t.async,t.username,t.password):i.open(s,t.url,t.async);try{t.data&&i.setRequestHeader("Content-Type",t.contentType);t.ifModified&&i.setRequestHeader("If-Modified-Since",KSQ.lastModified[t.url]||"Thu, 01 Jan 1970 00:00:00 GMT");i.setRequestHeader("X-Requested-With","XMLHttpRequest");i.setRequestHeader("Accept",t.dataType&&t.accepts[t.dataType]?t.accepts[t.dataType]+", */*":t.accepts._default)}catch(nt){}if(t.beforeSend&&t.beforeSend(i,t)===!1)return t.global&&KSQ.active--,i.abort(),!1;t.global&&KSQ.event.trigger("ajaxSend",[i,t]);l=function(n){if(!c&&i&&(i.readyState==4||n=="timeout")){if(c=!0,a&&(clearInterval(a),a=null),o=n=="timeout"&&"timeout"||!KSQ.httpSuccess(i)&&"error"||t.ifModified&&KSQ.httpNotModified(i,t.url)&&"notmodified"||"success",o=="success")try{y=KSQ.httpData(i,t.dataType,t.dataFilter)}catch(f){o="parsererror"}if(o=="success"){var r;try{r=i.getResponseHeader("Last-Modified")}catch(f){}t.ifModified&&r&&(KSQ.lastModified[t.url]=r);u||d()}else KSQ.handleError(t,i,o);g();t.async&&(i=null)}};t.async&&(a=setInterval(l,13),t.timeout>0&&setTimeout(function(){i&&(i.abort(),c||l("timeout"))},t.timeout));try{i.send(t.data)}catch(nt){KSQ.handleError(t,i,null,nt)}return t.async||l(),i},handleError:function(n,t,i,r){n.error&&n.error(t,i,r);n.global&&KSQ.event.trigger("ajaxError",[t,n,r])},active:0,httpSuccess:function(t){try{return!t.status&&location.protocol=="file:"||t.status>=200&&t.status<300||t.status==304||t.status==1223||KSQ.browser.safari&&t.status==n}catch(i){}return!1},httpNotModified:function(t,i){try{var r=t.getResponseHeader("Last-Modified");return t.status==304||r==KSQ.lastModified[i]||KSQ.browser.safari&&t.status==n}catch(u){}return!1},httpData:function(n,t,i){var u=n.getResponseHeader("content-type"),f=t=="xml"||!t&&u&&u.indexOf("xml")>=0,r=f?n.responseXML:n.responseText;if(f&&r.documentElement.tagName=="parsererror")throw"parsererror";return i&&(r=i(r,t)),t=="script"&&KSQ.globalEval(r),t=="json"&&(r=JSON.parse(r)),r},param:function(n){var i=[],t;if(n.constructor==Array||n.KSQ)KSQ.each(n,function(){i.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value))});else for(t in n)n[t]&&n[t].constructor==Array?KSQ.each(n[t],function(){i.push(encodeURIComponent(t)+"="+encodeURIComponent(this))}):i.push(encodeURIComponent(t)+"="+encodeURIComponent(KSQ.isFunction(n[t])?n[t]():n[t]));return i.join("&").replace(/%20/g,"+")}});KSQ.fn.extend({show:function(n,t){return n?this.animate({height:"show",width:"show",opacity:"show"},n,t):this.filter(":hidden").each(function(){if(this.style.display=this.oldblock||"",KSQ.css(this,"display")=="none"){var n=KSQ("<"+this.tagName+" />").appendTo("body");this.style.display=n.css("display");this.style.display=="none"&&(this.style.display="block");n.remove()}}).end()},hide:function(n,t){return n?this.animate({height:"hide",width:"hide",opacity:"hide"},n,t):this.filter(":visible").each(function(){this.oldblock=this.oldblock||KSQ.css(this,"display");this.style.display="none"}).end()},_toggle:KSQ.fn.toggle,toggle:function(n,t){return KSQ.isFunction(n)&&KSQ.isFunction(t)?this._toggle.apply(this,arguments):n?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},n,t):this.each(function(){KSQ(this)[KSQ(this).is(":hidden")?"show":"hide"]()})},slideDown:function(n,t){return this.animate({height:"show"},n,t)},slideUp:function(n,t){return this.animate({height:"hide"},n,t)},slideToggle:function(n,t){return this.animate({height:"toggle"},n,t)},fadeIn:function(n,t){return this.animate({opacity:"show"},n,t)},fadeOut:function(n,t){return this.animate({opacity:"hide"},n,t)},fadeTo:function(n,t,i){return this.animate({opacity:t},n,i)},animate:function(n,t,i,r){var u=KSQ.speed(t,i,r);return this[u.queue===!1?"each":"queue"](function(){if(this.nodeType!=1)return!1;var t=KSQ.extend({},u),i,r=KSQ(this).is(":hidden"),f=this;for(i in n){if(n[i]=="hide"&&r||n[i]=="show"&&!r)return t.complete.call(this);(i=="height"||i=="width")&&(t.display=KSQ.css(this,"display"),t.overflow=this.style.overflow)}return t.overflow!=null&&(this.style.overflow="hidden"),t.curAnim=KSQ.extend({},n),KSQ.each(n,function(i,u){var h=new KSQ.fx(f,t,i),o,e,s,c;/toggle|show|hide/.test(u)?h[u=="toggle"?r?"show":"hide":u](n):(o=u.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),e=h.cur(!0)||0,o?(s=parseFloat(o[2]),c=o[3]||"px",c!="px"&&(f.style[i]=(s||1)+c,e=(s||1)/h.cur(!0)*e,f.style[i]=e+c),o[1]&&(s=(o[1]=="-="?-1:1)*s+e),h.custom(e,s,c)):h.custom(e,u,""))}),!0})},queue:function(n,t){return((KSQ.isFunction(n)||n&&n.constructor==Array)&&(t=n,n="fx"),!n||typeof n=="string"&&!t)?u(this[0],n):this.each(function(){t.constructor==Array?u(this,n,t):(u(this,n).push(t),u(this,n).length==1&&t.call(this))})},stop:function(n,t){var i=KSQ.timers;return n&&this.queue([]),this.each(function(){for(var n=i.length-1;n>=0;n--)i[n].elem==this&&(t&&i[n](!0),i.splice(n,1))}),t||this.dequeue(),this}});u=function(n,t,i){if(n){t=t||"fx";var r=KSQ.data(n,t+"queue");(!r||i)&&(r=KSQ.data(n,t+"queue",KSQ.makeArray(i)))}return r};KSQ.fn.dequeue=function(n){return n=n||"fx",this.each(function(){var t=u(this,n);t.shift();t.length&&t[0].call(this)})};KSQ.extend({speed:function(n,t,i){var r=n&&n.constructor==Object?n:{complete:i||!i&&t||KSQ.isFunction(n)&&n,duration:n,easing:i&&t||t&&t.constructor!=Function&&t};return r.duration=(r.duration&&r.duration.constructor==Number?r.duration:KSQ.fx.speeds[r.duration])||KSQ.fx.speeds.def,r.old=r.complete,r.complete=function(){r.queue!==!1&&KSQ(this).dequeue();KSQ.isFunction(r.old)&&r.old.call(this)},r},easing:{linear:function(n,t,i,r){return i+r*n},swing:function(n,t,i,r){return(-Math.cos(n*Math.PI)/2+.5)*r+i}},timers:[],timerId:null,fx:function(n,t,i){this.options=t;this.elem=n;this.prop=i;t.orig||(t.orig={})}});KSQ.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(KSQ.fx.step[this.prop]||KSQ.fx.step._default)(this);(this.prop=="height"||this.prop=="width")&&(this.elem.style.display="block")},cur:function(n){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var t=parseFloat(KSQ.css(this.elem,this.prop,n));return t&&t>-1e4?t:parseFloat(KSQ.curCSS(this.elem,this.prop))||0},custom:function(n,t,i){function u(n){return f.step(n)}this.startTime=r();this.start=n;this.end=t;this.unit=i||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var f=this;u.elem=this.elem;KSQ.timers.push(u);KSQ.timerId==null&&(KSQ.timerId=setInterval(function(){for(var n=KSQ.timers,t=0;t<n.length;t++)n[t]()||n.splice(t--,1);n.length||(clearInterval(KSQ.timerId),KSQ.timerId=null)},13))},show:function(){this.options.orig[this.prop]=KSQ.attr(this.elem.style,this.prop);this.options.show=!0;this.custom(0,this.cur());(this.prop=="width"||this.prop=="height")&&(this.elem.style[this.prop]="1px");KSQ(this.elem).show()},hide:function(){this.options.orig[this.prop]=KSQ.attr(this.elem.style,this.prop);this.options.hide=!0;this.custom(this.cur(),0)},step:function(n){var f=r(),t,e,i,u;if(n||f>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=!0;t=!0;for(e in this.options.curAnim)this.options.curAnim[e]!==!0&&(t=!1);if(t&&(this.options.display!=null&&(this.elem.style.overflow=this.options.overflow,this.elem.style.display=this.options.display,KSQ.css(this.elem,"display")=="none"&&(this.elem.style.display="block")),this.options.hide&&(this.elem.style.display="none"),this.options.hide||this.options.show))for(i in this.options.curAnim)KSQ.attr(this.elem.style,i,this.options.orig[i]);return t&&this.options.complete.call(this.elem),!1}return u=f-this.startTime,this.state=u/this.options.duration,this.pos=KSQ.easing[this.options.easing||(KSQ.easing.swing?"swing":"linear")](this.state,u,0,1,this.options.duration),this.now=this.start+(this.end-this.start)*this.pos,this.update(),!0}};KSQ.extend(KSQ.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(n){n.elem.scrollLeft=n.now},scrollTop:function(n){n.elem.scrollTop=n.now},opacity:function(n){KSQ.attr(n.elem.style,"opacity",n.now)},_default:function(n){n.elem.style[n.prop]=n.now+n.unit}}});KSQ.fn.offset=function(){function border(n){add(KSQ.curCSS(n,"borderLeftWidth",!0),KSQ.curCSS(n,"borderTopWidth",!0))}function add(n,t){left+=parseInt(n,10)||0;top+=parseInt(t,10)||0}var left=0,top=0,elem=this[0],results,box;if(elem)with(KSQ.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=KSQ.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect)box=elem.getBoundingClientRect(),add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop)),add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);else{for(add(elem.offsetLeft,elem.offsetTop);offsetParent;)add(offsetParent.offsetLeft,offsetParent.offsetTop),(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)&&border(offsetParent),fixed||css(offsetParent,"position")!="fixed"||(fixed=!0),offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent,offsetParent=offsetParent.offsetParent;while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName))/^inline|table.*$/i.test(css(parent,"display"))||add(-parent.scrollLeft,-parent.scrollTop),mozilla&&css(parent,"overflow")!="visible"&&border(parent),parent=parent.parentNode;(safari2&&(fixed||css(offsetChild,"position")=="absolute")||mozilla&&css(offsetChild,"position")!="absolute")&&add(-doc.body.offsetLeft,-doc.body.offsetTop);fixed&&add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop))}results={top:top,left:left}}return results};KSQ.fn.extend({position:function(){var u;if(this[0]){var n=this.offsetParent(),t=this.offset(),r=/^body|html$/i.test(n[0].tagName)?{top:0,left:0}:n.offset();t.top-=i(this,"marginTop");t.left-=i(this,"marginLeft");r.top+=i(n,"borderTopWidth");r.left+=i(n,"borderLeftWidth");u={top:t.top-r.top,left:t.left-r.left}}return u},offsetParent:function(){for(var n=this[0].offsetParent;n&&!/^body|html$/i.test(n.tagName)&&KSQ.css(n,"position")=="static";)n=n.offsetParent;return KSQ(n)}});KSQ.each(["Left","Top"],function(t,i){var r="scroll"+i;KSQ.fn[r]=function(i){if(this[0])return i!=n?this.each(function(){this==window||this==document?window.scrollTo(t?KSQ(window).scrollLeft():i,t?i:KSQ(window).scrollTop()):this[r]=i}):this[0]==window||this[0]==document?self[t?"pageYOffset":"pageXOffset"]||KSQ.boxModel&&document.documentElement[r]||document.body[r]:this[0][r]}});KSQ.each(["Height","Width"],function(n,t){var r=n?"Left":"Top",u=n?"Right":"Bottom";KSQ.fn["inner"+t]=function(){return this[t.toLowerCase()]()+i(this,"padding"+r)+i(this,"padding"+u)};KSQ.fn["outer"+t]=function(n){return this["inner"+t]()+i(this,"border"+r+"Width")+i(this,"border"+u+"Width")+(n?i(this,"margin"+r)+i(this,"margin"+u):0)}})})();window.console||(window.console={});window.console.log||(window.console.log=function(){});String._KeyotiFormat=function(n){var t=Array.prototype.slice.call(arguments,1);return n.replace(/{(\d+)}/g,function(n,i){return typeof t[i]!="undefined"?t[i]:n})};var keyotiCustomDataSort={relevanceText:"Relevance",meta:null,selectedSortBy:null,init:function(){var n=KSQ("#sew_sortControl"),t;n.length>0&&(t=n[0].innerHTML.substring(n[0].innerHTML.indexOf("{"),n[0].innerHTML.lastIndexOf("}",n[0].innerHTML.indexOf("-->"))+1),this.meta=JSON.parse(t))},createChildControls:function(){var i=KSQ("#sew_sortControl"),t,n;if(i.length>0&&this.meta!=null&&this.meta.Options.length>0){for(this.meta.RelevanceText!=null&&(this.relevanceText=this.meta.RelevanceText),t="<select class='sew_sortControl'>",t+='<option value="Relevance">'+this.relevanceText+"<\/option>",n=0;n<this.meta.Options.length;n++)t+='<option value="'+this.meta.Options[n].Type+"|"+this.meta.Options[n].Direction+"|"+this.meta.Options[n].Field+'">'+this.meta.Options[n].Label+"<\/option>";t+="<\/select>";i.html(t);this.selectedSortBy!=null?this.setSortBy(this.selectedSortBy):this.setSortBy("Relevance");KSQ.browser.msie?i.click(function(){keyotiCustomDataSort.selectedSortBy!=keyotiCustomDataSort.getSortBy()&&keyotiSearch.onSortChange()}):i.change(function(){keyotiSearch.onSortChange()})}},getSortBy:function(){var n=KSQ("#sew_sortControl>select");return n.length==0?this.selectedSortBy:n.val()},setSortBy:function(n){this.selectedSortBy=n;KSQ("#sew_sortControl>select").val(n)}},keyotiCustomDataFilters={activeFilters:[],init:function(){var f=null,e,t,o,r,u,n,i;for(this.activeFilters=[],t=KSQ("div.sew_filterControl"),n=0;n<t.length;n++){if(o=t[n].innerHTML.substring(t[n].innerHTML.indexOf("{"),t[n].innerHTML.lastIndexOf("}",t[n].innerHTML.indexOf("-->"))+1),r=JSON.parse(o),f==null)e=r;else for(n=0;n<f.length;n++)f[n].FieldName==fieldName&&(e=f[n]);r!=null&&(i=this.createFilter(e),i!=null&&(i.definition.Label=r.Label,i.definition.controlDefinition=o,i.definition.OriginalOptions=i.definition.Options.slice(),r.ControlType=="calendar"?u=new KeyotiCalendarRangeFilterControl(KSQ(t[n]),i):r.ControlType=="checkboxes"?u=new KeyotiCheckboxesFilterControl(KSQ(t[n]),i):r.ControlType=="checkboxesIntRange"?u=new KeyotiCheckboxesIntRangeFilterControl(KSQ(t[n]),i):r.ControlType=="textboxesIntRange"?u=new KeyotiTextboxesIntRangeFilterControl(KSQ(t[n]),i):r.ControlType=="dropdown"&&(u=new KeyotiDropdownFilterControl(KSQ(t[n]),i)),this.activeFilters[this.activeFilters.length]=u))}},getFilterControl:function(n){for(var t=0;t<this.activeFilters.length;t++)if(this.activeFilters[t]!=null&&this.activeFilters[t].filter.definition.FieldName==n)return this.activeFilters[t];return null},updateWithLiveDataSamples:function(n){for(var i,t=0;t<n.length;t++)i=this.getFilterControl(n[t].FieldName),i.updateWithLiveData(n[t].DataSample)},createFilter:function(n){return n.Type=="date"?new KeyotiDateFilter(n):n.Type=="int"?new KeyotiIntFilter(n):n.Type=="stringor"?new KeyotiStringFilter(n):n.Type=="stringlistor"||n.Type=="stringlistand"?new KeyotiStringListFilter(n):void 0},getRequestFilterCollection:function(){for(var t=[],n=0;n<this.activeFilters.length;n++)this.activeFilters[n]!=null&&this.activeFilters[n].isFilterUsed()&&(t[t.length]=this.activeFilters[n].getRequestFilter());return t},resetFilterCollection:function(){for(var n=0;n<this.activeFilters.length;n++)this.activeFilters[n].setSelectedValues(null)},setFilterCollection:function(n){function i(n,t){for(var i=0;i<t.length;i++)if(n==t[i].FieldName)return t[i]}for(var t=0;t<this.activeFilters.length;t++)this.activeFilters[t].setSelectedValues(i(this.activeFilters[t].filter.definition.FieldName,n))}},keyotiTemplateUtility={getDisplayClass:function(n,t){return t==null||t.length==0?n+"NoContent":n+"Content"},formatCustomData:function(n,t){return t},convertDataAttributeInTemplate:!0,readTemplate:function(n,t,i){var u,r,f;if(u=typeof i=="undefined"?n:i,r=KSQ("#"+t),r!=null&&r.length>0){n.tag=r[0].nodeName;u.html=r.html();for(f in r.getAttributes())f.toLowerCase()!="id"&&(n[f]=r[0].getAttribute(f));this.convertDataAttributeInTemplate&&(u.html=u.html.replace(/data-([^'"]*['"][^'"]*['"])/gi,"data-$1 $1 "));r.hide()}}},keyotiSearchCloud={numberOfQueriesToGet:10,fontSizeUnits:"em",minimumFontSize:.8,maximumFontSize:1.8,itemTransform:{tag:"span","class":"sew_searchCloudItem",style:"${FontSizeStyle}",html:'<a href="#stayhere" onclick="keyotiSearchBox.doSearch(\'${QueryEscaped}\', 1)">${Query}<\/a> '},transform:{tag:"span","class":"sew_searchCloud",html:"",children:function(){return kjson2html.transform(this.Items,keyotiSearchCloud.itemTransform)}},init:function(){keyotiTemplateUtility.readTemplate(keyotiSearchCloud.itemTransform,"sew_searchCloudItemTEMPLATE");keyotiSearchCloud.isEnabled=KSQ("#sew_searchCloudControl").length>0},createChildControls:function(n){var r,t,i;if(n.Exception!=null)keyotiResultViewer.onError({Message:n.Exception,StackTrace:""});for(r=0,t=0;t<n.Items.length;t++)n.Items[t].Tally>r&&(r=n.Items[t].Tally);for(t=0;t<n.Items.length;t++)n.Items[t].QueryEscaped=n.Items[t].Query.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),n.Items[t].Frequency=n.Items[t].Tally/r,i=keyotiSearchCloud.maximumFontSize*n.Items[t].Frequency,i<keyotiSearchCloud.minimumFontSize&&(i=keyotiSearchCloud.minimumFontSize),n.Items[t].FontSize=i,n.Items[t].FontSizeStyle="font-size: "+i+keyotiSearchCloud.fontSizeUnits;keyotiSearchCloud.createControl(n)},createControl:function(n){KSQ("#sew_searchCloudControl").empty();KSQ("#sew_searchCloudControl").kjson2html(n,this.transform);KSQ("#sew_searchCloudControl").css("visibility","visible")}},keyotiCategoryChoosers={selectedLocation:null,locationChooserTransform:{tag:"div","class":"sew_locationOption",html:"",children:function(){return kjson2html.transform(this.LocationCategories,keyotiCategoryChoosers.locationChooserItemTransform)}},locationChooserItemTransform:{tag:"span",html:'<label ><input type="radio" name="sew_locationOption" class="sew_locationOptionItem"  value="${Value}"/>${Value}<\/label>'},init:function(){keyotiTemplateUtility.readTemplate(this.locationChooserTransform,"sew_locationOptionTEMPLATE",this.locationChooserItemTransform);keyotiTemplateUtility.readTemplate(this.contentChooserTransform,"sew_contentOptionTEMPLATE",this.contentChooserItemTransform)},getSelectedLocation:function(){return this.convertLocationBackendNameToFrontEndName(this.selectedLocation,!0)},setSelectedLocation:function(n){var i,t;for(this.selectedLocation=this.convertLocationBackendNameToFrontEndName(n,!1),i=KSQ("#sew_locationChooserControl .sew_locationOptionItem"),t=0;t<i.length;t++)i[t].value==this.selectedLocation&&(typeof i[t].checked!="undefined"&&(i[t].checked=!0),typeof i[t].selected!="undefined"&&(i[t].selected=!0))},convertLocationBackendNameToFrontEndName:function(n){return n},convertContentBackendNameToFrontEndName:function(n){return n},createLocationControls:function(n){if(KSQ("#sew_locationChooserControl").empty(),n.CategoriesEnabled){for(var t=0;t<n.LocationCategories.length;t++)n.LocationCategories[t].Value=this.convertLocationBackendNameToFrontEndName(n.LocationCategories[t].Value);KSQ("#sew_locationChooserControl").kjson2html(n,this.locationChooserTransform);KSQ("#sew_locationChooserControl input,#sew_locationChooserControl select").change(function(n){keyotiCategoryChoosers.selectedLocation=n.target?n.target.value:n.srcElement.value;keyotiSearch.onLocationChange(n.target?n.target.value:n.srcElement.value)});this.selectedLocation!=null?this.setSelectedLocation(this.convertLocationBackendNameToFrontEndName(this.selectedLocation)):this.setSelectedLocation(this.convertLocationBackendNameToFrontEndName("All"));KSQ("#sew_locationChooserControl").css("visibility","visible")}},selectedContents:[],contentChooserTransform:{tag:"div","class":"sew_contentOption",html:"",children:function(){return kjson2html.transform(this.ContentCategories,keyotiCategoryChoosers.contentChooserItemTransform)}},contentChooserItemTransform:{tag:"span",html:'<label ><input type="checkbox" class="sew_contentOptionItem"  value="${Value}"/>${Value}<\/label>'},getSelectedContents:function(){var t,n;for(this.selectedContents.length!=0||keyotiSearch.useWCFService||(this.selectedContents=[this.convertContentBackendNameToFrontEndName("All")]),t=[],n=0;n<this.selectedContents.length;n++)t[n]=this.convertContentBackendNameToFrontEndName(this.selectedContents[n],!0);return t},setSelectedContents:function(n){function r(n,t){for(var i=0;i<n.length;i++)if(n[i]==t)return!0}var i,t;for((typeof n=="undefined"||n==null)&&(n=["All"]),this.selectedContents=n,t=0;t<this.selectedContents.length;t++)this.selectedContents[t]=this.convertContentBackendNameToFrontEndName(this.selectedContents[t]);for(i=KSQ("#sew_contentChooserControl .sew_contentOptionItem"),t=0;t<i.length;t++)typeof i[t].checked!="undefined"&&(i[t].checked=r(n,i[t].value)),typeof i[t].selected!="undefined"&&(i[t].selected=r(n,i[t].value))},createContentControls:function(n){if(KSQ("#sew_contentChooserControl").empty(),n.CategoriesEnabled){for(var t=0;t<n.ContentCategories.length;t++)n.ContentCategories[t].Value=this.convertContentBackendNameToFrontEndName(n.ContentCategories[t].Value);KSQ("#sew_contentChooserControl").kjson2html(n,this.contentChooserTransform);KSQ("#sew_contentChooserControl input,#sew_contentChooserControl select").change(function(){var t=KSQ("#sew_contentChooserControl .sew_contentOptionItem"),n;for(keyotiCategoryChoosers.selectedContents=[],n=0;n<t.length;n++)(t[n].checked||t[n].selected)&&(keyotiCategoryChoosers.selectedContents[keyotiCategoryChoosers.selectedContents.length]=t[n].value);keyotiSearch.onContentChange(keyotiCategoryChoosers.selectedContents)});this.selectedContents!=null?this.setSelectedContents(this.selectedContents):this.setSelectedContents(["All"]);KSQ("#sew_contentChooserControl").css("visibility","visible")}},createChildControls:function(n){if(n.Exception!=null)keyotiResultViewer.onError({Message:n.Exception,StackTrace:""});else{keyotiCategoryChoosers.createLocationControls(n);keyotiCategoryChoosers.createContentControls(n);keyotiSearch.onCategoryControlsCreated(n)}}},keyotiSearchBox={searchOnEnter:!0,searchBoxControl:null,searchBox:null,searchButton:null,watermarkVisible:!0,watermarkText:"Search",buttonText:"Search",resultURL:null,init:function(){this.searchBoxControl==null&&(this.searchBoxControl=KSQ("#sew_searchBoxControl"));this.searchBoxControl.length>0&&(this.ensureSearchBoxChildControls(),keyotiSearchAutocomplete&&keyotiSearchAutocomplete.init(),this.searchBox.keydown(function(n){n.keyCode==13&&keyotiSearchBox.searchOnEnter&&(keyotiSearchBox.doSearch(),n.preventDefault())}),this.watermarkVisible&&(KSQ("#sew_searchBox").val(this.watermarkText).addClass("sew_watermark"),KSQ("#sew_searchBox").blur(function(){KSQ(this).val().length==0&&KSQ(this).val(keyotiSearchBox.watermarkText).addClass("sew_watermark")}),KSQ("#sew_searchBox").focus(function(){KSQ(this).val()==keyotiSearchBox.watermarkText&&KSQ(this).val("").removeClass("sew_watermark")})))},doSearch:function(n){typeof n!="string"&&(n=keyotiSearchBox.getQuery());keyotiSearch.search(n,1)},setQuery:function(n){KSQ("#sew_searchBox").val(n).removeClass("sew_watermark")},getQuery:function(){return KSQ("#sew_searchBox").hasClass("sew_watermark")&&this.setQuery(""),KSQ("#sew_searchBox")[0].value},ensureSearchBoxChildControls:function(){var t,n;this.searchBox=KSQ("#sew_searchBox");this.searchBox.length==0&&(t=document.createElement("input"),t.setAttribute("type","text"),t.setAttribute("id","sew_searchBox"),this.searchBoxControl[0].appendChild(t),this.searchBox=KSQ("#sew_searchBox"));this.searchButton=KSQ("#sew_searchButton");this.searchButton.length==0&&(n=document.createElement("input"),n.setAttribute("type","button"),n.setAttribute("id","sew_searchButton"),n.setAttribute("value",this.buttonText),this.searchBoxControl[0].appendChild(n),this.searchButton=KSQ("#sew_searchButton"),this.searchButton.click(keyotiSearchBox.doSearch))}},keyotiSearch={highlightKeywordsInResultDocument:!0,commonFolderUrl:"/Keyoti_SearchEngine_Web_Common",useWCFService:!0,updateOnOptionChange:!0,resultKeywordParameterName:"searchunitkeywords",indexDirectory:"~/Keyoti_Search_Index",language:"",customDictionaryPath:"",spellingSuggestionSource:"PresetDictionary",pageNumber:1,query:null,queryKeywords:[],resultsPerPage:10,keywordHighlightPattern:"<span class='sew_resultHighlight'>{0}<\/span>",securityGroups:[],onLocationChange:function(){this.query!=null&&this.updateOnOptionChange&&this.showPage(1,!0)},onContentChange:function(){this.query!=null&&this.updateOnOptionChange&&this.showPage(1,!0)},onCategoryControlsCreated:function(){},onFilterChange:function(){this.query!=null&&this.updateOnOptionChange&&this.showPage(1,!0)},onSortChange:function(){this.query!=null&&this.updateOnOptionChange&&this.showPage(1,!0)},_queryStringParameters:null,_getQueryStringParameters:function(){return this._queryStringParameters==null&&(this._queryStringParameters={},this._queryStringParameters=window.location.search.length>1?this._parseQueryStringParameters(window.location.search):{}),this._queryStringParameters},_parseQueryStringParameters:function(n){for(var r={},t,i=0,u=n.substr(1).split("&");i<u.length;i++)t=u[i].split("="),r[decodeURIComponent(t[0])]=t.length>1?decodeURIComponent(t[1]):"";return r},_onDocumentReady:function(){var n,t;keyotiCategoryChoosers.init();keyotiCustomDataFilters.init();keyotiSearchCloud.init();keyotiResultViewer.init();keyotiSearchBox.init();keyotiCustomDataSort.init();keyotiSearch.updateSearchCloud();keyotiSearch.serviceProxy.invoke("GetLocationAndContentCategories",{indexDirectory:keyotiSearch.indexDirectory},keyotiCategoryChoosers.createChildControls,keyotiResultViewer.onError);n=window.History;n.enabled&&(n.Adapter.bind(window,"statechange",keyotiSearch._onHistoryStateChange),t=n.getState(),t!=null&&keyotiSearch._reconstructSearchFromParameters())},updateSearchCloud:function(){keyotiSearchCloud.isEnabled&&keyotiSearch.serviceProxy.invoke("GetSearchCloud",{indexDirectory:keyotiSearch.indexDirectory,numberOfQueries:keyotiSearchCloud.numberOfQueriesToGet},keyotiSearchCloud.createChildControls,keyotiResultViewer.onError)},createCustomDataSortControl:function(){keyotiCustomDataSort.createChildControls()},_onHistoryStateChange:function(){var n=History.getState();keyotiSearch._queryStringParameters=null;n!=null&&n.data!=null&&n.data.resultObject!=null?(keyotiSearch.load(n.data),keyotiSearch.presentResults()):keyotiSearch._reconstructSearchFromParameters()},presentResults:function(){for(var r,u,f,t,i=[],n=0;n<keyotiSearch.resultObject.Results.length;n++){if(r="",keyotiSearch.resultObject.Results[n].KeywordHitMap!=null)for(t=0;t<keyotiSearch.resultObject.Results[n].KeywordHitMap.length;t++)r+=keyotiSearch.resultObject.Results[n].KeywordHitMap[t].Keyword+"="+keyotiSearch.resultObject.Results[n].KeywordHitMap[t].Hits,t<keyotiSearch.resultObject.Results[n].KeywordHitMap.length-1&&(r+=", ");if(keyotiSearch.resultObject.Results[n].KeywordHitMap=r,typeof keyotiSearch.resultObject.Results[n].CustomDataDictionary!="undefined")for(t=0;t<keyotiSearch.resultObject.Results[n].CustomDataDictionary.length;t++)keyotiSearch.resultObject.Results[n].CustomDataDictionary[keyotiSearch.resultObject.Results[n].CustomDataDictionary[t].Name]=keyotiTemplateUtility.formatCustomData(keyotiSearch.resultObject.Results[n].CustomDataDictionary[t].Name,keyotiSearch.resultObject.Results[n].CustomDataDictionary[t].Value)}for(u=keyotiResultViewer.resultItemTransform.html,f=/\$\{CustomDataDictionary\.(.*?)DisplayClass\}/gi;(result=f.exec(u))!==null;)i[i.length]=result[1];for(n=0;n<keyotiSearch.resultObject.Results.length;n++)if(typeof keyotiSearch.resultObject.Results[n].CustomDataDictionary!="undefined")for(t=0;t<i.length;t++)keyotiSearch.resultObject.Results[n].CustomDataDictionary[i[t]+"DisplayClass"]=keyotiTemplateUtility.getDisplayClass(i[t],keyotiSearch.resultObject.Results[n].CustomDataDictionary[i[t]]);this.highlightResultItems(keyotiSearch.resultObject.Results);this._addQueryKeywordsTo(keyotiSearch.resultObject.Results);keyotiResultViewer.showSearchResults(this.getHeaderJSON(),this.resultObject.Results,this.getFooterJSON());(this.resultObject.SuggestedSearchExpression==null||this.resultObject.SuggestedSearchExpression.length==0)&&KSQ("#sew_didYouMean").hide();this.resultObject.IgnoredWords.length==0&&KSQ("#sew_ignoredWords").hide()},_addQueryKeywordsTo:function(n){var t,i;for(console.log(n),t=0;t<n.length;t++)this.highlightKeywordsInResultDocument?(i=n[t].UriString.indexOf("?")>-1?"&":"?",n[t].UriStringWithKeywords=n[t].UriString+i+keyotiSearch.resultKeywordParameterName+"="+encodeURIComponent(keyotiSearch.queryKeywords)):n[t].UriStringWithKeywords=n[t].UriString},highlightResultItems:function(n){console.log(n);for(var t=0;t<n.length;t++)(n[t].Title.toLowerCase().indexOf("tpfr")>-1||n[t].Title.toLowerCase().indexOf("tppfr")>-1)&&(n[t].Summary="No Summary Available"),n[t].Summary=this.highlightText(n[t].Summary),n[t].Title=this.highlightText(n[t].Title)},highlightText:function(n,t){var i,r,u;for(typeof t=="undefined"&&(t=this.keywordHighlightPattern),RegExp.k_escape=function(n){return n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},i=0;i<this.queryKeywords.length;i++)keyotiSearch.queryKeywords[i].length>0&&(r=new RegExp("\\b("+RegExp.k_escape(keyotiSearch.queryKeywords[i])+")\\b","gi"),u=new RegExp("("+RegExp.k_escape(keyotiSearch.queryKeywords[i])+")","gi"),n=/\w/.test(keyotiSearch.queryKeywords[i].charAt(0))&&/\w/.test(keyotiSearch.queryKeywords[i].charAt(keyotiSearch.queryKeywords[i].length-1))?n.replace(r,t.replace("{0}","$1")):n.replace(u,t.replace("{0}","$1")));return n},htmlEscape:function(n){return String(n).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},getHeaderJSON:function(){var t=Math.ceil(this.resultObject.NumberOfResults/this.resultsPerPage),n="";return this.resultObject.IgnoredWords==null&&(this.resultObject.IgnoredWords=[]),this.resultObject.SuggestedSearchExpression!=null&&this.resultObject.SuggestedSearchExpression.length>0&&(n=this.resultObject.SuggestedSearchExpression.replace(/\\/g,"\\\\").replace(/'/g,"\\'")),{Query:this.htmlEscape(this.query),NumberOfResults:this.resultObject.NumberOfResults,IgnoredWords:this.resultObject.IgnoredWords.toString().replace(/,/g,", "),SuggestedSearchExpression:this.resultObject.SuggestedSearchExpression,SuggestedSearchExpressionEscaped:n,PageNumber:this.pageNumber,NumberOfPages:t}},getFooterJSON:function(){var n=Math.ceil(this.resultObject.NumberOfResults/this.resultsPerPage);return{PageNumber:this.pageNumber,NumberOfPages:n,PreviousPageLink:this.pageNumber>1?'<a href="javascript: keyotiSearch.previousPage();">Previous<\/a>':"",NextPageLink:this.pageNumber<n?'<a href="javascript: keyotiSearch.nextPage();">Next<\/a>':"",PageLinksBlock:this.getPagingLinksBlock(this.pageNumber,n)}},getPagingLinksBlock:function(n,t){var f="",r,u,i;for(r=n-5,u=n+5,n<=5&&(r=1,u=10),n>t-5&&(r=n-5-(t-n),u=t),i=r;i<=u;i++)i>0&&i<=t&&(f+=i==n?i+" ":'<a href="javascript: keyotiSearch.showPage('+i+');">'+i+"<\/a> ");return f},load:function(n){this.resultObject=n.resultObject;this.pageNumber=n.pageNumber;this.query=n.query;keyotiCategoryChoosers.setSelectedLocation(n.location);keyotiCategoryChoosers.setSelectedContents(n.contents);keyotiCustomDataFilters.setFilterCollection(n.customDataFilters);keyotiCustomDataSort.setSortBy(n.sortBy)},abortedSearchAttempts:0,search:function(n,t,i){if(this.serviceProxy.isBusy){this.abortedSearchAttempts++<90?setTimeout(function(){keyotiSearch.search(n,t,i)},500):this.abortedSearchAttempts=0;return}if(this.abortedSearchAttempts=0,this.pageNumber=t||1,this.query=n,keyotiSearchBox.resultURL!=null){location.href=keyotiSearchBox.resultURL+keyotiSearch.makeQueryStringForSearchParameters();return}keyotiResultViewer.showResultsLoadingAnim(!0);keyotiResultViewer.openResultsControlPanel();this._blockPushStateToHistory=i;this._doSearch(this._searchCallBackHandler)},_searchCallBackHandler:function(n){keyotiSearch.resultObject=n;keyotiSearch.queryKeywords=n.QueryKeywords;n.LiveDataSamples!=null&&keyotiCustomDataFilters.updateWithLiveDataSamples(n.LiveDataSamples);var t=n.Exception!=null;if(keyotiResultViewer.clearLoadingAnimTimeout(),t)keyotiResultViewer.onError({Message:n.Exception,StackTrace:""});else keyotiSearch._blockPushStateToHistory?keyotiSearch.presentResults():keyotiSearch._pushSearchToHistory(),keyotiResultViewer.hideResultsLoadingAnim();keyotiSearch._blockPushStateToHistory=!1;keyotiSearch.updateSearchCloud()},makeQueryStringForSearchParameters:function(){var n=keyotiSearch._getQueryStringParameters(),t,i,r,u;n.query=encodeURIComponent(keyotiSearch.query);n.pageNumber=keyotiSearch.pageNumber;n.location=encodeURIComponent(keyotiCategoryChoosers.getSelectedLocation());n.contents=encodeURIComponent(keyotiCategoryChoosers.getSelectedContents());n.customDataFilters=encodeURIComponent(JSON.stringify(keyotiCustomDataFilters.getRequestFilterCollection()));n.sortBy=encodeURIComponent(keyotiCustomDataSort.getSortBy());t="?";i=!1;for(r in n)u=n[r],t+=(i?"&":"")+r+"="+u,i=!0;return t},_pushSearchToHistory:function(){var n=keyotiSearch.makeQueryStringForSearchParameters();History.pushState({resultObject:keyotiSearch.resultObject,pageNumber:keyotiSearch.pageNumber,query:keyotiSearch.query,location:keyotiCategoryChoosers.getSelectedLocation(),contents:keyotiCategoryChoosers.getSelectedContents(),customDataFilters:keyotiCustomDataFilters.getRequestFilterCollection(),sortBy:keyotiCustomDataSort.getSortBy()},"Search page "+keyotiSearch.pageNumber,n)},_reconstructSearchFromParameters:function(){var n=keyotiSearch._getQueryStringParameters();n.query!=null?(keyotiSearchBox.setQuery(n.query),keyotiCategoryChoosers.setSelectedLocation(n.location),keyotiCategoryChoosers.setSelectedContents(n.contents?n.contents.split(","):[]),typeof n.customDataFilters!="undefined"&&keyotiCustomDataFilters.setFilterCollection(JSON.parse(n.customDataFilters)),typeof n.sortBy!="undefined"&&n.sortBy!="null"&&keyotiCustomDataSort.setSortBy(n.sortBy),keyotiSearch.search(n.query,n.pageNumber!=null?parseInt(n.pageNumber):1,!0),keyotiResultViewer.openResultsControlPanel(!0)):(keyotiCustomDataFilters.resetFilterCollection(),keyotiResultViewer.hideSearchResults(!0))},nextPage:function(){this.showPage(this.pageNumber+1)},previousPage:function(){this.showPage(this.pageNumber-1)},showPage:function(n,t){t||keyotiResultViewer.scrollTop();this.pageNumber=n;keyotiResultViewer.showResultsLoadingAnim(!0);this._doSearch(this._searchCallBackHandler)},_doSearch:function(n){this.serviceProxy.invoke("GetResults",{indexDirectory:this.indexDirectory,query:this.query,resultPage:this.pageNumber,resultsPerPage:this.resultsPerPage,locationName:keyotiCategoryChoosers.getSelectedLocation(),contentNames:keyotiCategoryChoosers.getSelectedContents(),securityGroupNames:this.getSecurityGroups(),filterCollection:keyotiCustomDataFilters.getRequestFilterCollection(),sortBy:keyotiCustomDataSort.getSortBy(),language:this.language,customDictionaryPath:this.customDictionaryPath,spellingSuggestionSource:this.spellingSuggestionSource},n,keyotiResultViewer.onError)},getSecurityGroups:function(){return this.securityGroups==null||this.securityGroups.length==0?[""]:this.securityGroups},serviceProxy:new function(){var n=this;this.isBusy=!1;this.appendURLString="";this.diagnoseWCFProblem=function(){this.invoke("GetSearchCloud","",null,null,null,"GET")};this.invoke=function(t,i,r,u,f,e){var o,s;typeof e=="undefined"&&(e="POST");this.serviceUrl=keyotiSearch.useWCFService?keyotiSearch.commonFolderUrl+"/SearchService.svc/":keyotiSearch.commonFolderUrl+"/SearchWebService.asmx/";this.isBusy=!0;o=n.serviceUrl+t+this.appendURLString;keyotiSearch.useWCFService?(s=JSON.stringify(i),console.log("Using WCF service .NET 4"),KSQ.ajax({url:o,data:s,type:e,processData:!1,contentType:"application/json",timeout:3e4,dataType:"text",success:function(n){var t,i;if(keyotiSearch.serviceProxy.isBusy=!1,r){if(t=JSON.parse(n),f){r(t);return}for(i in t){r(t[i]);break}}},error:function(n,t){if(n.status==500&&n.responseText.length==0&&keyotiSearch.serviceProxy.diagnoseWCFProblem(),keyotiSearch.serviceProxy.isBusy=!1,n.responseText.indexOf("Version:2.0")>-1&&alert("It appears that you are running .NET 2 on the server, therefore you must call this Javascript in your page:\r\n\r\nkeyotiSearch.useWCFService=false;\r\n\r\nDoing that will use the .NET 2 ASMX Web Service instead of .NET 4 WCF"),u){if(n.responseText){var i;try{i=JSON.parse(n.responseText)}catch(r){i={Message:"URL:"+this.url+"\r\n\r\n"+n.responseText}}i?(i.Message+="\r\nURL:"+this.url,u(i)):u({Message:"Unknown server error.\r\nURL:"+this.url})}else t&&(t=="timeout"&&(t="Sorry the server has not responded, please try again."),t=="error"&&(t=n.status==404?n.status+' error from server.  \r\nTry calling (in Javascript) \r\n\r\nkeyotiSearch.commonFolderUrl = "/Keyoti_SearchEngine_Web_Common/";\r\n\r\nwith the correct path to the folder that contains SearchService.svc and/or SearchWebService.asmx\r\n':n.status+" error from server."),u({Message:t+"\r\n\r\nURL:"+this.url,StackTrace:""}));return}}})):(console.log("Using web service .NET"),typeof i.filterCollection!="undefined"&&(i.filterCollection=JSON.stringify(i.filterCollection)),KSQ.ajax({url:o,data:i,type:e,processData:!0,contentType:"application/x-www-form-urlencoded",timeout:3e4,dataType:"text",success:function(n){var u,e,t,i;if(keyotiSearch.serviceProxy.isBusy=!1,r){if(u=n.indexOf("{"),e=n.lastIndexOf("}"),f=!0,t=null,u>-1&&e>-1&&(t=JSON.parse(n.substring(u,e+1))),f){r(t);return}for(i in t){if(t[i].exception!=null&&t[i].exception.length>0){alert(t[i].exception);return}if(t[i].Exception!=null&&t[i].Exception.length>0){alert(t[i].Exception);return}r(t[i]);break}}},error:function(n,t){if(keyotiSearch.serviceProxy.isBusy=!1,u){if(n.responseText){var i=n.responseText;i?u({Message:i+"\r\nURL:"+this.url,StackTrace:""}):u({Message:"Unknown server error.",StackTrace:""})}else t&&(t=="timeout"&&(t="Sorry the server has not responded, please try again."),t=="error"&&(t=n.status==404?n.status+' error from server.  \r\nTry calling (in Javascript) \r\n\r\nkeyotiSearch.commonFolderUrl = "/Keyoti_SearchEngine_Web_Common/";\r\n\r\nwith the correct path to the folder that contains SearchService.svc and/or SearchWebService.asmx\r\n':n.status+" error from server."),u({Message:t+"\r\n\r\nURL:"+this.url,StackTrace:""}));return}}}))}}},keyotiResultViewer={showResultsLoadingAnimPause:10,resultControlPanelInitialWidth:-1,resultControlPanelInitialHeight:500,resultControlPanelAnimationTime:300,showResultsLoadingAnimTimeout:null,resultsPanelIsOpen:!0,resultControlPanel:null,resultListPanel:null,resultHeaderPanel:null,resultFooterPanel:null,resultViewPanel:null,resultObject:null,ensureChildControls:function(){var i=KSQ(".sew_ajax_loader_backer"),n,t;i.length==0&&KSQ("#sew_searchResultControl").append('<div class="sew_ajax_loader_backer"><div class="sew_ajax_loader"><\/div><\/div>');n=KSQ(".sew_ajax_error");n.length==0&&KSQ("#sew_searchResultControl").append('<div class="sew_ajax_error"><span class="sew_errorTitle">Error<\/span><p class="sew_errorBody"><\/p><div class="sew_ajax_error_footer"><input type="button" value="OK" id="sew_errorOKButton" /><\/div><\/div>');t=KSQ("#sew_resultView");t.length==0&&KSQ("#sew_searchResultControl").append('<div id="sew_resultView"><div id="sew_resultHeader"><\/div><div id="sew_resultList"><\/div><div id="sew_resultFooter"><\/div><\/div>')},onError:function(n){keyotiResultViewer.showServerError(n);keyotiResultViewer.getResultControlPanel().removeClass("loading")},init:function(){this.ensureChildControls();KSQ("#sew_errorOKButton").click(keyotiResultViewer.onErrorOKButton_Click);keyotiResultViewer.resultItemTransform={tag:"div","class":"sew_resultItem",html:'                                                                                                                                                                    <span class="sew_resultItemLink"><a href="${UriStringWithKeywords}">${Title}<\/a><\/span>                                                                                                         <span class="sew_resultItemSummary">${Summary}<\/span>                                                                                                                               <span class="sew_previewResultWrapper"><img alt="Click to preview the document text" src="'+keyotiSearch.commonFolderUrl+"/ResultPreview_Expander_Closed.png\"                                            onclick=\"keyotiSearchResultPreviewer.toggleResultPreview(this,                                                                                                                                              '${UriStringAsStored}',                                                                                                                                                   '"+keyotiSearch.commonFolderUrl+"/ResultPreview_Expander_Closed.png',                                                                                                                              '"+keyotiSearch.commonFolderUrl+'/ResultPreview_Expander_Opened.png\')"/>                                                                                                                       <span class="sew_previewResultContent">Loading document...<\/span><\/span>                                                                                                            <div style="clear:both; height:1px;"><\/div>                                                                                                                                             <span class="sew_resultItemURL">${UriString}<\/span>                                                                                                                                                                                                                                                                   <span class="sew_location">${Location}<\/span>                                                                                                                                              <span class="sew_location">${Content}<\/span>                                                                                                                                                                                                                                                                                                                            '};keyotiResultViewer.resultHeaderTransform={tag:"div",html:'<div class="sew_header">Showing result page <b>${PageNumber}<\/b>. There are <b>${NumberOfResults}<\/b> results for <b>&#8220;${Query}&#8221;<\/b>. <span id="sew_ignoredWords">The following common words were ignored: ${IgnoredWords}<\/span><\/div><div id="sew_didYouMean">Did you mean: <a href="#stayhere" onclick="keyotiSearch.search(\'${SuggestedSearchExpressionEscaped}\', 1)">${SuggestedSearchExpression}<\/a><\/div>'};keyotiResultViewer.resultFooterTransform={tag:"div",html:'<div class="sew_footer"><span id="previousPageLink">${PreviousPageLink}<\/span> <span id="pageLinksBlock">${PageLinksBlock}<\/span><span id="nextPageLink">${NextPageLink}<\/span><\/div>'};keyotiTemplateUtility.readTemplate(this.resultItemTransform,"sew_resultItemTEMPLATE");keyotiTemplateUtility.readTemplate(this.resultFooterTransform,"sew_footerTEMPLATE");keyotiTemplateUtility.readTemplate(this.resultHeaderTransform,"sew_headerTEMPLATE")},scrollTop:function(n){var t;t=n?0:keyotiResultViewer.getResultControlPanel().offset().top;KSQ("html, body").animate({scrollTop:t},500)},resultItemTransform:null,resultHeaderTransform:null,resultFooterTransform:null,getResultControlPanel:function(){return this.resultControlPanel==null&&(this.resultControlPanel=KSQ("#sew_searchResultControl")),this.resultControlPanel},getResultViewPanel:function(){return this.resultViewPanel==null&&(this.resultViewPanel=KSQ("#sew_resultView")),this.resultViewPanel},getResultListPanel:function(){return this.resultListPanel==null&&(this.resultListPanel=KSQ("#sew_resultList")),this.resultListPanel},getResultHeaderPanel:function(){return this.resultHeaderPanel==null&&(this.resultHeaderPanel=KSQ("#sew_resultHeader")),this.resultHeaderPanel},getResultFooterPanel:function(){return this.resultFooterPanel==null&&(this.resultFooterPanel=KSQ("#sew_resultFooter")),this.resultFooterPanel},openResultsControlPanel:function(n){this.getResultControlPanel().length==0?alert("Search could not find required element with id='sew_searchResultControl', please add <div id='sew_searchResultControl'><\/div> to your page to display search results"):this.resultsPanelIsOpen||(this.resultsPanelIsOpen=!0,n?this.getResultControlPanel().show():this.getResultControlPanel().slideToggle(n?0:this.resultControlPanelAnimationTime))},closeResultsControlPanel:function(n){this.resultsPanelIsOpen&&(this.resultsPanelIsOpen=!1,n?this.getResultControlPanel().hide():this.getResultControlPanel().slideToggle(n?0:this.resultControlPanelAnimationTime))},showSearchResults:function(n,t,i){this.openResultsControlPanel();this.getResultListPanel().empty();this.getResultHeaderPanel().empty();this.getResultFooterPanel().empty();this.getResultHeaderPanel().kjson2html(n,this.resultHeaderTransform);keyotiSearch.createCustomDataSortControl();this.getResultListPanel().kjson2html(t,this.resultItemTransform);this.getResultFooterPanel().kjson2html(i,this.resultFooterTransform);this.hideResultsLoadingAnim();this.expandResultControlPanel()},hideSearchResults:function(n){this.closeResultsControlPanel(n);this.getResultListPanel().empty();this.getResultHeaderPanel().empty();this.getResultFooterPanel().empty()},_getLicensingError:function(n){var r=n.substring(n.indexOf(":")+1,n.indexOf("\r")),t=r.split("|"),i="Sorry, SearchUnit is either not licensed to run on this server or this web site.\n\nPlease double check your license key and ensure it is set in the web.config per the Help.\n\n";return i+="Server name: "+t[1]+"\n",i+="Server IP: "+t[0]+"\n",i+="Installed level: "+t[2]+"\n",t[3].length>0&&(i+=t[3]+"\n"),i+("Assembly: "+t[4]+"\n")},showServerError:function(n){var t,r;if(n?n=n.Message.indexOf("License")>-1&&n.Message.indexOf("|")>-1?this._getLicensingError(n.Message):n.Message+" \n"+n.StackTrace:keyotiSearch.Exception&&(n=keyotiSearch.Exception),n+="\r\n\r\nkeyotiSearch.useWCFService="+keyotiSearch.useWCFService,this.getResultControlPanel().length==0)alert(n.toString());else{this.openResultsControlPanel(!0);n=n.replace(/\n/g,"<br />");t=this.getResultControlPanel();r=t.height();r<100&&(t.height(this.resultControlPanelInitialHeight),r=this.resultControlPanelInitialHeight);var f=t.offset(),u=t.width(),i=r/4;i<150?i=150:i>700&&(i=700);this.getResultControlPanel().addClass("error");KSQ(".sew_ajax_error").css({position:"absolute",left:u/2+"px",top:i+"px","margin-left":-KSQ(".sew_ajax_error").width()/2,"margin-top":-KSQ(".sew_ajax_error").height()/2});KSQ(".sew_errorBody").html(n)}},hideServerError:function(){this.getResultControlPanel().removeClass("error")},onErrorOKButton_Click:function(){keyotiResultViewer.hideServerError()},clearLoadingAnimTimeout:function(){this.showResultsLoadingAnimTimeout!=null&&clearTimeout(this.showResultsLoadingAnimTimeout)},showResultsLoadingAnim:function(n){this.clearLoadingAnimTimeout();this.showResultsLoadingAnimTimeout=setTimeout(function(){var t,i,n;console.log("showing loading ");keyotiResultViewer.getResultControlPanel().addClass("loading");t=keyotiResultViewer.getResultControlPanel().height();t<100&&(t=keyotiResultViewer.resultControlPanelInitialHeight);var f=keyotiResultViewer.getResultControlPanel().offset(),r=keyotiResultViewer.getResultControlPanel().width(),u=KSQ(".sew_ajax_loader_backer");u.css({position:"absolute",left:"0",top:"0",height:t+"px",width:r+"px"});i=KSQ(".sew_ajax_loader");i.html("<img alt='loading image' src='"+keyotiSearch.commonFolderUrl+"/ajax-result-loader.gif' /><br/>Loading...");n=t/4;n<100?n=100:n>700&&(n=700);i.css({position:"absolute",left:r/2+"px",top:n+"px",height:"100px",width:"200px","margin-left":"-100px","margin-top":"-50px"})},n?this.showResultsLoadingAnimPause:0)},hideResultsLoadingAnim:function(){var t=KSQ(".sew_ajax_loader_backer"),n;t.css({height:"0px",width:"0px"});n=KSQ(".sew_ajax_loader");n.css({height:"0px",width:"0px"});this.getResultControlPanel().removeClass("loading")},resultViewPanelWidth:-1,expandResultControlPanel:function(n){var t,i;this.resultControlPanelInitialWidth==-1?(t=this.getResultViewPanel().width(),this.resultControlPanelInitialWidth=t):t=this.resultControlPanelInitialWidth;typeof n=="undefined"&&(n=0);i=this.getResultViewPanel().height()+50+n;this.getResultControlPanel().animate({opacity:1,width:t,height:i},this.resultControlPanelAnimationTime)},shrinkResultControlPanel:function(n){var i=this.getResultViewPanel().width(),t;typeof n=="undefined"&&(n=0);t=this.getResultControlPanel().height()-n;this.getResultControlPanel().animate({opacity:1,width:i,height:t},this.resultControlPanelAnimationTime)}},keyotiSearchAutocomplete={sew_failSilent:!1,filterFilenames:!0,options:{sew_queryTextBoxID:"sew_searchBox",sew_searchButtonID:"btnAdd",indexDirectory:null,sew_numberOfSuggestions:"5",sew_runSearchOnSelect:!0,sew_showNumberOfResults:!1,sew_autoCompleteQueryLoadPlugin:!1,sew_source:"PopularSearchesAndLexicon",sew_hideNoResulters:!1},sew_OC:{},sew_queryTB:null,sew_menuShiftX:0,sew_menuShiftY:0,dataReceived:function(){},sew_item_selected:function(){keyotiSearchAutocomplete.options.sew_runSearchOnSelect?keyotiSearchBox.doSearch():keyotiSearchBox.searchBox.focus()},sew_formatItem:function(n){return"<span class='sew_suggestion'>"+n[0].replace(/</g,"&lt;").replace(/>/g,"&gt;")+"<\/span><span class='sew_results'>"+(n[1]!="-1"&&typeof n[1]!="undefined"?n[1]:"")+"<\/span>"},init:function(){KSQ("#"+keyotiSearchAutocomplete.options.sew_queryTextBoxID).autocomplete(null,{delay:50,minChars:1,matchSubset:0,matchContains:1,cacheLength:1,formatItem:keyotiSearchAutocomplete.sew_formatItem,autoFill:!1,onItemSelect:keyotiSearchAutocomplete.sew_item_selected,extraParams:{cl:"SBAC",id:keyotiSearchAutocomplete.options.indexDirectory!=null?keyotiSearchAutocomplete.options.indexDirectory:keyotiSearch.indexDirectory,tl:keyotiSearchAutocomplete.options.sew_showNumberOfResults,n:keyotiSearchAutocomplete.options.sew_numberOfSuggestions,p:keyotiSearchAutocomplete.options.sew_autoCompleteQueryLoadPlugin?"1":"0",s:keyotiSearchAutocomplete.options.sew_source,hd:keyotiSearchAutocomplete.options.sew_hideNoResulters},sew_searchButtonID:keyotiSearchAutocomplete.options.sew_searchButtonID,sew_runSearchOnSelect:keyotiSearchAutocomplete.options.sew_runSearchOnSelect,sew_searchPostback:keyotiSearchAutocomplete.options.sew_searchPostback});keyotiSearchAutocomplete.sew_queryTB=KSQ("#"+keyotiSearchAutocomplete.options.sew_queryTextBoxID)[0];keyotiSearchAutocomplete.sew_queryTB!=null&&sew_copyComputedStyle(KSQ.style(".sew_suggestion"),keyotiSearchAutocomplete.sew_queryTB);keyotiSearchAutocomplete.sew_queryTB!=null&&sew_copyComputedStyle(KSQ.style(".sew_results"),keyotiSearchAutocomplete.sew_queryTB,"nocolor")}};KSQ.autocomplete=function(n,t){function b(){r={};r.data={};r.length=0}function ft(){if(c==46||c>8&&c<32)return u.hide();var n=i.val();n!=h&&(h=n,n.length>=t.minChars?(i.addClass(t.loadingClass),vt(n)):(i.removeClass(t.loadingClass),u.hide()))}function tt(n){var t=KSQ("li",e);t&&(f+=n,f<0?f=0:f>=t.size()&&(f=t.size()-1),t.removeClass("sew_ac_over"),t[f]&&KSQ(t[f]).addClass("sew_ac_over"),i.val(KSQ(t[f])[0].selectValue))}function d(r){r||(r=document.createElement("li"),r.extra=[],r.selectValue="");var f=KSQ.trim(r.selectValue?r.selectValue:r.innerHTML);n.lastSelected=f;h=f;u.html("");i.val(f);a();t.onItemSelect&&setTimeout(function(){t.onItemSelect(r,t)},1)}function et(n,t){var r=i.get(0),u;r.createTextRange?(u=r.createTextRange(),u.collapse(!0),u.moveStart("character",n),u.moveEnd("character",t),u.select()):r.setSelectionRange?r.setSelectionRange(n,t):r.selectionStart&&(r.selectionStart=n,r.selectionEnd=t);r.focus()}function ot(n){c!=8&&(i.val(i.val()+n.substring(h.length)),et(h.length,n.length))}function st(){var r=kt(n),f=t.width>0?t.width:i.width();u.css({width:parseInt(f)+"px",top:r.y+n.offsetHeight+keyotiSearchAutocomplete.sew_menuShiftY+"px",left:r.x+keyotiSearchAutocomplete.sew_menuShiftX+"px"}).show()}function ht(){o&&clearTimeout(o);o=setTimeout(a,200)}function a(){if(typeof keyotiSearchAutocomplete.sew_autocomplete_nohide=="undefined"&&(o&&clearTimeout(o),i.removeClass(t.loadingClass),u.is(":visible")&&u.hide(),t.mustMatch)){var r=i.val();r!=n.lastSelected&&d(null)}}function it(n,r){var f,s,o;if(r){if(keyotiSearchAutocomplete.filterFilenames)for(f=0;f<r.length;f++)(s=r[f][0].indexOf("."))>-1&&s<r[f][0].length-4&&(o=r[f][0].substring(s,s+4),(o==".htm"||o==".pdf"||o==".asp"||o==".doc"||o==".jsp"||o==".xls")&&r.splice(f--,1));if(keyotiSearchAutocomplete.dataReceived(r,n),i.removeClass(t.loadingClass),e.innerHTML="",!w||r.length==0)return a();KSQ.browser.msie&&u.append(document.createElement("iframe"));e.appendChild(at(r));t.autoFill&&i.val().toLowerCase()==n.toLowerCase()&&ot(r[0][0]);st()}else a()}function ct(n){var r,f,u,i,e;if(!n)return null;for(r=[],f=n.split(t.lineSeparator),u=0;u<f.length;u++)i=KSQ.trim(f[u]),i.indexOf("~Exception/")>-1?(e=i.substring(11),rt("An exception occurred on the server: "+e)):i&&(r[r.length]=lt(i,t.cellSeparator));return r}function lt(n,t){var i=n.lastIndexOf(t);return i==-1?[n]:[n.substring(0,i),n.substring(i+1)]}function at(n){var o=document.createElement("ul"),s=n.length,u,i,r,e,h;for(t.maxItemsToShow>0&&t.maxItemsToShow<s&&(s=t.maxItemsToShow),u=0;u<s;u++)if(i=n[u],i){if(r=document.createElement("li"),t.formatItem?(r.innerHTML=t.formatItem(i,u,s,r),r.selectValue=i[0]):(r.innerHTML=i[0],r.selectValue=i[0]),e=null,i.length>1)for(e=[],h=1;h<i.length;h++)e[e.length]=i[h];r.extra=e;o.appendChild(r);KSQ(r).hover(function(){KSQ("li",o).removeClass("sew_ac_over");KSQ(this).addClass("sew_ac_over");f=KSQ("li",o).indexOf(KSQ(this).get(0))},function(){KSQ(this).removeClass("sew_ac_over")}).click(function(n){n.preventDefault();n.stopPropagation();d(this)})}return o}function vt(n){t.matchCase||(n=n.toLowerCase());var i=null;i?it(n,i):(v!=null&&clearTimeout(v),v=setTimeout(yt,1e4),t.extraParams.q=n,keyotiSearch.serviceProxy.invoke("GetAutoComplete",t.extraParams,function(t){var u,i,r;if(clearTimeout(v),t.Exception!=null)keyotiResultViewer.onError({Message:t.Exception,StackTrace:""});else{for(u=t.Items,i=[],r=0;r<u.length;r++)i[i.length]=[u[r].Query,u[r].NumberOfResults];typeof keyotiSearchAutocomplete.sew_OnAutoCompleteSuggestionsGenerated=="function"&&keyotiSearchAutocomplete.sew_OnAutoCompleteSuggestionsGenerated(n,i);nt(n,i);it(n,i)}},function(n){keyotiResultViewer.showServerError(n);keyotiResultViewer.getResultControlPanel().removeClass("loading")}))}function yt(){rt('Sorry the server didn\'t respond to the AutoComplete request, please ensure you have added <add verb="*" path="Keyoti.SearchEngine.Web.CallBackHandler.ashx" type="Keyoti.SearchEngine.Web.CallBackHandler,Keyoti.SearchEngine.Web, Version=2015.6.16.510, Culture=neutral, PublicKeyToken=58d9fd2e9ec4dc0e"/> to your web.config - replacing ? with current version numbers, please see the user guide for more info.')}function rt(n){keyotiSearchAutocomplete.sew_failSilent||alert(n)}function pt(n){var i=t.url+"?q="+encodeURI(n);for(var r in t.extraParams)i+="&"+r+"="+encodeURI(t.extraParams[r]);return i+"&nocache="+Math.floor(Math.random()*99999)}function wt(n){var i,s,u,f,e,o,h;if(!n)return null;if(r.data[n])return r.data[n];if(t.matchSubset)for(i=n.length-1;i>=t.minChars;i--)if(s=n.substr(0,i),u=r.data[s],u){for(f=[],e=0;e<u.length;e++)o=u[e],h=o[0],bt(h,n)&&(f[f.length]=o);return f}return null}function bt(n,i){t.matchCase||(n=n.toLowerCase());var r=n.indexOf(i);return r==-1?!1:r==0||t.matchContains}function g(n,r){var h,u,e,f,o,s;for(r&&i.removeClass(t.loadingClass),h=r?r.length:0,u=null,e=0;e<h;e++)if(f=r[e],f[0].toLowerCase()==n.toLowerCase()){if(u=document.createElement("li"),t.formatItem?(u.innerHTML=t.formatItem(f,e,h,u),u.selectValue=f[0]):(u.innerHTML=f[0],u.selectValue=f[0]),o=null,f.length>1)for(o=[],s=1;s<f.length;s++)o[o.length]=f[s];u.extra=o}t.onFindValue&&setTimeout(function(){t.onFindValue(u)},1)}function nt(n,i){i&&n&&t.cacheLength&&(!r.length||r.length>t.cacheLength?(b(),r.length++):r[n]||r.length++,r.data[n]=i)}function kt(n){for(var t=n.offsetLeft||0,i=n.offsetTop||0;n=n.offsetParent;)t+=n.offsetLeft,i+=n.offsetTop;return{x:t,y:i}}var ut=this,i=KSQ(n).attr("autocomplete","off"),e,u,s,k,v;t.inputClass&&i.addClass(t.inputClass);e=document.createElement("div");u=KSQ(e);u.hide().addClass(t.resultsClass).css("position","absolute");t.width>0&&u.css("width",t.width);KSQ("body").append(e);n.autocompleter=ut;var o=null,h="",f=-1,r={},w=!1,c=null;if(b(),t.data!=null){var y="",l={},p=[];for(typeof t.url!="string"&&(t.cacheLength=1),s=0;s<t.data.length;s++)p=typeof t.data[s]=="string"?[t.data[s]]:t.data[s],p[0].length>0&&(y=p[0].substring(0,1).toLowerCase(),l[y]||(l[y]=[]),l[y].push(p));for(k in l)t.cacheLength++,nt(k,l[k])}i.keydown(function(n){c=n.keyCode;switch(n.keyCode){case 38:n.preventDefault();tt(-1);break;case 40:n.preventDefault();tt(1);break;case 9:case 13:i.get(0).blur();n.preventDefault();break;default:f=-1;o&&clearTimeout(o);o=setTimeout(function(){ft()},t.delay)}}).focus(function(){w=!0}).blur(function(){w=!1;ht()});a();v=null;this.flushCache=function(){b()};this.setExtraParams=function(n){t.extraParams=n};this.findValue=function(){var n=i.val(),r;t.matchCase||(n=n.toLowerCase());r=t.cacheLength?wt(n):null;r?g(n,r):typeof t.url=="string"&&t.url.length>0?KSQ.get(pt(n),function(t){t=ct(t);nt(n,t);g(n,t)}):g(n,null)}};KSQ.fn.autocomplete=function(n,t,i){return t=t||{},t.url=n,t.data=typeof i=="object"&&i.constructor==Array?i:null,t.inputClass=t.inputClass||"ac_input",t.resultsClass=t.resultsClass||"sew_ac_results",t.lineSeparator=t.lineSeparator||"\n",t.cellSeparator=t.cellSeparator||"|",t.minChars=t.minChars||1,t.delay=t.delay||400,t.matchCase=t.matchCase||0,t.matchSubset=t.matchSubset||1,t.matchContains=t.matchContains||0,t.cacheLength=t.cacheLength||1,t.mustMatch=t.mustMatch||0,t.extraParams=t.extraParams||{},t.loadingClass=t.loadingClass||"sew_ac_loading",t.selectFirst=t.selectFirst||!1,t.selectOnly=t.selectOnly||!1,t.maxItemsToShow=t.maxItemsToShow||-1,t.autoFill=t.autoFill||!1,t.width=parseInt(t.width,10)||0,this.each(function(){var n=this;new KSQ.autocomplete(n,t)}),this};KSQ.fn.autocompleteArray=function(n,t){return this.autocomplete(null,t,n)};KSQ.fn.indexOf=function(n){for(var t=0;t<this.length;t++)if(this[t]==n)return t;return-1};KSQ.style=function(n,t){var i,r;return t=KSQ.extend({type:"text/css",media:"all"},t),i=KSQ.style.sheets[t.media],i||(r=KSQ(document.createElement("style")).attr(t).appendTo("head")[0],r.styleSheet?KSQ.style.sheets[t.media]=i=r.styleSheet:r.sheet&&(KSQ.style.sheets[t.media]=i=r.sheet,i.rules=[])),i.rules?i.rules[n]?KSQ(i.rules[n]):i.cssRules?(i.insertRule(n+" {}",i.cssRules.length),KSQ(i.rules[n]=i.cssRules[i.cssRules.length-1])):(i.addRule(n,null),KSQ(i.rules[n]=i.rules[i.rules.length-1])):void 0};KSQ.style.sheets=[];KSQ(document).ready(keyotiSearch._onDocumentReady);keyotiSearchResultPreviewer={currentPreviewDIV:null,indexDirectory:null,previewLoadPlugin:!1,maxCharLength:25e3,keyword_highlightPattern:"<span class='sew_previewHighlight'>{0}<\/span>",toggleResultPreview:function(n,t,i,r){this.currentPreviewDIV=KSQ(n).next();n.sew_opened==!0?(keyotiResultViewer.expandResultControlPanel(0),this.currentPreviewDIV.hide("fast"),n.src=i,n.sew_opened=!1):(n.src=r,n.sew_opened=!0,keyotiResultViewer.expandResultControlPanel(150),this.currentPreviewDIV.show("fast"),keyotiSearch.serviceProxy.invoke("GetPreviewText",{indexDirectory:this.indexDirectory!=null?this.indexDirectory:keyotiSearch.indexDirectory,u:t,p:this.previewLoadPlugin?1:0,mx:this.maxCharLength},function(u){if(u.Value.toLowerCase().indexOf("ciktek e")>-1&&(u.Value="No Preview Available"),keyotiSearchResultPreviewer.currentPreviewDIV!=null)if(typeof keyotiSearchResultPreviewer.sew_OnResultPreviewTextLoaded=="function"&&(dataOut=keyotiSearchResultPreviewer.sew_OnResultPreviewTextLoaded(t,u.Value,n,i,r),dataOut!=null&&(u.Value=dataOut)),u.Exception!=null)keyotiResultViewer.onError({Message:u.Exception,StackTrace:""});else{var f=u.Value.replace(/</g,"&lt;");f=f.replace(/>/g,"&gt;");f=f.replace(/\n/g,"<br /><br />");f=keyotiSearch.highlightText(f,keyotiSearchResultPreviewer.keyword_highlightPattern);keyotiSearchResultPreviewer.currentPreviewDIV.html(f);keyotiSearchResultPreviewer.currentPreviewDIV=null}},keyotiResultViewer.onError))}};kjson2html={transform:function(n,t,i){var u={events:[],html:""},r={events:!1},f;return r=kjson2html._extend(r,i),(t!==undefined||n!==undefined)&&(f=typeof n=="string"?JSON.parse(n):n,u=kjson2html._transform(f,t,r)),r.events?u:u.html},_extend:function(n,t){var r={};for(var i in n)r[i]=n[i];for(i in t)r[i]=t[i];return r},_append:function(n,t){var i={html:"",event:[]};return typeof n!="undefined"&&typeof t!="undefined"&&(i.html=n.html+t.html,i.events=n.events.concat(t.events)),i},_isArray:function(n){return Object.prototype.toString.call(n)==="[object Array]"},_transform:function(n,t,i){var r={events:[],html:""},f,u;if(kjson2html._isArray(n))for(f=n.length,u=0;u<f;++u)r=kjson2html._append(r,kjson2html._apply(n[u],t,u,i));else typeof n=="object"&&(r=kjson2html._append(r,kjson2html._apply(n,t,undefined,i)));return r},_apply:function(n,t,i,r){var u={events:[],html:""},v,h,e,c,f,o,l,y,a,s,p;if(kjson2html._isArray(t))for(v=t.length,h=0;h<v;++h)u=kjson2html._append(u,kjson2html._apply(n,t[h],i,r));else if(typeof t=="object"&&t.tag!==undefined){u.html+="<"+t.tag;e={events:[],html:""};for(f in t)switch(f){case"tag":break;case"children":kjson2html._isArray(t.children)?e=kjson2html._append(e,kjson2html._apply(n,t.children,i,r)):typeof t.children=="function"&&(o=t.children.call(n,n,i),typeof o=="object"?o.html!==undefined&&o.events!==undefined&&(e=kjson2html._append(e,o)):typeof o=="string"&&(e.html+=o));break;case"html":c=kjson2html._getValue(n,t,"html",i);break;default:l=!1;f.length>2&&f.substring(0,2).toLowerCase()=="on"&&(r.events&&(y={action:t[f],obj:n,data:r.eventData,index:i},a=kjson2html._guid(),u.events[u.events.length]={id:a,type:f.substring(2),data:y},u.html+=" kjson2html-event-id-"+f.substring(2)+"='"+a+"'"),l=!0);l||(s=kjson2html._getValue(n,t,f,i),s!==undefined&&(p=typeof s=="string"?'"'+s.replace(/"/g,"&quot;")+'"':s,u.html+=" "+f+"="+p))}u.html+=">";c&&(u.html+=c);u=kjson2html._append(u,e);u.html+="<\/"+t.tag+">"}return u},_guid:function(){var n=function(){return((1+Math.random())*65536|0).toString(16).substring(1)};return n()+n()+"-"+n()+n()+"-"+n()+n()},_getValue:function(n,t,i,r){var f="",u=t[i],e=typeof u,o;return e==="function"?u.call(n,n,r):(e==="string"?(o=new kjson2html._tokenizer([/\$\{([^\}\{]+)\}/],function(t,i,r){return i?t.replace(r,function(t,i){for(var o,f=i.split("."),r=n,e="",s=f.length,u=0;u<s;++u)if(f[u].length>0&&(o=r[f[u]],r=o,r===null||r===undefined))break;return r!==null&&r!==undefined&&(e=r),e}):t}),f=o.parse(u).join("")):f=u,f)},_tokenizer:function(n,t){if(!(this instanceof kjson2html._tokenizer))return new kjson2html._tokenizer(n,t);this.tokenizers=n.splice?n:[n];t&&(this.doBuild=t);this.parse=function(n){this.src=n;this.ended=!1;this.tokens=[];do this.next();while(!this.ended);return this.tokens};this.build=function(n,t){n&&this.tokens.push(this.doBuild?this.doBuild(n,t,this.tkn):n)};this.next=function(){var n=this,t;n.findMin();t=n.src.slice(0,n.min);n.build(t,!1);n.src=n.src.slice(n.min).replace(n.tkn,function(t){return n.build(t,!0),""});n.src||(n.ended=!0)};this.findMin=function(){var n=this,r=0,t,i;for(n.min=-1,n.tkn="";(t=n.tokenizers[r++])!==undefined;)i=n.src[t.test?"search":"indexOf"](t),i!=-1&&(n.min==-1||i<n.min)&&(n.tkn=t,n.min=i);n.min==-1&&(n.min=n.src.length)}}},function(n){n.fn.kjson2html=function(t,i,r){if(typeof kjson2html=="undefined")return undefined;var u={append:!0,replace:!1,prepend:!1,eventData:{}};return r!==undefined&&n.extend(u,r),u.events=!0,this.each(function(){for(var r,e,o=kjson2html.transform(t,i,u),f=n(document.createElement("i")).html(o.html),s=0;s<o.events.length;s++){if(r=o.events[s],e=n(f).find("[kjson2html-event-id-"+r.type+"='"+r.id+"']"),e.length===0)throw"jquery.kjson2html was unable to attach event "+r.id+" to DOM";n(e).removeAttr("kjson2html-event-id-"+r.type);n(e).on(r.type,r.data,function(t){t.data.event=t;t.data.action.call(n(this),t.data)})}u.replace?n.fn.replaceWith.call(n(this),n(f).children()):u.prepend?n.fn.prepend.call(n(this),n(f).children()):n.fn.append.call(n(this),n(f).children())})}}(KSQ),function(n){n.fn.getAttributes=function(){var t=this,i={};return t&&t.length&&n.each(t.get(0).attributes,function(n,r){r=r.nodeName||r.name;n=t.attr(r);n!=undefined&&n!==!1&&(i[r]=n)}),i}}(KSQ);typeof JSON!="object"&&(JSON={}),function(){"use strict";function i(n){return n<10?"0"+n:n}function f(n){return o.lastIndex=0,o.test(n)?'"'+n.replace(o,function(n){var t=s[n];return typeof t=="string"?t:"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+n+'"'}function r(i,e){var s,l,h,a,v=n,c,o=e[i];o&&typeof o=="object"&&typeof o.toJSON=="function"&&(o=o.toJSON(i));typeof t=="function"&&(o=t.call(e,i,o));switch(typeof o){case"string":return f(o);case"number":return isFinite(o)?String(o):"null";case"boolean":case"null":return String(o);case"object":if(!o)return"null";if(n+=u,c=[],Object.prototype.toString.apply(o)==="[object Array]"){for(a=o.length,s=0;s<a;s+=1)c[s]=r(s,o)||"null";return h=c.length===0?"[]":n?"[\n"+n+c.join(",\n"+n)+"\n"+v+"]":"["+c.join(",")+"]",n=v,h}if(t&&typeof t=="object")for(a=t.length,s=0;s<a;s+=1)typeof t[s]=="string"&&(l=t[s],h=r(l,o),h&&c.push(f(l)+(n?": ":":")+h));else for(l in o)Object.prototype.hasOwnProperty.call(o,l)&&(h=r(l,o),h&&c.push(f(l)+(n?": ":":")+h));return h=c.length===0?"{}":n?"{\n"+n+c.join(",\n"+n)+"\n"+v+"}":"{"+c.join(",")+"}",n=v,h}}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+i(this.getUTCMonth()+1)+"-"+i(this.getUTCDate())+"T"+i(this.getUTCHours())+":"+i(this.getUTCMinutes())+":"+i(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var e=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,o=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,u,s={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},t;typeof JSON.stringify!="function"&&(JSON.stringify=function(i,f,e){var o;if(n="",u="",typeof e=="number")for(o=0;o<e;o+=1)u+=" ";else typeof e=="string"&&(u=e);if(t=f,!f||typeof f=="function"||typeof f=="object"&&typeof f.length=="number")return r("",{"":i});throw new Error("JSON.stringify");});typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){function walk(n,t){var r,u,i=n[t];if(i&&typeof i=="object")for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(u=walk(i,r),u!==undefined?i[r]=u:delete i[r]);return reviver.call(n,t,i)}var j;if(text=String(text),e.lastIndex=0,e.test(text)&&(text=text.replace(e,function(n){return"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse");})}(),function(n,t){"use strict";var i=n.History=n.History||{};if(typeof i.Adapter!="undefined")throw new Error("History.js Adapter has already been loaded...");i.Adapter={handlers:{},_uid:1,uid:function(n){return n._uid||(n._uid=i.Adapter._uid++)},bind:function(n,t,r){var u=i.Adapter.uid(n);i.Adapter.handlers[u]=i.Adapter.handlers[u]||{};i.Adapter.handlers[u][t]=i.Adapter.handlers[u][t]||[];i.Adapter.handlers[u][t].push(r);n["on"+t]=function(n,t){return function(r){i.Adapter.trigger(n,t,r)}}(n,t)},trigger:function(n,t,r){r=r||{};var u=i.Adapter.uid(n),f,e;for(i.Adapter.handlers[u]=i.Adapter.handlers[u]||{},i.Adapter.handlers[u][t]=i.Adapter.handlers[u][t]||[],f=0,e=i.Adapter.handlers[u][t].length;f<e;++f)i.Adapter.handlers[u][t][f].apply(this,[r])},extractEventData:function(n,i){return i&&i[n]||t},onDomLoad:function(t){var i=n.setTimeout(function(){t()},2e3);n.onload=function(){clearTimeout(i);t()}}};typeof i.init!="undefined"&&i.init()}(window),function(n){"use strict";var i=n.document,u=n.setTimeout||u,f=n.clearTimeout||f,r=n.setInterval||r,t=n.History=n.History||{};if(typeof t.initHtml4!="undefined")throw new Error("History.js HTML4 Support has already been loaded...");t.initHtml4=function(){if(typeof t.initHtml4.initialized!="undefined")return!1;t.initHtml4.initialized=!0;t.enabled=!0;t.savedHashes=[];t.isLastHash=function(n){var r=t.getHashByIndex(),i;return i=n===r,i};t.isHashEqual=function(n,t){return n=encodeURIComponent(n).replace(/%25/g,"%"),t=encodeURIComponent(t).replace(/%25/g,"%"),n===t};t.saveHash=function(n){return t.isLastHash(n)?!1:(t.savedHashes.push(n),!0)};t.getHashByIndex=function(n){var i=null;return i=typeof n=="undefined"?t.savedHashes[t.savedHashes.length-1]:n<0?t.savedHashes[t.savedHashes.length+n]:t.savedHashes[n],i};t.discardedHashes={};t.discardedStates={};t.discardState=function(n,i,r){var f=t.getHashByState(n),u;return u={discardedState:n,backState:r,forwardState:i},t.discardedStates[f]=u,!0};t.discardHash=function(n,i,r){var u={discardedHash:n,backState:r,forwardState:i};return t.discardedHashes[n]=u,!0};t.discardedState=function(n){var r=t.getHashByState(n),i;return i=t.discardedStates[r]||!1,i};t.discardedHash=function(n){return t.discardedHashes[n]||!1};t.recycleState=function(n){var i=t.getHashByState(n);return t.discardedState(n)&&delete t.discardedStates[i],!0};t.emulated.hashChange&&(t.hashChangeInit=function(){t.checkerFunction=null;var f="",s,u,e,o,h=Boolean(t.getHash());return t.isInternetExplorer()?(s="historyjs-iframe",u=i.createElement("iframe"),u.setAttribute("id",s),u.setAttribute("src","#"),u.style.display="none",i.body.appendChild(u),u.contentWindow.document.open(),u.contentWindow.document.close(),e="",o=!1,t.checkerFunction=function(){if(o)return!1;o=!0;var r=t.getHash(),i=t.getHash(u.contentWindow.document);return r!==f?(f=r,i!==r&&(e=i=r,u.contentWindow.document.open(),u.contentWindow.document.close(),u.contentWindow.document.location.hash=t.escapeHash(r)),t.Adapter.trigger(n,"hashchange")):i!==e&&(e=i,h&&i===""?t.back():t.setHash(i,!1)),o=!1,!0}):t.checkerFunction=function(){var i=t.getHash()||"";return i!==f&&(f=i,t.Adapter.trigger(n,"hashchange")),!0},t.intervalList.push(r(t.checkerFunction,t.options.hashChangeInterval)),!0},t.Adapter.onDomLoad(t.hashChangeInit));t.emulated.pushState&&(t.onHashChange=function(i){var e=i&&i.newURL||t.getLocationHref(),u=t.getHashByUrl(e),r=null,o=null,f;return t.isLastHash(u)?(t.busy(!1),!1):(t.doubleCheckComplete(),t.saveHash(u),u&&t.isTraditionalAnchor(u)?(t.Adapter.trigger(n,"anchorchange"),t.busy(!1),!1):(r=t.extractState(t.getFullUrl(u||t.getLocationHref()),!0),t.isLastSavedState(r)?(t.busy(!1),!1):(o=t.getHashByState(r),f=t.discardedState(r),f?(t.getHashByIndex(-2)===t.getHashByState(f.forwardState)?t.back(!1):t.forward(!1),!1):(t.pushState(r.data,r.title,encodeURI(r.url),!1),!0))))},t.Adapter.bind(n,"hashchange",t.onHashChange),t.pushState=function(i,r,u,f){if(u=encodeURI(u).replace(/%25/g,"%"),t.getHashByUrl(u))throw new Error("History.js does not support states with fragment-identifiers (hashes/anchors).");if(f!==!1&&t.busy())return t.pushQueue({scope:t,callback:t.pushState,args:arguments,queue:f}),!1;t.busy(!0);var e=t.createStateObject(i,r,u),o=t.getHashByState(e),s=t.getState(!1),h=t.getHashByState(s),c=t.getHash(),l=t.expectedStateId==e.id;return t.storeState(e),t.expectedStateId=e.id,t.recycleState(e),t.setTitle(e),o===h?(t.busy(!1),!1):(t.saveState(e),l||t.Adapter.trigger(n,"statechange"),!t.isHashEqual(o,c)&&!t.isHashEqual(o,t.getShortUrl(t.getLocationHref()))&&t.setHash(o,!1),t.busy(!1),!0)},t.replaceState=function(i,r,u,f){if(u=encodeURI(u).replace(/%25/g,"%"),t.getHashByUrl(u))throw new Error("History.js does not support states with fragment-identifiers (hashes/anchors).");if(f!==!1&&t.busy())return t.pushQueue({scope:t,callback:t.replaceState,args:arguments,queue:f}),!1;t.busy(!0);var e=t.createStateObject(i,r,u),s=t.getHashByState(e),o=t.getState(!1),h=t.getHashByState(o),c=t.getStateByIndex(-2);return t.discardState(o,e,c),s===h?(t.storeState(e),t.expectedStateId=e.id,t.recycleState(e),t.setTitle(e),t.saveState(e),t.Adapter.trigger(n,"statechange"),t.busy(!1)):t.pushState(e.data,e.title,e.url,!1),!0});t.emulated.pushState&&t.getHash()&&!t.emulated.hashChange&&t.Adapter.onDomLoad(function(){t.Adapter.trigger(n,"hashchange")})};typeof t.init!="undefined"&&t.init()}(window),function(n,t){"use strict";var e=n.console||t,r=n.document,o=n.navigator,f=!1,h=n.setTimeout,c=n.clearTimeout,l=n.setInterval,a=n.clearInterval,u=n.JSON,v=n.alert,i=n.History=n.History||{},s=n.history;try{f=n.sessionStorage;f.setItem("TEST","1");f.removeItem("TEST")}catch(y){f=!1}if(u.stringify=u.stringify||u.encode,u.parse=u.parse||u.decode,typeof i.init!="undefined")throw new Error("History.js Core has already been loaded...");i.init=function(){return typeof i.Adapter=="undefined"?!1:(typeof i.initCore!="undefined"&&i.initCore(),typeof i.initHtml4!="undefined"&&i.initHtml4(),!0)};i.initCore=function(){if(typeof i.initCore.initialized!="undefined")return!1;if(i.initCore.initialized=!0,i.options=i.options||{},i.options.hashChangeInterval=i.options.hashChangeInterval||100,i.options.safariPollInterval=i.options.safariPollInterval||500,i.options.doubleCheckInterval=i.options.doubleCheckInterval||500,i.options.disableSuid=i.options.disableSuid||!1,i.options.storeInterval=i.options.storeInterval||1e3,i.options.busyDelay=i.options.busyDelay||250,i.options.debug=i.options.debug||!1,i.options.initialTitle=i.options.initialTitle||r.title,i.options.html4Mode=i.options.html4Mode||!1,i.options.delayInit=i.options.delayInit||!1,i.intervalList=[],i.clearAllIntervals=function(){var n,t=i.intervalList;if(typeof t!="undefined"&&t!==null){for(n=0;n<t.length;n++)a(t[n]);i.intervalList=null}},i.debug=function(){(i.options.debug||!1)&&i.log.apply(i,arguments)},i.log=function(){var s=typeof e!="undefined"&&typeof e.log!="undefined"&&typeof e.log.apply!="undefined",t=r.getElementById("log"),n,f,h,o,i;for(s?(o=Array.prototype.slice.call(arguments),n=o.shift(),typeof e.debug!="undefined"?e.debug.apply(e,[n,o]):e.log.apply(e,[n,o])):n="\n"+arguments[0]+"\n",f=1,h=arguments.length;f<h;++f){if(i=arguments[f],typeof i=="object"&&typeof u!="undefined")try{i=u.stringify(i)}catch(c){}n+="\n"+i+"\n"}return t?(t.value+=n+"\n-----\n",t.scrollTop=t.scrollHeight-t.clientHeight):s||v(n),!0},i.getInternetExplorerMajorVersion=function(){return i.getInternetExplorerMajorVersion.cached=typeof i.getInternetExplorerMajorVersion.cached!="undefined"?i.getInternetExplorerMajorVersion.cached:function(){for(var n=3,t=r.createElement("div"),i=t.getElementsByTagName("i");(t.innerHTML="<!--[if gt IE "+ ++n+"]><i><\/i><![endif]-->")&&i[0];);return n>4?n:!1}()},i.isInternetExplorer=function(){return i.isInternetExplorer.cached=typeof i.isInternetExplorer.cached!="undefined"?i.isInternetExplorer.cached:Boolean(i.getInternetExplorerMajorVersion())},i.emulated=i.options.html4Mode?{pushState:!0,hashChange:!0}:{pushState:!Boolean(n.history&&n.history.pushState&&n.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(o.userAgent)&&!/AppleWebKit\/5([0-2]|3[0-2])/i.test(o.userAgent)),hashChange:Boolean(!("onhashchange"in n||"onhashchange"in r)||i.isInternetExplorer()&&i.getInternetExplorerMajorVersion()<8)},i.enabled=!i.emulated.pushState,i.bugs={setHash:Boolean(!i.emulated.pushState&&o.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(o.userAgent)),safariPoll:Boolean(!i.emulated.pushState&&o.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(o.userAgent)),ieDoubleCheck:Boolean(i.isInternetExplorer()&&i.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(i.isInternetExplorer()&&i.getInternetExplorerMajorVersion()<7)},i.isEmptyObject=function(n){for(var t in n)if(n.hasOwnProperty(t))return!1;return!0},i.cloneObject=function(n){var i,t;return n?(i=u.stringify(n),t=u.parse(i)):t={},t},i.getRootUrl=function(){var n=r.location.protocol+"//"+(r.location.hostname||r.location.host);return(r.location.port||!1)&&(n+=":"+r.location.port),n+="/",n},i.getBaseHref=function(){var t=r.getElementsByTagName("base"),i=null,n="";return t.length===1&&(i=t[0],n=i.href.replace(/[^\/]+$/,"")),n=n.replace(/\/+$/,""),n&&(n+="/"),n},i.getBaseUrl=function(){return i.getBaseHref()||i.getBasePageUrl()||i.getRootUrl()},i.getPageUrl=function(){var t=i.getState(!1,!1),r=(t||{}).url||i.getLocationHref(),n;return n=r.replace(/\/+$/,"").replace(/[^\/]+$/,function(n){return/\./.test(n)?n:n+"/"}),n},i.getBasePageUrl=function(){return i.getLocationHref().replace(/[#\?].*/,"").replace(/[^\/]+$/,function(n){return/[^\/]$/.test(n)?"":n}).replace(/\/+$/,"")+"/"},i.getFullUrl=function(n,t){var u=n,r=n.substring(0,1);return t=typeof t=="undefined"?!0:t,/[a-z]+\:\/\//.test(n)||(u=r==="/"?i.getRootUrl()+n.replace(/^\/+/,""):r==="#"?i.getPageUrl().replace(/#.*/,"")+n:r==="?"?i.getPageUrl().replace(/[\?#].*/,"")+n:t?i.getBaseUrl()+n.replace(/^(\.\/)+/,""):i.getBasePageUrl()+n.replace(/^(\.\/)+/,"")),u.replace(/\#$/,"")},i.getShortUrl=function(n){var t=n,r=i.getBaseUrl(),u=i.getRootUrl();return i.emulated.pushState&&(t=t.replace(r,"")),t=t.replace(u,"/"),i.isTraditionalAnchor(t)&&(t="./"+t),t=t.replace(/^(\.\/)+/g,"./").replace(/\#$/,""),t},i.getLocationHref=function(n){return n=n||r,n.URL===n.location.href?n.location.href:n.location.href===decodeURIComponent(n.URL)?n.URL:n.location.hash&&decodeURIComponent(n.location.href.replace(/^[^#]+/,""))===n.location.hash?n.location.href:n.URL.indexOf("#")==-1&&n.location.href.indexOf("#")!=-1?n.location.href:n.URL||n.location.href},i.store={},i.idToState=i.idToState||{},i.stateToId=i.stateToId||{},i.urlToId=i.urlToId||{},i.storedStates=i.storedStates||[],i.savedStates=i.savedStates||[],i.normalizeStore=function(){i.store.idToState=i.store.idToState||{};i.store.urlToId=i.store.urlToId||{};i.store.stateToId=i.store.stateToId||{}},i.getState=function(n,t){typeof n=="undefined"&&(n=!0);typeof t=="undefined"&&(t=!0);var r=i.getLastSavedState();return!r&&t&&(r=i.createStateObject()),n&&(r=i.cloneObject(r),r.url=r.cleanUrl||r.url),r},i.getIdByState=function(n){var t=i.extractId(n.url),r;if(!t)if(r=i.getStateString(n),typeof i.stateToId[r]!="undefined")t=i.stateToId[r];else if(typeof i.store.stateToId[r]!="undefined")t=i.store.stateToId[r];else{for(;;)if(t=(new Date).getTime()+String(Math.random()).replace(/\D/g,""),typeof i.idToState[t]=="undefined"&&typeof i.store.idToState[t]=="undefined")break;i.stateToId[r]=t;i.idToState[t]=n}return t},i.normalizeState=function(n){var t,r;return(n&&typeof n=="object"||(n={}),typeof n.normalized!="undefined")?n:(n.data&&typeof n.data=="object"||(n.data={}),t={},t.normalized=!0,t.title=n.title||"",t.url=i.getFullUrl(n.url?n.url:i.getLocationHref()),t.hash=i.getShortUrl(t.url),t.data=i.cloneObject(n.data),t.id=i.getIdByState(t),t.cleanUrl=t.url.replace(/\??\&_suid.*/,""),t.url=t.cleanUrl,r=!i.isEmptyObject(t.data),(t.title||r)&&i.options.disableSuid!==!0&&(t.hash=i.getShortUrl(t.url).replace(/\??\&_suid.*/,""),/\?/.test(t.hash)||(t.hash+="?"),t.hash+="&_suid="+t.id),t.hashedUrl=i.getFullUrl(t.hash),(i.emulated.pushState||i.bugs.safariPoll)&&i.hasUrlDuplicate(t)&&(t.url=t.hashedUrl),t)},i.createStateObject=function(n,t,r){var u={data:n,title:t,url:r};return u=i.normalizeState(u),u},i.getStateById=function(n){n=String(n);return i.idToState[n]||i.store.idToState[n]||t},i.getStateString=function(n){var t,r,f;return t=i.normalizeState(n),r={data:t.data,title:n.title,url:n.url},f=u.stringify(r),f},i.getStateId=function(n){var t,r;return t=i.normalizeState(n),r=t.id,r},i.getHashByState=function(n){var t,r;return t=i.normalizeState(n),r=t.hash,r},i.extractId=function(n){var i,t,u,r;return r=n.indexOf("#")!=-1?n.split("#")[0]:n,t=/(.*)\&_suid=([0-9]+)$/.exec(r),u=t?t[1]||n:n,i=t?String(t[2]||""):"",i||!1},i.isTraditionalAnchor=function(n){return!/[\/\?\.]/.test(n)},i.extractState=function(n,t){var r=null,u,f;return t=t||!1,u=i.extractId(n),u&&(r=i.getStateById(u)),r||(f=i.getFullUrl(n),u=i.getIdByUrl(f)||!1,u&&(r=i.getStateById(u)),!r&&t&&!i.isTraditionalAnchor(n)&&(r=i.createStateObject(null,null,f))),r},i.getIdByUrl=function(n){return i.urlToId[n]||i.store.urlToId[n]||t},i.getLastSavedState=function(){return i.savedStates[i.savedStates.length-1]||t},i.getLastStoredState=function(){return i.storedStates[i.storedStates.length-1]||t},i.hasUrlDuplicate=function(n){var r=!1,t;return t=i.extractState(n.url),r=t&&t.id!==n.id,r},i.storeState=function(n){return i.urlToId[n.url]=n.id,i.storedStates.push(i.cloneObject(n)),n},i.isLastSavedState=function(n){var t=!1,r,u,f;return i.savedStates.length&&(r=n.id,u=i.getLastSavedState(),f=u.id,t=r===f),t},i.saveState=function(n){return i.isLastSavedState(n)?!1:(i.savedStates.push(i.cloneObject(n)),!0)},i.getStateByIndex=function(n){var t=null;return t=typeof n=="undefined"?i.savedStates[i.savedStates.length-1]:n<0?i.savedStates[i.savedStates.length+n]:i.savedStates[n],t},i.getCurrentIndex=function(){var n=null;return n=i.savedStates.length<1?0:i.savedStates.length-1,n},i.getHash=function(n){var r=i.getLocationHref(n),t;return t=i.getHashByUrl(r),t},i.unescapeHash=function(n){var t=i.normalizeHash(n);return t=decodeURIComponent(t),t},i.normalizeHash=function(n){return n.replace(/[^#]*#/,"").replace(/#.*/,"")},i.setHash=function(n,t){var u,f;return t!==!1&&i.busy()?(i.pushQueue({scope:i,callback:i.setHash,args:arguments,queue:t}),!1):(i.busy(!0),u=i.extractState(n,!0),u&&!i.emulated.pushState?i.pushState(u.data,u.title,u.url,!1):i.getHash()!==n&&(i.bugs.setHash?(f=i.getPageUrl(),i.pushState(null,null,f+"#"+n,!1)):r.location.hash=n),i)},i.escapeHash=function(t){var r=i.normalizeHash(t);return r=n.encodeURIComponent(r),i.bugs.hashEscape||(r=r.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),r},i.getHashByUrl=function(n){var t=String(n).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return t=i.unescapeHash(t),t},i.setTitle=function(n){var t=n.title,u;t||(u=i.getStateByIndex(0),u&&u.url===n.url&&(t=u.title||i.options.initialTitle));try{r.getElementsByTagName("title")[0].innerHTML=t.replace("<","&lt;").replace(">","&gt;").replace(" & "," &amp; ")}catch(f){}return r.title=t,i},i.queues=[],i.busy=function(n){if(typeof n!="undefined"?i.busy.flag=n:typeof i.busy.flag=="undefined"&&(i.busy.flag=!1),!i.busy.flag){c(i.busy.timeout);var t=function(){var n,r,u;if(!i.busy.flag)for(n=i.queues.length-1;n>=0;--n)(r=i.queues[n],r.length!==0)&&(u=r.shift(),i.fireQueueItem(u),i.busy.timeout=h(t,i.options.busyDelay))};i.busy.timeout=h(t,i.options.busyDelay)}return i.busy.flag},i.busy.flag=!1,i.fireQueueItem=function(n){return n.callback.apply(n.scope||i,n.args||[])},i.pushQueue=function(n){return i.queues[n.queue||0]=i.queues[n.queue||0]||[],i.queues[n.queue||0].push(n),i},i.queue=function(n,t){return typeof n=="function"&&(n={callback:n}),typeof t!="undefined"&&(n.queue=t),i.busy()?i.pushQueue(n):i.fireQueueItem(n),i},i.clearQueue=function(){return i.busy.flag=!1,i.queues=[],i},i.stateChanged=!1,i.doubleChecker=!1,i.doubleCheckComplete=function(){return i.stateChanged=!0,i.doubleCheckClear(),i},i.doubleCheckClear=function(){return i.doubleChecker&&(c(i.doubleChecker),i.doubleChecker=!1),i},i.doubleCheck=function(n){return i.stateChanged=!1,i.doubleCheckClear(),i.bugs.ieDoubleCheck&&(i.doubleChecker=h(function(){return i.doubleCheckClear(),i.stateChanged||n(),!0},i.options.doubleCheckInterval)),i},i.safariStatePoll=function(){var r=i.extractState(i.getLocationHref()),t;if(!i.isLastSavedState(r))return t=r,t||(t=i.createStateObject()),i.Adapter.trigger(n,"popstate"),i},i.back=function(n){return n!==!1&&i.busy()?(i.pushQueue({scope:i,callback:i.back,args:arguments,queue:n}),!1):(i.busy(!0),i.doubleCheck(function(){i.back(!1)}),s.go(-1),!0)},i.forward=function(n){return n!==!1&&i.busy()?(i.pushQueue({scope:i,callback:i.forward,args:arguments,queue:n}),!1):(i.busy(!0),i.doubleCheck(function(){i.forward(!1)}),s.go(1),!0)},i.go=function(n,t){var r;if(n>0)for(r=1;r<=n;++r)i.forward(t);else{if(!(n<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(r=-1;r>=n;--r)i.back(t)}return i},i.emulated.pushState){var y=function(){};i.pushState=i.pushState||y;i.replaceState=i.replaceState||y}else i.onPopState=function(t,r){var e=!1,u=!1,o,f;return i.doubleCheckComplete(),o=i.getHash(),o?(f=i.extractState(o||i.getLocationHref(),!0),f?i.replaceState(f.data,f.title,f.url,!1):(i.Adapter.trigger(n,"anchorchange"),i.busy(!1)),i.expectedStateId=!1,!1):(e=i.Adapter.extractEventData("state",t,r)||!1,u=e?i.getStateById(e):i.expectedStateId?i.getStateById(i.expectedStateId):i.extractState(i.getLocationHref()),u||(u=i.createStateObject(null,null,i.getLocationHref())),i.expectedStateId=!1,i.isLastSavedState(u)?(i.busy(!1),!1):(i.storeState(u),i.saveState(u),i.setTitle(u),i.Adapter.trigger(n,"statechange"),i.busy(!1),!0))},i.Adapter.bind(n,"popstate",i.onPopState),i.pushState=function(t,r,u,f){if(i.getHashByUrl(u)&&i.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(f!==!1&&i.busy())return i.pushQueue({scope:i,callback:i.pushState,args:arguments,queue:f}),!1;i.busy(!0);var e=i.createStateObject(t,r,u);return i.isLastSavedState(e)?i.busy(!1):(i.storeState(e),i.expectedStateId=e.id,s.pushState(e.id,e.title,e.url),i.Adapter.trigger(n,"popstate")),!0},i.replaceState=function(t,r,u,f){if(i.getHashByUrl(u)&&i.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(f!==!1&&i.busy())return i.pushQueue({scope:i,callback:i.replaceState,args:arguments,queue:f}),!1;i.busy(!0);var e=i.createStateObject(t,r,u);return i.isLastSavedState(e)?i.busy(!1):(i.storeState(e),i.expectedStateId=e.id,s.replaceState(e.id,e.title,e.url),i.Adapter.trigger(n,"popstate")),!0};if(f){try{i.store=u.parse(f.getItem("History.store"))||{}}catch(p){i.store={}}i.normalizeStore()}else i.store={},i.normalizeStore();i.Adapter.bind(n,"unload",i.clearAllIntervals);i.saveState(i.storeState(i.extractState(i.getLocationHref(),!0)));f&&(i.onUnload=function(){var n,t,r;try{n=u.parse(f.getItem("History.store"))||{}}catch(o){n={}}n.idToState=n.idToState||{};n.urlToId=n.urlToId||{};n.stateToId=n.stateToId||{};for(t in i.idToState)i.idToState.hasOwnProperty(t)&&(n.idToState[t]=i.idToState[t]);for(t in i.urlToId)i.urlToId.hasOwnProperty(t)&&(n.urlToId[t]=i.urlToId[t]);for(t in i.stateToId)i.stateToId.hasOwnProperty(t)&&(n.stateToId[t]=i.stateToId[t]);i.store=n;i.normalizeStore();r=u.stringify(n);try{f.setItem("History.store",r)}catch(e){if(e.code!==DOMException.QUOTA_EXCEEDED_ERR)throw e;f.length&&(f.removeItem("History.store"),f.setItem("History.store",r))}},i.intervalList.push(l(i.onUnload,i.options.storeInterval)),i.Adapter.bind(n,"beforeunload",i.onUnload),i.Adapter.bind(n,"unload",i.onUnload));i.emulated.pushState||(i.bugs.safariPoll&&i.intervalList.push(l(i.safariStatePoll,i.options.safariPollInterval)),(o.vendor==="Apple Computer, Inc."||(o.appCodeName||"")==="Mozilla")&&(i.Adapter.bind(n,"hashchange",function(){i.Adapter.trigger(n,"popstate")}),i.getHash()&&i.Adapter.onDomLoad(function(){i.Adapter.trigger(n,"hashchange")})))};(!i.options||!i.options.delayInit)&&i.init()}(window);var sew_currentPreviewDIV=null,sew_indexDirectory="",sew_appPath="",sew_previewLoadPlugin=!1,sew_maxCharLength="";keyotiSearchHighlighter={_getQueryStringParameters:function(){return this._queryStringParameters==null&&(this._queryStringParameters={},this._queryStringParameters=window.location.search.length>1?this._parseQueryStringParameters(window.location.search):{}),this._queryStringParameters},_parseQueryStringParameters:function(n){for(var r={},t,i=0,u=n.substr(1).split("&");i<u.length;i++)t=u[i].split("="),r[decodeURIComponent(t[0])]=t.length>1?decodeURIComponent(t[1]):"";return r},_isCssClassDefined:function(){for(var t,i,n=0;n<document.styleSheets.length;n++)for(t=document.styleSheets[n].cssRules,i=0;t!=null&&i<t.length;i++)if(t[i].cssText.indexOf("keyoti_highlight")>-1)return!0;return!1},_highlight:function(n){var f=this._isCssClassDefined(),r,t,i,u;for(RegExp.k_escape=function(n){return n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},t=0;t<n.length;t++)n[t].length>0&&(i=new RegExp("\\b("+RegExp.k_escape(n[t])+")\\b","gi"),u=new RegExp("("+RegExp.k_escape(n[t])+")","gi"),/\w/.test(n[t].charAt(0))&&/\w/.test(n[t].charAt(n[t].length-1))?r=i:i=u),document.body!=null&&n[t].length>0&&findAndReplaceDOMText(document.body,{find:r,replace:function(n){called=!0;var t=document.createElement("span");return t.className="keyoti_highlight",f||(t.style.backgroundColor="yellow",t.style.color="black"),t.innerHTML=n.text,t}})}};typeof sew_highlighterOldOnLoad=="undefined"&&(sew_highlighterOldOnLoad=onload,onload=function(){var n,t;typeof sew_highlighterOldOnLoad=="function"&&sew_highlighterOldOnLoad();n=keyotiSearchHighlighter._getQueryStringParameters();n!=null&&(t=n.searchunitkeywords,t!=null&&keyotiSearchHighlighter._highlight(t.split(",")))});window.findAndReplaceDOMText=function(){function o(n){return String(n).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function t(){return s.apply(null,arguments)||u.apply(null,arguments)}function s(n,i,r,f,e){var o,s;return i&&!i.nodeType&&arguments.length<=2?!1:(o=typeof r=="function",o&&(r=function(n){return function(t,i){return n(t.text,i.startIndex)}}(r)),s=u(i,{find:n,wrap:o?null:r,replace:o?r:"$"+(f||"&"),prepMatch:function(n,t){if(!n[0])throw"findAndReplaceDOMText cannot handle zero-length matches";if(f>0){var i=n[f];n.index+=n[0].indexOf(i);n[0]=i}return n.endIndex=n.index+n[0].length,n.startIndex=n.index,n.index=t,n},filterElements:e}),t.revert=function(){return s.revert()},!0)}function u(n,t){return new i(n,t)}function i(n,t){t.portionMode=t.portionMode||f;this.node=n;this.options=t;this.prepMatch=t.prepMatch||this.prepMatch;this.reverts=[];this.matches=this.search();this.matches.length&&this.processMatches()}var f="retain",r="first",n=document,e={}.toString;return t.Finder=i,i.prototype={search:function(){var t,u=0,n=this.options.find,r=this.getAggregateText(),i=[];if(n=typeof n=="string"?RegExp(o(n),"g"):n,n.global)while(t=n.exec(r))i.push(this.prepMatch(t,u++));else(t=r.match(n))&&i.push(this.prepMatch(t,0));return i},prepMatch:function(n,t){if(!n[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");return n.endIndex=n.index+n[0].length,n.startIndex=n.index,n.index=t,n},getAggregateText:function(){function t(i){if(i.nodeType===3)return i.data;if(n&&!n(i))return"";var r="";if(i=i.firstChild)do r+=t(i);while(i=i.nextSibling);return r}var n=this.options.filterElements;return t(this.node)},processMatches:function(){var s=this.matches,e=this.node,h=this.options.filterElements,u,r,o=[],n=e,t=s.shift(),i=0,a=0,f=0,c,l=[e];n:for(;;){if(n.nodeType===3&&(!r&&n.length+i>=t.endIndex?r={node:n,index:f++,text:n.data.substring(t.startIndex-i,t.endIndex-i),indexInMatch:i-t.startIndex,indexInNode:t.startIndex-i,endIndexInNode:t.endIndex-i,isEnd:!0}:u&&o.push({node:n,index:f++,text:n.data,indexInMatch:i-t.startIndex,indexInNode:0}),!u&&n.length+i>t.startIndex&&(u={node:n,index:f++,indexInMatch:0,indexInNode:t.startIndex-i,endIndexInNode:t.endIndex-i,text:n.data.substring(t.startIndex-i,t.endIndex-i)}),i+=n.data.length),c=n.nodeType===1&&h&&!h(n),u&&r){if(n=this.replaceMatch(t,u,o,r),i-=r.node.data.length-r.endIndexInNode,u=null,r=null,o=[],t=s.shift(),f=0,a++,!t)break}else if(!c&&(n.firstChild||n.nextSibling)){n.firstChild?(l.push(n),n=n.firstChild):n=n.nextSibling;continue}for(;;){if(n.nextSibling){n=n.nextSibling;break}if(n=l.pop(),n===e)break n}}},revert:function(){for(var n=this.reverts.length;n--;)this.reverts[n]();this.reverts=[]},prepareReplacementString:function(n,t,i){var u=this.options.portionMode;return u===r&&t.indexInMatch>0?"":(n=n.replace(/\$(\d+|&|`|')/g,function(n,t){var r;switch(t){case"&":r=i[0];break;case"`":r=i.input.substring(0,i.startIndex);break;case"'":r=i.input.substring(i.endIndex);break;default:r=i[+t]}return r}),u===r)?n:t.isEnd?n.substring(t.indexInMatch):n.substring(t.indexInMatch,t.indexInMatch+t.text.length)},getPortionReplacementNode:function(t,i,r){var u=this.options.replace||"$&",f=this.options.wrap,o,e;return(f&&f.nodeType&&(o=n.createElement("div"),o.innerHTML=f.outerHTML||(new XMLSerializer).serializeToString(f),f=o.firstChild),typeof u=="function")?(u=u(t,i,r),u&&u.nodeType)?u:n.createTextNode(String(u)):(e=typeof f=="string"?n.createElement(f):f,u=n.createTextNode(this.prepareReplacementString(u,t,i,r)),!u.data)?u:e?(e.appendChild(u),e):u},replaceMatch:function(t,i,r,u){var e=i.node,o=u.node,s,h,f,c,v,w,y,b,l,p,a;if(e===o)return f=e,i.indexInNode>0&&(s=n.createTextNode(f.data.substring(0,i.indexInNode)),f.parentNode.insertBefore(s,f)),c=this.getPortionReplacementNode(u,t),f.parentNode.insertBefore(c,f),u.endIndexInNode<f.length&&(h=n.createTextNode(f.data.substring(u.endIndexInNode)),f.parentNode.insertBefore(h,f)),f.parentNode.removeChild(f),this.reverts.push(function(){s===c.previousSibling&&s.parentNode.removeChild(s);h===c.nextSibling&&h.parentNode.removeChild(h);c.parentNode.replaceChild(f,c)}),c;for(s=n.createTextNode(e.data.substring(0,i.indexInNode)),h=n.createTextNode(o.data.substring(u.endIndexInNode)),v=this.getPortionReplacementNode(i,t),w=[],y=0,b=r.length;y<b;++y)l=r[y],p=this.getPortionReplacementNode(l,t),l.node.parentNode.replaceChild(p,l.node),this.reverts.push(function(n,t){return function(){t.parentNode.replaceChild(n.node,t)}}(l,p)),w.push(p);return a=this.getPortionReplacementNode(u,t),e.parentNode.insertBefore(s,e),e.parentNode.insertBefore(v,e),e.parentNode.removeChild(e),o.parentNode.insertBefore(a,o),o.parentNode.insertBefore(h,o),o.parentNode.removeChild(o),this.reverts.push(function(){s.parentNode.removeChild(s);v.parentNode.replaceChild(e,v);h.parentNode.removeChild(h);a.parentNode.replaceChild(o,a)}),a}},t}(),function(n){function s(t,i,r,u){function e(r){var u=n[t][i][r]||[];return typeof u=="string"?u.split(/,?\s+/):u}var f=e("getter");return u.length==1&&typeof u[0]=="string"&&(f=f.concat(e("getterSetter"))),n.inArray(r,f)!=-1}var u=n.fn.remove,f=n.browser.mozilla&&parseFloat(n.browser.version)<1.9;if(n.ui={version:"1.6",plugin:{add:function(t,i,r){var f=n.ui[t].prototype;for(var u in r)f.plugins[u]=f.plugins[u]||[],f.plugins[u].push([i,r[u]])},call:function(n,t,i){var u=n.plugins[t],r;if(u)for(r=0;r<u.length;r++)n.options[u[r][0]]&&u[r][1].apply(n.element,i)}},contains:function(t,i){var r=n.browser.safari&&n.browser.version<522;if(t.contains&&!r)return t.contains(i);if(t.compareDocumentPosition)return!!(t.compareDocumentPosition(i)&16);while(i=i.parentNode)if(i==t)return!0;return!1},cssCache:{},css:function(t){if(n.ui.cssCache[t])return n.ui.cssCache[t];var i=n('<div class="ui-gen">').addClass(t).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");n.ui.cssCache[t]=!!(!/auto|default/.test(i.css("cursor"))||/^[1-9]/.test(i.css("height"))||/^[1-9]/.test(i.css("width"))||!/none/.test(i.css("backgroundImage"))||!/transparent|rgba\(0, 0, 0, 0\)/.test(i.css("backgroundColor")));try{n("body").get(0).removeChild(i.get(0))}catch(r){}return n.ui.cssCache[t]},hasScroll:function(t,i){if(n(t).css("overflow")=="hidden")return!1;var r=i&&i=="left"?"scrollLeft":"scrollTop",u=!1;return t[r]>0?!0:(t[r]=1,u=t[r]>0,t[r]=0,u)},isOverAxis:function(n,t,i){return n>t&&n<t+i},isOver:function(t,i,r,u,f,e){return n.ui.isOverAxis(t,r,f)&&n.ui.isOverAxis(i,u,e)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}},f){var i=n.attr,e=n.fn.removeAttr,r="http://www.w3.org/2005/07/aaa",t=/^aria-/,o=/^wairole:/;n.attr=function(n,u,f){var e=f!==undefined;return u=="role"?e?i.call(this,n,u,"wairole:"+f):(i.apply(this,arguments)||"").replace(o,""):t.test(u)?e?n.setAttributeNS(r,u.replace(t,"aaa:"),f):i.call(this,n,u.replace(t,"aaa:")):i.apply(this,arguments)};n.fn.removeAttr=function(n){return t.test(n)?this.each(function(){this.removeAttributeNS(r,n.replace(t,""))}):e.call(this,n)}}n.fn.extend({remove:function(){return n("*",this).add(this).each(function(){n(this).triggerHandler("remove")}),u.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return!1})},scrollParent:function(){var t;return t=n.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(n.curCSS(this,"position",1))&&/(auto|scroll)/.test(n.curCSS(this,"overflow",1)+n.curCSS(this,"overflow-y",1)+n.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(n.curCSS(this,"overflow",1)+n.curCSS(this,"overflow-y",1)+n.curCSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!t.length?n(document):t}});n.extend(n.expr[":"],{data:function(t,i,r){return n.data(t,r[3])},tabbable:function(t){function r(t){return!(n(t).is(":hidden")||n(t).parents(":hidden").length)}var i=t.nodeName.toLowerCase();return t.tabIndex>=0&&("a"==i&&t.href||/input|select|textarea|button/.test(i)&&"hidden"!=t.type&&!t.disabled)&&r(t)}});n.widget=function(t,i){var r=t.split(".")[0];t=t.split(".")[1];n.fn[t]=function(i){var u=typeof i=="string",e=Array.prototype.slice.call(arguments,1),f;return u&&i.substring(0,1)=="_"?this:u&&s(r,t,i,e)?(f=n.data(this[0],t),f?f[i].apply(f,e):undefined):this.each(function(){var f=n.data(this,t);f||u||n.data(this,t,new n[r][t](this,i));f&&u&&n.isFunction(f[i])&&f[i].apply(f,e)})};n[r]=n[r]||{};n[r][t]=function(i,u){var f=this;this.widgetName=t;this.widgetEventPrefix=n[r][t].eventPrefix||t;this.widgetBaseClass=r+"-"+t;this.options=n.extend({},n.widget.defaults,n[r][t].defaults,n.metadata&&n.metadata.get(i)[t],u);this.element=n(i).bind("setData."+t,function(n,t,i){return f._setData(t,i)}).bind("getData."+t,function(n,t){return f._getData(t)}).bind("remove",function(){return f.destroy()});this._init()};n[r][t].prototype=n.extend({},n.widget.prototype,i);n[r][t].getterSetter="option"};n.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName)},option:function(t,i){var r=t,u=this;if(typeof t=="string"){if(i===undefined)return this._getData(t);r={};r[t]=i}n.each(r,function(n,t){u._setData(n,t)})},_getData:function(n){return this.options[n]},_setData:function(n,t){this.options[n]=t;n=="disabled"&&this.element[t?"addClass":"removeClass"](this.widgetBaseClass+"-disabled")},enable:function(){this._setData("disabled",!1)},disable:function(){this._setData("disabled",!0)},_trigger:function(t,i,r){var u=t==this.widgetEventPrefix?t:this.widgetEventPrefix+t;return i=i||n.event.fix({type:u,target:this.element[0]}),this.element.triggerHandler(u,[i,r],this.options[t])}};n.widget.defaults={disabled:!1};n.ui.mouse={_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(n){return t._mouseDown(n)}).bind("click."+this.widgetName,function(){if(t._preventClickEvent)return t._preventClickEvent=!1,!1});n.browser.msie&&(this._mouseUnselectable=this.element.attr("unselectable"),this.element.attr("unselectable","on"));this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);n.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable)},_mouseDown:function(t){this._mouseStarted&&this._mouseUp(t);this._mouseDownEvent=t;var i=this,r=t.which==1,u=typeof this.options.cancel=="string"?n(t.target).parents().add(t.target).filter(this.options.cancel).length:!1;return!r||u||!this._mouseCapture(t)?!0:(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted))?(t.preventDefault(),!0):(this._mouseMoveDelegate=function(n){return i._mouseMove(n)},this._mouseUpDelegate=function(n){return i._mouseUp(n)},n(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),n.browser.safari||t.preventDefault(),!0)},_mouseMove:function(t){return n.browser.msie&&!t.button?this._mouseUp(t):this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return n(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,this._preventClickEvent=!0,this._mouseStop(t)),!1},_mouseDistanceMet:function(n){return Math.max(Math.abs(this._mouseDownEvent.pageX-n.pageX),Math.abs(this._mouseDownEvent.pageY-n.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}};n.ui.mouse.defaults={cancel:null,distance:1,delay:0}}(KSQ),function(n){function r(){this.debug=!1;this._curInst=null;this._keyEvent=!1;this._disabledInputs=[];this._datepickerShowing=!1;this._inDialog=!1;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._promptClass="ui-datepicker-prompt";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this._weekOverClass="ui-datepicker-week-over";this.regional=[];this.regional[""]={clearText:"Clear",clearStatus:"Erase the current date",closeText:"Close",closeStatus:"Close without change",prevText:"&#x3c;Prev",prevStatus:"Show the previous month",prevBigText:"&#x3c;&#x3c;",prevBigStatus:"Show the previous year",nextText:"Next&#x3e;",nextStatus:"Show the next month",nextBigText:"&#x3e;&#x3e;",nextBigStatus:"Show the next year",currentText:"Today",currentStatus:"Show the current month",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],monthStatus:"Show a different month",yearStatus:"Show a different year",weekHeader:"Wk",weekStatus:"Week of the year",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],dayStatus:"Set DD as first week day",dateStatus:"Select DD, M d",dateFormat:"mm/dd/yy",firstDay:0,initStatus:"Select a date",isRTL:!1};this._defaults={showOn:"focus",showAnim:"show",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,closeAtTop:!0,mandatory:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,showBigPrevNext:!1,gotoCurrent:!1,changeMonth:!0,changeYear:!0,showMonthAfterYear:!1,yearRange:"-10:+10",changeFirstDay:!0,highlightWeek:!1,showOtherMonths:!1,showWeeks:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",showStatus:!1,statusForDate:this.dateStatus,minDate:null,maxDate:null,duration:"normal",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,rangeSelect:!1,rangeSeparator:" - ",altField:"",altFormat:"",constrainInput:!0};n.extend(this._defaults,this.regional[""]);this.dpDiv=n('<div id="'+this._mainDivId+'" style="display: none;"><\/div>')}function i(t,i){n.extend(t,i);for(var r in i)(i[r]==null||i[r]==undefined)&&(t[r]=i[r]);return t}function u(t){return t&&(n.browser.safari&&typeof t=="object"&&t.length||t.constructor&&t.constructor.toString().match(/\Array\(\)/))}n.extend(n.ui,{datepicker:{version:"1.6"}});var t="datepicker";n.extend(r.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},setDefaults:function(n){return i(this._defaults,n||{}),this},_attachDatepicker:function(target,settings){var inlineSettings=null,attrName,attrValue,nodeName,inline,inst;for(attrName in this._defaults)if(attrValue=target.getAttribute("date:"+attrName),attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}nodeName=target.nodeName.toLowerCase();inline=nodeName=="div"||nodeName=="span";target.id||(target.id="dp"+ ++this.uuid);inst=this._newInst(n(target),inline);inst.settings=n.extend({},settings||{},inlineSettings||{});nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(t,i){var r=t[0].id.replace(/([:\[\]\.])/g,"\\\\$1");return{id:r,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?n('<div class="'+this._inlineClass+'"><\/div>'):this.dpDiv}},_connectDatepicker:function(i,r){var u=n(i),o,s,f;if(!u.hasClass(this.markerClassName)){if(o=this._get(r,"appendText"),s=this._get(r,"isRTL"),o&&u[s?"before":"after"]('<span class="'+this._appendClass+'">'+o+"<\/span>"),f=this._get(r,"showOn"),(f=="focus"||f=="both")&&u.focus(this._showDatepicker),f=="button"||f=="both"){var e=this._get(r,"buttonText"),h=this._get(r,"buttonImage"),c=n(this._get(r,"buttonImageOnly")?n("<img/>").addClass(this._triggerClass).attr({src:h,alt:e,title:e}):n('<button type="button"><\/button>').addClass(this._triggerClass).html(h==""?e:n("<img/>").attr({src:h,alt:e,title:e})));u[s?"before":"after"](c);c.click(function(){return n.datepicker._datepickerShowing&&n.datepicker._lastInput==i?n.datepicker._hideDatepicker():n.datepicker._showDatepicker(i),!1})}u.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",function(n,t,i){r.settings[t]=i}).bind("getData.datepicker",function(n,t){return this._get(r,t)});n.data(i,t,r)}},_inlineDatepicker:function(i,r){var u=n(i);u.hasClass(this.markerClassName)||(u.addClass(this.markerClassName).append(r.dpDiv).bind("setData.datepicker",function(n,t,i){r.settings[t]=i}).bind("getData.datepicker",function(n,t){return this._get(r,t)}),n.data(i,t,r),this._setDate(r,this._getDefaultDate(r)),this._updateDatepicker(r),this._updateAlternate(r))},_dialogDatepicker:function(r,u,f,e,o){var s=this._dialogInst,h;if(s||(h="dp"+ ++this.uuid,this._dialogInput=n('<input type="text" id="'+h+'" size="1" style="position: absolute; top: -100px;"/>'),this._dialogInput.keydown(this._doKeyDown),n("body").append(this._dialogInput),s=this._dialogInst=this._newInst(this._dialogInput,!1),s.settings={},n.data(this._dialogInput[0],t,s)),i(s.settings,e||{}),this._dialogInput.val(u),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,!this._pos){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,l=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,a=document.documentElement.scrollLeft||document.body.scrollLeft,v=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[c/2-100+a,l/2-150+v]}return this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px"),s.settings.onSelect=f,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),n.blockUI&&n.blockUI(this.dpDiv),n.data(this._dialogInput[0],t,s),this},_destroyDatepicker:function(i){var u=n(i),r;u.hasClass(this.markerClassName)&&(r=i.nodeName.toLowerCase(),n.removeData(i,t),r=="input"?u.siblings("."+this._appendClass).remove().end().siblings("."+this._triggerClass).remove().end().removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress):(r=="div"||r=="span")&&u.removeClass(this.markerClassName).empty())},_enableDatepicker:function(t){var r=n(t),i;r.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),i=="input"?(t.disabled=!1,r.siblings("button."+this._triggerClass).each(function(){this.disabled=!1}).end().siblings("img."+this._triggerClass).css({opacity:"1.0",cursor:""})):(i=="div"||i=="span")&&r.children("."+this._disableClass).remove(),this._disabledInputs=n.map(this._disabledInputs,function(n){return n==t?null:n}))},_disableDatepicker:function(t){var i=n(t),r;if(i.hasClass(this.markerClassName)){if(r=t.nodeName.toLowerCase(),r=="input")t.disabled=!0,i.siblings("button."+this._triggerClass).each(function(){this.disabled=!0}).end().siblings("img."+this._triggerClass).css({opacity:"0.5",cursor:"default"});else if(r=="div"||r=="span"){var u=i.children("."+this._inlineClass),e=u.offset(),f={left:0,top:0};u.parents().each(function(){if(n(this).css("position")=="relative")return f=n(this).offset(),!1});i.prepend('<div class="'+this._disableClass+'" style="'+(n.browser.msie?"background-color: transparent; ":"")+"width: "+u.width()+"px; height: "+u.height()+"px; left: "+(e.left-f.left)+"px; top: "+(e.top-f.top)+'px;"><\/div>')}this._disabledInputs=n.map(this._disabledInputs,function(n){return n==t?null:n});this._disabledInputs[this._disabledInputs.length]=t}},_isDisabledDatepicker:function(n){if(!n)return!1;for(var t=0;t<this._disabledInputs.length;t++)if(this._disabledInputs[t]==n)return!0;return!1},_getInst:function(i){try{return n.data(i,t)}catch(r){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(n,t,r){var e=t||{},f,u;typeof t=="string"&&(e={},e[t]=r);f=this._getInst(n);f&&(this._curInst==f&&this._hideDatepicker(null),i(f.settings,e),u=new Date,i(f,{rangeStart:null,endDay:null,endMonth:null,endYear:null,selectedDay:u.getDate(),selectedMonth:u.getMonth(),selectedYear:u.getFullYear(),currentDay:u.getDate(),currentMonth:u.getMonth(),currentYear:u.getFullYear(),drawMonth:u.getMonth(),drawYear:u.getFullYear()}),this._updateDatepicker(f))},_changeDatepicker:function(n,t,i){this._optionDatepicker(n,t,i)},_refreshDatepicker:function(n){var t=this._getInst(n);t&&this._updateDatepicker(t)},_setDateDatepicker:function(n,t,i){var r=this._getInst(n);r&&(this._setDate(r,t,i),this._updateDatepicker(r),this._updateAlternate(r))},_getDateDatepicker:function(n){var t=this._getInst(n);return t&&!t.inline&&this._setDateFromField(t),t?this._getDate(t):null},_doKeyDown:function(t){var i=n.datepicker._getInst(t.target),r=!0,u;if(i._keyEvent=!0,n.datepicker._datepickerShowing)switch(t.keyCode){case 9:n.datepicker._hideDatepicker(null,"");break;case 13:return u=n("td."+n.datepicker._dayOverClass+", td."+n.datepicker._currentClass,i.dpDiv),u[0]?n.datepicker._selectDay(t.target,i.selectedMonth,i.selectedYear,u[0]):n.datepicker._hideDatepicker(null,n.datepicker._get(i,"duration")),!1;case 27:n.datepicker._hideDatepicker(null,n.datepicker._get(i,"duration"));break;case 33:n.datepicker._adjustDate(t.target,t.ctrlKey?-n.datepicker._get(i,"stepBigMonths"):-n.datepicker._get(i,"stepMonths"),"M");break;case 34:n.datepicker._adjustDate(t.target,t.ctrlKey?+n.datepicker._get(i,"stepBigMonths"):+n.datepicker._get(i,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&n.datepicker._clearDate(t.target);r=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&n.datepicker._gotoToday(t.target);r=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&n.datepicker._adjustDate(t.target,-1,"D");r=t.ctrlKey||t.metaKey;t.originalEvent.altKey&&n.datepicker._adjustDate(t.target,t.ctrlKey?-n.datepicker._get(i,"stepBigMonths"):-n.datepicker._get(i,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&n.datepicker._adjustDate(t.target,-7,"D");r=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&n.datepicker._adjustDate(t.target,1,"D");r=t.ctrlKey||t.metaKey;t.originalEvent.altKey&&n.datepicker._adjustDate(t.target,t.ctrlKey?+n.datepicker._get(i,"stepBigMonths"):+n.datepicker._get(i,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&n.datepicker._adjustDate(t.target,7,"D");r=t.ctrlKey||t.metaKey;break;default:r=!1}else t.keyCode==36&&t.ctrlKey?n.datepicker._showDatepicker(this):r=!1;r&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var u=n.datepicker._getInst(t.target),i,r;if(n.datepicker._get(u,"constrainInput"))return i=n.datepicker._possibleChars(n.datepicker._get(u,"dateFormat")),r=String.fromCharCode(t.charCode==undefined?t.keyCode:t.charCode),t.ctrlKey||r<" "||!i||i.indexOf(r)>-1},_showDatepicker:function(t){var r,e,u,f;if((t=t.target||t,t.nodeName.toLowerCase()!="input"&&(t=n("input",t.parentNode)[0]),!n.datepicker._isDisabledDatepicker(t)&&n.datepicker._lastInput!=t)&&(r=n.datepicker._getInst(t),e=n.datepicker._get(r,"beforeShow"),i(r.settings,e?e.apply(t,[t,r]):{}),n.datepicker._hideDatepicker(null,""),n.datepicker._lastInput=t,n.datepicker._setDateFromField(r),n.datepicker._inDialog&&(t.value=""),n.datepicker._pos||(n.datepicker._pos=n.datepicker._findPos(t),n.datepicker._pos[1]+=t.offsetHeight),u=!1,n(t).parents().each(function(){return u|=n(this).css("position")=="fixed",!u}),u&&n.browser.opera&&(n.datepicker._pos[0]-=document.documentElement.scrollLeft,n.datepicker._pos[1]-=document.documentElement.scrollTop),f={left:n.datepicker._pos[0],top:n.datepicker._pos[1]},n.datepicker._pos=null,r.rangeStart=null,r.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),n.datepicker._updateDatepicker(r),r.dpDiv.width(n.datepicker._getNumberOfMonths(r)[1]*n(".ui-datepicker",r.dpDiv[0])[0].offsetWidth),f=n.datepicker._checkOffset(r,f,u),r.dpDiv.css({position:n.datepicker._inDialog&&n.blockUI?"static":u?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"}),!r.inline)){var o=n.datepicker._get(r,"showAnim")||"show",s=n.datepicker._get(r,"duration"),h=function(){n.datepicker._datepickerShowing=!0;n.browser.msie&&parseInt(n.browser.version,10)<7&&n("iframe.ui-datepicker-cover").css({width:r.dpDiv.width()+4,height:r.dpDiv.height()+4})};n.effects&&n.effects[o]?r.dpDiv.show(o,n.datepicker._get(r,"showOptions"),s,h):r.dpDiv[o](s,h);s==""&&h();r.input[0].type!="hidden"&&r.input[0].focus();n.datepicker._curInst=r}},_updateDatepicker:function(t){var r={width:t.dpDiv.width()+4,height:t.dpDiv.height()+4},i;t.dpDiv.empty().append(this._generateHTML(t)).find("iframe.ui-datepicker-cover").css({width:r.width,height:r.height});i=this._getNumberOfMonths(t);t.dpDiv[(i[0]!=1||i[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");t.input&&t.input[0].type!="hidden"&&t==n.datepicker._curInst&&n(t.input[0]).focus()},_checkOffset:function(t,i,r){var e=t.input?this._findPos(t.input[0]):null,o=window.innerWidth||(document.documentElement?document.documentElement.clientWidth:document.body.clientWidth),s=window.innerHeight||(document.documentElement?document.documentElement.clientHeight:document.body.clientHeight),u=document.documentElement.scrollLeft||document.body.scrollLeft,f=document.documentElement.scrollTop||document.body.scrollTop;return this._get(t,"isRTL")||i.left+t.dpDiv.width()-u>o?i.left=Math.max(r?0:u,e[0]+(t.input?t.input.width():0)-(r?u:0)-t.dpDiv.width()-(r&&n.browser.opera?document.documentElement.scrollLeft:0)):i.left-=r?u:0,i.top+t.dpDiv.height()-f>s?i.top=Math.max(r?0:f,e[1]-(r?f:0)-(this._inDialog?0:t.dpDiv.height())-(r&&n.browser.opera?document.documentElement.scrollTop:0)):i.top-=r?f:0,i},_findPos:function(t){while(t&&(t.type=="hidden"||t.nodeType!=1))t=t.nextSibling;var i=n(t).offset();return[i.left,i.top]},_hideDatepicker:function(i,r){var u=this._curInst,s,f,e,o;u&&(!i||u==n.data(i,t))&&(s=this._get(u,"rangeSelect"),s&&u.stayOpen&&this._selectDate("#"+u.id,this._formatDate(u,u.currentDay,u.currentMonth,u.currentYear)),u.stayOpen=!1,this._datepickerShowing&&(r=r!=null?r:this._get(u,"duration"),f=this._get(u,"showAnim"),e=function(){n.datepicker._tidyDialog(u)},r!=""&&n.effects&&n.effects[f]?u.dpDiv.hide(f,n.datepicker._get(u,"showOptions"),r,e):u.dpDiv[r==""?"hide":f=="slideDown"?"slideUp":f=="fadeIn"?"fadeOut":"hide"](r,e),r==""&&this._tidyDialog(u),o=this._get(u,"onClose"),o&&o.apply(u.input?u.input[0]:null,[u.input?u.input.val():"",u]),this._datepickerShowing=!1,this._lastInput=null,u.settings.prompt=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),n.blockUI&&(n.unblockUI(),n("body").append(this.dpDiv))),this._inDialog=!1),this._curInst=null)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker");n("."+this._promptClass,t.dpDiv).remove()},_checkExternalClick:function(t){if(n.datepicker._curInst){var i=n(t.target);i.parents("#"+n.datepicker._mainDivId).length!=0||i.hasClass(n.datepicker.markerClassName)||i.hasClass(n.datepicker._triggerClass)||!n.datepicker._datepickerShowing||n.datepicker._inDialog&&n.blockUI||n.datepicker._hideDatepicker(null,"")}},_adjustDate:function(t,i,r){var f=n(t),u=this._getInst(f[0]);this._adjustInstDate(u,i,r);this._updateDatepicker(u)},_gotoToday:function(t){var u=n(t),i=this._getInst(u[0]),r;this._get(i,"gotoCurrent")&&i.currentDay?(i.selectedDay=i.currentDay,i.drawMonth=i.selectedMonth=i.currentMonth,i.drawYear=i.selectedYear=i.currentYear):(r=new Date,i.selectedDay=r.getDate(),i.drawMonth=i.selectedMonth=r.getMonth(),i.drawYear=i.selectedYear=r.getFullYear());this._notifyChange(i);this._adjustDate(u)},_selectMonthYear:function(t,i,r){var f=n(t),u=this._getInst(f[0]);u._selectingMonthYear=!1;u["selected"+(r=="M"?"Month":"Year")]=u["draw"+(r=="M"?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10);this._notifyChange(u);this._adjustDate(f)},_clickMonthYear:function(t){var r=n(t),i=this._getInst(r[0]);i.input&&i._selectingMonthYear&&!n.browser.msie&&i.input[0].focus();i._selectingMonthYear=!i._selectingMonthYear},_changeFirstDay:function(t,i){var u=n(t),r=this._getInst(u[0]);r.settings.firstDay=i;this._updateDatepicker(r)},_selectDay:function(t,i,r,u){if(!n(u).hasClass(this._unselectableClass)){var o=n(t),f=this._getInst(o[0]),e=this._get(f,"rangeSelect");e&&(f.stayOpen=!f.stayOpen,f.stayOpen&&(n(".ui-datepicker td",f.dpDiv).removeClass(this._currentClass),n(u).addClass(this._currentClass)));f.selectedDay=f.currentDay=n("a",u).html();f.selectedMonth=f.currentMonth=i;f.selectedYear=f.currentYear=r;f.stayOpen?f.endDay=f.endMonth=f.endYear=null:e&&(f.endDay=f.currentDay,f.endMonth=f.currentMonth,f.endYear=f.currentYear);this._selectDate(t,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear));f.stayOpen?(f.rangeStart=this._daylightSavingAdjust(new Date(f.currentYear,f.currentMonth,f.currentDay)),this._updateDatepicker(f)):e&&(f.selectedDay=f.currentDay=f.rangeStart.getDate(),f.selectedMonth=f.currentMonth=f.rangeStart.getMonth(),f.selectedYear=f.currentYear=f.rangeStart.getFullYear(),f.rangeStart=null,f.inline&&this._updateDatepicker(f))}},_clearDate:function(t){var r=n(t),i=this._getInst(r[0]);this._get(i,"mandatory")||(i.stayOpen=!1,i.endDay=i.endMonth=i.endYear=i.rangeStart=null,this._selectDate(r,""))},_selectDate:function(t,i){var f=n(t),r=this._getInst(f[0]),u;i=i!=null?i:this._formatDate(r);this._get(r,"rangeSelect")&&i&&(i=(r.rangeStart?this._formatDate(r,r.rangeStart):i)+this._get(r,"rangeSeparator")+i);r.input&&r.input.val(i);this._updateAlternate(r);u=this._get(r,"onSelect");u?u.apply(r.input?r.input[0]:null,[i,r]):r.input&&r.input.trigger("change");r.inline?this._updateDatepicker(r):r.stayOpen||(this._hideDatepicker(null,this._get(r,"duration")),this._lastInput=r.input[0],typeof r.input[0]!="object"&&r.input[0].focus(),this._lastInput=null)},_updateAlternate:function(t){var f=this._get(t,"altField"),r,i;f&&(r=this._get(t,"altFormat")||this._get(t,"dateFormat"),i=this._getDate(t),dateStr=u(i)?!i[0]&&!i[1]?"":this.formatDate(r,i[0],this._getFormatConfig(t))+this._get(t,"rangeSeparator")+this.formatDate(r,i[1]||i[0],this._getFormatConfig(t)):this.formatDate(r,i,this._getFormatConfig(t)),n(f).each(function(){n(this).val(dateStr)}))},noWeekends:function(n){var t=n.getDay();return[t>0&&t<6,""]},iso8601Week:function(t){var i=new Date(t.getFullYear(),t.getMonth(),t.getDate()),r=new Date(i.getFullYear(),0,4),u=r.getDay()||7;return(r.setDate(r.getDate()+1-u),u<4&&i<r)?(i.setDate(i.getDate()-3),n.datepicker.iso8601Week(i)):i>new Date(i.getFullYear(),11,28)&&(u=new Date(i.getFullYear()+1,0,4).getDay()||7,u>4&&(i.getDay()||7)<u-3)?1:Math.floor((i-r)/6048e5)+1},dateStatus:function(t,i){return n.datepicker.formatDate(n.datepicker._get(i,"dateStatus"),t,n.datepicker._getFormatConfig(i))},parseDate:function(n,t,i){var f,y,e;if(n==null||t==null)throw"Invalid arguments";if(t=typeof t=="object"?t.toString():t+"",t=="")return null;var w=(i?i.shortYearCutoff:null)||this._defaults.shortYearCutoff,b=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,k=(i?i.dayNames:null)||this._defaults.dayNames,d=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,g=(i?i.monthNames:null)||this._defaults.monthNames,u=-1,o=-1,s=-1,l=-1,a=!1,c=function(t){var i=f+1<n.length&&n.charAt(f+1)==t;return i&&f++,i},h=function(n){c(n);for(var f=n=="@"?14:n=="y"?4:n=="o"?3:2,i=f,u=0;i>0&&r<t.length&&t.charAt(r)>="0"&&t.charAt(r)<="9";)u=u*10+parseInt(t.charAt(r++),10),i--;if(i==f)throw"Missing number at position "+r;return u},p=function(n,i,u){for(var h,l,f,e=c(n)?u:i,o=0,s=0;s<e.length;s++)o=Math.max(o,e[s].length);for(h="",l=r;o>0&&r<t.length;){for(h+=t.charAt(r++),f=0;f<e.length;f++)if(h==e[f])return f+1;o--}throw"Unknown name at position "+l;},v=function(){if(t.charAt(r)!=n.charAt(f))throw"Unexpected literal at position "+r;r++},r=0;for(f=0;f<n.length;f++)if(a)n.charAt(f)!="'"||c("'")?v():a=!1;else switch(n.charAt(f)){case"d":s=h("d");break;case"D":p("D",b,k);break;case"o":l=h("o");break;case"m":o=h("m");break;case"M":o=p("M",d,g);break;case"y":u=h("y");break;case"@":e=new Date(h("@"));u=e.getFullYear();o=e.getMonth()+1;s=e.getDate();break;case"'":c("'")?v():a=!0;break;default:v()}if(u==-1?u=(new Date).getFullYear():u<100&&(u+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u<=w?0:-100)),l>-1){o=1;s=l;do{if(y=this._getDaysInMonth(u,o-1),s<=y)break;o++;s-=y}while(1)}if(e=this._daylightSavingAdjust(new Date(u,o-1,s)),e.getFullYear()!=u||e.getMonth()+1!=o||e.getDate()!=s)throw"Invalid date";return e},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TIMESTAMP:"@",W3C:"yy-mm-dd",formatDate:function(n,t,i){var u,h,e;if(!t)return"";var l=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,v=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,y=(i?i.monthNames:null)||this._defaults.monthNames,f=function(t){var i=u+1<n.length&&n.charAt(u+1)==t;return i&&u++,i},o=function(n,t,i){var r=""+t;if(f(n))while(r.length<i)r="0"+r;return r},c=function(n,t,i,r){return f(n)?r[t]:i[t]},r="",s=!1;if(t)for(u=0;u<n.length;u++)if(s)n.charAt(u)!="'"||f("'")?r+=n.charAt(u):s=!1;else switch(n.charAt(u)){case"d":r+=o("d",t.getDate(),2);break;case"D":r+=c("D",t.getDay(),l,a);break;case"o":for(h=t.getDate(),e=t.getMonth()-1;e>=0;e--)h+=this._getDaysInMonth(t.getFullYear(),e);r+=o("o",h,3);break;case"m":r+=o("m",t.getMonth()+1,2);break;case"M":r+=c("M",t.getMonth(),v,y);break;case"y":r+=f("y")?t.getFullYear():(t.getYear()%100<10?"0":"")+t.getYear()%100;break;case"@":r+=t.getTime();break;case"'":f("'")?r+="'":s=!0;break;default:r+=n.charAt(u)}return r},_possibleChars:function(n){for(var i="",r=!1,t=0;t<n.length;t++)if(r)n.charAt(t)!="'"||lookAhead("'")?i+=n.charAt(t):r=!1;else switch(n.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":lookAhead("'")?i+="'":r=!0;break;default:i+=n.charAt(t)}return i},_get:function(n,t){return n.settings[t]!==undefined?n.settings[t]:this._defaults[t]},_setDateFromField:function(n){var u=this._get(n,"dateFormat"),i=n.input?n.input.val().split(this._get(n,"rangeSeparator")):null,t,r;if(n.endDay=n.endMonth=n.endYear=null,t=defaultDate=this._getDefaultDate(n),i.length>0){r=this._getFormatConfig(n);i.length>1&&(t=this.parseDate(u,i[1],r)||defaultDate,n.endDay=t.getDate(),n.endMonth=t.getMonth(),n.endYear=t.getFullYear());try{t=this.parseDate(u,i[0],r)||defaultDate}catch(f){this.log(f);t=defaultDate}}n.selectedDay=t.getDate();n.drawMonth=n.selectedMonth=t.getMonth();n.drawYear=n.selectedYear=t.getFullYear();n.currentDay=i[0]?t.getDate():0;n.currentMonth=i[0]?t.getMonth():0;n.currentYear=i[0]?t.getFullYear():0;this._adjustInstDate(n)},_getDefaultDate:function(n){var t=this._determineDate(this._get(n,"defaultDate"),new Date),i=this._getMinMaxDate(n,"min",!0),r=this._getMinMaxDate(n,"max");return t=i&&t<i?i:t,r&&t>r?r:t},_determineDate:function(n,t){var i=function(n){var t=new Date;return t.setDate(t.getDate()+n),t},r=function(n,t){for(var e=new Date,u=e.getFullYear(),f=e.getMonth(),i=e.getDate(),o=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,r=o.exec(n);r;){switch(r[2]||"d"){case"d":case"D":i+=parseInt(r[1],10);break;case"w":case"W":i+=parseInt(r[1],10)*7;break;case"m":case"M":f+=parseInt(r[1],10);i=Math.min(i,t(u,f));break;case"y":case"Y":u+=parseInt(r[1],10);i=Math.min(i,t(u,f))}r=o.exec(n)}return new Date(u,f,i)};return n=n==null?t:typeof n=="string"?r(n,this._getDaysInMonth):typeof n=="number"?isNaN(n)?t:i(n):n,n=n&&n.toString()=="Invalid Date"?t:n,n&&(n.setHours(0),n.setMinutes(0),n.setSeconds(0),n.setMilliseconds(0)),this._daylightSavingAdjust(n)},_daylightSavingAdjust:function(n){return n?(n.setHours(n.getHours()>12?n.getHours()+2:0),n):null},_setDate:function(n,t,i){var r=!t,u=n.selectedMonth,f=n.selectedYear;t=this._determineDate(t,new Date);n.selectedDay=n.currentDay=t.getDate();n.drawMonth=n.selectedMonth=n.currentMonth=t.getMonth();n.drawYear=n.selectedYear=n.currentYear=t.getFullYear();this._get(n,"rangeSelect")&&(i?(i=this._determineDate(i,null),n.endDay=i.getDate(),n.endMonth=i.getMonth(),n.endYear=i.getFullYear()):(n.endDay=n.currentDay,n.endMonth=n.currentMonth,n.endYear=n.currentYear));(u!=n.selectedMonth||f!=n.selectedYear)&&this._notifyChange(n);this._adjustInstDate(n);n.input&&n.input.val(r?"":this._formatDate(n)+(this._get(n,"rangeSelect")?this._get(n,"rangeSeparator")+this._formatDate(n,n.endDay,n.endMonth,n.endYear):""))},_getDate:function(n){var t=!n.currentYear||n.input&&n.input.val()==""?null:this._daylightSavingAdjust(new Date(n.currentYear,n.currentMonth,n.currentDay));return this._get(n,"rangeSelect")?[n.rangeStart||t,n.endYear?this._daylightSavingAdjust(new Date(n.endYear,n.endMonth,n.endDay)):n.rangeStart||t]:t},_generateHTML:function(t){var a=new Date,tt,p,w,at,b,k,o,h,st,rt,ht,d,ci,pt,wt,s;a=this._daylightSavingAdjust(new Date(a.getFullYear(),a.getMonth(),a.getDate()));var f=this._get(t,"showStatus"),e=this._get(t,"initStatus")||"&#xa0;",ut=this._get(t,"isRTL"),kt=this._get(t,"mandatory")?"":'<div class="ui-datepicker-clear"><a onclick="KSQ.datepicker._clearDate(\'#'+t.id+"');\""+this._addStatus(f,t.id,this._get(t,"clearStatus"),e)+">"+this._get(t,"clearText")+"<\/a><\/div>",dt='<div class="ui-datepicker-control">'+(ut?"":kt)+'<div class="ui-datepicker-close"><a onclick="KSQ.datepicker._hideDatepicker();"'+this._addStatus(f,t.id,this._get(t,"closeStatus"),e)+">"+this._get(t,"closeText")+"<\/a><\/div>"+(ut?kt:"")+"<\/div>",gt=this._get(t,"prompt"),ni=this._get(t,"closeAtTop"),ti=this._get(t,"hideIfNoPrevNext"),g=this._get(t,"navigationAsDateFormat"),v=this._get(t,"showBigPrevNext"),nt=this._getNumberOfMonths(t),ai=this._get(t,"showCurrentAtPos"),ft=this._get(t,"stepMonths"),et=this._get(t,"stepBigMonths"),vi=nt[0]!=1||nt[1]!=1,lt=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),y=this._getMinMaxDate(t,"min",!0),c=this._getMinMaxDate(t,"max"),i=t.drawMonth-ai,u=t.drawYear;if(i<0&&(i+=12,u--),c)for(tt=this._daylightSavingAdjust(new Date(c.getFullYear(),c.getMonth()-nt[1]+1,c.getDate())),tt=y&&tt<y?y:tt;this._daylightSavingAdjust(new Date(u,i,1))>tt;)i--,i<0&&(i=11,u--);p=this._get(t,"prevText");p=g?this.formatDate(p,this._daylightSavingAdjust(new Date(u,i-ft,1)),this._getFormatConfig(t)):p;w=v?this._get(t,"prevBigText"):"";w=g?this.formatDate(w,this._daylightSavingAdjust(new Date(u,i-et,1)),this._getFormatConfig(t)):w;at='<div class="ui-datepicker-prev">'+(this._canAdjustMonth(t,-1,u,i)?(v?"<a onclick=\"KSQ.datepicker._adjustDate('#"+t.id+"', -"+et+", 'M');\""+this._addStatus(f,t.id,this._get(t,"prevBigStatus"),e)+">"+w+"<\/a>":"")+"<a onclick=\"KSQ.datepicker._adjustDate('#"+t.id+"', -"+ft+", 'M');\""+this._addStatus(f,t.id,this._get(t,"prevStatus"),e)+">"+p+"<\/a>":ti?"":(v?"<label>"+w+"<\/label>":"")+"<label>"+p+"<\/label>")+"<\/div>";b=this._get(t,"nextText");b=g?this.formatDate(b,this._daylightSavingAdjust(new Date(u,i+ft,1)),this._getFormatConfig(t)):b;k=v?this._get(t,"nextBigText"):"";k=g?this.formatDate(k,this._daylightSavingAdjust(new Date(u,i+et,1)),this._getFormatConfig(t)):k;var ii='<div class="ui-datepicker-next">'+(this._canAdjustMonth(t,1,u,i)?"<a onclick=\"KSQ.datepicker._adjustDate('#"+t.id+"', +"+ft+", 'M');\""+this._addStatus(f,t.id,this._get(t,"nextStatus"),e)+">"+b+"<\/a>"+(v?"<a onclick=\"KSQ.datepicker._adjustDate('#"+t.id+"', +"+et+", 'M');\""+this._addStatus(f,t.id,this._get(t,"nextBigStatus"),e)+">"+k+"<\/a>":""):ti?"":"<label>"+b+"<\/label>"+(v?"<label>"+k+"<\/label>":""))+"<\/div>",ot=this._get(t,"currentText"),ri=this._get(t,"gotoCurrent")&&t.currentDay?lt:a;ot=g?this.formatDate(ot,ri,this._getFormatConfig(t)):ot;o=(ni&&!t.inline?dt:"")+'<div class="ui-datepicker-links">'+(ut?ii:at)+(this._isInRange(t,ri)?'<div class="ui-datepicker-current"><a onclick="KSQ.datepicker._gotoToday(\'#'+t.id+"');\""+this._addStatus(f,t.id,this._get(t,"currentStatus"),e)+">"+ot+"<\/a><\/div>":"")+(ut?at:ii)+"<\/div>"+(gt?'<div class="'+this._promptClass+'"><span>'+gt+"<\/span><\/div>":"");h=parseInt(this._get(t,"firstDay"));h=isNaN(h)?0:h;var ui=this._get(t,"changeFirstDay"),fi=this._get(t,"dayNames"),yi=this._get(t,"dayNamesShort"),pi=this._get(t,"dayNamesMin"),wi=this._get(t,"monthNames"),ei=this._get(t,"beforeShowDay"),vt=this._get(t,"highlightWeek"),it=this._get(t,"showOtherMonths"),oi=this._get(t,"showWeeks"),bi=this._get(t,"calculateWeek")||this.iso8601Week,si=this._get(t,"weekStatus"),yt=f?this._get(t,"dayStatus")||e:"",ki=this._get(t,"statusForDate")||this.dateStatus,di=t.endDay?this._daylightSavingAdjust(new Date(t.endYear,t.endMonth,t.endDay)):lt,hi=this._getDefaultDate(t);for(st=0;st<nt[0];st++)for(rt=0;rt<nt[1];rt++){for(ht=this._daylightSavingAdjust(new Date(u,i,t.selectedDay)),o+='<div class="ui-datepicker-one-month'+(rt==0?" ui-datepicker-new-row":"")+'">'+this._generateMonthYearHeader(t,i,u,y,c,ht,st>0||rt>0,f,e,wi)+'<table class="ui-datepicker" cellpadding="0" cellspacing="0"><thead><tr class="ui-datepicker-title-row">'+(oi?"<td"+this._addStatus(f,t.id,si,e)+">"+this._get(t,"weekHeader")+"<\/td>":""),s=0;s<7;s++)d=(s+h)%7,ci=yt.indexOf("DD")>-1?yt.replace(/DD/,fi[d]):yt.replace(/D/,yi[d]),o+="<td"+((s+h+6)%7>=5?' class="ui-datepicker-week-end-cell"':"")+">"+(ui?"<a onclick=\"KSQ.datepicker._changeFirstDay('#"+t.id+"', "+d+');"':"<span")+this._addStatus(f,t.id,ci,e)+' title="'+fi[d]+'">'+pi[d]+(ui?"<\/a>":"<\/span>")+"<\/td>";o+="<\/tr><\/thead><tbody>";pt=this._getDaysInMonth(u,i);u==t.selectedYear&&i==t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,pt));var li=(this._getFirstDayOfMonth(u,i)-h+7)%7,gi=vi?6:Math.ceil((li+pt)/7),r=this._daylightSavingAdjust(new Date(u,i,1-li));for(wt=0;wt<gi;wt++){for(o+='<tr class="ui-datepicker-days-row">'+(oi?'<td class="ui-datepicker-week-col"'+this._addStatus(f,t.id,si,e)+">"+bi(r)+"<\/td>":""),s=0;s<7;s++){var ct=ei?ei.apply(t.input?t.input[0]:null,[r]):[!0,""],l=r.getMonth()!=i,bt=l||!ct[0]||y&&r<y||c&&r>c;o+='<td class="ui-datepicker-days-cell'+((s+h+6)%7>=5?" ui-datepicker-week-end-cell":"")+(l?" ui-datepicker-other-month":"")+(r.getTime()==ht.getTime()&&i==t.selectedMonth&&t._keyEvent||hi.getTime()==r.getTime()&&hi.getTime()==ht.getTime()?" "+n.datepicker._dayOverClass:"")+(bt?" "+this._unselectableClass:"")+(l&&!it?"":" "+ct[1]+(r.getTime()>=lt.getTime()&&r.getTime()<=di.getTime()?" "+this._currentClass:"")+(r.getTime()==a.getTime()?" ui-datepicker-today":""))+'"'+((!l||it)&&ct[2]?' title="'+ct[2]+'"':"")+(bt?vt?" onmouseover=\"KSQ(this).parent().addClass('"+this._weekOverClass+"');\" onmouseout=\"KSQ(this).parent().removeClass('"+this._weekOverClass+"');\"":"":" onmouseover=\"KSQ(this).addClass('"+this._dayOverClass+"')"+(vt?".parent().addClass('"+this._weekOverClass+"')":"")+";"+(!f||l&&!it?"":"KSQ('#ui-datepicker-status-"+t.id+"').html('"+(ki.apply(t.input?t.input[0]:null,[r,t])||e)+"');")+'" onmouseout="KSQ(this).removeClass(\''+this._dayOverClass+"')"+(vt?".parent().removeClass('"+this._weekOverClass+"')":"")+";"+(!f||l&&!it?"":"KSQ('#ui-datepicker-status-"+t.id+"').html('"+e+"');")+'" onclick="KSQ.datepicker._selectDay(\'#'+t.id+"',"+i+","+u+', this);"')+">"+(l?it?r.getDate():"&#xa0;":bt?r.getDate():"<a>"+r.getDate()+"<\/a>")+"<\/td>";r.setDate(r.getDate()+1);r=this._daylightSavingAdjust(r)}o+="<\/tr>"}i++;i>11&&(i=0,u++);o+="<\/tbody><\/table><\/div>"}return o+=(f?'<div style="clear: both;"><\/div><div id="ui-datepicker-status-'+t.id+'" class="ui-datepicker-status">'+e+"<\/div>":"")+(!ni&&!t.inline?dt:"")+'<div style="clear: both;"><\/div>'+(n.browser.msie&&parseInt(n.browser.version,10)<7&&!t.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover"><\/iframe>':""),t._keyEvent=!1,o},_generateMonthYearHeader:function(n,t,i,r,u,f,e,o,s,h){var d,g,l;r=n.rangeStart&&r&&f<r?f:r;var w=this._get(n,"changeMonth"),b=this._get(n,"changeYear"),k=this._get(n,"showMonthAfterYear"),v='<div class="ui-datepicker-header">',p="";if(e||!w)p+=h[t];else{for(d=r&&r.getFullYear()==i,g=u&&u.getFullYear()==i,p+='<select class="ui-datepicker-new-month" onchange="KSQ.datepicker._selectMonthYear(\'#'+n.id+"', this, 'M');\" onclick=\"KSQ.datepicker._clickMonthYear('#"+n.id+"');\""+this._addStatus(o,n.id,this._get(n,"monthStatus"),s)+">",l=0;l<12;l++)(!d||l>=r.getMonth())&&(!g||l<=u.getMonth())&&(p+='<option value="'+l+'"'+(l==t?' selected="selected"':"")+">"+h[l]+"<\/option>");p+="<\/select>"}if(k||(v+=p+(e||w||b?"&#xa0;":"")),e||!b)v+=i;else{var y=this._get(n,"yearRange").split(":"),c=0,a=0;for(y.length!=2?(c=i-10,a=i+10):y[0].charAt(0)=="+"||y[0].charAt(0)=="-"?(c=a=(new Date).getFullYear(),c+=parseInt(y[0],10),a+=parseInt(y[1],10)):(c=parseInt(y[0],10),a=parseInt(y[1],10)),c=r?Math.max(c,r.getFullYear()):c,a=u?Math.min(a,u.getFullYear()):a,v+='<select class="ui-datepicker-new-year" onchange="KSQ.datepicker._selectMonthYear(\'#'+n.id+"', this, 'Y');\" onclick=\"KSQ.datepicker._clickMonthYear('#"+n.id+"');\""+this._addStatus(o,n.id,this._get(n,"yearStatus"),s)+">";c<=a;c++)v+='<option value="'+c+'"'+(c==i?' selected="selected"':"")+">"+c+"<\/option>";v+="<\/select>"}return k&&(v+=(e||w||b?"&#xa0;":"")+p),v+"<\/div>"},_addStatus:function(n,t,i,r){return n?" onmouseover=\"KSQ('#ui-datepicker-status-"+t+"').html('"+(i||r)+"');\" onmouseout=\"KSQ('#ui-datepicker-status-"+t+"').html('"+r+"');\"":""},_adjustInstDate:function(n,t,i){var e=n.drawYear+(i=="Y"?t:0),o=n.drawMonth+(i=="M"?t:0),s=Math.min(n.selectedDay,this._getDaysInMonth(e,o))+(i=="D"?t:0),r=this._daylightSavingAdjust(new Date(e,o,s)),u=this._getMinMaxDate(n,"min",!0),f=this._getMinMaxDate(n,"max");r=u&&r<u?u:r;r=f&&r>f?f:r;n.selectedDay=r.getDate();n.drawMonth=n.selectedMonth=r.getMonth();n.drawYear=n.selectedYear=r.getFullYear();(i=="M"||i=="Y")&&this._notifyChange(n)},_notifyChange:function(n){var t=this._get(n,"onChangeMonthYear");t&&t.apply(n.input?n.input[0]:null,[n.selectedYear,n.selectedMonth+1,n])},_getNumberOfMonths:function(n){var t=this._get(n,"numberOfMonths");return t==null?[1,1]:typeof t=="number"?[1,t]:t},_getMinMaxDate:function(n,t,i){var r=this._determineDate(this._get(n,t+"Date"),null);return!i||!n.rangeStart?r:!r||n.rangeStart>r?n.rangeStart:r},_getDaysInMonth:function(n,t){return 32-new Date(n,t,32).getDate()},_getFirstDayOfMonth:function(n,t){return new Date(n,t,1).getDay()},_canAdjustMonth:function(n,t,i,r){var f=this._getNumberOfMonths(n),u=this._daylightSavingAdjust(new Date(i,r+(t<0?t:f[1]),1));return t<0&&u.setDate(this._getDaysInMonth(u.getFullYear(),u.getMonth())),this._isInRange(n,u)},_isInRange:function(n,t){var i=n.rangeStart?this._daylightSavingAdjust(new Date(n.selectedYear,n.selectedMonth,n.selectedDay)):null,r,u;return i=i&&n.rangeStart<i?n.rangeStart:i,r=i||this._getMinMaxDate(n,"min"),u=this._getMinMaxDate(n,"max"),(!r||t>=r)&&(!u||t<=u)},_getFormatConfig:function(n){var t=this._get(n,"shortYearCutoff");return t=typeof t!="string"?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(n,"dayNamesShort"),dayNames:this._get(n,"dayNames"),monthNamesShort:this._get(n,"monthNamesShort"),monthNames:this._get(n,"monthNames")}},_formatDate:function(n,t,i,r){t||(n.currentDay=n.selectedDay,n.currentMonth=n.selectedMonth,n.currentYear=n.selectedYear);var u=t?typeof t=="object"?t:this._daylightSavingAdjust(new Date(r,i,t)):this._daylightSavingAdjust(new Date(n.currentYear,n.currentMonth,n.currentDay));return this.formatDate(this._get(n,"dateFormat"),u,this._getFormatConfig(n))}});n.fn.datepicker=function(t){n.datepicker.initialized||(n(document.body).append(n.datepicker.dpDiv).mousedown(n.datepicker._checkExternalClick),n.datepicker.initialized=!0);var i=Array.prototype.slice.call(arguments,1);return typeof t=="string"&&(t=="isDisabled"||t=="getDate")?n.datepicker["_"+t+"Datepicker"].apply(n.datepicker,[this[0]].concat(i)):this.each(function(){typeof t=="string"?n.datepicker["_"+t+"Datepicker"].apply(n.datepicker,[this].concat(i)):n.datepicker._attachDatepicker(this,t)})};n.datepicker=new r;n.datepicker.initialized=!1;n.datepicker.uuid=(new Date).getTime();n.datepicker.version="1.6"}(KSQ)