function alphaBullet(n){for(var t="",i=!1;!i;)t=String.fromCharCode(n%26+97)+t,n=Math.floor(n/26),n==0&&(i=!0),n--;return t}function centerKWindow(n){var t=n.closest(".k-window");t.css("top",window.innerHeight/2-t.height()/2);t.css("left",window.innerWidth/2-t.width()/2)}function decodeHtml(n){return n.replace(/-lt-/g,"<").replace(/-gt-/g,">")}function encodeHtml(n){return n.replace(/</g,"-lt-").replace(/>/g,"-gt-")}function fileSizeParser(n){var t="",f=n/1024,r=n/1048576,i,u;return typeof n!="undefined"&&(r>1?(t=numberToString(r,2),i=t.split("."),u=i.length>1?i[1]:"",u=="00"&&(t=i[0]),t+=" megabytes"):t=numberToString(f,0)+" kilobytes"),t}function expandSpriteHandler(n){var t=!1;$(this).attr("expanded")==="true"&&(t=!0);n.type=="mouseover"?expandSpriteUpdate(!0,$(this)):expandSpriteUpdate(!1,$(this))}function expandSpriteUpdate(n,t){var f=!1,i,e,r,u,o;for(t.attr("expanded")==="true"&&(f=!0),i="",n&&!f&&(i="expandSprite_hover"),!n&&f&&(i="expandSprite_expanded"),n&&f&&(i="expandSprite_expandedHover"),e=t.attr("class"),typeof e=="undefined"&&(e=""),r=e.split(" "),u=r.length-1;u>=0;u--)r[u]!=i&&r[u].indexOf("expandSprite_")==0&&t.removeClass(r[u]);o=$.inArray(i,r);o==-1&&t.addClass(i)}function getSize(n,t,i){var r={width:t,height:i};return typeof Storage!="undefined"&&localStorage[n]!=null&&(r=JSON.parse(localStorage[n])),r}function liveHoverHandler(n){n.type=="mouseover"?onHoverIn($(this)):onHoverOut($(this))}function moveRowDown(n,t){var i=n.find("tr");i.eq(t).insertAfter(i.eq(t+1))}function moveRowUp(n,t){var i=n.find("tr");i.eq(t).insertBefore(i.eq(t-1))}function nonUtcParser(n){return new Date(parseInt(n.substr(6)))}function numberToString(n,t){var u=Number("1.2").toLocaleString().substr(1,1),e=n.toLocaleString(),i=String(e).split(u),f=i[0],r=i.length>1?i[1]:"";return r=(r+"00000000000").substr(0,t),t<=0?f:f+u+r}function onHoverIn(n){var r=$(this),u,i,t;for(n!=undefined&&(r=n),u=r.attr("class"),i=u.split(" "),t=0;t<i.length;t++)if(i[t].indexOf("normal")!=-1&&i[t].length>5){normalClass=i[t];hoverClass=i[t].substring(0,i[t].length-6)+"hover";r.removeClass(normalClass).addClass(hoverClass);break}}function onHoverOut(n){var r=$(this),u,i,t;for(n!=undefined&&(r=n),u=r.attr("class"),i=u.split(" "),t=0;t<i.length;t++)if(i[t].indexOf("hover")!=-1&&i[t].length>6){normalClass=i[t].substring(0,i[t].length-5)+"normal";hoverClass=i[t];r.removeClass(hoverClass).addClass(normalClass);break}}function parseBool(n){var t=!1;return typeof n=="undefined"?t=!1:(n=="True"||n=="true")&&(t=!0),t}function resetDialogDiv(n){if($("#"+n).data("kendoWindow")!=null&&$("#"+n).data("kendoWindow").destroy(),document.getElementById(n)==null){var t=document.createElement("div");t.id=n;t.style="display: none";document.body.insertBefore(t)}}function getGridColumns(n,t){var i=null,f=!1,e,r,u;if(typeof Storage!="undefined"&&(e=localStorage[n],typeof e!="undefined"))for(i=JSON.parse(e),r=0;r<t.length;r++){for(f=!1,u=0;u<i.length;u++)if(i[u].field==t[r].field){f=!0;i[u].title=t[r].title;typeof t[r].template!="undefined"&&(i[u].template=t[r].template);i[u].width<=1&&(i[u].width=80);break}f||i.push(t[r])}return i==null&&(i=t),i}function unloadGridColumns(n){var r=[],t=$(n).data("kendoGrid").columns;for(var i in t)r.push({field:t[i].field,width:t[i].width,hidden:t[i].hidden,title:t[i].title});return r}function saveGridColumns(n,t){saveGridColumnsWithMove(n,t)}function saveGridColumnsWithMove(n,t,i,r){var e,u,f;typeof Storage!="undefined"&&(e=$(t).data("kendoGrid"),u=unloadGridColumns(t),typeof i!="undefined"&&typeof r!="undefined"&&(f=u[r],u.splice(r,1),u.splice(i,0,f)),localStorage[n]=JSON.stringify(u))}function saveSize(n,t,i){typeof Storage!="undefined"&&(localStorage[n]=JSON.stringify({height:i,width:t}))}function setGridToHeight(n,t){var i=$(n),f=i.children().not(".k-grid-content"),r=0,u;f.each(function(){r+=$(this).outerHeight()});i.height(t);u=t-r;i.find(".k-grid-content").height(u)}function spriteSlideDown(n,t){n.animate({height:1},600,"swing",function(){n.animate({height:t},300)})}function trace(n){try{console.log(n)}catch(t){}}function utcParser(n){var t=undefined;return n!=null&&n!=undefined&&(t=new Date(parseInt(n.substr(6))),t.setTime(t.getTime()-t.getTimezoneOffset()*6e4),t<0&&(t="")),t}function windowHeight(){var n=460;return document.body&&document.body.offsetWidth&&(n=document.body.offsetHeight),document.compatMode=="CSS1Compat"&&document.documentElement&&document.documentElement.offsetWidth&&(n=document.documentElement.offsetHeight),window.innerWidth&&window.innerHeight&&(n=window.innerHeight),n}function windowWidth(){var n=630;return document.body&&document.body.offsetWidth&&(n=document.body.offsetWidth),document.compatMode=="CSS1Compat"&&document.documentElement&&document.documentElement.offsetWidth&&(n=document.documentElement.offsetWidth),window.innerWidth&&window.innerHeight&&(n=window.innerWidth),n}function stsResize(){$("#headingBuffer").height($(".pageHeading").height()/2)}function changeToNextImage(n){$.ajax({type:"GET",url:window.baseUrl+"STS/GetNextImage",data:{ids:imgIDs},traditional:!0,success:function(n){n.ImageID>0&&(n.ResetIDs==!0&&(imgIDs=[]),imgIDs.push(n.ImageID),$("#ImageID").val(n.ImageID),$("#AuthImage").attr("src","data:image/jpeg;base64,"+n.ImageBase64).attr("alt",n.ImageDesc))}});n.preventDefault()}function setupEnterButtonClick(){$("input").keypress(function(n){n.which==13&&(n.preventDefault(),$("input.submitEnter").click())})}(function(n,t){var i=function(n,t,i){var r;return function(){function e(){i||n.apply(u,f);r=null}var u=this,f=arguments;r?clearTimeout(r):i&&n.apply(u,f);r=setTimeout(e,t||100)}};jQuery.fn[t]=function(n){return n?this.bind("resize",i(n)):this.trigger(t)}})(jQuery,"smartresize"),function(n){n.ajaxAntiForgery=function(t){return t.headers==null&&(t.headers={}),t.headers.__RequestVerificationToken=n("[name=__RequestVerificationToken]").val(),n.ajax(t)}}(jQuery)