/*
 *
 * Wijmo Library 2.3.1
 * http://wijmo.com/
 *
 * Copyright(c) GrapeCity, Inc.  All rights reserved.
 * 
 * Licensed under the Wijmo Commercial License. Also available under the GNU GPL Version 3 license.
 * licensing@wijmo.com
 * http://wijmo.com/widgets/license/
 *
 *
 **/
(function(a){"use strict";a.fn.extend({wijtextselection:function(){var c,e,g=this[0],d=this.val();if(arguments.length===0){var b,i,f,h;if(a.browser.msie&&a.browser.version<9)try{var k=document.selection;if(g.tagName.toLowerCase()!="textarea"){b=k.createRange().duplicate();b.moveEnd("character",d.length);f=b.text===""?d.length:d.lastIndexOf(b.text);b=k.createRange().duplicate();b.moveStart("character",-d.length);h=b.text.length}else{b=k.createRange();i=b.duplicate();i.moveToElementText(g);i.setEndPoint("EndToEnd",b);f=i.text.length-b.text.length,h=f+b.text.length}}catch(h){}else{f=g.selectionStart;h=g.selectionEnd}var m=d.substring(f,h);return{start:f,end:h,text:m,replace:function(a){return d.substring(0,f)+a+d.substring(h,d.length)}}}else if(arguments.length===1){if(typeof arguments[0]==="object"&&typeof arguments[0].start==="number"&&typeof arguments[0].end==="number"){c=arguments[0].start;e=arguments[0].end}else if(typeof arguments[0]==="string"){if((c=d.indexOf(arguments[0]))>-1)e=c+arguments[0].length}else if(Object.prototype.toString.call(arguments[0])==="[object RegExp]"){var l=arguments[0].exec(d);if(l!=null){c=l.index;e=c+l[0].length}}}else if(arguments.length===2)if(typeof arguments[0]==="number"&&typeof arguments[1]==="number"){c=arguments[0];e=arguments[1]}if(typeof c==="undefined"){c=0;e=d.length}if(a.browser.msie){var j=g.createTextRange();j.collapse(true);j.moveStart("character",c);j.moveEnd("character",e-c);j.select()}else{g.selectionStart=c;g.selectionEnd=e}}})})(jQuery);


/*
 *
 * Wijmo Library 2.3.1
 * http://wijmo.com/
 *
 * Copyright(c) GrapeCity, Inc.  All rights reserved.
 * 
 * Licensed under the Wijmo Commercial License. Also available under the GNU GPL Version 3 license.
 * licensing@wijmo.com
 * http://wijmo.com/widgets/license/
 *
 *
 **/
