'use strict'; /* jshint undef: true, unused: false, strict: true, curly: false, funcscope: true, globalstrict: true, proto: true, shadow: false, quotmark: single, eqnull: true, eqeqeq: true */ /* global __METHOD__, AppBase, WindowLib, setTimeout, AppStaticLib, window, console, document, navigator, jQuery, unescape, alert, Element, __LINE__ */ if(typeof(String.getHash)==='undefined'){Object.defineProperty(String.prototype,'hashCode',{value:function(){return this.split('').reduce(function(a,b){a=((a<<5)-a)+b.charCodeAt(0);return a&a;},0);}});}if(!Number.isInteger){Number.isInteger=function(value){return typeof value==='number'&&isFinite(value)&&Math.floor(value)===value;};}if(!Array.from){Array.from=(function(){var symbolIterator;try{symbolIterator=window.Symbol.iterator?window.Symbol.iterator:'Symbol(Symbol.iterator)';}catch(e){symbolIterator='Symbol(Symbol.iterator)';}var toStr=Object.prototype.toString;var isCallable=function(fn){return(typeof fn==='function'||toStr.call(fn)==='[object Function]');};var toInteger=function(value){var number=Number(value);if(isNaN(number))return 0;if(number===0||!isFinite(number))return number;return(number>0?1:-1)*Math.floor(Math.abs(number));};var maxSafeInteger=Math.pow(2,53)-1;var toLength=function(value){var len=toInteger(value);return Math.min(Math.max(len,0),maxSafeInteger);};var setGetItemHandler=function setGetItemHandler(isIterator,items){var iterator=isIterator&&items[symbolIterator]();return function getItem(k){return isIterator?iterator.next():items[k];};};var getArray=function getArray(T,A,len,getItem,isIterator,mapFn){var k=0;while(k1?arguments[1]:void undefined;var T;if(typeof mapFn!=='undefined'){if(!isCallable(mapFn)){throw new TypeError('Array.from: when provided, the second argument must be a function');}if(arguments.length>2){T=arguments[2];}}var len=toLength(items.length);var A=isCallable(C)?Object(new C(len)):new Array(len);return getArray(T,A,len,setGetItemHandler(isIterator,items),isIterator,mapFn);};})();}window.emulationMode=0;if(true){window.AppStaticLib={StrictifyAppCode:function(code,url,controls){var whereToStore=function(){var App=1;window.Framework.prop.ClassCollection[1]=App;};var stringLocation=whereToStore.toString();var insertIndex=stringLocation.indexOf('=1;')+3;stringLocation=stringLocation.substring(0,(stringLocation.length-1));stringLocation=stringLocation.substring(insertIndex);insertIndex=(stringLocation.indexOf('[1]')+1);var finalResult=stringLocation.substring(0,insertIndex)+'\''+url+'\''+stringLocation.substring(insertIndex+1);var othercontrols='';if(Array.isArray(controls)===true){var name='';var enddot=-1;var endslash=-1;var bit=null;for(var i=0;i=0;j--){bit=name[j];if((bit==='.')){enddot=j;continue;}if((bit==='/')&&(endslash===-1)){endslash=j;break;}}name=name.substr((endslash+1),(enddot-endslash-1));assertgroup('appbubble','This is where we should fill the local variables from hidden global memory pool');}}return'\'use strict\';\n'+othercontrols+code+finalResult;},_DisplayRecord:function(record,display){if((typeof(record)==='undefined')||(record===null))return;if(typeof(record)!=='object')return record;if(window.Framework.prop.developer){console.log(record);}var currentString=display;var returnString='';var start=display.indexOf('{');var value='';var end=null;var colName=null;if(start===-1){currentString='{'+display+'}';start=0;}while(start>-1){returnString+=currentString.substr(0,start);end=currentString.indexOf('}');colName=currentString.substr((start+1),(end-start-1));currentString=currentString.substr((end+1));value=record[colName];if((typeof(value)==='undefined')||(value===null)){value='';}returnString+=value;start=currentString.indexOf('{');}return returnString+currentString;},clone:function(item){if(!item){return item;}var types=[Number,String,Boolean];var result;types.forEach(function(type){if(typeof(type)==='undefined')throw new Error(__METHOD__+' reports that the type was not found on line '+__LINE__);if(item instanceof type){result=type(item);}});if(typeof(result)==='undefined'){if(Object.prototype.toString.call(item)==='[object Array]'){result=[];item.forEach(function(child,index){result[index]=AppStaticLib.clone(child);});}else if(typeof(item)==='object'){if(AppStaticLib.IsAnApp(item)){return item;}else if((item.nodeType)&&(typeof(item.cloneNode)==='function')){result=item.cloneNode(true);}else if(!item.prototype){if(item instanceof Date){result=new Date(item);}else{result={};for(var i in item){result[i]=AppStaticLib.clone(item[i]);}}}else{if(item.constructor){result=new item.constructor();}else{result=item;}}}else{result=item;}}return result;},Hyphenate:function(str,len){var res='';for(var i=0;i';var optionalTagText='\' title=\'';var closeTagText='';if(typeof(encode)!=='boolean')throw new Error('AppStaticLib.Layer5: Argument 1 is expected to be a boolean (used to determine logic, whether to encode/decode the searchText [Arg 2])');if(StaticLib.Empty(searchText))return searchText;if(typeof(searchText)!=='string')throw new Error('AppStaticLib.Layer5: Argument 2 is expected to be a String variable, with a value we will encode/decode based on the boolean 1st argument)');if(encode){return AppStaticLib._DoLayer5(searchText,openTagText,openTagText2,openTagText3,closeTagText,optionalTagText);}else{return AppStaticLib._UndoLayer5(searchText,openTagText,openTagText2,openTagText3,closeTagText);}},_UndoLayer5:function(searchText,openTagText,openTagText2,openTagText3,closeTagText){var start=-1;var before='';var after='';var end=-1;start=searchText.search(openTagText);while(start>-1){end=(start+openTagText.length);before=searchText.substr(0,start);after=searchText.substr(end);searchText=before+after;start=searchText.indexOf(closeTagText);if(start>-1){end=(start+closeTagText.length);before=searchText.substr(0,start);after=searchText.substr(end);searchText=before+after;}start=searchText.search(openTagText);}return searchText;},_DoLayer5:function(searchText,openTagText,openTagText2,openTagText3,closeTagText,optionalTagText){var emailPattern=/([\s'']|^)[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}(\.[a-zA-Z]{2})?(?=[.,\s''<]|$)/i;var emailPattern2=/(?:[\s'']|^)(["]?[^&]+(?:(?:<(' ')?)|("\s)))([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}(\.[a-zA-Z]{2})?(?:>)?)(?=[.,\s''<]|$)/i;var start=-1;var before='';var after='';var end=-1;var count=0;var currentEmail='';var untrimmedEmail='';var newText='';var modifier=0;start=searchText.search(emailPattern);while(start>-1){start++;untrimmedEmail=emailPattern.exec(searchText)[0];currentEmail=untrimmedEmail.trim();end=(start+currentEmail.length);modifier=0;if(currentEmail.length===untrimmedEmail.length){modifier=-1;}before=searchText.substr(0,(start+modifier));after=searchText.substr(end);newText=newText+before+openTagText+currentEmail+openTagText2+openTagText3+currentEmail+closeTagText;searchText=after;start=searchText.search(emailPattern);count++;}start=searchText.search(emailPattern2);searchText=newText+searchText;if(start>-1){start=searchText.search(emailPattern2);while(start>-1){untrimmedEmail=emailPattern2.exec(searchText)[0];currentEmail=untrimmedEmail.trim();end=(start+currentEmail.length);currentEmail=currentEmail.split(/(?:(?:<)|(?:"\s))/i);var emailAddress=currentEmail[1];emailAddress=emailAddress.replace('<','');emailAddress=emailAddress.replace('>','');var emailContactName=currentEmail[0];emailContactName=emailContactName.replace(/"/g,'');modifier=0;if(currentEmail.length===untrimmedEmail.length){modifier=-1;}before=searchText.substr(0,(start+modifier));after=searchText.substr(end);newText=newText+before+openTagText+emailAddress+openTagText2+optionalTagText+emailAddress+openTagText3+emailContactName+closeTagText;searchText=after;start=searchText.search(emailPattern2);count++;}searchText=newText+searchText;}return searchText;},IsAnApp:function(suspect){if(typeof(AppBase)==='undefined')return false;if(suspect instanceof(AppBase))return true;if(suspect===null)return false;if(typeof suspect!=='object')return false;if(typeof suspect.OnLoad!=='function')return false;if(typeof suspect.FormObjects!=='object')return false;if(typeof suspect.BindFormObjects!=='function')return false;return true;},IsControl:function(suspect){if(suspect===null)return false;if(typeof(suspect)!=='object')return false;if(typeof(window.Framework)!=='object')return false;if(typeof(window.FrameworkControls)!=='object')return false;if(typeof(window.Framework.Controls.AppButtonControl)!=='undefined'){if(suspect instanceof(window.Framework.Controls.AppButtonControl))return true;}if(typeof(window.Framework.Controls.AvailableSearch)!=='undefined'){if(suspect instanceof(window.Framework.Controls.AvailableSearch))return true;}if(typeof(window.Framework.Controls.DateControl)!=='undefined'){if(suspect instanceof(window.Framework.Controls.DateControl))return true;}if(typeof(window.Framework.Controls.EmailSelectControl)!=='undefined'){if(suspect instanceof(window.Framework.Controls.EmailSelectControl))return true;}if(typeof(window.Framework.Controls.FileSystem)!=='undefined'){if(suspect instanceof(window.Framework.Controls.FileSystem))return true;}if(typeof(window.Framework.Controls.FileUploadControl)!=='undefined'){if(suspect instanceof(window.Framework.Controls.FileUploadControl))return true;}if(typeof(window.Framwork.Controls.GridControl)!=='undefined'){if(suspect instanceof(window.Framwork.Controls.GridControl))return true;}if(typeof(window.Framework.Controls.HTMLControl)!=='undefined'){if(suspect instanceof(window.Framework.Controls.HTMLControl))return true;}if(typeof(IFrameControl)!=='undefined'){throw new Error(__METHOD__+' reports that the IFrameControl can no longer be tested this way on line '+__LINE__);}if(typeof(window.Framework.Controls.InvoiceEngine)!=='undefined'){if(suspect instanceof(window.Framework.Controls.InvoiceEngine))return true;}if(typeof(window.Framework.Controls.SelectBoxControl)!=='undefined'){if(suspect instanceof(window.Framework.Controls.SelectBoxControl))return true;}if(typeof(window.Framework.Controls.SelectBoxButtonControl)!=='undefined'){if(suspect instanceof(window.Framework.Controls.SelectBoxButtonControl))return true;}if(typeof(window.Framework.Controls.ServletTreeView)!=='undefined'){if(suspect instanceof(window.Framework.Controls.ServletTreeView))return true;}if(typeof(window.Framework.Controls.SmartGrid)!=='undefined'){if(suspect instanceof(window.Framework.Controls.SmartGrid))return true;}if(typeof(window.Framework.Controls.SuggestiveSearchControl)!=='undefined'){if(suspect instanceof(window.Framework.Controls.SuggestiveSearchControl))return true;}if(typeof(window.Framework.Controls.TabControl)!=='undefined'){if(suspect instanceof(window.Framework.Controls.TabControl))return true;}if(typeof(window.Framework.Controls.EmailControl)!=='undefined'){if(suspect instanceof(window.Framework.Controls.EmailControl))return true;}return false;},GetGridFromElement:function(element){var isAGrid=function(subject){if(typeof(subject)!=='object')return false;if(typeof(subject.GetControlName)!=='function')return false;return(subject.GetControlName()==='GridControl');};if((element===null)||(typeof(element)!=='object'))throw new Error('AppStaticLib can\'t GetGridFromElement from a non-object');if(isAGrid(element))return element;if((typeof(element.grid)!=='undefined')&&(isAGrid(element.grid)))return element.grid;if(typeof(element.StoredParent)!=='undefined')element=element.StoredParent;var parentApp=AppStaticLib.GetThisApp(element);return parentApp._controls.Grids[jQuery(element).parents('.gridContainer').attr('id')];},GetThisAppAndIgnoreTheseThings:function(element){var IgnoreIDs=['selenium-ide-indicator','ROMMissing','LoadingScreen','ID','ROMDebugInfo','ClassName','LoadingScreen','desktop','hovered','dialog-extend-fixed-container','themeSelector','ROMBuild'];var IgnoreClasses=['ClassName','ROMDebugInfo','ROMBlueScreen','cke','cke_panel_frame','CodeMirror-lint-tooltip','CodeMirror-hint','CodeMirror-hints','CodeMirror-lint-message-error','CodeMirror-lint-message-warning','ui-front','h1','notification','ui-widget-overlay'];var IgnoreMe=false;var count=0;for(count=0;((count=1)){IgnoreMe=true;break;}}}var parent=null;if(IgnoreMe!==true){try{parent=AppStaticLib.GetThisAppOf(element);}catch(err){parent=null;}}return parent;},GetThisApp:function(element){if(this.App){if(AppStaticLib.IsAnApp(this.App))return this.App;}if(AppStaticLib.IsAnApp(element))return element;return AppStaticLib.GetThisAppOf(element);},GetStructOf:function(element){var collection=AppStaticLib.GetCollectionOf(element);if(typeof collection==='undefined')return null;return collection.struct;},GetThisAppOf:function(element){if(typeof(jQuery(element)[0])==='undefined')throw new Error('Invalid element');if((element.length===0)||(typeof(jQuery(element)[0])==='undefined'))return null;if(jQuery(element)[0].tagName==='BODY')return null;if((element.type)&&(element.target)){element=element.target;}var collection=AppStaticLib.GetCollectionOf(element);if((typeof(collection)==='undefined')||(collection===null))return null;return collection.instance;},GetWindowOf:function(element){var elementsWindow='';if((typeof(element.length)==='number')&&(element.length>0)&&(typeof(element[0].nodeName)==='string')&&(typeof(element[0].nodeType)==='number'))element=element[0];if((typeof(element.AppDetails)!=='object')&&(document.body.contains(jQuery(element)[0])!==true)){if(document.body.contains(jQuery(element)[0].StoredParent)){element=element.StoredParent;}else{return null;}}if(element.parentElement===null){return null;}if(((typeof(element.parentElement)!=='undefined')&&(element.parentElement!==null))&&((element.id==='AppTopMenu')||(element.id==='AppBottomMenu')||(element.id==='AppLeftMenu')||(element.id==='AppRightMenu')||(element.parentElement.id==='AppTopMenu')||(element.parentElement.parentElement.id==='AppTopMenu')||(jQuery(element.parentElement).hasClass('ui-dialog'))||((element.parentElement.id==='AppBottomMenu')||(element.parentElement.parentElement.id==='AppBottomMenu'))||((element.parentElement.id==='AppLeftMenu')||(element.parentElement.parentElement.id==='AppLeftMenu'))||((element.parentElement.id==='AppRightMenu')||(element.parentElement.parentElement.id==='AppRightMenu'))||(jQuery(element).parents('.ui-dialog-titlebar').length===1)||(jQuery(element).parents('.WindowPosition').length)||(jQuery(element).parents('#AppTopMenu').length)||(jQuery(element).parents('#AppBottomMenu').length)||(jQuery(element).parents('#AppLeftMenu').length)||(jQuery(element).parents('#AppRightMenu').length))){var container=AppStaticLib.GetContainerOf(element);if(container.hasClass('containedapp'))return container;elementsWindow=container.children('.ui-dialog-content');if(elementsWindow.length===0){elementsWindow=container.children('.ui-dialog-inner').children('[instance]');}}else{if((jQuery(element).hasClass('ui-dialog-maximized'))||(jQuery(element).hasClass('ui-dialog-normal'))||(jQuery(element).hasClass('containedapp'))){elementsWindow=jQuery(element);}else{if(AppStaticLib.IsAnApp(element)){elementsWindow=jQuery(element.prop.popup);}else{if(jQuery(element).hasClass('ui-dialog')){elementsWindow=jQuery(element).children('[instance]');if(elementsWindow.length===0){elementsWindow=jQuery(element).children('.ui-dialog-inner').children('[instance]');}}else{elementsWindow=jQuery(element).parents('.containedapp');if(elementsWindow.length===0){elementsWindow=jQuery(element).parents('[instance]');if(elementsWindow.length===0){elementsWindow=jQuery(element).children('.ui-dialog-inner').children('[instance]');}}}}}}if(elementsWindow.length===0){if(StaticLib.Empty(element.id)===true)return null; /* jshint debug: true */ return null;}return elementsWindow;},GetContainerOf:function(element){if((element===null)||(typeof(element)==='undefined'))return null;var elementsWindow='';if((jQuery(element).hasClass('ui-dialog'))||(jQuery(element).hasClass('containedapp'))){elementsWindow=jQuery(element);return(elementsWindow.length===0)?null:elementsWindow;}if(element!==jQuery(element)[0])element=element[0];if(AppStaticLib.IsAnApp(element)){if(element.prop===null)return null;if(element.prop.handle===null)return null;elementsWindow=jQuery(element.prop.handle).parents('.ui-dialog');return(elementsWindow.length===0)?null:elementsWindow;}elementsWindow=jQuery(element).parents('.ui-dialog');if(elementsWindow.length===0){elementsWindow=jQuery(element).parents('.containedapp');}var temp=null;if(elementsWindow.length===0){temp=jQuery(element)[0];if(temp===null){ /* jshint debug: true */ return null;}if(typeof(temp)==='undefined')return null;if(temp.id==='AppTopMenu')elementsWindow=temp;else elementsWindow=jQuery(temp).parents('#AppTopMenu');if(elementsWindow.length!==0){if(jQuery(element)[0].id==='AppTopMenu')elementsWindow=jQuery(element);else elementsWindow=jQuery(element).parents('#AppTopMenu');temp=elementsWindow.parent().children('.ui-dialog');if(temp.length===0)elementsWindow=elementsWindow.parent().children('.AppContainer').children('.containedapp');else elementsWindow=temp;return(elementsWindow.length===0)?null:elementsWindow;}elementsWindow=jQuery(element).parents('#AppLeftMenu');if(elementsWindow.length!==0){if(jQuery(element)[0].id==='AppLeftMenu')elementsWindow=jQuery(element);else elementsWindow=jQuery(element).parents('#AppLeftMenu');temp=elementsWindow.parent().children('.ui-dialog');if(temp.length===0)elementsWindow=elementsWindow.parent().parent().children('.containedapp');else elementsWindow=temp;}if(elementsWindow.length===0){elementsWindow=jQuery(element).parents('#AppRightMenu');if(elementsWindow.length!==0){if(jQuery(element)[0].id==='AppRightMenu')elementsWindow=jQuery(element);else elementsWindow=jQuery(element).parents('#AppRightMenu');temp=elementsWindow.parent().parent().children('.ui-dialog');if(temp.length===0)elementsWindow=elementsWindow.parent().parent().children('.containedapp');else elementsWindow=temp;}}if(elementsWindow.length===0){elementsWindow=jQuery(element).parents('#AppBottomMenu');if(elementsWindow.length!==0){if(jQuery(element)[0].id==='AppBottomMenu')elementsWindow=jQuery(element);else elementsWindow=jQuery(element).parents('#AppBottomMenu');temp=elementsWindow.parent().children('.ui-dialog');if(temp.length===0)elementsWindow=elementsWindow.parent().children('.AppContainer').children('.containedapp');else elementsWindow=temp;}}}return(elementsWindow.length===0)?null:elementsWindow;},GetOuterWindowOf:function(element,getOutermost){if(typeof(element)==='undefined'){ /* jshint debug: true */ throw new Error(__METHOD__+' reports that the element is undefined on line '+__LINE__);}if(window.Framework.prop.developer)console.log(''+__METHOD__);if(getOutermost!==true)getOutermost=false;var elementsWindow='';if(jQuery(element).hasClass('ui-dialog-titlebar-close')){var container=WindowLib.GetContainerOf(element);elementsWindow=container.children('.ui-dialog-content');}else{if(jQuery(element).hasClass('ui-dialog-content')){elementsWindow=jQuery(element);}else{if(AppStaticLib.IsAnApp(element)){elementsWindow=jQuery(element.prop.handle);}else{elementsWindow=jQuery(element).parents('.containedapp');if(elementsWindow.length===0)elementsWindow=jQuery(element).parents('.ui-dialog-content');if(getOutermost===true){var depth=0;var temp=jQuery(elementsWindow);while((temp.length!==0)&&(depth<15)){depth++;temp=jQuery(elementsWindow).parents('.containedapp');if(temp.length!==0)elementsWindow=temp;}elementsWindow=elementsWindow.parents('.ui-dialog-content');}}}}if(elementsWindow.length===0){if(window.Framework.prop.developer){console.log('---WARNING: COULDN\'T FIND CONTEXT, RETURNING DOCUMENT--- for '+element[0].id);}return jQuery('html');}return elementsWindow;},GetCollectionOf:function(element){if(element.App){if(AppStaticLib.IsAnApp(element.App))element=element.App;}var elementsWindow=AppStaticLib.GetWindowOf(element);if(elementsWindow===null){return null;}if((elementsWindow.length===null)||(elementsWindow.length===0))return null;return window.Framework.prop.WindowCollection.items[elementsWindow.attr('id')];},SetupWhenReady:function(test,callThis,checkEvery){var obj={'test':test,'callThis':callThis,'checkEvery':checkEvery,'CheckIsReady':function(){if(this.test()===true){this.callThis();}else{setTimeout(jQuery.proxy(this.CheckIsReady,this),(this.checkEvery*1000));}}};obj.CheckIsReady();}};}var __EventRegister=[];function HasEvent(target,name,func){var e=null;for(var i=0;i<__EventRegister.length;i++){e=__EventRegister[i];if((target.id===e.target.id)&&(e.name===name)&&(e.func===func))return true;}return false;}function AddEvent(target,name,func,optionalArg,strict){var expected=__METHOD__+' expects a HTML object, name of event and the function to call';if(typeof(target)!=='object')throw new Error(expected);if((typeof(name)!=='string')||(name.length===0))throw new Error(expected);if(typeof(func)!=='function')throw new Error(expected);if(typeof(strict)!=='boolean')strict=true;var e=null;for(var i=0;i<__EventRegister.length;i++){e=__EventRegister[i];if((target.id===e.target.id)&&(e.name===name)&&(e.func===func)){if(strict===true)throw new Error(__METHOD__+' reports that the specified event ['+name+'] has already been registered for target ['+target.id+']');return;}}if((typeof(optionalArg)!=='undefined')&&(optionalArg!==null)){target.addEventListener(name,func,optionalArg);}else{target.addEventListener(name,func);}__EventRegister.push({target:target,name:name,func:func});}function RemoveEvent(target,name,func){var expected=__METHOD__+' expects a HTML object, name of event and the function to call';if(typeof(target)!=='object')throw new Error(expected);if((typeof(name)!=='string')||(name.length===0))throw new Error(expected);if(typeof(func)!=='function')throw new Error(expected);var e=null;for(var i=0;i<__EventRegister.length;i++){e=__EventRegister[i];if(!((target.id===e.target.id)&&(e.name===name)&&(e.func===func)))continue;target.removeEventListener(name,func);__EventRegister.splice(i,1);return;}throw new Error(__METHOD__+' reports that the specified event ['+name+'] was not found for element ['+target.id+']');}if(typeof(window.Framework)==='undefined'){window.Framework={};}if(typeof(window.Framework.Lib)==='undefined')window.Framework.Lib={};if(typeof(window.Framework.Controls)==='undefined')window.Framework.Controls={};window.sleep=function(secs){while(new Date()<(secs*1000)){}};window.propName=function(obj){var err=Error('PropName expects an object with EXACTLY one property on the object, to return as a name');if(obj===null)throw err;if(typeof(obj)!=='object')throw err;var allProps=Object.keys(obj);if(allProps.length!==1)throw err;return allProps[0];};function RuntimeError(message,method,lineNumber){var err=new Error();if(err.stack){if(typeof(Components)!=='undefined'){this.stack=err.stack.substring(err.stack.indexOf('\n')+1);}else if(typeof(chrome)!=='undefined'||typeof(process)!=='undefined'){this.stack=err.stack.replace(/\n[^\n]*/,'');}else{this.stack=err.stack;}}this.message=message===undefined?err.message:message;this.method=method===undefined?err.method:method;this.lineNumber=lineNumber===undefined?err.lineNumber:lineNumber;}RuntimeError.prototype=new Error();function CustomError(message,method,lineNumber){var err=new Error();if(err.stack){if(typeof(Components)!=='undefined'){this.stack=err.stack.substring(err.stack.indexOf('\n')+1);}else if(typeof(chrome)!=='undefined'||typeof(process)!=='undefined'){this.stack=err.stack.replace(/\n[^\n]*/,'');}else{this.stack=err.stack;}}this.message=message===undefined?err.message:message;this.method=method===undefined?err.method:method;this.lineNumber=lineNumber===undefined?err.lineNumber:lineNumber;}CustomError.prototype=new Error();var assert=function(expr){if(typeof(expr)!=='function')throw new Error('expr must be a value expression condition');var result=expr(); /*jshint -W087 */ /*jshint +W087 */ return result;};var assertall=function(msg){assert(function(){ /*jshint evil: true */ return eval('\n\n\n/*\n\n##################################################\nUser: everyone, you wanted to stop here for:\n'+msg+'\n##################################################\n\n\n*/'); /*jshint evil: false */ });};var assertgroup=function(name,desc,iffalse){if((typeof(name)!=='string')||(name.length===0))throw new Error(__METHOD__+' reports it needs a name to match upon as the first argument on line '+__LINE__);if(typeof(iffalse)!=='boolean')iffalse=true;if((typeof(window.Framework)==='object')&&(typeof(window.Framework.TaskID)==='undefined'))return false;if(typeof(desc)==='undefined')desc='##################################################\n# TASK ASSERT FOR YOU\n\nYou have not defined a message why you wanted to stop here\nGo back a couple of steps in your stack and provide a reason\n##################################################\n';if((desc.indexOf('/*')!==-1)||(desc.indexOf('*/')!==-1))throw new Error(__METHOD__+' reports that you have included a multiline comment in your message which is denied. Please remove your multiline comments.');if(assert(function(){return((name.toLocaleLowerCase()===window.Framework.TaskGroup)===true);})){ /* jshint evil: true */ return eval('\n\n\n/*\n\n#####################################################################################################\n\n ############# # ####### # #\n ## # # ## # ## \n ## # # ####### ### \n ## ####### ## # # \n ## # # ####### # # \n\nYour running task ['+window.Framework.TaskGroup+'] has an assert point here:\n'+desc+'\n##################################################\n\n\n*/'); /* jshint evil: false */ }return false;};var asserttask=function(TaskID,desc,iffalse){if(typeof(iffalse)!=='boolean')iffalse=true;if((typeof(window.Framework)==='object')&&(typeof(window.Framework.TaskID)==='undefined'))return false;if(typeof(desc)==='undefined')desc='##################################################\n# TASK ASSERT FOR YOU\n\nYou have not defined a message why you wanted to stop here\nGo back a couple of steps in your stack and provide a reason\n##################################################\n';if((desc.indexOf('/*')!==-1)||(desc.indexOf('*/')!==-1))throw new Error(__METHOD__+' reports that you have included a multiline comment in your message which is denied. Please remove your multiline comments.');if(assert(function(){return((TaskID===window.Framework.TaskID)===true);})){ /* jshint evil: true */ return eval('\n\n\n/*\n\n#####################################################################################################\n\n ############# # ####### # #\n ## # # ## # ## \n ## # # ####### ### \n ## ####### ## # # \n ## # # ####### # # \n\nYour running task ['+window.Framework.TaskID+'] has an assert point here:\n'+desc+'\n##################################################\n\n\n*/'); /* jshint evil: false */ }return false;};var assertuser=function(username,msg,iffalse,name,group){if(typeof(iffalse)!=='boolean')iffalse=true;if(typeof(name)!=='string')name='';if(typeof(group)!=='string')group='';if((typeof(window.Framework)==='object')&&(StaticLib.Empty(window.Framework.prop)!==true)&&(StaticLib.Empty(window.Framework.prop.CurrentUser)!==true)&&(StaticLib.Empty(window.Framework.prop.CurrentUser.Name)!==true))return false;if(typeof(msg)==='undefined')msg='##################################################\n# ASSERT FOR YOU\n\nYou have not defined a message why you wanted to stop here\nGo back a couple of steps in your stack and provide a reason\n##################################################\n';if((msg.indexOf('/*')!==-1)||(msg.indexOf('*/')!==-1))throw new Error(__METHOD__+' reports that you have included a multiline comment in your message which is denied. Please remove your multiline comments.');if(assert(function(){return!((typeof(window.Framework)!=='undefined')&&(window.Framework.prop.CurrentUser!==null)&&(window.Framework.prop.CurrentUser.Name.toLowerCase()===username.toLowerCase()));})){ /* jshint evil: true */ return eval('\n\n\n/*\n\n##################################################\nUser: '+username+', you wanted to stop here for:\n'+msg+'\n##################################################\n\n\n*/'); /* jshint evil: false */ }return false;};var assertdaniel=function(msg,iffalse,name,group){return assertuser('admin',msg,iffalse,name,group);};var assertadmin=assertdaniel;var assertvivek=function(msg,iffalse,name,group){return assertuser('Vivek Modi',msg,iffalse,name,group);};var assertian=function(msg,iffalse,name,group){return assertuser('ian',msg,iffalse,name,group);};var _ProcessStack=function(e){var result={name:null,line:null,pos:null,all:null,className:null,method:null,stack:null};if((typeof(e)==='undefined')||(e===null)||(typeof(e.stack)==='undefined'))return result;e=e.stack.split(/\n/);var found=false;var isSafari=true;var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('safari')!==-1)isSafari=false;var re=null;for(var i=0;i.toString (')===-1)continue;e=e[(i+1)];found=true;break;}else if(isSafari===true){found=true;break;}}if(!found)e=e[2];if(typeof(e)==='undefined')return; /* jshint -W049: true */ re=/^\s+at\s+(\w+\.\w+)\s.*\:([0-9]+):([0-9]+).*/g; /* jshint +W049: false */ var temp=null;if(isSafari!==true){temp=e.replace(re,'$1');result.name=temp.substring((temp.indexOf('.')+1));result.line=e.replace(re,'$2');result.pos=e.replace(re,'$3');result.all=e.replace(re,'Function: $1 on line $2 at pos $3');result.className=temp.substring(0,temp.indexOf('.'));result.method=result.className+'.'+result.name;result.stack=e;}else if(isSafari===true){re=/^(\w+)@https:\/\/.*:([0-9]+):([0-9]+)$/g;result.name=e[1].replace(re,'$1');result.line=e[1].replace(re,'$2');result.pos=e[1].replace(re,'$3');result.className='unknown';result.method='Safari.'+result.name;result.stack=e;}return result;};var _GetFunctionDetails=function(type){if(typeof(Error)==='undefined')return'Not available';var expected='_GetFunctionDetails reports required \'type\' was not specified. Valid types are [1: name, 2: line, 3: pos, 4: all, 5: class, 6: method, 7: stack]';if(typeof(type)==='undefined')throw new Error(expected);if(typeof(type)==='string')type=type.toLowerCase();var e=new Error();if(typeof(null)==='undefined')return'unknown';var result=_ProcessStack(e);switch(type){case 1:case'name':{return result.name;}case 2:case'line':{var value=result.line;var match=value.match(/^\s*at\s+([$\w]+).*?:(\d+):\d+/);var output=match?match[1]+':'+match[2]:'';return output;}case 3:case'pos':{return result.pos;}case 4:case'all':{return result.all;}case 5:case'class':{return result.className;}case 6:case'method':{return result.method;}case 7:case'stack':{return result.stack;}default:{throw new Error(expected);}}};function macro(name,retFunc,funcArgs){if((typeof(name)!=='string')||(name.length===0))throw new Error('macro expects the first argument to be the name of the macro you want to create');if((typeof(retFunc)!=='function')||(name.length===0))throw new Error('macro expects the second argument to be a function you want the return value to be');if(typeof(window[name])!=='undefined')throw new Error('Macro already exists for '+name);if(typeof(funcArgs)==='undefined')funcArgs=null;var z=jQuery.proxy(function(){return this.func(this.arg);},{func:retFunc,arg:funcArgs});window[name]={};Object.defineProperty(window[name],'name',{get:function(){return z();}});window[name].toString=function(){return z();};}macro('__FUNCTION__',_GetFunctionDetails,1);macro('__LINE__',_GetFunctionDetails,2);macro('__POS__',_GetFunctionDetails,3);macro('__ALL__',_GetFunctionDetails,4);macro('__CLASS__',_GetFunctionDetails,5);macro('__METHOD__',_GetFunctionDetails,6);macro('__STACK__',_GetFunctionDetails,7);var StaticLib={GetRandom:function(min,max){return Math.random()*(max-min)+min;},CompareVersions:function(versionStr1,versionStr2){var errMsg='CompareVersions expects 2 string arguments, both of which are version-strings [0.0.0] for example';if(typeof(versionStr1)!=='string')throw new Error(errMsg);if(typeof(versionStr2)!=='string')throw new Error(errMsg);versionStr1=versionStr1.split('.');versionStr2=versionStr2.split('.');if((versionStr1.length!==3)||(versionStr1.length!==3))throw new Error(errMsg);if(parseInt(versionStr1[0])===parseInt(versionStr2[0])){if(parseInt(versionStr1[1])===parseInt(versionStr2[1])){if(parseInt(versionStr1[2])===parseInt(versionStr2[2]))return 0;if(parseInt(versionStr1[2])');this.obj.attr('disabled',true);window.setTimeout(this.undo,3500);this.func(event);},GetContextOfDialog:function(item){var handle=null;var subject=jQuery(item);if(subject.hasClass('.ui-dialog-normal')){handle=subject;}else{handle=subject.parents('.ui-dialog-normal');}if(handle.length===0)return null;var obj=window.Framework.prop.WindowCollection.items[handle.attr('id')];if((typeof(obj)==='undefined')||(obj===null))return null;return window.Framework.prop.WindowCollection.items[handle.attr('id')].instance;},SelectElementText:function(el){StaticLib.UI.RemoveTextSelections();var range;if(document.selection){range=document.body.createTextRange();range.moveToElementText(el);range.select();}else if(window.getSelection){range=document.createRange();range.selectNode(el);window.getSelection().addRange(range);}},RemoveTextSelections:function(){if(document.selection)document.selection.empty();else if(window.getSelection)window.getSelection().removeAllRanges();},isFullScreen:false,ToggleFullscreen:function(){if(StaticLib.UI.isFullScreen){StaticLib.UI.ExitFullscreen();}else{StaticLib.UI.LaunchFullscreen();}},LaunchFullscreen:function(){var element=document.documentElement;if(typeof(element.webkitRequestFullscreen)==='function'){element.webkitRequestFullscreen();}else if(typeof(element.requestFullscreen)==='function'){element.requestFullscreen();}else if(typeof(element.mozRequestFullScreen)==='function'){element.mozRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);}else if(typeof(element.msRequestFullscreen)==='function'){element.msRequestFullscreen();}},ExitFullscreen:function(){if(document.fullscreenElement!==null){if(document.exitFullscreen){document.exitFullscreen();}else if(document.mozCancelFullScreen){document.mozCancelFullScreen();}else if(document.webkitExitFullscreen){document.webkitExitFullscreen();}else if(document.msExitFullscreen){document.msExitFullscreen();}}}},HasSameKeys:function(array1,array2){var keys1=Object.keys(array1);var keys2=Object.keys(array2);keys1.sort();keys2.sort();var missing=[];var extra=[];var offset=0;for(var count=0;count\&]/gim,function(i){return'&#'+i.charCodeAt(0)+';';});},EscapeAttribute:function(rawStr){rawStr=StaticLib.EscapeHtml(rawStr);if((typeof(rawStr)!=='string')||(rawStr===''))return rawStr;rawStr=rawStr.replace('"','"');rawStr=rawStr.replace('\'',''');return rawStr;},StripJS:function(content,silent){if(typeof(content)!=='string')throw new Error('.StripJS expects a single string argument. ("'+typeof(content)+'" received instead)');var onEvents=new RegExp('[\\s]on[a-zA-z]+[\\s]*=[\\s]*[\\"\\\']','i');var equalsPos=-1;var seperator='';var errorCount=0;var index=content.search(onEvents);while(index!==-1){errorCount++;equalsPos=content.indexOf('=',index);seperator=content.substr((equalsPos+1),1);content=StaticLib.StripBetween(content,index,(content.indexOf(seperator,(equalsPos+2))+1));index=content.search(onEvents);}var otherEvents=new RegExp('(animationend|animationiteration|animationstart|transitionend)[\\s]*=[\\s]*[\\"\\\']','i');index=content.search(otherEvents);while(index!==-1){errorCount++;equalsPos=content.indexOf('=',index);seperator=content.substr((equalsPos+1),1);content=StaticLib.StripBetween(content,index,(content.indexOf(seperator,(equalsPos+2))+1));index=content.search(otherEvents);}index=content.search('';while(index!==-1){errorCount++;content=StaticLib.StripBetween(content,index,(content.indexOf(seperator,index)+1));index=content.search('
'+errorCount+' instances were found and removed (this includes event attributes such as OnClick)

Please note that including JS in your HTML is a potential vulnerability, any functionality that can be produced by embedding code can be produced correctly by having it executed by the associated app.';if(typeof(window.Framework)!=='undefined'){if(errorCount>0){if(typeof(silent)==='function'){silent({title:'Developer Error A227',message:errMsg,modal:true});}else{if((window.Framework.prop.developer)&&(silent!==true)){window.Framework.UI.MsgBox({title:'Developer Error A228',message:errMsg,modal:true});}}}}return content;},StripBetween:function(content,start,end){return content.substring(0,start)+content.substring(end);},StartsWith:function(needle,haystack){var h=haystack;if(typeof(haystack)!=='string')h=String(h);return(h.startsWith(needle));},EndsWith:function(needle,haystack){var h=haystack;var n=needle;if(typeof(haystack)!=='string')h=String(h);if(typeof(needle)!=='string')n=String(n);if(n.length>h.length)return false;return(haystack.substring(h.length-n.length)===needle);},ReformatDateString:function(fromformat,toformat,value){return StaticLib.DateFormat(toformat,StaticLib.FormatIntoDate(fromformat,value));},GetFinancialYear:function(dateObj){var err='StaticLib.DateFormat() expects it\'s second argument to be a Date object';var monthCutoff=6;var dayCutoff=1;if(typeof(dateObj)!=='object'){throw new Error(err);}else{if(!(dateObj instanceof Date)){throw new Error(err);}}var start=dateObj.getFullYear();if(start===new Date().getFullYear()){return'NOW';}if((dateObj.getMonth()11)throw new Error('Month cannot be larger than 12');if(index<0)throw new Error('Month cannot be smaller than 1');isset=true;newDate.setMonth(index);}if(typeof(valueArray.M)!=='undefined'){index=shortMonthNames.indexOf(valueArray.M);if(index===-1)throw new Error('Month name\''+valueArray.M+'\' was not found');isset=true;newDate.setMonth(index);if(newDate.getMonth()!==index)newDate.setMonth(index);}if(typeof(valueArray.d)!=='undefined'){index=Number(valueArray.d);if(index>31)throw new Error('Day cannot be larger than 31');if(index<0)throw new Error('Day cannot be smaller than 1');isset=true;newDate.setDate(index);}if(typeof(valueArray.j)!=='undefined'){index=Number(valueArray.j);if(index>31)throw new Error('Day cannot be larger than 31');if(index<1)throw new Error('Day cannot be smaller than 1');isset=true;newDate.setDate(index);}if(typeof(valueArray.Y)!=='undefined'){isset=true;newDate.setFullYear(Number(valueArray.Y));}if(typeof(valueArray.y)!=='undefined'){var year=new Date().getFullYear().toString();var yearCutoff=Number(year.substr((year.length-2),2))+3;var currentCentury=Number(year.substr(0,2));var temp=valueArray.y;if(Number(temp)>yearCutoff){temp=(parseInt(currentCentury)-1)+temp;}else{temp=parseInt(currentCentury)+temp;}isset=true;newDate.setFullYear(Number(temp));}if(typeof(valueArray.h)!=='undefined'){index=Number(valueArray.h);if((value.indexOf('AM')!==-1)&&(index===0))index=12;if(index>12)throw new Error('12-Hour cannot be larger than 12');if(index<1)throw new Error('12-Hour cannot be smaller than 1');if(index===12){if(value.indexOf('AM')!==-1){isset=true;newDate.setHours(0);}else if(value.indexOf('PM')!==-1){isset=true;newDate.setHours(12);}else throw new Error('12-hour format expects an AM or a PM within');}else if(value.indexOf('AM')!==-1){isset=true;newDate.setHours(index);}else if(value.indexOf('PM')!==-1){isset=true;newDate.setHours(index+12);}else throw new Error('12-hour format expects an AM or a PM within');}if(typeof(valueArray.H)!=='undefined'){index=Number(valueArray.H);if(index>23)throw new Error('24-Hour cannot be larger than 23');if(index<0)throw new Error('24-Hour cannot be smaller than 0');isset=true;newDate.setHours(index);}if(typeof(valueArray.i)!=='undefined'){index=Number(valueArray.i);if(index>59)throw new Error('Minutes cannot be larger than 59');if(index<0)throw new Error('Minutes cannot be smaller than 0');isset=true;newDate.setMinutes(Number(valueArray.i));}if(typeof(valueArray.s)!=='undefined'){if((value.indexOf('AM')!==-1)||(value.indexOf('PM')!==-1)){valueArray.s=valueArray.s.replace('AM','');valueArray.s=valueArray.s.replace('PM','');}index=Number(valueArray.s);if(index>59)throw new Error('Seconds cannot be larger than 59');if(index<0)throw new Error('Seconds cannot be smaller than 0');isset=true;newDate.setSeconds(Number(valueArray.s));}if(isset){return newDate;}return null;},DateFormat:function(format,dateObj){var err='StaticLib.DateFormat() expects it\'s second argument to be a Date object';if(typeof(dateObj)!=='object'){throw new Error(err);}else{if(!(dateObj instanceof Date)){throw new Error(err);}}if(typeof(format)!=='string'){throw new Error('StaticLib.DateFormat() expects it\'s first argument to be a format string');}function getDayOfWeek(dateIs){switch(dateIs.getDay()){case 0:{return'Sunday';}case 1:{return'Monday';}case 2:{return'Tuesday';}case 3:{return'Wednesday';}case 4:{return'Thursday';}case 5:{return'Friday';}case 6:{return'Saturday';}default:{throw new Error('There was an error processing the date in StaticLib.DateFormat()');}}}function getMonthName(dateIs){switch((dateIs.getMonth()+1)){case 1:{return'January';}case 2:{return'Febuary';}case 3:{return'March';}case 4:{return'April';}case 5:{return'May';}case 6:{return'June';}case 7:{return'July';}case 8:{return'August';}case 9:{return'September';}case 10:{return'October';}case 11:{return'November';}case 12:{return'December';}default:{throw new Error('There was an error processing the date in StaticLib.DateFormat()');}}}function getDaysInMonth(dateIs){switch((dateIs.getMonth()+1)){case 1:case 3:case 5:case 7:case 8:case 10:case 12:{return 31;}case 4:case 6:case 9:case 11:{return 30;}case 2:{if(isLeapYear(dateIs)){return 29;}return 28;}default:{throw new Error('There was an error processing the date in StaticLib.DateFormat()');}}}function getMeridian(dateIs){var hour=dateIs.getHours();if(hour>=12)return'pm';return'am';}function isLeapYear(dateIs){var year=dateIs.getFullYear();if((year&3)!==0)return false;return((year%100)!==0||(year%400)===0);}function twelveHourTime(dateIs){var hour=dateIs.getHours();if(hour>12)return(hour-12);return hour;}function getNumTh(dateIs){switch(dateIs.getDate()){case 1:{return'st';}case 2:{return'nd';}case 3:{return'rd';}default:{return'th';}}}var temp=format;var temp2=[];var indexOf=-1;for(var i=0;i\\-\\&])','g'),'\\$&'),(ignore?'gi':'g')),(typeof(str2)==='string')?str2.replace(new RegExp('\$','g'),'$$$$'):str2);},IsBase64:function(value){return/^[a-zA-Z0-9/+]*={0,2}$/.test(value);},IsMobile:function(){return window.matchMedia('(max-width: 767px)').matches;},IsTablet:function(){var ua=navigator.userAgent.toLowerCase();if(/ipad|tablet|playbook|silk|kindle/.test(ua)||(/android/.test(ua)&&!/mobile/.test(ua))){return true;}var width=Math.min(window.screen.width,window.screen.height);return(navigator.maxTouchPoints>0&&width>=600&&width<1024);},GuessMimeType:function(fileName){var extension=fileName.toLowerCase();var type='';while(extension.indexOf('.')!==-1){extension=extension.substring(extension.indexOf('.')+1);}switch(extension){case'csv':{return'text/csv';}case'txt':{return'text/plain';}case'zip':{return'application/zip';}case'7z':{return'application/x-7z-compressed';}case'tar':{return'application/x-tar';}case'gz':{return'application/gzip';}case'gif':{return'image/gif';}case'jpg':case'jpeg':{return'image/jpeg';}case'bmp':{return'image/bmp';}case'png':{return'image/png';}case'svg':{return'image/svg+xml';}case'tif':case'tiff':{return'image/tiff';}case'xls':{return'application/vnd.ms-excel';}case'xlsx':{return'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';}case'docxs':{return'application/vnd.openxmlformats-officedocument.wordprocessingml.document';}case'ppts':{return'application/vnd.ms-powerpoint';}case'pptxs':{return'application/vnd.openxmlformats-officedocument.presentationml.presentation';}case'odps':{return'application/vnd.oasis.opendocument.presentation';}case'odss':{return'application/vnd.oasis.opendocument.spreadsheet';}case'odts':{return'application/vnd.oasis.opendocument.text';}case'docs':{return'application/msword';}case'pdfs':{return'application/pdf';}}return type;},GetValues:function(start){if((window.GetValueLookup===null)||(typeof(window.GetValueLookup)==='undefined')){window.GetValueLookup=[];window.GetValueOrig=[];}if((window.GetValueDepth===null)||(typeof(window.GetValueDepth)==='undefined'))window.GetValueDepth=0;window.GetValueDepth++;var returnObj={};var temp=null;if(StaticLib.IsPropStructInstance(start)){temp=start.GetValue();}else{temp=start;}if(temp===null)return null;if(typeof(temp)!=='object'){window.GetValueDepth--;return temp;}if(temp instanceof Date){window.GetValueDepth--;return temp;}if(AppStaticLib.IsAnApp(temp)){window.GetValueDepth--;return temp;}if((temp===null)||(typeof(temp)==='undefined')){window.GetValueDepth--;return null;}if(typeof(temp.length)!=='undefined')returnObj=[];var keys=[];if(StaticLib.IsPropBaseInstance(start)){var pos=window.GetValueLookup.indexOf(start);if(pos!==-1){window.GetValueDepth--;return window.GetValueOrig[pos];}window.GetValueLookup.push(start);window.GetValueOrig.push(returnObj);keys=start.GetPropList();}else{keys=Object.keys(temp);}for(var i=0;i0)values=values+',';if(useStrKeys)values=values+'"'+keys[count]+'":';values=values+StaticLib.JsonEncode(data[keys[count]]);}return values+end;}else return JSON.stringify(data);},MapLookup:function(data){this.data=data;this.replace=function(value){if(typeof(this.data[value])==='undefined')return value;else return this.data[value];};this.replaceAll=function(struct){var keys=Object.keys(struct);var length=keys.length;for(var i=0;iplaces1)power=places2;if(power===0)return val1*val2;power=Math.pow(10,power);var IntegerMultiply=(Math.round(val1*power)*Math.round(val2*power));var newValue=(IntegerMultiply/(power*power));var newValueString=newValue.toString();if(newValueString.indexOf('e')!==-1)newValueString=newValueString.split('+e')[0];if(newValueString.indexOf('.')!==-1){var newValueDecimalPlace=newValueString.split('.')[1];if(parseFloat(newValueString).toString()!==newValueString)return val1*val2;if(newValueDecimalPlace.length>10){if(parseFloat(newValueDecimalPlace.slice(-5))<10)return parseFloat(newValueString.substring(0,(newValueString.length-3)));}}return newValue;},PreciseDivide:function(val1,val2){if((typeof(val1)!=='number')||(typeof(val2)!=='number'))throw new Error('StaticLib.Math.PreciseDivide() expects it\'s arguments to be numbers'); /* jshint debug: true */ var places1=0;var places2=0;var power=0;if(Math.floor(val1)!==val1)places1=val1.toString().split('.')[1].length;if(Math.floor(val2)!==val2)places2=val2.toString().split('.')[1].length;power=places1;if(places2>places1)power=places2;var oldDivide=val1/val2;if(power===0)return oldDivide;var oldDivideString=oldDivide.toString();if(new RegExp('^0+[0-9]$').test(oldDivideString.split('.')[1]))return Math.round(oldDivide);power=Math.pow(10,power);var newDivide=(Math.round(val1*power)/Math.round(val2*power));if(newDivide.toString().length>oldDivideString.length)return oldDivide;return newDivide;},StringAdd:function(val1,val2){if((typeof(val1)!=='string')||(typeof(val2)!=='string'))throw new Error('StaticLib.Math.StringAdd() expects it\'s arguments to be strings');var len1=val1.length;var len2=val2.length;var pos1=val1.indexOf('.');var pos2=val2.indexOf('.');var AfterLength1=0;var BeforeLength1=len1;if(pos2!==-1){if(pos1===-1){pos1=len1;val1=val1+'.';}}if(pos1!==-1){BeforeLength1=pos1;AfterLength1=(len1-pos1);if(pos2===-1){pos2=len2;val2=val2+'.';len2++;}}var AfterLength2=0;var BeforeLength2=len2;if(pos2!==-1){BeforeLength2=pos2;AfterLength2=(len2-pos2);}while(AfterLength2>AfterLength1){val1=val1+'0';AfterLength1++;len1++;}while(AfterLength1>AfterLength2){val2=val2+'0';AfterLength2++;}while(BeforeLength2>BeforeLength1){val1='0'+val1;len1++;BeforeLength1++;}while(BeforeLength1>BeforeLength2){val2='0'+val2;BeforeLength2++;}if((val1[0]!=='0')&&(val2[0]!=='0')){val1='0'+val1;val2='0'+val2;len1++;}var carryThe=0;var value=0;var newVal='';var index=(len1-1);while(index>=0){if(val1[index]==='.'){index--;newVal='.'+newVal;continue;}value=parseInt(val1[index])+parseInt(val2[index])+carryThe;carryThe=0;if(value>=10){carryThe=Math.floor(value/10);value=value-(carryThe*10);}index--;if((index>0)||(value>0))newVal=value.toString()+newVal;}return newVal;},RoundNumber:function(value,minPlaces,maxPlaces){return Number(StaticLib.Math.Round(value,minPlaces,maxPlaces));},Round:function(value,minPlaces,maxPlaces){if(typeof(minPlaces)==='undefined'){minPlaces=2;}if(typeof(maxPlaces)==='undefined'){maxPlaces=minPlaces;}var orgValue=value;if(value<0)value=(value*-1);var index=-1;var temp=value.toString();index=temp.indexOf('e');if(index!==-1){var places=temp.substring(index+1);places=parseFloat(places);temp=temp.substring(0,index);index=temp.indexOf('.');temp=temp.slice(0,index)+temp.slice(index+1);while(places!==0){if(places>0){if(index1){index++;}else{temp='0'+temp;}places++;}}if(index!==temp.length)temp=temp.slice(0,index)+'.'+temp.slice(index);}index=temp.indexOf('.');var roundUpUntil=maxPlaces+index;var stopRoundingAt=minPlaces+index;if((stopRoundingAt>=temp.length)||(index===-1))return orgValue.toFixed(minPlaces);temp=temp.split('');temp.splice(index,1);var i=0;if(stopRoundingAt>=temp.length){i=(stopRoundingAt-1);}else{temp[stopRoundingAt]=Number(temp[stopRoundingAt]);i=stopRoundingAt;}var newTemp=[];for(i=i;i>=0;i--){if(i>0)temp[(i-1)]=Number(temp[(i-1)]);if(i>=roundUpUntil){if(temp[i]>4)temp[i-1]++;temp=temp.splice(0,roundUpUntil);}else{if(temp[i]>=10){temp[i]-=10;if(i>0){temp[i-1]++;}else{temp.splice(0,0,1);index++;}}}newTemp[i]=temp[i];}if((minPlaces>0)||((maxPlaces>0)&&(index!==-1)))newTemp.splice(index,0,'.');if(orgValue<0)newTemp.splice(0,0,'-');return newTemp.join('');},formatCurrency:function(val,decPlaces,symbol,decSeparator,seperateEvery,separator){if(val===null)return'N/A';if((typeof(symbol)==='undefined')||(symbol===null)){symbol='$';}else if(typeof(symbol)!=='string'){throw new Error('StaticLib.Math.formatCurrency expects argument 2 to be a string, the currency symbol to use');}if(val<0){symbol='-'+symbol;val=val*-1;}return symbol+StaticLib.Math.formatMoney(val,decPlaces,decSeparator,seperateEvery,separator);},formatMoney:function(val,decPlaces,decSeparator,seperateEvery,separator){if(val===null)return'N/A';if((typeof(decPlaces)==='undefined')||(decPlaces===null)){decPlaces=2;}else if(typeof(decPlaces)!=='number'){throw new Error('StaticLib.Math.formatMoney expects argument 2 to be a number, the number of allowed decimal places');}if((typeof(decSeparator)==='undefined')||(decSeparator===null)){decSeparator='.';}else if(typeof(decSeparator)!=='string'){throw new Error('StaticLib.Math.formatMoney expects argument 3 to be a string, the string or character used to seperate a number from it\'s decimals.');}if((typeof(seperateEvery)==='undefined')||(seperateEvery===null)){seperateEvery=3;}else if(typeof(seperateEvery)!=='number'){throw new Error('StaticLib.Math.formatMoney expects argument 4 to be a number, the number of characters to allow before inserting a seperator');}if((typeof(separator)==='undefined')||(separator===null)){separator=',';}else if(typeof(separator)!=='string'){throw new Error('StaticLib.Math.formatMoney expects argument 5 to be a string, the string or character used to seperate long numbers.');}val=StaticLib.Math.Round(val*1,decPlaces,decPlaces);if(seperateEvery<=0)return val;var SeperatorTool=new RegExp('(\\d)(?=(\\d{'+seperateEvery+'})+(?!\\d))','g');var parts=val.toString().split(decSeparator);val=parts[0].replace(SeperatorTool,'$1'+separator);if(parts[1])val=val+decSeparator+parts[1];return val;}},Compare:function(ObjA,ObjB){if((ObjA===null)||(typeof(a)==='undefined')){if(ObjA===ObjB)return true;return false;}var aProps=Object.keys(ObjA);var bProps=Object.keys(ObjB);if(aProps.length!==bProps.length)return false;var propName='';var value=null;for(var i=0;i0){StaticLib.SetModal('gridbox',{title:'Data Errors found',message:'Data errors have been detected whilst loading.',messageAfter:'You should review your data source',Grid:{DataForBinding:dataErrors,ColLayout:[{Caption:'Property',Name:'key',NeverWrap:true,ColDataType:window.Framework.Enum.Controls.Grid.ColDataTypes.STRING},{Caption:'Error',Name:'error',ColDataType:window.Framework.Enum.Controls.Grid.ColDataTypes.STRING}]}});}}},Crypto:{md5:{lib:{md5cycle:function(x,k){var a=x[0],b=x[1],c=x[2],d=x[3];a=StaticLib.Crypto.md5.lib.ff(a,b,c,d,k[0],7,-680876936);d=StaticLib.Crypto.md5.lib.ff(d,a,b,c,k[1],12,-389564586);c=StaticLib.Crypto.md5.lib.ff(c,d,a,b,k[2],17,606105819);b=StaticLib.Crypto.md5.lib.ff(b,c,d,a,k[3],22,-1044525330);a=StaticLib.Crypto.md5.lib.ff(a,b,c,d,k[4],7,-176418897);d=StaticLib.Crypto.md5.lib.ff(d,a,b,c,k[5],12,1200080426);c=StaticLib.Crypto.md5.lib.ff(c,d,a,b,k[6],17,-1473231341);b=StaticLib.Crypto.md5.lib.ff(b,c,d,a,k[7],22,-45705983);a=StaticLib.Crypto.md5.lib.ff(a,b,c,d,k[8],7,1770035416);d=StaticLib.Crypto.md5.lib.ff(d,a,b,c,k[9],12,-1958414417);c=StaticLib.Crypto.md5.lib.ff(c,d,a,b,k[10],17,-42063);b=StaticLib.Crypto.md5.lib.ff(b,c,d,a,k[11],22,-1990404162);a=StaticLib.Crypto.md5.lib.ff(a,b,c,d,k[12],7,1804603682);d=StaticLib.Crypto.md5.lib.ff(d,a,b,c,k[13],12,-40341101);c=StaticLib.Crypto.md5.lib.ff(c,d,a,b,k[14],17,-1502002290);b=StaticLib.Crypto.md5.lib.ff(b,c,d,a,k[15],22,1236535329);a=StaticLib.Crypto.md5.lib.gg(a,b,c,d,k[1],5,-165796510);d=StaticLib.Crypto.md5.lib.gg(d,a,b,c,k[6],9,-1069501632);c=StaticLib.Crypto.md5.lib.gg(c,d,a,b,k[11],14,643717713);b=StaticLib.Crypto.md5.lib.gg(b,c,d,a,k[0],20,-373897302);a=StaticLib.Crypto.md5.lib.gg(a,b,c,d,k[5],5,-701558691);d=StaticLib.Crypto.md5.lib.gg(d,a,b,c,k[10],9,38016083);c=StaticLib.Crypto.md5.lib.gg(c,d,a,b,k[15],14,-660478335);b=StaticLib.Crypto.md5.lib.gg(b,c,d,a,k[4],20,-405537848);a=StaticLib.Crypto.md5.lib.gg(a,b,c,d,k[9],5,568446438);d=StaticLib.Crypto.md5.lib.gg(d,a,b,c,k[14],9,-1019803690);c=StaticLib.Crypto.md5.lib.gg(c,d,a,b,k[3],14,-187363961);b=StaticLib.Crypto.md5.lib.gg(b,c,d,a,k[8],20,1163531501);a=StaticLib.Crypto.md5.lib.gg(a,b,c,d,k[13],5,-1444681467);d=StaticLib.Crypto.md5.lib.gg(d,a,b,c,k[2],9,-51403784);c=StaticLib.Crypto.md5.lib.gg(c,d,a,b,k[7],14,1735328473);b=StaticLib.Crypto.md5.lib.gg(b,c,d,a,k[12],20,-1926607734);a=StaticLib.Crypto.md5.lib.hh(a,b,c,d,k[5],4,-378558);d=StaticLib.Crypto.md5.lib.hh(d,a,b,c,k[8],11,-2022574463);c=StaticLib.Crypto.md5.lib.hh(c,d,a,b,k[11],16,1839030562);b=StaticLib.Crypto.md5.lib.hh(b,c,d,a,k[14],23,-35309556);a=StaticLib.Crypto.md5.lib.hh(a,b,c,d,k[1],4,-1530992060);d=StaticLib.Crypto.md5.lib.hh(d,a,b,c,k[4],11,1272893353);c=StaticLib.Crypto.md5.lib.hh(c,d,a,b,k[7],16,-155497632);b=StaticLib.Crypto.md5.lib.hh(b,c,d,a,k[10],23,-1094730640);a=StaticLib.Crypto.md5.lib.hh(a,b,c,d,k[13],4,681279174);d=StaticLib.Crypto.md5.lib.hh(d,a,b,c,k[0],11,-358537222);c=StaticLib.Crypto.md5.lib.hh(c,d,a,b,k[3],16,-722521979);b=StaticLib.Crypto.md5.lib.hh(b,c,d,a,k[6],23,76029189);a=StaticLib.Crypto.md5.lib.hh(a,b,c,d,k[9],4,-640364487);d=StaticLib.Crypto.md5.lib.hh(d,a,b,c,k[12],11,-421815835);c=StaticLib.Crypto.md5.lib.hh(c,d,a,b,k[15],16,530742520);b=StaticLib.Crypto.md5.lib.hh(b,c,d,a,k[2],23,-995338651);a=StaticLib.Crypto.md5.lib.ii(a,b,c,d,k[0],6,-198630844);d=StaticLib.Crypto.md5.lib.ii(d,a,b,c,k[7],10,1126891415);c=StaticLib.Crypto.md5.lib.ii(c,d,a,b,k[14],15,-1416354905);b=StaticLib.Crypto.md5.lib.ii(b,c,d,a,k[5],21,-57434055);a=StaticLib.Crypto.md5.lib.ii(a,b,c,d,k[12],6,1700485571);d=StaticLib.Crypto.md5.lib.ii(d,a,b,c,k[3],10,-1894986606);c=StaticLib.Crypto.md5.lib.ii(c,d,a,b,k[10],15,-1051523);b=StaticLib.Crypto.md5.lib.ii(b,c,d,a,k[1],21,-2054922799);a=StaticLib.Crypto.md5.lib.ii(a,b,c,d,k[8],6,1873313359);d=StaticLib.Crypto.md5.lib.ii(d,a,b,c,k[15],10,-30611744);c=StaticLib.Crypto.md5.lib.ii(c,d,a,b,k[6],15,-1560198380);b=StaticLib.Crypto.md5.lib.ii(b,c,d,a,k[13],21,1309151649);a=StaticLib.Crypto.md5.lib.ii(a,b,c,d,k[4],6,-145523070);d=StaticLib.Crypto.md5.lib.ii(d,a,b,c,k[11],10,-1120210379);c=StaticLib.Crypto.md5.lib.ii(c,d,a,b,k[2],15,718787259);b=StaticLib.Crypto.md5.lib.ii(b,c,d,a,k[9],21,-343485551);x[0]=StaticLib.Crypto.md5.lib.add32(a,x[0]);x[1]=StaticLib.Crypto.md5.lib.add32(b,x[1]);x[2]=StaticLib.Crypto.md5.lib.add32(c,x[2]);x[3]=StaticLib.Crypto.md5.lib.add32(d,x[3]);},cmn:function(q,a,b,x,s,t){a=StaticLib.Crypto.md5.lib.add32(StaticLib.Crypto.md5.lib.add32(a,q),StaticLib.Crypto.md5.lib.add32(x,t));return StaticLib.Crypto.md5.lib.add32((a<>>(32-s)),b);},ff:function(a,b,c,d,x,s,t){return StaticLib.Crypto.md5.lib.cmn((b&c)|((~b)&d),a,b,x,s,t);},gg:function(a,b,c,d,x,s,t){return StaticLib.Crypto.md5.lib.cmn((b&d)|(c&(~d)),a,b,x,s,t);},hh:function(a,b,c,d,x,s,t){return StaticLib.Crypto.md5.lib.cmn(b^c^d,a,b,x,s,t);},ii:function(a,b,c,d,x,s,t){return StaticLib.Crypto.md5.lib.cmn(c^(b|(~d)),a,b,x,s,t);},md51:function(s){if(new RegExp('[\x80-\xFF]').test(s)){s=unescape(encodeURI(s));}var n=s.length,state=[1732584193,-271733879,-1732584194,271733878],i;for(i=64;i<=s.length;i+=64){StaticLib.Crypto.md5.lib.md5cycle(state,StaticLib.Crypto.md5.lib.md5blk(s.substring(i-64,i)));}s=s.substring(i-64);var tail=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(i=0;i>2]|=s.charCodeAt(i)<<((i%4)<<3);tail[i>>2]|=0x80<<((i%4)<<3);if(i>55){StaticLib.Crypto.md5.lib.md5cycle(state,tail);for(i=0;i<16;i++)tail[i]=0;}tail[14]=n*8;StaticLib.Crypto.md5.lib.md5cycle(state,tail);return state;},md5blk:function(s){var md5blks=[],i;for(i=0;i<64;i+=4){md5blks[i>>2]=s.charCodeAt(i)+(s.charCodeAt(i+1)<<8)+(s.charCodeAt(i+2)<<16)+(s.charCodeAt(i+3)<<24);}return md5blks;},hex_chr:'0123456789abcdef'.split(''),rhex:function(n){var s='',j=0;for(;j<4;j++){s+=StaticLib.Crypto.md5.lib.hex_chr[(n>>(j*8+4))&0x0F]+StaticLib.Crypto.md5.lib.hex_chr[(n>>(j*8))&0x0F];}return s;},hex:function(x){for(var i=0;i=0);},IsNumeric:function(value,optStrict,optCurrency){if(typeof(optCurrency)==='undefined')optCurrency='Dollar';if(typeof(optStrict)==='undefined')optStrict=false;if(typeof(optStrict)!=='boolean')throw new Error('Strict must be set to Boolean type: True or False');if((optCurrency==='AUD')||(optCurrency==='USD'))optCurrency='Dollar';if(typeof(value)==='number')return true;if(StaticLib.Empty(value))return false;if(typeof(value)!=='string')return false;value=value.replace(/^-\$|^\+\$|^\$|^-|^\+/,'');switch(optCurrency){case'Dollar':{var afterDec=' + ';if(!optStrict)afterDec='*';var test='^[0-9]{1,3}(\,[0-9]{3})+(\.[0-9]'+afterDec+')?$';if(new RegExp(test).test(value))value=value.replace(new RegExp('\,','g'),'');break;}default:{throw new Error('Currency not implemented ['+optCurrency+']');}}if(new RegExp('[^0-9\.]').test(value))return false;var index=value.indexOf('.');if(index>=0){if((optStrict)&&(index===(value.length-1)))return false;if(value.split('.').length>2)return false;return true;}return true;},SetJSONArray:function(jsonData){if((typeof(jsonData)==='undefined')||(StaticLib.Empty(jsonData)))return null;if((typeof(jsonData)!=='object')&&(!StaticLib.IsJSONString(jsonData))){window.Framework.UI.MsgBox({title:'Error',message:'Grid.BuildTableRows(jsonData) is not a valid JSON format',modal:false});return null;}if(typeof(jsonData)==='string'){if(jsonData.length<9)return null;if(!StaticLib.IsJSONArray(jsonData))jsonData='['+jsonData+']';}else if(typeof(jsonData)==='object'){if((jsonData.length)||(jsonData.length>0))return jsonData;var arrayConstructor=[].constructor;if(jsonData.constructor!==arrayConstructor){var t=[];t.push(jsonData);jsonData=t;}}return jsonData;},IsJSONArray:function(str){try{if((typeof(str)==='object')&&(str.length))return true;if((typeof(str)==='string')&&(str.length<2))return false;if((str.substr(0,1)!=='[')||(str.substr((str.length-1),1)!==']'))return false;JSON.parse(str);return true;}catch(e){return false;}return false;},IsJSONString:function(str){if(typeof(str)!=='string')return false;if(str.length===0)return false;try{JSON.parse(str);}catch(e){return false;}return true;},mobilecheck:function(){return jQuery.browser.mobile;},escapeHTML:function(t){return jQuery('
').text(t).html();},escapeAttr:function(t){var txt=StaticLib.escapeHTML(t);var htmlEscapes={'&':'&','<':'<','>':'>','"':'"','\'':''','/':'/'};var htmlEscaper=new RegExp('[&<>"\'\/]','g');return txt.replace(htmlEscaper,function(match){return htmlEscapes[match];});},ObjectToInt:function(obj,unsigned,def){if(obj===null)return def;if(typeof(unsigned)==='undefined')unsigned=false;if(typeof(def)==='undefined')def=0;var val=def;if(typeof(obj)==='number'){val=obj;}else{if(parseInt(obj)){val=parseInt(obj);}}if(unsigned){if(val<0)return def;}return val;},ObjectToFloat:function(obj,unsigned,def){if(typeof(def)==='undefined')def=0;if(typeof(unsigned)==='undefined')unsigned=false;if(obj===null)return def;var val=def;if(typeof(obj)==='number'){val=obj;}else{if(parseFloat(obj)){val=parseFloat(obj);}else{return def;}}if(unsigned){if(val<0)return def;}return val;},StringToFloat:function(obj,thouSeparator){var value=String(obj).replace(new RegExp('[^-0-9\.]+','g'),'');return StaticLib.ObjectToFloat(value,false,0);},ObjectToPercentage:function(obj){var value=StaticLib.StringToFloat(obj);return value+'%';},ObjectToCurrency:function(obj,decimalPlaces){decimalPlaces=(typeof(decimalPlaces)!=='undefined')?decimalPlaces:2;var floatValue=StaticLib.ObjectToFloat(obj,false,0);var firstChar=(''+floatValue).substring(0,1);if(firstChar==='-'){return'-$'+floatValue.formatMoney().replace('-','');}else{return'$'+floatValue.formatMoney();}},BytesToSize:function(bytes,decimals){if(bytes===0)return'0 Bytes';var k=1000;var dm=decimals+1||3;var sizes=['Bytes','KB','MB','GB','TB','PB','EB','ZB','YB'];var i=Math.floor(Math.log(bytes)/Math.log(k));return(bytes/Math.pow(k,i)).toPrecision(dm)+' '+sizes[i];},Empty:function(obj){if(obj===null)return true;if(typeof(obj)==='undefined')return true;if(typeof(obj)==='object'){if(obj instanceof jQuery){if(obj.length===0)return true;return false;}if(!Array.isArray(obj))return false;if(obj.length!==Object.keys(obj).length)return false;}if(typeof(obj)==='boolean')return false;if(typeof(obj)==='number')return false;if(typeof(obj)==='function')return false;return(obj.length>0)?false:true;},ObjectToBoolean:function(obj){if(typeof(obj)==='undefined')return false;if(obj===null)return false;if(typeof(obj)==='boolean')return obj;if(typeof obj==='number')return(obj>0)?true:false;if(typeof obj==='string'){if(obj.toLowerCase()==='true')return true;if(obj.toLowerCase()==='false')return false;if(obj.toLowerCase()==='yes')return true;if(obj.toLowerCase()==='no')return false;if(obj.toLowerCase()==='y')return true;if(obj.toLowerCase()==='n')return false;if(obj.toLowerCase()==='1')return true;if(obj.toLowerCase()==='0')return false;if(obj.toLowerCase()==='')return false;}if(obj.length===0)return false;return false;},IsBoolean:function(bool){if(typeof(bool)==='boolean'){return true;}else{return false;}},IsString:function(str){if(str===undefined)return false;if(typeof(str)!=='string')return false;return true;},IsFloat:function(value,unsigned){if((typeof(unsigned)==='boolean')&&(unsigned===true)&&(Number(value)<0))return false;return((value===Number(value))&&((value%1)!==0));},IsInt:function(n,unsigned){unsigned=((unsigned===undefined)&&(!StaticLib.ObjectToBoolean(unsigned)))?false:unsigned;if(isNaN(n))return false;if((unsigned)&&(n<0))return false;return true;},IsHTMLElement:function(o){return((typeof(window.HTMLElement)==='object')?((o instanceof window.HTMLElement)===true):((o)&&(typeof(o)==='object')&&(o!==null)&&(o.nodeType===1)&&(typeof o.nodeName==='string')));},GetPropsList:function(data){var keys=null;if(StaticLib.IsPropBaseInstance(data)){keys=data.GetPropList();}else{keys=Object.keys(data);}return keys;},IsPropBaseInstance:function(obj){if(typeof(window.Framework.Lib)==='undefined')return false;if(typeof(window.Framework.Lib.PropsBaseV3)==='undefined')return false;if(obj===null)return false;if(typeof(obj)==='undefined')return false;if(!obj.constructor)return false;if(obj.constructor===Function)return false;if(obj.constructor===String)return false;if(obj.constructor===Boolean)return false;if(obj.constructor===Number)return false;if(obj.constructor===Object)return false;if(obj.constructor===Array)return false;if(obj.constructor===Date)return false;if(obj instanceof window.Framework.Lib.PropsBaseV3)return true;if(typeof(window.AppBase)!=='undefined'){if(obj instanceof window.AppBase)return false;}if(obj.constructor===window.Framework.Lib.PropStruct)return false;if(obj.constructor===window.Framework.Lib.PropsBaseV3)return true;if(obj.constructor===window.BaseType)return false;if(StaticLib.IsHTMLElement(obj))return false;if(obj.constructor.prototype)return StaticLib.IsPropStructInstance(obj.constructor.prototype);},IsPropStructInstance:function(obj){if(obj===null)return false;if(typeof(obj)==='undefined')return false;if(!obj.constructor)return false;if(obj.constructor===Function)return false;if(obj.constructor===String)return false;if(obj.constructor===Boolean)return false;if(obj.constructor===Number)return false;if(obj.constructor===Object)return false;if(obj.constructor===Array)return false;if(obj.constructor===Date)return false;if(obj instanceof window.Framework.Lib.PropsBaseV3)return false;if(typeof(window.AppBase)!=='undefined'){if(obj instanceof window.AppBase)return false;}if(obj.constructor===window.Framework.Lib.PropStruct)return true;if(obj.constructor===window.BaseType)return false;if(StaticLib.IsHTMLElement(obj))return false;if(obj.constructor.prototype){if(obj.constructor.prototype===obj)return false;return StaticLib.IsPropStructInstance(obj.constructor.prototype);}},isDisabled:function(formItem){if(typeof(formItem)==='undefined')return;formItem=jQuery(formItem);return formItem.is(':disabled');},disableItem:function(formItem){if(typeof(formItem)==='undefined')return;formItem=jQuery(formItem);var ref=formItem.tagName;if(typeof(ref)==='undefined'){if(formItem.length===0)return;ref=formItem.get(0).tagName;}switch(ref){case'A':formItem.addClass('disabled');break;default:formItem.prop('disabled',true);break;}},markButtonLoading:function(formItem){formItem=jQuery(formItem);StaticLib.disableItem(formItem);formItem.addClass('btn-loading');formItem.prepend('');},unmarkButtonLoading:function(formItem){formItem=jQuery(formItem);StaticLib.enableItem(formItem);formItem.removeClass('btn-loading');formItem.find('.progress-icon').remove();},markInputLoading:function(formItem){formItem=jQuery(formItem);if(formItem.hasClass('element-loading')){return;}formItem.addClass('element-loading');var html='
';formItem.after(html);},unmarkInputLoading:function(formItem){formItem=jQuery(formItem);formItem.removeClass('element-loading');formItem.next('.element-loading-container').remove();},enableItem:function(formItem){if(typeof(formItem)==='undefined')return;if(formItem.length===0)return;formItem=jQuery(formItem);switch(formItem.get(0).tagName){case'A':{formItem.removeClass('disabled');break;}default:{formItem.prop('disabled',false);break;}}},componentToHex:function(c){var hex=c.toString(16);return hex.length===1?'0'+hex:hex;},rgbToHex:function(r,g,b){return StaticLib.componentToHex(r)+StaticLib.componentToHex(g)+StaticLib.componentToHex(b);},combineFunctions:function(func1,func2){var type1=typeof(func1);var type2=typeof(func2);var handler=function(){};if(type1!=='function'){if(type2==='function')return func2;return handler;}else{if(type2!=='function')return func1;return jQuery.proxy(function(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9){this.func1(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);this.func2(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);},{func1:func1,func2:func2});}}};Number.prototype.formatMoney=function(decPlaces,thouSeparator,decSeparator){var n=this;return n.formatUI(decPlaces,thouSeparator,decSeparator);};Number.prototype.formatUI=function(decPlaces,thouSeparator,decSeparator){var n=this;decPlaces=isNaN(decPlaces=Math.abs(decPlaces))?2:decPlaces;decSeparator=decSeparator===undefined?'.':decSeparator;thouSeparator=thouSeparator===undefined?',':thouSeparator;var sign=n<0?'-':'';var i=parseInt(n=Math.abs(+n||0).toFixed(decPlaces))+'';var j=(j=i.length)>3?j%3:0;return sign+(j?i.substr(0,j)+thouSeparator:'')+i.substr(j).replace(new RegExp('(\d{3})(?=\d)','g'),'$1'+thouSeparator)+(decPlaces?decSeparator+Math.abs(n-i).toFixed(decPlaces).slice(2):'');};StaticLib.DeepFreeze(StaticLib);StaticLib.DeepSeal(StaticLib);