VPO={};VPO.$=function(a){if("string"==typeof a){if("object"==typeof VPO.xpath){a=VPO.xpath.evaluate("//*[@id = '"+a+"']",document).iterateNext()}else{a=document.getElementById(a)}}return a};VPO.addEventListener=function(a,c,b){if(a.attachEvent){a.attachEvent("on"+c,b)}else{a.addEventListener(c,b,true)}};VPO.removeEventListener=function(a,c,b){if(a.detachEvent){a.detachEvent("on"+c,b)}else{a.removeEventListener(c,b,true)}};String.prototype.add=function(a){if(this.match(new RegExp("\\b"+a+"\\b","g"))){return this}else{return this+" "+a}};String.prototype.remove=function(a){return this.replace(new RegExp("\\s*\\b"+a+"\\b\\s*","g")," ").replace(/\s*$/,"")};VPO.ajax={};VPO.ajax.execute=function(a,d){var b;var c;for(b in a){c=a[b];if("object"==typeof c&&"string"==typeof c.a&&"function"==typeof this.handler[c.a]&&"object"==typeof c.d){if("undefined"!=typeof c.d.e&&c.d.e=="#"){if("undefined"!=typeof d){if(d.length){for(var b=0;b<d.length;b++){c.d.e=d[b];this.handler[c.a](c.d)}}else{c.d.e=d;this.handler[c.a](c.d)}}}else{this.handler[c.a](c.d)}}}};VPO.ajax.handler={assign:function(a){if("undefined"==typeof a.e){return}a.e=VPO.$(a.e);if(a.e&&"string"==typeof a.p&&"undefined"!=typeof a.v){a.e[a.p]=a.v}},aadd:function(a){if("undefined"==typeof a.e){return}a.e=VPO.$(a.e);if(a.e&&"string"==typeof a.p&&"undefined"!=typeof a.v){a.e[a.p]=a.e[a.p].add(a.v)}},aremove:function(a){if("undefined"==typeof a.e){return}a.e=VPO.$(a.e);if(a.e&&"string"==typeof a.p&&"undefined"!=typeof a.v){a.e[a.p]=a.e[a.p].remove(a.v)}},areplace:function(a){if("undefined"==typeof a.e){return}a.e=VPO.$(a.e);if(a.e&&"string"==typeof a.p&&"undefined"!=typeof a.v){a.e[a.p]=a.e[a.p].replace(new RegExp("\\s*\\b"+a.v+"\\b\\s*","g")," "+a.w+" ").replace(/^\s*|\s*$/,"")}},style:function(a){if("undefined"==typeof a.e){return}a.e=VPO.$(a.e);if(a.e&&"string"==typeof a.p&&"string"==typeof a.v){a.e.style[a.p]=a.v}},className:function(a){if("undefined"==typeof a.e){return}a.e=VPO.$(a.e);if(a.e&&"string"==typeof a.a&&"string"==typeof a.v){switch(a.a){case"s":a.e.className=a.v;break;case"a":a.e.className.add(a.v);break;case"r":a.e.className.remove(a.v);break}}},redirect:function(a){if("undefined"==typeof a.l){return}if("undefined"==typeof a.t){document.location.assign(a.l)}else{setTimeout(function(b){document.location.assign(a.l)},a.t,a.l)}},css:function(a){if("string"==typeof a.f&&"string"==typeof a.m){VPO.CSS.add(a.f,a.m,a.a,a.p)}},alert:function(a){if("undefined"==typeof a.m){return}alert(a.m)},focus:function(a){if("undefined"==typeof a.e){return}a.e=VPO.$(a.e);if(a.e){a.e.focus()}},script:function(obj){if("undefined"==typeof obj.s){return}eval(obj.s)},dom:function(a){if("undefined"==typeof a.e){return}if("undefined"!=typeof a.d&&"string"==typeof a.f&&"function"==typeof VPO.DOM[a.f]){VPO.DOM[a.f](a)}},cond:function(b){if("undefined"!=typeof b.c&&"function"==typeof VPO.DOM.cond[b.c]&&"undefined"!=typeof b.d){var a=VPO.DOM.cond[b.c](b.e,b.d)}if(a){if("undefined"!=typeof b.y){VPO.ajax.execute(b.y.a,a)}}else{if("undefined"!=typeof b.n){VPO.ajax.execute(b.n.a,a)}}},animate:function(a){if("undefined"==typeof a.e){return}if("object"==typeof a.d&&"string"==typeof a.f&&"function"==typeof VPO.DOM.animate[a.f]){VPO.DOM.animate[a.f](a)}}};VPO.ajax.fakeID=function(a,b){ee=VPO.$(b);if(ee){ee.removeAttribute("id");if("undefined"!=typeof a.fakeID){delete a.fakeID}}a=VPO.$(a);if(a){a.setAttribute("id",b);a.fakeID=true}};VPO.ajax.getFormValues=function(a,b){a=VPO.$(a);if("undefined"==typeof b){b={}}if(a&&a.childNodes){this._getFormValues(b,a.childNodes)}return b};VPO.ajax._getFormValues=function(d,c){var a=c.length;for(var b=0;b<a;++b){var e=c[b];if("undefined"!=typeof e.childNodes){this._getFormValues(d,e.childNodes)}this._getFormValue(d,e)}};VPO.ajax._getFormValue=function(b,e){if(!e.name){return}if(e.type){if(e.type=="radio"||e.type=="checkbox"){if(false==e.checked){return}}}var c=e.name;var s=[];if("select-multiple"==e.type){var t=e.length;for(var h=0;h<t;++h){var l=e.options[h];if(true==l.selected){s.push(l.value)}}}else{s=e.value}var r=c.indexOf("[");if(0<=r){var f=c;var g=f.substr(0,f.indexOf("["));var q=f.substr(f.indexOf("["));if((typeof b[g])=="undefined"){b[g]=[]}var d=b;while(q.length!=0){var o=q.substr(0,q.indexOf("]")+1);q=q.substr(q.indexOf("]")+1);d=d[g];g=o.substr(1,o.length-2);if(g==""){g=d.length}if((typeof d[g])=="undefined"){d[g]=[]}}d[g]=s}else{b[c]=s}};VPO.ajax.JSON=function(){function f(n){return n<10?"0"+n:n}Date.prototype.toJSON=function(key){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()};var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapeable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapeable.lastIndex=0;return escapeable.test(string)?'"'+string.replace(escapeable,function(a){var c=meta[a];if(typeof c==="string"){return c}return"\\u"+("0000"+(+(a.charCodeAt(0))).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(typeof value.length==="number"&&!(value.propertyIsEnumerable("length"))){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value,rep);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value,rep);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}return{stringify:function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})},parse:function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+(+(a.charCodeAt(0))).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}();VPO.ajax.call=function(b,d,a){var e=document.getElementById("vpo.ajax.script");var c=document.getElementsByTagName("head").item(0);if(e){c.removeChild(e)}e=document.createElement("script");e.setAttribute("src",b+"?json="+encodeURIComponent(this.JSON.stringify({func:d,args:a})));e.setAttribute("id","vpo.ajax.script");c.appendChild(e);return true};VPO.ajax.response=function(a){if("object"==typeof a&&"undefined"!=typeof a.length){VPO.ajax.execute(a)}};VPO.CSS={};VPO.CSS.add=function(file,media,additional){var t;if("undefined"!=typeof additional&&"undefined"!=typeof additional.target){eval("t = "+additional.target)}else{t=document}var head=t.getElementsByTagName("head").item(0);var links=head.getElementsByTagName("link");var exists=false;for(i in links){if(links[i].rel=="stylesheet"&&links[i].href==file){exists=true}}if(!exists){var css;if("undefined"!=typeof additional){for(k in additional){if(k=="prepend"){css=t.createElement("style");css.setAttribute("type","text/css");if("undefined"==typeof css.styleSheet){css.appendChild(t.createTextNode(additional[k]))}else{css.styleSheet.cssText=additional[k]}head.appendChild(css)}}}css=t.createElement("link");css.setAttribute("type","text/css");css.setAttribute("rel","stylesheet");css.setAttribute("href",file);css.setAttribute("media",media);head.appendChild(css)}};VPO.CSS.getStyle=function(c,a){var b;if(document.defaultView&&document.defaultView.getComputedStyle){b=document.defaultView.getComputedStyle(c,"").getPropertyValue(a)}else{if(c.currentStyle){b=c.currentStyle[this.camelize(a)]}}return b};VPO.CSS.camelize=function(c){var e=c.split("-");if(e.length==1){return e[0]}var b=c.indexOf("-")==0?e[0].charAt(0).toUpperCase()+e[0].substring(1):e[0];for(var d=1,a=e.length;d<a;d++){var f=e[d];b+=f.charAt(0).toUpperCase()+f.substring(1)}return b};VPO.CSS.getWidth=function(a){return(parseInt(a.style.width||this.getStyle(a,"width"))||(a.offsetWidth-(parseInt(this.getStyle(a,"padding-left"))||0)-(parseInt(this.getStyle(a,"padding-right"))||0)-(parseInt(this.getStyle(a,"border-left-width"))||0)-(parseInt(this.getStyle(a,"border-right-width"))||0))||0)};VPO.CSS.getHeight=function(a){return(parseInt(a.style.height||this.getStyle(a,"height"))||(a.offsetHeight-(parseInt(this.getStyle(a,"padding-top"))||0)-(parseInt(this.getStyle(a,"padding-bottom"))||0)-(parseInt(this.getStyle(a,"border-top-width"))||0)-(parseInt(this.getStyle(a,"border-bottom-width"))||0))||0)};VPO.CSS.getScrollHeight=function(a){return a.scrollHeight-(parseInt(this.getStyle(a,"padding-top"))||0)-(parseInt(this.getStyle(a,"padding-bottom"))||0)-(parseInt(this.getStyle(a,"border-top-width"))||0)-(parseInt(this.getStyle(a,"border-bottom-width"))||0)};VPO.DOM={};VPO.DOM.build=function(j,f,h){if(j.length){for(var d in j){var e=false;if("string"==typeof j[d]){e=document.createTextNode(j[d])}else{if("object"==typeof j[d]){var g;try{if(j[d].t=="input"&&"undefined"!=typeof j[d].a.type&&j[d].a.type=="radio"){e="<input";for(var c in j[d].a){e+=" "+c+'="'+j[d].a[c]+'"'}e=document.createElement(e+">")}else{throw true}}catch(g){e=document.createElement(j[d].t);VPO.DOM.attrs(e,j[d].a)}}}if(e){var b;if(h){f.insertBefore(e,h)}else{f.appendChild(e)}if("undefined"!=typeof j[d].c){this.build(j[d].c,e)}}}}};VPO.DOM.attrs=function(e,attrs){if("object"==typeof attrs){var attrsold={};for(var i=0;i<e.attributes.length;i++){attrsold[e.attributes[i].name]=true}for(var a in attrs){if(m=a.match(/^on(.*)$/)){eval("e."+a+" = function(e) {"+attrs[a]+"};")}else{if(a=="style"&&"undefined"!=typeof e.style.setAttribute){e.style.setAttribute("cssText",attrs[a])}else{var attr=document.createAttribute(a);attr.nodeValue=attrs[a];e.setAttributeNode(attr)}}if("undefined"!=attrsold[a]){delete attrsold[a]}}for(var a in attrsold){e.removeAttribute(a)}}};VPO.DOM.cond={haschild:function(d,c){d=VPO.$(d);var b=[];if(d){var f;if("undefined"!=typeof c.t){f=d.getElementsByTagName(c.t)}else{f=d.childNodes}for(var a=0;a<f.length;a++){b[b.length]=f[a]}}return(b.length?b[0]:false)},xpath:function(f,d){f=VPO.$(f);var c=[];if(f){var b=VPO.xpath.evaluate(d.p,f);var a;while(a=b.iterateNext()){c[c.length]=a}}return(c.length?c:false)},confirm:function(b,a){if("string"==typeof a.t){return confirm(a.t)}}};VPO.DOM.popup=function(obj){var e=VPO.$(obj.e);if(e){e.parentNode.removeChild(e)}var a={id:obj.e,style:""};if(obj.cn){a["class"]=obj.cn}if(obj.al){obj.al.e=VPO.$(obj.al.e);if(obj.al.e){var x=0,y=0;var o=obj.al.e;while(o.tagName!="BODY"){x+=o.offsetLeft;y+=o.offsetTop;o=o.offsetParent}if(obj.al.s=="right"){x=document.body.clientWidth-(x+obj.al.e.offsetWidth)}a.style+="top:"+(y+obj.al.e.offsetHeight)+"px;"+obj.al.s+":"+x+"px;"}}var b=[];var c=[];if(obj.pr){for(var i=0;i<obj.pr.length;i++){var e=VPO.$(obj.pr[i]);if(e){e.parentNode.removeChild(e)}b[b.length]={t:"div",a:{id:obj.pr[i]}};c[c.length]=obj.pr[i]}}b[b.length]={t:"div",a:a,c:obj.d};var t;if("undefined"!=typeof obj.a&&"undefined"!=typeof obj.a.target){eval("t = "+obj.a.target)}else{t=document.body}this.build(b,t);e=VPO.$(obj.e);for(var i=0;i<c.length;i++){c[i]=VPO.$(c[i])}c[c.length]=e;if(obj.al&&obj.al.e.fakeID){e.clearID=obj.al.e}e.close=function(list){return function(){for(var i=0;i<list.length;i++){if(list[i].clearID){list[i].clearID.removeAttribute("id")}list[i].parentNode.removeChild(list[i])}if("function"==typeof obj.clickhandler){VPO.removeEventListener(document.body,"click",this.clickhandler)}}}(c);if(obj.c){e.clickhandler=VPO.DOM.popup[obj.c](e);setTimeout(function(){VPO.addEventListener(document.body,"click",e.clickhandler)},500)}};VPO.DOM.popup.k=function(c,e,a){if(!c){c=window.event}var d=c.srcElement?c.srcElement:c.target;var b=false;while(d.tagName!="BODY"&&!(b=(d==e))){d=d.parentNode}if(b==a){e.close()}};VPO.DOM.popup.c=function(a){return function(b){VPO.DOM.popup.k(b,a,true)}};VPO.DOM.popup.o=function(a){return function(b){VPO.DOM.popup.k(b,a,false)}};VPO.DOM.popup.a=function(a){return function(b){a.close()}};VPO.DOM.replace=function(a){a.e=VPO.$(a.e);if(a.e){while(a.e.firstChild){a.e.removeChild(a.e.firstChild)}this.build(a.d,a.e)}};VPO.DOM.remove=function(a){a.e=VPO.$(a.e);if(a.e){a.e.parentNode.removeChild(a.e)}};VPO.DOM.update=function(a){a.e=VPO.$(a.e);if(a.e){if(a.e.tagName.toLowerCase()==a.d[0].t.toLowerCase()){VPO.DOM.attrs(a.e,a.d[0].a);while(a.e.firstChild){a.e.removeChild(a.e.firstChild)}this.build(a.d[0].c,a.e);if("function"==typeof a.e.onchange){a.e.onchange()}}}};