/* Build $BuildVersion$ */
Qva={};Qva.agent=navigator.userAgent.toLowerCase();IS_IPAD=Qva.agent.indexOf("ipad")!==-1;IS_CHROME=Qva.agent.indexOf("chrome")!=-1&&Qva.agent.indexOf("webkit")!=-1;IS_SAFARI=!IS_CHROME&&(Qva.agent.indexOf("safari")!=-1||Qva.agent.indexOf("konqueror")!=-1);IS_WEBKIT=IS_CHROME||IS_SAFARI;IS_OPERA=Qva.agent.indexOf("opera")!=-1;IS_GECKO=!IS_WEBKIT&&Qva.agent.indexOf("gecko")!=-1;if(IS_GECKO){GECKO_VERSION=parseFloat(Qva.agent.substr(Qva.agent.search("firefox")+8,3))}IS_MAC=Qva.agent.indexOf("macintosh")!=-1;IS_IE=Qva.agent.indexOf("msie")!=-1;IE_DOCMODE=document.documentMode;if(IS_IE){IE_VERSION=parseFloat(Qva.agent.substr(Qva.agent.search("msie")+4,4));if(typeof IE_DOCMODE=="undefined"){IE_DOCMODE=IE_VERSION}IS_IE64BIT=Qva.agent.indexOf("x64")!=-1;IS_IE6_OR_IE7=(IE_VERSION==7&&IE_DOCMODE!=8&&IE_DOCMODE!=9)||IE_VERSION==6}else{IS_IE6_OR_IE7=false}IS_ANDROID=Qva.agent.indexOf("android")!==-1;IS_PLAYBOOK=Qva.agent.indexOf("playbook")!==-1;IS_MOBILE=Qva.agent.indexOf("mobile")!=-1;IS_TOUCHENABLED="ontouchstart" in window;delete (Qva.agent);if(!IS_IE){HTMLElement.prototype.__defineGetter__("innerText",function(){return this.textContent});HTMLElement.prototype.__defineSetter__("innerText",function(a){this.textContent=a});Event.prototype.__defineGetter__("srcElement",function(){return(this.target.nodeType==Node.ELEMENT_NODE)?this.target:this.target.parentNode});Event.prototype.__defineGetter__("toElement",function(){return(this.type=="mouseout")?this.relatedTarget:(this.type=="mouseover")?this.srcElement:null})}if(typeof XMLDocument==="undefined"&&typeof Document!=="undefined"){XMLDocument=Document}function clone(b){var d={};for(var a in b){d[a]=b[a]}return d}function purge(f){var b=f.attributes,d=0,a=0,c="";if(b){for(d=b.length-1;d>=0;d--){c=b[d].name;if(typeof f[c]==="function"){f[c]=null}}}if(f.childNodes){for(d=0,a=f.childNodes.length;d<a;++d){purge(f.childNodes[d])}}}Qva.binders={};Qva.GetBinder=function(d,b){var a=Qva.binders[d||""];if(!a&&b){a=new Qva.PageBinding(d);a.View=b;if(Qva.Modal&&!Qva.Modal.instance){new Qva.Modal()}var c=Qva.GetBinder();if(c){a.Autoview=c.Autoview;a.Remote=c.Remote;a.JSON=c.JSON}}return a};Qva.Start=function(){function c(){if(screen.deviceXDPI){return screen.deviceXDPI}var i=document.createElement("div");i.style.cssText="padding: 0px; position: absolute; width: 1in; visibility: hidden;";document.body.appendChild(i);var h=i.offsetWidth;document.body.removeChild(i);return h}Qva.DPI=c();function b(){if(Qva.Scanner&&Qva.Scanner.instance){Qva.Scanner.instance.Start()}for(var i in Qva.binders){Qva.binders[i].Start()}if(document.addEventListener){document.addEventListener("mouseup",function(j){Qva.OnMouseUp(j)},false);document.addEventListener("keyup",function(j){Qva.OnKeyUp(j)},false);document.addEventListener("keypress",function(j){Qva.OnKeyPress(j)},false);try{if(window.parent&&window.parent!=window){window.parent.addEventListener("mouseup",function(j){Qva.OnMouseUp(j)},false);window.parent.addEventListener("keyup",function(j){Qva.OnKeyUp(j)},false);window.parent.addEventListener("keypress",function(j){Qva.OnKeyPress(j)},false)}}catch(h){}}else{document.attachEvent("onmouseup",function(j){Qva.OnMouseUp(j)});document.attachEvent("onkeyup",function(j){Qva.OnKeyUp(j)});document.attachEvent("onkeypress",function(j){Qva.OnKeyPress(j)})}document.onclick=function(k){if(IS_GECKO){if(k.button==2){return}}Qva.HideContextMenu();Qva.ClosePopupInput();Qva.CloseMessagePopup();if(!Qva.LabelClick){return}if(!Qva.DocumentClick){return}for(var l in Qva.binders){var j=Qva.binders[l];if(!j.Enabled){continue}if(j.ToggleObject!=""){continue}j.Set("Document","click","",true)}}}var d=Qva.ExtractProperty("userid",null,true);var f=Qva.ExtractProperty("password",null,true);if(d===""||f===""){Qva.RemainingRetries=parseInt(Qva.ExtractProperty("retry","3"));if(isNaN(Qva.RemainingRetries)){Qva.RemainingRetries=3}var g=true;var a={LabelClick:false,Refresh:function(){if(!g){return}g=false;b()}};Qva.Modal.instance.Show(a,Qva.Remote+"?public=only&name=login.htm&userid="+escape(d))}else{b()}if(typeof(Qva.dropDialog)!=="undefined"){Qva.dropDialog.create(true)}if(Qva.Proxy){Qva.AddProxyToUrlsInStyleSheets()}if(Qva.BodyOnLoadFunctionNames.length>0){window.setTimeout(Qva.ExecuteBodyOnLoadFunctionNames,40)}};Qva.PopupInput=null;Qva.ContextMenu=null;Qva.ContextMenuMgr=null;Qva.ContextDropDown=null;Qva.ContextDialog=null;Qva.MgrWithMouseDown=null;Qva.MgrWithSelectStart=null;Qva.StartoffsetX=0;Qva.StartoffsetY=0;Qva.ActiveObjects=null;Qva.ActiveObjectsCloak=false;Qva.SearchableObject=null;Qva.StandardActions=null;Qva.ActiveElement=null;Qva.LabelClick=true;Qva.QvAjaxZfcPath="/QvAJAXZfc/";Qva.Remote="/QvAJAXZfc/QvsViewClient.aspx";Qva.BodyOnLoadFunctionNames=[];Qva.Proxy=null;Qva.DocumentClick=true;Qva.DragRect={Rects:[],CurrentObject:"",CurrentIndex:0,CurrentBinderId:"",Open:function(c,b,a){c=Qva.StartoffsetX-Qva.SelectClient2OffsetX+Qva.GetScrollLeft();b=Qva.StartoffsetY-Qva.SelectClient2OffsetY+Qva.GetScrollTop();if((this.CurrentObject!=""&&this.CurrentObject!=a.Name)||(this.CurrentBinderId!=""&&this.CurrentBinderId!=a.binderid)){this.Close()}this.CurrentObject=a.Name;this.CurrentBinderId=a.binderid;if(this.Rects.length<=this.CurrentIndex){this.Rects[this.CurrentIndex]=new QvDragRect(document.createElement("div"))}this.Rects[this.CurrentIndex].Open(c,b)},Size:function(b,a){b+=Qva.GetScrollLeft();a+=Qva.GetScrollTop();this.Rects[this.CurrentIndex].Size(b,a)},End:function(g,d,c,b){this.Size(g,d);if(b){this.Rects[this.CurrentIndex].Element.onmousemove=null;this.CurrentIndex++}else{var f=this.Rects[this.CurrentIndex].RectString();var a=Qva.GetObjectBinder(c);a.Set(c.Name,"rect",f,true);this.Close()}},SendSelection:function(b){if(this.CurrentObject!=""&&(b==17||b==224||b==91)){params={};params.rects="";params.rect=[];for(var a=0;a<this.Rects.length;a++){if(this.Rects[a].IsClosed()){break}params.rect[params.rect.length]=this.Rects[a].RectString()}Qva.GetBinder(this.CurrentBinderId).Set(this.CurrentObject,params);this.Close()}},Close:function(){for(var a=0;a<this.Rects.length;a++){this.Rects[a].Close()}this.CurrentObject="";this.CurrentIndex=0}};try{if(window.parent&&window.parent!=window&&window.parent.Qva){Qva.Remote=window.parent.Qva.Remote;Qva.QvAjaxZfcPath=window.parent.Qva.QvAjaxZfcPath;Qva.Proxy=window.parent.Qva.Proxy}}catch(e){}Qva.PageBinding=function(d){this.ID=d||"";this.binderid=this.ID;if(Qva.binders[this.ID]){alert("Need unique binderid");return}Qva.binders[this.ID]=this;this.Translations={};this.ColorDepth=0;this.OnUpdateBegin=null;this.IsUpdating=false;this.HasPendingLoad=false;this.ScrollLeftToRemember=0;this.ScrollTopToRemember=0;this.IsPartialLoad=false;this.CurrentLoadIsPartial=false;this.Enabled=false;this.First=true;this.Managers=new Array();this.Members={};this.UsePost=true;this.JSON=false;this.Body="";this.InitialSets="";this.Mark="";this.Stamp="";this.Slot="";this.RecursiveReadyLevel=0;this.ShowMessage=Qva.DefaultShowMessage;this.OnSessionLost=Qva.DefaultOnSessionLost;this.OnUpdateComplete=Qva.NoAction;this.OnCreateContextMenu=Qva.DefaultOnCreateContextMenu;this.OnCreateContextDropDown=Qva.OnCreateContextDropDown;this.AllowComAgent=true;this.InlineStyle=true;this.TableLimit=5000;this.Ident=null;this.TransientObject="";this.GlobalSearchObject="";this.PendingSearchName="";this.PendingSearchKeyName="";this.ToggleObject="";this.ToggleValues=[];this.DelaySet=false;this.DefaultScope="Document";this.CustomIcons={};this.BookmarksMgr=new Qva.Mgr.bookmarks(this,".Bookmarks");this.SelectionStyleMgr=new Qva.Mgr.selectionsstyle(this,".SelectionStyle");this.BookmarksSubscribers=[];this.UpdateBookMarks=function(){for(var f=0;f<this.BookmarksSubscribers.length;f++){this.BookmarksSubscribers[f].Paint(this.BookmarksMgr)}};this.AsyncPostPaintMgrQueue=[];this.postPaintTimeout=null;try{var a=window.document.implementation;if(a&&a.createDocument&&(!IS_IE||IE_VERSION>=9)){var c=a.createDocument("","",null);if(c.readyState==null){c.readyState=1;c.addEventListener("load",function(){c.readyState=4;if(typeof c.onreadystatechange=="function"){c.onreadystatechange()}},false)}this.Doc=c;this.LeftButton=0}else{if(window.ActiveXObject){this.Doc=new ActiveXObject("Microsoft.XMLDOM");this.LeftButton=IE_DOCMODE>=9?0:1}}}catch(b){}if(this.Doc==null){throw new Error("Your browser does not support XmlDocument objects")}};Qva.PageBinding.prototype.Start=function(){if(Qva.Mgr.search){var f=document.createElement("div");f.style.display="none";new Qva.Mgr.search(this,f,"Document.Search");document.body.insertBefore(f,document.body.firstChild)}this.delay_Send=true;this.IsRemote=true;this.IsHosted=false;try{if(this.View==null&&parent.qva!=null){this.View=parent.qva.View}}catch(g){}if(this.JSON){this.Session=Qva.ExtractProperty("session",this.Session)}this.Ident=Qva.ExtractProperty("ident",this.Ident);this.Userid=Qva.ExtractProperty("userid",this.Userid);this.Xuserid=Qva.ExtractProperty("xuserid",this.Xuserid);this.Password=Qva.ExtractProperty("password",this.Password);this.Xpassword=Qva.ExtractProperty("xpassword",this.Xpassword);this.Bookmark=Qva.ExtractProperty("bookmark",this.Bookmark);this.AlternateUser=Qva.ExtractProperty("user",this.AlternateUser);this.View=Qva.ExtractProperty("application",this.View);var b=parseInt(Qva.ExtractProperty("color_depth",""));if(!isNaN(b)&&0<b&&b<=32){this.ColorDepth=b}this.InitialSelections=Qva.ExtractPropertyArray("select",this.InitialSelections);this.InitialSearch=Qva.ExtractPropertyArray("search",this.InitialSearch);this.Sheet=Qva.ExtractProperty("sheet",this.Sheet);var c=Qva.Remote;try{if(!this.Remote){this.Remote=(parent.qva&&parent.qva.Remote)||c}}catch(d){this.Remote=c}this.Host=Qva.ExtractProperty("host",this.Host);if(Qva.Benchmark){this.Benchmark=new Qva.Benchmark()}this.Url=this.Remote;this.Url+=(this.Url.indexOf("?")==-1)?"?mark=":"&mark=";if(window.ActiveXObject&&(this.Unicorn||window.location.protocol=="file:")){this.TryAltAgent()}var a=""+window.window.navigator.userAgent;var h=parseInt(a.substr(a.indexOf("MSIE")+5,3));this.AutoViewAppend(null,this.DefaultScope,"ie6"+(a.indexOf("MSIE")!=-1&&h<7));this.Ticket=Qva.ExtractPropertyForDocument("ticket",this.View,this.Ticket);this.Slot=Qva.ExtractProperty("slot",this.Slot,true);var j=Qva.ExtractProperty("anonymous",this.Ticket,true)!=null;if(!j&&this.AuthenticateUrl){var i=this;this.LoadAuthenticate(function(k,l){if(k){i.LoadBegin()}else{alert(l);i.LoadBegin()}})}else{this.LoadBegin()}};Qva.PageBinding.prototype.LoadAuthenticate=function(d){var b;if(window.XMLHttpRequest){b=new XMLHttpRequest()}else{b=new ActiveXObject("MSXML2.XMLHTTP")}b.onreadystatechange=function(){if(b.readyState==4){if(b.status==200){d(true)}else{d(false,"Failed to authenticate")}}};var a=Qva.FixUrl(this.AuthenticateUrl,"keep","");a=Qva.AddProxyIfAny(a);b.open("GET",a,true);try{b.send(null)}catch(c){d(false,"Error sending")}};Qva.PageBinding.prototype.QueuePostPaintMessage=function(b){for(var a=0;a<this.AsyncPostPaintMgrQueue.length;++a){if(this.AsyncPostPaintMgrQueue[a]==b){return}}var c=this;this.AsyncPostPaintMgrQueue.push(b);if(!this.postPaintTimeout){this.postPaintTimeout=window.setTimeout(function(){c.avqAsyncPostPaint()},0)}};Qva.PageBinding.prototype.avqAsyncPostPaint=function(){this.postPaintTimeout=null;if(this.AsyncPostPaintMgrQueue.length==0){alert("AsyncPostPaintMgrQueue.length == 0");return}var a=this.AsyncPostPaintMgrQueue;this.AsyncPostPaintMgrQueue=[];for(var b=0;b<a.length;++b){a[b].PostPaint()}if(this.AsyncPostPaintMgrQueue.length==0&&!this.IsUpdating&&!this.OnUpdateCompleteTriggered){this.OnUpdateCompleteTriggered=true;this.OnUpdateComplete(true)}};Qva.MgrGetName=function(a){while(a){if(a.AvqMgr!=null){return a.AvqMgr.Name}a=a.parentNode}return""};function ctrlKeyPressed(a){return a.ctrlKey||a.metaKey||a.keyCode==224||a.keyCode==91}Qva.Clicks={List:[],CurrentObject:"",CurrentBinderId:"",Click:function(f,d){var i="";if((this.CurrentObject!=""&&this.CurrentObject!=d.Name)||(this.CurrentBinderId!=""&&this.CurrentBinderId!=d.binderid)){this.Close()}var a=0;var h=0;if(!f){a=window.event.offsetX;h=window.event.offsetY}else{var c=Qva.GetOffsets(f);a=c.offsetX;h=c.offsetY}i+=""+a+":"+h;var b=Qva.GetObjectBinder(d);var g=b.GetImageSize(d);i+=":"+g.width+":"+g.height;if(ctrlKeyPressed(f)){this.CurrentObject=d.Name;this.CurrentBinderId=d.binderid;this.List[this.List.length]=i}else{b.Set(d.Name,"click",i,true)}},SendSelection:function(b){if(this.CurrentObject!=""&&(b==17||b==224||b==91)){params={};params.clicks="";params.click=[];for(var a=0;a<this.List.length;a++){params.click[params.click.length]=this.List[a]}Qva.GetBinder(this.CurrentBinderId).Set(this.CurrentObject,params);this.Close()}},Close:function(){this.List.length=0;this.CurrentObject="";this.CurrentBinderId="";this.CurrentIndex=0}};Qva.OnMouseUp=function(a){var c=Qva.MgrWithMouseDown;Qva.MgrWithMouseDown=null;if(!a){a=window.event}if(Qva.MgrWithSelectStart!=null){var b=Qva.MgrWithSelectStart;Qva.MgrWithSelectStart=null;var f=a.clientX;var d=a.clientY;b.SelectEnd(f,d,ctrlKeyPressed(a))}else{if(c!=null){Qva.Clicks.Click(a,c)}}};Qva.OnKeyPress=function(d){if(!d){d=window.event}if(IS_MAC&&Qva.ContextMenu!=null&&Qva.ContextMenu.style.display==""){return}Qva.HideContextMenu(Qva.ActiveObjectsCloak);if(Qva.PopupInput!=null){return}if(!Qva.LabelClick){return}var c=d.target;if(!c){c=d.srcElement}if(c.tagName=="INPUT"&&c.type=="text"){return}if(c.tagName=="TEXTAREA"){return}if(c.tagName=="SELECT"){return}if(Qva.SearchableObject){var b=document.getElementById(Qva.SearchableObject);if(b&&b.AvqMgr&&b.AvqMgr.Searchable){var a=b.AvqMgr.PageBinder;var f=String.fromCharCode(d.charCode||d.keyCode);if(/[\x00-\x1F]/.test(f)){return}Qva.InitSearch=(Qva.InitSearch||"")+f;a.Set(Qva.SearchableObject+".SEARCH","action","",true)}}};Qva.OnKeyUp=function(a){if(IS_MAC&&Qva.ContextMenu!=null&&Qva.ContextMenu.style.display==""){return}Qva.HideContextMenu(Qva.ActiveObjectsCloak);if(Qva.PopupInput!=null){return}if(!Qva.LabelClick){return}if(!a){a=window.event}if(Qva.StandardActions){if(Qva.StandardActions.HandleKeyUp(a)){return}}if(!Qva.ActiveObjectsCloak&&Qva.ActiveObjects&&Qva.ActiveObjects.length==1){var d=document.getElementById(Qva.ActiveObjects[0]);if(d&&d.AvqMgr){if(d.AvqMgr.HandleKeyUp(a)){return}}}var b=a.target;if(!b){b=a.srcElement}if(a.keyCode==13&&b.tagName=="INPUT"&&b.onchange){b.onchange()}if(b.tagName=="INPUT"&&b.type=="text"){return}if(b.tagName=="TEXTAREA"){return}if(b.tagName=="SELECT"){return}if(Qva.SearchableObject){var d=document.getElementById(Qva.SearchableObject);if(d&&d.AvqMgr){var k=d.AvqMgr.PageBinder;if(k.ToggleObject!=""&&(a.keyCode==17||a.keyCode==224||a.keyCode==91)){var f=k.ToggleObject;var c={};c.select="";for(var j=0;j<k.ToggleValues.length;j++){c.select+=k.ToggleValues[j];if(j!=(k.ToggleValues.length-1)){c.select+=","}}c.toggle="true";if(k.TogglePhase!=null){c.phase=k.TogglePhase}k.TogglePhase=null;k.ToggleValues.length=0;k.ToggleObject="";var g=k.TransientObject;if(g==f){k.CloseTransient()}k.Set(f,c)}else{if(d.AvqMgr.Searchable){if(a.keyCode>=32&&!ctrlKeyPressed(a)){var i=a.keyCode;if(i>=33&&i<=40){if(i!=37&&i!=39){var h;switch(i){case 33:h="pgup";break;case 34:h="pgdn";break;case 35:h="end";break;case 36:h="home";break;case 38:h="up";break;case 40:h="down";break}k.Set(Qva.SearchableObject,"key",h,true)}}}}}}}Qva.DragRect.SendSelection(a.keyCode);Qva.Clicks.SendSelection(a.keyCode)};Qva.SetContextMenu=function(a,b){a.oncontextmenu=b;if(IS_GECKO&&IS_MAC){a.onmousedown=function(c){if(c.button==2&&!ctrlKeyPressed(c)){return b.call(this,c)}}}};Qva.Search=function(d,c,b){if(d.SearchName!=""){var a=d.PageBinder||Qva.GetBinder(d.binderid);if(a.GetEnabled()){a.Set(d.SearchName,"search",c.value,true)}else{a.PendingSearchName=d.SearchName;a.PendingSearchValue=c.value}}};Qva.CloseSearch=function(h,c,f,a){var j=h.SearchName;var d=c.value;c.value="";c.onkeyup=null;var i=h.PageBinder||Qva.GetBinder(h.binderid);if(i.Enabled){if(f){i.Set(j,"search",d,false)}var b;if(f){b=a?"ctrlaccept":"accept"}else{b="abort"}i.Set(j,"closesearch",b,true)}else{i.PendingSearchKey=(f?"accept":"abort");i.PendingSearchKeyName=j}var g=i.TransientObject;if(g==j){i.CloseTransient()}};Qva.OpenPopupInput=function(d,c){Qva.ClosePopupInput();var b=d;if(!c){b=d.parentNode.parentNode}Qva.PopupInput=document.createElement("input");if(IS_IE){Qva.PopupInput.style.fontFamily=b.currentStyle.fontFamily;Qva.PopupInput.style.fontSize=b.currentStyle.fontSize}else{var a=document.defaultView.getComputedStyle(b,"");Qva.PopupInput.style.fontFamily=a.getPropertyValue("font-family");Qva.PopupInput.style.fontSize=a.getPropertyValue("font-size")}Qva.PopupInput.style.top=b.offsetTop+"px";Qva.PopupInput.style.left=b.offsetLeft+"px";Qva.PopupInput.style.width=b.clientWidth+"px";Qva.PopupInput.style.height=b.clientHeight+"px";Qva.PopupInput.style.zIndex=666;Qva.PopupInput.style.position="absolute";Qva.PopupInput.style.border="none";Qva.PopupInput.style.padding="0px 0px 0px 0px";if(c){Qva.PopupInput.value=d.value;Qva.PopupInput.inputname=d.inputname}else{Qva.PopupInput.value=b.innerText}Qva.PopupInput.onmousedown=Qva.CancelAction;Qva.PopupInput.onmouseup=Qva.CancelAction;Qva.PopupInput.onclick=Qva.CancelAction;Qva.PopupInput.onkeydown=AvqAction_Input_KeyDown;Qva.PopupInput.binderid=d.binderid;Qva.PopupInput.val=d.pos;Qva.PopupInput.ObjectId=d.ObjectId;b.offsetParent.appendChild(Qva.PopupInput);Qva.PopupInput.focus();Qva.SetCursor(Qva.PopupInput,true)};Qva.ClosePopupInput=function(){if(Qva.PopupInput==null){return}Qva.PopupInput.parentNode.removeChild(Qva.PopupInput);Qva.PopupInput=null};Qva.AddRule=function(b,a,c){try{if(b.addRule){b.addRule(a,c)}else{b.insertRule(a+" { "+c+" }",b.cssRules.length)}}catch(d){}};Qva.PageBinding.prototype.Refresh=function(){this.Body+=" ";if(!this.Enabled){return}this.LoadBegin()};Qva.PageBinding.prototype.LoadBegin=function(){Qva.CloseMessagePopup();if(this.OnUpdateBegin!=null){this.OnUpdateBegin()}this.IsUpdating=true;this.ScrollLeftToRemember=null;this.ScrollTopToRemember=null;Qva.ActiveElement=null;try{this.ScrollLeftToRemember=Qva.GetScrollLeft();this.ScrollTopToRemember=Qva.GetScrollTop();Qva.ActiveElement=document.activeElement;document.body.style.cursor="wait"}catch(c){}if(!this.IsPartialLoad){Qva.ClosePopupInput()}this.Enabled=false;if(!this.First){for(var a=0;a<this.Managers.length;++a){var b=this.Managers[a];if(this.IsRemote&&b.Lock){b.Lock()}b.Touched=false}}if(this.Benchmark!=null){this.Benchmark.Load.Start()}if(this.View==null&&this.Kind==null){this.Ready()}else{if(this.AutoviewDictionary!=null){this.SetAutoviewAddCommands()}this.Load()}};Qva.PageBinding.prototype.Load=function(a){this.HasPendingLoad=false;this.CurrentLoadIsPartial=this.IsPartialLoad;this.IsPartialLoad=false;this.OnUpdateCompleteTriggered=false;if(this.First&&this.Bookmark!=null){this.Set("bookmark-apply","docaction",this.Bookmark,false)}var c=function(m,k){for(var f=0;f<k.length;f++){var i=k[f].split(",");var g=i[0].split(".");var j=true;if(g.length==2){if(g[g.length-2]!=m.View&&g[g.length-2]!=m.ID){j=false}}else{if(g.length==0){j=false}}if(j){if(g[g.length-1].indexOf("\\")==-1){var d=m.DefaultScope+".Document\\"+g[g.length-1]}else{var d=m.DefaultScope+"."+g[g.length-1]}var l="";for(var h=1;h<i.length;h++){if(h==1){l=i[h]}else{l+=" | "+i[h]}}m.Search(d,l,false,false)}}};if(this.First){if(this.InitialSelections!=null){c(this,this.InitialSelections)}if(this.InitialSearch!=null){c(this,this.InitialSearch)}if(this.Sheet!=null){var b=this.Sheet;if(b.indexOf("\\")==-1){b="Document\\"+b}this.Set("Document.TabRow."+b,"action","",false)}}if(this.PendingSearchName!=""){this.Set(this.PendingSearchName,"search",this.PendingSearchValue,false);this.PendingSearchName="";this.PendingSearchValue=""}if(this.PendingSearchKeyName!=""){this.Set(this.PendingSearchKeyName,"closesearch",this.PendingSearchKey,false);this.PendingSearchKeyName=""}if(this.delay_Send){if(this.delay_Send!==true){clearTimeout(this.delay_Send)}this.Send(a)}};Qva.PageBinding.prototype.GetUpdates=function(c){for(var a=0;a<this.Managers.length;++a){var b=this.Managers[a];if(b.GetUpdates){b.GetUpdates(c)}}if(c.length==0&&this.Poll){c.push({})}this.Poll=false};Qva.PageBinding.prototype.Send=function(j){this.delay_Send=null;var b=this.Body;this.Body="";if(!this.HasAutoviewAddCommands()){b+=this.InitialSets;this.InitialSets=""}if(b.length==0){var m=[];this.GetUpdates(m);if(m.length==0&&j){if(this.IdlePollInterval){var s=this;this.delay_Send=setTimeout(function(){s.Send()},this.IdlePollInterval)}else{this.delay_Send=true}return}for(var l=0;l<m.length;++l){b+="<poll ";for(var g in m[l]){b+=g+'="'+Qva.XmlEncode(m[l][g])+'" '}b+="/>"}}var h='<update mark="'+this.Mark+'" stamp="'+this.Stamp+'"';if(window.navigator&&window.navigator.cookieEnabled){h+=' cookie="true"'}else{h+=' cookie="false"'}if(this.DefaultScope!=null){h+=' scope="'+this.DefaultScope+'"'}if(this.JSON&&this.Session!=null){h+=' session="'+this.Session+'"'}if(this.View!=null){h+=' view="'+Qva.XmlEncode(this.View)+'"'}if(this.Autoview!=null&&this.Autoview!=""){h+=' autoview="'+Qva.XmlEncode(this.Autoview)+'"'}h+=' ident="'+Qva.XmlEncode(this.Ident)+'"';if(this.Userid!=null){h+=' userid="'+this.Userid+'"'}if(this.Xuserid!=null){h+=' xuserid="'+this.Xuserid+'"'}if(this.Password!=null){h+=' password="'+this.Password+'"'}if(this.Xpassword!=null){h+=' xpassword="'+this.Xpassword+'"'}if(this.Kind!=null){h+=' kind="'+this.Kind+'"'}if(this.Bookmark){h+=' start="document"'}h+=">";h+=b;h+="</update>";if(this.Trace!=null&&this.Trace.Request!=null){this.Trace.Request.innerText=h}var q=this;if(this.Agent==null){var a=this.Url+this.Mark;if(this.Host!=null){a+="&host="+escape(this.Host)}if(this.Ticket!=null){a+="&ticket="+escape(this.Ticket)}if(this.View!=null){a+="&view="+escape(this.View)}if(this.Userid!=null){a+="&userid="+escape(this.Userid)}if(this.Xuserid!=null){a+="&xuserid="+escape(this.Xuserid)}if(this.Password!=null){a+="&password="+escape(this.Password)}if(this.Xpassword!=null){a+="&xpassword="+escape(this.Xpassword)}if(this.Slot!=null){a+="&slot="+escape(this.Slot)}if(!this.Platform){var r=navigator.userAgent;var f="browser.";if(IS_PLAYBOOK){f+="playbook"}else{if(IS_ANDROID){f+="android"}else{if(IS_CHROME){f+="chrome"}else{if(IS_GECKO){f+="gecko "+GECKO_VERSION}else{if(IS_SAFARI){f+="safari"}else{if(IS_OPERA){f+="opera"}else{if(IS_IE){f+=r.substr(r.indexOf("MSIE"),8)}else{f+="unknown"}}}}}}}if(IS_MOBILE){f+=".mobile"}this.Platform=f}a+="&platform="+escape(this.Platform);a+="&dpi="+Qva.DPI;if(this.ColorDepth>0){a+="&color_depth="+this.ColorDepth}if(this.AlternateUser!=null){a+="&user="+this.AlternateUser}if(this.JSON){if(this.Session!=null){a+="&session="+escape(this.Session)}a+="&json="+escape(this.ID);a+="&cmd="+escape(h);var d=document.createElement("script");d.setAttribute("type","text/javascript");d.setAttribute("src",a);var p=document.getElementsByTagName("head").item(0);if(this.ScriptTag){p.replaceChild(d,this.ScriptTag)}else{p.appendChild(d)}this.ScriptTag=d}else{if(this.UsePost){var c;if(window.XMLHttpRequest){c=new XMLHttpRequest()}else{c=new ActiveXObject("MSXML2.XMLHTTP")}c.onreadystatechange=function(){if(c.readyState==4&&c.status==200){if(c.responseXML){q.Doc=c.responseXML}else{if(c.responseText){Assert(false);q.loadXML(c.responseText)}}q.Ready()}};a=Qva.AddProxyIfAny(a);c.open("POST",a,true);try{c.send(h)}catch(o){if(this.CommunicationError){this.CommunicationError(o)}else{alert("Communication error: "+o.message)}this.Enabled=true}}else{a+="&cmd="+escape(h);this.Doc.onreadystatechange=function(){if(q.Doc.readyState==4){q.Ready()}};if(!this.Doc.load(a)){alert("Communication error (get)");this.Enabled=true}}}}else{var k;try{k=this.UseExecute?this.Agent.Execute(h):this.Agent.XmlUpdate(h)}catch(o){k='<result><message text="Server not responding" /></result>'}if(!this.Doc.loadXML(k)){alert(k);k='<result><message text="Unexpected error loading" /></result>';this.Doc.loadXML(k)}window.setTimeout(function(){q.Ready()},0)}};Qva.PageBinding.prototype.SendClose=function(){var a=this.Url+this.Mark;a+="&close=true";if(this.Host!=null){a+="&host="+escape(this.Host)}if(this.View!=null){a+="&view="+escape(this.View)}if(this.Slot!=null){a+="&slot="+escape(this.Slot)}var b;if(window.XMLHttpRequest){b=new XMLHttpRequest()}else{b=new ActiveXObject("MSXML2.XMLHTTP")}a=Qva.AddProxyIfAny(a);b.open("POST",a,true);try{b.send()}catch(c){alert("Communication error (post): "+c.message)}};Qva.PageBinding.prototype.AddManager=function(a){a.PageBinder=this;a.Touched=false;if(a.SelectedClassName==null){a.SelectedClassName="QvSelected";a.DeselectedClassName="QvDeselected";a.EnabledClassName="QvOptional";a.DisabledClassName="QvExcluded";a.LockedClassName="QvLocked";a.SelectedExcludedClassName="QvSelectedExcluded";a.LockedExcludedClassName="QvLockedExcluded";a.AlternativeClassName="QvAlternative";a.ModeIfNotEnabled="n"}this.Managers[this.Managers.length]=a;this.Append(a,a.Name,a.Attr)};Qva.PageBinding.prototype.Append=function(j,c,h,b){if(c==null||c.substr(0,1)=="."){Assert(false)}if(c==null||c==""){return}var g=this.Members[c];if(g==null){g=new Array();this.Members[c]=g}for(var f=0;f<g.length;f++){if(g[f]==j){break}}if(f==g.length){g[g.length]=j}if(this.Autoview!=null&&!b){var a=c.split("@");var d=a[0];var k=a.length>1?a[1]:h}};Qva.PageBinding.prototype.HasAutoviewAddCommands=function(){if(this.AutoviewDictionary==null){return false}for(var a in this.AutoviewDictionary){var b=this.AutoviewDictionary[a];if(b.dirty){return true}}return false};Qva.PageBinding.prototype.AutoViewAppend=function(d,b,a){if(a==null){a="text"}if(this.AutoviewDictionary==null){this.AutoviewDictionary={}}var c=this.AutoviewDictionary[b];if(c==null){c={};c.dirty=true;c.attrs="mode";this.AutoviewDictionary[b]=c}if(c.attrs.indexOf(a)==-1){c.dirty=true;c.attrs+=";"+a}};Qva.PageBinding.prototype.SetAutoviewAddCommands=function(){for(var a in this.AutoviewDictionary){var b=this.AutoviewDictionary[a];if(!b.dirty){continue}b.dirty=false;this.Set(a,"add",b.attrs,false);if(this.First&&this.Body.length>900&&!this.UsePost){return}}};Qva.PageBinding.prototype.loadXML=function(a){if(this.Doc&&typeof this.Doc.loadXML!=="undefined"){return this.Doc.loadXML(a)}else{if(typeof DOMParser!=="undefined"){this.Doc=new DOMParser().parseFromString(a,"text/xml");return this.Doc!=null}}return false};function HtmlifyARGB(a){if(a&&a.length==9){if(a.substr(1,2)=="00"){return"Transparent"}a="#"+a.substr(3)}return a}function IsValidIEARGB(a){if(a&&a.length==9){if(a.substr(1,2)=="00"||a.substr(1,2)=="ff"){return true}return false}return true}Qva.ApplyColorDataToElement=function(g,j,l,k){var h=g.getAttribute("color"),f=g.getAttribute("bkgcolor"),a=g.getAttribute("FillDirection"),d=g.getAttribute("FillPattern"),c=g.getAttribute("PrimaryColor"),m=g.getAttribute("SecondaryColor"),i=g.getAttribute("ColorMode"),b=false;if(i){if(IS_IE&&IE_DOCMODE<=8&&!l){if((IsValidIEARGB(c)&&i==="0")||k){j.style.backgroundColor=HtmlifyARGB(c);b=true}}else{if(i==="0"||i==="1"){j.style.backgroundImage="";j.style.filter="";j.style.backgroundColor=SetBackgroundRGBValue(j,c);b=true}else{if(i==="2"&&(l||k)){j.style.backgroundImage="";j.style.filter="";b=Qva.ApplyGradientToElement(a,d,c,m,j,k);return b}}if(!l&&!k){j.style.backgroundImage="";SetBackgroundRGBValue(j,c)}}}else{if(f){j.style.backgroundImage="";j.style.backgroundColor=HtmlifyARGB(f)}}if(h){if(IS_IE){j.style.color=HtmlifyARGB(h)}else{SetColorRGBValue(j,h)}b=true}return b};function SetBackgroundRGBValue(b,a){try{b.style.backgroundColor=Qva.Hex2RGBA(a)}catch(c){b.style.backgroundColor=HtmlifyARGB(a)}}function SetColorRGBValue(b,a){try{b.style.color=Qva.Hex2RGBA(a)}catch(c){b.style.color=HtmlifyARGB(a)}}function SetActiveStyle(c,m){var i=c.BorderAroundContent?c.ContentElement:c.Element;c.IsActive=m;var k=c.GetCaption();if(!k){return}if(c.Element.style.display=="none"){return}if(c.BorderStyle==null){return}var j=m&&c.ActiveBorderColor?c.ActiveBorderColor:c.BorderColor;var d=c.BorderWidth+"px "+c.BorderStyle+" "+j;i.style.border=d;if(!c.BorderAroundContent){var h=k.Element;if(h!=null){if(h.style.display=="none"){return}var f=m?k.activecolor:k.color;if(f==null){return}Qva.ApplyColorDataToElement(f,h,(!IS_IE||IE_DOCMODE>8),true);h.style.borderBottom="1px "+c.BorderStyle+" "+j;var l=h.childNodes.length;for(var g=0;g<l;g++){var b=h.childNodes[g];if(b.nodeName!="IMG"){continue}var a=b.src;a=Qva.FixUrl(a,"color",HtmlifyARGB(f.getAttribute("color")));a=Qva.FixUrl(a,"bkgcolor",HtmlifyARGB(f.getAttribute("bkgcolor")));b.src=a}}else{Assert(false)}}}function SetSearchableAndActives(f,c){if(f){Qva.SearchableObject=f}Qva.ActiveObjectsCloak=false;if(c){if(Qva.ActiveObjects){for(var g=0;g<Qva.ActiveObjects.length;++g){var a=window.document.getElementById(Qva.ActiveObjects[g]);if(a&&a.AvqMgr.IsActive){SetActiveStyle(a.AvqMgr,false)}}}Qva.ActiveObjects=[];for(var b=0;b<c.length;++b){var d=window.document.getElementById(c[b]);if(d){if(!d.AvqMgr.IsActive){SetActiveStyle(d.AvqMgr,true)}Qva.ActiveObjects.push(c[b])}}}}Qva.PageBinding.prototype.Ready=function(){if(this.RecursiveReadyLevel>0){return}try{document.body.style.cursor="auto"}catch(F){Assert(false)}this.Enabled=true;var b=null;for(;;){if(this.Doc==null){Assert(false);return}var w=this.Doc.documentElement;if(this.View!=null||this.Kind!=null){if(w==null){var p="";var B=this.Doc.parseError;if(B!=null){p+="Line: "+B.line+"\r\n\r\nChar: "+B.filepos+"\r\n\r\nReason: "+B.reason+"\r\n\r\n"}p+="Failed to load:\r\n\r\nURL: "+this.Doc.url;Assert(false,p);return}switch(Qva.GetMessageCode(w)||Qva.GetMessage(w)){case"Wait":this.WaitMessage(Qva.GetMessage(w));this.Poll=true;return;case"19":case"Failed to open document, You don't have access to this document.":break;case"15":case"Failed to open document, you don't have access to the server.":if(isNaN(Qva.RemainingRetries)){Qva.RemainingRetries=3}if(Qva.RemainingRetries<=0){break}Qva.Modal.instance.Show(this,Qva.Remote+"?public=only&name=login.htm&userid="+escape(this.Userid));return;case"1":case"Server error":alert("Unexpected exception occurred!");return}if(!this.IsHosted){if(w.getAttribute("unicorn")=="3"){Qva.Unicorn=true}var c=w.getAttribute("session");if(this.Session==null){this.Session=c}else{if(this.Session!=c){var m=Qva.GetMessage(w);if(m==null){m="Session timed out"}this.OnSessionLost(m);return}}this.IdlePollInterval=parseInt(w.getAttribute("idlepollinterval"))}Qva.HideMessage();var q=w.getElementsByTagName("object");var A=null;var G=null;if(q.length>=1){if(q[0].getAttribute("activeobject")){A=q[0].getAttribute("activeobject").split(" ");G=q[0].getAttribute("searchableobject")}if(this.ShowDocumentTitle&&q[0].getAttribute("title")){window.document.title=q[0].getAttribute("title")}}SetSearchableAndActives(G,A);var E=w.getElementsByTagName("command");if(E.length>=1){for(var v=0;v<E.length;v++){var I=E[v];if(I.getAttribute("close")=="true"){CloseSession();return}}}var D=w.getElementsByTagName("open");if(D.length>=1){for(var d=0;d<D.length;d++){var r=D[d];var f=r.getAttribute("url");if(f){var n=r.getAttribute("redirect")=="true";try{if(f.substr(0,2)=="$/"){var x=f.substr(2);f=this.Remote;f+=(f.indexOf("?")>=0)?"&public=only":"?public=only";f+="&size=long";if(this.Host!=null){f+="&host="+escape(this.Host)}f+="&name=Temp/"+escape(x)}if(f){if(n){window.location=f}else{if(f.substr(0,7)=="mailto:"){var l="http://"+window.location.host+window.location.pathname;var u=/\[opendoc\]/g;f=f.replace(u,l)}else{f=Qva.AddProxyIfAny(f)}b=window.open(f);Qva.ShowOpenUrlMsg(f,this.Translations)}}}catch(F){this.ShowMessage("Can't open '"+f+"' due to error: "+F.message)}r.setAttribute("url","")}}}var o=w.getAttribute("ident");if(o!=null){this.Ident=o}var h=w.getAttribute("kind");if(h!=null){this.Kind=h}var k=w.getAttribute("mark");var t=w.getAttribute("stamp");if(k!=null&&t!=null){this.Mark=k;this.Stamp=t}var a=this.CurrentLoadIsPartial;this.CurrentLoadIsPartial=false;if(this.Benchmark!=null){this.Benchmark.Load.Stop()}if(this.Benchmark!=null){this.Benchmark.Paint.Start()}this.PaintTree(w,"",a);if(this.Benchmark!=null){this.Benchmark.Paint.Stop()}var s=this.First&&(this.HasAutoviewAddCommands()||this.InitialSets!="");if(this.PendingSearchName!=""||this.PendingSearchKeyName!=""||s||this.HasPendingLoad){this.Enabled=false;if(s){this.SetAutoviewAddCommands()}if(this.Benchmark!=null){this.Benchmark.Load.Start()}this.Load();return}this.IsUpdating=false;break}}var C=false;for(var z=0;z<this.Managers.length;++z){if(this.Managers[z].Mode=="invalid"){C=true;break}}if(!C&&this.AsyncPostPaintMgrQueue.length==0&&!this.First&&this.Body==""&&!this.OnUpdateCompleteTriggered){this.OnUpdateCompleteTriggered=true;if(this.Benchmark!=null){this.Benchmark.UpdateComplete.Start()}this.OnUpdateComplete(false);if(this.Benchmark!=null){this.Benchmark.UpdateComplete.Stop()}}this.PaintDone(true,w);if(this.View!=null||this.Kind!=null){var g=Qva.GetErrorMessage(w);if(g!=null){if(g.indexOf("Error Message: Object expected")!=-1||g.indexOf("Error Message: Failed to connect")!=-1){Qva.ErrorMessage("Could not connect to server!")}else{Qva.ErrorMessage(g)}}else{var g=Qva.GetMessage(w);if(g!=null){this.ShowMessage(g)}}if(this.Trace!=null&&this.Trace.Response!=null){this.Trace.Response.innerText=this.Doc.xml}}if(this.First&&this.DeveloperMode){var H=this.OnceAfterLoad();if(H!=null){this.ShowMessage(H)}}if(this.IsHosted&&this.first){window.focus()}if(this.IsRemote){try{if(document.selection&&document.selection.type!="None"){var j=document.selection.createRange();if(j!=null){j.select()}}}catch(F){Assert(false)}}this.First=false;if(b!=null){b.focus()}};var old_Ready=Qva.PageBinding.prototype.Ready;Qva.PageBinding.prototype.Ready=function(){old_Ready.apply(this,arguments);if(this.Body.length>0||this.HasAutoviewAddCommands()){this.count_Send=0;this.Send(true)}else{this.count_Send=(this.count_Send||0)+1;var a=this;this.delay_Send=setTimeout(function(){a.Send(true)},this.count_Send<5?10:100)}this.RestoreScrollPosition()};Qva.PageBinding.prototype.RestoreScrollPosition=function(){try{if(this.ScrollLeftToRemember!=null){if(document.activeElement!=Qva.ActiveElement){Qva.ActiveElement.focus()}var b=this.ScrollTopToRemember-Qva.GetScrollTop();var a=this.ScrollLeftToRemember-Qva.GetScrollLeft();if(!IS_TOUCHENABLED){setTimeout(function(){window.scrollBy(a,b)},10)}this.ScrollLeftToRemember=null;this.ScrollTopToRemember=null;Qva.ActiveElement=null}}catch(c){}};Qva.OpenUrlMsg=null;Qva.ShowOpenUrlMsg=function(b,a){if(!Qva.OpenUrlMsg){Qva.OpenUrlMsg=document.createElement("div");Qva.OpenUrlMsg.className="QvUrlPopup";document.body.appendChild(Qva.OpenUrlMsg)}Qva.OpenUrlMsg.innerHTML="";Qva.OpenUrlMsg.style.display="";var c=document.createElement("span");c.innerText=a.OpenUrlInfo||"The requested content has been opened in another window.";c.innerText+=" ";Qva.OpenUrlMsg.appendChild(c);var c=document.createElement("span");c.innerText=a.OpenUrlIfNot||"If not, ";Qva.OpenUrlMsg.appendChild(c);var d=document.createElement("a");d.href=b;d.target="_blank";d.innerText=a.OpenUrlPressHere||"press here";Qva.OpenUrlMsg.appendChild(d);var g=parseInt((Qva.GetViewportHeight()-Qva.OpenUrlMsg.offsetHeight)/2);var f=parseInt((Qva.GetViewportWidth()-Qva.OpenUrlMsg.offsetWidth)/2);Qva.OpenUrlMsg.style.top=g+"px";Qva.OpenUrlMsg.style.left=f+"px";var c=document.createElement("span");c.innerText=a.Close||"close";c.onclick=Qva.CloseUrlMsgDiv;c.style.position="relative";c.style.cursor="pointer";Qva.OpenUrlMsg.appendChild(c);c.style.top=Qva.OpenUrlMsg.offsetHeight-c.offsetTop-c.offsetHeight-20+"px";c.style.left=Qva.OpenUrlMsg.offsetWidth-c.offsetLeft-c.offsetWidth-30+"px";window.setTimeout(function(){Qva.CloseUrlMsgDiv()},10000)};Qva.CloseUrlMsgDiv=function(){if(!Qva.OpenUrlMsg){Assert(false)}else{Qva.OpenUrlMsg.style.display="none"}};Qva.PageBinding.prototype.OnceAfterLoad=function(){var g=[];var d=0;for(var a=0;a<this.Managers.length;++a){var b=this.Managers[a];if(b.Name==""||b.Name=="#edit#"||b.Touched){if(d!=a){this.Managers[d]=this.Managers[a]}++d}else{if(b.Name!=""){try{b.Element.style.display="none"}catch(c){Assert(false)}g[g.length]="Not found: "+b.Name}}}this.Managers.length=d;if(g.length==0){return null}var f="Errors:\n"+g.join("\n");return f};Qva.PageBinding.prototype.PaintTree=function(m,h,j){for(var b=m.firstChild;b!=null;b=b.nextSibling){if(b.nodeName!="value"&&b.nodeName!="action"&&b.nodeName!="group"&&b.nodeName!="list"){continue}var a=h+b.getAttribute("name");var i=this.Members[a];if(i!=null){var g="d";switch(b.getAttribute("mode")){case"not-applicable":g="n";break;case"hidden":g="h";break;case"enabled":g="e";break}var c=i.length;for(var l=0;l<c;++l){var n=i[l];var f=g;if(g!="n"&&n.HideIf&&n.HideIf(b.getAttribute("value"),b.getAttribute("text"))){f="n"}n.Paint(f,b,a,j)}}}for(var k=m.firstChild;k!=null;k=k.nextSibling){if(k.nodeName!="value"&&k.nodeName!="object"&&k.nodeName!="group"&&k.nodeName!="list"){continue}var d=h+k.getAttribute("name")+".";this.PaintTree(k,d,j)}};Qva.PageBinding.prototype.PaintDone=function(d,a){if(this.Benchmark!=null){this.Benchmark.Unlock.Start()}for(var b=0;b<this.Managers.length;++b){var c=this.Managers[b];if(this.IsRemote&&!c.Touched&&c.Unlock){c.Unlock()}}if(this.Benchmark!=null){this.Benchmark.Unlock.Stop()}if(this.Benchmark!=null){this.Benchmark.Display()}};Qva.PageBinding.prototype.CloseTransient=function(){this.Set(this.TransientObject,"closetransient","ok",false);var a=window.document.getElementById(this.TransientObject.replace(this.DefaultScope+".",""));if(a){a.parentNode.parentNode.style.display="none"}this.TransientObject=""};Qva.PageBinding.prototype._Send=function(h,d,c,a){d=Qva.MgrMakeName(d,this.DefaultScope);this.Body+="<"+h+' name="'+d+'" ';var f=false;if(a){for(var i in a){if(typeof(a[i])==="object"&&a[i].length>0){f=true;continue}this.Body+=i+'="'+Qva.XmlEncode(a[i])+'" '}}if(f){this.Body+=">";for(var i in a){if(typeof(a[i])==="object"&&a[i].length>0){for(var g=0;g<a[i].length;g++){this.Body+="<element "+i+'="'+Qva.XmlEncode(a[i][g])+'" />'}}}this.Body+="</"+h+">"}else{this.Body+="/>"}if(c){if(this.LoadBegin_Timeout){clearTimeout(this.LoadBegin_Timeout)}if(this.DelaySet){var b=this;this.LoadBegin_Timeout=setTimeout(function(){b.LoadBegin()},200)}else{this.LoadBegin()}}};Qva.PageBinding.prototype.Set=function(b,c,d,a){if(this.GlobalSearchObject!=""){if(this.GlobalSearchObject!=b.substr(0,this.GlobalSearchObject.length)&&this.TransientObject!=b.substr(0,this.TransientObject.length)&&(Qva.ContextMenuMgr==null||b!=Qva.ContextMenuMgr.Name)){this.Set(this.GlobalSearchObject,"closesearch","abort",true);this.GlobalSearchObject="";this.CloseTransient()}}else{if(this.TransientObject!=""){if(this.TransientObject!=b.substr(0,this.TransientObject.length)&&(this.GlobalSearchObject==""||this.GlobalSearchObject!=b.substr(0,this.GlobalSearchObject.length))&&(Qva.ContextMenuMgr==null||b!=Qva.ContextMenuMgr.Name)){if(this.TransientObject==this.ToggleObject){this.ToggleObject="";this.ToggleValues.length=0}this.CloseTransient()}}}if(typeof(c)=="object"){this._Send("set",b,d!==false,c)}else{var f={};f[c]=d;this._Send("set",b,a,f)}};Qva.PageBinding.prototype.SetInitial=function(a,b,c){this.InitialSets+='<set name="'+a+'" '+b+'="'+Qva.XmlEncode(c)+'"/>'};Qva.SelectChild=function(b,d,a){for(var c=b.firstChild;c;c=c.nextSibling){switch(c.nodeName){case"object":if(c.getAttribute("name")!=d[a]){break}return(a==0)?c:null;case"group":case"list":if(c.getAttribute("name")!=d[a]){break}return c;case"value":case"action":if(c.getAttribute("name")!=d[a]){break}return(a==d.length-1)?c:null}}return null};Qva.PageBinding.prototype.Select=function(d){if(d==null){return null}d=Qva.MgrMakeName(d,this.DefaultScope);var c=d.split(".");var b=this.Doc.documentElement;for(var a=0;b!=null&&a<c.length;++a){b=Qva.SelectChild(b,c,a)}return b};Qva.SelectNode=function(b,f){if(b==null||f==null){return null}var d=f.split(".");var c=b;for(var a=0;c!=null&&a<d.length;++a){c=this.SelectChild(c,d,a)}return c};Qva.PageBinding.prototype.SetClick=function(c,d,g){if(!this.Enabled){return}if(this.ToggleObject!=""){return}Qva.MgrWithMouseDown=null;var f="click";var k="";if(g){if(g.index){k=g.index}else{var i=0;var h=0;if(!c){i=window.event.offsetX;h=window.event.offsetY}else{var j=Qva.GetOffsets(c);i=j.offsetX;h=j.offsetY}k+=""+i+":"+h;var l=Qva.GetObjectBinder(g);var a=l.GetImageSize(g);k+=":"+a.width+":"+a.height}}else{if(!c){c=window.event}if(c.shiftKey||ctrlKeyPressed(c)){f="ctrl-click";c.cancelBubble=true}}var b=IE_DOCMODE<9?0:1;if(f=="ctrl-click"&&c.button==b){return}this.Set(d,f,k,true)};Qva.PageBinding.prototype.SetNewSheet=function(){var a=this.Select(".ActiveSheet");if(a){var b=a.getAttribute("text");if(b){this.NavigateToSheet(b)}}};Qva.PageBinding.prototype.NavigateToSheet=function(d){var b=window.location.search;var a=d+".htm";var c=""+window.location.pathname;if(c.length<a.length||c.substr(c.length-a.length)!=a){if(b.length>0){a+=b}if(this.JSON){a=Qva.FixUrl(a,"session",this.Session)}a=Qva.FixUrl(a,"userid");a=Qva.FixUrl(a,"password");window.location=a}};Qva.GetContainingModal=function(){return window.parent.Qva.Modal.instance};Qva.CloseModal=function(){if(window.parent.Qva.Modal){var a=window.parent.Qva.Modal.instance;if(a!=null){a.Close()}}};Qva.CloseModalMessageBox=function(){if(window.parent.Qva.Modal){var a=window.parent.Qva.Modal.instance;if(a!=null){a.CloseEx()}}};Qva.SetModalTitle=function(b){if(window.parent.Qva.Modal){var a=window.parent.Qva.Modal.instance;if(a!=null){a.SetTitle(b)}}};QvDragRect=function(a){this.Element=a;this.DragStartX=0;this.DragStartY=0;this.DragRectLeft=0;this.DragRectTop=0;this.DragRectWidth=0;this.DragRectHeight=0;this.Element.className="QvDragRect";this.Element.style.position="absolute";this.Element.style.zIndex=666;this.Element.style.display="";document.body.insertBefore(this.Element,document.body.firstChild)};QvDragRect.prototype.Open=function(a,b){this.DragStartX=a;this.DragStartY=b;this.DragRectLeft=a;this.DragRectTop=b;this.DragRectWidth=0;this.DragRectHeight=0;this.Element.style.left=this.DragRectLeft+"px";this.Element.style.top=this.DragRectTop+"px";this.Element.style.width="0px";this.Element.style.height="0px";this.Element.style.display="";this.Element.onmousemove=function(c){Qva.MouseMove(c,Qva.MgrWithSelectStart);return false}};QvDragRect.prototype.Size=function(a,b){this.DragRectLeft=a>this.DragStartX?this.DragStartX:a;this.DragRectTop=b>this.DragStartY?this.DragStartY:b;this.DragRectWidth=a>this.DragStartX?a-this.DragStartX:this.DragStartX-a;this.DragRectHeight=b>this.DragStartY?b-this.DragStartY:this.DragStartY-b;this.Element.style.left=this.DragRectLeft+"px";this.Element.style.top=this.DragRectTop+"px";this.Element.style.width=this.DragRectWidth+"px";this.Element.style.height=this.DragRectHeight+"px"};QvDragRect.prototype.IsClosed=function(){return this.Element.style.display=="none"};QvDragRect.prototype.Close=function(){this.Element.style.display="none";this.Element.onmousemove=null};QvDragRect.prototype.RectString=function(){var d=this.DragRectLeft+Qva.SelectClient2OffsetX-Qva.GetScrollLeft();var c=this.DragRectTop+Qva.SelectClient2OffsetY-Qva.GetScrollTop();var b=this.DragRectWidth;var a=this.DragRectHeight;return""+d+":"+c+":"+b+":"+a};Qva.MouseDown=function(b,c){Qva.MgrWithMouseDown=c;Qva.MgrWithSelectStart=null;if(!b){b=window.event;if(c.Select!=null){b.returnValue=false}Qva.StartoffsetX=window.event.offsetX;Qva.StartoffsetY=window.event.offsetY}else{if(c.Select!=null){b.preventDefault()}var a=Qva.GetOffsets(b);Qva.StartoffsetX=a.offsetX;Qva.StartoffsetY=a.offsetY}};Qva.MouseMove=function(b,k,a){if(Qva.MgrWithMouseDown!=k&&Qva.MgrWithSelectStart!=k){return}var i=0;var h=0;if(!b){b=window.event;if(k.Select!=null){b.returnValue=false}i=b.offsetX;h=b.offsetY}else{if(k.Select!=null){b.preventDefault()}var j=Qva.GetOffsets(b);i=j.offsetX;h=j.offsetY}var d=b.clientX;var c=b.clientY;if(Qva.MgrWithMouseDown==k){var g=i-Qva.StartoffsetX;var f=h-Qva.StartoffsetY;if(a==null){a=4}if(g<-a||g>a||f<-a||f>a){Qva.MgrWithMouseDown=null;Qva.MgrWithSelectStart=k;Qva.SelectClient2OffsetX=i-d;Qva.SelectClient2OffsetY=h-c;if(Qva.MgrWithSelectStart.SelectStart!=null){Qva.MgrWithSelectStart.SelectStart(d,c)}}}if(Qva.MgrWithSelectStart==k){if(Qva.MgrWithSelectStart.Select!=null){Qva.MgrWithSelectStart.Select(d,c)}}};Qva.MessagePopup=null;Qva.ShowMessagePopup=function(b,h){if(!Qva.MessagePopup){Qva.MessagePopup=document.createElement("div");Qva.MessagePopup.className="QvMessagePopup";document.body.appendChild(Qva.MessagePopup)}else{Qva.CloseMessagePopup()}Qva.MessagePopup.style.display="";var f=document.createElement("img");f.style.cssText="float:right;";f.src=h.BuildBinaryUrl(null,null,"CX");Qva.MessagePopup.appendChild(f);var j=document.createElement("br");Qva.MessagePopup.appendChild(j);var i=document.createElement("table");var k=i.insertRow(-1);var d=k.insertCell(-1);d.style.verticalAlign="top";var f=document.createElement("img");f.src=h.BuildBinaryUrl(null,null,"web:helpicon");d.appendChild(f);var d=k.insertCell(-1);d.innerText=b;Qva.MessagePopup.appendChild(i);var a=Math.min(Qva.GetViewportWidth()-100,i.offsetWidth+60);var g=parseInt((Qva.GetViewportHeight()-Qva.MessagePopup.offsetHeight)/2);var c=parseInt((Qva.GetViewportWidth()-a)/2);Qva.MessagePopup.style.width=a+"px";Qva.MessagePopup.style.top=g+"px";Qva.MessagePopup.style.left=c+"px"};Qva.CloseMessagePopup=function(){if(Qva.MessagePopup){Qva.MessagePopup.innerHTML="";Qva.MessagePopup.style.display="none";Qva.MessagePopup.style.width="";Qva.MessagePopup.style.top="";Qva.MessagePopup.style.left=""}};Qva.PageBinding.prototype.ContextClientAction=function(g,f){if(!g){g=window.event}g.cancelBubble=true;if(f.clientaction=="modal"&&Qva.Modal.instance!=null){var c=f.param.split(":");Qva.Modal.instance.Show(this,Qva.Remote+"?public=only&name="+c[0]+".htm&target="+escape(f.Name||f.AvqMgr.Name),parseInt(c[1]),parseInt(c[2]))}else{if(f.clientaction=="inputfield"){Qva.OpenPopupInput(f)}else{if(f.clientaction=="confirm"){var h=f.param.split(":");var b=(f.Name||f.AvqMgr.Name)+"."+h[0];var i=h.slice(1).join(":");if(window.confirm(i)){this.Set(b,"action","",true)}}else{if(f.clientaction=="url"){window.open(f.param)}else{if(f.clientaction=="bundledurl"){var a=this.BuildBinaryUrl(null,"",f.param);window.open(a)}else{if(f.clientaction=="popup"){Qva.ShowMessagePopup(f.param,this)}else{if(f.clientaction=="xed"){QvaExpressionEditor.Insert(f.param,QvaExpressionEditor.Element);Qva.HideContextMenu(true);return false}else{if(f.clientaction=="menu"){var d=g.target;if(!d){d=g.srcElement}this.OnContextMenu(g,d.ObjectId);return}else{alert("Not supported clientside action: "+f.clientaction)}}}}}}}}Qva.HideContextMenu();return false};Qva.PageBinding.prototype.OnContextMenu=function(f,c,a){if(!f){f=window.event}if(f.shiftKey&&ctrlKeyPressed(f)){return}Qva.HideContextMenu();var b;var d=f.target;if(!d){d=f.srcElement}if(d.position!=null){a=d.position;b=d.ObjectId||a}else{if(c){b=c;if(d.tagName=="IMG"&&d.isgraph){var g=Qva.GetPageCoords(d);a=(f.clientX-g.x)+":"+(f.clientY-g.y)}else{if(d.index){a=d.index}else{a=a||""}}}else{if(Qva.LabelClick){b=this.DefaultScope+".StandardActions"}else{return}}}return this.OnCreateContextMenu(this,f,b,a)};Qva.IsContextOpen=function(){if(Qva.ContextMenu!=null&&Qva.ContextMenu.style.display!="none"){return true}if(Qva.ContextDialog!=null&&Qva.ContextDialog.style.display!="none"){return true}if(Qva.ContextDropDown!=null&&Qva.ContextDropDown.style.display!="none"){return true}return false};Qva.HideContextDialog=function(){if(Qva.ContextDialogMgr!=null){Qva.ContextDialogMgr.Close(true);Qva.ContextDialogMgr.PageBinder.RemoveFromManagers(Qva.ContextDialogMgr);Qva.ContextDialogMgr=null}if(Qva.ContextDialogBtn!=null){if(Qva.ContextDialogBtn.style){Qva.ContextDialogBtn.style.backgroundColor=""}Qva.ContextDialogBtn=null}if(Qva.ContextDialog!=null){Qva.ContextDialog.style.display="none";Qva.ContextDialog=null}};Qva.CloseContextDialog=function(){if(Qva.ContextDialogMgr!=null){Qva.ContextDialogMgr.Close(false)}Qva.HideContextDialog()};Qva.AbortContextDialog=function(){if(Qva.ContextDialogMgr!=null){Qva.ContextDialogMgr.Abort()}Qva.HideContextDialog()};Qva.HideContextMenu=function(a){if(Qva.ContextMenu!=null){if(Qva.ContextMenuMgr.SubMenuRow&&Qva.ContextMenuMgr.SubMenuRow.SubMenu){document.body.removeChild(Qva.ContextMenuMgr.SubMenuRow.SubMenu);Qva.ContextMenuMgr.SubMenuRow.SubMenu=null}while(Qva.ContextMenu.firstChild.rows.length>0){Qva.ContextMenu.firstChild.deleteRow(Qva.ContextMenu.firstChild.rows.length-1)}Qva.ContextMenu.style.display="none"}if(Qva.ContextDropDown!=null){Qva.ContextDropDown.style.display="none"}if(!a){Qva.HideContextDialog();if(typeof(Qva.contextDialog)!=="undefined"){Qva.dropDialog.hide()}}};Qva.PageBinding.prototype.TryAltAgent=function(){try{if(external&&typeof(external.AvqView)=="string"){var c=this;external.AvqInitServer(this.View,function(){if(c.Enabled){c.LoadBegin()}});if(this.HostedTitle==null){external.AvqTitle(document.title)}else{if(this.HostedTitle!=""){external.AvqTitle(this.HostedTitle)}}this.IsRemote=false;this.IsHosted=true;this.View=external.AvqView;this.Agent=external}else{if(this.AllowComAgent){try{var a=/[\?\&]admin=/.exec(this.Remote);this.Agent=new ActiveXObject("QvsRemote.Client");this.UseExecute=true;if(a==null){this.Agent.Connect("localhost",true)}else{this.Agent.AdminConnect("localhost")}this.IsRemote=false}catch(b){}}}}catch(b){Assert(false)}};Qva.PageBinding.prototype.BuildBinaryUrl=function(f,d,c,a){if(c!=null&&d==null&&this.CustomIcons[c]){return this.CustomIcons[c]}var b=this.Url;b=b.replace("mark=","datamode=binary");if(c!=null){b+="&name="+escape(c)}if(this.Host!=null){b+="&host="+escape(this.Host)}if(this.Slot!=null){b+="&slot="+escape(this.Slot)}if(d!=null){b+="&stamp="+escape(d);if(this.Ticket!=null){b+="&ticket="+escape(this.Ticket)}if(this.View!=null){b+="&view="+escape(this.View)}if(this.Kind!=null){b+="&kind="+this.Kind}if(this.Userid!=null){b+="&userid="+this.Userid}if(this.Xuserid!=null){b+="&xuserid="+this.Xuserid}if(this.Password!=null){b+="&password="+this.Password}if(this.Xpassword!=null){b+="&xpassword="+this.Xpassword}}else{b+="&public=only"}if(this.Session!=null&&this.JSON){b+="&session="+escape(this.Session)}if(a){b+="&color="+escape(a)}b=Qva.AddProxyIfAny(b);return b};Qva.PageBinding.prototype.RemoveFromManagers=function(c){var b=-1;for(var a=0;a<this.Managers.length;++a){if(this.Managers[a]==c){b=a;break}}if(b==-1){Assert(false)}else{if(b!=this.Managers.length-1){var d=this.Managers[b];this.Managers[b]=this.Managers[this.Managers.length-1];this.Managers[this.Managers.length-1]=d;b=this.Managers.length-1}}if(this.Managers[b].Element.AvqMgr!=null){if(this.Managers[b].Element.AvqMgr.Detach!=null){this.Managers[b].Element.AvqMgr.Detach()}this.Managers[b].Element.AvqMgr=null}this.Managers[b].Element=null;this.Managers.length=b};Qva.PageBinding.prototype.RemoveFromMembers=function(d){var b=d.Name;if(b==null){Assert(false)}if(b==null||b==""){return}var a=this.Members[b];if(a==null){Assert(false);return}var f=new Array();for(var c=0;c<a.length;c++){if(a[c]!=d){f[f.length]=a[c]}}if(a.length==f.length){Assert(false)}this.Members[b]=f};function AvqAction_Input_KeyDown(b){if(!b){b=window.event}var a=b.keyCode;switch(a){case 13:if(this.inputname){Qva.GetBinder(this.binderid).Set(this.inputname,"text",this.value,true)}else{Qva.GetBinder(this.binderid).Set(this.ObjectId,"inputvalue",this.val+":"+this.value,true)}case 27:break}}Qva.NoAction=function(a){if(!a){a=window.event}if(!a){return}if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}};Qva.CancelAction=function(a){if(!a){a=window.event}a.cancelBubble=true;this.pressed=true};Qva.DefaultShowMessage=function(a){alert(a)};Qva.DefaultOnSessionLost=function(a){if(this.ReconnectUrl){window.location=Qva.FixUrl(this.ReconnectUrl,"session");return}Qva.RetryMessage([this.Translations.ConnectionLost||"Lost connection to server.",this.Translations.Reconnecting||"Reconnecting..."],this.Translations.UserCanceled||"Action canceled by user")};Qva.PageBinding.prototype.GetMenu=function(b,a){this._Send("menu",b,true,{position:(a||"")})};Qva.PageBinding.prototype.Search=function(c,d,a,b){this._Send("search",c,b,{text:d,toggle:(a?"true":"false")})};Qva.PageBinding.prototype.Hover=function(a,b){this._Send("hover",a,true,{pos:b})};Qva.DefaultOnCreateContextMenu=function(i,a,j,d,g){Qva.CancelBubble(a);if(Qva.ContextMenu==null||Qva.ContextMenuMgr.binderid!=i.binderid){Qva.ContextMenu=document.createElement("table");Qva.ContextMenu.style.width="140px";Qva.ContextMenu.style.position="absolute";Qva.ContextMenu.style.zIndex=667;Qva.ContextMenu.className="contextmenu";var h=new Qva.Mgr.menu(i,Qva.ContextMenu,i.DefaultScope+".Menu");Qva.ContextMenuMgr=h;document.body.appendChild(Qva.ContextMenu)}else{Qva.ContextMenu.style.display="";while(Qva.ContextMenu.rows.length>0){Qva.ContextMenu.deleteRow(0)}}var f=Qva.ContextMenu.insertRow(-1);var b=f.insertCell(-1);b.innerHTML="<BR>";if(g){Qva.ContextMenu.X=g.x;Qva.ContextMenu.Y=g.y}else{Qva.ContextMenu.X=a.clientX+Qva.GetScrollLeft();Qva.ContextMenu.Y=a.clientY+Qva.GetScrollTop()}Qva.ContextMenu.style.left=Qva.ContextMenu.X+"px";Qva.ContextMenu.style.top=Qva.ContextMenu.Y+"px";try{Qva.ContextMenu.focus()}catch(c){}i.GetMenu(j,d);return false};Qva.OnCreateContextDropDown=function(i,a,k,d,g){Qva.CancelBubble(a);var j=Qva.ContextDropDown?Qva.ContextDropDown.firstChild:null;if(j==null){Qva.ContextDropDown=document.createElement("div");j=document.createElement("table");Qva.ContextDropDown.appendChild(j);j.style.width="140px";Qva.ContextDropDown.style.position="absolute";Qva.ContextDropDown.style.zIndex=667;Qva.ContextDropDown.className="contextmenu";var h=new Qva.Mgr.menu(i,j,i.DefaultScope+".Menu");h.IsDropDown=true;document.body.appendChild(Qva.ContextDropDown)}else{Qva.ContextDropDown.style.display="";while(j.rows.length>0){j.deleteRow(0)}}var f=j.insertRow(-1);var b=f.insertCell(-1);b.innerHTML="<BR>";if(g){Qva.ContextDropDown.X=g.x;Qva.ContextDropDown.Y=g.y}else{Qva.ContextDropDown.X=a.clientX+Qva.GetScrollLeft();Qva.ContextDropDown.Y=a.clientY+Qva.GetScrollTop()}Qva.ContextDropDown.style.left=Qva.ContextDropDown.X+"px";Qva.ContextDropDown.style.top=Qva.ContextDropDown.Y+"px";try{Qva.ContextDropDown.focus()}catch(c){}i.GetMenu(k,d);return false};Qva.ShowContextDialog=function(c,g,i){var a=Qva.ContextDialogBtn;Qva.HideContextDialog();if(Qva.ContextDialog==null){Qva.ContextDialog=document.createElement("div");Qva.ContextDialog.style.position="absolute";Qva.ContextDialog.style.zIndex=666;Qva.ContextDialog.className="contextdialog";Qva.ContextDialog.onclick=Qva.CancelBubble;document.body.appendChild(Qva.ContextDialog)}Qva.ContextDialog.innerHTML=g;var j=Qva.GetBinder(c.binderid);var f=c.Name.split(".");var b=f[0]+"."+f[1]+"."+f[2];Qva.ContextDialogMgr=new Qva.Mgr.toolwindowbody(j,Qva.ContextDialog,b);Qva.ContextDialogMgr.Scan(c.Name);Qva.ContextDialogBtn=a||c;var h=Qva.GetPageCoords(Qva.ContextDialogBtn);Qva.ContextDialog.style.left=h.x+24+"px";Qva.ContextDialog.style.top=h.y-2+"px";Qva.ContextDialog.style.display="";if(Qva.ContextDialogBtn&&Qva.ContextDialogBtn.style){Qva.ContextDialogBtn.style.backgroundColor="silver"}try{Qva.ContextDialog.focus()}catch(d){}if(typeof(i)=="string"){Qva.ContextDialogMgr.SetSingleMode(c.Name,i)}else{j.LoadBegin()}};Qva.XmlEncode=function(a){var b=""+a;b=b.replace(/&/g,"&amp;");b=b.replace(/</g,"&lt;");b=b.replace(/>/g,"&gt;");b=b.replace(/"/g,"&quot;");return b};Qva.GetMessage=function(a){var b=a.getElementsByTagName("message");if(b.length>=1){var c=b[0].getAttribute("text");if(c&&c!=""){return c}}return null};Qva.GetMessageCode=function(a){var b=a.getElementsByTagName("message");if(b.length>=1){var c=b[0].getAttribute("code");if(c&&c!=""){return c}}return null};Qva.GetErrorMessage=function(b){var a=b.getElementsByTagName("Error");if(a.length>=1){var c=b.getElementsByTagName("message");if(c.length>=1){var d=c[0].getAttribute("text");if(d&&d!=""){return d}}}return null};Qva.GetDocHeight=function(){return Math.max(Math.max(document.body.scrollHeight,document.documentElement.scrollHeight),Math.max(document.body.offsetHeight,document.documentElement.offsetHeight),Math.max(document.body.clientHeight,document.documentElement.clientHeight))};Qva.GetViewportHeight=function(){if(window.innerHeight!=window.undefined){return window.innerHeight}if(document.compatMode=="CSS1Compat"){return document.documentElement.clientHeight}if(document.body){return document.body.clientHeight}};Qva.GetViewportWidth=function(){if(window.innerWidth!=window.undefined){return window.innerWidth}if(document.compatMode=="CSS1Compat"){return document.documentElement.clientWidth}if(document.body){return document.body.clientWidth}};Qva.GetScrollTop=function(){if(self.pageYOffset){return self.pageYOffset}if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollTop}return document.body.scrollTop};Qva.GetScrollLeft=function(){if(self.pageXOffset){return self.pageXOffset}if(document.documentElement&&document.documentElement.scrollLeft){return document.documentElement.scrollLeft}return document.body.scrollLeft};Qva.MgrSplit=function(c,a,d){if(a==null){return false}var b=a.split("@");switch(b.length){case 1:c.Attr="text";break;case 2:c.Attr=b[1];break;case 3:c.Attr=(b[1]!="")?b[1]:"text";c.Dec=parseInt(b[2]);break;default:return false}c.Name=Qva.MgrMakeName(b[0],d);return true};Qva.MgrMakeName=function(a,b){if(a==null){Assert(false)}if(a.substr(0,1)=="."){if(b==null){Assert(false)}if(a.length==1){return b}return b+a}else{return a}};Qva.MgrGetDisplayFromMode=function(a,b){if(a.Element.disabled&&a.ModeIfNotEnabled=="h"){return"none"}else{if(b=="d"||b=="e"||a.ModeIfNotEnabled=="d"){return""}else{return"none"}}};Qva.Trunc=function(a,h){var b=a.indexOf(".");if(b<0){return a}var d=a.length-b-1;if(d<=h){return a}var g=parseFloat(a);if(isNaN(g)){return a}var c=Math.pow(10,h);g=Math.round(g*c)/c;return g.toString()};Qva.LockDisabled=function(){this.Locked=this.Element.disabled;this.Element.disabled=true};Qva.UnlockDisabled=function(){this.Element.disabled=this.Locked};Qva.LockReadOnly=function(){this.Locked=this.Element.readOnly;this.Element.readOnly=true};Qva.UnlockReadOnly=function(){this.Element.readOnly=this.Locked};Qva.FixUrl=function(a,d,c){var b=new RegExp("[?&]"+d+"=[^&]*","i");a=a.replace(b,"");if(c!=null){a+="&"+d+"="+escape(c)}if(a.indexOf("?")==-1){a=a.replace(/&/,"?")}return a};Qva.ExtractProperty=function(c,a,h,b){if(h){var d=new RegExp("[?&]"+c+"=([^&]*)","i")}else{var d=new RegExp("[?&]"+c+"=([^&]+)","i")}var f=d.exec(b||window.location);try{if(f==null){f=d.exec(top.location)}}catch(g){}return f!=null?unescape(f[1]):a};Qva.ExtractPropertyArray=function(a,g,d,b){if(d){var j=new RegExp("[?&]"+a+"=([^&]*)","gi")}else{var j=new RegExp("[?&]"+a+"=([^&]+)","gi")}var c=[];var i="";try{if(j.test(b)){i=b}else{if(j.test(window.location)){i=window.location}else{if(j.test(top.location)){i=top.location}}}}catch(h){}if(i!=""){j.lastIndex=0;do{var f=j.exec(i);if(f!=null){c.push(unescape(f[1]))}}while(f!=null)}if(c.length>0){return c}else{return g}};Qva.ExtractPropertyForDocument=function(a,j,d,c,b){var i=null;var f=null;var h=Qva.ExtractPropertyArray(a,d,c,b);if(h){for(var k=0;k<h.length;k++){var g=h[k].split(":");if(g.length==2){if(g[0].toLowerCase()==j.toLowerCase()){i=g[1]}}else{f=h[k]}}}if(i==null&&f!=null){return f}else{return i}};Qva.GetAbsolutePageCoords=function(a){var b={x:0,y:0};while(a){b.x+=a.offsetLeft;b.y+=a.offsetTop;a=a.offsetParent}return b};Qva.GetPageCoords=function(a){var b={x:0,y:0};while(a){b.x+=a.offsetLeft;if(a.tagName=="DIV"){b.x-=a.scrollLeft}b.y+=a.offsetTop;if(a.tagName=="DIV"){b.y-=a.scrollTop}a=a.offsetParent}b.x-=Qva.GetScrollLeft();b.y-=Qva.GetScrollTop();return b};Qva.GetOffsets=function(d,f){if(!f){f=d.target||d.srcElement}if(typeof f.offsetLeft=="undefined"){f=f.parentNode}var a=Qva.GetAbsolutePageCoords(f);var b={x:Qva.GetScrollLeft()+d.clientX,y:Qva.GetScrollTop()+d.clientY};var c={offsetX:b.x-a.x,offsetY:b.y-a.y};return c};Qva.SetCursor=function(c,a){var b=0;if(c.value.length>0){b=c.value.charAt(0)=="*"?c.value.length-1:c.value.length}if(window.document.selection){var d=window.document.selection.createRange();d.moveStart("character",-c.value.length);d.moveEnd("character",-c.value.length);if(a){d.moveStart("character",0);d.moveEnd("character",c.value.length)}else{d.moveStart("character",b)}d.select()}else{if(c.selectionStart){if(a){c.selectionStart=0;c.selectionEnd=c.value.length}else{c.selectionStart=Math.max(1,b);c.selectionEnd=Math.max(1,b)}}}};Qva.CancelBubble=function(a){if(!a||!a.stopPropagation){window.event.cancelBubble=true}else{a.stopPropagation()}};function AvqAction_Search_KeyDown(b){if(!b){b=window.event}var c=this.SearchMgr;var a=b.keyCode;switch(a){case 13:Qva.CloseSearch(c,this,true,ctrlKeyPressed(b));break;case 27:var d=this;window.setTimeout(function(){Qva.CloseSearch(c,d,false)},0);break}}function AvqAction_Search_KeyUp(b){if(!b){b=window.event}var a=b.keyCode;switch(a){case 13:case 27:case 37:case 39:break;default:if(this.searchcol==null){Qva.Search(this.SearchMgr,this,a)}break}}function AvqAction_Search_Focus(){if(this.value==""){this.value=this.param!=null?this.param:"**";Qva.SetCursor(this)}}function getClientWidth(c){if(IS_GECKO||IS_OPERA||IS_WEBKIT){var f=c.offsetWidth;var b=document.defaultView.getComputedStyle(c,"");var d=parseInt(b.getPropertyValue("padding-left"))+parseInt(b.getPropertyValue("padding-right"));var a=parseInt(b.getPropertyValue("border-left-width"))+parseInt(b.getPropertyValue("border-right-width"));f-=d;f-=a;return f}else{return c.clientWidth}}function getClientHeight(d){if(IS_IE){return d.clientHeight}else{var c=d.offsetHeight;var b=document.defaultView.getComputedStyle(d,"");var f=parseInt(b.getPropertyValue("padding-top"))+parseInt(b.getPropertyValue("padding-bottom"));var a=parseInt(b.getPropertyValue("border-top-width"))+parseInt(b.getPropertyValue("border-bottom-width"));c-=f;c-=a;return c}}Qva.ExpressionDialog=function(b,c){if(b.disabled){return}var a=Qva.GetBinder(b.BinderId);if(!a.Enabled){return}if(a.IsHosted){var c=external.AvqExpressionDialog(b.Value,b.ExpressionType=="always");if(c!=b.Value){a.Set(b.Name,"value",c,true)}}else{if(Qva.ContextDialogBtn==b){Qva.HideContextDialog()}else{a.LoadHtml("Expression.Qvpp",function(d){Qva.ShowContextDialog(b,d,c)})}}};Qva.Hover=null;Qva.PageBinding.prototype.GetHoverDiv=function(){if(!Qva.Hover){Qva.Hover=document.createElement("div");Qva.Hover.className="QvHover";Qva.Hover.style.zIndex=666;Qva.Hover.style.display="none";Qva.Hover.style.position="absolute";Qva.Hover.style.backgroundColor="#FFFFCC";Qva.Hover.style.border="solid 1px black";Qva.Hover.style.padding="1px 3px 2px 3px";document.body.appendChild(Qva.Hover);new Qva.Mgr.hover(this,Qva.Hover,this.DefaultScope+".Hover")}return Qva.Hover};Qva.PageBinding.prototype.LoadHtml=function(b,f){var c;if(window.XMLHttpRequest){c=new XMLHttpRequest()}else{c=new ActiveXObject("MSXML2.XMLHTTP")}c.onreadystatechange=function(){if(c.readyState==4){if(c.status==200){f(c.responseText)}else{f("No such page")}}};var a=this.Url;if(b!=null){a+="&name="+escape(b)}if(this.Host!=null){a+="&host="+escape(this.Host)}a+="&public=only";a=Qva.AddProxyIfAny(a);c.open("GET",a,true);try{c.send(null)}catch(d){f("Error sending")}};Qva.PageBinding.prototype.AddToogleSelect=function(b,c,a){if(this.ToggleObject!=b){this.ToggleValues.length=0}this.ToggleObject=b;this.TogglePhase=a;for(var d=0;d<this.ToggleValues.length;d++){if(this.ToggleValues[d]==c){this.ToggleValues.splice(d,1);return}}this.ToggleValues[this.ToggleValues.length]=c};Qva.PageBinding.prototype.GetEnabled=function(){return this.Enabled};Qva.PageBinding.prototype.GetDocumentMgr=function(){return this};Qva.PageBinding.prototype.GetMaxClientWidth=function(a){return getClientWidth(a)};Qva.GetObjectBinder=function(b){var a=b;while(a&&!a.AvqMgr){a=a.parentNode;if(!a){continue}if(a.AvqMgr){return a.AvqMgr}}return Qva.GetBinder(b.binderid)};Qva.ModalMessage=function(i,h,d){if(!Qva.ModalMessage.msgdiv){var g=Qva.ModalMessage.msgdiv=document.createElement("DIV");g.className="HTMLMessage";var f=Qva.ModalMessage.textdiv=document.createElement("DIV");f.style.width="75%";f.style.height="100%";g.appendChild(f);var c=Qva.ModalMessage.img=document.createElement("img");c.style.display="block";c.style.position="absolute";c.style.left="85%";c.style.top="40%";c.alt="";c.id="WorkingGif";c.src=Qva.QvAjaxZfcPath+"htc/Working.gif";g.appendChild(c);var a=Qva.ModalMessage.cancelbtn=document.createElement("BUTTON");a.innerText="Cancel";a.style.display="block";a.style.position="absolute";a.style.left="75%";a.style.top="75%";g.appendChild(a);document.body.appendChild(g)}if(typeof i=="string"){Qva.ModalMessage.textdiv.innerText=i}else{Qva.ModalMessage.textdiv.innerText=i[0];for(var b=1;b<i.length;++b){Qva.ModalMessage.textdiv.innerHTML+="<br/><br/>";Qva.ModalMessage.textdiv.innerText+=i[b]}}Qva.ModalMessage.cancelbtn.onclick=h;Qva.ModalMessage.msgdiv.style.display="";Qva.ModalMessage.msgdiv.className="HTMLMessage "+(d||"")};Qva.HideMessage=function(){if(Qva.ModalMessage.msgdiv){Qva.ModalMessage.msgdiv.style.display="none"}};Qva.PageBinding.prototype.WaitMessage=function(c,b){var a=this;Qva.ModalMessage(c,function(){a._Send("abort","",true)},"Info")};Qva.RetryMessage=function(b,a){if(Qva.CanceledByUser){return}var c=setTimeout(function(){var d=window.location+"";var f=d.lastIndexOf("#");if(f!=-1){d=d.substr(0,f)}window.location=Qva.FixUrl(d,"session")},5000);Qva.ModalMessage(b,function(){clearTimeout(c);Qva.CanceledByUser=true;Qva.ModalMessage.textdiv.innerHTML+="<br/><br/>";Qva.ModalMessage.textdiv.innerText+=a;if(Qva.ModalMessage.img){Qva.ModalMessage.img.style.display="none"}Qva.ModalMessage.cancelbtn.style.display="none"})};Qva.ErrorMessage=function(c){var b=document.createElement("DIV");b.className="HTMLMessage";var a=document.createElement("DIV");a.style.width="100%";a.style.height="100%";a.innerHTML=c;a.style.overflow="auto";b.appendChild(a);document.body.appendChild(b)};Qva.addEvent=function(a,c,b){a["on"+c]=b};Qva.removeEvent=function(a,c,b){a["on"+c]=null};Qva.cancelSelectEvent_md=function(a){if(!Qva.MouseDown){return}a=a||window.event;var b=a.target||a.srcElement;if(Qva.DragDrop.curDrag||(b.nodeName!="INPUT"&&b.nodeName!="SELECT")){Qva.cancelSelectEvent=true}if(Qva.cancelSelectEvent&&a.preventDefault){a.preventDefault()}};Qva.cancelSelectEvent_mm=function(a){if(Qva.cancelSelectEvent){return false}};Qva.GetToolbarElement=function(){return document.getElementById("QvToolbar")};Qva.ResizeBody=function(){var d=document.documentElement.clientHeight,a=document.getElementById("MainContainer"),b=Qva.GetToolbarElement(),c=document.getElementById("Tabrow");document.body.style.height=d+"px";if(a&&b&&c){a.style.height=Number(d-b.offsetHeight-c.offsetHeight)+"px"}if(IS_TOUCHENABLED){b.style.width=document.body.scrollWidth+"px";c.style.width=document.body.scrollWidth+"px"}};Qva.LoadScript=function(b,d,c){if(c==undefined){c=document}var a=c.createElement("script");a.type="text/javascript";a.src=b;if(a.readyState){a.onreadystatechange=function(){if(a.readyState=="loaded"||a.readyState=="complete"){a.onreadystatechange=null;if(d&&typeof(d)==="function"){d()}}}}else{a.onload=function(){if(d&&typeof(d)==="function"){d()}}}c.getElementsByTagName("head")[0].appendChild(a)};Qva.LoadCSS=function(a,c){if(c==undefined){c=document}var b=c.createElement("link");b.setAttribute("rel","stylesheet");b.setAttribute("type","text/css");b.setAttribute("href",Qva.AddProxyIfAny(a));c.getElementsByTagName("head")[0].appendChild(b)};Qva.GetDebugFiles=function(b){var d="?n="+Math.floor(Math.random()*100001);Qva.LoadCSS(Qva.QvAjaxZfcPath+"htc/avq.css"+d);Qva.LoadCSS(Qva.QvAjaxZfcPath+"htc/tabcontent.css"+d);var c=[Qva.QvAjaxZfcPath+"htc/QvAjaxBaseMgr.js"+d,Qva.QvAjaxZfcPath+"htc/QvAjaxObjectMgr.js"+d,Qva.QvAjaxZfcPath+"htc/QvAjaxCollaboration.js"+d,Qva.QvAjaxZfcPath+"htc/QvAjaxDragDrop.js"+d,Qva.QvAjaxZfcPath+"htc/QvAjaxGraphics.js"+d,Qva.QvAjaxZfcPath+"htc/QvAjaxModal.js"+d,Qva.QvAjaxZfcPath+"htc/QvAjaxScan.js"+d,Qva.QvAjaxZfcPath+"htc/QvAjaxSlider.js"+d,Qva.QvAjaxZfcPath+"htc/QvAjaxGrid.js"+d,Qva.QvAjaxZfcPath+"htc/QvAjaxListbox.js"+d,Qva.QvAjaxZfcPath+"htc/QvAjaxTabRow.js"+d,Qva.QvAjaxZfcPath+"htc/QvAjaxToolWindow.js"+d,Qva.QvAjaxZfcPath+"htc/QvAjaxTouch.js"+d,Qva.QvAjaxZfcPath+"htc/Calendar/QvAjaxCalendar.js"+d,Qva.QvAjaxZfcPath+"htc/Calendar/calendar.js"+d,Qva.QvAjaxZfcPath+"htc/Calendar/lang/calendar-en.js"+d];var a=function(){if(c.length>0){var f=c.shift();Qva.LoadScript(Qva.AddProxyIfAny(f),a)}else{if(b&&typeof(b)==="function"){b()}}};Qva.LoadScript(Qva.AddProxyIfAny(c.shift()),a)};Qva.AddExtension=function(b,c,a){if(a){Qva.Mgr[b].prototype.Debug=true}Qva.Mgr[b].prototype.PostPaint=function(){if(typeof(this.QvaPublic.Paint)==="undefined"){this.QvaPublic.Paint=c}try{this.QvaPublic.Paint()}catch(d){if(a){Assert(false,"An error occured in the postpaint-function in the extension object: \n"+d.description)}else{Qva.Mgr[b].prototype.PostPaint=null}}}};Qva.AddExtensionBase=function(b,a){if(!Qva.Mgr[b]){Qva.Mgr[b]=function(c,f,d,g){if(!Qva.MgrSplit(this,d,g)){return}this.Element=f;this.Touched=false;f.ObjectId=c.Element.id;f.BinderId=c.ID;c.AddManager(this)}}new Qva.Mgr[b](a,a.ContentElement,a.Name)};Qva.ExtensionCreator={};Qva.WaitingForRequest=function(){};Qva.LoadWhenReady=function(a){if(a.IsUpdating){window.setTimeout(function(){Qva.LoadWhenReady(a)},10)}else{window.setTimeout(function(){a.LoadBegin()},10)}};Qva.CheckForRequestedScript=function(b,a){if(Qva.ExtensionCreator[b]==Qva.WaitingForRequest){window.setTimeout(function(){Qva.CheckForRequestedScript(b,a)},10)}else{window.setTimeout(function(){Qva.LoadWhenReady(a)},10)}};Qva.RequestScript=function(d,c){var b=document.getElementsByTagName("head")[0];var a=document.createElement("script");a.id=d;a.src=Qva.Remote+"?public=only&name=Extensions/"+d+"/script.js";a.type="text/javascript";b.appendChild(a);window.setTimeout(function(){Qva.CheckForRequestedScript(d,c)},10)};Qva.getFrameObjForElement=function(a){while(typeof(a.AvqMgr)==="undefined"&&a.parentNode!==null){a=a.parentNode}return typeof(a.AvqMgr)!=="undefined"?a.AvqMgr:null};Qva.PageBinding.prototype.GetQvObject=function(d,a,c){if(d.indexOf("Document\\")==-1&&d.indexOf("Server\\")==-1){d="Document\\"+d}if(d.indexOf("Document.")==-1){d="Document."+d}var b=new Qva.Mgr.QvObject(this,d,null);if(!c){c=this}b.PostPaint=function(){if(this.QvaPublic.Data.IsDataFetched()){if(!this.QvaPublic.callbackFn){this.QvaPublic.callbackFn=a}this.QvaPublic.callbackFn(c)}};this.Send(false);return b};Qva.PageBinding.prototype.Action=function(a){if(!this.Enabled){return}var b={};if(this.Position!=null){b.position=this.Position}b.action="";b.clientsizeWH=Qva.GetViewportWidth()+":"+Qva.GetViewportHeight();this.Set("Document.StandardActions."+a,b)};Qva.PageBinding.prototype.Clear=function(){this.Action("CLEARSTATE")};Qva.PageBinding.prototype.Back=function(){this.Action("BCK")};Qva.PageBinding.prototype.Forward=function(){this.Action("FWD")};Qva.PageBinding.prototype.Undo=function(){this.Action("UNDO")};Qva.PageBinding.prototype.Redo=function(){this.Action("REDO")};Qva.PageBinding.prototype.LockSelections=function(){this.Action("LS")};Qva.PageBinding.prototype.UnlockSelections=function(){this.Action("US")};Qva.PageBinding.prototype.CloseSession=function(){this.Enabled=false;this.Ready=function(){};this.OnContextMenu=function(){};this.SendClose()};Qva.Public={Data:function(a){this.CellStyles=new Array();this.CellBorderStyles=new Array();this.HeaderRows=new Array();this.Rows=new Array();this.Super=a;this.NewOffset=new Object({x:0,y:0});this.PageOffset=new Object({x:0,y:0});this.PageSize=new Object({x:0,y:0});this.TotalSize=new Object({x:0,y:0});switch(this.Super.Type){case"LB":this.Lock=function(){var b={};b.action="";this.Super.DocumentMgr.Set(this.Super.Name+".LOC",b)};this.Unlock=function(){var b={};b.action="";this.Super.DocumentMgr.Set(this.Super.Name+".ULC",b)};this.GetSelected=function(){var c=new Array();for(var b=0;b<this.Rows.length;b++){if(this.Rows[b]!==undefined){var d=this.Rows[b][0];if(d.selected==="yes"){c.push(d)}}}return c};this.GetEnabled=function(){var c=new Array();for(var b=0;b<this.Rows.length;b++){if(this.Rows[b]!==undefined){var d=this.Rows[b][0];if(d.mode!=="disabled"){c.push(d)}}}return c};this.Search=function(c,b){this.Super.DocumentMgr.Search(this.Super.Name,c,b,true)};this.SelectValues=function(c,b){var d={};d.select=c;d.toggle=b?"true":"false";this.Super.DocumentMgr.Set(this.Super.Name,d)};this.SelectTexts=function(){var b=arguments.length,c="",d=0;if(b>0){if(b===1&&typeof(arguments[0])==="object"&&arguments[0].length>0){for(d;d<arguments[0].length;d++){c+='"'+arguments[0][d]+'" '}}else{for(d;d<b;d++){c+='"'+arguments[d]+'" '}}this.Search(c)}};this.ClearSelections=function(){var b={};b.action="";this.Super.DocumentMgr.Set(this.Super.Name+".CD",b)};this.ClearAllButThis=function(){var b={};b.action="";this.Super.DocumentMgr.Set(this.Super.Name+".CO",b)};this.SelectAll=function(){var b={};b.action="";this.Super.DocumentMgr.Set(this.Super.Name+".SA",b)};this.SelectExcluded=function(){var b={};b.action="";this.Super.DocumentMgr.Set(this.Super.Name+".SE",b)};this.SelectPossible=function(){var b={};b.action="";this.Super.DocumentMgr.Set(this.Super.Name+".SP",b)};break;case"IB":case"TX":case"SO":case"SL":case"BM":case"LA":case"BU":break;case"CH":this.SearchColumn=function(f,d,b,c){var g={};g.search=d;if(b){g.toggle="true"}this.Super.DocumentMgr.Set(this.Super.Name+".C"+f,g,c)};this.SelectTextsInColumn=function(f,c){var b=arguments.length,g={};if(b>2){g.select="";g.text=[];if(b===3&&typeof(arguments[2])==="object"&&arguments[2].length>0){for(var d=0;d<arguments[2].length;d++){g.text[g.text.length]=arguments[2][d]}}else{for(var d=2;d<b;d++){g.text[g.text.length]=arguments[d]}}g.toggle=c?"true":"false";this.Super.DocumentMgr.Set(this.Super.Name+".C"+f,g)}};this.SelectValuesInColumn=function(f,c,b,d){var g={};if(typeof(c)==="object"&&c.length>0){g.select=c.toString()}else{g.select=c}g.toggle=b?"true":"false";this.Super.DocumentMgr.Set(this.Super.Name+".C"+f,g,d)};this.SelectRow=function(d){var f=new Array();for(var b=0;b<this.Rows[d].length;b++){if(this.Rows[d][b].value){f.push(b)}}for(var h=0;h<f.length;h++){var g=(h==f.length-1);this.SelectValuesInColumn(h,this.Rows[d][h].value,false,g)}};this.DrillUp=function(b,c){var d={drillup:b};if(c){d.column=c}this.Super.DocumentMgr.Set(this.Super.Name,d,true)};this.Cycle=function(b,c){var d={cycle:b};if(c){d.column=c}this.Super.DocumentMgr.Set(this.Super.Name,d,true)};case"MB":case"TB":this.ClearSelections=function(){var b={};b.action="";this.Super.DocumentMgr.Set(this.Super.Name+".CA",b)};break}switch(this.Super.Type){case"LB":case"CH":case"TB":this.PageObject=function(b,c,d){if(!d){d=1}this._parent=b;this._size=c;this.Current=d;this.Count=Math.ceil(b.TotalSize.y/c);this.Set=function(f){if(f>=1&&f<=this.Count){this.Current=f;this._parent.NewOffset.x=0;this._parent.NewOffset.y=(f-1)*this._size;if(this._parent.IsDataFetched()){this._parent.Super.ObjectMgr.PageBinder.QueuePostPaintMessage(this._parent.Super.PageBinder)}}};this.Next=function(){this.Set(this.Current+1)};this.Prev=function(){this.Set(this.Current-1)};this.StartItem=function(){return(this.Current-1)*this._size}};this.SetOffset=function(c){var b=Math.ceil(c.y/this.PageSize.y);if(!this.Rows[b]&&b<=this.TotalSize.y){c.y=b;this.Super.ObjectMgr.PartialLoad(this.Super.Name,c)}else{this.Super.ObjectMgr.QueuePostPaintMessage(this.Super.PageBinder)}};this.SetPagesize=function(b){this.PageSize=b;var c={};c.pageSize=b.x+":"+b.y;this.Super.DocumentMgr.Set(this.Super.Name,c)};this.SetPagesizeX=function(c){var b={};b.x=c;b.y=this.PageSize.y;this.SetPagesize(b)};this.SetPagesizeY=function(c){var b={};b.x=this.PageSize.x;b.y=c;this.SetPagesize(b)};case"MB":this.SetRect=function(c,b){this.Super.DocumentMgr.Set(this.Super.Name,"rect",c,b)}}this.IsDataFetched=function(){if(this.Super.ObjectMgr.Mode==="invalid"||this.PageSize.x===0){return true}var j=this.NewOffset;var h=this.PageSize.y*Math.floor(j.y/this.PageSize.y);var c=this.PageSize.x*Math.floor(j.x/this.PageSize.x);var f=h+this.PageSize.y;var b=c+this.PageSize.x;var g=(this.Page===undefined)?this.PageSize.y:this.Page._size;var i=(this.Page===undefined)?this.PageSize.x:this.Page._size;var d={};if(this.Rows[j.y]===undefined&&j.y<=this.TotalSize.y){d.y=h;d.x=c}else{if(this.Rows[j.y+g]===undefined&&j.y+g<=this.TotalSize.y){d.y=f;d.x=c}else{if(this.Rows[j.y][j.x]===undefined&&j.x<=this.TotalSize.x){d.x=c;d.y=h}else{if(this.Rows[j.y][j.x+i]===undefined&&j.x+i<=this.TotalSize.x){d.x=b;d.y=h}else{if(j.y+g<=this.TotalSize.y){if(this.Rows[j.y+g][j.x+i]===undefined&&j.x+i<=this.TotalSize.x){d.y=f;d.x=b}}}}}}if(d.x!==undefined){this.Super.ObjectMgr.PartialLoad(this.Super.Name,d);return false}else{return true}}},Layout:function(a){this.ObjectId="";this.Super=a;this.SetProperty=function(b,d,c){this.Super.DocumentMgr.Set(this.Super.Name,{property:b,value:d},c)}},Wrapper:function(a){this.Element=a.Element;if(typeof(a.PageBinder)!=="undefined"&&typeof(a.PageBinder.GetMaxClientHeight)!=="undefined"){this.GetHeight=a.PageBinder.GetMaxClientHeight}else{this.GetHeight=function(){return 0}}if(typeof(a.PageBinder)!=="undefined"&&typeof(a.PageBinder.GetMaxClientWidth)!=="undefined"){this.GetWidth=a.PageBinder.GetMaxClientWidth}else{this.GetWidth=function(){return 0}}this.PageBinder=a;this.DocumentMgr=typeof(a.PageBinder.PageBinder)!=="undefined"?a.PageBinder.PageBinder:a.PageBinder;this.ObjectMgr=typeof(a.PageBinder.PageBinder)!=="undefined"?a.PageBinder:a;this.Name=this.ObjectMgr.Name;this.Type=this.ObjectMgr.Type;this.Data=new Qva.Public.Data(this);this.Layout=new Qva.Public.Layout(this);this.GetQvObject=function(d,b){var c=this.DocumentMgr.GetQvObject(d,b,this);if(c.IsInvalid()){this.DocumentMgr.Load(true)}return c};this.IsInvalid=function(){var b=true;if(typeof(this.ObjectMgr.IsInvalid)!=="undefined"){b=this.ObjectMgr.IsInvalid()}return b};switch(this.Type){case"IB":this.GetVariable=function(b){if(b==undefined){b=0}if(this.Data.Rows[b]){return this.Data.Rows[b][2]}return null};this.SetVariable=function(d,c){if(c==undefined){c=0}var b={};b.text=d;this.DocumentMgr.Set(this.Name+".V"+c,b)};break;case"TX":this.GetText=function(){if(this.Layout&&this.Layout.Content&&this.Layout.Content.text){return this.Layout.Content.text}return null};break;case"BU":this.Click=function(){var b={};b.action="";this.DocumentMgr.Set(this.Layout.ObjectId,b)};break}},__namespace:true};Qva.Public.Wrapper.__class=true;Qva.Help={Show:function(c){var b="Toolbar";if(this.Context&&this.Context.Topic){var d=window.document.getElementById(this.Context.Name);if(d&&d.AvqMgr){b=this.Context.Topic}}var a=c.replace("{topic}",b);window.open(a,"MCWebHelp")}};Qva.InvertColor=function(f){var j,i,h,c,d;if(f.indexOf("#")===0){f=Qva.Hex2RGBA(f)}else{if(f.indexOf("rgb(")===0){f=f.replace("rgb(","rgba(");f=f.replace(")",",0)")}}f=f.replace(/\s+/g,"");j=f.split(",");i=parseInt(255-j[0].substr(5));h=parseInt(255-j[1]);c=parseInt(255-j[2]);d=parseFloat(1-j[3].replace(")",""));return"rgba("+i+","+h+","+c+","+d+")"};Qva.Hex2RGBA=function(b){Assert(b.length===9);var a=b.substr(3).match(/(.{2})/g),c=(parseInt(b.substr(1,2),16)/255).toFixed(2);a[0]=parseInt(a[0],16);a[1]=parseInt(a[1],16);a[2]=parseInt(a[2],16);return"rgba("+a.join(", ")+", "+c+")"};Qva.Hex2CSSExpression=function(a){var c=null;if(a&&a.indexOf("#")===0){try{if(!IS_IE||(IE_VERSION>=9&&IE_DOCMODE>=9)){c=Qva.Hex2RGBA(a)}}catch(b){Assert(false);c=null}}return c};Qva.ApplyGradientToElement=function(a,d,f,k,h,g){var j=Qva.Hex2RGBA(f),c=Qva.Hex2RGBA(k),b=false;try{h.style.backgroundColor="";if(a==="0"){switch(d){case"3":if(IS_WEBKIT){h.style.backgroundImage="-webkit-gradient(linear, center top, center bottom, from("+c+"), color-stop(0.5, "+j+"), to("+c+"))";b=true}else{if(IS_GECKO){h.style.backgroundImage="-moz-linear-gradient(top, "+c+","+j+" 50%, "+c+")";b=true}}break;case"2":if(IS_WEBKIT){h.style.backgroundImage="-webkit-gradient(linear, center top, center bottom, from("+j+"), color-stop(0.5, "+c+"), to("+j+"))";b=true}else{if(IS_GECKO){h.style.backgroundImage="-moz-linear-gradient(top, "+j+","+c+" 50%, "+j+")";b=true}}break;case"1":if(IS_WEBKIT){h.style.backgroundImage="-webkit-gradient(linear, center bottom, center top, from("+j+"), to("+c+"))";b=true}else{if(IS_GECKO){h.style.backgroundImage="-moz-linear-gradient(bottom, "+j+","+c+")";b=true}else{if(IS_IE){h.style.filter="progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr="+k+", EndColorStr="+f+");";b=true}}}break;case"0":default:if(IS_WEBKIT){h.style.backgroundImage="-webkit-gradient(linear, center top, center bottom, from("+j+"), to("+c+"))";b=true}else{if(IS_GECKO){h.style.backgroundImage="-moz-linear-gradient(top, "+j+","+c+")";b=true}else{if(IS_IE){h.style.filter="progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr="+f+", EndColorStr="+k+");";b=true}}}break}}else{if(a==="1"){switch(d){case"3":if(IS_WEBKIT){h.style.backgroundImage="-webkit-gradient(linear, left center, right center, from("+c+"), color-stop(0.5,"+j+"),   to("+c+"))";b=true}else{if(IS_GECKO){h.style.backgroundImage="-moz-linear-gradient(left, "+c+", "+j+" 50%, "+c+")";b=true}}break;case"2":if(IS_WEBKIT){h.style.backgroundImage="-webkit-gradient(linear, left center, right center, from("+j+"), color-stop(0.5,"+c+"),   to("+j+"))";b=true}else{if(IS_GECKO){h.style.backgroundImage="-moz-linear-gradient(left, "+j+", "+c+" 50%, "+j+")";b=true}}break;case"1":if(IS_WEBKIT){h.style.backgroundImage="-webkit-gradient(linear, right center, left center, from("+j+"), to("+c+"))";b=true}else{if(IS_GECKO){h.style.backgroundImage="-moz-linear-gradient(right, "+j+", "+c+")";b=true}else{if(IS_IE){h.style.filter="progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr="+k+", EndColorStr="+f+");";b=true}}}break;case"0":default:if(IS_WEBKIT){h.style.backgroundImage="-webkit-gradient(linear, left center, right center, from("+j+"), to("+c+"))";b=true}else{if(IS_GECKO){h.style.backgroundImage="-moz-linear-gradient(left, "+j+", "+c+")";b=true}else{if(IS_IE){h.style.filter="progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr="+f+", EndColorStr="+k+");";b=true}}}break}}}}catch(i){Assert(false);b=false}if(!b&&g){b=Qva.ApplyGradientToElement("0","0",f,k,h,false)}return b};Qva.JsToXml=function(f,b){switch(typeof f){case"object":var a="";if(f.length==undefined){for(var d in f){if(d=="Super"){continue}var g=f[d];if(typeof g=="function"){continue}if(b){a+=" "}a+="<"+d+">"+Qva.JsToXml(g,b)+"</"+d+">"}}else{for(var c=0;c<f.length;++c){if(b){a+=" "}a+="<e>"+Qva.JsToXml(f[c],b)+"</e>"}}return a;default:return Qva.XmlEncode(""+f)}};Qva.JsEncode=function(a){var b=""+a;b=b.replace(/\\/g,"\\\\");b=b.replace(/'/g,"\\'");return b};Qva.JsToText=function(f,b){switch(typeof f){case"object":if(f.length==undefined){var a="{";for(var d in f){if(d=="Super"){continue}var g=f[d];if(typeof g=="function"){continue}if(a.length>1){a+=","}if(b){a+="\n"}a+=d+":"+Qva.JsToText(g,b)}return a+"}"}else{var a="[";for(var c=0;c<f.length;++c){if(a.length>1){a+=","}if(b){a+="\n"}a+=Qva.JsToText(f[c],b)}return a+"]"}default:return Qva.JsEncode(""+f)}};function Assert(a){}Qva.AddProxyIfAny=function(a){if(!this.Proxy){return a}var c=this.Proxy+"?u=";if(a.indexOf(c)==0){a=a.substring(c.length);a=unescape(a);a=a.replace("%2B","+");a=a.replace("%2F","/")}var b=escape(a);b=b.replace("+","%2B");b=b.replace("/","%2F");return c+b};Qva.AddProxyToUrlsInStyleSheets=function(){try{for(var g=0;g<document.styleSheets.length;g++){var b=document.styleSheets[g].href;if(b==null){continue}if(b.indexOf("QvAjaxZfc")==-1){continue}var l;try{l=document.styleSheets[g].rules?document.styleSheets[g].rules:document.styleSheets[g].cssRules}catch(h){continue}if(!l){continue}for(var j=0;j<l.length;j++){var d;try{d=l[j].style.cssText?l[j].style.cssText:l[j].cssText}catch(h){continue}if(!d){continue}var f=0;while(d.indexOf("url(",f)!=-1){var c=d.indexOf("url(");f=d.indexOf(")",c);var a=d.substring(c+4,f);a=a.replace(new RegExp("(\"|')","g"),"");var k=b.lastIndexOf("%2f")+3>b.lastIndexOf("/")+1?b.lastIndexOf("%2f")+3:b.lastIndexOf("/")+1;var n=b.substring(0,k);if(a.indexOf(n)==-1){a=n+a}var m=a;m='"'+m+'"';d=d.substring(0,c+4)+m+d.substring(f);if(l[j].style.cssText){l[j].style.cssText=d}else{l[j].cssText=d}}}}}catch(h){}};Qva.ConsoleLog={SeverityTypes:{None:0,Normal:1,Verbose:2},Severity:0,LogExists:typeof(console)!=="undefined"&&console.log,Log:function(b,a){if(typeof(a)==="undefined"){a=Qva.ConsoleLog.Severity}if(Qva.ConsoleLog.LogExists&&a<=Qva.ConsoleLog.Severity){console.log(b)}},LogAllObjectProperties:function(a){for(props in a){this.Log(props+": "+a[props])}}};Qva.ExecuteBodyOnLoadFunctionNames=function(){for(var c in Qva.binders){if(!Qva.binders[c].Enabled){window.setTimeout(Qva.ExecuteBodyOnLoadFunctionNames,40);return}}for(var a=0;a<Qva.BodyOnLoadFunctionNames.length;a++){if(typeof Qva.BodyOnLoadFunctionNames[a]==="string"){var b=window[Qva.BodyOnLoadFunctionNames[a]];if(typeof b=="function"){b()}}else{if(typeof Qva.BodyOnLoadFunctionNames[a]==="function"){Qva.BodyOnLoadFunctionNames[a]()}}}Qva.BodyOnLoadFunctionNames=[]};if(!Qva.Mgr){Qva.Mgr={}}Qva.Mgr.objectstyle=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}a.AddManager(this);this.Element=c;this.radiustopleft=-1;this.radiustopright=-1;this.radiusbottomleft=-1;this.radiusbottomright=-1;this.InlineStyle=a.InlineStyle};function SetRoundedCorner(c,g,b,f,a,d){if(!c){return}if(IS_GECKO){c.style["MozBorderRadius"+f]=a+"px"}else{if(IS_WEBKIT){c.style["WebkitBorder"+b+"Radius"]=a+"px"}else{c.style["border"+b+"Radius"]=a+"px"}}SetRoundedCorner(g,null,b,f,a-d)}function CornerMayBeChanged(d,c,b){var a=parseFloat(b.getAttribute(c));if(d[c]!=a){d[c]=a;return true}return false}Qva.Mgr.objectstyle.prototype.Paint=function(i,d,a,k){if(k){return}if(d.getAttribute("bordercolor")){this.PageBinder.BorderColor=HtmlifyARGB(d.getAttribute("bordercolor"));this.PageBinder.ActiveBorderColor=HtmlifyARGB(d.getAttribute("activebordercolor"));if(d.getAttribute("borderstyle")){this.PageBinder.BorderStyle=d.getAttribute("borderstyle")}}this.PageBinder.BorderAroundContent=d.getAttribute("borderposition")=="content";var c=parseInt(d.getAttribute("borderwidth"));if(isNaN(c)){c=0}var m=this.PageBinder.BorderWidth!=c;this.PageBinder.BorderWidth=c;if(m){this.PageBinder.UpdateMoveAndResizeHandles(this.Element)}if(!IS_IE||IE_VERSION>8&&this.InlineStyle){var h=this.Element;var l=d;var j=CornerMayBeChanged(this,"radiustopleft",l);j|=CornerMayBeChanged(this,"radiustopright",l);j|=CornerMayBeChanged(this,"radiusbottomleft",l);j|=CornerMayBeChanged(this,"radiusbottomright",l);var n=null;for(var g=0;g<h.childNodes.length;g++){var b=h.childNodes[g];if(!b.style){continue}if(b.style.display=="none"){continue}if(b.className=="ResizeFrame"){continue}n=b;break}if(this.FirstChild!=n){this.FirstChild=n;j=true}var f=null;for(var g=h.childNodes.length-1;g>=0;g--){var b=h.childNodes[g];if(!b.style){continue}if(b.style.display=="none"){continue}if(b.className=="MoveZone"){continue}f=b;break}if(this.LastChild!=f){this.LastChild=f;j=true}if(j==true){SetRoundedCorner(h,this.FirstChild,"TopLeft","Topleft",this.radiustopleft,this.PageBinder.BorderWidth);SetRoundedCorner(h,this.FirstChild,"TopRight","Topright",this.radiustopright,this.PageBinder.BorderWidth);SetRoundedCorner(h,this.LastChild,"BottomRight","Bottomright",this.radiusbottomright,this.PageBinder.BorderWidth);SetRoundedCorner(h,this.LastChild,"BottomLeft","Bottomleft",this.radiusbottomleft,this.PageBinder.BorderWidth)}}SetActiveStyle(this.PageBinder,false);this.PageBinder.Resized()};Qva.PageBinding.prototype.GetMaximizedRect=function(f){var a=document.getElementById("PageContainer");var d=Qva.GetAbsolutePageCoords(a).y;var i=Qva.GetScrollTop();var j=Qva.GetViewportHeight();var b=Qva.GetViewportWidth();var c=Qva.GetScrollLeft();var h=Math.max(i-d,0);if(i<d){j-=(d-i)}var g={};g.height=""+j;g.width=""+b;g.left=""+c;g.top=""+h;return g};Qva.Mgr.SizeElement=function(c,f){var d=parseInt(f.width);var a=parseInt(f.height);var b=false;if(c.rect==null){c.style.left=parseFloat(f.left)+"px";c.style.top=parseFloat(f.top)+"px";c.style.width=d+"px";c.style.height=a+"px";b=true}else{if(f!=c.rect){if(f.left!=c.rect.left){c.style.left=parseFloat(f.left)+"px"}if(f.top!=c.rect.top){c.style.top=parseFloat(f.top)+"px"}if(f.width!=c.rect.width||f.height!=c.rect.height){c.style.width=d+"px";c.style.height=a+"px";b=true}}}c.rect=f;return b};Qva.Mgr.CreateAndUpdateResizeHandles=function(l,p,d,x){var y=2;var v=2;var k=4;var h=4;var q=parseInt(l.style.width);var b=parseInt(l.style.height);if(IS_IE6_OR_IE7){q+=2*p;b+=2*p}var t=l.id+"_resize";var j=document.getElementById(t);if(!j){var j=document.createElement("div");j.id=t;j.className="ResizeFrame";j.ResizeType="Parent";l.insertBefore(j,l.firstChild)}if(IS_IE6_OR_IE7){j.style.left="0px";j.style.top="0px"}else{j.style.left=-p+"px";j.style.top=-p+"px"}j.style.height="1px";j.style.width="1px";var a=d?["br","r","b"]:["br","r","b","bl","l","tl","t","tr"];switch(x){case"height":a=["t","b"];break;case"width":a=["l","r"];break}for(var r=0;r<a.length;r++){var c=l.id+"_resize_"+a[r];var w=document.getElementById(c);if(!w){var w=document.createElement("div");w.id=c;w.ResizeType=a[r];j.appendChild(w);w.className="ResizeZone"}var u=0;var s=0;if(IS_IE6_OR_IE7){u=-p;s=-p}if(a[r].indexOf("r")!=-1){var g=u+q-k}else{if(a[r].indexOf("l")!=-1){var g=u-h}else{var g=u+k}}if(a[r].indexOf("b")!=-1){var m=s+b-k}else{if(a[r].indexOf("t")!=-1){var m=s-v}else{var m=s+k}}if(a[r].indexOf("r")!=-1||a[r].indexOf("l")!=-1){var o=k+h}else{var o=q-2*k}if(a[r].indexOf("b")!=-1){var n=k+h}else{if(a[r].indexOf("t")!=-1){var n=k+v}else{var n=b-2*k}}var f="";if(a[r].indexOf("t")!=-1){f="n"}else{if(a[r].indexOf("b")!=-1){f="s"}}if(a[r].indexOf("l")!=-1){f+="w"}else{if(a[r].indexOf("r")!=-1){f+="e"}}w.style.cssText="width: "+o+"px; height: "+n+"px; cursor: "+f+"-resize; left: "+g+"px; top: "+m+"px;";w.onmousedown=function(i){Qva.Resize.mouseDown(i,l)}}};Qva.Mgr.CreateOrDeleteMoveHandle=function(b,f,c,g){var i=b.id+"_move";var a=document.getElementById(i);if(c){var j=g?parseInt(b.style.height):4,h=g?0:-6-f,d=parseInt(b.style.width);if(IS_IE6_OR_IE7){d+=2*f}if(d<10){d=10}if(!a){a=document.createElement("div");a.id=i;a.className="MoveZone";a.style.cssText="width: "+d+"px; height: "+j+"px; left: "+0+"px; top: "+h+"px;";a.Name=b.Name;a.moveObj=b.id;a.onmousedown=Qva.Move.mouseDown;b.appendChild(a)}a.style.cssText="width: "+d+"px; height: "+j+"px; left: "+0+"px; top: "+h+"px;"}else{if(a){b.removeChild(a)}}};Qva.Mgr.object=function(b,d,a,g,c,f){if(!Qva.MgrSplit(this,a,g)){return}b.AddManager(this);this.Managers=new Array();this.Members={};this.Element=d;this.binderid=b.binderid;d.binderid=b.binderid;d.ObjectId=d.id;d.Name=this.Name;d.AvqMgr=this;this.LeftButton=b.LeftButton;this.TableLimit=b.TableLimit;this.IsHosted=b.IsHosted;this.FirstTime=true;this.BorderColor=null;this.BorderStyle=null;this.BorderWidth=0;if(Qva.LabelClick){d.onclick=function(k){Qva.GetBinder(b.binderid).SetClick(k,this.ObjectId)}}Qva.DragDrop.DropFrames[Qva.DragDrop.DropFrames.length]=this;var h=b.DefaultScope+".DS";if(Qva.LabelClick&&this.PageBinder.CreateTransientListBox&&b.Members&&!b.Members[h]){this.PageBinder.CreateTransientListBox(h)}this.InlineStyle=b.InlineStyle;if(d.getAttribute("AvqStyle")){this.InlineStyle=d.getAttribute("AvqStyle")=="true"}new Qva.Mgr.objectstyle(this,this.Element,a+".Style",g);var a=this.Name.substr("Document.".length);this.poll={name:a,clearcache:"true"};this.PostPaintQueue=[];if(!f){var j=document.createElement("div");j.style.display="none";j.className="QvCaption";j.innerText=" ";d.appendChild(j);new Qva.Mgr.caption(this,j,this.Name+".Caption")}else{this.FirstTime=false}var i=document.createElement("div");i.className="QvContent";i.style.cssText="height:auto; width:auto;";d.appendChild(i);this.ContentElement=i;new Qva.Mgr.background(this,i,this.Name+".Background");new Qva.Mgr.fullsize(this,i,this.Name)};Qva.Mgr.object.prototype.Remove=function(){var a;for(a=0;a<this.Managers.length;a++){if(this.Managers[a].Remove){this.Managers[a].Remove()}}for(a=0;a<Qva.DragDrop.DropFrames.length;++a){if(Qva.DragDrop.DropFrames[a]===this){Qva.DragDrop.DropFrames[a]=Qva.DragDrop.DropFrames[Qva.DragDrop.DropFrames.length-1];Qva.DragDrop.DropFrames.length=Qva.DragDrop.DropFrames.length-1}}var b=document.getElementById(this.Element.id+"_minimized");if(b){if(IS_IE){b.outerHTML="   "}else{b.parentNode.removeChild(b)}}purge(this.Element);if(IS_IE){this.Element.outerHTML="   "}else{this.Element.parentNode.removeChild(this.Element)}};Qva.Mgr.object.prototype.UpdateMoveAndResizeHandles=function(b,c,f){var a=false;if(f){this.AllowResize=f.allowresize=="true";this.AllowMove=f.allowmove=="true";a=f.allowresize=="height"}var d=this.BorderAroundContent?0:this.BorderWidth;if(this.AllowResize||a){Qva.Mgr.CreateAndUpdateResizeHandles(b,d,c,a?"height":"true")}else{var g=b.firstChild;if(g&&g.className!="ResizeFrame"){g=null}if(g){b.removeChild(g)}}Qva.Mgr.CreateOrDeleteMoveHandle(b,d,this.AllowMove,c)};Qva.Mgr.object.prototype.Size=function(d){var b=this.Element;var a=window.document.getElementById(b.id+"_minimized");var c={};c.left=d.left;c.top=d.top;c.width=d.width;c.height=d.height;this.Maximized=false;var f=d.mode;if(f=="minimized"){b.style.display="none";if(!a){return}a.style.display="";if(Qva.Mgr.SizeElement(a,c)){this.UpdateMoveAndResizeHandles(a,true,d)}}else{if(f=="hidden"){if(a){a.style.display="none"}b.style.display="none"}else{if(f=="maximized"||d.maximized=="true"){this.Maximized=true;c=this.PageBinder.GetMaximizedRect&&this.PageBinder.GetMaximizedRect(b);if(a){a.style.display="none"}if(Qva.Mgr.SizeElement(b,c)){this.Resized();d.allowmove=false;d.allowresize=false;this.UpdateMoveAndResizeHandles(b,false,d)}b.style.display=""}else{if(d.left!=null){if(a){a.style.display="none"}if(Qva.Mgr.SizeElement(b,c)){this.Resized();this.UpdateMoveAndResizeHandles(b,false,d)}b.style.display=""}}}}};Qva.Mgr.object.prototype.Resized=function(){this.SetObjectWidth(0);this.SetObjectHeight(0);for(var a=0;a<this.Managers.length;++a){if(!this.Managers[a].PostPaint){continue}if(this.Managers[a].Fixed){this.Managers[a].Fixed=false}this.QueuePostPaintMessage(this.Managers[a])}};Qva.Mgr.object.prototype.HandleKeyUp=function(a){var b=Qva.SpecialActions.GetAction(a);if(b){if(!b.document){this.Set(this.Name+"."+b.id,"action","",true);return true}else{Assert(false)}}return false};Qva.Mgr.object.prototype.Inside=function(i,f){var g=this.Element;var d=Qva.GetPageCoords(g);var c=parseInt(g.offsetWidth);var a=parseInt(g.offsetHeight);if(i.x>d.x&&i.x<d.x+c&&i.y>d.y&&i.y<d.y+a){for(var h=0;h<this.DropTypes.length;h++){var b=this.DropTypes[h];if(b==f){return{Element:g,Dialog:"Drop.qvpp"}}}return{Element:null}}return null};Qva.Mgr.object.prototype.PostPaint=function(){if(!this.Element){return}if(this.Extension&&!this.FirstTime&&!Qva.Mgr[this.Extension].prototype.PostPaint){var c=Qva.ExtensionCreator[this.Extension];if(c==null){Qva.ExtensionCreator[this.Extension]=Qva.WaitingForRequest;Qva.RequestScript(this.Extension,this.PageBinder)}else{if(c!=Qva.WaitingForRequest){Assert(false)}}this.PageBinder.QueuePostPaintMessage(this);return}if(this.PostPaintQueue.length==0){return}var a=this.PostPaintQueue;this.PostPaintQueue=[];for(var b=0;b<a.length;++b){if(a[b].PostPaint){a[b].PostPaint()}}};Qva.Mgr.object.prototype.QueuePostPaintMessage=function(b){this.PageBinder.QueuePostPaintMessage(this);for(var a=0;a<this.PostPaintQueue.length;++a){if(this.PostPaintQueue[a]==b){return}}this.PostPaintQueue.push(b)};Qva.Mgr.object.prototype.CreateBookmarkButton=function(g,h){var a=g.insertCell(-1);a.style.cssText="padding:0px 2px 0px 2px;";var d=document.createElement("button");d.setAttribute("type","button");var c=document.createElement("img");c.galleryimg="no";c.style.cssText="float:left;";d.appendChild(c);var b=document.createTextNode(" ");d.appendChild(b);var f=document.createElement("span");d.appendChild(f);d.PageBinder=this;d.onmouseover=function(){this.style.border="outset 1px Gray"};d.onmouseout=function(){this.style.border="outset 1px Transparent"};a.appendChild(d);new Qva.Mgr.visibility(this,a,this.Name+h);new Qva.Mgr.action(this,d,this.Name+h);new Qva.Mgr.style(this,d,this.Name+".Style");new Qva.Mgr.binary(this,c,this.Name+h);new Qva.Mgr.text(this,f,this.Name+h)};Qva.Mgr.object.prototype.CreateBookmark=function(){this.ContentElement.className+=" QvBookmarkObject";var g=document.createElement("table");var b=document.createElement("colgroup");var d=document.createElement("col");d.style.cssText="width:45%;";b.appendChild(d);d=document.createElement("col");d.style.cssText="width:55%;";b.appendChild(d);g.appendChild(b);var h=g.insertRow(-1);var c=h.insertCell(-1);c.style.cssText="padding:2px 4px 10px 4px;";c.colSpan=2;var a=document.createElement("select");c.appendChild(a);var f=g.insertRow(-1);this.CreateBookmarkButton(f,".ADD");this.CreateBookmarkButton(f,".REM");this.ContentElement.appendChild(g);new Qva.Mgr.bookmarkselect(this.PageBinder,a,this.PageBinder.DefaultScope+".Bookmarks");new Qva.Mgr.style(this,a,this.Name+".Style")};Qva.Mgr.object.prototype.CreateButton=function(){this.ContentElement.className+=" QvButton";var b=document.createElement("button");b.style.cssText="cursor: pointer; width: auto; height: auto;";var a=document.createElement("img");a.galleryimg="no";b.appendChild(a);this.ContentElement.appendChild(b);new Qva.Mgr.actions(this,b,this.Name+".Content");new Qva.Mgr.button(this,b,this.Name+".Content")};Qva.Mgr.object.prototype.CreateTextOrLineObject=function(b){if(b){var d=document.createElement("table");d.className="TextObject";d.style.cssText="height:100%; width:100%;";var f=d.insertRow(-1);var a=f.insertCell(-1);this.ContentElement.appendChild(d)}if(b){var c=new Qva.Mgr.text(this,a,this.Name+".Content");if(c){c.MultiLine=true}new Qva.Mgr.style(this,a,this.Name+".Style");new Qva.Mgr.style(this,a,this.Name+".Content.Style");new Qva.Mgr.scroll(this,this.ContentElement,this.Name+".Content")}new Qva.Mgr.actions(this,this.ContentElement,this.Name+".Content")};Qva.Mgr.object.prototype.CreateListBox=function(){var a=document.createElement("div");a.className="QvListbox";this.ContentElement.appendChild(a);new Qva.Mgr.listbox(this,a,this.Name);new Qva.Mgr.style(this,a,this.Name+".Style");if(IS_TOUCHENABLED){Qva.Touch.Listbox.AddTouchSupport(this.ContentElement)}};Qva.Mgr.container=function(a,d,c,f){if(!Qva.MgrSplit(this,c,f)){return}this.Appearance=null;this.Children=null;this.Element=d;this.NavigatorElement=null;this.Touched=false;this.NavigatorItems=new Array();this.binderid=a.binderid;this.NavigatorElement=document.createElement("div");var b=document.createElement("div");this.Element.appendChild(this.NavigatorElement);this.Element.appendChild(b);this.Children=new Qva.Mgr.children(a,b,this.Name+".Children");new Qva.Mgr.style(a,a.Element,this.Name+".Style");a.AddManager(this);this.NavigatorElement.onclick=function(g){Qva.CancelBubble(g)}};Qva.Mgr.container.prototype={Appearance:null,AppearanceEnum:{Top:"top",Left:"left",Right:"right",Bottom:"bottom",Drop:"drop"},Children:null,Touched:null,Element:null,NavigatorElement:null,NavigatorItems:[{itemId:"",elem:null}],NavigatorChange:function(b){var a=Qva.GetBinder(this.binderid);if(a.Enabled&&this.NavigatorElement.SelectedVal!==b){a.Set(this.Name,"select",b,true);this.NavigatorElement.SelectedVal=b}},RemoveNavigatorContent:function(){while(this.NavigatorElement.firstChild){this.NavigatorElement.removeChild(this.NavigatorElement.firstChild)}},TabClick:function(c,a){if(!c){c=window.event}var b=c.target||c.srcElement;if(b&&b.tagName==="DIV"&&b.ObjectId){a.NavigatorChange(b.ObjectId)}else{if(b&&b.tagName==="IMG"&&b.parentNode.tagName==="DIV"&&b.parentNode.ObjectId){a.NavigatorChange(b.parentNode.ObjectId)}}},GetLargestTabHeight:function(){var b=0,c=0,a=this.NavigatorItems.length,d=0;for(;c<a;c++){d=getClientHeight(this.NavigatorItems[c].elem);if(b<d){b=d}}return b}};Qva.Mgr.container.__class=true;Qva.Mgr.container.prototype.Paint=function(m,s){var k=this,j=s.getAttribute("appearance"),w=s.getElementsByTagName("element"),r=w.length,t=0,b=(k.Appearance!==j)||(k.NavigatorItems.length!==r);if(!b&&(k.NavigatorItems.length>0&&r>0)){for(;t<r;t++){if(w[t].getAttribute("id")!==k.NavigatorItems[t].itemId||w[t].getAttribute("text")!==k.NavigatorItems[t].elem.value){b=true;break}}}k.Touched=true;k.NavigatorElement.SelectedVal=s.getAttribute("selected");if(b){k.NavigatorItems=new Array();k.Appearance=j;k.RemoveNavigatorContent();var q="",l="";switch(k.Appearance){case k.AppearanceEnum.Drop:var f=document.createElement("select");f.style.width="100%";f.style.height="100%";k.NavigatorElement.appendChild(f);for(t=0;t<r;t++){l=w[t].getAttribute("text");q=w[t].getAttribute("id");var n=document.createElement("option");n.innerText=l;n.value=q;f.appendChild(n);k.NavigatorItems.push({itemId:q,elem:n})}f.onchange=function(){k.NavigatorChange(f.options[f.selectedIndex].value)};break;case k.AppearanceEnum.Top:case k.AppearanceEnum.Bottom:var c=null,h=null,v=null,l="",g=getClientWidth(this.PageBinder.Element),o=Math.round(g/w.length),p=3,a=1,d=0;for(t=0;t<r;t++){c=document.createElement("div");c.onclick=function(i){k.TabClick(i,k)};c.className="QvTab QvFloatLeft";c.style.width=o-p*2-a+"px";c.ObjectId=w[t].getAttribute("id");v=w[t].getAttribute("icon");if(v){var x=document.createElement("img");x.src=Qva.GetBinder(this.binderid).BuildBinaryUrl(null,null,v);x.className="QvTabIcon";c.appendChild(x)}l=w[t].getAttribute("text");l=l?l.replace(/\t/g," "):" ";c.appendChild(document.createTextNode(l));if(t===0){h=document.createElement("div");h.className="QvTabLineVertical QvFloatLeft";h.style.marginRight="3px";h.style.height="100%";k.NavigatorElement.appendChild(h);var u=g-o*w.length;c.style.width=o+u-p*2-a*2+"px"}h=document.createElement("div");h.className="QvTabLineVertical QvFloatLeft";if(t!==w.length-1){h.style.marginRight=p+"px"}h.style.marginLeft=p+"px";h.style.height="100%";k.NavigatorElement.appendChild(c);k.NavigatorElement.appendChild(h);d=getClientHeight(c);k.NavigatorItems.push({itemId:c.ObjectId,elem:c})}break;case k.AppearanceEnum.Left:case k.AppearanceEnum.Right:default:var c=null,h=null,v=null,l="";for(t=0;t<w.length;t++){if(t===0){h=document.createElement("div");h.className="QvTabLineHorizontal QvTabLineTop";k.NavigatorElement.appendChild(h)}c=document.createElement("div");c.onclick=function(i){k.TabClick(i,k)};c.className="QvTab";c.ObjectId=w[t].getAttribute("id");v=w[t].getAttribute("icon");if(v){var x=document.createElement("img");x.src=Qva.GetBinder(this.binderid).BuildBinaryUrl(null,null,v);x.className="QvTabIcon";c.appendChild(x)}l=w[t].getAttribute("text");l=l?l.replace(/\t/g," "):" ";c.appendChild(document.createTextNode(l));h=document.createElement("div");h.className="QvTabLine QvTabLineHorizontal";if(this.Appearance===this.AppearanceEnum.Left){c.className+=" QvTabLeft";h.className+=" QvTabLineLeftAdjusted"}else{if(this.Appearance===this.AppearanceEnum.Right){c.className+=" QvTabRight";h.className+=" QvTabLineRightAdjusted"}}k.NavigatorElement.appendChild(c);k.NavigatorElement.appendChild(h);k.NavigatorItems.push({itemId:c.ObjectId,elem:c})}break}}SetActiveStyle(k.PageBinder,true);k.PageBinder.QueuePostPaintMessage(this)};Qva.Mgr.container.prototype.PostPaint=function(){var n=this.PageBinder.GetContentMaxHeight(this.Element),m="100%",g=0,a="none",k="0px 0px 0px 0px",d="0px",b="0px",o=this.PageBinder.GetMaxClientWidth(),h=n-g,c="relative",j=0;this.Element.style.height=n+"px";switch(this.Appearance){case this.AppearanceEnum.Drop:case this.AppearanceEnum.Top:k="3px 0px";if(this.Appearance===this.AppearanceEnum.Drop){g="22"}else{g=this.GetLargestTabHeight()}h=n-g-6;break;case this.AppearanceEnum.Bottom:c="absolute";g=this.GetLargestTabHeight();h=n-g-3;k=h+3+"px 0px 0px 0px";break;case this.AppearanceEnum.Right:case this.AppearanceEnum.Left:default:c="absolute";a="left";var f=120;m=f+"px";g=n;b=m;d="0px";o-=f;h=n;if(this.Appearance===this.AppearanceEnum.Right){a="right";b="0px";k="0px 0px 0px "+o+"px"}break}this.NavigatorElement.style.cssFloat=a;this.NavigatorElement.style.styleFloat=a;this.NavigatorElement.style.margin=k;this.NavigatorElement.style.position="relative";this.NavigatorElement.style.left="0px";this.NavigatorElement.style.top="0px";this.NavigatorElement.style.width=m;this.NavigatorElement.style.height=g+"px";this.Children.Element.style.position=c;this.Children.Element.style.top=d;this.Children.Element.style.left=b;this.Children.Element.style.width=o+"px";this.Children.Element.style.height=h+"px";switch(this.Appearance){case this.AppearanceEnum.Top:case this.AppearanceEnum.Left:case this.AppearanceEnum.Right:case this.AppearanceEnum.Bottom:for(j=0;j<this.NavigatorItems.length;j++){if(this.NavigatorItems[j].itemId===this.NavigatorElement.SelectedVal){if(this.NavigatorItems[j].elem.className.indexOf("QvTabSelected")===-1){this.NavigatorItems[j].elem.className+=" QvTabSelected"}}else{this.NavigatorItems[j].elem.className=this.NavigatorItems[j].elem.className.replace("QvTabSelected","")}}break;case this.AppearanceEnum.Drop:var p=this.NavigatorElement.getElementsByTagName("select");if(p&&p.length===1){p=p[0]}p.value=this.NavigatorElement.SelectedVal;break;default:break}for(j=0;j<this.Children.Managers.length;++j){var l=this.Children.Managers[j];if(l.Element.style.display===""){l.Size({mode:"enabled",maximized:"true"})}}};Qva.Mgr.object.prototype.CreateContainer=function(){new Qva.Mgr.container(this,this.ContentElement,this.Name)};Qva.Mgr.object.prototype.CreateBasicTable=function(){var a=document.createElement("div");a.className="QvGrid";this.ContentElement.appendChild(a);new Qva.Mgr.grid(this,a,this.Name);new Qva.Mgr.style(this,a,this.Name+".Style")};Qva.Mgr.object.prototype.CreateSlider=function(){var a=document.createElement("div");a.className="QvSliderObject";a.style.cssText="display:none; width: 100%; height: auto;";this.ContentElement.appendChild(a);var f=document.createElement("div");f.className="QvSliderObject";f.style.cssText="display:none; width: auto; height: auto;";var i=document.createElement("table");i.style.cssText="margin: 5px; width:100%;";var c=document.createElement("colgroup");var b=document.createElement("col");b.style.cssText="width: 80%;";c.appendChild(b);b=document.createElement("col");b.style.cssText="width: 20%;";c.appendChild(b);i.appendChild(c);var j=i.insertRow(-1);var h=j.insertCell(-1);h.style.cssText="display:none; background-color: White;";var g=j.insertCell(-1);g.style.cssText="padding: 3px 3px 3px 3px;";var d=document.createElement("img");d.src=this.PageBinder.BuildBinaryUrl(null,null,"Calendar_img");d.title="Date selector";d.style.cssText="display:none; cursor: pointer; border: 1px solid red;";g.appendChild(d);f.appendChild(i);this.ContentElement.appendChild(f);new Qva.Mgr.visibility(this,a,this.Name+".Slider");new Qva.Mgr.visibility(this,f,this.Name+".Calendar");new Qva.Mgr.slider(this,a,this.Name+".Slider");new Qva.Mgr.style(this,a,this.Name+".Style");new Qva.Mgr.text(this,h,this.Name+".Calendar");new Qva.Mgr.style(this,h,this.Name+".Style");new Qva.Mgr.date(this,d,this.Name+".Calendar");new Qva.Mgr.actionicon(this,h,this.Name+".Calendar")};Qva.Mgr.hideifhidden=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}a.AddManager(this);this.Element=c};Qva.Mgr.hideifhidden.prototype.Paint=function(c,b){this.Touched=true;var a=this.Element;if(a.style.display!="none"){a.style.display=Qva.MgrGetDisplayFromMode(this,c)}};function CreateHeaderOrFooter(a,c){var b=c.parentNode;b.removeChild(c);var f=document.createElement("div");b.appendChild(f);f.appendChild(c);b.style.overflowY="hidden";f.style.overflowY="hidden";f.style.overflowX="hidden";f.style.position="relative";var d={};d.Element=f;d.TableElement=c;d.ScrollParent=b;d.Lines=[];d.Body=c.tBodies[0];if(d.Body==null){c.insertRow(-1);d.Body=c.tBodies[0]}d.TableMgr=a;c.TableMgr=a;return d}Qva.Mgr.object.prototype.CreateChartOrTableBox=function(a){this.CreateBasicTable();if(a){var c=document.createElement("div");c.className="QvGraph";c.style.cssText="display:none;width:auto;height:auto;";var b=document.createElement("img");b.style.cssText="width:auto;height:auto;";this.Chart=b;c.appendChild(b);this.ContentElement.appendChild(c)}if(a){new Qva.Mgr.label(this,c,this.Name+".Graph");var c=new Qva.Mgr.graph(this,b,this.Name+".Graph");new Qva.Mgr.actions(this,b,this.Name+".Graph");if(IS_TOUCHENABLED){Qva.Touch.Chart.AddTouchSupport(c)}}};Qva.Mgr.object.prototype.CreateSearchObject=function(c){this.ContentElement.className+=" QvSearchObject";var i=document.createElement("table");i.style.cssText="width: 100%;";var b=document.createElement("colgroup");var a=document.createElement("col");a.style.cssText="width:15pt;";b.appendChild(a);a=document.createElement("col");b.appendChild(a);i.appendChild(b);var j=i.insertRow(-1);var h=j.insertCell(-1);h.style.cssText="padding: 2pt 2pt 2pt 2pt";var d=document.createElement("img");h.appendChild(d);var g=j.insertCell(-1);var f=document.createElement("input");f.style.cssText="width: 95%; display:none";g.appendChild(f);this.ContentElement.appendChild(i);new Qva.Mgr.style(this,f,this.Name+".Style");new Qva.Mgr.style(this,f,this.Name+".Input");new Qva.Mgr.binary(this,d,this.Name+".SEARCH");new Qva.Mgr.inputsearch(this,f,this.Name+".Input")};Qva.Mgr.object.prototype.CreateObjectContent=function(c,d){switch(c){case"CH":var a=true;case"TB":this.CreateChartOrTableBox(a);break;case"TX":var b=true;case"LA":this.CreateTextOrLineObject(b);break;case"CS":case"IB":case"MB":case"SB":this.CreateBasicTable();break;case"LB":this.CreateListBox();break;case"BM":this.CreateBookmark();break;case"SL":this.CreateSlider();break;case"BU":this.CreateButton();break;case"SO":this.CreateSearchObject();break;case"CT":this.CreateContainer();break;case"TW":break;default:break}};Qva.Mgr.object.prototype.IsInvalid=function(){return !this.Mode||this.Mode=="invalid"};Qva.Mgr.object.prototype.IsWaiting=function(){return this.Mode&&this.Mode=="waiting"};Qva.Mgr.object.prototype.GetUpdates=function(c){if(this.IsInvalid()){var d=clone(this.poll);if(this.poll.clearcache){delete this.poll.clearcache}c.push(d);this.Mode="waiting"}for(var a=0;a<this.Managers.length;++a){var b=this.Managers[a];if(b.GetUpdates){b.GetUpdates(c)}}};Qva.Mgr.object.prototype.Paint=function(g,b,a,h){if(b.getAttribute("menu")=="true"){Qva.SetContextMenu(this.Element,function(k){return Qva.GetBinder(this.binderid).OnContextMenu(k,this.ObjectId)})}var c=this.Mode=b.getAttribute("mode");if(c=="aborted"){if(this.woringTimer){if(this.woringTimer!==true){clearTimeout(this.woringTimer)}this.woringTimer=null}this.Abort()}else{if(c=="working"||c=="invalid"){if(this.isSliding){if(this.woringTimer){if(this.woringTimer!==true){clearTimeout(this.woringTimer)}this.woringTimer=true;this.Hide()}else{var j=this;this.woringTimer=setTimeout(function(){j.Hide()},1000)}}}else{if(this.woringTimer){if(this.woringTimer!==true){clearTimeout(this.woringTimer)}this.woringTimer=null}this.Show();if(c!="cached"){var d=b.getAttribute("accept");this.DropTypes=d?d.split(";"):[];var f=this.Element;f.TargetName=b.getAttribute("objectid");f.style.display=Qva.MgrGetDisplayFromMode(this,g);if(f.style.display=="none"){if(this.TableMgr){this.TableMgr.Reset()}return}if(this.FirstTime){if(!this.GetCaption()){var i=document.createElement("div");i.className="QvCaption";i.innerText=" ";this.Element.appendChild(i);new Qva.Mgr.caption(this,i,this.Name+".Caption")}this.Type=b.getAttribute("type");if(b.getAttribute("extension")){this.Extension=b.getAttribute("extension");Qva.AddExtensionBase(this.Extension,this);this.PageBinder.QueuePostPaintMessage(this)}else{this.CreateObjectContent(b.getAttribute("type"),b.getAttribute("format"))}this.FirstTime=false}if(b.getAttribute("menu")=="true"){Qva.SetContextMenu(f,function(k){return Qva.GetBinder(this.binderid).OnContextMenu(k,this.ObjectId)})}this.PaintTree(b,h,this.Name)}else{if(this.Element.style.display=="none"&&(this.PageBinder.GetDocumentMgr().Platform=="WORKBENCH"||this.PageBinder.GetDocumentMgr().Platform=="WEBPARTS")){this.Element.style.display=""}}}}};Qva.Mgr.object.prototype.SetMask=function(a){if(!this.Element){return}if(!this.Mask){var b=this.Mask=document.createElement("div");b.style.width="100%";b.style.height="100%";b.style.zIndex=1000;b.style.position="absolute";b.style.left="0";b.style.top="0";b.style.cursor="wait";b.style.backgroundRepeat="no-repeat";b.style.backgroundPosition="center center";b.style.backgroundColor="gray";b.style.display="none";this.Element.appendChild(b)}this.Mask.innerHTML="";this.Mask.style.opacity=a;this.Mask.style.filter="alpha(opacity="+Math.round(a*100)+")";this.Mask.style.display="";return this.AsyncElement};Qva.Mgr.object.prototype.Abort=function(){if(this.State!="Abort"){this.State="Abort";this.SetMask(0.4);if(!this.Mask){return}this.Mask.style.cursor="";this.Mask.innerHTML='<img style="position: absolute; width: 100%; height: 100%;" src="'+Qva.QvAjaxZfcPath+'htc/Aborted2.png" alt="" />'}};Qva.Mgr.object.prototype.Hide=function(){if(this.State!="Hide"){this.State="Hide";this.SetMask(0.4);if(!this.Mask){return}this.Mask.innerHTML='<div style="position: absolute; left: 50%; top: 50%; width: auto; height: auto;"><img style="position: relative; left: -8px; top: -8px;" src="'+Qva.QvAjaxZfcPath+'htc/Working.gif" alt="" /></div>'}};Qva.Mgr.object.prototype.Disable=function(){if(this.State!="Disable"){this.State="Disable";this.SetMask(0)}};Qva.Mgr.object.prototype.Show=function(){if(this.State!="Show"){this.State="Show";if(this.Mask){this.Mask.style.display="none"}}};Qva.Mgr.object.prototype.Append=function(d,b,a,c){this.PageBinder.Append(this,this.Name,a,c)};Qva.Mgr.object.prototype.SetInitial=function(a,b){this.PageBinder.SetInitial(this.Name,a,b)};function ObjectifyXmlAttributes(f,c){for(var b=0;b<c.attributes.length;b++){var a=c.attributes[b].name;if(a=="name"){continue}var g=c.attributes[b].value;if(a=="mode"){switch(g){case"enabled":f.visible=true;f.enabled=true;break;case"disabled":f.visible=true;f.enabled=false;break;case"hidden":f.visible=false;f.enabled=false;break}}var d=parseFloat(c.attributes[b].value);if(g==d){f[c.attributes[b].name]=d}else{f[c.attributes[b].name]=g}}}function ObjectifyXmlNode(b,a){if(!a.getAttribute("name")){return}b[a.getAttribute("name")]={};for(var c=a.firstChild;c;c=c.nextSibling){ObjectifyXmlNode(b[a.getAttribute("name")],c)}ObjectifyXmlAttributes(b[a.getAttribute("name")],a)}Qva.Mgr.object.prototype.GenericPaint=function(n,f){this.Touched=true;if(typeof(this.QvaPublic)==="undefined"){this.QvaPublic=new Qva.Public.Wrapper(this)}this.QvaPublic.Layout.ObjectId=f.getAttribute("objectid");this.ResetScrollPosition=true;if(f.getAttribute("pageoffset")){var o=f.getAttribute("pageoffset");this.QvaPublic.Data.PageOffset.x=parseInt(o.split(":")[0]);this.QvaPublic.Data.PageOffset.y=parseInt(o.split(":")[1]);var h=f.getAttribute("pagesize");this.QvaPublic.Data.PageSize.x=parseInt(h.split(":")[0]);this.QvaPublic.Data.PageSize.y=parseInt(h.split(":")[1]);var m=f.getAttribute("totalsize");this.QvaPublic.Data.TotalSize.x=parseInt(m.split(":")[0]);this.QvaPublic.Data.TotalSize.y=parseInt(m.split(":")[1]);this.SetOffset=this.PageBinder.SetOffset}if(this.QvaPublic.Data.PageOffset.y==0){this.QvaPublic.Data.Rows.length=0;this.QvaPublic.Data.HeaderRows.length=0}else{this.ResetScrollPosition=false}for(var c=f.firstChild;c;c=c.nextSibling){if(c.nodeName=="value"){var r=parseInt(c.getAttribute("name").substr(1));if(!isNaN(r)){var a=0;var p=0;if(!isNaN(this.QvaPublic.Data.PageOffset.y)){a=this.QvaPublic.Data.PageOffset.y}for(var d=c.firstChild;d;d=d.nextSibling){if(d.nodeName!="element"){continue}var l={};var j=d.getAttribute("position")=="top";var q=d.getAttribute("title");if(!q){q=d.getAttribute("text")}l.text=q;for(var k=0;k<d.attributes.length;k++){if(d.attributes[k].name=="name"){continue}if(d.attributes[k].name=="text"){continue}if(d.attributes[k].name=="title"){continue}if(d.attributes[k].name=="position"){continue}l[d.attributes[k].name]=d.attributes[k].value}if(j){if(!this.QvaPublic.Data.HeaderRows[p]){if(p!=this.QvaPublic.Data.HeaderRows.length){Assert(false)}this.QvaPublic.Data.HeaderRows[p]=new Array()}for(var g=d.firstChild;g;g=g.nextSibling){if(g.nodeName!="member"){continue}if(!l.members){l.members=[]}l.members[l.members.length]={label:g.getAttribute("label"),active:g.getAttribute("active")=="true"}}this.QvaPublic.Data.HeaderRows[p++][r]=l}else{if(!this.QvaPublic.Data.Rows[a]){this.QvaPublic.Data.Rows[a]=new Array()}this.QvaPublic.Data.Rows[a++][r]=l}}}else{ObjectifyXmlNode(this.QvaPublic.Layout,c)}}else{if(c.nodeName=="style"){for(var d=c.firstChild;d;d=d.nextSibling){var b={};ObjectifyXmlAttributes(b,d);this.QvaPublic.Data.CellStyles[this.QvaPublic.Data.CellStyles.length]=b}}else{if(c.nodeName=="borderstyle"){for(var d=c.firstChild;d;d=d.nextSibling){var b={};ObjectifyXmlAttributes(b,d);this.QvaPublic.Data.CellBorderStyles[this.QvaPublic.Data.CellBorderStyles.length]=b}}}}}this.PageBinder.QueuePostPaintMessage(this)};Qva.Mgr.object.prototype.AddManager=function(a){a.PageBinder=this;a.Touched=false;if(a.SelectedClassName==null){a.SelectedClassName="QvSelected";a.DeselectedClassName="QvDeselected";a.EnabledClassName="QvOptional";a.DisabledClassName="QvExcluded";a.LockedClassName="QvLocked";a.SelectedExcludedClassName="QvSelectedExcluded";a.LockedExcludedClassName="QvLockedExcluded";a.AlternativeClassName="QvAlternative";a.ModeIfNotEnabled="n"}if(!a.Paint){a.Paint=this.GenericPaint;a.pageoffset={};a.pagesize={};a.totalsize={}}this.Managers[this.Managers.length]=a;this.AddSubscription(a,a.Name)};Qva.Mgr.object.prototype.AddSubscription=function(d,a){if(a==null||a.substr(0,1)=="."){Assert(false)}if(a==null||a==""){return}var c=this.Members[a];if(c==null){c=new Array();this.Members[a]=c}for(var b=0;b<c.length;b++){if(c[b]==d){break}}if(b==c.length){c[c.length]=d}};Qva.Mgr.CreateObject=function(c,d,a,g){var f=document.createElement("div");f.className="QvFrame";f.id=d.id;if(d.mode=="maximized"||d.maximized=="true"){f.style.left="0";f.style.top="0";f.style.width="100%";f.style.height="100%"}else{if(d.left!=null){f.style.left=d.left+"px";f.style.top=d.top+"px";f.style.width=d.width+"px";f.style.height=d.height+"px"}else{f.style.display="none"}}var b=new Qva.Mgr.object(c,f,d.name,null,null,!g);return b};Qva.PageBinding.prototype.RemoveObject=function(a){var b=this.Members["Document."+a];if(b){b=b[0]}if(b){if(b.Remove){b.Remove()}this.RemoveFromManagers(b)}this.Members["Document."+a]=null};Qva.Mgr.object.prototype.PaintElem=function(b,a,h){var g=this.Members[a];if(g!=null){var f="d";switch(b.getAttribute("mode")){case"not-applicable":f="n";break;case"hidden":f="h";break;case"enabled":f="e";break}var c=g.length;for(var i=0;i<c;++i){var j=g[i];var d=f;if(f!="n"&&j.HideIf&&j.HideIf(b.getAttribute("value"),b.getAttribute("text"))){d="n"}j.Paint(d,b,a,h)}}};Qva.Mgr.object.prototype.PaintTree=function(d,b,a){var g=a+".";for(var f=d.firstChild;f!=null;f=f.nextSibling){if(f.nodeName!="value"&&f.nodeName!="action"&&f.nodeName!="group"&&f.nodeName!="list"){continue}var c=g+f.getAttribute("name");this.PaintTree(f,b,c)}this.PaintElem(d,a,b)};Qva.Mgr.object.prototype.BuildBinaryUrl=function(d,c,b,a){return this.PageBinder.BuildBinaryUrl(d,c,b,a)};Qva.Mgr.object.prototype.PartialLoad=function(a,b){if(isNaN(parseInt(b.x))||isNaN(parseInt(b.y))){return}var c=this.GetDocumentMgr();c.IsPartialLoad=true;c._Send("get",a.substr("Document.".length),true,{offset:b.x+":"+b.y})};Qva.Mgr.object.prototype.SetScrollPos=function(a){if(isNaN(parseInt(a.x))||isNaN(parseInt(a.y))){return}var b=this.GetDocumentMgr();b._Send("set",this.Name.substr("Document.".length),true,{scrollposition:a.x+":"+a.y})};Qva.Mgr.object.prototype.FixName=function(a){return a};Qva.Mgr.object.prototype._Send=function(d,c,b,a){this.PageBinder._Send(d,this.FixName(c),b,a)};Qva.Mgr.object.prototype.Set=function(b,c,d,a){this.PageBinder.Set(this.FixName(b),c,d,a)};Qva.Mgr.object.prototype.Search=function(c,d,a,b){this.PageBinder.Search(this.FixName(c),d,a,b)};Qva.Mgr.object.prototype.Hover=function(a,b){this.PageBinder.Hover(this.FixName(a),b)};Qva.Mgr.object.prototype.SetSize=function(a,b){this.poll.size=b;this.Mode="invalid"};Qva.Mgr.object.prototype.AddToogleSelect=function(b,c,a){this.PageBinder.AddToogleSelect(b,c,a)};Qva.Mgr.object.prototype.GetEnabled=function(){return this.PageBinder.Enabled};Qva.Mgr.object.prototype.IsValid=function(){return !this.IsInvalid()&&this.GetEnabled()&&!this.IsWaiting()};Qva.Mgr.object.prototype.GetDocumentMgr=function(){return this.PageBinder.GetDocumentMgr()};Qva.Mgr.object.prototype.LoadBegin=function(){this.PageBinder.LoadBegin()};Qva.Mgr.object.prototype.GetCaption=function(){return this.Caption};Qva.Mgr.object.prototype.GetBody=function(){for(var a=0;a<this.Managers.length;++a){var b=this.Managers[a];if(b.IsBody){return b}}return null};Qva.Mgr.object.prototype.GetSearchMgr=function(){mgr=this.GetBody();if(mgr){return mgr}for(var a=0;a<this.Managers.length;++a){mgr=this.Managers[a];if(mgr.SearchName){return mgr}}return null};Qva.Mgr.object.prototype.GetMaxClientHeight=function(){if(this.Element.rect){var a=isNaN(this.BorderWidth)?0:this.BorderWidth;return this.Element.rect.height-2*a}else{return getClientHeight(this.Element)}};Qva.Mgr.object.prototype.GetMaxClientWidth=function(){if(this.Element.rect){var a=isNaN(this.BorderWidth)?0:this.BorderWidth;return this.Element.rect.width-2*a}else{return getClientWidth(this.Element)}};Qva.Mgr.object.prototype.GetContentMaxHeight=function(c){if(typeof c=="undefined"){c=this.ContentElement}var b=this.GetMaxClientHeight();var g=this.Element.childNodes.length;for(var d=0;d<g;d++){var f=this.Element.childNodes[d];if(f==c){continue}if(f.nodeName!="DIV"){continue}if(f.style.display=="none"){continue}if(IS_IE){if(f.currentStyle.position!="relative"){continue}}else{var a=document.defaultView.getComputedStyle(f,"");if(a.getPropertyValue("position")!="relative"){continue}}b-=f.offsetHeight}if(b>0){return parseInt(b)}b=parseInt(c.style.height);if(isNaN(b)){return 0}return b};Qva.Mgr.object.prototype.GetContentHeight=function(){var b=parseInt(this.Element.style.height);if(!IS_IE6_OR_IE7||this.BorderAroundContent){b-=2*this.BorderWidth}var f=this.Element.childNodes.length;for(var c=0;c<f;c++){var d=this.Element.childNodes[c];if(d==this.ContentElement){continue}if(d.nodeName!="DIV"){continue}if(d.style.display=="none"){continue}if(IS_IE){if(d.currentStyle.position!="relative"){continue}}else{var a=document.defaultView.getComputedStyle(d,"");if(a.getPropertyValue("position")!="relative"){continue}}b-=d.offsetHeight}if(b>0){return parseInt(b)}b=parseInt(this.Element.style.height);if(!IS_IE6_OR_IE7||this.BorderAroundContent){b-=2*this.BorderWidth}if(isNaN(b)){return 0}return b};Qva.Mgr.object.prototype.GetImageSize=function(c){var b={width:0,height:0};var d=c.style.width;if(d=="auto"||c.autosize){if(d=="auto"){c.autosize=true}d=this.GetMaxClientWidth();c.style.width=d+"px";b.width=d}else{b.width=c.offsetWidth}var a=c.style.height;if(a=="auto"||c.autosize){if(a=="auto"){c.autosize=true}a=this.GetContentMaxHeight();if(a<0){a=getClientHeight(c.parentNode)}c.style.height=a+"px";b.height=a}else{b.height=c.offsetHeight}return b};Qva.Mgr.object.prototype.SetObjectHeight=function(c){var f=isNaN(this.BorderWidth)?0:this.BorderWidth;if(this.Element.rect){var b=this.Element.rect.height;var g=b-2*f;if(IS_IE6_OR_IE7&&!this.BorderAroundContent){b=g}var d=parseInt(this.Element.style.height);var a=b-c;if(a!=d){this.Element.style.height=a+"px";if(this.Element.firstChild.ResizeType){Qva.Mgr.CreateAndUpdateResizeHandles(this.Element,this.BorderAroundContent?0:f)}}}this.ContentElement.style.height=this.GetContentHeight()+"px";if(this.BackgroundMgr){this.QueuePostPaintMessage(this.BackgroundMgr)}};Qva.Mgr.object.prototype.SetObjectWidth=function(g){if(!this.Element.rect){return}if(this.Maximized){g=0}var c=isNaN(this.BorderWidth)?0:this.BorderWidth;var i=this.Element.rect.width;maxclientwidth=i-2*c;if(IS_IE6_OR_IE7&&!this.BorderAroundContent){i=maxclientwidth}var k=parseInt(this.Element.style.width);var a=i-g;if(a!=k){this.Element.style.width=a+"px";if(this.Element.firstChild.ResizeType){Qva.Mgr.CreateAndUpdateResizeHandles(this.Element,this.BorderAroundContent?0:c)}}var j=this.Element.childNodes.length;for(var f=0;f<j;f++){var b=this.Element.childNodes[f];if(b.nodeName!="DIV"){continue}if(b.style.display=="none"){continue}if(b.className=="Qv_Scrollbar"){continue}if(b.ResizeType){continue}var h=maxclientwidth-g;if(this.BorderAroundContent&&b!=this.ContentElement){h+=2*c}var d=parseInt(b.style.width);if(d!=h){b.style.width=h+"px"}}};Qva.Mgr.object.prototype.SetColumnWidth=function(a,b){this.Set(this.Name,"resizecolumn",a+":"+b,true)};Qva.Mgr.captionstyle=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}a.AddManager(this);this.Element=c;this.InlineStyle=a.InlineStyle};function SetElementStyle(c,a,d,b){if(!d){return false}if(b){d+=b}if(d!=c.style[a]){c.style[a]=d;return true}return false}Qva.Mgr.captionstyle.prototype.Paint=function(c,b){this.Touched=true;var a=SetElementStyle(this.Element,"fontFamily",b.getAttribute("fontfamily"));a|=SetElementStyle(this.Element,"fontSize",b.getAttribute("fontsize"),"pt");a|=SetElementStyle(this.Element,"fontStyle",b.getAttribute("fontstyle"));a|=SetElementStyle(this.Element,"fontWeight",b.getAttribute("fontweight"));a|=SetElementStyle(this.Element,"textAlign",b.getAttribute("textalign"));a|=SetElementStyle(this.Element,"verticalAlign",b.getAttribute("verticalalign"));a|=SetElementStyle(this.Element,"textDecoration",b.getAttribute("textdecoration"));if(a){this.PageBinder.Resized()}};Qva.Mgr.caption=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}this.Element=c;a.AddManager(this);this.ObjectId=a.Element.id;a.Caption=this;c.moveObj=this.ObjectId;c.Name=this.Name;c.binderid=a.binderid;this.RowHeight=-1;this.InlineStyle=a.InlineStyle;if(c.getAttribute("AvqStyle")){this.InlineStyle=c.getAttribute("AvqStyle")=="true"}if(this.InlineStyle){new Qva.Mgr.captionstyle(a,this.Element,b+".Style",d)}};Qva.Mgr.caption.prototype.SetPending=function(c){for(var a=0;a<c.length;++a){if(this.ObjectId!=c[a]){continue}this.Element.parentNode.className+=" QvPending";if(this.Element.BkgElem){this.Element.BkgElem.className+=" QvPending"}return}var b=this.Element.parentNode.className;this.Element.parentNode.className=b.replace(" QvPending","")};Qva.Mgr.caption.prototype.PostPaint=function(){var a=this.Element;if(a.style.display=="none"){return}if(this.RowHeight==-1&&this.RowSpan!=1){this.RowHeight=a.clientHeight}if(this.RowHeight!=-1){a.style.height=this.RowSpan==1?"":(this.RowHeight*this.RowSpan+"px")}if(this.NoText){for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(c.tagName!="SPAN"){continue}c.innerHTML="&nbsp;";break}}};Qva.Mgr.caption.prototype.Paint=function(g,h,v){this.Touched=true;var a=this.Element;var l=Qva.MgrGetDisplayFromMode(this,g);if(l!=a.style.display){this.PageBinder.Resized()}a.style.display=l;if(a.style.display=="none"){return}if(h.getAttribute("allowmove")=="true"){a.onmousedown=Qva.Move.mouseDown}else{a.onmousedown=null}if(this.InlineStyle){this.activecolor=h.getElementsByTagName("activecolor")[0];this.color=h.getElementsByTagName("color")[0]}if(g!="n"){a.innerHTML="";var s=h.getElementsByTagName("action");if(s.length>=1){for(var n=(s.length-1);n>=0;n--){var p=s[n];if(p.getAttribute("type")=="divider"){Assert(false);continue}var r=p.getElementsByTagName("icon");var j=null;for(var q=0;q<r.length;q++){j=r[q]}if(j==null){Assert(false);continue}var u=document.createElement("img");u.alt="";u.className="QvCaptionIcon";if(p.getAttribute("text")){u.title=p.getAttribute("text")}else{u.title=""}var o=j.getAttribute("style");if(o){u.style.cssText=o}var c=this.PageBinder.BuildBinaryUrl(j.getAttribute("path"),j.getAttribute("stamp"),j.getAttribute("name"),this.color?HtmlifyARGB(this.color.getAttribute("color")):null);u.src=c;var b=p.getAttribute("mode")=="disabled";if(!b){var k=p.getAttribute("name");var f=p.getAttribute("clientaction");u.binderid=a.binderid;u.ObjectId=this.ObjectId;if(k){u.onclick=onclick_action;u.Action=this.Name.replace("Caption",k)}if(f){u.onclick=onclick_ContextClientAction;u.clientaction=f;u.param=p.getAttribute("param")}if(p.getAttribute("menu")=="true"){u.position=k;Qva.SetContextMenu(u,function(i){return Qva.GetBinder(this.binderid).OnContextMenu(i,this.ObjectId)})}}a.appendChild(u)}}var d=h.getAttribute("label");if(!d){if(a.color&&a.color.getAttribute("bkgcolor")){a.style.color=a.color.getAttribute("bkgcolor")}d="Gg";this.NoText=true;a.title=""}else{this.NoText=false;a.title=d}var m=document.createElement("span");m.innerText=d;a.appendChild(m)}if(this.InlineStyle){var t=h.getAttribute("rowspan");if(t){if(this.RowSpan!=t){this.PageBinder.Resized()}this.RowSpan=t;this.PageBinder.QueuePostPaintMessage(this)}else{this.RowSpan=1}}else{this.PostPaint=null}};Qva.Mgr.restore=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}a.AddManager(this);this.Element=c;this.Element.Name=this.Name;this.Element.binderid=a.binderid;this.Element.moveObj=c.id;a.Append(this,this.Name,"action");this.Element.ondblclick=this.Restore;Qva.SetContextMenu(c,function(f){return Qva.GetBinder(this.binderid).OnContextMenu(f,this.Name.replace(".RE",""))});if(IS_TOUCHENABLED){Qva.Touch.Restore.AddTouchSupport(this)}};Qva.Mgr.restore.prototype.Restore=function(){Qva.GetBinder(this.binderid).Set(this.Name,"action","",true)};Qva.Mgr.restore.prototype.PostPaint=function(){if(this.Element.style.display=="none"){return}var a=this.avq_url;a+="&width="+escape(parseInt(this.Element.style.width));a+="&height="+escape(parseInt(this.Element.style.height));this.Element.style.backgroundImage="url("+a+")"};Qva.Mgr.restore.prototype.Paint=function(d,c){this.Touched=true;var b=this.Element;b.style.display=Qva.MgrGetDisplayFromMode(this,d);if(b.style.display=="none"){return}var a=this.PageBinder.BuildBinaryUrl(c.getAttribute("path"),c.getAttribute("stamp"),this.Name);this.avq_url=a;this.PageBinder.QueuePostPaintMessage(this)};Qva.Mgr.QvObject=function(a,b,c){if(!Qva.MgrSplit(this,b,c)){return}a.AddManager(this);this.Managers=new Array();this.Members={};this.IsInvalid=Qva.Mgr.object.prototype.IsInvalid;this.GetUpdates=Qva.Mgr.object.prototype.GetUpdates;this.GetWidth=Qva.Mgr.object.prototype.GetMaxClientWidth;this.GetHeight=Qva.Mgr.object.prototype.GetMaxClientHeight;this.pageoffset={};this.pagesize={};this.totalsize={};var b=this.Name.substr("Document.".length);this.poll={name:b,clearcache:"true"};this.PostPaintQueue=[];this.Paint=function(i,h,g,f){this.Type=h.getAttribute("type");var d=this.Mode=h.getAttribute("mode");if(d=="aborted"){}else{if(d=="working"||d=="invalid"){}else{if(d!="cached"){Qva.Mgr.object.prototype.GenericPaint.apply(this,Array(i,h))}}}};return this};Qva.Mgr.QvObject.prototype.PartialLoad=function(a,b){if(isNaN(parseInt(b.x))||isNaN(parseInt(b.y))){return}this.PageBinder.IsPartialLoad=true;this.PageBinder._Send("get",a.substr("Document.".length),true,{offset:b.x+":"+b.y})};Qva.Mgr.QvObject.prototype.QueuePostPaintMessage=function(b){for(var a=0;a<this.PostPaintQueue.length;++a){if(this.PostPaintQueue[a]==b){return}}this.PostPaintQueue.push(b);this.PageBinder.QueuePostPaintMessage(this)};Qva.Mgr.search=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}a.AddManager(this);this.Element=c;this.Element.Name=this.Name;this.Element.binderid=a.binderid;this.Element.className="PopupSearch";this.First=true};Qva.Mgr.search.Do=function(a,c,b){a.Set(".Search","search",c,b)};Qva.Mgr.search.KeyUp=function(c){if(!c){c=window.event}var b=c.keyCode;switch(b){case 13:case 27:break;default:this.last_search=this.value;var a=Qva.GetBinder(this.binderid);if(a.GetEnabled()){Qva.Mgr.search.Do(a,this.value,true)}else{a.PendingSearchName=".Search";a.PendingSearchValue=this.value}break}};Qva.Mgr.search.Close=function(d,c,g){Qva.KeepPopupSearchAlive=false;var h=".Search";var b=d.value;d.value="";window.focus();var a=Qva.GetBinder(d.binderid);if(a.Enabled){if(c){Qva.Mgr.search.Do(a,b,false)}var f;if(c){f=g?"ctrlaccept":"accept"}else{f="abort"}a.Set(h,"closesearch",f,true)}else{Qva.PendingSearchKey=(c?"accept":"abort");Qva.PendingSearchKeyName=h}};Qva.Mgr.search.KeyDown=function(b){if(!b){b=window.event}var a=b.keyCode;switch(a){case 13:Qva.Mgr.search.Close(this,true,ctrlKeyPressed(b));break;case 27:var c=this;window.setTimeout(function(){Qva.Mgr.search.Close(c,false)},0);break}};Qva.Mgr.search.prototype.Paint=function(k,g){if(this.First){this.First=false;var l=this.ToogleImg=document.createElement("img");l.src=qva.BuildBinaryUrl(null,null,"bundled:expand_right");l.style.display="none";l.alt="expand";l.Action="Document.Search.TG";l.onclick=onclick_action;l.binderid=this.Element.binderid;this.Element.appendChild(l);var n=document.createElement("img");n.src=qva.BuildBinaryUrl(null,null,"bundled:cross");n.alt="close";n.Action="Document.Search.Close";n.onclick=onclick_action;n.binderid=this.Element.binderid;this.Element.appendChild(n);var h={};h.name="Document.Search.DS";h.id="Search.DS";var d=this.AssosiatedDS=Qva.Mgr.CreateObject(this.PageBinder,h,false,false);d.Element.className+=" DS";d.Element.style.cssText="z-index: 100; display: none; left: 10pt; top: 10pt; width: 10pt; height: 800pt; position:absolute;";d.CreateListBox();new Qva.Mgr.transientpos(d,d.Element,h.name,"");document.body.appendChild(d.Element)}this.Touched=true;var i=this.Element;i.style.display=Qva.MgrGetDisplayFromMode(this,k);if(i.style.display=="none"){if(this.AssosiatedDS){this.AssosiatedDS.Element.style.display="none"}if(this.TextBox){purge(this.TextBox);this.Element.removeChild(this.TextBox);this.TextBox=null}return}if(!this.TextBox){var c=this.TextBox=document.createElement("input");c.binderid=this.Element.binderid;c.tabIndex=1;c.onkeyup=Qva.Mgr.search.KeyUp;c.onkeydown=Qva.Mgr.search.KeyDown;c.onclick=Qva.CancelAction;this.Element.appendChild(c);this.TextBox.last_search=""}var b=g.getAttribute("owner");var q=g.getAttribute("text");var r=g.getAttribute("associatedsearch");var f=window.document.getElementById(b);var j=Qva.GetAbsolutePageCoords(f);var o=40;var m=j.y-23;var a=f.offsetWidth;switch(r){case"true":a*=2;this.ToogleImg.alt="collapse";this.ToogleImg.src=qva.BuildBinaryUrl(null,null,"bundled:expand_left");this.ToogleImg.style.display="";break;case"false":this.AssosiatedDS.Element.style.display="none";this.ToogleImg.alt="expand";this.ToogleImg.src=qva.BuildBinaryUrl(null,null,"bundled:expand_right");this.ToogleImg.style.display="";break;case"hidden":default:this.AssosiatedDS.Element.style.display="none";o=18;this.ToogleImg.style.display="none";break}a-=2;if(a<100){a=100}i.style.left=j.x+"px";i.style.top=m+"px";i.style.width=a+"px";this.TextBox.style.width=(a-o)+"px";this.TextBox.focus();Qva.ActiveElement=this.TextBox;if(Qva.InitSearch){if(Qva.InitSearch=="<"||Qva.InitSearch==">"||Qva.InitSearch=="="){this.TextBox.value=Qva.InitSearch}else{if(q=="**"){this.TextBox.value="*"+Qva.InitSearch+"*"}else{if(q=="~"){this.TextBox.value="~"+Qva.InitSearch}else{this.TextBox.value=Qva.InitSearch}}}this.TextBox.last_search=this.TextBox.value;Qva.Mgr.search.Do(this.PageBinder,this.TextBox.value,true);Qva.SetCursor(this.TextBox,false);Qva.InitSearch=""}else{if(this.PageBinder.PendingSearchName==""&&this.TextBox.value!=q&&this.TextBox.last_search==this.TextBox.value){this.TextBox.value=q;Qva.SetCursor(this.TextBox,false)}}};if(!Qva.Mgr){Qva.Mgr={}}function onclick_action(b){if(this.disabled){return}var a=Qva.GetBinder(this.binderid);if(!a.Enabled){return}var c={};if(this.Position!=null){c.position=this.Position}c.action="";c.clientsizeWH=Qva.GetViewportWidth()+":"+Qva.GetViewportHeight();if(this.NeedCursor){if(Qva.ContextMenu){c.cursor=Qva.ContextMenu.X+":"+Qva.ContextMenu.Y}else{if(!b){b=window.event}c.cursor=(b.clientX+Qva.GetScrollLeft())+":"+(b.clientY+Qva.GetScrollTop())}}a.Set(this.Action||this.ObjectId,c);Qva.HideContextMenu()}function onclick_ContextClientAction(a){Qva.GetBinder(this.binderid).ContextClientAction(a,this)}Qva.Mgr.show=function(a,c,b,d,f){if(!Qva.MgrSplit(this,b,d)){return}this.Condition=f;a.AddManager(this);this.Element=c;a.Append(this,this.Name,"value")};Qva.Mgr.show.prototype.Paint=function(d,c){this.Touched=true;var b;if(d=="n"){b=(this.ModeIfNotEnabled=="d")}else{var a=c.getAttribute("value");if(!a){a=c.getAttribute("text")}b=(a==this.Condition)}this.Element.style.display=b?"":"none"};Qva.Mgr.hide=function(a,c,b,d,f){if(!Qva.MgrSplit(this,b,d)){return}this.Condition=f;this.Element=c;a.AddManager(this);a.Append(this,this.Name,"value")};Qva.Mgr.hide.prototype.Paint=function(d,c){this.Touched=true;var b;if(d=="n"){if(this.Condition==null){b=(this.ModeIfNotEnabled!="d")}else{b=false}}else{var a=c.getAttribute("value");if(!a){a=c.getAttribute("text")}b=(a==this.Condition)}this.Element.style.display=b?"none":""};Qva.Mgr.disable=function(a,c,b,d){this.Name=Qva.MgrMakeName(b,d);this.Element=c;a.AddManager(this)};Qva.Mgr.disable.prototype.Lock=Qva.LockDisabled;Qva.Mgr.disable.prototype.Unlock=Qva.UnlockDisabled;Qva.Mgr.disable.prototype.Paint=function(c,b){this.Touched=true;var a=this.Element;a.disabled=(c!="e");a.style.display=Qva.MgrGetDisplayFromMode(this,c)};Qva.Mgr.background=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}a.AddManager(this);this.Element=c;c.binderid=a.binderid;this.AutoSize=c.tagName=="DIV";a.BackgroundMgr=this};Qva.Mgr.background.prototype.PostPaint=function(){if(this.HasBkgImage){var d=this.Element;var b=d===document.body;var g=b?Qva.GetAbsolutePageCoords(document.getElementById("PageContainer")).y:0;var c=this.avq_url;if(this.AutoSize){var f=getClientWidth(d);var a=b?Qva.GetDocHeight():getClientHeight(d);if(isNaN(f)||isNaN(a)){if(b){f=parseInt(Qva.GetViewportWidth());a=parseInt(Qva.GetViewportHeight())}else{Assert(false)}}a-=g;if(this.PageBinder.IsHosted&&this.PageBinder.SetSize){if(this.Height!=a||this.Width!=f){this.Height=a;this.Width=f;this.PageBinder.SetSize(this.PageBinder.Name||this.Name,this.Width+":"+this.Height)}}c+="&width="+escape(f);c+="&height="+escape(a);c=Qva.AddProxyIfAny(c)}if(this.HasBkgImage){this.appliedurl=c;d.style.backgroundImage="url("+c+")"}else{this.appliedurl="";d.style.backgroundImage=""}if(b&&this.backgroundPosition){if(this.backgroundPosition.search("top")!=-1){if(IS_CHROME){d.style.backgroundPosition="0px "+g+"px"}else{d.style.backgroundPosition=this.backgroundPosition.replace("top",g+"px")}}else{d.style.backgroundPosition=this.backgroundPosition}}if(d!=document.body){d.style.backgroundRepeat="no-repeat"}}};Qva.Mgr.background.prototype.Paint=function(h,d,b){this.Touched=true;var f=this.Element,a=d.getAttribute("stamp"),i=IS_CHROME||(IS_GECKO&&GECKO_VERSION>=3.6)||IS_SAFARI||IE_DOCMODE>8,j=false;this.HasBkgImage=d.getAttribute("image")!=null;this.avq_url=null;if(IS_IE&&IE_DOCMODE>=8){f.style.filter=""}var c=f===document.body;if(c){if(this.HasBkgImage){i=false}else{f.style.backgroundImage="";i=IE_DOCMODE>7}}if(!this.HasBkgImage||c){if(!i){f.style.backgroundImage=""}var g=(!i&&a===null)||c;j=Qva.ApplyColorDataToElement(d,f,i,this.HasBkgImage?false:g);if(!j){this.HasBkgImage=this.HasBkgImage||(a&&a!="0")}}if(this.HasBkgImage){if(!f==document.body){f.style.backgroundColor=""}this.avq_url=this.PageBinder.BuildBinaryUrl(d.getAttribute("path"),a,this.Name)}if(f==document.body){Qva.ResizeBody();if(d.getAttribute("bkgcolor")){f.style.backgroundColor=HtmlifyARGB(d.getAttribute("bkgcolor"))}this.backgroundPosition=d.getAttribute("bkgposition");if(d.getAttribute("bkgrepeat")){f.style.backgroundRepeat=d.getAttribute("bkgrepeat")}if(d.getAttribute("opacity")){if(IS_WEBKIT||IS_OPERA){f.style.opacity=parseFloat(d.getAttribute("opacity"))}else{if(IS_GECKO){f.style.MozOpacity=parseFloat(d.getAttribute("opacity"))}else{f.style.filter="alpha(opacity:"+parseFloat(d.getAttribute("opacity"))*100+")"}}}if(!d.getAttribute("bkgposition")&&d.getAttribute("bkgrepeat")!="repeat"){this.AutoSize=true}}if(this.HasBkgImage){this.PageBinder.QueuePostPaintMessage(this)}};Qva.Mgr.fullsize=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}a.AddManager(this);this.Element=c;this.AutoSize=c.style.width=="auto"&&c.style.height=="auto"&&this.PageBinder.Element;if(!this.AutoSize){this.PostPaint=null}};Qva.Mgr.fullsize.prototype.PostPaint=function(){var b=this.Element;if(b.style.display=="none"){return}if(this.AutoSize){this.PageBinder.SetObjectWidth(0);this.PageBinder.SetObjectHeight(0);if(b.tagName=="DIV"){var a=this.PageBinder.GetContentMaxHeight(b);if(!isNaN(a)){b.style.height=a+"px"}}}else{Assert(false)}};Qva.Mgr.fullsize.prototype.Paint=function(){this.Touched=true};Qva.Mgr.visibility=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}a.AddManager(this);this.Element=c};Qva.Mgr.visibility.prototype.Paint=function(a){this.Touched=true;this.Element.style.display=Qva.MgrGetDisplayFromMode(this,a)};Qva.Mgr.label=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}a.AddManager(this);this.Element=c;this.AutoSize=c.style.width=="auto"&&c.style.height=="auto"&&this.PageBinder.Element;if(!this.AutoSize){this.PostPaint=null}};Qva.Mgr.label.prototype.PostPaint=function(){var b=this.Element;if(b.style.display=="none"){return}if(this.AutoSize){this.PageBinder.SetObjectWidth(0);this.PageBinder.SetObjectHeight(0);if(b.tagName=="DIV"){var a=this.PageBinder.GetContentHeight();if(!isNaN(a)){b.style.height=a+"px"}}}};Qva.Mgr.label.prototype.Paint=function(c,b){this.Touched=true;var a=this.Element;a.style.display=Qva.MgrGetDisplayFromMode(this,c);if(this.AutoSize&&a.style.display!="none"){this.PageBinder.QueuePostPaintMessage(this)}};Qva.Mgr.inline=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}a.AddManager(this);this.Element=c};Qva.Mgr.inline.prototype.Paint=function(d,c){this.Touched=true;var b=this.Element;b.style.display=Qva.MgrGetDisplayFromMode(this,d);if(b.style.display=="none"){return}b.innerHTML="";var a=c.removeChild(c.firstChild);b.appendChild(a)};Qva.Mgr.edit=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}a.AddManager(this);this.Element=c;a.Append(this,this.Name,"choice")};Qva.Mgr.edit.prototype.Paint=function(i,f,c){this.Touched=true;var d=this.Element;if(c==this.ToolTip&&f.getAttribute("text")){d.title=f.getAttribute("text");return}if(f.getAttribute("title")!=null){d.title=f.getAttribute("title")}if(this.MultiLine){var h="";var b=f.getElementsByTagName("element");for(var a=0;a<b.length;++a){if(a>0){h+="\n"}h+=b[a].getAttribute("text")}if(!IS_IE){d.style.whiteSpace="pre-wrap"}d.innerText=h;return}var g="";if(i!="n"){g=f.getAttribute(this.Attr);switch(this.Attr){case"value":if(f.getAttribute("text")==""){g=""}break;case"color":if(f.getAttribute("color")&&f.getAttribute("bkgcolor")){d.style.color=f.getAttribute("color");d.style.backgroundColor=f.getAttribute("bkgcolor");return}}}if(g==""&&this.TextIfNull){g=this.TextIfNull}var h;if(this.Dec!=null){h=Qva.Trunc(g,this.Dec)}else{h=g}if(d.tagName=="INPUT"||d.tagName=="TEXTAREA"){d.value=h}else{d.innerText=h}d.style.display=Qva.MgrGetDisplayFromMode(this,i)};Qva.Mgr.dsi=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}a.AddManager(this);this.Element=c};Qva.Mgr.dsi.prototype.Paint=function(f,d,b){this.Touched=true;var c=this.Element;var a=d.getAttribute("text").split(";");c.value=a.join("\n")};Qva.Mgr.inputcheckbox=function(b,d,a,g,c){if(!Qva.MgrSplit(this,a,g)){return}this.Element=d;b.AddManager(this);if(c!=null){var j=c.substr(1,1);var f=c.split(j);this.Conditional=(f[0]=="-")?-1:1;var i=(f.length>1)?f[1]:"";var h=(f.length>2)?f[2]:null;d.True=(this.Conditional>0)?i:h;d.False=(this.Conditional<0)?i:h}else{this.Conditional=0;d.True="1";d.False="0";this.Attr="value"}d.Name=this.Name;d.Attr=this.Attr;d.binderid=b.binderid;d.onclick=Qva.Mgr.inputcheckbox.OnClick;b.Append(this,this.Name,"choice")};Qva.Mgr.inputcheckbox.prototype.Lock=Qva.LockDisabled;Qva.Mgr.inputcheckbox.prototype.Unlock=Qva.UnlockDisabled;Qva.Mgr.inputcheckbox.prototype.Paint=function(f,c){this.Touched=true;var b=this.Element;var d=c.getAttribute(this.Attr);if(this.Conditional<0){b.checked=(d!=b.False)}else{b.checked=(d==b.True)}var g=c.getElementsByTagName("choice");if(g.length==0){b.disabled=(f!="e")}else{g=g[0].getElementsByTagName("element");var a=g.length;if(a>1){b.disabled=(f!="e")}else{b.disabled=true}}b.style.display=Qva.MgrGetDisplayFromMode(this,f)};Qva.Mgr.inputcheckbox.OnClick=function(){var a=Qva.GetBinder(this.binderid);if(!a.Enabled){return}var b=this.checked?this.True:this.False;if(b!=null){a.Set(this.Name,this.Attr,b,true)}else{b=this.checked?this.False:this.True;a.Set(this.Name,"count","-"+b,true)}};Qva.Mgr.inputradio=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}this.Element=c;c.Name=this.Name;c.Attr=this.Attr;c.binderid=a.binderid;a.AddManager(this);c.onclick=function(){var f=Qva.GetBinder(this.binderid);if(!f.Enabled){return}f.Set(this.Name,this.Attr,this.getAttribute("value"),true)};a.Append(this,this.Name,"choice")};Qva.Mgr.inputradio.prototype.PostScan=function(b){var a=this.Element.getAttribute(b.Prefix+"checkif");if(a){this.CheckIf=new Function("value","return "+a)}};Qva.Mgr.inputradio.prototype.Lock=Qva.LockDisabled;Qva.Mgr.inputradio.prototype.Unlock=Qva.UnlockDisabled;Qva.Mgr.inputradio.prototype.Paint=function(g,c){this.Touched=true;var b=this.Element;var f=c.getAttribute(this.Attr);if(f==null){f=c.getAttribute("value")}if(this.CheckIf){b.checked=this.CheckIf(f)}else{b.checked=(b.getAttribute("value")==f)}b.disabled=(g!="e");if(g=="e"&&!b.checked){var h=c.getElementsByTagName("choice");if(h.length>=1){b.disabled=true;h=h[0].getElementsByTagName("element");var d=h.length;for(var a=0;a<d;++a){if(h[a].getAttribute(this.Attr)==b.getAttribute("value")){b.disabled=false;break}}}}b.style.display=Qva.MgrGetDisplayFromMode(this,g)};Qva.Mgr.inputtext=function(a,c,b,d,f){if(!Qva.MgrSplit(this,b,d)){return}this.Element=c;this.Condition=f;c.Name=this.Name;c.binderid=a.binderid;c.Attr=this.Attr;a.AddManager(this);c.onclick=function(g){Qva.ActiveObjectsCloak=true;if(!g){g=window.event}g.cancelBubble=true};c.onchange=function(){var g=Qva.GetBinder(this.binderid);if(!g.Enabled){return}if(this.value==""){g.Set(this.Name,"text","",true)}else{g.Set(this.Name,this.Attr,this.value,true)}}};Qva.Mgr.inputtext.prototype.Lock=Qva.LockReadOnly;Qva.Mgr.inputtext.prototype.Unlock=Qva.UnlockReadOnly;Qva.Mgr.inputtext.prototype.Paint=function(f,b){this.Touched=true;var a=this.Element;a.readOnly=(f!="e");a.style.color=a.readOnly?"graytext":"";a.disabled=false;var c="";if(f!="n"){c=b.getAttribute(this.Attr);if(this.Attr=="value"&&b.getAttribute("text")==""){c=""}}if(f!="n"&&this.Condition!=null){var d=b.getAttribute("value");if(d==this.Condition){a.disabled=true;c=""}}if(c==""&&this.TextIfNull){c=this.TextIfNull}if(this.Dec!=null){a.value=Qva.Trunc(c,this.Dec)}else{a.value=c}a.style.display=Qva.MgrGetDisplayFromMode(this,f)};function Avq_Search_Focus(c){var a=this.SearchMgr.PageBinder;var b=this.SearchMgr.Name.replace(".Input","");if(this.value==this.SearchMgr.DefaultText){this.style.fontStyle="";this.style.color="";this.value="";Qva.SetCursor(this);a.Set(b,"click","",true)}a.GlobalSearchObject=b}function WebkitClickFix(a){if(this.value=="**"){Qva.SetCursor(this)}}function Avq_Search_KeyDown(d){if(!d){d=window.event}var g=this.SearchMgr;if(this.value==g.DefaultText){this.value="**";Qva.SetCursor(this);this.style.fontStyle="";this.style.color=""}var c=d.keyCode;var b=false;switch(c){case 13:b=true;case 27:var a=g.PageBinder||Qva.GetBinder(g.binderid);if(a.GetEnabled()){if(b){a.Set(g.SearchName,"search",this.value,false)}var f=b?"accept":"abort";a.Set(g.SearchName,"closesearch",f,true)}else{Qva.PendingSearchKey=(b?"accept":"abort");Qva.PendingSearchKeyName=g.SearchName}this.value=g.DefaultText;this.style.fontStyle=g.DefaultFontStyle;this.style.color=g.DefaultColor;a.GlobalSearchObject="";break}}Qva.Mgr.inputsearch=function(a,c,b,d,f){if(!Qva.MgrSplit(this,b,d)){return}this.Element=c;this.Condition=f;c.Name=this.Name;c.binderid=a.binderid;c.Attr=this.Attr;c.onkeydown=Avq_Search_KeyDown;c.onkeyup=AvqAction_Search_KeyUp;c.onfocus=Avq_Search_Focus;if(IS_WEBKIT){c.onclick=WebkitClickFix}else{c.onclick=Qva.CancelAction}c.SearchMgr=this;this.SearchName=this.Name;a.AddManager(this)};Qva.Mgr.inputsearch.prototype.Paint=function(c,b){this.Touched=true;var a=this.Element;a.readOnly=(c!="e");a.disabled=false;a.style.display=Qva.MgrGetDisplayFromMode(this,c);if(a.style.display=="none"){return}if(!this.DefaultText){this.DefaultText=b.getAttribute("defaulttext")}if(b.getAttribute("searching")!="true"){a.value=this.DefaultText;this.DefaultFontStyle=a.style.fontStyle;this.DefaultColor=a.style.color;a.blur()}else{this.PageBinder.GlobalSearchObject=this.Name.replace(".Input","")}};Qva.Mgr.inputsearch.prototype.GetCellRect=function(a,b){Assert(a==-1&&b==-1);var c=Qva.GetAbsolutePageCoords(this.Element);return{left:c.x,width:this.Element.offsetWidth,top:c.y,height:this.Element.offsetHeight}};Qva.Mgr.textarea=Qva.Mgr.inputtext;Qva.Mgr.inputpassword=Qva.Mgr.inputtext;Qva.Mgr.text=function(a,c,b,f,d){if(!Qva.MgrSplit(this,b,f)){return}if(d!=null){this.ToolTip=Qva.MgrMakeName(d,f);a.Append(this,this.ToolTip)}if(c.tagName=="SELECT"){Assert(false)}a.AddManager(this);this.Element=c};Qva.Mgr.text.prototype.Paint=Qva.Mgr.edit.prototype.Paint;Qva.Mgr.step=function(a,d,b,f,c){switch(c){case"next":this.Next=true;break;case"prev":this.Next=false;break;default:d.Step=parseFloat(c);if(isNaN(d.Step)){return}break}if(!Qva.MgrSplit(this,b,f)){return}if(d.Step==null){d.Choice=new Array()}a.AddManager(this);this.Element=d;d.Name=this.Name;d.binderid=a.binderid;d.Attr=this.Attr;d.onclick=Qva.Mgr.step.OnClick;a.Append(this,this.Name,"choice")};Qva.Mgr.step.prototype.Lock=Qva.LockDisabled;Qva.Mgr.step.prototype.Unlock=Qva.UnlockDisabled;Qva.Mgr.step.prototype.Paint=function(h,d){this.Touched=true;var c=this.Element;c.disabled=(h!="e");if(h=="n"){}else{if(c.Step!=null){c.Last=parseFloat(d.getAttribute(this.Attr))}else{var g=d.getAttribute(this.Attr);var b=d.getElementsByTagName("choice");c.Pending=-1;if(b.length>=1){var i=b[0].getElementsByTagName("element");var a=i.length;for(var f=0;f<a;++f){c.Choice[f]=i[f].getAttribute(this.Attr);if(i[f].getAttribute("selected")=="yes"){if(this.Next){c.Pending=f+1}else{c.Pending=f-1}}}c.Choice.length=a}if(c.Pending<0||c.Pending>=c.Choice.length){c.disabled=true}}}c.style.display=Qva.MgrGetDisplayFromMode(this,h)};Qva.Mgr.step.OnClick=function(){var a=Qva.GetBinder(this.binderid);if(!a.Enabled){return}var b;if(this.Step!=null){b=this.Last+this.Step}else{if(this.Pending<0||this.Pending>=this.Choice.length){return}b=this.Choice[this.Pending]}a.Set(this.Name,this.Attr,""+b,true)};Qva.Mgr.actions=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}this.Attr="mode";a.AddManager(this);this.Element=c;c.Action=this.Name;c.binderid=a.binderid};Qva.Mgr.actions.prototype.Lock=Qva.LockDisabled;Qva.Mgr.actions.prototype.Unlock=Qva.UnlockDisabled;Qva.Mgr.actions.prototype.Paint=function(d,c){this.Touched=true;var a=this.Element;var b=(d!="e");a.style.display=Qva.MgrGetDisplayFromMode(this,d);if(c.getAttribute("actions")=="true"&&!b){a.style.cursor="pointer";a.onclick=onclick_action}else{if(a.style.cursor=="pointer"){a.style.cursor="auto"}if(a.onclick==onclick_action){a.onclick=null}}};Qva.Mgr.scroll=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}a.AddManager(this);this.Element=c};Qva.Mgr.scroll.prototype.Paint=function(c,b){this.Touched=true;var a=this.Element;if(b.getAttribute("overflowx")){a.style.overflowX=b.getAttribute("overflowx")}if(b.getAttribute("overflowy")){a.style.overflowY=b.getAttribute("overflowy")}};Qva.Mgr.action=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}this.Attr="mode";a.AddManager(this);this.Element=c;c.Action=this.Name;c.binderid=a.binderid;c.onclick=onclick_action;a.Append(this,this.Name,"action")};Qva.Mgr.action.prototype.Lock=Qva.LockDisabled;Qva.Mgr.action.prototype.Unlock=Qva.UnlockDisabled;Qva.Mgr.action.prototype.Paint=function(h,g){this.Touched=true;var d=this.Element;d.disabled=(h!="e");var c=g.getAttribute("label")||d.alt;if(c){d.title=c}d.style.display=Qva.MgrGetDisplayFromMode(this,h);if(g.getAttribute("clientaction")){d.onclick=onclick_ContextClientAction;d.Name=this.Name;d.AvqMgr=this;d.clientaction=g.getAttribute("clientaction");d.param=g.getAttribute("param")}d.Position=g.getAttribute("value");var f=d.getAttribute("icon");if(f){var a=Qva.GetBinder(d.binderid);if(d.disabled){f+=".DISABLED"}var b=a.BuildBinaryUrl(g.getAttribute("path"),null,f);d.src=b;d.onmouseover=function(){this.className=this.disabled?"":"HighlightImage"};d.onmouseout=function(){this.className=""}}};Qva.Mgr.hr=function(a,d,b,f){if(!Qva.MgrSplit(this,b,f)){return}a.AddManager(this);var c=d.nextSibling;while(c&&c.tagName!="BUTTON"){c=c.nextSibling}if(c){this.Element=c;c.binderid=a.binderid;c.Name=this.Name;c.moveObj="*";c.xOnly=true;c.xMin=0;c.xMax=100;c.disabled=true;c.style.cursor=c.disabled?"":"pointer";c.onmousedown=Qva.Move.mouseDown}};Qva.Mgr.hr.prototype.Paint=function(c,b){this.Touched=true;var a=this.Element;a.disabled=c!="e";var d=parseInt(b.getAttribute("text"));d=isNaN(d)?0:(d/2.55);a.style.left=d+"px";a.style.cursor=a.disabled?"":"pointer"};Qva.Mgr.select=function(a,c,b,d,f){if(c.multiple){Assert(false);return}if(!Qva.MgrSplit(this,b,d)){return}a.AddManager(this);this.Element=c;this.Condition=f;this.Texts=new Array();this.Values=new Array();this.Disabled=new Array();this.Locked=new Array();c.binderid=a.binderid;c.Name=this.Name;c.onchange=Qva.Mgr.select.OnChange;c.onclick=Qva.CancelBubble};Qva.Mgr.select.prototype.Lock=Qva.LockDisabled;Qva.Mgr.select.prototype.Unlock=Qva.UnlockDisabled;Qva.Mgr.select.prototype.Paint=function(j,d){this.Touched=true;var g=this.Element;if(j!="n"){g.ByValue=(d.getAttribute("value")!=null)}var l=d.getAttribute("text");if(this.Dec!=null){l=Qva.Trunc(l,this.Dec)}if(l==null){l=""}if(this.TextIfNull&&l==""){l=this.TextIfNull}var k=g.options.length;if(j=="e"&&(this.Condition==null||l!="")){var o=d.getElementsByTagName("choice");if(o.length>=1){o=o[0].getElementsByTagName("element")}var h=(this.Condition==null)?0:1;var n=o.length-h;g.options.length=n;if(n>=1){this.SelectedIndex=-1;for(var c=0;c<n;++c){var i=o[c+h];var b=i.getAttribute("text");if(this.TextIfNull&&b==""){b=this.TextIfNull}if(this.Dec!=null){b=Qva.Trunc(b,this.Dec)}var a=g.options[c];a.text=b.replace(/\t/g," ");a.value=g.ByValue?i.getAttribute("value"):b;var f=false;if(g.ByValue){if(a.value==d.getAttribute("value")){this.SelectedIndex=c;f=true}}else{if(b==l){this.SelectedIndex=c;f=true}}if(f){a.selected=true}}if(this.SelectedIndex==-1){g.options[n-1].selected=true}}g.disabled=false}else{g.disabled=true;if(k<1||this.Condition!=null){g.options.length=1;var m=g.options[0];m.text=(l!=null)?l.replace(/\t/g," "):"";m.value=g.ByValue?d.getAttribute("value"):l;m.selected=true}}g.style.display=Qva.MgrGetDisplayFromMode(this,j)};Qva.Mgr.select.OnChange=function(){var a=Qva.GetBinder(this.binderid);if(!a.Enabled){return}if(this.selectedIndex<0){return}var b=this.options[this.selectedIndex];if(this.ByValue===true){a.Set(this.Name,"value",b.value,true)}else{a.Set(this.Name,"text",b.text,true)}};Qva.Mgr.graph=function(a,d,b,f){d.Name=this.Name=Qva.MgrMakeName(b,f);d.binderid=a.binderid;d.ObjectId=a.Element.ObjectId;d.isgraph=true;this.AutoSize=d.style.width=="auto"&&d.style.height=="auto";a.AddManager(this);this.Element=d;this.ScrollBars=[];this.HotSpots=[];d.SelectStart=Qva.Mgr.graph.SelectStart;d.Select=Qva.Mgr.graph.Select;d.SelectEnd=Qva.Mgr.graph.SelectEnd;d.onmousedown=function(g){Qva.MouseDown(g,d)};if(!IS_TOUCHENABLED){var c=Qva.GetBinder(d.binderid).GetHoverDiv();c.style.display="none";d.style.display="none";d.LastHoverPos={};d.onmousemove=function(g){Qva.MouseMove(g,d);if(!Qva.MgrWithSelectStart&&!Qva.MgrWithMouseDown){d.onmouseover(g)}};d.onmouseover=function(k){if(!d.hover){return}if(!k){k=window.event}var g=Qva.GetBinder(d.binderid);if(!g){return}var h=d.Name;var m={x:k.clientX+Qva.GetScrollLeft(),y:k.clientY+Qva.GetScrollTop()};if(m.x===d.LastHoverPos.x&&m.y===d.LastHoverPos.y){return}d.LastHoverPos=m;var i=g.GetHoverDiv();i.style.left=m.x+10+"px";i.style.top=m.y+5+"px";i.style.display="none";var l=Qva.GetPageCoords(d);var j=(k.clientX-l.x)+":"+(k.clientY-l.y);if(d.hoverTimout){d.hoverTimout=clearTimeout(d.hoverTimout)}d.hoverTimout=setTimeout(function(){if(Qva.IsContextOpen()){return}if(!g.GetEnabled()){return}g.Hover(h,j)},1000)};d.onmouseout=function(g){if(d.hoverTimout){d.hoverTimout=clearTimeout(d.hoverTimout)}}}d.style.cursor="crosshair"};Qva.Mgr.graph.prototype.Unlock=function(){this.Touched=true;if(this.Element.style.display!="none"){this.PostPaint()}};GraphScrollBar.prototype.Step=function(f){var a=this.PageBinder;if(!this.PageBinder.IsValid()){return}var b=this.Name;var d={};if(this.ScrollId!=null){d.id=this.ScrollId;d.scrollpos=f}else{var c=f-this.Pos;d.scrollstep=c}a.Set(b,d)};GraphScrollBar.prototype.createScrollEnd=function(i,c,k,b,d,f){var a=document.createElement("div");if(this.IsXScroll){a.style.top=(i+1)+"px";c++;if(!f){c+=(b-k)}a.style.left=c+"px";k-=2;a.style.height=k+"px";a.style.width=k+"px"}else{a.style.left=(c+1)+"px";i++;if(!f){i+=(k-b)}a.style.top=i+"px";b-=2;a.style.height=b+"px";a.style.width=b+"px"}a.style.backgroundColor=d;a.style.cursor="pointer";a.style.position="absolute";a.firstbutton=f;var g,j;if(this.IsXScroll){g=[parseInt(k/2)-1,parseInt(k/2)-3];j=f?[[2,0],[0,3],[2,6]]:[[0,0],[2,3],[0,6]]}else{g=[parseInt(b/2)-3,parseInt(b/2)];j=f?[[0,2],[3,0],[6,2]]:[[0,0],[3,2],[6,0]]}var l=[9,9];this.G.CreatePolygonObj(j,"#000000",a,g,l);var h=this;a.onmousedown=function(m){if(!m){m=window.event}m.cancelBubble=true;h.IsSliding=false;var n=this.firstbutton?h.Pos-1:h.Pos+1;if(n>=0&&n<=h.Max){h.UpdateSliderPos(n);h.Step(n)}return false};return a};function GraphScrollBar(p,o,m,c,b,q,f,g,l,j,k,n,a){var d=document.createElement("div");d.style.backgroundColor=g;d.style.cursor="pointer";d.style.position="absolute";this.binderid=p.Element.binderid;this.PageBinder=p.PageBinder;this.Name=p.Name;this.IsXScroll=n;this.ScrollId=a;var h=this;h.IsSliding=false;this.G=SelectInitGraphics();d.onmousedown=function(u){if(!u){u=window.event}u.cancelBubble=true;h.IsSliding=false;var t=Qva.GetPageCoords(this);var s;var r;if(h.IsXScroll){s=h.ScrollStart+u.clientX-t.x;r=parseInt(h.Pos*h.ScrollLength/h.Page)+h.ScrollStart+parseInt(h.firstbutton.style.width)}else{s=h.ScrollStart+u.clientY-t.y;r=parseInt(h.Pos*h.ScrollLength/h.Page)+h.ScrollStart+parseInt(h.firstbutton.style.height)}var v=s<(r)?(h.Pos-h.Page)>0?h.Pos-h.Page:0:Math.min(h.Pos+h.Page,(h.Max-h.Page));if(v>=0){h.UpdateSliderPos(v);h.Step(v)}return false};var i=document.createElement("div");i.style.backgroundColor=f;i.style.border="solid 1px white";i.style.cursor="pointer";i.style.position="absolute";i.onmousedown=function(t){if(!t){t=window.event}t.cancelBubble=true;if(h.IsXScroll){i.mouseZero=t.clientX;i.scrollZero=i.offsetLeft}else{i.mouseZero=t.clientY;i.scrollZero=i.offsetTop}function u(x,y){if(!x){x=window.event}var v,z;if(h.IsXScroll){v=i.scrollZero+x.clientX-i.mouseZero}else{v=i.scrollZero+x.clientY-i.mouseZero}if(v<h.ScrollStart){v=h.ScrollStart;z=0}else{if(v>h.ScrollStop){v=h.ScrollStop;z=h.Max-h.Page}else{z=Math.round((v-h.ScrollStart)*h.Page/h.ScrollLength)}}if(h.IsXScroll){i.style.left=v+"px"}else{i.style.top=v+"px"}if(h.Pos!=z){h.Step(z)}else{if(y){var w=function(B){var A=B;if(A!==h.pos){if(h.PageBinder.IsValid()){if(xpos!==h.pos){h.Step(A)}}else{setTimeout(w,1000)}}};w();h.IsSliding=false}}}function r(v){Qva.removeEvent(document,"mousemove",s);Qva.removeEvent(document,"mouseup",r);if(!v){v=window.event}u(v,true);h.i_Scroll.mouseZero=null;Qva.Select.Active=true}function s(v){v=v||window.event;h.isSliding=true;u(v,false);if(v.preventDefault){v.preventDefault()}else{v.returnValue=false}return false}Qva.Select.Active=false;Qva.addEvent(document,"mousemove",s);Qva.addEvent(document,"mouseup",r);return false};this.o_Scroll=d;this.i_Scroll=i;o.appendChild(d);o.appendChild(i);this.UpdateScrollSize(m,c,b,q,l,j,k,f,g)}GraphScrollBar.prototype.UpdateScrollPos=function(a){if(!isNaN(a)){this.Pos=a}if(!this.isSliding){this.UpdateSliderPos(a)}};GraphScrollBar.prototype.UpdateSliderPos=function(b){var a=parseInt(b*this.ScrollLength/this.Page)+this.ScrollStart;if(this.IsXScroll){this.i_Scroll.style.left=a+"px"}else{this.i_Scroll.style.top=a+"px"}};GraphScrollBar.prototype.UpdateScrollSize=function(j,c,a,n,k,h,i,d,l){if(this.Top!=j||this.Left!=c||this.Height!=n||this.Width!=a){this.Height=n;this.Top=j;this.Left=c;this.Width=a;this.o_Scroll.style.height=n+"px";this.o_Scroll.style.top=j+"px";this.o_Scroll.style.left=c+"px";this.o_Scroll.style.width=Math.max(0,a)+"px";if(this.IsXScroll){this.i_Scroll.style.height=Math.max(1,n-4)+"px";this.i_Scroll.style.top=j+1+"px";this.i_Scroll.style.left=(n+c)+"px"}else{this.i_Scroll.style.top=(a+j)+"px";this.i_Scroll.style.left=(c+1)+"px";this.i_Scroll.style.width=Math.max(1,a-4)+"px"}var m=this.o_Scroll.parentNode;if(this.firstbutton){m.removeChild(this.firstbutton);m.removeChild(this.lastbutton)}var g=this.createScrollEnd(j,c,n,a,d,true);var b=this.createScrollEnd(j,c,n,a,d,false);this.firstbutton=g;this.lastbutton=b;m.appendChild(g);m.appendChild(b)}this.Page=h;this.Max=k;var f=this.Max-this.Page;if(this.IsXScroll){this.ScrollStart=this.o_Scroll.offsetLeft+parseInt(this.Height);this.ScrollLength=parseFloat((this.Width-2*(this.Height))*this.Page/this.Max);this.ScrollLengthVisible=(this.ScrollLength>5)?parseInt(this.ScrollLength):5;this.ScrollStop=parseInt(f*this.ScrollLength/this.Page)+this.ScrollStart-(this.ScrollLengthVisible-parseInt(this.ScrollLength));this.i_Scroll.style.width=this.ScrollLengthVisible+"px"}else{this.ScrollStart=this.o_Scroll.offsetTop+parseInt(this.Width);this.ScrollLength=parseFloat((this.Height-2*(this.Width))*this.Page/this.Max);this.ScrollLengthVisible=(this.ScrollLength>5)?parseInt(this.ScrollLength):5;this.ScrollStop=parseInt(f*this.ScrollLength/this.Page)+this.ScrollStart-(this.ScrollLengthVisible-parseInt(this.ScrollLength));this.i_Scroll.style.height=this.ScrollLengthVisible+"px"}if(l){this.o_Scroll.style.backgroundColor=l}this.i_Scroll.style.backgroundColor=d;this.firstbutton.style.backgroundColor=d;this.lastbutton.style.backgroundColor=d;this.UpdateScrollPos(i)};GraphScrollBar.prototype.GetOffset=function(b){var a;if(this.IsXScroll){a=this.o_Scroll.offsetWidth-2*this.Height}else{a=this.o_Scroll.offsetHeight-2*this.Width}return Math.round(this.Page*b/a)};Qva.Mgr.graph.prototype.RemoveScrollBars=function(){for(var a=0;a<this.ScrollBars.length;a++){this.Element.parentNode.removeChild(this.ScrollBars[a].o_Scroll);this.Element.parentNode.removeChild(this.ScrollBars[a].i_Scroll);this.Element.parentNode.removeChild(this.ScrollBars[a].firstbutton);this.Element.parentNode.removeChild(this.ScrollBars[a].lastbutton)}this.ScrollBars.length=0};Qva.Mgr.graph.prototype.Paint=function(m,t){this.IsSelectable=t.getAttribute("selectable")!=="false";this.Touched=true;var a=this.Element;a.style.display=Qva.MgrGetDisplayFromMode(this,m);if(a.style.display=="none"){return}var b=(m!="e");a.disabled=b;if(!this.IsSelectable){a.style.cursor="";a.SelectStart=null;a.Select=null;a.SelectEnd=null;a.onmousedown=null;a.onmousemove=function(B){this.onmouseover(B)}}a.hover=t.getAttribute("hover")==="true";var f=t.getElementsByTagName("scroll");if(f.length>0){var l=false;for(var v=0;v<f.length;v++){var z=f[v];var r=z.getAttribute("id");var w=z.getAttribute("horizontal")=="true";if(this.ScrollBars[v]){if(this.ScrollBars[v].ScrollId!=r||this.ScrollBars[v].IsXScroll!=w){l=false;break}else{l=true}}else{l=false;break}}if(!l&&this.ScrollBars.length>0){this.RemoveScrollBars()}for(var v=0;v<f.length;v++){var z=f[v];var x=parseInt(z.getAttribute("max"));var g=parseInt(z.getAttribute("page"));var i=parseInt(z.getAttribute("pos"));var n=parseInt(z.getAttribute("top"));var c=parseInt(z.getAttribute("left"));var p=parseInt(z.getAttribute("height"));var s=parseInt(z.getAttribute("width"));var u=HtmlifyARGB(z.getAttribute("color"));var j=HtmlifyARGB(z.getAttribute("bkgcolor"));if(this.ScrollBars[v]){if(!this.ScrollBars[v].i_Scroll.mouseZero){this.ScrollBars[v].UpdateScrollSize(n,c,s,p,x,g,i,u,j)}else{this.ScrollBars[v].UpdateScrollPos(i)}}else{if(s>2&&p>2){var r=z.getAttribute("id");var w=z.getAttribute("horizontal")=="true";this.ScrollBars[v]=new GraphScrollBar(this,a.parentNode,n,c,s,p,u,j,x,g,i,w,z.getAttribute("id"))}}}}else{this.RemoveScrollBars()}for(var y=0;y<this.HotSpots.length;y++){this.Element.parentNode.removeChild(this.HotSpots[y])}this.HotSpots.length=0;var o=t.getElementsByTagName("hotspot");if(o.length>0){for(var y=0;y<o.length;y++){var h=o[y];var n=parseInt(h.getAttribute("top"));var c=parseInt(h.getAttribute("left"));var p=parseInt(h.getAttribute("height"));var s=parseInt(h.getAttribute("width"));var k=document.createElement("div");k.className="Qv_Hotspot";k.style.cursor="pointer";k.style.position="absolute";k.style.top=n+"px";k.style.left=c+"px";k.style.height=p+"px";k.style.width=s+"px";k.index=h.getAttribute("index");k.Name=a.Name;k.binderid=a.binderid;k.onclick=function(B){Qva.GetBinder(this.binderid).SetClick(B,this.Name,this)};a.parentNode.appendChild(k);this.HotSpots[y]=k}}var q=t.getAttribute("stamp");if(q!="0"){var A=q?this.Name:t.getAttribute("name");if(a.disabled){A+=".DISABLED"}var d=this.PageBinder.BuildBinaryUrl(t.getAttribute("path"),q,A);this.avq_url=d}this.PageBinder.QueuePostPaintMessage(this)};Qva.Mgr.graph.prototype.PostPaint=function(){var c=this.Element;if(c.style.display=="none"){return}if(this.AutoSize){this.PageBinder.SetObjectWidth(0);this.PageBinder.SetObjectHeight(0)}var b=this.avq_url;var f=false;if(c.style.width!=""&&c.style.height!=""){var a=Qva.GetObjectBinder(c);var d=a.GetImageSize(c);if(this.GraphWidth!=d.width||this.GraphHeight!=d.height){this.GraphWidth=d.width;this.GraphHeight=d.height;f=true}b+="&width="+escape(d.width)+"&height="+escape(d.height)}if(this.avq_url){c.src=Qva.AddProxyIfAny(b)}if(f){this.PageBinder.SetSize(this.Name,this.GraphWidth+":"+this.GraphHeight)}c.style.display="block"};Qva.Mgr.graph.SelectStart=function(b,a){Qva.DragRect.Open(b,a,this)};Qva.Mgr.graph.Select=function(b,a){Qva.DragRect.Size(b,a)};Qva.Mgr.graph.SelectEnd=function(c,b,a){Qva.DragRect.End(c,b,this,a)};Qva.Mgr.binary=function(a,c,b,d){c.Name=this.Name=Qva.MgrMakeName(b,d);c.binderid=a.binderid;c.ObjectId=a.Element.ObjectId;a.AddManager(this);this.Element=c};Qva.Mgr.binary.prototype.Paint=function(h,g){this.Touched=true;var d=this.Element;d.style.display=Qva.MgrGetDisplayFromMode(this,h);if(d.style.display=="none"){return}var f=(h!="e");var c=g.getAttribute("stamp");if(c!="0"){var b=c?this.Name:g.getAttribute("name");if(f){b+=".DISABLED"}var a=this.PageBinder.BuildBinaryUrl(g.getAttribute("path"),c,b);this.avq_url=a}this.PageBinder.QueuePostPaintMessage(this)};Qva.Mgr.binary.prototype.PostPaint=function(){var b=this.Element;if(b.style.display=="none"){return}var a=this.avq_url;if(this.avq_url){b.src=a}b.style.display="block"};Qva.Mgr.button=function(a,c,b,d){c.Name=this.Name=Qva.MgrMakeName(b,d);c.binderid=a.binderid;c.ObjectId=a.Element.ObjectId;a.AddManager(this);this.Element=c};Qva.Mgr.button.prototype.Paint=Qva.Mgr.binary.prototype.Paint;Qva.Mgr.button.prototype.PostPaint=function(){var f=this.Element;if(f.style.display=="none"){return}var a=null;if(f.tagName!="BUTTON"){Assert(false)}for(var d=0;d<f.childNodes.length;d++){if(f.childNodes[d].tagName=="IMG"){a=f.childNodes[d];break}}if(a){var c=this.avq_url;var h=false;var j=this.PageBinder.IsHosted;if(f.style.width!=""&&f.style.height!=""){var b=Qva.GetObjectBinder(f);var g=b.GetImageSize(f);if((IS_GECKO||IS_CHROME)){g.width-=3;g.height-=1}if(j&&(this.GraphWidth!=g.width||this.GraphHeight!=g.height)){this.GraphWidth=g.width;this.GraphHeight=g.height;h=true}c+="&width="+escape(g.width);c+="&height="+escape(g.height)}if(this.avq_url){a.src=Qva.AddProxyIfAny(c)}if(h){this.PageBinder.SetSize(this.Name,this.GraphWidth+":"+this.GraphHeight)}a.style.display="block"}else{Assert(false)}};Qva.Mgr.dropdown=function(a,c,b,d){this.Name=Qva.MgrMakeName((b!=null)?b:"",d);a.AddManager(this);this.Element=c;a.Append(this,this.Name,"menu");c.disabled=true;c.style.backgroundImage="url(/qvajaxzfc/qvsviewclient.aspx?datamode=binary&public=only&name=menu.DISABLED)";c.onclick=function(h){if(this.disabled){return}var f=Qva.GetBinder(this.BinderId);Qva.HideContextMenu(true);var g=this.previousSibling;while(g&&typeof g.tagName=="undefined"){g=g.previousSibling}if(!g){Assert(false);return}var i=Qva.GetAbsolutePageCoords(g);i.x+=2;i.y+=19;f.OnCreateContextDropDown(f,h,this.Name,null,i)};c.Name=this.Name;c.BinderId=this.BinderId};Qva.Mgr.dropdown.prototype.Paint=function(c,b){this.Touched=true;this.Element.style.display=(c!="n")?"":"none";this.Element.disabled=c!="e";var a=Qva.GetBinder(this.BinderId);this.Element.style.backgroundImage="url("+a.BuildBinaryUrl(null,null,this.Element.disabled?"menu.DISABLED":"menu")+")"};Qva.Mgr.menu=function(a,c,b,d){this.Name=Qva.MgrMakeName((b!=null)?b:"",d);a.AddManager(this);this.Element=c;this.binderid=a.binderid;a.Append(this,this.Name,"menu");Qva.SetContextMenu(c,function(f){if(!f){f=window.event}f.cancelBubble=true;return false})};function ShowSubMenu(b){var c=b.parentNode;if(c.AvqMgr.SubMenuRow!=null&&c.AvqMgr.SubMenuRow!=c&&c.AvqMgr.SubMenuRow.SubMenu){c.AvqMgr.SubMenuRow.SubMenu.style.display="none"}c.AvqMgr.SubMenuRow=c;if(!c.SubMenu){c.SubMenu=document.createElement("table");c.SubMenu.className="contextsubmenu";var a=Qva.GetPageCoords(c);c.SubMenu.style.top=a.y+Qva.GetScrollTop()+"px";c.SubMenu.style.left=a.x+c.offsetWidth+Qva.GetScrollLeft()+"px";document.body.appendChild(c.SubMenu);c.AvqMgr.AppendMenuItems(c.submenunode.getElementsByTagName("action"),c.SubMenu,1)}c.AvqMgr.SubMenuRow.SubMenu.style.display=""}function HighLightRow(a){var b=a.parentNode;b.className="ContextHighlightedRow"}function LeaveRow(a){var b=a.parentNode;b.className="ContextRow"}function HideSubMenu(a){var b=a.parentNode;if(b.AvqMgr.SubMenuRow!=null&&b.AvqMgr.SubMenuRow.SubMenu){b.AvqMgr.SubMenuRow.SubMenu.style.display="none"}}Qva.Mgr.menu.prototype.AppendMenuItems=function(m,d,b){var v=0;var u=true;var h=0;for(var x=0;x<m.length;x++){var p=m[x].getAttribute("text");var c=m[x].getAttribute("type")=="divider";var z=m[x].getElementsByTagName("icon");var j=parseInt(m[x].getAttribute("level"));if(j!=b){continue}if(!p&&!c&&z.length==0){Assert(false);continue}if(c&&x==(m.length-1)){break}h++;var l;var t;var s;var q;if(u){u=(!p&&!c)}if(d.rows[v]&&d.rows[v].cells[0]){l=d.rows[v];t=l.cells[0];if(!u){s=l.cells[1]}}else{l=d.insertRow(-1);t=l.insertCell(-1);if(!u){s=l.insertCell(-1)}}l.className="ContextRow";v++;t.style.width="16px";if(!u){if(l.cells[1]){s=l.cells[1]}else{s=l.insertCell(-1)}s.className="ContextTextCell";if(l.cells[2]){q=l.cells[2]}else{q=l.insertCell(-1)}d.style.width=""}else{d.style.width="20pt"}if(m[x].getAttribute("type")=="divider"){var r=document.createElement("div");r.className="ContextDivider";r.style.width="100%";r.style.height="1px";q.appendChild(r);q.style.padding="0px 0px 0px 0px";q.style.height="1px";var r=document.createElement("div");r.className="ContextDivider";r.style.width="100%";r.style.height="1px";s.appendChild(r);s.style.padding="0px 0px 0px 10px";s.style.height="1px";t.style.padding="0px";t.style.height="1px"}else{for(var y=0;y<z.length;y++){if(b!=parseInt(z[y].getAttribute("level"))){continue}var g=this.PageBinder.BuildBinaryUrl(z[y].getAttribute("path"),z[y].getAttribute("stamp"),z[y].getAttribute("name"));if(z[y].getAttribute("url")){g=z[y].getAttribute("url")}t.innerHTML='<img alt="" src="'+g+'" style="'+z[y].getAttribute("style")+((b==0&&!u)?'" class="Qv_menu" />':'" />')}if(!c){var w=m[x].getAttribute("name");if(!u){s.innerText=p?p:" ";var a=m[x].getAttribute("tooltip");if(a){s.title=a}var A=Qva.SpecialActions.GetShortcutText(w);if(A!=""){q.innerText=A;q.className="Qv_SubMenuContent"}}var f=m[x].getAttribute("mode")=="disabled";l.disabled=f;l.binderid=this.binderid;if(!f){var n=m[x].getAttribute("submenu")=="true";l.AvqMgr=this;if(n){var B=document.createElement("img");B.src=this.PageBinder.BuildBinaryUrl(null,null,"web:submenu");q.className="Qv_SubMenu";q.appendChild(B);l.submenunode=m[x];t.onmouseover=function(){ShowSubMenu(this);HighLightRow(this)};s.onmouseover=function(){ShowSubMenu(this);HighLightRow(this)};q.onmouseover=function(){ShowSubMenu(this);HighLightRow(this)}}else{var o=m[x].getAttribute("clientaction");if(w){l.NeedCursor=m[x].getAttribute("cursor")=="needed";l.onclick=onclick_action;l.Action=this.Context;if(w!="*"){l.Action+="."+w}var k=m[x].getAttribute("index");l.ObjectId=this.Context;if(k){l.Position=k}else{if(this.Position){l.Position=this.Position}}}else{if(o){l.onclick=onclick_ContextClientAction;l.Name=this.Context;l.ObjectId=this.Context.replace(this.PageBinder.DefaultScope+".","");l.clientaction=o;l.param=m[x].getAttribute("param")}}if(j==0){t.onmouseover=function(){HideSubMenu(this);HighLightRow(this)};if(!u){s.onmouseover=function(){HideSubMenu(this);HighLightRow(this)};q.onmouseover=function(){HideSubMenu(this);HighLightRow(this)}}}else{t.onmouseover=function(){HighLightRow(this)};if(!u){s.onmouseover=function(){HighLightRow(this)};q.onmouseover=function(){HighLightRow(this)}}}}t.onmouseout=function(){LeaveRow(this)};if(!u){s.onmouseout=function(){LeaveRow(this)};q.onmouseout=function(){LeaveRow(this)}}}else{t.style.color="InactiveCaptionText";if(!u){s.style.color="InactiveCaptionText"}}}else{Assert(false)}}}return h};Qva.Mgr.menu.prototype.Paint=function(h,b){var a=b.getElementsByTagName("action");if(a.length==0){Qva.HideContextMenu(true);return}this.Touched=true;this.Context=this.PageBinder.DefaultScope+"."+b.getAttribute("context");this.Position=b.getAttribute("position");if(this.IsDropDown){var g=parseInt(b.getAttribute("maxheight"));if(isNaN(g)){this.Element.parentNode.style.width="";this.Element.parentNode.style.height="";this.Element.parentNode.style.overflowY="";this.Element.parentNode.style.overflowX=""}else{this.Element.parentNode.style.width="160px";this.Element.parentNode.style.height=g+"px";this.Element.parentNode.style.overflowY="scroll";this.Element.parentNode.style.overflowX="visible"}}var f=this.AppendMenuItems(a,this.Element,0);if(f==0){Qva.HideContextMenu(true)}else{if(this.Element.offsetHeight+this.Element.offsetTop-Qva.GetScrollTop()>Qva.GetViewportHeight()){var d=Math.max(0,this.Element.offsetTop-this.Element.offsetHeight);this.Element.style.top=d+"px"}if(this.Element.offsetWidth+this.Element.offsetLeft-Qva.GetScrollLeft()>Qva.GetViewportWidth()){var c=Math.max(0,this.Element.offsetLeft-this.Element.offsetWidth);this.Element.style.left=c+"px"}}};Qva.Mgr.toolbar=function(a,c,b,d){this.Name=Qva.MgrMakeName((b!=null)?b:"",d);a.AddManager(this);this.Element=c;this.binderid=a.binderid;a.Append(this,this.Name,"toolbar");Qva.StandardActions=this};Qva.SpecialActions={};Qva.SpecialActions.list=[];Qva.SpecialActions.AddAction=function(f,b,a,d,c){this[f]={keycode:b,document:a,ctrl:d,shift:c};this.list[this.list.length]={id:f,keycode:b,document:a,ctrl:d,shift:c}};Qva.SpecialActions.AddAction("REDO",89,true,true,false);Qva.SpecialActions.AddAction("UNDO",90,true,true,false);Qva.SpecialActions.AddAction("LS",76,true,true,true);Qva.SpecialActions.AddAction("US",85,true,true,true);Qva.SpecialActions.AddAction("CLEARSTATE",68,true,true,true);Qva.SpecialActions.AddAction("BCK",37,true,false,true);Qva.SpecialActions.AddAction("FWD",39,true,false,true);Qva.SpecialActions.GetAction=function(c){for(var a=0;a<this.list.length;a++){var b=this.list[a];if(b.keycode==c.keyCode){if(b.ctrl==ctrlKeyPressed(c)&&b.shift==c.shiftKey){return b}return null}}return null};Qva.SpecialActions.GetShortcutText=function(c){var a=this[c];if(a){var b="\t";if(a.ctrl){b+="Ctrl+ "}if(a.shift){b+="Shift+ "}if(a.keycode==37){b+="Left Arrow"}else{if(a.keycode==39){b+="Right Arrow"}else{b+=String.fromCharCode(a.keycode)}}return b}return""};Qva.Mgr.toolbar.prototype.HandleKeyUp=function(a){var b=Qva.SpecialActions.GetAction(a);if(b&&b.document){this.PageBinder.Set(this.Name+"."+b.id,"action","",true);return true}return false};Qva.Mgr.toolbar.prototype.Paint=function(n,r){this.Touched=true;var b=this.Element;b.style.display=Qva.MgrGetDisplayFromMode(this,n);if(b.style.display=="none"){return}if(IS_TOUCHENABLED){b.style.height="36px"}var j=document.getElementById("Close");var y=r.getElementsByTagName("translate");for(var l=0;l<y.length;l++){var B=y[l].getAttribute("name");var m=y[l].getAttribute("text");this.PageBinder.Translations[B]=m;if(j){switch(B){case"Close":j.innerText=m;break;case"Restore":j.RestoreText=m;break}}}var h=r.getElementsByTagName("action");var w=b.tagName=="TABLE"?b:b.getElementsByTagName("table")[0];if(!w){w=document.createElement("table");b.appendChild(w)}var g;if(w.rows[0]){g=w.rows[0]}else{g=w.insertRow(-1)}var A=r.getElementsByTagName("value");var q=r.getElementsByTagName("help");var o=h.length+1+A.length+(q.length==1?1:0);if(g.cells.length>0&&(o!=g.cells.length)){w.deleteRow(0);g=w.insertRow(-1)}var c=0;for(var u=0;u<h.length;u++){var s=h[u].getAttribute("name");var k=h[u].getAttribute("clientaction");var z=h[u].getElementsByTagName("icon");if(IS_TOUCHENABLED&&(s==="CS"||s==="REPOSITORY"||s==="NEWSHEETOBJ"||s==="SHOWFIELDS"||z[0].getAttribute("name")==="NEWCHART")){continue}var a;if(g.cells[c]){a=g.cells[c]}else{a=g.insertCell(-1)}c++;a.style.width=(IS_TOUCHENABLED?"36px":"20px");a.align="center";a.className="";a.binderid=this.binderid;var m=h[u].getAttribute("text");a.title=m;if(z.length==0){a.innerText=m;a.style.width=h[u].getAttribute("width")||""}for(var x=0;x<z.length;x++){if(z[x].getAttribute("usage")!=null&&z[x].getAttribute("usage")!="caption"){continue}var d=this.PageBinder.BuildBinaryUrl(z[x].getAttribute("path"),z[x].getAttribute("stamp"),z[x].getAttribute("name"));if(IS_TOUCHENABLED){d+="&width=32&height=32";a.innerHTML='<img title="'+m+'" style="height:32px; width:32px;" alt="&nbsp;" src="'+d+'" />'}else{a.innerHTML='<img title="'+m+'" style="height:16px; width:16px;" alt="&nbsp;" src="'+d+'" />'}}if(s||k){if(s){a.onclick=onclick_action;a.Action=this.Name+"."+s}if(k){a.onclick=onclick_ContextClientAction;a.Name=this.Name;a.AvqMgr=this;a.clientaction=k;a.param=h[u].getAttribute("param")}a.disabled=h[u].getAttribute("mode")=="disabled";a.onmouseover=function(){this.className="ToolBarHighlightedButton"};a.onmouseout=function(){this.className="ToolBarButton"};a.className="ToolBarButton"}else{a.style.padding="0px";a.style.backgroundColor="#cccccc";a.style.width="1px"}}var B=this.PageBinder.DefaultScope+".Bookmarks";var a;if(g.cells[c]){a=g.cells[c]}else{a=g.insertCell(-1)}c++;if(a.Name!=B){a.Name=B;a.className="QvToolbarDropdownCell";var p=window.document.createElement("SELECT");a.appendChild(p);new Qva.Mgr.bookmarkselect(this.PageBinder,p,B)}for(var f=0;f<A.length;f++){var B=this.Name+"."+A[f].getAttribute("name");var a;if(g.cells[c]){a=g.cells[c]}else{a=g.insertCell(-1)}c++;if(a.Name==B){continue}a.Name=B;a.className="QvToolbarDropdownCell";var p=window.document.createElement("SELECT");a.appendChild(p);var v=new Qva.Mgr.select(this.PageBinder,p,B);v.Lock=null;v.Unlock=null}if(q.length==1){var a;if(g.cells[c]){a=g.cells[c]}else{a=g.insertCell(-1)}c++;var d=this.PageBinder.BuildBinaryUrl(null,null,"WEBHELP");if(IS_TOUCHENABLED){d+="&width=32&height=32";a.innerHTML='<img title="'+q[0].getAttribute("text")+'" style="height:32px; width:32px;" alt="&nbsp;" src="'+d+'" />'}else{a.innerHTML='<img title="'+q[0].getAttribute("text")+'" style="height:16px; width:16px;" alt="&nbsp;" src="'+d+'" />'}a.HelpUrl=q[0].getAttribute("url");a.onmouseover=function(){this.className="ToolBarHighlightedButton"};a.onmouseout=function(){this.className="ToolBarButton"};a.style.paddingLeft="6px";a.style.paddingRight="6px";a.onclick=function(){Qva.Help.Show(this.HelpUrl)}}};Qva.MgrLinkScan=function(f,a,d,h){f.LinkParts=d.split("$");var c=f.LinkParts.length;f.LinkArgs=d.split("$");if(c>=2){for(var g=1;g<c;g+=2){var b=h+f.LinkParts[g];a.Append(f,b);f.LinkParts[g]=b}}};function onclick_link(){window.open(this.link)}Qva.Mgr.link=function(a,c,b,d,f){if(!Qva.MgrSplit(this,b,d)){return}Qva.MgrLinkScan(this,a,f,d);a.AddManager(this);this.Element=c;c.Name=this.Name;c.binderid=a.binderid;c.onclick=onclick_link};Qva.Mgr.link.prototype.Paint=function(f,c,a){this.Touched=true;var b=this.Element;if(b.Name==a){b.style.display=Qva.MgrGetDisplayFromMode(this,f)}for(var d=1;d<this.LinkParts.length;d+=2){if(this.LinkParts[d]==a){this.LinkArgs[d]=c.getAttribute("text")}}b.link="";for(var d=0;d<this.LinkArgs.length;d++){b.link+=this.LinkArgs[d]}};Qva.Mgr.hover=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}a.AddManager(this);this.Element=c};Qva.Mgr.hover.prototype.Paint=function(j,g,b){var f=this.Element;f.style.display=Qva.MgrGetDisplayFromMode(this,j);f.innerHTML="";var a=g.getElementsByTagName("line");for(var d=0;d<a.length;d++){var h=document.createElement("span");h.innerText=a[d].getAttribute("text");f.appendChild(h);var c=document.createElement("br");f.appendChild(c)}};function SetRelatedElementsZindex(a,c){var h=window.document.getElementById(a);if(h){var g=h.style.zIndex;if(c==g){return}h.style.zIndex=c}var d=[a+"_minimized",a+"_minimized_resize",a+"_minimized_move",a+"_frame_resize",a+"_frame_move"];for(var b=0;b<d.length;b++){var f=window.document.getElementById(d[b]);if(f){f.style.zIndex=c}}}Qva.Mgr.dlg=function(a,d,b,f,c){if(!Qva.MgrSplit(this,b,f)){return}a.AddManager(this);this.Element=d;if(c.toUpperCase()=="EXPRESSION.QVPP"){this.IsExpression=true}d.binderid=a.binderid;d.Name=this.Name;d.AvqDialog=c;d.onclick=Qva.Mgr.dlg.OnClick;d.style.borderColor="gainsboro";d.onmouseover=function(){if(!this.disabled){this.style.borderColor="darkgray"}};d.onmouseout=function(){this.style.borderColor="gainsboro"}};Qva.Mgr.dlg.prototype.Paint=function(g,f){this.Touched=true;var c=this.Element;c.disabled=(g!="e");if(this.IsExpression){c.ExpressionType=f.getAttribute("expression");c.Value=f.getAttribute("text")}c.title=f.getAttribute("label");if(c.tagName=="IMG"){var d=c.getAttribute("icon");if(d){if(c.disabled){d+=".DISABLED"}var a=Qva.GetBinder(c.binderid);var b=a.BuildBinaryUrl(null,null,d);c.src=b}}c.style.display=Qva.MgrGetDisplayFromMode(this,g)};Qva.Mgr.dlg.OnClick=function(){if(this.disabled){return}var b=Qva.GetBinder(this.binderid);if(this.ExpressionType){Qva.ExpressionDialog(this,this.Value)}else{if(Qva.ContextDialogBtn==this){Qva.HideContextDialog()}else{var a=this;b.LoadHtml(this.AvqDialog,function(c){Qva.ShowContextDialog(a,c);b.Refresh()})}}};Qva.Mgr.panel=function(a,g,c,i,f){if(!Qva.MgrSplit(this,c,i)){return}a.AddManager(this);this.Element=g;g.binderid=a.binderid;g.Name=this.Name;g.cells[0].onclick=function(){Qva.SelectToolPane(this,false)};g.cells[1].onclick=function(){Qva.SelectToolPane(this,true)};var h=Qva.GetBinder(g.binderid);var d=document.createElement("img");d.src=h.BuildBinaryUrl("",null,"web:unpinned");g.cells[1].appendChild(d);var b=g.parentNode.parentNode.rows[g.rowIndex+1].cells[0];h.LoadHtml(f,function(j){b.innerHTML=j;a.Scan(g.Name,b)})};Qva.Mgr.style=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}a.AddManager(this);this.Element=c;this.InlineStyle=a.InlineStyle};Qva.Mgr.style.prototype.Paint=function(b,a){this.Touched=true;if(this.InlineStyle){SetElementStyle(this.Element,"fontFamily",a.getAttribute("fontfamily"));SetElementStyle(this.Element,"fontSize",a.getAttribute("fontsize"),"pt");SetElementStyle(this.Element,"fontStyle",a.getAttribute("fontstyle"));SetElementStyle(this.Element,"fontWeight",a.getAttribute("fontweight"));SetElementStyle(this.Element,"textAlign",a.getAttribute("textalign"));SetElementStyle(this.Element,"verticalAlign",a.getAttribute("verticalalign"));SetElementStyle(this.Element,"textDecoration",a.getAttribute("textdecoration"));SetElementStyle(this.Element,"paddingTop",a.getAttribute("paddingTop"),"px");SetElementStyle(this.Element,"paddingLeft",a.getAttribute("paddingLeft"),"px");SetElementStyle(this.Element,"paddingRight",a.getAttribute("paddingRight"),"px");SetElementStyle(this.Element,"paddingBottom",a.getAttribute("paddingBottom"),"px");if(a.getAttribute("color")){this.Element.style.color=HtmlifyARGB(a.getAttribute("color"))}}};Qva.Mgr.bookmarkselect=function(a,c,b){if(a.BookmarksSubscribers){a.BookmarksSubscribers[a.BookmarksSubscribers.length]=this}this.Element=c;c.binderid=a.binderid;c.Name=b;c.onchange=Qva.Mgr.bookmarkselect.OnChange;c.onclick=Qva.CancelBubble;if(a.BookmarksMgr){this.Paint(a.BookmarksMgr)}};Qva.Mgr.bookmarkselect.prototype.Paint=function(i){if(!i){return}var f=this.Element;var h=f.options.length;var j=i.BookMarks.length;f.options.length=j;if(j>=1){this.SelectedIndex=-1;for(var c=0;c<j;++c){var g=i.BookMarks[c];var b=""+g.text;var a=f.options[c];a.text=b.replace(/\t/g," ");a.value=g.value;var d=false;if(a.text==i.CurrentText){this.SelectedIndex=c;d=true}if(d){a.selected=true}}if(this.SelectedIndex==-1){f.options[j-1].selected=true}}f.disabled=false};Qva.Mgr.bookmarkselect.OnChange=function(){var a=Qva.GetBinder(this.binderid);if(!a.Enabled){return}if(this.selectedIndex<0){return}var b=this.options[this.selectedIndex];a.Set(this.Name,"value",b.value,true)};Qva.Mgr.bookmarks=function(a,b){if(!Qva.MgrSplit(this,b,"Document")){return}a.AddManager(this);this.BookMarks=[]};Qva.Mgr.bookmarks.prototype.Paint=function(g,d,b){this.CurrentText=d.getAttribute("text");this.Mode=d.getAttribute("mode");var a=d.firstChild;this.BookMarks.length=0;if(a.nodeName=="choice"){for(var f=a.firstChild;f;f=f.nextSibling){var c={};ObjectifyXmlAttributes(c,f);this.BookMarks[this.BookMarks.length]=c}}else{Assert(false)}this.PageBinder.UpdateBookMarks()};Qva.Mgr.bookmarks.prototype.NewBookmark=function(b,i,j,g,a,h,f,k,c){var d={};d.bmname=b;if(i){d.additive="true"}if(j){d.share="true"}if(g){d.excludeselections="true"}if(a){d.layoutstate="true"}if(h){d.hide="true"}if(f){d.showpopupinfo="true"}if(k){d.infomsg=k}if(c){d.inputfieldvaluesflag="true"}this.PageBinder.Set(this.Name,d)};Qva.Mgr.bookmarks.prototype.SelectBookmark=function(a){this.PageBinder.Set(this.Name,"value",a,true)};Qva.Mgr.bookmarks.prototype.DeleteBookmark=function(a){this.PageBinder.Set(this.Name,"delete",a,true)};Qva.Mgr.selectionsstyle=function(a,b){if(!Qva.MgrSplit(this,b,"Document")){return}a.AddManager(this);this.Styles=[]};Qva.Mgr.selectionsstyle.prototype.GetSelectionStyle=function(b){for(var a=0;a<this.Styles.length;a++){if(this.Styles[a].name==b){return this.Styles[a]}}Assert(false);return null};Qva.Mgr.selectionsstyle.prototype.Paint=function(m,g,f){var h=g.firstChild;this.Styles.length=0;if(h.nodeName=="state"){for(;h;h=h.nextSibling){var d={};d.name=h.getAttribute("name");ObjectifyXmlAttributes(d,h);this.Styles[this.Styles.length]=d}}else{Assert(false)}var b=false;for(var j=0;j<document.styleSheets.length;j++){if(b){break}var n;try{n=document.styleSheets[j].rules?document.styleSheets[j].rules:document.styleSheets[j].cssRules}catch(l){continue}if(!n){continue}for(var c=0;c<this.Styles.length;c++){for(var k=0;k<n.length;k++){var d=n[k];if(d.selectorText==(".Qv"+this.Styles[c].name)){b=true;d.style.color=HtmlifyARGB(this.Styles[c].color);var a=Qva.Hex2CSSExpression(this.Styles[c].backgroundcolor);if(!a){a=HtmlifyARGB(this.Styles[c].backgroundcolor)}d.style.backgroundColor=a}}}}Assert(b)};if(!Qva.Mgr){Qva.Mgr={}}Qva.Mgr.toolwindowtable=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}a.AddManager(this);this.Element=c;this.BinderId=a.ID;this.BaseName=a.Name};Qva.Mgr.toolwindowtable.prototype.Inside=function(i,h){for(var d=0;d<this.DropTargets.length;++d){var c=this.DropTargets[d];if(!c.dropObj){continue}if(c.dropObj.Type!=h){continue}var g=Qva.GetPageCoords(c);var f=parseInt(c.offsetWidth);var b=parseInt(c.offsetHeight);if(i.x>g.x&&i.x<g.x+f&&i.y>g.y&&i.y<g.y+b){if(i.y<g.y+0.37*b){var a="insertbefore"}else{if(i.y>g.y+0.7*b){var a="insertafter"}else{var a="dragto"}}if((c.dropObj.DropOn&&a=="dragto")||(c.dropObj.InsertAfter&&a=="insertafter")||(c.dropObj.InsertBefore&&a=="insertbefore")){return{Element:c,VerticalPosition:a}}}}return null};Qva.Tooltip=null;Qva.ShowTooltip=function(f,a){if(!a.Tooltip){return}if(!Qva.Tooltip){Qva.Tooltip=document.createElement("div");Qva.Tooltip.className="QvHover";Qva.Tooltip.style.zIndex=666;Qva.Tooltip.style.display="none";Qva.Tooltip.style.position="absolute";Qva.Tooltip.style.backgroundColor="#FFFFCC";Qva.Tooltip.style.border="solid 1px black";Qva.Tooltip.style.padding="1px 3px 2px 3px";document.body.appendChild(Qva.Tooltip)}Qva.Tooltip.innerHTML="";var b=a.Tooltip;for(var d=0;d<b.length;d++){var g=document.createElement("span");g.innerText=b[d];Qva.Tooltip.appendChild(g);var c=document.createElement("br");Qva.Tooltip.appendChild(c)}if(!f){f=window.event}Qva.Tooltip.style.left=(f.clientX+Qva.GetScrollLeft()+5)+"px";Qva.Tooltip.style.top=(f.clientY+Qva.GetScrollTop()+5)+"px";Qva.Tooltip.style.display=""};Qva.HideTooltip=function(){if(Qva.Tooltip){Qva.Tooltip.style.display="none"}};Qva.Mgr.toolwindowtable.prototype.Paint=function(u,U){this.Touched=true;this.DropTargets=[];var H=this.Element;var B=0;var o=H.firstChild;while(o.firstChild){o.removeChild(o.firstChild)}for(var w=U.firstChild;w!=null;w=w.nextSibling){if(w.nodeName!="column"){continue}var r=document.createElement("col");r.width=parseInt(w.getAttribute("width"));o.appendChild(r)}for(var w=U.firstChild;w!=null;w=w.nextSibling){if(w.nodeName!="row"){continue}var D=(B<H.rows.length)?H.rows[B]:H.insertRow(-1);++B;switch(w.getAttribute("class")){case"header":D.className="ToolProperty-Header";break;case"navigation":D.className="ToolProperty-Navigation";break;case"warning":D.className="ToolProperty-Warning";break;default:D.className="";break}var d=0;for(var l=w.firstChild;l!=null;l=l.nextSibling){var af=l.getAttribute("name");if(af){af=this.BaseName+"."+af}var ab=l.getAttribute("expression");var R=(d<D.cells.length)?D.cells[d]:D.insertCell(-1);++d;var C=l.getAttribute("indent");if(C){C=12*parseInt(C);R.style.paddingLeft=C+"pt"}else{R.style.paddingLeft=""}var ac=l.getAttribute("label");switch(l.getAttribute("class")){case"highlight":R.className="ToolProperty-Highlight";break}var G=l.getAttribute("colspan");if(G){R.colSpan=parseInt(G)}else{R.colSpan=1}var Y=l.getElementsByTagName("tooltip");var O=Y.length;if(O>0){var A=[];for(var L=0;L<O;++L){A.push(Y[L].getAttribute("text"))}R.Tooltip=A;R.onmouseover=function(a){Qva.ShowTooltip(a,this)};R.onmouseout=function(){Qva.HideTooltip()}}else{R.Tooltip=null}switch(l.nodeName){case"title":R.innerText=l.getAttribute("text");break;case"link":R.innerText=l.getAttribute("text");R.BinderId=this.BinderId;R.Name=af;R.className="ToolProperty-Link";R.onclick=function(){var a=Qva.GetBinder(this.BinderId);if(!a.Enabled){return}a.Set(this.Name,"action","",true)};break;case"literal":R.innerHTML="<span></span>";R.className="ToolProperty-Literal";R.firstChild.innerText=l.getAttribute("text");break;case"text":case"numeric":var y=null;if(C){R.style.paddingLeft=C+"pt"}if(ac){R.innerHTML="<span></span> <input />";R.firstChild.innerText=ac;R.firstChild.className="ToolProperty-Label"}else{var v=l.getAttribute("range");if(v=="percent"){R.innerHTML="<table cellspacing='0' cellpadding='0' width1='100%' ><tr><td width='30pt' >0%</td><td width='134px'><span style='position:absolute;'><hr style='margin:0pt;position:absolute;width:128px;' /><button style='top:-4px;position:absolute;width:4px;height:9px;background-color:lightgrey;border:solid 1px darkgray'></button></span></td><td width='36pt' align='right'>100%</td></tr></table>";y=R.lastChild.rows[0].cells[1].firstChild.lastChild}else{var Z=parseInt(l.getAttribute("size"));if(ab){R.innerHTML="<input style='width:80%'/><button>...</button>";y=R.firstChild;var p=R.lastChild;p.binderid=this.BinderId;p.Name=af;p.disabled=l.getAttribute("mode")!="enabled";p.Value=l.getAttribute("value");p.ExpressionType=ab;p.onclick=function(){Qva.ExpressionDialog(this,this.Value)}}else{if(!isNaN(Z)){R.innerHTML="<textarea rows='"+Z+"'></textarea>"}else{R.innerHTML="<input/>"}}}R.className="ToolProperty-TextInput"}if(y==null){y=R.lastChild}if(l.nodeName=="numeric"&&y.tagName=="INPUT"){y.style.width="24pt";y.style.textAlign="right"}y.Name=af;if(y.tagName!="BUTTON"){y.BinderId=this.BinderId;y.readOnly=l.getAttribute("mode")!="enabled";if(y.readOnly){y.style.color="silver"}y.value=l.getAttribute("value");y.onclick=Qva.CancelBubble;y.onchange=function(){var a=Qva.GetBinder(this.BinderId);if(!a.Enabled){return}a.Set(this.Name,"value",this.value,true)}}else{var T=parseInt(l.getAttribute("value"));T=isNaN(T)?0:T/2;y.style.left=T+"px";y.binderid=this.BinderId;y.moveObj="*";y.xOnly=true;y.xMin=parseInt(l.getAttribute("min"))/2;y.xMax=parseInt(l.getAttribute("max"))/2;y.disabled=l.getAttribute("mode")!="enabled";y.style.cursor=y.disabled?"":"pointer";y.onmousedown=Qva.Move.mouseDown}break;case"check":if(C){R.style.paddingLeft=C+"pt"}R.innerHTML="<input type='checkbox'/> <span></span>";R.lastChild.innerText=ac;R.lastChild.className="ToolProperty-Label";var y=R.firstChild;y.checked=l.getAttribute("value")=="1";y.disabled=l.getAttribute("mode")!="enabled";y.Name=af;y.BinderId=this.BinderId;y.onclick=function(){var a=Qva.GetBinder(this.BinderId);if(!a.Enabled){return}a.Set(this.Name,"value",this.checked?"1":"0",true)};break;case"icon":R.innerHTML="<img />";R.className="ToolProperty-IconCell";var t=R.firstChild;t.className="ToolProperty-Icon";t.disabled=l.getAttribute("mode")!="enabled";if(l.getAttribute("menu")=="true"){t.position=af}var aa=null;var V=l.getAttribute("image");if(l.getAttribute("type")=="radio"){aa=l.getAttribute("stamp");V+="."+l.getAttribute("value")}t.src=Qva.GetBinder(this.BinderId).BuildBinaryUrl(l.getAttribute("path"),aa,V+(t.disabled?".DISABLED":""));t.title=ac;R.BinderId=this.BinderId;R.Name=af;t.dragAccept=l.getAttribute("accept");if(t.dragAccept){this.DropTargets[this.DropTargets.length]=t}var ad=true;var ag=true;switch(l.getAttribute("type")){case"drag":t.dragObj={Name:af,Type:l.getAttribute("content"),Value:l.getAttribute("value")};if(l.getAttribute("dropat")!=null){t.dragObj.DropAt=true}t.BinderId=this.BinderId;t.Name=af;t.onmousedown=Qva.DragDrop.mouseDown;break;case"drop":t.BinderId=this.BinderId;t.Name=af;break;case"action":R.Value=l.getAttribute("value");break;case"radio":ag=false;R.Value=l.getAttribute("value");if(l.getAttribute("selected")=="true"){R.className="ToolProperty-IconSelected"}else{R.className="ToolProperty-IconUnselected"}break;case null:ad=false;break;default:ad=false;break}if(ad){if(!t.disabled){if(ag){t.onmouseover=function(){this.className="HighlightImage"};t.onmouseout=function(){this.className=""}}R.onclick=function(){var a=Qva.GetBinder(this.BinderId);if(!a.Enabled){return}if(this.Value!=null){a.Set(this.Name,"value",this.Value,true)}else{a.Set(this.Name,"action","",true)}}}}break;case"select":case"combo":var y;var p=null;if(ac){if(ab){R.innerHTML="<span></span> <select ></select><button>...</button>";p=R.lastChild;y=p.previousSibling}else{R.innerHTML="<span></span> <select ></select>";y=R.lastChild}R.firstChild.innerText=ac;R.firstChild.className="ToolProperty-Label"}else{if(ab){R.innerHTML="<select style='width:80%'></select><button>...</button>";p=R.lastChild}else{R.innerHTML="<select style='width:100%'></select>"}y=R.firstChild}if(p){p.binderid=this.BinderId;p.Name=af;p.disabled=l.getAttribute("mode")!="enabled";p.Value=l.getAttribute("value");p.ExpressionType=ab;p.onclick=function(){Qva.ExpressionDialog(this,this.Value)}}y.disabled=l.getAttribute("mode")!="enabled";y.Name=af;y.BinderId=this.BinderId;y.onclick=Qva.CancelBubble;y.onchange=function(){if(this.selectedIndex<0){return}var a=Qva.GetBinder(this.BinderId);if(!a.Enabled){return}var b=this.options[this.selectedIndex];a.Set(this.Name,"value",b.value,true)};var f=l.getElementsByTagName("option");var S=f.length;y.options.length=S;var z=l.getAttribute("value");var n=false;for(var L=0;L<S;++L){var J=f[L];var E=y.options[L];E.text=J.getAttribute("text");E.value=J.getAttribute("value");if(E.value==z){E.selected=true;n=true}}if(!n){y.options.length=S+1;var J=f[S];var E=y.options[S];E.text=l.getAttribute("text");E.value=z;E.selected=true}if(l.nodeName=="combo"){var N=y;setTimeout(function(){Qva.Mgr.toolwindowtable.CreateCombobox(N)},0)}break;case"img-select":case"txt-select":var Q="";if(ac){Q+="<span></span> "}if(l.nodeName=="img-select"){Q+='<img class="ToolProperty-ImgSelect" >'}else{Q+='<input class="ToolProperty-TxtSelect" />'}Q+="<button></button>";R.innerHTML=Q;if(ac){R.firstChild.innerText=ac;R.firstChild.className="ToolProperty-Label"}var y=R.lastChild;y.disabled=l.getAttribute("mode")!="enabled";y.Name=af;y.BinderId=this.BinderId;y.style.backgroundImage="url(/qvajaxzfc/qvsviewclient.aspx?datamode=binary&public=only&name=menu"+((l.getAttribute("mode")!="enabled")?".DISABLED":"")+")";y.className="ToolProperty-TxtSelectMenu";var c=y.previousSibling;if(l.nodeName=="img-select"){c.src="/qvajaxzfc/qvsviewclient.aspx?datamode=binary&public=only&name=bundled:"+l.getAttribute("image")}else{c.value=l.getAttribute("text");c.style.width="78%";c.Name=af;c.BinderId=this.BinderId;c.readOnly=l.getAttribute("mode")!="enabled";if(c.readOnly){c.style.color="silver"}if(!c.readOnly){c.onchange=function(){var a=Qva.GetBinder(this.BinderId);if(!a.Enabled){return}a.Set(this.Name,"value",this.value,true)}}}if(!y.disabled){y.onclick=function(b){if(!b){b=window.event}var a=Qva.GetBinder(this.BinderId);Qva.HideContextMenu(true);var aj=Qva.GetAbsolutePageCoords(this.previousSibling);aj.x+=2;aj.y+=19;a.OnCreateContextDropDown(a,b,this.Name,null,aj)}}break;case"color":R.disabled=l.getAttribute("mode")!="enabled";R.Name=af;R.BinderId=this.BinderId;R.onclick=function(){var a=Qva.GetBinder(this.BinderId);if(!a.Enabled){return}a.Set(this.Name,"value",this.Color,true)};if(ac){R.title=ac}var P=l.getAttribute("selected")=="1";R.innerHTML="<div>&nbsp</div>";R.Color=l.getAttribute("value");R.firstChild.className="ToolProperty-Color";R.firstChild.style.backgroundColor=l.getAttribute("value");R.style.backgroundColor=P?"Highlight":"Transparent";break}var q=l.getAttribute("warning");if(q){var t=document.createElement("IMG");t.src=Qva.GetBinder(this.BinderId).BuildBinaryUrl(l.getAttribute("path"),null,"warning");t.title=q;t.style.paddingLeft="2pt";R.appendChild(t);R.title=q}}while(d<D.cells.length){D.deleteCell(d)}var X=w.getAttribute("accept");var s=(w.getAttribute("type")=="drag")&&w.getAttribute("content");if(s||X){var m=w.getAttribute("name");if(m){m=this.BaseName+"."+m}D.BinderId=this.BinderId;D.Name=m;if(X){var k=w.getAttribute("at").split(";");var g=false;var M=false;var i=false;for(var x=0;x<k.length;x++){if(k[x]=="on"){g=true}if(k[x]=="before"){M=true}if(k[x]=="after"){i=true}}D.dropObj={Name:m,Type:X,DropOn:g,InsertAfter:i,InsertBefore:M};this.DropTargets[this.DropTargets.length]=D;var I=Qva.getFrameObjForElement(this.Element);var W=false;var K=X.split(";");for(var j in Qva.DragDrop.DropFrames){if(Qva.DragDrop.DropFrames[j].Name===I.Name){W=true;var F=Qva.DragDrop.DropFrames[j].DropTypes;for(var ai in K){var h=false;for(var ah in F){if(F[ah]===K[ai]){h=true;break}}if(!h){F[F.length]=K[ai]}}break}}if(!W){I.DropTypes=X.split(";");Qva.DragDrop.DropFrames.push(I)}}if(s){var ae=w.getAttribute("content");if(w.getAttribute("label")){D.title=w.getAttribute("label")}D.dragObj={Name:m,Type:ae};D.onmouseover=function(){if(this.className.indexOf("DragTarget")==-1){this.className+=" DragTarget"}};D.onmouseout=function(){this.className=this.className.replace("DragTarget","");this.className=this.className.replace(/^\s+|\s+$/g,"")};D.onmousedown=Qva.DragDrop.mouseDown}}}while(B<H.rows.length){H.deleteRow(B)}};Qva.Mgr.toolwindowbody=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}a.AddManager(this);this.Element=c;this.Managers={};this.OnComplete=new Function(c.getAttribute("onavq"));Qva.DragDrop.DropTargets[Qva.DragDrop.DropTargets.length]=this};Qva.Mgr.toolwindowbody.prototype.Abort=function(){this.SingleName=null};Qva.Mgr.toolwindowbody.prototype.Close=function(d){if(!this.SingleName){return}var c=this.Managers[this.SingleName][0].Element.value;if(c==this.SingleInitalText){return}var b=this.Managers[this.SingleName][0];var a=Qva.GetBinder(b.binderid);if(!a.Enabled){return}this.SingleInitalText=c;a.Set(this.SingleName,"value",c,true)};Qva.Mgr.toolwindowbody.prototype.SetSingleMode=function(a,c){this.SingleName=a;this.SingleInitalText=c;var b=this.Managers[this.SingleName][0];b.Element.value=c;b.Element.onchange=function(){}};Qva.Mgr.toolwindowbody.prototype.Scan=function(a,c){this.IsPage=true;this.SubName=a;var d=c||this.Element;var b=new Qva.Scanner(this);b.Scan(d,a||this.Name,this)};Qva.Mgr.toolwindowbody.prototype.Inside=function(h,c){for(var b in this.Managers){var f=this.Managers[b];for(var a=0;a<f.length;++a){var d=f[a];if(!d.Inside){continue}var g=d.Inside(h,c);if(g!=null){return g}}}return null};Qva.Mgr.toolwindowbody.prototype.PaintTree=function(c,g){for(var i=c.firstChild;i!=null;i=i.nextSibling){var b=i.getAttribute("name");var h=i.getAttribute("mode");switch(h){case"hidden":h="h";break;case"enabled":h="e";break;default:h="d";break}var f=this.Managers[g+"."+b];if(f){for(var a=0;a<f.length;++a){var d=f[a];d.Paint(h,i,b)}}this.PaintTree(i,g+"."+b)}};Qva.Mgr.toolwindowbody.prototype.Paint=function(j,f,k){this.Touched=true;if(f.getAttribute("isDropDialog")){Qva.dropDialog.showAt(f.getAttribute("x"),f.getAttribute("y"))}if(this.IsPage){if(j=="h"){Qva.dropDialog.element.style.display="none";Qva.dropDialog.hidden=true;return}var l=this.Managers["$"];if(l){for(var g=0;g<l.length;++g){var o=l[g];o.Paint("e",f,"$")}}this.PaintTree(f,k);if(this.OnComplete){this.OnComplete(f)}return}var i=f.getAttribute("value");if(i!=this.Selected){this.Managers={};this.Element.innerHTML="<table width='95%'></table>";var p=this.Element.firstChild;p.cellpadding=0;p.cellspacing=0;for(var b=f.firstChild;b!=null;b=b.nextSibling){if(b.nodeName!="property"){continue}var q=p.insertRow(-1);var n=q.insertCell(-1);var a=b.getAttribute("name");var c=b.getAttribute("indent");if(c){c=12*parseInt(c)}n.innerHTML="<table width='98%'><colgroup></colgroup></table>";n.colSpan=2;var o=new Qva.Mgr.toolwindowtable(this,n.firstChild,"."+a,this.Name)}this.Body=p.tBodies[0];this.Selected=i}for(var b=f.firstChild;b!=null;b=b.nextSibling){if(b.nodeName!="property"){continue}var a=this.Name+"."+b.getAttribute("name");var l=this.Managers[a];if(l!=null){var j="d";switch(b.getAttribute("mode")){case"hidden":j="h";break;case"enabled":j="e";break}var d=l.length;for(var m=0;m<d;++m){var o=l[m];var h=j;if(j!="n"&&o.HideIf&&o.HideIf(b.getAttribute("value"),b.getAttribute("text"))){h="n"}o.Paint(h,b,a)}}}};Qva.Mgr.toolwindowbody.prototype.Append=function(){};Qva.Mgr.toolwindowbody.prototype.AddManager=function(b){b.PageBinder=this;b.Touched=false;var a=this.Managers[b.Name];if(a==null){a=[];this.Managers[b.Name]=a}a.push(b)};Qva.Mgr.toolwindownavigation=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}a.AddManager(this);this.Element=c;this.Managers={}};Qva.Mgr.toolwindownavigation.prototype.Paint=function(f,c){this.Touched=true;var a=this.Element;if(f=="h"){a.style.display="none";return}a.style.display="";while(a.firstChild){a.removeChild(a.firstChild)}a.innerHTML="";var i=c.getElementsByTagName("option");var h=i.length;for(var d=0;d<h;++d){if(d>0){var j=document.createElement("span");j.innerText=" > ";a.appendChild(j)}var g=i[d];var b=document.createElement("span");if(d<h-1){b.className="Navigation-Link";b.BinderId=this.BinderId;b.Name=this.Name;b.Link=g.getAttribute("value");b.onclick=function(){var k=Qva.GetBinder(this.BinderId);if(!k.Enabled){return}k.Set(this.Name,"value",this.Link,true)}}b.innerText=g.getAttribute("text");a.appendChild(b)}};Qva.Mgr.toolwindowtable.CreateCombobox=function(b){var a=document.createElement("input");a.style.border="none";a.style.marginTop="2px";a.style.marginLeft="4px";a.style.position="absolute";a.style.height=Math.max(parseInt(b.offsetHeight)-6,0)+"px";a.style.left=parseInt(b.parentNode.offsetLeft)+"px";a.style.width=Math.max(parseInt(b.offsetWidth)-21,0)+"px";if(b.selectedIndex>=0){a.value=b.options[b.selectedIndex].text}b.parentNode.appendChild(a);a.Name=b.Name;a.BinderId=b.BinderId;if(b.disabled){a.disabled=true}else{a.onchange=function(){var c=Qva.GetBinder(this.BinderId);if(!c.Enabled){return}c.Set(this.Name,"text",this.value,true)}}};Qva.ToggleToolPane=function(b){var c=b.parentNode.rows[b.rowIndex+1];var a=b.cells[0].firstChild;if(a.tagName!="IMG"){a=a.nextSibling}if(c.style.display=="none"){a.src="collapse.png";c.style.display=""}else{a.src="expand.png";c.style.display="none"}};Qva.SelectToolPane=function(a,f){var g=a.parentNode;var i=g.parentNode.parentNode;var c=g.rowIndex;if(f&&g.cells[1]){var b=g.cells[1].firstChild;if(b.tagName!="IMG"){b=b.nextSibling}b.src=b.src.replace((b.src.indexOf("unpinned")!=-1)?"unpinned":"pinned",(b.src.indexOf("unpinned")!=-1)?"pinned":"unpinned")}for(var d=0;d<i.rows.length;d+=2){var h=i.rows[d+1];b=i.rows[d].cells[1];if(b){b=b.firstChild}if(b&&b.tagName!="IMG"){b=b.nextSibling}if(d==c||(b&&b.src.indexOf("unpinned")==-1)){h.style.display=""}else{h.style.display="none"}}};Qva.SelectToolTab=function(c){var i=c.parentNode;var a=1;var h=-1;for(var b=i.firstChild;b;b=b.nextSibling){if(b.tagName!="A"){continue}++a;if(b!=c){b.className=""}if(b==c){h=a}}c.className="selected";var d=i.parentNode.parentNode.parentNode.parentNode;for(var f=2;f<d.rows.length;++f){var g=d.rows[f];if(f==h){g.style.display=""}else{g.style.display="none"}}};Qva.Mgr.img=function(a,c,b,d){this.Name=b?Qva.MgrMakeName(b,d):"$";a.AddManager(this);this.Element=c;c.BinderId=a.PageBinder?a.PageBinder.ID:a.ID;c.Name=this.Name};Qva.Mgr.img.prototype.Paint=function(h,g){this.Touched=true;var d=this.Element;d.style.display=Qva.MgrGetDisplayFromMode(this,h);var c=(h=="e");var f=d.getAttribute("icon");if(f){var a=Qva.GetBinder(d.binderid);if(!c){f+=".DISABLED"}var b=a.BuildBinaryUrl(g.getAttribute("path"),null,f);d.src=b}};Qva.Mgr.radio=function(a,c,b,d,f){this.Name=Qva.MgrMakeName(b,d);a.AddManager(this);this.Element=c;c.BinderId=a.PageBinder?a.PageBinder.ID:a.ID;c.Name=this.Name;c.onclick=Qva.Mgr.radio.OnClick;c.setAttribute("unselected-class",c.className)};Qva.Mgr.radio.OnClick=function(){var a=Qva.GetBinder(this.BinderId);a.Set(this.Name,"value",this.getAttribute("value"),true)};Qva.Mgr.radio.prototype.Paint=function(g,b){this.Touched=true;var d=this.Element;d.style.display=Qva.MgrGetDisplayFromMode(this,g);var h=(g=="e");var j=d.getAttribute("value");if(h){var l=b.getElementsByTagName("option");if(l.length>0){h=false;for(var c=0;c<l.length;++c){var f=l[c];if(f.getAttribute("value")!=j){continue}if(f.getAttribute("mode")=="enabled"){h=true}break}}}d.disabled=!h;var i=d.getAttribute("icon");if(i){var k=Qva.GetBinder(d.binderid);if(!h){i+=".DISABLED"}var a=k.BuildBinaryUrl(b.getAttribute("path"),null,i);d.src=a}d.className=(j==b.getAttribute("value"))?d.getAttribute("selected-class"):d.getAttribute("unselected-class")};Qva.Mgr.color=function(a,c,b,d,h){this.Name=Qva.MgrMakeName(b,d);a.AddManager(this);this.Element=c;c.BinderId=a.PageBinder?a.PageBinder.ID:a.ID;c.Name=this.Name;c.setAttribute("value",h);var g=document.createElement("div");c.appendChild(g);g.innerText=" ";g.className="ToolProperty-Color";try{g.style.backgroundColor=h}catch(f){alert("Invalid color:"+h)}c.onclick=Qva.Mgr.color.OnClick};Qva.Mgr.color.OnClick=function(){var a=Qva.GetBinder(this.BinderId);a.Set(this.Name,"value",this.getAttribute("value"),true)};Qva.Mgr.color.prototype.Paint=function(f,c){this.Touched=true;var b=this.Element;b.style.display=Qva.MgrGetDisplayFromMode(this,f);var a=(f=="e");var d=b.getAttribute("value");b.disabled=!a;b.style.backgroundColor=(d==c.getAttribute("text"))?"highlight":""};Qva.Mgr.resize=function(a,c,b,d){this.Name="$";a.AddManager(this);this.Element=c};Qva.Mgr.resize.prototype.Paint=function(c,b){this.Touched=true;var a=this.Element};Qva.Mgr.list=function(a,f,d,g,h){this.Name=Qva.MgrMakeName(d,g);a.AddManager(this);this.Element=f;f.binderid=a.PageBinder?a.PageBinder.ID:a.ID;f.Name=this.Name;var c=f.getElementsByTagName("tr")[0].getElementsByTagName("td");this.Cells=[];for(var b=0;b<c.length;++b){this.Cells[b]=c[b].innerHTML.replace("avqcol=","avq=")}f.deleteRow(0);this.Managers={}};Qva.Mgr.list.prototype.Paint=function(g,c,h){this.Touched=true;var f=this.Element;f.style.display=Qva.MgrGetDisplayFromMode(this,g);var i=parseInt(c.getAttribute("value"));if(isNaN(i)){return}var k=Qva.GetBinder(f.binderid);while(i<f.rows.length){var a=f.rows.length-1;f.deleteRow(a);this.RemoveManagers(this.Name+"."+a)}while(i>f.rows.length){var a=f.rows.length;var l=f.insertRow(-1);for(var b=0;b<this.Cells.length;++b){var j=l.insertCell(-1);j.innerHTML=this.Cells[b]}var d=new Qva.Scanner(this);d.Scan(l,this.Name+"."+a,this)}this.PaintChildren(c,".")};Qva.Mgr.list.prototype.PaintChildren=function(d,c){for(var i=d.firstChild;i!=null;i=i.nextSibling){var b=i.getAttribute("name");if(b==null){continue}var h=i.getAttribute("mode");switch(h){case"hidden":h="h";break;case"enabled":h="e";break;default:h="d";break}var g=this.Managers[this.Name+c+b];if(g){for(var a=0;a<g.length;++a){var f=g[a];f.Paint(h,i,b)}}this.PaintChildren(i,c+b+".")}};Qva.Mgr.list.prototype.Append=function(){};Qva.Mgr.list.prototype.AddManager=function(b){b.PageBinder=this;b.Touched=false;var a=this.Managers[b.Name];if(a==null){a=[];this.Managers[b.Name]=a}a.push(b)};Qva.Mgr.list.prototype.RemoveManagers=function(b){for(var a in this.Managers){if(a.indexOf(b)!=0){continue}this.Managers[a]=null}};Qva.Mgr.row=function(b,f,a,h,d){if(!Qva.MgrSplit(this,a,h)){return}this.Attr="mode";b.AddManager(this);this.Element=f;b.Append(this,this.Name,"value");var j=f;while(j.tagName!="TR"){j=j.parentNode}var g=false;var c=j.cells.length;if(d){if(d=="drag"){g=true}else{if(d.substr(0,4)=="drag"){g=true;c=parseInt(d.substr(4))}else{c=parseInt(d)}}if(isNaN(c)){c=j.cells.length}}if(g){j.dragObj={Name:this.Name,Drag:f}}j.binderid=b.ID;j.Name=this.Name;for(var i=0;i<j.cells.length;++i){cell=j.cells[i];if(i<c){cell.onmouseover=function(k){j.className=j.disabled?"":"HighlightImage";Qva.ShowTooltip(k,j)};cell.onmouseout=function(){j.className="";Qva.HideTooltip()};if(g){cell.onmousedown=Qva.DragDrop.mouseDown}else{cell.onclick=function(){if(j.disabled){return}var k=Qva.GetBinder(j.binderid);if(!k.Enabled){return}k.Set(j.Name,"value",j.Value,true)}}}}};Qva.Mgr.row.prototype.Paint=function(g,d){this.Touched=true;var f=this.Element;var l=f;while(l.tagName!="TR"){l=l.parentNode}l.disabled=(g!="e");l.style.display=Qva.MgrGetDisplayFromMode(this,g);var i=d.getAttribute("icon");if(!i){i=f.getAttribute("icon")}if(i){var k=Qva.GetBinder(f.binderid);if(l.disabled){i+=".DISABLED"}var b=k.BuildBinaryUrl(d.getAttribute("path"),null,i);f.src=b}var h=d.getElementsByTagName("tooltip");var j=h.length;if(j>0){var a=[];for(var c=0;c<j;++c){a.push(h[c].getAttribute("text"))}l.Tooltip=a}else{l.Tooltip=null}if(l.dragObj){l.dragObj.Type=d.getAttribute("content");l.dragObj.Value=d.getAttribute("value")}else{l.Value=d.getAttribute("value")}};Qva.dropDialog={hidden:false,x:0,y:0,element:null,create:function(i){if(document.body===null||(document.body!==null&&typeof(document.body.binderid)==="undefined")){return}var m=Qva.GetBinder(document.body.binderid);if(Qva.dropDialog.element===null){Qva.dropDialog.element=document.createElement("div");Qva.dropDialog.element.style.position="absolute";Qva.dropDialog.element.style.zIndex=666;Qva.dropDialog.element.className="contextdialog";Qva.dropDialog.element.onclick=Qva.CancelBubble;document.body.appendChild(Qva.dropDialog.element)}var j=document.createElement("div");Qva.dropDialog.element.appendChild(j);var h=document.createElement("div");h.className="ToolProperty-Header";if(IS_IE){h.style.width="226px"}var k=document.createElement("img");k.className="icon-close QvCaptionIcon";Qva.addEvent(k,"click",Qva.dropDialog.hide);h.appendChild(k);var n=document.createElement("span");n.setAttribute("avq","text:Document.ContextDialog.Title");h.appendChild(n);j.appendChild(h);var f=document.createElement("table");var g=document.createElement("colgroup");var a=document.createElement("col");a.style.width="16px";g.appendChild(a);a=document.createElement("col");a.style.width="200px";g.appendChild(a);f.appendChild(g);var d=document.createElement("tbody");d.setAttribute("avq","list:Document.ContextDialog.Option");row=document.createElement("tr");cell=document.createElement("td");var c=document.createElement("img");c.setAttribute("avqcol","row:.Name");c.setAttribute("icon","Show");cell.appendChild(c);row.appendChild(cell);cell=document.createElement("td");var l=document.createElement("span");l.setAttribute("avqcol","text:.Name");cell.appendChild(l);row.appendChild(cell);d.appendChild(row);f.appendChild(d);j.appendChild(f);Qva.dropDialogMgr=new Qva.Mgr.toolwindowbody(m,Qva.dropDialog.element,"Document.ContextDialog");Qva.dropDialogMgr.Scan(document.body.Name);Qva.dropDialogMgr.Element.style.display=i?"none":"";try{Qva.dropDialog.element.focus()}catch(b){}},show:function(){Qva.dropDialog.element.style.display=""},showAt:function(a,b){Qva.dropDialog.x=a;Qva.dropDialog.y=b;Qva.dropDialog.element.style.left=a+"px";Qva.dropDialog.element.style.top=b+"px";Qva.dropDialog.show()},hide:function(){Qva.dropDialog.element.style.display="none";Qva.dropDialog.hidden=true;Qva.GetObjectBinder(Qva.dropDialog.element).Set(Qva.dropDialogMgr.Name,"action","close",true)}};QvaExpressionEditor={Insert:function(f,b){if(!b){return}var d=b.parentNode.parentNode.parentNode.parentNode.rows[1].cells[0].firstChild;if(!d.tagName){d=d.nextSibling}if(d.setSelectionRange){var a=d.selectionStart+f.length;if(f[f.length-1]==")"){--a}d.value=d.value.substring(0,d.selectionStart)+f+d.value.substring(d.selectionStart,d.selectionEnd)+d.value.substring(d.selectionEnd,d.value.length);d.setSelectionRange(a,a);d.focus()}else{if(document.selection&&document.selection.createRange){d.focus();var c=document.selection.createRange();c.text=f+c.text;if(f.charAt(f.length-1)==")"){c.moveStart("character",-1);c.moveEnd("character",-1);c.select()}}}},Update:function(b){var a=b.target||b.srcElement;var c=a.options[a.selectedIndex].value;if(!c){c=a.options[a.selectedIndex].text}this.Insert(c,a);if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}a.selectedIndex=0;return false}};Qva.Mgr.xed=function(a,d,c){this.Element=d;d.binderid=a.ID;d.style.border="1px solid silver";d.style.width="100%";d.style.textAlign="left";d.onmouseover=function(){this.style.border="1px outset gray"};d.onmouseout=function(){this.style.border="1px solid silver"};var b=document.createElement("img");b.style.position="relative";b.src="/qvajaxzfc/qvsviewclient.aspx?datamode=binary&public=only&name=menu";d.insertBefore(b,d.firstChild);d.onclick=function(h){if(!h){h=window.event}var g=Qva.GetBinder(this.binderid);Qva.HideContextMenu(true);var f=c;var i=Qva.GetAbsolutePageCoords(d);i.x+=1;i.y+=20;QvaExpressionEditor.Element=d;g.OnCreateContextMenu(g,h,f,null,i)}};function ScrollBar(b){this.TableMgr=b;this.TableMgr.Scrolled=false;var h=document.createElement("div");h.className="Qv_Scrollbar";this.Sibling=b.Element.parentNode;this.Parent=this.Sibling.parentNode;this.Parent.appendChild(h);h.style.overflowX="hidden";h.style.overflowY="scroll";h.style.width=this.TableMgr.GetScrollWidth()+"px";h.style.top="0px";h.style.display="none";var a=document.createElement("div");h.appendChild(a);a.style.width="1px";this.o_YScroll=h;this.i_YScroll=a;var f=document.createElement("div");f.className="Qv_Scrollbar";this.Parent.appendChild(f);f.style.overflowX="scroll";f.style.overflowY="hidden";f.style.height=this.TableMgr.GetScrollHeight()+"px";f.style.left="0px";f.style.display="none";var g=document.createElement("div");f.appendChild(g);g.style.height="1px";this.o_XScroll=f;this.i_XScroll=g;this.VisibleRows=40;this.TotalRows=0;this.Top=0;var c=document.createElement("div");c.className="Qv_ScrollbarBackground";this.Parent.appendChild(c);this.ScrollBackgroundY=c;c.style.width=this.TableMgr.GetScrollWidth()+"px";c.style.top="0px";var d=document.createElement("div");d.className="Qv_ScrollbarBackground";this.Parent.appendChild(d);this.ScrollBackgroundX=d;d.style.height=this.TableMgr.GetScrollWidth()+"px";d.style.top="0px"}ScrollBar.prototype.UpdateXSize=function(a,b,c,d){this.VisibleWidth=Math.max(b,1);this.TotalWidth=a;this.Top=c;this.UpdateWidth(d)};ScrollBar.prototype.Reset=function(){this.SetScrollPosition("o_YScroll","scrollTop",0);this.SetScrollPosition("o_XScroll","scrollLeft",0);this.TableMgr.Scrolled=false};ScrollBar.prototype.UpdateWidth=function(c){if(c.XSupressed||!c.X){this.o_XScroll.style.display="none";this.ScrollBackgroundX.style.display="none";return}else{this.o_XScroll.style.display="";this.ScrollBackgroundX.style.display=""}this.o_XScroll.style.top=this.Top+"px";this.ScrollBackgroundX.style.top=this.Top+"px";var b=this.Sibling.offsetWidth;if(isNaN(b)){return}this.o_XScroll.style.width=b+"px";this.ScrollBackgroundX.style.width=b+"px";if(this.TotalWidth==this.VisibleWidth){this.VisibleWidth-=0.5}var a=Math.round(b*this.TotalWidth/this.VisibleWidth);this.i_XScroll.style.width=a+"px";this.o_XScroll.style.display=(c.XSupressed||!c.X)?"none":"";this.ScrollBackgroundX.style.display=this.o_XScroll.style.display};ScrollBar.prototype.UpdateYSize=function(b,d,c,a){this.VisibleRows=Math.max(d,1);this.TotalRows=b;this.Left=this.Sibling.offsetWidth;this.UpdateHeight(c)};ScrollBar.prototype.UpdateHeight=function(d){if(!d.Y){this.o_YScroll.style.display="none";this.ScrollBackgroundY.style.display="none";return}var a=parseInt(this.Sibling.style.height);if(isNaN(a)){return}this.o_YScroll.style.height=a+"px";var b=Math.round(a*this.TotalRows/this.VisibleRows);if(this.TotalRows==this.VisibleRows){b=Math.round(a*1.05)}if(!IS_IE){b=Math.min(b,10000000)}this.i_YScroll.style.height=b+"px";this.o_YScroll.style.display=b<=a?"none":"";this.ScrollBackgroundY.style.display=this.o_YScroll.style.display;var c=this.Sibling.offsetTop;this.o_YScroll.style.top=c+"px";this.o_YScroll.style.left=this.Left+"px";this.ScrollBackgroundY.style.left=this.Left+"px";this.ScrollBackgroundY.style.height=this.TableMgr.PageBinder.GetContentMaxHeight()+"px"};ScrollBar.prototype.SetScrollPosition=function(b,d,a){this[b].onscroll=function(){};this[b][d]=a;var c=this.TableMgr;this[b].onscroll=Delay(function(){c.Scrolled=true;c.PageBinder.QueuePostPaintMessage(c)},100)};ScrollBar.prototype.GetScrollPosition=function(b,d){this[b].onscroll=null;var a=this[b][d];var c=this.TableMgr;this[b].onscroll=Delay(function(f){c.Scrolled=true;c.PageBinder.QueuePostPaintMessage(c)},100);return a};ScrollBar.prototype.SetOffset=function(a){if(a.y>0){this.SetScrollPosition("o_YScroll","scrollTop",a.y*this.o_YScroll.scrollHeight/this.TotalRows)}if(a.x>0){this.SetScrollPosition("o_XScroll","scrollLeft",a.x*this.o_XScroll.scrollWidth/this.TableMgr.TotalSize.x)}};ScrollBar.prototype.GetOffset=function(){var c={x:0,y:0,scrolllast:false,scrolllastrow:false};var a=parseInt(this.i_YScroll.style.height);if(a>0){var b=this.GetScrollPosition("o_YScroll","scrollTop");c.y=Math.round(this.TotalRows*b/a);if(isNaN(c.y)){Assert(false)}if(c.y+this.VisibleRows>this.TotalRows||(b+this.GetScrollPosition("o_YScroll","offsetHeight")==a)){c.scrolllastrow=true;c.y=this.TotalRows-this.VisibleRows}}if(this.o_XScroll.scrollWidth>0&&this.o_XScroll.style.display==""){var f=0;if(this.TableMgr.Width==1){this.TableMgr.Element.style.width=this.TableMgr.VisibleTableWidth?this.TableMgr.VisibleTableWidth+"px":"100%";var d=((this.o_XScroll.scrollLeft+this.o_XScroll.offsetWidth)/this.i_XScroll.scrollWidth-0.5)*2;this.TableMgr.ScrollParent.scrollLeft=(this.TableMgr.Element.offsetWidth-this.o_XScroll.offsetWidth)*d}else{c.x=Math.ceil((this.TableMgr.TotalSize.x+1)*this.o_XScroll.scrollLeft/this.o_XScroll.scrollWidth);if(c.x+this.TableMgr.VisibleColumnCount>this.TableMgr.TotalSize.x){c.scrolllast=true;c.x=this.TableMgr.TotalSize.x-this.TableMgr.VisibleColumnCount}}}return c};if(!Qva.Mgr){Qva.Mgr={}}Qva.Mgr.table=function(a,c,b,d){this.Name=Qva.MgrMakeName((b!=null)?b:"",d);this.LeftButton=a.LeftButton;this.Element=c;this.Element.TableMgr=this;this.TableScan(a,d);a.AddManager(this);if(!this.AutoCol&&this.Name!=""){a.Append(this,this.Name,"choice")}if(this.Name==""&&this.PageName!=""){this.AddSubscription(this.PageName)}this.ScrollParent=this.Element.parentNode;if(a.Element){this.ObjectId=a.Element.id;this.Frame=a.Element}this.ChunkOffset={x:0,y:0};this.ChunkSize={};this.Debug=true;this.Firstcol=0;this.SizeTodata=null;this.StateClassNameEnd="";this.binderid=a.binderid};Qva.Mgr.table.prototype.GetScrollWidth=function(){if(IS_MAC){return 17}else{return 18}};Qva.Mgr.table.prototype.GetScrollHeight=function(){if(IS_MAC){return 17}else{return 18}};Qva.Mgr.table.prototype.CellObject=function(b,d){this.val=b?b:"";var g=d.getAttribute("title");this.title=g?g:this.val;var a=d.getAttribute("value");if(typeof a!="undefined"){this.intval=a;this.selected=d.getAttribute("selected")=="yes";this.level=d.getAttribute("level");this.parts=d.getElementsByTagName("range")}else{if(d.getAttribute("selected")){this.selected=d.getAttribute("selected")=="yes"}}if(d.getAttribute("state")){this.state=d.getAttribute("state")}if(d.getAttribute("dblclick")){this.dblclick=true}this.mode=d.getAttribute("mode");this.disabled=this.mode=="disabled";this.style=d.getAttribute("style")?d.getAttribute("style"):"0";this.isnum=d.getAttribute("isnum")=="true";this.icons=d.getElementsByTagName("icon");this.subcontent=d.getElementsByTagName("subcontent");this.subcell=d.getAttribute("subcell");this.first=d.getAttribute("first");this.colspan=d.getAttribute("colspan");this.action=d.getAttribute("action");this.url=d.getAttribute("url");if(d.getAttribute("position")){this.position=d.getAttribute("position")}var c=d.getAttribute("selecttype");if(c){this.selecttype=c;this.selectsource=d.getAttribute("selectsource")=="true";if(this.action){Assert(false)}}this.input=d.getAttribute("input")=="true";var f=d.getAttribute("rowspan");if(f){this.rowspan=parseInt(f)}else{this.rowspan=1}};Qva.Mgr.table.prototype.TableScan=function(a,s){var c=this.Element;this.Selected=new Array();var h=c.getAttribute("AvqGroup");if(h!=null){this.Group=Qva.MgrMakeName(h,s);a.Append(this,this.Group)}this.PageSize=0;this.PageName="";this.TotalSize={};this.ColMgr=[];this.Fixed=false;this.RowHeight=-1;this.FirstRowOffsetHeight=-1;this.RowOffsetHeight=-1;this.PercentColWidth=false;this.Search=null;this.SearchName=this.Name;this.Searchable=false;this.IsAsync=false;this.IsTransient=false;this.TableLimit=a.TableLimit;this.InlineStyle=a.InlineStyle;if(c.getAttribute("AvqStyle")){this.InlineStyle=c.getAttribute("AvqStyle")=="true"}var g=c.getAttribute("AvqAsync");this.IsBody=c.getAttribute("avqbody")=="true";this.HeaderRowCount=0;this.FooterRowCount=0;if(g!=null){if(g!=""){var v=g.split(":");if(v.length>2){m_errors[m_errors.length]="Invalid AvqAsync: "+g;return}var u=parseInt(v[0]);if(isNaN(u)||u<=0){m_errors[m_errors.length]="Invalid page-size in AvqAsync: "+u;return}this.PageSize=u;if(v.length>=2){this.PageName=Qva.MgrMakeName(v[1],s)}}else{this.PageSize=20}this.IsAsync=true}this.PageIncr=this.PageSize>0?this.PageSize:20;if(c.tagName=="TABLE"){this.Body=c.tBodies[0];if(this.Body==null){c.insertRow(-1);this.Body=c.tBodies[0]}}else{this.Body=c}var l=this.Body;if(l.rows.length<1){l.appendChild(document.createElement("tr"))}if(IS_GECKO&&GECKO_VERSION<3.5){c.style.borderCollapse="separate";c.style.borderSpacing="0px"}var i=l.rows[0];i.rix=0;this.Width=i.cells.length;this.AutoCol=this.Width===0;var k=null;if(this.Name!=""){k=c.getAttribute("AvqChoice");if(k==null){k=this.Name}}this.Lines=new Array();this.Style=new Array();this.BorderStyle=new Array();this.RowClassNames=new Array();this.ColList=new Array();this.ColDict={};this.ChoiceIx=-1;var w=0;for(;w<this.Width;++w){var b=i.cells[w];var r=b.getAttribute("AvqCol");if(r==null){continue}if(r.indexOf(":")==-1&&r.indexOf(".")>=0){r="edit:"+r}var o=r.split(":");var t=o[0];var x=(o.length>1)?o[1]:this.Name;var d=(o.length>2)?o.slice(2).join(":"):null;if(this.ColMgr[w]){t=this.ColMgr[w].cmd;d=this.ColMgr[w].extra}var f=Qva.ColMgr[t]||Qva.ColMgr.basic;var n=new f(this,w,b,x,s,d);n.Cmd=t;if(n.Name==null){m_errors[m_errors.length]='Invalid AvqCol "'+o[1]+'": '+this.Name;continue}this.ColDict[n.Name]=n;this.ColList[this.ColList.length]=n}this.RowClassNames[0]=l.rows[0].className;var p=c.getAttribute("AvqStripeClasses");if(p!=null){this.RowClassNames=this.RowClassNames.concat((""+p).split(/\s/))}if(k!=null){var n=this.ColDict[k];if(n==null){n=new Qva.ColMgr.basic(this,w,null,k,s);this.ColDict[k]=n;++w}this.ChoiceIx=n.Index}if(this.IsBody&&this.IsAsync){this.ScrollBar=new ScrollBar(this);var q=this;var j=c.parentNode;j.removeChild(c);var m=document.createElement("div");j.appendChild(m);m.appendChild(c);this.Element=m;j.style.overflowY="hidden";m.style.overflowY="hidden";m.style.overflowX="hidden";m.style.position="relative"}};function Delay(a,b){return function(){var c=this;if(a._wait){clearTimeout(a._wait)}a._wait=setTimeout(function(){a.apply(c,arguments);a._wait=null},b)}}Qva.Mgr.table.prototype.Lock=Qva.NoAction;Qva.Mgr.table.prototype.Unlock=Qva.NoAction;Qva.Mgr.table.prototype.getTableElement=function(){if(this.Element.tagName=="DIV"){return this.Element.getElementsByTagName("table")[0]}else{return this.Element}};Qva.Mgr.table.prototype.setTableElementWidth=function(a){this.getTableElement().style.width=a;if(this.Header){this.Header.TableElement.style.width=a}if(this.Footer){this.Footer.TableElement.style.width=a}};Qva.Mgr.table.prototype.AddSubscription=function(a){if(this.PageBinder.Element){this.PageBinder.AddSubscription(this,a)}else{this.PageBinder.Append(this,a,null,true)}};Qva.Mgr.table.prototype.SetObjectHeight=function(a){if(this.PageBinder.Element){this.PageBinder.SetObjectHeight(a)}else{Assert(false)}};Qva.Mgr.table.prototype.SetObjectWidth=function(a){if(this.PageBinder.Element){this.PageBinder.SetObjectWidth(a)}else{Assert(false)}};Qva.Mgr.table.prototype.FixCol=function(p,x,J,b){var r=new Array();var c=false;for(var g=x.firstChild;g;g=g.nextSibling){if(g.nodeName!="value"){continue}if(g.getAttributeNode("width")==null){continue}if(g.getAttribute("name")=="Rect"){continue}r[r.length]=g;if(g.getAttribute("width")=="auto"){c=true}}if(this.PercentColWidth!=c){this.PercentColWidth=c;this.Fixed=false}if(this.Fixed&&this.ColList[this.ChunkOffset.x]){return}var D=r[0]?r[0].childNodes[0]:null;var u=D&&D.getAttribute("value");if(this.Fixed){var G=this.ChunkOffset.x;this.Width=Math.min(this.ChunkOffset.x+this.ChunkSize.x,this.TotalSize.x);for(;G<this.Width;++G){if(!r[G-this.ChunkOffset.x]){continue}var f=null;var A=u?(this.WindowsSelectionstyle?"windowsedit":"edit"):"text";if(this.ColMgr[G]){A=this.ColMgr[G].cmd;f=this.ColMgr[G].extra}J=r[G-this.ChunkOffset.x].getAttribute("name");var t=new Qva.ColMgr[A](this,G,null,J,this.PageName,f);t.Cmd=A;var v=r[G-this.ChunkOffset.x].getAttribute("width");var w=parseInt(v);if(!isNaN(w)){t.Width=w}this.ColDict[t.Name]=t;this.ColList[G]=t}}else{this.Width=r.length;var o=this.Body.parentNode;var n=this.Body.cloneNode(false);var k=document.createElement("tr");n.appendChild(k);k.rix=0;if(!this.ColGroup){this.ColGroup=document.createElement("colgroup");this.getTableElement().insertBefore(this.ColGroup,this.getTableElement().firstChild)}while(this.ColGroup.childNodes.length>0){this.ColGroup.removeChild(this.ColGroup.lastChild)}if(this.Header){if(!this.Header.Inflate){this.Header.Inflate=InflateFixRows}var i=this.Header.Body.parentNode;var B=this.Header.Body.cloneNode(false);var q=document.createElement("tr");B.appendChild(q);q.rix=0;if(!this.Header.ColGroup){this.Header.ColGroup=document.createElement("colgroup");this.Header.TableElement.insertBefore(this.Header.ColGroup,this.Header.TableElement.firstChild)}while(this.Header.ColGroup.childNodes.length>0){this.Header.ColGroup.removeChild(this.Header.ColGroup.lastChild)}}if(this.Footer){if(!this.Footer.Inflate){this.Footer.Inflate=InflateFixRows}var a=this.Footer.Body.parentNode;var z=this.Footer.Body.cloneNode(false);var y=document.createElement("tr");z.appendChild(y);y.rix=0;if(!this.Footer.ColGroup){this.Footer.ColGroup=document.createElement("colgroup");this.Footer.TableElement.insertBefore(this.Footer.ColGroup,this.Footer.TableElement.firstChild)}while(this.Footer.ColGroup.childNodes.length>0){this.Footer.ColGroup.removeChild(this.Footer.ColGroup.lastChild)}}this.ColList=[];var s=this.PageBinder.GetMaxClientWidth();var m=0;var F=0;var l=0;var G=0;for(;G<this.Width;++G){if(s>F){m++}var f=null;var A=u?(this.WindowsSelectionstyle?"windowsedit":"edit"):"text";if(this.ColMgr[G]){A=this.ColMgr[G].cmd;f=this.ColMgr[G].extra}J=r[G].getAttribute("name");var t=new Qva.ColMgr[A](this,G,null,J,this.PageName,f);t.Cmd=A;var v=r[G].getAttribute("width");var w=parseInt(v);if(!isNaN(w)){F+=w;if(IS_IE6_OR_IE7){F+=3}t.Width=w}this.ColDict[t.Name]=t;this.ColList[G]=t}G=0;for(;G<m;++G){var h=0;var I=null;var E=null;var C=null;while(!I){I=r[G].getElementsByTagName("element")[h];if(!I){break}if(I.getAttribute("position")){if(I.getAttribute("position")=="top"){if(!E){E=I}}if(I.getAttribute("position")=="bottom"){if(!C){C=I}}continue;h++}}if(I){var d=k.cells[G];if(d==null){d=k.appendChild(document.createElement("td"))}d.innerHTML="&nbsp;";if(this.InlineStyle){var H=new this.CellObject(I.getAttribute("text"),I);d.style.cssText+=this.SetCellStyle(H,0,G,true,true)}var j=this.ColGroup.appendChild(document.createElement("col"));if(this.PercentColWidth){j.style.width=""+100/this.Width+"%"}else{l+=this.ColList[G].Width;if(IS_IE6_OR_IE7){l+=3}j.style.width=this.ColList[G].Width+"px"}}if(this.Header){if(E){var d=q.cells[G];if(d==null){d=q.appendChild(document.createElement("td"))}d.innerHTML="&nbsp;";if(this.InlineStyle){var H=new this.CellObject(E.getAttribute("text"),E);d.style.cssText+=this.SetCellStyle(H,0,G,true,true)}}var j=this.Header.ColGroup.appendChild(document.createElement("col"));if(this.PercentColWidth){j.style.width=""+100/this.Width+"%"}else{j.style.width=this.ColList[G].Width+"px"}}if(this.Footer){if(C){var d=y.cells[G];if(d==null){d=y.appendChild(document.createElement("td"))}d.innerHTML="&nbsp;";if(this.InlineStyle){var H=new this.CellObject(C.getAttribute("text"),C);d.style.cssText+=this.SetCellStyle(H,0,G,true,true)}}var j=this.Footer.ColGroup.appendChild(document.createElement("col"));if(this.PercentColWidth){j.style.width=""+100/this.Width+"%"}else{j.style.width=this.ColList[G].Width+"px"}}}if(!this.PercentColWidth){this.TotalTableWidth=F;this.getTableElement().style.width=l+"px";this.VisibleColumnCount=m;this.VisibleTableWidth=l}else{this.getTableElement().style.width="100%";this.Element.style.width="";this.TotalTableWidth=null;this.VisibleTableWidth=null;this.VisibleColumnCount=this.Width}o.replaceChild(n,this.Body);this.Body=n;if(this.Header){i.replaceChild(B,this.Header.Body);this.Header.Body=B}if(this.Footer){a.replaceChild(z,this.Footer.Body);this.Footer.Body=z}}};Qva.Mgr.table.prototype.AppendIfMissing=function(d,c){var a=d.length;for(var b=0;b<a;++b){if(d[b]==c){return}}d[a]=c};Qva.PageBinding.prototype.CreateTransientListBox=function(b){var d={};d.name=b;d.id="DS";var f=Qva.Mgr.CreateObject(this,d,false,false);f.Element.className+=" DS";f.Element.style.cssText="z-index: 100; display: none; left: 10pt; top: 10pt; width: 10pt; height: 800pt; position:absolute;";var a=document.createElement("div");a.className="QvBody";var c=document.createElement("table");c.style.cssText="background-color: White;";c.setAttribute("avqbody","true");c.className="QvListBox";c.setAttribute("avqasync","40:"+b);a.appendChild(c);f.ContentElement.appendChild(a);document.body.appendChild(f.Element);f.TableMgr=new Qva.Mgr.table(f,c,d.name);f.TableMgr.Reset=function(){while(this.Body.rows.length>0){this.Body.deleteRow(this.Body.rows.length-1)}this.Fixed=false;this.Width=null;this.RowHeight=-1;this.FirstRowOffsetHeight=-1;this.RowOffsetHeight=-1;this.ByValue=null;this.getTableElement().style.width="";this.Element.style.width="";this.ScrollParent.style.width=""};new Qva.Mgr.style(f,c,d.name+".Style")};Qva.Mgr.table.prototype.ChangeStateClass=function(a){this.StateClassNameEnd=a?("_"+a):""};Qva.Mgr.table.prototype.ModifyAltClasses=function(m,d){var l=this.PageBinder;for(var g=0;g<document.styleSheets.length;g++){var k;try{k=document.styleSheets[g].rules?document.styleSheets[g].rules:document.styleSheets[g].cssRules}catch(h){continue}if(!k){continue}if(m=="LED"||m=="CORNER"){for(var j=0;j<k.length;j++){var c=k[j];var b=null;var a=null;if(c.selectorText==(".QvSelected_"+m)){b="Selected"}if(c.selectorText==(".QvExcluded_"+m)){b="Excluded"}if(c.selectorText==(".QvOptional_"+m)){b="Optional"}if(c.selectorText==(".QvLocked_"+m)){b="Locked"}if(c.selectorText==(".QvDeselected_"+m)){b="Deselected"}if(c.selectorText==(".QvAlternative_"+m)){b="Alternative"}if(c.selectorText==(".QvSelectedExcluded_"+m)){b="SelectedExcluded"}if(c.selectorText==(".QvLockedExcluded_"+m)){b="LockedExcluded"}if(b!=null){for(var f=d.firstChild;f;f=f.nextSibling){if(f.getAttribute("name")==b){a=l.BuildBinaryUrl(l.ImageFolder+m+".png",null,m,HtmlifyARGB(f.getAttribute("backgroundcolor")));break}}}if(a==null){continue}c.style.backgroundImage="url("+a+")";c.style.color=HtmlifyARGB(f.getAttribute("color"))}}else{Assert(false)}}};Qva.Mgr.table.prototype.GetCellRect=function(a,b){Assert(a==-1&&b==-1);var c=Qva.GetAbsolutePageCoords(this.Frame);return{left:c.x,width:this.Frame.offsetWidth,top:c.y,height:this.Frame.offsetHeight}};Qva.Mgr.table.prototype.Paint=function(l,F,r,U){this.debugcounter=0;this.Touched=true;var E=(this.Name==r||this.PageName==r)?F:F.parentNode;var w=E.getAttribute("windowsselectionstyle")=="true";if(this.WindowsSelectionstyle!=null&&this.WindowsSelectionstyle!=w){this.Width=0}this.WindowsSelectionstyle=w;var D=E.getAttribute("owner");this.Height=-1;if(D){var v=parseInt(E.getAttribute("row"));var k=parseInt(E.getAttribute("col"));if(this.Owner&&(this.Owner!=D||this.OwnerRow!=v||this.OwnerCol!=k)){this.Reset()}this.Owner=D;this.OwnerRow=v;this.OwnerCol=k;this.Position=E.getAttribute("position");this.IsTransient=true;if(IS_IE){this.PageBinder.BorderWidth=parseInt(this.PageBinder.Element.currentStyle.borderLeftWidth)}else{var j=document.defaultView.getComputedStyle(this.PageBinder.Element,"");this.PageBinder.BorderWidth=parseInt(j.getPropertyValue("border-left-width"))}this.PageBinder.TransientObject=this.PageName;if(!this.Fixed){var V=document.getElementById(this.Owner);var L=V&&V.AvqMgr&&V.AvqMgr.GetSearchMgr();if(L&&L.GetCellRect){var C=L.GetCellRect(k,v);if(this.Position=="offset"){C.left-=15}else{if(this.Position=="cut"){C.width-=15}else{if(this.Position=="below"){C.top+=C.height}else{if(this.Position=="right"){C.left+=C.width}else{Assert(this.Position=="")}}}}C.height=Qva.GetViewportHeight();C.height-=(C.top-Qva.GetScrollTop());if(C.height>80){C.height-=40}C.width=Math.max(C.width,50);this.Frame.style.left=C.left+"px";this.Frame.style.top=C.top+"px";this.Frame.style.height=C.height+"px";this.Frame.style.width=C.width+"px";this.Frame.rect=C;this.SetObjectWidth(0);this.SetObjectHeight(0)}else{Assert(false);this.PageBinder.PageBinder.CloseTransient();return}}}this.PageBinder.Searchable=E.getAttribute("searchable")=="true";var s=this.Element;try{var c=Qva.MgrGetDisplayFromMode(this,l);var H=this.ColDict[r];if(H==null){if(c!=s.style.display){s.style.display=c}}else{if(c=="none"){if(H.Index!=0){for(var q=0;q<this.Lines.length&&this.Lines[q];++q){this.Lines[q][H.Index]=null}}return}}}catch(ab){Assert(false)}if(this.InlineStyle){var aa=F.getElementsByTagName("style");if(aa.length>0){aa=aa[0].getElementsByTagName("style");for(var d=0;d<aa.length;d++){this.Style[d]=new this.StyleObject(aa[d])}}aa=F.getElementsByTagName("borderstyle");if(aa.length>0){aa=aa[0].getElementsByTagName("borderstyle");for(d=0;d<aa.length;d++){this.BorderStyle[d]=new this.BorderStyleObject(aa[d])}}}if(F.getAttribute("menu")=="true"){this.Menu=true}this.PageBinder.QueuePostPaintMessage(this);if(this.Group==r){var Q=F.childNodes;var f=Q.length;if(f>this.TableLimit){TableTruncateAlert(this.Name,f);f=this.TableLimit}var u=0;for(q=0;q<f;++q){var G=Q[q];if(this.ByValue==null){this.ByValue=(G.getAttribute("value")!=null)}var P=G.getAttribute("position");if(this.IsBody){if(P=="top"){u++;continue}}var X=q-u;if(X>=this.Lines.length){this.Lines[X]=new Array()}var ad=G.childNodes;var b=ad.length;for(var a=0;a<b;++a){var R=ad[a];r=R.getAttribute("name");for(var x in this.ColList){var H=this.ColList[x];if(H.Name!=r){continue}var S=R.getAttribute(H.Attr);if(H.Dec!=null){S=Qva.Trunc(S,H.Dec)}this.Lines[X][H.Index]=new this.CellObject(S,R)}}}this.Lines.length=f;this.TotalSize.y=f;this.VisibleColumnCount=this.Width;return}this.AndMode=E.getAttribute("andmode")=="true";var Y=E.getAttribute("semantic")=="true";if((Y||this.Semantic)&&Y!=this.Semantic){this.Semantic=Y;this.ChangeStateClass(this.Semantic?"Semantic":"")}var o=E.getAttribute("altclass");if(o!=this.AltClass){this.ChangeStateClass(o);this.AltClass=o;if(this.AltClass){this.ModifyAltClasses(this.AltClass,E.getElementsByTagName(this.AltClass)[0])}}var W=E.getAttribute("sizetodata")=="true"&&this.AutoCol;if(this.SizeTodata!=null&&this.SizeTodata!=W){this.Fixed=false}this.SizeTodata=W;this.SupressHorizontalScroll=E.getAttribute("suppresshorizontalscroll")=="true"&&this.AutoCol;if(this.IsBody){if(this.ScrollBar){this.Element.style.overflowX="hidden";s.parentNode.style.overflowX="hidden"}else{if(this.SupressHorizontalScroll&&this.IsBody){s.parentNode.style.overflowX="hidden"}else{s.parentNode.style.overflowX="auto"}}}if((this.PageName==""||this.PageName==r)){var I=E.getAttribute("pageoffset");var g=E.getAttribute("totalsize");var t={};if(g){t.x=parseInt(g.split(":")[0]);t.y=parseInt(g.split(":")[1])}if(I){this.ChunkOffset.x=parseInt(I.split(":")[0]);this.ChunkOffset.y=parseInt(I.split(":")[1]);var M=E.getAttribute("pagesize");var A={};A.x=parseInt(M.split(":")[0]);A.y=parseInt(M.split(":")[1]);this.Fixed=this.Fixed&&this.ChunkSize.x==A.x&&this.ChunkSize.y==A.y;this.Fixed=this.Fixed&&this.TotalSize.x==t.x&&this.TotalSize.y==t.y;if(!this.Fixed&&this.ScrollBar){this.ScrollBar.Reset()}this.ChunkSize=A}else{this.Fixed=false}var B=E.getAttribute("scrollposition");if(B){this.ScrollPosition={};this.ScrollPosition.x=parseInt(B.split(":")[0]);this.ScrollPosition.y=parseInt(B.split(":")[1])}else{this.ScrollPosition=null}this.TotalSize=t;var p=Math.max(500,this.ChunkSize.y);if(isNaN(this.EffectiveSize)||this.EffectiveSize<p){this.EffectiveSize=p}if(this.ChunkOffset.y+this.ChunkSize.y>=p){this.EffectiveSize+=p}if(this.EffectiveSize>this.TotalSize.y){this.EffectiveSize=this.TotalSize.y}if(this.IsAsync){if(!U){this.Lines.length=0;if(this.ScrollBar){this.ScrollBar.Reset()}else{if(this.ChunkOffset.y==0){this.ScrollParent.scrollTop=0}}}}}else{this.Fixed=false}if(this.Name==r){this.Current=F.getAttribute("text");if(this.Current!=null){return}Q=F.getElementsByTagName("choice");var N=Q.length>=1;if(N){Q=Q[0].getElementsByTagName("element")}else{Q=F.getElementsByTagName("element")}f=Q.length;if(this.IsAsync&&U){for(q=0;q<f;++q){G=Q[q].getAttribute("text");if(!N||Q[q].getAttribute("selected")=="yes"){this.AppendIfMissing(this.Selected,G)}}}else{var ac=0;var Z=0;var i=0;for(q=0;q<f;++q){G=Q[q].getAttribute("text");if(!N||Q[q].getAttribute("selected")=="yes"){this.Selected[ac++]=G}}this.Selected.length=ac}Q=F.getElementsByTagName("choice");if(Q.length>=1){Q=Q[0].getElementsByTagName("element")}f=Q.length;if(0<f&&this.ByValue==null){this.ByValue=(Q[0].getAttribute("value")!=null)}if(this.ByValue==true){if(this.AllValues==null){this.AllValues=new Array()}var Q=F.getElementsByTagName("choice");if(Q.length>=1){Q=Q[0].getElementsByTagName("element")}var f=Q.length;if(this.IsAsync){if(!U){this.AllValues.length=this.EffectiveSize}var T=this.ChunkOffset.y;for(var q=0;q<f;++q){this.AllValues[q+T]=Q[q].getAttribute("value")}}else{this.AllValues.length=f;for(var q=0;q<f;++q){this.AllValues[q]=Q[q].getAttribute("value")}}}}if(this.AutoCol&&l!="h"){this.FixCol(l,F,r,U)}else{this.VisibleColumnCount=this.Width}if(this.ColList.length==0){return}var n=0;var K=0;var h=this.ChunkOffset.x!=0?this.ChunkOffset.x:0;for(var ae=h;ae<this.ColList.length;ae++){var H=this.ColList[ae];if(!H){continue}var z=null;for(var y=F.firstChild;y;y=y.nextSibling){if(y.nodeName!="value"){continue}if(y.getAttribute("name")!=H.Name){continue}z=y;break}if(z==null){continue}Q=z.getElementsByTagName("element");var f=Q.length;if(f>this.TableLimit){TableTruncateAlert(this.Name,f);f=this.TableLimit}n=0;K=0;var O=0;for(var q=0;q<f;++q){var G=Q[q];var S=G.getAttribute("text");var P=G.getAttribute("position");O=q;var J;if(P=="top"){n++;J=this.Header.Lines}else{if(P=="bottom"){O-=n;K++;J=this.Footer.Lines}else{O-=n;O-=K;O+=this.ChunkOffset.y;J=this.Lines}}if(J[O]==null){J[O]=new Array()}var m=J[O];m[H.Index]=new this.CellObject(S,G)}if(!this.IsAsync&&f>0){this.Lines.length=O+1}if(f==0){this.Lines.length=0}}if(this.Header){this.Header.Lines.length=n;this.Header.Inflate();if(this.HeaderRowCount!=n){this.Fixed=false}this.HeaderRowCount=n}if(this.Footer){this.Footer.Lines.length=K;this.Footer.Inflate();if(this.FooterRowCount!=K){this.Fixed=false}this.FooterRowCount=K}};Qva.Mgr.table.prototype.StyleObject=function(c){var d=c.getAttribute("bgcolor");this.BgColorRGB=HtmlifyARGB(d);this.BgColorCSSExpr=Qva.Hex2CSSExpression(d);this.Color=HtmlifyARGB(c.getAttribute("color"));this.NumAdjust=c.getAttribute("numadjust");this.TextAdjust=c.getAttribute("textadjust");this.LabelAdjust=c.getAttribute("labeladjust");this.BorderStyle=c.getAttribute("borderstyle");var a=c.getAttribute("fontstyle");this.FontStyle=a;this.FontWeight=c.getAttribute("fontweight");this.TextDecoration=c.getAttribute("textdecoration");this.SizeMod=c.getAttribute("sizemod");var b=c.getAttribute("stretchmode");if(b){this.StretchMode=b}};Qva.Mgr.table.prototype.BorderStyleObject=function(f){var h=f.getAttribute("top").split(" "),d=f.getAttribute("right").split(" "),b=f.getAttribute("bottom").split(" "),g=f.getAttribute("left").split(" "),c=0,a=0;for(c=0,a=h.length,this.Top="";c<a;c++){this.Top+=HtmlifyARGB(h[c])+" "}for(c=0,a=d.length,this.Right="";c<a;c++){this.Right+=HtmlifyARGB(d[c])+" "}for(c=0,a=b.length,this.Bottom="";c<a;c++){this.Bottom+=HtmlifyARGB(b[c])+" "}for(c=0,a=g.length,this.Left="";c<a;c++){this.Left+=HtmlifyARGB(g[c])+" "}};Qva.Mgr.table.prototype.GetIndex=function(b){if(this.ChoiceIx<0){return 0}var c=b[this.ChoiceIx].val;if(this.Current!=null){return(this.Current===c)?1:0}for(var a=0;a<this.Selected.length;++a){if(this.Selected[a]===c){return 1}}return 0};Qva.Mgr.table.prototype.GetSelected=function(c,b){var a=this.Lines[c];return a[b].state?a[b].state=="Selected":false};Qva.Mgr.table.prototype.GetDisabled=function(b,a){return b[a].state?(b[a].state=="LockedExcluded"||b[a].state=="Excluded"||b[a].state=="SelectedExcluded"):true};Qva.Mgr.table.prototype.GetDeselected=function(c,b){var a=this.Lines[c];return a[b].state?a[b].state=="Deselected":true};function AvqAction_TableCheck(){var d=this;var j=d.parentNode.parentNode;if(j.tagName!="TR"){return}var h=GetTableManager(j);if(h==null){return}if(!h.PageBinder.GetEnabled()){return}var f=j.rix;var a=(h.Search!=null&&h.Search.value!="");var i=(h.Count!=null)?h.Count:h.Name;if(h.ByValue&&h.PageBinder.Autoview!=null){var g=h.AllValues[f];h.PageBinder.Set(i,"count",(d.checked?" ":"-")+g,!a)}else{if(h.ChoiceIx!=-1){var b=h.Lines[f][h.ChoiceIx].val;h.PageBinder.Set(i,"count",(d.checked?" ":"-")+b,!a)}else{var c=h.ColList[d.parentNode.cellIndex].Name;h.PageBinder.Set(h.Group,"cell",f+":"+c+":"+(d.checked?"1":"0"),!a)}}if(a){h.PageBinder.Set(h.SearchName,"closesearch","abort",true);if(h.Search!=null){h.Search.value=""}}}function AvqAction_TableInput(){var b=this;var f=b.parentNode.parentNode;if(f.tagName!="TR"){return}var c=GetTableManager(f);if(c==null){return}if(!c.PageBinder.GetEnabled()){return}var a=f.rix;var d=c.ColList[b.parentNode.cellIndex].Name;c.PageBinder.Set(c.Group,"cell",a+":"+d+":"+b.value,true)}Qva.Mgr.table.prototype.appendCellIcon=function(q,s,d,g,m,h,t){var u=document.createElement("img");var p="cursor: pointer;";var a=q.getAttribute("alttext");u.alt=a?a:"";var v=q.getAttribute("name");var n=q.getAttribute("align");u.className="Qv_CellIcon";if(n){u.className+="_"+n}u.className+=" Qv_"+v;var i=q.getAttribute("stamp");var b=parseFloat(q.getAttribute("percentwidth"));var j=h.Width-2;if(!isNaN(b)){j=parseInt(j*b/100);u.style.width=j+"px"}var r=q.getAttribute("sendsize")=="true";if(r){if(h.CellHeight==-1||h.Width==-1){Assert(false)}p+="height:"+h.CellHeight+"px; width:"+j+"px; "}u.style.cssText=p;var c=q.getAttribute("url");if(c){u.src=Qva.AddProxyIfAny(c)}else{var i=q.getAttribute("stamp");var l=HtmlifyARGB(q.getAttribute("color"));var c=this.PageBinder.BuildBinaryUrl(q.getAttribute("path"),i,v,l);if(r){if(q.getAttribute("stretchmode")){g=q.getAttribute("stretchmode")}c+="&width="+j+"&height="+h.CellHeight+"&stretchmode="+g+"&adjust="+m}if(Qva.GetBinder(this.binderid).CustomIcons[v]){u.src=c}else{u.src=Qva.AddProxyIfAny(c)}var k=q.getAttribute("action");var f=q.getAttribute("clientaction");var o=q.getAttribute("drag");if(k||f){u.binderid=this.binderid;if(k){u.onmousedown=avq_action_md;u.onmouseup=avq_action_mu;u.onclick=Qva.CancelAction;u.pressed=false;u.action=k}else{if(f){u.onmousedown=Qva.CancelAction;u.onmouseup=Qva.CancelAction;u.onclick=onclick_ContextClientAction;u.AvqMgr=this;u.clientaction=f;u.param=q.getAttribute("param")}}u.ObjectId=this.ObjectId;if(typeof(t)==="undefined"){u.xx=s;u.yy=d}else{u.val=t}if(q.getAttribute("menu")=="true"){u.position=k+":"+s+":"+d;Qva.SetContextMenu(u,function(w){this.pressed=false;return Qva.GetBinder(this.binderid).OnContextMenu(w,this.ObjectId)})}}else{if(o){u.dragObj={Name:this.PageName,type:"col"}}else{u.ondrag=function(){return false};u.onmousedown=Qva.NoAction;u.onmouseup=Qva.NoAction;u.onclick=Qva.NoAction}}}return u};Qva.Mgr.table.prototype.appendCellContent=function(b,E,k,D,f,n){if(!this.ByValue){if(b.position.split(":")[2]=="Body"){f+=this.HeaderRowCount+this.PageOffsetForPainting().y}else{if(b.position.split(":")[2]=="Foot"){f+=this.HeaderRowCount+this.TotalSize.y}}}var a=parseInt(E.level);var d=b.offsetLeft+1;var t=0;if(!isNaN(a)){var r=b.origpadding;if(isNaN(b.origpadding)){if(IS_IE){r=parseInt(b.currentStyle.paddingLeft)}else{var o=document.defaultView.getComputedStyle(b,"");r=parseInt(o.getPropertyValue("padding-left"))}b.origpadding=r}else{r=b.origpadding}for(var w=0;w<parseInt(E.level);w++){d+=10;t+=10;r+=10}b.style.paddingLeft=r+"px"}b.innerHTML="";var F="left";var y=this.Style[E.style];var l=null;if(y){if(E.position=="top"){F=y.LabelAdjust}else{F=E.isnum?y.NumAdjust:y.TextAdjust}l=y.StretchMode}var B=0;for(var x=0;x<E.icons.length;x++){var z=E.icons[x];var A=this.appendCellIcon(z,D,f,l,F,n,E.intval);if(z.getAttribute("align")){if(z.getAttribute("align")=="left"){d+=10}if(z.getAttribute("align")=="right"){B+=10}t+=10}b.appendChild(A)}var v=0;for(var H=0;H<E.subcontent.length;H++){var h=E.subcontent[H];var q=n.Width-2;if(h.getAttribute("name")){var c=parseFloat(h.getAttribute("percentwidth"));v+=c;q=parseInt(q*c/100);t+=q;var m=this.appendCellIcon(h,D,f,l,F,n);if(IS_IE6_OR_IE7){m.className="Qv_SubContent";m.style.right=B+"px";m.style.position="absolute"}b.appendChild(m)}else{var u=document.createElement("span");u.innerText=h.getAttribute("text")?h.getAttribute("text"):"  ";u.className="Qv_SubContent";var c=parseFloat(h.getAttribute("percentwidth"));if(!isNaN(c)){v+=c;q=parseInt(q*c/100);u.style.width=q+"px"}else{q=parseInt(h.getAttribute("width"));if(!isNaN(q)){u.style.width=q+"px"}}t+=q;if(IS_IE6_OR_IE7){u.style.position="absolute";u.style.right=B+"px"}if(h.getAttribute("align")){u.style.textAlign=h.getAttribute("align")}b.appendChild(u)}B+=q}if(E.parts&&E.parts.length>0){var p=0;var C=0;while(k!=""){var s=E.parts[C++];if(s){var j=parseInt(s.getAttribute("pos"));var G=parseInt(s.getAttribute("count"));if(j>p){var u=document.createElement("span");u.innerText=k.substr(0,j-p);k=k.substr(j-p);p=j;b.appendChild(u)}var u=document.createElement("span");u.innerText=k.substr(0,G);k=k.substr(G);p+=G;u.className="qvHighLighted";b.appendChild(u)}else{var u=document.createElement("span");u.innerText=k;b.appendChild(u);k=""}}}else{if(v<100){if(k){if(IS_IE6_OR_IE7&&t>0){if(n.Width-2-t>0){var u=document.createElement("span");u.innerText=k;u.style.position="absolute";u.style.left=d+"px";u.style.overflow="hidden";u.style.width=n.Width-2-t+"px";b.appendChild(u)}}else{var g=document.createTextNode(k);b.appendChild(g)}}}}};Qva.Mgr.table.prototype.GetScrollbarStatus=function(){if(!this.IsBody){return null}var j=this;var k=this.PageBinder.GetMaxClientWidth();var b=k<j.TotalTableWidth;var a=b&&j.SupressHorizontalScroll;var h=(b&&!j.SupressHorizontalScroll)?j.GetScrollHeight():0;var g=isNaN(j.TotalSize)?j.Lines.length:j.TotalSize;var c;if(g>0){c=j.RowOffsetHeight*g}var i=j.GetScrollMaxHeight();var d=(i-h)<c;var f=d?j.GetScrollWidth():0;if(d){b=k<(j.TotalTableWidth+f);a=b&&j.SupressHorizontalScroll;h=(b&&!j.SupressHorizontalScroll)?j.GetScrollHeight():0}return{X:b,Y:d,XSupressed:a,XScrollHeight:h,YScrollWidth:f}};Qva.Mgr.table.prototype.HasHorizontalScrollbar=function(){return this.GetScrollbarStatus().X};Qva.Mgr.table.prototype.FixTableWidth=function(h){if(this.Lines.length>0&&this.getTableElement().offsetWidth<10){Assert(false)}if(this.Lines.length==0){return}var b=this.PageBinder.GetMaxClientWidth();var d=b;var c=null;var k=null;if(this.HeaderVisible()){c=this.Header.ColGroup.childNodes[this.VisibleColumnCount-1]}if(this.FooterVisible()){k=this.Footer.ColGroup.childNodes[this.VisibleColumnCount-1]}var f=this.ColGroup.childNodes[this.VisibleColumnCount-1];var g="";var j=this.VisibleTableWidth;if(h.XSupressed){j=d-h.YScrollWidth}else{g=this.ColList[this.VisibleColumnCount-1].Width;if(this.SizeTodata&&(this.TotalTableWidth+h.YScrollWidth)<d){d=this.TotalTableWidth;d+=h.YScrollWidth}}this.setTableElementWidth(j+"px");f.style.width=g;if(this.HeaderVisible()){c.style.width=g}if(this.FooterVisible()){k.style.width=g}var l=!this.SizeTodata||h.X;if(l){this.SetObjectWidth(0);if(this.PageBinder.type="LB"&&!h.X){this.ColGroup.childNodes[0].style.width="100%";this.getTableElement().style.width="100%";this.Element.style.width="";this.TotalTableWidth=null;this.VisibleTableWidth=null;this.VisibleColumnCount=this.Width;this.PercentColWidth=true}}else{var i=b-d;this.SetObjectWidth(i)}var a="";if(h.Y&&this.ScrollBar){a=(d-h.YScrollWidth)+"px"}this.ScrollParent.style.width=a;if(this.HeaderVisible()){this.Header.ScrollParent.style.width=a}if(this.FooterVisible()){this.Footer.ScrollParent.style.width=a}};Qva.Mgr.table.prototype.FixListBoxWidth=function(b){if(b.Y){var a=this.PageBinder.GetMaxClientWidth();this.ScrollParent.style.width=(a-b.YScrollWidth)+"px";this.getTableElement().style.width=(a-b.YScrollWidth)+"px"}else{this.ScrollParent.style.width=""}};Qva.Mgr.table.prototype.GetScrollMaxHeight=function(){var b=this.PageBinder.GetContentMaxHeight();var c=this.PageBinder.ContentElement;var g=c.childNodes.length;for(var d=0;d<g;d++){var f=c.childNodes[d];if(f==this.ScrollParent){continue}if(f.style.display=="none"){continue}if(IS_IE){if(f.currentStyle.position!="relative"){continue}}else{var a=document.defaultView.getComputedStyle(f,"");if(a.getPropertyValue("position")!="relative"){continue}}b-=f.offsetHeight}if(b>0){return b}return 0};Qva.Mgr.table.prototype.FixTableHeight=function(d){var k=this.GetScrollMaxHeight();var i=k;var g=0;if(this.SizeTodata){var h,b;if(this.ScrollBar){var h=0;if(this.TotalSize.y>0){h=this.RowOffsetHeight*this.TotalSize.y}realWidth=this.getTableElement().offsetWidth;b=this.Element}else{h=this.Element.offsetHeight;realWidth=this.Element.offsetWidth;b=this.ScrollParent}if(!d.Y){i=this.getTableElement().offsetHeight;i+=d.XScrollHeight}g=k-Math.max(i,1);i=Math.min(i,k);if(this.ScrollBar){i-=d.XScrollHeight}}else{if(this.ScrollBar){i-=d.XScrollHeight}}if(parseInt(this.ScrollParent.style.height)!=i){if(isNaN(i)||i<0){this.ScrollParent.style.height="1px"}else{this.ScrollParent.style.height=i+"px"}}g=Math.max(g,0);this.SetObjectHeight(g);if(this.ScrollBar){if(this.TotalSize.y==0&&!this.FooterVisible()&&!this.HeaderVisible()){this.ScrollBar.UpdateHeight(d);this.ScrollBar.UpdateWidth(d)}else{var j=1;if(this.TotalSize.y>0){var c=this.RowOffsetHeight==-1?this.Body.rows[0].cells[0].offsetHeight:this.RowOffsetHeight;var j=Math.max(1,Math.min(this.TotalSize.y,Math.floor((k-d.XScrollHeight)/c))+1);j=Math.min(j,this.TotalSize.y)}var a=false;if(this.ScrollBar.VisibleRows!=j||this.ScrollBar.TotalRows!=this.TotalSize.y){a=true}this.ScrollBar.UpdateYSize(this.TotalSize.y,j,d,this.PageBinder);var f=i;f+=this.ScrollParent.offsetTop;if(this.FooterVisible()){f+=this.Footer.ScrollParent.offsetHeight}this.ScrollBar.UpdateXSize(this.PercentColWidth?parseInt(this.getTableElement().style.width):this.TotalSize.x,this.VisibleColumnCount,f,d);if(a){return false}}}return true};Qva.Mgr.table.prototype.FooterVisible=function(){return(this.Footer&&this.Footer.Lines.length>0)};Qva.Mgr.table.prototype.HeaderVisible=function(){return(this.Header&&this.Header.Lines.length>0)};Qva.Mgr.table.prototype.PostPaint=function(){if(this.debugcounter++>500){Assert(false);this.debugcounter=0;return}if(this.Lines==null){return}if(!this.ScrollParent||(this.ScrollParent.style&&this.ScrollParent.style.display=="none")){this.Fixed=true;return}if(this.PageBinder.Element){var S=this.PageBinder;if(!this.Fixed){if(this.Frame.style&&this.Frame.style.display=="none"){Assert(false);return}try{if(this.RowHeight<=0&&this.Body.rows[0]&&this.Body.rows[0].cells[0]){if(this.Lines.length>0&&this.Lines[0].length>0){if(this.Body.rows[0].cells[0].offsetHeight>0){if(IS_IE6_OR_IE7){this.RowHeight=this.Body.rows[0].cells[0].scrollHeight}else{this.RowHeight=getClientHeight(this.Body.rows[0].cells[0])}this.RowOffsetHeight=this.Body.rows[0].cells[0].offsetHeight}}}}catch(R){this.RowOffsetHeight=10}}}var c;if(this.TotalSize.y==0||this.Lines.length==0){c=0}else{if(this.ScrollBar&&this.RowHeight>1){c=this.ScrollBar.VisibleRows}else{if(this.IsAsync){c=this.EffectiveSize}else{c=this.Lines.length}}}var G=this.Body.rows.length;if(c!=G){if(!this.ScrollBar&&this.IsAsync&&c<G&&G<=this.TotalSize.y){this.EffectiveSize=G;c=this.EffectiveSize}else{this.Inflate(c,G)}}var w=this.GetScrollbarStatus();if(this.IsBody){if(!this.Fixed){if(this.PercentColWidth){this.FixListBoxWidth(w)}else{this.FixTableWidth(w)}if(!this.FixTableHeight(w)){this.PageBinder.QueuePostPaintMessage(this);return}}}else{this.Fixed=true}var o;if(this.InlineStyle&&this.IsBody){o=this.GetScrollMaxHeight()}else{o=getClientHeight(this.ScrollParent)}var E=0;var x=c;if(!this.ScrollBar&&this.IsAsync){if(this.TotalSize.y<this.PageSize){E=0;x=this.TotalSize.y}else{var I=this.ScrollParent.scrollTop;E=this.RowForPos(this.Body.rows,I);if(this.ChunkOffset.y==0&&I==0&&E!=0){E=0;x=this.PageSize}else{x=this.RowForPos(this.Body.rows,I+o)+1;var d=Math.ceil((x-E)/2);E-=d;x+=d}if(E<0){E=0}if(x>c){x=c}if(x>this.TotalSize.y){x=this.TotalSize.y}}}var u={x:null,y:null};var P=this.Body.rows;var H=false;this.Height=this.IsBody?this.TotalSize.y:P.length;var K=this.PageOffsetForPainting();if(this.IsBody){this.Element.style.top="0px";if(K.scrolllastrow){var J=this.GetScrollMaxHeight()-w.XScrollHeight-this.getTableElement().offsetHeight;this.Element.style.top=J+"px"}}this.Element.style.left="0px";if(this.HeaderVisible()){this.Header.Element.style.left="0px"}if(this.FooterVisible()){this.Footer.Element.style.left="0px"}if(!this.PercentColWidth&&w&&w.X&&!w.XSupressed&&this.ScrollBar){var p=0;for(var U=0;U<this.VisibleColumnCount&&this.Firstcol+U<(this.TotalSize.x);U++){var D=this.ColList[this.Firstcol+U];if(!D){if(this.Firstcol+U<this.TotalSize.x){u.x=Math.floor((this.Firstcol+U)/this.ChunkSize.x)}break}var b=D.Width;p+=b;this.ColGroup.childNodes[U].style.width=b+"px";if(this.HeaderVisible()){this.Header.ColGroup.childNodes[U].style.width=b+"px"}if(this.FooterVisible()){this.Footer.ColGroup.childNodes[U].style.width=b+"px"}}if(u.x==null){if(IS_IE6_OR_IE7){p+=3*this.VisibleColumnCount}this.VisibleTableWidth=p;if(this.Width!=1){if(K.scrolllast){var J=this.PageBinder.GetMaxClientWidth()-w.YScrollWidth-this.VisibleTableWidth;this.setTableElementWidth(this.VisibleTableWidth+"px");this.Element.style.width=this.VisibleTableWidth+"px";this.Element.style.left=J+"px";if(this.HeaderVisible()){this.Header.Element.style.width=this.VisibleTableWidth+"px";this.Header.Element.style.left=J+"px"}if(this.FooterVisible()){this.Footer.Element.style.width=this.VisibleTableWidth+"px";this.Footer.Element.style.left=J+"px"}}else{this.Element.style.width="";if(this.HeaderVisible()){this.Header.Element.style.width=""}if(this.FooterVisible()){this.Footer.Element.style.width=""}}}}}for(var z=0;z<3;z++){var F=this.Lines;var v=this.Body;var y=E;var r=x;var s=K.y;switch(z){case 0:if(!this.HeaderVisible()){continue}F=this.Header.Lines;v=this.Header.Body;y=0;r=this.Header.Lines.length;s=0;break;case 1:if(!this.FooterVisible()){continue}F=this.Footer.Lines;v=this.Footer.Body;s=0;y=0;r=this.Footer.Lines.length;break}if(u.x==null){for(var n=y;n<r;++n){if(u.x!=null||u.y!=null){break}var T=n+s;var j=F[T];var q=v.rows[n];if(j==null){if(u.y==null&&T<this.TotalSize.y){u.y=Math.floor(T/this.ChunkSize.y)}break}var h=this.GetIndex(j);var L=n%this.RowClassNames.length;if(q.className!=this.RowClassNames[L]){q.className=this.RowClassNames[L]}if(q.rix==null){q.rix=n}var N=0;var f=0;var A=0;for(var a=this.Firstcol;a<this.Firstcol+this.VisibleColumnCount;++a){if(!j[a]){if(u.x==null&&a<this.TotalSize.x){u.x=Math.floor(a/this.ChunkSize.x)}break}var D=this.ColList[a];if(this.ByValue==null){this.ByValue=D.Cmd=="edit"||D.Cmd=="windowsedit"}var t=parseInt(j[a].colspan);if(!isNaN(t)){if(A==0){A=t-1}else{Assert(A==t);A--;continue}t=Math.min(t,this.VisibleColumnCount+this.Firstcol-a)}var B=(a-this.Firstcol-N>-1)?q.cells[a-this.Firstcol-N]:null;if(B==null){B=document.createElement("td");q.appendChild(B)}if(!isNaN(t)){if(IS_IE&&N==0){for(var O=a+1;O<q.cells.length;O++){q.cells[O].colSpan=1}}N+=t-1;while(q.cells.length+N>this.VisibleColumnCount){q.removeChild(q.cells[q.cells.length-1]);f++}B.colSpan=t}else{B.colSpan=1}if(!D.IsLocal&&j[a]==null){B.style.display="none"}else{if(this.RowHeight>1){var C=this.RowHeight*j[a].rowspan;if(this.WindowsSelectionstyle){C=Math.max(C,20)}B.style.height=C+"px";if(this.PercentColWidth&&D.Width==-1){D.Width=getClientWidth(B)}D.CellHeight=C}B.style.display="";var l=this.GetDisabled(j,a);B.position=a+":"+n+":";B.position+=(z==0)?"Head":((z==1)?"Foot":"Body");D.PaintCell(j,B,n,l||h,n==y);B.oncontextmenu=function(i){this.pressed=false;return Qva.GetBinder(this.binderid).OnContextMenu(i)};B.binderid=this.binderid;var m=D.Name.split(".")[1];if(m=="Fields"){m+="."+D.Name.split(".")[2]}B.ObjectId=this.ObjectId}}}}}this.Unlock();this.Element.style.display="";if(u.y!=null||u.x!=null){var Q={x:this.ChunkOffset.x,y:this.ChunkOffset.y};if(u.y!=null){Q.y=u.y*this.ChunkSize.y;Q.x=Math.floor(K.x/this.ChunkSize.x)*this.ChunkSize.x}if(u.x!=null){Q.x=u.x*this.ChunkSize.x;Q.y=Math.floor(K.y/this.ChunkSize.y)*this.ChunkSize.y}if(this.ChunkOffset.y!=Q.y||this.ChunkOffset.x!=Q.x){this.ChunkOffset.x=Q.x;this.ChunkOffset.y=Q.y;this.PageBinder.PartialLoad(this.PageName,this.ChunkOffset);return}}if(!this.Fixed){if(F.length>0&&F[0].length>0&&v.rows[0]&&v.rows[0].cells[0].offsetHeight>0){this.RowOffsetHeight=v.rows[0].cells[0].offsetHeight}if(this.IsBody){if(c>0){var M=this.GetScrollbarStatus();if(M.Y!=w.Y){if(this.PercentColWidth){this.FixListBoxWidth(M)}else{this.FixTableWidth(M)}}if(!this.FixTableHeight(w)){this.PageBinder.QueuePostPaintMessage(this);return}}this.Fixed=true}}if(this.PageBinder.IsResizeableColumnType===true&&this.PageBinder.AllowResize){if(this.VisibleColumnCount>0){this.AddColumnResizers()}if(this.HeaderVisible()){var g=0,k=this.Header.Body.rows[0];for(g=0;g<this.VisibleColumnCount;g++){k.cells[g].onmousedown=function(i){Qva.DragDrop.reorderColumn.mouseDown(i)}}}}if(this.ScrollPosition&&this.Scrolled){if(this.ScrollPosition.y!=K.y||this.ScrollPosition.x!=K.x){this.PageBinder.SetScrollPos(K)}}};Qva.Mgr.table.prototype.AddColumnResizers=function(){try{var b=0,j=0,h=0,c=this.GetScrollbarStatus(),a=getClientHeight(this.PageBinder.GetCaption().Element),f=getClientHeight(this.Frame)-a-c.XScrollHeight,d=null,i=this.ScrollBar?this.ScrollBar.Left:getClientWidth(this.getTableElement());if(typeof(this.ColumnResizers)!=="undefined"&&this.ColumnResizers.length>0){for(j=0,h=this.ColumnResizers.length;j<h;j++){this.Frame.removeChild(this.ColumnResizers[j])}}this.ColumnResizers=new Array();for(j=this.Firstcol,h=this.VisibleColumnCount+this.Firstcol;j<h;j++){b+=this.ColList[j].Width;if(b<=i){d=document.createElement("div");d.className=j===h-1?"QvColumnResizer QvColumnResizerLast":"QvColumnResizer";d.style.height=f+"px";d.style.top=a+"px";d.title="Resize column";d.columnData={};d.columnData.widthOuter=this.ColList[j].Width;d.columnData.colIndex=j;d.columnData.outerRightCoordinate=b;d.columnData.outerLeftCoordinate=d.columnData.outerRightCoordinate-d.columnData.widthOuter;d.style.left=b+"px";d.onmousedown=function(k){Qva.DragDrop.resizeColumn.mouseDown(k)};this.Frame.appendChild(d);this.ColumnResizers.push(d)}}}catch(g){Assert(false)}};Qva.Mgr.table.prototype.OneRow=function(){var c=document.createElement("tr");for(var b=0;b<this.VisibleColumnCount;++b){var a=document.createElement("td");var d=this.ColList[b];if(d&&d.ClassName){a.className=d.ClassName;a.align=d.Align}a.innerHTML="|";c.appendChild(a)}return c};function InflateFixRows(){if(this.Lines.length==0){this.ScrollParent.style.display="none"}else{this.ScrollParent.style.display="";var a=this.TableMgr.OneRow();if(this.Body.rows.length!=this.Lines.length){while(this.Body.rows.length>1){this.Body.deleteRow(1)}for(var b=1;b<this.Lines.length;b++){this.Body.appendChild(a.cloneNode(true))}}}}Qva.Mgr.table.prototype.Inflate=function(k,g){var j=this;var d=j.Body;var i=d.parentNode;var c=this.OneRow();var h=k;var l=j.ChunkSize.y;if(l==null||l<=0){l=20}for(var b=0;b<g&&b<h;++b){var m=d.rows[b];m.rix=b;m.style.position="static"}for(var b=g;b<h;++b){var m=null;if(b==0&&j.Body.rows[0]){m=j.Body.rows[0].cloneNode(true)}else{m=c.cloneNode(true)}m.rix=b;var a=b%j.RowClassNames.length;m.className=j.RowClassNames[a];d.appendChild(m)}if(h<k){var f=k-1;var a=f%j.RowClassNames.length;var m=null;if(d.rows.length<=h){m=c.cloneNode(true);m.className=j.RowClassNames[a];m.style.position="absolute";m.style.left=d.rows[1].offsetLeft+"px";m.style.top=d.rows[1].offsetHeight*f+"px";d.appendChild(m)}else{while(d.rows.length>h+1){d.deleteRow(h+1)}m=d.rows[h];m.className=j.RowClassNames[a];m.style.position="absolute";m.style.left=d.rows[1].offsetLeft+"px";m.style.top=d.rows[1].offsetHeight*f+"px"}m.rix=f}if(h==k){while(j.Body.rows.length>h){j.Body.deleteRow(h)}}};Qva.Mgr.table.prototype.RowForPos=function(d,f){var c=0;var b=d.length;while(b-c>1){var a=Math.floor((b+c)/2);if(d[a].offsetTop>f){b=a}else{c=a}}return c};Qva.Mgr.table.prototype.PageOffsetForPainting=function(){if(!this.Scrolled&&this.ScrollPosition){this.ScrollPosition.y=Math.max(Math.min(this.ScrollPosition.y,this.ScrollBar.TotalRows-this.ScrollBar.VisibleRows),0);this.ScrollBar.SetOffset(this.ScrollPosition)}var a={x:0,y:0};if(this.ScrollBar){a=this.ScrollBar.GetOffset()}if(!this.Scrolled&&this.ScrollPosition){Assert(a.x==this.ScrollPosition.x&&a.y==this.ScrollPosition.y);a=this.ScrollPosition}this.Firstcol=a.x;return a};Qva.Mgr.table.prototype.RestoreSelectionStateClassName=function(b,a){if(a){return"Qv"+b.state+this.StateClassNameEnd}else{switch(b.state){case"Selected":return this.EnabledClassName+this.StateClassNameEnd;break;case"Locked":case"LockedExcluded":case"Deselected":Assert(false);break;default:return"Qv"+b.state+this.StateClassNameEnd;break}}};Qva.Mgr.table.prototype.GetSelectionStateClassName=function(b,c,a){if(!c){return"Qv"+b.state+this.StateClassNameEnd}else{if(a){if(!b.origstate){b.origstate=b.state}if(b.state!=b.origstate){return"Qv"+b.origstate+this.StateClassNameEnd}switch(b.state){case"Excluded":case"SelectedExcluded":case"Optional":case"Alternative":case"LockedExcluded":return this.SelectedClassName+this.StateClassNameEnd;break;case"Selected":case"Locked":return this.EnabledClassName+this.StateClassNameEnd;break;case"Deselected":Assert(false);break}}else{return this.SelectedClassName+this.StateClassNameEnd}}};Qva.Mgr.table.prototype.ClearSelection=function(){if(window.getSelection){window.getSelection().removeAllRanges()}else{try{window.document.selection.empty()}catch(a){}}};Qva.Mgr.table.prototype.PaintSelectedOptional=function(){if(!this.WindowsSelectionstyle){for(var c=0;c<this.Body.rows.length;c++){var d=this.Body.rows[c];for(var b=0;b<d.cells.length;b++){if(!this.Lines[c+this.PageOffsetForPainting().y][b].state){return}if(this.Lines[c+this.PageOffsetForPainting().y][b].state=="Selected"){var a=d.cells[b];a.className=this.EnabledClassName+this.StateClassNameEnd}}}}};Qva.Mgr.table.prototype.IndicateCellsToSelect=function(m,q){if(this.SelectionStartRow==null){return}var r=this.Element.id!=""?this.Element.id:this.PageBinder.Element.id;if(r!=Qva.SearchableObject){SetSearchableAndActives(r,this.IsTransient?null:[r])}if(!m){m=this.ctrl}var i=this.SelectionStartRow.rix;var k=this.SelectionEndRow.rix;if(i>k){var w=k;k=i;i=w}var s=this.SelectionStartCol;var j=this.SelectionEndCol;if(s>j){var w=j;j=s;s=w}if(this.prev_cix_start==null){this.prev_cix_start=new Array()}if(this.prev_cix_end==null){this.prev_cix_end=new Array()}var u=this.prev_rix_start!=null&&this.prev_rix_start<i?this.prev_rix_start:i;var b=this.prev_rix_end!=null&&this.prev_rix_end>k?this.prev_rix_end:k;if(this.AndMode){if(this.CurrentPhase!=null&&!q&&m_MgrWithPendingAndMode==null){this.CurrentPhase=(this.CurrentPhase+1)%3}}for(var g=u;g<=b;g++){var h=this.HeaderSelection?this.Header.Body.rows[g]:this.Body.rows[g];var c=g+(this.HeaderSelection?0:this.PageOffsetForPainting().y);var l=this.prev_cix_start[g]!=null&&this.prev_cix_start[g]<s?this.prev_cix_start[g]:s;var a=this.prev_cix_end[g]!=null&&this.prev_cix_end[g]>j?this.prev_cix_end[g]:j;var v=(this.ByValue&&g!=u)?0:s;var n=(this.ByValue&&g<b)?(h.cells.length-1):j;l=Math.min(l,v);a=Math.max(a,n);this.prev_cix_start[g]=v;this.prev_cix_end[g]=n;for(var z=l;z<=a;++z){var t=null;var f=h.cells[z];if(g<i||g>k||z<v||z>n){if(this.Lines[c][z].state){t=this.RestoreSelectionStateClassName(this.Lines[g][z],m||this.WindowsSelectionstyle)}else{t=""}}else{if(this.AndMode){if(this.CurrentPhase==null){this.CurrentPhase=0}var y=this.GetDisabled(this.Lines[c],z);switch(this.CurrentPhase){case 0:if(m){t=y?this.DeselectedClassName:this.SelectedClassName}else{t=this.SelectedClassName}break;case 1:if(m){t=y?this.SelectedClassName:this.DeselectedClassName}else{t=this.DeselectedClassName}break;case 2:t=y?this.DisabledClassName:this.EnabledClassName;break;default:Assert(false);break}t+=this.StateClassNameEnd}else{if(this.Lines[c][z].state){t=this.GetSelectionStateClassName(this.Lines[c][z],true,m||this.WindowsSelectionstyle)}else{t=this.SelectedClassName}}}var x=g%this.RowClassNames.length;if(h.className!=this.RowClassNames[x]){h.className=this.RowClassNames[x]}var p=this.ColList[z];if(this.ByValue&&f.value==-1){continue}var d=p.ClassName;var o=q||(t==this.EnabledClassName+this.StateClassNameEnd)||t=="";if(this.Semantic){if(t!=""){if(!o){t+="_Pressed"}d+=" "+t}else{Assert(false)}}else{if(t!=""){d+=" "+t}}if(f.className!=d){this.IndicateSingleSelect(g,z,o,t)}}}this.prev_rix_start=i;this.prev_rix_end=k;if(this.AndMode){this.ctrl=m;DelayAndModeToogle(this)}};var m_MgrWithPendingAndMode=null;function DelayAndModeToogle(a){if(m_MgrWithPendingAndMode!=null){return}m_MgrWithPendingAndMode=a;window.setTimeout(AndModeToogle,1000)}function AndModeToogle(){var a=m_MgrWithPendingAndMode;m_MgrWithPendingAndMode=null;a.IndicateCellsToSelect()}Qva.Mgr.table.prototype.SetWindowSelectionStyle=function(a,b,d,c){b.checked=d;b.disabled=c;if(c){var f=this.PageBinder.PageBinder.SelectionStyleMgr.GetSelectionStyle("Excluded");a.style.color=HtmlifyARGB(f.backgroundcolor)}else{a.style.color="#000000"}};Qva.Mgr.table.prototype.SetCellSelected=function(a,c,f,h){if(this.WindowsSelectionstyle){var b=null;for(var d=0;d<a.childNodes.length;d++){if(a.childNodes[d].tagName=="INPUT"){b=a.childNodes[d];break}}if(b==null){Assert(false)}this.SetWindowSelectionStyle(a,b,c==this.SelectedClassName||c==this.LockedClassName||c==this.SelectedExcludedClassName,c==this.DisabledClassName||c==this.SelectedExcludedClassName||c==this.LockedExcludedClassName)}else{if(!this.ByValue){if(f){if(a.origcolor!=""){a.style.color=a.origcolor;a.origcolor=""}if(a.origbackgroundColor!=""){a.style.backgroundColor=a.origbackgroundColor;a.origbackgroundColor=""}}else{if(a.style.color!=""){a.origcolor=a.style.color;a.style.color=""}if(a.style.backgroundColor!=""){a.origbackgroundColor=a.style.backgroundColor;a.style.backgroundColor=""}}}var g=h.ClassName;if(c!=""){g+=" "+c}if(a.className!=g){a.className=g}}};Qva.Mgr.table.prototype.IndicateSingleSelect=function(j,b,g,d){var l=this.HeaderSelection?this.Header.Body.rows:this.Body.rows;var k=l[j];var i=k.cells[b];var f=this.ColList[b];if(i.selectsource){var c=this.SelectedClassName;for(var h=0;h<k.cells.length;h++){var i=k.cells[h];if(!i.selectsource&&(i.singleselect||i.multiselect)){this.SetCellSelected(i,c,g,f)}}for(var a=0;a<j;a++){var i=l[a].cells[b];if(!i.selectsource&&(i.singleselect||i.multiselect)){this.SetCellSelected(i,c,g,f)}}}else{this.SetCellSelected(i,d,g,f)}};Qva.Mgr.table.prototype.SetCellStyle=function(i,a,m,k,d){if(!this.InlineStyle){return""}if(!i.style){return""}var b=this.Style[i.style];if(!b){return""}var h=a==0;var o=this.Height!=-1?a==(this.Height-1):this.IsHeader;var j=m==0;var c=m==(this.Width-1);var n="";if(d){if(b.BgColorCSSExpr){n+="; background-color:"+b.BgColorCSSExpr}else{if(b.BgColorRGB){n+="; background-color:"+b.BgColorRGB}}n+="; color:"+b.BgColorRGB}else{if(!k){if(b.BgColorCSSExpr){n+="; background-color:"+b.BgColorCSSExpr}else{if(b.BgColorRGB){n+="; background-color:"+b.BgColorRGB}}n+="; color:"+b.Color}else{n+="; background-color:";n+="; color:"}}if(i.position=="top"){n+="; text-align:"+b.LabelAdjust}else{n+="; text-align:"+(i.isnum?b.NumAdjust:b.TextAdjust)}n+="; font-style:"+b.FontStyle;n+="; font-weight:"+b.FontWeight;n+="; text-decoration:"+b.TextDecoration;switch(b.SizeMod){case"2":n+="; font-size:large";break;case"1":n+="; font-size:larger";break;case"-1":n+="; font-size:smaller";break;case"-2":n+="; font-size:small";break}if(!this.Semantic){var g=this.BorderStyle[b.BorderStyle];if(g){var f=false;var p=false;if(!(i.subcell=="y")){f=true;if(!(i.first=="y")){p=true}}n+="; border-bottom:";if(o&&this.SizeTodata&&!this.IsHeader||!p){var l=g.Bottom.substr(0,g.Bottom.indexOf("#"))+b.BgColorRGB;n+=l}else{n+=g.Bottom}n+="; border-top:";if((IS_GECKO&&GECKO_VERSION<3.5)||h||!f){n+="none"}else{n+=g.Top}if((IS_GECKO&&GECKO_VERSION<3.5)||j){n+="; border-left:none"}else{n+="; border-left:"+g.Left}if(c&&this.SizeTodata){n+="; border-right:none"}else{n+="; border-right:"+g.Right}}}return n};Qva.Mgr.table.prototype.SelectRows=function(j){var g=this.SelectionStartRow.rix;var i=this.SelectionEndRow.rix;if(g>i){var w=i;i=g;g=w}var m=this.SelectionStartCol;var h=this.SelectionEndCol;if(m>h){var w=h;h=m;m=w}this.IndicateCellsToSelect(j,true);this.SelectionStartRow=null;this.SelectionEndRow=null;this.SelectionStartCol=null;this.SelectionEndCol=null;if(this.AndMode&&this.CurrentPhase==2){this.CurrentPhase=null;return}var t=(this.Search!=null&&this.Search.value!="");var c="";var n=this.Body.rows[0].cells[0].value==null;if(this.ByValue){var v=(g==i&&m==h);var p=false;if(v){if(this.Body.rows[g].cells[m].value==-1){return}p=this.WindowsSelectionstyle&&this.Body.rows[g].cells[m].singleselect==true}var a=g+this.PageOffsetForPainting().y;var r=this.GetIndex(this.Lines[a]);var l=this.PageName;if(l==""){l=this.ColList[0].Name.split(".")[1]}for(var d=g;d<=i;d++){var f=this.HeaderSelection?this.Header.Body.rows[d]:this.Body.rows[d];var q=(d!=g)?0:m;var k=(d<i)?(f.cells.length-1):h;for(var x=q;x<=k;x++){var b=f.cells[x];var s=b.value;if(j){if(!this.AndMode){if(!this.Lines[d][x].origstate){this.Lines[d][x].origstate=this.Lines[d][x].state}if(this.Lines[d][x].state=="Selected"){if(this.Lines[d][x].origstate=="Selected"){this.Lines[d][x].state="Optional"}else{this.Lines[d][x].state=this.Lines[d][x].origstate}}else{this.Lines[d][x].state="Selected"}}this.PageBinder.AddToogleSelect(this.ObjectId,s,this.CurrentPhase)}else{if(n){this.PageBinder.Set(l,"text",b.innerText,true);return}else{if(c!=""){c+=","}c+=s}}}}}else{var o=""+(m+this.PageOffsetForPainting().x)+":"+(g+this.PageOffsetForPainting().y)+":"+(h-m+1)+":"+(i-g+1);if(this.HeaderSelection){o+=":Head"}this.PageBinder.Set(this.ObjectId,"rect",o,true);return}if(!j){if(t){this.PageBinder.Set(this.SearchName,"closesearch","abort",true);if(this.Search!=null){this.Search.value=""}}else{var u={};u.select=c;u.toggle=(IS_SAFARI&&IS_MOBILE)?"true":"false";if(this.AndMode){u.phase=this.CurrentPhase}this.PageBinder.Set(this.ObjectId,u)}}this.CurrentPhase=null};var m_MgrWithSelectStart=null;function AvqAction_TableEditMouseMove(a){if(this.disabled){return}if(!a){a=window.event}var c=this.parentNode;if(c.tagName!="TR"){return}var b=GetTableManager(c);if(b==null){return}if(b==null){return}if(b.SelectionStartRow==null){return}if(m_MgrWithSelectStart!=null&&m_MgrWithSelectStart!=b){return}if(b.SelectSource!=this.selectsource){return}b.ClearSelection();if(!b.PageBinder.GetEnabled()){return}b.SelectionEndRow=c;b.SelectionEndCol=this.cellIndex;if(this.singleselect){b.SelectionStartRow=b.SelectionEndRow;b.SelectionStartCol=b.SelectionEndCol}b.IndicateCellsToSelect(ctrlKeyPressed(a))}function GetTableManager(a){while(a&&!a.TableMgr){a=a.parentNode}return a.TableMgr}function AvqAction_TableEditMouseDown(a){if(this.disabled){return}if(!a){a=window.event}if(IS_MAC&&a.ctrlKey){return}var c=this.parentNode;if(c.tagName!="TR"){return}var b=GetTableManager(c);if(b==null){return}if(a.button!=b.LeftButton){return}if(!b.PageBinder.GetEnabled()){return}b.prev_rix_start=null;b.prev_rix_end=null;b.SelectionStartRow=c;b.SelectionEndRow=c;b.prev_cix_start=null;b.prev_cix_end=null;b.SelectionStartCol=this.cellIndex;b.SelectionEndCol=this.cellIndex;b.SelectSource=this.selectsource;b.CurrentPhase=null;b.HeaderSelection=this.position.split(":")[2]=="Head";if(b.ByValue&&!ctrlKeyPressed(a)){b.PaintSelectedOptional()}b.IndicateCellsToSelect(ctrlKeyPressed(a));m_MgrWithSelectStart=b;Qva.addEvent(document,"mouseup",AvqAction_TableEditMouseUp);Qva.Select.Active=false}function AvqAction_TableEditMouseUp(a){if(!a){a=window.event}var b=m_MgrWithSelectStart;if(b==null){return}if(b.SelectionStartRow==null){return}b.ClearSelection();if(!b.PageBinder.GetEnabled()){return}b.SelectRows(ctrlKeyPressed(a));Qva.removeEvent(document,"mouseup",AvqAction_TableEditMouseUp);Qva.Select.Active=true;m_MgrWithSelectStart=null}function TableHeaderDblClick(a){if(!a){a=window.event}var c=this.parentNode;if(c.tagName!="TR"){return}var b=GetTableManager(c);if(b==null){return}this.pressed=false;if(b.PageBinder.GetEnabled()){b.PageBinder.Set(b.PageBinder.Name,"dblclick",this.xx+":"+this.yy,true)}else{Assert(false)}}function avq_action_md(a){if(!a){a=window.event}a.cancelBubble=true;this.pressed=true}function action_mu(b){if(!b.pressed){return}b.pressed=false;var c=b.action;if(b.ObjectId!=null){var a=Qva.GetObjectBinder(b);var d={};if(typeof(b.val)==="undefined"){d.position=b.xx+":"+b.yy}else{d.value=b.val}d.action="";a.Set(b.ObjectId+"."+c,d)}}function avq_action_mu(a){if(!a){a=window.event}if(!this.pressed){return}a.cancelBubble=true;var b=this;window.setTimeout(function(){action_mu(b)},200)}Qva.ColMgr={};Qva.ColMgr.Init=function(d,b,a,c,f){this.IsLocal=false;this.Index=b;if(a!=null){this.ClassName=a.className;this.Align=a.align;this.Html=a.innerHTML}this.Parent=d;this.CellHeight=-1;this.Width=-1;this.binderid=d.binderid;Qva.MgrSplit(this,c,f)};Qva.ColMgr.basic=function(d,b,a,c,f){Qva.ColMgr.Init.apply(this,arguments);this.IsLocal=true};Qva.ColMgr.basic.prototype.PaintCell=function(b,a,c){a.innerHTML=this.Html};Qva.ColMgr.edit=function(d,b,a,c,f){Qva.ColMgr.Init.apply(this,arguments)};Qva.ColMgr.edit.prototype.PaintCell=function(c,a,g,d){a.style.color="";var b=this.Index;a.value=c[b].intval;var h="";if(this.Parent.AndMode){if(c[b].state=="Selected"){h="&  ";a.style.paddingLeft=""}else{if(c[b].state=="Deselected"){h="!  ";a.style.paddingLeft=""}else{a.style.paddingLeft="12px"}}}h+=(c[b].val!="")?c[b].val:" ";var i=this.Parent.GetSelectionStateClassName(c[b]);var f=this.ClassName;if(i!=""){f+=" "+i}if(a.className!=f){a.className=f}this.Parent.appendCellContent(a,c[b],h,b,g,this);a.title=c[b].title;if(c[b].selecttype==null){a.onmousedown=Qva.NoAction;a.onmousemove=Qva.NoAction}else{a.onmousedown=AvqAction_TableEditMouseDown;a.onmousemove=AvqAction_TableEditMouseMove;if(c[b].selecttype=="single"){a.singleselect=true}a.onclick=function(j){Qva.HideContextMenu();if(!j){j=window.event}Qva.CancelAction(j)}}a.style.cssText+=this.Parent.SetCellStyle(c[b],g,b,d&&this.Parent.ByValue)};Qva.ColMgr.text=function(d,b,a,c,f){Qva.ColMgr.Init.apply(this,arguments)};Qva.ColMgr.text.prototype.PaintCell=function(r,p,a,j,k){var m=this.Index;var i=false;if(r[m].dblclick){i=true;p.ondblclick=TableHeaderDblClick}var d=(r[m].val!="")?r[m].val:" ";var c=false;if(r[m].state){var b=this.Parent.GetSelectionStateClassName(r[m]);var g=this.ClassName;if(b!=""){g+=" "+b}if(p.className!=g){p.className=g}c=true;p.style.color="";p.style.backgroundColor=""}j=(j&&this.Parent.ByValue)||c;p.style.cssText+=this.Parent.SetCellStyle(r[m],a,m,j);if(p.className&&p.className!=""&&!c){p.className=""}var q=r[m].url;if(q){p.innerText="";var l=document.createElement("a");l.innerText=d;l.href=q;l.target="_blank";p.appendChild(l);p.onclick=Qva.CancelAction;p.onmousedown=Qva.CancelAction;p.onmousemove=Qva.CancelAction;p.style.cursor="Default"}else{p.style.cursor="";var o=r[m].subcell=="y"&&!k;if(o){p.innerText=""}else{p.innerText=d}p.title=r[m].title;var h=r[m].selecttype;if(r[m].icons.length>0&&!o){this.Parent.appendCellContent(p,r[m],h!="input"?r[m].val:null,m,a,this)}if(h==null){var f=r[m].action;if(f){p.binderid=this.binderid;p.onmousedown=avq_action_md;p.onmouseup=avq_action_mu;p.pressed=false;p.action=f;p.ObjectId=this.Parent.ObjectId;p.onclick=Qva.CancelAction}else{p.onclick=i?Qva.CancelAction:Qva.NoAction;p.onmousedown=Qva.NoAction;p.onmousemove=Qva.NoAction}p.xx=m;p.yy=a;p.selectsource=null;p.multiselect=null;p.singleselect=null}else{if(h=="input"){if(r[m].icons.length==0){p.innerText=""}var n=document.createElement("span");n.innerText=d;p.appendChild(n);p.value=r[m].intval;p.inputname=this.Parent.Name+".V"+a;p.onclick=function(s){if(!s){s=window.event}s.cancelBubble=true;Qva.OpenPopupInput(this,true);return false}}else{p.onmousedown=AvqAction_TableEditMouseDown;p.onmousemove=AvqAction_TableEditMouseMove;if(h=="multi"){p.multiselect=true}else{p.singleselect=true}p.selectsource=r[m].selectsource}}}};Qva.ColMgr.check=function(d,b,a,c,f){Qva.ColMgr.Init.apply(this,arguments)};Qva.ColMgr.check.prototype.PaintCell=function(c,a,d){var b=this.Index;if(a.firstChild==null||a.firstChild.tagName!="INPUT"||a.firstChild.type!="checkbox"){a.innerHTML='<input class="avqCheckbox" type=checkbox >'}a.firstChild.onclick=AvqAction_TableCheck;if(this.Parent.ChoiceIx!=-1){var f=d+this.Parent.PageOffsetForPainting().y;var g=this.Parent.GetIndex(c)!=0;a.firstChild.checked=g}else{a.firstChild.checked=c[b].val!=0;a.firstChild.disabled=c[b].disabled}};Qva.ColMgr.input=function(d,b,a,c,f){Qva.ColMgr.Init.apply(this,arguments)};Qva.ColMgr.input.prototype.PaintCell=function(c,a,d){var b=this.Index;if(a.firstChild==null||a.firstChild.tagName!="INPUT"||a.firstChild.type!="text"){a.innerHTML='<input class="avqEdit" style="width:100%" value="" >';a.firstChild.onchange=AvqAction_TableInput}a.firstChild.value=c[b].val;a.firstChild.disabled=c[b].disabled};Qva.ColMgr.windowsedit=function(d,b,a,c,f){Qva.ColMgr.Init.apply(this,arguments)};Qva.ColMgr.windowsedit.prototype.PaintCell=function(p,l,a,h){l.style.color="";var j=this.Index;if(p[j].intval=="-1"){l.innerHTML="";return}l.value=p[j].intval;var n="";if(this.Parent.AndMode){if(p[j].state=="Selected"){n="&  "}else{if(p[j].state=="Deselected"){n="!  "}}}n+=(p[j].val!="")?p[j].val:" ";var b=this.Parent.Style[p[j].style];var f=(p[j].isnum?b.NumAdjust:b.TextAdjust)=="right";var c=p[j].selecttype=="single";var i=null;for(var g=0;g<l.childNodes.length;g++){if(l.childNodes[g].tagName=="INPUT"){i=l.childNodes[g]}else{l.removeChild(l.childNodes[g])}}if(!i){i=document.createElement("INPUT");i.type=c?"radio":"checkbox";if(IE_DOCMODE>=8){i.style.padding="1px 0px 0px 1px"}else{i.style.padding="0px 0px 0px 0px"}l.appendChild(i)}this.Parent.SetWindowSelectionStyle(l,i,p[j].state=="Selected"||p[j].state=="Locked"||p[j].state=="SelectedExcluded",p[j].state=="Excluded"||p[j].state=="LockedExcluded"||p[j].state=="SelectedExcluded");if(f){var k=document.createElement("span");k.innerText=n;k.style.position="absolute";k.style.textAlign="right";l.appendChild(k);var d=l.offsetLeft-k.offsetWidth;d-=i.offsetWidth;if(this.Width!=-1){d+=this.Width-2}else{d+=l.offsetWidth;Assert(false)}if(IS_GECKO||IS_OPERA){d-=3}k.style.left=d+"px"}else{var o=document.createTextNode(n);l.appendChild(o)}if(p[j].state&&(p[j].state=="Locked"||p[j].state=="LockedExcluded")){l.onmousedown=Qva.NoAction;l.onmousemove=Qva.NoAction}else{l.onmousedown=AvqAction_TableEditMouseDown;l.onmousemove=AvqAction_TableEditMouseMove}if(p[j].selecttype=="single"){l.singleselect=true}h=h&&this.Parent.ByValue;var m=this.Parent.SetCellStyle(p[j],a,j,h);if(f){m=m.replace("right","left")}l.style.cssText+=m};Qva.ColMgr.action=function(d,b,a,c,g,f){Qva.ColMgr.Init.apply(this,arguments);this.Action=f};Qva.ColMgr.action.prototype.PaintCell=function(line,cell,rix,ignorecolor){var cix=this.Index;if(!cell.firstChild||cell.firstChild.tagName!="INPUT"){cell.innerHTML='<input type="button" />'}var button=cell.firstChild;if(!button){Assert(false);return}button.innerText=(line[cix].val!="")?line[cix].val:" ";button.Action=this.Action;button.onclick=function(event){eval(this.Action)};if(this.Parent.InlineStyle){ignorecolor=ignorecolor&&this.Parent.ByValue;cell.style.cssText+=this.Parent.SetCellStyle(line[cix],rix,cix,ignorecolor);if(cell.className&&cell.className!=""){cell.className=""}}};function AvqAction_TableAction(){var b=this;var f=b.parentNode;if(f.tagName!="TR"){return}var c=GetTableManager(f);if(c==null){return}if(!c.PageBinder.GetEnabled()){return}var a=f.rix;var d=c.ColList[b.cellIndex].Name;c.PageBinder.Set(c.Group,"cell",a+":"+d,true)}Qva.ColMgr.imgaction=function(d,b,a,c,g,f){Qva.ColMgr.Init.apply(this,arguments)};Qva.ColMgr.imgaction.prototype.PaintCell=function(b,a,d,c){a.style.display=(b[this.Index].mode==="hidden")?"none":"";a.innerHTML=this.Html;a.onclick=AvqAction_TableAction};Qva.ColMgr.hidden=function(d,b,a,c,f){Qva.ColMgr.Init.apply(this,arguments)};Qva.ColMgr.hidden.prototype.PaintCell=function(c,a,d){a.style.display="none";var b=this.Index;a.innerText=(c[b].val!="")?c[b].val:" "};Qva.ColMgr.error=function(d,b,a,c,g,f){Qva.ColMgr.Init.apply(this,arguments);this.IsLocal=true};Qva.ColMgr.error.prototype.PaintCell=function(b,a,f,c){var d=b[this.Index];var g=d.val;a.style.visibility=(g&&g!="")?"visible":"hidden";a.innerHTML=this.Html;a.title=g};function Delay(a,b){return function(){var c=this;if(a._wait){clearTimeout(a._wait)}a._wait=setTimeout(function(){a.apply(c,arguments);a._wait=null},b)}}function action_mu(b){if(!b.pressed){return}b.pressed=false;var c=b.action;if(b.ObjectId!=null){var a=Qva.GetObjectBinder(b);var d={};if(typeof(b.val)==="undefined"){d.position=b.xx+":"+b.yy}else{d.value=b.val}d.action="";a.Set(b.ObjectId+"."+c,d)}}Qva.PageBinding.prototype.CreateCellIcon=function(m,j,n,f,o){var d=m.getAttribute("name");if(o&&(d==="EXC"||d==="COC"||d==="ODDC")){return this.CreateCellCmdIcon(m,o)}var i=document.createElement("img");var c="cursor: pointer;";var k=m.getAttribute("alttext");i.alt=k?k:"";var l=m.getAttribute("align");i.className="Qv_CellIcon";if(l){i.className+="_"+l}i.className+=" Qv_"+d;var a=m.getAttribute("stamp");var h=m.getAttribute("sendsize")=="true";if(h){c+="height:"+o+"px; width:"+f+"px; "}i.style.cssText=c;var b=m.getAttribute("url");if(b){i.src=Qva.AddProxyIfAny(b)}else{var a=m.getAttribute("stamp");var g=HtmlifyARGB(m.getAttribute("color"));var b=this.BuildBinaryUrl(m.getAttribute("path"),a,d,g);if(h){if(m.getAttribute("stretchmode")){j=m.getAttribute("stretchmode")}b+="&width="+f+"&height="+o+"&stretchmode="+j+"&adjust="+n;b=Qva.AddProxyIfAny(b)}i.src=b}return i};Qva.PageBinding.prototype.CreateCellCmdIcon=function(g,a){var c=document.createElement("a");var f=g.getAttribute("name");var h=g.getAttribute("align");c.className="Qv_CellIcon";if(h){c.className+="_"+h}c.className+=" Qv_"+f;c.className+=" QvGrowIcon";var b=HtmlifyARGB(g.getAttribute("color"));var d=this.BuildBinaryUrl(g.getAttribute("path"),null,f,b);c.style.backgroundImage="url("+d+")";c.style.width=IS_TOUCHENABLED?"18px":"10px";c.style.height=a+"px";c.style.backgroundRepeat="no-repeat";c.style.backgroundPosition="center";c.style.top="0";c.title="";return c};function AppendAction(c,a,f,h){var d=a.getAttribute("action");var g=a.getAttribute("clientaction");var b=a.getAttribute("drag");if(d||g){c.binderid=f.binderid;c.onmousedown=Qva.CancelAction;c.onmouseup=Qva.CancelAction;if(d){c.onclick=onclick_Action;c.pressed=false;c.action=d}else{if(g){c.AvqMgr=f;c.onclick=onclick_ContextClientAction;c.clientaction=g;c.param=a.getAttribute("param")}}c.ObjectId=f.ObjectId;c.pos=h;if(a.getAttribute("menu")=="true"){c.position=d+":"+h;c.oncontextmenu=function(i){return Qva.GetBinder(this.binderid).OnContextMenu(i,this.ObjectId)}}}else{if(b){c.dragObj={Name:f.PageName,type:"col"}}else{c.ondrag=function(){return false};c.onmousedown=Qva.NoAction;c.onmouseup=Qva.NoAction;c.onclick=Qva.NoAction}}}function onclick_Action(a){if(!a){a=window.event}a.cancelBubble=true;this.pressed=true;var b=this;if(IS_TOUCHENABLED){do_Action(b)}else{window.setTimeout(function(){do_Action(b)},200)}}function do_Action(b){if(!b.pressed){return}b.pressed=false;var c=b.action;var d={action:"",position:b.pos};var a=Qva.GetBinder(b.binderid);a.Set(b.ObjectId+"."+c,d)}var useTouchScroll=IS_TOUCHENABLED;Qva.TouchScrollMgr=function(a,d){var c=d?"width":"height";var b=document.createElement("div");b.className="Qv_ScrollbarBackground";b.style.display="none";a.Element.appendChild(b);this.b_Scroll=b;b.style[c]=Qva.GetScrollBarWidth()+"px";var f=document.createElement("div");f.className="TouchScrollbar";f.style.display="none";f.style.opacity=1;f.style.width="4px";f.style.height="4px";f.style.right="auto";f.style.bottom="auto";f.style.webkitTransitionTimingFunction="cubic-bezier(0, 0.3, 0.6, 1)";f.style.webkitTransitionProperty="-webkit-transform";a.Element.appendChild(f);this.t_Scroll=f;this.vertical=d;this.h=d?"height":"width"};Qva.TouchScrollMgr.prototype.Set=function(g,i,b,f,j,d,h){g+=2;i+=2;b-=2;var a=Math.max(Math.round(b*b/f),10),c=b-a;this.ScrollStep=c/(b-f);this.t_Scroll.style.left=g+"px";this.t_Scroll.style.top=i+"px";this.t_Scroll.style[this.h]=a+"px";this.t_Scroll.style.display="";this.b_Scroll.style.left=d+"px";this.b_Scroll.style.top=h+"px";this.b_Scroll.style[this.h]=j+"px";this.b_Scroll.style.display=""};Qva.TouchScrollMgr.prototype.Hide=function(){this.t_Scroll.style.display="none";this.b_Scroll.style.display="none"};Qva.TouchScrollMgr.prototype.Get=function(){return 0};Qva.TouchScrollMgr.prototype.SetPosition=function(a){};Qva.TouchScrollMgr.prototype.Scroll=function(a){};Qva.TouchScrollMgr.prototype.Reposition=function(b){if(this.t_Scroll.style.display=="none"){return}var a=b*this.ScrollStep;if(this.vertical){this.t_Scroll.style.webkitTransform="translate3d(0, "+a+"px, 0)"}else{this.t_Scroll.style.webkitTransform="translate3d("+a+"px, 0, 0)"}};Qva.TouchScrollMgr.prototype.setTransitionTime=function(a){this.t_Scroll.style.webkitTransitionDuration=a};function ObjectifyARGB(f){var d=0,i=0,h=0,c=0;if(f&&f.length==9){d=parseInt(f.substr(1,2),16);i=parseInt(f.substr(3,2),16);h=parseInt(f.substr(5,2),16);c=parseInt(f.substr(7,2),16)}return{A:d,R:i,G:h,B:c,css:HtmlifyARGB(f)}}Qva.GetScrollBarWidth=function(){if(useTouchScroll){return 8}function a(){var f=document.createElement("p");f.style.width="100%";f.style.height="200px";var g=document.createElement("div");g.style.position="absolute";g.style.top="0px";g.style.left="0px";g.style.visibility="hidden";g.style.width="200px";g.style.height="150px";g.style.overflow="hidden";g.appendChild(f);document.body.appendChild(g);var d=f.offsetWidth;g.style.overflow="scroll";var c=f.offsetWidth;if(d==c){c=g.clientWidth}document.body.removeChild(g);return(d-c)}var b=a();if(IS_IE){b+=1}Qva.GetScrollBarWidth=function(){return b};return b};Qva.MeasureText=function(b,a,d){var c=Qva.Measure_div;if(!c){var c=document.createElement("div");c.style.position="absolute";c.style.width="auto";c.style.height="auto";c.style.visibility="hidden";document.body.insertBefore(c,document.body.firstChild);Qva.Measure_div=c}c.style.fontFamily=a;c.style.fontSize=d;c.innerText=b;return{width:c.offsetWidth,height:c.offsetHeight}};Qva.ScrollMgr=function(a,d){var c=d?"width":"height";var b=document.createElement("div");b.className="Qv_ScrollbarBackground";b.style.display="none";a.Element.appendChild(b);this.b_Scroll=b;b.style[c]=Qva.GetScrollBarWidth()+"px";var f=document.createElement("div");f.className="Qv_Scrollbar";if(d){f.style.overflowX="hidden";f.style.overflowY="scroll"}else{f.style.overflowX="scroll";f.style.overflowY="hidden"}f.style[c]=Qva.GetScrollBarWidth()+"px";f.style.display="none";var h=document.createElement("div");h.style[c]="1px";f.appendChild(h);a.Element.appendChild(f);this.o_Scroll=f;this.i_Scroll=h;var g=this;this.o_Scroll.onscroll=Delay(function(){g.Scrolled=true;a.PageBinder.QueuePostPaintMessage(a)},100);this.scroll_scale=10;this.h=!d?"width":"height";this.scrollStart=d?"scrollTop":"scrollLeft";if(d){var g=this;if(a.Element.addEventListener){a.Element.addEventListener("DOMMouseScroll",function(i){g.OnWheel(i)},false)}a.Element.onmousewheel=function(i){g.OnWheel(i)}}};Qva.ScrollMgr.prototype.Set=function(h,g,a,b,f,d,c){this.o_Scroll.style.left=h+"px";this.o_Scroll.style.top=g+"px";this.o_Scroll.style[this.h]=a+"px";this.i_Scroll.style[this.h]=(a+b*this.scroll_scale)+"px";this.o_Scroll.style.display="";this.b_Scroll.style.left=d+"px";this.b_Scroll.style.top=c+"px";this.b_Scroll.style[this.h]=f+"px";this.b_Scroll.style.display=""};Qva.ScrollMgr.prototype.Hide=function(){this.o_Scroll.style.display="none";this.b_Scroll.style.display="none"};Qva.ScrollMgr.prototype.Get=function(){return Math.round(this.o_Scroll[this.scrollStart]/this.scroll_scale)};Qva.ScrollMgr.prototype.SetPosition=function(a){if(!this.Scrolled){this.o_Scroll[this.scrollStart]=this.scroll_scale*a}};Qva.ScrollMgr.prototype.Scroll=function(a){this.o_Scroll[this.scrollStart]+=this.scroll_scale*a};Qva.ScrollMgr.prototype.OnWheel=function(a){if(!a){a=window.event}var b;if(a.wheelDelta){b=a.wheelDelta/120;if(window.opera){b=-b}}else{if(a.detail){b=-a.detail/3}}if(!b){return}this.Scroll(-b);if(a.preventDefault){a.preventDefault()}a.returnValue=false};if(!Qva.Mgr){Qva.Mgr={}}Qva.Mgr.grid=function(a,c,b,d){this.SearchName=this.Name=Qva.MgrMakeName(b,d);this.ObjectId=a.Element.id;this.LeftButton=a.LeftButton;this.Element=c;this.Cols=[];this.Body={position:"Body"};this.Headers={position:"Head"};this.Footers={position:"Foot"};this.Selection={};this.binderid=a.binderid;a.AddManager(this);c.Mgr=this;c.style.position="relative";c.style.overflow="hidden";c.style.cursor="Default";this.Content=document.createElement("div");c.appendChild(this.Content);this.xScroll=0;this.yScroll=0;if(useTouchScroll){this.YScroll=new Qva.TouchScrollMgr(this,true);this.XScroll=new Qva.TouchScrollMgr(this,false)}else{this.YScroll=new Qva.ScrollMgr(this,true);this.XScroll=new Qva.ScrollMgr(this,false)}};Qva.Mgr.grid.prototype.Paint=function(d,v,l,M){this.Touched=true;var n=this.Element;function U(b){for(var w=0;w<v.childNodes.length;++w){if(v.childNodes[w].tagName=="value"&&v.childNodes[w].getAttribute("name")==b){return v.childNodes[w]}}return null}var S=U("Body");if(S){n.style.display=S.getAttribute("mode")=="enabled"?"":"none"}if(n.style.display=="none"){return}var Q=v.getElementsByTagName("style");if(Q.length>0){this.Style=[];Q=Q[0].getElementsByTagName("style");for(var a=0;a<Q.length;a++){this.Style[a]=new this._StyleObject(Q[a])}}Q=v.getElementsByTagName("borderstyle");if(Q.length>0){this.BorderStyle=[];Q=Q[0].getElementsByTagName("borderstyle");for(a=0;a<Q.length;a++){var W=this.BorderStyle[a]=new this._BorderStyleObject(Q[a])}}var T=U("Style");if(T){var t=T.getAttribute("fontfamily");var s=T.getAttribute("fontsize")+"pt";this.TextHeight=Qva.MeasureText("�g",t,s).height}var R=v.getElementsByTagName("dropzones");if(R.length>0){this.DropZones=[];for(var m=R[0].firstChild;m;m=m.nextSibling){var j={};ObjectifyXmlAttributes(j,m);this.DropZones[this.DropZones.length]=j}}function q(b){var i=v.getAttribute(b);if(!i){return{x:0,y:0}}var w=i.split(":");return{x:parseInt(w[0]),y:parseInt(w[1])}}if(v.getAttribute("totalsize")!=null){this.ChunkOffset=q("pageoffset");this.ChunkSize=q("pagesize");this.TotalSize=q("totalsize")}else{this.ChunkOffset={x:0,y:0};for(var H=0;U("C"+H)!=null;++H){}if(H==1&&U("C2")!=null){++H}var F=U("C0").getElementsByTagName("element").length;this.TotalSize=this.ChunkSize={x:H,y:F}}if(v.getAttribute("scrollposition")!=null){this.ScrollPosition=q("scrollposition")}else{this.ScrollPosition={x:0,y:0}}M=this.ChunkOffset.x!=0||this.ChunkOffset.y!=0;if(!M){this.Cols=[];this.Body.Lines=[];this.Headers.Lines=[];this.Footers.Lines=[];this.YScroll.Scrolled=false;this.XScroll.Scrolled=false;this.LastSize=null}this.sizetodata=v.getAttribute("sizetodata")==="true";var C=this.ChunkOffset.x;var V=Math.min(this.ChunkOffset.x+this.ChunkSize.x,this.TotalSize.x);var N=this.PageBinder.GetMaxClientWidth()/Math.max(1,V-C);for(var O=C;O<V;++O){var r=U("C"+O);if(!r&&O==1){r=U("C2")}if(!r){continue}var L=parseInt(r.getAttribute("width"));if(isNaN(L)){L=N}if(this.Cols.min_width==null||this.Cols.min_width>L){this.Cols.min_width=L}if(!this.Cols[O]){this.Cols[O]={}}this.Cols[O].width=L;this.Cols[O].allowresize=r.getAttribute("allowresize")!="false";var g=0;var D=0;var K=r.getElementsByTagName("element");for(var k=0;k<K.length;++k){var z=K[k];var J=z.getAttribute("position");var G=k;var B;if(J==="top"){g++;B=this.Headers.Lines}else{if(J==="bottom"){G-=g;D++;B=this.Footers.Lines}else{G-=g;G-=D;G+=this.ChunkOffset.y;B=this.Body.Lines}}if(B[G]==null){B[G]=[]}var f=B[G];f[O]=new this._CellObject(z)}}if(this.Headers.Lines.length===0&&this.Footers.Lines.length===0&&this.Body.Lines.length===0){this.TotalSize={x:0,y:0}}this.Footers.rowHeight=this.Footers.Lines.length>0?this.Footers.Lines[0][0].rowspan*this.TextHeight:0;this.Body.rowHeight=this.Body.Lines.length>0?this.Body.Lines[0][0].rowspan*this.TextHeight:0;this.Headers.height=0;for(var P=0;P<this.Headers.Lines.length;++P){this.Headers.height+=this.Headers.Lines[P][0].rowspan*this.TextHeight}this.Footers.height=this.Footers.Lines.length*this.Footers.rowHeight;var h,A;h=A=this.Headers.height+this.Footers.height;h+=this.Body.rowHeight;A+=this.TotalSize.y*this.Body.rowHeight;var X=0;var E=0;var p=0;var u=parseInt(v.getAttribute("fixed_cols"));var o=parseInt(v.getAttribute("fixed_cols_right"));if(isNaN(u)){u=0}if(isNaN(o)){o=0}var c=u+o;for(var O=0;O<this.TotalSize.x;++O){if(!this.Cols[O]){p=null;break}var I=this.Cols[O].width;if(O<c){E+=I}else{X=Math.max(X,I)}p+=I}X+=E;this.fixed_cols_left=u;this.fixed_cols_right=o;this.min_width=X;this.max_width=p;this.min_height=h;this.max_height=A;this.fixed_width=E;this.PageBinder.QueuePostPaintMessage(this)};Qva.Mgr.grid.prototype._makeFixedLeftMap=function(){var c=this.fixed_cols_left;var a=[];var b=0;for(cix=0;cix<c;++cix){a.push({index:cix,width:this.Cols[cix].width,xPos:b,zIndex:1});b+=this.Cols[cix].width}if(a.length>0){a[a.length-1].right_border=true}return a};Qva.Mgr.grid.prototype._makeBodyColMap=function(h,j,d){var f=[];var g=h;for(var b=0;b<d;++b){var a=b+j;var c=this._getColWidth(a);f.push({index:a,width:c,xPos:g});g+=c}return f};Qva.Mgr.grid.prototype._makeFixedRight=function(){var f=this.fixed_cols_left;var b=f+this.fixed_cols_right;var c=[];var d=0;for(var a=f;a<b;++a){c.push({index:a,width:this.Cols[a].width,xPos:d,zIndex:1});d+=this.Cols[a].width}if(c.length>0){c[0].left_border=true}return c};Qva.Mgr.grid.prototype._makeColMapMap=function(f,c,b,a){var d=[];d[0]={};d[0].Map=this._makeFixedLeftMap();d[0].left=0;d[0].width=this.fixed_cols_left_width;d[1]={};d[1].Map=this._makeBodyColMap(f,c,b);d[1].left=this.fixed_cols_left_width;d[1].width=a;d[2]={};d[2].Map=this._makeFixedRight();d[2].left=this.fixed_cols_left_width+a;d[2].width=this.fixed_cols_right_width;return d};Qva.Mgr.grid.prototype._makeHeaderMap=function(){var a=[];var c=0;for(var d=0;d<this.Headers.Lines.length;++d){var b=this.Headers.Lines[d][0].rowspan*this.TextHeight;a.push({index:d,part:this.Headers,height:b,y:c,zIndex:1});c+=b}if(a.length>0){a[a.length-1].bottom_border=true}return a};Qva.Mgr.grid.prototype._makeBodyLineMap=function(g,h,d){var a=[];var c=g;for(var b=0;b<d;++b){var f=b+h;a.push({index:f,part:this.Body,height:this.Body.rowHeight,y:c});c+=this.Body.rowHeight}return a};Qva.Mgr.grid.prototype._makeFooterMap=function(){var a=[];var b=0;for(var c=0;c<this.Footers.Lines.length;++c){a.push({index:c,part:this.Footers,height:this.Footers.rowHeight,y:b,zIndex:1});b+=this.Footers.rowHeight}if(a.length>0){a[0].top_border=true}return a};Qva.Mgr.grid.prototype._makeLineMapMap=function(f,d,a,g){var b=[];b[0]={};b[0].Map=this._makeHeaderMap();b[0].top=0;b[0].height=this.Headers.height;b[1]={};b[1].Map=this._makeBodyLineMap(f,d,a);b[1].top=this.Headers.height;b[1].height=g;b[2]={};b[2].Map=this._makeFooterMap();b[2].top=this.Headers.height+g;b[2].height=this.Footers.height;if(a>0&&b[2].Map.length>0){var c=b[1].Map[b[1].Map.length-1];c.height=Math.max(c.height,g-(a-1)*this.Body.rowHeight)}return b};Qva.Mgr.grid.prototype._PostPaintCells2=function(t,g,w){var l=this.fixed_cols_left+this.fixed_cols_right;var O,M;var r=this;var B=false;for(M=0;M<g.length;++M){var v=g[M].index;var z=g[M].part;var s=z.Lines[v];if(!z.Painted[v]){z.Painted[v]=[]}var G=z.Painted[v];var P=z.position;for(O=0;O<w.length;++O){var a=w[O].index;if(!s){if(P!=="Body"){continue}this.PageBinder.PartialLoad("Document."+this.ObjectId,{x:Math.floor(a/this.ChunkSize.x)*this.ChunkSize.x,y:Math.floor(v/this.ChunkSize.y)*this.ChunkSize.y});return}if(!s[a]){if(!B){this.PageBinder.PartialLoad("Document."+this.ObjectId,{x:Math.floor(a/this.ChunkSize.x)*this.ChunkSize.x,y:Math.floor(v/this.ChunkSize.y)*this.ChunkSize.y});B=true}continue}var H=s[a];if(H.subcell==="y"&&M>0&&g[M-1].part.position===P){continue}if(O>0&&H.subcell==="x"){continue}if(O>0&&a!==l){if((typeof s[w[O-1].index]!=="undefined")&&s[w[O-1].index].colspan>1){continue}}if(IS_TOUCHENABLED&&O==0&&a>0&&a!==l&&s[a-1].colspan>1){continue}var n=w[O].xPos;var q=g[M].y;var b=w[O].width;var f=g[M].height;if(G[a]){continue}var X=G[a]=document.createElement("div");if(H.colspan>1){for(var S=1;S<H.colspan;++S){b+=this._getColWidth(a+S)}}var C=1;if(H.first==="y"||H.subcell==="y"){for(var S=1;M+S<g.length&&g[M+S].part.Lines[g[M+S].index]&&g[M+S].part.Lines[g[M+S].index][a].subcell==="y";++S){f+=g[M+S].height}C=S}X.xx=a;X.yy=v;X.position=a+":"+v+":"+P;for(var U=0;U<C;++U){var I=z.Lines[v+U];if(!I){continue}for(var W=0;W<H.colspan;++W){var Y=I[a+W];if(!Y||O+W>=w.length){continue}var Q=w[O+W].width;var L=g[M+U].height;var K=document.createElement("div");K.style.position="absolute";if(W==0){if(w[O+W].left_border){Q-=this._MakeBorder(K,Y,Y,"Left","Right",function(d){return d})}else{if(O>0){var J=I[w[O+W-1].index];if(!J){continue}Q-=this._MakeBorder(K,Y,J,"Left","Right",function(d){return Math.ceil(d/2)-1})}}}if(W+1==H.colspan){if(w[O+W].right_border){Q-=this._MakeBorder(K,Y,Y,"Right","Left",function(d){return d})}else{if(a+W+1<I.length){var p=I[a+W+1];if(!p){continue}Q-=this._MakeBorder(K,Y,p,"Right","Left",function(d){return Math.floor(d/2)+1})}}}if(U==0){if(g[M+U].top_border){L-=this._MakeBorder(K,Y,Y,"Top","Bottom",function(d){return d})}else{if(M>0){var N=g[M+U-1].part.Lines[g[M+U-1].index][w[O+W].index];if(!N){continue}L-=this._MakeBorder(K,Y,N,"Top","Bottom",function(d){return Math.ceil(d/2)-1})}}}if(U+1==C){if(v+U+1<z.Lines.length){if(!z.Lines[v+U+1]){continue}var D=z.Lines[v+U+1][a+W];if(!D){continue}L-=this._MakeBorder(K,Y,D,"Bottom","Top",function(d){return Math.floor(d/2)+1})}else{var V=this._MakeBorder(K,Y,Y,"Bottom","Top",function(d){return d});if(g[M+U].bottom_border){L-=V}else{f+=V}}}K.style.left=(w[O+W].xPos-n)+"px";K.style.top=(g[M+U].y-q)+"px";K.style.width=Q>=0?Q+"px":"0px";K.style.height=L>=0?L+"px":"0px";X.appendChild(K);K.position=X.position;K.binderid=this.binderid;K.ObjectId=this.ObjectId;K.setAttribute("unselectable","on")}}X.style.cssText=this._SetCellStyle(H,false,false);X.style.cursor="pointer";X.style.position="absolute";X.style.overflow="hidden";X.style.overflow="hidden";X.style.left=n+"px";X.style.top=q+"px";X.style.width=b>=0?b+"px":"0px";X.style.height=f>=0?f+"px":"0px";X.binderid=this.binderid;X.ObjectId=this.ObjectId;X.onclick=Qva.CancelAction;if(H.dblclick){X.ondblclick=Qva.Mgr.grid.DblClick;if(IS_TOUCHENABLED){Qva.Touch.GridCell.AddTouchSupport(X)}}if(H.dragable){var j=this;X.onmousedown=function(d){Qva.DragDrop.reorder.mouseDown(d,w,j.DropZones)}}if(H.selecttype==null){var c=H.action;if(c){X.onclick=Qva.Mgr.grid.Click;X.pos=a+":"+v;X.action=c}}else{if(H.selecttype=="input"){X.value=H.intval;X.inputname=this.Name+".V"+v;X.onclick=function(d){if(!d){d=window.event}d.cancelBubble=true;Qva.OpenPopupInput(this,true);return false}}else{X.onmousedown=Qva.Mgr.grid.MouseDown;X.onmousemove=Qva.Mgr.grid.MouseMove;if(H.selecttype=="multi"){X.multiselect=true}else{X.singleselect=true}X.selectsource=H.selectsource}}b=Math.max(b-4,0);var E=document.createElement("div");var R=this.Style[H.style];if(R){E.style.display=IS_IE6_OR_IE7?"":"table-cell";E.style.verticalAlign=H.label?R.LabelVertAdjust:R.VertAdjust}E.style.padding="0 2px";E.style.width=b+"px";E.style.height=f+"px";E.style.whiteSpace=(C===1&&H.rowspan===1)?"pre":(IS_IE?"":"pre-wrap");X.appendChild(E);if(R){var k=document.createElement("div");E.style.display=IS_IE6_OR_IE7?"":"table-cell";k.style.verticalAlign=H.label?R.LabelVertAdjust:R.VertAdjust;k.style.width=b+"px";k.style.height=f+"px";E.appendChild(k);E=k}this._appendCellContent(E,H);f-=1;var R=this.Style[H.style];var A=H.label?R.LabelAdjust:(H.isnum?R.NumAdjust:R.TextAdjust);var T=R.StretchMode;for(var m=0;m<H.icons.length;m++){var u=H.icons[m];var F=this._appendCellIcon(u,a,v+(P==="Body"?this.Headers.Lines.length:0),T,A,b,f);F.style.maxWidth=b+"px";F.style.maxHeight=f+"px";E.appendChild(F);if(IS_TOUCHENABLED&&F.action){Qva.Touch.GridCell.AddTouchSupport(F)}}if(H.selected){this._SetCellSelected(E,this.SelectedClassName,false)}else{if(H.locked){this._SetCellSelected(E,this.LockedClassName,false)}}if(H.val){E.setAttribute("unselectable","on");E.title=H.title;if(H.url){var o=document.createElement("a");o.innerText=H.val;o.href=H.url;o.target="_blank";E.appendChild(o);X.onmousedown=Qva.CancelAction;X.onmousemove=Qva.CancelAction;E.onclick=Qva.CancelAction;E.onmousedown=Qva.CancelAction;E.onmousemove=Qva.CancelAction;E.style.cursor="Default";var o=document.createElement("a");o.href=H.url;o.target="_blank";o.appendChild(X);X=o}else{if(H.icons.length>0){var Z=document.createElement("div");Z.style.overflow="hidden";Z.appendChild(document.createTextNode(H.val));Z.position=X.position;Z.binderid=this.binderid;Z.ObjectId=this.ObjectId;E.appendChild(Z)}else{E.appendChild(document.createTextNode(H.val))}}}E.position=X.position;E.binderid=this.binderid;E.ObjectId=this.ObjectId;t.appendChild(X);X.setAttribute("unselectable","on")}}};Qva.Mgr.grid.prototype._CheckSize=function(){var d=this.PageBinder.GetMaxClientWidth();var a=this.PageBinder.GetContentMaxHeight();if(this.min_width>d&&this.PageBinder.Maximized){this.min_width=0;if(this.fixed_width>d){this.fixed_cols_left=0;this.fixed_cols_right=0}}var f,g;if(this.LastSize&&this.LastSize.width==d&&this.LastSize.height==a){f=this.LastSize.r;g=false}else{f=this._UpdateSize(d,a);this.LastSize={width:d,height:a,r:f};g=true}var c=f.dx;var b=f.dy;this.Element.style.height=(this.PageBinder.GetContentMaxHeight()-b)+"px";this.PageBinder.SetObjectWidth(c);this.PageBinder.SetObjectHeight(b);return{width:f.width,height:f.height,changed:g}};Qva.Mgr.grid.prototype._UpdateSize=function(o,l){if(this.min_width>o&&this.PageBinder.Maximized){this.min_width=0;if(this.fixed_width>o){this.fixed_cols_left=0;this.fixed_cols_right=0}}var i=0;var h=0;if(this.TotalSize.x==0||this.TotalSize.y==0){}else{if(this.max_width!=null&&Math.max(o,this.min_width)>=this.max_width&&Math.max(l,this.min_height)>=this.max_height){if(this.sizetodata){i=o-this.max_width;h=l-this.max_height;o=this.max_width;l=this.max_height}else{}}else{if(this.max_width!=null&&Math.max(o-Qva.GetScrollBarWidth(),this.min_width)>=this.max_width){if(this.sizetodata){i=o-Qva.GetScrollBarWidth()-this.max_width;o=this.max_width}else{o-=Qva.GetScrollBarWidth()}}else{if(Math.max(l-Qva.GetScrollBarWidth(),this.min_height)>=this.max_height){if(this.sizetodata){h=l-Qva.GetScrollBarWidth()-this.max_height;l=this.max_height}else{l-=Qva.GetScrollBarWidth()}}else{o-=Qva.GetScrollBarWidth();l-=Qva.GetScrollBarWidth()}}}}if(o<this.min_width){i=o-this.min_width;o=this.min_width}if(l<this.min_height){h=l-this.min_height;l=this.min_height}var d=this.body_height=l-this.Headers.height-this.Footers.height;var c=Math.floor(d/this.Body.rowHeight);var n=this.TotalSize.y-c;var q=this.max_height>l;if(q){this.y_scroll_steps=n;if(useTouchScroll){this.YScroll.Set(o,this.Headers.height,d,this.TotalSize.y*this.Body.rowHeight,l,o,0)}else{this.YScroll.Set(o,this.Headers.height,d,n,l,o,0)}this.YScroll.SetPosition(this.ScrollPosition.y)}else{this.y_scroll_steps=0;this.YScroll.Hide()}var u=this.fixed_cols_left;var g=this.fixed_cols_right;var k=u+g;var j=0;var t=0;var s;for(s=0;s<u;++s){j+=this.Cols[s].width}for(;s<k;++s){t+=this.Cols[s].width}var b=j+t;this.fixed_cols_left_width=j;this.fixed_cols_right_width=t;var p=this.body_width=o-b;var a=p;var m;for(m=this.TotalSize.x-1;m>=0;--m){a-=this._getColWidth(m);if(a<0){break}}++m;m-=k;var f=this.max_width==null||this.max_width>o;if(f){this.x_scroll_steps=m;if(useTouchScroll){var r=0;for(var s=k;s<this.TotalSize.x&&this.Cols[s];++s){r+=this.Cols[s].width}r+=(this.TotalSize.x-s)*this.Cols[this.Cols.length-1].width;this.XScroll.Set(j,l,p,r,o+Qva.GetScrollBarWidth(),0,l)}else{this.XScroll.Set(j,l,p,m,o+Qva.GetScrollBarWidth(),0,l)}this.XScroll.SetPosition(this.ScrollPosition.x)}else{this.x_scroll_steps=0;this.XScroll.Hide()}this._UpdateMaxVisibleRows(d);this._UpdateMaxVisibleCols(p);return{dx:i,dy:h,width:o,height:l}};Qva.Mgr.grid.prototype._UpdateMaxVisibleRows=function(a){if(this.y_scroll_steps>0){this.max_visible_rows=Math.ceil(a/this.Body.rowHeight)}else{this.max_visible_rows=this.TotalSize.y}};Qva.Mgr.grid.prototype._UpdateMaxVisibleCols=function(a){if(this.x_scroll_steps==0){this.max_visible_cols=this.TotalSize.x;return}var d=0;var c=0;var g=0;var f=0;for(var b=0;b<this.Cols.length;++b){c+=this._getColWidth(b);++f;if(f>d){d=f}while(c>a){c-=this._getColWidth(g);++g;--f}}this.max_visible_cols=d};Qva.Mgr.grid.prototype._getColWidth=function(a){return(this.Cols[a]||this.Cols[this.Cols.length-1]).width};Qva.Mgr.grid.prototype.PostPaint=function(){var a=this.Element;if(a.style.display=="none"){return}var t=this._CheckSize();if(this.TotalSize.x===0&&this.TotalSize.y===0){return}var A=t.width;var u=t.height;var b=t.changed;this.xScroll=(this.x_scroll_steps>0)?this.XScroll.Get():0;this.yScroll=(this.y_scroll_steps>0)?this.YScroll.Get():0;if(!IS_TOUCHENABLED||b){this.Body.Painted=[];this.Headers.Painted=[];this.Footers.Painted=[];if(this.scroll_obj){this.scroll_obj.Remove()}this.scroll_obj=null}var d,k,p;var f,j,v;var n=this.fixed_cols_left+this.fixed_cols_right;if(IS_TOUCHENABLED){var K={x:0,y:0};if(this.scroll_obj){K=this.scroll_obj.getCurrentScroll()}var G=5;var F=1;var s=this.scroll_obj?Math.floor(K.y/this.Body.rowHeight):0;f=Math.max(0,s-G);var o=Math.min(this.TotalSize.y,s+this.max_visible_rows+G);var I=n;while(true){K.x-=this._getColWidth(I);if(K.x<0){break}++I}d=Math.max(n,I-F);var C=Math.min(this.TotalSize.x,I+this.max_visible_cols+F);j=o-f;v=f*this.Body.rowHeight;k=C-d;p=0;for(var J=n;J<d;++J){p+=this._getColWidth(J)}}else{if(this.x_scroll_steps>0&&this.xScroll==this.x_scroll_steps){d=this.TotalSize.x-this.max_visible_cols;k=this.max_visible_cols;p=this.body_width;for(var E=0;E<k;++E){var J=E+d;p-=this._getColWidth(J)}}else{d=this.xScroll+n;k=Math.min(this.max_visible_cols,this.TotalSize.x-d);p=0}if(this.y_scroll_steps>0&&this.yScroll===this.y_scroll_steps){f=this.TotalSize.y-this.max_visible_rows;j=this.max_visible_rows;v=this.body_height-j*this.Body.rowHeight}else{f=this.yScroll;j=Math.min(this.max_visible_rows,this.TotalSize.y-f);v=0}}var w=this._makeColMapMap(p,d,k,this.body_width);var B=this._makeLineMapMap(v,f,j,this.body_height);if(!IS_TOUCHENABLED||b){var D=document.createElement("div");D.style.position="relative";D.style.overflow="hidden";D.style.width=A+"px";D.style.height=u+"px";var z=this.parts={};for(var g=0;g<B.length;++g){for(var h=0;h<w.length;++h){var l=B[g].Map;var H=w[h].Map;var m=document.createElement("div");m.style.position="absolute";m.style.overflow="hidden";m.style.left=w[h].left+"px";m.style.top=B[g].top+"px";m.style.width=w[h].width+"px";m.style.height=B[g].height+"px";var q=z[h+":"+g]=document.createElement("div");m.appendChild(q);this._PostPaintCells2(q,l,H);D.appendChild(m)}}if(useTouchScroll){this._addTouchScroll(D,z)}a.replaceChild(D,this.Content);this.Content=D;if(!IS_TOUCHENABLED){this.AddColumnResizers(w)}}else{var z=this.parts;for(var g=0;g<B.length;++g){for(var h=0;h<w.length;++h){if(h!=1&&g!=1){continue}var l=B[g].Map;var H=w[h].Map;if(l.length==0||H.length==0){continue}var q=z[h+":"+g];this._PostPaintCells2(q,l,H)}}}if(this.ScrollPosition){var g=this.yScroll!=null?this.yScroll:0;var h=this.xScroll!=null?this.xScroll:0;if(this.ScrollPosition.y!=g||this.ScrollPosition.x!=h){this.PageBinder.SetScrollPos({x:h,y:g})}}};Qva.Mgr.grid.prototype._find_x_left=function(a){for(var b=0;(b<this.fixed_cols_left-1)&&(a>this.Cols[b].width);++b){a-=this.Cols[b].width}return{cix:b,x:a,width:this.Cols[b].width}};Qva.Mgr.grid.prototype._find_x_center=function(a){var b=this.fixed_cols_left+this.fixed_cols_right;for(cix=b;(cix<this.TotalSize.x-1)&&(a>this.Cols[cix].width);++cix){a-=this.Cols[cix].width}return{cix:cix,x:a,width:this.Cols[cix].width}};Qva.Mgr.grid.prototype._find_x_right=function(a){var b=this.fixed_cols_left+this.fixed_cols_right;for(cix=this.fixed_cols_left;(cix<b-1)&&(a>this.Cols[cix].width);++cix){a-=this.Cols[cix].width}return{cix:cix,x:a,width:this.Cols[cix].width}};Qva.Mgr.grid.prototype._find_y_top=function(b){var a;a.TODO();return{rix:rix,y:b,height:null}};Qva.Mgr.grid.prototype._find_y_center=function(b){var a=Math.max(0,Math.min(this.TotalSize.y-1,Math.floor(b/this.Body.rowHeight)));b-=a*this.Body.rowHeight;return{rix:a,y:b,height:this.Body.rowHeight}};Qva.Mgr.grid.prototype._find_x_bottom=function(b){var a;a.TODO();return{rix:rix,y:b,height:null}};Qva.Mgr.grid.multiselect=function(h,g,d){this.f_close=d;this.mgr=g;for(var i=0;i<3;++i){for(var b=0;b<3;++b){if(g.parts[b+":"+i]==h.parentNode){this.part_x=b;this.part_y=i}}}this.selection={x:h.xx,y:h.yy,width:1,height:1};this.part=this.part_y==1?g.Body:(this.part_y==0?g.Headers:g.Footers);var a=this.part.Painted[h.yy][h.xx];this.rect={left:a.offsetLeft,top:a.offsetTop,right:(a.offsetLeft+a.offsetWidth),bottom:(a.offsetTop+a.offsetHeight)};var c=this.selection_div=document.createElement("div");c.className="TouchSelectionRect";c.style.border="2px solid green";c.style.position="absolute";c.style.left="0px";c.style.top="0px";c.style.webkitTransitionTimingFunction="ease-in-out";c.style.zIndex=50;c.style.webkitTransitionDuration="0s";c.style.webkitTransitionProperty="all";c.style.display="";this._positionSelectionDiv(this.rect);h.parentNode.appendChild(c);this.move_x=[];this.move_y=[];if(!this.menu){this.menu=new Qva.Touch.SelectionMenu({AddPointerElem:true,Buttons:[{Fn:this._makeSelection,Scope:this,CssClass:"img_accept_tick"},{Fn:this._close,Scope:this,CssClass:"img_cancel_cross"}],Style:{position:"absolute",visibility:"hidden"}});document.documentElement.appendChild(this.menu.Element)}var f=Qva.GetAbsolutePageCoords(this.mgr.PageBinder.Element),b=f.x+(this.mgr.PageBinder.Element.offsetWidth-this.menu.Element.offsetWidth)/2,i=f.y-this.menu.Element.clientHeight;this.menu.Show(b,i);Qva.Touch.Events.OnTouchStart.AddListener(new Qva.Touch.Events.ListenerObject("GridSelectionPopup",this,function(j){if(j.target!==h){this._close()}}))};function remove(a){try{if(IS_IE){a.outerHTML="   "}else{a.innerHTML="   ";a.parentNode.removeChild(a)}}catch(b){}}Qva.Mgr.grid.multiselect.prototype._makeSelection=function(){var a=""+this.selection.x+":"+this.selection.y+":"+this.selection.width+":"+this.selection.height;if(this.part_y==0){a+=":Head"}if(this.part_y==2){a+=":Foot"}this.mgr.PageBinder.Set(this.mgr.ObjectId,"rect",a,true);this._close()};Qva.Mgr.grid.multiselect.prototype._close=function(){remove(this.selection_div);this.menu.Hide();this.f_close()};Qva.Mgr.grid.multiselect.prototype._positionSelectionDiv=function(a){this.selection_div.style.webkitTransform="translate3d("+(a.left+0)+"px, "+(a.top+0)+"px, 0)";this.selection_div.style.width=(a.right-a.left-4)+"px";this.selection_div.style.height=(a.bottom-a.top-4)+"px"};Qva.Mgr.grid.multiselect.prototype._isMoving=function(){return this.move_x.length>0||this.move_y.length>0};Qva.Mgr.grid.multiselect.prototype._find_x=function(a){if(this.part_x==0){return this.mgr._find_x_left(a)}else{if(this.part_x==1){return this.mgr._find_x_center(a)}else{if(this.part_x==2){return this.mgr._find_x_right(a)}}}};Qva.Mgr.grid.multiselect.prototype._find_y=function(a){if(this.part_y==0){return this.mgr._find_y_top(a)}else{if(this.part_y==1){return this.mgr._find_y_center(a)}else{if(this.part_y==2){return this.mgr._find_y_bottom(a)}}}};Qva.Mgr.grid.multiselect.prototype._fix_min_rect=function(a){if(a.right-a.left<10){if(this.move_x[0]=="left"){a.left=a.right-10}else{a.right=a.left+10}}if(a.bottom-a.top<10){if(this.move_y[0]=="top"){a.top=a.bottom-10}else{a.bottom=a.top+10}}};Qva.Mgr.grid.multiselect.prototype.touchStart=function(h,d){var l=Qva.Touch.GetCoordinatesForElem(this.selection_div.parentNode);var o=h-l.x;var m=d-l.y;var p=this.mgr.scroll_obj.getCurrentScroll();if(this.part_x==1){o+=p.x}if(this.part_y==1){m+=p.y}var n=this.rect;this.move_x=[];this.move_y=[];var j=o-n.left;var i=n.right-o;var k=m-n.top;var a=n.bottom-m;var b=50;var g=(n.right-n.left<3*b)?0:b;var c=(n.bottom-n.top<3*b)?0:b;var f=-b;if(j>g&&i>g&&k>c&&a>c){this.move_x=["left","right"];this.move_y=["top","bottom"]}else{if(j>f&&i>f&&k>f&&a>f){if(j<=g&&j>f){this.move_x.push("left")}if(i<=g&&i>f){this.move_x.push("right")}if(k<=c&&k>f){this.move_y.push("top")}if(a<=c&&a>f){this.move_y.push("bottom")}}}};Qva.Mgr.grid.multiselect.prototype.touchMove=function(b,a){if(!this._isMoving()){return false}var d={left:this.rect.left,top:this.rect.top,right:this.rect.right,bottom:this.rect.bottom};for(var c=0;c<this.move_x.length;++c){d[this.move_x[c]]+=b}for(var c=0;c<this.move_y.length;++c){d[this.move_y[c]]+=a}this._fix_min_rect(d);this.selection_div.style.webkitTransitionDuration="0ms";this._positionSelectionDiv(d);return true};Qva.Mgr.grid.multiselect.prototype.touchEnd=function(k,j){if(!this._isMoving()){return false}for(var d=0;d<this.move_x.length;++d){this.rect[this.move_x[d]]+=k}for(var d=0;d<this.move_y.length;++d){this.rect[this.move_y[d]]+=j}this._fix_min_rect(this.rect);function f(i){if(i.width>2*i.x){return -i.x}else{++i.cix;return i.width-i.x}}var b=this._find_x(this.rect.left);var h=this._find_x(this.rect.right);if(b.cix==h.cix){this.rect.left-=b.x;this.rect.right+=h.width-h.x;++h.cix}else{if(b.cix+1==h.cix){if(b.width-b.x<h.x){this.rect.left+=f(b);this.rect.right+=h.width-h.x;++h.cix}else{this.rect.left-=b.x;this.rect.right+=f(h)}}else{this.rect.left+=f(b);this.rect.right+=f(h)}}function c(i){if(i.height>2*i.y){return -i.y}else{++i.rix;return i.height-i.y}}var g=this._find_y(this.rect.top);var a=this._find_y(this.rect.bottom);if(g.rix==a.rix){this.rect.top-=g.y;this.rect.bottom+=a.height-a.y;++a.rix}else{if(g.rix+1==a.rix){if(g.height-g.y<a.y){this.rect.top+=c(g);this.rect.bottom+=a.height-a.y;++a.rix}else{this.rect.top-=g.y;this.rect.bottom+=c(a)}}else{this.rect.top+=c(g);this.rect.bottom+=c(a)}}this.selection.x=b.cix;this.selection.y=g.rix;this.selection.width=h.cix-b.cix;this.selection.height=a.rix-g.rix;this.selection_div.style.webkitTransitionDuration="500ms";this._positionSelectionDiv(this.rect);return true};Qva.Mgr.grid.prototype._addTouchScroll=function(A,v){var j=this;var l=this.x_scroll_steps>0;var G=this.y_scroll_steps>0;var p=this.fixed_cols_left+this.fixed_cols_right;var I=0;for(var H=p;H<this.TotalSize.x;++H){if(!this.Cols[H]){break}I+=this.Cols[H].width}I+=(this.TotalSize.x-H)*this.Cols[this.Cols.length-1].width;I-=this.body_width;if(I<0){I=0}var r=Math.max(0,this.TotalSize.y*this.Body.rowHeight-this.body_height);var E,D,s,F,d,w,t,i,J,z,h,o;w=t=0;F=[];Assert(!this.scroll_obj);this.scroll_obj={getCurrentScroll:function(){result={x:-w,y:-t};var x=F[F.length-1];if(x){result.x-=x.dx;result.y-=x.dy}return result},Remove:function(){if(o){o._close()}Assert(!o)}};for(var n=0;n<3;++n){for(var m=0;m<3;++m){if(n!=1&&m!=1){continue}v[n+":"+m].style.webkitTransitionTimingFunction="cubic-bezier(0, 0.3, 0.6, 1)";v[n+":"+m].style.webkitTransitionProperty="-webkit-transform"}}var u=false;function c(){j.PageBinder.QueuePostPaintMessage(j)}function b(K,L){v["1:1"].style.webkitTransform="translate3d("+K+"px, "+L+"px, 0)";v["0:1"].style.webkitTransform="translate3d(0, "+L+"px, 0)";v["2:1"].style.webkitTransform="translate3d(0, "+L+"px, 0)";v["1:0"].style.webkitTransform="translate3d("+K+"px, 0, 0)";v["1:2"].style.webkitTransform="translate3d("+K+"px, 0, 0)";j.XScroll.Reposition(K);j.YScroll.Reposition(L)}function q(x){v["1:1"].style.webkitTransitionDuration=x;v["0:1"].style.webkitTransitionDuration=x;v["2:1"].style.webkitTransitionDuration=x;v["1:0"].style.webkitTransitionDuration=x;v["1:2"].style.webkitTransitionDuration=x;j.XScroll.setTransitionTime(x);j.YScroll.setTransitionTime(x)}function f(K){var x=find_y(K);if(false||j.Body.rowHeight>2*x.y){K-=x.y}else{K+=j.Body.rowHeight-x.y}return K}function a(K){if(K.touches.length>K.changedTouches.length){return true}if(!j.PageBinder.IsValid()){return true}K.stopPropagation();K.preventDefault();E=K.changedTouches[0].clientX;D=K.changedTouches[0].clientY;s=K.timeStamp;d=K.changedTouches[0].identifier;F=[];i=false;if(o){o.touchStart(E,D);return false}var x=new WebKitCSSMatrix(window.getComputedStyle(v["1:1"]).webkitTransform);if(x.e!=n||x.f!=m){w=x.e;t=x.f}b(w,t);q("0ms");c();J=null;var y=K.changedTouches[0].target.parentNode;if(K.changedTouches[0].target.action||y.action){}else{if(y.singleselect){J={position:y.position,x:y.xx,y:y.yy,part:j.Body};if(getSection(J.position)==="Head"){J.part=j.Headers}if(getSection(J.position)==="Foot"){J.part=j.Footers}J.timeout=setTimeout(function(){J.timeout=null;j._IndicateSelection(J.part,J.y,J.x,true)},100)}else{if(y.multiselect){z=setTimeout(function(){if(i){Qva.ConsoleLog.Log("selection_timeout moved error.")}d=null;o=new Qva.Mgr.grid.multiselect(y,j,function(){o=null})},500)}}}return false}function B(y){if(d==null){return null}for(var x=0;x<y.changedTouches.length;++x){if(y.changedTouches[x].identifier==d){return y.changedTouches[x]}}return null}function k(L){var M=B(L);if(!M){return false}var y=M.clientX-E;var x=M.clientY-D;var K=L.timeStamp-s;F.push({dx:y,dy:x,dt:K});if(!i&&(Math.abs(y)+Math.abs(x)>3)){i=true}if(i&&z){clearTimeout(z);z=null}if(i&&J){if(J.timeout){clearTimeout(J.timeout);J.timeout=null}else{j._IndicateSelection(J.part,J.y,J.x,false)}J=null}return true}function C(L){if(!j.PageBinder.IsValid()){return true}if(!k(L)){return true}L.stopPropagation();L.preventDefault();if(J){return false}var K=F[F.length-1];if(o&&o.touchMove(K.dx,K.dy)){return false}if(!i){return false}var y=K.dx+w;var x=K.dy+t;if(!G){x=0}if(!l){y=0}if(-y<0){y=y/3}if(-y>I){y=(y+I)/3-I}if(-x<0){x=x/3}if(-x>r){x=(x+r)/3-r}b(y,x);q("0ms");c()}function g(N){if(!k(N)){return true}N.stopPropagation();N.preventDefault();if(z){clearTimeout(z);z=null}d=null;if(J){if(J.timeout){clearTimeout(J.timeout);J.timeout=null}j._IndicateSelection(J.part,J.y,J.x,false);var P=""+(J.x-j.fixed_cols_right)+":"+J.y+":1:1";if(getSection(J.position)==="Head"){P+=":Head"}j.PageBinder.Set(j.ObjectId,"rect",P,true);return}var L=F[F.length-1];if(o&&o.touchEnd(L.dx,L.dy)){return false}if(!i){var M=N.changedTouches[0].target;if(!M.action){M=M.parentNode}if(!M.action){M=M.parentNode}if(M.action){var O={};O.position=M.pos;O.action="";j.PageBinder.Set(j.ObjectId+"."+M.action,O);return false}}var L=F[F.length-1];for(var K=F.length-1;K>0&&L.dt-F[K-1].dt<100;--K){}var y=2*L.dx-F[K].dx+w;var x=2*L.dy-F[K].dy+t;if(!G){x=0}if(!l){y=0}if(-y<0){y=0}if(-y>I){y=-I}x=-Math.round(-x/j.Body.rowHeight)*j.Body.rowHeight;if(-x<0){x=0}if(-x>r){x=-r}w=y;t=x;F=[];q("500ms");b(y,x);c()}A.addEventListener("touchstart",a,false);A.addEventListener("touchmove",C,false);A.addEventListener("touchend",g,false);setTimeout(function(){q("0ms");b(0,0)},1000)};Qva.Mgr.grid.prototype.Remove=function(){if(this.scroll_obj){this.scroll_obj.Remove()}};Qva.Mgr.grid.prototype.AddColumnResizers=function(h){this.Element.AvqMgr=this.PageBinder;var f,b;if(this.ColumnResizers){f=this.ColumnResizers.length;for(colIndex=0;colIndex<f;colIndex++){this.Element.removeChild(this.ColumnResizers[colIndex])}}this.ColumnResizers=[];for(var a=0;a<h.length;++a){var g=h[a].Map;f=g.length;for(colIndex=0;colIndex<f;++colIndex){var i=g[colIndex].xPos+h[a].left;var d=g[colIndex].width;var c=i+d;if(!this.Cols[g[colIndex].index]||!this.Cols[g[colIndex].index].allowresize){continue}b=document.createElement("div");b.className=colIndex===f-1?"QvColumnResizer QvColumnResizerLast":"QvColumnResizer";b.style.height=this.Content.style.height;b.style.top="0px";b.style.zIndex=3;b.title="Resize column";b.columnData={};b.columnData.widthOuter=d;b.columnData.colIndex=g[colIndex].index;b.columnData.outerRightCoordinate=c;b.columnData.outerLeftCoordinate=b.columnData.outerRightCoordinate-b.columnData.widthOuter;b.style.left=c+"px";b.onmousedown=function(j){Qva.DragDrop.resizeColumn.mouseDown(j)};this.Element.appendChild(b);this.ColumnResizers.push(b)}}};Qva.Mgr.grid.prototype._CombineColors=function(b,a){if(b.A===0&&a.A===0){return"Transparent"}if(b.A===0){return a.css}if(a.A===0){return b.css}if(b.R+b.G+b.B>a.R+a.G+a.B){return a.css}return b.css};Qva.Mgr.grid.prototype._CombineBorders=function(c,b){var f=Math.max(c.width,b.width);var a=this._CombineColors(c.color,b.color);var d=c.style==="double"||b.style==="double"?"double":c.style==="solid"||b.style==="solid"?"solid":"none";return{width:f,color:a,style:d}};Qva.Mgr.grid.prototype._MakeBorder=function(a,m,d,i,g,h){var b=this.Style[m.style].BorderStyle;if(this.BorderStyle.length-1<b){return 0}var l=this.BorderStyle[b][i];if(!this.Style[d.style]){Assert(false)}var k=this.BorderStyle[this.Style[d.style].BorderStyle][g];var c=this._CombineBorders(l,k);if(c.style==="solid"){var j=h(c.width);a.style["border"+i]="solid "+j+"px "+c.color;return j}else{if(c.style==="double"){a.style["border"+i]="solid 3px "+c.color;return h(9)}else{Assert(c.style==="none");return 0}}};Qva.Mgr.grid.prototype._StyleObject=function(c){var d=c.getAttribute("bgcolor");this.BgColorRGB=HtmlifyARGB(d);this.BgColorCSSExpr=Qva.Hex2CSSExpression(d);this.Color=HtmlifyARGB(c.getAttribute("color"));this.NumAdjust=c.getAttribute("numadjust");this.TextAdjust=c.getAttribute("textadjust");this.VertAdjust=c.getAttribute("vertadjust");this.LabelAdjust=c.getAttribute("labeladjust");this.LabelVertAdjust=c.getAttribute("labelvertadjust");this.BorderStyle=c.getAttribute("borderstyle");var a=c.getAttribute("fontstyle");this.FontStyle=a;this.FontWeight=c.getAttribute("fontweight");this.TextDecoration=c.getAttribute("textdecoration");this.SizeMod=c.getAttribute("sizemod");var b=c.getAttribute("stretchmode");if(b){this.StretchMode=b}};Qva.Mgr.grid.prototype._BorderStyleObject=function(b){function a(d){var c=b.getAttribute(d).split(" ");if(c[0]==="none"){return{width:0,style:"none",color:ObjectifyARGB(null)}}var f=parseInt(c[1]);return{width:f,style:c[0],color:ObjectifyARGB(c[2])}}this.Top=a("top");this.Right=a("right");this.Bottom=a("bottom");this.Left=a("left")};Qva.Mgr.grid.prototype._CellObject=function(c){this.val=this.title=c.getAttribute("title")||c.getAttribute("text");var a=c.getAttribute("value");if(typeof a!="undefined"){this.intval=a;this.selected=c.getAttribute("selected")=="yes";this.level=c.getAttribute("level")}else{if(c.getAttribute("selected")){this.selected=c.getAttribute("selected")=="yes";this.byval=true}}if(c.getAttribute("state")){this.state=c.getAttribute("state")}this.dblclick=!!c.getAttribute("dblclick");this.mode=c.getAttribute("mode");this.disabled=this.mode=="disabled";this.style=c.getAttribute("style")?c.getAttribute("style"):"0";this.isnum=c.getAttribute("isnum")=="true";this.label=c.getAttribute("label")=="true";this.icons=c.getElementsByTagName("icon");this.subcell=c.getAttribute("subcell");this.first=c.getAttribute("first");this.colspan=parseInt(c.getAttribute("colspan"));if(isNaN(this.colspan)){this.colspan=1}this.action=c.getAttribute("action");this.url=c.getAttribute("url");if(c.getAttribute("position")){this.position=c.getAttribute("position")}var b=c.getAttribute("selecttype");if(b){this.selecttype=b;this.selectsource=c.getAttribute("selectsource")=="true";if(this.action){Assert(false)}}this.input=c.getAttribute("input")=="true";this.dragable=c.getAttribute("dragable")=="true";var d=c.getAttribute("rowspan");if(d){this.rowspan=parseInt(d)}else{this.rowspan=1}};Qva.Mgr.grid.prototype._SetCellStyle=function(d,a,c){if(!d.style){return""}var b=this.Style[d.style];if(!b){return""}var f="";if(c){if(b.BgColorCSSExpr){f+="; background-color:"+b.BgColorCSSExpr}else{if(b.BgColorRGB){f+="; background-color:"+b.BgColorRGB}}f+="; color:"+b.BgColorRGB}else{if(!a){if(b.BgColorCSSExpr){f+="; background-color:"+b.BgColorCSSExpr}else{if(b.BgColorRGB){f+="; background-color:"+b.BgColorRGB}}f+="; color:"+b.Color}else{f+="; background-color:";f+="; color:"}}f+="; text-align:"+(d.label?b.LabelAdjust:(d.isnum?b.NumAdjust:b.TextAdjust));f+="; font-style:"+b.FontStyle;f+="; font-weight:"+b.FontWeight;f+="; text-decoration:"+b.TextDecoration;switch(b.SizeMod){case"2":f+="; font-size:large";break;case"1":f+="; font-size:larger";break;case"-1":f+="; font-size:smaller";break;case"-2":f+="; font-size:small";break}return f};Qva.Mgr.grid.prototype._appendCellContent=function(a,f,g,b,d,i){var h=parseInt(f.level);if(!isNaN(h)){alert("TODO: level")}var c=0};Qva.Mgr.grid.prototype._appendCellIcon=function(g,b,h,d,i,f,a){var c=this.PageBinder.GetDocumentMgr().CreateCellIcon(g,d,i,f,a);AppendAction(c,g,this,b+":"+h);return c};Qva.Mgr.grid.getMgr=function(b){var a=b.parentNode;while(a&&!a.Mgr){a=a.parentNode}return a?a.Mgr:null};Qva.Mgr.grid.DblClick=function(a){this.pressed=false;if(!a){a=window.event}var b=Qva.Mgr.grid.getMgr(this);if(!b.PageBinder.GetEnabled()){return}b.PageBinder.Set(b.ObjectId,"dblclick",this.xx+":"+this.yy,true)};Qva.Mgr.grid.Click=function(a){if(!a){a=window.event}a.cancelBubble=true;this.pressed=true;var b=this;window.setTimeout(function(){action_mu(b)},200)};Qva.Mgr.grid.MouseDown=function(a){if(this.disabled){return}if(!a){a=window.event}var b=Qva.Mgr.grid.getMgr(this);if(a.button!=b.LeftButton){return}if(!b.PageBinder.IsValid()){return}Qva.Select.Active=false;Qva.Mgr.grid.SelectMgr=b;b.Selection.Start=b.Selection.End=this;b.Selection.SelectSource=this.selectsource;Qva.addEvent(document.body,"mouseup",Qva.Mgr.grid.MouseUp);b._IndicateCellsToSelect()};Qva.Mgr.grid.MouseMove=function(a){if(this.disabled){return}if(!a){a=window.event}var b=Qva.Mgr.grid.getMgr(this);if(Qva.Mgr.grid.SelectMgr!=b){return}if(b.Selection.SelectSource!=this.selectsource){return}if(!b.PageBinder.IsValid()){return}b.Selection.End=this;if(this.singleselect){b.Selection.Start=b.Selection.End}b._IndicateCellsToSelect()};function getSection(a){var b=a.split(":");if(b.length<3){return""}return b[2]}Qva.Mgr.grid.MouseUp=function(d){Qva.removeEvent(document.body,"mouseup",Qva.Mgr.grid.MouseUp);Qva.Select.Active=true;if(!d){d=window.event}var f=Qva.Mgr.grid.SelectMgr;Qva.Mgr.grid.SelectMgr=null;f._ClearCellsToSelect();if(getSection(f.Selection.Start.position)===getSection(f.Selection.End.position)){var b=Math.min(f.Selection.Start.xx,f.Selection.End.xx);b-=f.fixed_cols_right;var h=Math.min(f.Selection.Start.yy,f.Selection.End.yy);var c=Math.abs(f.Selection.Start.xx-f.Selection.End.xx)+1;var a=Math.abs(f.Selection.Start.yy-f.Selection.End.yy)+1;var g=""+b+":"+h+":"+c+":"+a;if(getSection(f.Selection.Start.position)==="Head"){g+=":Head"}f.PageBinder.Set(f.ObjectId,"rect",g,true)}else{alert("error")}};Qva.Mgr.grid.prototype._IndicateCellsToSelect=function(){if(this.ObjectId!=Qva.SearchableObject){SetSearchableAndActives(this.ObjectId,[this.ObjectId])}var c=Math.min(this.Selection.Start.xx,this.Selection.End.xx);var f=Math.min(this.Selection.Start.yy,this.Selection.End.yy);var j=Math.max(this.Selection.Start.xx,this.Selection.End.xx);var a=Math.max(this.Selection.Start.yy,this.Selection.End.yy);var g={left:c,top:f,right:j,bottom:a};if(!this.Selection.Old){this.Selection.Old=g}c=Math.min(c,this.Selection.Old.left);f=Math.min(f,this.Selection.Old.top);j=Math.max(j,this.Selection.Old.right);a=Math.max(a,this.Selection.Old.bottom);this.Selection.Old=g;var b=this.Body;if(getSection(this.Selection.Start.position)==="Head"){b=this.Headers}if(getSection(this.Selection.Start.position)==="Foot"){b=this.Footers}for(var i=c;i<=j;++i){for(var d=f;d<=a;++d){var h=g.left<=i&&i<=g.right&&g.top<=d&&d<=g.bottom;this._IndicateSelection(b,d,i,h)}}};Qva.Mgr.grid.prototype._IndicateSelection=function(f,i,c,b){if(f.Painted[i][c].selectsource){for(var d=0;d<f.Painted[i].length;d++){var g=i;var a=null;while(g>=0&&a==null){a=f.Painted[g--][d]}if(!a){continue}if(!a.selectsource&&(a.singleselect||a.multiselect)){this._SetCellSelected(a,b?this.SelectedClassName:"",!b)}}for(var h=0;h<f.Painted.length;h++){var a=f.Painted[h]&&f.Painted[h][c];if(!a){continue}if(!a.selectsource&&(a.singleselect||a.multiselect)){this._SetCellSelected(a,b?this.SelectedClassName:"",!b)}}if(f!=this.Headers){for(var h=0;h<this.Headers.Painted.length;h++){var a=this.Headers.Painted[h][c];if(!a){continue}if(!a.selectsource&&(a.singleselect||a.multiselect)){this._SetCellSelected(a,b?this.SelectedClassName:"",!b)}}}}else{this._SetCellSelected(f.Painted[i][c],b?this.SelectedClassName:"",!b)}};Qva.Mgr.grid.prototype._ClearCellsToSelect=function(){if(!this.Selection.Old){return}var g=this.Selection.Old.left;var f=this.Selection.Old.top;var d=this.Selection.Old.right;var b=this.Selection.Old.bottom;this.Selection.Old=null;var c=this.Body;if(getSection(this.Selection.Start.position)==="Head"){c=this.Headers}if(getSection(this.Selection.Start.position)==="Foot"){c=this.Footers}for(var a=g;a<=d;++a){for(var h=f;h<=b;++h){this._IndicateSelection(c,h,a,false)}}};Qva.Mgr.grid.prototype._SetCellSelected=function(a,b,c){if(!a){return}if(c){if(a.origcolor!=""){a.style.color=a.origcolor;a.origcolor=""}if(a.origbackgroundColor!=""){a.style.backgroundColor=a.origbackgroundColor;a.origbackgroundColor=""}}else{if(a.style.color!=""){a.origcolor=a.style.color;a.style.color=""}if(a.style.backgroundColor!=""){a.origbackgroundColor=a.style.backgroundColor;a.style.backgroundColor=""}}if(a.className!=b){a.className=b}};Qva.Mgr.grid.prototype.GetCell=function(c,d){var b=this.Headers.Lines.length;var a;if(d<b){return this.Headers.Painted[d][c]}else{return this.Body.Painted[d-b][c]}};Qva.Mgr.grid.prototype.GetCellRect=function(c,d){var b=this.Headers.Lines.length;var a=this.GetCell(c,d);var f=Qva.GetAbsolutePageCoords(a);return{left:f.x,width:a.offsetWidth,top:f.y,height:a.offsetHeight}};if(!Qva.Mgr){Qva.Mgr={}}Qva.PageBinding.prototype.CreateTransientListBox=function(a){var b={};b.name=a;b.id="DS";var c=Qva.Mgr.CreateObject(this,b,false,false);c.Element.className+=" DS";c.Element.style.cssText="z-index: 666; display: none; left: 10pt; top: 10pt; width: 10pt; height: 800pt; position:absolute;";c.CreateListBox();new Qva.Mgr.transientpos(c,c.Element,a,"");document.body.appendChild(c.Element)};function AppendWidthHighlights(b,j,f){if(f&&f.length>0){var g=0;var h=0;while(j!=""){var d=f[h++];if(d){var a=parseInt(d.getAttribute("pos"));var c=parseInt(d.getAttribute("count"));if(a>g){var i=document.createElement("span");i.innerText=j.substr(0,a-g);j=j.substr(a-g);g=a;b.appendChild(i)}var i=document.createElement("span");i.innerText=j.substr(0,c);j=j.substr(c);g+=c;i.className="qvHighLighted";b.appendChild(i)}else{var i=document.createElement("span");i.innerText=j;b.appendChild(i);j=""}}}else{b.appendChild(document.createTextNode(j))}}Qva.Mgr.transientpos=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}a.AddManager(this);this.Element=c};Qva.Mgr.transientpos.prototype.Paint=function(i,d,a){var f=this.Element;f.style.display=Qva.MgrGetDisplayFromMode(this,i);if(f.style.display=="none"){return}var b=d.getAttribute("owner");var l=parseInt(d.getAttribute("row"));var c=parseInt(d.getAttribute("col"));var h=d.getAttribute("position");this.PageBinder.TransientObject=this.Name;var k=document.getElementById(b);var g=k&&k.AvqMgr&&k.AvqMgr.GetSearchMgr();if(g&&g.GetCellRect){var j=g.GetCellRect(c,l);if(h=="offset"){j.left-=15}else{if(h=="cut"){j.width-=15}else{if(h=="below"){j.top+=j.height}else{if(h=="right"){j.left+=j.width}else{Assert(h=="")}}}}j.height=Qva.GetViewportHeight();j.height-=(j.top-Qva.GetScrollTop());if(j.height>80){j.height-=40}j.width=Math.max(j.width,50);j.mode=i;j.allowmove=false;j.allowresize=false;j.maximized=false;this.PageBinder.Size(j)}else{Assert(false);this.PageBinder.PageBinder.CloseTransient();return}};Qva.Mgr.listbox=function(a,c,b,d){this.SearchName=this.Name=Qva.MgrMakeName(b,d);this.binderid=a.binderid;this.ObjectId=a.Element.id;this.LeftButton=a.LeftButton;this.Element=c;c.Mgr=this;a.AddManager(this);this.Selections={Selected:[]};c.style.position="relative";c.style.overflow="hidden";c.style.cursor="Default";this.Content=document.createElement("div");c.appendChild(this.Content);if(useTouchScroll){this.YScroll=new Qva.TouchScrollMgr(this,true);this.XScroll=new Qva.TouchScrollMgr(this,false)}else{this.YScroll=new Qva.ScrollMgr(this,true);this.XScroll=new Qva.ScrollMgr(this,false)}};Qva.Mgr.listbox.prototype.GetCellRect=function(a,c){Assert(a==-1&&c==-1);var b=this.PageBinder.Element;var d=Qva.GetAbsolutePageCoords(b);return{left:d.x,width:b.offsetWidth,top:d.y,height:b.offsetHeight}};Qva.Mgr.listbox.prototype.AddSelectionStyle=function(d){var f=parseInt(d.getAttribute("style"));var b=HtmlifyARGB(d.getAttribute("color"));if(b!=null){b=b.replace("#","")}this.HideAndModeSymbols=false;this.AutoCtrl=false;this.HasSelectedExcluded=false;switch(f){case 1:this.TextIndent=17;if(this.OnlyoneSelected){this.AltClass="_RADIO_"+b;this.PageBinder.GetDocumentMgr().LoadRadioStyle(b)}else{this.AltClass="_CHECK_"+b;this.PageBinder.GetDocumentMgr().LoadCheckStyle(b);this.AutoCtrl=true;this.HasSelectedExcluded=true}break;case 2:var g=this.Lines[this.Lines.length-1];var c=Math.min((g?g.rowspan:1)*this.TextHeight,40);this.TextIndent=(c/2)+4;this.AltClass="_CORNERTAG_"+c+"_"+b;this.PageBinder.GetDocumentMgr().LoadCornertagStyle(c,b);this.HideAndModeSymbols=true;break;case 3:this.TextIndent=16;this.AltClass="_Led_"+b;this.PageBinder.GetDocumentMgr().LoadLedStyle(b);break;case 7:this.TextIndent=16;this.AltClass="_LED_CHECK_"+b;this.PageBinder.GetDocumentMgr().LoadLedCheckStyle(b);if(!this.OnlyoneSelected){this.AutoCtrl=true}this.HasSelectedExcluded=true;break;case -1:case 0:default:this.TextIndent=2;this.AltClass="";break}this.AltClass_OnBorder=!!this.AltClass;var a=d.getAttribute("semantic")=="true";if(a){this.AltClass="_Semantic"}};Qva.Mgr.listbox.prototype.Paint=function(p,r,A,c){this.Touched=true;var g=this.Element;function t(b){for(var y=0;y<r.childNodes.length;++y){if(r.childNodes[y].tagName=="value"&&r.childNodes[y].getAttribute("name")==b){return r.childNodes[y]}}return null}var d=t("Body");if(d){g.style.display=d.getAttribute("mode")=="enabled"?"":"none"}if(g.style.display=="none"){return}var k=r.getElementsByTagName("style");if(k.length>0){this.Style=[];k=k[0].getElementsByTagName("style");for(var q=0;q<k.length;q++){this.Style[q]=new this._StyleObject(k[q])}}k=r.getElementsByTagName("borderstyle");if(k.length>0){this.BorderStyle=[];k=k[0].getElementsByTagName("borderstyle");for(q=0;q<k.length;q++){var u=this.BorderStyle[q]=new this._BorderStyleObject(k[q])}}var w=t("Style");if(w){var x=this.fontfamily=w.getAttribute("fontfamily");var v=this.fontsize=w.getAttribute("fontsize")+"pt";this.TextHeight=Qva.MeasureText("�g",x,v).height;var n=r.getAttribute("longest");this.TextLength=Qva.MeasureText(n,x,v).width+4}this.readOnly=r.getAttribute("readonly")==="true";this.orderByCol=r.getAttribute("order")==="col";this.fixedCols=parseInt(r.getAttribute("columns"));if(isNaN(this.fixedCols)){this.fixedCols=null}this.maxrows=parseInt(r.getAttribute("maxrows"));if(isNaN(this.maxrows)){this.maxrows=null}function s(b){var y=r.getAttribute(b);if(!y){return 0}var B=y.split(":");return parseInt(B[1])}function a(b){var y=r.getAttribute(b);if(!y){return{x:0,y:0}}var B=y.split(":");return{x:parseInt(B[0]),y:parseInt(B[1])}}if(r.getAttribute("totalsize")!=null){this.ChunkOffset=s("pageoffset");this.ChunkSize=s("pagesize");this.TotalSize=s("totalsize")}else{this.ChunkOffset=0;var l=t("C0").getElementsByTagName("element").length;this.TotalSize=this.ChunkSize=l}if(this.ChunkOffset===0){this.Lines=[];this.YScroll.Scrolled=false;this.XScroll.Scrolled=false}if(r.getAttribute("scrollposition")!=null){this.ScrollPosition=a("scrollposition")}else{this.ScrollPosition={x:0,y:0}}this.andmode=r.getAttribute("andmode")=="true";this.CurrentPhase=0;this.suppresshorizontalscroll=r.getAttribute("suppresshorizontalscroll")==="true";this.sizetodata=r.getAttribute("sizetodata")==="true";this.PageBinder.Searchable=r.getAttribute("searchable")=="true";var j=t("C0");if(j){var o=j.getElementsByTagName("element");for(var i=0;i<o.length;++i){var f=o[i];var h=i+this.ChunkOffset;if(this.Lines[h]==null){this.Lines[h]=[]}this.Lines[h]=new this._CellObject(f)}var m=this.Lines[this.Lines.length-1];this.rowHeight=m?m.rowspan*this.TextHeight:0;this.singleselect=m&&m.selecttype=="single"}this.PageBinder.QueuePostPaintMessage(this);this.OnlyoneSelected=r.getAttribute("onlyoneselected")=="true";var z=r.getElementsByTagName("selectionstyle");if(z.length>0){this.AddSelectionStyle(z[0])}};Qva.Mgr.listbox.prototype._appendCellIcon=function(f,h,c,g,d,a){var b=this.PageBinder.GetDocumentMgr().CreateCellIcon(f,c,g,d,a);AppendAction(b,f,this,h);return b};Qva.Mgr.listbox.prototype.PostPaint=function(){var b=this.Element;if(b.style.display=="none"){return}if(!this.Lines){return}var q=this.PageBinder.GetMaxClientWidth();var p=this.PageBinder.GetContentMaxHeight();var C=Math.floor(p/this.rowHeight)*this.rowHeight;var t=this.orderByCol&&this.TextLength*2<=q;var F=this.fixedCols;var D=this.maxrows;var l,a,A;var g=false;var w=0;var c=0;var E=0;var h=0;if(t){function u(i){var x=this.rowHeight>=0?Math.floor(i/this.rowHeight):1;if(x>this.TotalSize){x=this.TotalSize}if(D!=null&&D<x){x=D}if(x<1){x=1}return x}l=u.call(this,p);a=Math.ceil(this.TotalSize/l);g=!this.suppresshorizontalscroll&&a==1&&Math.floor(q/a)<this.TextLength;if(F!=null&&F<a||q<a*this.TextLength||g){p-=Qva.GetScrollBarWidth();l=u.call(this,p);a=Math.ceil(this.TotalSize/l);A=(F!=null)?F:Math.floor(q/this.TextLength)}else{A=a}}else{function f(x){var i;if(F!=null){i=F}else{i=Math.floor(x/this.TextLength)}if(i>this.TotalSize){i=this.TotalSize}if(i<1){i=1}return i}a=f.call(this,q);l=Math.ceil(this.TotalSize/a);g=!this.suppresshorizontalscroll&&a==1&&Math.floor(q/a)<this.TextLength;if(g){p-=Qva.GetScrollBarWidth()}if(Math.max(p,this.rowHeight)<l*this.rowHeight){q-=Qva.GetScrollBarWidth();a=f.call(this,q);l=Math.ceil(this.TotalSize/a)}if(!g&&!this.suppresshorizontalscroll&&a==1&&Math.floor(q/a)<this.TextLength){g=true;p-=Qva.GetScrollBarWidth()}A=a}if(A<1){A=1}var r=this.colwidth=Math.floor(q/A);var n=q-A*r;if(A==a&&!g){Assert(n<A);this.col_extra=n;n=0}else{this.col_extra=0;q=A*r}var z=Math.floor(p/this.rowHeight);if(D!=null&&D<z){z=D}var m=0;if(this.Lines.length==0){m=p;p=0}else{if(p<this.rowHeight){m=p-this.rowHeight;p=this.rowHeight;z=1}else{if(this.sizetodata){var C=z*this.rowHeight;if(C>l*this.rowHeight){C=l*this.rowHeight}m=p-C;p=C}}}b.style.height=(this.PageBinder.GetContentMaxHeight()-m)+"px";this.PageBinder.SetObjectWidth(n);this.PageBinder.SetObjectHeight(m);if(this.Lines.length==0){return}this.visible_cols=A;this.columns=a;this.visible_rows=z;this.rows=l;if(A<a){if(useTouchScroll){this.XScroll.Set(0,p,q,a*r,q+Qva.GetScrollBarWidth(),0,p)}else{this.XScroll.scroll_scale=30;this.XScroll.Set(0,p,q,a-A,q+Qva.GetScrollBarWidth(),0,p);this.XScroll.SetPosition(this.ScrollPosition.x/l);w=this.XScroll.Get()}}else{if(g&&!useTouchScroll){this.XScroll.scroll_scale=1;this.XScroll.Set(0,p,q,this.TextLength-r,q+Qva.GetScrollBarWidth(),0,p);E=-this.XScroll.Get()}else{this.XScroll.Hide()}}if(z<l){if(useTouchScroll){this.YScroll.Set(q,0,p,l*this.rowHeight,p,q,0)}else{this.YScroll.Set(q,0,p,l-z,p,q,0);this.YScroll.SetPosition(this.ScrollPosition.y/a);c=this.YScroll.Get()}}else{this.YScroll.Hide()}var d=A<a||z<l;if(this.has_any_scrollbar!==d){this.PageBinder.GetDocumentMgr()._Send("set",this.Name,true,{scrollbar:(d?"true":"false")});this.has_any_scrollbar=d}if(IS_TOUCHENABLED){E+=w*r;h+=c*this.rowHeight}var B=[];var o=[];var v;for(v=0;v<A;++v){B.push({offset:((t?l:1)*(v+w)),xPos:(r*v+Math.min(this.col_extra,v)+E),width:g?this.TextLength:(r+(v<this.col_extra?1:0))})}for(v=0;v<z;++v){o.push({offset:((t?1:a)*(v+c)),yPos:(this.rowHeight*v+h),height:this.rowHeight})}this.Visible={Start:B[0].offset+o[0].offset,End:Math.min(B[B.length-1].offset+o[o.length-1].offset,this.TotalSize-1)};if(IS_TOUCHENABLED){if(!this.Painted){this.Painted=[]}if(!this.Content){var s=document.createElement("div");s.style.position="relative";s.style.overflow="hidden";this.Content=s;b.appendChild(this.Content)}this.Content.style.width=(a*r+this.col_extra)+"px";this.Content.style.height=(l*this.rowHeight)+"px";if(this.RePaintRect){this.PaintExtraCells(this.RePaintRect.left,this.RePaintRect.top,this.RePaintRect.width,this.RePaintRect.height);this.RePaintRect=null}else{this.Content.innerHTML="";if(this.PageBinder.ContentElement.Touch){this.PageBinder.ContentElement.Touch.ResetScroll()}this.Painted=[];this._PaintCells(this.Content,E,h,o,B)}}else{this.Painted=[];var s=document.createElement("div");s.style.position="relative";s.style.overflow="hidden";s.style.width=q+"px";s.style.height=p+"px";this._PaintCells(s,E,h,o,B);b.replaceChild(s,this.Content);this.Content=s;if(this.ScrollPosition){var k=w*l;var j=c*a;if(this.ScrollPosition.y!=j||this.ScrollPosition.x!=k){this.PageBinder.SetScrollPos({x:k,y:j})}}if(this.Selections.mouseDown||this.Selections.Selected.length>0){this._IndicateCellsToSelect()}}};Qva.Mgr.listbox.prototype.PaintExtraCells=function(c,j,a,k){var g=c*this.colwidth+Math.min(this.col_extra,c);var d=j*this.rowHeight;var h=[];var b=[];var f;for(f=0;f<a;++f){if(f+c<0||f+c>=this.columns){continue}h.push({offset:((this.orderByCol?this.rows:1)*(f+c)),xPos:(this.colwidth*f+Math.min(this.col_extra,f)+g),width:this.colwidth+(f<this.col_extra?1:0)})}for(f=0;f<k;++f){if(f+j<0||f+j>=this.rows){continue}b.push({offset:((this.orderByCol?1:this.columns)*(f+j)),yPos:(this.rowHeight*f+d),height:this.rowHeight})}this.Visible={Start:h[0].offset+b[0].offset,End:Math.min(h[h.length-1].offset+b[b.length-1].offset,this.TotalSize-1)};if(this._PaintCells(this.Content,g,d,b,h,false)===false){this.RePaintRect={left:c,top:j,width:a,height:k}}};Qva.Mgr.listbox.prototype._PaintCells=function(E,L,k,t,J){var m,l;for(l=0;l<t.length;++l){for(m=0;m<J.length;++m){var i=t[l].offset+J[m].offset;if(i>=this.TotalSize){continue}if(!this.Lines[i]){this.PageBinder.PartialLoad("Document."+this.ObjectId,{x:0,y:Math.floor(i/this.ChunkSize)*this.ChunkSize});return false}var a=this.Lines[i];var L=J[m].xOffset||0;var k=t[l].yOffset||0;var f=J[m].xPos+L;var A=t[l].yPos+k;var D=J[m].width-L;var B=t[l].height-k;if(this.Painted[i]){continue}var z=this.Painted[i]=document.createElement("div");var n=J[m].width;var C=t[l].height;var j=document.createElement("div");j.style.position="absolute";j.style.zIndex=1;n-=this._MakeBorder(j,"Left","Right",function(d){return Math.ceil(d/2)-1});n-=this._MakeBorder(j,"Right","Left",function(d){return Math.floor(d/2)+1});C-=this._MakeBorder(j,"Top","Bottom",function(d){return Math.ceil(d/2)-1});C-=this._MakeBorder(j,"Bottom","Top",function(d){return Math.floor(d/2)+1});j.style.left=(-L)+"px";j.style.top=(-k)+"px";j.style.width=n+"px";j.style.height=C+"px";j.setAttribute("unselectable","on");z.appendChild(j);z.style.cssText=this._SetCellStyle(a,false,false);z.style.cursor="pointer";z.style.position="absolute";z.style.overflow="hidden";z.style.overflow="hidden";z.style.left=f+"px";z.style.top=A+"px";z.style.width=D+"px";z.style.height=B+"px";z.setAttribute("unselectable","on");z.offset=i;z.value=a.intval;z.onclick=Qva.CancelAction;if(a.selecttype!=null){z.onmousedown=Qva.Mgr.listbox.MouseDown;z.onmousemove=Qva.Mgr.listbox.MouseMove;z.selectsource=a.selectsource}var h=document.createElement("div");h.style.padding="0";h.style.width=D+"px";h.style.height=B+"px";h.setAttribute("unselectable","on");h.title=a.title;h.style.whiteSpace=a.rowspan===1?"pre":(IS_IE?"":"pre-wrap");z.appendChild(h);var G=this.Style[0];var v=G.StretchMode;var K=a.isnum?G.NumAdjust:G.TextAdjust;z.className="Qv"+a.state+this.AltClass;if(this.AltClass_OnBorder){j.className="Qv"+a.state+this.AltClass}var g=D;var F=0;for(var M=0;M<a.subcontent.length;M++){var s=a.subcontent[M];var q=parseInt(s.getAttribute("width"));if(!isNaN(q)){g-=q}var c=parseInt(s.getAttribute("percentwidth"));if(!isNaN(c)){F+=c}}function b(w){var x=document.createElement("div");x.style.overflow="hidden";x.position=z.position;x.binderid=this.PageBinder.ID;x.ObjectId=this.ObjectId;x.style.width=w+"px";x.style.height=B+"px";x.style.cssFloat="left";x.style.styleFloat="left";x.setAttribute("unselectable","on");h.appendChild(x);return x}if(a.val){g-=this.TextIndent;g-=2;b.call(this,this.TextIndent)}var p=10;if(a.level){var o=a.level*10;g-=o;if(a.expandcollapse_icon){o-=p}b.call(this,o);if(a.expandcollapse_icon){var I=b.call(this,p);var H=this._appendCellIcon(a.expandcollapse_icon,a.intval,v,K);H.style.top=((B-p)/2)+"px";H.style.zIndex=1;I.appendChild(H)}g-=2;b.call(this,2)}if(this.andmode&&!this.HideAndModeSymbols){var r=12;g-=r;var I=b.call(this,r);var u=Qva.Mgr.listbox.AndModeSymbol(a.state);I.appendChild(document.createTextNode(u));z.AndModeSymbol=I}if(a.input_icon){g-=p}var q=parseInt(g*Math.max(0,100-F)/100);if(q>0){if(a.led_icon){q-=p}var I=b.call(this,q);if(a.val){AppendWidthHighlights(I,a.val,a.parts)}else{if(a.main_icon){var H=this._appendCellIcon(a.main_icon,a.intval,v,K,q,B);H.style.top="0";I.appendChild(H)}}if(a.led_icon){var I=b.call(this,p);var H=this._appendCellIcon(a.led_icon,a.intval,v,K);H.style.top=((B-p)/2)+"px";I.appendChild(H)}}for(var M=0;M<a.subcontent.length;M++){var s=a.subcontent[M];var q=parseInt(s.getAttribute("width"));if(isNaN(q)){q=parseInt(g*parseInt(s.getAttribute("percentwidth"))/100)}if(q<=0){continue}var I=b.call(this,q);if(s.getAttribute("name")){var H=this.PageBinder.GetDocumentMgr().CreateCellIcon(s,v,K,q,B);AppendAction(H,s,this,a.intval);I.appendChild(H)}else{I.appendChild(document.createTextNode(s.getAttribute("text")||"  "));if(s.getAttribute("align")){I.style.textAlign=s.getAttribute("align")}}}if(a.input_icon){var I=b.call(this,p);var H=this._appendCellIcon(a.input_icon,a.intval,v,K);H.style.top=((B-p)/2)+"px";H.style.zIndex=1;I.appendChild(H)}E.appendChild(z)}}};Qva.Mgr.listbox.AndModeSymbol=function(a){if(a=="Selected"){return"&"}else{if(a=="Deselected"){return"!"}else{return" "}}};Qva.Mgr.listbox.prototype.StartPhaseShift=function(a){var b=this;if(this.phase_timout){return}this.phase_timout=setTimeout(function(){b.NextPhase()},a)};Qva.Mgr.listbox.prototype.NextPhase=function(){this.CurrentPhase=(this.CurrentPhase+1)%3;this._IndicateCellsToSelect();this.phase_timout=null;this.StartPhaseShift(1100)};Qva.Mgr.listbox.prototype.EndPhaseShift=function(){if(this.phase_timout){clearTimeout(this.phase_timout);this.phase_timout=null}};Qva.Mgr.listbox.MouseDown=function(a){if(this.disabled){return}if(!a){a=window.event}var b=this.parentNode.parentNode.Mgr;if(a.button!=b.LeftButton){return}if(!b.PageBinder.GetEnabled()){return}if(Qva.Mgr.listbox.SelectMgr!=null&&Qva.Mgr.listbox.SelectMgr!=b){return}Qva.Mgr.listbox.SelectMgr=b;b.Selections.Start=b.Selections.End=this.offset;b.Selections.SelectSource=this.selectsource;b.Selections.mouseDown=true;document.onkeydown=Qva.Mgr.listbox.KeyChange;document.onkeyup=Qva.Mgr.listbox.KeyChange;document.body.onmousemove=Qva.Mgr.listbox.MouseMove_Document;Qva.addEvent(document.body,"mouseup",Qva.Mgr.listbox.MouseUp);b.Selections.ctrl=!b.OnlyoneSelected&&ctrlKeyPressed(a);b._IndicateCellsToSelect();if(b.andmode){b.StartPhaseShift(2500)}};Qva.Mgr.listbox.MouseMove_Document=function(d){if(!d){d=window.event}var f=Qva.Mgr.listbox.SelectMgr;if(!f){return}if(!f.Selections.mouseDown){return}if(!f.has_any_scrollbar){return}if(f.Selections.scrollTime&&new Date().getTime()-f.Selections.scrollTime<400){return}var b=f.visible_cols<f.columns;var a=f.visible_rows<f.rows;var c=Qva.GetOffsets(d,f.Element);if(b&&c.offsetX<0){if(f.Selections.End>=f.rows){f.Selections.End-=f.rows;f.XScroll.Scroll(-1);f.Selections.scrollTime=new Date().getTime()}}else{if(b&&c.offsetX>f.Element.offsetWidth){if(f.Selections.End<f.columns*f.rows-f.rows){if(f.Selections.End<f.TotalSize-f.rows){f.Selections.End+=f.rows}f.XScroll.Scroll(1);f.Selections.scrollTime=new Date().getTime()}}else{if(a&&c.offsetY<0){if(f.Selections.End>=f.columns){f.Selections.End-=f.columns;f.YScroll.Scroll(-1);f.Selections.scrollTime=new Date().getTime()}}else{if(a&&c.offsetY>f.Element.offsetHeight){if(f.Selections.End<f.columns*f.rows-f.columns){if(f.Selections.End<f.TotalSize-f.columns){f.Selections.End+=f.columns}f.YScroll.Scroll(1);f.Selections.scrollTime=new Date().getTime()}}}}}};Qva.Mgr.listbox.MouseMove=function(a){if(this.disabled){return}if(!a){a=window.event}var b=this.parentNode.parentNode.Mgr;if(Qva.Mgr.listbox.SelectMgr!=b){return}if(!b.PageBinder.GetEnabled()){return}if(!b.Selections.mouseDown){return}b.Selections.End=this.offset;if(b.singleselect){b.Selections.Start=b.Selections.End}b.Selections.ctrl=!b.OnlyoneSelected&&ctrlKeyPressed(a);b._IndicateCellsToSelect()};Qva.Mgr.listbox.MouseUp=function(a){Qva.removeEvent(document.body,"mouseup",Qva.Mgr.listbox.MouseUp);if(!a){a=window.event}var b=Qva.Mgr.listbox.SelectMgr;b.Selections.ctrl=!b.OnlyoneSelected&&ctrlKeyPressed(a);b.Selections.mouseDown=false;b._SaveCurrentSelection();if(b.Selections.ctrl){return}b._EndSelect(false)};Qva.Mgr.listbox.KeyChange=function(a){if(!a){a=window.event}var c=Qva.Mgr.listbox.SelectMgr;if(c.OnlyoneSelected){return}var b=ctrlKeyPressed(a);if(c.Selections.ctrl==b){return}if(b||c.Selections.mouseDown){c.Selections.ctrl=b;c._IndicateCellsToSelect()}else{c._EndSelect(true)}};Qva.Mgr.listbox.prototype._Select=function(d){var f=Math.min(this.Selections.Start,this.Selections.End);var b=Math.max(this.Selections.Start,this.Selections.End);var a=(this.Selections.mouseDown&&f<=d&&d<=b)||false;var c=this.Selections.Selected[d]||false;return a!==c};Qva.Mgr.listbox.prototype._SaveCurrentSelection=function(){var c=Math.min(this.Selections.Start,this.Selections.End);var a=Math.max(this.Selections.Start,this.Selections.End);for(var b=c;b<=a;++b){if(this.Selections.Selected[b]){delete this.Selections.Selected[b]}else{this.Selections.Selected[b]=true}}};Qva.Mgr.listbox.prototype._EndSelect=function(a){document.onkeydown=null;document.onkeyup=null;document.body.onmousemove=null;Qva.Mgr.listbox.SelectMgr=null;var b="";for(var f in this.Selections.Selected){if(isNaN(f)){continue}var d=this.Lines[f].intval;if(isNaN(d)){continue}if(b!=""){b+=","}b+=d}this.Selections={Selected:[]};if(b!=""){var c={};c.select=b;c.toggle=a?"true":"false";if(this.andmode){c.phase=this.CurrentPhase}this.PageBinder.Set(this.ObjectId,c)}else{if(!a){this.PageBinder.Set(this.ObjectId+".CD","action","",true)}}if(this.andmode){this.EndPhaseShift()}this.CurrentPhase=0};Qva.Mgr.listbox.prototype._IndicateCellsToSelect=function(){var a=this.Selections.ctrl||this.AutoCtrl;if(this.ObjectId!=Qva.SearchableObject){SetSearchableAndActives(this.ObjectId,[this.ObjectId])}for(var f=this.Visible.Start;f<=this.Visible.End;++f){var k=this._Select(f);var g=this.Lines[f].state=="Selected";var b=this.Lines[f].state=="Deselected";var h=this.Lines[f].state=="Excluded";var j=this.Lines[f].state=="Optional";var c=this.Lines[f].state=="SelectedExcluded";var i;if(k){if(this.andmode){switch(this.CurrentPhase){case 0:if(a&&(g||b)){i=this.EnabledClassName}else{if(a&&h){i=this.DeselectedClassName}else{i=this.SelectedClassName}}break;case 1:if(a&&(b||h)){i=this.SelectedClassName}else{if(b){i=this.EnabledClassName}else{i=this.DeselectedClassName}}break;case 2:i="Qv"+this.Lines[f].state;break;default:Assert(false);break}}else{if(a&&(g||b)){i=this.EnabledClassName}else{if(this.HasSelectedExcluded&&a&&c){i=this.DisabledClassName}else{i=this.SelectedClassName}}}}else{if(!a&&(g||b)){i=this.EnabledClassName}else{i="Qv"+this.Lines[f].state}}if(this.Painted[f].AndModeSymbol){var d=Qva.Mgr.listbox.AndModeSymbol(i.substr(2));this.Painted[f].AndModeSymbol.innerText=d}this.Painted[f].className=i+this.AltClass;if(this.AltClass_OnBorder){this.Painted[f].firstChild.className=i+this.AltClass}}};Qva.Mgr.listbox.prototype._CombineColors=function(b,a){if(b.A===0&&a.A===0){return"Transparent"}if(b.A===0){return a.css}if(a.A===0){return b.css}if(b.R+b.G+b.B>a.R+a.G+a.B){return a.css}return b.css};Qva.Mgr.listbox.prototype._CombineBorders=function(c,b){var f=Math.max(c.width,b.width);var a=this._CombineColors(c.color,b.color);var d=c.style==="double"||b.style==="double"?"double":c.style==="solid"||b.style==="solid"?"solid":"none";return{width:f,color:a,style:d}};Qva.Mgr.listbox.prototype._MakeBorder=function(j,h,a,i){var g=this.BorderStyle[this.Style[0].BorderStyle][h];var b=this.BorderStyle[this.Style[0].BorderStyle][a];var d=this._CombineBorders(g,b);if(d.style==="solid"){var c=i(d.width);j.style["border"+h]="solid "+c+"px "+d.color;return c}else{if(d.style==="double"){j.style["border"+h]="solid 3px "+d.color;return i(9)}else{Assert(d.style==="none");return 0}}};Qva.Mgr.listbox.prototype._StyleObject=function(c){var d=c.getAttribute("bgcolor");this.BgColorRGB=HtmlifyARGB(d);this.BgColorCSSExpr=Qva.Hex2CSSExpression(d);this.Color=HtmlifyARGB(c.getAttribute("color"));this.NumAdjust=c.getAttribute("numadjust");this.TextAdjust=c.getAttribute("textadjust");this.BorderStyle=c.getAttribute("borderstyle");var a=c.getAttribute("fontstyle");this.FontStyle=a;this.FontWeight=c.getAttribute("fontweight");this.TextDecoration=c.getAttribute("textdecoration");this.SizeMod=c.getAttribute("sizemod");var b=c.getAttribute("stretchmode");if(b){this.StretchMode=b}};Qva.Mgr.listbox.prototype._BorderStyleObject=function(b){function a(d){var c=b.getAttribute(d).split(" ");if(c[0]==="none"){return{width:0,style:"none",color:ObjectifyARGB(null)}}var f=parseInt(c[1]);return{width:f,style:c[0],color:ObjectifyARGB(c[2])}}this.Top=a("top");this.Right=a("right");this.Bottom=a("bottom");this.Left=a("left")};Qva.Mgr.listbox.prototype._CellObject=function(f){this.val=this.title=f.getAttribute("title")||f.getAttribute("text");this.intval=f.getAttribute("value");this.selected=f.getAttribute("selected")=="yes";this.level=parseInt(f.getAttribute("level"));if(!isNaN(this.level)){++this.level}this.parts=f.getElementsByTagName("range");if(f.getAttribute("state")){this.state=f.getAttribute("state")}this.isnum=f.getAttribute("isnum")=="true";var c=this.icons=f.getElementsByTagName("icon");for(var b=0;b<c.length;++b){var d=c[b];var a=d.getAttribute("name");if(d.getAttribute("sendsize")==="true"){this.main_icon=d}else{if(a=="EXC"||a=="COC"){this.expandcollapse_icon=d}else{if(a=="LED"){this.led_icon=d}else{if(a=="IC"){this.input_icon=d}}}}}this.icons=[];this.subcontent=f.getElementsByTagName("subcontent");this.selecttype=f.getAttribute("selecttype");var g=f.getAttribute("rowspan");if(g){this.rowspan=parseInt(g)}else{this.rowspan=1}};Qva.Mgr.listbox.prototype._SetCellStyle=function(d,a,c){var b=this.Style[0];if(!b){return""}var f="";if(c){if(b.BgColorCSSExpr){f+="; background-color:"+b.BgColorCSSExpr}else{if(b.BgColorRGB){f+="; background-color:"+b.BgColorRGB}}f+="; color:"+b.BgColorRGB}else{if(!a){if(b.BgColorCSSExpr){f+="; background-color:"+b.BgColorCSSExpr}else{if(b.BgColorRGB){f+="; background-color:"+b.BgColorRGB}}f+="; color:"+b.Color}else{f+="; background-color:";f+="; color:"}}f+="; text-align:"+(d.label?b.LabelAdjust:(d.isnum?b.NumAdjust:b.TextAdjust));f+="; font-style:"+b.FontStyle;f+="; font-weight:"+b.FontWeight;f+="; text-decoration:"+b.TextDecoration;switch(b.SizeMod){case"2":f+="; font-size:large";break;case"1":f+="; font-size:larger";break;case"-1":f+="; font-size:smaller";break;case"-2":f+="; font-size:small";break}return f};Qva.LoadDefaultStyles=function(){var h=Qva.QvStyles={};for(var a=0;a<document.styleSheets.length;a++){var g;try{g=document.styleSheets[a].rules?document.styleSheets[a].rules:document.styleSheets[a].cssRules}catch(f){continue}if(!g){continue}var d={};for(var c=0;c<g.length;c++){var b=g[c];switch(b.selectorText){case".QvSelected":d.QvSelected=b;break;case".QvExcluded":d.QvExcluded=b;break;case".QvOptional":d.QvOptional=b;break;case".QvLocked":d.QvLocked=b;break;case".QvDeselected":d.QvDeselected=b;break;case".QvAlternative":d.QvAlternative=b;break;case".QvSelectedExcluded":d.QvSelectedExcluded=b;break;case".QvLockedExcluded":d.QvLockedExcluded=b;break}}if(d.QvSelected){h.stylesheet=document.styleSheets[a];h["default"]=d;h.alt={QvSelected:{style:{color:"#363636",backgroundColor:"#00ff00"}},QvExcluded:{style:{color:"#a4a4a4",backgroundColor:"#a4a4a4"}},QvOptional:{style:{color:"#363636",backgroundColor:"#ffffff"}},QvLocked:{style:{color:"#363636",backgroundColor:"#000080"}},QvDeselected:{style:{color:"#363636",backgroundColor:"#ff0000"}},QvAlternative:{style:{color:"#363636",backgroundColor:"#ffffff"}},QvSelectedExcluded:{style:{color:"#a4a4a4",backgroundColor:"#a4a4a4"}},QvLockedExcluded:{style:{color:"#a4a4a4",backgroundColor:"#a4a4a4"}}}}}};function addRule(c,a){if(c.addRule){c.addRule(a,"dummy: none;");return c.rules[c.rules.length-1]}else{var b=c.insertRule(a+" { }",c.cssRules.length);return c.cssRules[b]}}Qva.PageBinding.prototype.LoadLedStyle=function(c){if(!Qva.QvStyles){Qva.LoadDefaultStyles()}if(Qva.QvStyles["Led_"+c]){return}Qva.QvStyles["Led_"+c]=true;var b=["Locked","Selected","Optional","Deselected","Alternative","Excluded","SelectedExcluded","LockedExcluded"];var a={SelectedExcluded:true,Excluded:true,LockedExcluded:true};for(var f=0;f<b.length;++f){var h=b[f];var j=Qva.QvStyles.alt["Qv"+h];var g=addRule(Qva.QvStyles.stylesheet,".Qv"+h+"_Led_"+c);if(!IS_IE&&a[h]){g.style.color=Qva.Hex2RGBA("#96"+c)}else{g.style.color="#"+c}var d=this.BuildBinaryUrl(null,null,"LED",j.style.backgroundColor);g.style.backgroundImage="url("+d+")";g.style.backgroundRepeat="no-repeat";g.style.backgroundPosition="3px center"}};Qva.PageBinding.prototype.LoadLedCheckStyle=function(f){if(!Qva.QvStyles){Qva.LoadDefaultStyles()}if(Qva.QvStyles["LED_CHECK_"+f]){return}Qva.QvStyles["LED_CHECK_"+f]=true;var d={Selected:true,SelectedExcluded:true,Locked:true,LockedExcluded:true};var k=["Locked","Selected","Optional","Deselected","Alternative","Excluded","SelectedExcluded","LockedExcluded"];var h={SelectedExcluded:true,Excluded:true,LockedExcluded:true};for(var g=0;g<k.length;++g){var b=k[g];var j=Qva.QvStyles.alt["Qv"+b];var c=addRule(Qva.QvStyles.stylesheet,".Qv"+b+"_LED_CHECK_"+f);if(!IS_IE&&h[b]){c.style.color=Qva.Hex2RGBA("#96"+f)}else{c.style.color="#"+f}var a=this.BuildBinaryUrl(null,null,"LED",j.style.backgroundColor);if(d[b]){a+="&check=true"}c.style.backgroundImage="url("+a+")";c.style.backgroundRepeat="no-repeat";c.style.backgroundPosition="3px center"}};Qva.PageBinding.prototype.LoadCornertagStyle=function(k,d){if(!Qva.QvStyles){Qva.LoadDefaultStyles()}if(Qva.QvStyles["CORNERTAG_"+k+"_"+d]){return}Qva.QvStyles["CORNERTAG_"+k+"_"+d]=true;var j=["Locked","Selected","Optional","Deselected","Alternative","Excluded","SelectedExcluded","LockedExcluded"];var g={SelectedExcluded:true,Excluded:true,LockedExcluded:true};for(var f=0;f<j.length;++f){var b=j[f];var h=Qva.QvStyles.alt["Qv"+b];var c=addRule(Qva.QvStyles.stylesheet,".Qv"+b+"_CORNERTAG_"+k+"_"+d);if(!IS_IE&&g[b]){c.style.color=Qva.Hex2RGBA("#96"+d)}else{c.style.color="#"+d}var a=this.BuildBinaryUrl(null,null,"CORNERTAG",h.style.backgroundColor)+"&width="+k+"&height="+k;c.style.backgroundImage="url("+a+")";c.style.backgroundRepeat="no-repeat"}};Qva.PageBinding.prototype.LoadCheckStyle=function(c){if(!Qva.QvStyles){Qva.LoadDefaultStyles()}if(Qva.QvStyles["CHECK_"+c]){return}Qva.QvStyles["CHECK_"+c]=true;var b=["Locked","Selected","Optional","Deselected","Alternative","Excluded","SelectedExcluded","LockedExcluded"];var a={SelectedExcluded:true,Excluded:true,LockedExcluded:true};for(var f=0;f<b.length;++f){var h=b[f];var j=Qva.QvStyles.alt["Qv"+h];var g=addRule(Qva.QvStyles.stylesheet,".Qv"+h+"_CHECK_"+c);if(!IS_IE&&a[h]){g.style.color=Qva.Hex2RGBA("#96"+c)}else{g.style.color="#"+c}var d=this.BuildBinaryUrl(null,null,"CHECK",null)+"&width=16&height=16&state="+f;g.style.backgroundImage="url("+d+")";g.style.backgroundRepeat="no-repeat";g.style.backgroundPosition="1px center"}};Qva.PageBinding.prototype.LoadRadioStyle=function(c){if(!Qva.QvStyles){Qva.LoadDefaultStyles()}if(Qva.QvStyles["RADIO_"+c]){return}Qva.QvStyles["RADIO_"+c]=true;var b=["Locked","Selected","Optional","Deselected","Alternative","Excluded","SelectedExcluded","LockedExcluded"];var a={SelectedExcluded:true,Excluded:true,LockedExcluded:true};for(var f=0;f<b.length;++f){var h=b[f];var j=Qva.QvStyles.alt["Qv"+h];var g=addRule(Qva.QvStyles.stylesheet,".Qv"+h+"_RADIO_"+c);if(!IS_IE&&a[h]){g.style.color=Qva.Hex2RGBA("#96"+c)}else{g.style.color="#"+c}var d=this.BuildBinaryUrl(null,null,"CHECK",null)+"&width=16&height=16&radio=true&state="+f;g.style.backgroundImage="url("+d+")";g.style.backgroundRepeat="no-repeat";g.style.backgroundPosition="1px center"}};if(!Qva.DragDrop){Qva.DragDrop=new Object({mouseOffset:null,DropTargets:[],DropFrames:[],DropDefault:null,curDrag:null,dragHelper:null,curDrop:null,dragType:null,DragStarted:null})}Qva.DragDrop.GetDropTarget=function(a,d,b){if(!d){d=Qva.DragDrop.curDrag.Type}if(b){var f=b.split(".");if(f.length>=2){b=f[0]+"."+f[1]}}for(var c=0;c<Qva.DragDrop.DropTargets.length;++c){var h=Qva.DragDrop.DropTargets[c].Inside(a,d);if(h){return h}}for(var c=0;c<Qva.DragDrop.DropFrames.length;++c){var g=Qva.DragDrop.DropFrames[c];if(b&&g.Name==b){continue}var h=g.Inside(a,d);if(h){return h}}if(Qva.DragDrop.DropDefault){return Qva.DragDrop.DropDefault.Inside(a,d)}return null};Qva.DragDrop.Inside=function(c,b){try{var f=Qva.GetPageCoords(c);var d=parseInt(c.offsetWidth);var a=parseInt(c.offsetHeight);return(b.x>f.x&&b.x<f.x+d&&b.y>f.y&&b.y<f.y+a)}catch(g){return false}};Qva.DragDrop.mouseMove=function(b){b=b||window.event;if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}if(!Qva.DragDrop.curDrag){Assert(false)}var p=new Date();if(p.getTime()-Qva.MouseDownStartTime<200){return}var s={x:b.clientX,y:b.clientY};var m=Qva.DragDrop.dragElement;if(!Qva.DragDrop.DragStarted){Qva.DragDrop.DragStarted=true;while(Qva.DragDrop.dragHelper.firstChild){Qva.DragDrop.dragHelper.removeChild(Qva.DragDrop.dragHelper.firstChild)}if(Qva.DragDrop.dragType=="cell"){Qva.DragDrop.dragHelper.appendChild(m.cloneNode(true));Qva.DragDrop.dragHelper.className="QvDragRect";Qva.DragDrop.dragHelper.style.display="block";Qva.DragDrop.dragHelper.firstChild.dragObj=null}else{var r=m.cloneNode(true);var k=m.getElementsByTagName("select");if(k.length>0){var t=r.getElementsByTagName("select");for(var j=0;j<k.length;j++){t[j].selectedIndex=k[j].selectedIndex}}var q=r.getElementsByTagName("span");for(var j=0;j<q.length;j++){q[j].style.cursor="inherit"}var f=m;while(f&&f.nodeName!="TABLE"){f=f.parentNode}if(f){var l=f.firstChild;while(l&&l.nodeName!="COLGROUP"){l=l.nextSibling}}var c=document.createElement("tbody");var o=document.createElement("table");o.style.width=parseInt(m.offsetWidth)+"px";o.style.height=parseInt(m.offsetHeight)+"px";o.style.tableLayout="fixed";c.appendChild(r);if(l){o.appendChild(l.cloneNode(true))}o.appendChild(c);Qva.DragDrop.dragHelper.appendChild(o);Qva.DragDrop.dragHelper.className="QvDragRect";Qva.DragDrop.dragHelper.style.display="block";Qva.DragDrop.dragHelper.style.fontFamily="arial";Qva.DragDrop.dragHelper.style.fontSize="10pt";r.dragObj=null}}Qva.DragDrop.dragHelper.style.top=s.y-Qva.DragDrop.mouseOffset.y+"px";Qva.DragDrop.dragHelper.style.left=s.x-Qva.DragDrop.mouseOffset.x+"px";var g=Qva.DragDrop.GetDropTarget(s);if(Qva.DragDrop.curDrop!=g){if(Qva.DragDrop.curDrop&&Qva.DragDrop.curDrop.Element){for(var h=Qva.DragDrop.curDrop.Element.firstChild;h!=null;h=h.nextSibling){if(h.nodeName=="TD"){h.className="";h.style.backgroundImage=""}}}Qva.DragDrop.curDrop=g;Qva.DragDrop.dragHelper.style.cursor="pointer";if(Qva.DragDrop.curDrop){Qva.DragDrop.dragHelper.style.cursor="";var a=Qva.GetBinder(this.BinderId).BuildBinaryUrl(null,null,"dropinsert");if(Qva.DragDrop.curDrop.VerticalPosition=="insertafter"){var n="DropTarget-Bottom"}else{if(Qva.DragDrop.curDrop.VerticalPosition=="insertbefore"){var n="DropTarget-Top"}else{var n="DropTarget-Open"}}if(Qva.DragDrop.curDrop.Element){for(var h=Qva.DragDrop.curDrop.Element.firstChild;h!=null;h=h.nextSibling){if(h.nodeName=="TD"){h.className=n;h.style.backgroundImage="url("+a+")"}}}else{Qva.DragDrop.dragHelper.style.cursor="not-allowed"}}}if(!Qva.DragDrop.curDrop){if(Qva.DragDrop.dragType=="row"){Qva.DragDrop.dragHelper.style.cursor="not-allowed"}}return false};Qva.DragDrop.mouseUp=function(d){if(Qva.DragDrop.curDrag){Qva.DragDrop.dragHelper.style.display="none";if(Qva.DragDrop.curDrop){if(Qva.DragDrop.curDrop.Element){for(var c=Qva.DragDrop.curDrop.Element.firstChild;c!=null;c=c.nextSibling){if(c.nodeName!="TD"){continue}c.className="";c.style.backgroundImage=""}var b=Qva.GetBinder(Qva.DragDrop.curDrop.Element.BinderId);if(b.Enabled){var h=Qva.DragDrop.curDrop.Element;if(typeof(h)!="string"){h=h.TargetName||h.ObjectId||h.Name}if(Qva.DragDrop.curDrop.VerticalPosition){b.Set(Qva.DragDrop.curDrag.Name,Qva.DragDrop.curDrop.VerticalPosition,h,true)}else{d=d||window.event;var a={x:d.clientX,y:d.clientY};var f=a.y-Qva.DragDrop.mouseOffset.y-document.getElementById("PageContainer").offsetTop;var g=a.x-Qva.DragDrop.mouseOffset.x;h={target:h,x:g,y:f,drop:Qva.DragDrop.curDrag.Value};b.Set(Qva.DragDrop.curDrag.Name,h)}}}}else{if(Qva.DragDrop.curDrag.DropAt){d=d||window.event;var a={x:d.clientX,y:d.clientY};if(!Qva.DragDrop.Inside(Qva.DragDrop.dragElement,a)){var f=a.y-Qva.DragDrop.mouseOffset.y-document.getElementById("PageContainer").offsetTop;var g=a.x-Qva.DragDrop.mouseOffset.x;var b=Qva.GetBinder(Qva.DragDrop.curDrag.BinderId);if(b.Enabled){b.Set(Qva.DragDrop.curDrag.Name,{target:"Document.ActiveSheet",x:g,y:f,drop:Qva.DragDrop.curDrag.Value})}}}}}else{if(Qva.DragDrop.curDrop){Assert(false)}}Qva.DragDrop.curDrop=null;Qva.DragDrop.curDrag=null;Qva.DragDrop.DragStarted=null;Qva.removeEvent(document,"mousemove",Qva.DragDrop.mouseMove);Qva.removeEvent(document,"mouseup",Qva.DragDrop.mouseUp);Qva.Select.Active=true};Qva.DragDrop.mouseDown=function(f){f=f||window.event;var h=f.target||f.srcElement;var c=h.nodeName.toUpperCase();if(h.disabled||c==="INPUT"||c==="SELECT"||c==="TEXTAREA"){return}if(f.preventDefault){f.preventDefault()}else{f.returnValue=false}var g=h.dragObj;if(g){Qva.DragDrop.dragType="cell";Qva.DragDrop.dragElement=h}else{while(h&&h.nodeName!="TR"){h=h.parentNode}if(h){var g=h.dragObj;if(g){Qva.DragDrop.dragType="row";Qva.DragDrop.dragElement=h}}}Qva.DragDrop.curDrag=g;Qva.DragDrop.DragStarted=null;if(g){var a={x:f.clientX,y:f.clientY};var b=Qva.GetPageCoords(h);Qva.DragDrop.mouseOffset={x:a.x-Qva.GetScrollLeft()-b.x,y:a.y-Qva.GetScrollTop()-b.y};Qva.Select.Active=false;Qva.addEvent(document,"mousemove",Qva.DragDrop.mouseMove);Qva.addEvent(document,"mouseup",Qva.DragDrop.mouseUp);var i=new Date();Qva.MouseDownStartTime=i.getTime()}return false};Qva.DragDrop.Init=function(){Qva.DragDrop.dragHelper=document.createElement("DIV");Qva.DragDrop.dragHelper.style.cssText="position:absolute; display:none;";Qva.DragDrop.dragHelper.style.zIndex=666;document.body.appendChild(Qva.DragDrop.dragHelper)};var old_QvaStart=Qva.Start;Qva.Start=function(){old_QvaStart();Qva.DragDrop.Init()};Qva.Select={};Qva.Select.Active=true;Qva.Select.mouseDown=function(b){if(!Qva.Select.Active){return}b=b||window.event;var c=b.target||b.srcElement;var a=c.disabled||(c.nodeName!="HTML"&&c.nodeName!="INPUT"&&c.nodeName!="SELECT"&&c.nodeName!="TEXTAREA");if(a){if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}Qva.addEvent(document,"mousemove",Qva.Select.mouseMove);Qva.addEvent(document,"mouseup",Qva.Select.mouseUp);return false}};Qva.Select.mouseMove=function(a){a=a||window.event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};Qva.Select.mouseUp=function(a){Qva.removeEvent(document,"mousemove",Qva.Select.mouseMove);Qva.removeEvent(document,"mouseup",Qva.Select.mouseUp)};document.onmousedown=Qva.Select.mouseDown;Qva.Move={};Qva.Move.mouseDown=function(b){if(!b){b=window.event}var c=b.target||b.srcElement;var a=c.disabled||(c.nodeName!="INPUT"&&c.nodeName!="SELECT");if(a){if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}if(!c.moveObj){while(!c.moveObj){c=c.parentNode}}if(c.moveObj){Qva.Move.old_cursor=document.body.style.cursor;document.body.style.cursor="move";Qva.Move.moveElement=c;Qva.Move.MoveStarted=null;Qva.Move.StartX=b.clientX+Qva.GetScrollLeft();Qva.Move.StartY=b.clientY+Qva.GetScrollTop();Qva.Select.Active=false;Qva.addEvent(document,"mousemove",Qva.Move.mouseMove);Qva.addEvent(document,"mouseup",Qva.Move.mouseUp);var f=new Date();Qva.MouseDownStartTime=f.getTime();Qva.MouseDown2=true}return false}};Qva.Move.mouseMove=function(h){if(!Qva.MouseDown2){return}if(!Qva.Move.moveElement){Assert(false)}if(!h){h=window.event;h.returnValue=false}else{h.preventDefault()}var k=new Date();if(k.getTime()-Qva.MouseDownStartTime<200){return}if(!Qva.Move.MoveStarted){Qva.Move.MoveStarted=true;var b=Qva.Move.moveElement.moveObj.split(":");Qva.Move.curMove=[];for(var g=0;g<b.length;g++){var f=(b[g]!="*")?document.getElementById(b[g]):Qva.Move.moveElement;Qva.Move.curMove[g]={Element:f,StartLeft:f.offsetLeft,StartTop:f.offsetTop,ClassName:f.className};f.className+=" QvMoveRect";f.style.zIndex=666}}var c=h.clientX+Qva.GetScrollLeft()-Qva.Move.StartX;var a=h.clientY+Qva.GetScrollTop()-Qva.Move.StartY;for(var g=0;g<Qva.Move.curMove.length;g++){var j=Qva.Move.curMove[g].StartLeft+c;if(!isNaN(Qva.Move.moveElement.xMax)){j=Math.min(j,Qva.Move.moveElement.xMax)}if(!isNaN(Qva.Move.moveElement.xMin)){j=Math.max(j,Qva.Move.moveElement.xMin)}if(!Qva.Move.moveElement.xOnly){Qva.Move.curMove[g].Element.style.top=Qva.Move.curMove[g].StartTop+a+"px"}Qva.Move.curMove[g].Element.style.left=j+"px"}return false};Qva.Move.mouseUp=function(a){a=a||window.event;Qva.MouseDown2=false;if(Qva.Move.MoveStarted){var j={x:a.clientX,y:a.clientY};var b=Qva.DragDrop.GetDropTarget(j,"Object",Qva.Move.moveElement.Name);var k=Qva.GetBinder(Qva.Move.moveElement.binderid);if(b&&b.Element&&b.Element.Name){k.Set(b.Element.Name,{drop:Qva.Move.moveElement.Name,cursor:a.clientX+":"+a.clientY});for(var f=0;f<Qva.Move.curMove.length;f++){Qva.Move.curMove[f].Element.style.left=Qva.Move.curMove[f].StartLeft+"px";Qva.Move.curMove[f].Element.style.top=Qva.Move.curMove[f].StartTop+"px"}}else{var d=a.clientX+Qva.GetScrollLeft()-Qva.Move.StartX;var c=a.clientY+Qva.GetScrollTop()-Qva.Move.StartY;var g=Qva.Move.curMove[0].StartTop+c;var h=Qva.Move.curMove[0].StartLeft+d;if(Qva.Move.moveElement.xOnly){h-=Qva.Move.moveElement.xMin;h/=(Qva.Move.moveElement.xMax-Qva.Move.moveElement.xMin);k.Set(Qva.Move.moveElement.Name,"value",Math.round(h*255),true)}else{k.Set(Qva.Move.moveElement.Name,{moveto:h+":"+g,cursor:a.clientX+":"+a.clientY})}}for(var f=0;f<Qva.Move.curMove.length;f++){Qva.Move.curMove[f].Element.className=Qva.Move.curMove[f].ClassName}Qva.Move.curMove=null;Qva.Move.moveElement=null;Qva.Move.MoveStarted=null}document.body.style.cursor=Qva.Move.old_cursor;Qva.removeEvent(document,"mousemove",Qva.Move.mouseMove);Qva.removeEvent(document,"mouseup",Qva.Move.mouseUp);Qva.Select.Active=true};Qva.Resize={};Qva.Resize.mouseDown=function(b,d){if(!b){b=window.event;b.returnValue=false}else{b.preventDefault()}b.cancelBubble=true;var c=b.target||b.srcElement;var a=Qva.GetPageCoords(d);Qva.Resize.ResizeType=c.ResizeType;Qva.Resize.Frame=d;Qva.Resize.StartX=b.clientX+Qva.GetScrollLeft();Qva.Resize.StartY=b.clientY+Qva.GetScrollTop();Qva.Resize.StartLeft=Qva.GetScrollLeft()+a.x-1;Qva.Resize.StartTop=Qva.GetScrollTop()+a.y-1;Qva.Resize.StartH=d.offsetHeight;Qva.Resize.StartW=d.offsetWidth;if(!Qva.Resize.SizeRect){Qva.Resize.SizeRect=document.createElement("div");Qva.Resize.SizeRect.className="QvSizeRect";Qva.Resize.SizeRect.style.display="";document.body.insertBefore(Qva.Resize.SizeRect,document.body.firstChild)}else{Qva.Resize.SizeRect.style.display=""}Qva.Resize.SizeRect.style.left=this.StartLeft+"px";Qva.Resize.SizeRect.style.top=this.StartTop+"px";Qva.Resize.SizeRect.style.width=this.StartW+"px";Qva.Resize.SizeRect.style.height=this.StartH+"px";Qva.Resize.SizeRect.X=null;Qva.Resize.SizeRect.Y=null;Qva.Resize.SizeRect.W=null;Qva.Resize.SizeRect.H=null;Qva.Resize.old_cursor=document.body.style.cursor;document.body.style.cursor=c.style.cursor;Qva.Select.Active=false;Qva.addEvent(document,"mousemove",Qva.Resize.mouseMove);Qva.addEvent(document,"mouseup",Qva.Resize.mouseUp)};Qva.Resize.mouseMove=function(d){var b=20;if(!Qva.Resize.SizeRect){return}if(!d){d=window.event;d.returnValue=false}else{d.preventDefault()}var c=d.clientX+Qva.GetScrollLeft()-Qva.Resize.StartX;var a=d.clientY+Qva.GetScrollTop()-Qva.Resize.StartY;if(Qva.Resize.ResizeType.indexOf("t")!=-1){Qva.Resize.SizeRect.Y=Math.max(b,Qva.Resize.StartTop+a);Qva.Resize.SizeRect.H=Math.max(b,Qva.Resize.StartH-a)}if(Qva.Resize.ResizeType.indexOf("b")!=-1){Qva.Resize.SizeRect.H=Math.max(b,Qva.Resize.StartH+a)}if(Qva.Resize.ResizeType.indexOf("l")!=-1){Qva.Resize.SizeRect.X=Math.max(b,Qva.Resize.StartLeft+c);Qva.Resize.SizeRect.W=Math.max(b,Qva.Resize.StartW-c)}if(Qva.Resize.ResizeType.indexOf("r")!=-1){Qva.Resize.SizeRect.W=Math.max(b,Qva.Resize.StartW+c)}if(Qva.Resize.SizeRect.Y){Qva.Resize.SizeRect.style.top=Qva.Resize.SizeRect.Y+"px"}if(Qva.Resize.SizeRect.X){Qva.Resize.SizeRect.style.left=Qva.Resize.SizeRect.X+"px"}if(Qva.Resize.SizeRect.W){Qva.Resize.SizeRect.style.width=Qva.Resize.SizeRect.W+"px"}if(Qva.Resize.SizeRect.H){Qva.Resize.SizeRect.style.height=Qva.Resize.SizeRect.H+"px"}};Qva.Resize.mouseUp=function(f){document.body.style.cursor=Qva.Resize.old_cursor;var d=Qva.Resize.ResizeType;var c=(Qva.Resize.SizeRect.W?Qva.Resize.SizeRect.W:Qva.Resize.StartW);var a=(Qva.Resize.SizeRect.H?Qva.Resize.SizeRect.H:Qva.Resize.StartH);var g=Qva.Resize.Frame.AvqMgr;if(g){g.Set(Qva.Resize.Frame.ObjectId,"resize",d+":"+c+":"+a,true)}else{var b=Qva.GetBinder(Qva.Resize.Frame.binderid);b.Set(Qva.Resize.Frame.Name,"resize",d+":"+c+":"+a,true)}Qva.Resize.SizeRect.style.display="none";Qva.Resize.Frame=null;Qva.removeEvent(document,"mousemove",Qva.Resize.mouseMove);Qva.removeEvent(document,"mouseup",Qva.Resize.mouseUp);Qva.Select.Active=true};Qva.DragDrop.resizeColumn={colIndex:null,frame:null,oldCursor:null,resizeRect:null,startDragX:0,widthOuter:0,mouseDown:function(d){if(!d){d=window.event;d.returnValue=false}else{d.preventDefault()}d.cancelBubble=true;var f=d.target||d.srcElement;this.oldCursor=document.body.style.cursor;document.body.style.cursor="w-resize";var h=Qva.GetPageCoords(f.parentNode);this.frame=f.parentNode;this.colIndex=f.columnData.colIndex;this.startDragX=d.clientX+Qva.GetScrollLeft();this.widthOuter=f.columnData.widthOuter;if(this.resizeRect===null){this.resizeRect=document.createElement("div");this.resizeRect.className="QvSizeRect";this.resizeRect.style.display="";document.body.insertBefore(this.resizeRect,document.body.firstChild)}else{this.resizeRect.style.visibility="visible"}var b=h.x+f.columnData.outerLeftCoordinate;var a=b+f.columnData.widthOuter;var g=Math.max(h.x,b);var c=a-g;this.resizeRect.style.left=g+"px";this.resizeRect.style.top=Qva.GetPageCoords(f).y+"px";this.resizeRect.style.height=f.style.height;this.resizeRect.style.width=c+"px";this.resizeRect.startWidth=c;this.resizeRect.delta=0;Qva.addEvent(document,"mousemove",this.mouseMove);Qva.addEvent(document,"mouseup",this.mouseUp)},mouseMove:function(b){if(!Qva.DragDrop.resizeColumn.resizeRect){return}if(!b){b=window.event;b.returnValue=false}else{b.preventDefault()}Qva.DragDrop.resizeColumn.resizeRect.delta=b.clientX+Qva.GetScrollLeft()-Qva.DragDrop.resizeColumn.startDragX;var a=Math.max(10,Qva.DragDrop.resizeColumn.resizeRect.startWidth+Qva.DragDrop.resizeColumn.resizeRect.delta);Qva.DragDrop.resizeColumn.resizeRect.style.width=a+"px"},mouseUp:function(c){var a=Qva.DragDrop.resizeColumn;if(typeof(a.resizeRect.delta)!=="undefined"&&a.resizeRect.delta!==0){var b=Math.max(10,a.widthOuter+a.resizeRect.delta),d=a.frame.AvqMgr;d.SetColumnWidth(a.colIndex,b)}a.resizeRect.style.visibility="hidden";a.frame=null;document.body.style.cursor=a.oldCursor;Qva.removeEvent(document,"mousemove",a.mouseMove);Qva.removeEvent(document,"mouseup",a.mouseUp)}};Qva.DragDrop.reorder={source:{x:null,y:null,Orientation:""},target:{x:null,y:null,Orientation:""},displayRect:null,PosMarker:null,oldCursor:null,startDragX:0,startDragY:0,startDragHeaderLeft:0,startDragHeaderTop:0,frame:null,lstZoneCoords:null,ColumnWidth:0,RowHeight:0,mouseDown:function(n,s,h){if(!n){n=window.event;n.returnValue=false}else{n.preventDefault()}n.cancelBubble=true;var u=n.target||n.srcElement,d,b,l,j,a,g;while(u.parentNode.xx===undefined){u=u.parentNode}this.frame=u.parentNode.parentNode.parentNode.parentNode;l=Qva.GetPageCoords(this.frame);this.oldCursor=document.body.style.cursor;this.source.x=u.parentNode.xx;this.source.y=u.parentNode.yy;this.target.x=this.source.x;this.target.y=this.source.y;this.ColumnWidth=u.offsetWidth;this.RowHeight=u.offsetHeight;for(var o=0;o<h.length;o++){var q=h[o];if(q.orientation=="horizontal"){if(this.target.y!=parseInt(q.y)){continue}if(this.target.x<parseInt(q.x)){continue}}else{if(this.target.x!=parseInt(q.x)){continue}if(this.target.y<parseInt(q.y)){continue}}this.source.Orientation=q.orientation;break}if(this.source.Orientation==""){Assert(false);return}this.target.Orientation=this.source.Orientation;var p=Qva.GetPageCoords(u);this.startDragX=n.clientX+Qva.GetScrollLeft();this.startDragY=n.clientY+Qva.GetScrollTop();this.startDragHeaderLeft=p.x;this.startDragHeaderTop=p.y;if(this.displayRect===null){this.displayRect=document.createElement("div");this.displayRect.className="QvReorderTable";document.body.insertBefore(this.displayRect,document.body.firstChild)}this.displayRect.style.visibility="hidden";this.displayRect.style.left=p.x+"px";this.displayRect.style.top=p.y+"px";if(this.target.Orientation=="vertical"){this.displayRect.style.height=this.frame.style.height;this.displayRect.style.width=this.ColumnWidth+"px"}else{this.displayRect.style.height=this.RowHeight+"px";this.displayRect.style.width=parseInt(this.frame.style.width)-u.parentNode.offsetLeft+"px"}this.displayRect.delta=0;if(this.PosMarker===null){this.PosMarker=document.createElement("div")}this.PosMarker.style.visibility="hidden";this.PosMarker.style.top=this.displayRect.style.top;this.PosMarker.style.left=this.displayRect.style.left;if(this.target.Orientation=="vertical"){this.PosMarker.className="QvReorderColumnPos";this.PosMarker.style.height=this.displayRect.style.height;this.PosMarker.style.width=""}else{this.PosMarker.className="QvReorderRowPos";this.PosMarker.style.height="";this.PosMarker.style.width=this.displayRect.style.width}document.body.insertBefore(this.PosMarker,document.body.firstChild);this.lstZoneCoords=[];for(d=0;d<h.length;++d){var q=h[d];if(!s[q.x]){if(!s[q.x-1]){continue}var c=s[q.x-1].xPos+s[q.x-1].width+l.x;var m=this.frame.offsetWidth-(s[q.x-1].xPos+s[q.x-1].width)}else{var m=s[q.x].width;var c=s[q.x].xPos+l.x}var k=q.y*this.RowHeight+l.y;if(q.orientation=="vertical"){var r=c+m;var t=c+m/2;var f}else{var f=k+this.RowHeight;var t=k+(f-k)/2;var r}this.lstZoneCoords.push({leftCoord:c,rightCoord:r,middleCoord:t,topCoord:k,bottomCoord:f,orientation:q.orientation,x:q.x,y:q.y})}Qva.addEvent(document,"mousemove",this.mouseMove);Qva.addEvent(document,"mouseup",this.mouseUp)},mouseMove:function(a){var b=Qva.DragDrop.reorder;if(!b.displayRect||b.displayRect===null){return}if(!a){a=window.event;a.returnValue=false}else{a.preventDefault()}var g=a.clientX+Qva.GetScrollLeft(),d=a.clientY+Qva.GetScrollTop(),j,c,l=Qva.GetPageCoords(b.frame).x+Qva.GetScrollLeft(),i=l+b.frame.offsetWidth,f=Qva.GetPageCoords(b.frame).y+Qva.GetScrollTop(),h=f+b.frame.offsetHeight;if(g>=l&&g<=i&&d>=f&&d<=h){for(j=0,c=b.lstZoneCoords.length;j<c;j++){var k={x:b.lstZoneCoords[j].x,y:b.lstZoneCoords[j].y};var m=b.lstZoneCoords[j];if(g>=m.leftCoord&&d>=m.topCoord){if(m.orientation=="vertical"&&g<=m.rightCoord){b.displayRect.style.left=b.startDragHeaderLeft+a.clientX+Qva.GetScrollLeft()-b.startDragX+"px";b.PosMarker.className="QvReorderColumnPos";if(g>=m.middleCoord){b.PosMarker.style.left=m.rightCoord+"px";k.x++}else{b.PosMarker.style.left=m.leftCoord+"px"}b.displayRect.style.top=m.topCoord+"px";b.displayRect.style.height=b.frame.style.height;b.displayRect.style.width=b.ColumnWidth+"px";b.PosMarker.style.height=b.displayRect.style.height;b.PosMarker.style.top=b.displayRect.style.top;b.PosMarker.style.width=""}else{if(m.orientation=="horizontal"&&d<=m.bottomCoord){b.displayRect.style.top=b.startDragHeaderTop+a.clientY+Qva.GetScrollTop()-b.startDragY+"px";b.PosMarker.className="QvReorderRowPos";if(d>=m.middleCoord){b.PosMarker.style.top=m.bottomCoord+"px";k.y++}else{b.PosMarker.style.top=b.lstZoneCoords[j].topCoord+"px"}b.displayRect.style.left=m.leftCoord+"px";b.displayRect.style.height=b.RowHeight+"px";b.displayRect.style.width=l+parseInt(b.frame.style.width)-m.leftCoord+"px";b.PosMarker.style.width=b.displayRect.style.width;b.PosMarker.style.left=b.displayRect.style.left;b.PosMarker.style.height=""}else{continue}}b.target.x=k.x;b.target.y=k.y;b.target.Orientation=m.orientation;break}}b.displayRect.style.visibility="visible";b.PosMarker.style.visibility="visible";document.body.style.cursor="move"}},mouseUp:function(b){var a=Qva.DragDrop.reorder;a.displayRect.style.visibility="hidden";a.PosMarker.style.visibility="hidden";document.body.style.cursor=a.oldCursor;Qva.removeEvent(document,"mousemove",a.mouseMove);Qva.removeEvent(document,"mouseup",a.mouseUp);params={};params.reorder="";params.source=a.source.Orientation+":"+a.source.x+":"+a.source.y;params.target=a.target.Orientation+":"+a.target.x+":"+a.target.y;if(params.source!=params.target){var c=a.frame.parentNode.Mgr;c.PageBinder.Set(c.Name,params)}}};Qva.Scanner=function(a,b){this.DefaultBinder=a;this.Errors=new Array();if(b){this.NameSpace=b;this.Prefix=b+":";this.Attr=b+":bind"}else{this.NameSpace="avq";this.Prefix="avq";this.Attr="avq"}this.ModeIfNotEnabled="n";Qva.Scanner.instance=this};Qva.Scanner.prototype.Start=function(){var a=this.DefaultBinder||Qva.GetBinder();var b=(a&&(a.Autoview!=null||a.Kind!=null))?a.DefaultScope:null;this.Scan(document.body,b,a);if(this.Errors.length>0){var c="Errors:\n"+this.Errors.join("\n");this.Errors.length=0;alert(c)}};Qva.Scanner.prototype.Scan=function(d,j,p){if(!d.getAttribute){return}var n=d.getAttribute(this.Prefix+"doc");if(n!=null){n=n.split(":");p=Qva.GetBinder(n[0],n[1]);j=(p.Autoview!=null||p.Kind!=null)?p.DefaultScope:null}var l=d.getAttribute(this.Prefix+"view");if(l!=null){p=Qva.GetBinder(l,l);j=(p.Autoview!=null||p.Kind!=null)?p.DefaultScope:null}if(j==null&&p!=null){j=p.DefaultScope}var i=d.getAttribute(this.Prefix+"scope");if(i==null){i=j}else{if(i.substr(0,1)=="."){i=j+i}}var m=d.getAttribute(this.Attr);if(m!=null){if(m.indexOf(":")==-1&&m.indexOf(".")>=0){m="edit:"+m}var g=m.split(":");var h=g[0];if(h=="edit"){var f=d.tagName.toLowerCase();if(f=="input"){f+=d.type.toLowerCase()}if(Qva.Mgr[f]){h=f}else{if(f!="span"){}}}if(Qva.Mgr[h]){var a=(g.length>1)?g[1]:null;var c=(g.length>2)?g.slice(2).join(":"):null;var o=new Qva.Mgr[h](p,d,a,i,c);if(o.Name!=null){this.PostManager(o)}else{this.Errors[this.Errors.length]="Invalid "+this.NameSpace+"-attribute: "+m}}else{this.Errors[this.Errors.length]="Unknown type: "+h}}var k=d.childNodes.length;for(var b=0;b<k;++b){this.Scan(d.childNodes[b],i,p)}};Qva.Scanner.prototype.PostManager=function(c){var b=c.Element;c.SelectedClassName=b.getAttribute("QvSelected");if(c.SelectedClassName==null){c.SelectedClassName="QvSelected"}c.DeselectedClassName=b.getAttribute("QvDeselected");if(c.DeselectedClassName==null){c.DeselectedClassName="QvDeselected"}c.EnabledClassName=b.getAttribute("QvOptional");if(c.EnabledClassName==null){c.EnabledClassName="QvOptional"}c.DisabledClassName=b.getAttribute("QvExcluded");if(c.DisabledClassName==null){c.DisabledClassName="QvExcluded"}c.LockedClassName=b.getAttribute("QvLocked");if(c.LockedClassName==null){c.LockedClassName="QvLocked"}c.SelectedExcludedClassName=b.getAttribute("QvSelectedExcluded");if(c.SelectedExcludedClassName==null){c.SelectedExcludedClassName="QvSelectedExcluded"}c.LockedExcludedClassName=b.getAttribute("QvLockedExcluded");if(c.LockedExcludedClassName==null){c.LockedExcludedClassName="QvLockedExcluded"}c.AlternativeClassName=b.getAttribute("QvAlternative");if(c.AlternativeClassName==null){c.AlternativeClassName="QvAlternative"}c.TextIfNull=c.Element.getAttribute(this.Prefix+"textifnull");c.Icon=c.Element.getAttribute(this.Prefix+"icon");c.ModeIfNotEnabled=this.ModeIfNotEnabled;var a=c.Element.getAttribute(this.Prefix+"ifnotenabled");if(a!=null){switch(a){case"disabled":c.ModeIfNotEnabled="d";break;case"hidden":c.ModeIfNotEnabled="h";break;default:this.Errors[this.Errors.length]="IfNotEnabled is not implemented for "+a;break}}var d=c.Element.getAttribute(this.Prefix+"hideif");if(d){c.HideIf=new Function("value","text","return "+d)}if(c.PostScan){c.PostScan(this)}};var ModalType={popup:0,messagebox:1};Qva.Modal=function(a){if(typeof a!=="string"){a=null}this.ScriptPath=a||Qva.QvAjaxZfcPath+"htc/";this.HideSelects=false;this.DefaultPage="modal/loading.html";this.TabIndexes=[];this.PageBinders=[];this.PopupMasks=[];this.PopupCointainers=[];this.PopFrames=[];this.TabbableTags=["A","BUTTON","TEXTAREA","INPUT","IFRAME"];this.PopupIsShown=false;this.NumberOfShownWindows=0;this.Type=[];Qva.Modal.instance=this};Qva.Modal.prototype.ShowEx=function(f,b,d,a,c){this.NumberOfShownWindows++;this.Type[this.NumberOfShownWindows]=c;this.PageBinders[this.NumberOfShownWindows]=f;this.Init();var g=document.getElementById("popCloseBox"+this.NumberOfShownWindows);if(g){g.style.display="block"}this.PopupIsShown=true;this.DisableTabs();this.PopupMasks[this.NumberOfShownWindows].style.display="block";this.PopupCointainers[this.NumberOfShownWindows].style.display="block";if(d&&a){this.SetSize(d,a)}if(this.PageBinders[this.NumberOfShownWindows].Session){b+=((b.indexOf("?")==-1)?"?":"&")+"session="+escape(this.PageBinders[this.NumberOfShownWindows].Session)}if(this.PageBinders[this.NumberOfShownWindows].Ticket){b=Qva.FixUrl(b,"ticket",this.PageBinders[this.NumberOfShownWindows].Ticket)}if(this.PageBinders[this.NumberOfShownWindows].Host){b=Qva.FixUrl(b,"host",this.PageBinders[this.NumberOfShownWindows].Host)}if(this.PageBinders[this.NumberOfShownWindows].Unicorn){b=Qva.FixUrl(b,"unicorn","3")}if(this.PageBinders[this.NumberOfShownWindows].View!=""){b=Qva.FixUrl(b,"view",this.PageBinders[this.NumberOfShownWindows].View)}if(this.PageBinders[this.NumberOfShownWindows].Remote!=""){b=Qva.FixUrl(b,"remote",this.PageBinders[this.NumberOfShownWindows].Remote)}if(Qva.Benchmark){this.Benchmark=new Qva.Benchmark()}b=Qva.AddProxyIfAny(b);this.PopFrames[this.NumberOfShownWindows].contentWindow.location.replace(b);if(this.HideSelects==true){this.HideSelectBoxes()}};Qva.Modal.prototype.Show=function(d,b,c,a){this.ShowEx(d,b,c,a,ModalType.popup)};Qva.Modal.prototype.SetSize=function(c,a){this.CenterWin(c,a);var b=parseInt(document.getElementById("popupTitleBar"+this.NumberOfShownWindows).offsetHeight,10);this.PopupCointainers[this.NumberOfShownWindows].style.width=c+"px";this.PopupCointainers[this.NumberOfShownWindows].style.height=(a+b)+"px";this.SetMaskSize();this.PopFrames[this.NumberOfShownWindows].style.width=parseInt(document.getElementById("popupTitleBar"+this.NumberOfShownWindows).offsetWidth,10)+"px";this.PopFrames[this.NumberOfShownWindows].style.height=(a)+"px"};Qva.Modal.prototype.Init=function(){if(this.PopupMasks[this.NumberOfShownWindows]!=null){return}theBody=document.getElementsByTagName("BODY")[0];var a=document.createElement("div");a.style.zIndex=200+3*this.NumberOfShownWindows;a.className="popupMask";a.style.position="absolute";var f=document.createElement("div");f.style.zIndex=201+3*this.NumberOfShownWindows;f.className="popupContainer";f.style.position="absolute";var c=" ";if(this.Type[this.NumberOfShownWindows]!=ModalType.popuponlyok){c='<img src="'+Qva.AddProxyIfAny(this.ScriptPath+"modal/close.gif")+'" id="popCloseBox'+this.NumberOfShownWindows+'" />'}f.innerHTML='<div><div class="popupTitleBar" id="popupTitleBar'+this.NumberOfShownWindows+'"><div class="popupTitle" id="popupTitle'+this.NumberOfShownWindows+'" style="width:90%"></div><div class="popupControls" id="popupControls'+this.NumberOfShownWindows+'" style="width:15px">'+c+'</div></div><iframe src="'+Qva.AddProxyIfAny(this.ScriptPath+this.DefaultPage)+'" style="width:100%;height:100%;background-color:#E9E9E9;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame'+this.NumberOfShownWindows+'" name="popupFrame" width="100%" height="100%"></iframe></div>';theBody.appendChild(a);theBody.appendChild(f);this.PopupCloseBox=document.getElementById("popCloseBox"+this.NumberOfShownWindows);this.PopupMasks[this.NumberOfShownWindows]=a;this.PopupCointainers[this.NumberOfShownWindows]=f;this.PopFrames[this.NumberOfShownWindows]=document.getElementById("popupFrame"+this.NumberOfShownWindows);var d=document.getElementById("popupTitleBar"+this.NumberOfShownWindows);d.style.zIndex=202+3*this.NumberOfShownWindows;d.onmousedown=function(j){if(!j){j=window.event}var i=Qva.GetOffsets(j,f);function h(k){d.onmousemove=null;d.onmouseup=null;d.onmouseout=null;return false}function g(l){if(!l){l=window.event}var k={x:l.clientX+Qva.GetScrollLeft(),y:l.clientY+Qva.GetScrollTop()};f.style.left=(k.x-i.offsetX)+"px";f.style.top=(k.y-i.offsetY)+"px";return false}d.onmousemove=g;d.onmouseup=h;d.onmouseout=h;return false};if(this.PopupCloseBox){this.PopupCloseBox.onmousedown=function(g){Qva.Modal.instance.Close()}}var b=parseInt(window.navigator.appVersion.charAt(0),10);if(b<=6&&window.navigator.userAgent.indexOf("MSIE")>-1){this.HideSelects=true}};Qva.Modal.prototype.DisableTabs=function(){if(document.all){var c=0;for(var b=0;b<this.TabbableTags.length;b++){var d=document.getElementsByTagName(this.TabbableTags[b]);for(var a=0;a<d.length;a++){this.TabIndexes[c]=d[a].tabIndex;d[a].tabIndex="-1";c++}}}};Qva.Modal.prototype.RestoreTabs=function(){if(document.all){var c=0;for(var b=0;b<this.TabbableTags.length;b++){var d=document.getElementsByTagName(this.TabbableTags[b]);for(var a=0;a<d.length;a++){d[a].tabIndex=this.TabIndexes[c];d[a].tabEnabled=true;c++}}}};Qva.Modal.prototype.CenterWin=function(h,a){if(this.PopupIsShown){if(h==null||isNaN(h)){h=this.PopupCointainers[this.NumberOfShownWindows].offsetWidth}if(a==null){a=this.PopupCointainers[this.NumberOfShownWindows].offsetHeight}var f=document.getElementsByTagName("BODY")[0];var b=parseInt(Qva.GetScrollTop(),10);var d=parseInt(f.scrollLeft,10);this.SetMaskSize();var g=parseInt(document.getElementById("popupTitleBar"+this.NumberOfShownWindows).offsetHeight,10);var c=Qva.GetViewportHeight();var i=Qva.GetViewportWidth();this.PopupCointainers[this.NumberOfShownWindows].style.top=(b+((c-(a+g))/2))+g*3+"px";this.PopupCointainers[this.NumberOfShownWindows].style.left=(d+((i-h)/2))+"px"}};Qva.Modal.prototype.SetMaskSize=function(){var b=document.getElementsByTagName("BODY")[0];var a=Qva.GetViewportHeight();var c=Qva.GetViewportWidth();if(a>b.scrollHeight){popHeight=a}else{popHeight=b.scrollHeight}if(c>b.scrollWidth){popWidth=c}else{popWidth=b.scrollWidth}};Qva.Modal.prototype.HideSelectBoxes=function(){for(var a=0;a<document.forms.length;a++){for(var b=0;b<document.forms[a].length;b++){if(document.forms[a].elements[b].tagName=="SELECT"){document.forms[a].elements[b].style.visibility="hidden"}}}};Qva.Modal.prototype.DisplaySelectBoxes=function(){for(var a=0;a<document.forms.length;a++){for(var b=0;b<document.forms[a].length;b++){if(document.forms[a].elements[b].tagName=="SELECT"){document.forms[a].elements[b].style.visibility="visible"}}}};Qva.Modal.prototype.Hide=function(){var a=document.getElementsByTagName("BODY")[0];a.style.overflow="";this.RestoreTabs();if(this.PopupMasks[this.NumberOfShownWindows]==null){return}this.PopupMasks[this.NumberOfShownWindows].style.display="none";this.PopupCointainers[this.NumberOfShownWindows].style.display="none";this.PopFrames[this.NumberOfShownWindows].contentWindow.location.replace(Qva.AddProxyIfAny(this.ScriptPath+this.DefaultPage));if(this.HideSelects==true){this.DisplaySelectBoxes()}this.NumberOfShownWindows--;this.PopupIsShown=this.NumberOfShownWindows>0};Qva.Modal.prototype.SetTitle=function(b){try{document.getElementById("popupTitle"+this.NumberOfShownWindows).innerText=b}catch(a){}};Qva.Modal.prototype.Close=function(){if(this.Type[this.NumberOfShownWindows]!=ModalType.popup){return}this.CloseEx()};Qva.Modal.prototype.CloseEx=function(){this.Hide();if(this.PageBinders[this.NumberOfShownWindows+1]){if(this.PageBinders[this.NumberOfShownWindows+1].LabelClick){this.PageBinders[this.NumberOfShownWindows+1].Set(".Nothing","add","nothing",true)}else{this.PageBinders[this.NumberOfShownWindows+1].Refresh()}}};Calendar=function(d,c,g,a){this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.getDateToolTip=null;this.getDateText=null;this.timeout=null;this.onSelected=g||null;this.onClose=a||null;this.dragging=false;this.hidden=false;this.startDate=new Date(1970,1-1,1);this.endDate=new Date(2050,12-1,31);this.dateFormat=Calendar._TT.DEF_DATE_FORMAT;this.ttDateFormat=Calendar._TT.TT_DATE_FORMAT;this.isPopup=true;this.weekNumbers=true;this.firstDayOfWeek=typeof d=="number"?d:Calendar._FD;this.showsOtherMonths=false;this.dateStr=c;this.ar_days=null;this.showsTime=false;this.time24=true;this.yearStep=2;this.hiliteToday=true;this.multiple=null;this.table=null;this.element=null;this.tbody=null;this.firstdayname=null;this.monthsCombo=null;this.yearsCombo=null;this.hilitedMonth=null;this.activeMonth=null;this.hilitedYear=null;this.activeYear=null;this.dateClicked=false;if(typeof Calendar._SDN=="undefined"){if(typeof Calendar._SDN_len=="undefined"){Calendar._SDN_len=3}var b=new Array();for(var f=8;f>0;){b[--f]=Calendar._DN[f].substr(0,Calendar._SDN_len)}Calendar._SDN=b;if(typeof Calendar._SMN_len=="undefined"){Calendar._SMN_len=3}b=new Array();for(var f=12;f>0;){b[--f]=Calendar._MN[f].substr(0,Calendar._SMN_len)}Calendar._SMN=b}};Calendar._C=null;Calendar.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));Calendar.is_ie5=(Calendar.is_ie&&/msie 5\.0/i.test(navigator.userAgent));Calendar.is_opera=/opera/i.test(navigator.userAgent);Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos=function(f){var a=0,d=0;var c=/^div$/i.test(f.tagName);if(c&&f.scrollLeft){a=f.scrollLeft}if(c&&f.scrollTop){d=f.scrollTop}var g={x:f.offsetLeft-a,y:f.offsetTop-d};if(f.offsetParent){var b=this.getAbsolutePos(f.offsetParent);g.x+=b.x;g.y+=b.y}return g};Calendar.isRelated=function(c,a){var d=a.relatedTarget;if(!d){var b=a.type;if(b=="mouseover"){d=a.fromElement}else{if(b=="mouseout"){d=a.toElement}}}while(d){if(d==c){return true}d=d.parentNode}return false};Calendar.removeClass=function(f,d){if(!(f&&f.className)){return}var a=f.className.split(" ");var b=new Array();for(var c=a.length;c>0;){if(a[--c]!=d){b[b.length]=a[c]}}f.className=b.join(" ")};Calendar.addClass=function(b,a){Calendar.removeClass(b,a);b.className+=" "+a};Calendar.getElement=function(a){var b=Calendar.is_ie?window.event.srcElement:a.currentTarget;while(b.nodeType!=1||/^div$/i.test(b.tagName)){b=b.parentNode}return b};Calendar.getTargetElement=function(a){var b=Calendar.is_ie?window.event.srcElement:a.target;while(b.nodeType!=1){b=b.parentNode}return b};Calendar.stopEvent=function(a){a||(a=window.event);if(Calendar.is_ie){a.cancelBubble=true;a.returnValue=false}else{a.preventDefault();a.stopPropagation()}return false};Calendar.addEvent=function(a,c,b){if(a.attachEvent){a.attachEvent("on"+c,b)}else{if(a.addEventListener){a.addEventListener(c,b,true)}else{a["on"+c]=b}}};Calendar.removeEvent=function(a,c,b){if(a.detachEvent){a.detachEvent("on"+c,b)}else{if(a.removeEventListener){a.removeEventListener(c,b,true)}else{a["on"+c]=null}}};Calendar.createElement=function(c,b){var a=null;if(document.createElementNS){a=document.createElementNS("http://www.w3.org/1999/xhtml",c)}else{a=document.createElement(c)}if(typeof b!="undefined"){b.appendChild(a)}return a};Calendar._add_evs=function(el){with(Calendar){addEvent(el,"mouseover",dayMouseOver);addEvent(el,"mousedown",dayMouseDown);addEvent(el,"mouseout",dayMouseOut);if(is_ie){addEvent(el,"dblclick",dayMouseDblClick);el.setAttribute("unselectable",true)}}};Calendar.findMonth=function(a){if(typeof a.month!="undefined"){return a}else{if(typeof a.parentNode.month!="undefined"){return a.parentNode}}return null};Calendar.findYear=function(a){if(typeof a.year!="undefined"){return a}else{if(typeof a.parentNode.year!="undefined"){return a.parentNode}}return null};Calendar.showMonthsCombo=function(){var h=Calendar._C;if(!h){return false}var j=h.activeDiv;var g=h.monthsCombo;if(h.hilitedMonth){Calendar.removeClass(h.hilitedMonth,"hilite")}if(h.activeMonth){Calendar.removeClass(h.activeMonth,"active")}var f=h.monthsCombo.getElementsByTagName("div")[h.date.getMonth()];Calendar.addClass(f,"active");h.activeMonth=f;var d=g.style;if(j.navtype<0){d.left=j.offsetLeft+"px"}else{var c=g.offsetWidth;if(typeof c=="undefined"){c=50}d.left=(j.offsetLeft+j.offsetWidth-c)+"px"}d.top=(j.offsetTop+j.offsetHeight)+"px";var a=h.monthsCombo.getElementsByTagName("div");for(var b=0;b<12;++b){a[b].style.display="block"}if(h.date.getFullYear()==h.startDate.getFullYear()){for(var b=0;b<h.startDate.getMonth();++b){a[b].style.display="none"}}if(h.date.getFullYear()==h.endDate.getFullYear()){for(var b=h.endDate.getMonth()+1;b<12;++b){a[b].style.display="none"}}d.display="block"};Calendar.showYearsCombo=function(d){var a=Calendar._C;if(!a){return false}var c=a.activeDiv;var g=a.yearsCombo;if(a.hilitedYear){Calendar.removeClass(a.hilitedYear,"hilite")}if(a.activeYear){Calendar.removeClass(a.activeYear,"active")}a.activeYear=null;var b=a.date.getFullYear()+(d?1:-1);var k=g.firstChild;var j=false;for(var f=12;f>0;--f){if(b>=a.startDate.getFullYear()&&b<=a.endDate.getFullYear()){k.innerHTML=b;k.year=b;k.style.display="block";j=true}else{k.style.display="none"}k=k.nextSibling;b+=d?a.yearStep:-a.yearStep}if(j){var l=g.style;l.display="block";if(c.navtype<0){l.left=c.offsetLeft+"px"}else{var h=g.offsetWidth;if(typeof h=="undefined"){h=50}l.left=(c.offsetLeft+c.offsetWidth-h)+"px"}l.top=(c.offsetTop+c.offsetHeight)+"px"}};Calendar.tableMouseUp=function(ev){var cal=Calendar._C;if(!cal){return false}if(cal.timeout){clearTimeout(cal.timeout)}var el=cal.activeDiv;if(!el){return false}var target=Calendar.getTargetElement(ev);ev||(ev=window.event);Calendar.removeClass(el,"active");if(target==el||target.parentNode==el){Calendar.cellClick(el,ev)}var mon=Calendar.findMonth(target);var date=null;if(mon){date=new Date(cal.date);if(mon.month!=date.getMonth()){date.setMonth(mon.month);cal.setDate(date);cal.dateClicked=false;cal.callHandler(ev)}}else{var year=Calendar.findYear(target);if(year){date=new Date(cal.date);if(year.year!=date.getFullYear()){date.setFullYear(year.year);cal.setDate(date);cal.dateClicked=false;cal.callHandler(ev)}}}with(Calendar){removeEvent(document,"mouseup",tableMouseUp);removeEvent(document,"mouseover",tableMouseOver);removeEvent(document,"mousemove",tableMouseOver);cal._hideCombos();_C=null;return stopEvent(ev)}};Calendar.tableMouseOver=function(o){var a=Calendar._C;if(!a){return}var c=a.activeDiv;var k=Calendar.getTargetElement(o);if(k==c||k.parentNode==c){Calendar.addClass(c,"hilite active");Calendar.addClass(c.parentNode,"rowhilite")}else{if(typeof c.navtype=="undefined"||(c.navtype!=50&&(c.navtype==0||Math.abs(c.navtype)>2))){Calendar.removeClass(c,"active")}Calendar.removeClass(c,"hilite");Calendar.removeClass(c.parentNode,"rowhilite")}o||(o=window.event);if(c.navtype==50&&k!=c){var n=Calendar.getAbsolutePos(c);var q=c.offsetWidth;var p=o.clientX;var r;var m=true;if(p>n.x+q){r=p-n.x-q;m=false}else{r=n.x-p}if(r<0){r=0}var g=c._range;var j=c._current;var h=Math.floor(r/10)%g.length;for(var f=g.length;--f>=0;){if(g[f]==j){break}}while(h-->0){if(m){if(--f<0){f=g.length-1}}else{if(++f>=g.length){f=0}}}var b=g[f];c.innerHTML=b;a.onUpdateTime(o)}var d=Calendar.findMonth(k);if(d){if(d.month!=a.date.getMonth()){if(a.hilitedMonth){Calendar.removeClass(a.hilitedMonth,"hilite")}Calendar.addClass(d,"hilite");a.hilitedMonth=d}else{if(a.hilitedMonth){Calendar.removeClass(a.hilitedMonth,"hilite")}}}else{if(a.hilitedMonth){Calendar.removeClass(a.hilitedMonth,"hilite")}var l=Calendar.findYear(k);if(l){if(l.year!=a.date.getFullYear()){if(a.hilitedYear){Calendar.removeClass(a.hilitedYear,"hilite")}Calendar.addClass(l,"hilite");a.hilitedYear=l}else{if(a.hilitedYear){Calendar.removeClass(a.hilitedYear,"hilite")}}}else{if(a.hilitedYear){Calendar.removeClass(a.hilitedYear,"hilite")}}}return Calendar.stopEvent(o)};Calendar.tableMouseDown=function(a){if(Calendar.getTargetElement(a)==Calendar.getElement(a)){return Calendar.stopEvent(a)}};Calendar.calDragIt=function(b){var c=Calendar._C;if(!(c&&c.dragging)){return false}var f;var d;if(Calendar.is_ie){d=window.event.clientY+document.body.scrollTop;f=window.event.clientX+document.body.scrollLeft}else{f=b.pageX;d=b.pageY}c.hideShowCovered();var a=c.element.style;a.left=(f-c.xOffs)+"px";a.top=(d-c.yOffs)+"px";return Calendar.stopEvent(b)};Calendar.calDragEnd=function(ev){var cal=Calendar._C;if(!cal){return false}cal.dragging=false;with(Calendar){removeEvent(document,"mousemove",calDragIt);removeEvent(document,"mouseup",calDragEnd);tableMouseUp(ev)}cal.hideShowCovered()};Calendar.dayMouseDown=function(ev){var el=Calendar.getElement(ev);if(el.disabled){return false}var cal=el.calendar;cal.activeDiv=el;Calendar._C=cal;if(el.navtype!=300){with(Calendar){if(el.navtype==50){el._current=el.innerHTML;addEvent(document,"mousemove",tableMouseOver)}else{addEvent(document,Calendar.is_ie5?"mousemove":"mouseover",tableMouseOver)}addClass(el,"hilite active");addEvent(document,"mouseup",tableMouseUp)}}else{if(cal.isPopup){cal._dragStart(ev)}}if(el.navtype==-1||el.navtype==1){if(cal.timeout){clearTimeout(cal.timeout)}cal.timeout=setTimeout("Calendar.showMonthsCombo()",250)}else{if(el.navtype==-2||el.navtype==2){if(cal.timeout){clearTimeout(cal.timeout)}cal.timeout=setTimeout((el.navtype>0)?"Calendar.showYearsCombo(true)":"Calendar.showYearsCombo(false)",250)}else{cal.timeout=null}}return Calendar.stopEvent(ev)};Calendar.dayMouseDblClick=function(a){Calendar.cellClick(Calendar.getElement(a),a||window.event);if(Calendar.is_ie){document.selection.empty()}};Calendar.dayMouseOver=function(b){var a=Calendar.getElement(b);if(Calendar.isRelated(a,b)||Calendar._C||a.disabled){return false}if(a.ttip){if(a.ttip.substr(0,1)=="_"){a.ttip=a.caldate.print(a.calendar.ttDateFormat)+a.ttip.substr(1)}a.calendar.tooltips.innerHTML=a.ttip}if(a.navtype!=300){Calendar.addClass(a,"hilite");if(a.caldate){Calendar.addClass(a.parentNode,"rowhilite")}}return Calendar.stopEvent(b)};Calendar.dayMouseOut=function(ev){with(Calendar){var el=getElement(ev);if(isRelated(el,ev)||_C||el.disabled){return false}removeClass(el,"hilite");if(el.caldate){removeClass(el.parentNode,"rowhilite")}if(el.calendar){el.calendar.tooltips.innerHTML=_TT.SEL_DATE}return stopEvent(ev)}};Calendar.cellClick=function(f,q){var c=f.calendar;var j=false;var n=false;var g=null;if(typeof f.navtype=="undefined"){if(c.currentDateEl){Calendar.removeClass(c.currentDateEl,"current");Calendar.addClass(f,"current");j=(c.currentDateEl==f);if(!j){c.currentDateEl=f}}c.date.setDateOnly(f.caldate);g=c.date;var b=!(c.dateClicked=!f.otherMonth);if(!b&&!c.currentDateEl){c._toggleMultipleDate(new Date(g))}else{n=!f.disabled}if(b){c._init(c.firstDayOfWeek,g)}}else{if(f.navtype==200){Calendar.removeClass(f,"hilite");c.callCloseHandler();return}g=new Date(c.date);if(f.navtype==0){g.setDateOnly(new Date())}c.dateClicked=false;var p=g.getFullYear();var h=g.getMonth();function a(s){var t=g.getDate();var i=g.getMonthDays(s);if(t>i){g.setDate(i)}g.setMonth(s)}switch(f.navtype){case 400:Calendar.removeClass(f,"hilite");var r=Calendar._TT.ABOUT;if(typeof r!="undefined"){r+=c.showsTime?Calendar._TT.ABOUT_TIME:""}else{r='Help and about box text is not translated into this language.\nIf you know this language and you feel generous please update\nthe corresponding file in "lang" subdir to match calendar-en.js\nand send it back to <mihai_bazon@yahoo.com> to get it into the distribution  ;-)\n\nThank you!\nhttp://dynarch.com/mishoo/calendar.epl\n'}alert(r);return;case -2:if(p>c.startDate.getFullYear()){g.setFullYear(p-1)}break;case -1:if(p==c.startDate.getFullYear()&&h<=c.startDate.getMonth()){break}if(h>0){a(h-1)}else{g.setFullYear(p-1);a(11)}break;case 1:if(p==c.endDate.getFullYear()&&h>=c.endDate.getMonth()){break}if(h<11){a(h+1)}else{g.setFullYear(p+1);a(0)}break;case 2:if(p<c.endDate.getFullYear()){g.setFullYear(p+1)}break;case 100:c.setFirstDayOfWeek(f.fdow);return;case 50:var m=f._range;var o=f.innerHTML;for(var l=m.length;--l>=0;){if(m[l]==o){break}}if(q&&q.shiftKey){if(--l<0){l=m.length-1}}else{if(++l>=m.length){l=0}}var d=m[l];f.innerHTML=d;c.onUpdateTime(q);return;case 0:if(typeof c.getDateStatus=="function"){var k=c.getDateStatus(this,g);if(k===true||/disabled/i.test(k)){return false}}break}if(!g.equalsTo(c.date)){c.setDate(g);n=true}else{if(f.navtype==0){n=j=true}}}if(n){q&&c.callHandler(q)}if(j){Calendar.removeClass(f,"hilite");q&&c.callCloseHandler()}};Calendar.prototype.create=function(o){var n=null;if(!o){n=document.getElementsByTagName("body")[0];this.isPopup=true}else{n=o;this.isPopup=false}this.date=this.dateStr?new Date(this.dateStr):new Date();var r=Calendar.createElement("table");this.table=r;r.cellSpacing=0;r.cellPadding=0;r.calendar=this;Calendar.addEvent(r,"mousedown",Calendar.tableMouseDown);var a=Calendar.createElement("div");a.style.zIndex=666;this.element=a;a.className="calendar";if(this.isPopup){a.style.position="absolute";a.style.display="none"}a.appendChild(r);var l=Calendar.createElement("thead",r);var p=null;var s=null;var b=this;var f=function(t,j,i){p=Calendar.createElement("td",s);p.colSpan=j;p.className="button";if(i!=0&&Math.abs(i)<=2){p.className+=" nav"}Calendar._add_evs(p);p.calendar=b;p.navtype=i;p.innerHTML="<div unselectable='on'>"+t+"</div>";return p};s=Calendar.createElement("tr",l);var c=6;(this.isPopup)&&--c;(this.weekNumbers)&&++c;f("?",1,400).ttip=Calendar._TT.INFO;this.title=f("",c,300);this.title.className="title";if(this.isPopup){this.title.ttip=Calendar._TT.DRAG_TO_MOVE;this.title.style.cursor="move";f("&#x00d7;",1,200).ttip=Calendar._TT.CLOSE}s=Calendar.createElement("tr",l);s.className="headrow";this._nav_py=f("&#x00ab;",1,-2);this._nav_py.ttip=Calendar._TT.PREV_YEAR;this._nav_pm=f("&#x2039;",1,-1);this._nav_pm.ttip=Calendar._TT.PREV_MONTH;this._nav_now=f(Calendar._TT.TODAY,this.weekNumbers?4:3,0);this._nav_now.ttip=Calendar._TT.GO_TODAY;this._nav_nm=f("&#x203a;",1,1);this._nav_nm.ttip=Calendar._TT.NEXT_MONTH;this._nav_ny=f("&#x00bb;",1,2);this._nav_ny.ttip=Calendar._TT.NEXT_YEAR;s=Calendar.createElement("tr",l);s.className="daynames";if(this.weekNumbers){p=Calendar.createElement("td",s);p.className="name wn";p.innerHTML=Calendar._TT.WK}for(var k=7;k>0;--k){p=Calendar.createElement("td",s);if(!k){p.navtype=100;p.calendar=this;Calendar._add_evs(p)}}this.firstdayname=(this.weekNumbers)?s.firstChild.nextSibling:s.firstChild;this._displayWeekdays();var h=Calendar.createElement("tbody",r);this.tbody=h;for(k=6;k>0;--k){s=Calendar.createElement("tr",h);if(this.weekNumbers){p=Calendar.createElement("td",s)}for(var g=7;g>0;--g){p=Calendar.createElement("td",s);p.calendar=this;Calendar._add_evs(p)}}if(this.showsTime){s=Calendar.createElement("tr",h);s.className="time";p=Calendar.createElement("td",s);p.className="time";p.colSpan=2;p.innerHTML=Calendar._TT.TIME||"&nbsp;";p=Calendar.createElement("td",s);p.className="time";p.colSpan=this.weekNumbers?4:3;(function(){function u(D,F,E,G){var B=Calendar.createElement("span",p);B.className=D;B.innerHTML=F;B.calendar=b;B.ttip=Calendar._TT.TIME_PART;B.navtype=50;B._range=[];if(typeof E!="number"){B._range=E}else{for(var C=E;C<=G;++C){var A;if(C<10&&G>=10){A="0"+C}else{A=""+C}B._range[B._range.length]=A}}Calendar._add_evs(B);return B}var y=b.date.getHours();var i=b.date.getMinutes();var z=!b.time24;var j=(y>12);if(z&&j){y-=12}var w=u("hour",y,z?1:0,z?12:23);var v=Calendar.createElement("span",p);v.innerHTML=":";v.className="colon";var t=u("minute",i,0,59);var x=null;p=Calendar.createElement("td",s);p.className="time";p.colSpan=2;if(z){x=u("ampm",j?"pm":"am",["am","pm"])}else{p.innerHTML="&nbsp;"}b.onSetTime=function(){var B,A=this.date.getHours(),C=this.date.getMinutes();if(z){B=(A>=12);if(B){A-=12}if(A==0){A=12}x.innerHTML=B?"pm":"am"}w.innerHTML=(A<10)?("0"+A):A;t.innerHTML=(C<10)?("0"+C):C};b.onUpdateTime=function(D){var B=this.date;var C=parseInt(w.innerHTML,10);if(z){if(/pm/i.test(x.innerHTML)&&C<12){C+=12}else{if(/am/i.test(x.innerHTML)&&C==12){C=0}}}var E=B.getDate();var A=B.getMonth();var F=B.getFullYear();B.setHours(C);B.setMinutes(parseInt(t.innerHTML,10));B.setFullYear(F);B.setMonth(A);B.setDate(E);this.dateClicked=false;this.callHandler(D)}})()}else{this.onSetTime=this.onUpdateTime=function(){}}var m=Calendar.createElement("tfoot",r);s=Calendar.createElement("tr",m);s.className="footrow";p=f(Calendar._TT.SEL_DATE,this.weekNumbers?8:7,300);p.className="ttip";if(this.isPopup){p.ttip=Calendar._TT.DRAG_TO_MOVE;p.style.cursor="move"}this.tooltips=p;a=Calendar.createElement("div",this.element);this.monthsCombo=a;a.className="combo";for(k=0;k<Calendar._MN.length;++k){var d=Calendar.createElement("div");d.className=Calendar.is_ie?"label-IEfix":"label";d.month=k;d.innerHTML=Calendar._SMN[k];a.appendChild(d)}a=Calendar.createElement("div",this.element);this.yearsCombo=a;a.className="combo";for(k=12;k>0;--k){var q=Calendar.createElement("div");q.className=Calendar.is_ie?"label-IEfix":"label";a.appendChild(q)}this._init(this.firstDayOfWeek,this.date);n.appendChild(this.element)};Calendar._keyEvent=function(l){var a=window._dynarch_popupCalendar;if(!a||a.multiple){return false}(Calendar.is_ie)&&(l=window.event);var j=(Calendar.is_ie||l.type=="keypress"),m=l.keyCode;if(l.ctrlKey){switch(m){case 37:j&&Calendar.cellClick(a._nav_pm);break;case 38:j&&Calendar.cellClick(a._nav_py);break;case 39:j&&Calendar.cellClick(a._nav_nm);break;case 40:j&&Calendar.cellClick(a._nav_ny);break;default:return false}}else{switch(m){case 32:Calendar.cellClick(a._nav_now);break;case 27:j&&a.callCloseHandler();break;case 37:case 38:case 39:case 40:if(j){var f,n,k,h,c,d;f=m==37||m==38;d=(m==37||m==39)?1:7;function b(){c=a.currentDateEl;var o=c.pos;n=o&15;k=o>>4;h=a.ar_days[k][n]}b();function g(){var o=new Date(a.date);o.setDate(o.getDate()-d);a.setDate(o)}function i(){var o=new Date(a.date);o.setDate(o.getDate()+d);a.setDate(o)}while(1){switch(m){case 37:if(--n>=0){h=a.ar_days[k][n]}else{n=6;m=38;continue}break;case 38:if(--k>=0){h=a.ar_days[k][n]}else{g();b()}break;case 39:if(++n<7){h=a.ar_days[k][n]}else{n=0;m=40;continue}break;case 40:if(++k<a.ar_days.length){h=a.ar_days[k][n]}else{i();b()}break}break}if(h){if(!h.disabled){Calendar.cellClick(h)}else{if(f){g()}else{i()}}}}break;case 13:if(j){Calendar.cellClick(a.currentDateEl,l)}break;default:return false}}return Calendar.stopEvent(l)};Calendar.prototype._init=function(o,y){var x=new Date();var s=x.getFullYear();var A=x.getMonth();var b=x.getDate();this.table.style.visibility="hidden";if(Calendar.CompareDate(y,this.startDate)<0){y=new Date(this.startDate)}if(Calendar.CompareDate(y,this.endDate)>0){y=new Date(this.endDate)}this.firstDayOfWeek=o;this.date=new Date(y);var k=y.getFullYear();var z=y.getMonth();var C=y.getDate();var B=y.getMonthDays();y.setDate(1);var t=(y.getDay()-this.firstDayOfWeek)%7;if(t<0){t+=7}y.setDate(-t);y.setDate(y.getDate()+1);var f=this.tbody.firstChild;var m=Calendar._SMN[z];var q=this.ar_days=new Array();var p=Calendar._TT.WEEKEND;var d=this.multiple?(this.datesCells={}):null;for(var v=0;v<6;++v,f=f.nextSibling){var a=f.firstChild;if(this.weekNumbers){a.className="day wn";a.innerHTML=y.getWeekNumber();a=a.nextSibling}f.className="daysrow";var w=false,g,c=q[v]=[];for(var u=0;u<7;++u,a=a.nextSibling,y.setDate(g+1)){g=y.getDate();var h=y.getDay();a.className="day";a.pos=v<<4|u;c[u]=a;var n=(y.getMonth()==z);if(!n){if(this.showsOtherMonths){a.className+=" othermonth";a.otherMonth=true}else{a.className="emptycell";a.innerHTML="&nbsp;";a.disabled=true;continue}}else{a.otherMonth=false;w=true}a.disabled=false;a.innerHTML=this.getDateText?this.getDateText(y,g):g;if(d){d[y.print("%Y%m%d")]=a}if(this.getDateStatus){var r=this.getDateStatus(this,y);if(this.getDateToolTip){var l=this.getDateToolTip(y,k,z,g);if(l){a.title=l}}if(r===true){a.className+=" disabled";a.disabled=true}else{if(/disabled/i.test(r)){a.disabled=true}a.className+=" "+r}}if(!a.disabled){a.caldate=new Date(y);a.ttip="_";if(!this.multiple&&n&&g==C&&this.hiliteToday){a.className+=" current";this.currentDateEl=a}if(y.getFullYear()==s&&y.getMonth()==A&&g==b){a.className+=" today";a.ttip+=Calendar._TT.PART_TODAY}if(p.indexOf(h.toString())!=-1){a.className+=a.otherMonth?" oweekend":" weekend"}}}if(!(w||this.showsOtherMonths)){f.className="emptyrow"}}this.title.innerHTML=Calendar._MN[z]+", "+k;this.onSetTime();this.table.style.visibility="visible";this._initMultipleDates()};Calendar.prototype._initMultipleDates=function(){if(this.multiple){for(var b in this.multiple){var a=this.datesCells[b];var c=this.multiple[b];if(!c){continue}if(a){a.className+=" current"}}}};Calendar.prototype._toggleMultipleDate=function(b){if(this.multiple){var c=b.print("%Y%m%d");var a=this.datesCells[c];if(a){var f=this.multiple[c];if(!f){Calendar.addClass(a,"current");this.multiple[c]=b}else{Calendar.removeClass(a,"current");delete this.multiple[c]}}}};Calendar.prototype.setDateToolTipHandler=function(a){this.getDateToolTip=a};Calendar.prototype.setDate=function(a){if(!a.equalsTo(this.date)){this._init(this.firstDayOfWeek,a)}};Calendar.prototype.refresh=function(){this._init(this.firstDayOfWeek,this.date)};Calendar.prototype.setFirstDayOfWeek=function(a){this._init(a,this.date);this._displayWeekdays()};Calendar.prototype.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(a){this.getDateStatus=a};Calendar.prototype.setRange=function(b,c){this.startDate=b;this.endDate=c};Calendar.prototype.callHandler=function(a){if(this.onSelected){this.onSelected(this,a)}};Calendar.prototype.callCloseHandler=function(){if(this.onClose){this.onClose(this)}this.hideShowCovered()};Calendar.prototype.destroy=function(){var a=this.element.parentNode;a.removeChild(this.element);Calendar._C=null;window._dynarch_popupCalendar=null};Calendar.prototype.reparent=function(b){var a=this.element;a.parentNode.removeChild(a);b.appendChild(a)};Calendar._checkCalendar=function(b){var c=window._dynarch_popupCalendar;if(!c){return false}var a=Calendar.is_ie?Calendar.getElement(b):Calendar.getTargetElement(b);for(;a!=null&&a!=c.element;a=a.parentNode){}if(a==null){window._dynarch_popupCalendar.callCloseHandler();return Calendar.stopEvent(b)}};Calendar.prototype.show=function(){var f=this.table.getElementsByTagName("tr");for(var d=f.length;d>0;){var g=f[--d];Calendar.removeClass(g,"rowhilite");var c=g.getElementsByTagName("td");for(var b=c.length;b>0;){var a=c[--b];Calendar.removeClass(a,"hilite");Calendar.removeClass(a,"active")}}this.element.style.display="block";this.hidden=false;if(this.isPopup){window._dynarch_popupCalendar=this;Calendar.addEvent(document,"keydown",Calendar._keyEvent);Calendar.addEvent(document,"keypress",Calendar._keyEvent);Calendar.addEvent(document,"mousedown",Calendar._checkCalendar)}this.hideShowCovered()};Calendar.prototype.hide=function(){if(this.isPopup){Calendar.removeEvent(document,"keydown",Calendar._keyEvent);Calendar.removeEvent(document,"keypress",Calendar._keyEvent);Calendar.removeEvent(document,"mousedown",Calendar._checkCalendar)}this.element.style.display="none";this.hidden=true;this.hideShowCovered()};Calendar.prototype.showAt=function(a,c){var b=this.element.style;b.left=a+"px";b.top=c+"px";this.show()};Calendar.prototype.showAtElement=function(c,d){var a=this;var f=Calendar.getAbsolutePos(c);if(!d||typeof d!="string"){this.showAt(f.x,f.y+c.offsetHeight);return true}function b(j){if(j.x<0){j.x=0}if(j.y<0){j.y=0}var k=document.createElement("div");var i=k.style;i.position="absolute";i.right=i.bottom=i.width=i.height="0px";document.body.appendChild(k);var h=Calendar.getAbsolutePos(k);document.body.removeChild(k);if(Calendar.is_ie){h.y+=document.body.scrollTop;h.x+=document.body.scrollLeft}else{h.y+=window.scrollY;h.x+=window.scrollX}var g=j.x+j.width-h.x;if(g>0){j.x-=g}g=j.y+j.height-h.y;if(g>0){j.y-=g}}this.element.style.display="block";Calendar.continuation_for_the_khtml_browser=function(){var g=a.element.offsetWidth;var j=a.element.offsetHeight;a.element.style.display="none";var i=d.substr(0,1);var k="l";if(d.length>1){k=d.substr(1,1)}switch(i){case"T":f.y-=j;break;case"B":f.y+=c.offsetHeight;break;case"C":f.y+=(c.offsetHeight-j)/2;break;case"t":f.y+=c.offsetHeight-j;break;case"b":break}switch(k){case"L":f.x-=g;break;case"R":f.x+=c.offsetWidth;break;case"C":f.x+=(c.offsetWidth-g)/2;break;case"l":f.x+=c.offsetWidth-g;break;case"r":break}f.width=g;f.height=j+40;a.monthsCombo.style.display="none";b(f);a.showAt(f.x,f.y)};if(Calendar.is_khtml){setTimeout(Calendar.continuation_for_the_khtml_browser,10)}else{Calendar.continuation_for_the_khtml_browser()}};Calendar.prototype.setDateFormat=function(a){this.dateFormat=a};Calendar.prototype.setTtDateFormat=function(a){this.ttDateFormat=a};Calendar.prototype.parseDate=function(b,a){if(!a){a=this.dateFormat}this.setDate(Date.parseDate(b,a))};Calendar.prototype.hideShowCovered=function(){if(!Calendar.is_ie&&!Calendar.is_opera){return}function b(k){var i=k.style.visibility;if(!i){if(document.defaultView&&typeof(document.defaultView.getComputedStyle)=="function"){if(!Calendar.is_khtml){i=document.defaultView.getComputedStyle(k,"").getPropertyValue("visibility")}else{i=""}}else{if(k.currentStyle){i=k.currentStyle.visibility}else{i=""}}}return i}var t=["applet","iframe","select"];var c=this.element;var a=Calendar.getAbsolutePos(c);var g=a.x;var d=c.offsetWidth+g;var s=a.y;var r=c.offsetHeight+s;for(var j=t.length;j>0;){var h=document.getElementsByTagName(t[--j]);var f=null;for(var m=h.length;m>0;){f=h[--m];a=Calendar.getAbsolutePos(f);var q=a.x;var o=f.offsetWidth+q;var n=a.y;var l=f.offsetHeight+n;if(this.hidden||(q>d)||(o<g)||(n>r)||(l<s)){if(!f.__msh_save_visibility){f.__msh_save_visibility=b(f)}f.style.visibility=f.__msh_save_visibility}else{if(!f.__msh_save_visibility){f.__msh_save_visibility=b(f)}f.style.visibility="hidden"}}}};Calendar.prototype._displayWeekdays=function(){var b=this.firstDayOfWeek;var a=this.firstdayname;var d=Calendar._TT.WEEKEND;for(var c=0;c<7;++c){a.className="day name";var f=(c+b)%7;if(c){a.ttip=Calendar._TT.DAY_FIRST.replace("%s",Calendar._DN[f]);a.navtype=100;a.calendar=this;a.fdow=f;Calendar._add_evs(a)}if(d.indexOf(f.toString())!=-1){Calendar.addClass(a,"weekend")}a.innerHTML=Calendar._SDN[(c+b)%7];a=a.nextSibling}};Calendar.prototype._hideCombos=function(){this.monthsCombo.style.display="none";this.yearsCombo.style.display="none"};Calendar.prototype._dragStart=function(ev){if(this.dragging){return}this.dragging=true;var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft}else{posY=ev.clientY+window.scrollY;posX=ev.clientX+window.scrollX}var st=this.element.style;this.xOffs=posX-parseInt(st.left);this.yOffs=posY-parseInt(st.top);with(Calendar){addEvent(document,"mousemove",calDragIt);addEvent(document,"mouseup",calDragEnd)}};Calendar.CompareDate=function(b,a){if(b.getFullYear()<a.getFullYear()){return -1}else{if(b.getFullYear()>a.getFullYear()){return 1}else{if(b.getMonth()<a.getMonth()){return -1}else{if(b.getMonth()>a.getMonth()){return 1}else{if(b.getDate()<a.getDate()){return -1}else{if(b.getDate()>a.getDate()){return 1}else{return 0}}}}}}};Date._MD=new Array(31,28,31,30,31,30,31,31,30,31,30,31);Date.SECOND=1000;Date.MINUTE=60*Date.SECOND;Date.HOUR=60*Date.MINUTE;Date.DAY=24*Date.HOUR;Date.WEEK=7*Date.DAY;Date.parseDate=function(n,c){var o=new Date();var p=0;var f=-1;var l=0;var r=n.split(/\W+/);var q=c.match(/%./g);var k=0,h=0;var s=0;var g=0;for(k=0;k<r.length;++k){if(!r[k]){continue}switch(q[k]){case"%d":case"%e":l=parseInt(r[k],10);break;case"%m":f=parseInt(r[k],10)-1;break;case"%Y":case"%y":p=parseInt(r[k],10);(p<100)&&(p+=(p>29)?1900:2000);break;case"%b":case"%B":for(h=0;h<12;++h){if(Calendar._MN[h].substr(0,r[k].length).toLowerCase()==r[k].toLowerCase()){f=h;break}}break;case"%H":case"%I":case"%k":case"%l":s=parseInt(r[k],10);break;case"%P":case"%p":if(/pm/i.test(r[k])&&s<12){s+=12}else{if(/am/i.test(r[k])&&s>=12){s-=12}}break;case"%M":g=parseInt(r[k],10);break}}if(isNaN(p)){p=o.getFullYear()}if(isNaN(f)){f=o.getMonth()}if(isNaN(l)){l=o.getDate()}if(isNaN(s)){s=o.getHours()}if(isNaN(g)){g=o.getMinutes()}if(p!=0&&f!=-1&&l!=0){return new Date(p,f,l,s,g,0)}p=0;f=-1;l=0;for(k=0;k<r.length;++k){if(r[k].search(/[a-zA-Z]+/)!=-1){var u=-1;for(h=0;h<12;++h){if(Calendar._MN[h].substr(0,r[k].length).toLowerCase()==r[k].toLowerCase()){u=h;break}}if(u!=-1){if(f!=-1){l=f+1}f=u}}else{if(parseInt(r[k],10)<=12&&f==-1){f=r[k]-1}else{if(parseInt(r[k],10)>31&&p==0){p=parseInt(r[k],10);(p<100)&&(p+=(p>29)?1900:2000)}else{if(l==0){l=r[k]}}}}}if(p==0){p=o.getFullYear()}if(f!=-1&&l!=0){return new Date(p,f,l,s,g,0)}return o};Date.prototype.getMonthDays=function(b){var a=this.getFullYear();if(typeof b=="undefined"){b=this.getMonth()}if(((0==(a%4))&&((0!=(a%100))||(0==(a%400))))&&b==1){return 29}else{return Date._MD[b]}};Date.prototype.getDayOfYear=function(){var a=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var c=new Date(this.getFullYear(),0,0,0,0,0);var b=a-c;return Math.floor(b/Date.DAY)};Date.prototype.getWeekNumber=function(){var c=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var b=c.getDay();c.setDate(c.getDate()-(b+6)%7+3);var a=c.valueOf();c.setMonth(0);c.setDate(4);return Math.round((a-c.valueOf())/(7*86400000))+1};Date.prototype.equalsTo=function(a){return((this.getFullYear()==a.getFullYear())&&(this.getMonth()==a.getMonth())&&(this.getDate()==a.getDate())&&(this.getHours()==a.getHours())&&(this.getMinutes()==a.getMinutes()))};Date.prototype.setDateOnly=function(a){var b=new Date(a);this.setDate(1);this.setFullYear(b.getFullYear());this.setMonth(b.getMonth());this.setDate(b.getDate())};Date.prototype.print=function(n){var b=this.getMonth();var l=this.getDate();var o=this.getFullYear();var q=this.getWeekNumber();var r=this.getDay();var x={};var t=this.getHours();var c=(t>=12);var j=(c)?(t-12):t;var v=this.getDayOfYear();if(j==0){j=12}var f=this.getMinutes();var k=this.getSeconds();x["%a"]=Calendar._SDN[r];x["%A"]=Calendar._DN[r];x["%b"]=Calendar._SMN[b];x["%B"]=Calendar._MN[b];x["%C"]=1+Math.floor(o/100);x["%d"]=(l<10)?("0"+l):l;x["%e"]=l;x["%H"]=(t<10)?("0"+t):t;x["%I"]=(j<10)?("0"+j):j;x["%j"]=(v<100)?((v<10)?("00"+v):("0"+v)):v;x["%k"]=t;x["%l"]=j;x["%m"]=(b<9)?("0"+(1+b)):(1+b);x["%M"]=(f<10)?("0"+f):f;x["%n"]="\n";x["%p"]=c?"PM":"AM";x["%P"]=c?"pm":"am";x["%s"]=Math.floor(this.getTime()/1000);x["%S"]=(k<10)?("0"+k):k;x["%t"]="\t";x["%U"]=x["%W"]=x["%V"]=(q<10)?("0"+q):q;x["%u"]=r+1;x["%w"]=r;x["%y"]=(""+o).substr(2,2);x["%Y"]=o;x["%%"]="%";x["%D"]=x["%m"]+"/"+x["%d"]+"/"+x["%y"];x["%r"]=x["%I"]+":"+x["%M"]+":"+x["%S"]+" "+x["%p"];x["%R"]=x["%H"]+":"+x["%M"];x["%T"]=x["%H"]+":"+x["%M"]+":"+x["%S"];var u=/%./g;if(!Calendar.is_ie5&&!Calendar.is_khtml){return n.replace(u,function(a){return x[a]||a})}var p=n.match(u);for(var h=0;h<p.length;h++){var g=x[p[h]];if(g){u=new RegExp(p[h],"g");n=n.replace(u,g)}}return n};Date.prototype.__msh_oldSetFullYear=Date.prototype.setFullYear;Date.prototype.setFullYear=function(b){var a=new Date(this);a.__msh_oldSetFullYear(b);if(a.getMonth()!=this.getMonth()){this.setDate(28)}this.__msh_oldSetFullYear(b)};window._dynarch_popupCalendar=null;Calendar._DN=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");Calendar._SDN=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun");Calendar._FD=0;Calendar._MN=new Array("January","February","March","April","May","June","July","August","September","October","November","December");Calendar._SMN=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");Calendar._TT={};Calendar._TT.INFO="About the calendar";Calendar._TT.ABOUT="DHTML Date/Time Selector\n(c) dynarch.com 2002-2005 / Author: Mihai Bazon\nFor latest version visit: http://www.dynarch.com/projects/calendar/\nDistributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details.\n\nDate selection:\n- Use the \xab, \xbb buttons to select year\n- Use the "+String.fromCharCode(8249)+", "+String.fromCharCode(8250)+" buttons to select month\n- Hold mouse button on any of the above buttons for faster selection.";Calendar._TT.ABOUT_TIME="\n\nTime selection:\n- Click on any of the time parts to increase it\n- or Shift-click to decrease it\n- or click and drag for faster selection.";Calendar._TT.PREV_YEAR="Prev. year (hold for menu)";Calendar._TT.PREV_MONTH="Prev. month (hold for menu)";Calendar._TT.GO_TODAY="Go Today";Calendar._TT.NEXT_MONTH="Next month (hold for menu)";Calendar._TT.NEXT_YEAR="Next year (hold for menu)";Calendar._TT.SEL_DATE="Select date";Calendar._TT.DRAG_TO_MOVE="Drag to move";Calendar._TT.PART_TODAY=" (today)";Calendar._TT.DAY_FIRST="Display %s first";Calendar._TT.WEEKEND="0,6";Calendar._TT.CLOSE="Close";Calendar._TT.TODAY="Today";Calendar._TT.TIME_PART="(Shift-)Click or drag to change value";Calendar._TT.DEF_DATE_FORMAT="%Y-%m-%d";Calendar._TT.TT_DATE_FORMAT="%a, %b %e";Calendar._TT.WK="wk";Calendar._TT.TIME="Time:";function ToDate(g){var c=g.split("-");if(c.length===3){for(var b=0;b<3;++b){while(c[b].charAt(0)==="0"){c[b]=c[b].substr(1)}}var h=parseInt(c[0]);var a=parseInt(c[1]);var f=parseInt(c[2]);return new Date(h,a-1,f)}else{return new Date(g)}}if(!Qva.Mgr){Qva.Mgr={}}Qva.Mgr.actionicon=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}this.SearchName=this.Name;this.Owner=a;this.Element=c;this.Touched=false;a.AddManager(this)};Qva.Mgr.actionicon.prototype.GetCellRect=function(a,b){Assert(a==-1&&b==-1);var c=Qva.GetAbsolutePageCoords(this.Element);return{left:c.x,width:this.Element.offsetWidth,top:c.y,height:this.Element.offsetHeight}};Qva.Mgr.actionicon.prototype.Paint=function(f,c){this.Touched=true;var j=c.getElementsByTagName("icon");if(j.length>=1){var h=j[0];var d=document.createElement("img");var a=h.getAttribute("name");var g=h.getAttribute("align");d.className="Qv_CellIcon";if(g){d.className+="_"+g}var b=this.PageBinder.BuildBinaryUrl(h.getAttribute("path"),null,a);d.src=b;this.Img=d;var i=this.PageBinder;d.ObjectId=i.Name;d.action=a;d.binderid=i.PageBinder.ID;d.style.cursor="pointer";this.Element.appendChild(d);d.onclick=function(l){if(!l){l=window.event}l.cancelBubble=true;var k=Qva.GetObjectBinder(this);var m={};m.action="";k.Set(k.Name+"."+this.action,m)}}};Qva.Mgr.date=function(d,g,c,h){if(!Qva.MgrSplit(this,c,h)){return}this.Owner=d;this.Element=g;this.Touched=false;d.AddManager(this);this.Selected={};var i=this;function f(n,m){if(n.startDate&&Calendar.CompareDate(m,n.startDate)<0){return true}if(n.endDate&&Calendar.CompareDate(m,n.endDate)>0){return true}var l=m.print("%Y-%m-%d");if(i.Selected[l]){return"selected"}return false}function j(n,m){if(n.dateClicked){var o=false;var l=n.date.print("%Y-%m-%d");if(o){if(i.Selected[l]){delete i.Selected[l]}else{i.Selected[l]=n.date}n.refresh()}else{i.Selected={};i.Selected[l]=n.date;i.Owner.Set(i.Name,"value",l,true)}}else{}if(n.dateClicked&&!o){n.callCloseHandler()}}function k(l){l.hide()}var b=null;var a=new Calendar(b,null,j,k);this.Cal=a;a.showsTime=false;a.weekNumbers=true;a.showsOtherMonths=true;a.yearStep=1;a.setRange(new Date(2004,1-1,1),new Date(2005,11-1,23));a.setDateStatusHandler(f);a.getDateText=null;a.setDateFormat("%m/%d/%Y");a.create();g.onclick=function(){a.hide();a.refresh();var l="Tl";a.showAtElement(g,l);return false}};Qva.Mgr.date.prototype.Lock=Qva.LockDisabled;Qva.Mgr.date.prototype.Unlock=Qva.UnlockDisabled;Qva.Mgr.date.prototype.Paint=function(g,d){this.Touched=true;this.Element.style.display=Qva.MgrGetDisplayFromMode(this,g);var a=this.Cal;var k=d.getElementsByTagName("value");if(k.length>=1){var j=k[0];var f=ToDate(j.getAttribute("min"));var i=ToDate(j.getAttribute("max"));if(f&&i){a.setRange(f,i)}var h=j.getAttribute("current");this.Selected={};if(h){var c=ToDate(h);if(!isNaN(c)){var b=c.print("%Y-%m-%d");this.Selected[b]=c;a.setDate(new Date(c))}}}this.Unlock()};var Graphics={VML:{CreateElement:function(b,a){var c=document.createElement("v:"+b);c.unselectable="on";if(a){a.appendChild(c)}return c},CreateShape:function(f,b,a,d){var c=Graphics.VML.CreateElement("shape",d);c.coordsize=b;if(a){c.fillcolor=a}c.path=f;return c},CreateArea:function(a,b){var c=Graphics.VML.CreateElement("group",b);c.style.width=a[0]+"px";c.style.height=a[1]+"px";c.coordsize=a.join(",");c.style.position="absolute";return c},CreatePolygonObj:function(g,a,f,j,d){var h="m "+g[0][0]+","+g[0][1]+" l";for(var c=1;c<g.length;++c){h+=" "+g[c][0]+" "+g[c][1]}h+=" x e";var b=Graphics.VML.CreateShape(h,d.join(","),a,f);b.style.width=d[0]+"px";b.style.height=d[1]+"px";b.style.position="absolute";b.style.left=j[0]+"px";b.style.top=j[1]+"px";return b},CreatePolygon:function(c,a,b){return Graphics.VML.CreatePolygonObj(c,a,b,[0,0],[b.style.pixelWidth,b.style.pixelHeight])},CreateLine:function(g,f,b,d,c){var a=Graphics.VML.CreateElement("line",d);a.from=g.join(",");a.to=f.join(",");if(b){a.strokecolor=b}if(c){a.strokeweight=c}return a},CreatePolyLine:function(g,b,d,c){var a=Graphics.VML.CreateElement("polyline",d);a.points=g.join(" ");if(b){a.strokecolor=b}var h=Graphics.VML.CreateElement("fill");h.on="false";a.appendChild(h);if(c){a.strokeweight=c}return a},CreateRect:function(g,c,a,d,b){var f=Graphics.VML.CreateElement("rect",d);f.fillcolor=a;f.style.left=g[0]+"px";f.style.top=g[1]+"px";f.style.width=c[0]+"px";f.style.height=c[1]+"px";if(!b){Graphics.VML.CreateElement("stroke",f).on="false"}return f},FixPolygon:function(d,f,c,a){var g="m "+f[0][0]+","+f[0][1]+" l";for(var b=1;b<f.length;++b){g+=" "+f[b][0]+" "+f[b][1]}g+=" x e";d.path=g;d.coordsize=c.join(",");d.style.width=c[0]+"px";d.style.height=c[1]+"px"},Init:function(){if(IE_DOCMODE>=8){if(!document.namespaces.v){document.namespaces.add("v","urn:schemas-microsoft-com:vml","#default#VML")}}else{if(!document.namespaces.v){document.namespaces.add("v","urn:schemas-microsoft-com:vml")}}if(!Graphics.VML.styleSheet){Graphics.VML.styleSheet=document.createStyleSheet();Graphics.VML.styleSheet.cssText="v\\:*{behavior:url(#default#VML);display: inline-block;}"}},styleSheet:null},Canvas:{CreateArea:function(a,b){var c=document.createElement("canvas");c.style.width=a[0]+"px";c.style.height=a[1]+"px";c.width=a[0];c.height=a[1];if(b){b.appendChild(c)}return c},CreatePolygonObj:function(d,a,c,g,b){var f=Graphics.Canvas.CreateArea(b,c);f.style.position="absolute";f.style.left=g[0]+"px";f.style.top=g[1]+"px";Graphics.Canvas.CreatePolygon(d,a,f);return f},CreatePolygon:function(f,b,d){var a=d.getContext("2d");a.fillStyle=b||"rgb(0,0,0)";a.beginPath();a.moveTo(f[0][0],f[0][1]);for(var c=1;c<f.length;++c){a.lineTo(f[c][0],f[c][1])}a.fill()},CreateLine:function(g,f,b,d,c){var a=d.getContext("2d");a.lineWidth=c||1;a.strokeStyle=b||"rgb(0,0,0)";a.beginPath();a.moveTo(g[0],g[1]);a.lineTo(f[0],f[1]);a.stroke()},CreatePolyLine:function(g,b,f,d){if(g.length===0){return}var a=f.getContext("2d");a.lineWidth=d||1;a.strokeStyle=b||"rgb(0,0,0)";a.beginPath();a.moveTo(g[0][0],g[0][1]);for(var c=1;c<g.length;++c){a.lineTo(g[c][0],g[c][1])}a.stroke()},CreateRect:function(g,d,b,f,c){var a=f.getContext("2d");if(c){a.strokeStyle=c===true?"rgb(0,0,0)":c;a.strokeRect(g[0],g[1],d[0],d[1])}a.fillStyle=b;a.fillRect(g[0],g[1],d[0],d[1])},FixPolygon:function(d,f,c,b){d.style.width=c[0]+"px";d.style.height=c[1]+"px";d.width=c[0];d.height=c[1];var a=d.getContext("2d");a.clearRect(0,0,c[0],c[1]);Graphics.Canvas.CreatePolygon(f,b,d)},Init:function(){}},SVG:{CreateElement:function(c,b){var a="http://www.w3.org/2000/svg";try{var d=document.createElementNS(a,c)}catch(f){var d=document.createElement(c);d.setAttribute("xmlns",a)}if(b){b.appendChild(d)}return d},CreateArea:function(a,b){var c=Graphics.SVG.CreateElement("svg",b);c.setAttribute("width",a[0]+"px");c.setAttribute("height",a[1]+"px");c.style.width=a[0]+"px";c.style.height=a[1]+"px";return c},CreatePolygonObj:function(d,a,c,g,b){var f=Graphics.SVG.CreateArea(b,c);f.style.position="absolute";f.style.left=g[0]+"px";f.style.top=g[1]+"px";Graphics.SVG.CreatePolygon(d,a,f);return f},CreatePolygon:function(d,a,c){var b=Graphics.SVG.CreateElement("polygon",c);b.setAttribute("points",d.join(","));b.setAttribute("fill",a||"black");return b},CreateLine:function(g,f,b,d,c){var a=Graphics.SVG.CreateElement("line",d);a.setAttribute("x1",g[0]+"px");a.setAttribute("y1",g[1]+"px");a.setAttribute("x2",f[0]+"px");a.setAttribute("y2",f[1]+"px");a.setAttribute("stroke",b||"black");a.setAttribute("strokeWidth",c);return a},CreatePolyLine:function(f,b,d,c){var a=Graphics.SVG.CreateElement("polyline",d);a.setAttribute("points",f.join(","));a.setAttribute("stroke",b||"black");a.setAttribute("strokeWidth",c);a.setAttribute("fill","none");return a},CreateRect:function(g,c,a,d,b){var f=Graphics.SVG.CreateElement("rect",d);f.setAttribute("x",g[0]+"px");f.setAttribute("y",g[1]+"px");f.setAttribute("width",c[0]+"px");f.setAttribute("height",c[1]+"px");f.setAttribute("fill",a||"black");if(b){f.setAttribute("stroke","black")}return f},FixPolygon:function(){Assert(false)},Init:function(){}}};var useragent=""+window.window.navigator.userAgent;if(useragent.indexOf("MSIE")!=-1){var SelectGraphics=function(){return Graphics.VML}}else{var SelectGraphics=function(a){if(Graphics[a]&&a!=="VML"){return Graphics[a]}return Graphics.Canvas}}function SelectInitGraphics(a){var b=SelectGraphics(a);b.Init();return b}function MeasureText(b,a){if(!MeasureText.div){MeasureText.div=document.createElement("div");MeasureText.div.style.position="absolute";MeasureText.div.style.width="auto";MeasureText.div.style.height="auto";MeasureText.div.style.visibility="hidden";document.body.insertBefore(MeasureText.div,document.body.firstChild)}MeasureText.div.style.fontSize=a;MeasureText.div.innerText=b;return{width:MeasureText.div.offsetWidth,height:MeasureText.div.offsetHeight}}MeasureText.div=null;if(!Qva.Mgr){Qva.Mgr={}}Qva.Mgr.slider=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}this.Element=c;this.Touched=false;a.AddManager(this);this.G=SelectInitGraphics()};Qva.Mgr.slider.prototype.Lock=Qva.LockDisabled;Qva.Mgr.slider.prototype.Unlock=Qva.UnlockDisabled;Qva.Mgr.slider.prototype.Paint=function(f,d){this.Touched=true;var b=this.Element;b.style.display=Qva.MgrGetDisplayFromMode(this,f);if(b.style.display=="none"){return}for(var g=d.firstChild;g;g=g.nextSibling){if(g.nodeName=="layout"){this.Node=g}else{if(g.nodeName=="choice"){if(!this.Choice){this.Choice=[]}var a=0;for(var c=g.firstChild;c;c=c.nextSibling){this.Choice[a++]=c.getAttribute("text")}this.Choice.length=a}}}this.PageBinder.QueuePostPaintMessage(this)};Qva.Mgr.slider.tooltip=null;Qva.Mgr.slider.prototype.PostPaint=function(){if(this.Element.style.display=="none"){return}var z=this;var m=this.Element;var ac=this.Node;var av=true;var s=ac.getAttribute("orientation")||"horizontal";var H=HtmlifyARGB(ac.getAttribute("color"))||"#AABCDD";var c=null;var ax=null;var r=null;for(var ag=ac.firstChild;ag;ag=ag.nextSibling){if(c==null&&ag.nodeName=="tics"){c=ag}if(ax==null&&ag.nodeName=="thumb"){ax=ag}if(r==null&&ag.nodeName=="arrows"){r=ag}}var n=parseFloat(ac.getAttribute("max"));var aw=parseFloat(ac.getAttribute("min"));var C=parseFloat(ac.getAttribute("current_min"));var U=parseFloat(ac.getAttribute("current_max"));var u=ac.getAttribute("selectionrange")=="multi";var R=ac.getAttribute("selectionvalid")=="true"&&!isNaN(C)&&!isNaN(U);if(aw==n){return}var J=ac.getAttribute("step");if(J){J=parseFloat(J)}var aj=m.offsetTop;var an=getClientWidth(m);var p=m.parentNode;var q=p.clientHeight-aj;var Y=m.style.fontSize;var d=s=="horizontal"?an:q;var g=19;var W=s=="horizontal"?"left":"top";var x=s=="horizontal"?"top":"left";var aa=s=="horizontal"?"width":"height";var B=s=="horizontal"?"height":"width";var w=s=="horizontal"?q-15:12;var O=s=="horizontal"?"center":"left";var V=s=="horizontal"?w-28:w+23;var ar=s=="horizontal"?"left":"top";var ao=s=="horizontal"?"clientX":"clientY";var al=s=="horizontal"?[[0,4],[4,0],[8,4],[8,12],[0,12]]:[[0,0],[8,0],[12,4],[8,8],[0,8]];var t=s=="horizontal"?function(k,l){return[k,l]}:function(l,k){return[k,l]};var K=s=="horizontal"?-1:1;var af=w+K*10;var i=af+K*13;var A=af+K*7;var at=document.createElement("div");at.style.width=an+"px";at.style.height=q+"px";var o=z.G.CreateArea([an,q],at);var M=z.G.CreateLine(t(g,w),t(d-g,w),H,o,4);if(!M){M=o}var ae=d-2*(g+5);var G=n-aw+1;var Z=ae/(G-1);if(c){var v=HtmlifyARGB(c.getAttribute("color"))||"#A4A4A4";function E(az,l,k){z.G.CreateLine(t(az,k),t(az,l),v,o)}var y=parseInt(c.getAttribute("labels"));var ai=parseInt(c.getAttribute("major"));if(ai<2){ai=0}var D=parseInt(c.getAttribute("minor"));if(D<0){D=0}var F=0;var ap=c.getElementsByTagName("label");var ad=ae/(ai-1);for(var L=0;L<ai;++L){var Q=ap[F++];var aq;if(Q&&Q.getAttribute("index")){aq=Math.round(g+5+parseInt(Q.getAttribute("index"))*Z)}else{aq=Math.round(g+5+L*ad)}if(s=="horizontal"){E(aq,af+3,i+3,v)}else{E(aq,af-3,i-3,v)}if(y>0&&L%y==0&&Q){var ak=Q.getAttribute("text");var I=MeasureText(ak,Y);var h={position:"absolute",fontSize:Y,overflow:"visible",color:v,fontFamily:m.style.fontFamily,textAlign:O};h[W]=(s=="horizontal"?Math.round(aq-I.width/2):Math.floor(aq-I.height/2)+2)+"px";h[x]=(s=="horizontal"?Math.max(Math.round(V-I.height/2),0):V)+"px";h.width=I.width+2+"px";h.height=I.height+"px";var f=document.createElement("div");for(var N in h){if(N=="color"){f.style[N]=HtmlifyARGB(h[N])}else{f.style[N]=h[N]}}f.innerText=ak;at.appendChild(f)}if(L==ai-1){continue}var ah=ad/(D+1);for(var S=1;S<=D;++S){var T=Math.round(aq+S*ah);E(T,af,A,v)}}}if(Qva.Mgr.slider.tooltip===null){Qva.Mgr.slider.tooltip=document.createElement("div");Qva.Mgr.slider.tooltip.style.position="absolute";Qva.Mgr.slider.tooltip.style.width="auto";Qva.Mgr.slider.tooltip.style.height="auto";Qva.Mgr.slider.tooltip.style.zIndex=666;Qva.Mgr.slider.tooltip.style.backgroundColor="#FFFFCC";Qva.Mgr.slider.tooltip.style.borderWidth="1px";Qva.Mgr.slider.tooltip.style.borderColor="black";Qva.Mgr.slider.tooltip.style.borderStyle="solid";Qva.Mgr.slider.tooltip.style.padding="3px";document.body.insertBefore(Qva.Mgr.slider.tooltip,document.body.firstChild)}Qva.Mgr.slider.tooltip.style.visibility="hidden";var b=HtmlifyARGB(ax.getAttribute("color"))||"#3796FF";var au=t(30,w-6);var ay=t(8,12);var ax=z.G.CreatePolygonObj(al,b,at,au,ay);ax.style.cursor="inherit";function am(k){if(n==aw){return 0}return(ax.maxVal-ax.minVal)*(k-aw)/(n-aw)+ax.minVal}function ab(k){return(k-ax.minVal)*(n-aw)/(ax.maxVal-ax.minVal)+aw}function j(aB,k,az,l){ax._min=aB;ax._max=k;var aC=8;var aA=Math.round(am(k)-am(aB));if(aA>aC){P(aB,aA)}else{if(az=="min"){P(k,0);if(l){ax._min=ax._max}}else{P(aB,0);if(l){ax._max=ax._min}}}}function P(aA,l){ax.style[ar]=Math.round(am(aA))+"px";if(l>0){var aB=[[4,0],[8,4],[l,4],[l+4,0],[l+4,12],[l,8],[8,8],[4,12]];if(s!="horizontal"){for(var az=0;az<aB.length;++az){var k=aB[az][0];aB[az][0]=aB[az][1];aB[az][1]=k}}z.G.FixPolygon(ax,aB,t(l+8,12),b)}else{z.G.FixPolygon(ax,al,ay,b)}}if(u){ax.onmouseover=function(aA){if(Qva.Select.Active){if(!aA){aA=window.event}var aB=3;var aC=Qva.GetPageCoords(ax);var az=s==="horizontal"?"x":"y";var k=ax._min==ax._max?0:8;if(Math.abs(aC[az]-aA[ao])<aB){document.body.style.cursor=s==="horizontal"?"w-resize":"n-resize"}else{if(Math.abs(aC[az]+(parseFloat(ax.style[aa])-k)-aA[ao])<aB){document.body.style.cursor=s==="horizontal"?"e-resize":"s-resize"}else{document.body.style.cursor="pointer"}}}};ax.onmousemove=ax.onmouseover;ax.onmouseout=function(){if(Qva.Select.Active){document.body.style.cursor="default"}}}ax._setPos=function(k){var az=[ax._min,ax._max];if(J){az[0]=(az[0]+J/2)-((az[0]+J/2)%J);az[1]=(az[1]+J/2)-((az[1]+J/2)%J)}if(k){var l=ax.lastValue!=az[0]||ax.lastValue!=az[1];Qva.Mgr.slider.tooltip.style.visibility="hidden";if(u){az=az[0]+":"+az[1]}else{az=az[0]}if(l){z.PageBinder.Set(z.Name,"value",az,true)}}else{var aA=Qva.GetAbsolutePageCoords(ax);az[0]=Math.round(az[0]*100)/100;az[1]=Math.round(az[1]*100)/100;if(u){if(z.Choice){Qva.Mgr.slider.tooltip.innerHTML="Min: "+(z.Choice[az[0]]||"?")+"<br/>Max: "+(z.Choice[az[1]]||"?")}else{Qva.Mgr.slider.tooltip.innerHTML="Min: "+az[0]+"<br/>Max: "+az[1]}}else{Qva.Mgr.slider.tooltip.innerText=z.Choice?(z.Choice[az[0]]||"?"):az[0]}if(s=="horizontal"){Qva.Mgr.slider.tooltip.style.left=(aA.x-5)+"px";Qva.Mgr.slider.tooltip.style.top=(aA.y-50)+"px"}else{Qva.Mgr.slider.tooltip.style.left=(aA.x+50)+"px";Qva.Mgr.slider.tooltip.style.top=(aA.y-5)+"px"}Qva.Mgr.slider.tooltip.style.fontFamily=z.Element.style.fontFamily;Qva.Mgr.slider.tooltip.style.fontSize=z.Element.style.fontSize;Qva.Mgr.slider.tooltip.style.fontWeight=z.Element.style.fontWeight;Qva.Mgr.slider.tooltip.style.visibility="visible"}};ax.setPos=function(az,l){if(az<ax.minVal){az=ax.minVal}if(az>ax.maxVal){az=ax.maxVal}var k=ab(az);if(!isNaN(k)){j(k,k,"max",l)}ax._setPos(l)};ax.onmousedown=function(aC){if(!aC){aC=window.event}switch(document.body.style.cursor){case"w-resize":case"n-resize":ax.setPos=function(aF,aD){var aE=am(ax._max);if(aE<aF){aF=aE}if(aF<ax.minVal){aF=ax.minVal}j(ab(aF),ax._max,"min",aD);ax._setPos(aD)};break;case"e-resize":case"s-resize":var aA=parseFloat(ax.style[aa])-8;ax.setPos=function(aF,aD){aF+=aA;var aE=am(ax._min);if(aF<aE){aF=aE}if(ax.maxVal<aF){aF=ax.maxVal}j(ax._min,ab(aF),"max",aD);ax._setPos(aD)};break;default:var aA=parseFloat(ax.style[aa])-8;var l=ax._max-ax._min;ax.setPos=function(aG,aE){var aF=ax.maxVal-aA;if(aG<ax.minVal){aG=ax.minVal}if(aG>aF){aG=aF}var aD=ab(aG);if(!isNaN(aD)){j(aD,aD+l,"max",aE)}ax._setPos(aE)};break}var k=parseFloat(ax.style[ar]);ax.mouseZero=IS_TOUCHENABLED?aC.targetTouches[0][ao]:aC[ao];ax.mouseZero-=k;ax._setPos(false);function az(aD){if(!aD){aD=window.event}var aE=IS_TOUCHENABLED?aD.changedTouches[0][ao]:aD[ao];aE-=ax.mouseZero;ax.setPos(aE,true);if(IS_TOUCHENABLED){Qva.removeEvent(document,"touchmove",aB);Qva.removeEvent(document,"touchend",az)}else{Qva.removeEvent(document,"mousemove",aB);Qva.removeEvent(document,"mouseup",az)}Qva.Select.Active=true}function aB(aD){if(!aD){aD=window.event}var aE=IS_TOUCHENABLED?aD.targetTouches[0][ao]:aD[ao];aE-=ax.mouseZero;ax.setPos(aE)}Qva.Select.Active=false;if(IS_TOUCHENABLED){Qva.addEvent(document,"touchmove",aB);Qva.addEvent(document,"touchend",az)}else{Qva.addEvent(document,"mousemove",aB);Qva.addEvent(document,"mouseup",az)}aC.cancelBubble=true;return false};if(IS_TOUCHENABLED){ax.ontouchstart=ax.onmousedown}ax.minVal=17+3;ax.maxVal=parseFloat(ax.parentNode.style[aa])-parseFloat(ax.style[aa])-17-3;ax.lastValue=C==U?C:-1;if(R){j(C,U,"max",true)}else{ax.style.visibility="hidden";M.onmouseover=function(l){var aA=ax.onmousedown;var k=ax.onmouseover;var aB=ax.onmousemove;var az=ax.onmouseout;ax.onmouseover=null;ax.onmousedown=function(aC){ax.style.visibility="visible";ax.onmouseout=null;ax.onmousemove=null;M.onmouseover=null;M.onmousemove=null;M.onmouseout=null;ax.onmousedown=aA;ax.onmouseover=k;ax.onmousemove=aB;ax.onmouseout=az;if(u){document.body.style.cursor="e-resize"}aA(aC)};ax.onmouseout=function(){ax.style.visibility="hidden";ax.onmouseout=null;ax.onmousemove=null;M.onmousemove=null;M.onmouseout=null;Qva.Mgr.slider.tooltip.style.visibility="hidden"};ax.onmousemove=function(aD){if(!aD){aD=window.event}var aC=s=="horizontal"?"x":"y";var aE=aD[ao]-(Qva.GetPageCoords(m)[aC]+4);ax.setPos(aE,false)};M.onmouseout=function(aC){if(!aC){aC=window.event}if(!aC.toElement){Assert(false)}if(aC.toElement!==ax){ax.onmouseout()}};M.onmousemove=ax.onmousemove;ax.onmousemove(l);ax.style.visibility="visible"}}function a(aA,az){var l=aA=="start"?0:10;var k=aA=="start"?10:0;var aE=[t(l,0),t(k,6),t(l,12)];var aB=t(aA=="start"?(d-15):5,w-6);var aF=t(10,12);var aD=z.G.CreatePolygonObj(aE,az,at,aB,aF);var aC=u?1:(J!=null?J:1);if(aA!=="start"){aC=-aC}aD.onmousedown=function(){if(ax._min!=-1&&ax._min+aC>=aw&&ax._max+aC<=n){ax._min+=aC;ax._max+=aC;ax._setPos(true)}}}if(r){var X=HtmlifyARGB(r.getAttribute("color"))||"#0080C0";a("start",X);a("end",X)}if(av&&m.firstChild){m.replaceChild(at,m.firstChild)}else{m.appendChild(at)}};function ListDiff(d,b,c,f){var g=0;var a=0;while(g<d.length&&a<b.length){if(d[g]<b[a]){f.push(d[g]);++g}else{if(d[g]>b[a]){c.push(b[a]);++a}else{++g;++a}}}for(;g<d.length;++g){f.push(d[g])}for(;a<b.length;++a){c.push(b[a])}}Qva.Collaboration=function(a,b){this.Name=a.DefaultScope+".ActiveSheet";this.Attr="collobj";this.Element=b;this.PageBinder=a;a.AddManager(this);this.Objects=[]};Qva.Collaboration.prototype.Scale=function(c,a,b){var d=parseFloat(c.getAttribute(a));if(isNaN(d)||d<0){d=100}if(d<b){d=b}return d};Qva.Collaboration.prototype.Paint=function(k,m){this.Touched=true;if(this.Element==null){this.Element=document.getElementById("MainContainer")}if(this.Element==null){return}this.ZList=[];var a=[];var o=m.getElementsByTagName("object");var f=o.length;var n=0;Qva.Help.Context=null;var h=null;for(var b=0;b<f;++b){var p=o[b];var v=p.getAttribute("name");var t=p.getAttribute("objectid");if(this.PageBinder.SingleObjectId&&t){if(t!=this.PageBinder.SingleObjectId){continue}}if(!v){continue}a.push(v);this.ZList.push(v);var j={};j.id=v;j.mode=p.getAttribute("mode");j.left=p.getAttribute("left");j.top=p.getAttribute("top");j.width=p.getAttribute("width");j.height=p.getAttribute("height");j.allowmove=p.getAttribute("allowmove");j.allowresize=!IS_TOUCHENABLED&&p.getAttribute("allowresize");if(j.mode=="maximized"){j.maximized=true;h=v}else{j.maximized=false}j.type=p.getAttribute("type");j.help=p.getAttribute("help");j.extension=p.getAttribute("extension");if(Qva.Help.Context==null&&j.mode!="hidden"){Qva.Help.Context={Name:j.id,Topic:j.help,SubType:j.extension}}if(IS_IE6_OR_IE7){var l=parseInt(p.getAttribute("top"))+parseInt(p.getAttribute("height"));if(l>n){n=l}}var c=v;v=this.PageBinder.DefaultScope+"."+v;var u=this.PageBinder.Members[v];if(u){u=u[0]}if(u){u.Size(j);if(p.getAttribute("type")!="TW"){continue}var q=p.getAttribute("page")!=null;if(!!u.HasPage==q){continue}this.PageBinder.RemoveObject(c)}j.create=true;j.name=v;if(j.type=="TW"){j.page=p.getAttribute("page")}switch(j.type){case"TW":this.CreateToolWindow(j);break;default:this.AddObject(j);break}if(j.type!="TW"){this.CreateMinimized(j)}u=this.PageBinder.Members[v];if(u){u=u[0]}if(u){u.Size(j)}}if(IS_IE6_OR_IE7){this.Element.style.height=n+10+"px"}a.sort();var d=[];var s=[];ListDiff(this.Objects,a,d,s);this.Objects=a;for(var r=0;r<s.length;++r){this.PageBinder.RemoveObject(s[r])}for(var r=0;r<this.ZList.length;r++){var v=this.ZList[r];var g=v==h?this.ZList.length+1:this.ZList.length-r;SetRelatedElementsZindex(v,g)}};Qva.Collaboration.prototype.AddObject=function(a){var b=Qva.Mgr.CreateObject(this.PageBinder,a,false,true);this.Element.appendChild(b.Element)};Qva.Collaboration.prototype.CreateToolWindow=function(f){var h=Qva.Mgr.CreateObject(this.PageBinder,f,true,true);h.Element.className+=" ToolWindow";h.Element.style.cssText+="display:none;";var c=document.createElement("table");c.className="ToolWindow";c.style.cssText="height:100%; width:100%;";if(f.page){h.HasPage=true;var g=c.insertRow(-1);var a=g.insertCell(-1);a.vAlign="top"}else{var b=c.insertRow(-1);var i=b.insertCell(-1);i.vAlign="top";i.innerHTML="<div class='ToolWindow-Navigation'></div>";var g=c.insertRow(-1);var a=g.insertCell(-1);a.vAlign="top";a.innerHTML="<div class='ToolWindow-Body'></div>"}h.ContentElement.appendChild(c);Qva.SetContextMenu(h,function(j){return Qva.GetBinder(this.binderid).OnContextMenu(j,this.Name)});this.Element.appendChild(h.Element);new Qva.Mgr.style(h,h.ContentElement,f.name+".Style");if(f.page){var d=this.PageBinder;this.PageBinder.LoadHtml(f.page,function(j){a.innerHTML=j;var k=new Qva.Mgr.toolwindowbody(d,a.firstChild,f.name+".Body");k.Scan();d.Refresh()})}else{new Qva.Mgr.toolwindownavigation(this.PageBinder,i.firstChild,f.name+".Navigation");new Qva.Mgr.toolwindowbody(this.PageBinder,a.firstChild,f.name+".Body")}};Qva.Collaboration.prototype.CreateMinimized=function(a){var b=document.createElement("div");b.className="QvFrame";b.style.cssText="vertical-align:middle;text-align:left; display:none;";b.id=a.id+"_minimized";this.Element.appendChild(b);new Qva.Mgr.restore(this.PageBinder,b,a.name+".RE")};Qva.Mgr.children=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}a.AddManager(this);this.Element=c;c.binderid=a.binderid;this.PageBinder=a.PageBinder;a.AddManager(this);this.Objects=[];this.Managers=[];this.InlineStyle=a.InlineStyle;this.LeftButton=a.LeftButton;this.TableLimit=a.TableLimit;this.IsHosted=a.IsHosted;this.Enabled=a.GetEnabled();this.binderid=a.binderid};Qva.Mgr.children.prototype.GetEnabled=function(){return this.PageBinder.GetEnabled()};Qva.Mgr.children.prototype.Paint=function(l,r){this.Touched=true;var a=[];var c=r.getElementsByTagName("object");var o=c.length;var k=0;for(var g=0;g<o;++g){var f=c[g];var b=f.getAttribute("name");if(!b){continue}a.push(b);var j={};j.id=b;j.mode=f.getAttribute("mode");j.left=f.getAttribute("left");j.top=f.getAttribute("top");j.width=f.getAttribute("width");j.height=f.getAttribute("height");j.allowmove=f.getAttribute("allowmove");j.allowresize=f.getAttribute("allowresize");j.maximized=j.mode=="maximized";if(IS_IE6_OR_IE7){var q=parseInt(f.getAttribute("top"))+parseInt(f.getAttribute("height"));if(q>k){k=q}}var n=b;b=this.PageBinder.GetDocumentMgr().DefaultScope+"."+b;var s=this.PageBinder.GetDocumentMgr().Members[b];if(s){s=s[0]}if(s){s.Size(j);continue}j.create=true;j.name=b;j.type=f.getAttribute("type");j.extension=f.getAttribute("extension");var d=Qva.Mgr.CreateObject(this,j,false,true);this.Element.appendChild(d.Element)}if(IS_IE6_OR_IE7){this.Element.style.height=k+10+"px"}a.sort();var p=[];var m=[];ListDiff(this.Objects,a,p,m);this.Objects=a;for(var h=0;h<m.length;++h){this.RemoveObject(m[h])}};Qva.Mgr.children.prototype.QueuePostPaintMessage=function(a){this.PageBinder.QueuePostPaintMessage(a)};Qva.Mgr.children.prototype.BuildBinaryUrl=function(d,c,b,a){return this.PageBinder.BuildBinaryUrl(d,c,b,a)};Qva.Mgr.children.prototype.Set=function(b,c,d,a){this.PageBinder.GetDocumentMgr().Set(b,c,d,a)};Qva.Mgr.children.prototype.GetDocumentMgr=function(){return this.PageBinder.GetDocumentMgr()};Qva.Mgr.children.prototype.GetUpdates=function(c){for(var a=0;a<this.Managers.length;++a){var b=this.Managers[a];if(b.GetUpdates){b.GetUpdates(c)}}};Qva.Mgr.children.prototype.GetMaximizedRect=function(){var a={};a.left="0";a.top="0";a.width=""+this.Element.offsetWidth;a.height=""+this.Element.offsetHeight;return a};Qva.Mgr.children.prototype.AddManager=function(a){a.PageBinder=this;a.Touched=false;if(a.SelectedClassName==null){a.SelectedClassName="QvSelected";a.DeselectedClassName="QvDeselected";a.EnabledClassName="QvOptional";a.DisabledClassName="QvExcluded";a.LockedClassName="QvLocked";a.SelectedExcludedClassName="QvSelectedExcluded";a.LockedExcludedClassName="QvLockedExcluded";a.AlternativeClassName="QvAlternative";a.ModeIfNotEnabled="n"}this.Managers[this.Managers.length]=a;this.PageBinder.GetDocumentMgr().Append(a,a.Name,a.Attr)};Qva.Mgr.children.prototype.Append=function(d,b,a,c){this.PageBinder.GetDocumentMgr().Append(d,b,a,c)};Qva.Mgr.children.prototype.RemoveFromManagers=Qva.PageBinding.prototype.RemoveFromManagers;Qva.Mgr.children.prototype.RemoveObject=function(a){var b=this.PageBinder.GetDocumentMgr().Members["Document."+a];if(b){b=b[0]}if(b){if(b.Remove){b.Remove()}this.RemoveFromManagers(b)}this.PageBinder.GetDocumentMgr().Members["Document."+a]=null};Qva.Mgr.children.prototype.Remove=function(){for(var a=0;a<this.Objects.length;a++){this.RemoveObject(this.Objects[a])}};Qva.Mgr.children.prototype.GetEnabled=function(){return this.Enabled};Qva.Mgr.tabrow2=function(a,c,b,d){if(!Qva.MgrSplit(this,b,d)){return}a.AddManager(this);this.Element=c;c.Name=this.Name;this.binderid=a.binderid;Qva.DragDrop.DropFrames[Qva.DragDrop.DropFrames.length]=this};Qva.Mgr.tabrow2.prototype.Inside=function(h,f){var g=this.Element;var d=Qva.GetPageCoords(g);var c=parseInt(g.offsetWidth);var a=parseInt(g.offsetHeight);if(h.x>d.x&&h.x<d.x+c&&h.y>d.y&&h.y<d.y+a){if(f=="Object"){for(var b=g.firstChild.firstChild;b;b=b.nextSibling){if(b.tagName!="LI"){continue}d=Qva.GetPageCoords(b);c=parseInt(b.offsetWidth);a=parseInt(b.offsetHeight);if(h.x>d.x&&h.x<d.x+c&&h.y>d.y&&h.y<d.y+a){b.Name=this.Name+"."+b.id;return{Element:b,Dialog:"Drop.qvpp"}}}}return{Element:null}}return null};Qva.Mgr.tabrow2.prototype.Paint=function(i,o,v){this.Touched=true;var a=this.Element;if(i!="n"){var f=document.getElementsByTagName("ul")[0];if(!f){f=document.createElement("ul");a.appendChild(f)}var d=o.getElementsByTagName("value");var j=f.getElementsByTagName("li");for(var r=0;r<Math.max(d.length,j.length);r++){var c=d[r];var n=j[r];if(!c&&!n){continue}var p;var s;if(!n){n=document.createElement("li");f.appendChild(n)}n.innerHTML="";if(!c||c.getAttribute("mode")=="hidden"){n.style.display="none";continue}n.style.display="";p=document.createElement("a");s=document.createElement("span");if(IS_TOUCHENABLED){s.style.fontSize="22px"}Qva.ApplyColorDataToElement(c,p,false,true);p.appendChild(s);n.appendChild(p);var l=c.getAttribute("name");n.id=l;var m=c.getAttribute("selected")==="true";n.className=m?"selected":"";var t=c.getElementsByTagName("icon");var h=c.getAttribute("text");if(t.length>=1){h+=" "}var g=document.createTextNode(h);s.appendChild(g);if(t.length>=1){var k=t[0].getAttribute("stamp");var v=t[0].getAttribute("name");var q=HtmlifyARGB(t[0].getAttribute("color"));var b=Qva.GetBinder(this.binderid).BuildBinaryUrl(t[0].getAttribute("path"),k,v,q);var u=document.createElement("img");u.alt="";u.src=b;s.appendChild(u)}if(c.getAttribute("action")){n.onclick=onclick_action;n.Action=this.Name+"."+l}}}a.style.display=Qva.MgrGetDisplayFromMode(this,i)};Qva.Touch={GetCoordinatesForElem:function(a){var b={x:0,y:0};b=Qva.GetPageCoords(a);return b},EventListenerExists:typeof(document.addEventListener)!=="undefined",Events:{ListenerObject:function(c,b,a){return{id:c,scope:b,fn:a}},OnTouchStart:{Listeners:[],AddListener:function(a){this.Listeners.push(a)},RemoveListener:function(d){var b=0,c=Qva.Touch.Events.OnTouchStart.Listeners,a=c.length;for(;b<a;b++){if(c[b].id===d){this.Listeners.splice(b,1)}}},FireEvent:function(d){var b=0,c=Qva.Touch.Events.OnTouchStart.Listeners,a=c.length;for(;b<a;b++){Qva.ConsoleLog.Log("General touchstart fired. Listener called for: "+c[b].id,Qva.ConsoleLog.SeverityTypes.Normal);c[b].fn.apply(c[b].scope,[d])}}},OnTouchEnd:{Listeners:[],AddListener:function(a){this.Listeners.push(a)},FireEvent:function(d){var b=0,c=Qva.Touch.Events.OnTouchEnd.Listeners,a=c.length;for(;b<a;b++){c[b].fn.apply(c[b].scope,[d])}}}},Init:function(){function a(b){Qva.Touch.Events.OnTouchStart.FireEvent(b)}if(Qva.Touch.EventListenerExists){document.addEventListener("touchstart",a,false)}else{document.ontouchstart=a}},SelectionPopup:null,Restore:{AddTouchSupport:function(a){a.Touch={FingerMoved:false};function c(d){a.Touch.FingerMoved=true}function b(d){d.preventDefault();d.stopPropagation();this.ontouchmove=null;this.ontouchend=null;Qva.ConsoleLog.Log("Restore.TouchEnd. FingerMoved:"+a.Touch.FingerMoved,Qva.ConsoleLog.SeverityTypes.Verbose);if(!a.Touch.FingerMoved){a.Restore()}}a.Element.ontouchstart=function(d){d.preventDefault();d.stopPropagation();this.ontouchmove=c;this.ontouchend=b;a.Touch.FingerMoved=false};Qva.ConsoleLog.Log("Added touch support for RestoreObj:"+a.Name,Qva.ConsoleLog.SeverityTypes.Verbose)}},GridCell:{AddTouchSupport:function(a){var b=function(d){var f=d.target.nodeName.toLowerCase();if(f==="img"){if(d.target.action){d.target.onclick.apply(this,[d])}else{this.pressed=true;action_mu(this);Qva.Touch.Events.OnTouchStart.AddListener(new Qva.Touch.Events.ListenerObject("Grid_DropdownSelect",this,function(g){document.onclick();Qva.Touch.Events.OnTouchStart.RemoveListener("Grid_DropdownSelect")}))}}else{if(f==="a"){return true}else{if(this.style.backgroundColor){this.style.backgroundColor=Qva.InvertColor(this.style.backgroundColor)}if(this.style.color){this.style.color=Qva.InvertColor(this.style.color)}this.addEventListener("touchend",c,true)}}d.stopPropagation();d.preventDefault()},c=function(d){Qva.Mgr.grid.DblClick.apply(this,[d]);this.removeEventListener("touchend",c,false)};a.addEventListener("touchstart",b,false)}},Listbox:{AddTouchSupport:function(d){var c=function(i,h){return Math.max(0,Math.min(i.rows-i.visible_rows,Math.round(-h/i.rowHeight)))};var a=function(o){var k=this.Touch,j=isNaN(k.TotalScrollX)?0:k.TotalScrollX,m=isNaN(k.TotalScrollY)?0:k.TotalScrollY,l=this.children[0].Mgr,n=o.target;Qva.ConsoleLog.Log("Listbox["+k.Mgr.Name+"].touchStart",Qva.ConsoleLog.SeverityTypes.Normal);if(n.onclick&&n.className.indexOf("Qv_CellIcon")>-1){return true}if(o.touches.length>o.changedTouches.length){return true}if(Qva.Touch.Listbox.SelectMenu&&Qva.Touch.Listbox.SelectMenu.Visible&&Qva.Touch.Listbox.SelectMenu.ListboxObject!==k){Qva.Touch.Listbox.SelectMenu.Hide(true)}if(Qva.Touch.SelectionPopup){Qva.Touch.SelectionPopup.Hide()}var i=window.getComputedStyle(k.ElementToScroll).webkitTransform;var h;if(i!="none"){h=new WebKitCSSMatrix(i)}if(i!="none"&&(h.e!==j||h.f!==m)){k.TotalScrollX=h.e;k.TotalScrollY=h.f;k.ElementToScroll.style.webkitTransitionDuration="0ms";k.ElementToScroll.style.webkitTransform="translate3d("+h.e+"px, "+h.f+"px, 0)"}else{if(!k.MultiSelectMode&&!l.readOnly){k.SelectRow=setTimeout(function(){k.MultiSelectModeInitializing=true;Qva.Touch.Listbox.PreSelectMulti({row:n,lb:k,contentElem:this});k.MultiSelectMode=true},500)}}k.TouchStartX=o.changedTouches?o.changedTouches[0].clientX:o.clientX;k.TouchStartY=o.changedTouches?o.changedTouches[0].clientY:o.clientY;k.TouchIdentifier=o.changedTouches?o.changedTouches[0].identifier:"i";k.TouchPointList=[];if(Qva.Touch.EventListenerExists){this.addEventListener("touchmove",f,true);this.addEventListener("touchend",b,true)}else{this.ontouchmove=f;this.ontouchend=b}k.FingerMoved=false;k.TouchStartTime=o.timeStamp;o.stopPropagation();o.preventDefault();return true};var g=function(o,n){var l=0,h=o.changedTouches.length;for(;l<h;++l){if(o.changedTouches[l].identifier==n.TouchIdentifier){break}}if(l>=o.changedTouches.length){return false}var k=o.changedTouches[l].clientX-n.TouchStartX;var j=o.changedTouches[l].clientY-n.TouchStartY;var m=o.timeStamp-n.TouchStartTime;n.TouchPointList.push({dx:k,dy:j,dt:m});return true};var f=function(r){var q=this.Touch,s=isNaN(q.TotalScrollX)?0:q.TotalScrollX,m=isNaN(q.TotalScrollY)?0:q.TotalScrollY,l="",u=this.children[0].Mgr,p=0,o=0,t=null,n=0,k=0,v=0,i=0;clearTimeout(q.SelectRow);if(!g(r,q)){return true}t=q.TouchPointList[q.TouchPointList.length-1];i=Math.abs(t.dx);v=Math.abs(t.dy);if(v<3){m+=t.dy}if(i<3){s+=t.dx}if(v<3&&i<3){return true}p=t.dx+s;o=t.dy+m;q.FingerMoved=true;r.stopPropagation();r.preventDefault();if(u.columns<=u.visible_cols){p=0}var j=Math.max(0,(u.columns-u.visible_cols)*u.colwidth);if(-p<0){p=p/3}if(-p>j){p=(p+j)/3-j}if(u.rows<=u.visible_rows){o=0}var h=Math.max(0,(u.rows-u.visible_rows)*u.rowHeight);if(-o<0){o=o/3}if(-o>h){o=(o+h)/3-h}q.TmpScrollX=p;q.TmpScrollY=o;n=c(u,o);k=Math.max(0,Math.min(u.columns-u.visible_cols,Math.round(-p/u.colwidth)));if(n!==0||k!==0){u.PaintExtraCells(k,n,u.visible_cols,u.visible_rows)}q.ElementToScroll.style.webkitTransitionDuration="0ms";l="translate3d("+p+"px, "+o+"px, 0)";Qva.ConsoleLog.Log("Listbox["+q.Mgr.Name+"].touchMove. Translate: "+l+" :: DeltaX: "+p+" :: DeltaY: "+o,Qva.ConsoleLog.SeverityTypes.Verbose);q.ElementToScroll.style.webkitTransform=l;u.XScroll.setTransitionTime("0ms");u.YScroll.setTransitionTime("0ms");u.XScroll.Reposition(p);u.YScroll.Reposition(o);return false};var b=function(r){var p=this.Touch,s=isNaN(p.TotalScrollX)?0:p.TotalScrollX,k=isNaN(p.TotalScrollY)?0:p.TotalScrollY,u=this.children[0].Mgr,t=null,n=0,m=0,l=0,h=0,o=0,j={},q=r.target;Qva.ConsoleLog.Log("Listbox["+p.Mgr.Name+"].touchEnd. FingerMoved:"+p.FingerMoved+" :: target row offset:"+q.parentNode.offset,Qva.ConsoleLog.SeverityTypes.Normal);clearTimeout(p.SelectRow);if(!g(r,p)){return true}t=p.TouchPointList[p.TouchPointList.length-1];for(o=p.TouchPointList.length-1;o>0&&t.dt-p.TouchPointList[o-1].dt<200;--o){}n=(t.dx-p.TouchPointList[o].dx)+t.dx+s;m=(t.dy-p.TouchPointList[o].dy)+t.dy+k;h=Math.max(0,Math.min(u.columns-u.visible_cols,Math.round(-n/u.colwidth)));l=c(u,m);n=u.colwidth*-h;m=u.rowHeight*-l;if(l!==0||h!==0){u.PaintExtraCells(h,l,u.visible_cols,u.visible_rows)}p.ElementToScroll.style.webkitTransitionDuration="800ms";p.ElementToScroll.style.webkitTransform="translate3d("+n+"px, "+m+"px, 0)";u.XScroll.setTransitionTime("800ms");u.YScroll.setTransitionTime("800ms");u.XScroll.Reposition(n);u.YScroll.Reposition(m);p.TotalScrollX=n;p.TotalScrollY=m;if(!p.FingerMoved&&!u.readOnly){if(p.MultiSelectMode&&!p.MultiSelectModeInitializing){Qva.Touch.Listbox.PreSelectMulti({row:q,lb:p,contentElem:this})}else{if(!p.MultiSelectMode){Qva.Touch.Listbox.PreSelectSingle({row:q,lb:p});p.ResetScroll()}}}p.MultiSelectModeInitializing=false;if(Qva.Touch.EventListenerExists){this.removeEventListener("touchmove",f,false);this.removeEventListener("touchend",b,false)}else{this.ontouchmove=null;this.ontouchend=null}r.stopPropagation();r.preventDefault();return true};d.Touch={ElementToScroll:d.children[0].children[0],Scrollbar:new Qva.Touch.Scrollbar(d),Mgr:d.children[0].Mgr,MultiSelectMode:false,TouchStartX:0,TouchStartY:0,TouchStartTime:0,TmpScrollX:0,TmpScrollY:0,TotalScrollY:0,TotalScrollX:0,FingerMoved:false,ToggleSelect:false,ResetScroll:function(){this.ElementToScroll.style.webkitTransform="";this.TotalScrollX=0;this.TotalScrollY=0;this.Mgr.YScroll.Reposition(0);this.Mgr.XScroll.Reposition(0)}};d.Touch.ElementToScroll.style.webkitTransform="translate3d(0px, 0px, 0)";d.Touch.ElementToScroll.style.webkitTransitionTimingFunction="cubic-bezier(0,0,0.25,1)";d.Touch.ElementToScroll.style.webkitTransitionProperty="-webkit-transform";d.addEventListener("touchstart",a,true)}},Chart:{DelayBeforePopup:500,Pinch:false,AddTouchSupport:function(d){function a(){if(d.fingerDown){clearTimeout(d.fingerDown);delete (d.fingerDown);Qva.ConsoleLog.Log("clear",Qva.ConsoleLog.SeverityTypes.Normal)}}function b(g){var f=g.targetTouches?g.targetTouches[0].pageX:g.pageX,h=g.targetTouches?g.targetTouches[0].pageY:g.pageY;Qva.ConsoleLog.Log("Chart.touchStart:"+d.Name,Qva.ConsoleLog.SeverityTypes.Normal);if(Qva.Touch.Listbox.SelectMenu&&Qva.Touch.Listbox.SelectMenu.Visible){Qva.Touch.Listbox.SelectMenu.Hide(true)}if(!d.IsSelectable){return true}if(g.touches.length!==1){Qva.Touch.Chart.Pinch=true;return true}if(IS_ANDROID&&Qva.Touch.Chart.Pinch===true){Qva.Touch.Chart.Pinch=false;return true}if(g.touches.length===1){d.fingerDown=setTimeout(function(){Qva.Touch.SelectionPopup.Show(d.Element,f,h);a()},Qva.Touch.Chart.DelayBeforePopup)}if(Qva.Touch.EventListenerExists){d.Element.addEventListener("touchend",c,false)}else{d.Element.ontouchend=c}if(IS_ANDROID){g.preventDefault()}return true}function c(f){Qva.ConsoleLog.Log("Chart.touchEnd",Qva.ConsoleLog.SeverityTypes.Verbose);a();if(f.targetTouches.length>0){return false}if(Qva.Touch.EventListenerExists){d.Element.removeEventListener("touchend",c,false)}else{d.Element.ontouchend=null}return false}d.Element.className+=" Suppress-Callout";d.Element.ontouchstart=b;if(Qva.Touch.SelectionPopup===null){Qva.ConsoleLog.Log("Hover object has been created...",Qva.ConsoleLog.SeverityTypes.Normal);Qva.Touch.SelectionPopup=new Qva.Touch.HoverObject()}}}};Qva.Touch.HoverObject=function(a){Resizer=function(f,d,c,b){var g=document.createElement("div");g.className="Touch-ResizeHandle-Inner";this.Element=document.createElement("div");this.Element.className="Touch-ResizeHandle-Outer";this.Element.appendChild(g);this.Element.ObjRef=this;if(b){this.OnResize=b}if(c){this.BeforeResize=c}this.SetPosition(f,d);this.Element.ontouchstart=this.TouchStart};Resizer.prototype={Element:null,OnResize:null,BeforeResize:null,TouchCoord:{x:0,y:0},TouchStart:function(b){Qva.ConsoleLog.Log("Resizer.touchStart fired",Qva.ConsoleLog.SeverityTypes.Verbose);this.ontouchmove=this.ObjRef.TouchMove;this.ontouchend=this.ObjRef.TouchEnd;this.ObjRef.TouchCoord.x=b.targetTouches?b.targetTouches[0].clientX:b.clientX;this.ObjRef.TouchCoord.y=b.targetTouches?b.targetTouches[0].clientY:b.clientY;if(this.ObjRef.BeforeResize.fn){this.ObjRef.BeforeResize.fn.apply(this.ObjRef.BeforeResize.scope||this,[b])}b.stopPropagation();b.preventDefault()},TouchMove:function(f){Qva.ConsoleLog.Log("Resizer.touchMove fired",Qva.ConsoleLog.SeverityTypes.Verbose);var g=f.targetTouches?f.targetTouches[0].clientX:f.clientX,d=f.targetTouches?f.targetTouches[0].clientY:f.clientY,b=this.ObjRef.TouchCoord.x-g,c=this.ObjRef.TouchCoord.y-d;this.ObjRef.TouchCoord.x-=b;this.ObjRef.TouchCoord.y-=c;if(this.ObjRef.OnResize.fn){this.ObjRef.OnResize.fn.apply(this.ObjRef.OnResize.scope,[f,{width:b,height:c}])}f.stopPropagation();f.preventDefault()},TouchEnd:function(b){Qva.ConsoleLog.Log("Resizer.touchEnd fired",Qva.ConsoleLog.SeverityTypes.Verbose);this.ontouchmove=null;this.ontouchend=null;b.stopPropagation();b.preventDefault()},SetPosition:function(b,c){this.Element.style.left=b-7+"px";this.Element.style.top=c-7+"px"}};SelectionRect=function(d,c,f,g,b){this.Element=document.createElement("div");this.Element.className="TouchSelectionRect img_move_arrows";this.Element.style.border="2px solid green";this.Size.defaultWidth=d;this.Size.defaultHeight=c;this.Element.ObjRef=this;this.Element.OnMove=g;this.Element.BeforeMove=f;this.Element.AfterMove=b;this.SetSize(d,c);this.Element.ontouchstart=this.TouchStart;return this};SelectionRect.prototype={Element:{BeforeMove:{fn:null,scope:null},OnMove:{fn:null,scope:null},AfterMove:{fn:null,scope:null},ObjRef:null},StartTouch:{x:0,y:0},Size:{defaultWidth:0,defaultHeight:0,currentWidth:0,currentHeight:0},TouchStart:function(b){Qva.ConsoleLog.Log("SelectionRect.touchStart fired",Qva.ConsoleLog.SeverityTypes.Verbose);this.ObjRef.StartTouch.x=b.targetTouches?b.targetTouches[0].clientX:b.clientX;this.ObjRef.StartTouch.y=b.targetTouches?b.targetTouches[0].clientY:b.clientY;this.ontouchmove=this.ObjRef.TouchMove;this.ontouchend=this.ObjRef.TouchEnd;if(this.BeforeMove.fn){this.BeforeMove.fn.apply(this.BeforeMove.scope||this,[b,this.ObjRef.StartTouch])}b.stopPropagation();b.preventDefault()},TouchMove:function(g){Qva.ConsoleLog.Log("SelectionRect.touchMove fired",Qva.ConsoleLog.SeverityTypes.Verbose);var h=this.ObjRef.StartTouch,f=g.targetTouches?g.targetTouches[0].clientX:g.clientX,d=g.targetTouches?g.targetTouches[0].clientY:g.clientY,c=h.x-f,b=h.y-d;if(this.OnMove.fn){this.OnMove.fn.apply(this.OnMove.scope,[g,{x:c,y:b}])}g.stopPropagation();g.preventDefault()},TouchEnd:function(b){Qva.ConsoleLog.Log("SelectionRect.touchEnd fired",Qva.ConsoleLog.SeverityTypes.Verbose);b.returnValue=false;this.ontouchmove=null;this.ontouchend=null;if(this.AfterMove.fn){this.AfterMove.fn.apply(this.AfterMove.scope,[b])}},SetSize:function(c,b){this.Size.currentWidth=c;this.Size.currentHeight=b;this.Element.style.width=c+"px";this.Element.style.height=b+"px"},ResetSize:function(){this.SetSize(this.Size.defaultWidth,this.Size.defaultHeight)}};this.Element=document.createElement("div");this.Element.HoverRef=this;this.Element.className="Suppress-Callout";this.Element.style.position="absolute";this.Element.style.display="none";this.Element.style.zIndex=999;this.Element.IsSelectionPopup=true;this.MenuObj=new Qva.Touch.SelectionMenu({AddPointerElem:true,Buttons:[{Fn:this.MakeSelection,Scope:this,CssClass:"img_accept_tick"},{Fn:this.Hide,Scope:this,CssClass:"img_cancel_cross"}],Style:{"margin-left":"-15px"}});this.Element.appendChild(this.MenuObj.Element);this.SelectionObj=new SelectionRect(this.Size.width,this.Size.height,{fn:this.BeforeMove,scope:this},{fn:this.OnMove,scope:this},{fn:this.AfterMove,scope:this});this.Element.appendChild(this.SelectionObj.Element);this.ResizerObj=new Resizer(this.Size.width,this.Size.height,{fn:this.BeforeResize,scope:this},{fn:this.OnResize,scope:this});this.Element.appendChild(this.ResizerObj.Element);document.documentElement.appendChild(this.Element)};Qva.Touch.HoverObject.prototype={Element:null,ChartElement:null,MenuObj:null,SelectionObj:null,ResizerObj:null,MinWidth:15,MinHeight:15,Size:{width:100,height:80},CurrentPos:{left:0,top:0},Limits:{maxWidth:0,maxHeight:0,xMin:0,xMax:0,yMin:0,yMax:0,dragLeft:0,dragRight:0,dragTop:0,dragBottom:0},DefineLimits:function(){var b=Qva.Touch.GetCoordinatesForElem(this.ChartElement),c=Qva.Touch.GetCoordinatesForElem(this.SelectionObj.Element),h=getClientHeight(this.MenuObj.Element),f=getClientWidth(this.ChartElement),d=getClientHeight(this.ChartElement),a=getClientWidth(this.SelectionObj.Element),g=getClientHeight(this.SelectionObj.Element);this.Limits.xMin=b.x;this.Limits.xMax=b.x+f-a;this.Limits.yMin=b.y-h;this.Limits.yMax=b.y+d-g-h;this.Limits.maxWidth=b.x+f-c.x;this.Limits.maxHeight=b.y+d-c.y;this.Limits.dragLeft=c.x-b.x;this.Limits.dragRight=c.x-(b.x+f-a);this.Limits.dragTop=c.y-b.y;this.Limits.dragBottom=c.y-(b.y+d-g)},Show:function(c,b,f){Qva.ConsoleLog.Log("Show popup",Qva.ConsoleLog.SeverityTypes.Normal);this.ChartElement=c;this.Element.style.display="";this.Element.style.webkitTransform="translate3d(0px, 0px, 0)";this.DefineLimits();var a=b-(this.Size.width/2),d=f-getClientHeight(this.MenuObj.Element)-(this.Size.height/2);if(IS_IPAD){a=Math.max(a,this.Limits.xMin);a=Math.min(a,this.Limits.xMax);d=Math.max(d,this.Limits.yMin);d=Math.min(d,this.Limits.yMax)}this.Element.style.left=a+"px";this.Element.style.top=d+"px";this.CurrentPos.left=a;this.CurrentPos.top=d;this.SelectionObj.ResetSize(this.Size.width,this.Size.height);this.ResizerObj.SetPosition(this.Size.width,this.Size.height);Qva.Touch.Events.OnTouchStart.AddListener(new Qva.Touch.Events.ListenerObject("SelectionPopup",this,function(g){if(!g.target.offsetParent.IsSelectionPopup&&g.target!==this.ChartElement){Qva.ConsoleLog.Log("Touch outside SelectionPopup. Will be closed.",Qva.ConsoleLog.SeverityTypes.Normal);this.Hide()}}))},Hide:function(){Qva.ConsoleLog.Log("HoverObject.Hide",Qva.ConsoleLog.SeverityTypes.Normal);this.Element.style.display="none";Qva.Touch.Events.OnTouchStart.RemoveListener("SelectionPopup");Qva.ConsoleLog.Log("Removed SelPopup listener",Qva.ConsoleLog.SeverityTypes.Normal)},MakeSelection:function(){var b=Qva.GetObjectBinder(this.ChartElement),i=Qva.Touch.GetCoordinatesForElem(this.ChartElement),d=Qva.Touch.GetCoordinatesForElem(this.SelectionObj.Element),g=d.x-i.x,f=d.y-i.y,c=getClientWidth(this.SelectionObj.Element),a=getClientHeight(this.SelectionObj.Element),h=g+":"+f+":"+c+":"+a+":"+getClientWidth(this.ChartElement)+":"+getClientHeight(this.ChartElement);Qva.ConsoleLog.Log("Make selection. rect: "+h,Qva.ConsoleLog.SeverityTypes.Normal);b.Set(this.ChartElement.Name,"rect",h,true);this.Hide()},BeforeMove:function(b,a){Qva.ConsoleLog.Log("BeforeMove fired",Qva.ConsoleLog.SeverityTypes.Normal);this.DefineLimits()},OnMove:function(b,a){a.x=Math.min(a.x,this.Limits.dragLeft);a.x=Math.max(a.x,this.Limits.dragRight);a.y=Math.min(a.y,this.Limits.dragTop);a.y=Math.max(a.y,this.Limits.dragBottom);this.Element.style.webkitTransform="translate3d("+-a.x+"px, "+-a.y+"px, 0)"},AfterMove:function(c){var b=this.Element.style.webkitTransform,a=parseInt(b.substring(b.indexOf("(")+1,b.indexOf("px")),10),d=parseInt(b.substring(b.indexOf(",")+1,b.lastIndexOf("px")),10);Qva.ConsoleLog.Log("AfterMove fired",Qva.ConsoleLog.SeverityTypes.Normal);this.CurrentPos.left+=a;this.CurrentPos.top+=d;this.Element.style.webkitTransform="translate3d(0px, 0px, 0)";this.Element.style.left=this.CurrentPos.left+"px";this.Element.style.top=this.CurrentPos.top+"px"},BeforeResize:function(a){Qva.ConsoleLog.Log("BeforeResize fired",Qva.ConsoleLog.SeverityTypes.Normal);this.DefineLimits()},OnResize:function(g,c){var b=Math.max(this.SelectionObj.Size.currentWidth-c.width,this.MinWidth),d=Math.min(this.Limits.maxWidth,b),f=Math.max(this.SelectionObj.Size.currentHeight-c.height,this.MinHeight),a=Math.min(this.Limits.maxHeight,f);this.SelectionObj.SetSize(d,a);this.ResizerObj.SetPosition(d,a)}};Qva.Touch.Scrollbar=function(b,a){this.Element=document.createElement("div");this.Element.className="TouchScrollbar";this.Id=b;this.Visible=false;return this};Qva.Touch.Scrollbar.prototype={Element:null,Id:"",ScrollStep:0,Visible:false,Show:function(b,c){var d=Math.max(Math.round(b*b/c,10)),a=b-d;this.ScrollStep=a/(b-c);this.Element.style.height=d+"px";this.Element.style["-webkit-transition-duration"]="100ms";this.Element.style.opacity=1;this.Visible=true;Qva.ConsoleLog.Log("Scrollbar["+this.Id+"].Show. VisibleAreaH: "+b+" :: scrollH: "+c+" :: ScrollbarHeight: "+d+" :: ScrollStep: "+this.ScrollStep,Qva.ConsoleLog.SeverityTypes.Verbose)},Reposition:function(b){var a=b*this.ScrollStep;this.Element.style.webkitTransform="translate(0px, "+a+"px)";Qva.ConsoleLog.Log("Scrollbar["+this.Id+"].Reposition: yVal: "+b+" :: scrollstep: "+this.ScrollStep+" :: newVal: "+a,Qva.ConsoleLog.SeverityTypes.Verbose)},Hide:function(){this.Element.style["-webkit-transition-duration"]="600ms";this.Element.style.opacity=0;this.Visible=false;Qva.ConsoleLog.Log("Scrollbar["+this.Id+"].Hide",Qva.ConsoleLog.SeverityTypes.Verbose)}};Qva.Touch.Listbox.PreSelectSingle=function(a){a.lb.Mgr.Selections.ctrl=false;a.lb.Mgr.Selections.Start=a.lb.Mgr.Selections.End=a.row.parentNode.offset;a.lb.Mgr._SaveCurrentSelection();a.lb.Mgr._IndicateCellsToSelect();a.lb.Mgr._EndSelect(false)};Qva.Touch.Listbox.PreSelectMulti=function(a){var b=a.lb.Mgr,c=a.row.parentNode.offset;if(!a.lb.MultiSelectMode){if(!Qva.Touch.Listbox.SelectMenu){Qva.Touch.Listbox.SelectMenu=new Qva.Touch.Listbox.SelectionMenu()}if(Qva.Touch.Listbox.SelectMenu.Visible){Qva.Touch.Listbox.SelectMenu.Hide(true)}Qva.Touch.Listbox.SelectMenu.Show(a.lb);a.lb.ToggleSelect=true;Qva.ConsoleLog.Log("PreSelectMulti - show menu",Qva.ConsoleLog.SeverityTypes.Verbose)}if(a.lb.MultiSelectModeInitializing&&a.row.parentNode.className.indexOf("QvSelected")!==-1){return}b.Selections.ctrl=a.lb.ToggleSelect;b.Selections.Start=b.Selections.End=c;b._SaveCurrentSelection();b._IndicateCellsToSelect()};Qva.Touch.SelectionMenu=function(d){var b=null,k=null,a=null,c=null,j=null,i=this,h=d.Buttons.length,f=0;this.Element=document.createElement("div");this.Element.className="TouchSelectionMenu";b=document.createElement("div");b.className="TouchSelectionMenu-Panel";this.Element.appendChild(b);for(;f<h;f++){k=document.createElement("div");k.className="TouchSelectionMenu-Button-Background TouchSelectionMenu-Button-Background-Default";k.style.marginLeft=f*4+"px";k.ontouchstart=this.OnBtnTouchStart(this,d.Buttons[f]);b.appendChild(k);a=document.createElement("div");a.className="TouchSelectionMenu-Gloss";k.appendChild(a);c=document.createElement("div");c.className="TouchSelectionMenu-Button "+d.Buttons[f].CssClass;k.appendChild(c)}if(d.AddPointerElem){j=document.createElement("div");j.className="TouchSelectionMenu-Pointer-Down";j.style.marginLeft="30px";j.style.marginTop="-1px";this.Element.appendChild(j)}for(var g in d.Style){this.Element.style[g]=d.Style[g]}return this};Qva.Touch.SelectionMenu.prototype={Element:null,Show:function(a,b){this.Element.style.left=a+"px";this.Element.style.top=b+"px";this.Element.style.visibility="visible"},Hide:function(){this.Element.style.visibility="hidden"},IsTapInsideBtn:function(b,h,c){var g=Qva.Touch.GetCoordinatesForElem(c),a=getClientWidth(c)/2,f=g.x+a,d=g.y+a;return(Math.pow((b-f),2)+Math.pow((h-d),2)<Math.pow(a,2))},ToggleButtonState:function(b,a){if(a){b.className=b.className.replace(" TouchSelectionMenu-Button-Background-Default"," TouchSelectionMenu-Button-Background-Pressed");b.firstChild.style.display="none"}else{b.className=b.className.replace(" TouchSelectionMenu-Button-Background-Pressed"," TouchSelectionMenu-Button-Background-Default");b.firstChild.style.display=""}},OnBtnTouchStart:function(a,b){return function(c){if(c.touches.length==1&&a.IsTapInsideBtn(c.touches[0].clientX,c.touches[0].clientY,this)){a.ToggleButtonState(this,true);this.ontouchmove=function(d){var f=d.changedTouches[0];if(!a.IsTapInsideBtn(f.clientX,f.clientY,this)){this.ontouchend=null;this.ontouchmove=null;a.ToggleButtonState(this,false)}};this.ontouchend=function(d){this.ontouchmove=null;this.ontouchend=null;setTimeout(function(f){return function(){a.ToggleButtonState(f,false);setTimeout(function(){b.Fn.apply(b.Scope,[d])},200)}}(this),100)};c.stopPropagation();c.preventDefault()}}}};Qva.Touch.Extend=function(c,a){for(var b in a.prototype){if(!(b in c.prototype)){c.prototype[b]=a.prototype[b]}}return c};Qva.Touch.Listbox.SelectionMenu=function(){var a={addPointerElem:false,Buttons:[{Fn:this.Select,Scope:this,CssClass:"img_accept_tick"},{Fn:this.Clear,Scope:this,CssClass:"img_clear_eraser"},{Fn:this.Hide,Scope:this,CssClass:"img_cancel_cross"}],Style:{position:"absolute",display:"none"}};document.documentElement.appendChild(Qva.Touch.SelectionMenu.call(this,a).Element)};Qva.Touch.Listbox.SelectionMenu.prototype={Visible:false,ListboxObject:null,Show:function(b){var c=b.Mgr.PageBinder.Element,a=Qva.GetAbsolutePageCoords(c),f=document.getElementById("PageContainer"),g=0,d=document.getElementById("TouchSelectionMenu-PointerElem");this.ListboxObject=b;this.Element.style.display="";this.Visible=true;if(!d){d=document.createElement("div");d.id="TouchSelectionMenu-PointerElem";this.Element.appendChild(d)}if(parseInt(a.x+c.clientWidth+this.Element.clientWidth,10)<f.clientWidth){left=a.x+c.clientWidth+"px";d.className="TouchSelectionMenu-Pointer-Left";d.style.marginLeft=-d.offsetWidth+1+"px";this.Element.style.marginLeft=d.offsetWidth+"px"}else{left=a.x-this.Element.clientWidth+"px";d.className="TouchSelectionMenu-Pointer-Right";d.style.marginLeft=this.Element.clientWidth-1+"px";this.Element.style.marginLeft=-d.offsetWidth+"px"}d.style.marginTop=(-this.Element.clientHeight/2)-(d.offsetHeight/2)+"px";this.Element.style.top=a.y+10+"px";this.Element.style.left=left;Qva.Touch.Events.OnTouchStart.AddListener(new Qva.Touch.Events.ListenerObject("ListboxMenu",this,function(h){if(h.target!==this.Element||h.target!==this.ListboxObject.ElementToScroll){Qva.ConsoleLog.Log("Touch outside Listbox menu. Will be closed.",Qva.ConsoleLog.SeverityTypes.Normal);this.Hide(true)}}))},Hide:function(a){this.Element.style.display="none";this.ListboxObject.MultiSelectMode=false;this.ListboxObject.Mgr.Selections={Selected:[]};if(a){this.ListboxObject.Mgr.PageBinder.QueuePostPaintMessage(this.ListboxObject.Mgr)}this.ListboxObject.ResetScroll();this.Visible=false;Qva.Touch.Events.OnTouchStart.RemoveListener("ListboxMenu")},Select:function(){this.ListboxObject.Mgr._EndSelect(this.ListboxObject.ToggleSelect);this.ListboxObject.ResetScroll();this.Hide(false)},Clear:function(){this.ListboxObject.Mgr.Selections.ctrl=this.ListboxObject.ToggleSelect=false;this.ListboxObject.Mgr.Selections={Selected:[]};this.ListboxObject.Mgr._IndicateCellsToSelect()}};Qva.Touch.Extend(Qva.Touch.Listbox.SelectionMenu,Qva.Touch.SelectionMenu);Qva.Touch.Init();
