function Button(g){this.setFocus=function(){b.className="mbut-focus"};this.blurFocus=function(){b.className="mbut"};this.hide=function(){e.style.display="none";b.style.display="none"};this.show=function(){e.style.display="block";b.style.display="block"};this.forceHide=function(){e.style.visibility="hidden";b.style.visibility="hidden";e.style.display="none";b.style.display="none"};this.forceShow=function(){e.style.visibility="";b.style.visibility="";e.style.display="";b.style.display=""};this.onMouseMove=function(l){l=l||window.event;if(typeof l.pageY=="undefined"&&typeof l.clientX=="number"&&document.documentElement){l.pageX=l.clientX+document.documentElement.scrollLeft;l.pageY=l.clientY+document.documentElement.scrollTop}var i=oy=0;var j=b;if(j.offsetParent){i=j.offsetLeft;oy=j.offsetTop;while(j=j.offsetParent){i+=j.offsetLeft;oy+=j.offsetTop}}j=b;var o=parseInt(j.scrollLeft);var n=parseInt(j.scrollTop);while(j=j.parentNode){o+=parseInt(j.scrollLeft?j.scrollLeft:0);n+=parseInt(j.scrollTop?j.scrollTop:0)}var p=l.pageX-i+o;var m=l.pageY-oy+n;var q=c.offsetWidth;var k=c.offsetHeight;c.style.top=m-(k+10)+"px";c.style.left=p-(q+f)+"px"};this.onMouseOut=function(h){b.onmousemove=function(){};return true};this.onMouseOver=function(h){b.onmousemove=a.onMouseMove;return true};this.onChange=function(h){if(g.onchange){g.onchange()}};this.getValue=function(){return c.value};this.setType=function(h){if(h!="file"){if(g.file){g.file=false}b.onmousemove=function(){};b.onmouseout=function(){};b.onmouseover=function(){};c.style.top="50px";c.style.left="50px"}else{b.onmouseout=this.onMouseOut;b.onmouseover=this.onMouseOver}};this.click=function(){e.onclick()};this.setMultiFunc=function(h){d=h;e.onclick=function(){for(var i in d){if(typeof(d[i])=="function"){d[i]()}}}};this.setNewFunc=function(h,j){var i='<table class="mbut_hover" cellpadding="0" cellspacing="0"><tbody><tr><td class="mbut-bico-br mbut_hover_left"><div class="mbutHovDiv"></div></td><td class="mbut-bico-bg mbut_hover_bg"><div align="center"><div class="mbutTextButton">'+h+'</div></div></td><td class="mbut-bico-br mbut_hover_right"><div class="mbutHovDiv"></div></td></tr></tbody></table>';e.innerHTML=i;if(typeof(j)=="function"){e.onclick=j}};var a=this;var d;var b=document.createElement("A");b.tabIndex="-1";b.href="#";b.className="mbut";var e=document.createElement("DIV");if(g.color=="red"){e.className="mbut-color-red"}else{e.className="mbut-color-blue"}this.setNewFunc(g.name,g.func);b.appendChild(e);g.target.appendChild(b);if(g.file){var f=-20;if(is_gecko){f=140}if(is_chrome){f=-20}if(is_safari){f=-10}b.style.height=+25+"px";b.style.overflow="hidden";var c=document.createElement("INPUT");c.setAttribute("type","file");if(g.fileid){c.name=g.fileid;c.id=g.fileid}else{c.name="file"}c.className="mbut-hf";c.tabIndex="-1";c.onchange=this.onChange;b.onmouseout=this.onMouseOut;b.onmouseover=this.onMouseOver;b.appendChild(c)}}function CheckBox(f){this.onselect=function(g){if(f.id){f.onselectfunc(f.id)}return false};this.check=function(h){if(h!=true){var g=(h)?h:window.event;disableEventPropagation(g)}if("checked"==e.className){e.className="unchecked"}else{e.className="checked"}if(f.checkfunc){f.checkfunc()}return false};this.click=function(h){var g=(h)?h:window.event;disableEventPropagation(g);if(f.clickfunc){f.clickfunc()}else{a.check(true)}};this.select=function(){c.className="checkbox-main checkbox-selected"};this.deselect=function(){c.className="checkbox-main-hover"};this.setName=function(g){b.innerHTML='<a hreff="#" class="checkbox-a" title="'+g+'"><span class="checkbox-text">'+g+"</span></a>"};this.setNameByTextNode=function(h){b.innerHTML="";var g=document.createElement("A");g.href="#";g.className="checkbox-a";g.title=h.nodeValue;var i=document.createElement("SPAN");i.className="checkbox-text";i.appendChild(h);g.appendChild(i);b.appendChild(g)};this.setColor=function(g){e.style.backgroundColor=g};this.setChecked=function(g){if(g){e.className="checked";d="checked"}else{e.className="unchecked";d="unchecked"}};this.isChanged=function(){return(d!=e.className)?true:false};this.getChecked=function(){return(e.className=="checked")?true:false};this.getElement=function(){return c};this.init=function(){c=document.createElement("DIV");if(f.disableHover){c.className="checkbox-main"}else{c.className="checkbox-main-hover"}if(f.id){c.setAttribute("name",f.id)}c.onclick=a.click;e=document.createElement("DIV");e.className="unchecked";e.onclick=a.check;if(f.onselectfunc){c.onmousedown=a.onselect}c.appendChild(e);b=document.createElement("DIV");b.className="checkbox-over";if(f.name){a.setName(f.name)}if(f.color){a.setColor(f.color)}a.setChecked(f.checked);c.appendChild(b)};var a=this;var c,e,b;var d="unchecked";a.init()}function ColorPicker(e){this.showPicker=function(){d=false;var v=getWindowWidth();var o=getWindowHeight();var p=parseInt(h.offsetWidth)-parseInt(j.offsetWidth);var q=parseInt(k.offsetLeft);var s=parseInt(k.offsetTop);var u=parseInt(112);var w=parseInt(156);var r=parseInt(h.offsetWidth)-parseInt(j.offsetWidth);var t=0;if(v<(q+r+u)){p=v-(q+20+u)}if(o<(s+w)){t=o-(s+w)}f.style.left=p+"px";f.style.top=t+"px";f.style.display="";addHandler(document.body,"mouseup",l.onMouseUp);addHandler(document.body,"mousedown",l.onMouseDown)};this.closePicker=function(){f.style.display="none";removeHandler(document.body,"mouseup",l.onMouseUp);removeHandler(document.body,"mousedown",l.onMouseDown)};this.onMouseUp=function(o){if(d){l.closePicker()}};this.setDisable=function(){j.style.display="none"};this.setEnable=function(){j.style.display=""};this.onMouseDown=function(r){var o=(r)?r:window.event;var q=(o.target)?o.target:o.srcElement;var p=r;while(q!=null){if(q.className=="cpr-color"){d=true;l.setColor(q.style.backgroundColor);return true}q=q.parentNode}l.closePicker()};this.setColor=function(o){h.style.backgroundColor=o};this.letColor=function(p,o){h.style.backgroundColor=m[p][o]};this.getColor=function(){if(/^rgb/.test(h.style.backgroundColor)){return l.rgbConvert(h.style.backgroundColor)}else{return h.style.backgroundColor}};this.createPalette=function(){var r=document.createElement("TABLE");tody=document.createElement("TBODY");r.setAttribute("cellSpacing","0");r.setAttribute("width","110");r.setAttribute("height","154");r.setAttribute("cellPadding","0");r.setAttribute("border","0");for(var q=0;q<7;++q){var s=document.createElement("TR");for(var o=0;o<5;++o){var t=document.createElement("TD");var p=document.createElement("DIV");p.className="cpr-color";p.style.backgroundColor=m[q][o];t.appendChild(p);s.appendChild(t)}tody.appendChild(s)}r.appendChild(tody);return r};this.rgbConvert=function(o){o=o.replace(/rgb\(|\)/g,"").split(",");o[0]=parseInt(o[0],10).toString(16).toLowerCase();o[1]=parseInt(o[1],10).toString(16).toLowerCase();o[2]=parseInt(o[2],10).toString(16).toLowerCase();o[0]=(o[0].length==1)?"0"+o[0]:o[0];o[1]=(o[1].length==1)?"0"+o[1]:o[1];o[2]=(o[2].length==1)?"0"+o[2]:o[2];return("#"+o.join(""))};var m=new Array();m=[["#d3d60d","#ff9600","#c87b18","#c87b18","#532f0c"],["#df4343","#d90000","#b50000","#901c1c","#5e010b"],["#e455c1","#f205ef","#c405c6","#9510b6","#5c0376"],["#656be6","#4a41fb","#1510e1","#13169d","#05086a"],["#65e1e6","#32cae5","#0ca3b9","#0a8399","#054e5e"],["#65e67a","#32e554","#0cb929","#028017","#025000"],["#b7b7b7","#818282","#595959","#2e2e2e","#000000"]];var n,g;var d=false;var k=e;var c,b,a;var l=this;var i=document.createElement("DIV");i.className="cpr-main";var h=document.createElement("INPUT");h.setAttribute("disabled","true");h.className="cpr-input";i.appendChild(h);var j=document.createElement("DIV");j.className="cpr-icon";j.onclick=l.showPicker;i.appendChild(j);var f=document.createElement("DIV");f.className="cpr";f.appendChild(this.createPalette());f.style.display="none";k.style.position="relative";k.appendChild(f);k.appendChild(i)}var agt=navigator.userAgent.toLowerCase();var is_gecko=(agt.indexOf("gecko")!=-1);var is_opera=(agt.indexOf("opera")!=-1);var is_chrome=(agt.indexOf("chrome")!=-1);var is_safari=(agt.indexOf("safari")!=-1);var is_ie=(agt.indexOf("msie")!=-1);var is_major=parseInt(navigator.appVersion);var is_ie6=(is_ie&&(is_major==4)&&(agt.indexOf("msie 6.")!=-1));var is_ie7=(is_ie&&(is_major==4)&&(agt.indexOf("msie 7.")!=-1));var is_ie8=(is_ie&&(is_major==4)&&(agt.indexOf("msie 8.")!=-1));var is_gecko1=(is_gecko&&(agt.indexOf("firefox/1")!=-1));var is_gecko2=(is_gecko&&(agt.indexOf("firefox/1")!=-1));var is_gecko3=(is_gecko&&(agt.indexOf("firefox/1")!=-1));function loadCss(a){var c=document.getElementsByTagName("head")[0];var b=document.createElement("link");b.rel="stylesheet";b.type="text/css";b.href=a;c.appendChild(b)}if(is_ie6){loadCss("../style_magnum/wm5js-ie6-min.css")}if(is_ie7){loadCss("../style_magnum/wm5js-ie7-min.css")}if(is_ie8){loadCss("../style_magnum/wm5js-ie8-min.css")}if(is_safari){loadCss("../style_magnum/wm5js-safari-min.css")}if(is_chrome){loadCss("../style_magnum/wm5js-chrome-min.css")}function $(a){return !$.cache[a]?$.cache[a]=document.getElementById(a):$.cache[a]}$.cache=[];String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};String.prototype.ltrim=function(){return this.replace(/^\s+/,"")};String.prototype.rtrim=function(){return this.replace(/\s+$/,"")};var $A=function(d){if(!d){return[]}if(d.toArray){return d.toArray()}else{var b=[];for(var a=0,c=d.length;a<c;a++){b.push(d[a])}return b}};Function.prototype.bind=function(){var a=this,c=$A(arguments),b=c.shift();return function(){return a.apply(b,c.concat($A(arguments)))}};Function.prototype.bindAsEventListener=function(){var a=this,c=$A(arguments),b=c.shift();return function(d){return a.apply(b,[(d||window.event)].concat(c).concat($A(arguments)))}};function notNull(b){if(b==null){return""}if(typeof(b)=="undefined"){return""}return b}function removeChild(a){if(a){if(a.parentNode){try{a.parentNode.removeChild(a)}catch(b){a.parentNode.removeNode(a)}}}}function disableEventPropagation(a){try{a.stopPropagation()}catch(b){window.event.cancelBubble=true}}function wheel(b,a){var c=0;if(!b){b=window.event}if(b.wheelDelta){c=b.wheelDelta/120;if(window.opera){c=-c}}else{if(b.detail){c=-b.detail/3}}if(c){a(c)}if(b.preventDefault){b.preventDefault()}b.returnValue=false}var layerCount=100;function addLayer(a){layerCount++;a.style.zIndex=layerCount}function removeLayer(b){var a=b.style.zIndex;if(a==layerCount){layerCount--}}function addHandler(a,c,b){if(a.attachEvent){a.attachEvent("on"+c,b)}else{if(a.addEventListener){a.addEventListener(c,b,false)}}}function removeHandler(a,c,b){if(a.removeEventListener){a.removeEventListener(c,b,false)}else{if(a.detachEvent){a.detachEvent("on"+c,b)}}}function getElementsByClassName(b,f,a){var e=(f=="*"&&b.all)?b.all:b.getElementsByTagName(f);var h=new Array();a=a.replace(/\-/g,"\\-");var g=new RegExp("(^|\\s)"+a+"(\\s|$)");var d;for(var c=0;c<e.length;c++){d=e[c];if(g.test(d.className)){h.push(d)}}return(h)}function setElementOpacity(a,b){var g=getOpacityProperty();var d;if(typeof(a)=="string"){d=document.getElementById(a)}else{d=a}if(!d||!g){return}if(g=="filter"){try{b*=100;var c=d.filters["DXImageTransform.Microsoft.alpha"]||d.filters.alpha;if(c){c.opacity=b}else{d.style.filter+="progid:DXImageTransform.Microsoft.Alpha(opacity="+b+")"}}catch(f){}}else{d.style[g]=b}}function getOpacityProperty(){if(typeof document.body.style.opacity=="string"){return"opacity"}else{if(typeof document.body.style.MozOpacity=="string"){return"MozOpacity"}else{if(typeof document.body.style.KhtmlOpacity=="string"){return"KhtmlOpacity"}else{if(document.body.filters&&navigator.appVersion.match(/MSIE ([\d.]+);/)[1]>=5.5){return"filter"}}}}return false}function getHeight(b){if(b.currentStyle){var a=b.offsetHeight}else{if(window.getComputedStyle){var a=document.defaultView.getComputedStyle(b,null).getPropertyValue("Height")}}return a||0}function getWidth(a){if(a.currentStyle){var b=a.clientWidth-parseInt(a.currentStyle.paddingLeft)-parseInt(a.currentStyle.paddingRight)}else{if(window.getComputedStyle){var b=document.defaultView.getComputedStyle(a,null).getPropertyValue("width")}}return b||0}function getPageCoords(a){var b={x:0,y:0};if(typeof window.pageXOffset!="undefined"){b.x=window.pageXOffset+a.clientX;b.y=window.pageYOffset+a.clientY}else{if(document.compatMode&&document.compatMode!="BackCompat"){b.x=document.documentElement.scrollLeft+a.clientX;b.y=document.documentElement.scrollTop+a.clientY}else{b.x=document.body.scrollLeft+a.clientX;b.y=document.body.scrollTop+a.clientY}}return b}function logging(a){if(window.console){if(window.console.log){console.log(a)}}}function preventSelection(b,a){this.removeSelection=function(){if(window.getSelection){window.getSelection().removeAllRanges()}else{if(document.selection&&document.selection.clear){document.selection.clear()}}};if(a){b.style.cursor="default";if(!is_ie){b.style.MozUserSelect="none";b.style.KhtmlUserSelect="none";b.style.UserSelect="none";addHandler(b,"mousemove",this.removeSelection)}else{b.onselectstart=function(){return false};if(!is_ie6&&!is_ie7){addHandler(b,"mousemove",this.removeSelection)}}}else{if(!is_ie){b.style.MozUserSelect="";b.style.KhtmlUserSelect="";b.style.UserSelect="";removeHandler(b,"mousemove",this.removeSelection)}else{b.onselectstart=function(){return true};if(!is_ie6&&!is_ie7){removeHandler(b,"mousemove",this.removeSelection)}}}}function getWindowScrollHeight(){return window.pageYOffset||(document.documentElement&&document.documentElement.scrollTop)||(document.body&&document.body.scrollTop)}function getWindowHeight(){var a=0;if(typeof(window.innerHeight)=="number"){a=window.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){a=document.documentElement.clientHeight}else{if(document.body&&document.body.clientHeight){a=document.body.clientHeight}}}return a}function getWindowScrollWidth(){return window.pageXOffset||(document.documentElement&&document.documentElement.scrollLeft)||(document.body&&document.body.scrollLeft)}function getWindowWidth(){var a=0;if(self.innerHeight){a=self.innerWidth}else{if(document.documentElement&&document.documentElement.clientHeight){a=document.documentElement.clientWidth}else{if(document.body){a=document.body.clientWidth}}}return a}sprintfWrapper={init:function(){if(typeof arguments=="undefined"){return null}if(arguments.length<1){return null}if(typeof arguments[0]!="string"){return null}if(typeof RegExp=="undefined"){return null}var j=arguments[0];var c=new RegExp(/(%([%]|(\-)?(\+|\x20)?(0)?(\d+)?(\.(\d)?)?([bcdfosxX])))/g);var g=new Array();var l=new Array();var a=0;var h=0;var m=0;var d=0;var k="";var f=null;while(f=c.exec(j)){if(f[9]){a+=1}h=d;m=c.lastIndex-f[0].length;l[l.length]=j.substring(h,m);d=c.lastIndex;g[g.length]={match:f[0],left:f[3]?true:false,sign:f[4]||"",pad:f[5]||" ",min:f[6]||0,precision:f[8],code:f[9]||"%",negative:parseInt(arguments[a])<0?true:false,argument:String(arguments[a])}}l[l.length]=j.substring(d);if(g.length==0){return j}if((arguments.length-1)<a){return null}var b=null;var f=null;var e=null;for(e=0;e<g.length;e++){if(g[e].code=="%"){substitution="%"}else{if(g[e].code=="b"){g[e].argument=String(Math.abs(parseInt(g[e].argument)).toString(2));substitution=sprintfWrapper.convert(g[e],true)}else{if(g[e].code=="c"){g[e].argument=String(String.fromCharCode(parseInt(Math.abs(parseInt(g[e].argument)))));substitution=sprintfWrapper.convert(g[e],true)}else{if(g[e].code=="d"){g[e].argument=String(Math.abs(parseInt(g[e].argument)));substitution=sprintfWrapper.convert(g[e])}else{if(g[e].code=="f"){g[e].argument=String(Math.abs(parseFloat(g[e].argument)).toFixed(g[e].precision?g[e].precision:6));substitution=sprintfWrapper.convert(g[e])}else{if(g[e].code=="o"){g[e].argument=String(Math.abs(parseInt(g[e].argument)).toString(8));substitution=sprintfWrapper.convert(g[e])}else{if(g[e].code=="s"){g[e].argument=g[e].argument.substring(0,g[e].precision?g[e].precision:g[e].argument.length);substitution=sprintfWrapper.convert(g[e],true)}else{if(g[e].code=="x"){g[e].argument=String(Math.abs(parseInt(g[e].argument)).toString(16));substitution=sprintfWrapper.convert(g[e])}else{if(g[e].code=="X"){g[e].argument=String(Math.abs(parseInt(g[e].argument)).toString(16));substitution=sprintfWrapper.convert(g[e]).toUpperCase()}else{substitution=g[e].match}}}}}}}}}k+=l[e];k+=substitution}k+=l[e];return k},convert:function(b,d){if(d){b.sign=""}else{b.sign=b.negative?"-":b.sign}var a=b.min-b.argument.length+1-b.sign.length;var c=new Array(a<0?0:a).join(b.pad);if(!b.left){if(b.pad=="0"||d){return b.sign+c+b.argument}else{return c+b.sign+b.argument}}else{if(b.pad=="0"||d){return b.sign+b.argument+c.replace(/0/g," ")}else{return b.sign+b.argument+c}}}};sprintf=sprintfWrapper.init;var MD5=function(s){function L(b,a){return(b<<a)|(b>>>(32-a))}function K(k,b){var F,a,d,x,c;d=(k&2147483648);x=(b&2147483648);F=(k&1073741824);a=(b&1073741824);c=(k&1073741823)+(b&1073741823);if(F&a){return(c^2147483648^d^x)}if(F|a){if(c&1073741824){return(c^3221225472^d^x)}else{return(c^1073741824^d^x)}}else{return(c^d^x)}}function r(a,c,b){return(a&c)|((~a)&b)}function q(a,c,b){return(a&b)|(c&(~b))}function p(a,c,b){return(a^c^b)}function n(a,c,b){return(c^(a|(~b)))}function u(G,F,aa,Z,k,H,I){G=K(G,K(K(r(F,aa,Z),k),I));return K(L(G,H),F)}function f(G,F,aa,Z,k,H,I){G=K(G,K(K(q(F,aa,Z),k),I));return K(L(G,H),F)}function D(G,F,aa,Z,k,H,I){G=K(G,K(K(p(F,aa,Z),k),I));return K(L(G,H),F)}function t(G,F,aa,Z,k,H,I){G=K(G,K(K(n(F,aa,Z),k),I));return K(L(G,H),F)}function e(k){var G;var d=k.length;var c=d+8;var b=(c-(c%64))/64;var F=(b+1)*16;var H=Array(F-1);var a=0;var x=0;while(x<d){G=(x-(x%4))/4;a=(x%4)*8;H[G]=(H[G]|(k.charCodeAt(x)<<a));x++}G=(x-(x%4))/4;a=(x%4)*8;H[G]=H[G]|(128<<a);H[F-2]=d<<3;H[F-1]=d>>>29;return H}function B(c){var b="",d="",k,a;for(a=0;a<=3;a++){k=(c>>>(a*8))&255;d="0"+k.toString(16);b=b+d.substr(d.length-2,2)}return b}function J(b){b=b.replace(/\r\n/g,"\n");var a="";for(var k=0;k<b.length;k++){var d=b.charCodeAt(k);if(d<128){a+=String.fromCharCode(d)}else{if((d>127)&&(d<2048)){a+=String.fromCharCode((d>>6)|192);a+=String.fromCharCode((d&63)|128)}else{a+=String.fromCharCode((d>>12)|224);a+=String.fromCharCode(((d>>6)&63)|128);a+=String.fromCharCode((d&63)|128)}}}return a}var C=Array();var P,h,E,v,g,Y,X,W,V;var S=7,Q=12,N=17,M=22;var A=5,z=9,y=14,w=20;var o=4,m=11,l=16,j=23;var U=6,T=10,R=15,O=21;s=J(s);C=e(s);Y=1732584193;X=4023233417;W=2562383102;V=271733878;for(P=0;P<C.length;P+=16){h=Y;E=X;v=W;g=V;Y=u(Y,X,W,V,C[P+0],S,3614090360);V=u(V,Y,X,W,C[P+1],Q,3905402710);W=u(W,V,Y,X,C[P+2],N,606105819);X=u(X,W,V,Y,C[P+3],M,3250441966);Y=u(Y,X,W,V,C[P+4],S,4118548399);V=u(V,Y,X,W,C[P+5],Q,1200080426);W=u(W,V,Y,X,C[P+6],N,2821735955);X=u(X,W,V,Y,C[P+7],M,4249261313);Y=u(Y,X,W,V,C[P+8],S,1770035416);V=u(V,Y,X,W,C[P+9],Q,2336552879);W=u(W,V,Y,X,C[P+10],N,4294925233);X=u(X,W,V,Y,C[P+11],M,2304563134);Y=u(Y,X,W,V,C[P+12],S,1804603682);V=u(V,Y,X,W,C[P+13],Q,4254626195);W=u(W,V,Y,X,C[P+14],N,2792965006);X=u(X,W,V,Y,C[P+15],M,1236535329);Y=f(Y,X,W,V,C[P+1],A,4129170786);V=f(V,Y,X,W,C[P+6],z,3225465664);W=f(W,V,Y,X,C[P+11],y,643717713);X=f(X,W,V,Y,C[P+0],w,3921069994);Y=f(Y,X,W,V,C[P+5],A,3593408605);V=f(V,Y,X,W,C[P+10],z,38016083);W=f(W,V,Y,X,C[P+15],y,3634488961);X=f(X,W,V,Y,C[P+4],w,3889429448);Y=f(Y,X,W,V,C[P+9],A,568446438);V=f(V,Y,X,W,C[P+14],z,3275163606);W=f(W,V,Y,X,C[P+3],y,4107603335);X=f(X,W,V,Y,C[P+8],w,1163531501);Y=f(Y,X,W,V,C[P+13],A,2850285829);V=f(V,Y,X,W,C[P+2],z,4243563512);W=f(W,V,Y,X,C[P+7],y,1735328473);X=f(X,W,V,Y,C[P+12],w,2368359562);Y=D(Y,X,W,V,C[P+5],o,4294588738);V=D(V,Y,X,W,C[P+8],m,2272392833);W=D(W,V,Y,X,C[P+11],l,1839030562);X=D(X,W,V,Y,C[P+14],j,4259657740);Y=D(Y,X,W,V,C[P+1],o,2763975236);V=D(V,Y,X,W,C[P+4],m,1272893353);W=D(W,V,Y,X,C[P+7],l,4139469664);X=D(X,W,V,Y,C[P+10],j,3200236656);Y=D(Y,X,W,V,C[P+13],o,681279174);V=D(V,Y,X,W,C[P+0],m,3936430074);W=D(W,V,Y,X,C[P+3],l,3572445317);X=D(X,W,V,Y,C[P+6],j,76029189);Y=D(Y,X,W,V,C[P+9],o,3654602809);V=D(V,Y,X,W,C[P+12],m,3873151461);W=D(W,V,Y,X,C[P+15],l,530742520);X=D(X,W,V,Y,C[P+2],j,3299628645);Y=t(Y,X,W,V,C[P+0],U,4096336452);V=t(V,Y,X,W,C[P+7],T,1126891415);W=t(W,V,Y,X,C[P+14],R,2878612391);X=t(X,W,V,Y,C[P+5],O,4237533241);Y=t(Y,X,W,V,C[P+12],U,1700485571);V=t(V,Y,X,W,C[P+3],T,2399980690);W=t(W,V,Y,X,C[P+10],R,4293915773);X=t(X,W,V,Y,C[P+1],O,2240044497);Y=t(Y,X,W,V,C[P+8],U,1873313359);V=t(V,Y,X,W,C[P+15],T,4264355552);W=t(W,V,Y,X,C[P+6],R,2734768916);X=t(X,W,V,Y,C[P+13],O,1309151649);Y=t(Y,X,W,V,C[P+4],U,4149444226);V=t(V,Y,X,W,C[P+11],T,3174756917);W=t(W,V,Y,X,C[P+2],R,718787259);X=t(X,W,V,Y,C[P+9],O,3951481745);Y=K(Y,h);X=K(X,E);W=K(W,v);V=K(V,g)}var i=B(Y)+B(X)+B(W)+B(V);return i.toLowerCase()};function htmlspecialchars(a){if(typeof a=="undefined"||a==null){return""}a=a.replace("&","&amp;");a=a.replace('"',"&quot;");a=a.replace("'","&#039;");a=a.replace("<","&lt;");a=a.replace(">","&gt;");return a}function html_entity_decode(b){var a=document.createElement("textarea");a.innerHTML=b.replace(/</g,"&lt;").replace(/>/g,"&gt;");return a.value}function getStyleProperty(a,b){var d="";if(document.defaultView&&document.defaultView.getComputedStyle){d=document.defaultView.getComputedStyle(a,"").getPropertyValue(b)}else{if(a.currentStyle){try{b=b.replace(/\-(\w)/g,function(e,f){return f.toUpperCase()});d=a.currentStyle[b]}catch(c){}}}return d}function setRequest(b,h,g,i,c){if(window.XMLHttpRequest){xmlreq=new XMLHttpRequest()}else{if(window.ActiveXObject){try{xmlreq=new ActiveXObject("Msxml2.XMLHTTP")}catch(f){try{xmlreq=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){alert("Your browser doesn't support ajax!")}}}}var a="";if(g){a="POST"}else{g=null}function d(){if(xmlreq.readyState==4){if(xmlreq.status==200){i(xmlreq.responseText)}else{}}}xmlreq.open(a,b+"?"+h,c);if(a=="POST"){xmlreq.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8")}xmlreq.onreadystatechange=d;xmlreq.send(g);return xmlreq}AIM={frame:function(f){var e="f"+Math.floor(Math.random()*99999);var b=document.createElement("DIV");b.innerHTML='<iframe style="display:none" src="about:blank" id="'+e+'" name="'+e+'" onload="AIM.loaded(\''+e+"');\"></iframe>";document.body.appendChild(b);var a=document.getElementById(e);if(f&&typeof(f.onComplete)=="function"){a.onComplete=f.onComplete}return e},form:function(b,a){b.setAttribute("target",a)},submit:function(a,b){AIM.form(a,AIM.frame(b));if(b&&typeof(b.onStart)=="function"){return b.onStart()}else{return true}},loaded:function(c){var a=document.getElementById(c);if(a.contentDocument){var b=a.contentDocument}else{if(a.contentWindow){var b=a.contentWindow.document}else{var b=window.frames[c].document}}if(b.location.href=="about:blank"){return}if(typeof(a.onComplete)=="function"){a.onComplete(b.body.innerHTML)}}};function createCookie(c,d,e){if(e){var b=new Date();b.setTime(b.getTime()+(e*24*60*60*1000));var a="; expires="+b.toGMTString()}else{var a=""}document.cookie=c+"="+d+a+"; path=/"}function readCookie(b){var e=b+"=";var a=document.cookie.split(";");for(var d=0;d<a.length;d++){var f=a[d];while(f.charAt(0)==" "){f=f.substring(1,f.length)}if(f.indexOf(e)==0){return f.substring(e.length,f.length)}}return null}function eraseCookie(a){createCookie(a,"",-1)}function ContextMenu(d){this.createMenu=function(f){var g='<table summary="" class="wm5_co_m"><tbody><tr><td class="wm5_co">';for(var h in f){if(f[h].separator){g+='<div class="wm5_co_sp"></div>'}else{g+='<div onclick="'+f[h].func+'">'+f[h].name+"</div>"}}g+="</td></tr></tbody></table>";return g};this.disableContextMenu=function(f){f.oncontextmenu=function(){return false}};this.show=function(j){var i=(j)?j:window.event;if((typeof i)=="undefined"){return false}var h=(i.target)?i.target:i.srcElement;var f=i.clientX||i.pageX;var k=i.clientY||i.pageY;var g;if(i.which){g=(i.which==3)}else{if(i.button){g=(i.button==2)}}if(g){b=document.onmousedown;document.onmousedown=c.closeContextMenu;c.disableContextMenu(h);e.style.display="block";e.style.position="absolute";e.style.top=(k+5)+"px";e.style.left=(f+5)+"px";return false}c.closeContextMenu();return false};this.closeContextMenu=function(h){var g=(h)?h:window.event;if((typeof g)=="undefined"){return false}var f=(g.target)?g.target:g.srcElement;while(f!=null){if(f==e&&g.type=="mousedown"){return true}f=f.parentNode}e.style.display="none";if(b!=null){document.onmousedown=b}document.onmousedown=null;return false};var c=this;var b;var e=document.createElement("DIV");var a=document.getElementsByTagName("BODY")[0];e.style.display="none";e.innerHTML=c.createMenu(d);e.onmouseup=c.closeContextMenu;a.appendChild(e)}function DatePicker(g,f,p,j){this.GetDate=function(){t.closePicker();n=b.getFullYear();z=b.getMonth();D=b.getDate();C=0;a=0;s=0;var d=A.value;if(/\d{1,2}.\d{1,2}.\d{4}/.test(d)){var m=d.split("/");C=m[0]-1;a=m[1];s=m[2];z=C;D=a;n=s}t.showPicker()};this.showPicker=function(){if(f!="inline"){t.closePicker();if(j){if(j.icon){q.style.left=(l.offsetLeft+l.offsetWidth-u.offsetWidth)+"px";q.style.top=l.offsetTop+"px"}else{q.style.left=A.offsetLeft+"px";q.style.top=(A.offsetTop+A.offsetHeight)+"px"}}}var S='<table cellspacing="0" class="dcr-dcalendarTable"><thead><tr><th class="dcr-calhead" colspan="7"><div class="dcr-calheader'+((f=="advpicker")?" advp":"")+'">';if(f!="advpicker"){S+='<div class="dcr-calnavleft" title="'+B.previous+'">&nbsp;</div><div class="dcr-calnavsleft">&nbsp;</div><div class="dcr-title">'+B.monthNames[z]+" "+n+'</div><div class="dcr-calnavright" title="'+B.next+'">&nbsp;</div><div class="dcr-calnavsright">&nbsp;</div></div></th><tr class="dcr-calweekdayrow">'}else{S+='<div class="dcr-calnavleft" title="'+B.previous+'" style="left:5px;">&nbsp;</div><div class="dcr-adv-title"><select style="width: 66px;" value="'+z+'">';for(var N=0;N<12;++N){if(N==z){S+='<option selected value="'+N+'">'+B.monthNames[N]+"</option>"}else{S+='<option value="'+N+'">'+B.monthNames[N]+"</option>"}}S+="</select>";S+='<select style="width: 59px;" value="'+n+'">';for(var N=E;N>E-100;--N){if(N==n){S+='<option selected value="'+N+'">'+N+"</option>"}else{S+='<option value="'+N+'">'+N+"</option>"}}S+="</select></div>";S+='<div class="dcr-calnavright" title="'+B.next+'"  style="right:5px;">&nbsp;</div></div></th><tr class="dcr-calweekdayrow">'}for(var N=0;N<7;++N){S+="<th>"+B.shortWeek[N]+"</th>"}S+="</tr></thead>";var O=1;var J=new Date(n,z,O);if(new Date(n,1,29).getDate()==29){e[1]=29}else{e[1]=28}var L="";var T=false;for(var K=1;K<7;K++){S=S+"<tr>";for(var Q=0;Q<7;Q++){var J=new Date(n,z,O);if(J.getDay()==Q&&O<=e[z]){if(J.getDate()==a&&J.getMonth()==C&&J.getFullYear()==s){L="dcr-cellSelected";T=true}else{if(J.getDate()==i&&J.getMonth()==c&&J.getFullYear()==E){L="dcr-cellToday";T=true}else{L="dcr-cellDay";T=false}}if(((b>J)&&!v)||(b<=J)||T){if(x&&(b<J)){S=S+'<td class="dcr-futCellDay">'+O+"</td>"}else{S=S+"<td id="+k+"_"+O+' class="'+L+'" name="'+O+'"><a href="javascript:void(0);" name="'+O+'"><span class="scalendarDay'+O+'" name="'+O+'">'+O+"</span></a></td>"}}else{S=S+'<td class="dcr-futCellDay">'+O+"</td>"}O++}else{S=S+'<td class="dcr-futCellDay">&nbsp;</td>'}}S=S+"</tr>"}S=S+"</table>";q.innerHTML=S;if(f!="advpicker"){var y=getElementsByClassName(q,"DIV","dcr-calnavsleft")[0];y.onclick=t.prevYear;var d=getElementsByClassName(q,"DIV","dcr-calnavsright")[0];d.onclick=t.nextYear}var F=getElementsByClassName(q,"DIV","dcr-calnavleft")[0];F.onclick=t.prevMonth;var P=getElementsByClassName(q,"DIV","dcr-calnavright")[0];P.onclick=t.nextMonth;if(f!="inline"){var H=getElementsByClassName(q,"TD","dcr-cellDay");for(var M in H){H[M].onclick=t.returnDate}var m=getElementsByClassName(q,"TD","dcr-cellToday");for(var M in m){m[M].onclick=t.returnDate}var I=getElementsByClassName(q,"TD","dcr-cellSelected");for(var M in I){I[M].onclick=t.returnDate}q.style.display="inline";if(r!=t.checkFocus){r=document.onmousedown}document.onmousedown=t.checkFocus}else{q.style.display="block";var H=getElementsByClassName(q,"TD","dcr-cellDay");for(var M in H){H[M].onclick=t.inlineClick}var m=getElementsByClassName(q,"TD","dcr-cellToday");for(var M in m){m[M].onclick=t.inlineClick}var I=getElementsByClassName(q,"TD","dcr-cellSelected");for(var M in I){I[M].onclick=t.inlineClick}}if(f=="advpicker"){var G=q.getElementsByTagName("SELECT")[0];G.onchange=t.selectMonth;var R=q.getElementsByTagName("SELECT")[1];R.onchange=t.selectYear}if(f=="inline"){if(j){if(j.updatefunc&&!o){j.updatefunc(this);o=true}}}if(f!="inline"){if(j){if(j.icon&&j.showTop){q.style.top=l.offsetTop-q.offsetHeight+18+"px"}if(j.icon&&j.showLeft){q.style.left=(l.offsetLeft)+"px"}}}};this.prevYear=function(){o=false;n--;t.showPicker()};this.nextYear=function(){o=false;n++;t.showPicker()};this.prevMonth=function(){o=false;z--;if(z==-1){z=11;n--}t.showPicker()};this.nextMonth=function(){o=false;z++;if(z==12){z=0;n++}t.showPicker()};this.setDate=function(m,d){z=m.getMonth();n=m.getFullYear();D=m.getDate();if("DayView"==d){C=z;s=n;a=D}else{if("WeekView"==d){C=z;s=n;a=D}else{if("MonthView"==d){C=z;s=n;a=D}else{C=z;s=n;a=D}}}t.showPicker()};this.selectMonth=function(){o=false;z=parseInt(this.value);t.showPicker()};this.selectYear=function(){o=false;n=parseInt(this.value);t.showPicker()};this.returnDate=function(F){var d=(F)?F:window.event;var y=(d.target)?d.target:d.srcElement;if(y.className!=null){var m=y.getAttribute("name");A.value=((z+1)<10?"0"+(z+1):(z+1))+"/"+(m<10?"0"+m:m)+"/"+n;t.closePicker()}};this.inlineClick=function(F){if(j.inlineClick){var d=(F)?F:window.event;var y=(d.target)?d.target:d.srcElement;if(y.className!=null){var m=y.getAttribute("name");j.inlineClick(((z+1)<10?"0"+(z+1):(z+1))+"/"+(m<10?"0"+m:m)+"/"+n)}}};this.closePicker=function(){if(q.style.display!="none"){q.innerHTML=null;q.style.display="none";if(r!=null){document.onmousedown=r}if(j.onclose){j.onclose()}}};this.checkFocus=function(y){var d=(y)?y:window.event;var m=(d.target)?d.target:d.srcElement;while(m!=null){if(m.className=="dcr-dcalendar"){return true}m=m.parentNode}t.closePicker()};this.getCurrentDate=function(){var d;d=A.value;return new Date(d)};this.setCurrentDate=function(d){A.value=d};this.setValue=function(d){var m=new Date();m.setTime(d*1000);A.value=((m.getMonth()+1)<10?"0"+(m.getMonth()+1):(m.getMonth()+1))+"/"+(m.getDate()<10?"0"+m.getDate():m.getDate())+"/"+m.getFullYear()};this.getValue=function(){var d=A.value;return(new Date(d).valueOf())/1000};this.setDisable=function(){A.className="dpk-picker_input_disable";if(j.icon){u.style.display="none";u.onclick=null}else{A.onclick=null}};this.setEnable=function(){A.className="dpk-picker_input";if(j.icon){u.style.display="";u.onclick=t.GetDate}else{A.onclick=t.GetDate}};this.getUID=function(){return k};this.getYear=function(){return n};this.getMonth=function(){return z};this.getDay=function(){return D};this.directInputBlur=function(){if(!(/\d{2}.\d{2}.\d{4}/.test(A.value))){n=b.getFullYear();z=b.getMonth();D=b.getDate();A.value=((z+1)<10?"0"+(z+1):(z+1))+"/"+(D<10?"0"+D:D)+"/"+n}var m=A.value.split("/");C=m[0]-1;a=m[1];s=m[2];var d=new Date(A.value);t.setValue(d.valueOf()/1000);if((v&&d<b)||(x&&d>b)){n=b.getFullYear();z=b.getMonth();D=b.getDate();A.value=((z+1)<10?"0"+(z+1):(z+1))+"/"+(D<10?"0"+D:D)+"/"+n}};this.directInput=function(m){var G=(m)?m:window.event;key=G.keyCode;if(key>=96&&key<=105){key-=48}var d=key>=48&&key<=57||key>=96&&key<=105;var H=key==190||key==110||key==109||key==111||key==191;var J=key>=35&&key<=40||key==8||key==46||key==13;if(d||H||J){if(A.value.length==0&&(H||J)){}else{if(A.value.length==1&&d){var K=parseInt(A.value);var I=parseInt(String.fromCharCode(key));if(K==1&&I>2){A.value+=2+"/"}else{if(K>1){A.value=12+"/"}else{if(K==0&&I==0){A.value+=1+"/"}else{A.value+=I+"/"}}}}else{if(A.value.length==1&&H){A.value="0"+A.value+"/"}else{if(A.value.length==4&&d){var F=parseInt(A.value.substring(A.value.length-1));var y=parseInt(String.fromCharCode(key));if(F>3&&y>1||F==3&&y>1){A.value=(A.value.substring(0,A.value.length-1)+31+"/")}else{if(F==0&&y==0){A.value+=1+"/"}else{A.value+=y+"/"}}}else{if(A.value.length==4&&H){A.value=(A.value.substring(0,A.value.length-1)+"0"+A.value.substring(A.value.length-1)+"/")}else{if(A.value.length<=9||J){return true}else{if(A.selectionStart!=A.selectionEnd){return true}}}}}}}}if(m.preventDefault){m.preventDefault()}m.returnValue=false;return false};if(j==null){j=new Array();j.pastDisable=false;j.futureDisable=false;j.icon=false;j.directinput=false}var v=j.pastDisable;var x=j.futureDisable;var h=j.directinput;var t=this;var B=g;var r;var b=new Date();var E=b.getFullYear();var c=b.getMonth();var i=b.getDate();var s=0;var C=0;var a=0;var n=b.getFullYear();var z=b.getMonth();var D=b.getDate();var e=new Array(31,28,31,30,31,30,31,31,30,31,30,31);var k=Math.floor(Math.random()*10000000);var q=document.createElement("div");q.className="dcr-dcalendar";q.style.display="none";var o=true;var w=p;if(f!="inline"){var l=document.createElement("DIV");l.className="dpk-datepicker";var A=document.createElement("INPUT");A.className="dpk-picker_input";l.appendChild(A);if(!h){A.readOnly="true"}else{addHandler(A,"keydown",t.directInput);addHandler(A,"blur",t.directInputBlur)}if(j.icon){var u=document.createElement("DIV");u.className="dpk-picker_icon";u.onclick=t.GetDate;l.appendChild(u)}else{A.onclick=t.GetDate}p.appendChild(l);p.appendChild(q);addHandler(document.body,"scroll",t.closePicker);addHandler(window,"resize",t.closePicker);if(is_gecko){addHandler(document.body,"DOMMouseScroll",t.closePicker)}else{addHandler(document.body,"mousewheel",t.closePicker)}}else{q.style.zIndex="1";q.style.position="relative";p.appendChild(q);o=false;t.showPicker()}}function UploadFile(c,e){this.getExt=function(){var f=b.getValue().toLowerCase();return f.substring(f.lastIndexOf(".")+1,f.length)};this.onChange=function(){if(!e.withoutField){a.value=b.getValue()}};var a=document.createElement("INPUT");a.setAttribute("type","text");a.setAttribute("readOnly","true");a.className="fu-upinput";var d=document.createElement("span");d.appendChild(a);var b=new Button({target:d,name:e.name,file:true,func:function(){},onchange:this.onChange});c.style.width="100%";c.style.position="relative";c.appendChild(d);return b}function Grid(H,b){var J;var B="ASC";var g=0;this.headerSort=function(O){var M=(O)?O:window.event;var N=(M.target)?M.target:M.srcElement;while(N!=null){if(/^grid-head-cell/.test(N.className)){break}N=N.parentNode}if(N==null){return}if(J!=null&&J!=N){J.className="grid-head-cell"}if("grid-head-cell grid-sort-asc"==N.className){N.className="grid-head-cell grid-sort-desc";B="DESC"}else{N.className="grid-head-cell grid-sort-asc";B="ASC"}J=N;g=N.getAttribute("name");if(b.funcSort){b.funcSort(g,B)}};var r=new Array();this.headerResize=function(S){this.resizing=function(Y){var Y=Y||window.event;var X=Y.clientX||Y.pageX;if(X<P-i[T.n1].width+i[T.n1].minwidth){U=P-i[T.n1].width+i[T.n1].minwidth}if(X>P+i[T.n2].width-i[T.n2].minwidth){U=P+i[T.n2].width-i[T.n2].minwidth}if(X>P-i[T.n1].width+i[T.n1].minwidth&&X<P+i[T.n2].width-i[T.n2].minwidth){U=X}R.style.left=U+"px"};this.stopResizing=function(Z){var Y,X;if(typeof(U)!="undefined"){if(U-P<0){Y=(i[T.n1].width-Math.abs(U-P));X=(i[T.n2].width+Math.abs(U-P))}else{Y=(i[T.n1].width+Math.abs(U-P));X=(i[T.n2].width-Math.abs(U-P))}r[T.n1].style.width=Y+"px";r[T.n2].style.width=X+"px";i[T.n1].width=Y;i[T.n2].width=X}document.onmousemove=M;document.onmouseup=N;document.body.style.cursor="default";c.style.cursor=V;removeChild(R);preventSelection(document.body,false)};var W=this;var M;var N;var V;var S=S||window.event;var O=S.clientX||S.pageX;var T=(S.target||S.srcElement);var Q=l.offsetTop+T.offsetTop+(is_ie?-1:1);var P=l.offsetLeft+T.offsetLeft;var U;var R=document.createElement("DIV");R.className="grid-border-resize";R.id="resize-border";R.style.left=P+"px";R.style.top=Q+"px";R.style.height=getHeight(A);document.body.appendChild(R);setElementOpacity("resize-border","0.50");M=document.onmousemove;N=document.onmouseup;V=document.body.style.cursor;document.onmousemove=W.resizing;document.onmouseup=W.stopResizing;document.body.style.cursor="e-resize";V=c.style.cursor;c.style.cursor="e-resize";preventSelection(document.body,true)};this.tableResize=function(){l.style.width=parseInt(l.parentNode.style.width)-2+"px";l.style.height=l.parentNode.style.height;var N=l.offsetWidth-(is_ie?30:21);var M=0;for(var O in i){i[O].width=Math.floor((N*0.01)*(parseInt(r[O].style.width)/(k*0.01)));M+=i[O].width;r[O].style.width=i[O].width+"px"}A.style.width=l.style.width;A.style.height=l.style.height;k=M;G.style.top=r[0].offsetHeight+"px";G.style.height=l.offsetHeight-(r[0].offsetHeight+1)+"px";if(h.getVisiableRows()+1<=o){d.style.display="none"}else{d.style.display=""}h.drawRecords(y);if(F){h.setFocus()}else{h.blurFocus()}};var x=-1;var v=-1;var a=-1;var s=null;var m=new Array();var u=0;var j=null;var z=null;this.selectRec=function(M){h.selectRecs(M,M)};this.selectRecs=function(P,O){if(P>O){var N=P;P=O;O=N}for(var M=P;M<=O;M++){m[M]=true;u++;if(cacheobj.isAccessible(M)){h.selectRow(cacheobj.get(M))}}};this.deselectRec=function(M){h.deselectRecs(M,M)};this.deselectRecs=function(P,O){if(P>O){var N=P;P=O;O=N}for(var M=P;M<=O;M++){delete m[M];u--;if(cacheobj.isAccessible(M)){h.deselectRow(cacheobj.get(M))}}if(u<=0){u=0}};this.selectAllRecs=function(){h.deselectRecs(0,o);m=new Array();h.selectRecs(0,o-1)};this.selectRow=function(M){if("object"==typeof(M)){M.className="grid-body-active"}};this.deselectRow=function(M){if("object"==typeof(M)){M.className=""}};this.isSelectedRec=function(M){return m[M]?true:false};this.isSelectedRow=function(M){if("object"==typeof(M)){return(M.className=="grid-body-active"?true:false)}};this.scrollToSelected=function(){if(typeof(C)!="undefined"){var O=C.getElementsByTagName("TR");var P=C.getElementsByTagName("TR").length-1;var N=parseInt(C.getElementsByTagName("TR")[0].getAttribute("count"));var M=parseInt(C.getElementsByTagName("TR")[P].getAttribute("count"));if(P>0){if(x>M){h.ScrollTo(x-(M-N))}if(x<N){h.ScrollTo(x)}}}};this.getSelectedId=function(){var O="";for(var N in m){if(m[N]&&N>=0){if(cacheobj.isAccessible(N)){var M=cacheobj.get(N);O+=M.getAttribute("name")+"|"}else{return false}}}return O};this.getSelectedIntervals=function(){var S="";var T=new Array();for(var P in m){var M=parseInt(P);if(m[P]&&M>=0){T.push(new Array(M,M))}}var R=true;while(R){R=false;for(var O in T){for(var N in T){if(typeof(T[N])!="undefined"&&typeof(T[O])!="undefined"){if(T[O][0]<=T[N][0]&&T[O][1]>=T[N][1]&&O!=N){delete T[N];R=true;continue}if(O!=N&&T[O][0]<=T[N][0]&&(T[N][0]-T[O][1]<=1)){T[O][1]=T[N][1];delete T[N];R=true;continue}}}}}for(var Q in T){if(typeof(T[Q])!="undefined"){S+=T[Q][0]+"-"+T[Q][1]+","}}return S.substring(0,S.length-1)};this.getSelectedCount=function(){return u};this.onRowKeyDown=function(S){var M=(S)?S:window.event;s=M.ctrlKey;if(s&&M.shiftKey){h.deselectRecs(0,o)}switch(M.keyCode){case 40:try{var T=C.getElementsByTagName("TR").length-1;var P=parseInt(C.getElementsByTagName("TR")[0].getAttribute("count"));var N=parseInt(C.getElementsByTagName("TR")[T].getAttribute("count"))}catch(S){return false}if(x>=o-1){x=o-1;v=T;return false}v++;x++;if(x<P||N<x){h.ScrollTo(x-T);v=T}if(M.shiftKey){if(v==T){h.ScrollTo(x-T)}if(a>=x){h.deselectRec(x-1)}else{h.selectRec(x)}}else{h.deselectRecs(0,o);if(v>=T){h.ScrollTo(x-T)}a=x;h.selectRec(x)}break;case 38:var T=C.getElementsByTagName("TR").length-1;var P=parseInt(C.getElementsByTagName("TR")[0].getAttribute("count"));var N=parseInt(C.getElementsByTagName("TR")[T].getAttribute("count"));if(x<=0){x=0;v=0;return false}v--;x--;if(x<P||N<x){h.ScrollTo(x);v=0}if(M.shiftKey){if(v==0){h.ScrollTo(x)}if(a<=x){h.deselectRec(x+1)}else{h.selectRec(x)}}else{h.deselectRecs(0,o);if(v<=0){h.ScrollTo(x);v=0}a=x;h.selectRec(x)}break;case 33:var T=C.getElementsByTagName("TR").length;var Q=x;var R=parseInt(C.getElementsByTagName("TR")[0].getAttribute("count"));if(x<=0){x=0;return false}if(M.shiftKey){if(v==0){x-=x>=0?T:N-x;h.ScrollTo(x)}else{x=R;v=0}if(a<x){h.deselectRecs(Q,x+1);h.ScrollTo(x)}else{if(a<Q){h.deselectRecs(Q,a-1);h.selectRecs(a,x)}else{h.selectRecs(Q,x)}}}else{if(v==0){x-=x>=T?T:T-x;h.ScrollTo(x)}else{x=R}if(x<=0){x=0}h.deselectRecs(0,o);a=x;v=0;h.selectRec(x)}break;case 34:var T=C.getElementsByTagName("TR").length-1;var N=parseInt(C.getElementsByTagName("TR")[T].getAttribute("count"));var Q=x;if(x>=o-1){x=o;return false}if(M.shiftKey){if(v==T){x+=x>=N?T+1:N-x;h.ScrollTo(x-T)}else{x=N;v=T}if(a>x){h.deselectRecs(Q,x);h.ScrollTo(x+1)}else{if(a>Q){h.deselectRecs(Q,a-1);h.selectRecs(a,x)}else{h.selectRecs(Q,x)}}}else{if(v==T){x+=(x>=N)?T+1:N-x;h.ScrollTo(x-T)}else{x=N}h.deselectRecs(0,o);a=x;v=T;h.selectRec(x)}break;case 35:var T=C.getElementsByTagName("TR").length-1;if(M.shiftKey){if(a>x){h.deselectRecs(x,a);h.selectRecs(a,o)}else{h.selectRecs(a,o)}x=o-1;h.ScrollTo(x)}else{h.deselectRecs(0,o);x=o-1;v=T;a=x;h.ScrollTo(x);h.selectRec(x)}break;case 36:if(M.shiftKey){if(a<x){h.deselectRecs(x,a);h.selectRecs(a,0)}else{h.selectRecs(a,0)}x=0;h.ScrollTo(x)}else{h.deselectRecs(0,o);x=0;a=x;h.ScrollTo(x);h.selectRec(x)}break;case 65:if(M.ctrlKey){h.selectAllRecs();return false}break;case 46:if(!M.ctrlKey&&!M.altKey){if(b.funcRemove){b.funcRemove(h.getSelectedId())}}break}if(!M.shiftKey&&!M.ctrlKey){if(b.funcClick){var O=cacheobj.get(x);if(typeof(O.getAttribute)!="undefined"){b.funcClick(O.getAttribute("name"))}}}};this.onRowDblClick=function(N){var N=N||window.event;var M=(N.target||N.srcElement);if(!N.shiftKey&&!N.ctrlKey){while(M!=null){if(M.tagName=="TR"){v=M.rowIndex-1;x=parseInt(M.getAttribute("count"));a=x;h.deselectRecs(0,o);h.selectRec(x);if(b.funcDblClick){if(typeof(M.getAttribute)!="undefined"){b.funcDblClick(M.getAttribute("name"))}}return true}M=M.parentNode}}};this.onRowClick=function(N){var N=N||window.event;var M=(N.target||N.srcElement);if(!N.shiftKey&&!N.ctrlKey){while(M!=null){if(M.tagName=="TR"){v=M.rowIndex-1;x=parseInt(M.getAttribute("count"));a=x;h.deselectRecs(0,o);h.selectRec(x);if(b.funcClick){if(typeof(M.getAttribute)!="undefined"){b.funcClick(M.getAttribute("name"))}}return true}M=M.parentNode}}};this.onRowMouseDown=function(N){var N=N||window.event;var M=(N.target||N.srcElement);while(M!=null){if(M.tagName=="TR"){x=parseInt(M.getAttribute("count"));v=M.rowIndex-1;if(N.ctrlKey){a=x;if(h.isSelectedRec(x)){h.deselectRec(x)}else{h.selectRec(x)}return}else{if(N.shiftKey){h.deselectRecs(0,o);h.selectRecs(a,x)}else{if(!h.isSelectedRec(x)){h.deselectRecs(0,o);h.selectRec(x)}a=x}}dNd=true;j=document.onmousemove;z=document.onmouseup;document.onmousemove=h.onRowMouseMove;document.onmouseup=h.onRowMouseUp;if(N.button==0&&is_ie){return false}}M=M.parentNode}};this.onRowMouseUp=function(M){if(!dNd){return false}else{dNd=false;document.onmousemove=j;document.onmouseup=z}if(b.funcDrop){b.funcDrop(M)}};this.onRowMouseMove=function(M){if(!dNd){return false}if(b.funcDrag){b.funcDrag(M)}};this.onScroll=function(N){this.mouseWheel=function(O){if(O>0){G.scrollTop-=23*O}else{G.scrollTop+=23*Math.abs(O)}};var N=N||window.event;var M=this;if(N.type=="mousedown"){t=true}if(N.type=="mouseup"){t=false}if(N.type!="scroll"&&N.type!="mousedown"&&N.type!="mouseup"){wheel(N,M.mouseWheel);return false}if(t){return false}if(h.getScroll()==w){return true}w=h.getScroll();y=h.getScroll();setTimeout(function(){h.drawRecords(y)},0)};this.getVisiableRows=function(){return o>=(Math.floor((l.offsetHeight-25)/p))?(Math.floor((l.offsetHeight-25)/p)):o-1};this.setTotalRecords=function(M){if(M!=o){o=M;h.clearCache(o)}o=M;if(h.getVisiableRows()+1<=o){d.style.display="none"}else{d.style.display=""}I.style.height=(((o)*p))+"px";G.scrollTop=0;setTimeout(function(){h.ScrollTo(0)},0)};this.getScroll=function(){return Math.floor(parseInt(G.scrollTop)/p)};this.ScrollTo=function(M){G.scrollTop=(p*M)};this.drawRecords=function(S){if(o==0){var N=document.createElement("TR");var R=document.createElement("TD");R.setAttribute("align","center");R.setAttribute("colSpan",r.length);R.className="grid-norecords-text";R.innerHTML=b.noRecordsText?b.noRecordsText:"No records";N.appendChild(R);var P=document.createElement("TBODY");P.className="grid-tb";if(typeof(C)!="undefined"){c.removeChild(C)}P.appendChild(N);C=P;c.appendChild(C);return true}var Q=S+h.getVisiableRows();if(Q>=o){Q=o-1}if(Math.abs(f-S)<0){}else{var P=document.createElement("TBODY");P.className="grid-tb";if(b.funcClick){addHandler(P,"click",h.onRowClick)}if(b.funcDblClick){P.ondblclick=h.onRowDblClick}P.onmousedown=h.onRowMouseDown;var M=cacheobj.getPool(S,Q);if(typeof M=="object"){for(var O in M){P.appendChild(M[O])}}else{return false}if(typeof(C)!="undefined"){c.removeChild(C)}C=P;c.appendChild(C);y=S;D=Q}f=y};this.clearCache=function(M){cacheobj.clear(M);m=new Array();x=-1;v=-1;a=-1;s=null;u=0;y=0;D=0;f=0};this.loadCache=function(M){cacheobj.load(M)};cacheobj=new function(){this.clearHover=function(M){M.firstChild.style.backgroundColor="#FFFFFF"};this.load=function(T){for(var S in T){var O=document.createElement("TR");O.setAttribute("count",S);O.setAttribute("name",T[S][b.nameOfRecordUId]);for(var N in i){var R=document.createElement("TD");var M=document.createElement("NOBR");var Q;if(i[N].drawFunc){Q=i[N].drawFunc(T[S][i[N].id])}else{try{Q=document.createTextNode(decodeURIComponent(notNull(T[S][i[N].id])))}catch(P){Q=document.createTextNode((notNull(T[S][i[N].id])))}}M.appendChild(Q);R.appendChild(M);O.appendChild(R)}cacheobj.cache[S]=new Array();cacheobj.cache[S]=O;if(typeof(m[S])!="undefined"&&m[S]){h.selectRec(S)}}cacheobj.cacheLoaded=true;cacheobj.quietCacheLoaded=true};this.clear=function(M){totalElements=M;cacheobj.cache=new Array()};this.isAccessible=function(M){return(typeof(cacheobj.cache[M])=="undefined")?false:true};this.get=function(M){if(typeof(cacheobj.cache[M])=="undefined"){return false}else{return cacheobj.cache[M]}};this.getPool=function(O,Q){var U=new Array();var N=(O-20)>0?(O-20):0;var P=0;if(totalElements>20){P=(((totalElements-1)>(Q+20))?Q+20:(totalElements-1))}else{P=Q}var T=false;h.quietLoadStart=O;h.quietLoadEnd=Q;for(var S=N;S<O;S++){if(typeof(cacheobj.cache[S])=="undefined"){h.quietLoadStart=S;h.quietLoadEnd=O;T=true;break}}for(var R=O;R<=Q;++R){if(typeof(cacheobj.cache[R])=="undefined"){h.quietLoadEnd=R;T=true}else{U.push(cacheobj.cache[R])}}for(var M=Q+1;M<=P;M++){if(typeof(cacheobj.cache[M])=="undefined"){h.quietLoadEnd=M;h.quietLoadEnd++;T=true}}if(cacheobj.quietCacheLoaded&&T){cacheobj.quietCacheLoaded=false;h.quietLoadStart-=(h.quietLoadStart-50>0?50:0);h.quietLoadEnd=((totalElements-1)>(Q+50))?(h.quietLoadEnd+Q+50):totalElements;setTimeout(function(){h.newRecordsRequest(true)}.bind(this))}return U};this.remove=function(M){};this.cache=new Array();this.prewStart=0;this.totalElements=0;this.cacheLoaded=true;this.quietCacheLoaded=true};this.newRecordsRequest=function(M){var O=h.loadStart;var N=h.loadEnd;if(M){O=h.quietLoadStart;N=h.quietLoadEnd}b.funcLoadCache(g,B,O,N,false,M);h.showLock(true)}.bind(this);this.showLock=function(){n.style.display="block";L.style.left=Math.floor(parseInt(n.offsetWidth)/2)-30+"px";L.style.top=Math.floor(parseInt(n.offsetHeight)/2)-15+"px"};this.hideLock=function(){n.style.display="none"};var F=false;this.setFocus=function(){var M=getElementsByClassName(C,"TR","grid-body-inactive");for(var N in M){M[N].className="grid-body-active"}if(F){return}if(!is_ie){removeHandler(G,"DOMMouseScroll",function(){h.setFocus()})}removeHandler(G,"mousewheel",function(){h.setFocus()});addHandler(document,"keydown",h.onRowKeyDown);if(!is_ie){addHandler(A,"DOMMouseScroll",h.onScroll);addHandler(G,"DOMMouseScroll",h.onScroll)}addHandler(G,"scroll",h.onScroll);addHandler(A,"mousewheel",h.onScroll);addHandler(G,"mousewheel",h.onScroll);F=true};this.blurFocus=function(){var M=getElementsByClassName(C,"TR","grid-body-active");for(var N in M){M[N].className="grid-body-inactive"}if(!F){return}removeHandler(document,"keydown",h.onRowKeyDown);if(!is_ie){removeHandler(A,"DOMMouseScroll",h.onScroll);removeHandler(G,"DOMMouseScroll",h.onScroll)}removeHandler(G,"scroll",h.onScroll);removeHandler(A,"mousewheel",h.onScroll);removeHandler(G,"mousewheel",h.onScroll);if(!is_ie){addHandler(G,"DOMMouseScroll",function(){h.setFocus()})}addHandler(G,"mousewheel",function(){h.setFocus()});F=false};this.checkFocus=function(O){var M=(O)?O:window.event;var N=(M.target)?M.target:M.srcElement;while(N!=null){if(/^grid-position/.test(N.className)){h.setFocus();return}N=N.parentNode}h.blurFocus()};this.render=function(){addHandler(window,"resize",h.tableResize);preventSelection(l,true)};this.redraw=function(){var width = parseInt(l.parentNode.style.width);width = width>=0?width:0;l.style.width=parseInt(l.parentNode.style.width)-2+"px";var height = parseInt(l.parentNode.style.height);height = height>=0?height:0;l.style.height=height+"px";h.tableResize();};this.init=function(){var U=document.createElement("THEAD");var S=document.createElement("TR");var P;var O=i.length;for(var Q in i){var N=document.createElement("TH");N.className="grid-head-cell";N.style.width=i[Q].width+"px";k+=i[Q].width;if(i[Q].resizable){var T=document.createElement("DIV");T.className="grid-head-border";T.n1=P;T.n2=Q;T.onmousedown=h.headerResize;N.appendChild(T)}if(i[Q].name){var R=document.createElement("SPAN");R.innerHTML=i[Q].name;R.onselectstart="return false;";var M=document.createElement("DIV");M.className="grid-head-cell";M.setAttribute("name",i[Q].id);if(i[Q].sortable){M.onclick=h.headerSort;if(b.sortDir&&b.sortType){if(i[Q].id==b.sortType){if(b.sortDir=="ASC"){M.className="grid-head-cell grid-sort-asc"}else{M.className="grid-head-cell grid-sort-desc"}J=M;B=b.sortDir;g=b.sortType}}}M.appendChild(R);N.appendChild(M)}else{if(i[Q].drawHeadFunc){var M=document.createElement("DIV");M.className="grid-head-cell";M.setAttribute("name",i[Q].id);if(i[Q].sortable){M.onclick=h.headerSort;if(b.sortDir&&b.sortType){if(i[Q].id==b.sortType){if(b.sortDir=="ASC"){M.className="grid-head-cell grid-sort-asc"}else{M.className="grid-head-cell grid-sort-desc"}J=M;B=b.sortDir;g=b.sortType}}}M.appendChild(i[Q].drawHeadFunc());N.appendChild(M)}}if(Q==i.length-1){N.style.borderRight="0px"}r[Q]=N;P=Q;S.appendChild(N)}d=document.createElement("TH");d.className="grid-scroll-th";var M=document.createElement("DIV");M.className="grid-addcol";M.innerHTML="&nbsp;";d.appendChild(M);S.appendChild(d);U.appendChild(S);c=document.createElement("TABLE");c.className="grid-table";if(b.bodyid){c.id=b.bodyid}c.border="0";c.width="100%";c.setAttribute("cellspacing","0");c.setAttribute("cellpadding","0");c.appendChild(U);n=document.createElement("DIV");n.className="grid-lock";L=document.createElement("DIV");L.className="grid-lock-clock";n.appendChild(L);A=document.createElement("DIV");A.className="grid";A.appendChild(c);G=document.createElement("DIV");G.className="grid-scroll";if(is_ie){G.setAttribute("hidefocus","hidefocus");G.setAttribute("tabIndex","-1")}I=document.createElement("IMG");I.style.width="1px";I.style.height="1px";if(!is_ie){I.src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="}else{I.src="../img/space.gif"}G.appendChild(I);G.style.overflow="auto";l=document.createElement("DIV");l.className="grid-position";l.appendChild(A);l.appendChild(G);l.appendChild(n);addHandler(document.body,"mousedown",h.checkFocus);if(b.sortDir){B=b.sortDir}if(b.sortType){g=b.sortType}};this.getElement=function(){return l};var w=0;var t=false;var y=0;var D=0;var f=0;var h=this;var i=H;var K=0;var q=0;var e=0;var E=0;var o=0;var k=0;var I,c,G,l,C,A,d;var n,L;var p=22;h.init()}function Layout(k,j){this.init=function(){b=document.createElement("DIV");if(k=="wm5-duo"){q=document.createElement("DIV");q.className="resize-left";if(j.left.source){q.appendChild(j.left.source)}i=document.createElement("DIV");i.className="resize-border-left";i.onmousedown=p.itemsResize;f=document.createElement("DIV");f.className="resize-right";if(j.right.source){f.appendChild(j.right.source)}if(is_ie){i.style.styleFloat="left";q.style.styleFloat="left";f.style.styleFloat="right"}else{q.style.cssFloat="left";i.style.cssFloat="left";f.style.cssFloat="right"}b.appendChild(q);b.appendChild(i);b.appendChild(f)}else{if(k=="wm5-trio"){q=document.createElement("DIV");q.className="resize-left";if(j.left.source){q.appendChild(j.left.source)}i=document.createElement("DIV");i.className="resize-border-left";i.onmousedown=p.itemsResize;f=document.createElement("DIV");f.className="resize-right";n=document.createElement("DIV");n.className="resize-north";if(j.north.source){n.appendChild(j.north.source)}d=document.createElement("DIV");d.className="resize-border-north";d.onmousedown=p.itemsResize;resizeSouth=document.createElement("DIV");resizeSouth.className="resize-south";if(j.south.source){resizeSouth.appendChild(j.south.source)}if(is_ie){i.style.styleFloat="left";q.style.styleFloat="left";f.style.styleFloat="right"}else{q.style.cssFloat="left";i.style.cssFloat="left";f.style.cssFloat="right"}f.appendChild(n);f.appendChild(d);f.appendChild(resizeSouth);b.appendChild(q);b.appendChild(i);b.appendChild(f)}else{if(k=="wm5-trio-line"){q=document.createElement("DIV");q.className="resize-left";if(j.left.source){q.appendChild(j.left.source)}i=document.createElement("DIV");i.className="resize-border-left-line";i.onmousedown=p.itemsResize;e=document.createElement("DIV");e.className="resize-center";if(j.center.source){e.appendChild(j.center.source)}m=document.createElement("DIV");m.className="resize-border-right-line";m.onmousedown=p.itemsResize;f=document.createElement("DIV");f.className="resize-right";if(j.right.source){f.appendChild(j.right.source)}if(is_ie){q.style.styleFloat="left";i.style.styleFloat="left";e.style.styleFloat="left";m.style.styleFloat="left";f.style.styleFloat="right"}else{q.style.cssFloat="left";i.style.cssFloat="left";e.style.cssFloat="left";m.style.cssFloat="left";f.style.cssFloat="right"}b.appendChild(q);b.appendChild(i);b.appendChild(e);b.appendChild(m);b.appendChild(f)}}}};this.itemsResize=function(B){this.resizing=function(H){var H=H||window.event;var F=H.clientX||H.pageX;var J=H.clientY||H.pageY;F=F-c;J=J;if(x.className=="resize-border-left"||x.className=="resize-border-right-line"||x.className=="resize-border-left-line"){if(isNaN(F)){F=0}var I=F;if(F<u){I=u}if(F>t){I=t}A.style.left=I+"px"}else{if(x.className=="resize-border-north"){if(isNaN(J)){J=0}var G=J;if(J<D){G=D}if(J>C){G=C}A.style.top=G+"px"}}};this.stopResizing=function(J){if(x.className=="resize-border-left"){var G=parseInt(A.style.left)-5;var F=parseInt(a-5-G);j.left.width=(G/((a-5)*0.01));j.right.width=(F/((a-5)*0.01));removeChild(A);p.resize();if(j.left.func){j.left.func()}if(j.right.func){j.right.func()}}else{if(x.className=="resize-border-north"){var I=parseInt(A.style.top)-l;var H=parseInt(o-5-I);j.north.height=(I/((o-5)*0.01));j.south.height=(H/((o-5)*0.01));removeChild(A);p.resize();if(j.north.func){j.north.func()}if(j.south.func){j.south.func()}}else{if(x.className=="resize-border-left-line"){var G=parseInt(A.style.left)-5;var F=parseInt(a-10-G-j.right.width*((a-10)*0.01));j.left.width=(G/((a-10)*0.01));j.center.width=(F/((a-10)*0.01));removeChild(A);p.resize();if(j.left.func){j.left.func()}if(j.center.func){j.center.func()}}else{if(x.className=="resize-border-right-line"){var G=parseInt(A.style.left)-10-j.left.width*((a-10)*0.01);var F=parseInt(a-10-G-j.left.width*((a-10)*0.01));j.center.width=(G/((a-10)*0.01));j.right.width=(F/((a-10)*0.01));removeChild(A);p.resize();if(j.center.func){j.center.func()}if(j.right.func){j.right.func()}}}}}document.onmousemove=r;document.onmouseup=s;document.body.style.cursor="default";preventSelection(document.body,false)};var r;var s;var E;var B=B||window.event;var w=B.clientX||B.pageX;var v=B.clientY||B.pageY;var x=(B.target||B.srcElement);var z,y,u,t,D,C;var A=document.createElement("DIV");A.className="resize-border-active";r=document.onmousemove;s=document.onmouseup;E=document.body.style.cursor;if(x.className=="resize-border-left"){z=l;y=c+parseInt(((a-5)*0.01*j.left.width));u=parseInt(((a-5)*0.01*j.left.minWidth));t=parseInt(a-((a-5)*0.01*j.right.minWidth));A.style.width=5+"px";A.style.height=o+"px";document.body.style.cursor="col-resize"}else{if(x.className=="resize-border-north"){z=l+parseInt((o-5)*0.01*j.north.height);y=c+parseInt((a-5)*0.01*j.left.width)+5;D=parseInt((o-5)*0.01*j.north.minHeight);C=parseInt(o-((o-5)*0.01*j.south.minHeight));A.style.width=parseInt((a-5)*0.01*j.right.width)+"px";+"px";document.body.style.cursor="row-resize"}else{if(x.className=="resize-border-left-line"){z=l;y=c+parseInt(((a-10)*0.01*j.left.width));u=c+parseInt(((a-10)*0.01*j.left.minWidth));t=c+parseInt(((a-10)*0.01*j.left.width))+5+parseInt(((a-10)*0.01*j.center.width))-parseInt(((a-10)*0.01*j.center.minWidth));A.style.width=5+"px";A.style.height=o+"px";document.body.style.cursor="col-resize"}else{if(x.className=="resize-border-right-line"){z=l;y=c+parseInt(((a-10)*0.01*j.left.width))+5+parseInt(((a-10)*0.01*j.center.width));u=c+parseInt(((a-10)*0.01*j.left.width))+5+parseInt(((a-10)*0.01*j.center.minWidth));t=c+parseInt(((a-10)*0.01*j.left.width))+5+parseInt(((a-10)*0.01*j.center.width))+parseInt(((a-10)*0.01*j.right.width))-parseInt(((a-10)*0.01*j.right.minWidth));A.style.width=5+"px";A.style.height=o+"px";document.body.style.cursor="col-resize"}}}}A.style.left=y+"px";A.style.top=z+"px";b.appendChild(A);document.onmousemove=this.resizing;document.onmouseup=this.stopResizing;preventSelection(document.body,true)};this.resize=function(u){a=b.parentNode.offsetWidth;o=b.parentNode.offsetHeight-(is_ie6?15:0);l=b.parentNode.offsetTop;c=b.parentNode.offsetLeft;if(k=="wm5-duo"){var x=(a-5)*0.01;var t=j.left.width;var v=j.right.width;if(j.left.hidden){x=(a-25-5)*0.01;v=100;q.style.width="25px"}if(!j.left.hidden){q.style.width=parseInt(x*t)+"px"}f.style.width=parseInt(x*v)+"px";q.style.height=o+"px";f.style.height=o+"px";i.style.height=o+"px"}else{if(k=="wm5-trio"){var x=(a-5)*0.01;var t=j.left.width;var v=j.right.width;if(j.left.hidden||j.left.hidden){x=(a-25-5)*0.01;if(j.left.hidden){v=100;q.style.width="25px"}else{t=100;f.style.width="25px"}}if(!j.left.hidden){q.style.width=parseInt(x*t)+"px"}if(!j.right.hidden){f.style.width=parseInt(x*v)+"px"}q.style.height=o+"px";f.style.height=o+"px";i.style.height=o+"px";if(h==1){n.style.height=parseInt(o)+"px";resizeSouth.style.height="0px";d.style.height="0px"}else{n.style.height=parseInt((o-5)*0.01*j.north.height)+"px";resizeSouth.style.height=parseInt((o-5)*0.01*j.south.height)+"px";d.style.height="5px"}n.style.width=parseInt(x*v)+"px";resizeSouth.style.width=parseInt(x*v)+"px";d.style.width=parseInt(x*v)+"px"}else{if(k=="wm5-trio-line"){var x=(a-10)*0.01;var t=j.left.width;var v=j.right.width;var w=j.center.width;if(j.right.hidden&&!j.left.hidden){f.style.width="25px";var s=t*x;x=(a-30-10)*0.01;var r=t*x;t+=(s-r)/x;w=100-t;x=(a-25-10)*0.01}else{if(j.left.hidden&&!j.right.hidden){q.style.width="25px";var s=v*x;x=(a-25-10)*0.01;var r=v*x;v+=(s-r)/x;w=100-v;x=(a-25-10)*0.01}else{if(j.left.hidden&&j.right.hidden){q.style.width="25px";f.style.width="25px";w=100;x=(a-2*25-10)*0.01}else{w=100-t-v}}}q.style.height=o+"px";i.style.height=o+"px";e.style.height=o+"px";m.style.height=o+"px";f.style.height=o+"px";if(!j.left.hidden){q.style.width=parseInt(x*t)+"px"}e.style.width=parseInt(x*w)+"px";if(!j.right.hidden){f.style.width=parseInt(x*v)+"px"}}}}};this.getNorthWidth=function(){if(typeof(j.north)!="undefined"){if(p.isHiddenItem("north")){return g.north}else{return Math.floor(j.north.width)}}else{return null}};this.getSouthWidth=function(){if(typeof(j.south)!="undefined"){if(p.isHiddenItem("south")){return g.south}else{return Math.floor(j.south.width)}}else{return null}};this.getLeftWidth=function(){if(typeof(j.left)!="undefined"){if(p.isHiddenItem("left")){return g.left}else{return Math.floor(j.left.width)}}else{return null}};this.getRightWidth=function(){if(typeof(j.right)!="undefined"){if(p.isHiddenItem("right")){return g.right}else{if(k=="wm5-duo"||k=="wm5-trio"){var r=0;if(p.isHiddenItem("left")){r+=(g.left-j.left.width)}return Math.floor(j.right.width-r)}else{return Math.floor(j.right.width)}}}else{return null}};this.getCenterWidth=function(){if(typeof(j.center)!="undefined"){if(p.isHiddenItem("center")){return g.center}else{var r=0;if(p.isHiddenItem("left")){r+=(g.left-j.left.width)}if(p.isHiddenItem("right")){r+=(g.right-j.right.width)}return Math.floor(j.center.width-r)}}else{return null}};this.redraw=this.resize;this.render=function(){addHandler(window,"resize",p.resize)};var g=new Array();this.isHiddenItem=function(r){if(g[r]!=null){return true}else{return false}};this.hideItem=function(r,s){if(typeof s=="undefined"){s="30"}if(k=="wm5-trio-line"){if(r=="left"){g.left=parseInt(q.offsetWidth)/((a-10)*0.01);q.style.width=s+"px";j.center.width+=j.left.width;j.left.width=0;j.left.hidden=true;i.className="resize-border-left-line-hide";i.onmousedown=null}if(r=="right"){g.right=parseInt(f.offsetWidth)/((a-10)*0.01);f.style.width=s+"px";j.center.width+=j.right.width;j.right.width=0;j.right.hidden=true;m.className="resize-border-right-line-hide";m.onmousedown=null}}else{if(k=="wm5-duo"||k=="wm5-trio"){if(r=="left"){g.left=parseInt(q.offsetWidth)/((a-5)*0.01);j.right.width=100;j.left.width=0;j.left.hidden=true;i.className="resize-border-left-line-hide";i.onmousedown=null}if(r=="right"){g.right=parseInt(f.offsetWidth)/((a-5)*0.01);j.right.width=parseInt(s/((a-5)*0.01));j.left.width+=(g.right-j.right.width);j.right.hidden=true;i.className="resize-border-left-line-hide";i.onmousedown=null}}}p.resize()};this.showItem=function(r){if(k=="wm5-trio-line"){if(r=="left"){if(g.left){j.center.width-=g.left;j.left.width=g.left;j.left.hidden=false;i.onmousedown=p.itemsResize;i.className="resize-border-left-line";i.onmousedown=p.itemsResize;g.left=null}}if(r=="right"){if(g.right){j.center.width-=g.right;j.right.width=g.right;j.right.hidden=false;i.onmousedown=p.itemsResize;m.className="resize-border-right-line";m.onmousedown=p.itemsResize;g.right=null}}}else{if(k=="wm5-duo"||k=="wm5-trio"){if(r=="left"){if(g.left){j.right.width=100-g.left;j.left.width=g.left;i.onmousedown=p.itemsResize;j.left.hidden=false;i.className="resize-border-left";i.onmousedown=p.itemsResize;g.left=null}}if(r=="right"){if(g.right){j.left.width=100-g.right;j.right.width=g.right;j.right.hidden=false;i.onmousedown=p.itemsResize;i.className="resize-border-left";i.onmousedown=p.itemsResize;g.right=null}}}}p.resize()};this.hide=function(){resizeSouth.style.display="none";d.style.display="none";h=1;p.resize()};this.show=function(){resizeSouth.style.display="";d.style.display="";h=0;p.resize()};this.getElement=function(){return b};var p=this;var h=0;var m,e;var q,i,f,n,d,f,b;var a=0,o=0,l=0,c=0;this.init()}lockScreenOn = false;function lockScreen(){this.show=function(f){document.body.appendChild(a);document.body.appendChild(c);setElementOpacity(c,"0.25");setElementOpacity(a,"0.25");b.resize();var g=document.body.style.overflow;if(g==null||typeof(g)=="undefined"||g!="hidden"){e=document.body.style.overflow;document.body.style.overflow="hidden"}if(f){c.style.display="block";d=setTimeout(function(){b.hide()},30000)}a.style.display="block";lockScreenOn = true;};this.hide=function(){if(e!=null){document.body.style.overflow=e}if(d!=null){window.clearTimeout(d)}d=null;c.style.display="none";a.style.display="none";removeChild(a);removeChild(c);lockScreenOn = false;};this.resize=function(){a.style.width=getWindowWidth()+"px";a.style.height=getWindowHeight()+"px";c.style.left=Math.floor(getWindowWidth()/2)-15+"px";c.style.top=Math.floor(getWindowHeight()/2)-15+"px"};this.getMask=function(){return a};this.create=function(){a=document.createElement("DIV");a.className="lockscreen";c=document.createElement("DIV");c.className="lockscreen-clock";addLayer(a);addLayer(c);addHandler(window,"resize",b.resize)};var b=this;var c,a,d;var e;this.create();return this}function mBox(n,j){this.onKeyDownMbox=function(v){var u=(v)?v:window.event;switch(u.keyCode){case 27:if(n.closeButton){if(c!=null){c.click()}t();k.close()}case 32:case 13:break}};this.onMouseDownMbox=function(w){var u=(w)?w:window.event;var v=getPageCoords(u);q=v.y-parseInt(mainDiv.style.top);r=v.x-parseInt(mainDiv.style.left);movePanel=true;f=document.onmousemove;l=document.onmouseup;document.onmousemove=g.onMouseMoveMbox;mainDiv.onmouseup=g.onMouseUpMbox};this.onMouseMoveMbox=function(w){var u=(w)?w:window.event;if(movePanel){var v=getPageCoords(u);mainDiv.style.top=(v.y-q)+"px";mainDiv.style.left=(v.x-r)+"px"}};this.onMouseUpMbox=function(w){var u=(w)?w:window.event;var v=(u.target)?u.target:u.srcElement;movePanel=false;document.onmousemove=f;document.onmouseup=l};this.show=function(){window.scrollTo(0,0);if(c!=null){c.setFocus()}};this.getLock=function(){return k.getLock()};this.getMainLayer=function(){return k.getMainLayer()};function t(){document.onkeydown=i}var g=this;var f;var l;var q,r;var k;var o;var s=document.createElement("DIV");var p=document.createElement("DIV");p.className="alert_text";p.innerHTML=n.bodyText?n.bodyText:"";s.appendChild(p);var e=document.createElement("DIV");e.className="alert_bottom";e.align="center";var m=document.createElement("TABLE");var a=document.createElement("TBODY");var b=document.createElement("TR");var d=document.createElement("TD");d.appendChild(e);b.appendChild(d);a.appendChild(b);m.appendChild(a);k=new winBox({headText:n.headText,closeButton:true,width:n.width?n.width:"300px",body:s,bottom:m},null);var c;for(key in j){btn=new Button({target:e,name:j[key].name,func:j[key].func});btn.setMultiFunc([j[key].func,k.close,t]);if(j[key].setDefault){btn.setFocus();c=btn}}var h=k.getCloseBtn();if(h){addHandler(h,"click",function(){t()})}var i=null;if(document.onkeydown!=null){i=document.onkeydown}document.onkeydown=this.onKeyDownMbox;this.show();k.show()}function MultiSelect(h,n,f){this.showOptions=function(){if(i==null){return}if(p.style.display!="block"){p.style.height=((i.length*17)>150?"150px":"auto");p.style.width=(parseInt(l.offsetWidth)-2)+"px";p.style.display="block";if(a!=o.onMouseUp){a=document.onmouseup}document.onmouseup=o.onMouseUp;if(j!=o.onMouseDown){j=document.onmousedown}document.onmousedown=o.onMouseDown;if(!is_ie){addHandler(document,"DOMMouseScroll",o.onScroll);addHandler(document,"DOMMouseScroll",o.onScroll)}addHandler(document,"scroll",o.onScroll);addHandler(document,"mousewheel",o.onScroll)}else{o.hideOptions()}};this.onScroll=function(s){var q=(s)?s:window.event;var r=(q.target)?q.target:q.srcElement;while(r!=null){if(r.className=="cmb-active"||r.className=="cmb-options"){return false}r=r.parentNode}o.hideOptions()};this.onMouseDown=function(s){var q=(s)?s:window.event;var r=(q.target)?q.target:q.srcElement;while(r!=null){if(r.className=="cmb-active"||r.className=="cmb-options"){if(r.id){if(r.id!=o.id){o.hideOptions()}}return false}r=r.parentNode}o.hideOptions()};this.onMouseUp=function(s){var q=(s)?s:window.event;var r=(q.target)?q.target:q.srcElement;while(r!=null){if(r.className=="cmb-active"||r.className=="cmb-options"||r.className=="cmb-pushed"){return false}r=r.parentNode}o.hideOptions()};this.hideOptions=function(){p.style.display="none";if(a!=null){document.onmouseup=a}if(j!=null){document.onmousedown=j}document.onmousedown=null;document.onmouseup=null;k.blur();l.className="cmb";if(!is_ie){removeHandler(document,"DOMMouseScroll",o.onScroll);removeHandler(document,"DOMMouseScroll",o.onScroll)}removeHandler(document,"scroll",o.onScroll);removeHandler(document,"mousewheel",o.onScroll)};this.onOptionClick=function(u){var q=(u)?u:window.event;var s=(q.target)?q.target:q.srcElement;var t=s.tagName;while(s!=null){if(s.tagName=="LABEL"){if(!m){var r=s.getElementsByTagName("INPUT")[0];if(s.className=="boxchecked"){s.className="";r.checked=false;--d}else{s.className="boxchecked";r.checked=true;++d}k.value=d+" "+f.lang.selected;if(t=="LABEL"){return false}}else{k.value=s.title;c=s.getAttribute("name");o.hideOptions();for(key in i){if(i[key].id==c){if(i[key].func){i[key].func()}}}}}s=s.parentNode}};this.getValue=function(){var r=new Array();r.selected="";r.unselected="";if(m){r.selected=c;for(key in i){if(i[key].defaultSelected){r.unselected=i[key].id}}}else{var s=getElementsByClassName(p,"INPUT","mcheckbox");for(var q in s){if(s[q].checked){for(key in i){if(!i[key].checked){if(i[key].id==s[q].value){r.selected+=s[q].value+"|";break}}}}else{for(key in i){if(i[key].checked){if(i[key].id==s[q].value){r.unselected+=s[q].value+"|";break}}}}}}return r};this.setDisable=function(){l.className="cmb-disable";k.onmouseup=null;k.setAttribute("readOnly","readOnly")};this.setEnable=function(){l.className="cmb";k.onmouseup=o.showOptions;k.removeAttribute("readOnly")};this.setValue=function(s){var t=true;i=s;p.innerHTML="";d=0;if(i==null||i.length<=0){k.value=f.lang.listEmpty;o.setDisable();return}else{if(k.value==f.lang.listEmpty){o.setEnable()}}for(key in i){var q;var r=document.createElement("LABEL");r.onclick=o.onOptionClick;r.onselectstart=function(){return false};if(!m){if(i[key].checked){q='<input type="checkbox" value="'+i[key].id+'" checked="checked" class="mcheckbox"/>';r.className="boxchecked";++d}else{q='<input type="checkbox" value="'+i[key].id+'" class="mcheckbox"/>'}r.innerHTML=q;var u=document.createTextNode(i[key].name);r.appendChild(u)}else{if(i[key].defaultSelected||t){k.value=(i[key].name);c=i[key].id;t=false}if(i[key].func){}var u=document.createTextNode(i[key].name);r.appendChild(u);r.setAttribute("name",i[key].id)}r.setAttribute("title",(i[key].name));p.appendChild(r)}if(!m){k.value=d+" "+f.lang.selected}};this.clearInput=function(){k.value=""};this.setSelected=function(q){for(key in i){if(i[key].id==q){i[key].defaultSelected=true}else{if(i[key].defaultSelected){i[key].defaultSelected=false}}}o.setValue(i)};var o=this;var i=n;var a,j;var d=0;var b=Math.floor(Math.random()*100000000);var m=false;var c;var e=24;if(f){if(f.simpleSelect){m=true}}var k=document.createElement("INPUT");k.setAttribute("TYPE","text");k.setAttribute("readOnly","readOnly");k.className="cmb-input";k.onfocus=function(){this.blur()};if(m){k.value=""}else{k.value=d+" "+f.lang.selected}var g=document.createElement("DIV");g.className="cmb-arrow";g.onmouseover=function(){if(this.parentNode.className!="cmb-active"&&this.parentNode.className!="cmb-disable"){this.parentNode.className="cmb-hover"}};g.onmouseout=function(){if(this.parentNode.className!="cmb-active"&&this.parentNode.className!="cmb-disable"){this.parentNode.className="cmb"}};g.onmousedown=function(){if(this.parentNode.className!="cmb-disable"){this.parentNode.className="cmb-pushed"}};g.onmouseup=function(){if(this.parentNode.className!="cmb-disable"){this.parentNode.className="cmb-active";o.showOptions()}};var p=document.createElement("DIV");p.className="cmb-options";p.style.display="none";var l=document.createElement("DIV");l.className="cmb";l.id=b;l.appendChild(k);l.appendChild(g);if(f){if(f.width){l.style.width=f.width+"px";k.style.width=f.width-e+"px"}}this.setValue(i);preventSelection(k,true);h.appendChild(l);h.appendChild(p)}function Notify(){this.createNotify=function(){b=document.createElement("DIV");b.style.width="auto";b.style.top="40px";b.style.left=(parseInt(getWindowWidth())-300)/2+"px";b.style.position="absolute";var c=document.getElementsByTagName("BODY")[0];c.appendChild(b);addHandler(window,"resize",a.resize)};this.resize=function(){if(b!=null){b.style.left=(parseInt(getWindowWidth())-b.offsetWidth)/2+"px"}};this.showNotify=function(c){if(b!=null){hideNotify()}if(c.length>100){c=c.substring(0,100)+"..."}a.createNotify();b.innerHTML='<div class="notify_contaner" onstartselect="return false;" onclick="this.style.display=\'none\';"><div class="notify"><center><span class="notifyTxt">'+c+'</span></center></div><div class="notify_underlay"/></div>';b.style.left=(parseInt(getWindowWidth())-b.offsetWidth)/2+"px";b.style.display="block";setTimeout("hideNotify()","4000")};hideNotify=function(){if(b!=null){b.style.display="none";var c=document.getElementsByTagName("BODY")[0];c.removeChild(b);removeHandler(window,"resize",a.resize);b=null}};var b;var a=this}function searchBox(g,d){this.createMenu=function(m){var n='<table summary="" class="SearchMenuMain"><tbody><tr><td class="SearchMenu">';for(var o in m){n+='<div class="'+(o==d.defaultBy?"SearchMenuPoint":"searchbyitem")+'" name="'+m[o].param+'">'+m[o].name+"</div>"}n+="</td></tr></tbody></table>";return n};this.onMouseDown=function(p){var o=(p)?p:window.event;if((typeof o)=="undefined"){return false}var n=(o.target)?o.target:o.srcElement;var m=n;while(n!=null){if(n.className=="searchbyitem"){if(f!=null){f.className="searchbyitem"}f=m;f.className="SearchMenuPoint";if(d.autosearch){k.closeSerchByMenu();if((/^[\s]+$/).test(l.value)||l.value==""){return true}if(d.searchFunc!=null){d.searchFunc(l.value,f.getAttribute("name"))}i.style.display=""}return true}n=n.parentNode}k.closeSerchByMenu()};this.showSerchByMenu=function(){b.style.top=c.offsetTop+c.offsetHeight-1+"px";b.style.left=c.offsetLeft+20+"px";b.style.display="";if(document.onmousedown!=k.onMouseDown){h=document.onmousedown}document.onmousedown=k.onMouseDown};this.closeSerchByMenu=function(){b.style.display="none";document.onmousedown=h};var a="";var e=null;this.autoSearch=function(){if((/^[\s]+$/).test(l.value)||l.value==""){return}if(l.value!=a){if(d.searchFunc!=null){d.searchFunc(l.value,f.getAttribute("name"))}a=l.value;i.style.display=""}};this.onKeyDown=function(n){var m=(n)?n:window.event;if(m.keyCode==13){if(d.searchFunc!=null){d.searchFunc(l.value,f.getAttribute("name"))}i.style.display=""}else{if(d.autosearch){if(e!=null){window.clearTimeout(e)}e=setTimeout(function(){k.autoSearch()},1000)}}};this.clearSearch=function(){l.value="";if(d.clearFunc!=null){d.clearFunc()}i.style.display="none"};this.setSearchText=function(m){l.value="text"};var k=this;var f;var h;var l=document.createElement("INPUT");l.className="quickSearchText";l.setAttribute("TYPE","text");l.onkeydown=k.onKeyDown;var j=document.createElement("DIV");j.className="search_block_zoom";j.onmouseup=this.showSerchByMenu;var i=document.createElement("DIV");i.className="search_block_clear";i.onmouseup=this.clearSearch;i.style.display="none";var c=document.createElement("DIV");c.className="search_block2";c.appendChild(j);c.appendChild(l);c.appendChild(i);g.appendChild(c);var b=document.createElement("DIV");b.style.display="none";b.style.position="absolute";b.innerHTML=k.createMenu(d.serchBy);f=getElementsByClassName(b,"DIV","SearchMenuPoint")[0];b.onmouseup=this.closeSerchByMenu;document.body.appendChild(b)}function SlidePanel(d){this.init=function(){b=document.createElement("DIV");b.innerHTML=d.name;b.className="wm5_ac_ht";var l=document.createElement("SPAN");l.className="wm5_ac_ai";l.innerHTML="&nbsp;";j=document.createElement("SPAN");j.className="wm5_ac_collapse";j.innerHTML="&nbsp;";l.appendChild(j);i=document.createElement("DIV");i.className="wm5_ac_h";i.appendChild(b);i.appendChild(l);h=document.createElement("DIV");h.className="accordion_content";h.style.overflow="auto";c=document.createElement("DIV");c.className="wm5_ac";c.appendChild(i);c.appendChild(h);h.appendChild(d.source);if(d.collapsed){j.className="wm5_ac_expand";d.source.style.display="none";b.style.display="none";c.style.overflow="hidden";c.className="wm5_ac_hidden";c.style.height="auto";c.style.width="21px";if(!isNaN(c.style.height)){h.style.height=parseInt(c.style.height)-22+"px"}j.onclick=k.expand;f=true}else{j.onclick=k.collapse;f=false}};this.collapse=function(o,n,q){if(n==null&&q==null){e=true;n=new Date().getTime();q=a;g=parseInt(getWidth(c));j.className="wm5_ac_expand";h.style.height=parseInt(c.style.height)-i.offsetHeight-5+"px";d.source.style.display="none";b.style.display="none";i.style.height="22px";c.style.overflow="hidden";c.className="wm5_ac_hidden";j.onclick=null;f=true;if(d.funcCollapse){d.funcCollapse()}}var m=new Date().getTime();var p=m-n;if(q<=p){c.style.width="auto";j.onclick=k.expand;e=false;k.resize();return}q-=p;var l=Math.round((q/a)*g);if(l>25){c.style.width=l+"px"}setTimeout(function(){k.collapse(null,m,q)},11)};this.expand=function(o,n,q){if(n==null&&q==null){if(d.funcExpand){d.funcExpand()}if(g==null){g=parseInt(getWidth(c.parentNode))}c.style.width="auto";e=true;n=new Date().getTime();q=a;j.className="wm5_ac_collapse";j.onclick=null;f=false}var m=new Date().getTime();var p=m-n;if(q<=p){c.style.width="auto";b.style.display="";d.source.style.display="";c.className="wm5_ac";j.onclick=k.collapse;e=false;k.resize();return}q-=p;var l=parseInt(Math.round((q/a)*g));c.style.width=(g-l)+1+"px";setTimeout(function(){k.expand(null,m,q)},11)};this.resize=function(n){if(e){return}var l=parseInt(c.parentNode.offsetHeight-1);if(isNaN(l)){return}if(l<0){l=0}c.style.height=l+"px";if((l-i.offsetHeight)>0){h.style.height=(l-i.offsetHeight)+"px"}else{h.style.height="0px"}if(c.className=="wm5_ac_hidden"){var m=parseInt(c.parentNode.offsetHeight)-22;if(m<0){m=0}h.style.height=m+"px"}};this.render=function(){addHandler(window,"resize",k.resize);preventSelection(i,true)};this.redraw=function(){k.resize()};this.isCollapsed=function(){return f};this.getElement=function(){return c};var k=this;var a=50;var g=null;var e=false;var f=false;var j,i,h,c,b;k.init()}function Switcher(b,e){this.switchItem=function(i){var f=(i)?i:window.event;var h=(f.target)?f.target:f.srcElement;while(h!=null){if(h.tagName=="A"){if(d!=h.id){switch(c[h.id].className){case"ta-but1":c[h.id].setAttribute("class","ta-but1 ta-but-a");c[h.id].className="ta-but1 ta-but-a";break;case"ta-but2":c[h.id].setAttribute("class","ta-but2 ta-but-a");c[h.id].className="ta-but2 ta-but-a";break;case"ta-but3":c[h.id].setAttribute("class","ta-but3 ta-but-a");c[h.id].className="ta-but3 ta-but-a";break}switch(c[d].className){case"ta-but1 ta-but-a":c[d].setAttribute("class","ta-but1");c[d].className="ta-but1";break;case"ta-but2 ta-but-a":c[d].setAttribute("class","ta-but2");c[d].className="ta-but2";break;case"ta-but3 ta-but-a":c[d].setAttribute("class","ta-but3");c[d].className="ta-but3";break}d=h.id;for(var g in b){if(b[g].id==h.id){b[g].func()}}}return true}h=h.parentNode}};this.init=function(){for(var i in b){var f=document.createElement("A");f.setAttribute("href","#");if(b[i].tooltip){f.title=b[i].tooltip}if(b[i].id){f.onclick=a.switchItem;f.id=b[i].id}var g=document.createElement("DIV");if(b[i].name){g.innerHTML=b[i].name}if(i==0){f.className="ta-but1";var h=document.createElement("DIV");h.className="ta-left";g.className="ta-left-r";f.appendChild(h);f.appendChild(g)}else{if(i<b.length-1){f.className="ta-but2";g.className="ta-center-r";f.appendChild(g)}else{f.className="ta-but3";var h=document.createElement("DIV");h.className="ta-right";g.className="ta-right-r";f.appendChild(g);f.appendChild(h)}}if(b[i].selected){f.className+=" ta-but-a";if(b[i].id){d=b[i].id}}if(b[i].id){c[b[i].id]=new Array();c[b[i].id]=f}e.appendChild(f)}};var a=this;var d;var c=new Array();a.init()}function tabPanel(o,m,h){this.tabClick=function(s){var k=(s)?s:window.event;var r=(k.target)?k.target:k.srcElement;while(r!=null){if(r.className!=null){if("htabs-div"==r.className){p.setTabActive(r.id)}}r=r.parentNode}};this.setTabActive=function(k){b[j].type="disactive";e[j].innerHTML="";e[j].appendChild(p.createTab(b[j]));d["cont_"+j].style.display="none";d["cont_"+j].style.visibility="hidden";j=k;b[j].type="active";if(b[j].func){b[j].func()}e[j].innerHTML="";e[j].appendChild(p.createTab(b[j]));d["cont_"+j].style.display="";d["cont_"+j].firstChild.style.padding="20 10 0 10";d["cont_"+j].firstChild.style.display="";d["cont_"+j].style.visibility=""};this.createTab=function(s){var k;var r=document.createElement("DIV");r.id=s.id;r.onclick=p.tabClick;if(s.type=="active"){r.className="htabs-div htabs-act";k='    <a href="#" class="htabs-btn">		<div class="htabs-left"></div>		<div class="htabs-center">			<div class="htabs-inner-cnt">'+s.name+'</div>		</div>		<div class="htabs-right"></div>	</a>'}else{r.className="htabs-div";k='    <a href="#" class="htabs-btn">		<div class="htabs-left"></div>		<div class="htabs-center">			<div class="htabs-inner-cnt">'+s.name+'</div>		</div>		<div class="htabs-right"></div>	</a>'}r.innerHTML=k+'<div class="htabs-hr"></div>';return r};this.setDisableTab=function(k){e[k].style.display="none"};this.setEnableTab=function(k){e[k].style.display=""};this.resize=function(){g.style.height=(parseInt(m.parentNode.style.height)-n.offsetHeight)+"px"};this.render=function(){addHandler(window,"resize",p.resize)};var p=this;var n=document.createElement("DIV");n.className="tab-header";var g=document.createElement("DIV");g.className="tab-cont";var j;var b=new Array();var e=new Array();var d=new Array();var c="disactive";for(var q in o){b[o[q].id]=o[q];var a=o[q].id;if(o[q].active){b[a].type="active";j=a}else{b[a].type="disactive"}if(o[q].func){b[a].func=o[q].func}e[a]=document.createElement("DIV");e[a].appendChild(this.createTab(b[a]));n.appendChild(e[a]);var l=document.createElement("DIV");l.className="tab-content";l.style.display="none";l.id="cont_"+a;if(a==j){l.style.display="";b[a].item.style.display="";b[a].item.style.padding="20 10 0 10"}l.appendChild(b[a].item);d[l.id]=l;g.appendChild(d[l.id])}var i=document.createElement("DIV");i.className="tab-bottom";for(var f in h){i.appendChild(h[f])}g.appendChild(i);m.appendChild(n);m.appendChild(g)}function TimePicker(b,e,c){this.getTime=function(){var m=g.value;l.showPicker();a.style.display="inline"};this.showPicker=function(){enableClosePicker=false;a.innerHTML=l.createTimePicker();a.style.display="inline";if(c){if(c.showTop){logging(a.style.height);logging(a);a.style.top=(i.offsetTop-a.offsetHeight+i.offsetHeight)+"px"}else{a.style.top=i.offsetTop+"px"}if(c.showLeft){a.style.left=(i.offsetLeft)+"px"}else{a.style.left=(i.offsetLeft+i.offsetWidth-j.offsetWidth)+"px"}}addHandler(document.body,"mouseup",l.mouseUp);addHandler(document.body,"mousedown",l.checkFocus)};this.createTimePicker=function(){var n="";n+='<div align="center" class="HoursMinutes"><div class="hour">'+b.hours+'</div><div class="minute">'+b.minutes+"</div></div>";n+='<table cellpadding="0" cellspacing="0"><tr><td width="48" class="HoursPick">';for(var m=1;m<=12;++m){if((h==m)||(h-12==m)||(h==0&&m==12)){n+='<div class="tp_sel_h" name="hours '+m+'"><a href="#">'+m+"</a></div>"}else{n+='<div name="hours '+m+'"><a href="#">'+m+"</a></div>"}}n+='</td><td class="LineTimePick"></td><td width="48" class="HoursPick">';for(var m=0;m<60;m+=5){if(d==m){n+='<div class="tp_sel_m" name="minutes '+(m<10?"0"+m:m)+'"><a href="#">'+(m<10?"0"+m:m)+"</a></div>"}else{n+='<div name="minutes '+(m<10?"0"+m:m)+'"><a href="#">'+(m<10?"0"+m:m)+"</a></div>"}}n+='</td></tr></table><div align="center" class="AMPM">';if(h<12){n+='<span class="tp_sel_ampm" name="ampm AM"><a class="ampnsel" href="#" name="AM">AM</a></span><span name="ampm PM"><a class="ampnsel" href="#">PM</a></span>';f="AM"}else{n+='<span name="ampm AM"><a href="#" class="ampnsel" name="AM">AM</a></span><span class="tp_sel_ampm" name="ampm PM"><a class="ampnsel" href="#">PM</a></span>';f="PM"}n+='<span name="close"><a href="#" class="timepicker_close">&nbsp;</a></span>';return n};this.closePicker=function(){if(a.style.display!="none"){a.innerHTML=null;a.style.display="none";removeHandler(document.body,"mouseup",l.mouseUp);removeHandler(document.body,"mousedown",l.checkFocus);if(c){if(c.onclose){c.onclose()}}}};this.mouseUp=function(m){if(enableClosePicker){l.closePicker()}};this.checkFocus=function(p){var m=(p)?p:window.event;var o=(m.target)?m.target:m.srcElement;var n=p;while(o!=null){if(o.className=="TimePicker"){l.returnTime(n);return false}o=o.parentNode}l.closePicker()};this.returnTime=function(q){var m=(q)?q:window.event;var o=(m.target)?m.target:m.srcElement;while(o!=null){if(o.tagName=="SPAN"||o.tagName=="DIV"){var r=o.getAttribute("name");if(/^close/.test(r)){enableClosePicker=true;g.value=l.getFormatedTime();break}if(/^minutes/.test(r)){var p=getElementsByClassName(a,"DIV","tp_sel_m")[0];if(p!=null){p.className=""}o.className="tp_sel_m";d=o.getAttribute("name");d=parseInt(d.substring(7,d.length));g.value=l.getFormatedTime();break}if(/^hours/.test(r)){var p=getElementsByClassName(a,"DIV","tp_sel_h")[0];if(p!=null){p.className=""}o.className="tp_sel_h";h=o.getAttribute("name");if(f=="AM"){h=parseInt(h.substring(5,h.length));if(h==12){h=24}}else{h=12+parseInt(h.substring(5,h.length));if(h==24){h=12}}g.value=l.getFormatedTime();break}if(/^ampm/.test(r)){var p=getElementsByClassName(a,"SPAN","tp_sel_ampm")[0];if(p!=null){p.className=""}o.className="tp_sel_ampm";var n=o.getAttribute("name");n=n.substring(5,n.length);if(n=="AM"&&f!=n){h-=12;f="AM"}else{if(f!=n){if(h!=24){h+=12}else{h=12}f="PM"}}g.value=l.getFormatedTime();break}}o=o.parentNode}};this.clear=function(){g.value=""};this.setValue=function(m){var n=new Date(m*1000);h=n.getHours();d=n.getMinutes();g.value=l.getFormatedTime()};this.getValue=function(){var m=new Date();m.setHours(h);m.setMinutes(d);return m.valueOf()/1000};this.getFormatedTime=function(){var o=0;var n=0;var p="AM";if(true){if(h>12){p="PM";o=h-12}else{p="AM";o=h}if(h==12){p="PM";o=12}if(h==0||h==24){p="AM";o=12}return(o<10?"0"+o:o)+":"+(d<10?"0"+d:d)+" "+p}else{return(o<10?"0"+o:o)+":"+(d<10?"0"+d:d)}};var h=1;var d=0;var f="AM";var k=e;var l=this;var i=document.createElement("DIV");i.className="timepickermain";var g=document.createElement("INPUT");g.readOnly="true";g.className="tpicker_input";i.appendChild(g);var j=document.createElement("DIV");j.className="timepicker_icon";j.onclick=l.getTime;i.appendChild(j);var a=document.createElement("DIV");a.className="TimePicker";a.style.display="none";a.align="center";k.appendChild(i);k.appendChild(a);addHandler(document.body,"scroll",l.closePicker);addHandler(window,"resize",l.closePicker);if(is_gecko){addHandler(document.body,"DOMMouseScroll",l.closePicker)}else{addHandler(document.body,"mousewheel",l.closePicker)}}function TogglerList(c,e){this.collapse=function(n,l,p){if(l==null&&p==null){l=new Date().getTime();p=a;g.className="toggler-arrow-closed";f.style.overflow="hidden";g.onclick=null;h.onclick=null}var k=new Date().getTime();var o=k-l;if(p<=o){f.style.display="none";f.style.height="0px";g.onclick=i.expand;h.onclick=i.expand;return}p-=o;var m=Math.round((p/a)*d);f.style.height=m+"px";setTimeout(function(){i.collapse(null,k,p)},33)};this.expand=function(n,l,p){if(l==null&&p==null){l=new Date().getTime();p=a;f.style.display="";f.style.overflow="hidden";g.className="toggler-arrow";g.onclick=null;h.className="toggler-text";h.onclick=null}var k=new Date().getTime();var o=k-l;if(p<=o){f.style.height=d+2+"px";g.onclick=i.collapse;h.onclick=i.collapse;return}p-=o;var m=parseInt(Math.round((p/a)*d));f.style.height=(d-m)+1+"px";setTimeout(function(){i.expand(null,k,p)},33)};this.appendItem=function(m,n,k){var l=document.createElement("DIV");l.className=n;l.appendChild(m);j[n]=new Array();j[n].element=l;j[n].height=k;f.appendChild(l);d+=k;if(g.className=="toggler-arrow-empty"){if(c.collapsed){f.style.display="none";g.className="toggler-arrow-closed";g.onclick=i.expand;h.className="toggler-text";h.onclick=i.expand}else{f.style.display="";g.className="toggler-arrow";g.onclick=i.collapse;h.className="toggler-text";h.onclick=i.collapse}}f.style.height=d+2+"px"};this.removeItem=function(m){if(j[m]!=null){removeChild(j[m].element);d-=j[m].height;j.splice(m);var l=new Array();for(var k in j){if(k!=m){l[k]=j[k]}}j=l}if(f.style.display!="none"){f.style.height=d+"px"}if(d<=0){f.style.display="none";g.className="toggler-arrow-empty";g.onclick=null;h.className="toggler-text-empty";h.onclick=null}};this.getItem=function(k){if(typeof(j[k])!="undefined"){return j[k].element}else{return}};this.removeAllItems=function(){for(var k in j){i.removeItem(k)}};this.init=function(){var m=document.createElement("DIV");m.className="toggler-head";g=document.createElement("SPAN");g.className="toggler-arrow-empty";g.innerHTML="&nbsp;";g.onclick=null;h=document.createElement("SPAN");h.className="toggler-text-empty";h.title=c.name;h.innerHTML=c.name;h.onclick=null;if(c.clickfunc){var k=document.createElement("A");k.href="#";var l=document.createElement("SPAN");l.className="toggler-button";if(c.btntitle){l.title=c.btntitle}l.innerHTML="&nbsp;";l.onclick=c.clickfunc;k.appendChild(l);m.appendChild(k)}m.appendChild(g);m.appendChild(h);f=document.createElement("DIV");f.className="toggler-content";if(c.id){f.setAttribute("id",c.id)}e.appendChild(m);e.appendChild(f);preventSelection(m,true);preventSelection(f,true)};var j=new Array();var f,g,h;var i=this;var d=0;var b=0;var a=350;this.init()}function Tooltip(c){this.build=function(e){var d=document.createElement("DIV");d.className="cevent-maindiv";d.style.visibility="hidden";d.innerHTML='<div class="cevent-topleft"></div><div class="cevent-topcenter"></div><div class="cevent-topright"></div><div class="cevent-middle">	<div class="cevent-tdiv"></div></div><div class="cevent-bottomleft"></div><div class="cevent-bottomcenter"></div><div class="cevent-bottomright"></div>';return d};this.show=function(d,f){document.body.appendChild(a);var e=getElementsByClassName(a,"DIV","cevent-tdiv");e[0].innerHTML="";e[0].appendChild(document.createTextNode(c.text));a.style.top=f-parseInt(a.offsetHeight)+"px";a.style.left=d-20+"px";a.style.visibility="visible"};this.hide=function(){a.style.visibility="hidden"};var a;var b=this;if(c){a=this.build()}}function validField(f,c,b,h){this.startValidation=function(){setElementOpacity(a,1);i.className="vfload";var k=j.validation(e,d);if(k==true){setTimeout(function(){j.validationSuccessful()},1000)}else{setTimeout(function(){j.validationFaild(k)},500)}};this.validation=function(m,n){if(m.value.length<=0){if(m.required){return sprintf(n.required,m.name)}else{return true}}if(m.nospaceonly){if((/^[\s]+$/).test(m.value)){return sprintf(n.nospaceonly,m.name)}}if(m.maxLength){if(m.value.length>=m.maxLength){return sprintf(n.maxLength,m.maxLength)}}if(m.validChars){for(var l=0;l<m.value.length;l++){var k=""+m.value.substring(l,l+1);if(m.validChars.indexOf(k)=="-1"){return sprintf(n.validChars,m.validChars)}}}if(m.novalidChars){for(var l=0;l<m.value.length;l++){var k=""+m.value.substring(l,l+1);if(m.novalidChars.indexOf(k)!="-1"){return sprintf(n.novalidChars,m.novalidChars)}}}if(m.email){if(!(/^([a-z0-9_\-\!\$\&\*\=\^\`\|\~\#\%\'\+\/\?\{\}]+\.)*[a-z0-9_\-\!\$\&\*\=\^\`\|\~\#\%\'\+\/\?\{\}]+@([a-z0-9_\-\!\$\&\*\=\^\`\|\~\#\%\'\+\/\?\{\}]+\.)+[a-z]{2,6}$/i).test(m.value)){return n.email}}if(e.externalValidation){return e.externalValidation(e.value)}else{return true}};this.validationFaild=function(k){i.className="vffaild";g.className="vfinput_error";h(true,k)};this.validationSuccessful=function(){i.className="vfsucs";g.className="vfinput";setTimeout(function(){j.hideProgress(1)},500);h(false,"")};this.hideProgress=function(k){setElementOpacity(a,k);k-=0.01;if(k>0){setTimeout(function(){j.hideProgress(k)},10)}};this.changeField=function(){e.value=g.value;if(typeof(e.disable)=="undefined"||!e.disable){j.startValidation()}};this.isValidField=function(){e.value=g.value;var k=j.validation(e,d);if(k!=true){j.validationFaild(k);return false}else{h(false,"")}return true};this.setDisable=function(){g.setAttribute("readOnly","true");g.className="vfinput_disable"};this.setEnable=function(){g.removeAttribute("readOnly");g.className="vfinput"};this.getValue=function(){return encodeURIComponent(g.value)};this.setValue=function(k){i.className="vfspace";if(g.className!="vfinput_disable"){g.className="vfinput"}setElementOpacity(a,0);h(false,"");g.value=k};var j=this;var e=c;var d=b;var a="vLoad"+Math.floor(Math.random()*100000000);var g=document.createElement("INPUT");g.setAttribute("TYPE","text");g.className="vfinput";g.onchange=this.changeField;var i=document.createElement("SPAN");i.className="vfspace";i.id=a;i.border=0;f.appendChild(g);f.appendChild(i)}function winBox(c){this.setNewHead=function(l,n){if(h!=null){b.removeChild(h)}h=document.createElement("DIV");h.className="winbox-top";h.onmousedown=j.onMouseDownMbox;if(c.closeButton){var m=document.createElement("SPAN");m.className="icons icon-close";g=document.createElement("A");g.className="winbox-close";g.href="#";g.appendChild(m);g.onmousedown=function(o){disableEventPropagation(o)};g.onmouseup=this.close;h.appendChild(g)}head=document.createElement("SPAN");head.className="winbox-head-text";if(!n){head.innerHTML=l}else{head.innerHTML="";head.appendChild(document.createTextNode(l))}h.appendChild(head);if(k!=null){b.insertBefore(h,k)}else{b.appendChild(h)}};this.getCloseBtn=function(){if(c&&c.closeButton){return g}else{return null}};this.setNewBodyText=function(l){var m=document.createElement("DIV");m.className="winbox-text";m.innerHTML=(l?l:"");j.setNewBody(m)};this.setNewBody=function(l){if(k!=null){b.removeChild(k)}k=document.createElement("DIV");k.className="winbox-body";if(c.height){k.style.height=c.height}b.style.width=c.width?c.width:"300px";k.appendChild(l);b.appendChild(k)};this.setNewBottom=function(l){if(a!=null){b.removeChild(a)}a=document.createElement("DIV");a.className="winbox-bottom";a.align="center";a.appendChild(l);b.appendChild(a)};this.close=function(){b.style.display="none";i.hide();if(c.onClose){c.onClose()}};this.show=function(){b.style.display="block";i.show(false)};this.getLock=function(){return i};this.getMainLayer=function(){return b};this.isDisplayed=function(){return("block"==b.style.display?true:false)};this.onKeyDownMbox=function(m){var l=(m)?m:window.event;switch(l.keyCode){case 27:if(c.closeButton){j.close()}break}};this.onMouseDownMbox=function(n){var l=(n)?n:window.event;var m=getPageCoords(l);d=m.y-parseInt(b.style.top);e=m.x-parseInt(b.style.left);movePanel=true;if(is_ie){addHandler(document.body,"mousemove",j.onMouseMoveMbox);addHandler(document.body,"mouseup",j.onMouseUpMbox)}else{addHandler(window,"mousemove",j.onMouseMoveMbox);addHandler(window,"mouseup",j.onMouseUpMbox)}preventSelection(b,true);preventSelection(document.body,true)};var f=0;this.onMouseMoveMbox=function(o){var m=(o)?o:window.event;if(is_ie){if(m.button!=1){j.onMouseUpMbox(m)}}else{if(m.detail!=0||m.button!=0){j.onMouseUpMbox(m)}}if(movePanel){if(f==2){var n=getPageCoords(m);var p=(n.y-d);var l=(n.x-e);if(l+parseInt(b.offsetWidth)>getWindowWidth()){l=getWindowWidth()-parseInt(b.offsetWidth)}if(p+parseInt(b.offsetHeight)>getWindowHeight()){p=getWindowHeight()-parseInt(b.offsetHeight)}if(p<0){p=0}if(l<0){l=0}b.style.top=p+"px";b.style.left=l+"px";if(c.onMove){c.onMove()}f=0}else{f++;return}}};this.onMouseUpMbox=function(n){var l=(n)?n:window.event;var m=(l.target)?l.target:l.srcElement;movePanel=false;if(is_ie){removeHandler(document.body,"mousemove",j.onMouseMoveMbox);removeHandler(document.body,"mouseup",j.onMouseUpMbox)}else{removeHandler(window,"mousemove",j.onMouseMoveMbox);removeHandler(window,"mouseup",j.onMouseUpMbox)}preventSelection(b,false);preventSelection(document.body,false)};this.init=function(){b=document.createElement("DIV");b.className="winbox";b.style.display="none";b.onkeydown=this.onKeyDownMbox;b.style.width=c.width?c.width:"300px";var l=(parseInt(getWindowHeight())-300)/2-100;var m=parseInt((parseInt(getWindowWidth())-parseInt(b.style.width))/2);if(c.top){b.style.top=c.top}else{if(l<0){l=0}b.style.top=l+"px"}b.style.left=m+"px";i=new lockScreen();addLayer(b);this.setNewHead(c.headText?c.headText:"");if(c.bodyText){j.setNewBodyText(c.bodyText)}if(c.body){j.setNewBody(c.body)}if(c.bottom){this.setNewBottom(c.bottom)}document.body.appendChild(b)};var j=this;var d,e;var a,k,h,b,i;var g;this.init()};
