-
Notifications
You must be signed in to change notification settings - Fork 13
/
minCCL.js
1 lines (1 loc) · 322 KB
/
minCCL.js
1
function getlowcomp(b){if(b>0){var a=Math.floor(b/2),c=a.toString(16);if(c.length<2){return"0"+c}return c}return"00"}function gethighcomp(b){if(b<255){var a=b+Math.floor(((255-b)/2));if(a<=16){return"0"+a.toString(16)}return a.toString(16)}return"FF"}function canvasGetOffsetLeft(a){var b=0;if(a.offsetParent){do{b+=((parseInt(a.offsetLeft)>=0||parseInt(a.offsetLeft)<0)&&parseInt(a.offsetLeft).toString()==a.offsetLeft.toString()?a.offsetLeft:0)}while(a=a.offsetParent);return b}}function canvasGetOffsetTop(b){var a=0;if(b.offsetParent){do{a+=((parseInt(b.offsetTop)>=0||parseInt(b.offsetTop)<0)&&parseInt(b.offsetTop).toString()==b.offsetTop.toString()?b.offsetTop:0)}while(b=b.offsetParent);return a}}function drawEllipse(m,j,i,k,d){var g=0.5522848;var c=(k/2)*g,a=(d/2)*g,l=j+k,f=i+d,e=j+k/2,b=i+d/2;m.beginPath();m.moveTo(j,b);m.bezierCurveTo(j,b-a,e-c,i,e,i);m.bezierCurveTo(e+c,i,l,b-a,l,b);m.bezierCurveTo(l,b+a,e+c,f,e,f);m.bezierCurveTo(e-c,f,j,b+a,j,b);m.closePath()}var canvases=new Array();var ctxs=new Array();var windows=new Array();var windowCount=0;var highestDepth=0;var clickFunctions=new Array();var doubleClickFunctions=new Array();var dragFunctions=new Array();var dragEndFunctions=new Array();var dragEnterFunctions=new Array();var dragLeaveFunctions=new Array();var dragOverFunctions=new Array();var dragStartFunctions=new Array();var dropFunctions=new Array();var mouseDownFunctions=new Array();var mouseMoveFunctions=new Array();var mouseOutFunctions=new Array();var mouseOverFunctions=new Array();var mouseUpFunctions=new Array();var mouseWheelFunctions=new Array();var scrollFunctions=new Array();var windowDrawFunctions=new Array();var windowIdWithFocus=new Array();var modalWindows=new Array();var hiddenWindows=new Array();var gotFocusFunctions=new Array();var lostFocusFunctions=new Array();var keyPressFunctions=new Array();var keyDownFunctions=new Array();var doingClickEvent=0;var doingMouseUp=0;var doingMouseDown=0;var doingEventForWindowID=-1;var intervalID=-1;var windowWithAnimationCount=new Array();var suspendDraw=0;var sessionID=null;var donotredaw=null;function animatedDraw(){for(var a=0;a<windowWithAnimationCount.length;a++){var b=getWindowProps(windowWithAnimationCount[a].CanvasID,windowWithAnimationCount[a].WindowID);if(b){invalidateRect(windowWithAnimationCount[a].CanvasID,null,b.X,b.Y,b.Width,b.Height)}}}function registerAnimatedWindow(c,a){for(var b=0;b<windowWithAnimationCount.length;b++){if(windowWithAnimationCount[b].CanvasID==c&&windowWithAnimationCount[b].WindowID==a){if(intervalID==-1){intervalID=setInterval(animatedDraw,20)}return}}windowWithAnimationCount.push({CanvasID:c,WindowID:a});intervalID=setInterval(animatedDraw,20)}function unregisterAnimatedWindow(d,a){for(var b=0;b<windowWithAnimationCount.length;b++){if(windowWithAnimationCount[b].CanvasID==d&&windowWithAnimationCount[b].WindowID==a){windowWithAnimationCount.splice(b,1);break}}var c=0;for(var b=0;b<windowWithAnimationCount.length;b++){if(windowWithAnimationCount[b].CanvasID==d){c=1;break}}if(!c){clearInterval(intervalID)}}function doesWindowHaveFocus(c,a){for(var b=0;b<windowIdWithFocus.length;b++){if(windowIdWithFocus[b][0]==c&&windowIdWithFocus[b][1]==a){return 1}}return 0}function correctEvent(b,c){c=c||window.event;var a=document.getElementById(b);if(c.pageX||c.pageY){c.calcX=c.pageX-canvasGetOffsetLeft(a);c.calcY=c.pageY-canvasGetOffsetTop(a)}else{if(c.clientX||c.clientY){c.calcX=c.clientX+document.body.scrollLeft+document.documentElement.scrollLeft-canvasGetOffsetLeft(a);c.calcY=c.clientY+document.body.scrollTop+document.documentElement.scrollTop-canvasGetOffsetTop(a)}}return c}function pointEvent(j,v,A,a,c){A=correctEvent(v,A);var m=A.calcX;var l=A.calcY;var g=0;var C=new Array();var h=0;for(var B=0;B<=highestDepth;B++){for(var t=0;t<windows.length;t++){if(windows[t].ParentWindowID==a&&checkIfModalWindow(v,windows[t].WindowCount)==1&&checkIfHiddenWindow(v,windows[t].WindowCount)==0&&windows[t].CanvasID==v&&windows[t].Depth==B&&m>=windows[t].X&&m<=windows[t].X+windows[t].Width&&l>=windows[t].Y&&l<=windows[t].Y+windows[t].Height){doingEventForWindowID=windows[t].WindowCount;if(doingClickEvent==1||doingMouseUp==1||doingMouseDown==1){var n=0;g=1;for(var s=0;s<windowIdWithFocus.length;s++){if(windowIdWithFocus[s][0]==v&&windowIdWithFocus[s][1]!=windows[t].WindowCount&&windowIdWithFocus[s][1]!=-1){n=1;for(var z=0;z<lostFocusFunctions.length;z++){if(lostFocusFunctions[z][0]==v&&lostFocusFunctions[z][1]==windowIdWithFocus[s][1]&&lostFocusFunctions[z][1]!=windows[t].WindowCount){lostFocusFunctions[z][2](v,windowIdWithFocus[s][1]);if(!donotredaw){C.push(lostFocusFunctions[z][1])}}}windowIdWithFocus[s][1]=windows[t].WindowCount;for(var z=0;z<gotFocusFunctions.length;z++){if(gotFocusFunctions[z][0]==v&&gotFocusFunctions[z][1]==windowIdWithFocus[s][1]){gotFocusFunctions[z][2](v,windowIdWithFocus[s][1]);if(!donotredaw){C.push(gotFocusFunctions[z][1])}}}h=1}else{if(windowIdWithFocus[s][0]==v&&windowIdWithFocus[s][1]==windows[t].WindowCount){n=1}}}if(n==0){setFocusToWindowID(v,windows[t].WindowCount);for(var z=0;z<gotFocusFunctions.length;z++){if(gotFocusFunctions[z][0]==v&&gotFocusFunctions[z][1]==windows[t].WindowCount&&windowIdWithFocus[s][1]!=-1){gotFocusFunctions[z][2](v,windows[t].WindowCount);if(!donotredaw){C.push(gotFocusFunctions[z][1])}}}h=1}}for(var o=0;o<j.length;o++){if(j[o][0]==windows[t].WindowCount){if(windows[t].ChildWindowIDs&&windows[t].ChildWindowIDs.length>0){if(pointEvent(j,v,A,windows[t].WindowCount,c)!=1){j[o][1](v,windows[t].WindowCount,A)}}else{j[o][1](v,windows[t].WindowCount,A)}if(!donotredaw&&windows[t]){invalidateRect(v,null,windows[t].X,windows[t].Y,windows[t].Width,windows[t].Height);if(windows[t].ControlType=="ScrollBar"){var b=getScrollBarProps(v,windows[t].WindowCount);var r=getWindowProps(v,b.OwnedByWindowID);if(r){invalidateRect(v,null,r.X,r.Y,r.Width,r.Height);if(b.DrawFunction){b.DrawFunction(v,windows[t].WindowCount)}else{drawScrollBar(v,windows[t].WindowCount)}}}}if(windows[t]&&windows[t].ControlType!="TextBox"&&c!=1){if(A.preventDefault){A.preventDefault()}A.returnValue=false}}}return 1}}}for(var B=0;B<=highestDepth;B++){for(var t=0;t<windows.length;t++){if(windows[t].ParentWindowID==a&&checkIfModalWindow(v,windows[t].WindowCount)==0&&checkIfHiddenWindow(v,windows[t].WindowCount)==0&&windows[t].CanvasID==v&&windows[t].Depth==B&&m>=windows[t].X&&m<=windows[t].X+windows[t].Width&&l>=windows[t].Y&&l<=windows[t].Y+windows[t].Height){doingEventForWindowID=windows[t].WindowCount;if(doingClickEvent==1||doingMouseUp==1||doingMouseDown==1){var n=0;g=1;for(var s=0;s<windowIdWithFocus.length;s++){if(windowIdWithFocus[s][0]==v&&windowIdWithFocus[s][1]!=windows[t].WindowCount&&windowIdWithFocus[s][1]!=-1){n=1;for(var z=0;z<lostFocusFunctions.length;z++){if(lostFocusFunctions[z][0]==v&&lostFocusFunctions[z][1]==windowIdWithFocus[s][1]&&lostFocusFunctions[z][1]!=windows[t].WindowCount){lostFocusFunctions[z][2](v,windowIdWithFocus[s][1]);if(!donotredaw){C.push(lostFocusFunctions[z][1])}}}windowIdWithFocus[s][1]=windows[t].WindowCount;for(var z=0;z<gotFocusFunctions.length;z++){if(gotFocusFunctions[z][0]==v&&gotFocusFunctions[z][1]==windowIdWithFocus[s][1]){gotFocusFunctions[z][2](v,windowIdWithFocus[s][1]);if(!donotredaw){C.push(gotFocusFunctions[z][1])}}}h=1}else{if(windowIdWithFocus[s][0]==v&&windowIdWithFocus[s][1]==windows[t].WindowCount&&windowIdWithFocus[s][1]!=-1){n=1}}}if(n==0){setFocusToWindowID(v,windows[t].WindowCount);for(var z=0;z<gotFocusFunctions.length;z++){if(gotFocusFunctions[z][0]==v&&gotFocusFunctions[z][1]==windows[t].WindowCount){gotFocusFunctions[z][2](v,windows[t].WindowCount);if(!donotredaw){C.push(gotFocusFunctions[z][1])}}}h=1}}for(var o=0;o<j.length;o++){if(j[o][0]==windows[t].WindowCount){if(windows[t].ChildWindowIDs&&windows[t].ChildWindowIDs.length>0){doingEvent=0;if(pointEvent(j,v,A,windows[t].WindowCount,c)!=1){j[o][1](v,windows[t].WindowCount,A)}}else{j[o][1](v,windows[t].WindowCount,A)}if(!donotredaw&&windows[t]){invalidateRect(v,null,windows[t].X,windows[t].Y,windows[t].Width,windows[t].Height);if(windows[t].ControlType=="ScrollBar"){var b=getScrollBarProps(v,windows[t].WindowCount);var r=getWindowProps(v,b.OwnedByWindowID);if(r){invalidateRect(v,null,r.X,r.Y,r.Width,r.Height);if(b.DrawFunction){b.DrawFunction(v,windows[t].WindowCount)}else{drawScrollBar(v,windows[t].WindowCount)}}}}if(windows[t]&&windows[t].ControlType!="TextBox"&&c!=1){if(A.preventDefault){A.preventDefault()}A.returnValue=false}}}return 1}}}if(g==1){return 1}if(doingClickEvent==1||doingMouseUp==1||doingMouseDown==1){for(var p=0;p<windowIdWithFocus.length;p++){if(windowIdWithFocus[p][0]==v){doingEventForWindowID=-1;for(var z=0;z<lostFocusFunctions.length;z++){if(lostFocusFunctions[z][0]==v&&lostFocusFunctions[z][1]==windowIdWithFocus[p][1]&&windowIdWithFocus[p][1]!=-1){lostFocusFunctions[z][2](v,windowIdWithFocus[p][1]);if(!donotredaw){C.push(lostFocusFunctions[z][1])}}}windowIdWithFocus[p][1]=-1;h=1}}}if(h==1&&!donotredaw){for(var t=0;t<C.length;t++){var w=getWindowProps(v,C[t]);if(w){invalidateRect(v,null,w.X,w.Y,w.Width,w.Height)}}}donotredaw=null;return 0}function setFocusToWindowID(c,a){for(var b=0;windowIdWithFocus.length;b++){if(windowIdWithFocus[b][0]==c){windowIdWithFocus[b][1]=a;return}}windowIdWithFocus.push([c,a])}function canvasOnClick(b,a){doingClickEvent=1;pointEvent(clickFunctions,b,a);doingClickEvent=0}function canvasOnDblClick(b,a){pointEvent(doubleClickFunctions,b,a)}function canvasOnDrag(b,a){pointEvents(dragFunctions,b,a)}function canvasOnDragEnd(b,a){pointEvent(dragEndFunctions,b,a)}function canvasOnDragEnter(b,a){pointEvent(dragEnterFunctions,b,a)}function canvasOnDragLeave(b,a){pointEvent(dragLeaveFunctions,b,a)}function canvasOnDragOver(b,a){pointEvent(dragOverFunctions,b,a)}function canvasOnDragStart(b,a){pointEvent(dragStartFunctions,b,a)}function canvasOnDrop(b,a){pointEvent(dropFunctions,b,a)}function canvasOnMouseDown(b,a){doingMouseDown=1;pointEvent(mouseDownFunctions,b,a);doingMouseDown=0}function canvasOnMouseMove(b,a){pointEvent(mouseMoveFunctions,b,a)}function canvasOnMouseOut(b,a){pointEvent(mouseOutFunctions,b,a)}function canvasOnMouseOver(b,a){pointEvent(mouseOverFunctions,b,a)}function canvasOnMouseUp(b,a){doingMouseUp=1;pointEvent(mouseUpFunctions,b,a);doingMouseUp=0}function canvasOnMouseWheel(b,a){pointEvent(mouseWheelFunctions,b,a)}function canvasOnScroll(b,a){pointEvent(scrollFunctions,b,a)}function registerCanvasElementId(b){var a=document.getElementById(b);canvases.push([b,a]);ctxs.push([b,a.getContext("2d")]);a.onclick=function(c){canvasOnClick(b,c)};a.ondblclick=function(c){canvasOnDblClick(b,c)};a.addEventListener("ondrag",function(c){canvasOnDrag(b,c)});a.addEventListener("ondragend",function(c){canvasOnDragEnd(b,c)});a.addEventListener("ondragenter",function(c){canvasOnDragEnter(b,c)});a.addEventListener("ondragleave",function(c){canvasOnDragLeave(b,c)});a.addEventListener("ondragover",function(c){canvasOnDragOver(b,c)});a.addEventListener("ondragstart",function(c){c.dataTransfer.setData("text/plain","Dragging");canvasOnDragStart(b,c)});a.addEventListener("ondrop",function(c){canvasOnDrop(b,c)});a.onkeypress=function(f){for(var d=0;d<keyPressFunctions.length;d++){for(var c=0;c<windowIdWithFocus.length;c++){if(windowIdWithFocus[c][0]==keyPressFunctions[d].CanvasID&&windowIdWithFocus[c][1]==keyPressFunctions[d].WindowID){keyPressFunctions[d].KeyPressFunction(keyPressFunctions[d].CanvasID,keyPressFunctions[d].WindowID,f);var g=getWindowProps(keyPressFunctions[d].CanvasID,keyPressFunctions[d].WindowID);if(g){invalidateRect(keyPressFunctions[d].CanvasID,null,g.X,g.Y,g.Width,g.Height)}if(f.preventDefault){f.preventDefault()}f.returnValue=false}}}return false};a.onkeydown=function(n){for(var g=0;g<keyDownFunctions.length;g++){for(var d=0;d<windowIdWithFocus.length;d++){if(n.keyCode==9){var o=getWindowProps(windowIdWithFocus[d][0],windowIdWithFocus[d][1]);if(o.CanvasID==keyDownFunctions[g].CanvasID&&o.WindowCount==keyDownFunctions[g].WindowID){if(o.ControlType!="WordProcessor"){var m=0;for(var c=0;c<windows.length;c++){if(windows[c].WindowCount!=o.WindowCount&&o.TabStopIndex+1==windows[c].TabStopIndex){m=1;windowIdWithFocus[d][1]=windows[c].WindowCount;for(var l=0;l<lostFocusFunctions.length;l++){if(lostFocusFunctions[l][0]==o.CanvasID&&lostFocusFunctions[l][1]==o.WindowCount&&lostFocusFunctions[l][1]!=windows[c].WindowCount){lostFocusFunctions[l][2](b,o.WindowCount)}}for(var l=0;l<gotFocusFunctions.length;l++){if(gotFocusFunctions[l][0]==o.CanvasID&&gotFocusFunctions[l][1]==windows[c].WindowCount){gotFocusFunctions[l][2](b,windows[c].WindowCount)}}var h=getCanvas(windows[c].CanvasID);invalidateRect(windows[c].CanvasID,null,0,0,h.width,h.height);if(n.preventDefault){n.preventDefault()}n.returnValue=false;return false}}if(m==0){if(o.TabStopIndex!=1){for(var c=0;c<windows.length;c++){if(windows[c].WindowCount!=o.WindowCount&&windows[c].TabStopIndex==1){m=1;windowIdWithFocus[d][1]=windows[c].WindowCount;for(var l=0;l<lostFocusFunctions.length;l++){if(lostFocusFunctions[l][0]==o.CanvasID&&lostFocusFunctions[l][1]==o.WindowCount&&lostFocusFunctions[l][1]!=windows[c].WindowCount){lostFocusFunctions[l][2](o.CanvasID,o.WindowCount)}}for(var l=0;l<gotFocusFunctions.length;l++){if(gotFocusFunctions[l][0]==o.CanvasID&&gotFocusFunctions[l][1]==windows[c].WindowCount){gotFocusFunctions[l][2](b,windows[c].WindowCount)}}var h=getCanvas(windows[c].CanvasID);invalidateRect(windows[c].CanvasID,null,0,0,h.width,h.height);if(n.preventDefault){n.preventDefault()}n.returnValue=false;return false}}}}}}else{if(o.MultiWindowControlsMainWindowId!=null&&o.MultiWindowControlsMainWindowId>=0){o=getWindowProps(o.CanvasID,o.MultiWindowControlsMainWindowId);if(o.CanvasID==keyDownFunctions[g].CanvasID&&o.WindowCount==keyDownFunctions[g].WindowID){if(o.ControlType!="WordProcessor"){var m=0;for(var c=0;c<windows.length;c++){if(windows[c].WindowCount!=o.WindowCount&&o.TabStopIndex+1==windows[c].TabStopIndex){m=1;windowIdWithFocus[d][1]=windows[c].WindowCount;for(var l=0;l<lostFocusFunctions.length;l++){if(lostFocusFunctions[l][0]==o.CanvasID&&lostFocusFunctions[l][1]==o.WindowCount&&lostFocusFunctions[l][1]!=windows[c].WindowCount){lostFocusFunctions[l][2](b,o.WindowCount)}}for(var l=0;l<gotFocusFunctions.length;l++){if(gotFocusFunctions[l][0]==o.CanvasID&&gotFocusFunctions[l][1]==windows[c].WindowCount){gotFocusFunctions[l][2](b,windows[c].WindowCount)}}var h=getCanvas(windows[c].CanvasID);invalidateRect(windows[c].CanvasID,null,0,0,h.width,h.height);if(n.preventDefault){n.preventDefault()}n.returnValue=false;return false}}if(m==0){if(o.TabStopIndex!=1){for(var c=0;c<windows.length;c++){if(windows[c].WindowCount!=o.WindowCount&&windows[c].TabStopIndex==1){m=1;windowIdWithFocus[d][1]=windows[c].WindowCount;for(var l=0;l<lostFocusFunctions.length;l++){if(lostFocusFunctions[l][0]==o.CanvasID&&lostFocusFunctions[l][1]==o.WindowCount&&lostFocusFunctions[l][1]!=windows[c].WindowCount){lostFocusFunctions[l][2](o.CanvasID,o.WindowCount)}}for(var l=0;l<gotFocusFunctions.length;l++){if(gotFocusFunctions[l][0]==o.CanvasID&&gotFocusFunctions[l][1]==windows[c].WindowCount){gotFocusFunctions[l][2](b,windows[c].WindowCount)}}var h=getCanvas(windows[c].CanvasID);invalidateRect(windows[c].CanvasID,null,0,0,h.width,h.height);if(n.preventDefault){n.preventDefault()}n.returnValue=false;return false}}}}}}}}}if(windowIdWithFocus[d][0]==keyDownFunctions[g].CanvasID&&windowIdWithFocus[d][1]==keyDownFunctions[g].WindowID){keyDownFunctions[g].KeyDownFunction(keyDownFunctions[g].CanvasID,keyDownFunctions[g].WindowID,n);var o=getWindowProps(keyDownFunctions[g].CanvasID,keyDownFunctions[g].WindowID);if(o){invalidateRect(keyDownFunctions[g].CanvasID,null,o.X,o.Y,o.Width,o.Height)}if(n.preventDefault){n.preventDefault()}n.returnValue=false}}}return false};if(navigator.userAgent.toLowerCase().indexOf("android")>-1||navigator.userAgent.toLowerCase().indexOf("ipad")>-1||navigator.userAgent.toLowerCase().indexOf("iphone")>-1||navigator.userAgent.toLowerCase().indexOf("ipod")>-1){a.addEventListener("touchstart",function(c){c.pageX=c.touches[0].pageX;c.pageY=c.touches[0].pageY;pointEvent(mouseDownFunctions,b,c,null)},false);a.addEventListener("touchmove",function(c){c.pageX=c.touches[0].pageX;c.pageY=c.touches[0].pageY;pointEvent(mouseMoveFunctions,b,c,null)},false);a.addEventListener("touchend",function(c){c.pageX=c.touches[0].pageX;c.pageY=c.touches[0].pageY;pointEvent(mouseUpFunctions,b,c,null,1)},false)}else{a.onmousedown=function(c){canvasOnMouseDown(b,c)};a.onmousemove=function(c){canvasOnMouseMove(b,c)};a.onmouseup=function(c){canvasOnMouseUp(b,c)};a.onmouseout=function(c){canvasOnMouseOut(b,c)};a.onmouseover=function(c){canvasOnMouseOver(b,c)};a.onmousewheel=function(c){canvasOnMouseWheel(b,c)};a.onscroll=function(c){canvasOnScroll(b,c)}}}function createWindow(b,j,i,a,k,e,d,g,c,h,f){++windowCount;windows.push({WindowCount:windowCount,X:j,Y:i,Width:a,Height:k,Depth:e,CanvasID:b,ParentWindowID:d,ChildWindowIDs:new Array(),ControlType:g,ControlNameID:c,MultiWindowControlsMainWindowId:h,TabStopIndex:f});return windowCount}function getWindowControlPropsByWindowProps(a){switch(a.ControlType){case"Panel":return getPanelProps(a.CanvasID,a.WindowCount);case"Label":return getLabelProps(a.CanvasID,a.WindowCount);case"Button":return getButtonProps(a.CanvasID,a.WindowCount);case"ScrollBar":return getScrollBarProps(a.CanvasID,a.WindowCount);case"Grid":return getGridProps(a.CanvasID,a.WindowCount);case"ComboBoxTextArea":return getComboboxPropsByTextAreaWindowId(a.CanvasID,a.WindowCount);case"CheckBox":return getcheckboxProps(a.CanvasID,a.WindowCount);case"RadioButtonGroup":return getRadioButtonProps(a.CanvasID,a.WindowCount);case"Image":return getImageControlProps(a.CanvasID,a.WindowCount);case"TreeView":return getTreeViewProps(a.CanvasID,a.WindowCount);case"Calender":return getCalenderProps(a.CanvasID,a.WindowCount);case"ProgressBar":return getProgressBarProps(a.CanvasID,a.WindowCount);case"Slider":return getSliderProps(a.CanvasID,a.WindowCount);case"DatePickerTextArea":return getDatePickerPropsByTextBoxAreaWindowID(a.CanvasID,a.WindowCount);case"BarGraph":return getBarGraphProps(a.CanvasID,a.WindowCount);case"PieChart":return getPieChartProps(a.CanvasID,a.WindowCount);case"LineGraph":return getLineGraphProps(a.CanvasID,a.WindowCount);case"Gauge":return getGaugeChartProps(a.CanvasID,a.WindowCount);case"RadarGraph":return getRadarGraphProps(a.CanvasID,a.WindowCount);case"LineAreaGraph":return getLineAreaGraphProps(a.CanvasID,a.WindowCount);case"CandlesticksGraph":return getCandlesticksGraphProps(a.CanvasID,a.WindowCount);case"DoughnutChart":return getDoughnutChartProps(a.CanvasID,a.WindowCount);case"BarsMixedWithLabeledLineGraph":return getBarsMixedWithLabledLineGraphProps(a.CanvasID,a.WindowCount);case"StackedBarGraph":return getstackedBarGraphProps(a.CanvasID,a.WindowCount);case"Tab":return getTabProps(a.CanvasID,a.WindowCount);case"ImageMap":return getImageMapProps(a.CanvasID,a.WindowCount);case"SubMenu":return getSubMenuBarProps(a.CanvasID,a.WindowCount);case"MenuBar":return getMenuBarProps(a.CanvasID,a.WindowCount);case"TextBox":return getTextBoxProps(a.CanvasID,a.WindowCount);case"ImageFader":return getImageFaderProps(a.CanvasID,a.WindowCount);case"ImageSlider":return getImageSliderProps(a.CanvasID,a.WindowCount);case"MultiLineLabel":return getMultiLineLabelProps(a.CanvasID,a.WindowCount);case"WordProcessor":return getWordProcessorProps(a.CanvasID,a.WindowCount)}}function registerChildWindow(c,a,d){for(var b=0;b<windows.length;b++){if(windows[b].WindowCount==d){windows[b].ChildWindowIDs.push(a);var e=getWindowProps(c,a);if(e){e.ParentWindowID=d}}}}function registerKeyPressFunction(d,c,a){for(var b=0;b<windows.length;b++){if(windows[b].CanvasID==d&&windows[b].WindowCount==a){keyPressFunctions.push({CanvasID:d,KeyPressFunction:c,WindowID:a})}}}function registerKeyDownFunction(d,c,a){for(var b=0;b<windows.length;b++){if(windows[b].CanvasID==d&&windows[b].WindowCount==a){keyDownFunctions.push({CanvasID:d,KeyDownFunction:c,WindowID:a})}}}function registerEvent(a,d,e,c){for(var b=0;b<windows.length;b++){if(windows[b].CanvasID==e&&windows[b].WindowCount==a){c.push([a,d,e])}}}function registerClickFunction(a,b,c){registerEvent(a,b,c,clickFunctions)}function registerDoubleClickFunction(a,b,c){registerEvent(a,b,c,doubleClickFunctions)}function registerDragFunction(a,c,b){registerEvent(a,c,b,dragFunctions)}function registerDragEndFunction(a,b,c){registerEvent(a,b,c,dragEndFunctions)}function registerDragEnterFunction(a,c,b){registerEvent(a,c,b,dragEnterFunctions)}function registerDragLeaveFunction(a,b,c){registerEvent(a,b,c,dragLeaveFunctions)}function registerDragOverFunction(a,c,b){registerEvent(a,c,b,dragOverFunctions)}function registerDragStartFunction(a,b,c){registerEvent(a,b,c,dragStartFunctions)}function registerDropFunction(a,b,c){registerEvent(a,b,c,dropFunctions)}function registerMouseDownFunction(a,b,c){registerEvent(a,b,c,mouseDownFunctions)}function registerMouseMoveFunction(a,b,c){registerEvent(a,b,c,mouseMoveFunctions)}function registerMouseOutFunction(a,c,b){registerEvent(a,c,b,mouseOutFunctions)}function registerMouseOverFunction(a,b,c){registerEvent(a,b,c,mouseOverFunctions)}function registerMouseUpFunction(a,b,c){registerEvent(a,b,c,mouseUpFunctions)}function registerMouseWheelFunction(b,a,c){registerEvent(b,a,c,mouseWheelFunctions)}function registerScrollFunction(a,b,c){registerEvent(a,b,c,scrollFunctions)}function registerWindowDrawFunction(a,b,c){registerEvent(a,b,c,windowDrawFunctions)}function getWindowDepth(a,c){for(var b=0;b<windows.length;b++){if(windows[b].WindowCount==a&&windows[b].CanvasID==c){return windows[b].Depth}}}function setWindowDepth(c,a,d){for(var b=0;b<windows.length;b++){if(windows[b].WindowCount==a&&windows[b].CanvasID==c){windows[b].Depth=d;if(d>highestDepth){highestDepth=d}return}}}function checkIfModalWindow(c,a){for(var b=0;b<modalWindows.length;b++){if(modalWindows[b].CanvasID==c&&modalWindows[b].WindowID==a){return 1}}return 0}function registerModalWindow(b,a){modalWindows.push({CanvasID:b,WindowID:a})}function checkIfHiddenWindow(c,a){for(var b=0;b<hiddenWindows.length;b++){if(hiddenWindows[b].CanvasID==c&&hiddenWindows[b].WindowID==a){return hiddenWindows[b].HiddenStatus}}return 0}function registerHiddenWindow(c,a,b){hiddenWindows.push({CanvasID:c,WindowID:a,HiddenStatus:b})}function setHiddenWindowStatus(d,a,b){for(var c=0;c<hiddenWindows.length;c++){if(hiddenWindows[c].HiddenStatus!=b&&hiddenWindows[c].CanvasID==d&&hiddenWindows[c].WindowID==a){hiddenWindows[c].HiddenStatus=b}}}function registerLostFocusFunction(c,a,b){lostFocusFunctions.push([c,a,b])}function registerGotFocusFunction(c,a,b){gotFocusFunctions.push([c,a,b])}function getWindowProps(c,a){for(var b=0;b<windows.length;b++){if(windows[b].CanvasID==c&&windows[b].WindowCount==a){return windows[b]}}}function invalidateRect(b,e,k,j,a,l){if(suspendDraw==0){var c=getCanvas(b);if(e==null){getCtx(b).clearRect(k,j,a,l)}for(var g=0;g<=highestDepth;g++){for(var f=0;f<windowDrawFunctions.length;f++){var h=getWindowProps(b,windowDrawFunctions[f][0]);if(h&&h.ParentWindowID==e&&checkIfHiddenWindow(b,windowDrawFunctions[f][0])==0&&checkIfModalWindow(b,windowDrawFunctions[f][0])==0&&getWindowDepth(windowDrawFunctions[f][0],windowDrawFunctions[f][2])==g&&windowDrawFunctions[f][2]==b&&k<h.X+h.Width&&k+a>h.X&&j<h.Y+h.Height&&j+l>h.Y){var m=getCtx(b);m.save();m.beginPath();m.rect(h.X,h.Y,h.Width,h.Height);m.clip();windowDrawFunctions[f][1](b,windowDrawFunctions[f][0]);if(h.ChildWindowIDs&&h.ChildWindowIDs.length>0){invalidateRect(b,windowDrawFunctions[f][0],k,j,a,l)}m.restore()}}}for(var g=0;g<=highestDepth;g++){for(var f=0;f<windowDrawFunctions.length;f++){var h=getWindowProps(b,windowDrawFunctions[f][0]);if(h&&h.ParentWindowID==e&&checkIfHiddenWindow(b,windowDrawFunctions[f][0])==0&&checkIfModalWindow(b,windowDrawFunctions[f][0])==1&&getWindowDepth(windowDrawFunctions[f][0],windowDrawFunctions[f][2])==g&&windowDrawFunctions[f][2]==b&&k<h.X+h.Width&&k+a>h.X&&j<h.Y+h.Height&&j+l>h.Y){var m=getCtx(b);m.save();m.beginPath();m.rect(h.X,h.Y,h.Width,h.Height);m.clip();windowDrawFunctions[f][1](b,windowDrawFunctions[f][0]);if(h.ChildWindowIDs&&h.ChildWindowIDs.length>0){invalidateRect(b,windowDrawFunctions[f][0],k,j,a,l)}m.restore()}}}}}function getCtx(b){for(var a=0;a<ctxs.length;a++){if(ctxs[a][0]==b){return ctxs[a][1]}}}function getCanvas(b){for(var a=0;a<canvases.length;a++){if(canvases[a][0]==b){return canvases[a][1]}}}function destroyControl(c,a){for(var b=0;b<windows.length;b++){if(windows[b].CanvasID==c&&windows[b].WindowCount==a){destroyControlByWindowObj(windows[b])}}}function destroyControlByNameID(b){for(var a=0;a<windows.length;a++){if(windows[a].ControlNameID==b){destroyControlByWindowObj(windows[a])}}}function destroyWindow(c,a){for(var b=0;b<windows.length;b++){if(windows[b].CanvasID==c&&windows[b].WindowCount==a){removeEventHooks(windows[b]);windows.splice(b,1);unregisterAnimatedWindow(c,a)}}}function removeEventFunctions(b,d,a){for(var c=b.length-1;c>=0;c--){if(b[c][2]==d&&b[c][0]==a){b.splice(c,1)}}}function removeEventHooks(a){removeEventFunctions(clickFunctions,a.CanvasID,a.WindowCount);removeEventFunctions(doubleClickFunctions,a.CanvasID,a.WindowCount);removeEventFunctions(dragFunctions,a.CanvasID,a.WindowCount);removeEventFunctions(dragEndFunctions,a.CanvasID,a.WindowCount);removeEventFunctions(dragEnterFunctions,a.CanvasID,a.WindowCount);removeEventFunctions(dragLeaveFunctions,a.CanvasID,a.WindowCount);removeEventFunctions(dragOverFunctions,a.CanvasID,a.WindowCount);removeEventFunctions(dragStartFunctions,a.CanvasID,a.WindowCount);removeEventFunctions(dropFunctions,a.CanvasID,a.WindowCount);removeEventFunctions(mouseDownFunctions,a.CanvasID,a.WindowCount);removeEventFunctions(mouseMoveFunctions,a.CanvasID,a.WindowCount);removeEventFunctions(mouseOutFunctions,a.CanvasID,a.WindowCount);removeEventFunctions(mouseOverFunctions,a.CanvasID,a.WindowCount);removeEventFunctions(mouseUpFunctions,a.CanvasID,a.WindowCount);removeEventFunctions(mouseWheelFunctions,a.CanvasID,a.WindowCount);removeEventFunctions(scrollFunctions,a.CanvasID,a.WindowCount);removeEventFunctions(windowDrawFunctions,a.CanvasID,a.WindowCount);removeEventFunctions(gotFocusFunctions,a.CanvasID,a.WindowCount);removeEventFunctions(lostFocusFunctions,a.CanvasID,a.WindowCount);removeEventFunctions(keyPressFunctions,a.CanvasID,a.WindowCount);removeEventFunctions(keyDownFunctions,a.CanvasID,a.WindowCount)}function destroyControlByWindowObj(b){for(var c=0;b.ChildWindowIDs&&c<b.ChildWindowIDs.length;c++){for(var a=0;a<windows.length;a++){if(windows[a].CanvasID==b.CanvasID&&windows[a].WindowID==b.ChildWindowIDs[c]){destroyControlByWindowObj(windows[a])}}}switch(b.ControlType){case"Label":for(var c=labelPropsArray.length-1;c>=0;c--){if(labelPropsArray[c].CanvasID==b.CanvasID&&labelPropsArray[c].WindowID==b.WindowCount){labelPropsArray.splice(c,1)}}break;case"Button":for(var c=buttonPropsArray.length-1;c>=0;c--){if(buttonPropsArray[c].CanvasID==b.CanvasID&&buttonPropsArray[c].WindowID==b.WindowCount){buttonPropsArray.splice(c,1)}}break;case"ScrollBar":for(var c=scrollBarPropsArray.length-1;c>=0;c--){if(scrollBarPropsArray[c].CanvasID==b.CanvasID&&scrollBarPropsArray[c].WindowID==b.WindowCount){scrollBarPropsArray.splice(c,1)}}break;case"Grid":for(var c=gridPropsArray.length-1;c>=0;c--){if(gridPropsArray[c].CanvasID==b.CanvasID&&gridPropsArray[c].WindowID==b.WindowCount){gridPropsArray.splice(c,1)}}break;case"ComboBoxTextArea":for(var c=comboboxPropsArray.length-1;c>=0;c--){if(comboboxPropsArray[c].CanvasID==b.CanvasID&&comboboxPropsArray[c].WindowID==b.WindowCount){destroyWindow(b.CanvasID,comboboxPropsArray[c].ButtonWindowID);destroyWindow(b.CanvasID,comboboxPropsArray[c].ListAreaWindowID);comboboxPropsArray.splice(c,1)}}break;case"CheckBox":for(var c=checkboxPropsArray.length-1;c>=0;c--){if(checkboxPropsArray[c].CanvasID==b.CanvasID&&checkboxPropsArray[c].WindowID==b.WindowCount){checkboxPropsArray.splice(c,1)}}break;case"RadioButtonGroup":for(var c=radiobuttonPropsArray.length-1;c>=0;c--){if(radiobuttonPropsArray[c].CanvasID==b.CanvasID&&radiobuttonPropsArray[c].WindowID==b.WindowCount){radiobuttonPropsArray.splice(c,1)}}break;case"Image":for(var c=imageControlPropsArray.length-1;c>=0;c--){if(imageControlPropsArray[c].CanvasID==b.CanvasID&&imageControlPropsArray[c].WindowID==b.WindowCount){imageControlPropsArray.splice(c,1)}}break;case"TreeView":for(var c=treeViewPropsArray.length-1;c>=0;c--){if(treeViewPropsArray[c].CanvasID==b.CanvasID&&treeViewPropsArray[c].WindowID==b.WindowCount){treeViewPropsArray.splice(c,1)}}break;case"Calender":for(var c=calenderPropsArray.length-1;c>=0;c--){if(calenderPropsArray[c].CanvasID==b.CanvasID&&calenderPropsArray[c].WindowID==b.WindowCount){calenderPropsArray.splice(c,1)}}break;case"ProgressBar":for(var c=progressBarPropsArray.length-1;c>=0;c--){if(progressBarPropsArray[c].CanvasID==b.CanvasID&&progressBarPropsArray[c].WindowID==b.WindowCount){progressBarPropsArray.splice(c,1)}}break;case"Slider":for(var c=sliderPropsArray.length-1;c>=0;c--){if(sliderPropsArray[c].CanvasID==b.CanvasID&&sliderPropsArray[c].WindowID==b.WindowCount){sliderPropsArray.splice(c,1)}}break;case"DatePickerTextArea":for(var c=datePickerPropsArray.length-1;c>=0;c--){if(datePickerPropsArray[c].CanvasID==b.CanvasID&&datePickerPropsArray[c].WindowID==b.WindowCount){destroyWindow(b.CanvasID,datePickerPropsArray[c].ButtonWindowID);destroyControl(b.CanvasID,datePickerPropsArray[c].CalenderWindowID);datePickerPropsArray.splice(c,1)}}break;case"Panel":for(var c=panelPropsArray.length-1;c>=0;c--){if(panelPropsArray[c].CanvasID==b.CanvasID&&panelPropsArray[c].WindowID==b.WindowCount){panelPropsArray.splice(c,1)}}break;case"BarGraph":for(var c=barGraphsPropsArray.length-1;c>=0;c--){if(barGraphsPropsArray[c].CanvasID==b.CanvasID&&barGraphsPropsArray[c].WindowID==b.WindowCount){barGraphsPropsArray.splice(c,1)}}break;case"PieChart":for(var c=pieChartsPropsArray.length-1;c>=0;c--){if(pieChartsPropsArray[c].CanvasID==b.CanvasID&&pieChartsPropsArray[c].WindowID==b.WindowCount){pieChartsPropsArray.splice(c,1)}}break;case"LineGraph":for(var c=lineGraphsPropsArray.length-1;c>=0;c--){if(lineGraphsPropsArray[c].CanvasID==b.CanvasID&&lineGraphsPropsArray[c].WindowID==b.WindowCount){lineGraphsPropsArray.splice(c,1)}}break;case"Gauge":for(var c=gaugeChartPropsArray.length-1;c>=0;c--){if(gaugeChartPropsArray[c].CanvasID==b.CanvasID&&gaugeChartPropsArray[c].WindowID==b.WindowCount){gaugeChartPropsArray.splice(c,1)}}break;case"RadarGraph":for(var c=radarGraphPropsArray.length-1;c>=0;c--){if(radarGraphPropsArray[c].CanvasID==b.CanvasID&&radarGraphPropsArray[c].WindowID==b.WindowCount){radarGraphPropsArray.splice(c,1)}}break;case"LineAreaGraph":for(var c=lineAreaGraphPropsArray.length-1;c>=0;c--){if(lineAreaGraphPropsArray[c].CanvasID==b.CanvasID&&lineAreaGraphPropsArray[c].WindowID==b.WindowCount){lineAreaGraphPropsArray.splice(c,1)}}break;case"CandlesticksGraph":for(var c=candlesticksGraphPropsArray.length-1;c>=0;c--){if(candlesticksGraphPropsArray[c].CanvasID==b.CanvasID&&candlesticksGraphPropsArray[c].WindowID==b.WindowCount){candlesticksGraphPropsArray.splice(c,1)}}break;case"DoughnutChart":for(var c=doughnutChartPropsArray.length-1;c>=0;c--){if(doughnutChartPropsArray[c].CanvasID==b.CanvasID&&doughnutChartPropsArray[c].WindowID==b.WindowCount){doughnutChartPropsArray.splice(c,1)}}break;case"BarsMixedWithLabeledLineGraph":for(var c=barsMixedWithLabledLineGraphsPropsArray.length-1;c>=0;c--){if(barsMixedWithLabledLineGraphsPropsArray[c].CanvasID==b.CanvasID&&barsMixedWithLabledLineGraphsPropsArray[c].WindowID==b.WindowCount){barsMixedWithLabledLineGraphsPropsArray.splice(c,1)}}break;case"StackedBarGraph":for(var c=stackedBarGraphPropsArray.length-1;c>=0;c--){if(stackedBarGraphPropsArray[c].CanvasID==b.CanvasID&&stackedBarGraphPropsArray[c].WindowID==b.WindowCount){stackedBarGraphPropsArray.splice(c,1)}}break;case"Tab":for(var c=tabPropsArray.length-1;c>=0;c--){if(tabPropsArray[c].CanvasID==b.CanvasID&&tabPropsArray[c].WindowID==b.WindowCount){tabPropsArray.splice(c,1)}}break;case"ImageMap":for(var c=imageMapPropsArray.length-1;c>=0;c--){if(imageMapPropsArray[c].CanvasID==b.CanvasID&&imageMapPropsArray[c].WindowID==b.WindowCount){imageMapPropsArray.splice(c,1)}}break;case"SubMenu":for(var c=subMenuBarPropsArray.length-1;c>=0;c--){if(subMenuBarPropsArray[c].CanvasID==b.CanvasID&&subMenuBarPropsArray[c].WindowID==b.WindowCount){for(var d=0;d<subMenuBarPropsArray[c].ChildMenuWindowIDs.length;d++){destroyControl(b.CanvasID,subMenuBarPropsArray[c].ChildMenuWindowIDs[d])}subMenuBarPropsArray.splice(c,1)}}break;case"MenuBar":for(var c=menuBarPropsArray.length-1;c>=0;c--){if(menuBarPropsArray[c].CanvasID==b.CanvasID&&menuBarPropsArray[c].WindowID==b.WindowCount){for(var d=0;d<menuBarPropsArray[c].ChildMenuWindowIDs.length;d++){destroyControl(b.CanvasID,menuBarPropsArray[c].ChildMenuWindowIDs[d])}menuBarPropsArray.splice(c,1)}}break;case"TextBox":for(var c=textBoxPropsArray.length-1;c>=0;c--){if(textBoxPropsArray[c].CanvasID==b.CanvasID&&textBoxPropsArray[c].WindowID==b.WindowCount){textBoxPropsArray.splice(c,1)}}break;case"ImageFader":for(var c=imageFaderPropsArray.length-1;c>=0;c--){if(imageFaderPropsArray[c].CanvasID==b.CanvasID&&imageFaderPropsArray[c].WindowID==b.WindowCount){imageFaderPropsArray.splice(c,1)}}break;case"ImageSlider":for(var c=imageSliderPropsArray.length-1;c>=0;c--){if(imageSliderPropsArray[c].CanvasID==b.CanvasID&&imageSliderPropsArray[c].WindowID==b.WindowCount){imageSliderPropsArray.splice(c,1)}}break;case"MultiLineLabel":for(var c=multiLineLabelPropsArray.length-1;c>=0;c--){if(multiLineLabelPropsArray[c].CanvasID==b.CanvasID&&multiLineLabelPropsArray[c].WindowID==b.WindowCount){multiLineLabelPropsArray.splice(c,1)}}break;case"WordProcessor":for(var c=wordProcessorPropsArray.length-1;c>=0;c--){if(wordProcessorPropsArray[c].CanvasID==b.CanvasID&&wordProcessorPropsArray[c].WindowID==b.WindowCount){wordProcessorPropsArray.splice(c,1)}}break;case"VirtualKeyboard":for(var c=virtualKeyboardPropsArray.length-1;c>=0;c--){if(virtualKeyboardPropsArray[c].CanvasID==b.CanvasID&&virtualKeyboardPropsArray[c].WindowID==b.WindowCount){virtualKeyboardPropsArray.splice(c,1)}}break;case"Splitter":for(var c=splitterPropsArray.length-1;c>=0;c--){if(splitterPropsArray[c].CanvasID==b.CanvasID&&splitterPropsArray[c].WindowID==b.WindowCount){splitterPropsArray.splice(c,1)}}break}destroyWindow(b.CanvasID,b.WindowCount)}function getWindowByControlNameID(b){for(var a=0;a<windows.length;a++){if(windows[a].ControlNameID==b){return windows[a]}}}var labelPropsArray=new Array();function getLabelProps(c,a){for(var b=0;b<labelPropsArray.length;b++){if(labelPropsArray[b].CanvasID==c&&labelPropsArray[b].WindowID==a){return labelPropsArray[b]}}}function CCLLabel(){}CCLLabel.prototype={CanvasID:"",ControlNameID:"l1",X:0,Y:0,Width:0,Height:0,Depth:0,Text:"Label",TextHeight:12,TextFontString:"12pt Ariel",TextColor:"#000000",AutoAdjustWidth:1,IsHyperlink:0,URL:null,NoBrowserHistory:null,IsNewBrowserWindow:null,NameOfNewBrowserWindow:null,WidthOfNewBrowserWindow:null,HeightOfNewBrowserWindow:null,NewBrowserWindowIsResizable:null,NewBrowserWindowHasScrollBars:null,NewBrowserWindowHasToolbar:null,NewBrowserWindowHasLocationOrURLOrAddressBox:null,NewBrowserWindowHasDirectoriesOrExtraButtons:null,NewBrowserWindowHasStatusBar:null,NewBrowserWindowHasMenuBar:null,NewBrowserWindowCopyHistory:null,DrawFunction:null,Alignment:null,ClickFunction:null,BackGroundColor:null,Tag:null,TabStopIndex:null,Initialize:function(){return createLabel(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Text,this.TextColor,this.TextHeight,this.TextFontString,this.DrawFunction,this.Depth,this.Alignment,this.ClickFunction,this.BackGroundColor,this.AutoAdjustWidth,this.Tag,this.IsHyperlink,this.URL,this.NoBrowserHistory,this.IsNewBrowserWindow,this.NameOfNewBrowserWindow,this.WidthOfNewBrowserWindow,this.HeightOfNewBrowserWindow,this.NewBrowserWindowIsResizable,this.NewBrowserWindowHasScrollBars,this.NewBrowserWindowHasToolbar,this.NewBrowserWindowHasLocationOrURLOrAddressBox,this.NewBrowserWindowHasDirectoriesOrExtraButtons,this.NewBrowserWindowHasStatusBar,this.NewBrowserWindowHasMenuBar,this.NewBrowserWindowCopyHistory,this.TabStopIndex)}};function createLabel(B,F,E,D,a,e,v,G,q,l,d,k,b,f,c,j,I,n,g,K,m,o,t,p,i,C,J,z,w,h,A,s,L){if(j==1){var r=getCtx(B);r.font=l;a=r.measureText(v).width}var u=createWindow(B,E,D,a,e,k,null,"Label",F,null,L);var H=new CCLLabel();labelPropsArray.push({CanvasID:B,WindowID:u,X:E,Y:D,Width:a,Height:e,Text:v,TextHeight:q,TextFontString:l,TextColor:G,IsHyperlink:n,URL:g,NoBrowserHistory:K,IsNewBrowserWindow:m,NameOfNewBrowserWindow:o,WidthOfNewBrowserWindow:t,HeightOfNewBrowserWindow:p,NewBrowserWindowIsResizable:i,NewBrowserWindowHasScrollBars:C,NewBrowserWindowHasToolbar:J,NewBrowserWindowHasLocationOrURLOrAddressBox:z,NewBrowserWindowHasDirectoriesOrExtraButtons:w,NewBrowserWindowHasStatusBar:h,NewBrowserWindowHasMenuBar:A,NewBrowserWindowCopyHistory:s,DrawFunction:d,Alignment:b,ClickFunction:f,BackGroundColor:c,Tag:I});if(d!=undefined&&d!=null){registerWindowDrawFunction(u,function(x,M){var y=getLabelProps(x,M);y.DrawFunction(x,M)},B)}else{registerWindowDrawFunction(u,function(){var y=getCtx(B);var x=getLabelProps(B,u);y.font=x.TextFontString;if(x.BackGroundColor){y.fillStyle=x.BackGroundColor;y.beginPath();y.rect(x.X,x.Y,x.Width,x.Height);y.fill()}y.fillStyle=x.TextColor;y.fillText(x.Text,x.X+(x.Alignment=="center"?((x.Width-y.measureText(x.Text).width)/2):0),x.Y+x.Height-((x.Height-x.TextHeight)/2))},B)}if(f!=null){registerClickFunction(u,f,B)}else{if(n==1){registerClickFunction(u,function(){if(m==1){var y="";var x=0;if(t!=null){y+="width="+t;x=1}if(p!=null){y+=(x==1?",":"")+"height="+p}if(i!=null){y+=(x==1?",":"")+"resizable="+i}if(C!=null){y+=(x==1?",":"")+"scrollbars="+C}if(J!=null){y+=(x==1?",":"")+"toolbar="+J}if(z!=null){y+=(x==1?",":"")+"location="+z}if(w!=null){y+=(x==1?",":"")+"directories="+w}if(h!=null){y+=(x==1?",":"")+"status="+h}if(A!=null){y+=(x==1?",":"")+"menubar="+A}if(s!=null){y+=(x==1?",":"")+"copyhistory="+s}window.open(g,o,y)}else{if(K==1){window.location.replace(g)}else{window.location.href=g}}},B)}}if(L!=null&&L>0){registerKeyDownFunction(B,function(){},u)}return u}var buttonPropsArray=new Array();function getButtonProps(c,a){for(var b=0;b<buttonPropsArray.length;b++){if(buttonPropsArray[b].CanvasID==c&&buttonPropsArray[b].WindowID==a){return buttonPropsArray[b]}}}function defaultButtonDrawFunction(a,h){var e=0;var d=0;var i=getCtx(a);i.save();var c=getButtonProps(a,h);if(c.IsPressed==1){c.IsPressed=0;e=5;d=5}if(c.Theme==1){i.beginPath();i.moveTo(e+c.X,d+c.Y+c.EdgeRadius);i.arc(e+c.X+c.EdgeRadius,d+c.Y+c.EdgeRadius,c.EdgeRadius,Math.PI,(Math.PI/180)*270,false);i.lineTo(e+c.X+c.Width-c.EdgeRadius,d+c.Y);i.arc(e+c.X+c.Width-c.EdgeRadius,d+c.Y+c.EdgeRadius,c.EdgeRadius,(Math.PI/180)*270,Math.PI*2,false);i.lineTo(e+c.X+c.Width,d+c.Y+c.Height-c.EdgeRadius);i.arc(e+c.X+c.Width-c.EdgeRadius,d+c.Y+c.Height-c.EdgeRadius,c.EdgeRadius,0,Math.PI/2,false);i.lineTo(e+c.X+c.EdgeRadius,d+c.Y+c.Height);i.arc(e+c.X+c.EdgeRadius,d+c.Y+c.Height-c.EdgeRadius,c.EdgeRadius,Math.PI/2,Math.PI,false);i.closePath();var f=i.createLinearGradient(e+c.X,d+c.Y,e+c.X,d+c.Y+c.Height);f.addColorStop(0,"#536fa0");f.addColorStop(1,"#274580");i.fillStyle=f;i.fill();i.strokeStyle="#1f3a73";i.stroke();f=i.createLinearGradient(e+c.X,d+c.Y+((c.Height-c.TextHeight)/2),e+c.X,d+c.Y-((c.Height-c.TextHeight)/2)+c.Height);f.addColorStop(0,"#fafbfc");f.addColorStop(1,"#dde2ea");i.fillStyle=f;i.shadowBlur=5;i.shadowColor="#636e7f";i.font=c.TextFontString;i.fillText(c.Text,e+c.X+((c.Width-i.measureText(c.Text).width)/2),d+c.Y+c.Height-((c.Height-c.TextHeight)/2))}else{if(c.Theme==2){var f=i.createLinearGradient(e+c.X,d+c.Y,e+c.X,d+c.Y+c.Height);f.addColorStop(0,"#7888ff");f.addColorStop(1,"#d0d3fe");i.shadowBlur=5;i.shadowColor=f;i.beginPath();i.moveTo(e+c.X,d+c.Y+c.EdgeRadius);i.arc(e+c.X+c.EdgeRadius,d+c.Y+c.EdgeRadius,c.EdgeRadius,Math.PI,(Math.PI/180)*270,false);i.lineTo(e+c.X+c.Width-c.EdgeRadius-5,d+c.Y);i.arc(e+c.X+c.Width-c.EdgeRadius-5,d+c.Y+c.EdgeRadius,c.EdgeRadius,(Math.PI/180)*270,Math.PI*2,false);i.lineTo(e+c.X+c.Width-5,d+c.Y+c.Height-c.EdgeRadius-5);i.arc(e+c.X+c.Width-c.EdgeRadius-5,d+c.Y+c.Height-c.EdgeRadius-5,c.EdgeRadius,0,Math.PI/2,false);i.lineTo(e+c.X+c.EdgeRadius,d+c.Y+c.Height-5);i.arc(e+c.X+c.EdgeRadius,d+c.Y+c.Height-c.EdgeRadius-5,c.EdgeRadius,Math.PI/2,Math.PI,false);i.closePath();f=i.createLinearGradient(e+c.X,d+c.Y+9,e+c.X,d+c.Y+c.Height-9);f.addColorStop(0,"#7a83c6");f.addColorStop(1,"#5787dc");i.strokeStyle=f;i.lineWidth=1;i.stroke();i.beginPath();i.moveTo(e+c.X+1,d+c.Y+c.EdgeRadius+1);i.arc(e+c.X+c.EdgeRadius+1,d+c.Y+c.EdgeRadius+1,c.EdgeRadius,Math.PI,(Math.PI/180)*270,false);i.lineTo(e+c.X+c.Width-c.EdgeRadius-6,d+c.Y+1);i.arc(e+c.X+c.Width-c.EdgeRadius-6,d+c.Y+c.EdgeRadius+1,c.EdgeRadius,(Math.PI/180)*270,Math.PI*2,false);i.lineTo(e+c.X+c.Width-6,d+c.Y+c.Height-c.EdgeRadius-6);i.arc(e+c.X+c.Width-c.EdgeRadius-6,d+c.Y+c.Height-c.EdgeRadius-6,c.EdgeRadius,0,Math.PI/2,false);i.lineTo(e+c.X+c.EdgeRadius+1,d+c.Y+c.Height-6);i.arc(e+c.X+c.EdgeRadius+1,d+c.Y+c.Height-c.EdgeRadius-6,c.EdgeRadius,Math.PI/2,Math.PI,false);i.closePath();f=i.createLinearGradient(e+c.X,d+c.Y+1,e+c.X,d+c.Y+c.Height-6);f.addColorStop(0,"#a0abe9");f.addColorStop(1,"#80b2fb");i.strokeStyle=f;i.lineWidth=1;i.stroke();i.beginPath();i.moveTo(e+c.X+2,d+c.Y+c.EdgeRadius+2);i.arc(e+c.X+c.EdgeRadius+2,d+c.Y+c.EdgeRadius+2,c.EdgeRadius,Math.PI,(Math.PI/180)*270,false);i.lineTo(e+c.X+c.Width-c.EdgeRadius-7,d+c.Y+2);i.arc(e+c.X+c.Width-c.EdgeRadius-7,d+c.Y+c.EdgeRadius+2,c.EdgeRadius,(Math.PI/180)*270,Math.PI*2,false);i.lineTo(e+c.X+c.Width-7,d+c.Y+c.Height-c.EdgeRadius-7);i.arc(e+c.X+c.Width-c.EdgeRadius-7,d+c.Y+c.Height-c.EdgeRadius-7,c.EdgeRadius,0,Math.PI/2,false);i.lineTo(e+c.X+c.EdgeRadius+2,d+c.Y+c.Height-7);i.arc(e+c.X+c.EdgeRadius+2,d+c.Y+c.Height-c.EdgeRadius-7,c.EdgeRadius,Math.PI/2,Math.PI,false);i.closePath();f=i.createLinearGradient(e+c.X,d+c.Y+2,e+c.X,d+c.Y+c.Height-7);f.addColorStop(0,"#99a4e4");f.addColorStop(1,"#4c7ce2");i.fillStyle=f;i.fill();f=i.createLinearGradient(e+c.X,d+c.Y+((c.Height-c.TextHeight)/2),e+c.X,d+c.Y-((c.Height-c.TextHeight)/2)+c.Height);f.addColorStop(0,"#fafbfc");f.addColorStop(1,"#dde2ea");i.fillStyle=f;i.shadowBlur=5;i.shadowColor="#636e7f";i.font=c.TextFontString;i.fillText(c.Text,e+c.X+((c.Width-i.measureText(c.Text).width-5)/2),d+c.Y+c.Height-5-((c.Height-c.TextHeight-5)/2))}else{i.beginPath();i.moveTo(e+c.X,d+c.Y+c.EdgeRadius);i.arc(e+c.X+c.EdgeRadius,d+c.Y+c.EdgeRadius,c.EdgeRadius,Math.PI,(Math.PI/180)*270,false);i.lineTo(e+c.X+c.Width-c.EdgeRadius,d+c.Y);i.arc(e+c.X+c.Width-c.EdgeRadius,d+c.Y+c.EdgeRadius,c.EdgeRadius,(Math.PI/180)*270,Math.PI*2,false);i.lineTo(e+c.X+c.Width,d+c.Y+c.Height-c.EdgeRadius);i.arc(e+c.X+c.Width-c.EdgeRadius,d+c.Y+c.Height-c.EdgeRadius,c.EdgeRadius,0,Math.PI/2,false);i.lineTo(e+c.X+c.EdgeRadius,d+c.Y+c.Height);i.arc(e+c.X+c.EdgeRadius,d+c.Y+c.Height-c.EdgeRadius,c.EdgeRadius,Math.PI/2,Math.PI,false);i.closePath();i.fillStyle=c.BorderColor;i.fill();var b=i.createLinearGradient(e+c.X,d+c.Y,e+c.X,d+c.Y+c.Height);b.addColorStop(0,c.TopColorStart);b.addColorStop(1,c.TopColorEnd);i.fillStyle=b;i.beginPath();i.rect(e+c.X+c.EdgeRadius,d+c.Y+c.EdgeRadius,c.Width-(2*c.EdgeRadius),(c.Height/2)-c.EdgeRadius);i.fill();var j=i.createLinearGradient(e+c.X,d+c.Y,e+c.X,d+c.Y+c.Height);j.addColorStop(0,c.BottomColorStart);j.addColorStop(1,c.BottomColorEnd);i.fillStyle=j;i.beginPath();i.rect(e+c.X+c.EdgeRadius,d+c.Y+(c.Height/2),c.Width-(2*c.EdgeRadius),(c.Height/2)-c.EdgeRadius);i.fill();i.font=c.TextFontString;i.fillStyle=c.TextColor;i.fillText(c.Text,e+c.X+((c.Width-i.measureText(c.Text).width)/2),d+c.Y+c.Height-((c.Height-c.TextHeight)/2))}}if(c.HasGloss==1){i.beginPath();i.moveTo(e+c.X+2,d+c.Y+c.EdgeRadius+2);i.arc(e+c.X+c.EdgeRadius+2,d+c.Y+c.EdgeRadius+2,c.EdgeRadius,Math.PI,(Math.PI/180)*270,false);i.lineTo(e+c.X+c.Width-c.EdgeRadius-2,d+c.Y+2);i.arc(e+c.X+c.Width-c.EdgeRadius-2,d+c.Y+c.EdgeRadius+2,c.EdgeRadius,(Math.PI/180)*270,Math.PI*2,false);i.lineTo(e+c.X+c.Width-2,d+c.Y+((c.Height-4)/2)-c.EdgeRadius+2);i.arc(e+c.X+c.Width-c.EdgeRadius-2,d+c.Y+((c.Height-4)/2)-c.EdgeRadius+2,c.EdgeRadius,0,Math.PI/2,false);i.lineTo(e+c.X+c.EdgeRadius+2,d+c.Y+((c.Height-4)/2)+2);i.arc(e+c.X+c.EdgeRadius+2,d+c.Y+((c.Height-4)/2)-c.EdgeRadius+2,c.EdgeRadius,Math.PI/2,Math.PI,false);i.closePath();var f=i.createLinearGradient(e+c.X,d+c.Y+2,e+c.X,d+c.Y+((c.Height-4)/2)+5);f.addColorStop(0,"rgba(255,255,255,0.4)");f.addColorStop(1,"rgba(255,255,255,0.05)");i.fillStyle=f;i.fill()}i.restore()}function CCLButton(){}CCLButton.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,Text:null,EdgeRadius:null,BottomColorStart:null,BottomColorEnd:null,TopColorStart:null,TopColorEnd:null,TextHeight:null,TextFontString:null,TextColor:null,IsPressed:0,BorderColor:null,IsHyperlink:null,URL:null,NoBrowserHistory:null,IsNewBrowserWindow:null,NameOfNewBrowserWindow:null,WidthOfNewBrowserWindow:null,HeightOfNewBrowserWindow:null,NewBrowserWindowIsResizable:null,NewBrowserWindowHasScrollBars:null,NewBrowserWindowHasToolbar:null,NewBrowserWindowHasLocationOrURLOrAddressBox:null,NewBrowserWindowHasDirectoriesOrExtraButtons:null,NewBrowserWindowHasStatusBar:null,NewBrowserWindowHasMenuBar:null,NewBrowserWindowCopyHistory:null,Tag:null,Theme:null,HasGloss:null,ControlNameID:null,Depth:null,ClickFunction:null,DrawFunction:null,TabStopIndex:null,Initialize:function(){return createButton(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Text,this.TextColor,this.TextHeight,this.TextFontString,this.EdgeRadius,this.Depth,this.Theme,this.HasGloss,this.ClickFunction,this.DrawFunction,this.BottomColorStart,this.BottomColorEnd,this.TopColorStart,this.TopColorEnd,this.BorderColor,this.Tag,this.IsHyperlink,this.URL,this.NoBrowserHistory,this.IsNewBrowserWindow,this.NameOfNewBrowserWindow,this.WidthOfNewBrowserWindow,this.HeightOfNewBrowserWindow,this.NewBrowserWindowIsResizable,this.NewBrowserWindowHasScrollBars,this.NewBrowserWindowHasToolbar,this.NewBrowserWindowHasLocationOrURLOrAddressBox,this.NewBrowserWindowHasDirectoriesOrExtraButtons,this.NewBrowserWindowHasStatusBar,this.NewBrowserWindowHasMenuBar,this.NewBrowserWindowCopyHistory,this.TabStopIndex)}};function createButton(D,J,I,H,a,d,w,K,r,l,j,i,A,q,e,c,s,F,b,k,E,L,n,f,N,m,o,v,p,h,G,M,B,C,g,z,t,O){var u=createWindow(D,I,H,a,d,i,null,"Button",J,null,O);buttonPropsArray.push({CanvasID:D,WindowID:u,X:I,Y:H,Width:a,Height:d,Text:w,EdgeRadius:j,BottomColorStart:s,BottomColorEnd:F,TopColorStart:b,TopColorEnd:k,TextHeight:r,TextFontString:l,TextColor:K,IsPressed:0,BorderColor:E,IsHyperlink:n,URL:f,NoBrowserHistory:N,IsNewBrowserWindow:m,NameOfNewBrowserWindow:o,WidthOfNewBrowserWindow:v,HeightOfNewBrowserWindow:p,NewBrowserWindowIsResizable:h,NewBrowserWindowHasScrollBars:G,NewBrowserWindowHasToolbar:M,NewBrowserWindowHasLocationOrURLOrAddressBox:B,NewBrowserWindowHasDirectoriesOrExtraButtons:C,NewBrowserWindowHasStatusBar:g,NewBrowserWindowHasMenuBar:z,NewBrowserWindowCopyHistory:t,Tag:L,Theme:A,HasGloss:q});registerClickFunction(u,function(){if(n==1){if(m==1){var y="";var x=0;if(v!=null){y+="width="+v;x=1}if(p!=null){y+=(x==1?",":"")+"height="+p}if(h!=null){y+=(x==1?",":"")+"resizable="+h}if(G!=null){y+=(x==1?",":"")+"scrollbars="+G}if(M!=null){y+=(x==1?",":"")+"toolbar="+M}if(B!=null){y+=(x==1?",":"")+"location="+B}if(newbroserwindowhasdirectoriesorextrabuttons!=null){y+=(x==1?",":"")+"directories="+newbroserwindowhasdirectoriesorextrabuttons}if(g!=null){y+=(x==1?",":"")+"status="+g}if(z!=null){y+=(x==1?",":"")+"menubar="+z}if(t!=null){y+=(x==1?",":"")+"copyhistory="+t}window.open(f,(navigator.userAgent.toLowerCase().indexOf("msie")==-1?o:o.replace(/ /g,"")),y)}else{if(N==1){window.location.replace(f)}else{window.location.href=f}}}else{getButtonProps(D,u).IsPressed=0;e(D,u)}},D);registerMouseDownFunction(u,function(y,x){getButtonProps(y,x).IsPressed=1},D);registerMouseUpFunction(D,function(y,x){getButtonProps(y,x).IsPressed=0},D);if(c!=undefined&&c!=null){registerWindowDrawFunction(u,function(){c(D,u)},D)}else{registerWindowDrawFunction(u,function(){defaultButtonDrawFunction(D,u)},D)}if(O!=null&&O>0){registerKeyDownFunction(D,function(){},u)}return u}var scrollBarPropsArray=new Array();function getScrollBarProps(c,a){for(var b=0;b<scrollBarPropsArray.length;b++){if(scrollBarPropsArray[b].CanvasID==c&&scrollBarPropsArray[b].WindowID==a){return scrollBarPropsArray[b]}}}function drawScrollBar(a,e){var j=getScrollBarProps(a,e);var h=j.X,f=j.Y,c=j.Len,d=(j.MaxItems==0?1:j.MaxItems),i=j.SelectedID;var k=getCtx(a);if(j.Alignment==1){k.clearRect(j.X,j.Y,15,j.Len);var b=k.createLinearGradient(h,f,h+15,f);b.addColorStop(0,"#e3e3e3");b.addColorStop(0.5,"#ededed");b.addColorStop(1,"#e5e5e5");k.fillStyle=b;k.beginPath();k.rect(h,f,15,c);k.fill();k.lineCap="butt";k.strokeStyle="#3c7fb1";k.beginPath();k.rect(h,f,15,15);k.stroke();k.fillStyle="#dcf0fb";k.beginPath();k.rect(h+1,f+1,6,13);k.fill();k.fillStyle="#a7d8f3";k.beginPath();k.rect(h+8,f+1,6,13);k.fill();k.strokeStyle="#c0e4f8";k.beginPath();k.moveTo(h+7,f+1);k.lineTo(h+7,f+14);k.stroke();var b=k.createLinearGradient(h+7,f+6,h+7,f+10);b.addColorStop(0,"#4e9ac4");b.addColorStop(1,"#0d2a3a");k.fillStyle=b;k.beginPath();k.moveTo(h+8,f+6);k.lineTo(h+11,f+10);k.lineTo(h+4,f+10);k.closePath();k.fill();k.lineCap="butt";k.strokeStyle="#3c7fb1";k.beginPath();k.rect(h,f+c-15,15,15);k.stroke();k.fillStyle="#dcf0fb";k.beginPath();k.rect(h+1,f+c-15+1,6,13);k.fill();k.fillStyle="#a7d8f3";k.beginPath();k.rect(h+8,f+c-15+1,6,13);k.fill();k.strokeStyle="#c0e4f8";k.beginPath();k.moveTo(h+7,f+c-15+1);k.lineTo(h+7,f+c-15+14);k.stroke();var b=k.createLinearGradient(h+7,f+c-15+6,h+7,f+c-15+10);b.addColorStop(0,"#0d2a3a");b.addColorStop(1,"#4e9ac4");k.fillStyle=b;k.beginPath();k.moveTo(h+4,f+c-15+6);k.lineTo(h+11,f+c-15+6);k.lineTo(h+7,f+c-15+10);k.closePath();k.fill();k.lineWidth=1;k.strokeStyle="#15598a";k.beginPath();k.rect(h,f+((i*(c-55))/d)+16,15,25);k.stroke();k.fillStyle="#6ac1e5";k.beginPath();k.rect(h+8,f+((i*(c-55))/d)+16+1,6,23);k.fill();k.fillStyle="#b7e4f7";k.beginPath();k.rect(h+1,f+((i*(c-55))/d)+16+1,6,23);k.fill();k.strokeStyle="#8fd5f3";k.beginPath();k.moveTo(h+8,f+((i*(c-55))/d)+16+1);k.lineTo(h+8,f+((i*(c-55))/d)+16+22);k.stroke();var b=k.createLinearGradient(h+4,f+((i*(c-55))/d)+16+8,h+10,f+((i*(c-55))/d)+16+8);b.addColorStop(0,"#2b404b");b.addColorStop(1,"#5888a1");k.strokeStyle=b;k.beginPath();k.moveTo(h+4,f+((i*(c-55))/d)+16+8);k.lineTo(h+10,f+((i*(c-55))/d)+16+8);k.stroke();k.beginPath();k.moveTo(h+4,f+((i*(c-55))/d)+16+11);k.lineTo(h+10,f+((i*(c-55))/d)+16+11);k.stroke();k.beginPath();k.moveTo(h+4,f+((i*(c-55))/d)+16+14);k.lineTo(h+10,f+((i*(c-55))/d)+16+14);k.stroke();var b=k.createLinearGradient(h+4,f+((i*(c-55))/d)+16+8,h+10,f+((i*(c-55))/d)+16+8);b.addColorStop(0,"#447791");b.addColorStop(1,"#96bed3");k.strokeStyle=b;k.beginPath();k.moveTo(h+4,f+((i*(c-55))/d)+16+9);k.lineTo(h+10,f+((i*(c-55))/d)+16+9);k.stroke();k.beginPath();k.moveTo(h+4,f+((i*(c-55))/d)+16+12);k.lineTo(h+10,f+((i*(c-55))/d)+16+12);k.stroke();k.beginPath();k.moveTo(h+4,f+((i*(c-55))/d)+16+15);k.lineTo(h+10,f+((i*(c-55))/d)+16+15);k.stroke()}else{k.clearRect(j.X,j.Y,j.Len,15);var b=k.createLinearGradient(h,f,h,f+15);b.addColorStop(0,"#e3e3e3");b.addColorStop(0.5,"#ededed");b.addColorStop(1,"#e5e5e5");k.fillStyle=b;k.beginPath();k.rect(h,f,c,15);k.fill();k.lineCap="butt";k.strokeStyle="#3c7fb1";k.beginPath();k.rect(h,f,15,15);k.stroke();k.fillStyle="#dcf0fb";k.beginPath();k.rect(h+1,f+1,13,6);k.fill();k.fillStyle="#a7d8f3";k.beginPath();k.rect(h+1,f+8,13,6);k.fill();k.strokeStyle="#c0e4f8";k.beginPath();k.moveTo(h+1,f+7);k.lineTo(h+14,f+7);k.stroke();var b=k.createLinearGradient(h+6,f+7,h+10,f+7);b.addColorStop(0,"#4e9ac4");b.addColorStop(1,"#0d2a3a");k.fillStyle=b;k.beginPath();k.moveTo(h+6,f+8);k.lineTo(h+10,f+11);k.lineTo(h+10,f+4);k.closePath();k.fill();k.lineCap="butt";k.strokeStyle="#3c7fb1";k.beginPath();k.rect(h+c-15,f,15,15);k.stroke();k.fillStyle="#dcf0fb";k.beginPath();k.rect(h+c-15+1,f,13,6);k.fill();k.fillStyle="#a7d8f3";k.beginPath();k.rect(h+c-15+1,f+8,13,6);k.fill();k.strokeStyle="#c0e4f8";k.beginPath();k.moveTo(h+c-15+1,f+7);k.lineTo(h+c-1,f+7);k.stroke();var b=k.createLinearGradient(h+c-15+6,f+7,h+c-15+10,f+7);b.addColorStop(0,"#0d2a3a");b.addColorStop(1,"#4e9ac4");k.fillStyle=b;k.beginPath();k.moveTo(h+c-15+6,f+4);k.lineTo(h+c-15+10,f+8);k.lineTo(h+c-15+6,f+11);k.closePath();k.fill();k.lineWidth=1;k.strokeStyle="#15598a";k.beginPath();k.rect(h+((i*(c-55))/d)+16,f,25,15);k.stroke();k.fillStyle="#6ac1e5";k.beginPath();k.rect(h+((i*(c-55))/d)+16+1,f+8,23,6);k.fill();k.fillStyle="#b7e4f7";k.beginPath();k.rect(h+((i*(c-55))/d)+16+1,f+1,23,6);k.fill();k.strokeStyle="#8fd5f3";k.beginPath();k.moveTo(h+((i*(c-55))/d)+16+1,f+8);k.lineTo(h+((i*(c-55))/d)+16+22,f+8);k.stroke();var b=k.createLinearGradient(h+((i*(c-55))/d)+16+8,f+4,h+((i*(c-55))/d)+16+8,f+10);b.addColorStop(0,"#2b404b");b.addColorStop(1,"#5888a1");k.strokeStyle=b;k.beginPath();k.moveTo(h+((i*(c-55))/d)+16+8,f+4);k.lineTo(h+((i*(c-55))/d)+16+8,f+10);k.stroke();k.beginPath();k.moveTo(h+((i*(c-55))/d)+16+11,f+4);k.lineTo(h+((i*(c-55))/d)+16+11,f+10);k.stroke();k.beginPath();k.moveTo(h+((i*(c-55))/d)+16+14,f+4);k.lineTo(h+((i*(c-55))/d)+16+14,f+10);k.stroke();var b=k.createLinearGradient(h+((i*(c-55))/d)+16+8,f+4,h+((i*(c-55))/d)+16+8,f+10);b.addColorStop(0,"#447791");b.addColorStop(1,"#96bed3");k.strokeStyle=b;k.beginPath();k.moveTo(h+((i*(c-55))/d)+16+9,f+4);k.lineTo(h+((i*(c-55))/d)+16+9,f+10);k.stroke();k.beginPath();k.moveTo(h+((i*(c-55))/d)+16+12,f+4);k.lineTo(h+((i*(c-55))/d)+16+12,f+10);k.stroke();k.beginPath();k.moveTo(h+((i*(c-55))/d)+16+15,f+4);k.lineTo(h+((i*(c-55))/d)+16+15,f+10);k.stroke()}}function scrollBarClick(d,b,f){var c=getScrollBarProps(d,b);var h=f.calcX;var a=f.calcY;if(c.Alignment==1){if(h>c.X&&h<c.X+15&&a>c.Y&&a<c.Y+15&&c.SelectedID-1>=0){if(c.CustomIncrementFunction){c.CustomIncrementFunction(getSelectedTag(c.CanvasID,c.WindowID),c,0)}--c.SelectedID}else{if(h>c.X&&h<c.X+15&&a>c.Y+c.Len-15&&a<c.Y+c.Len&&c.SelectedID+1<c.MaxItems){if(c.CustomIncrementFunction){c.CustomIncrementFunction(getSelectedTag(c.CanvasID,c.WindowID),c,1)}++c.SelectedID}}}else{if(h>c.X&&h<c.X+15&&a>c.Y&&a<c.Y+15&&c.SelectedID-1>=0){if(c.CustomIncrementFunction){c.CustomIncrementFunction(getSelectedTag(c.CanvasID,c.WindowID),c,0)}--c.SelectedID}else{if(h>c.X+c.Len-15&&h<c.X+c.Len&&a>c.Y&&a<c.Y+15&&c.SelectedID+1<c.MaxItems){if(c.CustomIncrementFunction){c.CustomIncrementFunction(getSelectedTag(c.CanvasID,c.WindowID),c,1)}++c.SelectedID}}}var g=getWindowProps(d,c.OwnedByWindowID);if(g){invalidateRect(d,null,g.X,g.Y,g.Width,g.Height)}}function scrollBarMouseDown(d,b,f){var c=getScrollBarProps(d,b);var a=f.calcX;var g=f.calcY;if(c.Alignment==1){if(a>c.X&&a<c.X+15&&g>c.Y+((c.SelectedID*(c.Len-55))/c.MaxItems)+16&&g<c.Y+((c.SelectedID*(c.Len-55))/c.MaxItems)+16+25){c.MouseDownState=1}}else{if(g>c.Y&&g<c.Y+15&&a>c.X+((c.SelectedID*(c.Len-55))/c.MaxItems)+16&&a<c.X+((c.SelectedID*(c.Len-55))/c.MaxItems)+16+25){c.MouseDownState=1}}}function scrollBarMouseMove(f,b,g){var d=getScrollBarProps(f,b);var c=d.SelectedID;if(d.MouseDownState==1){if(d.Alignment==1){var i=g.calcY;if(i<d.Y){d.SelectedID=1}else{if(i>d.Y+d.Len){d.SelectedID=d.MaxItems}else{d.SelectedID=Math.floor(((i-d.Y)*d.MaxItems)/d.Len)}}}else{var a=g.calcX;if(a<d.X){d.SelectedID=1}else{if(a>d.X+d.Len){d.SelectedID=d.MaxItems}else{d.SelectedID=Math.floor(((a-d.X)*d.MaxItems)/d.Len)}}}if(d.CustomMouseMoveFunction!=null){d.CustomMouseMoveFunction(d,d.SelectedID)}}if(d.SelectedID!=c){var h=getWindowProps(f,d.OwnedByWindowID);if(h){invalidateRect(f,null,h.X,h.Y,h.Width,h.Height)}}}function scrollBarMouseUp(c,a){var b=getScrollBarProps(c,a);b.MouseDownState=0}function scrollBarLostFocus(c,a){var b=getScrollBarProps(c,a);b.MouseDownState=0}var scrollbarSelectedTags=new Array();function setSelectedTag(d,a,e){var c=0;for(var b=0;b<scrollbarSelectedTags.length;b++){if(scrollbarSelectedTags[b][0]==d&&scrollbarSelectedTags[b][1]==a){c=1;scrollbarSelectedTags[b][2]=e;break}}if(c==0){scrollbarSelectedTags.push([d,a,e])}}function getSelectedTag(c,a){for(var b=0;b<scrollbarSelectedTags.length;b++){if(scrollbarSelectedTags[b][0]==c&&scrollbarSelectedTags[b][1]==a){return scrollbarSelectedTags[b][2]}}}function CCLScrollbar(){}CCLScrollbar.prototype={CanvasID:null,WindowID:null,X:null,Y:null,Len:null,SelectedID:null,MaxItems:null,Alignment:null,MouseDownState:null,Tag:null,OwnedByWindowID:null,DrawFunction:null,CustomIncrementFunction:null,CustomMouseMoveFunction:null,ControlNameID:null,Depth:null,ClickFunction:null,SelectedTag:null,Initialize:function(){return createScrollBar(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Len,this.Depth,this.MaxItems,this.Alignment,this.OwnedByWindowID,this.DrawFunction,this.ClickFunction,this.Tag,this.CustomIncrementFunction,this.SelectedTag,this.CustomMouseMoveFunction)}};function createScrollBar(a,d,p,o,j,f,k,m,i,e,c,q,b,h,g,n){var l;if(m==1){l=createWindow(a,p,o,15,j,f,null,"ScrollBar",d,n)}else{l=createWindow(a,p,o,j,15,f,null,"ScrollBar",d,n)}scrollBarPropsArray.push({CanvasID:a,WindowID:l,X:p,Y:o,Len:j,SelectedID:0,MaxItems:k,Alignment:m,MouseDownState:0,Tag:q,OwnedByWindowID:i,DrawFunction:e,CustomIncrementFunction:b,CustomMouseMoveFunction:g});if(c==null){registerClickFunction(l,scrollBarClick,a)}else{registerClickFunction(l,c,a)}if(e==null){registerWindowDrawFunction(l,function(){drawScrollBar(a,l)},a)}else{registerWindowDrawFunction(l,function(){e(a,l)},a)}registerMouseDownFunction(l,scrollBarMouseDown,a);registerMouseMoveFunction(l,scrollBarMouseMove,a);registerMouseUpFunction(l,scrollBarMouseUp,a);registerLostFocusFunction(a,l,scrollBarLostFocus);return l}var gridPropsArray=new Array();function getGridProps(c,a){for(var b=0;b<gridPropsArray.length;b++){if(gridPropsArray[b].CanvasID==c&&gridPropsArray[b].WindowID==a){return gridPropsArray[b]}}}function CCLGrid(){}CCLGrid.prototype={CanvasID:null,WindowID:null,X:null,Y:null,Width:null,Height:null,RowData:null,HeaderData:null,RowDataTextColor:null,RowDataTextFontString:null,HeaderDataTextColor:null,HeaderDataTextHeight:null,HeaderDataTextFontString:null,CellClickFunction:null,DataRowHeight:null,ColumnWidthArray:null,HeaderRowHeight:null,HasBorder:null,BorderColor:null,BorderLineWidth:null,VScrollBarWindowId:null,HScrollBarWindowId:null,HeaderBackgroundStartColor:null,HeaderBackgroundEndColor:null,AltRowBgColorStart1:null,AltRowBgColorEnd1:null,AltRowBgColorStart2:null,AltRowBgColorEnd2:null,Tag:null,HasSelectedRow:null,SelectedRowBgColor:null,HasSelectedCell:null,SelectedCellBgColor:null,SelectedRow:null,SelectedCell:null,HasSorting:null,SortableColumnsArray:null,HasSortImages:null,SortImageURLsArray:null,SortImageShowIndex:null,SortedData:null,CustomSortFunction:null,HasFilters:null,FilterColumnsArray:null,HasFilterImageIcon:null,FilterImageIcon:null,FilteredData:null,SortClickExtents:null,HasUIDs:null,UIDs:null,ControlNameID:null,DrawHeaderCellFunction:null,DrawRowDataCellFunction:null,RowDataTextHeight:null,Depth:null,TabStopIndex:null,Initialize:function(){return createGrid(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.RowData,this.HeaderData,this.RowDataTextColor,this.RowDataTextHeight,this.RowDataTextFontString,this.HeaderDataTextColor,this.HeaderDataTextHeight,this.HeaderDataTextFontString,this.DrawRowDataCellFunction,this.DrawHeaderCellFunction,this.CellClickFunction,this.DataRowHeight,this.HeaderRowHeight,this.ColumnWidthArray,this.HasBorder,this.BorderColor,this.BorderLineWidth,this.HeaderBackgroundStartColor,this.HeaderBackgroundEndColor,this.AltRowBgColorStart1,this.AltRowBgColorEnd1,this.AltRowBgColorStart2,this.AltRowBgColorEnd2,this.Tag,this.HasSelectedRow,this.SelectedRowBgColor,this.HasSelectedCell,this.SelectedCellBgColor,this.HasSorting,this.SortableColumnsArray,this.HasSortImages,this.SortImageURLsArray,this.SortImageShowIndex,this.CustomSortFunction,this.HasUIDs,this.UIDs,this.HasFilters,this.FilterColumnsArray,this.HasFilterImageIcon,this.FilterImageIcon,this.TabStopIndex)}};function createGrid(L,R,Q,P,a,d,g,T,h,e,B,ac,I,aa,K,D,t,F,H,s,c,Z,M,n,X,v,q,o,p,m,V,E,w,C,ab,O,l,N,r,S,j,W,b,k,J,u,A,ae){var z=createWindow(L,Q,P,a,d,g,null,"Grid",R,null,ae);var G=0;for(var Y=0;Y<c.length;Y++){G+=c[Y]}var f=s+(H*T.length);var ad=null;if(f>d){ad=createScrollBar(L,R+"VS",Q+a,P,d,g,T.length,1,z)}var U=null;if(G>a){U=createScrollBar(L,R+"HS",Q,P+d,a,g,c.length,0,z)}gridPropsArray.push({CanvasID:L,WindowID:z,X:Q,Y:P,Width:a,Height:d,RowData:T,HeaderData:h,RowDataTextColor:e,RowDataTextFontString:ac,HeaderDataTextColor:I,HeaderDataTextHeight:aa,HeaderDataTextFontString:K,CellClickFunction:F,DataRowHeight:H,ColumnWidthArray:c,HeaderRowHeight:s,HasBorder:Z,BorderColor:M,BorderLineWidth:n,VScrollBarWindowId:ad,HScrollBarWindowId:U,HeaderBackgroundStartColor:X,HeaderBackgroundEndColor:v,AltRowBgColorStart1:q,AltRowBgColorEnd1:o,AltRowBgColorStart2:p,AltRowBgColorEnd2:m,Tag:V,HasSelectedRow:E,SelectedRowBgColor:w,HasSelectedCell:C,SelectedCellBgColor:ab,SelectedRow:-1,SelectedCell:-1,HasSorting:O,SortableColumnsArray:l,HasSortImages:N,SortImageURLsArray:r,SortImageShowIndex:S,SortedData:T,CustomSortFunction:j,HasFilters:k,FilterColumnsArray:J,HasFilterImageIcon:u,FilterImageIcon:A,FilteredData:T,SortClickExtents:new Array(),HasUIDs:W,OrigUIDs:b,SortedUIDs:b,DrawHeaderCellFunction:t,DrawRowDataCellFunction:D,RowDataTextHeight:B});if(O==1&&checkIfAllUnsorted(getGridProps(L,z))==0){if(j!=null){j(getGridProps(L,z))}else{sortGridData(getGridProps(L,z))}}registerWindowDrawFunction(z,drawGrid,L);registerClickFunction(z,clickGrid,L);if(ae!=null&&ae>0){registerKeyDownFunction(L,function(){},z)}return z}function drawGrid(b,n){var h=getGridProps(b,n);var d=getScrollBarProps(b,h.VScrollBarWindowId);var s=getScrollBarProps(b,h.HScrollBarWindowId);var p=getCtx(b);var o=0;if(d!=null){o=d.SelectedID}var e=0;if(s!=null){e=s.SelectedID}var j=0;h.SortClickExtents=new Array();for(var m=e;m<h.ColumnWidthArray.length;m++){if(j>=h.Width){break}j+=h.ColumnWidthArray[m];var k=p.createLinearGradient(h.X+j-h.ColumnWidthArray[m],h.Y,h.X+j-h.ColumnWidthArray[m],h.Y+h.HeaderRowHeight);k.addColorStop(0,h.HeaderBackgroundStartColor);k.addColorStop(1,h.HeaderBackgroundEndColor);p.fillStyle=k;p.beginPath();p.rect(h.X+j-h.ColumnWidthArray[m],h.Y,(j>h.Width?h.ColumnWidthArray[m]+h.Width-j:h.ColumnWidthArray[m]),h.HeaderRowHeight);p.fill();p.save();p.beginPath();p.rect(h.X+j-h.ColumnWidthArray[m],h.Y,(j>h.Width?h.ColumnWidthArray[m]+h.Width-j:h.ColumnWidthArray[m]),h.HeaderRowHeight);p.clip();p.fillStyle=h.HeaderDataTextColor;p.font=h.HeaderDataTextFontString;p.fillText(h.HeaderData[m],h.X+j-h.ColumnWidthArray[m],h.Y+h.HeaderRowHeight-((h.HeaderRowHeight-h.HeaderDataTextHeight)/2));p.restore();if(h.HasBorder==1){p.strokeStyle=h.BorderColor;p.lineWidth=h.BorderLineWidth;p.beginPath();p.rect(h.X+j-h.ColumnWidthArray[m],h.Y,h.ColumnWidthArray[m]+h.Width-j,h.HeaderRowHeight);p.stroke()}var l=getGridSortedColumnIndex(h,m);if(h.HasSorting==1&&l>-1){var i=h.Y+((h.HeaderRowHeight-9)/2);if(h.SortableColumnsArray[l][2]=="Ascending"){p.strokeStyle="#FFFFFF";p.beginPath();p.moveTo(h.X+j-6,i+3);p.lineTo(h.X+j-6,i+12);p.lineTo(h.X+j-9,i+9);p.moveTo(h.X+j-2,i+9);p.lineTo(h.X+j-6,i+12);p.stroke();h.SortClickExtents.push([m,h.X+j-9,i+3,7,9])}else{if(h.SortableColumnsArray[l][2]=="Descending"){p.strokeStyle="#FFFFFF";p.beginPath();p.moveTo(h.X+j-6,i+12);p.lineTo(h.X+j-6,i+3);p.lineTo(h.X+j-9,i+5);p.moveTo(h.X+j-2,i+5);p.lineTo(h.X+j-6,i+3);p.stroke();h.SortClickExtents.push([m,h.X+j-9,i+3,7,9])}else{if(h.SortableColumnsArray[l][2]=="Unsorted"){p.strokeStyle="#FFFFFF";p.beginPath();p.rect(h.X+j-11,i+3,9,9);p.stroke();h.SortClickExtents.push([m,h.X+j-11,i+3,9,9])}}}}}var f=0;for(var a=o;a<(h.HasSorting==1?h.SortedData.length:h.RowData.length);a++){if(((a-o)*h.DataRowHeight)+h.HeaderRowHeight>=h.Height){break}var j=0;for(var m=e;m<h.ColumnWidthArray.length;m++){if(j>=h.Width){break}j+=h.ColumnWidthArray[m];p.save();p.beginPath();p.rect(h.X+j-h.ColumnWidthArray[m],h.Y+((a-o)*h.DataRowHeight)+h.HeaderRowHeight,(j>h.Width?h.ColumnWidthArray[m]+h.Width-j:h.ColumnWidthArray[m]),h.DataRowHeight);p.clip();var q=p.createLinearGradient(h.X+j-h.ColumnWidthArray[m],h.Y+((a-o)*h.DataRowHeight)+h.HeaderRowHeight,h.X+j-h.ColumnWidthArray[m],h.Y+((a-o)*h.DataRowHeight)+h.HeaderRowHeight+h.DataRowHeight);if(f==0){q.addColorStop(0,h.AltRowBgColorStart1);q.addColorStop(1,h.AltRowBgColorEnd1)}else{q.addColorStop(0,h.AltRowBgColorStart2);q.addColorStop(1,h.AltRowBgColorEnd2)}p.fillStyle=q;p.beginPath();p.rect(h.X+j-h.ColumnWidthArray[m],h.Y+((a-o)*h.DataRowHeight)+h.HeaderRowHeight,(j>h.Width?h.ColumnWidthArray[m]+h.Width-j:h.ColumnWidthArray[m]),h.DataRowHeight);p.fill();if(h.HasSelectedRow==1&&h.SelectedRowBgColor&&a==h.SelectedRow){p.fillStyle=h.SelectedRowBgColor;p.beginPath();p.rect(h.X+j-h.ColumnWidthArray[m],h.Y+((a-o)*h.DataRowHeight)+h.HeaderRowHeight,(j>h.Width?h.ColumnWidthArray[m]+h.Width-j:h.ColumnWidthArray[m]),h.DataRowHeight);p.fill()}if(h.HasSelectedCell==1&&h.SelectedCellBgColor&&m==h.SelectedCell){p.fillStyle=h.SelectedCellBgColor;p.beginPath();p.rect(h.X+j-h.ColumnWidthArray[m],h.Y+((a-o)*h.DataRowHeight)-((h.DataRowHeight-h.HeaderDataTextHeight)/2)+h.HeaderRowHeight+h.DataRowHeight,h.ColumnWidthArray[m],h.DataRowHeight);p.fill()}p.beginPath();if((h.HasSorting==1?h.SortedData:h.RowData)[a][m]){p.fillStyle=h.RowDataTextColor;p.font=h.RowDataTextFontString;p.fillText((h.HasSorting==1?h.SortedData:h.RowData)[a][m],h.X+j-h.ColumnWidthArray[m],h.Y+((a-o)*h.DataRowHeight)-((h.DataRowHeight-h.HeaderDataTextHeight)/2)+h.HeaderRowHeight+h.DataRowHeight)}p.restore();if(h.HasBorder==1){p.strokeStyle=h.BorderColor;p.lineWidth=h.BorderLineWidth;p.beginPath();p.rect(h.X+j-h.ColumnWidthArray[m],h.Y+((a-o)*h.DataRowHeight)+h.HeaderRowHeight,h.ColumnWidthArray[m]+h.Width-j,h.DataRowHeight);p.stroke()}}if(f==1){f=0}else{f=1}}}function clickGrid(b,o,m){var g=getGridProps(b,o);var d=getScrollBarProps(b,g.VScrollBarWindowId);var u=getScrollBarProps(b,g.HScrollBarWindowId);var q=m.calcX;var p=m.calcY;var s=0;if(d!=null){s=d.SelectedID}var f=0;if(u!=null){f=u.SelectedID}for(var a=s;a<g.RowData.length;a++){if(((a-s)*g.DataRowHeight)+g.HeaderRowHeight>=g.Height){break}var l=0;for(var n=f;n<g.ColumnWidthArray.length;n++){if(l>=g.Width){break}l+=g.ColumnWidthArray[n];if(q>g.X+l-g.ColumnWidthArray[n]&&p>g.Y+((a-s)*g.DataRowHeight)+g.HeaderRowHeight&&q<g.X+l-g.ColumnWidthArray[n]+(l>g.Width?g.ColumnWidthArray[n]+g.Width-l:g.ColumnWidthArray[n])&&p<g.DataRowHeight+g.Y+((a-s)*g.DataRowHeight)+g.HeaderRowHeight){g.SelectedRow=a;g.SelectedCell=n;if(g.CellClickFunction){g.CellClickFunction(b,o,n+1,a+1)}return}}}var t=0;if(g.HasSorting==1){for(var k=0;k<g.SortClickExtents.length;k++){if(q>g.SortClickExtents[k][1]&&q<g.SortClickExtents[k][1]+g.SortClickExtents[k][3]&&p>g.SortClickExtents[k][2]&&p<g.SortClickExtents[k][2]+g.SortClickExtents[k][4]){for(var h=0;h<g.SortableColumnsArray.length;h++){if(g.SortableColumnsArray[h][0]==g.SortClickExtents[k][0]){if(g.SortableColumnsArray[h][2]=="Unsorted"){g.SortableColumnsArray[h][2]="Ascending";t=1}else{if(g.SortableColumnsArray[h][2]=="Ascending"){g.SortableColumnsArray[h][2]="Descending";t=1}else{if(g.SortableColumnsArray[h][2]="Descending"){g.SortableColumnsArray[h][2]="Unsorted";t=1}}}}}}}}if(t==1){if(g.CustomSortFunction!=null){g.CustomSortFunction(g)}else{sortGridData(g)}invalidateRect(g.CanvasID,null,g.X,g.Y,g.Width,g.Height)}}function getGridSortedColumnIndex(b,d){if(b.SortableColumnsArray){for(var a=0;a<b.SortableColumnsArray.length;a++){if(b.SortableColumnsArray[a][0]==d){return a}}}return -1}function checkIfAllUnsorted(b){for(var a=0;a<b.SortableColumnsArray.length;a++){if(b.SortableColumnsArray[a][2]!="Unsorted"){return 0}}return 1}function sortGridData(d){if(d.SortedData&&d.SortedData.length>1&&checkIfAllUnsorted(d)==0){var e=new Array();var f=new Array();e.push(d.SortedData[0]);if(d.HasUIDs==1){f.push(d.SortedUIDs[0])}for(var a=1;a<d.SortedData.length;a++){var j=e.length;for(var b=0;b<e.length;b++){var i=1;for(var k=0;k<d.SortedData[a].length;k++){var h=getGridSortedColumnIndex(d,k);if(h>-1){if(d.SortableColumnsArray[h][1]=="Alphabetical"&&d.SortableColumnsArray[h][2]!="Unsorted"){var g;if(d.SortableColumnsArray[h][1]=="Alphabetical"){g=d.SortedData[a][k]&&e[b][k]?d.SortedData[a][k].localeCompare(e[b][k]):d.SortedData[a][k]&&!e[b][k]?1:!d.SortedData[a][k]&&!e[b][k]?0:-1}else{if(d.SortableColumnsArray[h][1]=="Numerical"||d.SortableColumnsArray[h][1]=="Date"){g=d.SortedData[a][k]&&e[b][k]?Number(d.SortedData[a][k])>Number(e[b][k])?1:Number(d.SortedData[a][k])<Number(e[b][k])?-1:0:!d.SortedData[a][k]&&!e[b][k]?0:d.SortedData[a][k]&&!e[b][k]?1:-1}}if(d.SortableColumnsArray[h][2]=="Ascending"){if(g==1){g=-1}else{if(g=-1){g=1}}}if(g<=i){i=g}}}}if(i==1){j=b;break}else{j=b+1}}e.splice(j,0,d.SortedData[a]);if(d.HasUIDs==1){f.splice(j,0,d.SortedUIDs[a])}}d.SortedData=e;if(d.HasUIDs==1){d.SortedUIDs=f}}else{d.SortedData=d.RowData;if(d.HasUIDs==1){d.SortedUIDs=d.OrigUIDs}}}var comboboxPropsArray=new Array();function getComboboxPropsByTextAreaWindowId(c,a){for(var b=0;b<comboboxPropsArray.length;b++){if(comboboxPropsArray[b].CanvasID==c&&comboboxPropsArray[b].TextAreaWindowID==a){return comboboxPropsArray[b]}}}function getComboboxPropsByButtonWindowId(c,a){for(var b=0;b<comboboxPropsArray.length;b++){if(comboboxPropsArray[b].CanvasID==c&&comboboxPropsArray[b].ButtonWindowID==a){return comboboxPropsArray[b]}}}function getComboboxPropsByListAreaWindowId(c,a){for(var b=0;b<comboboxPropsArray.length;b++){if(comboboxPropsArray[b].CanvasID==c&&comboboxPropsArray[b].ListAreaWindowID==a){return comboboxPropsArray[b]}}}function getComboboxPropsByScrollBarWindowId(c,a){for(var b=0;b<comboboxPropsArray.length;b++){if(comboboxPropsArray[b].CanvasID==c&&comboboxPropsArray[b].VScrollBarWindowID==a){return comboboxPropsArray[b]}}}function CCLCombobox(){}CCLCombobox.prototype={CanvasID:null,TextAreaWindowID:null,ButtonWindowID:null,ListAreaWindowID:null,VScrollBarWindowID:null,X:null,Y:null,Width:null,Height:null,Data:null,SelectedID:null,TextAreaTextColor:null,TextAreaTextHeight:null,TextAreaFontString:null,ListAreaTextColor:null,ListAreaTextHeight:null,ListAreaFontString:null,OnSelectionChanged:null,Tag:null,DrawListAreaFunction:null,ListAreaClickFunction:null,ControlNameID:null,ButtonClickFunction:null,DrawButtonFunction:null,DrawTextAreaFunction:null,Depth:null,TabStopIndex:null,Initialize:function(){return createComboBox(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.Data,this.DrawTextAreaFunction,this.DrawButtonFunction,this.DrawListAreaFunction,this.ButtonClickFunction,this.ListAreaClickFunction,this.TextAreaTextColor,this.TextAreaTextHeight,this.TextAreaFontString,this.ListAreaTextColor,this.ListAreaTextHeight,this.ListAreaFontString,this.OnSelectionChanged,this.Tag,this.TabStopIndex)}};function createComboBox(p,b,i,f,o,k,A,z,l,r,u,w,a,d,h,g,q,n,m,t,B,e){var j=createWindow(p,i,f,o-k,k,A,null,"ComboBoxTextArea",b+"ComboBoxTextArea",null,e);var c=createWindow(p,i+o-k,f,k,k,A,null,"ComboBoxButton",b+"ComboBoxButton",j,e);var s=createWindow(p,i,f+k,o-15,100,A,null,"ComboBoxListArea",b+"ComboBoxListArea",j,e);var v=createScrollBar(p,b+"VS",i+o-15,f+k,100,A,z.length,1,s,function(){drawComboboxScrollBar(p,v)},null,j,e);comboboxPropsArray.push({CanvasID:p,WindowID:j,TextAreaWindowID:j,ButtonWindowID:c,ListAreaWindowID:s,VScrollBarWindowID:v,X:i,Y:f,Width:o,Height:k,Data:z,SelectedID:0,TextAreaTextColor:d,TextAreaTextHeight:h,TextAreaFontString:g,ListAreaTextColor:q,ListAreaTextHeight:n,ListAreaFontString:m,OnSelectionChanged:t,Tag:B,DrawListAreaFunction:u,ListAreaClickFunction:a,ButtonClickFunction:w,DrawButtonFunction:r,DrawTextAreaFunction:l});if(l!=null){registerWindowDrawFunction(j,function(){l(p,j)},p)}else{registerWindowDrawFunction(j,function(){drawComboboxTextArea(p,j)},p)}if(r!=null){registerWindowDrawFunction(c,function(){r(p,c)},p)}else{registerWindowDrawFunction(c,function(){drawComboboxButton(p,c)},p)}if(u!=null){registerWindowDrawFunction(s,function(){u(p,s)},p)}else{registerWindowDrawFunction(s,function(){drawComboboxListArea(p,s)},p)}if(w!=null){registerClickFunction(c,w,p)}else{registerClickFunction(c,comboboxButtonClick,p)}if(a!=null){registerClickFunction(s,a,p)}else{registerClickFunction(s,comboboxListAreaClick,p)}registerModalWindow(p,s);registerHiddenWindow(p,s,1);registerModalWindow(p,v);registerHiddenWindow(p,v,1);registerLostFocusFunction(p,s,function(){comboboxListAreaLostFocus(p,s)});registerLostFocusFunction(p,j,function(){comboboxTextAreaLostFocus(p,j)});registerLostFocusFunction(p,v,function(){comboboxScrollBarLostFocus(p,v)});registerLostFocusFunction(p,c,function(){comboboxButtonLostFocus(p,c)});if(e!=null&&e>0){registerKeyDownFunction(p,function(y,x,C){if(C.keyCode==40){var D=getComboboxPropsByTextAreaWindowId(y,j);if(checkIfHiddenWindow(y,D.ListAreaWindowID)==1){setHiddenWindowStatus(y,D.VScrollBarWindowID,0);setHiddenWindowStatus(y,D.ListAreaWindowID,0);invalidateRect(y,null,D.X,D.Y,D.Width+1,D.Height+101)}}else{if(C.keyCode==38){var D=getComboboxPropsByTextAreaWindowId(y,j);if(checkIfHiddenWindow(y,D.ListAreaWindowID)!=1){setHiddenWindowStatus(y,D.VScrollBarWindowID,1);setHiddenWindowStatus(y,D.ListAreaWindowID,1);invalidateRect(y,null,D.X,D.Y,D.Width+1,D.Height+101)}}}},j)}return j}function drawComboboxScrollBar(b,a){drawScrollBar(b,a)}function drawComboboxTextArea(c,a){var d=getComboboxPropsByTextAreaWindowId(c,a);var b=getCtx(c);b.clearRect(d.X,d.Y,d.Width,d.Height);b.fillStyle=d.TextAreaTextColor;b.font=d.TextAreaFontString;if(d.SelectedID<d.Data.length&&d.SelectedID>=0){b.fillText(d.Data[d.SelectedID],d.X+5,d.Y+d.Height-(d.TextAreaTextHeight/2))}else{b.fillText(d.Data[0],d.X+5,d.Y+d.Height-(d.TextAreaTextHeight/2))}b.strokeStyle="#b7bfc8";b.beginPath();b.rect(d.X,d.Y,d.Width-d.Height,d.Height);b.stroke()}function drawComboboxButton(d,a){var e=getComboboxPropsByButtonWindowId(d,a);var b=getCtx(d);b.lineCap="butt";b.strokeStyle="#3c7fb1";b.beginPath();b.rect(e.X+e.Width-e.Height,e.Y,e.Height,e.Height);b.stroke();b.fillStyle="#dcf0fb";b.beginPath();b.rect(e.X+e.Width-e.Height+1,e.Y+1,(e.Height/2)-2,e.Height-2);b.fill();b.strokeStyle="#c0e4f8";b.moveTo(e.X+e.Width-(e.Height/2)+1,e.Y+1);b.lineTo(e.X+e.Width-(e.Height/2)+1,e.Y+e.Height-1);b.stroke();b.fillStyle="#a7d8f3";b.beginPath();b.rect(e.X+e.Width-(e.Height/2)+1,e.Y+1,(e.Height/2)-2,e.Height-2);b.fill();var c=b.createLinearGradient(e.X+e.Width-(e.Height/2)-1,e.Y+(e.Height/2)-1,e.X+e.Width-(e.Height/2)-1,e.Y+(e.Height/2)+3);c.addColorStop(0,"#0d2a3a");c.addColorStop(1,"#4e9ac4");b.fillStyle=c;b.beginPath();b.moveTo(e.X+e.Width-(e.Height/2)-4,e.Y+(e.Height/2)-1);b.lineTo(e.X+e.Width-(e.Height/2)+3,e.Y+(e.Height/2)-1);b.lineTo(e.X+e.Width-(e.Height/2)-1,e.Y+(e.Height/2)+3);b.closePath();b.fill()}function comboboxButtonClick(b,a){var c=getComboboxPropsByButtonWindowId(b,a);if(checkIfHiddenWindow(b,c.ListAreaWindowID)==1){setHiddenWindowStatus(b,c.VScrollBarWindowID,0);setHiddenWindowStatus(b,c.ListAreaWindowID,0)}else{setHiddenWindowStatus(b,c.VScrollBarWindowID,1);setHiddenWindowStatus(b,c.ListAreaWindowID,1)}invalidateRect(b,null,c.X,c.Y,c.Width+1,c.Height+101)}function drawComboboxListArea(e,a){var f=getComboboxPropsByListAreaWindowId(e,a);var c=getScrollBarProps(e,f.VScrollBarWindowID);var b=getCtx(e);b.fillStyle="#FFFFFF";b.beginPath();b.rect(f.X,f.Y+f.Height,f.Width-15,100);b.fill();b.fillStyle=f.ListAreaTextColor;b.font=f.ListAreaFontString;for(var d=c.SelectedID;d<f.Data.length&&((f.ListAreaTextHeight+6)*(d-c.SelectedID+1))<100;d++){b.fillText(f.Data[d],f.X+5,f.Y+f.Height+((f.ListAreaTextHeight+6)*(d-c.SelectedID+1)))}b.strokeStyle="#b7bfc8";b.beginPath();b.rect(f.X,f.Y+f.Height,f.Width-15,100);b.stroke()}function comboboxListAreaClick(a,g,f){var h=getComboboxPropsByListAreaWindowId(a,g);var b=getScrollBarProps(a,h.VScrollBarWindowID);var k=f.calcX;var j=f.calcY;for(var d=b.SelectedID;d<h.Data.length&&((h.ListAreaTextHeight+6)*(d-b.SelectedID+1))<100;d++){if(k>h.X&&j>h.Y+h.Height+((h.ListAreaTextHeight+6)*(d-b.SelectedID))&&k<h.X+h.Width-15&&j<h.Y+h.Height+((h.ListAreaTextHeight+6)*(d-b.SelectedID+1))){if(h.SelectedID!=d){h.SelectedID=d;setHiddenWindowStatus(a,h.VScrollBarWindowID,1);setHiddenWindowStatus(a,h.ListAreaWindowID,1);var c=getCanvas(a);invalidateRect(a,null,0,0,c.width,c.height);if(h.OnSelectionChanged!=null){h.OnSelectionChanged(a,h.TextAreaWindowID,d)}}return}}}function comboboxListAreaLostFocus(b,a){var c=getComboboxPropsByListAreaWindowId(b,a);if(doesWindowHaveFocus(b,c.VScrollBarWindowID)==0&&doesWindowHaveFocus(b,c.TextAreaWindowID)==0&&doesWindowHaveFocus(b,c.ButtonWindowID)==0&&doingEventForWindowID!=c.ListAreaWindowID&&doingEventForWindowID!=c.VScrollBarWindowID){setHiddenWindowStatus(b,c.VScrollBarWindowID,1);setHiddenWindowStatus(b,c.ListAreaWindowID,1);invalidateRect(b,null,c.X,c.Y,c.Width+1,c.Height+101)}}function comboboxTextAreaLostFocus(b,a){var c=getComboboxPropsByTextAreaWindowId(b,a);if(doesWindowHaveFocus(b,c.VScrollBarWindowID)==0&&doesWindowHaveFocus(b,c.ListAreaWindowID)==0&&doesWindowHaveFocus(b,c.ButtonWindowID)==0&&doingEventForWindowID!=c.ListAreaWindowID&&doingEventForWindowID!=c.VScrollBarWindowID){setHiddenWindowStatus(b,c.VScrollBarWindowID,1);setHiddenWindowStatus(b,c.ListAreaWindowID,1);invalidateRect(b,null,c.X,c.Y,c.Width+1,c.Height+101)}}function comboboxButtonLostFocus(b,a){var c=getComboboxPropsByButtonWindowId(b,a);if(doesWindowHaveFocus(b,c.VScrollBarWindowID)==0&&doesWindowHaveFocus(b,c.ListAreaWindowID)==0&&doesWindowHaveFocus(b,c.TextAreaWindowID)==0&&doingEventForWindowID!=c.ListAreaWindowID&&doingEventForWindowID!=c.VScrollBarWindowID){setHiddenWindowStatus(b,c.VScrollBarWindowID,1);setHiddenWindowStatus(b,c.ListAreaWindowID,1);invalidateRect(b,null,c.X,c.Y,c.Width+1,c.Height+101)}}function comboboxScrollBarLostFocus(b,a){var c=getComboboxPropsByScrollBarWindowId(b,a);if(doesWindowHaveFocus(b,c.TextAreaWindowID)==0&&doesWindowHaveFocus(b,c.ListAreaWindowID)==0&&doesWindowHaveFocus(b,c.ButtonWindowID)==0&&doingEventForWindowID!=c.ListAreaWindowID&&doingEventForWindowID!=c.VScrollBarWindowID){setHiddenWindowStatus(b,c.VScrollBarWindowID,1);setHiddenWindowStatus(b,c.ListAreaWindowID,1);invalidateRect(b,null,c.X,c.Y,c.Width+1,c.Height+101)}}var checkboxPropsArray=new Array();function getcheckboxProps(c,a){for(var b=0;b<checkboxPropsArray.length;b++){if(checkboxPropsArray[b].CanvasID==c&&checkboxPropsArray[b].WindowID==a){return checkboxPropsArray[b]}}}function drawCheckbox(e,a){var c=getcheckboxProps(e,a);var b=getCtx(e);b.save();b.shadowOffsetX=1;b.shadowOffsetY=1;b.shadowBlur=5;b.shadowColor="#e3e3e3";b.strokeStyle="#3c7fb1";b.beginPath();b.rect(c.X,c.Y,15,15);b.stroke();b.lineCap="round";if(c.Status==1){b.lineWidth=4;var d=b.createLinearGradient(c.X,c.Y,c.X+15,c.Y+15);d.addColorStop(0,"#abffaf");d.addColorStop(1,"#00ff0c");b.strokeStyle=d;b.beginPath();b.moveTo(c.X+3,c.Y+9);b.lineTo(c.X+6,c.Y+12);b.lineTo(c.X+18,c.Y-3);b.stroke()}else{b.lineWidth=3;var d=b.createLinearGradient(c.X,c.Y,c.X+15,c.Y+15);d.addColorStop(0,"#ff2a2a");d.addColorStop(1,"#ff6b6b");b.strokeStyle=d;b.beginPath();b.moveTo(c.X+4,c.Y+4);b.lineTo(c.X+11,c.Y+11);b.moveTo(c.X+11,c.Y+4);b.lineTo(c.X+4,c.Y+11);b.stroke()}b.restore()}function CCLCheckbox(){}CCLCheckbox.prototype={CanvasID:null,X:null,Y:null,Status:null,Tag:null,ControlNameID:null,Depth:null,TabStopIndex:null,Initialize:function(){return createCheckbox(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Depth,this.Status,this.Tag,this.TabStopIndex)}};function createCheckbox(a,b,h,g,d,c,i,e){var f=createWindow(a,h,g,15,15,d,null,"CheckBox",b,null,e);checkboxPropsArray.push({CanvasID:a,WindowID:f,X:h,Y:g,Status:c,Tag:i});registerClickFunction(f,function(){var j=getcheckboxProps(a,f);if(j.Status==1){j.Status=0}else{j.Status=1}},a);registerWindowDrawFunction(f,function(){drawCheckbox(a,f)},a);if(e!=null&&e>0){registerKeyDownFunction(a,function(){},f)}return f}var radiobuttonPropsArray=new Array();function getRadioButtonProps(c,a){for(var b=0;b<radiobuttonPropsArray.length;b++){if(radiobuttonPropsArray[b].CanvasID==c&&radiobuttonPropsArray[b].WindowID==a){return radiobuttonPropsArray[b]}}}function CCLRadioButtonGroup(){}CCLRadioButtonGroup.prototype={CanvasID:null,WindowID:null,X:null,Y:null,Width:null,Height:null,Alignment:null,GroupName:null,Labels:null,SelectedID:null,LabelTextColor:null,LabelFontString:null,Radius:null,LabelTextHeight:null,Tag:null,ControlNameID:null,Depth:null,TabStopIndex:null,Initialize:function(){return createRadioButtonGroup(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Alignment,this.Depth,this.GroupName,this.Labels,this.SelectedID,this.LabelTextColor,this.LabelFontString,this.LabelTextHeight,this.Radius,this.Tag,this.TabStopIndex)}};function createRadioButtonGroup(n,a,k,j,h,v,e,r,b,p,s,t,d,w,g){var c=document.getElementById(n);var o=c.getContext("2d");o.font=s;var l=0;if(2*d>=t+8){l=2*d}else{l=t+8}var m=0;for(var q=0;q<r.length;q++){var u=o.measureText(r[q]).width;m+=u+8+(2*d)}var f=createWindow(n,k,j,m,l,v,null,"RadioButtonGroup",a,null,g);radiobuttonPropsArray.push({CanvasID:n,WindowID:f,X:k,Y:j,Width:m,Height:l,Alignment:h,GroupName:e,Labels:r,SelectedID:b,LabelTextColor:p,LabelFontString:s,Radius:d,ButtonExtents:new Array(),LabelTextHeight:t,Tag:w});registerWindowDrawFunction(f,function(A,D){var C=getRadioButtonProps(A,D);var y=getCtx(A);var E=0;y.font=C.LabelFontString;var x=new Array();for(var B=0;B<C.Labels.length;B++){y.fillStyle=C.LabelTextColor;y.fillText(C.Labels[B],C.X+E,C.Y+C.Height-((C.Height-C.LabelTextHeight)/2));var z=y.measureText(C.Labels[B]).width;y.fillStyle="#fcfcfc";y.beginPath();y.arc(C.X+E+z+4+C.Radius,C.Y+C.Radius+((C.Height-(C.Radius*2))/2),C.Radius,0,Math.PI*2,false);y.fill();y.lineWidth=1;y.strokeStyle="#c4c4c4";y.beginPath();y.arc(C.X+E+z+4+C.Radius,C.Y+C.Radius+((C.Height-(C.Radius*2))/2),C.Radius-1,(Math.PI/180)*315,(Math.PI/180)*135,false);y.stroke();y.strokeStyle="#141414";y.beginPath();y.arc(C.X+E+z+4+C.Radius,C.Y+C.Radius+((C.Height-(C.Radius*2))/2),C.Radius-1,(Math.PI/180)*135,(Math.PI/180)*315,false);y.stroke();y.strokeStyle="#808080";y.beginPath();y.arc(C.X+E+z+4+C.Radius,C.Y+C.Radius+((C.Height-(C.Radius*2))/2),C.Radius-1,(Math.PI/180)*135,(Math.PI/180)*315,false);y.stroke();if(B==C.SelectedID){y.fillStyle="#51852f";y.beginPath();y.arc(C.X+E+z+4+C.Radius,C.Y+C.Radius+((C.Height-(C.Radius*2))/2),C.Radius-4,0,Math.PI*2,false);y.fill()}x.push({X:C.X+E+z+4,Y:C.Y,Width:C.Radius*2,Height:C.Height});E+=z+8+(2*C.Radius)}C.ButtonExtents=x},n);registerClickFunction(f,function(x,B,A){var z=getRadioButtonProps(x,B);var D=A.calcX;var C=A.calcY;for(var y=0;y<z.ButtonExtents.length;y++){if(D>z.ButtonExtents[y].X&&D<z.ButtonExtents[y].X+z.ButtonExtents[y].Width&&C>z.ButtonExtents[y].Y&&C<z.ButtonExtents[y].Y+z.ButtonExtents[y].Height){z.SelectedID=y;break}}},n);if(g!=null&&g>0){registerKeyDownFunction(n,function(){},f)}return f}var imageControlPropsArray=new Array();function getImageControlProps(c,a){for(var b=0;b<imageControlPropsArray.length;b++){if(imageControlPropsArray[b].CanvasID==c&&imageControlPropsArray[b].WindowID==a){return imageControlPropsArray[b]}}}var imageControlImages=new Array();function setImageControlImage(a,d){var c=0;for(var b=0;b<imageControlImages.length;b++){if(imageControlImages[b].CanvasID==a.CanvasID&&imageControlImages[b].WindowID==a.WindowID){c=1;imageControlImages[b].Image=d}}if(c==0){imageControlImages.push({CanvasID:a.CanvasID,WindowID:a.WindowID,Image:d})}}function getImageControlImage(a){for(var b=0;b<imageControlImages.length;b++){if(imageControlImages[b].CanvasID==a.CanvasID&&imageControlImages[b].WindowID==a.WindowID){return imageControlImages[b].Image}}}function CCLImage(){}CCLImage.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,ImageURL:null,ClickFunction:null,AlreadyDrawnImage:null,IsHyperlink:null,URL:null,NoBrowserHistory:null,IsNewBrowserWindow:null,NameOfNewBrowserWindow:null,WidthOfNewBrowserWindow:null,HeightOfNewBrowserWindow:null,NewBrowserWindowIsResizable:null,NewBrowserWindowHasScrollBars:null,NewBrowserWindowHasToolbar:null,NewBrowserWindowHasLocationOrURLOrAddressBox:null,NewBrowserWindowHasDirectoriesOrExtraButtons:null,NewBrowserWindowHasStatusBar:null,NewBrowserWindowHasMenuBar:null,NewBrowserWindowCopyHistory:null,Tag:null,Tile:null,ControlNameID:null,Depth:null,TabStopIndex:null,Initialize:function(){return createImage(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.imgurl,this.ClickFunction,this.Tile,this.Tag,this.IsHyperlink,this.URL,this.NoBrowserHistory,this.IsNewBrowserWindow,this.NameOfNewBrowserWindow,this.WidthOfNewBrowserWindow,this.HeightOfNewBrowserWindow,this.NewBrowserWindowIsResizable,this.NewBrowserWindowHasScrollBars,this.NewBrowserWindowHasToolbar,this.NewBrowserWindowHasLocationOrURLOrAddressBox,this.NewBrowserWindowHasDirectoriesOrExtraButtons,this.NewBrowserWindowHasStatusBar,this.NewBrowserWindowHasMenuBar,this.NewBrowserWindowCopyHistory,this.TabStopIndex)}};function createImage(u,a,l,j,s,o,D,t,b,C,E,r,f,k,e,p,z,B,m,A,w,q,v,d,c,i,h){var g=createWindow(u,l,j,s,o,D,null,"Image",a,null,h);var n=new Image();n.onload=function(){invalidateRect(u,null,l,j,s,o)};imageControlPropsArray.push({CanvasID:u,WindowID:g,X:l,Y:j,Width:s,Height:o,ImageURL:t,ClickFunction:b,AlreadyDrawnImage:0,IsHyperlink:r,URL:f,NoBrowserHistory:k,IsNewBrowserWindow:e,NameOfNewBrowserWindow:p,WidthOfNewBrowserWindow:z,HeightOfNewBrowserWindow:B,NewBrowserWindowIsResizable:m,NewBrowserWindowHasScrollBars:A,NewBrowserWindowHasToolbar:w,NewBrowserWindowHasLocationOrURLOrAddressBox:q,NewBrowserWindowHasDirectoriesOrExtraButtons:v,NewBrowserWindowHasStatusBar:d,NewBrowserWindowHasMenuBar:c,NewBrowserWindowCopyHistory:i,Tag:E,Tile:C});n.src=t;setImageControlImage(getImageControlProps(u,g),n);registerWindowDrawFunction(g,function(x,K){var M=getCtx(x);var G=getImageControlProps(x,K);var H=getImageControlImage(G);if(H&&H.complete==true){if(G.Tile==1){var L=getWindowProps(x,K);if(L){var J=Math.ceil(L.Width/H.width);var I=Math.ceil(L.Height/H.height);for(var y=0;y<I;y++){for(var F=0;F<J;F++){M.drawImage(H,G.X+(F*H.width),G.Y+(y*H.height))}}}}else{M.drawImage(H,G.X,G.Y)}}},u);if(b!=null){registerClickFunction(g,function(){b(u,g)},u)}else{if(r==1){registerClickFunction(g,function(){if(e==1){var y="";var x=0;if(z!=null){y+="width="+z;x=1}if(B!=null){y+=(x==1?",":"")+"height="+B}if(m!=null){y+=(x==1?",":"")+"resizable="+m}if(A!=null){y+=(x==1?",":"")+"scrollbars="+A}if(w!=null){y+=(x==1?",":"")+"toolbar="+w}if(q!=null){y+=(x==1?",":"")+"location="+q}if(newbroserwindowhasdirectoriesorextrabuttons!=null){y+=(x==1?",":"")+"directories="+newbroserwindowhasdirectoriesorextrabuttons}if(d!=null){y+=(x==1?",":"")+"status="+d}if(c!=null){y+=(x==1?",":"")+"menubar="+c}if(i!=null){y+=(x==1?",":"")+"copyhistory="+i}window.open(f,p,y)}else{if(k==1){window.location.replace(f)}else{window.location.href=f}}},u)}}if(h!=null&&h>0){registerKeyDownFunction(u,function(){},g)}return g}var treeViewPropsArray=new Array();var iconImages=new Array();function getTreeViewProps(c,a){for(var b=0;b<treeViewPropsArray.length;b++){if(treeViewPropsArray[b].CanvasID==c&&treeViewPropsArray[b].WindowID==a){return treeViewPropsArray[b]}}}function findNumberOfExpandedNodesInAll(a){var c=0;for(var b=0;b<a.length;b++){if(a[b].Expanded==1){c++}if(a[b].ChildNodes.length>0){c+=findNumberOfExpandedNodesInAll(a[b].ChildNodes)}}return c}function findIfImageAlreadyInIconImages(c,a){for(var b=0;b<a.length;b++){if(a[b].ImageURL==c){return 1}}return 0}function fillIconImages(b,a){for(var c=0;c<b.length;c++){if(b[c].ImageURL!=null&&b[c].ImageURL.length>0&&findIfImageAlreadyInIconImages(b[c].ImageURL,a)==0){var d=new Image();d.onload=function(){};d.src=b[c].ImageURL;a.push({ImageURL:b[c].ImageURL,Image:d})}if(b[c].ChildNodes.length>0){fillIconImages(b[c].ChildNodes,a)}}return a}function findNodeIndex(c,a){for(var b=0;b<a.length;b++){if(c==a[b]){return b}else{if(a[b].ChildNodes&&a[b].ChildNodes.length>0){return b+findNodeIndex(c,a[b].ChildNodes)}}}return 0}function treeviewVSCustomIncrementFunction(b,e,c){var a=new Array();for(var d=0;d<b.TreeviewNodeInstancesRootNodes.length;d++){a.push(b.TreeviewNodeInstancesRootNodes[d]);if(b.TreeviewNodeInstancesRootNodes[d].ChildNodes.length>0&&b.TreeviewNodeInstancesRootNodes[d].Expanded==1){fillChildNodes(b.TreeviewNodeInstancesRootNodes[d].ChildNodes,a)}}for(var d=0;d<a.length;d++){if(getSelectedTag(e.CanvasID,e.WindowID)==a[d]){if(c==1){if(d+1<a.length){setSelectedTag(e.CanvasID,e.WindowID,a[d+1])}}else{if(d-1>=0){setSelectedTag(e.CanvasID,e.WindowID,a[d-1])}}break}}for(var d=0;d<treeViewPropsArray.length;d++){if(getTreeviewNodes(treeViewPropsArray[d])==b.TreeviewNodeInstancesRootNodes){invalidateRect(treeViewPropsArray[d].CanvasID,null,treeViewPropsArray[d].X,treeViewPropsArray[d].Y,treeViewPropsArray[d].Width,treeViewPropsArray[d].Height);setTreeviewSelectedNode(treeViewPropsArray[d],getSelectedTag(e.CanvasID,e.WindowID));break}}}function treeviewVSCustomMouseMoveFunction(f,b){var e=null;for(var d=0;d<treeViewPropsArray.length;d++){if(f.WindowID==treeViewPropsArray[d].VScrollBarWindowID){e=treeViewPropsArray[d]}}if(e!=null){var a=new Array();var c=getTreeviewNodes(e);for(var d=0;d<c.length;d++){a.push(c[d]);if(c[d].ChildNodes.length>0&&c[d].Expanded==1){fillChildNodes(c[d].ChildNodes,a)}}if(b>=0&&b<a.length){setSelectedTag(f.CanvasID,f.WindowID,a[b]);setTreeviewSelectedNode(e,a[b])}}}var treeviewNodesArray=new Array();function setTreeviewNodes(a,b){var d=0;for(var c=0;c<treeviewNodesArray.length;c++){if(treeviewNodesArray[c][0]==a.CanvasID&&treeviewNodesArray[c][1]==a.WindowID){d=1;treeviewNodesArray[c][2]=b}}if(d==0){treeviewNodesArray.push([a.CanvasID,a.WindowID,b])}}function getTreeviewNodes(a){for(var b=0;b<treeviewNodesArray.length;b++){if(treeviewNodesArray[b][0]==a.CanvasID&&treeviewNodesArray[b][1]==a.WindowID){return treeviewNodesArray[b][2]}}}var treeviewSelectedNodeArray=new Array();function setTreeviewSelectedNode(a,c){var d=0;for(var b=0;b<treeviewSelectedNodeArray.length;b++){if(treeviewSelectedNodeArray[b][0]==a.CanvasID&&treeviewSelectedNodeArray[b][1]==a.WindowID){d=1;treeviewSelectedNodeArray[b][2]=c}}if(d==0){treeviewSelectedNodeArray.push([a.CanvasID,a.WindowID,c])}}function getTreeviewSelectedNode(a){for(var b=0;b<treeviewSelectedNodeArray.length;b++){if(treeviewSelectedNodeArray[b][0]==a.CanvasID&&treeviewSelectedNodeArray[b][1]==a.WindowID){return treeviewSelectedNodeArray[b][2]}}}var treeviewClickLabelExtentsArray=new Array();function setTreeviewClickLabelExtents(b,a){var d=0;for(var c=0;c<treeviewClickLabelExtentsArray.length;c++){if(treeviewClickLabelExtentsArray[c][0]==b.CanvasID&&treeviewClickLabelExtentsArray[c][1]==b.WindowID){d=1;treeviewClickLabelExtentsArray[c][2]=a}}if(d==0){treeviewClickLabelExtentsArray.push([b.CanvasID,b.WindowID,a])}}function getTreeviewClickLabelExtents(a){for(var b=0;b<treeviewClickLabelExtentsArray.length;b++){if(treeviewClickLabelExtentsArray[b][0]==a.CanvasID&&treeviewClickLabelExtentsArray[b][1]==a.WindowID){return treeviewClickLabelExtentsArray[b][2]}}}var treeviewClickButtonExtentsArray=new Array();function setTreeviewClickButtonExtents(b,a){var d=0;for(var c=0;c<treeviewClickButtonExtentsArray.length;c++){if(treeviewClickButtonExtentsArray[c][0]==b.CanvasID&&treeviewClickButtonExtentsArray[c][1]==b.WindowID){d=1;treeviewClickButtonExtentsArray[c][2]=a}}if(d==0){treeviewClickButtonExtentsArray.push([b.CanvasID,b.WindowID,a])}}function getTreeviewClickButtonExtents(a){for(var b=0;b<treeviewClickButtonExtentsArray.length;b++){if(treeviewClickButtonExtentsArray[b][0]==a.CanvasID&&treeviewClickButtonExtentsArray[b][1]==a.WindowID){return treeviewClickButtonExtentsArray[b][2]}}}function CCLTreeview(){}CCLTreeview.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,VScrollBarWindowID:null,HScrollBarWindowID:null,ClickNodeFunction:null,Tag:null,HasIcons:null,IconWidth:null,IconHeight:null,TextColor:null,TextFontString:null,TextHeight:null,ControlNameID:null,Depth:null,Nodes:null,SelectedNode:null,TabStopIndex:null,Initialize:function(){return createTreeView(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.Nodes,this.TextColor,this.TextFontString,this.TextHeight,this.ClickNodeFunction,this.Tag,this.HasIcons,this.IconWidth,this.IconHeight,this.SelectedNode,this.TabStopIndex)}};function createTreeView(q,a,i,g,n,k,w,o,t,h,j,s,z,d,r,v,l,f){var e=createWindow(q,i,g,n,k,w,null,"TreeView",a,null,f);var c=findNumberOfExpandedNodesInAll(o);iconImages=(d==1?fillIconImages(o,new Array()):new Array());var m=createScrollBar(q,a+"VS",i+n,g,k,w,c,1,e,null,null,null,treeviewVSCustomIncrementFunction,l!=null?l:o!=null&&o.length>0?o[0]:null,treeviewVSCustomMouseMoveFunction);var u=createScrollBar(q,a+"HS",i,g+k,n,w,c,0,e);var b=new Array();var p=new Array();treeViewPropsArray.push({CanvasID:q,WindowID:e,X:i,Y:g,Width:n,Height:k,VScrollBarWindowID:m,HScrollBarWindowID:u,ClickNodeFunction:s,Tag:z,HasIcons:d,IconWidth:r,IconHeight:v,TextColor:t,TextFontString:h,TextHeight:j});setTreeviewSelectedNode(getTreeViewProps(q,e),l!=null?l:o!=null&&o.length>0?o[0]:null);setTreeviewNodes(getTreeViewProps(q,e),o);setTreeviewClickLabelExtents(getTreeViewProps(q,e),p);setTreeviewClickButtonExtents(getTreeViewProps(q,e),b);registerWindowDrawFunction(e,drawTreeView,q);registerClickFunction(e,clickTreeView,q);if(f!=null&&f>0){registerKeyDownFunction(q,function(){},e)}return e}function toggleNodeExpandedState(a,b){if(b.Expanded==0){b.Expanded=1}else{b.Expanded=0}}function clickTreeView(a,g,f){var c=getTreeViewProps(a,g);var k=getScrollBarProps(a,c.VScrollBarWindowID);var j=f.calcX;var h=f.calcY;var d=getTreeviewClickButtonExtents(c);for(var b=0;b<d.length;b++){if(d[b].Node&&j>d[b].X&&j<d[b].X+9&&h>d[b].Y&&h<d[b].Y+9){toggleNodeExpandedState(c,d[b].Node);k.MaxItems=checkHowManyChildNodesAreExpandedInAll(getTreeviewNodes(c));invalidateRect(a,null,c.X,c.Y,c.Width,c.Height);return}}if(c.ClickNodeFunction!=null){var l=getTreeviewClickLabelExtents(c);for(var b=0;b<l.length;b++){if(l[b].TreeviewClickLabelExtentsNode&&j>l[b].X&&j<l[b].X+l[b].Width&&h>l[b].Y&&h<l[b].Y+l[b].TextHeight){c.ClickNodeFunction(a,g,l[b].TreeviewClickLabelExtentsNode);setTreeviewSelectedNode(c,l[b].TreeviewClickLabelExtentsNode);invalidateRect(a,null,c.X,c.Y,c.Width,c.Height);return}}}}function checkIfParentsAreExpanded(b,c){if(c.TreeviewNodeInstancesParentNode==null){return 1}var a=c;while(a.TreeviewNodeInstancesParentNode!=null){if(a.Expanded==0){return 0}a=a.TreeviewNodeInstancesParentNode}return 1}function checkIfStringAndConvertToInt(a){if(typeof a=="string"){return parseInt(a)}return a}function fillChildNodes(b,a){for(var c=0;c<b.length;c++){a.push(b[c]);if(b[c].ChildNodes.length>0&&b[c].Expanded==1){fillChildNodes(b[c].ChildNodes,a)}}}function drawTreeView(a,j){var g=getTreeViewProps(a,j);var l=getCtx(a);l.save();l.strokeStyle="#C0C0C0";l.beginPath();l.rect(g.X,g.Y,g.Width,g.Height);l.stroke();l.beginPath();l.rect(g.X,g.Y,g.Width,g.Height);l.clip();l.fillStyle=g.TextColor;l.font=g.TextFontString;var b=0;setTreeviewClickLabelExtents(g,new Array());var h=new Array();var e=getTreeviewNodes(g);for(var f=0;f<e.length;f++){h.push(e[f]);if(e[f].ChildNodes.length>0&&e[f].Expanded==1){fillChildNodes(e[f].ChildNodes,h)}}var d=0;for(var f=0;f<h.length&&b<g.Height;f++){if(h[f]==getTreeviewSelectedNode(g)){d=1}if(d==1){var k=4+g.Y+b;var c=findNodeLevel(h[f]);drawTreeViewNode(l,h[f],4+g.X,4+g.Y+b,g.TextColor,g.TextFontString,g.TextHeight,c,g.IconWidth,g.IconHeight,g);b+=(g.TextHeight>g.IconHeight?(g.TextHeight>9?g.TextHeight:9):(g.IconHeight>9?g.IconHeight:9))+8}}l.restore()}function findNodeLevel(a){if(a.TreeviewNodeInstancesParentNode==null){return 0}else{return 1+findNodeLevel(a.TreeviewNodeInstancesParentNode)}}function numberOfChildNodes(c){var b=c.ChildNodes.length;if(b>0){for(var a=0;a<c.ChildNodes.length;a++){b+=numberOfChildNodes(c.ChildNodes[a])}}return b}function checkHowManyChildNodesAreExpanded(c){var b=c.ChildNodes.length;if(b>0){for(var a=0;a<c.ChildNodes.length;a++){if(c.ChildNodes[a].Expanded==1){b++;if(c.ChildNodes[a].ChildNodes.length>0){b+=checkHowManyChildNodesAreExpanded(c.ChildNodes[a])}}}}return b}function checkHowManyChildNodesAreExpandedInAll(a){var c=0;for(var b=0;b<a.length;b++){if(a[b].Expanded==1){c++;if(a[b].ChildNodes.length>0){c+=a[b].ChildNodes.length;c+=checkHowManyChildNodesAreExpandedInAll(a[b].ChildNodes)}}}return c}function drawTreeViewNode(n,c,l,j,b,o,k,a,f,i,d){l+=a*8+(a==0?2:10);if(c.ChildNodes.length>0){n.strokeStyle="#3c7fb1";n.beginPath();n.rect(l,j,10,10);var e=getTreeviewClickButtonExtents(d);e.push({X:l,Y:j,Node:c});setTreeviewClickButtonExtents(d,e);n.stroke();n.fillStyle="#dcf0fb";n.beginPath();n.rect(l+1,j+1,8,5);n.fill();n.fillStyle="#a7d8f3";n.beginPath();n.rect(l+1,j+6,8,4);n.fill();n.strokeStyle="#000000";n.beginPath();n.moveTo(l+2,j+5);n.lineTo(l+8,j+5);n.stroke();if(c.Expanded==0){n.beginPath();n.moveTo(l+5,j+2);n.lineTo(l+5,j+8);n.stroke()}numOfChildNodes=checkHowManyChildNodesAreExpanded(c);if(c.ChildNodes.length>0){if(numOfChildNodes==0){n.strokeStyle="#000000";n.beginPath();n.moveTo(l+5,j+2);n.lineTo(l+5,j+8);n.stroke()}}}else{}var g=0;if(c.ImageURL!=null){for(var m=0;m<iconImages.length;m++){if(c.ImageURL==iconImages[m].ImageURL){n.drawImage(iconImages[m].Image,l+13,j);g+=f+5;break}}}n.fillStyle=b;n.font=o;n.fillText(c.Label,l+13+g,j+k);var h=getTreeviewClickLabelExtents(d);h.push({X:l+13,Y:j,Width:n.measureText(c.Label).width+g,TextHeight:k,TreeviewClickLabelExtentsNode:c})}function insertTreeviewNode(f,b,e,a){var c=getTreeViewProps(f,b);for(var d=0;d<c.Data.length;d++){if(e){if(c.Data[d][0]==e){c.Data.splice(d,0,a)}}else{c.Data.push(a)}}}function addChildNodes(c,e,g,b,d,a){var f={TreeviewNodeInstancesParentNode:e,TreeviewNodeInstancesRootNodes:c,ImageURL:g,Expanded:b,ChildNodes:new Array(),Label:d,CustomExtraInfo:a};if(e==null){c.push(f)}else{e.ChildNodes.push(f)}return f}var calenderPropsArray=new Array();function getCalenderProps(c,a){for(var b=0;b<calenderPropsArray.length;b++){if(calenderPropsArray[b].CanvasID==c&&calenderPropsArray[b].WindowID==a){return calenderPropsArray[b]}}}function drawCalender(a,h){var l=getCalenderProps(a,h);var o=getCtx(a);var n=new Date("1 "+l.VisibleMonth+" "+l.VisibleYear);var p=new Date();o.fillStyle=l.HeaderBackgroundColor;o.beginPath();o.rect(l.X,l.Y,l.Width,l.HeaderHeight);o.fill();o.fillStyle=l.BodyBackgroundColor;o.beginPath();o.rect(l.X,l.Y+l.HeaderHeight,l.Width,l.Height-l.HeaderHeight);o.fill();var k=new Array();o.fillStyle="#C0C0C0";o.font=l.TextHeaderFontString;var f=o.measureText("September").width;var d=o.measureText("0000").width;var c=l.X+((l.Width-(68+f+d))/2);o.beginPath();o.moveTo(c+4,l.Y+((l.HeaderHeight-11)/2)+6);o.lineTo(c+15,l.Y+((l.HeaderHeight-11)/2));o.lineTo(c+15,l.Y+((l.HeaderHeight-11)/2)+11);o.closePath();o.fill();k.push({X:c+4,Y:l.Y+((l.HeaderHeight-11)/2),Width:11,Height:11});o.beginPath();o.moveTo(c+23+f,l.Y+((l.HeaderHeight-11)/2));o.lineTo(c+23+f,l.Y+((l.HeaderHeight-11)/2)+11);o.lineTo(c+34+f,l.Y+((l.HeaderHeight-11)/2)+6);o.closePath();o.fill();k.push({X:c+23+f,Y:l.Y+((l.HeaderHeight-11)/2),Width:11,Height:11});o.beginPath();o.moveTo(c+38+f,l.Y+((l.HeaderHeight-11)/2)+6);o.lineTo(c+49+f,l.Y+((l.HeaderHeight-11)/2));o.lineTo(c+49+f,l.Y+((l.HeaderHeight-11)/2)+11);o.closePath();o.fill();k.push({X:c+38+f,Y:l.Y+((l.HeaderHeight-11)/2),Width:11,Height:11});o.beginPath();o.moveTo(c+57+f+d,l.Y+((l.HeaderHeight-11)/2));o.lineTo(c+57+f+d,l.Y+((l.HeaderHeight-11)/2)+11);o.lineTo(c+68+f+d,l.Y+((l.HeaderHeight-11)/2)+6);o.closePath();o.fill();k.push({X:c+57+f+d,Y:l.Y+((l.HeaderHeight-11)/2),Width:11,Height:11});l.ButtonClickExtents=k;o.fillStyle=l.TextHeaderColor;o.fillText(l.VisibleMonth,c+19+((f-o.measureText(l.VisibleMonth).width)/2),l.Y+((l.HeaderHeight-l.TextHeaderHeight)/2)+l.TextHeaderHeight);o.fillText(l.VisibleYear,c+53+f,l.Y+((l.HeaderHeight-l.TextHeaderHeight)/2)+l.TextHeaderHeight);var g=(n.getDay()>0?new Date(n.getTime()-(n.getDay()*24*60*60*1000)):n);var m=new Array();var e=null;for(var b=0;b<7;b++){switch(b){case 0:e="Sun";break;case 1:e="Mon";break;case 2:e="Tue";break;case 3:e="Wed";break;case 4:e="Thu";break;case 5:e="Fri";break;case 6:e="Sat";break}o.fillStyle=l.DayLabelTextColor;o.font=l.DayLabelTextFontString;o.fillText(e,l.X+4+((b%7)*l.DayCellWidth)+((l.DayCellWidth-o.measureText(e).width)/2),l.Y+l.HeaderHeight+4+l.DayCellHeight-((l.DayCellHeight-l.DayLabelTextHeight)/2))}for(var b=0;b<42;b++,g=new Date(g.getTime()+(24*60*60*1000))){m.push({X:l.X+4+((b%7)*l.DayCellWidth),Y:l.Y+l.HeaderHeight+4+((Math.floor(b/7)+1)*l.DayCellHeight),Date:g});var j=0;if(l.MouseHoverDate!=null&&g.getMonth()==l.MouseHoverDate.getMonth()&&g.getDate()==l.MouseHoverDate.getDate()&&g.getFullYear()==l.MouseHoverDate.getFullYear()){j=1;o.fillStyle=l.MouseOverHightLightColor;o.beginPath();o.rect(l.X+4+((b%7)*l.DayCellWidth),l.Y+l.HeaderHeight+4+((Math.floor(b/7)+1)*l.DayCellHeight),l.DayCellWidth,l.DayCellHeight);o.fill()}if(g.getMonth()!=n.getMonth()){o.fillStyle=l.DayDateInactiveTextColor;o.font=l.DayDateInactiveTextFontString;o.fillText(g.getDate().toString(),l.X+4+((b%7)*l.DayCellWidth)+((l.DayCellWidth-o.measureText(g.getDate().toString()).width)/2),l.Y+l.HeaderHeight+4+((Math.floor(b/7)+2)*l.DayCellHeight)-((l.DayCellHeight-l.TodayTextHeight)/2))}else{if(l.SelectedDay!=null&&g.getMonth()==l.SelectedDay.getMonth()&&g.getDate()==l.SelectedDay.getDate()&&g.getFullYear()==l.SelectedDay.getFullYear()){o.fillStyle=l.SelectedDayHighLightColor;o.beginPath();o.rect(l.X+4+((b%7)*l.DayCellWidth),l.Y+l.HeaderHeight+4+((Math.floor(b/7)+1)*l.DayCellHeight),l.DayCellWidth,l.DayCellHeight);o.fill();o.fillStyle=l.SelectedDayTextColor;o.font=l.SelectedDayTextFontString;o.fillText(g.getDate().toString(),l.X+4+((b%7)*l.DayCellWidth)+((l.DayCellWidth-o.measureText(g.getDate().toString()).width)/2),l.Y+l.HeaderHeight+4+((Math.floor(b/7)+2)*l.DayCellHeight)-((l.DayCellHeight-l.SelectedDayTextHeight)/2))}else{if(g.getMonth()==p.getMonth()&&g.getDate()==p.getDate()&&g.getFullYear()==p.getFullYear()){if(j==0){o.fillStyle=l.TodayHighLightColor;o.beginPath();o.rect(l.X+4+((b%7)*l.DayCellWidth),l.Y+l.HeaderHeight+4+((Math.floor(b/7)+1)*l.DayCellHeight),l.DayCellWidth,l.DayCellHeight);o.fill()}o.fillStyle=l.TodayTextColor;o.font=l.TodayTextFontString;o.fillText(g.getDate().toString(),l.X+4+((b%7)*l.DayCellWidth)+((l.DayCellWidth-o.measureText(g.getDate().toString()).width)/2),l.Y+l.HeaderHeight+4+((Math.floor(b/7)+2)*l.DayCellHeight)-((l.DayCellHeight-l.TodayTextHeight)/2))}else{o.fillStyle=l.DayDateActiveColor;o.font=l.DayDateActiveTextFontString;o.fillText(g.getDate().toString(),l.X+4+((b%7)*l.DayCellWidth)+((l.DayCellWidth-o.measureText(g.getDate().toString()).width)/2),l.Y+l.HeaderHeight+4+((Math.floor(b/7)+2)*l.DayCellHeight)-((l.DayCellHeight-l.DayDateActiveTextHeight)/2))}}}}l.DateClickExtents=m}function CCLCalendar(){}CCLCalendar.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,VisibleMonth:null,VisibleYear:null,SelectedDay:null,DayCellWidth:null,DayCellHeight:null,HeaderHeight:null,TextHeaderColor:null,TextHeaderHeight:null,TextHeaderFontString:null,DayDateActiveColor:null,DayDateActiveTextHeight:null,DayDateActiveTextFontString:null,DayDateInactiveTextColor:null,DayDateInactiveTextHeight:null,DayDateInactiveTextFontString:null,SelectedDayTextColor:null,SelectedDayTextHeight:null,SelectedDayTextFontString:null,SelectedDayHighLightColor:null,TodayTextColor:null,TodayTextHeight:null,TodayTextFontString:null,TodayHighLightColor:null,OnDayClickFunction:null,HeaderBackgroundColor:null,BodyBackgroundColor:null,MouseOverHightLightColor:null,MouseHoverDate:null,DayLabelTextColor:null,DayLabelTextHeight:null,Tag:null,DayLabelTextFontString:null,ControlNameID:null,Depth:null,TabStopIndex:null,Initialize:function(){return createCalendar(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.VisibleMonth,this.VisibleYear,this.SelectedDay,this.DayCellWidth,this.DayCellHeight,this.HeaderHeight,this.HeaderBackgroundColor,this.BodyBackgroundColor,this.TextHeaderColor,this.TextHeaderHeight,this.TextHeaderFontString,this.DayDateActiveColor,this.DayDateActiveTextHeight,this.DayDateActiveTextFontString,this.DayDateInactiveTextColor,this.DayDateInactiveTextHeight,this.DayDateInactiveTextFontString,this.SelectedDayTextColor,this.SelectedDayTextHeight,this.SelectedDayTextFontString,this.SelectedDayHighLightColor,this.TodayTextColor,this.TodayTextHeight,this.TodayTextFontString,this.TodayHighLightColor,this.MouseOverHightLightColor,this.OnDayClickFunction,this.DayLabelTextColor,this.DayLabelTextHeight,this.DayLabelTextFontString,this.Tag,this.TabStopIndex)}};function createCalendar(r,B,A,v,a,d,g,J,e,G,p,k,q,j,w,h,n,I,K,f,c,F,b,M,o,i,t,H,L,C,l,s,E,u,O,z,N,D,P){var m=createWindow(r,A,v,a,d,g,null,"Calender",B,null,P);calenderPropsArray.push({CanvasID:r,WindowID:m,X:A,Y:v,Width:a,Height:d,VisibleMonth:J,VisibleYear:e,SelectedDay:new Date(G),DayCellWidth:p,DayCellHeight:k,HeaderHeight:q,TextHeaderColor:h,TextHeaderHeight:n,TextHeaderFontString:I,DayDateActiveColor:K,DayDateActiveTextHeight:f,DayDateActiveTextFontString:c,DayDateInactiveTextColor:F,DayDateInactiveTextHeight:b,DayDateInactiveTextFontString:M,SelectedDayTextColor:o,SelectedDayTextHeight:i,SelectedDayTextFontString:t,SelectedDayHighLightColor:H,TodayTextColor:L,TodayTextHeight:C,TodayTextFontString:l,TodayHighLightColor:s,OnDayClickFunction:u,HeaderBackgroundColor:j,BodyBackgroundColor:w,MouseOverHightLightColor:E,MouseHoverDate:null,ButtonClickExtents:null,DateClickExtents:null,DayLabelTextColor:O,DayLabelTextHeight:z,Tag:D,DayLabelTextFontString:N});registerWindowDrawFunction(m,drawCalender,r);registerClickFunction(m,calenderClick,r);registerMouseOverFunction(m,calenderMouseOver,r);if(P!=null&&P>0){registerKeyDownFunction(r,function(){},m)}return m}function getMonthName(a){switch(a){case 0:return"January";case 1:return"Febuary";case 2:return"March";case 3:return"April";case 4:return"May";case 5:return"June";case 6:return"July";case 7:return"August";case 8:return"September";case 9:return"October";case 10:return"November";case 11:return"December"}}function calenderClick(g,b,h){var f=getCalenderProps(g,b);var a=h.calcX;var j=h.calcY;var d=new Date("1 "+f.VisibleMonth+" "+f.VisibleYear);for(var c=0;c<f.ButtonClickExtents.length;c++){if(a>f.ButtonClickExtents[c].X&&a<f.ButtonClickExtents[c].X+f.ButtonClickExtents[c].Width&&j>f.ButtonClickExtents[c].Y&&j<f.ButtonClickExtents[c].Y+f.ButtonClickExtents[c].Height){switch(c){case 0:if(d.getMonth()==0){f.VisibleMonth="December";f.VisibleYear=(parseInt(f.VisibleYear,10)-1).toString()}else{f.VisibleMonth=getMonthName(d.getMonth()-1)}return;case 1:if(d.getMonth()==11){f.VisibleMonth="January";f.VisibleYear=(parseInt(f.VisibleYear,10)+1).toString()}else{f.VisibleMonth=getMonthName(d.getMonth()+1)}return;case 2:f.VisibleYear=(parseInt(f.VisibleYear,10)-1).toString();return;case 3:f.VisibleYear=(parseInt(f.VisibleYear,10)+1).toString();return}}}for(var c=0;c<f.DateClickExtents.length;c++){if(a>f.DateClickExtents[c].X&&a<f.DateClickExtents[c].X+f.DayCellWidth&&j>f.DateClickExtents[c].Y&&j<f.DateClickExtents[c].Y+f.DayCellHeight){f.SelectedDay=f.DateClickExtents[c].Date;if(f.OnDayClickFunction!=null){f.OnDayClickFunction(f.CanvasID,f.WindowID,f.SelectedDay)}return}}}function calenderMouseOver(f,b,g){var d=getCalenderProps(f,b);var a=g.calcX;var h=g.calcY;for(var c=0;c<d.DateClickExtents.length;c++){if(a>d.DateClickExtents[c].X&&a<d.DateClickExtents[c].X+d.DayCellWidth&&h>d.DateClickExtents[c].Y&&h<d.DateClickExtents[c].Y+d.DayCellHeight){d.MouseHoverDate=d.DateClickExtents[c].Date;return}}}var progressBarPropsArray=new Array();function getProgressBarProps(c,a){for(var b=0;b<progressBarPropsArray.length;b++){if(progressBarPropsArray[b].CanvasID==c&&progressBarPropsArray[b].WindowID==a){return progressBarPropsArray[b]}}}function CCLProgressBar(){}CCLProgressBar.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,Color:null,MaxValue:null,MinValue:null,CurrentValue:null,Tag:null,ControlNameID:null,Depth:null,TabStopIndex:null,Initialize:function(){return(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.Color,this.MaxValue,this.MinValue,this.CurrentValue,this.Tag,this.TabStopIndex)}};function createProgressBar(a,d,k,i,c,l,f,e,j,n,b,m,g){var h=createWindow(a,k,i,c,l,f,null,"ProgressBar",d,null,g);progressBarPropsArray.push({CanvasID:a,WindowID:h,X:k,Y:i,Width:c,Height:l,Color:e,MaxValue:j,MinValue:n,CurrentValue:b,Tag:m});registerWindowDrawFunction(h,drawProgressBar,a);if(g!=null&&g>0){registerKeyDownFunction(a,function(){},h)}return h}function setProgressBarCurrentValue(d,a,c){var b=getProgressBarProps(d,a);b.CurrentValue=c;invalidateRect(d,null,b.X,b.Y,b.Width,b.Height)}function drawProgressBar(a,h){var i=getProgressBarProps(a,h);var j=getCtx(a);var c=j.createLinearGradient(i.X,i.Y,i.X,i.Y+i.Height);c.addColorStop(0,"#f4f5f6");c.addColorStop(1,"#eaeced");j.fillStyle=c;j.beginPath();j.moveTo(i.X,i.Y+5);j.arc(i.X+5,i.Y+5,5,Math.PI,(Math.PI*270)/180,false);j.lineTo(i.X+i.Width-5,i.Y);j.arc(i.X+i.Width-5,i.Y+5,5,(Math.PI*270)/180,Math.PI*2,false);j.lineTo(i.X+i.Width,i.Y+i.Height-5);j.arc(i.X+i.Width-5,i.Y+i.Height-5,5,0,Math.PI/2,false);j.lineTo(i.X+5,i.Y+i.Height);j.arc(i.X+5,i.Y+i.Height-5,5,Math.PI/2,Math.PI,false);j.closePath();j.fill();j.strokeStyle="#a9b2bb";j.beginPath();j.moveTo(i.X,i.Y+5);j.arc(i.X+5,i.Y+5,5,Math.PI,(Math.PI*270)/180,false);j.lineTo(i.X+i.Width-5,i.Y);j.arc(i.X+i.Width-5,i.Y+5,5,(Math.PI*270)/180,Math.PI*2,false);j.stroke();j.strokeStyle="#768694";j.beginPath();j.moveTo(i.X+i.Width,i.Y+5);j.lineTo(i.X+i.Width,i.Y+i.Height-5);j.arc(i.X+i.Width-5,i.Y+i.Height-5,5,0,Math.PI/2,false);j.moveTo(i.X+5,i.Y+i.Height);j.arc(i.X+5,i.Y+i.Height-5,5,Math.PI/2,Math.PI,false);j.lineTo(i.X,i.Y+5);j.stroke();j.strokeStyle="#657582";j.beginPath();j.moveTo(i.X+5,i.Y+i.Height);j.lineTo(i.X+i.Width-5,i.Y+i.Height);j.stroke();var b=((i.CurrentValue-i.MinValue)*i.Width)/(i.MaxValue-i.MinValue);var k=j.createLinearGradient(i.X,i.Y,i.X,i.Y+i.Height);var e=parseInt(i.Color.substr(1,2),16);var f=parseInt(i.Color.substr(3,2),16);var d=parseInt(i.Color.substr(5,2),16);k.addColorStop(0,"#"+getlowcomp(e)+getlowcomp(f)+getlowcomp(d));k.addColorStop(0.5,i.Color);k.addColorStop(1,"#"+gethighcomp(e)+gethighcomp(f)+gethighcomp(d));j.fillStyle=k;j.beginPath();j.moveTo(i.X+2,i.Y+7);j.arc(i.X+7,i.Y+7,5,Math.PI,(Math.PI*270)/180,false);j.lineTo(i.X+b-7,i.Y+2);j.arc(i.X+b-7,i.Y+7,5,(Math.PI*270)/180,Math.PI*2,false);j.lineTo(i.X+b-2,i.Y+i.Height-7);j.arc(i.X+b-7,i.Y+i.Height-7,5,0,Math.PI/2,false);j.lineTo(i.X+7,i.Y+i.Height-2);j.arc(i.X+7,i.Y+i.Height-7,5,Math.PI/2,Math.PI,false);j.closePath();j.fill()}var sliderPropsArray=new Array();function getSliderProps(c,a){for(var b=0;b<sliderPropsArray.length;b++){if(sliderPropsArray[b].CanvasID==c&&sliderPropsArray[b].WindowID==a){return sliderPropsArray[b]}}}function drawSlider(f,b){var e=getSliderProps(f,b);var c=getCtx(f);c.strokeStyle="#a3aeb9";c.beginPath();c.rect(e.X,e.Y+(e.HandleHeight/2)-1,e.Width,3);c.stroke();c.strokeStyle="#e6eff7";c.beginPath();c.moveTo(e.X+1,e.Y+(e.HandleHeight/2));c.lineTo(e.X+e.Width-1,e.Y+(e.HandleHeight/2));c.stroke();var a=((e.CurrentValue-e.MinValue)*e.Width)/(e.MaxValue-e.MinValue)-(e.HandleWidth/2);var d=c.createLinearGradient(e.X+a,e.Y,e.X+a,e.Y+e.HandleHeight);d.addColorStop(0,"#fdfdfd");d.addColorStop(1,"#ced4d9");c.fillStyle=d;c.beginPath();c.rect(e.X+a,e.Y,e.HandleWidth,e.HandleHeight);c.fill();c.strokeStyle="#a0abb7";c.beginPath();c.moveTo(e.X+a+1,e.Y);c.lineTo(e.X+a+e.HandleWidth-1,e.Y);c.stroke();c.strokeStyle="#8094a4";c.beginPath();c.moveTo(e.X+a,e.Y+1);c.lineTo(e.X+a,e.Y+e.HandleHeight-1);c.moveTo(e.X+a+e.HandleWidth,e.Y+1);c.lineTo(e.X+a+e.HandleWidth,e.Y+e.HandleHeight-1);c.stroke();c.strokeStyle="#617584";c.beginPath();c.moveTo(e.X+a+1,e.Y+e.HandleHeight);c.lineTo(e.X+a+e.HandleWidth-1,e.Y+e.HandleHeight);c.stroke()}function sliderMouseDown(c,a){var b=getSliderProps(c,a);b.MouseDownState=1}function sliderMouseMove(d,b,f){var c=getSliderProps(d,b);if(c.MouseDownState==1){var a=f.calcX;if(a<c.X){c.CurrentValue=c.MinValue}else{if(a>c.X+c.Width){c.CurrentValue=c.MaxValue}else{c.CurrentValue=c.MinValue+(((a-c.X)*(c.MaxValue-c.MinValue))/c.Width)}}}}function sliderMouseUp(c,a){var b=getSliderProps(c,a);b.MouseDownState=0}function CCLSlider(){}CCLSlider.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,HandleWidth:null,HandleHeight:null,MaxValue:null,MinValue:null,MouseDownState:null,Tag:null,ControlNameID:null,Depth:null,TabStopIndex:null,Value:null,Initialize:function(){return createSlider(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.HandleWidth,this.MaxValue,this.MinValue,this.Value,this.Tag,this.TabStopIndex)}};function createSlider(a,c,i,g,b,l,d,k,h,n,j,m,e){var f=createWindow(a,i,g,b,l,d,null,"Slider",c,null,e);sliderPropsArray.push({CanvasID:a,WindowID:f,X:i,Y:g,Width:b,Height:l,HandleWidth:k,HandleHeight:l,MaxValue:h,MinValue:n,CurrentValue:j,MouseDownState:0,Tag:m});registerWindowDrawFunction(f,drawSlider,a);registerMouseDownFunction(f,sliderMouseDown,a);registerMouseUpFunction(f,sliderMouseUp,a);registerMouseMoveFunction(f,sliderMouseMove,a);if(e!=null&&e>0){registerKeyDownFunction(a,function(){},f)}return f}var datePickerPropsArray=new Array();function getDatePickerPropsByTextBoxAreaWindowID(c,a){for(var b=0;b<datePickerPropsArray.length;b++){if(datePickerPropsArray[b].CanvasID==c&&datePickerPropsArray[b].TextBoxAreaWindowID==a){return datePickerPropsArray[b]}}}function getDatePickerPropsByButtonWindowID(c,a){for(var b=0;b<datePickerPropsArray.length;b++){if(datePickerPropsArray[b].CanvasID==c&&datePickerPropsArray[b].ButtonWindowID==a){return datePickerPropsArray[b]}}}function getDatePickerPropsByCalenderWindowID(c,a){for(var b=0;b<datePickerPropsArray.length;b++){if(datePickerPropsArray[b].CanvasID==c&&datePickerPropsArray[b].CalenderWindowID==a){return datePickerPropsArray[b]}}}function CCLDatePicker(){}CCLDatePicker.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,TextBoxAreaTextColor:null,TextBoxAreaTextHeight:null,TextBoxAreaTextFontString:null,Tag:null,ControlNameID:null,Depth:null,TabStopIndex:null,VisibleMonth:null,VisibleYear:null,SelectedDay:null,DayCellWidth:null,DayCellHeight:null,HeaderHeight:null,TextHeaderColor:null,TextHeaderHeight:null,TextHeaderFontString:null,DayDateActiveColor:null,DayDateActiveTextHeight:null,DayDateActiveTextFontString:null,DayDateInactiveTextColor:null,DayDateInactiveTextHeight:null,DayDateInactiveTextFontString:null,SelectedDayTextColor:null,SelectedDayTextHeight:null,SelectedDayTextFontString:null,SelectedDayHighLightColor:null,TodayTextColor:null,TodayTextHeight:null,TodayTextFontString:null,TodayHighLightColor:null,OnDayClickFunction:null,HeaderBackgroundColor:null,BodyBackgroundColor:null,MouseOverHightLightColor:null,MouseHoverDate:null,DayLabelTextColor:null,DayLabelTextHeight:null,Tag:null,DayLabelTextFontString:null,CalenderHeight:null,Initialize:function(){return(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.VisibleMonth,this.VisibleYear,this.SelectedDay,this.DayCellWidth,this.DayCellHeight,this.HeaderHeight,this.HeaderBackgroundColor,this.BodyBackgroundColor,this.TextHeaderColor,this.TextHeaderHeight,this.TextHeaderFontString,this.DayDateActiveColor,this.DayDateActiveTextHeight,this.DayDateActiveTextFontString,this.DayDateInactiveTextColor,this.DayDateInactiveTextHeight,this.DayDateInactiveTextFontString,this.SelectedDayTextColor,this.SelectedDayTextHeight,this.SelectedDayTextFontString,this.SelectedDayHighLightColor,this.TodayTextColor,this.TodayTextHeight,this.TodayTextFontString,this.TodayHighLightColor,this.MouseOverHightLightColor,this.OnDayClickFunction,this.DayLabelTextColor,this.DayLabelTextHeight,this.DayLabelTextFontString,this.TextBoxAreaTextColor,this.TextBoxAreaTextHeight,this.TextBoxAreaTextFontString,this.CalenderHeight,this.Tag,this.TabStopIndex)}};function createDatePicker(v,G,F,C,a,d,h,P,e,M,t,p,u,o,D,i,r,O,Q,g,c,L,b,S,s,m,z,N,R,I,q,w,K,B,U,E,T,n,H,l,A,J,V){var f=createWindow(v,F,C,a-d,d,h,null,"DatePickerTextArea",G+"DatePickerTextArea");var k=createWindow(v,F+a-d,C,d,d,h,null,"DatePickerButton",G+"DatePickerButton");var j=createCalendar(v,G+"DatePickerCalender",F,C+d,a,A,h,P,e,M,t,p,u,o,D,i,r,O,Q,g,c,L,b,S,s,m,z,N,R,I,q,w,K,function(){var y=getDatePickerPropsByTextBoxAreaWindowID(v,f);var x=getCalenderProps(v,y.CalenderWindowID);if(B!=null){B(v,y.CalenderWindowID,x.SelectedDay)}setHiddenWindowStatus(v,y.CalenderWindowID,1)},U,E,T);datePickerPropsArray.push({CanvasID:v,WindowID:f,TextBoxAreaWindowID:f,ButtonWindowID:k,CalenderWindowID:j,X:F,Y:C,Width:a,Height:d,TextBoxAreaTextColor:n,TextBoxAreaTextHeight:H,TextBoxAreaTextFontString:l,Tag:J});registerModalWindow(v,j);registerHiddenWindow(v,j,1);registerClickFunction(k,function(x,W){var X=getDatePickerPropsByButtonWindowID(x,W);if(checkIfHiddenWindow(v,X.CalenderWindowID)==1){setHiddenWindowStatus(v,X.CalenderWindowID,0)}else{setHiddenWindowStatus(v,X.CalenderWindowID,1)}var y=getCalenderProps(x,X.CalenderWindowID);invalidateRect(x,null,y.X,y.Y,y.Width,y.Height)},v);registerWindowDrawFunction(f,function(W,Y){var Z=getDatePickerPropsByTextBoxAreaWindowID(W,Y);var X=getCalenderProps(W,Z.CalenderWindowID);var y=getCtx(W);y.strokeStyle="#a3aeb9";y.beginPath();y.rect(Z.X,Z.Y,Z.Width-Z.Height,Z.Height);y.stroke();if(X.SelectedDay!=null){y.fillStyle=Z.TextBoxAreaTextColor;y.font=Z.TextBoxAreaTextFontString;var x=X.SelectedDay.getDate().toString()+"/"+(X.SelectedDay.getMonth()+1).toString()+"/"+X.SelectedDay.getFullYear().toString();y.fillText(x,Z.X+4,Z.Y+Z.Height-((Z.Height-Z.TextBoxAreaTextHeight)/2))}},v);registerWindowDrawFunction(k,function(x,X){var Y=getDatePickerPropsByButtonWindowID(x,X);var y=getCtx(x);y.lineCap="butt";y.strokeStyle="#3c7fb1";y.beginPath();y.rect(Y.X+Y.Width-Y.Height,Y.Y,Y.Height,Y.Height);y.stroke();y.fillStyle="#dcf0fb";y.beginPath();y.rect(Y.X+Y.Width-Y.Height+1,Y.Y+1,(Y.Height/2)-2,Y.Height-2);y.fill();y.strokeStyle="#c0e4f8";y.moveTo(Y.X+Y.Width-(Y.Height/2)+1,Y.Y+1);y.lineTo(Y.X+Y.Width-(Y.Height/2)+1,Y.Y+Y.Height-1);y.stroke();y.fillStyle="#a7d8f3";y.beginPath();y.rect(Y.X+Y.Width-(Y.Height/2)+1,Y.Y+1,(Y.Height/2)-2,Y.Height-2);y.fill();var W=y.createLinearGradient(Y.X+Y.Width-(Y.Height/2)-1,Y.Y+(Y.Height/2)-1,Y.X+Y.Width-(Y.Height/2)-1,Y.Y+(Y.Height/2)+3);W.addColorStop(0,"#0d2a3a");W.addColorStop(1,"#4e9ac4");y.fillStyle=W;y.beginPath();y.moveTo(Y.X+Y.Width-(Y.Height/2)-4,Y.Y+(Y.Height/2)-1);y.lineTo(Y.X+Y.Width-(Y.Height/2)+3,Y.Y+(Y.Height/2)-1);y.lineTo(Y.X+Y.Width-(Y.Height/2)-1,Y.Y+(Y.Height/2)+3);y.closePath();y.fill()},v);registerModalWindow(v,j);registerHiddenWindow(v,j,1);registerLostFocusFunction(v,j,function(){datePickerCalenderWindowLostFocus(v,j)});registerLostFocusFunction(v,f,function(){datePickerTextBoxWindowLostFocus(v,f)});registerLostFocusFunction(v,k,function(){datePickerButtonLostFocus(v,k)});return f}function datePickerCalenderWindowLostFocus(b,a){var c=getDatePickerPropsByCalenderWindowID(b,a);if(doesWindowHaveFocus(b,c.TextBoxAreaWindowID)==0&&doesWindowHaveFocus(b,c.ButtonWindowID)==0&&doingEventForWindowID!=c.CalenderWindowID){setHiddenWindowStatus(b,c.CalenderWindowID,1)}}function datePickerTextBoxWindowLostFocus(b,a){var c=getDatePickerPropsByTextBoxAreaWindowID(b,a);if(doesWindowHaveFocus(b,c.CalenderWindowID)==0&&doesWindowHaveFocus(b,c.ButtonWindowID)==0&&doingEventForWindowID!=c.CalenderWindowID){setHiddenWindowStatus(b,c.CalenderWindowID,1)}}function datePickerButtonLostFocus(b,a){var c=getDatePickerPropsByButtonWindowID(b,a);if(doesWindowHaveFocus(b,c.CalenderWindowID)==0&&doesWindowHaveFocus(b,c.TextBoxAreaWindowID)==0&&doingEventForWindowID!=c.CalenderWindowID){setHiddenWindowStatus(b,c.CalenderWindowID,1)}}var panelPropsArray=new Array();function getPanelProps(c,a){for(var b=0;b<panelPropsArray.length;b++){if(panelPropsArray[b].CanvasID==c&&panelPropsArray[b].WindowID==a){return panelPropsArray[b]}}}function CCLPanel(){}CCLPanel.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,ExpandedWidth:null,ExpandedHeight:null,CollapsedWidth:null,CollapsedHeight:null,IsCollapsable:null,HasBorder:null,BorderColor:null,HasBackgroundGradient:null,BackgroundStartColor:null,BackgroundEndColor:null,HeaderHeight:null,HeaderBackgroundStartColor:null,HeaderBackgroundEndColor:null,ExpandCollapseButtonColor:null,IsExpanded:null,ExpandCollapseButtonRadius:null,PanelLabel:null,PanelLabelTextColor:null,PanelLabelTextHeight:null,PanelLabelTextFontString:null,OriginalWidth:null,OriginalHeight:null,Tag:null,ControlNameID:null,Depth:null,TabStopIndex:null,Initialize:function(){return(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.HasBorder,this.BorderColor,this.HasBackgroundGradient,this.BackgroundStartColor,this.BackgroundEndColor,this.IsCollapsable,this.CollapsedWidth,this.CollapsedHeight,this.PanelLabel,this.PanelLabelTextColor,this.PanelLabelTextHeight,this.PanelLabelTextFontString,this.HeaderBackgroundStartColor,this.HeaderBackgroundEndColor,this.HeaderHeight,this.ExpandCollapseButtonColor,this.IsExpanded,this.ExpandCollapseButtonRadius,this.Tag,this.TabStopIndex)}};function createPanel(r,d,l,k,q,o,B,f,b,z,p,e,m,v,c,n,t,A,u,h,s,g,w,a,D,C,j){var i=createWindow(r,l,k,(m==1?(a==1?q:v):q),(m==1?(a==1?o:g):o),B,null,"Panel",d,null,j);panelPropsArray.push({CanvasID:r,WindowID:i,X:l,Y:k,Width:q,Height:o,ExpandedWidth:q,ExpandedHeight:o,CollapsedWidth:v,CollapsedHeight:c,IsCollapsable:m,HasBorder:f,BorderColor:b,HasBackgroundGradient:z,BackgroundStartColor:p,BackgroundEndColor:e,HeaderHeight:g,HeaderBackgroundStartColor:h,HeaderBackgroundEndColor:s,ExpandCollapseButtonColor:w,IsExpanded:a,ExpandCollapseButtonRadius:D,PanelLabel:n,PanelLabelTextColor:t,PanelLabelTextHeight:A,PanelLabelTextFontString:u,OriginalWidth:q,OriginalHeight:o,Tag:C});registerWindowDrawFunction(i,function(J,x){var G=getPanelProps(J,x);var K=getCtx(J);if(G.IsCollapsable==1){if(G.IsExpanded==1){if(G.HasBackgroundGradient==1){var E=K.createLinearGradient(G.X,G.Y,G.X,G.Y+G.Height);E.addColorStop(0,G.BackgroundStartColor);E.addColorStop(1,G.BackgroundEndColor);K.fillStyle=E;K.beginPath();K.rect(G.X,G.Y,G.Width,G.Height);K.fill()}if(G.HasBorder==1){K.strokeStyle=G.BorderColor;K.beginPath();K.rect(G.X,G.Y,G.Width,G.Height);K.stroke()}}else{if(G.HasBorder==1){K.strokeStyle=G.BorderColor;K.beginPath();K.rect(G.X,G.Y,G.Width,G.HeaderHeight);K.stroke()}}var y=K.createLinearGradient(G.X,G.Y,G.X,G.Y+G.HeaderHeight);y.addColorStop(0,G.HeaderBackgroundStartColor);y.addColorStop(1,G.HeaderBackgroundEndColor);K.fillStyle=y;K.beginPath();K.rect(G.X,G.Y,G.Width,G.HeaderHeight);K.fill();K.fillStyle=G.PanelLabelTextColor;K.font=G.PanelLabelTextFontString;K.fillText(G.PanelLabel,G.X+((G.Width-G.ExpandCollapseButtonRadius-K.measureText(G.PanelLabel).width)/2),G.Y+G.HeaderHeight-((G.HeaderHeight-G.PanelLabelTextHeight)/2));var L=K.createRadialGradient(G.X+G.Width-4-G.ExpandCollapseButtonRadius,G.Y+G.HeaderHeight-((G.HeaderHeight-(G.ExpandCollapseButtonRadius*2))/2)-G.ExpandCollapseButtonRadius,0,G.X+G.Width-4-G.ExpandCollapseButtonRadius,G.Y+G.HeaderHeight-((G.HeaderHeight-(G.ExpandCollapseButtonRadius*2))/2)-G.ExpandCollapseButtonRadius,G.ExpandCollapseButtonRadius);var H=parseInt(G.ExpandCollapseButtonColor.substr(1,2),16);var I=parseInt(G.ExpandCollapseButtonColor.substr(3,2),16);var F=parseInt(G.ExpandCollapseButtonColor.substr(5,2),16);L.addColorStop(0,"#"+gethighcomp(H)+gethighcomp(I)+gethighcomp(F));L.addColorStop(0.9,G.ExpandCollapseButtonColor);L.addColorStop(1,"#"+getlowcomp(H)+getlowcomp(I)+getlowcomp(F));K.fillStyle=L;K.beginPath();K.arc(G.X+G.Width-4-G.ExpandCollapseButtonRadius,G.Y+G.HeaderHeight-((G.HeaderHeight-(G.ExpandCollapseButtonRadius*2))/2)-G.ExpandCollapseButtonRadius,G.ExpandCollapseButtonRadius,0,Math.PI*2,false);K.fill();K.strokeStyle="#000000";K.beginPath();if(G.IsExpanded==1){K.moveTo(G.X+G.Width-8-G.ExpandCollapseButtonRadius,G.Y+G.HeaderHeight-((G.HeaderHeight-(G.ExpandCollapseButtonRadius*2))/2)+4-G.ExpandCollapseButtonRadius);K.lineTo(G.X+G.Width-4-G.ExpandCollapseButtonRadius,G.Y+G.HeaderHeight-((G.HeaderHeight-(G.ExpandCollapseButtonRadius*2))/2)-2-G.ExpandCollapseButtonRadius);K.lineTo(G.X+G.Width-G.ExpandCollapseButtonRadius,G.Y+G.HeaderHeight-((G.HeaderHeight-(G.ExpandCollapseButtonRadius*2))/2)+4-G.ExpandCollapseButtonRadius);K.moveTo(G.X+G.Width-8-G.ExpandCollapseButtonRadius,G.Y+G.HeaderHeight-((G.HeaderHeight-(G.ExpandCollapseButtonRadius*2))/2)+1-G.ExpandCollapseButtonRadius);K.lineTo(G.X+G.Width-4-G.ExpandCollapseButtonRadius,G.Y+G.HeaderHeight-((G.HeaderHeight-(G.ExpandCollapseButtonRadius*2))/2)-5-G.ExpandCollapseButtonRadius);K.lineTo(G.X+G.Width-G.ExpandCollapseButtonRadius,G.Y+G.HeaderHeight-((G.HeaderHeight-(G.ExpandCollapseButtonRadius*2))/2)+1-G.ExpandCollapseButtonRadius)}else{K.moveTo(G.X+G.Width-8-G.ExpandCollapseButtonRadius,G.Y+G.HeaderHeight-((G.HeaderHeight-(G.ExpandCollapseButtonRadius*2))/2)-4-G.ExpandCollapseButtonRadius);K.lineTo(G.X+G.Width-4-G.ExpandCollapseButtonRadius,G.Y+G.HeaderHeight-((G.HeaderHeight-(G.ExpandCollapseButtonRadius*2))/2)+2-G.ExpandCollapseButtonRadius);K.lineTo(G.X+G.Width-G.ExpandCollapseButtonRadius,G.Y+G.HeaderHeight-((G.HeaderHeight-(G.ExpandCollapseButtonRadius*2))/2)-4-G.ExpandCollapseButtonRadius);K.moveTo(G.X+G.Width-8-G.ExpandCollapseButtonRadius,G.Y+G.HeaderHeight-((G.HeaderHeight-(G.ExpandCollapseButtonRadius*2))/2)-1-G.ExpandCollapseButtonRadius);K.lineTo(G.X+G.Width-4-G.ExpandCollapseButtonRadius,G.Y+G.HeaderHeight-((G.HeaderHeight-(G.ExpandCollapseButtonRadius*2))/2)+5-G.ExpandCollapseButtonRadius);K.lineTo(G.X+G.Width-G.ExpandCollapseButtonRadius,G.Y+G.HeaderHeight-((G.HeaderHeight-(G.ExpandCollapseButtonRadius*2))/2)-1-G.ExpandCollapseButtonRadius)}K.stroke()}else{if(G.HasBackgroundGradient==1){var E=K.createLinearGradient(G.X,G.Y,G.X,G.Y+G.Height);E.addColorStop(0,G.BackgroundStartColor);E.addColorStop(1,G.BackgroundEndColor);K.fillStyle=E;K.beginPath();K.rect(G.X,G.Y,G.Width,G.Height);K.fill()}if(G.HasBorder==1){K.strokeStyle=G.BorderColor;K.beginPath();K.rect(G.X,G.Y,G.Width,G.Height);K.stroke()}}},r);if(m==1){registerClickFunction(i,function(F,H,I){var J=getPanelProps(F,H);var G=getWindowProps(F,H);if(G){var E=I.calcX;var K=I.calcY;if(E>J.X+J.Width-4-(J.ExpandCollapseButtonRadius*2)&&E<J.X+J.Width-4&&K>J.Y+ +((J.HeaderHeight-(J.ExpandCollapseButtonRadius*2))/2)&&K<J.Y+J.HeaderHeight-((J.HeaderHeight-(J.ExpandCollapseButtonRadius*2))/2)){if(J.IsExpanded==1){J.IsExpanded=0;J.Width=J.CollapsedWidth;J.Height=J.HeaderHeight+J.CollapsedHeight;G.Width=J.CollapsedWidth;G.Height=J.HeaderHeight+J.CollapsedHeight}else{J.IsExpanded=1;J.Width=J.OriginalWidth;J.Height=J.OriginalHeight;G.Width=J.OriginalWidth;G.Height=J.OriginalHeight}}invalidateRect(F,null,J.X,J.Y,J.OriginalWidth,J.OriginalHeight)}},r)}else{registerClickFunction(i,function(){},r)}registerMouseDownFunction(i,function(){},r);registerMouseMoveFunction(i,function(){},r);registerMouseUpFunction(i,function(){},r);if(j!=null&&j>0){registerKeyDownFunction(r,function(){},i)}return i}var barGraphsPropsArray=new Array();function getBarGraphProps(c,a){for(var b=0;b<barGraphsPropsArray.length;b++){if(barGraphsPropsArray[b].CanvasID==c&&barGraphsPropsArray[b].WindowID==a){return barGraphsPropsArray[b]}}}function CCLBarGraph(){}CCLBarGraph.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,Data:null,MaxValue:null,NumMarksY:null,Title:null,TitleTextColor:null,TitleTextHeight:null,TitleTextFontString:null,BarWidth:null,AxisLabelsTextHeight:null,AxisLabelsTextFontString:null,AxisLabelsTextColor:null,MarginLeft:null,GapBetweenBars:null,BarClickFunction:null,AlreadyUnregisteredAnimation:null,HasLegend:null,MarginRight:null,Tag:null,ControlNameID:null,Depth:null,TabStopIndex:null,Initialize:function(){return createBarGraph(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.Data,this.MaxValue,this.NumMarksY,this.Title,this.TitleTextColor,this.TitleTextHeight,this.TitleTextFontString,this.BarWidth,this.AxisLabelsTextColor,this.AxisLabelsTextHeight,this.AxisLabelsTextFontString,this.MarginLeft,this.GapBetweenBars,this.BarClickFunction,this.HasLegend,this.MarginRight,this.Tag,this.TabStopIndex)}};function createBarGraph(s,a,l,k,r,o,w,v,p,f,A,d,B,t,h,e,m,q,n,j,c,b,u,z,i){var g=createWindow(s,l,k,r,o,w,null,"BarGraph",a,null,i);barGraphsPropsArray.push({CanvasID:s,WindowID:g,X:l,Y:k,Width:r,Height:o,Data:v,MaxValue:p,NumMarksY:f,Title:A,TitleTextColor:d,TitleTextHeight:B,TitleTextFontString:t,BarWidth:h,BarLabelsWithBoundingBoxes:new Array(),H:o-m-8-20,AxisLabelsTextHeight:m,AxisLabelsTextFontString:q,AxisLabelsTextColor:e,MarginLeft:n,GapBetweenBars:j,BarClickFunction:c,AlreadyUnregisteredAnimation:0,HasLegend:b,MarginRight:u,Tag:z});registerClickFunction(g,function(y,F,D){var x=getBarGraphProps(y,F);var G=D.calcX;var E=D.calcY;for(var C=0;C<x.BarLabelsWithBoundingBoxes.length;C++){if(G>=x.BarLabelsWithBoundingBoxes[C].X&&G<=x.BarLabelsWithBoundingBoxes[C].X+x.BarLabelsWithBoundingBoxes[C].Width&&E>=x.BarLabelsWithBoundingBoxes[C].Y&&E<=x.BarLabelsWithBoundingBoxes[C].Y+x.BarLabelsWithBoundingBoxes[C].Height){if(x.BarClickFunction!=null){x.BarClickFunction(y,F,C);return}}}},s);registerWindowDrawFunction(g,function(J,x){var K=getBarGraphProps(J,x);var M=getCtx(J);var F=K.H;if(K.AlreadyUnregisteredAnimation==0&&F<K.TitleTextHeight+8){K.AlreadyUnregisteredAnimation=1;unregisterAnimatedWindow(J,x)}M.clearRect(0,0,canvas.width,canvas.height);M.save();M.fillStyle=K.TitleTextColor;M.font=K.TitleTextFontString;M.lineWidth=2;M.fillText(K.Title,K.X+(K.Width-M.measureText(K.Title).width)/2,K.Y+K.TitleTextHeight+4);M.lineWidth=1;M.fillStyle=K.AxisLabelsTextColor;M.font=K.AxisLabelsTextFontString;var H=K.Height-K.TitleTextHeight-K.AxisLabelsTextHeight-16;M.beginPath();M.moveTo(K.X+K.MarginLeft,K.Y+K.TitleTextHeight+8+H);M.lineTo(K.X+K.MarginLeft,K.Y+K.TitleTextHeight+8);M.stroke();for(var I=0;I<K.NumMarksY;I++){var C=(K.MaxValue/K.NumMarksY)*I;C=Math.round(C*100)/100;var E=M.measureText(C.toString()).width;var G=H/K.NumMarksY;M.fillText(C.toString(),K.X+K.MarginLeft-E-5,K.Y+K.TitleTextHeight+8+(K.AxisLabelsTextHeight/2)+H-(I*G));M.beginPath();M.moveTo(K.X+K.MarginLeft,K.Y+K.TitleTextHeight+8+H-(I*G));M.lineTo(K.X+K.MarginLeft+(K.Data.length*(K.BarWidth+K.GapBetweenBars))+K.GapBetweenBars,K.Y+K.TitleTextHeight+8+H-(I*G));M.stroke()}K.BarLabelsWithBoundingBoxes=new Array();for(var D=0;D<K.Data.length;D++){if(K.HasLegend!=1){var L=M.measureText(K.Data[D][0]).width;M.fillStyle=K.AxisLabelsTextColor;M.font=K.AxisLabelsTextFontString;if(L<K.BarWidth){M.fillText(K.Data[D][0],K.X+K.MarginLeft+K.GapBetweenBars+(D*(K.BarWidth+K.GapBetweenBars))+((K.BarWidth-L)/2),K.Y+K.Height-4)}else{M.fillText(K.Data[D][0],K.X+K.MarginLeft+K.GapBetweenBars+(D*(K.BarWidth+K.GapBetweenBars))-((L-K.BarWidth)/2),K.Y+K.Height-4)}}drawrect(J,x,M,K,D,H)}if(K.HasLegend==1){for(var y=0;y<K.Data.length;y++){M.fillStyle=v[y][2];M.fillRect(K.X+K.Width-K.MarginRight,K.Y+K.Height-8-K.AxisLabelsTextHeight-(y*(8+K.AxisLabelsTextHeight)),30,K.AxisLabelsTextHeight);M.fillText(v[y][0],K.X+K.Width-K.MarginRight+35,K.Y+K.Height-8-(y*(8+K.AxisLabelsTextHeight)))}}if(F>=K.TitleTextHeight+8){K.H-=5}M.restore()},s);registerAnimatedWindow(s,g);if(i!=null&&i>0){registerKeyDownFunction(s,function(){},g)}return g}function drawrect(a,g,n,h,b,e){var k=h.H;if(h.H<h.TitleTextHeight+8+e-((e*h.Data[b][1])/h.MaxValue)){k=e-((e*h.Data[b][1])/h.MaxValue)}h.BarLabelsWithBoundingBoxes.push({X:h.X+h.MarginLeft+h.GapBetweenBars+(b*(h.BarWidth+h.GapBetweenBars)),Y:h.Y+h.TitleTextHeight+8+k,Width:h.BarWidth,Height:e-k});var l=n.createLinearGradient(h.X,h.Y+h.TitleTextHeight+8,h.X,h.Y+h.Height-h.AxisLabelsTextHeight-8);var m=h.Data[b][2];var d=parseInt(m.substr(1,2),16);var f=parseInt(m.substr(3,2),16);var c=parseInt(m.substr(5,2),16);l.addColorStop(0,"#"+getlowcomp(d)+getlowcomp(f)+getlowcomp(c));l.addColorStop(0.5,m);l.addColorStop(1,"#"+gethighcomp(d)+gethighcomp(f)+gethighcomp(c));n.fillStyle=l;n.shadowOffsetX=5;n.shadowOffsetY=5;n.shadowBlur=5;n.shadowColor="#"+getlowcomp(d)+getlowcomp(f)+getlowcomp(c);n.beginPath();n.moveTo(h.X+h.MarginLeft+h.GapBetweenBars+(b*(h.BarWidth+h.GapBetweenBars)),h.Y+h.TitleTextHeight+8+5+k);n.arc(h.X+h.MarginLeft+h.GapBetweenBars+(b*(h.BarWidth+h.GapBetweenBars))+5,h.Y+h.TitleTextHeight+8+5+k,5,Math.PI,(Math.PI/180)*270,false);n.lineTo(h.X+h.MarginLeft+h.GapBetweenBars+h.BarWidth-5+(b*(h.BarWidth+h.GapBetweenBars)),h.Y+h.TitleTextHeight+8+k);n.arc(h.X+h.MarginLeft+h.GapBetweenBars+h.BarWidth-5+(b*(h.BarWidth+h.GapBetweenBars)),h.Y+h.TitleTextHeight+8+5+k,5,(Math.PI/180)*270,0,false);n.lineTo(h.X+h.MarginLeft+h.GapBetweenBars+h.BarWidth+(b*(h.BarWidth+20)),h.Y+h.TitleTextHeight+8+e);n.lineTo(h.X+h.MarginLeft+h.GapBetweenBars+(b*(h.BarWidth+h.GapBetweenBars)),h.Y+h.TitleTextHeight+8+e);n.closePath();n.fill();n.shadowOffsetX=0;n.shadowOffsetY=0;n.shadowBlur=0;n.shadowColor="#FFFFFF";l=n.createLinearGradient(0,0,50,300);l.addColorStop(0,"#FFFFFF");l.addColorStop(0.5,"#000000");l.addColorStop(1,"#FFFFFF");n.fillStyle=l;n.globalAlpha=0.1;n.beginPath();n.moveTo(h.X+h.MarginLeft+h.GapBetweenBars+(b*(h.BarWidth+h.GapBetweenBars))+5,h.Y+h.TitleTextHeight+8+5+k);n.arc(h.X+h.MarginLeft+h.GapBetweenBars+(b*(h.BarWidth+h.GapBetweenBars))+10,h.Y+h.TitleTextHeight+8+10+k,5,Math.PI,(Math.PI/180)*270,false);n.lineTo(h.X+h.MarginLeft+h.GapBetweenBars+h.BarWidth-10+(b*(h.BarWidth+h.GapBetweenBars)),h.Y+h.TitleTextHeight+8+k+5);n.arc(h.X+h.MarginLeft+h.GapBetweenBars+h.BarWidth-10+(b*(h.BarWidth+h.GapBetweenBars)),h.Y+h.TitleTextHeight+8+10+k,5,(Math.PI/180)*270,0,false);n.lineTo(h.X+h.MarginLeft+h.GapBetweenBars+h.BarWidth+(b*(h.BarWidth+20))-5,h.Y+h.TitleTextHeight+8+e);n.lineTo(h.X+h.MarginLeft+h.GapBetweenBars+(b*(h.BarWidth+h.GapBetweenBars))+5,h.Y+h.TitleTextHeight+8+e);n.closePath();n.fill();n.globalAlpha=1;var j=n.measureText(h.Data[b][1].toString()).width;if(j<h.BarWidth){n.fillText(h.Data[b][1].toString(),h.X+h.MarginLeft+h.GapBetweenBars+(b*(h.BarWidth+h.GapBetweenBars))+((h.BarWidth+-j)/2),h.Y+h.TitleTextHeight+8+h.AxisLabelsTextHeight+k+((e-k)/2))}else{n.fillText(h.Data[b][1].toString(),h.X+h.MarginLeft+h.GapBetweenBars+(b*(h.BarWidth+h.GapBetweenBars))-((j-h.BarWidth)/2),h.Y+h.TitleTextHeight+8+h.AxisLabelsTextHeight+k+((e-k)/2))}}var pieChartsPropsArray=new Array();function getPieChartProps(c,a){for(var b=0;b<barGraphsPropsArray.length;b++){if(pieChartsPropsArray[b].CanvasID==c&&pieChartsPropsArray[b].WindowID==a){return pieChartsPropsArray[b]}}}function CCLPieChart(){}CCLPieChart.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,Data:null,Title:null,TitleTextColor:null,TitleTextHeight:null,TitleTextFontString:null,LabelTextColor:null,LabelTextHeight:null,LabelTextFontString:null,SliceClickFunction:null,Tag:null,ControlNameID:null,Depth:null,TabStopIndex:null,Initialize:function(){return createPieChart(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.Data,this.Title,this.TitleTextColor,this.TitleTextHeight,this.TitleTextFontString,this.LabelTextColor,this.LabelTextHeight,this.LabelTextFontString,this.SliceClickFunction,this.Tag,this.TabStopIndex)}};function createPieChart(n,b,h,g,m,k,t,s,v,c,l,p,f,a,q,j,u,e){var d=createWindow(n,h,g,m,k,t,null,"PieChart",b,null,e);var r=0;for(var o=0;o<s.length;o++){r+=s[o][1]}pieChartsPropsArray.push({CanvasID:n,WindowID:d,X:h,Y:g,Width:m,Height:k,Data:s,Title:v,TitleTextColor:c,TitleTextHeight:l,TitleTextFontString:p,CurrentRadius:20,TotalValue:r,LabelTextColor:f,LabelTextHeight:a,LabelTextFontString:q,AlreadyUnregisteredAnimation:0,DeltaI:-1,DeltaX:0,DeltaY:0,SliceClickFunction:j,Tag:u});registerClickFunction(d,function(w,y,H){var C=getPieChartProps(w,y);var M=C.Data;var L=(C.Height-C.TitleTextHeight-24-(C.LabelTextHeight*2))/2;var I=0;for(var G=0;G<M.length;G++){I+=M[G][1]}var O=H.calcX;var K=H.calcY;var J=-1;var F=C.X+(C.Width-(L*2))/2+L;var E=C.Y+16+C.TitleTextHeight+C.LabelTextHeight+L;if(L*L>(O-F)*(O-F)+(K-E)*(K-E)){if(O>F&&K==E){J=0}else{if(O>F&&K>E){J=(Math.atan((K-E)/(O-F)))*180/Math.PI}else{if(O<F&&K>E){J=180-((Math.atan((K-E)/(O-F)))*180/Math.PI)}else{if(O<F&&K==E){J=180}else{if(O<F&&K<E){J=180+((Math.atan((K-E)/(O-F)))*180/Math.PI)}else{if(O==F&&K<E){J=270}else{if(O>F&&K<E){J=360+((Math.atan((K-E)/(O-F)))*180/Math.PI)}}}}}}}}var N=0;var x=0;var B=0;for(G=0;G<M.length;G++){N+=(M[G][1]*360)/I;var A=0;var z=0;if(J>=0&&x<=J&&N>=J){var D=x+((N-x)/2);if(D==0){A=40;z=0}else{if(D>0&&D<90){A=Math.cos(D*(Math.PI/180))*40;z=Math.sin(D*(Math.PI/180))*40}else{if(D==90){A=0;z=40}else{if(D>90&&D<180){A=-(Math.cos((180-D)*(Math.PI/180))*40);z=Math.sin((180-D)*(Math.PI/180))*40}else{if(D==180){A=-40;z=0}else{if(D>180&&D<270){A=-(Math.cos((180-D)*(Math.PI/180))*40);z=(Math.sin((180-D)*(Math.PI/180))*40)}else{if(D==270){A=0;z=-40}else{if(D>270&&D<360){A=Math.cos((360-D)*(Math.PI/180))*40;z=-(Math.sin((360-D)*(Math.PI/180))*40)}}}}}}}}}if(A!=0||z!=0){C.DeltaX=A;C.DeltaY=z;C.DeltaI=G;B=1;if(C.SliceClickFunction!=null){C.SliceClickFunction(w,y,G)}}if(N<90){lastx=F+Math.cos((Math.PI/180)*N)*L;lasty=E+Math.sin((Math.PI/180)*N)*L}else{if(N==90){lastx=F;lasty=E+L}else{if(N>90&&N<180){lastx=F-Math.cos((Math.PI/180)*(180-N))*L;lasty=E+Math.sin((Math.PI/180)*(180-N))*L}else{if(N==180){lastx=F-L;lasty=E}else{if(N>180&&N<270){lastx=F+Math.cos((Math.PI/180)*(N-180))*L;lasty=E+Math.sin((Math.PI/180)*(N-180))*L}else{if(N==270){lastx=F;lasty=E-L}else{if(N>270&&N<360){lastx=F-Math.cos((Math.PI/180)*(360-N))*L;lasty=E+Math.sin((Math.PI/180)*(360-N))*L}}}}}}}x=N}if(B==0){C.DeltaX=0;C.DeltaY=0;C.DeltaI=-1}},n);registerWindowDrawFunction(d,function(G,w){var y=getPieChartProps(G,w);var C=y.CurrentRadius;if(y.AlreadyUnregisteredAnimation==0&&C>=(y.Height-y.TitleTextHeight-24-(y.LabelTextHeight*2))/2){y.AlreadyUnregisteredAnimation=1;unregisterAnimatedWindow(G,w)}var A=y.Data;var L=y.X+(y.Width-(C*2))/2+C;var I=y.Y+16+y.TitleTextHeight+y.LabelTextHeight+C;var J=getCtx(G);J.save();J.fillStyle=y.TitleTextColor;J.font=y.TitleTextFontString;J.fillText(y.Title,y.X+(y.Width-J.measureText(y.Title).width)/2,y.Y+4+y.TitleTextHeight);J.font=y.LabelTextFontString;var K=0;var B=0;for(var z=0;z<A.length;z++){K+=(A[z][1]*100*360)/(r*100);var E=parseInt(A[z][2].substr(1,2),16);var F=parseInt(A[z][2].substr(3,2),16);var D=parseInt(A[z][2].substr(5,2),16);var H=J.createRadialGradient(L,I,0,L,I,C);H.addColorStop(0,"#"+gethighcomp(E)+gethighcomp(F)+gethighcomp(D));H.addColorStop(0.5,A[z][2]);H.addColorStop(1,"#"+getlowcomp(E)+getlowcomp(F)+getlowcomp(D));J.fillStyle=H;J.beginPath();J.moveTo(L+(y.DeltaI==z?y.DeltaX:0),I+(y.DeltaI==z?y.DeltaY:0));J.arc(L+(y.DeltaI==z?y.DeltaX:0),I+(y.DeltaI==z?y.DeltaY:0),C,(Math.PI/180)*B,(Math.PI/180)*K,false);J.closePath();J.fill();J.strokeStyle=A[z][2];if(K<90){lastx=L+Math.cos((Math.PI/180)*K)*C;lasty=I+Math.sin((Math.PI/180)*K)*C}else{if(K==90){lastx=L;lasty=I+C}else{if(K>90&&K<180){lastx=L-Math.cos((Math.PI/180)*(180-K))*C;lasty=I+Math.sin((Math.PI/180)*(180-K))*C}else{if(K==180){lastx=L-C;lasty=I}else{if(K>180&&K<270){lastx=L+Math.cos((Math.PI/180)*(K-180))*C;lasty=I+Math.sin((Math.PI/180)*(K-180))*C}else{if(K==270){lastx=L;lasty=I-C}else{if(K>270&&K<360){lastx=L-Math.cos((Math.PI/180)*(360-K))*C;lasty=I+Math.sin((Math.PI/180)*(360-K))*C}}}}}}}B=K}if(C<(y.Height-y.TitleTextHeight-24-(y.LabelTextHeight*2))/2){y.CurrentRadius+=5}var K=0;var B=0;J.font=y.LabelTextFontString;for(var z=0;z<A.length;z++){K+=(A[z][1]*100*360)/(r*100);J.fillStyle=A[z][2];drawPieChartLabels(J,A[z][0],K,B,C,r,A[z][1],A[z][2],0,0,L+(y.DeltaI==z?y.DeltaX:0),I+(y.DeltaI==z?y.DeltaY:0),y.LabelTextHeight);B=K}for(var x=0;x<A.length;x++){J.fillStyle=A[x][2];J.fillRect(y.X+y.Width-100,y.Y+y.Height-8-y.LabelTextHeight-(x*(8+y.LabelTextHeight)),30,y.LabelTextHeight);J.fillStyle=A[x][2];J.fillText(A[x][0],y.X+y.Width-100+35,y.Y+y.Height-8-(x*(8+y.LabelTextHeight)))}J.restore()},n);registerAnimatedWindow(n,d);if(e!=null&&e>0){registerKeyDownFunction(n,function(){},d)}return d}function drawPieChartLabels(j,a,m,d,e,c,g,b,l,i,k,h,f){j.fillStyle=b;if((((m-d)/2)+d)<90){j.fillText(g.toString(),k+5+l+Math.cos((Math.PI/180)*(((m-d)/2)+d))*e,h+i+Math.sin((Math.PI/180)*(((m-d)/2)+d))*e)}else{if((((m-d)/2)+d)==90){j.fillText(g.toString(),k+5+l+Math.cos((Math.PI/180)*(((m-d)/2)+d))*e,h+i+Math.sin((Math.PI/180)*(((m-d)/2)+d))*e)}else{if((((m-d)/2)+d)>90&&(((m-d)/2)+d)<180){tw=j.measureText(g.toString()).width;j.fillText(g.toString(),k+l-tw-Math.cos((Math.PI/180)*(180-(((m-d)/2)+d)))*e,h+f+i+Math.sin((Math.PI/180)*(180-(((m-d)/2)+d)))*e)}else{if((((m-d)/2)+d)==180){j.fillText(g.toString(),k+l-Math.cos((Math.PI/180)*(180-(((m-d)/2)+d)))*e,h+f+i+Math.sin((Math.PI/180)*(180-(((m-d)/2)+d)))*e)}else{if((((m-d)/2)+d)>180&&(((m-d)/2)+d)<270){tw=j.measureText(g.toString()).width;j.fillText(g.toString(),k-f+l-tw-Math.cos((Math.PI/180)*((((m-d)/2)+d)-180))*e,h+i-Math.sin((Math.PI/180)*((((m-d)/2)+d)-180))*e)}else{if((((m-d)/2)+d)==270){tw=j.measureText(g.toString()).width;j.fillText(g.toString(),k-f+l-tw-Math.cos((Math.PI/180)*((((m-d)/2)+d)-180))*e,h+i-Math.sin((Math.PI/180)*((((m-d)/2)+d)-180))*e)}else{if((((m-d)/2)+d)>270&&(((m-d)/2)+d)<360){j.fillText(g.toString(),k+f+l+Math.cos((Math.PI/180)*(360-(((m-d)/2)+d)))*e,h+i-Math.sin((Math.PI/180)*(360-(((m-d)/2)+d)))*e)}}}}}}}}var lineGraphsPropsArray=new Array();function getLineGraphProps(c,a){for(var b=0;b<lineGraphsPropsArray.length;b++){if(lineGraphsPropsArray[b].CanvasID==c&&lineGraphsPropsArray[b].WindowID==a){return lineGraphsPropsArray[b]}}}function CCLLineGraph(){}CCLLineGraph.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,Data:null,XMaxValue:null,NumMarksX:null,YMaxValue:null,NumMarksY:null,Title:null,TitleTextColor:null,TitleTextHeight:null,TitleTextFontString:null,AxisLabelsTextColor:null,AxisLabelsTextHeight:null,AxisLabelsTextFontString:null,ClickFunction:null,MarginLeft:null,IsLabeledXValues:null,Tag:null,ControlNameID:null,Depth:null,TabStopIndex:null,Initialize:function(){return createLineGraph(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.Data,this.XMaxValue,this.NumMarksX,this.YMaxValue,this.NumMarksY,this.Title,this.TitleTextColor,this.TitleTextHeight,this.TitleTextFontString,this.AxisLabelsTextColor,this.AxisLabelsTextHeight,this.AxisLabelsTextFontString,this.ClickFunction,this.MarginLeft,this.IsLabeledXValues,this.Tag,this.TabStopIndex)}};function createLineGraph(u,b,n,m,s,q,B,A,w,h,i,g,D,e,r,z,d,p,t,a,o,c,C,l){var k=createWindow(u,n,m,s,q,B,null,"LineGraph",b,null,l);var f=0;for(var v=0;v<A.length;v++){if(A[v][0].length>f){f=A[v][0].length}}lineGraphsPropsArray.push({CanvasID:u,WindowID:k,X:n,Y:m,Width:s,Height:q,Data:A,XMaxValue:w,NumMarksX:h,YMaxValue:i,NumMarksY:g,Title:D,TitleTextColor:e,TitleTextHeight:r,TitleTextFontString:z,AxisLabelsTextColor:d,AxisLabelsTextHeight:p,AxisLabelsTextFontString:t,H:2,HMax:f,LineXYs:new Array(),ClickFunction:a,AlreadyUnregisteredAnimation:0,MarginLeft:o,IsLabeledXValues:c,Tag:C});registerClickFunction(k,function(J,x,G){var F=getLineGraphProps(J,x);if(F.ClickFunction!=null){var K=F.LineXYs;var I=G.calcX;var H=G.calcY;for(var E=0;E<K.length;E++){for(var y=0;y<K[E].length-1;y++){if(I>=K[E][y][0]&&I<=K[E][y+1][0]){if((H<=K[E][y][1]&&H>=K[E][y+1][1])||(H>=K[E][y][1]&&H<=K[E][y+1][1])){m=(((K[E][y][1]-K[E][y+1][1])*(I-K[E][y][0]))/(K[E][y][0]-K[E][y+1][0]))+K[E][y][1];if(m+4>H&&m-4<H){F.ClickFunction(J,x,E)}}}}}}},u);registerWindowDrawFunction(k,function(P,x){var K=getLineGraphProps(P,x);if(K.AlreadyUnregisteredAnimation==0&&K.H>K.HMax){K.AlreadyUnregisteredAnimation=1;unregisterAnimatedWindow(P,x)}K.LineXYs=new Array();var R=getCtx(P);R.save();R.fillStyle=K.TitleTextColor;R.font=K.TitleTextFontString;R.fillText(K.Title,K.X+(K.Width-R.measureText(K.Title).width)/2,K.Y+K.TitleTextHeight+4);R.fillStyle="#A0A0A0";R.font=K.AxisLabelsTextFontString;R.beginPath();R.moveTo(K.X+K.MarginLeft,K.Y+K.Height-K.AxisLabelsTextHeight-8);R.lineTo(K.X+K.MarginLeft,K.Y+K.TitleTextHeight+8);R.stroke();R.beginPath();R.moveTo(K.X+K.MarginLeft,K.Y+K.Height-K.AxisLabelsTextHeight-8);R.lineTo(K.X+K.Width,K.Y+K.Height-K.AxisLabelsTextHeight-8);R.stroke();var G=false;for(var N=0;N<K.NumMarksX;N++){if(G){R.fillStyle="#C0C0C0";G=false}else{R.fillStyle="#D0D0D0";G=true}R.fillRect(K.X+K.MarginLeft+N*((K.Width-K.MarginLeft)/K.NumMarksX),K.Y+K.TitleTextHeight+8,((K.Width-K.MarginLeft)/K.NumMarksX),K.Height-K.TitleTextHeight-K.AxisLabelsTextHeight-16)}R.fillStyle=K.AxisLabelsTextColor;R.font=K.AxisLabelsTextFontString;R.strokeStyle="#404040";for(var N=0;N<K.NumMarksY;N++){var F=(K.YMaxValue/K.NumMarksY)*N;var J=R.measureText(F.toString()).width;R.fillText(F.toString(),K.X+K.MarginLeft-4-J,K.Y+K.Height-K.AxisLabelsTextHeight-8-(N*((K.Height-K.TitleTextHeight-K.AxisLabelsTextHeight-16)/K.NumMarksY)));R.beginPath();R.moveTo(K.X+K.MarginLeft-3,K.Y+K.Height-K.AxisLabelsTextHeight-8-(N*((K.Height-K.TitleTextHeight-K.AxisLabelsTextHeight-16)/K.NumMarksY)));R.lineTo(K.X+K.Width,K.Y+K.Height-K.AxisLabelsTextHeight-8-(N*((K.Height-K.TitleTextHeight-K.AxisLabelsTextHeight-16)/K.NumMarksY)));R.stroke()}var O=new Array();if(K.IsLabeledXValues==1){var M=0;for(var I=0;I<K.Data.length;I++){if(K.Data[I][0].length>M){M=K.Data[I][0].length}}for(var I=0;I<M;I++){for(var H=0;H<K.Data.length;H++){if(I<K.Data[H][0].length){var E=0;for(var y=0;y<O.length;y++){if(O[y]==K.Data[H][0][I][0]){E=1;break}}if(E==0){O.push(K.Data[H][0][I][0])}}}}}for(var L=0;L<K.NumMarksX;L++){var F;var Q;if(K.IsLabeledXValues==1){Q=O.length/K.NumMarksX;if(O.length%K.NumMarksX>=K.NumMarksX/2){F=O[L*Math.ceil(Q)]}else{F=O[L*Math.floor(Q)]}}else{F=(K.XMaxValue/K.NumMarksX)*L}var J=R.measureText(F.toString()).width;R.fillText(F.toString(),K.X+K.MarginLeft+((L*(K.Width-K.MarginLeft))/K.NumMarksX)-(J/2),K.Y+K.Height-4);R.beginPath();R.moveTo(K.X+K.MarginLeft+((L*(K.Width-K.MarginLeft))/K.NumMarksX),K.Y+K.Height-K.AxisLabelsTextHeight-5);R.lineTo(K.X+K.MarginLeft+((L*(K.Width-K.MarginLeft))/K.NumMarksX),K.Y+K.TitleTextHeight+8);R.stroke()}var I=0;while(I<A.length){drawline(u,R,K,I,O);I++}if(K.H<K.HMax){K.H+=1}R.restore()},u);registerAnimatedWindow(u,k);if(l!=null&&l>0){registerKeyDownFunction(u,function(){},k)}return k}function findXLabelIndexForValue(c,b){for(var a=0;a<c.length;a++){if(c[a]==b){return a}}}function drawline(a,j,c,h,g){var e=parseInt(c.Data[h][1].substr(1,2),16);var f=parseInt(c.Data[h][1].substr(3,2),16);var d=parseInt(c.Data[h][1].substr(5,2),16);j.strokeStyle=c.Data[h][1];j.lineWidth=3;j.lineCap="round";j.miterLimit=0;j.shadowOffsetX=2;j.shadowOffsetY=2;j.shadowBlur=5;j.shadowColor="#"+getlowcomp(e).toString(16)+getlowcomp(f).toString(16)+getlowcomp(d).toString(16);j.beginPath();var k=new Array();k=k.concat([[c.X+c.MarginLeft+(c.IsLabeledXValues==1?(findXLabelIndexForValue(g,c.Data[h][0][0][0])*(c.Width-c.MarginLeft))/g.length:((c.Data[h][0][0][0]*(c.Width-c.MarginLeft))/c.XMaxValue)),c.Y+c.Height-c.AxisLabelsTextHeight-8-((c.Data[h][0][0][1]*(c.Height-c.TitleTextHeight-c.AxisLabelsTextHeight-16))/c.YMaxValue)]]);j.moveTo(c.X+c.MarginLeft+(c.IsLabeledXValues==1?(findXLabelIndexForValue(g,c.Data[h][0][0][0])*(c.Width-c.MarginLeft))/g.length:((c.Data[h][0][0][0]*(c.Width-c.MarginLeft))/c.XMaxValue)),c.Y+c.Height-c.AxisLabelsTextHeight-8-((c.Data[h][0][0][1]*(c.Height-c.TitleTextHeight-c.AxisLabelsTextHeight-16))/c.YMaxValue));for(var b=1;b<c.H&&b<c.Data[h][0].length;b++){k=k.concat([[c.X+c.MarginLeft+(c.IsLabeledXValues==1?(findXLabelIndexForValue(g,c.Data[h][0][b][0])*(c.Width-c.MarginLeft))/g.length:((c.Data[h][0][b][0]*(c.Width-c.MarginLeft))/c.XMaxValue)),c.Y+c.Height-c.AxisLabelsTextHeight-8-((c.Data[h][0][b][1]*(c.Height-c.TitleTextHeight-c.AxisLabelsTextHeight-16))/c.YMaxValue)]]);j.lineTo(c.X+c.MarginLeft+(c.IsLabeledXValues==1?(findXLabelIndexForValue(g,c.Data[h][0][b][0])*(c.Width-c.MarginLeft))/g.length:((c.Data[h][0][b][0]*(c.Width-c.MarginLeft))/c.XMaxValue)),c.Y+c.Height-c.AxisLabelsTextHeight-8-((c.Data[h][0][b][1]*(c.Height-c.TitleTextHeight-c.AxisLabelsTextHeight-16))/c.YMaxValue))}c.LineXYs.concat([[k]]);j.stroke()}var gaugeChartPropsArray=new Array();function getGaugeChartProps(c,a){for(var b=0;b<gaugeChartPropsArray.length;b++){if(gaugeChartPropsArray[b].CanvasID==c&&gaugeChartPropsArray[b].WindowID==a){return gaugeChartPropsArray[b]}}}function CCLGauge(){}CCLGauge.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,Data:null,Title:null,TitleTextColor:null,TitleTextHeight:null,TitleTextFontString:null,GaugeRadius:null,GaugeLabelTextColor:null,GaugeLabelTextHeight:null,GaugeLabelTextFontString:null,Tag:null,ControlNameID:null,Depth:null,TabStopIndex:null,Initialize:function(){return(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.Data,this.Title,this.TitleTextColor,this.TitleTextHeight,this.TitleTextFontString,this.GaugeRadius,this.GaugeLabelTextColor,this.GaugeLabelTextHeight,this.GaugeLabelTextFontString,this.Tag,this.TabStopIndex)}};function createGauge(l,a,h,g,k,i,q,p,s,b,j,m,f,c,n,o,r,e){var d=createWindow(l,h,g,k,i,q,null,"Gauge",a,null,e);gaugeChartPropsArray.push({CanvasID:l,WindowID:d,X:h,Y:g,Width:k,Height:i,Data:p,Title:s,TitleTextColor:b,TitleTextHeight:j,TitleTextFontString:m,H:1,CenterX:h+k/2,CenterY:g+(i-8-j)/2+(i-8-j-(f*2))/2,GaugeRadius:f,GaugeLabelTextColor:c,GaugeLabelTextHeight:n,GaugeLabelTextFontString:o,AlreadyUnregisteredAnimation:0,Tag:r});registerWindowDrawFunction(d,function(t,y){var B=getGaugeChartProps(t,y);var F=getCtx(t);if(B.AlreadyUnregisteredAnimation==0&&B.H>100){B.AlreadyUnregisteredAnimation=1;unregisterAnimatedWindow(canvaisd1,y)}F.save();F.globalAlpha=B.H/100;F.fillStyle=B.TitleTextColor;F.font=B.TitleTextFontString;F.fillText(B.Title,B.X+((B.Width-F.measureText(s).width)/2),B.Y+B.TitleTextHeight+4);var x=F.createRadialGradient(B.CenterX,B.CenterY,0,B.CenterX,B.CenterY,B.GaugeRadius-5);x.addColorStop(0,"#C0C0C0");x.addColorStop(0.5,"#A0A0A0");x.addColorStop(1,"#D0D0D0");F.fillStyle=x;F.beginPath();F.arc(B.CenterX,B.CenterY,B.GaugeRadius,0,2*Math.PI,false);F.arc(B.CenterX,B.CenterY,B.GaugeRadius-5,0,2*Math.PI,true);F.closePath();F.fill();var u=F.createRadialGradient(B.CenterX,B.CenterY,0,B.CenterX,B.CenterY,B.GaugeRadius-5);u.addColorStop(0,"#0000C0");u.addColorStop(0.5,"#0000A0");u.addColorStop(1,"#0000D0");F.fillStyle=u;F.beginPath();F.arc(B.CenterX,B.CenterY,B.GaugeRadius-5,0,2*Math.PI,false);F.fill();if(B.H<60){F.globalAlpha=0}else{F.globalAlpha=(B.H-60)/100}var K=F.createRadialGradient(B.CenterX,B.CenterY,B.GaugeRadius-50,B.CenterX,B.CenterY,B.GaugeRadius-5);K.addColorStop(0,"#000000");K.addColorStop(1,"#FFFFFF");F.fillStyle=K;F.beginPath();F.moveTo(B.CenterX-(Math.sin(Math.PI/8)*(B.GaugeRadius-10)),B.CenterY+(Math.cos(Math.PI/8)*(B.GaugeRadius-10)));F.arc(B.CenterX,B.CenterY,B.GaugeRadius-10,(Math.PI/180)*112.5,(Math.PI/180)*67.5,false);F.lineTo(B.CenterX+(Math.sin(Math.PI/8)*(B.GaugeRadius-50)),B.CenterY+(Math.cos(Math.PI/8)*(B.GaugeRadius-50)));F.arc(B.CenterX,B.CenterY,B.GaugeRadius-50,(Math.PI/180)*67.5,(Math.PI/180)*112.5,true);F.closePath();F.fill();F.globalAlpha=B.H/100;F.strokeStyle="#000000";for(var G=0;G<((B.Data[1]/B.Data[5])+1);G++){var H=((315*G)/(B.Data[1]/B.Data[5]))+112.5;if(H>360){H-=360}F.beginPath();if(H==0){F.moveTo(B.CenterX+(B.GaugeRadius-45),B.CenterY);F.lineTo(B.CenterX+(B.GaugeRadius-25),B.CenterY)}else{if(H>0&&H<90){F.moveTo(B.CenterX+(Math.cos((Math.PI/180)*H)*(B.GaugeRadius-45)),B.CenterY+(Math.sin((Math.PI/180)*H)*(B.GaugeRadius-45)));F.lineTo(B.CenterX+(Math.cos((Math.PI/180)*H)*(B.GaugeRadius-25)),B.CenterY+(Math.sin((Math.PI/180)*H)*(B.GaugeRadius-25)))}else{if(H==90){F.moveTo(B.CenterX,B.CenterY+(B.GaugeRadius-45));F.lineTo(B.CenterX,B.CenterY+(B.GaugeRadius-25))}else{if(H>90&&H<180){H=180-H;F.moveTo(B.CenterX-(Math.cos((Math.PI/180)*H)*(B.GaugeRadius-45)),B.CenterY+(Math.sin((Math.PI/180)*H)*(B.GaugeRadius-45)));F.lineTo(B.CenterX-(Math.cos((Math.PI/180)*H)*(B.GaugeRadius-25)),B.CenterY+(Math.sin((Math.PI/180)*H)*(B.GaugeRadius-25)))}else{if(H==180){F.moveTo(B.CenterX-(B.GaugeRadius-45),B.CenterY);F.lineTo(B.CenterX-(B.GaugeRadius-25),B.CenterY)}else{if(H>180&&H<270){H=H-180;F.moveTo(B.CenterX-(Math.cos((Math.PI/180)*H)*(B.GaugeRadius-45)),B.CenterY-(Math.sin((Math.PI/180)*H)*(B.GaugeRadius-45)));F.lineTo(B.CenterX-(Math.cos((Math.PI/180)*H)*(B.GaugeRadius-25)),B.CenterY-(Math.sin((Math.PI/180)*H)*(B.GaugeRadius-25)))}else{if(H==270){F.moveTo(B.CenterX,B.CenterY-(B.GaugeRadius-45));F.lineTo(B.CenterX,B.CenterY-(B.GaugeRadius-25))}else{if(H>270&&H<360){H=H-270;F.moveTo(B.CenterX+(Math.sin((Math.PI/180)*H)*(B.GaugeRadius-45)),B.CenterY-(Math.cos((Math.PI/180)*H)*(B.GaugeRadius-45)));F.lineTo(B.CenterX+(Math.sin((Math.PI/180)*H)*(B.GaugeRadius-25)),B.CenterY-(Math.cos((Math.PI/180)*H)*(B.GaugeRadius-25)))}}}}}}}}F.stroke()}F.fillStyle=B.GaugeLabelTextColor;F.font=B.GaugeLabelTextFontString;for(var G=0;G<((B.Data[1]/B.Data[5])+1);G++){var H=((315*G)/(B.Data[1]/B.Data[5]))+112.5;if(H>360){H-=360}var E=(G*B.Data[5]).toString();var I=F.measureText(E).width;var D=B.GaugeLabelTextHeight;if(H==0){F.fillText(E,B.CenterX+(B.GaugeRadius-52)-F.measureText(E).width,B.CenterY)}else{if(H>0&&H<90){F.fillText(E,B.CenterX-I+(Math.cos((Math.PI/180)*H)*(B.GaugeRadius-52)),B.CenterY+(Math.sin((Math.PI/180)*H)*(B.GaugeRadius-52)))}else{if(H==90){F.fillText(E,B.CenterX-(I/2),B.CenterY+(B.GaugeRadius-52)-D)}else{if(H>90&&H<180){H=180-H;F.fillText(E,B.CenterX-(Math.cos((Math.PI/180)*H)*(B.GaugeRadius-52)),B.CenterY+(Math.sin((Math.PI/180)*H)*(B.GaugeRadius-52)))}else{if(H==180){F.fillText(E,B.CenterX-(B.GaugeRadius-52),B.CenterY-(D/2))}else{if(H>180&&H<270){H=H-180;F.fillText(E,B.CenterX-(Math.cos((Math.PI/180)*H)*(B.GaugeRadius-52)),B.CenterY+D-(Math.sin((Math.PI/180)*H)*(B.GaugeRadius-52)))}else{if(H==270){F.fillText(E,B.CenterX-(I/2),B.CenterY-(B.GaugeRadius-52)+D)}else{if(H>270&&H<360){H=H-270;F.fillText(E,B.CenterX+(Math.sin((Math.PI/180)*H)*((B.GaugeRadius-52)-I)),B.CenterY-(Math.cos((Math.PI/180)*H)*((B.GaugeRadius-52)-I)))}}}}}}}}}F.strokeStyle="#000000";for(var G=0;G<((((B.Data[1]/B.Data[5])*B.Data[6]))+1);G++){if(G%B.Data[6]>0){var H=((315*G)/((B.Data[1]/B.Data[5])*B.Data[6]))+112.5;if(H>360){H-=360}F.beginPath();if(H==0){F.moveTo(B.CenterX+(B.GaugeRadius-45),B.CenterY);F.lineTo(B.CenterX+(B.GaugeRadius-35),B.CenterY)}else{if(H>0&&H<90){F.moveTo(B.CenterX+(Math.cos((Math.PI/180)*H)*(B.GaugeRadius-45)),B.CenterY+(Math.sin((Math.PI/180)*H)*(B.GaugeRadius-45)));F.lineTo(B.CenterX+(Math.cos((Math.PI/180)*H)*(B.GaugeRadius-35)),B.CenterY+(Math.sin((Math.PI/180)*H)*(B.GaugeRadius-35)))}else{if(H==90){F.moveTo(B.CenterX,B.CenterY+(B.GaugeRadius-45));F.lineTo(B.CenterX,B.CenterY+(B.GaugeRadius-35))}else{if(H>90&&H<180){H=180-H;F.moveTo(B.CenterX-(Math.cos((Math.PI/180)*H)*(B.GaugeRadius-45)),B.CenterY+(Math.sin((Math.PI/180)*H)*(B.GaugeRadius-45)));F.lineTo(B.CenterX-(Math.cos((Math.PI/180)*H)*(B.GaugeRadius-35)),B.CenterY+(Math.sin((Math.PI/180)*H)*(B.GaugeRadius-35)))}else{if(H==180){F.moveTo(B.CenterX-(B.GaugeRadius-45),B.CenterY);F.lineTo(B.CenterX-(B.GaugeRadius-35),B.CenterY)}else{if(H>180&&H<270){H=H-180;F.moveTo(B.CenterX-(Math.cos((Math.PI/180)*H)*(B.GaugeRadius-45)),B.CenterY-(Math.sin((Math.PI/180)*H)*(B.GaugeRadius-45)));F.lineTo(B.CenterX-(Math.cos((Math.PI/180)*H)*(B.GaugeRadius-35)),B.CenterY-(Math.sin((Math.PI/180)*H)*(B.GaugeRadius-35)))}else{if(H==270){F.moveTo(B.CenterX,B.CenterY-(B.GaugeRadius-45));F.lineTo(B.CenterX,B.CenterY-(B.GaugeRadius-35))}else{if(H>270&&H<360){H=H-270;F.moveTo(B.CenterX+(Math.sin((Math.PI/180)*H)*(B.GaugeRadius-45)),B.CenterY-(Math.cos((Math.PI/180)*H)*(B.GaugeRadius-45)));F.lineTo(B.CenterX+(Math.sin((Math.PI/180)*H)*(B.GaugeRadius-35)),B.CenterY-(Math.cos((Math.PI/180)*H)*(B.GaugeRadius-35)))}}}}}}}}F.stroke()}}drawarc(F,B.Data[2][2],B.Data[2][0],B.Data[2][1],B.Data[1],B.CenterX,B.CenterY,B.GaugeRadius);drawarc(F,B.Data[3][2],B.Data[3][0],B.Data[3][1],B.Data[1],B.CenterX,B.CenterY,B.GaugeRadius);drawarc(F,B.Data[4][2],B.Data[4][0],B.Data[4][1],B.Data[1],B.CenterX,B.CenterY,B.GaugeRadius);var A=(((315*B.Data[7])/B.Data[1])*(B.H/100))+112.5;if(A>360){A-=360}F.translate(B.CenterX,B.CenterY);F.rotate((Math.PI/180)*A);var z="#60007C";var J=F.createLinearGradient(0,0,B.GaugeRadius-80,0);var w=parseInt(z.substr(1,2),16);var v=parseInt(z.substr(3,2),16);var C=parseInt(z.substr(5,2),16);J.addColorStop(0,"#"+getlowcomp(w)+getlowcomp(v)+getlowcomp(C));J.addColorStop(0.5,z);J.addColorStop(1,"#"+gethighcomp(w)+gethighcomp(v)+gethighcomp(C));F.fillStyle=J;F.beginPath();F.moveTo(0,10);F.lineTo(0,-10);F.lineTo(B.GaugeRadius-40,0);F.closePath();F.fill();var K=F.createRadialGradient(B.CenterX,B.CenterY,0,B.CenterX,B.CenterY,10);K.addColorStop(0,"#C0C0C0");K.addColorStop(0.5,"#A0A0A0");K.addColorStop(1,"#D0D0D0");F.fillStyle=K;F.beginPath();F.arc(0,0,10,0,Math.PI*2,false);F.fill();F.restore();if(B.H<100){B.H++}},l);registerAnimatedWindow(l,d);if(e!=null&&e>0){registerKeyDownFunction(l,function(){},d)}return d}function drawarc(n,j,a,f,l,o,m,c){var b=n.createRadialGradient(o,m,c-100,o,m,c-80);var h=parseInt(j.substr(1,2),16);var i=parseInt(j.substr(3,2),16);var e=parseInt(j.substr(5,2),16);b.addColorStop(0,"#"+getlowcomp(h)+getlowcomp(i)+getlowcomp(e));b.addColorStop(0.5,j);b.addColorStop(1,"#"+gethighcomp(h)+gethighcomp(i)+gethighcomp(e));n.fillStyle=b;var g=((315*a)/l)+112.5;if(g>360){g-=360}var k=((315*f)/l)+112.5;if(k>360){k-=360}n.beginPath();var d=0;if(g==0){n.moveTo(o+(c-100),m)}else{if(g>0&&g<90){n.moveTo(o+(Math.cos((Math.PI/180)*g)*(c-100)),m+(Math.sin((Math.PI/180)*g)*(c-100)))}else{if(g==90){n.moveTo(o,m+(c-100))}else{if(g>90&&g<180){d=180-g;n.moveTo(o-(Math.cos((Math.PI/180)*d)*(c-100)),m+(Math.sin((Math.PI/180)*d)*(c-100)))}else{if(g==180){n.moveTo(o-(c-100),m)}else{if(g>180&&g<270){d=g-180;n.moveTo(o-(Math.cos((Math.PI/180)*d)*(c-100)),m-(Math.sin((Math.PI/180)*d)*(c-100)))}else{if(g==270){n.moveTo(o,m-(c-100))}else{if(g>270&&g<360){d=g-270;n.moveTo(o+(Math.sin((Math.PI/180)*d)*(c-100)),m-(Math.cos((Math.PI/180)*d)*(c-100)))}}}}}}}}n.arc(o,m,(c-100),(Math.PI/180)*g,(Math.PI/180)*k,false);n.arc(o,m,(c-80),(Math.PI/180)*k,(Math.PI/180)*g,true);n.closePath();n.fill()}var radarGraphPropsArray=new Array();function getRadarGraphProps(c,a){for(var b=0;b<radarGraphPropsArray.length;b++){if(radarGraphPropsArray[b].CanvasID==c&&radarGraphPropsArray[b].WindowID==a){return radarGraphPropsArray[b]}}}function CCLRadarGraph(){}CCLRadarGraph.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,Data:null,MaxValue:null,ColorStr:null,NumMarks:null,Title:null,TitleTextColor:null,TitleTextHeight:null,TitleTextFontString:null,MarkLabelTextColor:null,MarkLabelTextHeight:null,MarkLabelTextFontString:null,Tag:null,ControlNameID:null,Depth:null,TabStopIndex:null,Initialize:function(){return createRadarGraph(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.Data,this.MaxValue,this.ColorStr,this.NumMarks,this.Title,this.TitleTextColor,this.TitleTextHeight,this.TitleTextFontString,this.MarkLabelTextColor,this.MarkLabelTextHeight,this.MarkLabelTextFontString,this.Tag,this.TabStopIndex)}};function createRadarGraph(n,a,g,f,m,j,s,r,k,b,h,u,c,l,q,o,p,i,t,e){var d=createWindow(n,g,f,m,j,s,null,"RadarGraph",a,null,e);radarGraphPropsArray.push({CanvasID:n,WindowID:d,X:g,Y:f,Width:m,Height:j,Data:r,MaxValue:k,ColorStr:b,NumMarks:h,Title:u,TitleTextColor:c,TitleTextHeight:l,TitleTextFontString:q,H:20,MarkLabelTextColor:o,MarkLabelTextHeight:p,MarkLabelTextFontString:i,AlreadyUnregisteredAnimation:0,Tag:t});registerWindowDrawFunction(d,function(H,y){var v=getRadarGraphProps(H,y);var I=getCtx(H);if(v.AlreadyUnregisteredAnimation==0&&v.H>=((v.Height-v.TitleTextHeight-8-v.MarkLabelTextHeight-8-4)/2)){v.AlreadyUnregisteredAnimation=1;unregisterAnimatedWindow(H,y)}I.save();I.fillStyle=v.TitleTextColor;I.font=v.TitleTextFontString;I.fillText(v.Title,v.X+((v.Width-I.measureText(v.Title).width)/2),v.Y+v.TitleTextHeight+4);I.font=v.MarkLabelTextFontString;var z=(Math.PI*360)/(180*v.Data.length);I.translate(v.X+(v.Width/2),v.Y+v.TitleTextHeight+8+((v.Height-v.TitleTextHeight-8-v.MarkLabelTextHeight-8)/2)+v.MarkLabelTextHeight+8);I.rotate(Math.PI*270/180);var D=parseInt(v.ColorStr.substr(1,2),16);var E=parseInt(v.ColorStr.substr(3,2),16);var C=parseInt(v.ColorStr.substr(5,2),16);var G=I.createRadialGradient(0,0,0,0,0,v.H);G.addColorStop(0,"#"+gethighcomp(D)+gethighcomp(E)+gethighcomp(C));G.addColorStop(0.5,v.ColorStr);G.addColorStop(1,"#"+getlowcomp(D)+getlowcomp(E)+getlowcomp(C));I.fillStyle=G;I.beginPath();I.moveTo(v.Data[0]*v.H/v.MaxValue,0);for(var B=1;B<v.Data.length;B++){I.rotate(z);I.lineTo(v.Data[B]*v.H/v.MaxValue,0)}I.closePath();I.fill();I.restore();I.save();I.strokeStyle="#505050";I.translate(v.X+(v.Width/2),v.Y+v.TitleTextHeight+8+((v.Height-v.TitleTextHeight-8-v.MarkLabelTextHeight-8)/2)+v.MarkLabelTextHeight+8);I.rotate((Math.PI*270)/180);for(var B=0;B<v.Data.length;B++){I.beginPath();I.moveTo(0,0);I.lineTo(v.H,0);I.closePath();I.stroke();var w=v.H/v.NumMarks;for(var F=0;F<v.NumMarks;F++){I.beginPath();I.moveTo((F+1)*w,3);I.lineTo((F+1)*w,-3);I.closePath();I.stroke()}I.rotate(z)}I.restore();I.fillStyle=v.MarkLabelTextColor;I.font=v.MarkLabelTextFontString;if(v.H==((v.Height-v.TitleTextHeight-8-v.MarkLabelTextHeight-8-4)/2)){I.save();I.translate(v.X+(v.Width/2),v.Y+v.TitleTextHeight+8+((v.Height-v.TitleTextHeight-8-v.MarkLabelTextHeight-8)/2)+v.MarkLabelTextHeight+8);for(var B=0;B<v.NumMarks;B++){var A=(((B+1)*v.MaxValue)/v.NumMarks).toString();I.fillText(A,-(I.measureText(A).width+5),(v.MarkLabelTextHeight/2)-((B+1)*(((v.Height-v.TitleTextHeight-8)/2)/v.NumMarks)))}I.restore()}if(v.H+5<=((v.Height-v.TitleTextHeight-8-v.MarkLabelTextHeight-8-4)/2)){v.H+=5}else{v.H=((v.Height-v.TitleTextHeight-8-v.MarkLabelTextHeight-8-4)/2)}},n);registerAnimatedWindow(n,d)}var lineAreaGraphPropsArray=new Array();function getLineAreaGraphProps(c,a){for(var b=0;b<lineAreaGraphPropsArray.length;b++){if(lineAreaGraphPropsArray[b].CanvasID==c&&lineAreaGraphPropsArray[b].WindowID==a){return lineAreaGraphPropsArray[b]}}}function CCLLineAreaGraph(){}CCLLineAreaGraph.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,Data:null,XMaxValue:null,YMaxValue:null,NumMarksX:null,NumMarksY:null,Title:null,TitleTextColor:null,TitleTextHeight:null,TitleTextFontString:null,AxisLabelsColor:null,AxisLabelsHeight:null,AxisLabelsFontString:null,MarginLeft:null,IsLabledOnXAxis:null,Tag:null,ControlNameID:null,Depth:null,TabStopIndex:null,Initialize:function(){return createLineAreaGraph(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.Data,this.XMaxValue,this.YMaxValue,this.NumMarksX,this.NumMarksY,this.Title,this.TitleTextColor,this.TitleTextHeight,this.TitleTextFontString,this.AxisLabelsColor,this.AxisLabelsHeight,this.AxisLabelsFontString,this.MarginLeft,this.IsLabledOnXAxis,this.Tag,this.TabStopIndex)}};function createLineAreaGraph(q,a,l,k,p,n,v,u,s,h,g,e,z,d,o,t,c,f,b,m,r,w,j){var i=createWindow(q,l,k,p,n,v,null,"LineAreaGraph",a,null,j);lineAreaGraphPropsArray.push({CanvasID:q,WindowID:i,X:l,Y:k,Width:p,Height:n,Data:u,XMaxValue:s,YMaxValue:h,NumMarksX:g,NumMarksY:e,Title:z,TitleTextColor:d,TitleTextHeight:o,TitleTextFontString:t,AxisLabelsColor:c,AxisLabelsHeight:f,AxisLabelsFontString:b,H:0,MarginLeft:m,AlreadyUnregisteredAnimation:0,IsLabledOnXAxis:r,Tag:w});registerWindowDrawFunction(i,function(L,x){var E=getLineAreaGraphProps(L,x);if(E.AlreadyUnregisteredAnimation==0&&E.H>=E.Data[0].length-1){E.AlreadyUnregisteredAnimation=1;unregisterAnimatedWindow(L,x)}var N=getCtx(L);N.save();N.fillStyle=E.TitleTextColor;N.font=E.TitleTextFontString;N.fillText(E.Title,E.X+((E.Width-N.measureText(E.Title).width)/2),E.Y+4+E.TitleTextHeight);N.font=E.AxisLabelsFontString;N.beginPath();N.moveTo(E.X+E.MarginLeft,E.Y+E.Height-E.AxisLabelsHeight-8);N.lineTo(E.X+E.MarginLeft,E.Y+E.TitleTextHeight+8);N.stroke();N.beginPath();N.moveTo(E.X+E.MarginLeft,E.Y+E.Height-E.AxisLabelsHeight-8);N.lineTo(E.X+E.Width,E.Y+E.Height-E.AxisLabelsHeight-8);N.stroke();var A=false;for(var I=0;I<E.NumMarksX;I++){if(A){N.fillStyle="#C0C0C0";A=false}else{N.fillStyle="#D0D0D0";A=true}N.fillRect(E.X+E.MarginLeft+I*((E.Width-E.MarginLeft)/E.NumMarksX),E.Y+E.TitleTextHeight+8,((E.Width-E.MarginLeft)/E.NumMarksX),E.Height-E.TitleTextHeight-E.AxisLabelsHeight-16)}N.fillStyle=E.AxisLabelsColor;N.strokeStyle="#404040";for(I=0;I<E.NumMarksY;I++){var y=(E.YMaxValue/E.NumMarksY)*I;var C=N.measureText(y.toString()).width;N.fillText(y.toString(),E.X+E.MarginLeft-C-10,E.Y+E.Height-E.AxisLabelsHeight-8-(I*((E.Height-E.TitleTextHeight-E.AxisLabelsHeight-16)/E.NumMarksY)));N.beginPath();N.moveTo(E.X+E.MarginLeft-5,E.Y+E.Height-E.AxisLabelsHeight-8-(I*((E.Height-E.TitleTextHeight-E.AxisLabelsHeight-16)/E.NumMarksY)));N.lineTo(E.X+E.Width,E.Y+E.Height-E.AxisLabelsHeight-8-(I*((E.Height-E.TitleTextHeight-E.AxisLabelsHeight-16)/E.NumMarksY)));N.stroke()}var J=new Array();if(E.IsLabledOnXAxis==1){for(var B=0;B<E.Data[0].length;B++){J.push(E.Data[0][B][0])}}N.fillStyle=E.AxisLabelsColor;for(var G=0;G<E.NumMarksX;G++){var y;if(E.IsLabledOnXAxis==1){increment=J.length/E.NumMarksX;if(J.length%E.NumMarksX>=E.NumMarksX/2){y=J[G*Math.ceil(increment)]}else{y=J[G*Math.floor(increment)]}}else{y=(E.XMaxValue/E.NumMarksX)*G}var C=N.measureText(y.toString()).width;N.fillText(y.toString(),E.X+E.MarginLeft+(G*((E.Width-E.MarginLeft)/E.NumMarksX))-(C/2),E.Y+E.Height-4);N.beginPath();N.moveTo(E.X+E.MarginLeft+(G*((E.Width-E.MarginLeft)/E.NumMarksX)),E.Y+E.TitleTextHeight+8+(E.Height-E.TitleTextHeight-E.AxisLabelsHeight-16)+5);N.lineTo(E.X+E.MarginLeft+(G*((E.Width-E.MarginLeft)/E.NumMarksX)),E.Y+E.TitleTextHeight+8);N.stroke()}for(var I=0;I<E.Data[0][0][1].length;I++){var M=E.Data[1][I];var K=N.createLinearGradient(E.X+E.MarginLeft,E.Y+E.Height-E.AxisLabelsHeight-8,E.X+E.Width-E.MarginLeft,E.Y+E.Height-E.AxisLabelsHeight-8);var F=parseInt(M.substr(1,2),16);var H=parseInt(M.substr(3,2),16);var D=parseInt(M.substr(5,2),16);K.addColorStop(0,"#"+getlowcomp(F)+getlowcomp(H)+getlowcomp(D));K.addColorStop(0.5,M);K.addColorStop(1,"#"+gethighcomp(F)+gethighcomp(H)+gethighcomp(D));N.fillStyle=K;N.beginPath();N.moveTo(E.X+E.MarginLeft,E.Y+E.Height-E.AxisLabelsHeight-8);for(var B=0;B<E.H+1;B++){N.lineTo(E.X+E.MarginLeft+(E.IsLabledOnXAxis==1?(findXLabelIndexForValue(J,E.Data[0][B][0])*(E.Width-E.MarginLeft))/J.length:((E.Data[0][B][0]*(E.Width-E.MarginLeft))/E.XMaxValue)),E.Y+E.Height-E.AxisLabelsHeight-8-((E.Data[0][B][1][I]+sumyvalues(E.Data,I,B))*(E.Height-E.TitleTextHeight-E.AxisLabelsHeight-16))/E.YMaxValue)}if(I==0){N.lineTo(E.X+E.MarginLeft+(E.IsLabledOnXAxis==1?(findXLabelIndexForValue(J,E.Data[0][E.H][0])*(E.Width-E.MarginLeft))/J.length:((E.Data[0][E.H][0]*(E.Width-E.MarginLeft))/E.XMaxValue)),E.Y+E.Height-E.AxisLabelsHeight-8)}else{for(var B=E.H;B>=0;B--){N.lineTo(E.X+E.MarginLeft+(E.IsLabledOnXAxis==1?(findXLabelIndexForValue(J,E.Data[0][B][0])*(E.Width-E.MarginLeft))/J.length:((E.Data[0][B][0]*(E.Width-E.MarginLeft))/E.XMaxValue)),E.Y+E.Height-E.AxisLabelsHeight-8-((E.Data[0][B][1][I-1]+sumyvalues(E.Data,I-1,B))*(E.Height-E.TitleTextHeight-E.AxisLabelsHeight-16))/E.YMaxValue)}}N.closePath();N.fill()}N.restore();if(E.H<E.Data[0].length-1){E.H++}},q);registerAnimatedWindow(q,i)}function sumyvalues(e,f,b){var d=0;for(var a=0;a<f;a++){d+=e[0][b][1][a]}return d}var candlesticksGraphPropsArray=new Array();function getCandlesticksGraphProps(c,a){for(var b=0;b<candlesticksGraphPropsArray.length;b++){if(candlesticksGraphPropsArray[b].CanvasID==c&&candlesticksGraphPropsArray[b].WindowID==a){return candlesticksGraphPropsArray[b]}}}function CCLCandlesticksGraph(){}CCLCandlesticksGraph.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,Data:null,XMarksLabelData:null,XMarksWidth:null,YMaxValue:null,NumMarksY:null,Title:null,TitleColor:null,TitleHeight:null,TitleFontString:null,CandleBodyWidth:null,CandleBodyColor:null,CandleLineColor:null,MarginLeft:null,AxisLabelsColor:null,AxisLabelsHeight:null,AxisLabelsFontString:null,Tag:null,ControlNameID:null,Depth:null,TabStopIndex:null,Initialize:function(){return createCandlesticksGraph(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.Data,this.XMarksLabelData,this.XMarksWidth,this.YMaxValue,this.NumMarksY,this.Title,this.TitleColor,this.TitleHeight,this.TitleFontString,this.CandleBodyWidth,this.CandleBodyColor,this.CandleLineColor,this.marginleft,this.axislabelscolor,this.axislabelsheight,this.axislabelsfontstring,this.Tag,this.TabStopIndex)}};function createCandlesticksGraph(s,a,k,j,r,o,w,v,p,z,f,d,B,l,m,q,t,i,u,n,c,e,b,A,h){var g=createWindow(s,k,j,r,o,w,null,"CandlesticksGraph",a,null,h);candlesticksGraphPropsArray.push({CanvasID:s,WindowID:g,X:k,Y:j,Width:r,Height:o,Data:v,XMarksLabelData:p,XMarksWidth:z,YMaxValue:f,NumMarksY:d,Title:B,TitleColor:l,TitleHeight:m,TitleFontString:q,CandleBodyWidth:t,CandleBodyColor:i,CandleLineColor:u,MarginLeft:n,AxisLabelsColor:c,AxisLabelsHeight:e,AxisLabelsFontString:b,Tag:A});registerWindowDrawFunction(g,function(L,x){var y=getCandlesticksGraphProps(L,x);var M=getCtx(L);M.save();M.fillStyle=y.TitleColor;M.font=y.TitleFontString;M.fillText(y.Title,y.X+(y.Width-M.measureText(B).width)/2,y.Y+y.TitleHeight+4);M.strokeStyle="#C0C0C0";M.beginPath();M.moveTo(y.X+y.MarginLeft,y.Y+y.Height-8-y.AxisLabelsHeight);M.lineTo(y.X+y.MarginLeft,y.Y+y.TitleHeight+8);M.stroke();M.beginPath();M.moveTo(y.X+y.MarginLeft,y.Y+y.Height-8-y.AxisLabelsHeight);M.lineTo(y.X+y.Width,y.Y+y.Height-8-y.AxisLabelsHeight);M.stroke();var D=false;for(var J=0;J<=v.length;J++){if(D){M.fillStyle="#C0C0C0";D=false}else{M.fillStyle="#D0D0D0";D=true}M.fillRect(y.X+y.MarginLeft+(J*y.XMarksWidth),y.Y+y.TitleHeight+8,y.XMarksWidth,y.Height-y.TitleHeight-y.AxisLabelsHeight-16)}M.fillStyle=y.AxisLabelsColor;M.font=y.AxisLabelsFontString;M.strokeStyle="#404040";for(var J=0;J<y.NumMarksY;J++){var C=(y.YMaxValue/y.NumMarksY)*J;var E=M.measureText(C.toString()).width;M.fillText(C.toString(),y.X+y.MarginLeft-10-E,y.Y+y.Height-y.AxisLabelsHeight-8-(J*((y.Height-y.TitleHeight-y.AxisLabelsHeight-16)/y.NumMarksY)));M.beginPath();M.moveTo(y.X+y.MarginLeft-5,y.Y+y.Height-y.AxisLabelsHeight-8-(J*((y.Height-y.TitleHeight-y.AxisLabelsHeight-16)/y.NumMarksY)));M.lineTo(y.X+y.Width,y.Y+y.Height-y.AxisLabelsHeight-8-(J*((y.Height-y.TitleHeight-y.AxisLabelsHeight-16)/y.NumMarksY)));M.stroke()}for(var H=0;H<y.Data.length;H++){M.beginPath();M.moveTo(y.X+y.MarginLeft+((H+1)*y.XMarksWidth),y.Y+y.Height-y.AxisLabelsHeight-8+5);M.lineTo(y.X+y.MarginLeft+((H+1)*y.XMarksWidth),y.Y+y.TitleHeight+8);M.stroke()}for(var J=0;J<y.XMarksLabelData.length;J++){var E=M.measureText(y.XMarksLabelData[J][1].toString()).width;M.fillText(y.XMarksLabelData[J][1],y.X+y.MarginLeft+((y.XMarksLabelData[J][0]+1)*y.XMarksWidth)-(E/2),y.Y+y.Height-4)}for(var J=0;J<y.Data.length;J++){var K=M.createLinearGradient(y.X+y.MarginLeft+((J+1)*y.XMarksWidth),y.Y+y.Height-y.AxisLabelsHeight-8-(y.Data[J][0]*(y.Height-y.TitleHeight-y.AxisLabelsHeight-16)/y.YMaxValue),y.X+y.MarginLeft+((J+1)*y.XMarksWidth),y.Y+y.Height-y.AxisLabelsHeight-8-(y.Data[J][1]*(y.Height-y.TitleHeight-y.AxisLabelsHeight-16)/y.YMaxValue));var G=parseInt(y.CandleBodyColor.substr(1,2),16);var I=parseInt(y.CandleBodyColor.substr(3,2),16);var F=parseInt(y.CandleBodyColor.substr(5,2),16);K.addColorStop(0,"#"+getlowcomp(G)+getlowcomp(I)+getlowcomp(F));K.addColorStop(0.5,y.CandleBodyColor);K.addColorStop(1,"#"+gethighcomp(G)+gethighcomp(I)+gethighcomp(F));M.fillStyle=K;M.strokeStyle=y.CandleLineColor;M.beginPath();if(y.Data[J][0]<y.Data[J][1]){M.moveTo(y.X+y.MarginLeft+((J+1)*y.XMarksWidth)-(y.CandleBodyWidth/2),y.Y+y.Height-y.AxisLabelsHeight-8-(y.Data[J][0]*(y.Height-y.TitleHeight-y.AxisLabelsHeight-16)/y.YMaxValue));M.lineTo(y.X+y.MarginLeft+((J+1)*y.XMarksWidth)+(y.CandleBodyWidth/2),y.Y+y.Height-y.AxisLabelsHeight-8-(y.Data[J][0]*(y.Height-y.TitleHeight-y.AxisLabelsHeight-16)/y.YMaxValue));M.lineTo(y.X+y.MarginLeft+((J+1)*y.XMarksWidth)+(y.CandleBodyWidth/2),y.Y+y.Height-y.AxisLabelsHeight-8-(y.Data[J][1]*(y.Height-y.TitleHeight-y.AxisLabelsHeight-16)/y.YMaxValue));M.lineTo(y.X+y.MarginLeft+((J+1)*y.XMarksWidth)-(y.CandleBodyWidth/2),y.Y+y.Height-y.AxisLabelsHeight-8-(y.Data[J][1]*(y.Height-y.TitleHeight-y.AxisLabelsHeight-16)/y.YMaxValue));M.closePath();M.fill();M.beginPath();M.moveTo(y.X+y.MarginLeft+((J+1)*y.XMarksWidth),y.Y+y.Height-y.AxisLabelsHeight-8-(y.Data[J][0]*(y.Height-y.TitleHeight-y.AxisLabelsHeight-16)/y.YMaxValue));M.lineTo(y.X+y.MarginLeft+((J+1)*y.XMarksWidth),y.Y+y.Height-y.AxisLabelsHeight-8-(y.Data[J][2]*(y.Height-y.TitleHeight-y.AxisLabelsHeight-16)/y.YMaxValue));M.closePath();M.stroke();M.beginPath();M.moveTo(y.X+y.MarginLeft+((J+1)*y.XMarksWidth),y.Y+y.Height-y.AxisLabelsHeight-8-(y.Data[J][1]*(y.Height-y.TitleHeight-y.AxisLabelsHeight-16)/y.YMaxValue));M.lineTo(y.X+y.MarginLeft+((J+1)*y.XMarksWidth),y.Y+y.Height-y.AxisLabelsHeight-8-(y.Data[J][3]*(y.Height-y.TitleHeight-y.AxisLabelsHeight-16)/y.YMaxValue));M.closePath();M.stroke()}else{M.strokeStyle=y.CandleBodyColor;M.moveTo(y.X+y.MarginLeft+((J+1)*y.XMarksWidth)-(y.CandleBodyWidth/2),y.Y+y.Height-y.AxisLabelsHeight-8-(y.Data[J][0]*(y.Height-y.TitleHeight-y.AxisLabelsHeight-16)/y.YMaxValue));M.lineTo(y.X+y.MarginLeft+((J+1)*y.XMarksWidth)+(y.CandleBodyWidth/2),y.Y+y.Height-y.AxisLabelsHeight-8-(y.Data[J][0]*(y.Height-y.TitleHeight-y.AxisLabelsHeight-16)/y.YMaxValue));M.lineTo(y.X+y.MarginLeft+((J+1)*y.XMarksWidth)+(y.CandleBodyWidth/2),y.Y+y.Height-y.AxisLabelsHeight-8-(y.Data[J][1]*(y.Height-y.TitleHeight-y.AxisLabelsHeight-16)/y.YMaxValue));M.lineTo(y.X+y.MarginLeft+((J+1)*y.XMarksWidth)-(y.CandleBodyWidth/2),y.Y+y.Height-y.AxisLabelsHeight-8-(y.Data[J][1]*(y.Height-y.TitleHeight-y.AxisLabelsHeight-16)/y.YMaxValue));M.closePath();M.stroke();M.strokeStyle=y.CandleLineColor;M.beginPath();M.moveTo(y.X+y.MarginLeft+((J+1)*y.XMarksWidth),y.Y+y.Height-y.AxisLabelsHeight-8-(y.Data[J][1]*(y.Height-y.TitleHeight-y.AxisLabelsHeight-16)/y.YMaxValue));M.lineTo(y.X+y.MarginLeft+((J+1)*y.XMarksWidth),y.Y+y.Height-y.AxisLabelsHeight-8-(y.Data[J][2]*(y.Height-y.TitleHeight-y.AxisLabelsHeight-16)/y.YMaxValue));M.closePath();M.stroke();M.beginPath();M.moveTo(y.X+y.MarginLeft+((J+1)*y.XMarksWidth),y.Y+y.Height-y.AxisLabelsHeight-8-(y.Data[J][0]*(y.Height-y.TitleHeight-y.AxisLabelsHeight-16)/y.YMaxValue));M.lineTo(y.X+y.MarginLeft+((J+1)*y.XMarksWidth),y.Y+y.Height-y.AxisLabelsHeight-8-(y.Data[J][3]*(y.Height-y.TitleHeight-y.AxisLabelsHeight-16)/y.YMaxValue));M.closePath();M.stroke()}}M.restore()},s)}var doughnutChartPropsArray=new Array();function getDoughnutChartProps(c,a){for(var b=0;b<doughnutChartPropsArray.length;b++){if(doughnutChartPropsArray[b].CanvasID==c&&doughnutChartPropsArray[b].WindowID==a){return doughnutChartPropsArray[b]}}}function CCLDoughnutChart(){}CCLDoughnutChart.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,Data:null,Title:null,TitleColor:null,TitleTextHeight:null,TitleFontString:null,InnerRadius:null,MarginSides:null,LabelColor:null,LabelHeight:null,LabelFontString:null,LegendWidth:null,LegendHeight:null,LegendFontString:null,SliceClickFunction:null,Tag:null,ControlNameID:null,Depth:null,TabStopIndex:null,Initialize:function(){return(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.Data,this.Title,this.TitleColor,this.TitleTextHeight,this.TitleFontString,this.InnerRadius,this.MarginSides,this.LabelColor,this.LabelHeight,this.LabelFontString,this.LegendWidth,this.LegendHeight,this.LegendFontString,this.SliceClickFunction,this.Tag,this.TabStopIndex)}};function createDoughnutChart(q,b,j,g,p,l,A,z,C,k,o,n,u,w,r,m,a,e,c,t,h,B,f){var d=createWindow(q,j,g,p,l,A,null,"DoughnutChart",b,null,f);var v=0;for(var s=0;s<z.length;s++){v+=z[s][1]}doughnutChartPropsArray.push({CanvasID:q,WindowID:d,X:j,Y:g,Width:p,Height:l,Data:z,Title:C,TitleColor:k,TitleTextHeight:o,TitleFontString:n,InnerRadius:u,CurrentRadius:u+20,TotalValue:v,MarginSides:w,LabelColor:r,LabelHeight:m,LabelFontString:a,LegendWidth:e,LegendHeight:c,LegendFontString:t,AnimationCompleted:0,DeltaI:-1,DeltaX:0,DeltaY:0,SliceClickFunction:h,Tag:B});registerClickFunction(d,function(K,x,H){var i=getDoughnutChartProps(K,x);var F=i.Data;var E=i.TotalValue;var J=H.calcX;var I=H.calcY;var L=-1;var Q=i.X+(i.Width/2)+i.MarginSides;var N=i.Y+((i.Height-i.TitleTextHeight-8-(i.LabelHeight*2))/2);if(150*150>(J-Q)*(J-Q)+(I-N)*(I-N)){if(J>Q&&I==N){L=0}else{if(J>Q&&I>N){L=(Math.atan((I-N)/(J-Q)))*180/Math.PI}else{if(J<Q&&I>N){L=180-((Math.atan((I-N)/(J-Q)))*180/Math.PI)}else{if(J<Q&&I==N){L=180}else{if(J<Q&&I<N){L=180+((Math.atan((I-N)/(J-Q)))*180/Math.PI)}else{if(J==Q&&I<N){L=270}else{if(J>Q&&I<N){L=360+((Math.atan((I-N)/(J-Q)))*180/Math.PI)}}}}}}}}var P=0;var G=0;var y=0;for(s=0;s<F.length;s++){P+=(F[s][1]*360)/E;var O=0;var M=0;if(L>=0&&G<=L&&P>=L){var D=G+((P-G)/2);if(D==0){O=40;M=0}else{if(D>0&&D<90){O=Math.cos(D*(Math.PI/180))*40;M=Math.sin(D*(Math.PI/180))*40}else{if(D==90){O=0;M=40}else{if(D>90&&D<180){O=-(Math.cos((180-D)*(Math.PI/180))*40);M=Math.sin((180-D)*(Math.PI/180))*40}else{if(D==180){O=-40;M=0}else{if(D>180&&D<270){O=-(Math.cos((180-D)*(Math.PI/180))*40);M=(Math.sin((180-D)*(Math.PI/180))*40)}else{if(D==270){O=0;M=-40}else{if(D>270&&D<360){O=Math.cos((360-D)*(Math.PI/180))*40;M=-(Math.sin((360-D)*(Math.PI/180))*40)}}}}}}}}}if(O!=0||M!=0){i.DeltaX=O;i.DeltaY=M;i.DeltaI=s;y=1;if(i.SliceClickFunction!=null){i.SliceClickFunction(K,x,s)}}G=P}if(y==0){i.DeltaX=0;i.DeltaY=0;i.DeltaI=-1}},q);registerWindowDrawFunction(d,function(S,F){var L=getDoughnutChartProps(S,F);var I=getCtx(S);var O=L.TotalValue;var Q=L.Data;var N=L.InnerRadius;var P=L.CurrentRadius;if(L.AnimationCompleted==0&&P>=(L.Width-(L.MarginSides*2)-L.LegendWidth)/2){unregisterAnimatedWindow(S,F);L.AnimationCompleted=1}I.save();I.fillStyle=L.TitleColor;I.font=L.TitleFontString;I.fillText(L.Title,L.X+(L.Width-I.measureText(L.Title).width)/2,L.Y+L.TitleTextHeight+4);I.font=L.LabelFontString;var K=L.X+(L.Width/2)+L.MarginSides;var J=L.Y+((L.Height-L.TitleTextHeight-8-(L.LabelHeight*2))/2);var R=0;var D=0;for(var M=0;M<Q.length;M++){R+=(Q[M][1]*100*360)/(O*100);var y=parseInt(Q[M][2].substr(1,2),16);var x=parseInt(Q[M][2].substr(3,2),16);var G=parseInt(Q[M][2].substr(5,2),16);var E=I.createRadialGradient(K+(L.DeltaI==M?L.DeltaX:0),J+(L.DeltaI==M?L.DeltaY:0),N,K+(L.DeltaI==M?L.DeltaX:0),J+(L.DeltaI==M?L.DeltaY:0),P);E.addColorStop(0,"#"+gethighcomp(y)+gethighcomp(x)+gethighcomp(G));E.addColorStop(0.5,Q[M][2]);E.addColorStop(1,"#"+getlowcomp(y)+getlowcomp(x)+getlowcomp(G));I.fillStyle=E;I.beginPath();I.arc(K+(L.DeltaI==M?L.DeltaX:0),J+(L.DeltaI==M?L.DeltaY:0),P,(Math.PI/180)*D,(Math.PI/180)*R,false);I.arc(K+(L.DeltaI==M?L.DeltaX:0),J+(L.DeltaI==M?L.DeltaY:0),N,(Math.PI/180)*R,(Math.PI/180)*D,true);I.closePath();I.fill();I.strokeStyle=Q[M][2];D=R}if(L.AnimationCompleted==0){L.CurrentRadius+=5}var R=0;var D=0;for(var M=0;M<Q.length;M++){R+=(Q[M][1]*100*360)/(O*100);I.strokeStyle=Q[M][2];drawPieChartLabels(I,Q[M][0],R,D,P,O,Q[M][1],Q[M][2],0,0,K+(L.DeltaI==M?L.DeltaX:0),J+(L.DeltaI==M?L.DeltaY:0),L.LabelHeight);D=R}I.font=L.LegendFontString;for(var H=0;H<Q.length;H++){I.fillStyle=Q[H][2];I.fillRect(L.X+L.Width-L.LegendWidth,L.Y+L.Height-4-L.LegendHeight-(H*(L.LegendHeight+10)),30,L.LegendHeight);I.fillStyle=Q[H][2];I.fillText(Q[H][0],L.X+L.Width-L.LegendWidth+35,L.Y+L.Height-4-(H*(L.LegendHeight+10)))}I.restore()},q);registerAnimatedWindow(q,d);if(f!=null&&f>0){registerKeyDownFunction(q,function(){},d)}return d}var barsMixedWithLabledLineGraphsPropsArray=new Array();function getBarsMixedWithLabledLineGraphProps(c,a){for(var b=0;b<barsMixedWithLabledLineGraphsPropsArray.length;b++){if(barsMixedWithLabledLineGraphsPropsArray[b].CanvasID==c&&barsMixedWithLabledLineGraphsPropsArray[b].WindowID==a){return barsMixedWithLabledLineGraphsPropsArray[b]}}}function CCLBarsMixedWithLabledLineGraph(){}CCLBarsMixedWithLabledLineGraph.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,Data:null,MaxValue:null,NumMarksY:null,Title:null,TitleTextColor:null,TitleTextHeight:null,TitleTextFontString:null,BarWidth:null,AxisLabelsTextHeight:null,AxisLabelsTextFontString:null,AxisLabelsTextColor:null,MarginLeft:null,GapBetweenBars:null,BarClickFunction:null,HasLegend:null,MarginRight:null,LineClickFunction:null,YMaxValue:null,Tag:null,ControlNameID:null,Depth:null,TabStopIndex:null,LinesData:null,Intialize:function(){return createBarsMixedWithLabledLineGraph(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.Data,this.MaxValue,this.NumMarksY,this.Title,this.TitleTextColor,this.TitleTextHeight,this.TitleTextFontString,this.BarWidth,this.AxisLabelsTextColor,this.AxisLabelsTextHeight,this.AxisLabelsTextFontString,this.MarginLeft,this.GapBetweenBars,this.BarClickFunction,this.HasLegend,this.MarginRight,this.LinesData,this.LineClickFunction,this.Tag,this.TabStopIndex)}};function createBarsMixedWithLabledLineGraph(v,a,n,m,u,q,B,A,r,h,D,e,t,w,j,f,o,s,p,l,d,b,z,g,c,C,k){var i=createWindow(v,n,m,u,q,B,null,"BarsMixedWithLabeledLineGraph",a,null,k);barsMixedWithLabledLineGraphsPropsArray.push({CanvasID:v,WindowID:i,X:n,Y:m,Width:u,Height:q,Data:A,MaxValue:r,NumMarksY:h,Title:D,TitleTextColor:e,TitleTextHeight:t,TitleTextFontString:w,BarWidth:j,BarLabelsWithBoundingBoxes:new Array(),H:q-o-8-20,AxisLabelsTextHeight:o,AxisLabelsTextFontString:s,AxisLabelsTextColor:f,MarginLeft:p,GapBetweenBars:l,BarClickFunction:d,AlreadyUnregisteredAnimation:0,HasLegend:b,MarginRight:z,LinesData:g,LineXYs:new Array(),LineClickFunction:c,YMaxValue:r,Tag:C});registerClickFunction(i,function(J,y,G){var x=getBarsMixedWithLabledLineGraphProps(J,y);var I=G.calcX;var H=G.calcY;for(var F=0;F<x.BarLabelsWithBoundingBoxes.length;F++){if(I>=x.BarLabelsWithBoundingBoxes[F].X&&I<=x.BarLabelsWithBoundingBoxes[F].X+x.BarLabelsWithBoundingBoxes[F].Width&&H>=x.BarLabelsWithBoundingBoxes[F].Y&&H<=x.BarLabelsWithBoundingBoxes[F].Y+x.BarLabelsWithBoundingBoxes[F].Height){if(x.BarClickFunction!=null){x.BarClickFunction(J,y,F);return}}}var K=x.LineXYs;for(var F=0;F<K.length;F++){for(var E=0;E<K[F].length-1;E++){if(I>=K[F][E][0]&&I<=K[F][E+1][0]){if((H<=K[F][E][1]&&H>=K[F][E+1][1])||(H>=K[F][E][1]&&H<=K[F][E+1][1])){m=(((K[F][E][1]-K[F][E+1][1])*(I-K[F][E][0]))/(K[F][E][0]-K[F][E+1][0]))+K[F][E][1];if(m+4>H&&m-4<H){x.LineClickFunction(J,y,F)}}}}}},v);registerWindowDrawFunction(i,function(S,E){var H=getBarsMixedWithLabledLineGraphProps(S,E);var M=getCtx(S);var P=H.H;if(H.AlreadyUnregisteredAnimation==0&&P<H.TitleTextHeight+8){H.AlreadyUnregisteredAnimation=1;unregisterAnimatedWindow(S,E)}H.LineXYs=new Array();M.clearRect(0,0,canvas.width,canvas.height);M.save();M.fillStyle=H.TitleTextColor;M.font=H.TitleTextFontString;M.lineWidth=2;M.fillText(H.Title,H.X+(H.Width-M.measureText(H.Title).width)/2,H.Y+H.TitleTextHeight+4);M.lineWidth=1;M.fillStyle=H.AxisLabelsTextColor;M.font=H.AxisLabelsTextFontString;var G=H.Height-H.TitleTextHeight-H.AxisLabelsTextHeight-16;M.beginPath();M.moveTo(H.X+H.MarginLeft,H.Y+H.TitleTextHeight+8+G);M.lineTo(H.X+H.MarginLeft,H.Y+H.TitleTextHeight+8);M.stroke();for(var Q=0;Q<H.NumMarksY;Q++){var T=(H.MaxValue/H.NumMarksY)*Q;T=Math.round(T*100)/100;var R=M.measureText(T.toString()).width;var x=G/H.NumMarksY;M.fillText(T.toString(),H.X+H.MarginLeft-R-5,H.Y+H.TitleTextHeight+8+(H.AxisLabelsTextHeight/2)+G-(Q*x));M.beginPath();M.moveTo(H.X+H.MarginLeft,H.Y+H.TitleTextHeight+8+G-(Q*x));M.lineTo(H.X+H.MarginLeft+(H.Data.length*(H.BarWidth+H.GapBetweenBars))+H.GapBetweenBars,H.Y+H.TitleTextHeight+8+G-(Q*x));M.stroke()}H.BarLabelsWithBoundingBoxes=new Array();for(var O=0;O<H.Data.length;O++){if(H.HasLegend!=1){var J=M.measureText(H.Data[O][0]).width;M.fillStyle=H.AxisLabelsTextColor;M.font=H.AxisLabelsTextFontString;if(J<H.BarWidth){M.fillText(H.Data[O][0],H.X+H.MarginLeft+H.GapBetweenBars+(O*(H.BarWidth+H.GapBetweenBars))+((H.BarWidth-J)/2),H.Y+H.Height-4)}else{M.fillText(H.Data[O][0],H.X+H.MarginLeft+H.GapBetweenBars+(O*(H.BarWidth+H.GapBetweenBars))-((J-H.BarWidth)/2),H.Y+H.Height-4)}}drawrect(S,E,M,H,O,G)}var F=new Array();var I=0;for(var O=0;O<H.LinesData.length;O++){if(H.LinesData[O][0].length>I){I=H.LinesData[O][0].length}}for(var O=0;O<I;O++){for(var N=0;N<H.LinesData.length;N++){if(O<H.LinesData[N][0].length){var y=0;for(var K=0;K<F.length;K++){if(F[K]==H.LinesData[N][0][O][0]){y=1;break}}if(y==0){F.push(H.LinesData[N][0][O][0])}}}}var O=0;while(O<H.LinesData.length){drawlineforbarsmixedwithlinesgraph(M,H,O,F);O++}if(H.HasLegend==1){for(var L=0;L<H.Data.length;L++){M.fillStyle=A[L][2];M.fillRect(H.X+H.Width-H.MarginRight,H.Y+H.Height-8-H.AxisLabelsTextHeight-(L*(8+H.AxisLabelsTextHeight)),30,H.AxisLabelsTextHeight);M.fillText(A[L][0],H.X+H.Width-H.MarginRight+35,H.Y+H.Height-8-(L*(8+H.AxisLabelsTextHeight)))}}if(P>=H.TitleTextHeight+8){H.H-=5}M.restore()},v);registerAnimatedWindow(v,i);if(k!=null&&k>0){registerKeyDownFunction(v,function(){},i)}return i}function drawlineforbarsmixedwithlinesgraph(h,a,g,f){var d=parseInt(a.LinesData[g][1].substr(1,2),16);var e=parseInt(a.LinesData[g][1].substr(3,2),16);var c=parseInt(a.LinesData[g][1].substr(5,2),16);h.strokeStyle=a.LinesData[g][1];h.lineWidth=3;h.lineCap="round";h.miterLimit=0;h.shadowOffsetX=2;h.shadowOffsetY=2;h.shadowBlur=5;h.shadowColor="#"+getlowcomp(d).toString(16)+getlowcomp(e).toString(16)+getlowcomp(c).toString(16);h.beginPath();var j=new Array();j=j.concat([[a.X+a.MarginLeft+(findXLabelIndexForValue(f,a.LinesData[g][0][0][0])*(a.Width-a.MarginLeft))/f.length,a.Y+a.Height-a.AxisLabelsTextHeight-8-((a.LinesData[g][0][0][1]*(a.Height-a.TitleTextHeight-a.AxisLabelsTextHeight-16))/a.YMaxValue)]]);h.moveTo(a.X+a.MarginLeft+a.GapBetweenBars+(a.BarWidth/2)+(findXLabelIndexForValue(f,a.LinesData[g][0][0][0])*(a.Width-a.MarginLeft-a.GapBetweenBars-(a.BarWidth/2)))/f.length,a.Y+a.Height-a.AxisLabelsTextHeight-8-((a.LinesData[g][0][0][1]*(a.Height-a.TitleTextHeight-a.AxisLabelsTextHeight-16))/a.YMaxValue));for(var b=1;b<a.H&&b<a.LinesData[g][0].length;b++){j=j.concat([[a.X+a.MarginLeft+(findXLabelIndexForValue(f,a.LinesData[g][0][b][0])*(a.Width-a.MarginLeft))/f.length,a.Y+a.Height-a.AxisLabelsTextHeight-8-((a.LinesData[g][0][b][1]*(a.Height-a.TitleTextHeight-a.AxisLabelsTextHeight-16))/a.YMaxValue)]]);h.lineTo(a.X+a.MarginLeft+a.GapBetweenBars+(a.BarWidth/2)+(findXLabelIndexForValue(f,a.LinesData[g][0][b][0])*(a.GapBetweenBars+a.BarWidth)),a.Y+a.Height-a.AxisLabelsTextHeight-8-((a.LinesData[g][0][b][1]*(a.Height-a.TitleTextHeight-a.AxisLabelsTextHeight-16))/a.YMaxValue))}a.LineXYs.concat([[j]]);h.stroke()}var stackedBarGraphPropsArray=new Array();function getstackedBarGraphProps(c,a){for(var b=0;b<stackedBarGraphPropsArray.length;b++){if(stackedBarGraphPropsArray[b].CanvasID==c&&stackedBarGraphPropsArray[b].WindowID==a){return stackedBarGraphPropsArray[b]}}}function CCLStackedBarGraph(){}CCLStackedBarGraph.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,Data:null,MaxValue:null,NumMarksY:null,Title:null,TitleColor:null,TitleHeight:null,TitleFontString:null,BarWidth:null,GapBetweenBarSets:null,AxisLabelsColor:null,AxisLabelsHeight:null,AxisLabelsFontString:null,BarClickFunction:null,MarginLeft:null,Tag:null,ControlNameID:null,Depth:null,TabStopIndex:null,Initialize:function(){return createStackedBarGraph(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.Data,this.MaxValue,this.NumMarksY,this.Title,this.TitleColor,this.TitleHeight,this.TitleFontString,this.BarWidth,this.GapBetweenBarSets,this.AxisLabelsColor,this.AxisLabelsHeight,this.AxisLabelsFontString,this.BarClickFunction,this.MarginLeft,this.Tag,this.TabStopIndex)}};function createStackedBarGraph(t,a,l,k,s,p,v,u,q,f,z,m,n,r,i,e,c,g,b,d,o,w,j){var h=createWindow(t,l,k,s,p,v,null,"StackedBarGraph",a,null,j);stackedBarGraphPropsArray.push({CanvasID:t,WindowID:h,X:l,Y:k,Width:s,Height:p,Data:u,MaxValue:q,NumMarksY:f,Title:z,TitleColor:m,TitleHeight:n,TitleFontString:r,BarWidth:i,GapBetweenBarSets:e,H:p-n-16-g,AxisLabelsColor:c,AxisLabelsHeight:g,AxisLabelsFontString:b,BarLabelsWithBoundingBoxes:new Array(),BarClickFunction:d,AlreadyUnregisteredAnimation:0,MarginLeft:o,Tag:w});registerClickFunction(h,function(G,x,D){var y=getstackedBarGraphProps(G,x);var B=y.Data;var A=0;for(var C=0;C<B.length;C++){A+=B[C][1]}var F=D.calcX;var E=D.calcY;for(var C=0;C<y.BarLabelsWithBoundingBoxes.length;C++){if(F>=y.BarLabelsWithBoundingBoxes[C][1]&&F<=y.BarLabelsWithBoundingBoxes[C][3]&&E>=y.BarLabelsWithBoundingBoxes[C][2]&&E<=y.BarLabelsWithBoundingBoxes[C][4]){if(y.BarClickFunction!=null){y.BarClickFunction(G,x,C)}}}},t);registerWindowDrawFunction(h,function(F,x){var A=getstackedBarGraphProps(F,x);if(A.AlreadyUnregisteredAnimation==0&&A.H<100){unregisterAnimatedWindow(F,x);A.AlreadyUnregisteredAnimation=1}var H=getCtx(F);H.save();H.fillStyle=A.TitleColor;H.font=A.TitleFontString;H.fillText(A.Title,A.X+(A.Width-H.measureText(A.Title).width)/2,A.Y+A.TitleHeight+4);H.font=A.AxisLabelsFontString;H.beginPath();H.moveTo(A.X+A.MarginLeft,A.Y+A.Height-A.AxisLabelsHeight-8);H.lineTo(A.X+A.MarginLeft,A.Y+A.TitleHeight+8);H.stroke();for(var E=0;E<A.NumMarksY;E++){var y=(A.MaxValue/A.NumMarksY)*E;y=Math.round(y*100)/100;var C=H.measureText(y.toString()).width;var D=(A.Height-A.TitleHeight-A.AxisLabelsHeight-16)/A.NumMarksY;H.fillText(y.toString(),A.X+A.MarginLeft-10-C,A.Y+A.Height-A.AxisLabelsHeight-8-(E*D));H.beginPath();H.moveTo(A.X+A.MarginLeft-5,A.Y+A.Height-A.AxisLabelsHeight-8-(E*D));H.lineTo(A.X+A.MarginLeft+A.GapBetweenBarSets+(A.Data.length*A.BarWidth),A.Y+A.Height-A.AxisLabelsHeight-8-(E*D));H.stroke()}A.BarLabelsWithBoundingBoxes=new Array();for(var B=0;B<A.Data.length;B++){H.fillStyle=A.AxisLabelsColor;H.font=A.AxisLabelsFontString;var G=H.measureText(A.Data[B][0]).width;if(G<A.BarWidth){H.fillText(A.Data[B][0],A.X+A.MarginLeft+(B*A.BarWidth)+((A.BarWidth-G)/2),A.Y+A.Height-4)}else{H.fillText(A.Data[B][0],A.X+A.MarginLeft+(B*A.BarWidth),A.Y+A.Height-A.AxisLabelsHeight-3)}drawmultiplerect(H,A,B)}if(A.AlreadyUnregisteredAnimation==0&&A.H>100){A.H-=5}H.restore()},t);registerAnimatedWindow(t,h);if(j!=null&&j>0){registerKeyDownFunction(t,function(){},h)}return h}function drawmultiplerect(p,c,d){p.save();var l=c.H;var j=0;for(var m=1;m<c.Data.length;m++){j+=c.Data[d][m][0]}var b=c.Height-c.TitleHeight-c.AxisLabelsHeight-16;var g=c.Height-b-c.AxisLabelsHeight-8;var o=c.Height-c.AxisLabelsHeight-8;if(c.H<g+(b-(b/c.MaxValue)*j)){l=g+(b-(b/c.MaxValue)*j)}c.BarLabelsWithBoundingBoxes.push([c.Data[d][0],c.X+c.MarginLeft+((c.BarWidth-c.GapBetweenBarSets)/2)+(d*c.BarWidth),c.Y+o-l,c.X+c.MarginLeft+c.GapBetweenBarSets+((c.BarWidth-c.GapBetweenBarSets)/2)+(d*c.BarWidth),c.Y+o]);var a=0;for(var m=1;m<c.Data[d].length;m++){var n=c.Data[d][m][1];var k=p.createLinearGradient(c.X,c.Y,c.X+c.BarWidth,c.Y+b);var f=parseInt(n.substr(1,2),16);var h=parseInt(n.substr(3,2),16);var e=parseInt(n.substr(5,2),16);k.addColorStop(0,"#"+getlowcomp(f)+getlowcomp(h)+getlowcomp(e));k.addColorStop(0.5,n);k.addColorStop(1,"#"+gethighcomp(f)+gethighcomp(h)+gethighcomp(e));p.fillStyle=k;p.shadowOffsetX=5;p.shadowBlur=5;p.shadowColor="#"+getlowcomp(f).toString(16)+getlowcomp(h).toString(16)+getlowcomp(e).toString(16);l=(o-c.H)*c.Data[d][m][0]/j;if(c.H<g+(b-(b/c.MaxValue)*j)){l=b*c.Data[d][m][0]/c.MaxValue}p.shadowOffsetY=0;if(m<c.Data[d].length-1){p.beginPath();p.moveTo(c.X+c.MarginLeft+((c.BarWidth-c.GapBetweenBarSets)/2)+(d*c.BarWidth),c.Y+o-(a+l));p.lineTo(c.X+c.MarginLeft+c.GapBetweenBarSets+((c.BarWidth-c.GapBetweenBarSets)/2)+(d*c.BarWidth),c.Y+o-(a+l));p.lineTo(c.X+c.MarginLeft+c.GapBetweenBarSets+((c.BarWidth-c.GapBetweenBarSets)/2)+(d*c.BarWidth),c.Y+o-a);p.lineTo(c.X+c.MarginLeft+((c.BarWidth-c.GapBetweenBarSets)/2)+(d*c.BarWidth),c.Y+o-a);p.closePath();p.fill();p.shadowOffsetX=0;p.shadowOffsetY=0;p.shadowBlur=0;p.shadowColor="#FFFFFF";k=p.createLinearGradient(c.X,c.Y,c.X+c.BarWidth,c.Y+b);k.addColorStop(0,"#FFFFFF");k.addColorStop(0.5,"#000000");k.addColorStop(1,"#FFFFFF");p.fillStyle=k;p.globalAlpha=0.1;p.beginPath();p.moveTo(c.X+c.MarginLeft+((c.BarWidth-c.GapBetweenBarSets)/2)+(d*c.BarWidth)+5,c.Y+o-(a+l)+5);p.lineTo(c.X+c.MarginLeft+c.GapBetweenBarSets-5+((c.BarWidth-c.GapBetweenBarSets)/2)+(d*c.BarWidth),c.Y+o-(a+l)+5);p.lineTo(c.X+c.MarginLeft+c.GapBetweenBarSets-5+((c.BarWidth-c.GapBetweenBarSets)/2)+(d*c.BarWidth),c.Y+o-a-5);p.lineTo(c.X+c.MarginLeft+5+((c.BarWidth-c.GapBetweenBarSets)/2)+(d*c.BarWidth),c.Y+o-a-5);p.closePath();p.fill();p.globalAlpha=1}else{p.beginPath();p.moveTo(c.X+c.MarginLeft+((c.BarWidth-c.GapBetweenBarSets)/2)+(d*c.BarWidth),c.Y+o-(a+l)+5);p.arc(c.X+c.MarginLeft+5+((c.BarWidth-c.GapBetweenBarSets)/2)+(d*c.BarWidth),c.Y+o-(a+l)+5,5,Math.PI,(Math.PI/180)*270,false);p.lineTo(c.X+c.MarginLeft+c.BarWidth-c.GapBetweenBarSets-5+((c.BarWidth-c.GapBetweenBarSets)/2)+(d*c.BarWidth),c.Y+o-(a+l));p.arc(c.X+c.MarginLeft+c.GapBetweenBarSets-5+((c.BarWidth-c.GapBetweenBarSets)/2)+(d*c.BarWidth),c.Y+o-(a+l)+5,5,(Math.PI/180)*270,0,false);p.lineTo(c.X+c.MarginLeft+c.GapBetweenBarSets+((c.BarWidth-c.GapBetweenBarSets)/2)+(d*c.BarWidth),c.Y+o-a);p.lineTo(c.X+c.MarginLeft+((c.BarWidth-c.GapBetweenBarSets)/2)+(d*c.BarWidth),c.Y+o-a);p.closePath();p.fill();p.shadowOffsetX=0;p.shadowOffsetY=0;p.shadowBlur=0;p.shadowColor="#FFFFFF";k=p.createLinearGradient(c.X,c.Y,c.X+c.BarWidth,c.Y+b);k.addColorStop(0,"#FFFFFF");k.addColorStop(0.5,"#000000");k.addColorStop(1,"#FFFFFF");p.fillStyle=k;p.globalAlpha=0.1;p.beginPath();p.moveTo(c.X+c.MarginLeft+5+((c.BarWidth-c.GapBetweenBarSets)/2)+(d*c.BarWidth),c.Y+o-(a+l)+10);p.arc(c.X+c.MarginLeft+10+((c.BarWidth-c.GapBetweenBarSets)/2)+(d*c.BarWidth),c.Y+o-(a+l)+10,5,Math.PI,(Math.PI/180)*270,false);p.lineTo(c.X+c.MarginLeft+c.GapBetweenBarSets-10+((c.BarWidth-c.GapBetweenBarSets)/2)+(d*c.BarWidth),c.Y+o-(a+l)+5);p.arc(c.X+c.MarginLeft+c.GapBetweenBarSets-10+((c.BarWidth-c.GapBetweenBarSets)/2)+(d*c.BarWidth),c.Y+o-(a+l)+10,5,(Math.PI/180)*270,0,false);p.lineTo(c.X+c.MarginLeft+c.GapBetweenBarSets-5+((c.BarWidth-c.GapBetweenBarSets)/2)+(d*c.BarWidth),c.Y+o-5-a);p.lineTo(c.X+c.MarginLeft+5+((c.BarWidth-c.GapBetweenBarSets)/2)+(d*c.BarWidth),c.Y+o-5-a);p.closePath();p.fill();p.globalAlpha=1}p.shadowOffsetX=0;p.shadowOffsetY=0;p.shadowBlur=0;p.shadowColor="#FFFFFF";a+=l;p.restore()}}var tabPropsArray=new Array();function getTabProps(c,a){for(var b=0;b<tabPropsArray.length;b++){if(tabPropsArray[b].CanvasID==c&&tabPropsArray[b].WindowID==a){return tabPropsArray[b]}}}function CCLTabControl(){}CCLTabControl.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,TabLabels:null,TabLabelColor:null,TabLabelHeight:null,TabLabelFontString:null,PanelWindowIDs:null,SelectedTabID:null,TabLabelGradientStartColor:null,TabLabelGradientEndColor:null,GapBetweenTabs:null,SelectedTabBorderColor:null,SelectedTabBorderLineWidth:null,Tag:null,ControlNameID:null,Depth:null,TabStopIndex:null,PanelHasBackgroundGradient:null,PanelHasBorder:null,PanelBackgroundStartColor:null,PanelBackgroundEndColor:null,PanelBorderColor:null,Initialize:function(){return createTabControl(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.TabLabels,this.TabLabelColor,this.TabLabelHeight,this.TabLabelFontString,this.TabLabelGradientStartColor,this.TabLabelGradientEndColor,this.PanelHasBorder,this.PanelBorderColor,this.PanelHasBackgroundGradient,this.panelBackgroundStartColor,this.panelBackgroundEndColor,this.selectedTabID,this.GapBetweenTabs,this.SelectedTabBorderColor,this.SelectedTabBorderLineWidth,this.Tag,this.TabStopIndex)}};function createTabControl(t,a,n,m,s,r,D,d,l,B,p,f,A,u,z,C,e,c,o,q,j,k,E,h){var g=createWindow(t,n,m,s,r,D,null,"Tab",a,null,h);var b=new Array();for(var v=0;v<d.length;v++){var w=createPanel(t,a+"Panel"+v.toString(),n,m+B+8,s,r-B-8,D,u,z,C,e,c);b.push(w);registerHiddenWindow(t,w,(v==o?0:1));registerChildWindow(t,w,g)}tabPropsArray.push({CanvasID:t,WindowID:g,X:n,Y:m,Width:s,Height:r,TabLabels:d,TabLabelColor:l,TabLabelHeight:B,TabLabelFontString:p,PanelWindowIDs:b,SelectedTabID:o,TabLabelGradientStartColor:f,TabLabelGradientEndColor:A,TabLabelHitAreas:new Array(),GapBetweenTabs:q,SelectedTabBorderColor:j,SelectedTabBorderLineWidth:k,Tag:E});registerWindowDrawFunction(g,function(K,x){var G=getTabProps(K,x);var M=getCtx(K);M.font=G.TabLabelFontString;var y=M.measureText(G.TabLabels[G.SelectedTabID]).width+8+((G.TabLabelHeight+8)*2);var L=0;var J=0;G.TabLabelHitAreas=new Array();var I=0;for(var H=0;H<G.TabLabels.length;H++){if(H==G.SelectedTabID+1){L+=y}if(H==G.SelectedTabID){J=L}else{I=M.measureText(G.TabLabels[H]).width+8+((G.TabLabelHeight+8)*2);if(H!=G.SelectedTabID&&L+I<G.Width){var F=M.createLinearGradient(G.X+L,G.Y,G.X+L+I,G.Y+G.TabLabelHeight+8);F.addColorStop(0,G.TabLabelGradientStartColor);F.addColorStop(1,G.TabLabelGradientEndColor);M.fillStyle=F;M.beginPath();M.moveTo(G.X+L+((H+1)*G.GapBetweenTabs),G.Y+G.TabLabelHeight+8);M.lineTo(G.X+L+((H+1)*G.GapBetweenTabs),G.Y+5);M.arc(G.X+L+((H+1)*G.GapBetweenTabs)+5,G.Y+5,5,Math.PI,(Math.PI/180)*270,false);M.lineTo(G.X+L+((H+1)*G.GapBetweenTabs)+I-5,G.Y);M.arc(G.X+L+((H+1)*G.GapBetweenTabs)+I-5,G.Y+5,5,(Math.PI/180)*270,Math.PI*2,false);M.lineTo(G.X+L+((H+1)*G.GapBetweenTabs)+I,G.Y+G.TabLabelHeight+8);M.closePath();M.fill();M.fillStyle=G.TabLabelColor;M.fillText(G.TabLabels[H],G.X+L+((H+1)*G.GapBetweenTabs)+G.TabLabelHeight+8+4,G.Y+G.TabLabelHeight+4);G.TabLabelHitAreas.push({XStart:G.X+L,XEnd:G.X+L+((G.TabLabelHeight+8)*2)+I+8,YStart:G.Y,YEnd:G.Y+G.TabLabelHeight+8,PanelWindowID:G.PanelWindowIDs[H],TabID:H})}L+=I}}L=J;var F=M.createLinearGradient(G.X,G.Y,G.X,G.Y+G.TabLabelHeight+8);F.addColorStop(0,G.TabLabelGradientStartColor);F.addColorStop(1,G.TabLabelGradientEndColor);M.fillStyle=F;M.beginPath();M.moveTo(G.X+L+((G.SelectedTabID+1)*G.GapBetweenTabs),G.Y+G.TabLabelHeight+8);M.lineTo(G.X+L+((G.SelectedTabID+1)*G.GapBetweenTabs),G.Y+5);M.arc(G.X+L+((G.SelectedTabID+1)*G.GapBetweenTabs)+5,G.Y+5,5,Math.PI,(Math.PI/180)*270,false);M.lineTo(G.X+L+((G.SelectedTabID+1)*G.GapBetweenTabs)+I-5,G.Y);M.arc(G.X+L+((G.SelectedTabID+1)*G.GapBetweenTabs)+I-5,G.Y+5,5,(Math.PI/180)*270,Math.PI*2,false);M.lineTo(G.X+L+((G.SelectedTabID+1)*G.GapBetweenTabs)+I,G.Y+G.TabLabelHeight+8);M.closePath();M.fill();M.fillStyle=G.TabLabelColor;M.fillText(G.TabLabels[G.SelectedTabID],G.X+L+((G.SelectedTabID+1)*G.GapBetweenTabs)+G.TabLabelHeight+8+4,G.Y+G.TabLabelHeight+4);M.strokeStyle=G.SelectedTabBorderColor;M.lineWidth=G.SelectedTabBorderLineWidth;M.beginPath();M.moveTo(G.X,G.Y+G.TabLabelHeight+8);M.lineTo(G.X+L+((G.SelectedTabID+1)*G.GapBetweenTabs),G.Y+G.TabLabelHeight+8);M.lineTo(G.X+L+((G.SelectedTabID+1)*G.GapBetweenTabs),G.Y+5);M.arc(G.X+L+((G.SelectedTabID+1)*G.GapBetweenTabs)+5,G.Y+5,5,Math.PI,(Math.PI/180)*270,false);M.lineTo(G.X+L+((G.SelectedTabID+1)*G.GapBetweenTabs)+I-5,G.Y);M.arc(G.X+L+((G.SelectedTabID+1)*G.GapBetweenTabs)+I-5,G.Y+5,5,(Math.PI/180)*270,Math.PI*2,false);M.lineTo(G.X+L+((G.SelectedTabID+1)*G.GapBetweenTabs)+I,G.Y+G.TabLabelHeight+8);M.lineTo(G.X+G.Width,G.Y+G.TabLabelHeight+8);M.lineTo(G.X+G.Width,G.Y+G.Height);M.stroke();M.lineWidth=1;G.TabLabelHitAreas.push({XStart:G.X+L,XEnd:G.X+L+((G.TabLabelHeight+8)*2)+I+8,YStart:G.Y,YEnd:G.Y+G.TabLabelHeight+8,PanelWindowID:G.PanelWindowIDs[G.SelectedTabID],TabID:G.SelectedTabID})},t);registerClickFunction(g,function(y,I,H){var x=getTabProps(y,I);var K=H.calcX;var J=H.calcY;for(var F=0;F<x.TabLabelHitAreas.length;F++){if(K>x.TabLabelHitAreas[F].XStart&&K<x.TabLabelHitAreas[F].XEnd&&J>x.TabLabelHitAreas[F].YStart&&J<x.TabLabelHitAreas[F].YEnd){for(var G=0;G<x.PanelWindowIDs.length;G++){if(G!=x.TabLabelHitAreas[F].PanelWindowID){setHiddenWindowStatus(y,x.PanelWindowIDs[G],1)}}setHiddenWindowStatus(y,x.TabLabelHitAreas[F].PanelWindowID,0);x.SelectedTabID=x.TabLabelHitAreas[F].TabID}}},t);if(h!=null&&h>0){registerKeyDownFunction(t,function(){},g)}return g}var imageMapPropsArray=new Array();function getImageMapProps(c,a){for(var b=0;b<imageMapPropsArray.length;b++){if(imageMapPropsArray[b].CanvasID==c&&imageMapPropsArray[b].WindowID==a){return imageMapPropsArray[b]}}}var imageMapImages=new Array();function setImageMapImage(a,d){var c=0;for(var b=0;b<imageMapImages.length;b++){if(imageMapImages[b].CanvasID==a.CanvasID&&imageMapImages[b].WindowID==a.WindowID){c=1;imageMapImages[b].Image=d}}if(c==0){imageMapImages.push({CanvasID:a.CanvasID,WindowID:a.WindowID,Image:d})}}function getImageMapImage(a){for(var b=0;b<imageMapImages.length;b++){if(imageMapImages[b].CanvasID==a.CanvasID&&imageMapImages[b].WindowID==a.WindowID){return imageMapImages[b].Image}}}function CCLImageMapControl(){}CCLImageMapControl.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,ImgUrl:null,PinXYs:null,PinClickFunction:null,HasZoom:null,ImageTopLeftXOffset:null,ImageTopLeftYOffset:null,MovingMap:null,LastMovingX:null,LastMovingY:null,Scale:null,ScaleIncrementFactor:null,Tag:null,ControlNameID:null,Depth:null,TabStopIndex:null,Initialize:function(){return createImageMapControl(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.ImgUrl,this.PinXYs,this.PinClickFunction,this.HasZoom,this.ImageTopLeftXOffset,this.ImageTopLeftYOffset,this.Scale,this.ScaleIncrementFactor,this.Tag,this.TabStopIndex)}};function createImageMapControl(m,b,g,f,k,j,q,l,a,p,o,n,c,r,h,s,e){var d=createWindow(m,g,f,k,j,q,null,"ImageMap",b,null,e);var i=new Image();i.src=l;i.onload=function(){invalidateRect(m,null,g,f,k,j)};imageMapPropsArray.push({CanvasID:m,WindowID:d,X:g,Y:f,Width:k,Height:j,ImgUrl:l,PinXYs:a,PinClickFunction:p,HasZoom:o,ImageTopLeftXOffset:n,ImageTopLeftYOffset:c,MovingMap:0,LastMovingX:0,LastMovingY:0,Scale:r,ScaleIncrementFactor:h,Tag:s});setImageMapImage(getImageMapProps(m,d),i);registerWindowDrawFunction(d,function(B,t){var u=getImageMapProps(B,t);var v=getImageMapImage(u);var C=getCtx(B);C.save();C.drawImage(v,u.ImageTopLeftXOffset,u.ImageTopLeftYOffset,u.Width/u.Scale,u.Height/u.Scale,u.X,u.Y,u.Width,u.Height);for(var w=0;w<u.PinXYs.length;w++){if(u.PinXYs[w][0]*u.Scale>u.ImageTopLeftXOffset*u.Scale&&u.PinXYs[w][0]*u.Scale<(u.ImageTopLeftXOffset*u.Scale)+(u.Width*u.Scale)&&u.PinXYs[w][1]*u.Scale>u.ImageTopLeftYOffset*u.Scale&&u.PinXYs[w][1]*u.Scale<(u.ImageTopLeftYOffset*u.Scale)+(u.Height*u.Scale)){var x=C.createRadialGradient(u.X+(u.PinXYs[w][0]*u.Scale)-(u.ImageTopLeftXOffset*u.Scale),u.Y+(u.PinXYs[w][1]*u.Scale)-(u.ImageTopLeftYOffset*u.Scale),0,u.X+(u.PinXYs[w][0]*u.Scale)-(u.ImageTopLeftXOffset*u.Scale),u.Y+(u.PinXYs[w][1]*u.Scale)-(u.ImageTopLeftYOffset*u.Scale),u.PinXYs[w][2]);var z=parseInt(u.PinXYs[w][3].substr(1,2),16);var A=parseInt(u.PinXYs[w][3].substr(3,2),16);var y=parseInt(u.PinXYs[w][3].substr(5,2),16);x.addColorStop(0,"#"+getlowcomp(z)+getlowcomp(A)+getlowcomp(y));x.addColorStop(0.5,u.PinXYs[w][3]);x.addColorStop(1,"#"+gethighcomp(z)+gethighcomp(A)+gethighcomp(y));C.fillStyle=x;C.beginPath();C.arc(u.X+(u.PinXYs[w][0]*u.Scale)-(u.ImageTopLeftXOffset*u.Scale),u.Y+(u.PinXYs[w][1]*u.Scale)-(u.ImageTopLeftYOffset*u.Scale),u.PinXYs[w][2],0,Math.PI*2,false);C.fill()}}C.restore()},m);registerMouseDownFunction(d,function(u,v){var t=getImageMapProps(u,v);t.MovingMap=1},m);registerLostFocusFunction(m,d,function(u,v){var t=getImageMapProps(u,v);t.MovingMap=0});registerMouseUpFunction(d,function(u,v){var t=getImageMapProps(u,v);t.MovingMap=0},m);registerClickFunction(d,function(z,v,w){var t=getImageMapProps(z,v);var y=w.calcX;var x=w.calcY;for(var u=0;u<t.PinXYs.length;u++){if(y>t.X+(t.PinXYs[u][0]*t.Scale)-(t.ImageTopLeftXOffset*t.Scale)-t.PinXYs[u][2]&&y<t.X+(t.PinXYs[u][0]*t.Scale)-(t.ImageTopLeftXOffset*t.Scale)+t.PinXYs[u][2]&&x>t.Y+(t.PinXYs[u][1]*t.Scale)-(t.ImageTopLeftYOffset*t.Scale)-t.PinXYs[u][2]&&x<t.Y+(t.PinXYs[u][1]*t.Scale)-(t.ImageTopLeftYOffset*t.Scale)+t.PinXYs[u][2]){if(t.PinClickFunction!=null){t.PinClickFunction(z,v,u)}}}},m);registerMouseMoveFunction(d,function(v,B,w){var t=getImageMapProps(v,B);var A=w.calcX;var z=w.calcY;var u=getImageMapImage(t);if(t.MovingMap==0){t.LastMovingX=A;t.LastMovingY=z}else{if(t.MovingMap==1){var D=A-t.LastMovingX;var C=z-t.LastMovingY;if(D!=0&&t.ImageTopLeftXOffset+D>0&&t.ImageTopLeftXOffset+D+(t.Width/t.Scale)<u.width&&C!=0&&t.ImageTopLeftYOffset+C>0&&t.ImageTopLeftYOffset+C+(t.Height/t.Scale)<u.height){t.ImageTopLeftXOffset+=D;t.ImageTopLeftYOffset+=C}}}},m);if(o==1){registerMouseWheelFunction(d,function(w,u,v){var t=getImageMapProps(w,u);var x=t.Scale;t.Scale+=(v.wheelDelta/120)*t.ScaleIncrementFactor;if(t.ImageTopLeftXOffset+(t.Width/t.Scale)>=i.width||t.ImageTopLeftYOffset+(t.Height/t.Scale)>=i.height){t.Scale=x}},m)}if(e!=null&&e>0){registerKeyDownFunction(m,function(){},d)}return d}var menuBarPropsArray=new Array();var subMenuBarPropsArray=new Array();function getMenuBarProps(c,a){for(var b=0;b<menuBarPropsArray.length;b++){if(menuBarPropsArray[b].CanvasID==c&&menuBarPropsArray[b].WindowID==a){return menuBarPropsArray[b]}}}function getSubMenuBarProps(c,a){for(var b=0;b<subMenuBarPropsArray.length;b++){if(subMenuBarPropsArray[b].CanvasID==c&&subMenuBarPropsArray[b].WindowID==a){return subMenuBarPropsArray[b]}}}function CCLSubMenu(){}CCLSubMenu.prototype={CanvasID:null,XOffset:null,YOffset:null,Width:null,Height:null,Data:null,ParentMenuWindowID:null,ParentIndexInParentMenu:null,DropDownColorStart:null,DropDownColorEnd:null,Tag:null,ControlNameID:null,Depth:null,TabStopIndex:null,Initialize:function(){return createSubMenu(this.CanvasID,this.ControlNameID,this.ParentMenuWindowID,this.Depth,this.Data,this.XOffset,this.YOffset,this.ParentIndexInParentMenu,this.DropDownColorStart,this.DropDownColorEnd,this.Tag,this.TabStopIndex)}};function createSubMenu(p,a,e,u,t,l,j,o,s,m,v,h){var q=getCtx(p);var c=0;var n=5;var d=new Array();for(var r=0;r<t.length;r++){q.font=t[r][3];var b=q.measureText(t[r][0]).width+10;if(b>c){c=b}n+=t[r][2]+5;d.push([t[r][0],t[r][1],t[r][2],t[r][3],t[r][4],t[r][5]])}var g=createWindow(p,l,j,c,n,u,null,"SubMenu",a,null,h);registerModalWindow(p,g);registerHiddenWindow(p,g,1);var k=5;var f=new Array();for(var r=0;r<t.length;r++){if(t[r][6]!=null){f.push(createSubMenu(p,a+"SubMenuLevel1_"+r.toString(),g,u,t[r][6],l+c,j+k+5,r,s,m))}k+=t[r][2]+5}subMenuBarPropsArray.push({CanvasID:p,WindowID:g,X:l,Y:j,Width:c,Height:n,Data:d,ParentMenuWindowID:e,ParentIndexInParentMenu:o,ChildMenuWindowIDs:f,DropDownColorStart:s,DropDownColorEnd:m,Tag:v});registerWindowDrawFunction(g,function(z,D){var x=getSubMenuBarProps(z,D);var y=getMenuBarProps(z,x.ParentMenuWindowID);if(y==undefined||y==null){y=getSubMenuBarProps(z,x.ParentMenuWindowID)}if(y.Data[x.ParentIndexInParentMenu][4]==1){var w=getCtx(z);var B=w.createLinearGradient(x.X,x.Y,x.X,x.Y+x.Height);B.addColorStop(0,x.DropDownColorStart);B.addColorStop(1,x.DropDownColorEnd);w.fillStyle=B;w.beginPath();w.rect(x.X,x.Y,x.Width,x.Height);w.fill();var C=0;for(var A=0;A<x.Data.length;A++){w.fillStyle=x.Data[A][1];w.font=x.Data[A][3];w.fillText(x.Data[A][0],x.X+5,x.Y+C+5+x.Data[A][2]);C+=x.Data[A][2]+5}}},p);registerClickFunction(g,function(F,w,D){var C=getSubMenuBarProps(F,w);var G=D.calcX;var E=D.calcY;var z=0;for(var B=0;B<C.Data.length;B++){if(G>C.X&&G<C.X+C.Width&&E>C.Y+z+5&&E<C.Y+z+5+C.Data[B][2]){if(typeof C.Data[B][5]=="function"){C.Data[B][5](F,w,1,B)}else{var H=0;for(var A=0;A<C.Data.length;A++){if(A==B){if(C.Data[B][4]==0){C.Data[B][4]=1;setStatusForAllChildWindowsFromMenuBar(F,C.ChildMenuWindowIDs,0,H,C.ParentMenuWindowID)}else{C.Data[B][4]=0;setStatusForAllChildWindowsFromMenuBar(F,C.ChildMenuWindowIDs,1,H,C.ParentMenuWindowID)}}if(C.Data[A][5]==null){H++}}}}z+=C.Data[B][2]+5}},p);registerLostFocusFunction(p,g,function(w,y){if(checkIfAnyMenuHasFocusFromSubMenu(w,y)==0){var i=getSubMenuBarProps(w,y);var x=getMenuBarProps(w,i.ParentMenuWindowID);if(x==undefined||x==null){x=getSubMenuBarProps(w,i.ParentMenuWindowID)}x.Data[i.ParentIndexInParentMenu][4]=0;setStatusForAllChildWindowsFromMenuBar(w,i.ChildMenuWindowIDs,1,-1,i.ParentMenuWindowID)}});if(h!=null&&h>0){registerKeyDownFunction(p,function(){},g)}return g}function checkIfAnyMenuHasFocusFromSubMenu(e,a){var b=getSubMenuBarProps(e,a);if(doingEventForWindowID==a){return 1}for(var d=0;d<b.ChildMenuWindowIDs.length;d++){if(doingEventForWindowID==b.ChildMenuWindowIDs[d]){return 1}}var f=1;var c=getMenuBarProps(e,b.ParentMenuWindowID);if(c==undefined||c==null){f=0;c=getSubMenuBarProps(e,b.ParentMenuWindowID)}if(doingEventForWindowID==c.WindowID){return 1}while(f==0){f=1;c=getMenuBarProps(e,c.ParentMenuWindowID);if(c==undefined||c==null){f=0;c=getSubMenuBarProps(e,b.ParentMenuWindowID)}if(doingEventForWindowID==c.WindowID){return 1}}return 0}function checkIfAnyMenuHasFocusFromParentMenu(c,a){var d=getMenuBarProps(c,a);if(doingEventForWindowID==a){return 1}for(var b=0;b<d.ChildMenuWindowIDs.length;b++){if(doingEventForWindowID==d.ChildMenuWindowIDs[b]){return 1}}return 0}function CCLMenuBar(){}CCLMenuBar.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,Data:null,BarColorStart:null,BarColorMiddle:null,BarColorEnd:null,DropDownColorStart:null,DropDownColorEnd:null,Tag:null,Orientation:null,ControlNameID:null,Depth:null,TabStopIndex:null,Initialize:function(){return createMenuBarControl(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.Data,this.BarColorStart,this.BarColorMiddle,this.BarColorEnd,this.DropDownColorStart,this.DropDownColorEnd,this.Orientation,this.Tag,this.TabStopIndex)}};function createMenuBarControl(n,a,h,g,m,k,u,t,q,s,l,r,j,c,v,f){var e=createWindow(n,h,g,m,k,u,null,"MenuBar",a,null,f);var o=getCtx(n);var d=0;var b=new Array();for(var p=0;p<t.length;p++){o.font=t[p][3];if(t[p][6]!=null){b.push(createSubMenu(n,a+p.toString(),e,u,t[p][6],h+d+5,g+k,p,r,j))}d+=o.measureText(t[p][0]).width+5}menuBarPropsArray.push({CanvasID:n,WindowID:e,X:h,Y:g,Width:m,Height:k,Data:t,BarColorStart:q,BarColorMiddle:s,BarColorEnd:l,DropDownColorStart:r,DropDownColorEnd:j,ChildMenuWindowIDs:b,Tag:v});registerWindowDrawFunction(e,function(x,B){var A=getMenuBarProps(x,B);var w=getCtx(x);var z=w.createLinearGradient(A.X,A.Y,A.X,A.Y+A.Height);z.addColorStop(0,A.BarColorStart);z.addColorStop(0.5,A.BarColorMiddle);z.addColorStop(1,A.BarColorEnd);w.fillStyle=z;w.beginPath();w.rect(A.X,A.Y,A.Width,A.Height);w.fill();var C=0;for(var y=0;y<A.Data.length;y++){w.fillStyle=A.Data[y][1];w.font=A.Data[y][3];w.fillText(A.Data[y][0],A.X+C+5,A.Y+A.Height-((A.Height-A.Data[y][2])/2));C+=w.measureText(A.Data[y][0]).width+5}},n);registerClickFunction(e,function(F,w,D){var z=getMenuBarProps(F,w);var I=getCtx(F);var G=D.calcX;var E=D.calcY;var A=0;for(var C=0;C<z.Data.length;C++){I.font=z.Data[C][3];currWidth=I.measureText(z.Data[C][0]).width;if(G>z.X+A+5&&G<z.X+A+currWidth+5&&E>z.Y&&E<z.Y+z.Height){if(typeof z.Data[C][6]=="function"){z.Data[C][6](F,w,0,C)}else{if(z.Data[C][6]!=null){var H=0;for(var B=0;B<z.Data.length;B++){if(B==C){if(z.Data[C][4]==0){z.Data[C][4]=1;setStatusForAllChildWindowsFromMenuBar(F,z.ChildMenuWindowIDs,0,H,null)}else{z.Data[C][4]=0;setStatusForAllChildWindowsFromMenuBar(F,z.ChildMenuWindowIDs,1,H,null)}}if(z.Data[B][6]!=null){H++}}}else{if(z.Data[C][5]!=null){z.Data[C][5](F,w,0,C)}}}}A+=currWidth+5}},n);registerLostFocusFunction(n,e,function(w,y){if(checkIfAnyMenuHasFocusFromParentMenu(w,y)==0){var z=getMenuBarProps(w,y);for(var x=0;x<z.Data.length;x++){if(z.Data[x][4]==1){setStatusForAllChildWindowsFromMenuBar(w,z.ChildMenuWindowIDs,1,-1,null)}z.Data[x][4]=0}}});if(f!=null&&f>0){registerKeyDownFunction(n,function(){},e)}return e}function setStatusForAllChildWindowsFromMenuBar(a,m,c,l,g){if(c==0){for(var d=0;d<m.length;d++){setHiddenWindowStatus(a,m[d],(d==l?c:1));var f=getSubMenuBarProps(a,m[d]);for(var b=0;b<f.Data.length;b++){f.Data[b][4]=c}setStatusForAllChildWindowsFromMenuBar(a,f.ChildMenuWindowIDs,c,-1)}}else{var f=null;while(g){f=getSubMenuBarProps(a,g);if(!f){f=getMenuBarProps(a,g)}g=f.ParentMenuWindowID}if(!f){for(var d=0;d<menuBarPropsArray.length;d++){var k=0;for(var b=0;b<m.length;b++){var n=0;for(var h=0;h<menuBarPropsArray[d].ChildMenuWindowIDs.length;h++){if(m[b]==menuBarPropsArray[d].ChildMenuWindowIDs[h]){n=1;break}}if(n==0){k=1;break}}if(k==0){f=menuBarPropsArray[d];break}}}for(var d=0;d<f.ChildMenuWindowIDs.length;d++){setHiddenWindowStatus(a,f.ChildMenuWindowIDs[d],1);var e=getSubMenuBarProps(a,f.ChildMenuWindowIDs[d]);if(e.ChildMenuWindowIDs.length>0){recurseHideSubMenuBarWindows(a,e)}}}}function recurseHideSubMenuBarWindows(d,a){for(var b=0;b<a.ChildMenuWindowIDs.length;b++){setHiddenWindowStatus(d,a.ChildMenuWindowIDs[b],1);var c=getSubMenuBarProps(d,a.ChildMenuWindowIDs[b]);if(c.ChildMenuWindowIDs.length>0){recurseHideSubMenuBarWindows(c)}}}var textBoxPropsArray=new Array();function getTextBoxProps(c,a){for(var b=0;b<textBoxPropsArray.length;b++){if(textBoxPropsArray[b].CanvasID==c&&textBoxPropsArray[b].WindowID==a){return textBoxPropsArray[b]}}}function getTextBoxPropsByDropDownWindowID(c,a){for(var b=0;b<textBoxPropsArray.length;b++){if(textBoxPropsArray[b].CanvasID==c&&textBoxPropsArray[b].DropDownWindowID==a){return textBoxPropsArray[b]}}}function getTextBoxPropsByKeyboardID(c,a){for(var b=0;b<textBoxPropsArray.length;b++){if(textBoxPropsArray[b].CanvasID==c&&textBoxPropsArray[b].CustomKeyboardWindowID==a){return textBoxPropsArray[b]}}}function textBoxTouchKeyPress(e,a,d){var b=getTextBoxPropsByKeyboardID(e,a);switch(d.toLowerCase()){case"left":if(b.CaretPosIndex>-1){b.CaretPosIndex--;b.SelectedTextStartIndex=-1;b.SelectedTextEndIndex=-1;b.WasSelecting=0;b.MouseDown=0}invalidateRect(e,null,b.X,b.Y,b.Width,b.Height);return;case"right":if(b.CaretPosIndex>b.UserInputText.length-1){b.CaretPosIndex=b.UserInputText.length-1}else{b.CaretPosIndex++}b.SelectedTextStartIndex=-1;b.SelectedTextEndIndex=-1;b.MouseDown=0;b.WasSelecting=0;invalidateRect(e,null,b.X,b.Y,b.Width,b.Height);return;case"backspacekey":if(b.CaretPosIndex>-1){if(b.CaretPosIndex==0){if(b.UserInputText.length>1){b.UserInputText=b.UserInputText.substring(1,b.UserInputText.length-1)}else{b.UserInputText=""}b.CaretPosIndex=-1}else{if(b.CaretPosIndex==b.UserInputText.length-1){b.UserInputText=b.UserInputText.substring(0,b.UserInputText.length-1);b.CaretPosIndex--}else{if(b.CaretPosIndex>0){b.UserInputText=b.UserInputText.substring(0,b.CaretPosIndex)+b.UserInputText.substring(b.CaretPosIndex+1);b.CaretPosIndex--}}}b.SelectedTextStartIndex=-1;b.SelectedTextEndIndex=-1;b.MouseDown=0;b.WasSelecting=0}if(b.ListPossiblesAllChoices!=null){FindTextBoxPossible(b,g)}invalidateRect(e,null,b.X,b.Y,b.Width,b.Height);return;case"spacebarkey":d=" ";break;case"carriagereturnkey":return}if(!b.UserInputText||(b.UserInputText&&b.UserInputText.length<b.MaxChars)){var g=d;var f;if(b.ListPossiblesAllChoices!=null){f=FindTextBoxPossible(b,g)}if((!b.AllowedCharsRegEx||b.AllowedCharsRegEx==null||b.AllowedCharsRegEx.length==0||g.match(b.AllowedCharsRegEx)==g)&&(!b.LimitToListPossibles||(b.LimitToListPossibles==1&&f))){if(b.CaretPosIndex==-1){b.UserInputText=g+(b.UserInputText?b.UserInputText:"");b.CaretPosIndex++}else{if(b.UserInputText&&b.CaretPosIndex==b.UserInputText.length-1){b.UserInputText=b.UserInputText+g;b.CaretPosIndex++}else{if(b.UserInputText){b.UserInputText=b.UserInputText.substring(0,b.CaretPosIndex+1)+g+b.UserInputText.substring(b.CaretPosIndex+1);b.CaretPosIndex++}}}b.SelectedTextStartIndex=-1;b.SelectedTextEndIndex=-1;b.MouseDown=0;b.WasSelecting=0}}invalidateRect(e,null,b.X,b.Y,b.Width,b.Height)}var textBoxImages=new Array();function setTextBoxImage(a,d){var c=0;for(var b=0;b<textBoxImages.length;b++){if(textBoxImages[b].CanvasID==a.CanvasID&&textBoxImages[b].WindowID==a.WindowID){c=1;textBoxImages[b].Image=d}}if(c==0){textBoxImages.push({CanvasID:a.CanvasID,WindowID:a.WindowID,Image:d})}}function getTextBoxImage(a){for(var b=0;b<textBoxImages.length;b++){if(textBoxImages[b].CanvasID==a.CanvasID&&textBoxImages[b].WindowID==a.WindowID){return textBoxImages[b].Image}}}function CCLTextbox(){}CCLTextbox.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,WaterMarkText:null,WaterMarkTextColor:null,WaterMarkTextFontString:null,TextColor:null,TextHeight:null,TextFontString:null,MaxChars:null,AllowedCharsRegEx:null,IsPassword:null,PasswordChar:null,HasBorder:null,BorderColor:null,BorderLineWidth:null,HasShadow:null,ShadowOffsetX:null,ShadowOffsetY:null,ShadowBlurValue:null,HasRoundedEdges:null,EdgeRadius:null,HasBgGradient:null,BgGradientStartColor:null,BgGradientEndColor:null,HasBgImage:null,BgImageUrl:null,HasAutoComplete:null,ListPossibles:null,DropDownPossiblesListIfThereIsInputText:null,LimitToListPossibles:null,ListPossiblesTextHeight:null,ListPossiblesTextFontString:null,UserInputText:null,ShadowColor:null,ShowCaret:null,CaretColor:null,TextSelectionBgColor:null,Tag:null,DropDownWindowID:null,ListPossiblesTextColor:null,VScrollBarWindowID:null,ListPossiblesAllChoices:null,CustomKeyboardWindowID:null,ControlNameID:null,Depth:null,HasFocusInitially:null,WaterMarkTextHeight:null,TabStopIndex:null,Initialize:function(){return createTextBox(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.WaterMarkText,this.WaterMarkTextColor,this.WaterMarkTextHeight,this.WaterMarkTextFontString,this.TextColor,this.TextHeight,this.TextFontString,this.MaxChars,this.AllowedCharsRegEx,this.IsPassword,this.PasswordChar,this.HasBorder,this.BorderColor,this.BorderLineWidth,this.HasShadow,this.ShadowColor,this.ShadowOffsetX,this.ShadowOffsetY,this.ShadowBlurValue,this.HasRoundedEdges,this.EdgeRadius,this.HasBgGradient,this.BgGradientStartColor,this.BgGradientEndColor,this.HasBgImage,this.BgImageUrl,this.HasAutoComplete,this.ListPossibles,this.DropDownPossiblesListIfThereIsInputText,this.LimitToListPossibles,this.ListPossiblesTextColor,this.ListPossiblesTextHeight,this.ListPossiblesTextFontString,this.UserInputText,this.CaretColor,this.TextSelectionBgColor,this.HasFocusInitially,this.Tag,this.CustomKeyboardWindowID,this.TabStopIndex)}};function createTextBox(H,O,N,M,b,e,i,h,u,s,G,Q,r,k,v,E,W,n,V,I,m,p,aa,d,c,C,D,j,P,U,w,f,t,q,S,B,o,X,L,Y,K,l,R,F,T,A,Z){var z=createWindow(H,N,M,b,e,i,null,"TextBox",O,null,Z);var J,a;if(q==1){J=createWindow(H,N,M+e,b,100,i,null,"TextBoxDropDown",O+"TextBoxDropDown");a=createScrollBar(H,O+"VS",N+b-15,M+e,100,i,S.length,1,z);registerHiddenWindow(H,J,1);registerModalWindow(H,J);registerHiddenWindow(H,a,1);registerModalWindow(H,a);registerWindowDrawFunction(J,function(ae,ab){var ac=getTextBoxPropsByDropDownWindowID(ae,ab);var y=getScrollBarProps(ae,ac.VScrollBarWindowID);var x=getCtx(ae);x.fillStyle="#FFFFFF";x.beginPath();x.rect(ac.X,ac.Y+ac.Height,ac.Width-15,100);x.fill();x.fillStyle=ac.ListPossiblesTextColor;x.font=ac.ListPossiblesTextFontString;for(var ad=y.SelectedID;ad<ac.ListPossibles.length&&((ac.ListPossiblesTextHeight+6)*(ad-y.SelectedID+1))<100;ad++){x.fillText(ac.ListPossibles[ad],ac.X+5,ac.Y+ac.Height+((ac.ListPossiblesTextHeight+6)*(ad-y.SelectedID+1)))}x.strokeStyle="#b7bfc8";x.beginPath();x.rect(ac.X,ac.Y+ac.Height,ac.Width-15,100);x.stroke()},H);registerClickFunction(J,function(af,ag,ah){var ad=getTextBoxPropsByDropDownWindowID(af,ag);var ac=getScrollBarProps(af,ad.VScrollBarWindowID);var ab=ah.calcX;var ai=ah.calcY;for(var ae=ac.SelectedID;ae<ad.ListPossibles.length&&((ad.ListPossiblesTextHeight+6)*(ae-ac.SelectedID+1))<100;ae++){if(ab>ad.X&&ai>ad.Y+ad.Height+((ad.ListPossiblesTextHeight+6)*(ae-ac.SelectedID))&&ab<ad.X+ad.Width-15&&ai<ad.Y+ad.Height+((ad.ListPossiblesTextHeight+6)*(ae-ac.SelectedID+1))){if(ad.ListPossiblesSelectedID!=ae){ad.ListPossiblesSelectedID=ae;ad.UserInputText=ad.ListPossibles[ae];setHiddenWindowStatus(H,ad.VScrollBarWindowID,1);setHiddenWindowStatus(H,ad.DropDownWindowID,1)}return}}},H)}if(F==1){setFocusToWindowID(H,z)}if(navigator.userAgent.toLowerCase().indexOf("android")>-1||navigator.userAgent.toLowerCase().indexOf("ipad")>-1||navigator.userAgent.toLowerCase().indexOf("iphone")>-1||navigator.userAgent.toLowerCase().indexOf("ipod")>-1){if(!A){A=createVirtualKeyboard(H,O+"VKB",N,M+e,360,180,i,null,textBoxTouchKeyPress,5,5,1,12,"12pt Ariel",null);registerModalWindow(H,A);registerHiddenWindow(H,A,0)}}textBoxPropsArray.push({CanvasID:H,WindowID:z,X:N,Y:M,Width:b,Height:e,WaterMarkText:h,WaterMarkTextColor:u,WaterMarkTextFontString:G,TextColor:Q,TextHeight:r,TextFontString:k,MaxChars:v,AllowedCharsRegEx:E,IsPassword:W,PasswordChar:n,HasBorder:V,BorderColor:I,BorderLineWidth:m,HasShadow:p,ShadowOffsetX:d,ShadowOffsetY:c,ShadowBlurValue:C,HasRoundedEdges:D,EdgeRadius:j,HasBgGradient:P,BgGradientStartColor:U,BgGradientEndColor:w,HasBgImage:f,BgImageUrl:t,HasAutoComplete:q,ListPossibles:new Array(),DropDownPossiblesListIfThereIsInputText:B,LimitToListPossibles:o,ListPossiblesTextHeight:L,ListPossiblesTextFontString:Y,CaretPosIndex:-1,UserInputText:K,ShadowColor:aa,ShowCaret:0,CaretColor:l,SelectedTextStartIndex:-1,SelectedTextEndIndex:-1,TextSelectionBgColor:R,MouseDown:0,WasSelecting:0,MouseDownTime:0,Tag:T,DropDownWindowID:J,ListPossiblesTextColor:X,VScrollBarWindowID:a,ListPossiblesSelectedID:-1,ListPossiblesAllChoices:S,CaretTime:Date.now(),CustomKeyboardWindowID:A,TabStopIndex:Z});if(f==1){var g=new Image(b,e);g.src=t;g.onload=function(){invalidateRect(H,null,N,M,b,e)};setTextBoxImage(getTextBoxProps(H,z),g)}registerWindowDrawFunction(z,function(ai,y){var ad=getTextBoxProps(ai,y);var al=getCtx(ai);al.save();if(ad.HasBgGradient){var af=al.createLinearGradient(ad.X,ad.Y,ad.X,ad.Y+ad.Height);af.addColorStop(0,ad.BgGradientStartColor);af.addColorStop(1,ad.BgGradientEndColor);al.fillStyle=af}else{al.fillStyle="#FFFFFF"}if(ad.HasShadow){al.shadowBlur=ad.ShadowBlurValue;al.shadowColor=ad.ShadowColor;al.shadowOffsetX=ad.ShadowOffsetX;al.shadowOffsetY=ad.ShadowOffsetY}if(ad.HasBgImage==1){var ac=getTextBoxImage(ad);al.drawImage(ac,0,0,ac.width,ac.height,ad.X,ad.Y,ad.Width,ad.Height)}else{al.beginPath();if(ad.HasRoundedEdges==1){al.moveTo(ad.X,ad.Y+ad.EdgeRadius);al.arc(ad.X+ad.EdgeRadius,ad.Y+ad.EdgeRadius,ad.EdgeRadius,Math.PI,(Math.PI/180)*270,false);al.lineTo(ad.X+ad.Width-ad.EdgeRadius,ad.Y);al.arc(ad.X+ad.Width-ad.EdgeRadius,ad.Y+ad.EdgeRadius,ad.EdgeRadius,(Math.PI/180)*270,Math.PI*2,false);al.lineTo(ad.X+ad.Width,ad.Y+ad.Height-ad.EdgeRadius);al.arc(ad.X+ad.Width-ad.EdgeRadius,ad.Y+ad.Height-ad.EdgeRadius,ad.EdgeRadius,0,Math.PI/2,false);al.lineTo(ad.X+ad.EdgeRadius,ad.Y+ad.Height);al.arc(ad.X+ad.EdgeRadius,ad.Y+ad.Height-ad.EdgeRadius,ad.EdgeRadius,Math.PI/2,Math.PI,false);al.closePath()}else{al.rect(ad.X,ad.Y,ad.Width,ad.Height)}al.fill()}al.restore();if(ad.HasBorder==1){al.strokeStyle=ad.BorderColor;al.lineWidth=ad.BorderLineWidth;al.beginPath();if(ad.HasRoundedEdges==1){al.moveTo(ad.X,ad.Y+ad.EdgeRadius);al.arc(ad.X+ad.EdgeRadius,ad.Y+ad.EdgeRadius,ad.EdgeRadius,Math.PI,(Math.PI/180)*270,false);al.lineTo(ad.X+ad.Width-ad.EdgeRadius,ad.Y);al.arc(ad.X+ad.Width-ad.EdgeRadius,ad.Y+ad.EdgeRadius,ad.EdgeRadius,(Math.PI/180)*270,Math.PI*2,false);al.lineTo(ad.X+ad.Width,ad.Y+ad.Height-ad.EdgeRadius);al.arc(ad.X+ad.Width-ad.EdgeRadius,ad.Y+ad.Height-ad.EdgeRadius,ad.EdgeRadius,0,Math.PI/2,false);al.lineTo(ad.X+ad.EdgeRadius,ad.Y+ad.Height);al.arc(ad.X+ad.EdgeRadius,ad.Y+ad.Height-ad.EdgeRadius,ad.EdgeRadius,Math.PI/2,Math.PI,false);al.closePath()}else{al.rect(ad.X,ad.Y,ad.Width,ad.Height)}al.stroke()}if(ad.UserInputText&&ad.UserInputText.length>0){al.fillStyle=ad.TextColor;al.font=ad.TextFontString;if(ad.IsPassword==1){var ag="";for(var ae=0;ae<ad.UserInputText.length;ae++){ag+=ad.PasswordChar}al.fillText(ag,ad.X+4,ad.Y+ad.Height-((ad.Height-ad.TextHeight)/2))}else{if(ad.SelectedTextStartIndex>-1&&ad.SelectedTextEndIndex>-1){al.fillStyle=ad.TextSelectionBgColor;var ab=(ad.SelectedTextEndIndex==ad.UserInputText.length-1?ad.UserInputText.substring(ad.SelectedTextStartIndex):ad.UserInputText.substring(ad.SelectedTextStartIndex,ad.SelectedTextEndIndex-ad.SelectedTextStartIndex+1));var x=al.measureText(ab).width;var ah=(ad.SelectedTextStartIndex==0?0:al.measureText(ad.UserInputText.substring(0,ad.SelectedTextStartIndex+1)).width);al.beginPath();if(ah+x+8>ad.Width){al.rect(ad.X+ah+4,ad.Y+((ad.Height-ad.TextHeight)/2),ad.Width-ah,ad.TextHeight)}else{al.rect(ad.X+ah+4,ad.Y+((ad.Height-ad.TextHeight)/2),x,ad.TextHeight)}al.fill()}al.fillStyle=ad.TextColor;al.fillText(ad.UserInputText,ad.X+4,ad.Y+ad.Height-((ad.Height-ad.TextHeight)/2))}}else{if(ad.WaterMarkText&&ad.WaterMarkText.length>0){al.fillStyle=ad.WaterMarkTextColor;al.font=ad.WaterMarkTextFontString;al.fillText(ad.WaterMarkText,ad.X+4,ad.Y+ad.Height-((ad.Height-ad.TextHeight)/2))}}if(doesWindowHaveFocus(ai,y)==1){if(ad.ShowCaret==1){if(Date.now()-ad.CaretTime>250){ad.ShowCaret=0;ad.CaretTime=Date.now()}al.strokeStyle=ad.CaretColor;al.beginPath();if(ad.CaretPosIndex==-1){al.moveTo(ad.X,ad.Y+4);al.lineTo(ad.X+3,ad.Y+4);al.moveTo(ad.X,ad.Y+ad.Height-4);al.moveTo(ad.X+3,ad.Y+ad.Height-4);al.moveTo(ad.X+2,ad.Y+4);al.lineTo(ad.X+2,ad.Y+ad.Height-4)}else{if(ad.CaretPosIndex>-1){var ak=(ad.UserInputText&&ad.UserInputText.length-1>=ad.CaretPosIndex?(ad.IsPassword==1?repeatPasswordChar(ad.PasswordChar,ad.UserInputText.length):ad.UserInputText.substring(0,ad.CaretPosIndex+1)):"");al.font=ad.TextFontString;var aj=al.measureText(ak).width;al.moveTo(ad.X+aj,ad.Y+4);al.lineTo(ad.X+3+aj,ad.Y+4);al.moveTo(ad.X+aj,ad.Y+ad.Height-4);al.moveTo(ad.X+3+aj,ad.Y+ad.Height-4);al.moveTo(ad.X+2+aj,ad.Y+4);al.lineTo(ad.X+2+aj,ad.Y+ad.Height-4)}}al.stroke()}else{if(Date.now()-ad.CaretTime>500){ad.ShowCaret=1;ad.CaretTime=Date.now()}}}},H);registerMouseDownFunction(z,function(ah,aj,ag){var ac=getTextBoxProps(ah,aj);if(ac.UserInputText&&ac.UserInputText.length>0){ac.MouseDown=1;ac.MouseDownTime=(new Date()).getTime();var ai=ag.calcX;var ak=getCtx(ah);ak.font=ac.TextFontString;if(ai>ac.X&&ai<ac.X+4){ac.SelectedTextStartIndex=-1}else{if(ai>ac.X+ak.measureText(ac.UserInputText).width+4){ac.SelectedTextStartIndex=ac.UserInputText.length-1}else{var ab=new Array();var y=0;for(var ae=0;ae<ac.UserInputText.length;ae++){var af=ak.measureText(ac.UserInputText.substring(0,ae+1)).width;ab.push({Width:af-y});y=af}if(ai>ac.X+4&&ai<ac.X+ab[0].Width){ac.SelectedTextStartIndex=0}else{var y=ab[0].Width;for(var ae=1;ae<ab.length;ae++){if(ai>ac.X+y&&ai<ac.X+y+ab[ae].Width){ac.SelectedTextStartIndex=ae;break}y+=ab[ae].Width}}}}if(ac.SelectedTextStartIndex>ac.SelectedTextEndIndex){var ad=ac.SelectedTextStartIndex;ac.SelectedTextStartIndex=ac.SelectedTextEndIndex;ac.SelectedTextEndIndex=ad}}},H);registerMouseMoveFunction(z,function(ag,aj,ah){var ac=getTextBoxProps(ag,aj);if(ac.MouseDown==1&&(new Date()).getTime()-ac.MouseDownTime>500&&ac.UserInputText&&ac.UserInputText.length>0){var ai=ah.calcX;var ak=getCtx(ag);ak.font=ac.TextFontString;if(ai>ac.X&&ai<ac.X+4){ac.SelectedTextEndIndex=-1}else{if(ai>ac.X+ak.measureText(ac.UserInputText).width+4){ac.SelectedTextEndIndex=ac.UserInputText.length-1}else{var ab=new Array();var y=0;for(var ae=0;ae<ac.UserInputText.length;ae++){var af=ak.measureText(ac.UserInputText.substring(0,ae+1)).width;ab.push({Width:af-y});y=af}if(ai>ac.X+4&&ai<ac.X+ab[0].Width){ac.SelectedTextEndIndex=0}else{var y=ab[0].Width;for(var ae=1;ae<ab.length;ae++){if(ai>ac.X+y&&ai<ac.X+y+ab[ae].Width){ac.SelectedTextEndIndex=ae;break}y+=ab[ae].Width}}}}if(ac.SelectedTextStartIndex>ac.SelectedTextEndIndex){var ad=ac.SelectedTextStartIndex;ac.SelectedTextStartIndex=ac.SelectedTextEndIndex;ac.SelectedTextEndIndex=ad}}},H);registerMouseUpFunction(z,function(af,aj,ah){var ac=getTextBoxProps(af,aj);if(ac.MouseDown==1){ac.MouseDown=0;if((new Date()).getTime()-ac.MouseDownTime>500){if(ac.UserInputText&&ac.UserInputText.length>0){ac.WasSelecting=1;var ai=ah.calcX;var ak=getCtx(af);ak.font=ac.TextFontString;if(ai>ac.X&&ai<ac.X+4){ac.SelectedTextEndIndex=-1}else{if(ai>ac.X+ak.measureText(ac.UserInputText).width+4){ac.SelectedTextEndIndex=ac.UserInputText.length-1}else{var ab=new Array();var y=0;for(var ae=0;ae<ac.UserInputText.length;ae++){var ag=ak.measureText(ac.UserInputText.substring(0,ae+1)).width;ab.push({Width:ag-y});y=ag}if(ai>ac.X+4&&ai<ac.X+ab[0].Width){ac.SelectedTextEndIndex=0}else{var y=ab[0].Width;for(var ae=1;ae<ab.length;ae++){if(ai>ac.X+y&&ai<ac.X+y+ab[ae].Width){ac.SelectedTextEndIndex=ae;break}y+=ab[ae].Width}}}}if(ac.SelectedTextStartIndex>ac.SelectedTextEndIndex){var ad=ac.SelectedTextStartIndex;ac.SelectedTextStartIndex=ac.SelectedTextEndIndex;ac.SelectedTextEndIndex=ad}}}}},H);registerClickFunction(z,function(ah,y,ag){var ad=getTextBoxProps(ah,y);var ai=ag.calcX;var aj=getCtx(ah);aj.font=ad.TextFontString;if(ai>ad.X&&ai<ad.X+4){ad.CaretPosIndex=-1}else{if(ad.UserInputText&&ai>ad.X+aj.measureText(ad.UserInputText).width+4){ad.CaretPosIndex=ad.UserInputText.length-1}else{if(ad.UserInputText){var ac=new Array();var ab=0;for(var ae=0;ae<ad.UserInputText.length;ae++){var af=aj.measureText(ad.UserInputText.substring(0,ae+1)).width;ac.push({Width:af-ab});ab=af}if(ai>ad.X+4&&ai<ad.X+ac[0].Width){ad.CaretPosIndex=0}else{var ab=ac[0].Width;for(var ae=1;ae<ac.length;ae++){if(ai>ad.X+ab&&ai<ad.X+ab+ac[ae].Width){ad.CaretPosIndex=ae;break}ab+=ac[ae].Width}}}}}if(ad.WasSelecting==1){ad.WasSelecting=0}else{ad.SelectedTextStartIndex=-1;ad.SelectedTextEndIndex=-1}},H);if(!(navigator.userAgent.toLowerCase().indexOf("android")>-1||navigator.userAgent.toLowerCase().indexOf("ipad")>-1||navigator.userAgent.toLowerCase().indexOf("iphone")>-1||navigator.userAgent.toLowerCase().indexOf("ipod")>-1)){registerKeyDownFunction(H,function(x,ab,ac){var y=getTextBoxProps(x,ab);switch(ac.keyCode){case 37:if(y.CaretPosIndex>-1){y.CaretPosIndex--;y.SelectedTextStartIndex=-1;y.SelectedTextEndIndex=-1;y.WasSelecting=0;y.MouseDown=0}return;case 39:if(y.CaretPosIndex>y.UserInputText.length-1){y.CaretPosIndex=y.UserInputText.length-1}else{y.CaretPosIndex++}y.SelectedTextStartIndex=-1;y.SelectedTextEndIndex=-1;y.MouseDown=0;y.WasSelecting=0;return;case 46:if(y.CaretPosIndex<y.UserInputText.length-1){if(y.CaretPosIndex==-1){y.UserInputText=y.UserInputText.substring(1)}else{if(y.CaretPosIndex==y.UserInputText.length-2){y.UserInputText=y.UserInputText.substring(0,y.UserInputText.length-1)}else{y.UserInputText=y.UserInputText.substring(0,y.CaretPosIndex+1)+y.UserInputText.substring(y.CaretPosIndex+2)}}y.SelectedTextStartIndex=-1;y.SelectedTextEndIndex=-1;y.MouseDown=0;y.WasSelecting=0}if(y.ListPossiblesAllChoices!=null){FindTextBoxPossible(y,ae)}return;case 8:if(y.CaretPosIndex>-1){if(y.CaretPosIndex==0){if(y.UserInputText.length>1){y.UserInputText=y.UserInputText.substring(1,y.UserInputText.length-1)}else{y.UserInputText=""}y.CaretPosIndex=-1}else{if(y.CaretPosIndex==y.UserInputText.length-1){y.UserInputText=y.UserInputText.substring(0,y.UserInputText.length-1);y.CaretPosIndex--}else{if(y.CaretPosIndex>0){y.UserInputText=y.UserInputText.substring(0,y.CaretPosIndex)+y.UserInputText.substring(y.CaretPosIndex+1);y.CaretPosIndex--}}}y.SelectedTextStartIndex=-1;y.SelectedTextEndIndex=-1;y.MouseDown=0;y.WasSelecting=0}if(y.ListPossiblesAllChoices!=null){FindTextBoxPossible(y,ae)}return}if(ac.ctrlKey&&String.fromCharCode(ac.keyCode).toLowerCase()=="a"){y.SelectedTextStartIndex=0;y.SelectedTextEndIndex=y.UserInputText.length-1}else{if(ac.ctrlKey&&String.fromCharCode(ac.keyCode).toLowerCase()=="c"&&window.clipboardData){if(y.SelectedTextStartIndex>-1&&y.SelectedTextEndIndex>-1&&y.UserInputText&&y.SelectedTextEndIndex<y.UserInputText.length){window.clipboardData.setData("Text",(y.UserInputText&&y.SelectedTextEndIndex==y.UserInputText.length-1?y.UserInputText.substring(y.SelectedTextStartIndex):y.UserInputText.substring(y.SelectedTextStartIndex,y.SelectedTextEndIndex-y.SelectedTextStartIndex+1)))}}else{if(!y.UserInputText||(y.UserInputText&&y.UserInputText.length<y.MaxChars)){var ae=getCharFromKeyCode(ac);var ad;if(y.ListPossiblesAllChoices!=null){ad=FindTextBoxPossible(y,ae)}if((!y.AllowedCharsRegEx||y.AllowedCharsRegEx==null||y.AllowedCharsRegEx.length==0||ae.match(y.AllowedCharsRegEx)==ae)&&(!y.LimitToListPossibles||(y.LimitToListPossibles==1&&ad))){if(y.CaretPosIndex==-1){y.UserInputText=ae+(y.UserInputText?y.UserInputText:"");y.CaretPosIndex++}else{if(y.UserInputText&&y.CaretPosIndex==y.UserInputText.length-1){y.UserInputText=y.UserInputText+ae;y.CaretPosIndex++}else{if(y.UserInputText){y.UserInputText=y.UserInputText.substring(0,y.CaretPosIndex+1)+ae+y.UserInputText.substring(y.CaretPosIndex+1);y.CaretPosIndex++}}}y.SelectedTextStartIndex=-1;y.SelectedTextEndIndex=-1;y.MouseDown=0;y.WasSelecting=0}}}}},z)}registerLostFocusFunction(H,z,function(ab,y){var x=getTextBoxProps(ab,y);if(navigator.userAgent.toLowerCase().indexOf("android")>-1||navigator.userAgent.toLowerCase().indexOf("ipad")>-1||navigator.userAgent.toLowerCase().indexOf("iphone")>-1||navigator.userAgent.toLowerCase().indexOf("ipod")>-1){if(doesWindowHaveFocus(ab,x.CustomKeyboardWindowID)==0&&doingEventForWindowID!=x.CustomKeyboardWindowID){setHiddenWindowStatus(ab,x.CustomKeyboardWindowID,1)}else{setHiddenWindowStatus(ab,x.CustomKeyboardWindowID,0)}}if(doesWindowHaveFocus(ab,x.VScrollBarWindowID)==0&&doesWindowHaveFocus(ab,x.DropDownWindowID)==0&&doingEventForWindowID!=x.DropDownWindowID&&doingEventForWindowID!=x.VScrollBarWindowID){x.SelectedTextStartIndex=-1;x.SelectedTextEndIndex=-1;x.MouseDown=0;x.WasSelecting=0;setHiddenWindowStatus(ab,x.DropDownWindowID,1);setHiddenWindowStatus(ab,x.VScrollBarWindowID,1)}});registerGotFocusFunction(H,z,function(y,ab){var x=getTextBoxProps(y,ab);setHiddenWindowStatus(y,x.CustomKeyboardWindowID,0)});registerAnimatedWindow(H,z);return z}function repeatPasswordChar(e,a){var d="";for(var b=0;b<a;b++){d=d+e}return d}function FindTextBoxPossible(a,f){var e="";if(a.CaretPosIndex==-1){e=f+(a.UserInputText?a.UserInputText:"")}else{if(a.UserInputText&&a.CaretPosIndex==a.UserInputText.length-1){e=a.UserInputText+f}else{if(a.UserInputText){e=a.UserInputText.substring(0,a.CaretPosIndex+1)+f+a.UserInputText.substring(a.CaretPosIndex+1)}}}a.ListPossibles=new Array();var d=false;for(var b=0;a.ListPossiblesAllChoices&&b<a.ListPossiblesAllChoices.length;b++){if(a.ListPossiblesAllChoices[b].indexOf(e)==0){d=true;a.ListPossibles.push(a.ListPossiblesAllChoices[b])}}if(d){setHiddenWindowStatus(a.CanvasID,a.DropDownWindowID,0);setHiddenWindowStatus(a.CanvasID,a.VScrollBarWindowID,0)}else{setHiddenWindowStatus(a.CanvasID,a.DropDownWindowID,1);setHiddenWindowStatus(a.CanvasID,a.VScrollBarWindowID,1);a.ListPossiblesSelectedID=-1}return d}var imageFaderPropsArray=new Array();function getImageFaderProps(c,a){for(var b=0;b<imageFaderPropsArray.length;b++){if(imageFaderPropsArray[b].CanvasID==c&&imageFaderPropsArray[b].WindowID==a){return imageFaderPropsArray[b]}}}var imageFaderImages=new Array();function setImageFaderImage(g,b,f){var e=0;for(var d=0;d<imageFaderImages.length;d++){if(imageFaderImages[d].CanvasID==g.CanvasID&&imageFaderImages[d].WindowID==g.WindowID){e=1;var c=0;for(var a=0;a<imageFaderImages[d].Images.length;a++){if(imageFaderImages[d].Images[a].ImgURL==b){c=1;imageFaderImages[d].Images[a].Image=f}}if(c==0){imageFaderImages[d].Images.push({ImgURL:b,Image:f})}}}if(e==0){imageFaderImages.push({CanvasID:g.CanvasID,WindowID:g.WindowID,Images:[{ImgURL:b,Image:f}]})}}function getImageFaderImage(d,b){for(var c=0;c<imageFaderImages.length;c++){if(imageFaderImages[c].CanvasID==d.CanvasID&&imageFaderImages[c].WindowID==d.WindowID){for(var a=0;a<imageFaderImages[c].Images.length;a++){if(imageFaderImages[c].Images[a].ImgURL==b){return imageFaderImages[c].Images[a].Image}}}}}function getImageFaderImageByIndex(c,a){for(var b=0;b<imageFaderImages.length;b++){if(imageFaderImages[b].CanvasID==c.CanvasID&&imageFaderImages[b].WindowID==c.WindowID){if(b>=0&&b<imageFaderImages[b].Images.length){return imageFaderImages[b].Images[a].Image}}}}function getImageFaderImagesCount(b){for(var a=0;a<imageFaderImages.length;a++){if(imageFaderImages[a].CanvasID==b.CanvasID&&imageFaderImages[a].WindowID==b.WindowID){return imageFaderImages[a].Images.length}}}var imageFaderDrawingCanvasAndCtxs=new Array();function setImageFaderDrawingCanvasAndCtx(e,a,d){var c=0;for(var b=0;b<imageFaderDrawingCanvasAndCtxs.length;b++){if(imageFaderDrawingCanvasAndCtxs[b].CanvasID==e.CanvasID&&imageFaderDrawingCanvasAndCtxs[b].WindowID==e.WindowID){c=1;imageFaderDrawingCanvasAndCtxs[b].DrawingCanvas=a;imageFaderDrawingCanvasAndCtxs[b].DrawingCanvasCtx=d}}if(c==0){imageFaderDrawingCanvasAndCtxs.push({CanvasID:e.CanvasID,WindowID:e.WindowID,DrawingCanvas:a,DrawingCanvasCtx:d})}}function getImageFaderDrawingCanvas(b){for(var a=0;a<imageFaderDrawingCanvasAndCtxs.length;a++){if(imageFaderDrawingCanvasAndCtxs[a].CanvasID==b.CanvasID&&imageFaderDrawingCanvasAndCtxs[a].WindowID==b.WindowID){return imageFaderDrawingCanvasAndCtxs[a].DrawingCanvas}}}function getImageFaderDrawingCanvasCtx(b){for(var a=0;a<imageFaderDrawingCanvasAndCtxs.length;a++){if(imageFaderDrawingCanvasAndCtxs[a].CanvasID==b.CanvasID&&imageFaderDrawingCanvasAndCtxs[a].WindowID==b.WindowID){return imageFaderDrawingCanvasAndCtxs[a].DrawingCanvasCtx}}}function CCLImageFader(){}CCLImageFader.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,ImageURLs:null,FadeStartValue:null,FadeEndValue:null,FadeStepValue:null,HoldForTicks:null,ClickFunction:null,OverlayImages:null,ControlNameID:null,Depth:null,TabStopIndex:null,Initialize:function(){return createImageFader(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.ImageURLs,this.FadeStartValue,this.FadeEndValue,this.FadeStepValue,this.HoldForTicks,this.ClickFunction,this.OverlayImages,this.TabStopIndex)}};function createImageFader(r,c,n,l,q,p,u,b,e,g,t,m,d,a,k){var h=createWindow(r,n,l,q,p,u,null,"ImageFader");var f=document.createElement("canvas");f.width=q;f.height=p;var j=f.getContext("2d");imageFaderPropsArray.push({CanvasID:r,WindowID:h,X:n,Y:l,Width:q,Height:p,ImageURLs:b,FadeStartValue:e,FadeEndValue:g,FadeStepValue:t,HoldForTicks:m,ClickFunction:d,HoldCountDown:m,CurrentImageIndex:0,CurrentGlobalAlphaValue:e,OverlayImages:a});setImageFaderDrawingCanvasAndCtx(getImageFaderProps(r,h),f,j);for(var s=0;s<b.length;s++){var o=new Image();o.onload=function(){invalidateRect(r,null,n,l,q,p)};o.src=b[s];setImageFaderImage(getImageFaderProps(r,h),b[s],o)}registerWindowDrawFunction(h,function(x,z){var A=getImageFaderProps(x,z);var v=getImageFaderDrawingCanvasCtx(A);var y=getCtx(x);v.save();if(A.HoldCountDown==0){if(A.CurrentGlobalAlphaValue==A.FadeStartValue){if(A.CurrentImageIndex+1>=getImageFaderImagesCount(A)){A.CurrentImageIndex=0}else{A.CurrentImageIndex++}}if(A.CurrentGlobalAlphaValue<A.FadeEndValue){A.CurrentGlobalAlphaValue+=A.FadeStepValue;if(A.CurrentGlobalAlphaValue>1){A.CurrentGlobalAlphaValue=1}v.globalAlpha=A.CurrentGlobalAlphaValue}else{A.CurrentGlobalAlphaValue=A.FadeStartValue;v.globalAlpha=A.CurrentGlobalAlphaValue;A.HoldCountDown=A.HoldForTicks}if(A.OverlayImages==1&&A.CurrentGlobalAlphaValue!=A.FadeEndValue){var i=0;if(A.CurrentImageIndex-1<0){i=getImageFaderImagesCount(A)-1}else{i=A.CurrentImageIndex-1}if(A.FadeEndValue-v.globalAlpha>0&&A.FadeEndValue-v.globalAlpha<1){var w=v.globalAlpha;v.globalAlpha=A.FadeEndValue-w;v.drawImage(getImageFaderImageByIndex(A,i),0,0);v.globalAlpha=w}}v.drawImage(getImageFaderImageByIndex(A,A.CurrentImageIndex),0,0);y.drawImage(getImageFaderDrawingCanvas(A),A.X,A.Y)}else{A.HoldCountDown--;v.globalAlpha=A.FadeEndValue;y.drawImage(getImageFaderImageByIndex(A,A.CurrentImageIndex),A.X,A.Y)}v.restore()},r);if(d){registerClickFunction(h,function(i,w,v){var x=getImageFaderProps(i,w);x.ClickFunction(i,w,v,x.CurrentImageIndex)},r)}registerAnimatedWindow(r,h);if(k!=null&&k>0){registerKeyDownFunction(r,function(){},h)}return h}var imageSliderPropsArray=new Array();function getImageSliderProps(c,a){for(var b=0;b<imageSliderPropsArray.length;b++){if(imageSliderPropsArray[b].CanvasID==c&&imageSliderPropsArray[b].WindowID==a){return imageSliderPropsArray[b]}}}var imageSliderImages=new Array();function setImageSliderImage(g,b,f){var e=0;for(var d=0;d<imageSliderImages.length;d++){if(imageSliderImages[d].CanvasID==g.CanvasID&&imageSliderImages[d].WindowID==g.WindowID){e=1;var c=0;for(var a=0;a<imageSliderImages[d].Images.length;a++){if(imageSliderImages[d].Images[a].ImgURL==b){c=1;imageSliderImages[d].Images[a].Image=f}}if(c==0){imageSliderImages[d].Images.push({ImgURL:b,Image:f})}}}if(e==0){imageSliderImages.push({CanvasID:g.CanvasID,WindowID:g.WindowID,Images:[{ImgURL:b,Image:f}]})}}function getImageSliderImage(d,b){for(var c=0;c<imageSliderImages.length;c++){if(imageSliderImages[c].CanvasID==d.CanvasID&&imageSliderImages[c].WindowID==d.WindowID){for(var a=0;a<imageSliderImages[c].Images.length;a++){if(imageSliderImages[c].Images[a].ImgURL==b){return imageSliderImages[c].Images[a].Image}}}}}function getImageSliderImageByIndex(c,a){for(var b=0;b<imageSliderImages.length;b++){if(imageSliderImages[b].CanvasID==c.CanvasID&&imageSliderImages[b].WindowID==c.WindowID){if(a>=0&&a<imageSliderImages[b].Images.length){return imageSliderImages[b].Images[a].Image}}}}function CCLImageSlider(){}CCLImageSlider.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,ImageURLs:null,Direction:null,StepIncrement:null,ClickFunction:null,HoldForTicks:null,ControlNameID:null,Depth:null,TabStopIndex:null,Initialize:function(){return createImageSlider(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.ImageURLs,this.Direction,this.StepIncrement,this.HoldForTicks,this.ClickFunction,this.TabStopIndex)}};function createImageSlider(b,e,o,m,d,q,h,j,n,a,p,c,k){var l=createWindow(b,o,m,d,q,h,null,"ImageSlider");imageSliderPropsArray.push({CanvasID:b,WindowID:l,X:o,Y:m,Width:d,Height:q,ImageURLs:j,Direction:n,StepIncrement:a,ClickFunction:c,HoldForTicks:p,CurrentImageIndex:0,Slide:0,HoldCountDown:p});for(var g=0;g<j.length;g++){var f=new Image();f.onload=function(){invalidateRect(b,null,o,m,d,q)};f.src=j[g];setImageSliderImage(getImageSliderProps(b,l),j[g],f)}registerWindowDrawFunction(l,function(s,u){var v=getImageSliderProps(s,u);var r=getCtx(s);if(v.HoldCountDown==0){v.Slide+=v.StepIncrement;if(v.Direction==1){if(Math.abs(v.Slide)>=v.Width){v.HoldCountDown=v.HoldForTicks;if(v.Slide>0){if(v.CurrentImageIndex==0){v.CurrentImageIndex=v.ImageURLs.length-1}else{v.CurrentImageIndex--}}else{if(v.Slide<0){if(v.CurrentImageIndex+1<v.ImageURLs.length){v.CurrentImageIndex++}else{v.CurrentImageIndex=0}}}v.Slide=0;v.HoldCountDown=v.HoldForTicks;r.drawImage(getImageSliderImageByIndex(v,v.CurrentImageIndex),v.X,v.Y)}else{if(v.Slide>0){var i;if(v.CurrentImageIndex==0){i=v.ImageURLs.length-1}else{i=v.CurrentImageIndex-1}r.drawImage(getImageSliderImageByIndex(v,i),v.X-v.Width+v.Slide,v.Y);r.drawImage(getImageSliderImageByIndex(v,v.CurrentImageIndex),v.X+v.Slide,v.Y)}else{var t;if(v.CurrentImageIndex+1<v.ImageURLs.length){t=v.CurrentImageIndex+1}else{t=0}r.drawImage(getImageSliderImageByIndex(v,v.CurrentImageIndex),v.X+v.Slide,v.Y);r.drawImage(getImageSliderImageByIndex(v,t),v.X+v.Width+v.Slide,v.Y)}}}else{if(Math.abs(v.Slide)>=v.Height){v.HoldCountDown=v.HoldForTicks;if(v.Slide>0){if(v.CurrentImageIndex==0){v.CurrentImageIndex=v.ImageURLs.length-1}else{v.CurrentImageIndex--}}else{if(v.Slide<0){if(v.CurrentImageIndex+1<v.ImageURLs.length){v.CurrentImageIndex++}else{v.CurrentImageIndex=0}}}v.Slide=0;v.HoldCountDown=v.HoldForTicks;r.drawImage(getImageSliderImageByIndex(v,v.CurrentImageIndex),v.X,v.Y)}else{if(v.Slide>0){var i;if(v.CurrentImageIndex==0){i=v.ImageURLs.length-1}else{i=v.CurrentImageIndex-1}r.drawImage(getImageSliderImageByIndex(v,i),v.X,v.Y-v.Height+v.Slide);r.drawImage(getImageSliderImageByIndex(v,v.CurrentImageIndex),v.X,v.Y+v.Slide)}else{var t;if(v.CurrentImageIndex+1<v.ImageURLs.length){t=v.CurrentImageIndex+1}else{t=0}r.drawImage(getImageSliderImageByIndex(v,v.CurrentImageIndex),v.X,v.Y+v.Slide);r.drawImage(getImageSliderImageByIndex(v,t),v.X,v.Y+v.Height+v.Slide)}}}}else{v.HoldCountDown--;r.drawImage(getImageSliderImageByIndex(v,v.CurrentImageIndex),v.X,v.Y)}},b);if(c){registerClickFunction(l,function(i,s,r){var t=getImageSliderProps(i,s);t.ClickFunction(i,s,r,t.CurrentImageIndex)},b)}registerAnimatedWindow(b,l);if(k!=null&&k>0){registerKeyDownFunction(b,function(){},l)}return l}var multiLineLabelPropsArray=new Array();function getMultiLineLabelProps(c,a){for(var b=0;b<multiLineLabelPropsArray.length;b++){if(multiLineLabelPropsArray[b].CanvasID==c&&multiLineLabelPropsArray[b].WindowID==a){return multiLineLabelPropsArray[b]}}}function getMarkupFontString(a,c){for(var b=0;b<c.length;b++){if(a>=c[b][0]&&a<=c[b][1]){return c[b][3]}}}function getMarkupFontColor(a,c){for(var b=0;b<c.length;b++){if(a>=c[b][0]&&a<=c[b][1]){return c[b][2]}}}function getMarkupLineNumber(a,c){for(var b=0;b<c.length;b++){if(a<=c[b]){return b}}return c.length}function CCLMultiLineLabel(){}CCLMultiLineLabel.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,HasMarkup:null,Text:null,TextColor:null,TextHeight:null,TextFontString:null,LineSpacingInPixels:null,WordSensitive:null,ControlNameID:null,Depth:null,TabStopIndex:null,Initialize:function(){return createMultiLineLabel(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Depth,this.HasMarkup,this.Text,this.TextColor,this.TextHeight,this.TextFontString,this.LineSpacingInPixels,this.WordSensitive,this.TabStopIndex)}};function createMultiLineLabel(w,c,r,q,v,J,k,t,f,a,l,o,I,n){var u=a+o;var z=getCtx(w);z.font=l;var H=new Array();var s="";var E=new Array();if(k==0){if(I==0){var p=0;var b=0;while(p<t.length){if(t.substr(p,1)=="\n"){H.push(p);b=p;u+=a+o}else{if(z.measureText(t.substr(b,p-b+1)).width>v){H.push(p);b=p;u+=a+o}}p++}}else{var p=0;var b=0;var m=-1;while(p<t.length){if(t.substr(p,1)=="\n"){H.push(p);b=p}else{if(z.measureText(t.substr(b,p-b+1)).width>v){if(m>-1){H.push(m);b=m}else{H.push(p);b=p}}}u+=a+o;p++;if(t.substr(p,1)==" "){m=p}}}}else{if(window.DOMParser){var d=new DOMParser();xmlDoc=d.parseFromString("<root>"+t+"</root>","text/xml");for(var B=0;B<xmlDoc.firstChild.childNodes.length;B++){switch(xmlDoc.firstChild.childNodes[B].nodeName){case"NT":var G=s.length>0?s.length-1:0;s+=xmlDoc.firstChild.childNodes[B].childNodes.length>0?xmlDoc.firstChild.childNodes[B].childNodes[0].nodeValue:xmlDoc.firstChild.childNodes[B].nodeValue;E.push([G,s.length-1,f,l]);break;case"N":var e,F,D;for(var A=0;A<xmlDoc.firstChild.childNodes[B].childNodes.length;A++){switch(xmlDoc.firstChild.childNodes[B].childNodes[A].nodeName){case"C":e=xmlDoc.firstChild.childNodes[B].childNodes[A].childNodes.length>0?xmlDoc.firstChild.childNodes[B].childNodes[A].childNodes[0].nodeValue:xmlDoc.firstChild.childNodes[B].childNodes[A].nodeValue;break;case"F":F=xmlDoc.firstChild.childNodes[B].childNodes[A].childNodes.length>0?xmlDoc.firstChild.childNodes[B].childNodes[A].childNodes[0].nodeValue:xmlDoc.firstChild.childNodes[B].childNodes[A].nodeValue;break;case"T":D=xmlDoc.firstChild.childNodes[B].childNodes[A].childNodes.length>0?xmlDoc.firstChild.childNodes[B].childNodes[A].childNodes[0].nodeValue:xmlDoc.firstChild.childNodes[B].childNodes[A].nodeValue;break}}var G=s.length-1;s+=D;E.push([G,s.length-1,e,F]);break}}if(I==0){var p=0;var b=0;var g=0;while(p<s.length){z.font=getMarkupFontString(p,E);var C=z.measureText(s.substr(p,1)).width;if(s.substr(p,1)=="\n"){H.push(p);g=0;u+=a+o}else{if(g+C>v){H.push(p-1);g=0;u+=a+o}else{g+=C;p++}}}}else{var p=0;var b=0;var g=0;var m=-1;while(p<s.length){z.font=getMarkupFontString(p,E);var C=z.measureText(s.substr(p,1)).width;if(s.substr(p,1)=="\n"){H.push(p);g=0;u+=a+o}else{if(g+C>v){if(m>-1){H.push(m);p=m}else{H.push(p-1)}g=0;u+=a+o}else{g+=C;p++}}if(s.substr(p,1)==" "){m=p}}}}}var h=createWindow(w,r,q,v,u,J,null,"MultiLineLabel");multiLineLabelPropsArray.push({CanvasID:w,WindowID:h,X:r,Y:q,Width:v,Height:u,HasMarkup:k,Text:t,TextColor:f,TextHeight:a,TextFontString:l,LineSpacingInPixels:o,LineBreakIndexes:H,MarkupTextExtents:E,MarkupText:s});registerWindowDrawFunction(h,function(N,j){var K=getMultiLineLabelProps(N,j);var P=getCtx(N);if(K.HasMarkup==0){P.font=K.TextFontString;P.fillStyle=K.TextColor;var y=0;for(var L=0;L<K.LineBreakIndexes.length;L++){P.fillText(removeTrailingSpacesAndLineBreaks(K.Text.substr((L>0?K.LineBreakIndexes[L-1]:0),K.LineBreakIndexes[L]-(L>0?K.LineBreakIndexes[L-1]:0))),K.X,K.Y+K.TextHeight+((K.TextHeight+K.LineSpacingInPixels)*L))}if(K.LineBreakIndexes[K.LineBreakIndexes.length-1]+1<K.Text.length){P.fillText(removeTrailingSpacesAndLineBreaks(K.Text.substr(K.LineBreakIndexes[K.LineBreakIndexes.length-1])),K.X,K.Y+(K.TextHeight*(K.LineBreakIndexes.length+1))+(K.LineSpacingInPixels*K.LineBreakIndexes.length))}}else{var M=0;var O=0;var Q=0;while(M<K.MarkupText.length){P.font=getMarkupFontString(M,K.MarkupTextExtents);P.fillStyle=getMarkupFontColor(M,K.MarkupTextExtents);var x=getMarkupLineNumber(M,K.LineBreakIndexes);if(x!=Q){Q=x;O=0}P.fillText(K.MarkupText.substr(M,1),K.X+O,K.Y+K.TextHeight+((K.TextHeight+K.LineSpacingInPixels)*x));O+=P.measureText(K.MarkupText.substr(M,1)).width;M++}}},w);if(n!=null&&n>0){registerKeyDownFunction(w,function(){},h)}return h}var wordProcessorPropsArray=new Array();function getWordProcessorProps(c,a){for(var b=0;b<wordProcessorPropsArray.length;b++){if(wordProcessorPropsArray[b].CanvasID==c&&wordProcessorPropsArray[b].WindowID==a){return wordProcessorPropsArray[b]}}}function getWordProcessorPropsByKeyboardID(c,a){for(var b=0;b<wordProcessorPropsArray.length;b++){if(wordProcessorPropsArray[b].CanvasID==c&&wordProcessorPropsArray[b].CustomKeyboardWindowID==a){return wordProcessorPropsArray[b]}}}function wordProcessorTouchKeyPress(a,k,m){var i=getWordProcessorPropsByKeyboardID(a,k);var l=false;switch(m.toLowerCase()){case"left":if(i.CaretPosIndex>-1){i.CaretPosIndex--;i.SelectedTextStartIndex=-1;i.SelectedTextEndIndex=-1;i.WasSelecting=0;i.MouseDown=0}l=true;break;case"up":var g=0;if(i.LineBreakIndexes.length>0){for(var b=0;b<i.LineBreakIndexes.length;b++){if((b==0?true:i.CaretPosIndex>i.LineBreakIndexes[b-1])&&i.CaretPosIndex<i.LineBreakIndexes[b]){g=b;break}else{if(i.CaretPosIndex>i.LineBreakIndexes[b]){g=b+1}}}if(g>0){i.CaretPosIndex=(g==1?0:i.LineBreakIndexes[g-2])+(i.CaretPosIndex-i.LineBreakIndexes[g-1])}}l=true;break;case"right":if(i.CaretPosIndex>=i.UserInputText.length-1){i.CaretPosIndex=i.UserInputText.length-1}else{i.CaretPosIndex++}i.SelectedTextStartIndex=-1;i.SelectedTextEndIndex=-1;i.MouseDown=0;i.WasSelecting=0;l=true;break;case"down":var g=0;if(i.LineBreakIndexes.length>0){for(var b=0;b<i.LineBreakIndexes.length;b++){if((b==0?true:i.CaretPosIndex>i.LineBreakIndexes[b-1])&&i.CaretPosIndex<i.LineBreakIndexes[b]){g=b;break}else{if(i.CaretPosIndex>i.LineBreakIndexes[b]){g=b+1}}}if(g<i.LineBreakIndexes.length){i.CaretPosIndex=i.LineBreakIndexes[g]+(i.CaretPosIndex-(g==0?0:i.LineBreakIndexes[g-1]))}}l=true;break;case"backspacekey":if(i.CaretPosIndex>-1){if(i.CaretPosIndex==0){if(i.UserInputText.length>1){i.UserInputText=i.UserInputText.substring(1,i.UserInputText.length-1)}else{i.UserInputText=""}i.CaretPosIndex=-1}else{if(i.CaretPosIndex==i.UserInputText.length-1){i.UserInputText=i.UserInputText.substring(0,i.UserInputText.length-1);i.CaretPosIndex--}else{if(i.CaretPosIndex>0){i.UserInputText=i.UserInputText.substring(0,i.CaretPosIndex)+i.UserInputText.substring(i.CaretPosIndex+1);i.CaretPosIndex--}}}i.SelectedTextStartIndex=-1;i.SelectedTextEndIndex=-1;i.MouseDown=0;i.WasSelecting=0}l=true;break;case"spacebarkey":m=" ";break;case"carriagereturnkey":m="\n";break}if(!l){if(!i.UserInputText||(i.UserInputText&&i.UserInputText.length<i.MaxChars)){var j=m;var h;if((!i.AllowedCharsRegEx||i.AllowedCharsRegEx==null||i.AllowedCharsRegEx.length==0||j.match(i.AllowedCharsRegEx)==j||j=="\n")){if(i.CaretPosIndex==-1){i.UserInputText=j+(i.UserInputText?i.UserInputText:"");i.CaretPosIndex++}else{if(i.UserInputText&&i.CaretPosIndex==i.UserInputText.length-1){i.UserInputText=i.UserInputText+j;i.CaretPosIndex++}else{if(i.UserInputText){i.UserInputText=i.UserInputText.substring(0,i.CaretPosIndex+1)+j+i.UserInputText.substring(i.CaretPosIndex+1);i.CaretPosIndex++}}}i.SelectedTextStartIndex=-1;i.SelectedTextEndIndex=-1;i.MouseDown=0;i.WasSelecting=0}}}i.LineBreakIndexes=new Array();if(i.UserInputText&&i.UserInputText.length>0){var n=getCtx(a);if(i.WordSensitive==0){var f=0;var d=0;while(f<i.UserInputText.length){if(i.UserInputText.substr(d,f-d+1)=="\n"){i.LineBreakIndexes.push(f);d=f}else{if(n.measureText(i.UserInputText.substr(d,f-d+1)).width+i.Margin>i.Width-15){i.LineBreakIndexes.push(f);d=f}}f++}}else{var f=0;var d=0;var o=-1;while(f<i.UserInputText.length){if(i.UserInputText.substr(f,1)=="\n"){i.LineBreakIndexes.push(f);d=f}else{if(n.measureText(i.UserInputText.substr(d,f-d+1)).width+i.Margin>i.Width-15){if(o>-1){i.LineBreakIndexes.push(o);d=o}else{i.LineBreakIndexes.push(f);d=f}}}f++;if(i.UserInputText.substr(f,1)==" "){o=f}}}var e=getScrollBarProps(a,i.VScrollBarWindowID);e.MaxItems=i.LineBreakIndexes.length;var g=0;if(i.LineBreakIndexes.length>0){for(var b=0;b<i.LineBreakIndexes.length;b++){if((b==0?true:i.CaretPosIndex>i.LineBreakIndexes[b-1])&&i.CaretPosIndex<i.LineBreakIndexes[b]){g=b;break}else{if(i.CaretPosIndex>i.LineBreakIndexes[b]){g=b+1}}}}if(g-e.SelectedID+1>(i.Height-(i.Margin*2))/(i.TextHeight+i.LineSpacingInPixels)){e.SelectedID=g-Math.floor((i.Height-(i.Margin*2))/(i.TextHeight+i.LineSpacingInPixels))+1}else{if(g<e.SelectedID){e.SelectedID=g}}}}var wordProcessorBgImages=new Array();function setWordProcessorBgImage(b,d){var c=0;for(var a=0;a<wordProcessorBgImages.length;a++){if(wordProcessorBgImages[a].CanvasID==b.CanvasID&&wordProcessorBgImages[a].WindowID==b.WindowID){c=1;wordProcessorBgImages[a].Image=d}}if(c==0){wordProcessorBgImages.push({CanvasID:b.CanvasID,WindowID:b.WindowID,Image:d})}}function getWordProcessorImage(b){for(var a=0;a<wordProcessorBgImages.length;a++){if(wordProcessorBgImages[a].CanvasID==b.CanvasID&&wordProcessorBgImages[a].WindowID==b.WindowID){return wordProcessorBgImages[a].Image}}}function CCLWordProcessor(){}CCLWordProcessor.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,HasMarkup:null,Text:null,TextColor:null,TextHeight:null,TextFontString:null,LineSpacingInPixels:null,WordSensitive:null,WaterMarkText:null,WaterMarkTextColor:null,WaterMarkTextHeight:null,WaterMarkTextFontString:null,MaxChars:null,HasShadow:null,ShadowColor:null,ShadowOffsetX:null,ShadowOffsetY:null,HasRoundedEdges:null,EdgeRadius:null,HasBgGradient:null,BgGradientStartColor:null,BgGradientEndColor:null,HasBgImage:null,BgImageUrl:null,Margin:null,HasBorder:null,BorderColor:null,BorderLineWidth:null,ShowCaret:null,CaretColor:null,AllowedCharsRegEx:null,CustomKeyboardWindowID:null,ControlNameID:null,Depth:null,Initialize:function(){return createWordProcessor(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.HasMarkup,this.Text,this.TextColor,this.TextHeight,this.TextFontString,this.LineSpacingInPixels,this.WordSensitive,this.WaterMarkText,this.WaterMarkTextColor,this.WaterMarkTextHeight,this.WaterMarkTextFontString,this.MaxChars,this.HasShadow,this.ShadowColor,this.ShadowOffsetX,this.ShadowOffsetY,this.HasRoundedEdges,this.EdgeRadius,this.HasBgGradient,this.BgGradientStartColor,this.BgGradientEndColor,this.HasBgImage,this.BgImageUrl,this.Margin,this.HasBorder,this.BorderColor,this.BorderLineWidth,this.AllowedCharsRegEx,this.CaretColor,this.CustomKeyboardWindowID)}};function createWordProcessor(E,I,H,G,a,d,j,t,A,K,p,l,e,L,h,s,q,D,u,o,O,c,b,B,k,J,M,v,f,r,i,N,F,n,C,m,z){var w;if(t==1){w=createWindow(E,H,G+20,a-15,d-20,j,null,"WordProcessor",I)}else{w=createWindow(E,H,G,a-15,d,j,null,"WordProcessor",I)}vscrollbarwindowid=createScrollBar(E,I+"VS",H+a-15,G,d,j,(p+e)*Math.floor(d/p),1,w);if(navigator.userAgent.toLowerCase().indexOf("android")>-1||navigator.userAgent.toLowerCase().indexOf("ipad")>-1||navigator.userAgent.toLowerCase().indexOf("iphone")>-1||navigator.userAgent.toLowerCase().indexOf("ipod")>-1){if(!z){z=createVirtualKeyboard(E,I+"VKB",H,G+d,360,180,j,null,wordProcessorTouchKeyPress,5,5,1,12,"12pt Ariel",null)}}wordProcessorPropsArray.push({CanvasID:E,WindowID:w,X:H,Y:G,Width:a,Height:d,HasMarkup:t,Text:A,TextColor:K,TextHeight:p,TextFontString:l,LineSpacingInPixels:e,WordSensitive:L,WaterMarkText:h,WaterMarkTextColor:s,WaterMarkTextHeight:q,WaterMarkTextFontString:D,MaxChars:u,HasShadow:o,ShadowColor:O,ShadowOffsetX:c,ShadowOffsetY:b,HasRoundedEdges:B,EdgeRadius:k,HasBgGradient:J,BgGradientStartColor:M,BgGradientEndColor:v,HasBgImage:f,BgImageUrl:r,Margin:i,HasBorder:N,BorderColor:F,BorderLineWidth:n,UserInputText:"",VScrollBarWindowID:vscrollbarwindowid,CaretPosIndex:-1,ShowCaret:0,CaretColor:m,LineBreakIndexes:new Array(),SelectedTextStartIndex:-1,SelectedTextEndIndex:-1,MouseDown:0,WasSelecting:0,AllowedCharsRegEx:C,CaretTime:Date.now(),CustomKeyboardWindowID:z});if(f==1){var g=new Image();g.src=r;g.onload=function(){invalidateRect(E,H,G,a,d)};setWordProcessorBgImage(getWordProcessorProps(E,w),g)}registerWindowDrawFunction(w,function(V,x){var U=getWordProcessorProps(V,x);var Q=getScrollBarProps(V,U.VScrollBarWindowID);var Y=getCtx(V);Y.save();if(U.HasBgImage==1){Y.drawImage(getWordProcessorImage(U),U.X,U.Y)}else{if(U.HasBgGradient==1){var S=Y.createLinearGradient(U.X,U.Y,U.X,U.Y+U.Height);S.addColorStop(0,U.BgGradientStartColor);S.addColorStop(1,U.BgGradientEndColor);Y.fillStyle=S}}if(U.HasRoundedEdges==1){Y.beginPath();Y.moveTo(U.X,U.Y+U.EdgeRadius);Y.arc(U.EdgeRadius+U.X,U.Y+U.EdgeRadius,U.EdgeRadius,Math.PI,(Math.PI/180)*270,false);Y.lineTo(U.X+U.Width-15-U.EdgeRadius,U.Y);Y.arc(U.X+U.Width-15-U.EdgeRadius,U.Y+U.EdgeRadius,U.EdgeRadius,(Math.PI/180)*270,Math.PI*2,false);Y.lineTo(U.X+U.Width-15,U.Y+U.Height-U.EdgeRadius);Y.arc(U.X+U.Width-15-U.EdgeRadius,U.Y+U.Height-U.EdgeRadius,U.EdgeRadius,0,Math.PI/2,false);Y.lineTo(U.X+U.EdgeRadius,U.Y+U.Height);Y.arc(U.X+U.EdgeRadius,U.Y+U.Height-U.EdgeRadius,U.EdgeRadius,Math.PI/2,Math.PI,false);Y.closePath();Y.clip();if(U.HasBgImage==1&&U.Image.complete==true){Y.drawImage(U.Image,U.X,U.Y)}else{if(U.HasBgGradient==1){Y.fill()}}if(U.HasBorder==1){Y.strokeStyle=U.BorderColor;Y.lineWidth=U.BorderLineWidth;Y.stroke()}}else{Y.beginPath();Y.rect(U.X,U.Y,U.Width-15,U.Height);Y.clip();if(U.HasBgImage==1&&U.Image.complete==true){Y.drawImage(U.Image,U.X,U.Y)}else{if(U.HasBgGradient==1){Y.fill()}}if(U.HasBorder==1){Y.strokeStyle=U.BorderColor;Y.lineWidth=U.BorderLineWidth;Y.stroke()}}if(U.HasMarkup==0){if(U.UserInputText&&U.UserInputText.length>0){Y.font=U.TextFontString;Y.fillStyle=U.TextColor;var P=0;if(U.LineBreakIndexes.length==0&&U.UserInputText&&U.UserInputText.length>0){Y.fillText(removeTrailingSpacesAndLineBreaks(U.UserInputText),U.X+U.Margin,U.Y+U.Margin+U.TextHeight)}else{var R;for(R=Q.SelectedID;R<U.LineBreakIndexes.length&&(R-Q.SelectedID)*(U.TextHeight+U.LineSpacingInPixels)<U.Height-(U.Margin*2);R++){Y.fillText(removeTrailingSpacesAndLineBreaks(U.UserInputText.substr((R>0?U.LineBreakIndexes[R-1]:0),U.LineBreakIndexes[R]-(R>0?U.LineBreakIndexes[R-1]:0))),U.X+U.Margin,U.Y+U.Margin+U.TextHeight+((U.TextHeight+U.LineSpacingInPixels)*(R-Q.SelectedID)))}if(U.LineBreakIndexes[U.LineBreakIndexes.length-1]+1<U.UserInputText.length){Y.fillText(removeTrailingSpacesAndLineBreaks(U.UserInputText.substr(U.LineBreakIndexes[U.LineBreakIndexes.length-1])),U.X+U.Margin,U.Y+U.Margin+((R-Q.SelectedID+1)*(U.TextHeight+U.LineSpacingInPixels))-U.LineSpacingInPixels)}}}else{Y.font=U.WaterMarkTextFontString;Y.fillStyle=U.WaterMarkTextColor;Y.fillText(U.WaterMarkText,U.X+U.Margin,U.Y+U.Margin+U.WaterMarkTextHeight)}if(doesWindowHaveFocus(V,x)==1){if(U.ShowCaret==1){if(Date.now()-U.CaretTime>250){U.ShowCaret=0;U.CaretTime=Date.now()}Y.strokeStyle=U.CaretColor;Y.beginPath();var T=0;if(U.LineBreakIndexes.length>0){for(var y=0;y<U.LineBreakIndexes.length;y++){if((y==0?true:U.CaretPosIndex>U.LineBreakIndexes[y-1])&&U.CaretPosIndex<U.LineBreakIndexes[y]){T=y;break}else{if(U.CaretPosIndex>U.LineBreakIndexes[y]){T=y+1}}}}if(U.CaretPosIndex==-1){Y.moveTo(U.X+U.Margin,U.Y+U.Margin+4);Y.lineTo(U.X+U.Margin+3,U.Y+U.Margin+4);Y.moveTo(U.X+U.Margin,U.Y+U.Margin+U.TextHeight-4);Y.moveTo(U.X+U.Margin+3,U.Y+U.Margin+U.TextHeight-4);Y.moveTo(U.X+U.Margin+2,U.Y+U.Margin+4);Y.lineTo(U.X+U.Margin+2,U.Y+U.Margin+U.TextHeight-4)}else{if(U.CaretPosIndex>-1){var X=removeTrailingSpacesAndLineBreaks(U.UserInputText&&U.UserInputText.length-1>=U.CaretPosIndex?(T>0?U.UserInputText.substring(U.LineBreakIndexes[T-1],U.CaretPosIndex+1):U.UserInputText.substring(0,U.CaretPosIndex+1)):"");Y.font=U.TextFontString;var W=Y.measureText(X).width;T-=getScrollBarProps(V,U.VScrollBarWindowID).SelectedID;Y.moveTo(U.X+U.Margin+W,U.Y+U.Margin+((U.TextHeight+U.LineSpacingInPixels)*T));Y.lineTo(U.X+U.Margin+3+W,U.Y+U.Margin+((U.TextHeight+U.LineSpacingInPixels)*T));Y.moveTo(U.X+U.Margin+W,U.Y+U.Margin+U.TextHeight+((U.TextHeight+U.LineSpacingInPixels)*((T==0?1:T)-1)));Y.moveTo(U.X+U.Margin+3+W,U.Y+U.Margin+U.TextHeight+((U.TextHeight+U.LineSpacingInPixels)*T));Y.moveTo(U.X+U.Margin+2+W,U.Y+U.Margin+((U.TextHeight+U.LineSpacingInPixels)*T));Y.lineTo(U.X+U.Margin+2+W,U.Y+U.Margin+U.TextHeight+((U.TextHeight+U.LineSpacingInPixels)*T))}}Y.stroke()}else{if(Date.now()-U.CaretTime>500){U.ShowCaret=1;U.CaretTime=Date.now()}}}}Y.restore()},E);if(!(navigator.userAgent.toLowerCase().indexOf("android")>-1||navigator.userAgent.toLowerCase().indexOf("ipad")>-1||navigator.userAgent.toLowerCase().indexOf("iphone")>-1||navigator.userAgent.toLowerCase().indexOf("ipod")>-1)){registerKeyDownFunction(E,function(W,aa,T){var U=getWordProcessorProps(W,aa);var X=false;switch(T.keyCode){case 37:if(U.CaretPosIndex>-1){U.CaretPosIndex--;U.SelectedTextStartIndex=-1;U.SelectedTextEndIndex=-1;U.WasSelecting=0;U.MouseDown=0}X=true;break;case 38:var R=0;if(U.LineBreakIndexes.length>0){for(var x=0;x<U.LineBreakIndexes.length;x++){if((x==0?true:U.CaretPosIndex>U.LineBreakIndexes[x-1])&&U.CaretPosIndex<U.LineBreakIndexes[x]){R=x;break}else{if(U.CaretPosIndex>U.LineBreakIndexes[x]){R=x+1}}}if(R>0){U.CaretPosIndex=(R==1?0:U.LineBreakIndexes[R-2])+(U.CaretPosIndex-U.LineBreakIndexes[R-1])}}X=true;break;case 39:if(U.CaretPosIndex>=U.UserInputText.length-1){U.CaretPosIndex=U.UserInputText.length-1}else{U.CaretPosIndex++}U.SelectedTextStartIndex=-1;U.SelectedTextEndIndex=-1;U.MouseDown=0;U.WasSelecting=0;X=true;break;case 40:var R=0;if(U.LineBreakIndexes.length>0){for(var x=0;x<U.LineBreakIndexes.length;x++){if((x==0?true:U.CaretPosIndex>U.LineBreakIndexes[x-1])&&U.CaretPosIndex<U.LineBreakIndexes[x]){R=x;break}else{if(U.CaretPosIndex>U.LineBreakIndexes[x]){R=x+1}}}if(R<U.LineBreakIndexes.length){U.CaretPosIndex=U.LineBreakIndexes[R]+(U.CaretPosIndex-(R==0?0:U.LineBreakIndexes[R-1]))}}X=true;break;case 46:if(U.CaretPosIndex<U.UserInputText.length-1){if(U.CaretPosIndex==-1){U.UserInputText=U.UserInputText.substring(1)}else{if(U.CaretPosIndex==U.UserInputText.length-2){U.UserInputText=U.UserInputText.substring(0,U.UserInputText.length-1)}else{U.UserInputText=U.UserInputText.substring(0,U.CaretPosIndex+1)+U.UserInputText.substring(U.CaretPosIndex+2)}}U.SelectedTextStartIndex=-1;U.SelectedTextEndIndex=-1;U.MouseDown=0;U.WasSelecting=0}X=true;break;case 8:if(U.CaretPosIndex>-1){if(U.CaretPosIndex==0){if(U.UserInputText.length>1){U.UserInputText=U.UserInputText.substring(1,U.UserInputText.length-1)}else{U.UserInputText=""}U.CaretPosIndex=-1}else{if(U.CaretPosIndex==U.UserInputText.length-1){U.UserInputText=U.UserInputText.substring(0,U.UserInputText.length-1);U.CaretPosIndex--}else{if(U.CaretPosIndex>0){U.UserInputText=U.UserInputText.substring(0,U.CaretPosIndex)+U.UserInputText.substring(U.CaretPosIndex+1);U.CaretPosIndex--}}}U.SelectedTextStartIndex=-1;U.SelectedTextEndIndex=-1;U.MouseDown=0;U.WasSelecting=0}X=true;break}if(!X){if(T.ctrlKey&&String.fromCharCode(T.keyCode).toLowerCase()=="a"){U.SelectedTextStartIndex=0;U.SelectedTextEndIndex=U.UserInputText.length-1}else{if(T.ctrlKey&&String.fromCharCode(T.keyCode).toLowerCase()=="c"&&window.clipboardData){if(U.SelectedTextStartIndex>-1&&U.SelectedTextEndIndex>-1&&U.UserInputText&&U.SelectedTextEndIndex<U.UserInputText.length){window.clipboardData.setData("Text",(U.UserInputText&&U.SelectedTextEndIndex==U.UserInputText.length-1?U.UserInputText.substring(U.SelectedTextStartIndex):U.UserInputText.substring(U.SelectedTextStartIndex,U.SelectedTextEndIndex-U.SelectedTextStartIndex+1)))}}else{if(!U.UserInputText||(U.UserInputText&&U.UserInputText.length<U.MaxChars)){var V=getCharFromKeyCode(T);var S;if((!U.AllowedCharsRegEx||U.AllowedCharsRegEx==null||U.AllowedCharsRegEx.length==0||V.match(U.AllowedCharsRegEx)==V||V=="\n")){if(U.CaretPosIndex==-1){U.UserInputText=V+(U.UserInputText?U.UserInputText:"");U.CaretPosIndex++}else{if(U.UserInputText&&U.CaretPosIndex==U.UserInputText.length-1){U.UserInputText=U.UserInputText+V;U.CaretPosIndex++}else{if(U.UserInputText){U.UserInputText=U.UserInputText.substring(0,U.CaretPosIndex+1)+V+U.UserInputText.substring(U.CaretPosIndex+1);U.CaretPosIndex++}}}U.SelectedTextStartIndex=-1;U.SelectedTextEndIndex=-1;U.MouseDown=0;U.WasSelecting=0}}}}}U.LineBreakIndexes=new Array();if(U.UserInputText&&U.UserInputText.length>0){var Y=getCtx(W);if(U.WordSensitive==0){var Q=0;var y=0;while(Q<U.UserInputText.length){if(U.UserInputText.substr(y,Q-y+1)=="\n"){U.LineBreakIndexes.push(Q);y=Q}else{if(Y.measureText(U.UserInputText.substr(y,Q-y+1)).width+U.Margin>U.Width-15){U.LineBreakIndexes.push(Q);y=Q}}Q++}}else{var Q=0;var y=0;var Z=-1;while(Q<U.UserInputText.length){if(U.UserInputText.substr(Q,1)=="\n"){U.LineBreakIndexes.push(Q);y=Q}else{if(Y.measureText(U.UserInputText.substr(y,Q-y+1)).width+U.Margin>U.Width-15){if(Z>-1){U.LineBreakIndexes.push(Z);y=Z}else{U.LineBreakIndexes.push(Q);y=Q}}}Q++;if(U.UserInputText.substr(Q,1)==" "){Z=Q}}}var P=getScrollBarProps(W,U.VScrollBarWindowID);P.MaxItems=U.LineBreakIndexes.length;var R=0;if(U.LineBreakIndexes.length>0){for(var x=0;x<U.LineBreakIndexes.length;x++){if((x==0?true:U.CaretPosIndex>U.LineBreakIndexes[x-1])&&U.CaretPosIndex<U.LineBreakIndexes[x]){R=x;break}else{if(U.CaretPosIndex>U.LineBreakIndexes[x]){R=x+1}}}}if(R-P.SelectedID+1>(U.Height-(U.Margin*2))/(U.TextHeight+U.LineSpacingInPixels)){P.SelectedID=R-Math.floor((U.Height-(U.Margin*2))/(U.TextHeight+U.LineSpacingInPixels))+1}else{if(R<P.SelectedID){P.SelectedID=R}}}},w)}registerClickFunction(w,function(W,P,T){var X=T.calcX;var V=T.calcY;var U=getWordProcessorProps(W,P);var Y=getCtx(W);var Q=getScrollBarProps(W,U.VScrollBarWindowID);if(U.UserInputText.length>0){var S=0;if(U.LineBreakIndexes.length>0){for(var R=Q.SelectedID;R<U.LineBreakIndexes.length;R++){if(U.Y+U.Margin+((U.TextHeight+U.LineSpacingInPixels)*(R-Q.SelectedID+1))>V){break}else{S=R+1}}}if(S==0){S=Q.SelectedID}for(var R=(S==0?0:U.LineBreakIndexes[S-1]);R<(S<U.LineBreakIndexes.length?U.LineBreakIndexes[S]:U.UserInputText.length);R++){if(X>U.X+U.Margin+Y.measureText(U.UserInputText.substr((S==0?0:U.LineBreakIndexes[S-1]),R-(S==0?0:U.LineBreakIndexes[S-1]))).width){U.CaretPosIndex=R}else{break}}}},E);registerLostFocusFunction(E,w,function(P,x){var y=getWordProcessorProps(P,x);if(navigator.userAgent.toLowerCase().indexOf("android")>-1||navigator.userAgent.toLowerCase().indexOf("ipad")>-1||navigator.userAgent.toLowerCase().indexOf("iphone")>-1||navigator.userAgent.toLowerCase().indexOf("ipod")>-1){if(doesWindowHaveFocus(P,y.CustomKeyboardWindowID)==0&&doingEventForWindowID!=y.CustomKeyboardWindowID){setHiddenWindowStatus(P,y.CustomKeyboardWindowID,1)}else{setHiddenWindowStatus(P,y.CustomKeyboardWindowID,0)}}});registerGotFocusFunction(E,w,function(x,P){var y=getWordProcessorProps(x,P);setHiddenWindowStatus(x,y.CustomKeyboardWindowID,0)});registerAnimatedWindow(E,w);return w}function removeTrailingSpacesAndLineBreaks(a){while(a.length>0){if(a.substr(0,1)=="\n"||a.substr(0,1)==" "){a=(1<a.length?a.substr(1,a.length-1):"")}else{break}}return a}function getCharFromKeyCode(a){switch(a.keyCode){case 16:return"";case 190:return a.shiftKey||a.shiftLeft?">":".";case 32:return" ";case 13:return"\n";case 9:return" ";case 106:return"*";case 107:return"+";case 109:return"-";case 110:return a.shiftKey||a.shiftLeft?">":".";case 111:return"/";case 186:return a.shiftKey||a.shiftLeft?":":";";case 187:return a.shiftKey||a.shiftLeft?"+":"=";case 188:return a.shiftKey||a.shiftLeft?"<":",";case 189:return a.shiftKey||a.shiftLeft?"_":"-";case 191:return a.shiftKey||a.shiftLeft?"?":"/";case 192:return a.shiftKey||a.shiftLeft?"~":"`";case 219:return a.shiftKey||a.shiftLeft?"{":"[";case 220:return a.shiftKey||a.shiftLeft?"|":"\\";case 221:return a.shiftKey||a.shiftLeft?"}":"]";case 48:return a.shiftKey||a.shiftLeft?")":"0";case 49:return a.shiftKey||a.shiftLeft?"!":"1";case 50:return a.shiftKey||a.shiftLeft?"@":"2";case 51:return a.shiftKey||a.shiftLeft?"#":"3";case 52:return a.shiftKey||a.shiftLeft?"$":"4";case 53:return a.shiftKey||a.shiftLeft?"%":"5";case 54:return a.shiftKey||a.shiftLeft?"^":"6";case 55:return a.shiftKey||a.shiftLeft?"&":"7";case 56:return a.shiftKey||a.shiftLeft?"*":"8";case 57:return a.shiftKey||a.shiftLeft?"(":"9";case 65:return a.shiftKey||a.shiftLeft?"A":"a";case 66:return a.shiftKey||a.shiftLeft?"B":"b";case 67:return a.shiftKey||a.shiftLeft?"C":"c";case 68:return a.shiftKey||a.shiftLeft?"D":"d";case 69:return a.shiftKey||a.shiftLeft?"E":"e";case 70:return a.shiftKey||a.shiftLeft?"F":"f";case 71:return a.shiftKey||a.shiftLeft?"G":"g";case 72:return a.shiftKey||a.shiftLeft?"H":"h";case 73:return a.shiftKey||a.shiftLeft?"I":"i";case 74:return a.shiftKey||a.shiftLeft?"J":"j";case 75:return a.shiftKey||a.shiftLeft?"K":"k";case 76:return a.shiftKey||a.shiftLeft?"L":"l";case 77:return a.shiftKey||a.shiftLeft?"M":"m";case 78:return a.shiftKey||a.shiftLeft?"N":"n";case 79:return a.shiftKey||a.shiftLeft?"O":"o";case 80:return a.shiftKey||a.shiftLeft?"P":"p";case 81:return a.shiftKey||a.shiftLeft?"Q":"q";case 82:return a.shiftKey||a.shiftLeft?"R":"r";case 83:return a.shiftKey||a.shiftLeft?"S":"s";case 84:return a.shiftKey||a.shiftLeft?"T":"t";case 85:return a.shiftKey||a.shiftLeft?"U":"u";case 86:return a.shiftKey||a.shiftLeft?"V":"v";case 87:return a.shiftKey||a.shiftLeft?"W":"w";case 88:return a.shiftKey||a.shiftLeft?"X":"x";case 89:return a.shiftKey||a.shiftLeft?"Y":"y";case 90:return a.shiftKey||a.shiftLeft?"Z":"z";case 222:return a.shiftKey||a.shiftLeft?'"':"'";default:return""}}var virtualKeyboardPropsArray=new Array();function getVirtualKeyboardProps(c,a){for(var b=0;b<virtualKeyboardPropsArray.length;b++){if(virtualKeyboardPropsArray[b].CanvasID==c&&virtualKeyboardPropsArray[b].WindowID==a){return virtualKeyboardPropsArray[b]}}}function CCLVirtualKeyboard(){}CCLVirtualKeyboard.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,Keys:null,KeyPressFunction:null,GapBetweenButtons:null,GapBetweenRows:null,TextHeight:null,TextFontString:null,CustomDrawLetterFunction:null,HasGloss:null,ControlNameID:null,Depth:null,TabStopIndex:null,Initialize:function(){return createVirtualKeyboard(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.Keys,this.KeyPressFunction,this.GapBetweenButtons,this.GapBetweenRows,this.HasGloss,this.TextHeight,this.TextFontString,this.CustomDrawLetterFunction,this.TabStopIndex)}};function createVirtualKeyboard(o,b,i,g,m,l,q,j,n,r,d,a,k,h,p,f){var e=createWindow(o,i,g,m,l,q,null,"VirtualKeyboard",b,null,f);var c=(j==null?0:1);if(!j){j=[[[["Q",30,30],["W",30,30],["E",30,30],["R",30,30],["T",30,30],["Y",30,30],["U",30,30],["I",30,30],["O",30,30],["P",30,30]],[["A",30,30],["S",30,30],["D",30,30],["F",30,30],["G",30,30],["H",30,30],["J",30,30],["K",30,30],["L",30,30]],[["shiftKey",30,30],["Z",30,30],["X",30,30],["C",30,30],["V",30,30],["B",30,30],["N",30,30],["M",30,30],["backspaceKey",30,30]],[["keyboardOff",30,30],[",",30,30],["spacebarKey",60,30],[".",30,30],["12#",30,30,1],["carriageReturnKey",30,30]],[["up",30,30],["down",30,30],["left",30,30],["right",30,30]]],[[["1",30,30],["2",30,30],["3",30,30],["4",30,30],["5",30,30],["6",30,30],["7",30,30],["8",30,30],["9",30,30],["0",30,30]],[["!",30,30],["@",30,30],["#",30,30],["$",30,30],["%",30,30],["&",30,30],["*",30,30],["?",30,30],["/",30,30]],[["_",30,30],['"',30,30],["'",30,30],["(",30,30],[")",30,30],["-",30,30],["+",30,30],[";",30,30],["backspaceKey",30,30]],[["keyboardOff",30,30],[":",30,30],[",",30,30],["spacebarKey",45,30],[".",30,30],["ABC",40,30,0],["carriageReturnKey",30,30]],[["up",30,30],["down",30,30],["left",30,30],["right",30,30]]]]}virtualKeyboardPropsArray.push({CanvasID:o,WindowID:e,X:i,Y:g,Width:m,Height:l,Keys:j,KeyPressFunction:n,GapBetweenButtons:r,GapBetweenRows:d,CurrentKeyboardIndex:0,KeyExtents:null,TextHeight:k,TextFontString:h,CustomKeys:c,CustomDrawLetterFunction:p,HasGloss:a,ShiftKeyPressed:0});registerWindowDrawFunction(e,function(C,s){var E=getVirtualKeyboardProps(C,s);E.KeyExtents=new Array();var F=getCtx(C);F.fillStyle="#3c4243";F.beginPath();F.rect(E.X,E.Y,E.Width,E.Height);F.fill();F.strokeStyle="#353a3b";var t=(E.Height/Math.tan(Math.PI/4));for(var x=0;x<(E.Width+t)/10;x++){F.beginPath();F.moveTo(E.X-t+(x*10),E.Y);F.lineTo(E.X+(x*10),E.Y+E.Height);F.stroke();F.beginPath();F.moveTo(E.X-t+(x*10),E.Y+E.Height);F.lineTo(E.X+(x*10),E.Y);F.stroke()}var v=E.GapBetweenRows;for(var H=0;H<E.Keys[E.CurrentKeyboardIndex].length;H++){var u=0;for(var B=0;B<E.Keys[E.CurrentKeyboardIndex][H].length;B++){u+=E.Keys[E.CurrentKeyboardIndex][H][B][1]+E.GapBetweenButtons}var y=E.GapBetweenButtons+((E.Width-E.GapBetweenButtons-u)/2);for(var B=0;B<E.Keys[E.CurrentKeyboardIndex][H].length;B++){F.beginPath();F.moveTo(y+E.X,v+E.Y+5);F.arc(y+E.X+5,v+E.Y+5,5,Math.PI,(Math.PI/180)*270,false);F.lineTo(y+E.X+E.Keys[E.CurrentKeyboardIndex][H][B][1]-5,v+E.Y);F.arc(y+E.X+E.Keys[E.CurrentKeyboardIndex][H][B][1]-5,v+E.Y+5,5,(Math.PI/180)*270,Math.PI*2,false);F.lineTo(y+E.X+E.Keys[E.CurrentKeyboardIndex][H][B][1],v+E.Y+E.Keys[E.CurrentKeyboardIndex][H][B][2]-5);F.arc(y+E.X+E.Keys[E.CurrentKeyboardIndex][H][B][1]-5,v+E.Y+E.Keys[E.CurrentKeyboardIndex][H][B][2]-5,5,0,Math.PI/2,false);F.lineTo(y+E.X+5,v+E.Y+E.Keys[E.CurrentKeyboardIndex][H][B][2]);F.arc(y+E.X+5,v+E.Y+E.Keys[E.CurrentKeyboardIndex][H][B][2]-5,5,Math.PI/2,Math.PI,false);F.closePath();E.KeyExtents.push([y+E.X,v+E.Y,E.Keys[E.CurrentKeyboardIndex][H][B][1],E.Keys[E.CurrentKeyboardIndex][H][B][2],E.ShiftKeyPressed==1?E.Keys[E.CurrentKeyboardIndex][H][B][0]:E.Keys[E.CurrentKeyboardIndex][H][B][0].toLowerCase(),H,B]);var z=F.createLinearGradient(y+E.X,v+E.Y,y+E.X,v+E.Y+E.Keys[E.CurrentKeyboardIndex][H][B][2]);z.addColorStop(0,"#536fa0");z.addColorStop(1,"#274580");F.fillStyle=z;F.fill();F.strokeStyle="#1f3a73";F.stroke();if(E.CustomKeys==0){z=F.createLinearGradient(y+E.X,v+E.Y+((E.Keys[E.CurrentKeyboardIndex][H][B][2]-E.TextHeight)/2),y+E.X,v+E.Y-((E.Keys[E.CurrentKeyboardIndex][H][B][2]-E.TextHeight)/2)+E.Keys[E.CurrentKeyboardIndex][H][B][2]);z.addColorStop(0,"#fafbfc");z.addColorStop(1,"#dde2ea");F.fillStyle=z;F.strokeStyle=z;F.shadowBlur=5;F.shadowColor="#636e7f";F.font=E.TextFontString;switch(E.Keys[E.CurrentKeyboardIndex][H][B][0]){case"shiftKey":F.beginPath();F.moveTo(y+E.X+(E.Keys[E.CurrentKeyboardIndex][H][B][1]/2),v+E.Y+5);F.lineTo(y+E.X+5,v+E.Y+15);F.lineTo(y+E.X+(E.Keys[E.CurrentKeyboardIndex][H][B][1]/2)-3,v+E.Y+15);F.lineTo(y+E.X+(E.Keys[E.CurrentKeyboardIndex][H][B][1]/2)-3,v+E.Y+E.Keys[E.CurrentKeyboardIndex][H][B][1]-5);F.lineTo(y+E.X+(E.Keys[E.CurrentKeyboardIndex][H][B][1]/2)+3,v+E.Y+E.Keys[E.CurrentKeyboardIndex][H][B][1]-5);F.lineTo(y+E.X+(E.Keys[E.CurrentKeyboardIndex][H][B][1]/2)+3,v+E.Y+15);F.lineTo(y+E.X+E.Keys[E.CurrentKeyboardIndex][H][B][1]-5,v+E.Y+15);F.closePath();if(E.ShiftKeyPressed==1){F.save();var G=F.createLinearGradient(y+E.X,v+E.Y,y+E.X,v+E.Y+E.Keys[E.CurrentKeyboardIndex][H][B][2]);G.addColorStop(0,"#00FF00");G.addColorStop(1,"#FFFFFF");F.fillStyle=G;F.fill();F.restore()}else{F.fill()}break;case"backspaceKey":F.beginPath();F.moveTo(y+E.X+5,v+E.Y+(E.Keys[E.CurrentKeyboardIndex][H][B][2]/2));F.lineTo(y+E.X+14,v+E.Y+5);F.lineTo(y+E.X+14,v+E.Y+(E.Keys[E.CurrentKeyboardIndex][H][B][2]/2)-3);F.lineTo(y+E.X+E.Keys[E.CurrentKeyboardIndex][H][B][1]-5,v+E.Y+(E.Keys[E.CurrentKeyboardIndex][H][B][2]/2)-3);F.lineTo(y+E.X+E.Keys[E.CurrentKeyboardIndex][H][B][1]-5,v+E.Y+(E.Keys[E.CurrentKeyboardIndex][H][B][2]/2)+3);F.lineTo(y+E.X+14,v+E.Y+(E.Keys[E.CurrentKeyboardIndex][H][B][2]/2)+3);F.lineTo(y+E.X+14,v+E.Y+E.Keys[E.CurrentKeyboardIndex][H][B][2]-5);F.closePath();F.fill();break;case"keyboardOff":F.beginPath();F.rect(y+E.X+5,v+E.Y+5,E.Keys[E.CurrentKeyboardIndex][H][B][1]-10,E.Keys[E.CurrentKeyboardIndex][H][B][2]-10);F.stroke();for(var D=0;D<(E.Keys[E.CurrentKeyboardIndex][H][B][1]-10)/4;D++){for(var A=0;A<(E.Keys[E.CurrentKeyboardIndex][H][B][2]-10)/4;A++){F.beginPath();F.rect(y+E.X+5+(D*4),v+E.Y+5+(A*4),3,3);F.stroke()}}break;case"spacebarKey":F.beginPath();F.moveTo(y+E.X+5,v+E.Y+E.Keys[E.CurrentKeyboardIndex][H][B][2]-10);F.lineTo(y+E.X+5,v+E.Y+E.Keys[E.CurrentKeyboardIndex][H][B][2]-5);F.lineTo(y+E.X+E.Keys[E.CurrentKeyboardIndex][H][B][1]-5,v+E.Y+E.Keys[E.CurrentKeyboardIndex][H][B][2]-5);F.lineTo(y+E.X+E.Keys[E.CurrentKeyboardIndex][H][B][1]-5,v+E.Y+E.Keys[E.CurrentKeyboardIndex][H][B][2]-10);F.stroke();break;case"carriageReturnKey":F.beginPath();F.moveTo(y+E.X+5,v+E.Y+22);F.lineTo(y+E.X+14,v+E.Y+15);F.lineTo(y+E.X+14,v+E.Y+19);F.lineTo(y+E.X+19,v+E.Y+19);F.lineTo(y+E.X+19,v+E.Y+5);F.lineTo(y+E.X+25,v+E.Y+5);F.lineTo(y+E.X+25,v+E.Y+25);F.lineTo(y+E.X+14,v+E.Y+25);F.lineTo(y+E.X+14,v+E.Y+29);F.closePath();F.fill();break;case"up":F.beginPath();F.moveTo(y+E.X+15,v+E.Y+5);F.lineTo(y+E.X+25,v+E.Y+25);F.lineTo(y+E.X+5,v+E.Y+25);F.closePath();F.fill();break;case"down":F.beginPath();F.moveTo(y+E.X+15,v+E.Y+25);F.lineTo(y+E.X+5,v+E.Y+5);F.lineTo(y+E.X+25,v+E.Y+5);F.closePath();F.fill();break;case"left":F.beginPath();F.moveTo(y+E.X+5,v+E.Y+15);F.lineTo(y+E.X+25,v+E.Y+5);F.lineTo(y+E.X+25,v+E.Y+25);F.closePath();F.fill();break;case"right":F.beginPath();F.moveTo(y+E.X+25,v+E.Y+15);F.lineTo(y+E.X+5,v+E.Y+25);F.lineTo(y+E.X+5,v+E.Y+5);F.closePath();F.fill();break;break;case"12#":case"ABC":F.fillText(E.Keys[E.CurrentKeyboardIndex][H][B][0],y+E.X+((E.Keys[E.CurrentKeyboardIndex][H][B][1]-F.measureText(E.Keys[E.CurrentKeyboardIndex][H][B][0]).width)/2),v+E.Y+E.Keys[E.CurrentKeyboardIndex][H][B][2]-((E.Keys[E.CurrentKeyboardIndex][H][B][2]-E.TextHeight)/2));break;default:F.fillText(E.ShiftKeyPressed==1?E.Keys[E.CurrentKeyboardIndex][H][B][0]:E.Keys[E.CurrentKeyboardIndex][H][B][0].toLowerCase(),y+E.X+((E.Keys[E.CurrentKeyboardIndex][H][B][1]-F.measureText(E.ShiftKeyPressed==1?E.Keys[E.CurrentKeyboardIndex][H][B][0]:E.Keys[E.CurrentKeyboardIndex][H][B][0].toLowerCase()).width)/2),v+E.Y+E.Keys[E.CurrentKeyboardIndex][H][B][2]-((E.Keys[E.CurrentKeyboardIndex][H][B][2]-E.TextHeight)/2));break}}else{E.CustomDrawLetterFunction(F,E.Keys[E.CurrentKeyboardIndex][H][B][0],y+E.X,v+E.Y,E.Keys[E.CurrentKeyboardIndex][H][B][1],E.Keys[E.CurrentKeyboardIndex][H][B][2])}if(E.HasGloss==1){F.beginPath();F.moveTo(y+E.X+2,v+E.Y+5+2);F.arc(y+E.X+5+2,v+E.Y+5+2,5,Math.PI,(Math.PI/180)*270,false);F.lineTo(y+E.X+E.Keys[E.CurrentKeyboardIndex][H][B][1]-5-2,v+E.Y+2);F.arc(y+E.X+E.Keys[E.CurrentKeyboardIndex][H][B][1]-5-2,v+E.Y+5+2,5,(Math.PI/180)*270,Math.PI*2,false);F.lineTo(y+E.X+E.Keys[E.CurrentKeyboardIndex][H][B][1]-2,v+E.Y+E.Keys[E.CurrentKeyboardIndex][H][B][2]-5+2);F.arc(y+E.X+E.Keys[E.CurrentKeyboardIndex][H][B][1]-5-2,v+E.Y+E.Keys[E.CurrentKeyboardIndex][H][B][2]-5+2,5,0,Math.PI/2,false);F.lineTo(y+E.X+5+2,v+E.Y+E.Keys[E.CurrentKeyboardIndex][H][B][2]+2);F.arc(y+E.X+5+2,v+E.Y+E.Keys[E.CurrentKeyboardIndex][H][B][2]-5+2,5,Math.PI/2,Math.PI,false);F.closePath();var z=F.createLinearGradient(y+E.X+2,v+E.Y+2,y+E.X+2,v+E.Y+(E.Keys[E.CurrentKeyboardIndex][H][B][2]/2));z.addColorStop(0,"rgba(255,255,255,0.4)");z.addColorStop(1,"rgba(255,255,255,0.05)");F.fillStyle=z;F.fill()}y+=E.Keys[E.CurrentKeyboardIndex][H][B][1]+E.GapBetweenButtons}v+=E.Keys[E.CurrentKeyboardIndex][H][0][2]+E.GapBetweenRows}registerClickFunction(e,function(I,M,L){donotredaw=1;var w=L.calcX;var N=L.calcY;var K=getVirtualKeyboardProps(I,M);for(var J=0;J<K.KeyExtents.length;J++){if(w>K.KeyExtents[J][0]&&w<K.KeyExtents[J][0]+K.KeyExtents[J][2]&&N>K.KeyExtents[J][1]&&N<K.KeyExtents[J][1]+K.KeyExtents[J][3]){if(K.Keys[K.CurrentKeyboardIndex][K.KeyExtents[J][5]][K.KeyExtents[J][6]].length==4){K.CurrentKeyboardIndex=K.Keys[K.CurrentKeyboardIndex][K.KeyExtents[J][5]][K.KeyExtents[J][6]][3]}else{if(K.Keys[K.CurrentKeyboardIndex][K.KeyExtents[J][5]][K.KeyExtents[J][6]][0]=="shiftKey"){K.ShiftKeyPressed=(K.ShiftKeyPressed==1?0:1)}else{K.KeyPressFunction(I,M,K.KeyExtents[J][4])}}return}}},o)},o);if(f!=null&&f>0){registerKeyDownFunction(o,function(){},e)}return e}var splitterPropsArray=new Array();function getSplitterProps(c,a){for(var b=0;b<splitterPropsArray.length;b++){if(splitterPropsArray[b].CanvasID==c&&splitterPropsArray[b].WindowID==a){return splitterPropsArray[b]}}}function CCLSplitter(){}CCLSplitter.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,LineColor:null,ControlNameID:null,Depth:null,TabStopIndex:null,Initialize:function(){return createSplitter(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.LineColor,this.TabStopIndex)}};function createSplitter(a,c,j,h,b,k,e,l,f){var g=createWindow(a,j,h,b,k,e,null,"Splitter",c,null,f);splitterPropsArray.push({CanvasID:a,WindowID:g,X:j,Y:h,Width:b,Height:k,LineColor:l,MouseDown:0});registerWindowDrawFunction(g,function(o,i){var n=getSplitterProps(o,i);var m=getCtx(o);m.fillStyle=n.LineColor;m.rect(n.X,n.Y,n.Width,n.Height);m.fill()},a);registerMouseDownFunction(g,function(i,n){var m=getSplitterProps(a,g);m.MouseDown=1},a);for(var d=0;d<windows.length;d++){if(windows[d].ParentWindowID==null&&((k>b&&windows[d].X<j+b+2&&windows[d].X+windows[d].Width>j-2)||(b>k&&windows[d].Y<h+k&&windows[d].Y+windows[d].Height>h-2))){registerMouseMoveFunction(windows[d].WindowCount,function(w,m,r){var q=getSplitterProps(a,g);if(q.MouseDown==1){var v=getWindowProps(a,g);var r=correctEvent(a,window.event);var A=r.calcX;var u=r.calcY;var C=1000000;var s=0;var n=0;var B=1000000;if(q.Height>q.Width){var z=A-q.X;if(z!=0){for(var p=0;p<windows.length;p++){if(windows[p].WindowCount!=g&&windows[p].ParentWindowID==null&&q.X-2<windows[p].X+windows[p].Width&&q.X+q.Width+2>windows[p].X){if(windows[p].X<C){C=windows[p].X}if(windows[p].X+windows[p].Width>s){s=windows[p].X+windows[p].Width}if(windows[p].Y<B){B=windows[p].Y}if(windows[p].Y+windows[p].Height>n){n=windows[p].Y+windows[p].Height}if(windows[p].X+windows[p].Width<v.X){windows[p].Width+=z;getWindowControlPropsByWindowProps(windows[p]).Width=windows[p].Width}else{if(windows[p].X>v.X){windows[p].X+=z;windows[p].Width-=z;var o=getWindowControlPropsByWindowProps(windows[p]);o.X=windows[p].X;o.Width=windows[p].Width}}if(windows[p].Width<0){windows[p].Width=0}}}v.X=A;q.X=A;invalidateRect(a,null,C,B,s-C,n-B)}}else{if(q.Width>q.Height){var t=u-q.Y;if(t!=0){for(var p=0;p<windows.length;p++){if(windows[p].WindowCount!=g&&windows[p].ParentWindowID==null&&q.Y-2<windows[p].Y+windows[p].Height&&q.Y+q.Height+2>windows[p].Y){if(windows[p].X<C){C=windows[p].X}if(windows[p].X+windows[p].Width>s){s=windows[p].X+windows[p].Width}if(windows[p].Y<B){B=windows[p].Y}if(windows[p].Y+windows[p].Height>n){n=windows[p].Y+windows[p].Height}if(windows[p].Y+windows[p].Height<v.Y){windows[p].Height+=t;getWindowControlPropsByWindowProps(windows[p]).Height=windows[p].Height}else{if(windows[p].Y>v.Y){windows[p].Y+=t;windows[p].Height-=t;var o=getWindowControlPropsByWindowProps(windows[p]);o.Y=windows[p].Y;o.Height=windows[p].Height}}if(windows[p].Height<0){windows[p].Height=0}}}v.Y=u;q.Y=u;invalidateRect(a,null,C,B,s-C,n-B)}}}}},a)}}registerMouseUpFunction(g,function(){var i=getSplitterProps(a,g);i.MouseDown=0},a);if(f!=null&&f>0){registerKeyDownFunction(a,function(){},g)}return g}var boundaryFillableMapPropsArray=new Array();function getBoundaryFillableMapProps(c,a){for(var b=0;b<boundaryFillableMapPropsArray.length;b++){if(boundaryFillableMapPropsArray[b].CanvasID==c&&boundaryFillableMapPropsArray[b].WindowID==a){return boundaryFillableMapPropsArray[b]}}}function CCLBoundaryFillableMap(){}CCLBoundaryFillableMap.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,FillPoints:null,ImgURL:null,Image:null,ImageWidth:null,ImageHeight:null,ControlNameID:null,Depth:null,TabStopIndex:null,Initialize:function(){return createBoundaryFillableMap(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.FillPoints,this.ImgURL,this.ImageWidth,this.ImageHeight,this.TabStopIndex)}};function createBoundaryFillableMap(a,c,k,j,b,l,e,f,n,m,i,g){var h=createWindow(a,k,j,b,l,e,null,"BoundaryFillableMap",c,null,g);var d=new Image();d.onload=function(){invalidateRect(a,null,k,j,b,l)};d.src=n;boundaryFillableMapPropsArray.push({CanvasID:a,WindowID:h,X:k,Y:j,Width:b,Height:l,FillPoints:f,ImgURL:n,Image:d,ImageWidth:m,ImageHeight:i});registerWindowDrawFunction(h,function(r,v){var t=getBoundaryFillableMapProps(r,v);var u=getCtx(r);var q=document.createElement("canvas");q.width=t.ImageWidth;q.height=t.ImageHeight;var p=q.getContext("2d");p.drawImage(t.Image,0,0);var o=p.getImageData(0,0,q.width,q.height);for(var s=0;s<t.FillPoints.length;s++){o=fillImageData(t.FillPoints[s],o)}u.putImageData(o,t.X,t.Y)},a);if(g!=null&&g>0){registerKeyDownFunction(a,function(){},h)}return h}function fillImageData(c,b){var e=new Array();e.push([c[0],c[1]]);while(e.length>0){var a=e[e.length-1][0];var d=e[e.length-1][1];e.pop();if(b.data[(d*b.width*4)+(a*4)]==c[6]&&b.data[(d*b.width*4)+(a*4)+1]==c[7]&&b.data[(d*b.width*4)+(a*4)+2]==c[8]&&b.data[(d*b.width*4)+(a*4)+3]==c[9]){b.data[(d*b.width*4)+(a*4)]=c[10];b.data[(d*b.width*4)+(a*4)+1]=c[11];b.data[(d*b.width*4)+(a*4)+2]=c[12];b.data[(d*b.width*4)+(a*4)+3]=c[13];if(c.length==17&&c[14]==0?a-1>c[15]:a-1>c[2]){e.push([a-1,d])}if(c.length==17&&c[14]==0?a+1<c[16]:a+1<c[4]){e.push([a+1,d])}if(c.length==17&&c[14]==1?d-1>c[15]:d-1>c[3]){e.push([a,d-1])}if(c.length==17&&c[14]==1?a-1>c[16]:d+1<c[5]){e.push([a,d+1])}}}return b}var simpleXMLViewerPropsArray=new Array();function getSimpleXMLViewerProps(c,a){for(var b=0;b<simpleXMLViewerPropsArray.length;b++){if(simpleXMLViewerPropsArray[b].CanvasID==c&&simpleXMLViewerPropsArray[b].WindowID==a){return simpleXMLViewerPropsArray[b]}}}function fillSimpleXMLViewerChildNodes(c,h,k,d,a,l,j){for(var e=0;e<h.length;e++){var b=addChildNodes(c.ChildNodes,c,d==0?null:a,1,h[e].nodeName,["Node",h[e]]);if(h[e].attributes&&h[e].attributes.length>0){for(var g=0;g<h[e].attributes.length;g++){var f=addChildNodes(b.ChildNodes,b,j,1,h[e].attributes[g].name,["Attribute",h[e].attributes[g]]);addChildNodes(f.ChildNodes,f,l,1,h[e].attributes[g].value,["AttributeValue",h[e].attributes[g]])}}if(h[e].childNodes.length>0){fillSimpleXMLViewerChildNodes(b,h[e].childNodes,k,d,a,l,j)}else{if(h[e].nodeValue&&h[e].nodeValue.length>0){addChildNodes(b.ChildNodes,b,d==0?null:l,1,h[e].nodeValue,["Value",h[e]])}}}}function CCLXMLViewer(){}CCLXMLViewer.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,XML:null,TextColor:null,TextFontString:null,TextHeight:null,ClickNodeFunction:null,Tag:null,HasIcons:null,IconWidth:null,IconHeight:null,ImgURLNode:null,ImgURLValue:null,ImgURLAttribute:null,ControlNameID:null,Depth:null,TabStopIndex:null,Initialize:function(){createSimpleXMLViewer(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.XML,this.TextColor,this.TextFontString,this.TextHeight,this.ClickNodeFunction,this.Tag,this.HasIcons,this.IconWidth,this.IconHeight,this.ImgURLNode,this.ImgURLValue,this.ImgURLAttribute,this.TabStopIndex)}};function createSimpleXMLViewer(t,b,m,k,r,p,B,e,z,l,n,w,C,g,v,A,o,c,a,j){var d=new DOMParser();xmlDoc=d.parseFromString(e,"text/xml");var q=new Array();for(var u=0;u<xmlDoc.firstChild.childNodes[0].childNodes.length;u++){var s=addChildNodes(q,null,g==0?null:o,1,xmlDoc.firstChild.childNodes[0].childNodes[u].nodeName,["Node",xmlDoc.firstChild.childNodes[0].childNodes[u]]);if(xmlDoc.firstChild.childNodes[0].childNodes[u].attributes.length>0){for(var m=0;m<xmlDoc.firstChild.childNodes[0].childNodes[u].attributes.length;m++){var f=addChildNodes(s.ChildNodes,s,a,1,xmlDoc.firstChild.childNodes[0].childNodes[u].attributes[m].name,["Attribute",xmlDoc.firstChild.childNodes[0].childNodes[u].attributes[m]]);addChildNodes(f.ChildNodes,f,c,1,xmlDoc.firstChild.childNodes[0].childNodes[u].attributes[m].value,["AttributeValue",xmlDoc.firstChild.childNodes[0].childNodes[u].attributes[m]])}}if(xmlDoc.firstChild.childNodes[0].childNodes[u].childNodes.length>0){fillSimpleXMLViewerChildNodes(s,xmlDoc.firstChild.childNodes[0].childNodes[u].childNodes,xmlDoc,g,o,c,a)}else{if(xmlDoc.firstChild.childNodes[0].childNodes[u].nodeValue&&xmlDoc.firstChild.childNodes[0].childNodes[u].nodeValue.length>0){addChildNodes(s.ChildNodes,null,g==0?null:c,1,xmlDoc.firstChild.childNodes[0].childNodes[u].nodeValue,["Value",xmlDoc.firstChild.childNodes[0].childNodes[u]])}}}var h=createTreeView(t,b,m,k,r,p,B,q,z,l,n,w,C,g,v,A,null);simpleXMLViewerPropsArray.push({CanvasID:t,WindowID:h,X:m,Y:k,Width:r,Height:p,XML:e,TextColor:z,TextFontString:l,TextHeight:n,ClickNodeFunction:w,Tag:C,HasIcons:g,IconWidth:v,IconHeight:A,ImgURLNode:o,ImgURLValue:c,ImgURLAttribute:a});if(j!=null&&j>0){registerKeyDownFunction(t,function(){},h)}return h}var votingPropsArray=new Array();var votingOutlineImageArray=new Array();function getVotingOutlineImage(c,a){for(var b=0;b<votingOutlineImageArray.length;b++){if(votingOutlineImageArray[b][0]==c&&votingOutlineImageArray[b][1]==a){return votingOutlineImageArray[b][2]}}}function getVotingProps(c,a){for(var b=0;b<votingPropsArray.length;b++){if(votingPropsArray[b].CanvasID==c&&votingPropsArray[b].WindowID==a){return votingPropsArray[b]}}}function CCLVotingControl(){}CCLVotingControl.prototype={CanvasID:null,X:null,Y:null,Width:null,Height:null,NumStars:null,MaxValueOfAllStars:null,StarColorRed:null,StarColorGreen:null,StarColorBlue:null,StarColorAlpha:null,SpacingInPixelsBetweenStars:null,HasPartialStars:null,Editable:null,HasValueLabel:null,LabelXPos:null,LabelYPos:null,StarsStartingPosOffsetWhenLabel:null,StarsYPosWhenLabel:null,InitialValue:null,OutlineThicknessOfEmptyStar:null,StarsOrientation:null,FillOrientation:null,OutLineImgURL:null,CustomFillPoint:null,ImgWidth:null,ImgHeight:null,StarSizeInPixels:null,HasMouseOverLabel:null,StarOutlineBgColorRed:null,StarOutlineBgColorGreen:null,StarOutlineBgColorBlue:null,StarOutlineBgColorAlpha:null,LabelTextColor:null,LabelTextFontString:null,LabelTextHeight:null,CustomClickFunction:null,RoundDisplayedValueToNumOfDecimals:null,ControlNameID:null,Depth:null,TabStopIndex:null,IsCustomPattern:null,Initialize:function(){return createVotingControl(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Height,this.Depth,this.NumStars,this.MaxValueOfAllStars,this.StarColorRed,this.StarColorGreen,this.StarColorBlue,this.StarColorAlpha,this.StarSizeInPixels,this.SpacingInPixelsBetweenStars,this.HasPartialStars,this.Editable,this.HasValueLabel,this.LabelXPos,this.LabelYPos,this.LabelTextColor,this.LabelTextFontString,this.LabelTextHeight,this.StarsStartingPosOffsetWhenLabel,this.StarsYPosWhenLabel,this.InitialValue,this.OutlineThicknessOfEmptyStar,this.StarsOrientation,this.FillOrientation,this.IsCustomPattern,this.OutLineImgURL,this.CustomFillPoint,this.ImgWidth,this.ImgHeight,this.HasMouseOverLabel,this.StarOutlineBgColorRed,this.StarOutlineBgColorGreen,this.StarOutlineBgColorBlue,this.StarOutlineBgColorAlpha,this.CustomClickFunction,this.RoundDisplayedValueToNumOfDecimals,this.TabStopIndex)}};function createVotingControl(v,F,E,D,a,b,e,A,N,h,n,L,s,R,k,o,G,O,f,B,d,t,P,K,J,H,C,r,i,I,g,l,w,u,q,c,M,z,Q,p,j,S){var m=createWindow(v,E,D,a,b,e,null,"VotingControl",F,null,S);if(I==1){votingOutlineImage=new Image();votingOutlineImage.onload=function(){invalidateRect(v,null,E,D,a,b)};votingOutlineImage.src=g;votingOutlineImageArray.push([v,m,votingOutlineImage])}votingPropsArray.push({CanvasID:v,WindowID:m,X:E,Y:D,Width:a,Height:b,NumStars:A,MaxValueOfAllStars:N,StarColorRed:h,StarColorGreen:n,StarColorBlue:L,StarColorAlpha:s,SpacingInPixelsBetweenStars:k,HasPartialStars:o,Editable:G,HasValueLabel:O,LabelXPos:f,LabelYPos:B,StarsStartingPosOffsetWhenLabel:K,StarsYPosWhenLabel:J,InitialValue:H,OutlineThicknessOfEmptyStar:C,StarsOrientation:r,FillOrientation:i,IsCustomPattern:I,OutLineImgURL:g,CustomFillPoint:l,ImgWidth:w,ImgHeight:u,StarSizeInPixels:R,HasMouseOverLabel:q,StarOutlineBgColorRed:c,StarOutlineBgColorGreen:M,StarOutlineBgColorBlue:z,StarOutlineBgColorAlpha:Q,LabelTextColor:d,LabelTextFontString:t,LabelTextHeight:P,CustomClickFunction:p,RoundDisplayedValueToNumOfDecimals:j});registerWindowDrawFunction(m,function(x,T){var Z=getVotingProps(x,T);if(Z.IsCustomPattern==1){var ai=getCtx(x);var W=document.createElement("canvas");W.width=Z.ImgWidth;W.height=Z.ImgHeight;var ac=W.getContext("2d");ac.drawImage(getVotingOutlineImage(x,T),0,0);var Y=ac.getImageData(0,0,W.width,W.height);var X=Z.HasPartialStars==1?Math.floor(Z.InitialValue/(Z.MaxValueOfAllStars/Z.NumStars)):Math.round(Z.InitialValue/(Z.MaxValueOfAllStars/Z.NumStars));if(X>0){Y=fillImageData(Z.CustomFillPoint,Y);for(var af=0;af<X;af++){ai.putImageData(Y,Z.X+(Z.StarsOrientation==0?(Z.HasValueLabel==1?Z.StarsStartingPosOffsetWhenLabel:0)+(af*(Z.ImgWidth+Z.SpacingInPixelsBetweenStars)):0),Z.Y+(Z.StarsOrientation==1?(Z.HasValueLabel==1?Z.StarsStartingPosOffsetWhenLabel:0)+(af*(Z.ImgHeight+Z.SpacingInPixelsBetweenStars)):0))}}var y=0;if(Z.HasPartialStars==1){y=1;var ah=Math.round(((Z.InitialValue/(Z.MaxValueOfAllStars/Z.NumStars))%1)*Z.ImgWidth);if(ah>0){var V=document.createElement("canvas");V.width=Z.ImgWidth;V.height=Z.ImgHeight;var ad=V.getContext("2d");ad.drawImage(getVotingOutlineImage(x,T),0,0);var Y=ad.getImageData(0,0,W.width,W.height);var aa=findStartingFillPointXY(passImageDataAsArray(Y),Y.width,Z.CustomFillPoint,Z.FillOrientation,ah);for(var ae=0;ae<aa.length;ae++){var aj=[aa[ae].X,aa[ae].Y,0,0,Z.ImgWidth,Z.ImgHeight,Z.StarOutlineBgColorRed,Z.StarOutlineBgColorGreen,Z.StarOutlineBgColorBlue,Z.StarOutlineBgColorAlpha,Z.StarColorRed,Z.StarColorGreen,Z.StarColorBlue,Z.StarColorAlpha,Z.FillOrientation,0,ah];Y=fillImageData(aj,Y)}ai.putImageData(Y,Z.X+(Z.StarsOrientation==0?(Z.HasValueLabel==1?Z.StarsStartingPosOffsetWhenLabel:0)+(X*(Z.ImgWidth+Z.SpacingInPixelsBetweenStars)):0),Z.Y+(Z.StarsOrientation==1?(Z.HasValueLabel==1?Z.StarsStartingPosOffsetWhenLabel:0)+(X*(Z.ImgHeight+Z.SpacingInPixelsBetweenStars)):0))}}if(X+y<Z.NumStars){var U=document.createElement("canvas");U.width=Z.ImgWidth;U.height=Z.ImgHeight;var ab=U.getContext("2d");ab.drawImage(getVotingOutlineImage(x,T),0,0);var ag=ac.getImageData(0,0,W.width,W.height);for(var af=X+y;af<Z.NumStars;af++){ai.putImageData(ag,Z.X+(Z.StarsOrientation==0?(Z.HasValueLabel==1?Z.StarsStartingPosOffsetWhenLabel:0)+(af*(Z.ImgWidth+Z.SpacingInPixelsBetweenStars)):0),Z.Y+(Z.StarsOrientation==1?(Z.HasValueLabel==1?Z.StarsStartingPosOffsetWhenLabel:0)+(af*(Z.ImgHeight+Z.SpacingInPixelsBetweenStars)):0))}}if(Z.HasValueLabel==1){ai.fillStyle=Z.LabelTextColor;ai.fillText(Z.InitialValue.toFixed(Z.RoundDisplayedValueToNumOfDecimals?Z.RoundDisplayedValueToNumOfDecimals:2).toString()+" out of "+Z.MaxValueOfAllStars.toString(),Z.X+Z.LabelXPos,Z.Y+Z.LabelYPos)}}else{var ai=getCtx(x);var W=document.createElement("canvas");W.width=Z.StarSizeInPixels;W.height=Z.StarSizeInPixels;var ac=W.getContext("2d");drawOutlineEmptyStarOnCtx(ac,Z,W);var Y=ac.getImageData(0,0,W.width,W.height);var X=Z.HasPartialStars==1?Math.floor(Z.InitialValue/(Z.MaxValueOfAllStars/Z.NumStars)):Math.round(Z.InitialValue/(Z.MaxValueOfAllStars/Z.NumStars));if(X>0){var aj=[Z.StarSizeInPixels/2,Z.StarSizeInPixels/2,0,0,Z.StarSizeInPixels,Z.StarSizeInPixels,255,255,255,255,Z.StarColorRed,Z.StarColorGreen,Z.StarColorBlue,Z.StarColorAlpha];Y=fillImageData(aj,Y);for(var af=0;af<X;af++){ai.putImageData(Y,Z.X+(Z.StarsOrientation==0?(Z.HasValueLabel==1?Z.StarsStartingPosOffsetWhenLabel:0)+(af*(Z.ImgWidth+Z.SpacingInPixelsBetweenStars)):0),Z.Y+(Z.StarsOrientation==1?(Z.HasValueLabel==1?Z.StarsStartingPosOffsetWhenLabel:0)+(af*(Z.ImgHeight+Z.SpacingInPixelsBetweenStars)):0))}}var y=0;if(Z.HasPartialStars==1){y=1;var ah=Math.round(((Z.InitialValue/(Z.MaxValueOfAllStars/Z.NumStars))%1)*Z.StarSizeInPixels);if(ah>0){var V=document.createElement("canvas");V.width=Z.StarSizeInPixels;V.height=Z.StarSizeInPixels;var ad=V.getContext("2d");drawOutlineEmptyStarOnCtx(ad,Z,V);var ag=ad.getImageData(0,0,V.width,V.height);var aa=findStartingFillPointXY(passImageDataAsArray(ag),ag.width,[Z.StarSizeInPixels/2,Z.StarSizeInPixels/2,0,0,Z.StarSizeInPixels,Z.StarSizeInPixels,255,255,255,255,Z.StarColorRed,Z.StarColorGreen,Z.StarColorBlue,Z.StarColorAlpha],Z.FillOrientation,ah);for(var ae=0;ae<aa.length;ae++){var aj=[aa[ae].X,aa[ae].Y,0,0,Z.StarSizeInPixels,Z.StarSizeInPixels,255,255,255,255,Z.StarColorRed,Z.StarColorGreen,Z.StarColorBlue,Z.StarColorAlpha,Z.FillOrientation,0,ah];ag=fillImageData(aj,ag)}ai.putImageData(ag,Z.X+(Z.StarsOrientation==0?(Z.HasValueLabel==1?Z.StarsStartingPosOffsetWhenLabel:0)+(X*(Z.StarSizeInPixels+Z.SpacingInPixelsBetweenStars)):0),Z.Y+(Z.StarsOrientation==1?(Z.HasValueLabel==1?Z.StarsStartingPosOffsetWhenLabel:0)+(X*(Z.StarSizeInPixels+Z.SpacingInPixelsBetweenStars)):0))}}if(X+y<Z.NumStars){var U=document.createElement("canvas");U.width=Z.ImgWidth;U.height=Z.ImgHeight;var ab=U.getContext("2d");drawOutlineEmptyStarOnCtx(ab,Z,U);var ag=ab.getImageData(0,0,U.width,U.height);for(var af=X+y;af<Z.NumStars;af++){ai.putImageData(ag,Z.X+(Z.StarsOrientation==0?(Z.HasValueLabel==1?Z.StarsStartingPosOffsetWhenLabel:0)+(af*(Z.StarSizeInPixels+Z.SpacingInPixelsBetweenStars)):0),Z.Y+(Z.StarsOrientation==1?(Z.HasValueLabel==1?Z.StarsStartingPosOffsetWhenLabel:0)+(af*(Z.StarSizeInPixels+Z.SpacingInPixelsBetweenStars)):0))}}if(Z.HasValueLabel==1){ai.fillStyle=Z.LabelTextColor;ai.fillText(Z.InitialValue.toFixed(Z.RoundDisplayedValueToNumOfDecimals?Z.RoundDisplayedValueToNumOfDecimals:2).toString()+" out of "+Z.MaxValueOfAllStars.toString(),Z.X+Z.LabelXPos,Z.Y+Z.LabelYPos)}}},v);if(G==1){registerClickFunction(m,function(x,W,T){var Z=getVotingProps(x,W);var V=T.calcX;var U=T.calcY;for(var y=0;y<Z.NumStars;y++){var ac=Z.X+(Z.StarsOrientation==0?(Z.HasValueLabel==1?Z.StarsStartingPosOffsetWhenLabel:0)+(y*((Z.IsCustomPattern==1?Z.ImgWidth:Z.StarSizeInPixels)+Z.SpacingInPixelsBetweenStars)):0);var Y=ac+(Z.IsCustomPattern==1?Z.ImgWidth:Z.StarSizeInPixels);var ab=Z.Y+(Z.StarsOrientation==1?(Z.HasValueLabel==1?Z.StarsStartingPosOffsetWhenLabel:0)+(y*((Z.IsCustomPattern==1?Z.ImgHeight:Z.StarSizeInPixels)+Z.SpacingInPixelsBetweenStars)):0);var X=ab+(Z.IsCustomPattern==1?Z.ImgHeight:Z.StarSizeInPixels);if(ac<V&&Y>V&&ab<U&&X>U){var aa=(y*(Z.MaxValueOfAllStars/Z.NumStars))+((Z.FillOrientation==0?((V-ac)/(Z.IsCustomPattern==1?Z.ImgWidth:Z.StarSizeInPixels)):((U-ab)/(Z.IsCustomPattern==1?Z.ImgHeight:Z.StarSizeInPixels)))*(Z.MaxValueOfAllStars/Z.NumStars));if(Z.CustomClickFunction){Z.CustomClickFunction(x,W,Z,V,U,aa)}else{Z.InitialValue=aa}}}},v)}}function passImageDataAsArray(a){var c=new Array();for(var b=0;b<a.width*a.height*4;b++){c.push(a.data[b])}return c}function findStartingFillPointXY(f,a,d,c,b){var h=new Array();var i=new Array();i.push([d[0],d[1]]);while(i.length>0){var g=i[i.length-1][0];var e=i[i.length-1][1];i.pop();if(f[(e*a*4)+(g*4)]==d[6]&&f[(e*a*4)+(g*4)+1]==d[7]&&f[(e*a*4)+(g*4)+2]==d[8]&&f[(e*a*4)+(g*4)+3]==d[9]){f[(e*a*4)+(g*4)]=d[10];f[(e*a*4)+(g*4)+1]=d[11];f[(e*a*4)+(g*4)+2]=d[12];f[(e*a*4)+(g*4)+3]=d[13];if(d.length==17&&d[14]==0?g-1>d[15]:g-1>d[2]){i.push([g-1,e])}if(d.length==17&&d[14]==0?g+1<d[16]:g+1<d[4]){i.push([g+1,e])}if(d.length==17&&d[14]==1?e-1>d[15]:e-1>d[3]){i.push([g,e-1])}if(d.length==17&&d[14]==1?g-1>d[16]:e+1<d[5]){i.push([g,e+1])}if(c==0?g<=b:e<=b){h.push({X:g,Y:e})}}}return h}function drawOutlineEmptyStarOnCtx(b,c,d){b.fillStyle="#FFFFFF";b.rect(0,0,c.StarSizeInPixels,c.StarSizeInPixels);b.fill();b.strokeStyle="#000000";b.lineWidth=c.OutlineThicknessOfEmptyStar;b.beginPath();var e=[[0,Math.floor(24*c.StarSizeInPixels/70)],[Math.floor(27*c.StarSizeInPixels/70),Math.floor(24*c.StarSizeInPixels/70)],[Math.floor(c.StarSizeInPixels/2),0],[Math.floor(43*c.StarSizeInPixels/70),Math.floor(24*c.StarSizeInPixels/70)],[c.StarSizeInPixels,Math.floor(24*c.StarSizeInPixels/70)],[Math.floor(49*c.StarSizeInPixels/70),Math.floor(41*c.StarSizeInPixels/70)],[Math.floor(60*c.StarSizeInPixels/70),c.StarSizeInPixels],[Math.floor(c.StarSizeInPixels/2),Math.floor(50*c.StarSizeInPixels/70)],[Math.floor(15*c.StarSizeInPixels/70),Math.floor(c.StarSizeInPixels)],[Math.floor(21*c.StarSizeInPixels/70),Math.floor(41*c.StarSizeInPixels/70)]];var a=b.getImageData(0,0,d.width,d.height);b.putImageData(drawClosedLoopLines(a,e,c.StarColorRed,c.StarColorGreen,c.StarColorBlue,c.StarColorAlpha),0,0)}function drawClosedLoopLines(b,d,g,e,a,f){if(d.length>1){for(var c=0;c<d.length;c++){b=drawline2(b,d[c][0],d[c][1],c==d.length-1?d[0][0]:d[c+1][0],c==d.length-1?d[0][1]:d[c+1][1],g,e,a,f)}}return b}function drawline2(j,b,i,a,g,c,e,k,d){var n=a-b;var h=1;var m=g-i;var f=1;if(n<0){h=-1;n=-n}if(m<0){f=-1;m=-m}n=n<<1;m=m<<1;j=setPixel(j,b,i,c,e,k,d);if(m<n){var l=m-(n>>1);while(b!=a){if(l>=0){i+=f;l-=n}l+=m;b+=h;j=setPixel(j,b,i,c,e,k,d)}}else{var l=n-(m>>1);while(i!=g){if(l>=0){b+=h;l-=m}l+=n;i+=f;j=setPixel(j,b,i,c,e,k,d)}}return j}function setPixel(c,b,g,f,d,a,e){c.data[(g*c.width*4)+(b*4)]=f;c.data[(g*c.width*4)+(b*4)+1]=d;c.data[(g*c.width*4)+(b*4)+2]=a;c.data[(g*c.width*4)+(b*4)+3]=e;return c}function findMinValueIndex(d){var b=-1;if(d.length>1){var a=d[0];var b=0;for(var c=1;c<d.length;c++){if(a>d[c]){a=d[c];b=c}}}return b}var ribbonPropsArray=new Array();function getRibbonProps(c,a){for(var b=0;b<ribbonPropsArray.length;b++){if(ribbonPropsArray[b].CanvasID==c&&ribbonPropsArray[b].WindowID==a){return ribbonPropsArray[b]}}}function RibbonButtonScrollableList(){}RibbonButtonScrollableList.prototype={ID:null,X:null,Y:null,Width:null,Height:null,VerticalScrollBarYPos:null,VerticalScrollBarWidth:null,VeritcalScrollBarScrollButtonWidth:null,VerticalScrollBarScollButtonHeight:null,VerticalScrollBarButtonHasImage:null,VerticalScrollBarTopButtonImageUrl:null,VerticalScrollBarBottomButtonImageUrl:null};function RibbonControlTypes(){}RibbonControlTypes.prototype={Button:1,ComboBox:2,CheckBox:3,ButtonScrollableList:4,DropDownButton:5,DropDownButtonListButton:6};function RibbonControl(){}RibbonControl.prototype={X:null,Y:null,Width:null,Height:null,Type:null,DropDownButtonX:null,DropDownButtonY:null,DropDownButtonWidth:null,DropDownButtonHeight:null,DropDownListX:null,DropDownListY:null,DropDownListWidth:null,DropDownListHeight:null,HasButtonImage:null,ButtonImageUrl:null,HasDropDownTextBoxBgImage:null,DropDownTextBoxBgImageUrl:null,HasDropDownListBgImage:null,DropDownListBgImageUrl:null,HasLabel:null,LabelText:null,LabelTextFontColor:null,LabelTextFontHeight:null,LabelTextFontString:null,LabelX:null,LabelY:null,ButtonScrollableListId:null,DropDownButtonListX:null,DropDownButtonListY:null,DropDownButtonListWidth:null,DropDownButtonListHeight:null,DropDownButtonListButtons:null,DropDownListButtons:null,ClickFunction:null,ControlBgStartColor:null,ControlBgEndColor:null,HasControlBorder:null,ControlBorderColor:null,ControlBorderThickness:null,ButtonImage:null,DropDownTextBoxBgImage:null,DropDownListBgImage:null};function InitializeRibbonControl(J,I,a,c,P,O,N,h,L,H,G,d,j,A,s,p,f,q,D,B,M,v,m,u,i,g,z,o,n,r,C,t,e,E,F,b,k,w,l){var K=new RibbonControl();K.X=J;K.Y=I;K.Width=a;K.Height=c;K.Type=P;K.DropDownButtonX=O;K.DropDownButtonY=N;K.DropDownButtonWidth=h;K.DropDownButtonHeight=L;K.DropDownListX=H;K.DropDownListY=G;K.DropDownListWidth=d;K.DropDownListHeight=j;K.HasButtonImage=A;K.ButtonImageUrl=s;K.HasDropDownTextBoxBgImage=p;K.DropDownTextBoxBgImageUrl=f;K.HasDropDownListBgImage=q;K.DropDownListBgImageUrl=D;K.HasLabel=B;K.LabelText=M;K.LabelTextFontColor=v;K.LabelTextFontHeight=m;K.LabelTextFontString=u;K.LabelX=i;K.LabelY=g;K.ButtonScrollableListId=z,K.DropDownButtonListX=o;K.DropDownButtonListY=n;K.DropDownButtonListWidth=r;K.DropDownButtonListHeight=C;K.DropDownButtonListButtons=t;K.DropDownListButtons=e,K.ClickFunction=E;K.ControlBgStartColor=F;K.ControlBgEndColor=b;K.HasControlBorder=k;K.ControlBorderColor=w;K.ControlBorderThickness=l;return K}function CCLRibbon(){}CCLRibbon.prototype={CanvasID:null,ControlNameID:null,X:null,Y:null,Width:null,Height:null,Depth:null,Controls:null,HasHoverColor:null,HoverColor:null,HoverColorAlpha:null,TabStopIndex:null,BgColorStart:null,BgColorEnd:null,ScrollableLists:null,Initialize:function(){return createRibbon(this.CanvasID,this.ControlNameID,this.X,this.Y,this.Width,this.Depth,this.Height,this.Controls,this.TabStopIndex,this.BgColorStart,this.BgColorEnd,this.ScrollableLists)}};function createRibbon(a,e,o,n,b,q,h,p,l,k,j,c){var m=createWindow(a,o,n,b,q,h,null,"Ribbon",e,null,l);ribbonPropsArray.push({CanvasID:a,X:o,Y:n,Width:b,Height:q,Controls:p,ShowDropDownListControlsIndex:-1,BgColorStart:k,BgColorEnd:j,ScrollableLists:c});for(var g=0;g<p.length;g++){if(control.HasButtonImage==1){var f=new Image();image.onload=function(){};f.src=control.ButtonImageUrl;control.ButtonImage=f}if(control.HasDropDownTextBoxBgImage==1){var d=new Image();d.onload=function(){};d.src=control.DropDownTextBoxBgImageUrl;control.DropDownTextBoxBgImage=d}if(control.HasDropDownListBgImage==1){var r=new Image();r.onload=function(){};r.src=control.DropDownListBgImageUrl;control.DropDownListBgImage=r}}registerWindowDrawFunction(m,function(s,x){var w=getRibbonProps(s,x);var A=getCtx(s);if(w.BgColorStart!=null&&w.BgColorEnd!=null){var z=A.createLinearGradient(w.X,w.Y,w.X+w.Width,w.Y);z.addColorStop(w.BgColorStart);z.addColorStop(w.BgColorEnd);A.fillStyle=z;A.beginPath();A.rect(w.X,w.Y,w.X+w.Width,w.Y+w.Height);A.fill()}var y=new RibbonControlTypes();for(var u=0;u<w.Controls.length;u++){var t=w.Controls[u];if(t.Type==y.Button){if(t.ControlBgStartColor!=null&&t.ControlBgEndColor!=null){var v=A.createLinearGradient(w.X+t.X,w.Y+t.Y,w.X+t.X+t.Width,w.Y+t.Y);A.fillStyle=v;A.beginPath();A.rect(w.X+t.X,w.Y+t.Y,w.X+t.X+t.Width,w.Y+t.Y+t.Height);A.fill()}if(t.HasButtonImage==1&&t.ButtonImageUrl!=null&&t.ButtonImage!=null){A.drawImage(t.ButtonImage,w.X+t.X,w.Y+t.Y)}if(t.HasControlBorder==1){A.strokeStyle=t.ControlBorderColor!=null?t.ControlBorderColor:"#000000";A.rect(w.X+t.X,w.Y+t.Y,w.X+t.X+t.Width,w.Y+t.Y+t.Height);A.stroke()}}}},a)}function invokeServerSideFunction(g,f,e,a,b,h){var d="[FunctionName]"+f+"[/FunctionName][CanvasID]"+e+"[/CanvasID][WindowID]"+a.toString()+"[/WindowID][Vars]"+getEncodedVariables()+"[/Vars][SessionID]"+sessionID+"[/SessionID][Params]"+encodeParams(h)+"[/Params]";var c;if(window.XMLHttpRequest){c=new XMLHttpRequest()}else{c=new ActiveXObject("Microsoft.XMLHTTP")}c.onreadystatechange=function(){if(c.readyState==4&&c.status==200&&c.responseText&&c.responseText.length>0){suspendDraw=1;var i=UnWrapVars(c.responseText);suspendDraw=0;if(b){b(i)}}};c.open("POST",g,true);if(navigator.userAgent.toLowerCase().indexOf("msie")==-1){c.overrideMimeType("application/octet-stream")}c.setRequestHeader("Content-Type","text/xml");c.setRequestHeader("Cache-Control","max-age=0");c.send(d)}function encodeParams(d){var c="[Array]";if(d){for(var b=0;b<d.length;b++){if(typeof d[b]==="string"||typeof d[b]==="number"){c+="[i]"+encodeAllBrackets(d[b].toString())+"[/i]"}else{if(d[b] instanceof Array){c+="[Array]";for(var a=0;a<d[b].length;a++){c+=encodeParams(d[b][a])}c+="[/Array]"}}}}return c+"[/Array]"}var imageControlBackupImageUrls=new Array();var textBoxBackupImageUrls=new Array();var imageSliderBackupImageUrls=new Array();var imageFaderBackupImageUrls=new Array();var wordProcessorBackupImageUrls=new Array();var treeviewBackupImageUrls=new Array();function getEncodedVariables(){var b="[Windows]";for(var a=0;a<windows.length;a++){b+="[i]"+stringEncodeObject(windows[a])+"[/i]"}b+="[/Windows][labelPropsArray]";for(var a=0;a<labelPropsArray.length;a++){b+="[i]"+stringEncodeObject(labelPropsArray[a])+"[/i]"}b+="[/labelPropsArray][buttonPropsArray]";for(var a=0;a<buttonPropsArray.length;a++){b+="[i]"+stringEncodeObject(buttonPropsArray[a])+"[/i]"}b+="[/buttonPropsArray][scrollBarPropsArray]";for(var a=0;a<scrollBarPropsArray.length;a++){b+="[i]"+stringEncodeObject(scrollBarPropsArray[a])+"[/i]"}b+="[/scrollBarPropsArray][gridPropsArray]";for(var a=0;a<gridPropsArray.length;a++){b+="[i]"+stringEncodeObject(gridPropsArray[a])+"[/i]"}b+="[/gridPropsArray][comboboxPropsArray]";for(var a=0;a<comboboxPropsArray.length;a++){b+="[i]"+stringEncodeObject(comboboxPropsArray[a])+"[/i]"}b+="[/comboboxPropsArray][checkboxPropsArray]";for(var a=0;a<checkboxPropsArray.length;a++){b+="[i]"+stringEncodeObject(checkboxPropsArray[a])+"[/i]"}b+="[/checkboxPropsArray][radiobuttonPropsArray]";for(var a=0;a<radiobuttonPropsArray.length;a++){b+="[i]"+stringEncodeObject(radiobuttonPropsArray[a])+"[/i]"}b+="[/radiobuttonPropsArray][imageControlPropsArray]";for(var a=0;a<imageControlPropsArray.length;a++){b+="[i]"+stringEncodeObject(imageControlPropsArray[a])+"[/i]"}b+="[/imageControlPropsArray][treeViewPropsArray]";for(var a=0;a<treeViewPropsArray.length;a++){b+="[i]"+stringEncodeObject(treeViewPropsArray[a])+"[/i]"}b+="[/treeViewPropsArray][calenderPropsArray]";for(var a=0;a<calenderPropsArray.length;a++){b+="[i]"+stringEncodeObject(calenderPropsArray[a])+"[/i]"}b+="[/calenderPropsArray][progressBarPropsArray]";for(var a=0;a<progressBarPropsArray.length;a++){b+="[i]"+stringEncodeObject(progressBarPropsArray[a])+"[/i]"}b+="[/progressBarPropsArray][sliderPropsArray]";for(var a=0;a<sliderPropsArray.length;a++){b+="[i]"+stringEncodeObject(sliderPropsArray[a])+"[/i]"}b+="[/sliderPropsArray][datePickerPropsArray]";for(var a=0;a<datePickerPropsArray.length;a++){b+="[i]"+stringEncodeObject(datePickerPropsArray[a])+"[/i]"}b+="[/datePickerPropsArray][panelPropsArray]";for(var a=0;a<panelPropsArray.length;a++){b+="[i]"+stringEncodeObject(panelPropsArray[a])+"[/i]"}b+="[/panelPropsArray][barGraphsPropsArray]";for(var a=0;a<barGraphsPropsArray.length;a++){b+="[i]"+stringEncodeObject(barGraphsPropsArray[a])+"[/i]"}b+="[/barGraphsPropsArray][pieChartsPropsArray]";for(var a=0;a<pieChartsPropsArray.length;a++){b+="[i]"+stringEncodeObject(pieChartsPropsArray[a])+"[/i]"}b+="[/pieChartsPropsArray][lineGraphsPropsArray]";for(var a=0;a<lineGraphsPropsArray.length;a++){b+="[i]"+stringEncodeObject(lineGraphsPropsArray[a])+"[/i]"}b+="[/lineGraphsPropsArray][gaugeChartPropsArray]";for(var a=0;a<gaugeChartPropsArray.length;a++){b+="[i]"+stringEncodeObject(gaugeChartPropsArray[a])+"[/i]"}b+="[/gaugeChartPropsArray][radarGraphPropsArray]";for(var a=0;a<radarGraphPropsArray.length;a++){b+="[i]"+stringEncodeObject(radarGraphPropsArray[a])+"[/i]"}b+="[/radarGraphPropsArray][lineAreaGraphPropsArray]";for(var a=0;a<lineAreaGraphPropsArray.length;a++){b+="[i]"+stringEncodeObject(lineAreaGraphPropsArray[a])+"[/i]"}b+="[/lineAreaGraphPropsArray][candlesticksGraphPropsArray]";for(var a=0;a<candlesticksGraphPropsArray.length;a++){b+="[i]"+stringEncodeObject(candlesticksGraphPropsArray[a])+"[/i]"}b+="[/candlesticksGraphPropsArray][doughnutChartPropsArray]";for(var a=0;a<doughnutChartPropsArray.length;a++){b+="[i]"+stringEncodeObject(doughnutChartPropsArray[a])+"[/i]"}b+="[/doughnutChartPropsArray][barsMixedWithLabledLineGraphsPropsArray]";for(var a=0;a<barsMixedWithLabledLineGraphsPropsArray.length;a++){b+="[i]"+stringEncodeObject(barsMixedWithLabledLineGraphsPropsArray[a])+"[/i]"}b+="[/barsMixedWithLabledLineGraphsPropsArray][stackedBarGraphPropsArray]";for(var a=0;a<stackedBarGraphPropsArray.length;a++){b+="[i]"+stringEncodeObject(stackedBarGraphPropsArray[a])+"[/i]"}b+="[/stackedBarGraphPropsArray][tabPropsArray]";for(var a=0;a<tabPropsArray.length;a++){b+="[i]"+stringEncodeObject(tabPropsArray[a])+"[/i]"}b+="[/tabPropsArray][imageMapPropsArray]";for(var a=0;a<imageMapPropsArray.length;a++){b+="[i]"+stringEncodeObject(imageMapPropsArray[a])+"[/i]"}b+="[/imageMapPropsArray][menuBarPropsArray]";for(var a=0;a<menuBarPropsArray.length;a++){b+="[i]"+stringEncodeObject(menuBarPropsArray[a])+"[/i]"}b+="[/menuBarPropsArray][subMenuBarPropsArray]";for(var a=0;a<subMenuBarPropsArray.length;a++){b+="[i]"+stringEncodeObject(subMenuBarPropsArray[a])+"[/i]"}b+="[/subMenuBarPropsArray][textBoxPropsArray]";for(var a=0;a<textBoxPropsArray.length;a++){b+="[i]"+stringEncodeObject(textBoxPropsArray[a])+"[/i]"}b+="[/textBoxPropsArray][imageFaderPropsArray]";for(var a=0;a<imageFaderPropsArray.length;a++){b+="[i]"+stringEncodeObject(imageFaderPropsArray[a])+"[/i]"}b+="[/imageFaderPropsArray][imageSliderPropsArray]";for(var a=0;a<imageSliderPropsArray.length;a++){b+="[i]"+stringEncodeObject(imageSliderPropsArray[a])+"[/i]"}b+="[/imageSliderPropsArray][multiLineLabelPropsArray]";for(var a=0;a<multiLineLabelPropsArray.length;a++){b+="[i]"+stringEncodeObject(multiLineLabelPropsArray[a])+"[/i]"}b+="[/multiLineLabelPropsArray][wordProcessorPropsArray]";for(var a=0;a<wordProcessorPropsArray.length;a++){b+="[i]"+stringEncodeObject(wordProcessorPropsArray[a])+"[/i]"}b+="[/wordProcessorPropsArray][virtualKeyboardPropsArray]";for(var a=0;a<virtualKeyboardPropsArray.length;a++){b+="[i]"+stringEncodeObject(virtualKeyboardPropsArray[a])+"[/i]"}b+="[/virtualKeyboardPropsArray][splitterPropsArray]";for(var a=0;a<splitterPropsArray.length;a++){b+="[i]"+stringEncodeObject(splitterPropsArray[a])+"[/i]"}b+="[/splitterPropsArray][boundaryFillableMapPropsArray]";for(var a=0;a<boundaryFillableMapPropsArray.length;a++){b+="[i]"+stringEncodeObject(boundaryFillableMapPropsArray[a])+"[/i]"}b+="[/boundaryFillableMapPropsArray][simpleXMLViewerPropsArray]";for(var a=0;a<simpleXMLViewerPropsArray.length;a++){b+="[i]"+stringEncodeObject(simpleXMLViewerPropsArray[a])+"[/i]"}b+="[/simpleXMLViewerPropsArray][votingPropsArray]";for(var a=0;a<votingPropsArray.length;a++){b+="[i]"+stringEncodeObject(votingPropsArray[a])+"[/i]"}b+="[/votingPropsArray]";return b}var savedImagesOnPostback=new Array();var currentSavedImagesOnPostbackWindowID;var currentSavedImagesOnPostbackCanvasID;var savedFunctionsOnPostback=new Array();var savedDrawingCanvas=new Array();var savedDrawingCanvasCtx=new Array();var savedImageArrayOnPostback=new Array();var savedArrayFunctionsOnPostback=new Array();function stringEncodeObject(d){var c="";var e="";for(var a in d){if(d[a]!=null){if(d[a]&&typeof d[a]=="function"){savedFunctionsOnPostback.push({CanvasID:currentSavedImagesOnPostbackCanvasID,WindowID:currentSavedImagesOnPostbackWindowID,FunctionValue:d[a],PropertyName:a});continue}if(typeof d[a]==="string"||typeof d[a]==="number"){if(a=="WindowID"){currentSavedImagesOnPostbackWindowID=d[a].toString()}if(a=="CanvasID"){currentSavedImagesOnPostbackCanvasID=d[a].toString()}e+="["+a+"]"+encodeAllBrackets(d[a].toString())+"[/"+a+"]"}else{if(d[a] instanceof Array){e+="["+a+"][Array]";for(var b=0;b<d[a].length;b++){if(d[a]!=null){if(d[a][b]&&typeof d[a][b]=="function"){savedArrayFunctionsOnPostback.push({CanvasID:currentSavedImagesOnPostbackCanvasID,WindowID:currentSavedImagesOnPostbackWindowID,Index:b.toString(),Function:d[a][b]});continue}if(typeof d[a][b]==="string"||typeof d[a][b]==="number"){e+="[i]"+encodeAllBrackets(d[a][b].toString())+"[/i]"}else{if(d[a][b] instanceof Array){e+="[i]"+encodeArray(d[a][b],(c&&c.length>0?c+","+b.toString():b.toString()))+"[/i]"}else{if(typeof d[a]==="object"){e+="[i]"+stringEncodeValueObject(d[a][b])+"[/i]"}}}}else{e+="[i][/i]"}}e+="[/Array][/"+a+"]"}else{if(typeof d[a]==="object"){e+="["+a+"]"+stringEncodeValueObject(d[a])+"[/"+a+"]"}}}}}return e}function encodeAllBrackets(a){a=a.replace(/&/g,"&");a=a.replace(/</g,"<");a=a.replace(/\[/g,"&lb;");a=a.replace(/\]/g,"&rb;");return a.replace(/>/g,">")}function encodeArray(a,c){var d="[Array]";for(var b=0;b<a.length;b++){if(a[b]!=null){if(a[b]&&typeof a[b]=="function"){savedArrayFunctionsOnPostback.push({CanvasID:currentSavedImagesOnPostbackCanvasID,WindowID:currentSavedImagesOnPostbackWindowID,Index:(c&&c.length>0?c+","+b.toString():b.toString()),Function:a[b]});continue}if(typeof a[b]==="string"||typeof a[b]==="number"){d+="[i]"+encodeAllBrackets(a[b].toString())+"[/i]"}else{if(a[b] instanceof Array){d+="[i]"+encodeArray(a[b],(c&&c.length>0?c+","+b.toString():b.toString()))+"[/i]"}else{if(typeof a[b]==="object"){d+="[i]"+stringEncodeValueObject(a[b])+"[/i]"}}}}else{d+="[i][/i]"}}return d+"[/Array]"}function stringEncodeValueObject(b){var c="[ObjectArray]";for(var a in b){if(b[a]!=null&&a!="TreeviewNodeInstancesParentNode"&&a!="TreeviewNodeInstancesRootNodes"&&a!="TreeviewClickLabelExtentsNode"){if(b[a] instanceof Array&&b[a].length>0){c+="["+a+"]"+encodeArray(b[a])+"[/"+a+"]"}else{if(typeof b[a]==="string"||typeof b[a]==="number"){c+="["+a+"]"+encodeAllBrackets(b[a].toString())+"[/"+a+"]"}else{if(typeof b[a]==="object"&&!b[a] instanceof Array){c+="["+a+"]"+stringEncodeValueObject(b[a])+"[/"+a+"]"}}}}else{if(b[a]==null){c+="["+a+"][/"+a+"]"}}}return c+"[/ObjectArray]"}function rectifyNullFunctions(a){if(a.length==6){a.splice(5,0,null)}if(a.length>=7&&a[6]!=null){for(var b=0;b<a[6].length;b++){if(typeof a[6][b][5]!="function"&&typeof a[6][b][5]=="object"){a[6][b].splice(5,0,null);rectifyNullFunctions(a[6][b][6])}}}else{if(a.length==6){a.push(null)}}}function UnWrapVars(data){var xmlDoc=null;data=data.replace(/\[/g,"<");data=data.replace(/\]/g,">");data=data.replace(/[&]lb[;]/g,"[");data=data.replace(/[&]rb[;]/g,"]");if(window.DOMParser){var parser=new DOMParser();xmlDoc=parser.parseFromString(data,"text/xml");for(var i=0;i<xmlDoc.firstChild.childNodes[0].childNodes.length;i++){eval(xmlDoc.firstChild.childNodes[0].childNodes[i].nodeName+" = new Array();");for(var x=0;x<xmlDoc.firstChild.childNodes[0].childNodes[i].childNodes.length;x++){var obj=new Object();recurseFillVars(xmlDoc.firstChild.childNodes[0].childNodes[i].childNodes[x],obj);eval(xmlDoc.firstChild.childNodes[0].childNodes[i].nodeName+".push(obj);")}}}for(var i=0;i<savedArrayFunctionsOnPostback.length;i++){for(var j=0;j<menuBarPropsArray.length;j++){if(savedArrayFunctionsOnPostback[i].CanvasID==menuBarPropsArray[j].CanvasID&&savedArrayFunctionsOnPostback[i].WindowID==menuBarPropsArray[j].WindowID){var arrayIndexes=savedArrayFunctionsOnPostback[i].Index.split(",");var dataptr=menuBarPropsArray[j].Data;for(var x=0;x<arrayIndexes.length-1;x++){dataptr=dataptr[dataptr.length-1>arrayIndexes[x]?arrayIndexes[x]:dataptr.length-1]}dataptr.splice(arrayIndexes[arrayIndexes.length-1],0,savedArrayFunctionsOnPostback[i].Function)}}}for(var j=0;j<menuBarPropsArray.length;j++){for(var k=0;k<menuBarPropsArray[j].Data.length;k++){rectifyNullFunctions(menuBarPropsArray[j].Data[k])}}for(var i=0;i<subMenuBarPropsArray.length;i++){for(var j=0;j<menuBarPropsArray.length;j++){for(var c=0;c<menuBarPropsArray[j].ChildMenuWindowIDs.length;c++){if(subMenuBarPropsArray[i].WindowID==menuBarPropsArray[j].ChildMenuWindowIDs[c]&&subMenuBarPropsArray[i].CanvasID==menuBarPropsArray[j].CanvasID){var x=0;for(var k=0;k<menuBarPropsArray[j].Data.length;k++){if(menuBarPropsArray[j].Data[k][6]!=null){if(x==c){subMenuBarPropsArray[i].Data=menuBarPropsArray[j].Data[k][6]}x++}}}}}}for(var i=0;i<menuBarPropsArray.length;i++){for(var c=0;menuBarPropsArray[i].ChildMenuWindowIDs&&c<menuBarPropsArray[i].ChildMenuWindowIDs.length;c++){for(var k=0;k<subMenuBarPropsArray.length;k++){if(subMenuBarPropsArray[k].CanvasID==menuBarPropsArray[i].CanvasID&&subMenuBarPropsArray[k].WindowID==menuBarPropsArray[i].ChildMenuWindowIDs[c]){for(var m=0;m<subMenuBarPropsArray[k].ChildMenuWindowIDs.length;m++){for(var j=0;j<subMenuBarPropsArray.length;j++){if(subMenuBarPropsArray[j].CanvasID==subMenuBarPropsArray[k].CanvasID&&subMenuBarPropsArray[j].WindowID==subMenuBarPropsArray[k].ChildMenuWindowIDs[m]){var x=0;for(var u=0;u<subMenuBarPropsArray[k].Data.length;u++){if(subMenuBarPropsArray[k].Data[u][6]!=null){if(x==m){subMenuBarPropsArray[j].Data=subMenuBarPropsArray[k].Data[u][6]}x++}}}}}}}}}for(var i=0;i<savedFunctionsOnPostback.length;i++){var o=getLabelProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getButtonProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getScrollBarProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getGridProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getComboboxPropsByTextAreaWindowId(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getcheckboxProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getRadioButtonProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getImageControlProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getTreeViewProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getCalenderProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getSliderProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getDatePickerPropsByTextBoxAreaWindowID(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getPanelProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getBarGraphProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getPieChartProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getLineGraphProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getGaugeChartProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getRadarGraphProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getLineAreaGraphProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getCandlesticksGraphProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getDoughnutChartProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getBarsMixedWithLabledLineGraphProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getstackedBarGraphProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getTabProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getImageMapProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getMenuBarProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getSubMenuBarProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getTextBoxProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getVirtualKeyboardProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getSplitterProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}var o=getSimpleXMLViewerProps(savedFunctionsOnPostback[i].CanvasID,savedFunctionsOnPostback[i].WindowID);if(setSavedFunctionOnPostback(o,savedFunctionsOnPostback,i)==1){continue}}return getParameters(xmlDoc.firstChild.childNodes[1].childNodes[0].childNodes)}function getParameters(b){var a=new Array();for(var c=0;c<b.length;c++){if(b[c].nodeName=="Array"){a.push(getParameters(b[c].childNodes))}else{a.push(correctValueTypes(b[c].childNodes.length>0?b[c].childNodes[0].nodeValue:b[c].nodeValue))}}return a}function setSavedFunctionOnPostback(c,a,b){if(c!=null){c[a[b].PropertyName]=a[b].FunctionValue;return 1}return 0}function recurseFillVars(e,f){for(var d=0;d<e.childNodes.length;d++){if(e.childNodes[d].childNodes.length>0&&e.childNodes[d].childNodes[0].nodeName=="Array"){var b=new Array();f[e.childNodes[d].nodeName]=b;for(var a=0;a<e.childNodes[d].childNodes[0].childNodes.length;a++){if(e.childNodes[d].childNodes[0].childNodes[a].childNodes.length>0&&e.childNodes[d].childNodes[0].childNodes[a].childNodes[0].nodeName=="Array"){var c=new Array();recurseFillArray(c,e.childNodes[d].childNodes[0].childNodes[a].childNodes[0]);b.push(c)}else{if(e.childNodes[d].childNodes[0].childNodes[a].childNodes.length>0&&e.childNodes[d].childNodes[0].childNodes[a].childNodes[0].nodeName=="ObjectArray"){b.push(FillObjectArrayValues(e.childNodes[d].childNodes[0].childNodes[a]))}else{b.push(correctValueTypes(e.childNodes[d].childNodes[0].childNodes[a].childNodes.length>0?e.childNodes[d].childNodes[0].childNodes[a].childNodes[0].nodeValue:e.childNodes[d].childNodes[0].childNodes[a].nodeValue))}}}}else{if(e.childNodes[d].childNodes.length>0&&e.childNodes[d].childNodes[0].nodeName=="ObjectArray"){f[e.childNodes[d].nodeName]=FillObjectArrayValues(e.childNodes[d].childNodes[0])}else{f[e.childNodes[d].nodeName]=correctValueTypes(e.childNodes[d].childNodes.length>0?e.childNodes[d].childNodes[0].nodeValue:e.childNodes[d].nodeValue)}}}}function FillObjectArrayValues(d){var c={};for(var e=0;e<d.childNodes.length;e++){if(d.childNodes[e].childNodes.length>0&&d.childNodes[e].childNodes[0].nodeValue=="Array"){var a=new Array();for(var b=0;b<d.childNodes[e].childNodes[0].childNodes.length;b++){recurseFillArray(a,d.childNodes[e].childNodes[0].childNodes[b])}c[d.childNodes[e].nodeName]=a}else{if(d.childNodes[e].childNodes.length>0&&d.childNodes[e].childNodes[0].nodeValue=="ObjectArray"){c[d.childNodes[e].nodeName]=FillObjectArrayValues(d.childNodes[e].childNodes[0])}else{c[d.childNodes[e].nodeName]=correctValueTypes(d.childNodes[e].childNodes.length>0?d.childNodes[e].childNodes[0].nodeValue:d.childNodes[e].nodeValue)}}}return c}function correctValueTypes(a){if(!a){return null}if(typeof a=="string"&&(parseInt(a)>=0||parseInt(a)<0)&&parseInt(a).toString()==a){return parseInt(a)}else{if(typeof a=="string"&&(parseFloat(a)>=0||parseFloat(a)<0)&&parseFloat(a).toString()==a){return parseFloat(a)}else{if(typeof a=="string"){return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}}}return a}function recurseFillArray(b,e){for(var d=0;d<e.childNodes.length;d++){if(e.childNodes[d].childNodes.length>0&&e.childNodes[d].nodeName=="Array"){var c=new Array();for(var a=0;a<e.childNodes[d].childNodes.length;a++){recurseFillArray(c,e.childNodes[d].childNodes[a])}b.push(c)}else{if(e.childNodes[d].childNodes.length>0&&e.childNodes[d].childNodes[0].nodeName=="Array"){var c=new Array();for(var a=0;a<e.childNodes[d].childNodes[0].childNodes.length;a++){recurseFillArray(c,e.childNodes[d].childNodes[0].childNodes[a])}b.push(c)}else{if(e.childNodes[d].childNodes.length>0&&e.childNodes[d].nodeName=="ObjectArray"){b.push(FillObjectArrayValues(e.childNodes[d]))}else{b.push(correctValueTypes(e.childNodes[d].childNodes.length>0?e.childNodes[d].childNodes[0].nodeValue:e.childNodes[d].nodeValue))}}}}};