(function(a){"use strict";var h="wijmo-wijcombobox-input",c="ui-state-hover",d="ui-state-active",b="ui-state-focus",f="ui-corner-left",e="ui-corner-right",i="<div class='wijmo-wijcombobox-trigger ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-s'></span></div>",g="<label class='wijmo-wijcombobox-label ui-widget-content'></label>";a.widget("wijmo.wijcombobox",{options:{dataSource:null,data:null,labelText:null,minLength:4,delay:300,showingAnimation:null,hidingAnimation:null,showTrigger:true,triggerPosition:"right",dropdownHeight:300,dropdownWidth:"auto",selectOnItemFocus:false,autoFilter:true,autoComplete:true,highlightMatching:true,dropDownListPosition:{},columns:[],selectionMode:"single",multipleSelectionSeparator:",",forceSelectionText:false,select:null,isEditable:true,selectedIndex:-1,selectedValue:null,inputTextInDropDownList:false,text:null,ensureDropDownOnBody:true,open:null,close:null,selectElementWidthFix:6,search:null,changed:null,listOptions:null},_create:function(){var b=this;b.selectedItem=null;b.selectedItems=[];if(window.wijmoApplyWijTouchUtilEvents)a=window.wijmoApplyWijTouchUtilEvents(a);b._initInnerData();b._createDOMElements();b._bindInputEvents();b._initDropDownList();b.repaint();b._checkSelectIndex();if(b._usingRemoteData()&&b.options.data)b.originalDataSourceLoaded=b.options.data.loaded;b.element.is(":hidden")&&b.element.wijAddVisibilityObserver&&b.element.wijAddVisibilityObserver(function(){b.repaint();b.element.wijRemoveVisibilityObserver&&b.element.wijRemoveVisibilityObserver()},"wijcombobox")},_initInnerData:function(){var a=this,c=a.options,b;if(c.datasource!==null){b=a._isBind();if(b)a.innerData=a._getMappingItems();else a.innerData=c.data}a.listHasCreated=false},_checkSelectIndex:function(){var c=this,d,b=c.options,e=c.innerData;b.selectedIndex===-1&&b.selectedValue&&a.each(e,function(a){if(e[a].value===b.selectedValue){c.options.selectedIndex=a;return false}});d=b.selectedIndex;!c._usingRemoteData()&&(d>=0||a.isArray(d))&&c.search(null,"checkindex");if(b.selectedIndex===-1&&b.text)(!b.forceSelectionText||b.forceSelectionText&&c._checkTextInItems(b.text)!==-1)&&c._input.val(b.text)},repaint:function(){var b=this.options,a=this;if(a.element.is(":visible")||a._comboDiv||a._select!==undefined&&a._input.is(":visible")){a._showTrigger();if(b.disabledState){var c=b.disabled;a.disable();b.disabled=c}b.disabled&&a.disable();return true}return false},_bindInputEvents:function(){var c=this,e,f,g,d;e=c._input;f=c.options;e.bind("keydown.wijcombobox",function(b){if(f.disabledState===true||f.disabled)return;g=b.keyCode;d=a.ui.keyCode;switch(g){case d.UP:c._move("previous",b);b.preventDefault();break;case d.DOWN:c._move("next",b);b.preventDefault();break;case d.ENTER:if(c.menu.active){b.preventDefault();f.selectionMode==="multiple"&&c.menu&&c.menu.items&&c.menu.items.length===1&&a.each(c.selectedItems,function(b,a){if(a!==c.menu.items[0])a.selected=false});c.menu.select(b)}b.preventDefault();break;case d.TAB:e.trigger("wijcomboblur");if(!c.menu.active||f.selectionMode==="multiple"&&d.TAB===g)return;c.menu.select(b);var h=e.val().length;c._selectText(h,h,e);break;case d.ESCAPE:c.close(b);break;case d.LEFT:case d.RIGHT:case d.SHIFT:case 16:case d.CONTROL:case d.HOME:case d.END:case d.DELETE:case d.PAGE_UP:case d.PAGE_DOWN:break;case 18:e.trigger("wijcomboblur");break;default:window.clearTimeout(c.searching);if(f.isEditable===false){if(c._cacheKey===undefined)c._cacheKey="";c._cacheKey+=String.fromCharCode(g)}c.searching=window.setTimeout(function(){var a;if(f.isEditable===false){a=c._cacheKey;c._cacheKey=undefined}else a=e.val();c.search(a,b)},f.delay)}}).bind("wijcomboblur.wijcombobox",function(a){window.clearTimeout(c.searching);c._addInputFocus(false,b);c.closing=window.setTimeout(function(){c.close(a,true)},150)}).bind("focus.wijcombobox",function(){c._addInputFocus(true,b)}).bind("blur.wijcombobox",function(){!c.menu.element.is(":visible")&&e.trigger("wijcomboblur");c._change()})},_addInputFocus:function(f,e){var c=this,d,b,a;d=c._input.parent();b=f?"addClass":"removeClass";a=c._triggerArrow;d[b](e);a!==undefined&&a[b](e)},_renderColumnsHeader:function(c){var b=a("<ul class='wijmo-wijcombobox-rowheader'></ul>");a.each(this.options.columns,function(e,c){var d=a("<li class='wijmo-wijcombobox-cell ui-widget-header'></li>");d.html(c.name);c.width!==undefined&&d.width(c.width);d.appendTo(b)});c.append(b)},_hasSameValueText:function(a,b){return a.label===b.label&&a.value===b.value},_initDropDownList:function(){var b=this,h,d,c,f,e,g;h=b.element[0].ownerDocument;if(!b._comboDiv)d=a("<div class='wijmo-wijcombobox-list'></div>");else d=b._oriList;c=b.options;if(c.columns.length>0){d.addClass("wijmo-wijcombobox-multicolumn");f=a("<div class='wijmo-wijsuperpanel-header ui-state-default'></div>");b._renderColumnsHeader(f);d.append(f)}e={keepHightlightOnMouseLeave:true,selectionMode:c.selectionMode,addHoverItemClass:c.columns.length===0,focus:function(e,d){var a=d;c.selectOnItemFocus&&b.menu.select(null,{notCloseAfterSelected:true});if(c.columns.length>0){a.element.prev().addClass("wijmo-wijcombobox-active-prev");a.element.find(".wijmo-wijcombobox-row>.wijmo-wijcombobox-cell").addClass("ui-state-hover")}},selected:function(i,f){window.clearTimeout(b.closing);var j=c.selectionMode,d,e,h,g;d=f.item;if(b._trigger("select",i,d))if(j==="single"){if(!b._usingRemoteData()){e=a.inArray(d,b.items);if(e===undefined)e=f.selectedIndex;if(e!==c.selectedIndex){b._input.val(d.label);g=b.selectedItem;if(g!==null)g.selected=false;b.selectedItem=d;h=c.selectedIndex;c.selectedIndex=e;c.selectedValue=b.selectedItem.value;if(b._select!==undefined){b._select[0].selectedIndex=c.selectedIndex;b._select.trigger("change")}c.inputTextInDropDownList=true;c.text=b._input.val();g&&g.element&&g.element.removeClass("wijmo-wijcombobox-selecteditem");b._trigger("changed",null,{oldItem:g,selectedItem:b.selectedItem,newIndex:c.selectedIndex,oldIndex:h})}else b.selectedItem&&b._input.val()!==b.selectedItem.label&&(f.data===undefined||!f.data.notCloseAfterSelected)&&b._input.val(d.label)}else if(b.selectedItem===null||!b._hasSameValueText(d,b.selectedItem)){b._input.val(d.label);c.text=b._input.val();b.selectedItem=d;e=a.inArray(d,b.items);if(e===undefined)e=f.selectedIndex;if(e!==c.selectedIndex){c.selectedIndex=e;c.selectedValue=b.selectedItem.value}c.inputTextInDropDownList=true;b._trigger("changed",null,{selectedItem:d})}}else if(!b._usingRemoteData()){b.selectedItems=f.selectedItems;b._selectedItemsToInputVal(b.selectedItems);c.inputTextInDropDownList=true;c.selectedIndex=f.selectedIndex;b._trigger("changed",null,{selectedItem:d,selectedItems:b.selectedItems})}if((f.data===undefined||!f.data.notCloseAfterSelected)&&j==="single"){b.close(i);b._input.focus()}},blur:function(d,b){var a=b.element;if(c.columns.length>0&&a){a.find(".wijmo-wijcombobox-row>.wijmo-wijcombobox-cell").removeClass("ui-state-hover");a.prev().removeClass("wijmo-wijcombobox-active-prev")}},itemRendering:function(g,f){var d=f,e;e="";if(d.isSeparator)e+=" wijmo-wijcombobox-separator";if(d.selected)e+=" wijmo-wijcombobox-selecteditem";e.length>0&&d.element.addClass(e);if(b._keypress&&c.isEditable&&c.columns.length===0&&c.highlightMatching&&a.trim(b._input.val()).length>0&&d.label)d.text=d.label.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+b._escapeRegex(b._input.val())+")(?![^<>]*>)(?![^&;]+;)","gi"),"<span class='ui-priority-primary'>$1</span>");else d.text=undefined},itemRendered:function(g,f){var b=f,d,e;if(b.cells===undefined)return;d=b.element;d.empty();e=a("<ul class='wijmo-wijcombobox-row'></ul>");a.each(b.cells,function(d,f){var b=a("<li class='wijmo-wijcombobox-cell ui-state-default'></li>");if(c.columns&&c.columns.length>d)typeof c.columns[d].width!=="undefined"&&b.width(c.columns[d].width);b.append(f);b.attr("title",f);e.append(b)});d.append(e)},superPanelOptions:{resized:function(){var d=b.menu,a=d.element;c.dropdownWidth=a.outerWidth();c.dropdownHeight=a.outerHeight();b._positionList();b.menu.refreshSuperPanel()}}};e=a.extend(true,e,c.listOptions);g=c.ensureDropDownOnBody?"body":b._comboElement;b.menu=d.appendTo(g,h).wijlist(e).zIndex(b._input.zIndex()+1).css({top:0,left:0}).hide().data("wijlist");b._createDropDownList();b._menuUL=b.menu.ul},_createDropDownList:function(e){var b=this,c,f=b.options,d=e;if(!d)d=b.innerData;if(d===null)c=null;else c=a.isArray(d)?d:d.items;if(b._comboDiv){if(!b.listHasCreated&&c&&c.length>0){b.menu.setTemplateItems(f.data);b.menu.renderList();b.listHasCreated=true}}else if(!b.listHasCreated&&c&&c.length>0){b.menu.setItems(c);b.menu.renderList();b.listHasCreated=true}},_getSelectedItemsText:function(e){var b="",c,d;c=this;d=c.options.multipleSelectionSeparator;c.selectedItems=e;a.each(e,function(c,a){if(a)b+=a.label+d});if(b.length>0)b=b.substr(0,b.lastIndexOf(d));return b},_selectedItemsToInputVal:function(b){var a=this;a._input.val(a._getSelectedItemsText(b));a.options.text=a._input.val()},_createDOMElements:function(){var b=this,e,d,f,g;g=a("<div class='wijmo-wijcombobox-wrapper ui-state-default ui-corner-all'></div>");d=b.element;if(d.is("select")){e=a("<div role='combobox' class='wijmo-wijcombobox ui-widget ui-helper-clearfix'></div>");e.append(g);b._comboElement=e;b._select=d;d.addClass("ui-widget");f=b._input=a("<input role='textbox' aria-autocomplete='list' aria-haspopup='true' />").insertAfter(d);if(!b.options.data){b.options.data=b._convertSelectOptions();b._initInnerData()}}else if(d.is("div")&&a(d.children()[0]).is("input[type='text']")&&a(d.children()[1]).is("div")){b._comboElement=b._comboDiv=e=d;b._oriList=a(d.children()[1]);f=b._input=a(d.children()[0]);g.prependTo(e).append(f);d.addClass("wijmo-wijcombobox ui-widget ui-helper-clearfix");d.attr("role","combobox")}else{e=a("<div role='combobox' class='wijmo-wijcombobox ui-widget ui-helper-clearfix'></div>");e.append(g);b._comboElement=e;f=b._input=d}if(!b._comboDiv){e.insertBefore(f);b.element.is(":visible")&&f.width(f.width());e.children(".wijmo-wijcombobox-wrapper").append(f)}f.attr({autocomplete:"off",role:"textbox","aria-wijcombobox":"list","aria-haspopup":"true"}).addClass(h);b._oldWidth=d.css("width");if(b.options.isEditable===false){f.attr("readonly","readonly");g.bind("click",function(){if(b.options.disabledState===true||b.options.disabled)return;b._triggerClick()})}(b.options.disabledState===true||b.options.disabled===true)&&f.attr("disabled","disabled");e.bind("mouseenter",function(){if(b.options.disabledState===true||b.options.disabled)return;b._addInputFocus(true,c)}).bind("mouseleave",function(){b._addInputFocus(false,c)})},_convertSelectOptions:function(){var d=[],b,c;b=this;c=b._select.get(0).options;a.each(c,function(b,a){d.push({label:a.text,value:a.value})});if(b.options.selectedIndex===-1&&b.options.selectedValue===null&&b.options.text===null)b.options.selectedIndex=b._select[0].selectedIndex;return d},getComboElement:function(){return this._comboElement},_showTrigger:function(){var h=this,l,j,q,p,r,t=0,b,k,o,m,s,n;l=h.options;j=h._input;q=j.parent();p=h._comboElement;b=h._triggerArrow;k=h._label;if(h._select!==undefined){if(!a.browser.msie)t=h._select.width();else{r=h._select.clone();h._select.after(r);t=r.width();r.remove()}j.width(t+(h.innerData.length>20?l.selectElementWidthFix:0));h._select.hide()}j.css("margin-left","");j.css("margin-right","");p.width(q[0].offsetWidth);if(l.labelText!==null){k=h._label=a(g);q.append(k.html(l.labelText))}else if(k!==undefined){k.remove();h._label=undefined}if(l.showTrigger){j.removeClass("ui-corner-all");if(b===undefined){b=h._triggerArrow=a(i);p.append(b);b.bind("mouseover.triggerevent",h,function(d){if(l.disabledState===true||l.disabled)return;var b=a(d.currentTarget);b.addClass(c)}).bind("mousedown.triggerevent",h,function(c){if(l.disabledState===true||l.disabled)return;var b=a(c.currentTarget);b.addClass(d)}).bind("mouseup.triggerevent",h,function(c){var b=a(c.currentTarget);b.removeClass(d)}).bind("click.triggerevent",h,function(){if(l.disabledState===true||l.disabled)return;h._triggerClick()})}if(l.triggerPosition==="right"){b.css({left:"",right:"0px"});b.removeClass(f);b.addClass(e)}else{b.css({right:"",left:"0px"});b.removeClass(e);b.addClass(f)}b.setOutHeight(p.innerHeight());o=b.find("span");o.css("margin-left",(b.innerWidth()-o[0].offsetWidth)/2);o.css("margin-top",(b.innerHeight()-o[0].offsetHeight)/2)}else{if(b!==undefined){b.unbind(".triggerevent");b.remove();h._triggerArrow=undefined}j.removeClass("ui-corner-left");j.removeClass("ui-corner-right");j.addClass("ui-corner-all")}m=s=n=0;if(k!==undefined)s+=k[0].offsetWidth;if(b!==undefined)n=b[0].offsetWidth;m=s+n;j.setOutWidth(q.innerWidth()-m);m=m===0?"":m;if(l.triggerPosition==="right"){j.css("margin-left","");j.css("margin-right",m);if(k!==undefined){k.css("left","");k.css("right",n)}}else{j.css("margin-right","");j.css("margin-left",m);if(k!==undefined){k.css("right","");k.css("left",n)}}},_triggerClick:function(c){var a=this,b="";window.clearTimeout(a.closing);if(a.menu.element.is(":visible"))a.close();else{if(a._usingRemoteData())b=a._input.val();a.search(b,c)}},destroy:function(){var b=this,c=b.element;b.options.isEditable===false&&c.removeAttr("readonly");if(b._select!==undefined){b._select.removeClass("ui-widget");b._select.show();b._input.remove()}else if(b._comboDiv){b._comboDiv.removeClass("wijmo-wijcombobox ui-widget ui-helper-clearfix");b._comboDiv.removeAttr("role");b._input.insertBefore(b._comboDiv);b._comboDiv.children(".wijmo-wijcombobox-wrapper").remove()}else{c.css("width",b._oldWidth);c.removeClass(h);c.removeAttr("autocomplete").removeAttr("role").removeAttr("aria-wijcombobox").removeAttr("aria-haspopup");c.insertBefore(b._comboElement);c.css("padding","")}b._comboElement.remove();b.menu.destroy();b.menu.element.remove();a.Widget.prototype.destroy.call(b)},_setOption:function(f,e){var b=this,n,j,d,o,i=b._label,l,h,k=null,m=0,c=b.options;n=b._comboElement;j=b.element;o=j.parent();h=c.selectedIndex;if(b._triggerArrow)m=b._triggerArrow.outerWidth();a.Widget.prototype._setOption.apply(b,arguments);if(f==="disabled")if(e){n.addClass("wijmo-wijcombobox-disabled ui-state-disabled");b._input.attr("disabled","disabled");b._comboDiv&&b._input.addClass("wijmo-wijcombobox-disabled ui-state-disabled").attr("disabled","disabled");b._triggerArrow&&b._triggerArrow.unbind("click.triggerevent");b.close()}else{n.removeClass("wijmo-wijcombobox-disabled ui-state-disabled");b._input.removeAttr("disabled");b._comboDiv&&b._input.removeClass("wijmo-wijcombobox-disabled ui-state-disabled").removeAttr("disabled");b._triggerArrow&&b._triggerArrow.bind("click.triggerevent",b,function(){if(c.disabledState===true)return;b._triggerClick()})}else if(f==="labelText"){if(c.labelText!==null){i=b._label=a(g);b._input.parent().append(i.html(c.labelText));if(b._triggerArrow!==undefined)l=b._triggerArrow[0].offsetWidth;if(c.triggerPosition==="right"){if(i!==undefined){i.css("left","");i.css("right",l)}}else if(i!==undefined){i.css("right","");i.css("left",l)}b.repaint()}else if(i!==undefined){i.remove();b._label=undefined}}else if(f==="showTrigger"){b._showTrigger();!c.showTrigger&&b.element.is("select")&&j.width(j.width()+m)}else if(f==="triggerPosition"){j.width(j.width()+m);b._showTrigger()}else if(f==="selectionMode")b.menu._setOption("selectionMode",e);else if(f==="isEditable")if(e){b._input.removeAttr("readonly");a(".wijmo-wijcombobox-wrapper",b._comboElement[0]).bind("click",function(){b._triggerClick()})}else{b._input.attr("readonly","readonly");a(".wijmo-wijcombobox-wrapper",b._comboElement[0]).unbind("click")}else if(f==="data"||f==="dataSource"){b._initInnerData();b._setSelectedIndex(c.selectedIndex);if(a.isArray(b.innerData)){b.listHasCreated=false;b._createDropDownList()}else try{b.innerData.loaded=function(c){if(c===null)b.items=null;else b.items=a.isArray(c)?c:c.items;b.listHasCreated=false;b._createDropDownList()};b.innerData.load(null)}catch(p){}if(c.selectedIndex!==-1){k=d?d[h]:null;d=b.innerData;b._trigger("changed",null,{oldItem:k,selectedItem:b.selectedItem,newIndex:c.selectedIndex,oldIndex:h})}}else if(f==="selectedIndex"){if(e===h)return;if(e>-1){if(b.selectedItem&&b.selectedItem.selected!==undefined)b.selectedItem.selected=false;d=b.innerData;if(h&&h!==-1&&d[h])d[h].selected=false;if(d&&d[e]!==null){b.selectedItem=d[e];if(b.selectedItem){b.selectedItem.selected=true;b._input.val(b.selectedItem.label);c.selectedValue=b.selectedItem.value;c.inputTextInDropDownList=true;c.text=b._input.val()}}}else if(e<=-1||!e){c.inputTextInDropDownList=false;b._clearSelection()}k=d?d[h]:null;b._trigger("changed",null,{oldItem:k,selectedItem:b.selectedItem,newIndex:c.selectedIndex,oldIndex:h})}else if(f==="selectedValue")if(e){if(b.selectedItem&&b.selectedItem.selected!==undefined)b.selectedItem.selected=false;d=b.items;if(!d)d=b.innerData;a.each(d,function(a){if(d[a].value===e){b.selectedItem=d[a];b.selectedItem.selected=true;b._input.val(b.selectedItem.label);b.options.selectedIndex=a;c.inputTextInDropDownList=true;c.text=b._input.val();return false}})}else{c.inputTextInDropDownList=false;b._clearSelection()}else if(f==="text"){if(c.forceSelectionText&&b._checkTextInItems(e)===-1)return;b._input.val(e)}},_setSelectedIndex:function(b){var a=this,c=a.options;if(b===null||b===undefined)return;if(b===-1){a.selectedItem=null;c.selectedIndex=-1;c.selectedValue=null;if(c.text)a._input.val(c.text);else a._input.val("")}else if(a.innerData&&a.innerData[b]!==null&&a.innerData[b]!==undefined){a.innerData[b].selected=true;a._input.val(a.innerData[b].label)}c.text=a._input.val()},search:function(h,d){var b=this,g,c,e,f;g=b.options;c=b.innerData;window.clearTimeout(b.closing);e={value:h,e:d,self:b};if(c!==null||b._comboDiv){f=b._isBind();if(d!=="checkindex")if(b._trigger("search",d,{datasrc:c,term:e})===false)return;if(a.isArray(c)||f||b._comboDiv){b._hideShowArrow(false);b._onListLoaded(c,e)}else if(!f&&a.isArray(g.dataSource))return;else{if(b._usingRemoteData()&&d!==undefined&&h.length<g.minLength)return;b._hideShowArrow(false);c.loaded=function(a,c){b.listHasCreated=false;b._createDropDownList(a);b._onListLoaded(a,c);b.originalDataSourceLoaded&&b.originalDataSourceLoaded(a,c)};c.load(e)}}},_isBind:function(){var b=this.options,a=b.data;return a!==null&&a.label&&a.label.bind?true:false},_getMappingItems:function(){var g=this.options,c=g.dataSource,b=g.data,d,e,f;if(!c||!b)return null;if(!b.label||!b.label.bind||!b.value||!b.value.bind)return null;e=b.label.bind;f=b.value.bind;if(c&&c.length!==0){d=[];a.each(c,function(b,a){d.push({label:a[e],value:a[f]})});return d}return null},_clearSelection:function(){var b=this,c=b.options;if(c.selectionMode==="single"){if(b.selectedItem!==null)b.selectedItem.selected=false;b.selectedItem=null}else if(b.selectedItems){a.each(b.selectedItems,function(b,a){if(a.selected)a.selected=false});b.selectedItem=null;b.selectedItems=null}c.selectedValue=null;b._input.val("");c.text=b._input.val()},_usingRemoteData:function(){var b=this.options.data,c=false;if(!a.isArray(b)&&b!==null&&b.proxy)c=true;return c},_hideShowArrow:function(d){var c=this,b,a;b=c.element;a=c._triggerArrow;a!==undefined&&a[d?"show":"hide"]();b[d?"removeClass":"addClass"]("wijmo-wijcombobox-loading")},_onListLoaded:function(g,h){var c=h.self,k,i,j,d,f,e;k=c._input;i=c.options;j=h.value;if(g===null)d=null;else d=a.isArray(g)?g:g.items;c.items=d;if(h.e==="checkindex"){f=i.selectedIndex;if(i.selectionMode==="multiple"&&a.isArray(f)){a.each(f,function(e,b){var a=d[b];a.selected=true;c.selectedItems.push(a)});c._selectedItemsToInputVal(c.selectedItems)}else{d[f].selected=true;c.selectedItem=d[f];k.val(c.selectedItem.label)}c._hideShowArrow(true);return}if(!c._usingRemoteData()&&d)e=d;else{c._topHit=null;e=d}if(e&&e.length>0||c._comboDiv){c._openlist(e,h,j);c._trigger("open");c._addInputFocus(true,b)}else c.close(null,true);c._hideShowArrow(true)},close:function(h,g){var e=this,d,c,f;d=e.menu;e._dropDownHeight=d.element.outerHeight();e._dropDownWidth=d.element.outerWidth();window.clearTimeout(e.closing);if(d.element.is(":visible")&&!d.element.is(":animated")&&!d.element.parent().is(":animated")){e._trigger("close",h);d.deactivate();c=e.options.hidingAnimation;if(c&&(c.effect==="size"||c.animated==="size"))c.options=a.extend({to:{width:0,height:0}},c.options);f=d.element.attr("style");if(g!==true&&c)d.element.hide(c.effect||c.animated,c.options,c.speed||c.duration,function(){d.element.removeAttr("style").attr("style",f).hide();c.callback&&c.callback.apply(this,arguments)});else d.element.hide();e._addInputFocus(false,b);a(document).unbind("mouseup",e.closeOnClick)}},_change:function(){var a=this,b,k,g,f,d,c,i,j,h,e=-1;b=a.options;k=b.forceSelectionText;g=b.selectionMode;f=a._input;d=f.val();c=a.selectedItem;i=a.selectedItems;j=a.selectedIndex;h=a.innerData;if(k){if(g==="single")if(c!==null)c.label!==d&&f.val(c.label);else f.val("")}else if(g==="single")if(!c&&d!==""||c!==null&&c.label!==d){if(a.selectedItem!==null)a.selectedItem.selected=false;e=a._checkTextInItems(d);if(e===-1){a.selectedItem=null;b.selectedIndex=-1;b.selectedValue=null;b.inputTextInDropDownList=false}else if(h){a.selectedItem=h[e];b.selectedIndex=e;b.selectedValue=a.selectedItem.value;b.inputTextInDropDownList=true}b.text=a._input.val();a._trigger("changed",null,{oldItem:c,selectedItem:a.selectedItem,newIndex:b.selectedIndex,oldIndex:j})}if(g==="multiple"){if(!a.selectedItems||a.selectedItems.length===0)i=[c];a._selectedItemsToInputVal(i)}},_checkTextInItems:function(d){var e=this,c=-1,b=e.innerData;d&&a.each(b,function(a){if(b[a]&&b[a].label&&b[a].label===d){c=a;return false}});return c},_openlist:function(t,q,g){var b=q.self,f=q.e,i,h,c,e,p,s=2,m=0,l,k,r,d,n,o,j=false;i=b._keypress=!!f;e=b.options;c=b.menu.element;c.zIndex(b.element.zIndex()+100);if(g!==null&&g!==undefined){j=b._keypress&&e.isEditable&&e.columns.length===0&&e.highlightMatching&&a.trim(b._input.val()).length>0;b._topHit=b.menu.filterItems(g,e.autoFilter,j)}b.menu.element.show();if(e.dropdownWidth==="auto")h=b._comboElement.outerWidth();else h=e.dropdownWidth;p=c.css("padding");c.css("padding","0px");c.setOutWidth(h);c.css("padding",p);l=e.dropdownHeight;if(c.children(".wijmo-wijsuperpanel-header"))m=c.children(".wijmo-wijsuperpanel-header").outerHeight()||0;r=Math.min(b._menuUL.outerHeight()+s+m,l);c.setOutHeight(r);b.menu.refreshSuperPanel();b._positionList();!i&&b.selectedItem!==undefined&&b.menu.activate(null,b.selectedItem,true);if(i&&f.keyCode!==a.ui.keyCode.BACKSPACE)if(e.isEditable)b._runAutoComplete();else b.menu.activate(null,b._topHit,true);else{d=b.options.showingAnimation;if(e.showingAnimation!==null&&!(f!==undefined&&f.keyCode===a.ui.keyCode.BACKSPACE)){b.menu.element.hide();o={from:{width:0,height:0},to:{width:b._dropDownWidth||c.outerWidth(),height:b._dropDownHeight||c.outerHeight()}};if(d&&(d.effect==="size"||d.animated==="size"))d.options=a.extend(o,d.options);n=c.attr("style");c.show(d.effect||d.animated,d.options,d.speed||d.duration,function(){c.removeAttr("style").attr("style",n).show();d.callback&&d.callback.apply(this,arguments);a.browser.msie&&c.css("filter","")})}}if(!b.hasOwnProperty("closeOnClick")){k=b.closeOnClick;b.closeOnClick=function(a){return k(a)}}a(document).bind("mouseup",b,b.closeOnClick)},closeOnClick:function(c){var b=c.data,d=c.target;if(!a.contains(b._comboElement[0],d)&&!a.contains(b.menu.element[0],d)){b.close();a(".wijmo-wijcombobox-wrapper",b._comboElement[0]).removeClass("ui-state-hover").removeClass("ui-state-focus");a(".wijmo-wijcombobox-trigger",b._comboElement[0]).removeClass("ui-state-hover").removeClass("ui-state-focus")}},_positionList:function(){var c=this,d,b;d=c.options.dropDownListPosition;b={my:"left top",at:"left bottom",of:c._comboElement,collision:"none"};b=a.extend(b,d);c.menu.element.position(b)},_runAutoComplete:function(){var b=this,c,a,e,d,f,g;c=b._input;a=b._topHit;if(!b.options.autoComplete||a===null||a===undefined)return;b.menu.activate(null,a,true);e=c.val();d=a.label;c.val(d);f=e.length;g=d.length;b._selectText(f,g,c)},_selectText:function(d,e,c){var f=c.val(),a=c.get(0),b;if(f.length>0)if(a.setSelectionRange!==undefined)a.setSelectionRange(d,e);else if(a.createTextRange!==undefined){b=a.createTextRange();b.moveStart("character",d);b.moveEnd("character",e-f.length);b.select()}},_move:function(a,b){if(!this.menu.element.is(":visible")){this.search("",b);return}if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a))return;this.menu[a](b)},_escapeRegex:function(a){return a===undefined?a:a.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")},_filter:function(c,f){var d=this._escapeRegex(f),e,b=null;if(!c)return null;e=new RegExp(d,"i");a.each(c,function(f,a){if(d===undefined||d.length===0){a.match=true;return}var c=e.exec(a.label);if(c===null)a.match=false;else{if(b===null&&c.index===0)b=a;a.match=c.index>=0}});this._topHit=b;return c}})})(jQuery);


/*
 *
 * Wijmo Library 2.3.1
 * http://wijmo.com/
 *
 * Copyright(c) GrapeCity, Inc.  All rights reserved.
 * 
 * Licensed under the Wijmo Commercial License. Also available under the GNU GPL Version 3 license.
 * licensing@wijmo.com
 * http://wijmo.com/widgets/license/
 *
 *
 **/
var __extends=this.__extends||function(b,c){function a(){this.constructor=b}a.prototype=c.prototype;b.prototype=new a},wijmo;(function(c){"use strict";var a=jQuery,b=function(){function a(){}a.prototype.destroy=function(){};a.prototype.disable=function(){};a.prototype._trigger=function(){};a.prototype._setOption=function(){};a.prototype.option=function(){};a.prototype.widget=function(){return null};return a}();c.WijmoWidget=b;b.prototype={};var e=function(c){__extends(b,c);function b(){c.apply(this,arguments);this._boundMouseWheel=false}b.prototype._create=function(){var b=this,c;if(this.element[0].tagName.toLowerCase()!=="input")throw"Target element is not a INPUT";this._creationDate=new Date;if(window.wijmoApplyWijTouchUtilEvents)a=window.wijmoApplyWijTouchUtilEvents(a);this.element.is(":hidden")&&this.element.wijAddVisibilityObserver&&this.element.wijAddVisibilityObserver(function(){b._destroy();b._create();b.element.wijRemoveVisibilityObserver&&b.element.wijRemoveVisibilityObserver()},"wijinput");this.element.data("widgetName",this.widgetName);a.effects.save(this.element,["width","height"]);this.element.wrap("<div class='wijmo-wijinput ui-widget ui-helper-clearfix ui-state-default ui-corner-all'><span class='wijmo-wijinput-wrapper'></span></div>");this.element.addClass("wijmo-wijinput-input ui-corner-all").attr("role","textbox");if(!(a.browser.msie&&parseFloat(a.browser.version)<=7))try{this.element.attr("aria-multiline",false)}catch(d){this.element[0].setAttribute("aria-multiline","false")}this.wrapper=this.element.parent();this.outerDiv=this.wrapper.parent();if(this.options.showTrigger){this.triggerBtn=a("<div class='wijmo-wijinput-trigger ui-state-default'><span class='ui-icon ui-icon-triangle-1-s'></span></div>").addClass(this.options.buttonAlign==="left"?"ui-corner-left":"ui-corner-right").attr("role","button").appendTo(this.outerDiv);this.element.attr({role:"combobox","aria-expanded":false})}if(this.options.showSpinner){this.spinner=a("<div class='wijmo-wijinput-spinner wijmo-wijinput-button'></div>");this.spinUp=a("<div class='ui-state-default wijmo-wijinput-spinup'><span class='ui-icon ui-icon-triangle-1-n'></span></div>").attr("role","button");this.spinDown=a("<div class='ui-state-default wijmo-wijinput-spindown'><span class='ui-icon ui-icon-triangle-1-s'></span></div>").attr("role","button");if(!this.options.showTrigger){this.spinUp.addClass(this.options.buttonAlign==="left"?"ui-corner-tl":"ui-corner-tr");this.spinDown.addClass(this.options.buttonAlign==="left"?"ui-corner-bl":"ui-corner-br")}this.spinner.append(this.spinUp).append(this.spinDown).appendTo(this.outerDiv);this.element.attr("role","spinner")}if(this.options.showTrigger&&this.options.showSpinner)this.outerDiv.addClass(this.options.buttonAlign==="left"?"ui-input-spinner-trigger-left":"ui-input-spinner-trigger-right");else{this.options.showTrigger&&this.outerDiv.addClass(this.options.buttonAlign==="left"?"ui-input-trigger-left":"ui-input-trigger-right");this.options.showSpinner&&this.outerDiv.addClass(this.options.buttonAlign==="left"?"ui-input-spinner-left":"ui-input-spinner-right")}this._initialize();this.outerDiv.width(this.element.width());c=this.element.leftBorderWidth()+this.element.rightBorderWidth();this.element.width(this.outerDiv.width()-c)};b.prototype._createTextProvider=function(){return undefined};b.prototype._beginUpdate=function(){};b.prototype._endUpdate=function(){var a=this;if(this.element.mousewheel&&!this._boundMouseWheel){this.element.mousewheel(function(c,b){a.isFocused()&&a._doSpin(b>0,false)&&c.preventDefault()});this._boundMouseWheel=true}};b.prototype._onTriggerClicked=function(){};b.prototype._initialize=function(){var b=this;this.element.data("initializing",true);this._trigger("initializing");this.element.data("preText",this.element.val());this.element.data("elementValue",this.element.val());this.element.data("errorstate",false);this.element.data("breakSpinner",true);this.element.data("prevCursorPos",-1);this.element.data("simulating",false);this._createTextProvider();this._beginUpdate();var c=this.options,d=function(a){return(!a.which?a.button:a.which)===1},e=function(c){if(b.options.disabled)return;if(!d(c))return;b._trySetFocus();b.element.data("breakSpinner",false);b._addState("active",a(b));b._doSpin(a(c.currentTarget).hasClass("wijmo-wijinput-spinup"),true)},f=function(c){if(b.options.disabled)return;if(!d(c))return;b._stopSpin();b._removeState("active",a(b))},g;this.triggerBtn&&!c.disabledState&&this.triggerBtn.bind({mouseover:function(){if(b.options.disabled)return;b._addState("hover",a(b))},mouseout:function(){if(b.options.disabled)return;b._removeState("hover",a(b))},mousedown:function(c){if(b.options.disabled)return;if(!d(c))return;b._addState("active",a(b));b._trigger("triggerMouseDown")},click:function(c){if(b.options.disabled)return;b._stopEvent(c);b._stopSpin();b._removeState("active",a(b));b._trigger("triggerMouseUp");b._onTriggerClicked();b._trySetFocus()}});this.spinUp&&!c.disabledState&&this.spinUp.bind({mouseover:function(){if(b.options.disabled)return;b._addState("hover",a(b))},mouseout:function(){if(b.options.disabled)return;b._removeState("hover",a(b));b._removeState("active",a(b));b._stopSpin()},mousedown:e,mouseup:f});this.spinDown&&!c.disabledState&&this.spinDown.bind({mouseover:function(){if(b.options.disabled)return;b._addState("hover",a(b))},mouseout:function(){if(b.options.disabled)return;b._removeState("hover",a(b));b._removeState("active",a(b));b._stopSpin()},mousedown:e,mouseup:f});this.element.bind({"focus.wijinput":a.proxy(this._onFocus,this),"blur.wijinput":a.proxy(this._onBlur,this),"mouseup.wijinput":a.proxy(this._onMouseUp,this),"keypress.wijinput":a.proxy(this._onKeyPress,this),"keydown.wijinput":a.proxy(this._onKeyDown,this),"keyup.wijinput":a.proxy(this._onKeyUp,this),"compositionstart.wijinput":a.proxy(this._onCompositionStart,this),"compositionend.wijinput":a.proxy(this._onCompositionEnd,this),"change.wijinput":a.proxy(this._onChange,this),"paste.wijinput":a.proxy(this._onPaste,this),"drop.wijinput":a.proxy(this._onDrop,this)});this.element.bind("propertychange.wijinput input.wijinput",a.proxy(this._onInput,this));this.element.data("initializing",false);this._resetData();this._endUpdate();this._updateText();if(this.options.disabledState){g=c.disabled;this.disable();c.disabled=g}this.options.disabled&&this.disable();this.element.data("initialized",true);this._trigger("initialized")};b.prototype._init=function(){};b.prototype._setOption=function(d,c){this._super(d,c);switch(d){case"buttonAlign":case"showTrigger":case"showSpinner":this._destroy();this._create();break;case"showNullText":this._updateText();break;case"disabled":this.element.attr("disabled",c);var b=c?"addClass":"removeClass",a=this.namespace+"-state-disabled";this.element[b](a);this.triggerBtn&&this.triggerBtn[b](a);this.spinUp&&this.spinUp[b](a);this.spinDown&&this.spinDown[b](a)}};b.prototype.destroy=function(){this._super();this._destroy()};b.prototype.isDestroyed=function(){return!this.outerDiv};b.prototype._destroy=function(){if(this.isDestroyed())return;this.wrapper=undefined;this.outerDiv=undefined;this.element.unbind(".wijinput");this.element.removeData("errorstate").removeData("breakSpinner").removeData("prevCursorPos").removeData("simulating").removeData("isPassword").removeClass("wijmo-wijinput-input").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow").removeAttr("aria-expanded");this.element.parent().replaceWith(this.element);this.element.parent().replaceWith(this.element);a.effects.restore(this.element,["width","height"])};b.prototype.widget=function(){return this.outerDiv||this._super()};b.prototype._getCulture=function(a){if(typeof a==="undefined")a=this.options.culture;return Globalize.findClosestCulture(a||this.options.culture)};b.prototype._addState=function(b,a){a.is(":not(.ui-state-disabled)")&&a.addClass("ui-state-"+b)};b.prototype._removeState=function(a,b){b.removeClass("ui-state-"+a)};b.prototype._isInitialized=function(){return!this.element.data("initializing")};b.prototype._setData=function(a){this.setText(a)};b.prototype._resetData=function(){};b.prototype._validateData=function(){};b.prototype.getText=function(){return!this._isInitialized()?this.element.val():this._textProvider.toString(true,false,false)};b.prototype.setText=function(a){if(!this._isInitialized())this.element.val(a);else{this._textProvider.set(a);this._updateText()}};b.prototype.getPostValue=function(){return!this._isInitialized()?this.element.val():this._textProvider.toString(true,false,true)};b.prototype.selectText=function(a,b){if(this.element.is(":disabled"))return;this.element.wijtextselection(a,b)};b.prototype.focus=function(){if(this.element.is(":disabled"))return;this.element.get(0).focus()};b.prototype.isFocused=function(){return this.outerDiv.hasClass("ui-state-focus")};b.prototype._raiseTextChanged=function(){var a=this.element.val(),b=this.element.data("preText");if(!!this.element.data("initialized")&&b!==a){this._trigger("textChanged",null,{text:a});this.element.data("changed",true)}this.element.data("preText",a)};b.prototype._raiseDataChanged=function(){};b.prototype._allowEdit=function(){return!(this.element.attr("readOnly")&&this.element.is(":disabled"))};b.prototype._updateText=function(a){if(typeof a==="undefined")a=false;if(!this._isInitialized())return;a=!!a;var b=this.element.wijtextselection(),c=this.options;if(this.isDeleteAll&&c.showNullText){this.isDeleteAll=false;c.date=null;this.element.val(c.nullText)}else{this.element.val(this._textProvider.toString());this.options.text=this._textProvider.toString(true,false,false)}if(this.element.is(":disabled"))return;a&&this.selectText(b.start,b.end);this.element.data("prevCursorPos",b.start);this._raiseTextChanged();this._raiseDataChanged()};b.prototype._trySetFocus=function(){if(!this.isFocused())try{!this.options.disableUserInput&&this.element.focus()}catch(a){}};b.prototype._deleteSelText=function(c){if(typeof c==="undefined")c=false;if(!this._allowEdit())return;var a=this.element.wijtextselection(),b;if(c){if(a.end<1)return;if(a.end===a.start)a.start--}a.end--;if(a.end<a.start)a.end=a.start;b=new d;this._textProvider.removeAt(a.start,a.end,b);this._updateText();this.selectText(b.testPosition,b.testPosition)};b.prototype._fireIvalidInputEvent=function(d){var b=this,c;if(a.isFunction(b.options.invalidInput)&&b._trigger("invalidInput",null,{widget:b,"char":d})===true)return;if(!b.element.data("errorstate")){c=b.options.invalidClass||"ui-state-error";b.element.data("errorstate",true);window.setTimeout(function(){b.outerDiv.removeClass(c);b.element.data("errorstate",false)},200);b.outerDiv.addClass(c)}};b.prototype._onInput=function(){if(!this._isSimulating()||!this.element.data("ime")||this.element.data("isComposingIME")){this.element.data("isComposingIME")&&this.element.data("simulationPending",true);return}this._simulate()};b.prototype._keyDownPreview=function(){return false};b.prototype._onDoubleByteCharacter=function(){var a=this.element.data("lastDbsState"),c=this.element.wijtextselection(),b=this.element.val();if(this.element.data("isComposingIME")&&a&&a.selection.start===c.start&&a.Text===b){this.element.removeData("lastDbsState");this._onCompositionEnd()}else{this.element.data("lastDbsState",{selection:c,text:b});this._onCompositionStart()}};b.prototype._onCompositionStart=function(){if(this.element.data("isComposingIME"))return;this.element.data("isComposingIME",true);this._beforeSimulate(true)};b.prototype._onCompositionEnd=function(){if(!this.element.data("isComposingIME"))return;this.element.data("isComposingIME",false);this._isInitialized()&&(!this._textProvider||!this._textProvider.noMask)&&this._simulateIfPending()};b.prototype._simulateIfPending=function(){this.element.data("simulationPending")&&this.element.data("lastSelection")&&this._simulate()};b.prototype._beforeSimulate=function(a){if(typeof a==="undefined")a=false;if(!this.element.data("lastSelection")){this.element.data("lastSelection",this.element.wijtextselection());this.element.data("lastValue",this.element.val())}this.element.data("ime",a);this.element.data("simulating",true)};b.prototype._isSimulating=function(){return this.element.data("simulating")};b.prototype._simulate=function(f){var a=this,b=null,e,c,d;this.element.data("simulationPending",false);if(typeof f==="string")b=f;else{e=this.element.wijtextselection();c=this.element.data("lastSelection").start;d=e.end;if(d>=c)b=this.element.val().substring(c,d)}b&&window.setTimeout(function(){if(!a.element.data("lastValue"))return;a.element.val(a.element.data("lastValue"));var e=a.element.data("lastSelection"),c,d;a.element.wijtextselection(e);a.element.data("batchKeyPress",true);a.element.data("simulating",false);c=jQuery.Event("keypress");c.ctrlKey=c.altKey=false;for(d=0;d<b.length;d++){c.which=c.charCode=c.keyCode=b.charCodeAt(d);a._onKeyPress(c)}a.element.data("batchKeyPress",false);a._endSimulate()},1)};b.prototype._endSimulate=function(){this._simulateIfPending();this.element.removeData("ime");this.element.removeData("lastSelection");this.element.removeData("lastValue")};b.prototype._onKeyDown=function(b){this.element.data("prevCursorPos",-1);if(!this._isInitialized()||this._textProvider&&!!this._textProvider.noMask)return;var c=this._getKeyCode(b);if(c===229){this._onDoubleByteCharacter();return}this._onCompositionEnd();if(this.options.disableUserInput){this._stopEvent(b);return}if(this._keyDownPreview(b)){this._stopEvent(b);return}switch(c){case a.ui.keyCode.UP:this._doSpin(true,false);this._stopEvent(b);return;case a.ui.keyCode.DOWN:this._doSpin(false,false);this._stopEvent(b);return}if(b.ctrlKey)switch(c){case a.ui.keyCode.INSERT:case 67:return}if(b.ctrlKey||b.altKey)return;switch(c){case 112:case 113:case 114:case 115:case 116:case 117:case a.ui.keyCode.TAB:case a.ui.keyCode.CAPSLOCK:case a.ui.keyCode.END:case a.ui.keyCode.HOME:case a.ui.keyCode.CTRL:case a.ui.keyCode.SHIFT:return;case a.ui.keyCode.BACKSPACE:this._deleteSelText(true);this._stopEvent(b);return;case a.ui.keyCode.DELETE:this._deleteSelText(false);this._stopEvent(b);return;case a.ui.keyCode.ENTER:if(!this.options.hideEnter)return;break;case a.ui.keyCode.ESCAPE:this._stopEvent(b);window.setTimeout(a.proxy(this._resetData,this),1);return;case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.ALT:this._stopEvent(b);return}};b.prototype._onKeyUp=function(c){if(this._textProvider&&!!this._textProvider.noMask)return;var b=this._getKeyCode(c);if(this._isSimulating()){b===a.ui.keyCode.ENTER&&this._onCompositionEnd();return}if(!this._isInitialized())return;if(b===a.ui.keyCode.ENTER||b===a.ui.keyCode.ESCAPE)return;if(this.options.disableUserInput){this._raiseTextChanged();this._raiseDataChanged();return}this._stopEvent(c)};b.prototype._getKeyCode=function(a){var b=window.navigator.userAgent;return(b.indexOf("iPod")!==-1||b.indexOf("iPhone")!==-1)&&a.which===127?8:a.keyCode||a.which};b.prototype._keyPressPreview=function(){return false};b.prototype._onKeyPress=function(b){if(this._isSimulating()||this._textProvider&&!!this._textProvider.noMask)return;this.element.data("prevCursorPos",-1);if(this.options.disableUserInput)return;if(!this._allowEdit())return;if(b.ctrlKey&&b.keyCode===119){this._onPaste(b);return}var c=b.keyCode||b.which,d,e;if(c===0)return;if(c===a.ui.keyCode.BACKSPACE){this._stopEvent(b);return}if(b.ctrlKey||b.altKey)if(c!==a.ui.keyCode.SPACE)return;if(this._keyPressPreview(b))return;if(c===a.ui.keyCode.ENTER&&!this.options.hideEnter)return true;e=String.fromCharCode(c);d=this._textProvider.replaceWith(this.element.wijtextselection(),e);if(d){this._updateText();this.selectText(d.testPosition+1,d.testPosition+1)}else this._fireIvalidInputEvent(e);!this.element.data("batchKeyPress")&&this._stopEvent(b)};b.prototype._isNullText=function(a){a=a||this.element.val();return this.options.showNullText&&a===this.options.nullText};b.prototype._doFocus=function(){var d=this.element.wijtextselection(),b=d.start,c;this._updateText();c=this.element.val();if(c.length===b)b=0;!a.browser.safari&&this.selectText(b,b)};b.prototype._afterFocused=function(){this._isNullText()&&this._doFocus()};b.prototype._onFocus=function(){if(this.options.disableUserInput)return;this._addState("focus",this.outerDiv);if(!this.element.data("breakSpinner"))return;if(!this._isInitialized())return;if(!this._allowEdit())return;!this.element.data("focusNotCalledFirstTime")&&this.element.data("focusNotCalledFirstTime",+new Date);this._afterFocused()};b.prototype._onBlur=function(){if(this.options.disableUserInput)return;this._onCompositionEnd();if(this._isComboListVisible())return;var c=this.isFocused(),b,a=this;this._removeState("focus",this.outerDiv);if(!this.element.data("breakSpinner")){this.element.get(0).focus();b=this.element.data("prevCursorPos");b!==undefined&&b!==-1&&this.selectText(b,b);return}if(!this._isInitialized())return;if(!c)return;this.element.data("value",this.element.val());window.setTimeout(function(){a._onChange();a._updateText();a._validateData();!a._popupVisible()&&!!a.element.data("changed")&&a._trigger("change");a.element.data("changed",false)},100)};b.prototype._popupVisible=function(){return this._isComboListVisible()};b.prototype._onMouseUp=function(){if(!this._isInitialized())return;if(this.element.is(":disabled"))return;var a=this.element.wijtextselection();this.element.data("prevCursorPos",a.start)};b.prototype._onChange=function(){if(!this.element)return;var a=this.element.val(),b=this.getText();b!==a&&this.setText(a)};b.prototype._onPaste=function(){if(this._textProvider&&!!this._textProvider.noMask)return;this._beforeSimulate();var a=this;window.setTimeout(function(){a._simulate()},1)};b.prototype._onDrop=function(a){this._beforeSimulate();if(a.originalEvent&&a.originalEvent.dataTransfer){var b=a.originalEvent.dataTransfer.getData("Text");b&&this._simulate(b)}};b.prototype._stopEvent=function(a){a.stopPropagation();a.preventDefault()};b.prototype._calcSpinInterval=function(){this._repeatingCount++;return this._repeatingCount>10?50:this._repeatingCount>4?100:this._repeatingCount>2?200:400};b.prototype._doSpin=function(){return false};b.prototype._stopSpin=function(){this.element.data("breakSpinner",true);this._repeatingCount=0};b.prototype._hasComboItems=function(){return!!this.options.comboItems&&this.options.comboItems.length};b.prototype._isComboListVisible=function(){return!this._comboDiv?false:this._comboDiv.wijpopup("isVisible")};b.prototype._popupComboList=function(){if(!this._hasComboItems())return;if(!this._allowEdit())return;if(this._isComboListVisible()){this._comboDiv.wijpopup("hide");return}var b=this,c;if(this._comboDiv===undefined){this._comboDiv=a("<div></div>").appendTo(document.body).width(this.outerDiv.width()).height(this.options.comboHeight||180).css("position","absolute");c=this._normalize(this.options.comboItems);this._comboDiv.wijlist({autoSize:true,maxItemsCount:5,selected:function(c,a){b._setData(a.item.value);b._comboDiv.wijpopup("hide");b._trySetFocus()}});this._comboDiv.wijlist("setItems",c);this._comboDiv.wijlist("renderList");this._comboDiv.wijlist("refreshSuperPanel")}this._comboDiv.wijpopup({autoHide:true});this.outerDiv.attr("aria-expanded",true);this._comboDiv.wijpopup("show",{of:this.outerDiv,offset:"0 4",hidden:function(){b.outerDiv.attr("aria-expanded",false)}})};b.prototype._normalize=function(b){return b.length&&b[0].label&&b[0].value?b:a.map(b,function(b){return typeof b==="string"?{label:b,value:b}:a.extend({label:b.label||b.value,value:b.value||b.label},b)})};return b}(b);c.wijinputcore=e;e.prototype.options=a.extend({},b.prototype.options,{culture:"",invalidClass:"ui-state-error",nullText:"",showNullText:false,hideEnter:false,disableUserInput:false,buttonAlign:"right",showTrigger:false,showSpinner:false,comboItems:undefined,comboWidth:undefined,comboHeight:undefined,initializing:null,initialized:null,triggerMouseDown:null,triggerMouseUp:null,textChanged:null,invalidInput:null});var d=function(){function a(){this.characterEscaped=1;this.noEffect=2;this.sideEffect=3;this.success=4;this.unknown=0;this.hint=0;this.alphanumericCharacterExpected=-2;this.asciiCharacterExpected=-1;this.digitExpected=-3;this.invalidInput=-51;this.letterExpected=-4;this.nonEditPosition=-54;this.positionOutOfRange=-55;this.promptCharNotAllowed=-52;this.signedDigitExpected=-5;this.unavailableEditPosition=-53;this.testPosition=-1}a.prototype.clone=function(){var b=new a;b.hint=this.hint;b.testPosition=this.testPosition;return b};return a}();c.wijInputResult=d;var f=function(){function a(){}a.prototype.set=function(){};a.prototype.toString=function(){return""};a.prototype.insertAt=function(){return false};a.prototype.removeAt=function(){};a.prototype.replaceWith=function(a,e){var c=a.start,b=new d;if(a.start<a.end){this.removeAt(a.start,a.end-1,b,true);c=b.testPosition}return this.insertAt(e,c,b)?b:null};return a}();c.wijTextProvider=f})(wijmo||(wijmo={}));var wijinputcore=wijmo.wijinputcore.prototype,wijInputResult=wijmo.wijInputResult;


/*
 *
 * Wijmo Library 2.3.1
 * http://wijmo.com/
 *
 * Copyright(c) GrapeCity, Inc.  All rights reserved.
 * 
 * Licensed under the Wijmo Commercial License. Also available under the GNU GPL Version 3 license.
 * licensing@wijmo.com
 * http://wijmo.com/widgets/license/
 *
 *
 **/
var __extends=this.__extends||function(b,c){function a(){this.constructor=b}a.prototype=c.prototype;b.prototype=new a},wijmo;(function(a){"use strict";var b=jQuery,d=function(d){__extends(c,d);function c(){d.apply(this,arguments)}c.prototype._createTextProvider=function(){this._textProvider=new e(this,this.options.type);this._textProvider._nullvalue=this.element.val()===""&&this.options.value===null};c.prototype._beginUpdate=function(){var a=this.options;this.element.addClass("wijmo-wijinput-numeric");this.element.data({defaultValue:a.value,preValue:a.value}).attr({"aria-valuemin":a.minValue,"aria-valuemax":a.maxValue,"aria-valuenow":a.value||0})};c.prototype._onTriggerClicked=function(){this._popupComboList()};c.prototype._setOption=function(b,a){d.prototype._setOption.call(this,b,a);switch(b){case"minValue":this.element.attr("aria-valuemin",a);this._updateText();break;case"maxValue":this.element.attr("aria-valuemax",a);this._updateText();break;case"value":this.setValue(a);this._updateText();break;case"showGroup":case"decimalPlaces":case"culture":this._textProvider.updateStringFormat();this._updateText()}};c.prototype._setData=function(a){this.setValue(a)};c.prototype._resetData=function(){var a=this.element.data("defaultValue");if(a===undefined||a===null){a=this.element.data("elementValue");if(a===undefined||a===null&&a==="")a=0}this.setValue(a)};c.prototype._validateData=function(){!this._textProvider.checkAndRepairBounds(true,false)&&this._updateText()};c.prototype._raiseDataChanged=function(){var a=this.options.value,b=this.element.data("preValue");this.element.data("preValue",a);if(b!==a){this.element.attr("aria-valuenow",a);this._trigger("valueChanged",null,{value:a})}};c.prototype.getValue=function(){var a=this._textProvider.getValue();if(a===undefined||a===null)a=this.getText();return a};c.prototype.setValue=function(a,b){if(typeof b==="undefined")b=false;try{b=!!b;if(typeof a==="boolean")a=a?"1":"0";else if(typeof a==="string")a=this._textProvider.tryParseValue(a);if(this._textProvider.setValue(a))this._updateText();else if(b){var c="",d;c=this.getText();this.setText(a);a=a.trim();d=this.getText().trim();d!==a&&this.setText(c)}else this.setText(a);return true}catch(e){return false}};c.prototype.isValueNull=function(){try{return this._textProvider.isValueNull()}catch(a){return true}};c.prototype.getPostValue=function(){if(!this._isInitialized())return this.element.val();if(this.options.showNullText&&this.isValueNull())return"0";var a=this.options.value?this.options.value:0;if(this.options.type==="percent")a=(a/100).toFixed(10);return a.toString()};c.prototype._updateText=function(a){if(typeof a==="undefined")a=false;if(!this._isInitialized())return;this.options.value=this._textProvider.getValue();d.prototype._updateText.call(this,a);!this._textProvider.checkAndRepairBounds(false,false)&&this._trigger("valueBoundsExceeded")};c.prototype._doSpin=function(f,e){if(!this._allowEdit())return false;if(e&&this.element.data("breakSpinner"))return false;var d=this.element.wijtextselection(),c=new a.wijInputResult;if(this.element.data("focusNotCalledFirstTime")!==-9&&+new Date-this.element.data("focusNotCalledFirstTime")<600){this.element.data("focusNotCalledFirstTime",-9);this.element.data("prevCursorPos",0)}if(this.element.data("prevCursorPos")===-1)this.element.data("prevCursorPos",d.start);else d.start=this.element.data("prevCursorPos");c.testPosition=d.start;this._textProvider[f?"incEnumPart":"decEnumPart"](d.start,c,this.options.increment);this._updateText();this.element.data("prevCursorPos",c.testPosition);this.selectText(c.testPosition,c.testPosition);e&&!this.element.data("breakSpinner")&&window.setTimeout(b.proxy(function(){this._doSpin(f,true)},this),this._calcSpinInterval());return true};c.prototype._deleteSelText=function(b){if(typeof b==="undefined")b=false;var a,c;if(!b){a=this.element.wijtextselection();if(a.start===a.end){c=this._textProvider._stringFormat._currentText;if(c.charAt(a.end)===this._textProvider.getGroupSeparator()||c.charAt(a.end)===this._textProvider.getDecimalSeparator()){a.start++;a.end++;this.element.wijtextselection(a);return}}}d.prototype._deleteSelText.call(this,b)};return c}(a.wijinputcore);d.prototype.options=b.extend(true,{},a.wijinputcore.prototype.options,{type:"numeric",value:null,minValue:-1e9,maxValue:1e9,showGroup:false,decimalPlaces:2,increment:1,valueChanged:null,valueBoundsExceeded:null});b.widget("wijmo.wijinputnumber",d.prototype);var e=function(e){__extends(d,e);function d(a,b){e.call(this);this._type="numeric";this._stringFormat=null;this._nullvalue=false;this.inputWidget=a;this._type=b;this._stringFormat=new c(this._type,this.inputWidget.options.decimalPlaces,this.inputWidget.options.showGroup,this._getCulture());this._stringFormat._setValueFromJSFloat(this.getValue())}d.prototype._getCulture=function(){return this.inputWidget._getCulture()};d.prototype.getDecimalSeparator=function(){return this._getCulture().numberFormat["."]};d.prototype.getGroupSeparator=function(){return this._getCulture().numberFormat[","]};d.prototype.tryParseValue=function(a){return this._stringFormat.tryParseValue(a)};d.prototype.toString=function(){return this.inputWidget.options.showNullText&&!this.inputWidget.isFocused()&&this.isValueNull()?this.inputWidget.options.nullText:this._stringFormat.getFormattedValue()};d.prototype.isValueNull=function(){var a=this.inputWidget.options,b=a.minValue;return null===a.value||undefined===a.value||b===a.value||this._nullvalue};d.prototype.set=function(a,b){this.clear();this.insertAt(a,0,b);return true};d.prototype.clear=function(){this._stringFormat.clear()};d.prototype.checkAndRepairBounds=function(a,d){var c=true,b,e;if(typeof a==="undefined")a=false;b=this.inputWidget.options.minValue;e=this.inputWidget.options.maxValue;if(typeof d!=="undefined"&&d)return this._stringFormat.checkMinValue(b,false,true);if(!this._stringFormat.checkMinValue(b,a,false))c=false;if(!this._stringFormat.checkMaxValue(e,a))c=false;this.inputWidget.options.decimalPlaces>=0&&this._stringFormat.checkDigitsLimits(this.inputWidget.options.decimalPlaces);return c};d.prototype.countSubstring=function(c,b){var d=0,a=c.indexOf(b);while(a!==-1){d++;a=c.indexOf(b,a+1)}return d};d.prototype.getAdjustedPositionFromLeft=function(a){for(var e=this._stringFormat._currentText,c,d=0;d<e.length;d++){c=e.charAt(d);if(!b.wij.charValidator.isDigit(c)&&c!==","&&c!=="."||c==="0"){if(this._stringFormat.isZero()){if(a<d)a++}else if(a<=d)a++}else break}return a};d.prototype.getDecimalSeparatorPos=function(){var a=this._stringFormat._currentText;return a.indexOf(this.getDecimalSeparator())};d.prototype.removeLeadingZero=function(a){var b=0;if(a.charAt(b)===" "||a.charAt(b)===this._getCulture().numberFormat.currency.symbol)b++;while(a.charAt(b)==="0")a=a.substr(0,b)+a.substr(b+1);return a};d.prototype.insertAt=function(c,e,d){var j=this._getCulture().numberFormat,l,h,g,f,i,k,n,m,o,p;if(c===j["."])c=j["."];if(!d)d=new a.wijInputResult;else this._nullvalue=false;if(c.length===1){if(c==="+"){this._stringFormat.setPositiveSign();this.checkAndRepairBounds(true,false);return true}if(c==="-"||c===")"||c==="("){this._stringFormat.invertSign();this.checkAndRepairBounds(true,false);d.testPosition=e;if(this._stringFormat.isNegative())d.testPosition=e;else d.testPosition=e-2;return true}if(!b.wij.charValidator.isDigit(c)){if(c==="."){l=this.getDecimalSeparatorPos();if(l>=0){d.testPosition=l;return true}}if(c!==","&&c!=="."&&c!==")"&&c!=="+"&&c!=="-"&&c!=="("&&c!==this.getDecimalSeparator())if(this._type==="percent"&&c===j.percent.symbol){d.testPosition=e;return true}else if(this._type==="currency"&&c===j.currency.symbol){d.testPosition=e;return true}else return false}}e=this.getAdjustedPositionFromLeft(e);h=e;g=this._stringFormat._currentText;if(h>g.length)h=g.length-1;f=this.removeLeadingZero(g.substring(0,h));i=g.substring(h,g.length);if(this._stringFormat.isZero())i=i.replace(/0/,"");d.testPosition=f.length+c.length-1;this._stringFormat.deFormatValue(f+c+i);k=this._stringFormat._currentText;try{if(this.inputWidget.options.showGroup){n=this.countSubstring(f,this._stringFormat._groupSeparator);m=this.countSubstring(k.substring(0,f.length+c.length),this._stringFormat._groupSeparator);d.testPosition+=m-n}else if(c.length===1){o=f.charAt(f.length-1);p=k.charAt(d.testPosition-1);if(p!==o)d.testPosition--}}catch(q){}return true};d.prototype.removeAt=function(e,f,c,k){if(typeof c==="undefined")c=new a.wijInputResult;if(typeof k==="undefined")k=false;var l=this._getCulture().numberFormat,d,h,b,g,j,i;c.testPosition=e;try{d=this._stringFormat._currentText;if(e===f&&d.substring(e,f+1)===this.getDecimalSeparator())return false;h=d.slice(0,e);b=h;g=d.slice(e,f+1).indexOf(this.getDecimalSeparator())>=0;if(g)b+=this.getDecimalSeparator();b+=d.slice(f+1);b=b||"0";this._stringFormat.deFormatValue(b);b=this._stringFormat._currentText;this._nullvalue=false;if(this.inputWidget.options.showGroup)if(g)c.testPosition=b.indexOf(this.getDecimalSeparator());else try{j=this.countSubstring(h,this._stringFormat._groupSeparator);i=this.countSubstring(b.substring(0,Math.max(0,e-1)),this._stringFormat._groupSeparator);c.testPosition-=j-i;if(d.indexOf(l.currency.symbol)===c.testPosition||d.indexOf(l.percent.symbol)===c.testPosition)c.testPosition++}catch(m){}return true}catch(n){}return true};d.prototype.incEnumPart=function(d,b,c){if(!b)b=new a.wijInputResult;this._stringFormat.increment(c);this._nullvalue=false;return this.checkAndRepairBounds(true,false)};d.prototype.decEnumPart=function(d,b,c){if(!b)b=new a.wijInputResult;this._stringFormat.decrement(c);this._nullvalue=false;return this.checkAndRepairBounds(true,false)};d.prototype.getValue=function(){return this._stringFormat.getJSFloatValue()};d.prototype.setValue=function(a){try{this._stringFormat._setValueFromJSFloat(a);this.checkAndRepairBounds(true,false);return true}catch(b){return false}};d.prototype.updateStringFormat=function(){var a="0";if(typeof this._stringFormat!=="undefined")a=this._stringFormat._currentValueInString;this._stringFormat=new c(this._type,this.inputWidget.options.decimalPlaces,this.inputWidget.options.showGroup,this._getCulture());this._stringFormat._currentValueInString=a};return d}(a.wijTextProvider),c=function(){function a(d,a,b,c){this.type=d;this.digitsPlaces=a;this.showGroup=b;this.culture=c;this._currentValueInString="0";this._currentText="0";this._groupSeparator=" "}a.prototype.decimalSeparator=function(){return this.culture.numberFormat["."]};a.prototype.isNegtive=function(a){return a.indexOf("-")!==-1||a.indexOf("(")!==-1};a.prototype.stripValue=function(a){var b=this.culture.numberFormat,h=this.isNegtive(a),d,e,c,g,f;a=a.replace("(","");a=a.replace(")","");a=a.replace("-","");a=a.replace(b.percent.symbol,"");a=a.replace(b.currency.symbol,"");d=b[","];e=b["."];switch(this.type){case"percent":d=b.percent[","];e=b.percent["."];break;case"currency":d=b.currency[","];e=b.currency["."]}this._groupSeparator=d;c=new RegExp("["+d+"]","g");a=a.replace(c,"");c=new RegExp("["+e+"]","g");a=a.replace(c,".");c=new RegExp("[ ]","g");a=a.replace(c,"");try{g=new RegExp("([\\d\\.])+");f=g.exec(a);if(f)a=f[0];if(h)a="-"+a;return a}catch(i){}return null};a.prototype.tryParseValue=function(b){b=this.stripValue(b);if(b===null)return 0;var a;try{a=parseFloat(b);if(isNaN(a))a=0}catch(c){a=0}return a};a.prototype.deFormatValue=function(a){a=this.stripValue(a);if(a===null)return;this._currentValueInString=a;this._currentText=this.formatValue(a)};a.prototype.formatValue=function(c){c=""+c+"";var a=this.culture.numberFormat,j=this.digitsPlaces,h=" ",e=".",f=2,i=this.isNegtive(c),d=new Array(3),g,b;d.push(3);g="n";switch(this.type){case"numeric":g=i?a.pattern[0]:"n";h=a[","];e=a["."];f=a.decimals;d=a.groupSizes;break;case"percent":g=a.percent.pattern[i?0:1];h=a.percent[","];e=a.percent["."];f=a.percent.decimals;d=a.percent.groupSizes;break;case"currency":g=a.currency.pattern[i?0:1];h=a.currency[","];e=a.currency["."];f=a.currency.decimals;d=a.currency.groupSizes}if(j!==-2)f=j;if(!this.showGroup)d=[0];c=c.replace(new RegExp("^[0]+"),"");b=this.formatDigit(c,h,e,f,d);b=b.replace(new RegExp("^[0]+"),"");if(b.indexOf(e)===0)b="0"+b;if(b==="")b="0";this._currentValueInString=c;this._currentText=this.applyFormatPattern(g,b,a.percent.symbol,a.currency.symbol);return this._currentText};a.prototype.getFormattedValue=function(){return this.formatValue(this._currentValueInString)};a.prototype.getJSFloatValue=function(){try{return this._currentValueInString===""?0:parseFloat(this._currentValueInString)}catch(a){return Number.NaN}};a.prototype.clear=function(){this._currentValueInString="0";this._currentText="0"};a.prototype._setValueFromJSFloat=function(a){try{this._currentValueInString=""+a+"";this.formatValue(a);return true}catch(b){return false}};a.prototype.isZero=function(c){if(typeof c==="undefined")c=this._currentValueInString;try{var a=c.replace("-",""),b;a=a.replace("(","");a=a.replace(")","");if(!a.length)a="0";b=parseFloat(a);if(!isNaN(b)&&!b)return true}catch(d){}return false};a.prototype.setPositiveSign=function(){this._currentValueInString=this._currentValueInString.replace("-","");this._currentValueInString=this._currentValueInString.replace("(","");this._currentValueInString=this._currentValueInString.replace(")","")};a.prototype.isNegative=function(){return this._currentValueInString.indexOf("-")!==-1||this._currentValueInString.indexOf("(")!==-1};a.prototype.invertSign=function(){var a=this.isNegative();if(a)this.setPositiveSign();else this._currentValueInString=!this._currentValueInString.length?"0":"-"+this._currentValueInString;if(this.isZero())this._currentValueInString=a?"0":"-0";this.formatValue(this._currentValueInString)};a.prototype.parseNumber=function(b){if(typeof b==="undefined")b=this._currentValueInString;var a=this._currentValueInString.split(this.decimalSeparator(),2);return{decimal:parseInt(a[0],10)||0,fraction:(a.length>1?parseInt(a[1],10):0)||0}};a.prototype._change=function(b){var a=this.parseNumber();this._currentValueInString=""+(a.decimal+b)+this.decimalSeparator()+a.fraction};a.prototype.increment=function(a){if(typeof a==="undefined")a=1;this._change(a)};a.prototype.decrement=function(a){if(typeof a==="undefined")a=1;this._change(-a)};a.prototype.checkDigitsLimits=function(f){try{var a=this._currentValueInString.split(this.decimalSeparator()),d,b,c,e;if(!a.length||a.length===1&&a[0]==="")return;d="";if(a.length>1)d=a[1];b="";for(c=0;c<f;c++){e="0";if(d.length>c)e=d.charAt(c);b=b+e}if(b.length>0)this._currentValueInString=a[0]+"."+b;else this._currentValueInString=a[0]}catch(g){}};a.prototype.checkMinValue=function(g,i,h){if(typeof h==="undefined")h=false;var e=true,a,b,c,d,f;try{a=this._currentValueInString.split(this.decimalSeparator());b=parseFloat(a[0]===""||a[0]==="-"?"0":a[0]);c=0;if(a.length>1&&parseFloat(a[1])>0)c=parseFloat("1."+a[1]);if(b<0||a[0]==="-")c=c*-1;g=""+g+"";a=g.split(this.decimalSeparator());d=parseFloat(a[0]);f=0;if(a.length>1&&parseFloat(a[1])>0)f=parseFloat("1."+a[1]);if(b>d)return true;if(b<d||h&&b===d&&c<=f)e=false;else if(b===d&&b<0&&c>f)e=false;else if(b===d&&b>=0&&c<f)e=false;if(!e&&i)this._currentValueInString=""+g+""}catch(j){}return e};a.prototype.checkMaxValue=function(g,h){var d=true,a,b,c,e,f;try{a=this._currentValueInString.split(this.decimalSeparator());b=parseFloat(a[0]===""||a[0]==="-"?"0":a[0]);c=0;if(a.length>1&&parseFloat(a[1])>0)c=parseFloat("1."+a[1]);if(b<0||a[0]==="-")c=c*-1;g=""+g+"";a=g.split(this.decimalSeparator());e=parseFloat(a[0]);f=0;if(a.length>1&&parseFloat(a[1])>0)f=parseFloat("1."+a[1]);if(b<e)return true;if(b>e)d=false;if(b===e&&b>=0&&c>f)d=false;if(b===e&&b<0&&c<f)d=false;if(!d&&h)this._currentValueInString=""+g+""}catch(i){}return d};a.prototype.applyFormatPattern=function(f,e,d,c){var a=f,b=new RegExp("[n]","g");a=a.replace(b,e);b=new RegExp("[%]","g");a=a.replace(b,d);b=new RegExp("[$]","g");a=a.replace(b,c);return a};a.prototype.formatDigit=function(l,k,h,j,i){var a=""+l+"",c,b,e,g,f,d;a=a.replace("-","");a=a.replace("(","");a=a.replace(")","");c=a.indexOf(h);if(c===-1)c=a.indexOf(".");if(c===-1)c=a.indexOf(",");if(c===-1)c=a.length;b="";e=0;g=0;for(d=a.length-1;d>=0;d--){f=a.charAt(d);if(d<c){b=f+b;g++;if(g===i[e]*1&&i[e]*1&&d){b=k+b;g=0;if(i.length-1>e)e++}}}if(j>0){b=b+h;for(d=0;d<j;d++){f="0";if(d+c+1<a.length)f=a.charAt(d+c+1);b=b+f}}if(j===-1)if(c<a.length-1){b=b+h;b=b+a.substr(c+1)}return b};return a}()})(wijmo||(wijmo={}));


/*
 *
 * Wijmo Library 2.3.1
 * http://wijmo.com/
 *
 * Copyright(c) GrapeCity, Inc.  All rights reserved.
 * 
 * Licensed under the Wijmo Commercial License. Also available under the GNU GPL Version 3 license.
 * licensing@wijmo.com
 * http://wijmo.com/widgets/license/
 *
 *
 **/
var __extends=this.__extends||function(b,c){function a(){this.constructor=b}a.prototype=c.prototype;b.prototype=new a},wijmo;(function(c){"use strict";var b=jQuery,a;(function(a){a._map=[];a.editOptional=1;a.editRequired=2;a.separator=4;a.literal=8})(a||(a={}));var d=function(b){__extends(a,b);function a(){b.apply(this,arguments)}a.prototype._createTextProvider=function(){this._textProvider=new e(this,this.options.mask,false)};a.prototype._beginUpdate=function(){this.element.addClass("wijmo-wijinput-mask");this.element.data("isPassword",this.options.passwordChar.length>0&&this.element.attr("type")!=="password");this.element.data("defaultText",this.options.text)};a.prototype._onTriggerClicked=function(){this._popupComboList()};a.prototype._setOption=function(c,a){b.prototype._setOption.call(this,c,a);switch(c){case"text":this.setText(a);break;case"mask":case"culture":if(typeof a==="undefined"||a.length<=0)return;var d=this.getText();this._textProvider.mask=a;this._textProvider.initialMask=a;this._textProvider.initialize();this._textProvider.set(d);this._updateText();break;case"promptChar":if(this._textProvider){this._textProvider.updatePromptChar();this._updateText()}break;case"hidePromptOnLeave":case"resetOnPrompt":this._updateText();break;case"passwordChar":this.element.data("isPassword",(a+"").length>0);this._updateText()}};a.prototype._resetData=function(){var a=this.element.data("defaultText");if(a===undefined||a===null)a=this.element.data("elementValue");if(a===undefined||a===null)a="";this.setText(a)};a.prototype._isPassword=function(){return!!this.element.data("isPassword")};a.prototype._getTextWithPrompts=function(){return!this._isInitialized()?this.element.val():this._textProvider.toString(true,true,false)};a.prototype._getTextWithLiterals=function(){return!this._isInitialized()?this.element.val():this._textProvider.toString(true,false,true)};a.prototype._getTextWithPromptAndLiterals=function(){return!this._isInitialized()?this.element.val():this._textProvider.toString(true,true,true)};a.prototype._onChange=function(){if(!this.element)return;var b=this.element.val(),a=this.getText();if(a!==b){a=this._getTextWithPrompts();if(a!==b){a=this._getTextWithPromptAndLiterals();a!==b&&this.setText(b)}}};a.prototype._afterFocused=function(){(this._isNullText()||!!this.options.hidePromptOnLeave)&&this._doFocus()};return a}(c.wijinputcore);d.prototype.options=b.extend(true,{},b.Widget.prototype.options,c.wijinputcore.prototype.options,{text:null,mask:"",promptChar:"_",hidePromptOnLeave:false,resetOnPrompt:true,allowPromptAsInput:false,passwordChar:"",resetOnSpace:true,skipLiterals:true});b.widget("wijmo.wijinputmask",d.prototype);var e=function(e){__extends(d,e);function d(a,c,b){e.call(this);this.inputWidget=a;this.mask=c;this.asciiOnly=b;this.testString="";this.assignedCharCount=0;this.requiredCharCount=0;this.noMask=false;this.descriptors=[];this.initialize()}d.prototype.initialize=function(){this.noMask=!this.mask||this.mask.length<=0;if(this.noMask)return;this.testString="";this.assignedCharCount=0;this.requiredCharCount=0;this.descriptors=new Array(0);for(var i="none",m=false,o=0,l,b,c=a.literal,d="",g,n,e,j,h=this.inputWidget._getCulture(),k=0;k<this.mask.length;k++){b=false;g=this.mask.charAt(k);if(m){m=false;b=true}if(!b){e=g;if(e<="C"){switch(e){case"#":case"9":case"?":case"C":g=this.getPromtChar();c=a.editOptional;b=true;break;case"$":d=h.numberFormat.currency.symbol;c=a.separator;b=true;break;case"%":case"-":case";":case"=":case"@":case"B":c=a.literal;b=true;break;case"&":case"0":case"A":g=this.getPromtChar();c=a.editRequired;b=true;break;case",":d=h.numberFormat[","];c=a.separator;b=true;break;case".":d=h.numberFormat["."];c=a.separator;b=true;break;case"/":d=h.calendars.standard["/"];c=a.separator;b=true;break;case":":d=h.calendars.standard[":"];c=a.separator;b=true;break;case"<":i="lower";continue;case">":i="upper";continue}if(!b){c=a.literal;b=true}}if(!b){if(e<="\\"){switch(e){case"L":g=this.getPromtChar();c=a.editRequired;b=true;break;case"\\":m=true;c=a.literal;continue}if(!b){c=a.literal;b=true}}if(!b){if(e==="a"){g=this.getPromtChar();c=a.editOptional;b=true}if(!b){if(e!=="|"){c=a.literal;b=true}if(!b){i="none";continue}}}}}if(b){j=new f(k,c);if(this.isEditDesc(j))j.caseConversion=i;if(c!==a.separator)d=g;for(l=0;l<d.length;l++){n=d.charAt(l);this.testString=this.testString+n;this.descriptors[this.descriptors.length]=j;o++}}}this.testString.Capacity=this.testString.length};d.prototype.getAllowPromptAsInput=function(){return!!this.inputWidget?this.inputWidget.options.allowPromptAsInput:false};d.prototype.getPasswordChar=function(){return!!this.inputWidget?this.inputWidget.options.passwordChar:"*"};d.prototype.isPassword=function(){return!!this.inputWidget?this.inputWidget._isPassword():false};d.prototype.getResetOnPrompt=function(){return!!this.inputWidget?this.inputWidget.options.resetOnPrompt:true};d.prototype.getResetOnSpace=function(){return!!this.inputWidget?this.inputWidget.options.resetOnSpace:true};d.prototype.getSkipLiterals=function(){return!!this.inputWidget?this.inputWidget.options.skipLiterals:true};d.prototype.getHidePromptOnLeave=function(){return!!this.inputWidget?this.inputWidget.options.hidePromptOnLeave:false};d.prototype._trueOR=function(a,b){return(a>>>1|b>>>1)*2+(a&1|b&1)};d.prototype.setValue=function(){return false};d.prototype.getValue=function(){return null};d.prototype.getPromtChar=function(){return!!this.inputWidget?this.inputWidget.options.promptChar:"_"};d.prototype.updatePromptChar=function(){if(this.noMask)return;for(var c,d=0;d<this.descriptors.length;d++){c=this.descriptors[d];if(c.charType===a.editOptional||c.charType===a.editRequired)if(!c.isAssigned)this.testString=b.wij.charValidator.setChar(this.testString,this.getPromtChar(),d)}};d.prototype.resetChar=function(c){var d=this.descriptors[c];if(this.isEditPos(c)&&d.isAssigned){d.isAssigned=false;this.testString=b.wij.charValidator.setChar(this.testString,this.getPromtChar(),c);this.assignedCharCount--;if(d.charType===a.editRequired)this.requiredCharCount--}};d.prototype.getAdjustedPos=function(a){if(this.noMask){if(a>=this.testString.length)a=this.testString.length-1}else if(a>=this.descriptors.length)a=a-1;return Math.max(0,a)};d.prototype.incEnumPart=function(){return!this.noMask};d.prototype.decEnumPart=function(){return!this.noMask};d.prototype.findNonEditPositionInRange=function(c,d,b){return this.findPositionInRange(c,d,b,this._trueOR(a.literal,a.separator))};d.prototype.findPositionInRange=function(a,b,e,f){a=Math.max(0,a);b=Math.min(b,this.testString.length-1);if(a<=b)while(a<=b){var c=e?a++:b--,d=this.descriptors[c];if((d.charType&4294967295&f&4294967295)===d.charType)return c}return-1};d.prototype.findAssignedEditPositionInRange=function(c,d,b){return this.assignedCharCount===0?-1:this.findEditPositionInRange(c,d,b,a.editRequired)};d.prototype.findEditPositionInRange=function(c,d,f,g){do{var b,e;b=this.findPositionInRange(c,d,f,this._trueOR(a.editRequired,a.editOptional));if(b===-1)break;e=this.descriptors[b];switch(g){case a.editOptional:if(!e.isAssigned)return b;break;case a.editRequired:if(e.isAssigned)return b;break;default:return b}if(f)c++;else d--}while(c<=d);return-1};d.prototype.findAssignedEditPositionFrom=function(d,c){if(!this.assignedCharCount)return-1;var a,b;if(c){a=d;b=this.testString.length-1}else{a=0;b=d}return this.findAssignedEditPositionInRange(a,b,c)};d.prototype.findEditPositionFrom=function(d,c){var a,b;if(c){a=d;b=this.testString.length-1}else{a=0;b=d}return this.findEditPositionInRange(a,b,c,0)};d.prototype.setChar=function(c,e,d){e=e<0?0:e;if(!d)d=this.descriptors[e];if(this.testEscapeChar(c,e,d))this.resetChar(e);else{if(b.wij.charValidator.isLetter(c))if(b.wij.charValidator.isUpper(c)){if(d.caseConversion==="lower")c=c.toLowerCase()}else if(d.caseConversion==="upper")c=c.toUpperCase();this.testString=b.wij.charValidator.setChar(this.testString,c,e);if(!d.isAssigned){d.isAssigned=true;this.assignedCharCount++;if(d.charType===a.editRequired)this.requiredCharCount++}}};d.prototype.internalInsertAt=function(i,f,a,l){if(i.length===0){a.testPosition=f;a.hint=a.noEffect;return true}if(!this._testString(i,f,a))return false;var b=this.findEditPositionFrom(f,true),h=this.findAssignedEditPositionInRange(b,a.testPosition,true)!==-1,m=this.findAssignedEditPositionFrom(this.testString.length-1,false),d,e,g,k,j;if(h&&a.testPosition===this.testString.length-1){a.hint=a.unavailableEditPosition;a.testPosition=this.testString.length;return false}d=this.findEditPositionFrom(a.testPosition+1,true);if(h){e=new c.wijInputResult;e.hint=e.unknown;g=true;while(g){g=false;if(d===-1){a.hint=a.unavailableEditPosition;a.testPosition=this.testString.length;return false}k=this.descriptors[b];if(k.isAssigned&&!this.testChar(this.testString.charAt(b),d,e)){a.hint=e.hint;a.testPosition=d;return false}if(b!==m){b=this.findEditPositionFrom(b+1,true);d=this.findEditPositionFrom(d+1,true);g=true;continue}}if(e.hint>a.hint)a.hint=e.hint}if(!l){if(h)while(b>=f){j=this.descriptors[b];if(j.isAssigned)this.setChar(this.testString.charAt(b),d);else this.resetChar(d);d=this.findEditPositionFrom(d-1,false);b=this.findEditPositionFrom(b-1,false)}this.setString(i,f)}return true};d.prototype.insertAt=function(d,a,b){if(typeof b==="undefined")b=new c.wijInputResult;if(d===undefined)throw"InsertAt: input";if(this.noMask){this.testString=this.testString.substring(0,a)+d+this.testString.substring(a,this.testString.length);b.testPosition=a+d.length-1;return true}if(a>=0&&a<this.testString.length)return this.internalInsertAt(d,a,b,false);b.testPosition=a;b.hint=b.positionOutOfRange;return false};d.prototype.clear=function(a){if(this.noMask){this.testString="";a.hint=a.success;return}if(!this.assignedCharCount)a.hint=a.noEffect;else{a.hint=a.success;for(var b=0;b<this.testString.length;b++)this.resetChar(b)}};d.prototype.isLiteral=function(b){return!b?false:b.charType!==a.literal?b.charType===a.separator:true};d.prototype.testEscapeChar=function(b,a,c){a=a<0?0:a;if(!c)c=this.descriptors[a];return this.isLiteral(c)?this.getSkipLiterals()?b===this.testString.charAt(a):false:(!this.getResetOnPrompt()||b!==this.getPromtChar())&&(!this.getResetOnSpace()||b!==" ")?false:true};d.prototype.testChar=function(c,e,a){if(!b.wij.charValidator.isPrintableChar(c)){a.hint=a.invalidInput;return false}var d=this.descriptors[e];if(!d)return false;if(this.isLiteral(d)){if(this.getSkipLiterals()&&c===this.testString.charAt(e)){a.hint=a.characterEscaped;return true}a.hint=a.nonEditPosition;return false}if(c===this.getPromtChar()){if(this.getResetOnPrompt()){if(this.isEditDesc(d)&&d.isAssigned)a.hint=a.sideEffect;else a.hint=a.characterEscaped;return true}if(!this.getAllowPromptAsInput()){a.hint=a.promptCharNotAllowed;return false}}if(c===" "&&this.getResetOnSpace()){if(this.isEditDesc(d)&&d.isAssigned)a.hint=a.sideEffect;else a.hint=a.characterEscaped;return true}switch(this.mask.charAt(d.maskPosition)){case"L":if(!b.wij.charValidator.isLetter(c)){a.hint=a.letterExpected;return false}if(!b.wij.charValidator.isAsciiLetter(c)&&this.asciiOnly){a.hint=a.asciiCharacterExpected;return false}break;case"a":if(!b.wij.charValidator.isAlphanumeric(c)&&c!==" "){a.hint=a.alphanumericCharacterExpected;return false}if(!b.wij.charValidator.isAciiAlphanumeric(c)&&this.asciiOnly){a.hint=a.asciiCharacterExpected;return false}break;case"?":if(!b.wij.charValidator.isLetter(c)&&c!==" "){a.hint=a.letterExpected;return false}if(b.wij.charValidator.isAsciiLetter(c)||!this.asciiOnly)break;a.hint=a.asciiCharacterExpected;return false;case"A":if(!b.wij.charValidator.isAlphanumeric(c)){a.hint=a.alphanumericCharacterExpected;return false}if(b.wij.charValidator.isAciiAlphanumeric(c)||!this.asciiOnly)break;a.hint=a.asciiCharacterExpected;return false;case"C":if(!b.wij.charValidator.isAscii(c)&&this.asciiOnly&&c!==" "){a.hint=a.asciiCharacterExpected;return false}break;case"9":if(!b.wij.charValidator.isDigit(c)&&c!==" "){a.hint=a.digitExpected;return false}break;case"#":if(!b.wij.charValidator.isDigit(c)&&c!=="-"&&c!=="+"&&c!==" "){a.hint=a.digitExpected;return false}break;case"&":if(!b.wij.charValidator.isAscii(c)&&this.asciiOnly){a.hint=a.asciiCharacterExpected;return false}break;case"0":if(!b.wij.charValidator.isDigit(c)){a.hint=a.digitExpected;return false}}if(c===this.testString.charAt(e)&&d.isAssigned)a.hint=a.noEffect;else a.hint=a.success;return true};d.prototype._testString=function(e,g,a){a.hint=a.unknown;a.testPosition=g;if(e.length){var b=new c.wijInputResult,d,f;b.testPosition=a.testPosition;b.hint=a.hint;for(d=0;d<e.length;d++){f=e.charAt(d);if(a.testPosition>this.testString.length){a.hint=a.unavailableEditPosition;return false}if(!this.testEscapeChar(f,a.testPosition)){a.testPosition=this.findEditPositionFrom(a.testPosition,true);if(a.testPosition===-1){a.testPosition=this.testString.length;a.hint=a.unavailableEditPosition;return false}}if(!this.testChar(f,a.testPosition,b)){a.hint=b.hint;return false}if(b.hint>a.hint)a.hint=b.hint;a.testPosition+=1;if(a.testPosition===this.testString.length)break}a.testPosition-=1}return true};d.prototype.set=function(b,a){if(typeof a==="undefined")a=new c.wijInputResult;if(b===undefined)throw"SetFromPos: input parameter is null or undefined.";a.hint=a.unknown;a.testPosition=0;if(!b.length){this.clear(a);return true}if(this.noMask){this.testString=b;return true}if(!this.testSetString(b,a.testPosition,a))return false;var d=this.findAssignedEditPositionFrom(a.testPosition+1,true);d!==-1&&this.resetString(d,this.testString.length-1);return true};d.prototype.resetString=function(a,b){if(this.noMask){this.testString="";return}a=this.findAssignedEditPositionFrom(a,true);if(a!==-1){b=this.findAssignedEditPositionFrom(b,false);while(a<=b){a=this.findAssignedEditPositionFrom(a,true);this.resetChar(a);a++}}};d.prototype.setString=function(d,a){for(var b,c=0;c<d.length;c++){b=d.charAt(c);if(!this.testEscapeChar(b,a))a=this.findEditPositionFrom(a,true);if(a<0||a>=this.testString.length)return;this.setChar(b,a);a++}};d.prototype.testSetString=function(a,b,c){if(a.length>this.testString.length)a=a.substring(0,this.testString.length);if(this._testString(a,b,c)){this.setString(a,b);return true}return false};d.prototype.toString=function(f,i,h,d,e){var k=this.inputWidget.options.text||"",o,n,l,p,c,q,j,g,m;k=b.trim(k);if(this.inputWidget.options.showNullText&&!this.inputWidget.isFocused()&&(k===""||k===this.inputWidget.options.nullText))return this.inputWidget.options.nullText;f=f===undefined?!this.isPassword():f;i=i===undefined?this.getHidePromptOnLeave()?this.inputWidget.isFocused():true:i;h=h===undefined?true:h;if(this.noMask){if(!f){o="";for(n=0;n<this.testString.length;n++)o+=this.getPasswordChar();return o}return this.testString}d=d===undefined?0:d;e=e===undefined?this.testString.length:e;if(e<=0)return"";if(d<0)d=0;if(d>=this.testString.length)return"";l=this.testString.length-d;if(e>l)e=l;if((!this.isPassword()||f)&&i&&h){p=this.testString.substring(d,e-d);return p}c="";q=d+e-1;for(j=d;j<=q;j++){g=this.testString.charAt(j);m=this.descriptors[j];switch(m.charType){case a.editOptional:case a.editRequired:if(!m.isAssigned)break;if(!this.isPassword()||f){c=c+g;continue}c=c+this.getPasswordChar();continue;case a.editRequired|a.editOptional:c=c+g;continue;case a.separator:case a.literal:if(!h)continue;c=c+g;continue;default:c=c+g;continue}if(i){c=c+g;continue}c=c+" ";continue}return c};d.prototype.isEditDesc=function(b){return this.noMask?true:b.charType!==a.editRequired?b.charType===a.editOptional:true};d.prototype.isEditPos=function(a){if(this.noMask)return true;if(a<0||a>=this.testString.length)return false;var b=this.descriptors[a];return this.isEditDesc(b)};d.prototype.internalRemoveAt=function(e,f,d,j){if(typeof j==="undefined")j=false;if(this.noMask){try{this.testString=this.testString.substring(0,e)+this.testString.substring(f+1,this.testString.length);d.testPosition=e}catch(r){}return true}var o=new c.wijInputResult,l,k,b,n,a,p,h,q,g,m,i=this.findAssignedEditPositionFrom(this.testString.length-1,false);b=this.findEditPositionInRange(e,f,true,0);d.hint=d.noEffect;if(b===-1||b>i){d.testPosition=e;return true}d.testPosition=e;n=f<i;if(this.findAssignedEditPositionInRange(e,f,true)!==-1)d.hint=d.success;if(n){a=this.findEditPositionFrom(f+1,true);p=a;e=b;h=true;while(h){h=false;l=this.testString.charAt(a);q=this.descriptors[a];if((l!==this.getPromtChar()||q.isAssigned)&&!this.testChar(l,b,o)){d.hint=o.hint;d.testPosition=b;return false}if(a!==i){a=this.findEditPositionFrom(a+1,true);b=this.findEditPositionFrom(b+1,true);h=true;continue}}if(d.sideEffect>d.hint)d.hint=d.sideEffect;if(j)return true;a=p;b=e;g=true;while(g){g=false;k=this.testString.charAt(a);m=this.descriptors[a];if(k===this.getPromtChar()&&!m.isAssigned)this.resetChar(b);else{this.setChar(k,b);this.resetChar(a)}if(a!==i){a=this.findEditPositionFrom(a+1,true);b=this.findEditPositionFrom(b+1,true);g=true;continue}}e=b+1}e<=f&&this.resetString(e,f);return true};d.prototype.removeAt=function(d,b,a){if(typeof b==="undefined")b=d;if(typeof a==="undefined")a=new c.wijInputResult;if(b>=this.testString.length){a.testPosition=b;a.hint=a.positionOutOfRange;return false}if(d>=0&&d<=b)return this.internalRemoveAt(d,b,a,false);a.testPosition=d;a.hint=a.positionOutOfRange;return false};return d}(c.wijTextProvider),f=function(){function a(b,a){this.maskPos=b;this.charType=a;this.caseConversion="none";this.isAssigned=false;this.maskPosition=0;this.maskPosition=b;this.charType=a}return a}()})(wijmo||(wijmo={}));


