var $=function(a){if(a){return document.getElementById(a)}};var $Form={submitById:function(c,b){var a=$(c);if(a){if(b){a.action=b}a.submit()}}};var canvera=new Object();canvera.util=new Object();canvera.http=new Object();canvera.dhtml=new Object();canvera.util.Map=function(){var d=new Object();var b=0;var c=new Array();var a=new Array();this.put=function(e,f){if(typeof e=="string"&&typeof f!="undefined"){d[e]=f;c.push(e);a.push(f);b++}};this.get=function(e){var f=null;if(typeof e=="string"){f=d[e]}return f};this.has=function(f,g){var e=false;if(typeof f=="string"&&typeof g!="undefined"){if(typeof d[f]!="undefined"&&d[f]==g){e=true}}return e};this.hasKey=function(f){var e=false;if(typeof f=="string"){for(eachKey in d){if(eachKey==f){e=true;break}}}return e};this.hasValue=function(f){var e=false;if(typeof f=="undefined"){for(eachKey in d){if(d[eachKey]==f){e=true;break}}}return e};this.getKeys=function(){return c};this.getValues=function(){return a};this.getSize=function(){return b}};canvera.http.Request=function(b){var f="GET";var a=null;var c=true;var d=new canvera.util.Map();var e=null;if(typeof b=="object"){if(typeof b.method=="string"){switch(b.method.toUpperCase()){case"GET":f="GET";break;case"POST":f="POST";break}}if(typeof b.url=="string"){a=b.url}if(typeof b.async=="boolean"){c=b.async}if(typeof b.params=="object"){for(name in b.params){d.put(name,b.params[name])}}if(typeof b.callback=="function"){e=b.callback}}this.getMethod=function(){return f};this.isGet=function(){return f=="GET"};this.useGet=function(){f="GET"};this.usePost=function(){f="POST"};this.isPost=function(){return f=="POST"};this.isAsynchronous=function(){return c};this.isSynchronous=function(){return !c};this.setAsynchronous=function(){c=true};this.setSynchronous=function(){c=false};this.getUrl=function(){return a};this.setUrl=function(g){if(typeof g=="string"){a=g}};this.getParameterMap=function(){return d};this.setParameterMap=function(g){if(typeof g=="object"&&g.constructor==canvera.util.Map){d=g}};this.getCallback=function(){return e};this.setCallback=function(g){if(typeof g=="function"){e=g}};this.getQueryString=function(){var n=null;var j=d.getKeys();if(j.length>0){n="";for(var i=0;i<j.length;i++){var h=j[i];var k=d.get(h);if(i>0){n+="&"}if(k.constructor==Array){for(var g=0;g<k.length;g++){var m=k[g];var l=h+"="+m;if(g>0){n+="&"}n+=l}}else{var l=h+"="+k;n+=l}}}return n};this.serialize=function(){var h=this.getQueryString();var g=a;if(typeof h=="string"&&h.length>0){if(g.indexOf("?")==-1){g=g+"?"+h}else{if(g.indexOf("?")==g.length-1||g.indexOf("&")==g.length-1){g=g+h}else{g=g+"&"+h}}}return g}};canvera.http.Response=function(b){var d=null;var g=null;var c=null;var f=canvera.util.Map();var e=null;var a=null;if(typeof b.status=="number"){d=b.status}if(typeof b.message=="string"){g=b.message}if(typeof b.headers=="string"){c=b.headers}if(typeof b.text=="string"){e=b.text}if(typeof b.xml=="object"){a=b.xml}this.getStatusCode=function(){return d};this.getStatusMessage=function(){return g};this.getHeader=function(h){return f.get(h)};this.getHeaderString=function(){return c};this.getText=function(){return e};this.getXml=function(){return a}};canvera.http.Processor={process:function(c){if(c){var b=c.getParameterMap();if(b){var e=""+new Date().getTime();b.put(e,e);c.setParameterMap(b)}}var d=null;if(window.ActiveXObject){d=new ActiveXObject("Microsoft.XMLHTTP")}else{d=new XMLHttpRequest()}if(d){if(c.isGet()){d.open(c.getMethod(),c.serialize(),c.isAsynchronous())}else{if(c.isPost()){d.open(c.getMethod(),c.getUrl(),c.isAsynchronous())}}var a=function(g){var f={status:g.status,message:g.statusText,headers:g.getAllResponseHeaders(),text:g.responseText,xml:g.responseXML};return new canvera.http.Response(f)};if(c.isAsynchronous()){d.onreadystatechange=function(){if(d.readyState==4){var f=a(d);var g=c.getCallback();if(g){g(c,f)}}}}if(c.isGet()){d.send(null)}else{if(c.isPost()){d.send(c.getQueryString())}}if(c.isSynchronous()){return a(d)}}}};canvera.dhtml.Popup=function(v){if(typeof(v)=="object"&&typeof(v.name)=="string"&&v.name.length>0){var A=v.name;var j=v.src;var k=v.scheme;var z=v.title;var g=v.left;var l=v.top;var n=v.width;var m=v.height;var p=v.overflow;var x=v.center;var t=v.modal;var f=v.draggable;var i=null;var o=$(v.popupElement);var u=$(v.dragHandle);var q=$(v.contentHolder);var a=null;var d=v.onLoad;var h=v.onOpen;var e=v.onClose;var w=v.onUnload;var y=false;var s;var r;var c;var b;this.open=function(B){if(typeof(B)=="object"){if(typeof(B.src)=="string"&&B.src.length>0){j=B.src}if(typeof(B.scheme)=="string"&&B.scheme.length>0){k=B.scheme}if(typeof(B.title)=="string"){z=B.title}if(typeof(B.left)=="number"&&B.left>=0){g=B.left}if(typeof(B.top)=="number"&&B.top>=0){l=B.top}if(typeof(B.width)=="number"&&B.width>0){n=B.width}if(typeof(B.height)=="number"&&B.height>0){m=B.height}if(typeof(B.overflow)=="string"&&B.overflow.length>0){p=B.overflow}if(typeof(B.center)!="undefined"){x=B.center}if(typeof(B.modal)!="undefined"){t=B.modal}if(typeof(B.draggable)!="undefined"){f=B.draggable}if(typeof(B.popupElement)=="string"&&B.popupElement.length>0){o=$(B.popupElement)}if(typeof(B.dragHandle)=="string"&&B.dragHandle.length>0){u=$(B.dragHandle)}if(typeof(B.contentHolder)=="string"&&B.contentHolder.length>0){q=$(B.contentHolder)}if(typeof(B.onLoad)=="function"){d=B.onLoad}if(typeof(B.onOpen)=="function"){h=B.onOpen}if(typeof(B.onClose)=="function"){e=B.onClose}if(typeof(B.onUnload)=="function"){w=B.onUnload}i=B.parameters}var C=this;if(o){if(o.parentNode!=document.body){o.parentNode.removeChild(o);document.body.appendChild(o)}o.onkeypress=function(E){var D;if(typeof(E)=="undefined"){D=27;E=window.event}else{D=E.DOM_VK_ESCAPE}if(E.keyCode==D){C.close()}}}if(f&&u&&o){u.onmousedown=function(D){u.style.cursor="move";if(typeof(D)=="undefined"){D=window.event}s=D.clientX;r=D.clientY;y=true};o.onmouseup=function(D){u.style.cursor="default";if(typeof(D)=="undefined"){D=window.event}y=false};o.onmousemove=function(D){if(typeof(D)=="undefined"){D=window.event}if(y){c=D.clientX;b=D.clientY;C.drag();s=c;r=b}};o.onmouseout=u.onmouseup}if(t){this.mask()}this.resize(n,m);this.overflow(p);this.load(j,i);if(x){this.center()}else{this.move(g,l)}this.show();this.onOpen()};this.drag=function(){if(o){var B=g+c-s;var E=l+b-r;var D=canvera.dhtml.Window.getViewportLeft()+canvera.dhtml.Window.getViewportWidth()-n;var C=canvera.dhtml.Window.getViewportTop()+canvera.dhtml.Window.getViewportHeight()-m;if(B>=0&&B<=D&&E>=0&&E<=C){this.move(B,E)}}};this.close=function(){this.onClose();this.hide();this.unload();if(t){this.unmask()}};this.show=function(){if(o){o.style.display="block"}if(q){q.style.display="block"}};this.hide=function(){if(q){q.style.display="none"}if(o){o.style.display="none"}};this.unload=function(){if(q){this.onUnload();q.innerHTML=""}};this.move=function(B,C){if(o){if(typeof(B)=="number"&&B>=0){g=B;o.style.left=B+"px"}if(typeof(C)=="number"&&C>=0){l=C;o.style.top=C+"px"}}};this.resize=function(B,C){if(q){if(typeof(n)=="number"&&n>=0){n=B;q.style.width=n-40+"px"}if(typeof(m)=="number"&&m>=0){m=C;q.style.height=m-67+"px"}}};this.load=function(F,E){if(q){if(typeof(F)=="string"&&F.length>0){switch(k){case"ajax":var D=new canvera.http.Request({url:F,params:E,async:false});var C=canvera.http.Processor.process(D);q.innerHTML=C.getText();break;case"dom":var B=$(F);if(B){q.innerHTML=B.innerHTML}break}this.onLoad()}}};this.overflow=function(B){if(q){q.style.overflow=p}};this.mask=function(){if(a==null||typeof(a)=="undefined"){a=document.createElement("div");document.body.appendChild(a);a.className="Mask";a.style.left="0px";a.style.top="0px";a.style.width=canvera.dhtml.Window.getPageWidth()+"px";a.style.height=canvera.dhtml.Window.getPageHeight()+"px";a.style.display="block"}};this.unmask=function(){if(a){document.body.removeChild(a);a=null}};this.onLoad=function(){if(typeof(d)=="function"){d()}};this.onOpen=function(){if(typeof(h)=="function"){h()}};this.onClose=function(){if(typeof(e)=="function"){e()}};this.onUnload=function(){if(typeof(w)=="function"){w()}};this.center=function(){var B=canvera.dhtml.Window.getViewportLeft()+(canvera.dhtml.Window.getViewportWidth()-n)/2;var C=canvera.dhtml.Window.getViewportTop()+(canvera.dhtml.Window.getViewportHeight()-m)/2;this.move(B,C)}}};canvera.dhtml.Window={getViewportWidth:function(){var a;if(typeof window.innerWidth!="undefined"){a=window.innerWidth}else{if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!=0){a=document.documentElement.clientWidth}else{a=document.getElementsByTagName("body")[0].clientWidth}}return a},getViewportHeight:function(){var a;if(typeof window.innerHeight!="undefined"){a=window.innerHeight}else{if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientHeight!="undefined"&&document.documentElement.clientHeight!=0){a=document.documentElement.clientHeight}else{a=document.getElementsByTagName("body")[0].clientHeight}}return a},getViewportLeft:function(){var a;if(window.pageXOffset){a=window.pageXOffset}else{if(document.body.scrollLeft){a=document.body.scrollLeft}else{a=document.documentElement.scrollLeft}}return a},getViewportTop:function(){var a;if(window.pageYOffset){a=window.pageYOffset}else{if(document.body.scrollTop){a=document.body.scrollTop}else{a=document.documentElement.scrollTop}}return a},getPageWidth:function(){var a;if(window.scrollMaxX){a=window.innerWidth+window.scrollMaxX}else{if(document.body.scrollWidth>document.documentElement.scrollWidth){a=document.body.scrollWidth}else{a=document.documentElement.scrollWidth}}return a},getPageHeight:function(){var a;if(window.scrollMaxY){a=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.documentElement.scrollHeight){a=document.body.scrollHeight}else{a=document.documentElement.scrollHeight}}return a}};canvera.dhtml.Browser={isIE:function(){if(document.all){return true}else{return false}}};canvera.dhtml.Selectable=function(b){this.id=b.id;this.element=b.element;this.onSelect=b.onSelect;this.onDeselect=b.onDeselect;this.name=b.name;this.value=b.value;var a="<input id='"+b.id+"' type='checkbox' name='"+b.name+"' value='"+b.value+"' style='display:none;'/>";document.write(a);b.element.select=function(){b.onSelect(b.element);b.element.onclick=b.element.deselect;$(b.id).checked=true};b.element.deselect=function(){b.onDeselect(b.element);b.element.onclick=b.element.select;$(b.id).checked=false};b.element.onclick=b.element.select;if(typeof canvera.dhtml.Selectable[b.name]=="undefined"){canvera.dhtml.Selectable[b.name]=new Array()}canvera.dhtml.Selectable[b.name].push(b.element)};canvera.dhtml.Selectable.selectAll=function(b){if(canvera.dhtml.Selectable[b]&&canvera.dhtml.Selectable[b].length>0){for(var a=0;a<canvera.dhtml.Selectable[b].length;a++){canvera.dhtml.Selectable[b][a].select()}}};canvera.dhtml.Selectable.deselectAll=function(b){if(canvera.dhtml.Selectable[b]&&canvera.dhtml.Selectable[b].length>0){for(var a=0;a<canvera.dhtml.Selectable[b].length;a++){canvera.dhtml.Selectable[b][a].deselect()}}};