/* Copyright © Fabasoft R&D GmbH, A-4020 Linz, 1995-2010. */
/*
 * jQuery JavaScript Library v1.3.1
 * http://jquery.com/
 *
 * Copyright (c) 2009 John Resig
 * Dual licensed under the MIT and GPL licenses.
 * http://docs.jquery.com/License
 *
 * Date: 2009-01-21 20:42:16 -0500 (Wed, 21 Jan 2009)
 * Revision: 6158
 */
(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.makeArray(E))},selector:"",jquery:"1.3.1",size:function(){return this.length},get:function(E){return E===g?o.makeArray(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,find:function(E){if(this.length===1&&!/,/.test(E)){var G=this.pushStack([],"find",E);G.length=0;o.find(E,this[0],G);return G}else{var F=o.map(this,function(H){return o.find(E,H)});return this.pushStack(/[^+>] [^+>]/.test(E)?o.unique(F):F,"find",E)}},clone:function(F){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.cloneNode(true),H=document.createElement("div");H.appendChild(I);return o.clean([H.innerHTML])[0]}else{return this.cloneNode(true)}});var G=E.find("*").andSelf().each(function(){if(this[h]!==g){this[h]=null}});if(F===true){this.find("*").andSelf().each(function(I){if(this.nodeType==3){return}var H=o.data(this,"events");for(var K in H){for(var J in H[K]){o.event.add(G[I],K,H[K][J],H[K][J].data)}}})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var F=o.expr.match.POS.test(E)?o(E):null;return this.map(function(){var G=this;while(G&&G.ownerDocument){if(F?F.index(G)>-1:o(G).is(E)){return G}G=G.parentNode}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""
}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML:null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(K,N,M){if(this[0]){var J=(this[0].ownerDocument||this[0]).createDocumentFragment(),G=o.clean(K,(this[0].ownerDocument||this[0]),J),I=J.firstChild,E=this.length>1?J.cloneNode(true):J;if(I){for(var H=0,F=this.length;H<F;H++){M.call(L(this[H],I),H>0?E.cloneNode(true):J)}}if(G){o.each(G,z)}}return this;function L(O,P){return N&&o.nodeName(O,"table")&&o.nodeName(P,"tr")?(O.getElementsByTagName("tbody")[0]||O.appendChild(O.ownerDocument.createElement("tbody"))):O}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){G=o.trim(G);if(G){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(G,E,I){if(E=="width"||E=="height"){var K,F={position:"absolute",visibility:"hidden",display:"block"},J=E=="width"?["Left","Right"]:["Top","Bottom"];function H(){K=E=="width"?G.offsetWidth:G.offsetHeight;var M=0,L=0;o.each(J,function(){M+=parseFloat(o.curCSS(G,"padding"+this,true))||0;L+=parseFloat(o.curCSS(G,"border"+this+"Width",true))||0});K-=Math.round(M+L)}if(o(G).is(":visible")){H()}else{o.swap(G,F,H)}return Math.max(0,K)}return o.curCSS(G,E,I)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document
}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,R){if(typeof R==="number"){R+=""}if(!R){return}if(typeof R==="string"){R=R.replace(/(<(\w+)[^>]*?)\/>/g,function(T,U,S){return S.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?T:U+"></"+S+">"});var O=o.trim(R).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+R+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var N=!O.indexOf("<table")&&O.indexOf("<tbody")<0?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&O.indexOf("<tbody")<0?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(R)){L.insertBefore(K.createTextNode(R.match(/^\s*/)[0]),L.firstChild)}R=o.makeArray(L.childNodes)}if(R.nodeType){G.push(R)}else{G=o.merge(G,R)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(){var G=arguments;return this.each(function(){for(var H=0,I=G.length;H<I;H++){o(G[H])[F](this)
}})}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(">*",this).remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
/*
 * Sizzle CSS Selector Engine - v0.9.3
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var Q=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]+['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,K=0,G=Object.prototype.toString;var F=function(X,T,aa,ab){aa=aa||[];T=T||document;if(T.nodeType!==1&&T.nodeType!==9){return[]}if(!X||typeof X!=="string"){return aa}var Y=[],V,ae,ah,S,ac,U,W=true;Q.lastIndex=0;while((V=Q.exec(X))!==null){Y.push(V[1]);if(V[2]){U=RegExp.rightContext;break}}if(Y.length>1&&L.exec(X)){if(Y.length===2&&H.relative[Y[0]]){ae=I(Y[0]+Y[1],T)}else{ae=H.relative[Y[0]]?[T]:F(Y.shift(),T);while(Y.length){X=Y.shift();if(H.relative[X]){X+=Y.shift()}ae=I(X,ae)}}}else{var ad=ab?{expr:Y.pop(),set:E(ab)}:F.find(Y.pop(),Y.length===1&&T.parentNode?T.parentNode:T,P(T));ae=F.filter(ad.expr,ad.set);if(Y.length>0){ah=E(ae)}else{W=false}while(Y.length){var ag=Y.pop(),af=ag;if(!H.relative[ag]){ag=""}else{af=Y.pop()}if(af==null){af=T}H.relative[ag](ah,af,P(T))}}if(!ah){ah=ae}if(!ah){throw"Syntax error, unrecognized expression: "+(ag||X)}if(G.call(ah)==="[object Array]"){if(!W){aa.push.apply(aa,ah)}else{if(T.nodeType===1){for(var Z=0;ah[Z]!=null;Z++){if(ah[Z]&&(ah[Z]===true||ah[Z].nodeType===1&&J(T,ah[Z]))){aa.push(ae[Z])}}}else{for(var Z=0;ah[Z]!=null;Z++){if(ah[Z]&&ah[Z].nodeType===1){aa.push(ae[Z])}}}}}else{E(ah,aa)}if(U){F(U,T,aa,ab)}return aa};F.matches=function(S,T){return F(S,null,null,T)};F.find=function(Z,S,aa){var Y,W;if(!Z){return[]}for(var V=0,U=H.order.length;V<U;V++){var X=H.order[V],W;if((W=H.match[X].exec(Z))){var T=RegExp.leftContext;if(T.substr(T.length-1)!=="\\"){W[1]=(W[1]||"").replace(/\\/g,"");Y=H.find[X](W,S,aa);if(Y!=null){Z=Z.replace(H.match[X],"");break}}}}if(!Y){Y=S.getElementsByTagName("*")}return{set:Y,expr:Z}};F.filter=function(ab,aa,ae,V){var U=ab,ag=[],Y=aa,X,S;while(ab&&aa.length){for(var Z in H.filter){if((X=H.match[Z].exec(ab))!=null){var T=H.filter[Z],af,ad;S=false;if(Y==ag){ag=[]}if(H.preFilter[Z]){X=H.preFilter[Z](X,Y,ae,ag,V);if(!X){S=af=true}else{if(X===true){continue}}}if(X){for(var W=0;(ad=Y[W])!=null;W++){if(ad){af=T(ad,X,W,Y);var ac=V^!!af;if(ae&&af!=null){if(ac){S=true}else{Y[W]=false}}else{if(ac){ag.push(ad);S=true}}}}}if(af!==g){if(!ae){Y=ag}ab=ab.replace(H.match[Z],"");if(!S){return[]}break}}}ab=ab.replace(/\s*,\s*/,"");if(ab==U){if(S==null){throw"Syntax error, unrecognized expression: "+ab}else{break}}U=ab}return Y};var H=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(S){return S.getAttribute("href")
}},relative:{"+":function(W,T){for(var U=0,S=W.length;U<S;U++){var V=W[U];if(V){var X=V.previousSibling;while(X&&X.nodeType!==1){X=X.previousSibling}W[U]=typeof T==="string"?X||false:X===T}}if(typeof T==="string"){F.filter(T,W,true)}},">":function(X,T,Y){if(typeof T==="string"&&!/\W/.test(T)){T=Y?T:T.toUpperCase();for(var U=0,S=X.length;U<S;U++){var W=X[U];if(W){var V=W.parentNode;X[U]=V.nodeName===T?V:false}}}else{for(var U=0,S=X.length;U<S;U++){var W=X[U];if(W){X[U]=typeof T==="string"?W.parentNode:W.parentNode===T}}if(typeof T==="string"){F.filter(T,X,true)}}},"":function(V,T,X){var U="done"+(K++),S=R;if(!T.match(/\W/)){var W=T=X?T:T.toUpperCase();S=O}S("parentNode",T,U,V,W,X)},"~":function(V,T,X){var U="done"+(K++),S=R;if(typeof T==="string"&&!T.match(/\W/)){var W=T=X?T:T.toUpperCase();S=O}S("previousSibling",T,U,V,W,X)}},find:{ID:function(T,U,V){if(typeof U.getElementById!=="undefined"&&!V){var S=U.getElementById(T[1]);return S?[S]:[]}},NAME:function(S,T,U){if(typeof T.getElementsByName!=="undefined"&&!U){return T.getElementsByName(S[1])}},TAG:function(S,T){return T.getElementsByTagName(S[1])}},preFilter:{CLASS:function(V,T,U,S,Y){V=" "+V[1].replace(/\\/g,"")+" ";var X;for(var W=0;(X=T[W])!=null;W++){if(X){if(Y^(" "+X.className+" ").indexOf(V)>=0){if(!U){S.push(X)}}else{if(U){T[W]=false}}}}return false},ID:function(S){return S[1].replace(/\\/g,"")},TAG:function(T,S){for(var U=0;S[U]===false;U++){}return S[U]&&P(S[U])?T[1]:T[1].toUpperCase()},CHILD:function(S){if(S[1]=="nth"){var T=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(S[2]=="even"&&"2n"||S[2]=="odd"&&"2n+1"||!/\D/.test(S[2])&&"0n+"+S[2]||S[2]);S[2]=(T[1]+(T[2]||1))-0;S[3]=T[3]-0}S[0]="done"+(K++);return S},ATTR:function(T){var S=T[1].replace(/\\/g,"");if(H.attrMap[S]){T[1]=H.attrMap[S]}if(T[2]==="~="){T[4]=" "+T[4]+" "}return T},PSEUDO:function(W,T,U,S,X){if(W[1]==="not"){if(W[3].match(Q).length>1){W[3]=F(W[3],null,null,T)}else{var V=F.filter(W[3],T,U,true^X);if(!U){S.push.apply(S,V)}return false}}else{if(H.match.POS.test(W[0])){return true}}return W},POS:function(S){S.unshift(true);return S}},filters:{enabled:function(S){return S.disabled===false&&S.type!=="hidden"},disabled:function(S){return S.disabled===true},checked:function(S){return S.checked===true},selected:function(S){S.parentNode.selectedIndex;return S.selected===true},parent:function(S){return !!S.firstChild},empty:function(S){return !S.firstChild},has:function(U,T,S){return !!F(S[3],U).length},header:function(S){return/h\d/i.test(S.nodeName)},text:function(S){return"text"===S.type},radio:function(S){return"radio"===S.type},checkbox:function(S){return"checkbox"===S.type},file:function(S){return"file"===S.type},password:function(S){return"password"===S.type},submit:function(S){return"submit"===S.type},image:function(S){return"image"===S.type},reset:function(S){return"reset"===S.type},button:function(S){return"button"===S.type||S.nodeName.toUpperCase()==="BUTTON"},input:function(S){return/input|select|textarea|button/i.test(S.nodeName)}},setFilters:{first:function(T,S){return S===0},last:function(U,T,S,V){return T===V.length-1},even:function(T,S){return S%2===0},odd:function(T,S){return S%2===1},lt:function(U,T,S){return T<S[3]-0},gt:function(U,T,S){return T>S[3]-0},nth:function(U,T,S){return S[3]-0==T},eq:function(U,T,S){return S[3]-0==T}},filter:{CHILD:function(S,V){var Y=V[1],Z=S.parentNode;var X=V[0];if(Z&&(!Z[X]||!S.nodeIndex)){var W=1;for(var T=Z.firstChild;T;T=T.nextSibling){if(T.nodeType==1){T.nodeIndex=W++}}Z[X]=W-1}if(Y=="first"){return S.nodeIndex==1}else{if(Y=="last"){return S.nodeIndex==Z[X]}else{if(Y=="only"){return Z[X]==1}else{if(Y=="nth"){var ab=false,U=V[2],aa=V[3];if(U==1&&aa==0){return true}if(U==0){if(S.nodeIndex==aa){ab=true}}else{if((S.nodeIndex-aa)%U==0&&(S.nodeIndex-aa)/U>=0){ab=true}}return ab}}}}},PSEUDO:function(Y,U,V,Z){var T=U[1],W=H.filters[T];if(W){return W(Y,V,U,Z)}else{if(T==="contains"){return(Y.textContent||Y.innerText||"").indexOf(U[3])>=0}else{if(T==="not"){var X=U[3];for(var V=0,S=X.length;V<S;V++){if(X[V]===Y){return false}}return true}}}},ID:function(T,S){return T.nodeType===1&&T.getAttribute("id")===S},TAG:function(T,S){return(S==="*"&&T.nodeType===1)||T.nodeName===S},CLASS:function(T,S){return S.test(T.className)},ATTR:function(W,U){var S=H.attrHandle[U[1]]?H.attrHandle[U[1]](W):W[U[1]]||W.getAttribute(U[1]),X=S+"",V=U[2],T=U[4];return S==null?V==="!=":V==="="?X===T:V==="*="?X.indexOf(T)>=0:V==="~="?(" "+X+" ").indexOf(T)>=0:!U[4]?S:V==="!="?X!=T:V==="^="?X.indexOf(T)===0:V==="$="?X.substr(X.length-T.length)===T:V==="|="?X===T||X.substr(0,T.length+1)===T+"-":false},POS:function(W,T,U,X){var S=T[2],V=H.setFilters[S];if(V){return V(W,U,T,X)}}}};var L=H.match.POS;for(var N in H.match){H.match[N]=RegExp(H.match[N].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(T,S){T=Array.prototype.slice.call(T);if(S){S.push.apply(S,T);return S}return T};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(M){E=function(W,V){var T=V||[];if(G.call(W)==="[object Array]"){Array.prototype.push.apply(T,W)
}else{if(typeof W.length==="number"){for(var U=0,S=W.length;U<S;U++){T.push(W[U])}}else{for(var U=0;W[U];U++){T.push(W[U])}}}return T}}(function(){var T=document.createElement("form"),U="script"+(new Date).getTime();T.innerHTML="<input name='"+U+"'/>";var S=document.documentElement;S.insertBefore(T,S.firstChild);if(!!document.getElementById(U)){H.find.ID=function(W,X,Y){if(typeof X.getElementById!=="undefined"&&!Y){var V=X.getElementById(W[1]);return V?V.id===W[1]||typeof V.getAttributeNode!=="undefined"&&V.getAttributeNode("id").nodeValue===W[1]?[V]:g:[]}};H.filter.ID=function(X,V){var W=typeof X.getAttributeNode!=="undefined"&&X.getAttributeNode("id");return X.nodeType===1&&W&&W.nodeValue===V}}S.removeChild(T)})();(function(){var S=document.createElement("div");S.appendChild(document.createComment(""));if(S.getElementsByTagName("*").length>0){H.find.TAG=function(T,X){var W=X.getElementsByTagName(T[1]);if(T[1]==="*"){var V=[];for(var U=0;W[U];U++){if(W[U].nodeType===1){V.push(W[U])}}W=V}return W}}S.innerHTML="<a href='#'></a>";if(S.firstChild&&S.firstChild.getAttribute("href")!=="#"){H.attrHandle.href=function(T){return T.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var S=F,T=document.createElement("div");T.innerHTML="<p class='TEST'></p>";if(T.querySelectorAll&&T.querySelectorAll(".TEST").length===0){return}F=function(X,W,U,V){W=W||document;if(!V&&W.nodeType===9&&!P(W)){try{return E(W.querySelectorAll(X),U)}catch(Y){}}return S(X,W,U,V)};F.find=S.find;F.filter=S.filter;F.selectors=S.selectors;F.matches=S.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){H.order.splice(1,0,"CLASS");H.find.CLASS=function(S,T){return T.getElementsByClassName(S[1])}}function O(T,Z,Y,ac,aa,ab){for(var W=0,U=ac.length;W<U;W++){var S=ac[W];if(S){S=S[T];var X=false;while(S&&S.nodeType){var V=S[Y];if(V){X=ac[V];break}if(S.nodeType===1&&!ab){S[Y]=W}if(S.nodeName===Z){X=S;break}S=S[T]}ac[W]=X}}}function R(T,Y,X,ab,Z,aa){for(var V=0,U=ab.length;V<U;V++){var S=ab[V];if(S){S=S[T];var W=false;while(S&&S.nodeType){if(S[X]){W=ab[S[X]];break}if(S.nodeType===1){if(!aa){S[X]=V}if(typeof Y!=="string"){if(S===Y){W=true;break}}else{if(F.filter(Y,[S]).length>0){W=S;break}}}S=S[T]}ab[V]=W}}}var J=document.compareDocumentPosition?function(T,S){return T.compareDocumentPosition(S)&16}:function(T,S){return T!==S&&(T.contains?T.contains(S):true)};var P=function(S){return S.nodeType===9&&S.documentElement.nodeName!=="HTML"||!!S.ownerDocument&&P(S.ownerDocument)};var I=function(S,Z){var V=[],W="",X,U=Z.nodeType?[Z]:Z;while((X=H.match.PSEUDO.exec(S))){W+=X[0];S=S.replace(H.match.PSEUDO,"")}S=H.relative[S]?S+"*":S;for(var Y=0,T=U.length;Y<T;Y++){F(S,U[Y],V)}return F.filter(W,V)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(S){return"hidden"===S.type||o.css(S,"display")==="none"||o.css(S,"visibility")==="hidden"};F.selectors.filters.visible=function(S){return"hidden"!==S.type&&o.css(S,"display")!=="none"&&o.css(S,"visibility")!=="hidden"};F.selectors.filters.animated=function(S){return o.grep(o.timers,function(T){return S===T.elem}).length};o.multiFilter=function(U,S,T){if(T){U=":not("+U+")"}return F.matches(U,S)};o.dir=function(U,T){var S=[],V=U[T];while(V&&V!=document){if(V.nodeType==1){S.push(V)}V=V[T]}return S};o.nth=function(W,S,U,V){S=S||1;var T=0;for(;W;W=W[U]){if(W.nodeType==1&&++T==S){break}}return W};o.sibling=function(U,T){var S=[];for(;U;U=U.nextSibling){if(U.nodeType==1&&U!=T){S.push(U)}}return S};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)
}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();
if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){G=false}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&typeof l.frameElement==="undefined"){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width="1px";L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L)})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")
},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];
function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}this[H].style.display=o.data(this[H],"olddisplay",K)}}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)==1){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n)}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()
}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(H,F){var E=H?"Left":"Top",G=H?"Right":"Bottom";o.fn["inner"+F]=function(){return this[F.toLowerCase()]()+j(this,"padding"+E)+j(this,"padding"+G)};o.fn["outer"+F]=function(J){return this["inner"+F]()+j(this,"border"+E+"Width")+j(this,"border"+G+"Width")+(J?j(this,"margin"+E)+j(this,"margin"+G):0)};var I=F.toLowerCase();o.fn[I]=function(J){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+F]||document.body["client"+F]:this[0]==document?Math.max(document.documentElement["client"+F],document.body["scroll"+F],document.documentElement["scroll"+F],document.body["offset"+F],document.documentElement["offset"+F]):J===g?(this.length?o.css(this[0],I):null):this.css(I,typeof J==="string"?J:J+"px")}})})();var fscjq=jQuery.noConflict(true);function FscPluginCBMessage(a){alert(a.retmsg)}function FscPluginArrayContains(b,a){for(i=0;i<b.length;i++){if(b[i]==a){return true}}return false}var g_fscplugin=null;var FSC_USECASE={FSC_DAVEDIT:"DavEdit",FSC_RECOVERY:"Recovery",FSC_IMPORT:"Import",FSC_CLIENTSTATUS:"ClientStatus"};var g_httpHostInfo=new function(){this.m_name="";this.m_version=0;this.m_os="";this.m_pluginsupport=[];this.m_agentString=navigator.userAgent.toLowerCase();var a=null;if(a=this.m_agentString.match(/msie *([0-9\.]*)/)){this.m_name="iexplorer"}else{if(a=this.m_agentString.match(/firefox\/* *([0-9\.]*)/)){this.m_name="firefox"}else{if(a=this.m_agentString.match(/chrome\/* *([0-9\.]*)/)){this.m_name="chrome"}else{if(a=this.m_agentString.match(/([0-9\.]*) safari/)){this.m_name="safari"}else{if(a=this.m_agentString.match(/prism\/* *([0-9\.]*)/)){this.m_name="prism"}else{if(a=this.m_agentString.match(/opera\/* *([0-9\.]*)/)){this.m_name="opera"}}}}}}if(a){this.m_version=parseFloat(a[1])}this.m_pluginsupport[FSC_USECASE.FSC_CLIENTSTATUS]=true;this.m_pluginsupport[FSC_USECASE.FSC_IMPORT]=false;this.m_pluginsupport[FSC_USECASE.FSC_RECOVERY]=false;this.m_pluginsupport[FSC_USECASE.FSC_DAVEDIT]=false;if(this.m_agentString.indexOf("windows")>=0){this.m_os="windows";if(this.m_name=="firefox"||this.m_name=="iexplorer"||this.m_name=="prism"||(this.m_name=="chrome"&&this.m_version<5)){this.m_pluginsupport[FSC_USECASE.FSC_IMPORT]=true}}else{if(this.m_agentString.indexOf("linux")>=0){this.m_os="linux";if(this.m_name=="firefox"){this.m_pluginsupport[FSC_USECASE.FSC_IMPORT]=true}}else{if(this.m_agentString.indexOf("macintosh")>=0){this.m_os="macintosh";this.m_pluginsupport[FSC_USECASE.FSC_DAVEDIT]=true;if(this.m_name=="firefox"||(this.m_name=="safari"&&this.m_version>=5)){this.m_pluginsupport[FSC_USECASE.FSC_IMPORT]=true}}}}};function FscDetectPlugin(a){if(g_httpHostInfo.m_name=="iexplorer"){try{var d=new ActiveXObject("Folio.Plugin");return true}catch(c){}}else{var b=navigator.mimeTypes[a];if(b&&b.enabledPlugin){return true}}return false}function FscPluginGet(){if(!document.body){return null}if(null==g_fscplugin&&FscDetectPlugin("application/x-fabasoft-folio")){var d=null;if(g_httpHostInfo.m_name=="iexplorer"){d=document.createElement("object");var e=document.createAttribute("CLASSID");e.nodeValue="CLSID:F7645B47-9E0E-4CBB-93E5-00024B0EC1C2";d.setAttributeNode(e);d.style.display="none"}else{d=document.createElement("embed");var a=document.createAttribute("type");a.nodeValue="application/x-fabasoft-folio";d.setAttributeNode(a);var c=document.createAttribute("hidden");c.nodeValue="true";d.setAttributeNode(c)}if(d){d.setAttribute("width","0");d.setAttribute("height","0");var b=document.createAttribute("id");b.nodeValue="fscplugin";d.setAttributeNode(b);document.body.appendChild(d);g_fscplugin=new FscPlugin()}}return g_fscplugin}function FscPlugin(){this.m_native=document.getElementById("fscplugin");this.m_clientversion=0;this.m_timeoutid=0;this.m_cbprogress=null;this.m_cbmessage=FscPluginCBMessage;this.m_cbconfirm=null;this.m_importprogress=null;this.m_importcomplete=null;this.m_importoverwrite=null;this.m_importconfirm=null;this.m_objectaddresslist=null;this.m_importcancontinue=false;this.Supports=function(usecase){if(usecase){return g_httpHostInfo.m_pluginsupport[usecase]}else{if(g_httpHostInfo.m_os=="macintosh"){return true}}return false};this.GetPluginVersion=function FscPlugin_GetPluginVersion(){return this.m_native.GetPluginVersion()};this.SetClientVersion=function FscPlugin_SetClientVersion(version){this.m_clientverson=version;return this.m_native.SetClientVersion(version)};this.GetMACAddress=function FscPlugin_GetMACAddress(){return this.m_native.GetMACAddress()};this.GetScreenshot=function FscPlugin_GetScreenshot(){return this._Eval(this.m_native.GetScreenshot())};this.GetSystemInformation=function FscPlugin_GetSystemInformation(){return this._Eval(this.m_native.GetSystemInformation())};this.ClearTempFiles=function FscPlugin_ClearTempFiles(){return this.m_native.ClearTempFiles()};this.ViewTempFile=function FscPlugin_ViewTempFile(file){return this.m_native.ViewTempFile(file)};this.Trace=function FscPlugin_Trace(message){return this.m_native.Trace(message)};this.SetUrl=function FscPlugin_SetUrl(baseurl,urlarguments){return this.m_native.SetUrl(baseurl,urlarguments)};this.SetLangString=function FscPlugin_SetLangString(key,value){return this.m_native.SetLangString(key,value)};this.GetLangString=function FscPlugin_GetLangString(key){return this.m_native.GetLangString(key)};this.SetConfigValue=function FscPlugin_SetConfigValue(key,value){return this.m_native.SetConfigValue(key,value)};this.GetConfigValue=function FscPlugin_GetConfigValue(key){return this.m_native.GetConfigValue(key)};this.GetClientFeatureStatus=function FscPlugin_GetClientFeatureStatus(key,url){var retval="FAIL";switch(key){case"FF_ENABLECODEBASESUPPORT":try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");retval="OK"}catch(error){retval="NOK"}break;case"FF_ENABLEPOPUPS":try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var prefservice=Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPref);if(!prefservice.GetBoolPref("dom.disable_open_during_load")){retval="OK"}else{var uri=Components.classes["@mozilla.org/network/standard-url;1"].createInstance(Components.interfaces.nsIURI);uri.spec=url;var currenturi=uri.QueryInterface(Components.interfaces.nsIURL);var popupmanager=Components.classes["@mozilla.org/PopupWindowManager;1"].createInstance(Components.interfaces.nsIPopupWindowManager);retval=popupmanager.testPermission(currenturi)==1?res="OK":"NOK"}}catch(error){}break;case"FF_ENABLEPOPUPSMAX":try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");var prefservice=Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPref);retval=prefservice.GetIntPref("dom.popup_maximum")<200?"NOK":"OK"}catch(error){}break;default:retval=this.m_native.GetClientFeatureStatus(key,url)}return retval};this.GetBrowserExeName=function FscPlugin_GetBrowserExeName(){return this.m_native.GetBrowserExeName()};this.GetBrowserExeVersion=function FscPlugin_GetBrowserExeVersion(){return this.m_native.GetBrowserExeVersion()};this.GetRecoveryKeys=function FscPlugin_GetRecoveryKeys(baseurl){return this._Eval(this.m_native.GetRecoveryKeys(baseurl,"FscPluginCB"))};this.GetRecoveryState=function FscPlugin_GetRecoveryState(key){return this._Eval(this.m_native.GetRecoveryState(key,"FscPluginCB"))};this.SetMessageCallback=function FscPlugin_SetMessageCallback(cbmessage){this.m_cbmessage=cbmessage};this.SetProgressCallback=function FscPlugin_SetProgressCallback(cbprogress){this.m_cbprogress=cbprogress};this.DavEdit=function FscPlugin_DavEdit(url,name,extension,size,options){var ret=this._DocLoad(url,name,extension,size,options);if(this._CheckError(ret)){this._AddTO();return ret.doc.key}return false};this.importFlags={CANCEL:"100",ALL_WRITE:"011",ALL_LEAVE:"010",WRITE:"001",LEAVE:"000"};this.ImportReset=function FscPlugin_ImportReset(id,filesizelimit,rootdavurl,donotshare){if(!filesizelimit){filesizelimit=0}this.m_native.ImportReset(id,filesizelimit,rootdavurl,"FscPluginCB",donotshare)};this.ImportGetFileList=function(event){var fileList=null;this.m_objectaddresslist=null;if(g_httpHostInfo.m_name!="iexplorer"&&event&&event.dataTransfer){mimetypes=event.dataTransfer.types;if(!FscPluginArrayContains(mimetypes,"application/x-moz-file")&&!FscPluginArrayContains(mimetypes,"text/x-moz-url")&&!FscPluginArrayContains(mimetypes,"text/uri-list")&&!FscPluginArrayContains(mimetypes,"Files")){if(text=event.dataTransfer.getData("text/plain")){this._ExtractObjectsFromText(text);return}}}switch(g_httpHostInfo.m_name){case"iexplorer":var tmp=this.m_native.GetDroppedFileList(event.dataTransfer);if(tmp&&tmp.length){fileList=tmp.split("\n")}break;case"firefox":case"prism":if(g_httpHostInfo.m_version<3.5){netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");nsIDragService=Components.interfaces.nsIDragService;var dragService=Components.classes["@mozilla.org/widget/dragservice;1"].getService(nsIDragService);if(!dragService){break}fileList=new Array;var session=dragService.getCurrentSession();var trans=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);trans.addDataFlavor("application/x-moz-file");for(var i=0;i<session.numDropItems;i++){session.getData(trans,i);var dataObj=new Object();var dropSizeObj=new Object();trans.getTransferData("application/x-moz-file",dataObj,dropSizeObj);var droppedFile=dataObj.value.QueryInterface(Components.interfaces.nsILocalFile);fileList.push(droppedFile.path)}}else{fileList=new Array;netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");var dt=event.dataTransfer;for(var i=0;i<dt.mozItemCount;i++){var url=dt.mozGetDataAt("text/x-moz-url",i);if(g_httpHostInfo.m_os=="linux"&&url.indexOf("smb://")==0){this.m_cbmessage({retok:false,retmsg:"Linux: Import from a samba share, which is not mounted, is not implemented yet."});fileList=null;break}if(url==null){var curFile=dt.mozGetDataAt("application/x-moz-file",i).QueryInterface(Components.interfaces.nsIFile);fileList.push(curFile.path)}else{fileList.push(url)}}}break;case"chrome":if(g_httpHostInfo.m_version>4.1){fileList=event.dataTransfer.getData("text/uri-list").split("\n").slice(1)}else{var root=event.dataTransfer.getData("text/uri-list");var pref=root.slice(0,root.lastIndexOf("/")+1);fileList=new Array;for(var i=0;i<event.dataTransfer.files.length;i++){fileList.push(pref+event.dataTransfer.files[i].fileName)}}break;case"safari":if(g_httpHostInfo.m_version>4.1){if(g_httpHostInfo.m_os=="macintosh"){fileList=event.dataTransfer.getData("text/uri-list").split("\n")}else{var root=event.dataTransfer.getData("text/uri-list");var pref=root.slice(0,root.lastIndexOf("/")+1);fileList=new Array;for(var i=0;i<event.dataTransfer.files.length;i++){fileList.push(pref+event.dataTransfer.files[i].fileName)}}}else{fileList=event.dataTransfer.getData("text/uri-list").split("\n")
}break}return fileList};this.ImportAdd=function FscPlugin_ImportAdd(id,fileurl,options){if(!options){options=""}if(g_httpHostInfo.m_os=="macintosh"&&g_httpHostInfo.m_name=="firefox"){fileurl=encodeURI(fileurl)}return this.m_native.ImportAdd(id,fileurl,options)};this.ImportFromEvent=function(id,event,progresscallback,completecallback,confirmcallback,overwritecallback){var files=this.ImportGetFileList(event);var succeeded=true;if(files){for(var i=0,len=files.length;i<len;i++){succeeded=this.ImportAdd(id,files[i]);if(!succeeded){break}}}if(succeeded){this.Import(id,progresscallback,completecallback,confirmcallback,overwritecallback)}};this.Import=function FscPlugin_Import(id,progresscallback,completecallback,confirmcallback,overwritecallback){this.m_importconfirm=confirmcallback;this.m_importprogress=progresscallback;this.m_importcomplete=completecallback;this.m_importoverwrite=overwritecallback;this.m_native.Import(id)};this.ImportConfirmed=function(id,userchoise){this.m_native.ImportConfirmed(id,userchoise)};this.ImportResolveConflict=function(id,relpath,conflictstate){this.m_native.ImportResolveConflict(id,relpath,conflictstate)};this.ImportBreak=function(id){this.m_native.ImportBreak(id)};this.ImportProcessComplete=function(data){data.addresslist=[];if(data.coolist!=null){for(var i=0,len=data.coolist.length;i<len;i++){if(data.coolist[i].objaddress!=""){data.addresslist.push(data.coolist[i].objaddress)}}}this.m_importcomplete(data)};this.GetObjectAddressList=function(){if(this.m_objectaddresslist&&typeof this.m_objectaddresslist==="object"&&this.m_objectaddresslist.length>0){return this.m_objectaddresslist.join("|")}return this.m_native.GetObjectAddressList()};this._ExtractObjectsFromText=function FscPlugin__ExtractObjectsFromText(text){this.m_objectaddresslist=text.match(/COO\.\d*\.\d*\.\d*\.\d*/g)};this._DocLoad=function FscPlugin__DocLoad(url,name,extension,size,options){if(url&&name&&extension){size=(size)?size:0;options=(options)?options:"read";return this._Eval((this.m_native.DocLoad(url,name,extension,size,options,"FscPluginCB")))}};this._DocCheck=function FscPlugin__DocCheck(){return this._Eval(this.m_native.DocCheck("FscPluginCB"))};this._DocLock=function FscPlugin__DocLock(url){return this.m_native._DocLock(url,"FscPluginCB")};this._Eval=function FscPlugin__Eval(json){var data=null;eval("data = "+json);return data};this._CheckError=function FscPlugin__CheckError(data){if(data==null){var tmp;tmp.retok=false;tmp.retmsg="Unexpected error.";this.m_cbmessage(tmp);return false}if(!data.retok){this.m_cbmessage(data);return false}return true};this._AddTO=function FscPlugin__AddTO(){if(this.m_timeoutid==0){this.m_timeoutid=window.setInterval("FscPluginTO()",10000)}};this._RemTO=function FscPlugin_RemTO(){if(this.m_timeoutid!=0){window.clearInterval(this.m_timeoutid);this.m_timeoutid=0}};this._TO=function FscPlugin__TO(){var ret=this._DocCheck(false);if(this._CheckError(ret)){if(ret.docs==null||ret.docs.length==0){this._RemTO()}}return null};this._CB=function FscPlugin__CB(jsondata){var ret="";var data=null;if(g_httpHostInfo.m_name=="iexplorer"){eval("data = "+jsondata)}else{data=jsondata}if(this._CheckError(data)){if(data.prg&&this.m_cbprogress){this.m_cbprogress(data.doc,data.prg)}else{if(data.importqst){this.m_importconfirm(data.importqst)}else{if(data.impProgress){this.m_importprogress(data.impProgress)}else{if(data.importEntry&&data.existingEntry){this.m_importoverwrite(data)}else{if(this.m_importcomplete&&data.impComplete){this.ImportProcessComplete(data)}}}}}}return ret}}function FscPluginTO(){FscPluginGet()._TO()}function FscPluginCB(a){return FscPluginGet()._CB(a)};_STRUDLModuleEvent=function(c,a,b){this.id=c;this.name=a;this.param=b;this._serialize=function(){var d="{"+strudl.utils.serializeString("EVR",this.name);d+=","+strudl.utils.serializeNumber("evtid",this.id);d+=","+strudl.utils.serializeString("param",this.param)+"}";return d}};_STRUDLModule=function(b,a){this.id=b;this.name=a;this.events=new Object();this.RegisterEvent=function(e,c,d){this.events[e]=new _STRUDLModuleEvent(e,c,d);strudl.cache.register=true};this._serialize=function(){var c="{"+strudl.utils.serializeString("MOD",this.name)+",";c+=strudl.utils.serializeNumber("modid",this.id)+",";c+=strudl.utils.serializeArray("events",this.events)+"}";return c};this.Event=function(l,m,c,g){if(!strudl.env.active){return}c=isNaN(c)?50:c;var e=strudl.cache.context["id"+l];if((e==null&&c===0)||e>=c){g=isNaN(g)?0:g;var d=null;if(arguments.length>4){d=[];var k=0;for(var h=4;h<arguments.length;h++){if((null!=arguments[h])&&("undefined"!==typeof arguments[h])){for(var f=0;f<k;f++){d.push("")}k=0;d.push(arguments[h])}else{k++}}}strudl.cache._add(new _STRUDLEvent(l,this.id,m,c,g,d))}}};_STRUDLEvent=function(b,f,c,d,e,a){this.timestamp=(new Date()).getTime();this.logicalclock=strudl.cache.logicalclock++;this.contextid=b;this.module=f;this.id=c;this.level=d;this.flags=e;this.params=a;this._serialize=function(){var g="{"+strudl.utils.serializeNumber("EVT",this.timestamp);g+=","+strudl.utils.serializeNumber("lgclk",this.logicalclock);g+=","+strudl.utils.serializeNumber("ctxid",this.contextid);g+=","+strudl.utils.serializeNumber("evtid",this.id);g+=","+strudl.utils.serializeNumber("module",this.module);g+=","+strudl.utils.serializeNumber("lvl",this.level);g+=","+strudl.utils.serializeNumber("flags",this.flags);if(this.params!=null&&this.params.length>0){g+=","+strudl.utils.serializeArray("params",this.params)}g+="}";return g}};_STRUDLContext=function(b,a,c){this.timestamp=(new Date()).getTime();this.logicalclock=strudl.cache.logicalclock++;this.contextid=b;this.name=a;this.token=c;this._serialize=function(){var d="{"+strudl.utils.serializeNumber(this.name,this.timestamp);d+=","+strudl.utils.serializeNumber("lgclk",this.logicalclock);d+=","+strudl.utils.serializeNumber("ctxid",this.contextid);d+=","+strudl.utils.serializeString("token",this.token);d+="}";return d}};_STRUDLCreateContext=function(b,c,a){this.timestamp=(new Date()).getTime();this.logicalclock=strudl.cache.logicalclock++;this.contextid=b;this.filter=c;this.sessions=a;this._serialize=function(){var d="{"+strudl.utils.serializeNumber("CCR",this.timestamp);d+=","+strudl.utils.serializeNumber("lgclk",this.logicalclock);d+=","+strudl.utils.serializeNumber("ctxid",this.contextid);d+=","+strudl.utils.serializeString("filter",this.filter);d+=","+strudl.utils.serializeArray("sessions",this.sessions);d+="}";return d}};_STRUDLReleaseContext=function(a){this.timestamp=(new Date()).getTime();this.logicalclock=strudl.cache.logicalclock++;this.contextid=a;this._serialize=function(){var b="{"+strudl.utils.serializeNumber("CRE",this.timestamp);b+=","+strudl.utils.serializeNumber("lgclk",this.logicalclock);b+=","+strudl.utils.serializeNumber("ctxid",this.contextid);b+="}";return b}};_STRUDLReport=function(c,b,d,a){this.timestamp=(new Date()).getTime();this.logicalclock=strudl.cache.logicalclock++;this.contextid=c;this.filtervalue=b;this.reportkey=d;this.description=a;this._serialize=function(){var e="{"+strudl.utils.serializeNumber("REP",this.timestamp);e+=","+strudl.utils.serializeNumber("lgclk",this.logicalclock);e+=","+strudl.utils.serializeNumber("ctxid",this.contextid);e+=","+strudl.utils.serializeString("filter",this.filtervalue);e+=","+strudl.utils.serializeString("key",this.reportkey);e+=","+strudl.utils.serializeString("description",this.description);e+="}";return e}};_STRUDLReportValue=function(b,c,d,a){this.timestamp=(new Date()).getTime();this.logicalclock=strudl.cache.logicalclock++;this.contextid=b;this.reportkey=c;this.key=d;this.value=a;this._serialize=function(){var e="{"+strudl.utils.serializeNumber("REV",this.timestamp);e+=","+strudl.utils.serializeNumber("lgclk",this.logicalclock);e+=","+strudl.utils.serializeNumber("ctxid",this.contextid);e+=","+strudl.utils.serializeString("reportkey",this.reportkey);e+=","+strudl.utils.serializeString("key",this.key);e+=","+strudl.utils.serializeString("value",this.value);e+="}";return e}};_STRUDLSession=function(b,c,a){this.id=b;this.level=c;this.filters=a};var strudl={version:"5.2.4",LEVEL_LOG:0,LEVEL_NORMAL:50,LEVEL_DETAIL:60,LEVEL_DEBUG:70,FLAG_NONE:0,FLAG_ENTER:1,FLAG_LEAVE:2,FLAG_WAIT:4,FLAG_WARNING:8,FLAG_ERROR:16,FLAG_PROCESS_INFO:32,EVENT_ERROR:268439552,EVENT_WARNING:268439553,EVENT_INFO:268439554,EVENT_TRACE:268439555,EVENT_REQUEST_SEQUENCE:268443648,EVENT_SEQUENCE_NAME:268443649,EVENT_PARENT_SEQUENCE:268443650,env:{url:"/strudlwebapi/strudlwebapi.dll",flushinterval:60000,flushtimeout:2000,eventsperflush:100,active:true,exceptioncallback:null,report:{dialogtitle:"Application Feedback",dialogtitlesuffix:" - powered by Fabasoft app.strudl",dialogtext:"Let us know your feedback:",dialogsubmittext:"   Submit Feedback   ",dialogcanceltooltip:"Cancel",dialogcssextra:"border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;",dialogbgcssbackground:"#AAA",dialogbgcssextra:"opacity:0.8;-moz-opacity:0.8;-webkit-opacity:0.8;filter:Alpha(Opacity=80);",imagename:"strudlapi.gif",onsubmit:null,oncancel:null,dialognode:null,screenshot:{enabled:true,label:"Include Screenshot",previewlabel:"Preview..."},softwareinfo:{enabled:true,label:"Include Software Repository/Registry",previewlabel:"Preview..."},displaymetadata:true,metadatatitle:"Your feedback will include the following information:",filestitle:"You can attach the following files to your feedback:",data:{contextid:null,filter:null,key:null,description:""},pluginactive:false,plugin:null}},cache:{procid:null,logicalclock:0,events:null,context:[],contextid:1,connectioncontextid:null,connected:false,registration:{appname:undefined,appid:undefined,apptiername:undefined,apptierid:undefined,modules:{},filters:{},modulecount:0},register:false,sendregistration:true,sessions:null,loglevel:0,guid:null,cookieenabled:false,flushintervalhandle:0,flushtimeouthandle:0,reregistertimeouthandle:0,initialized:false,flush:function(synchronous){try{if(strudl.cache.flushtimeouthandle!==0){window.clearTimeout(strudl.cache.flushtimeouthandle);
strudl.cache.flushtimeouthandle=0}if(!strudl.env.active){return}if(typeof synchronous==="undefined"){synchronous=false}var request=null;if(window.XMLHttpRequest){request=new XMLHttpRequest()}else{if(window.ActiveXObject){request=new ActiveXObject("Microsoft.XMLHTTP")}else{request=new XMLHttpRequest()}}if(request==null){return}request.open("POST",strudl.env.url,!synchronous);var now=new Date();var strnow=now.getUTCFullYear()+"-"+(now.getUTCMonth()+1)+"-"+now.getUTCDate()+"T"+now.getUTCHours()+":"+now.getUTCMinutes()+":"+now.getUTCSeconds()+"."+now.getUTCMilliseconds();var result='{"strudl":{'+strudl.utils.serializeString("VER",strudl.version);result+=","+strudl.utils.serializeString("GUID",strudl.cache.guid);result+=","+strudl.utils.serializeNumber("SES",now.getTime());result+=","+strudl.utils.serializeString("NOW",strnow);result+=',"REG":{'+strudl.utils.serializeString("procid",this.procid);result+=","+strudl.utils.serializeString("appname",this.registration.appname);result+=","+strudl.utils.serializeString("appid",this.registration.appid);result+=","+strudl.utils.serializeString("apptiername",this.registration.apptiername);result+=","+strudl.utils.serializeString("apptierid",this.registration.apptierid)+"}";if(this.register||this.sendregistration){result+=","+strudl.utils.serializeArray("modules",this.registration.modules);result+=","+strudl.utils.serializeMap("filters",strudl.cache.registration.filters);this.sendregistration=false;this.register=false}if(this.events!=null){var items=null;if(synchronous){items=this.events.splice(0,this.events.length)}else{items=this.events.splice(0,strudl.env.eventsperflush);if(this.events.length>0){strudl.utils.setupTimeout()}}if(items!=null&&items.length>0){result+=","+strudl.utils.serializeArray("events",items)}}result+="}}";var handler=function(){if(4===request.readyState){if(200===request.status){try{var json=eval("("+request.responseText+")");strudl.cache.sessions=json.sessions;if(json.loglevel!=null){strudl.cache.loglevel=json.loglevel}strudl.cache.guid=json.GUID}catch(e2){strudl.utils.error(e2,"strudl.cache.flush(): XMLHttpRequest.onreadystatechange failed: "+e2.name+": "+e2.message)}}else{try{strudl.utils.error(null,"strudl.cache.flush(): XMLHttpRequest.onreadystatechange: status="+request.status+"; statusText='"+request.statusText+"'")}catch(e3){strudl.utils.error(null,"strudl.cache.flush(): XMLHttpRequest.onreadystatechange: status!=200, Exception: "+e3.name+": '"+e3.message+"'")}}request=null;handler=null}};request.onreadystatechange=function(){try{if(handler!=null){handler()}}catch(e){}};request.send(result);if(strudl.cache.test){strudl.cache.test.innerHTML=result}this._persist();if(synchronous){try{if(handler!=null){handler()}}catch(e4){}}strudl.cache._reregistertimeout()}catch(e){strudl.utils.error(e,"strudl.cache.flush() failed: "+e.name+": "+e.message)}},_reregistertimeout:function(){if(strudl.cache.reregistertimeouthandle===0){strudl.cache.reregistertimeouthandle=window.setTimeout(function(){if(strudl.cache.reregistertimeouthandle!==0){window.clearTimeout(strudl.cache.reregistertimeouthandle);strudl.cache.reregistertimeouthandle=0;strudl.cache._reregistertimeout()}strudl.cache.sendregistration=true},600000)}},_add:function(a){if(!strudl.env.active){return}if(this.events==null){this.events=[]}this.events.push(a)},_persist:function(){if(null!=this.procid){var a=encodeURIComponent(this.procid)+","+this.logicalclock+","+this.contextid;if(this.connectioncontextid!=null){a+=","+this.connectioncontextid+","+this.context["id"+this.connectioncontextid]}document.cookie="strudl="+a+";"}},_restore:function(){if(document.cookie){var c=document.cookie.split("; ");for(var b=0;b<c.length;b++){var a=c[b];if(a.substring(0,7)==="strudl="){var d=a.substring(7,a.length).split(",");this.procid=decodeURIComponent(d[0]);this.logicalclock=parseInt(d[1],10);if(isNaN(this.logicalclock)){this.logicalclock=0}this.contextid=parseInt(d[2],10);if(isNaN(this.contextid)){this.contextid=1}else{this.contextid+=1000+Math.floor(Math.random()*1000);this.contextid=(this.contextid%100000)+1}this.connectioncontextid=parseInt(d[3],10);if(isNaN(this.connectioncontextid)){this.connectioncontextid=null}else{this.context["id"+this.connectioncontextid]=parseInt(d[4],10)}break}}}},_init:function(){if(!strudl.cache.initialized){strudl.cache._restore();if(window.addEventListener){window.addEventListener("unload",strudl.utils.syncFlush,false)}else{if(window.attachEvent){window.attachEvent("onunload",strudl.utils.syncFlush)}}strudl.cache.initialized=true;strudl.utils.setupInterval();strudl.utils.RestoreGUID();strudl.utils.CheckCookieSupport()}}},RegisterApplication:function(b,c,a,d){if(!strudl.cache.initialized){strudl.cache._init()}if(this.cache.procid==null){this.cache.procid=strudl.utils.Encode64(strudl.utils.CreateContextToken())}this.cache.registration.appname=b;this.cache.registration.appid=c;this.cache.registration.apptiername=a;this.cache.registration.apptierid=d;this.cache.register=true},RegisterModule:function(c){var b=this.cache.registration.modules[c];
if(b==null){var a=this.cache.registration.modulecount++;b=new _STRUDLModule(a,c);this.cache.registration.modules[c]=b;this.cache.register=true}return b},RegisterFilterValue:function(b,a){this.cache.registration.filters[b]=a;this.cache.register=true},CreateContext:function(d,e){if(!strudl.env.active){return null}this.utils.setupTimeout();var i=this.cache.sessions;var a=strudl.cache.loglevel;if(d!=null||this.cache.context["id"+d]==null){d=++this.cache.contextid;this.cache.context["id"+d]=a}var c=[];if(i!=null){for(var h=0;h<i.length;h++){var f=i[h];if(f!=null&&typeof f==="object"&&typeof f.id==="number"&&typeof f.level==="number"){if(typeof f.filters==="object"&&f.filters.length>0){for(var b=0;b<f.filters.length;b++){var g=f.filters[b];if(g.length===0||e.toLowerCase()===g.toLowerCase()){c.push(f.id);if(f.level>a){a=f.level}break}}}else{c.push(f.id);if(f.level>a){a=f.level}}}}}if(this.cache.context["id"+d]<a){this.cache.context["id"+d]=a}this.cache._add(new _STRUDLCreateContext(d,e,c));return d},GetContext:function(a){if(!strudl.env.active){return null}this.utils.setupTimeout();var b=null;if(this.cache.context["id"+a]!=null){b=strudl.utils.Encode64(strudl.utils.CreateContextToken(this.cache.context["id"+a]));this.cache._add(new _STRUDLContext(a,"CGE",b))}return b},AttachContext:function(b,d){if(!strudl.env.active){return b}this.utils.setupTimeout();if(b==null||this.cache.context["id"+b]==null){b=++this.cache.contextid}var c=strudl.LEVEL_NORMAL;if(d!=null){var a=strudl.utils.Decode64(d);c=a.charCodeAt(15)}if(this.cache.context["id"+b]==null||this.cache.context["id"+b]<c){this.cache.context["id"+b]=c}this.cache._add(new _STRUDLContext(b,"CAT",d));return b},ReleaseContext:function(a){if(!strudl.env.active){return}this.utils.setupTimeout();if(this.cache.context["id"+a]!=null){this.cache._add(new _STRUDLReleaseContext(a));delete this.cache.context["id"+a]}if(this.cache.connectioncontextid==a){this.cache.connectioncontextid=null}},GetSyncMark:function(a){if(!strudl.env.active){return null}var b=null;if(this.cache.context["id"+a]!=null){b=strudl.utils.Encode64(strudl.utils.CreateContextToken());this.cache._add(new _STRUDLContext(a,"SGE",b))}return b},SetSyncMark:function(a,b){if(!strudl.env.active){return}if(this.cache.context["id"+a]!=null){this.cache._add(new _STRUDLContext(a,"SSE",b))}},Report:function(b,d,c,a){if(!strudl.env.active){return}this.cache._add(new _STRUDLReport(b,d,c,a));strudl.cache.flush(true)},ReportValue:function(b,c,d,a){if(!strudl.env.active){return}this.cache._add(new _STRUDLReportValue(b,c,d,a))},ReportContent:function(g,c,i,d,h){if(!strudl.env.active){return}var e=null;if(window.XMLHttpRequest){e=new XMLHttpRequest()}else{if(window.ActiveXObject){e=new ActiveXObject("Microsoft.XMLHTTP")}else{e=new XMLHttpRequest()}}if(e==null){return}var b=strudl.env.url+"?ReportContent";if(this.cache.procid!==null){b+="&procid="+encodeURIComponent(this.cache.procid)}b+="&reportkey="+encodeURIComponent(g);b+="&filename="+encodeURIComponent(c);var f=d?d:"plaintext";b+="&encoding="+encodeURIComponent(f);var a=h?h:"text/plain";b+="&mimetype="+encodeURIComponent(a);e.open("POST",b,true);e.send(i)},ReportDialog:function(c,d,l,j,i,k){if(!strudl.env.active){return}if(c==null){c=strudl.CreateContext(null,d)}var a=strudl.GetStrudlAPIModule();a.Event(c,strudl.EVENT_REQUEST_SEQUENCE,strudl.LEVEL_NORMAL,strudl.FLAG_NONE,"app.strudl_FeedbackDialog_Create_SEQ");a.Event(c,strudl.EVENT_SEQUENCE_NAME,strudl.LEVEL_NORMAL,strudl.FLAG_NONE,"app.strudl_FeedbackDialog_Create_SEQ","Create app.strudl feedback dialog");a.Event(c,strudl.EVENT_INFO,strudl.LEVEL_NORMAL,strudl.FLAG_NONE,"Prepare app.strudl feedback dialog");strudl.env.report.data.contextid=c;strudl.env.report.data.filter=d;strudl.env.report.data.key=l;strudl.env.report.data.description=j;strudl.env.report.pluginactive=false;strudl.env.report.plugin=null;try{strudl.env.report.plugin=FscPluginGet();if(strudl.env.report.plugin!==null){strudl.env.report.pluginactive=true}}catch(f){}var b=strudl.env.report.plugin;if(strudl.env.report.pluginactive){if(strudl.env.report.screenshot.enabled){try{if(b&&b.GetScreenshot&&typeof b.GetScreenshot==="function"){a.Event(c,strudl.EVENT_INFO,strudl.LEVEL_NORMAL,strudl.FLAG_ENTER,"app.strudl feedback dialog calls plugin.GetScreenshot()");strudl.env.report.data.screenshot=b.GetScreenshot();a.Event(c,strudl.EVENT_INFO,strudl.LEVEL_NORMAL,strudl.FLAG_LEAVE,"app.strudl feedback dialog calls plugin.GetScreenshot() done")}}catch(h){strudl.env.report.data.screenshot=null}}if(strudl.env.report.softwareinfo.enabled){try{if(b&&b.GetSystemInformation&&typeof b.GetSystemInformation==="function"){a.Event(c,strudl.EVENT_INFO,strudl.LEVEL_NORMAL,strudl.FLAG_ENTER,"app.strudl feedback dialog calls plugin.GetSystemInformation()");strudl.env.report.data.softwareinfo=b.GetSystemInformation();a.Event(c,strudl.EVENT_INFO,strudl.LEVEL_NORMAL,strudl.FLAG_LEAVE,"app.strudl feedback dialog calls plugin.GetSystemInformation() done")}}catch(g){strudl.env.report.data.softwareinfo=null
}}}if(k){strudl.env.report.data.metadata=k}a.Event(c,strudl.EVENT_INFO,strudl.LEVEL_NORMAL,strudl.FLAG_ENTER,"Create app.strudl feedback dialog");strudl.utils.createReportDialog(i);a.Event(c,strudl.EVENT_INFO,strudl.LEVEL_NORMAL,strudl.FLAG_LEAVE,"Create app.strudl feedback dialog done");if(strudl.env.report.data.contextid!==null){strudl.ReleaseContext(strudl.env.report.data.contextid)}},HasActiveContext:function(a,c){if(!strudl.env.active){return false}var b=this.cache.context["id"+a];if(b!=null){return b>=c}else{return c===0}},IsConnected:function(){return this.cache.connected},SetConnectionContext:function(a){this.cache.connectioncontextid=a},GetConnectionContext:function(){return this.cache.connectioncontextid},SendXMLHttpRequest:function(h,f,j,k,b){var a=b;if(strudl.env.active&&f){var g=this.GetContext(b);a=this.AttachContext(null,g)}var c=strudl.GetXMLHTTPModule();if(strudl.env.active||("function"===typeof k)){h.onreadystatechange=function(){if(strudl.env.active){if(h.readyState!==4){c.Event(a,h.readyState,strudl.LEVEL_DEBUG,strudl.FLAG_NONE);if("function"===typeof k){c.Event(a,10,strudl.LEVEL_DEBUG,strudl.FLAG_ENTER);try{k(h,a)}catch(o){var p="strudl.SendXMLHttpRequest user callback failed: "+o.name+": "+o.message;strudl.utils.error(o,p);c.Event(a,strudl.EVENT_ERROR,strudl.LEVEL_DEBUG,strudl.FLAG_NONE,p)}c.Event(a,11,strudl.LEVEL_DEBUG,strudl.FLAG_LEAVE)}}else{var l=h.getResponseHeader("TelemetrySyncMark");if(l){strudl.SetSyncMark(a,l)}c.Event(a,h.readyState,strudl.LEVEL_NORMAL,strudl.FLAG_LEAVE+strudl.FLAG_WAIT,h.status,h.statusText);if("function"===typeof k){c.Event(a,10,strudl.LEVEL_NORMAL,strudl.FLAG_ENTER);try{k(h,a)}catch(n){var m="strudl.SendXMLHttpRequest user callback failed: "+n.name+": "+n.message;strudl.utils.error(n,m);c.Event(a,strudl.EVENT_ERROR,strudl.LEVEL_NORMAL,strudl.FLAG_NONE,m)}c.Event(a,11,strudl.LEVEL_NORMAL,strudl.FLAG_LEAVE)}if(f){strudl.ReleaseContext(a)}}}else{if("function"===typeof k){k(h,a)}}}}if(strudl.env.active){c.Event(a,0,strudl.LEVEL_NORMAL,strudl.FLAG_ENTER+strudl.FLAG_WAIT);var g=strudl.GetContext(a);if(g){h.setRequestHeader("TelemetryContext",g)}}h.send(j);if(strudl.env.active&&!f){try{c.Event(a,4,strudl.LEVEL_NORMAL,strudl.FLAG_LEAVE+strudl.FLAG_WAIT,h.status,h.statusText)}catch(i){var d="strudl.SendXMLHttpRequest failed: "+i.name+": "+i.message;strudl.utils.error(i,d);c.Event(a,strudl.EVENT_ERROR,strudl.LEVEL_NORMAL,strudl.FLAG_NONE,d)}}},GetXMLHTTPModule:function(){if(this.cache.xmlhttpmodule==null){this.cache.xmlhttpmodule=this.RegisterModule("XMLHttpRequest")}return this.cache.xmlhttpmodule},GetStrudlAPIModule:function(){if(this.cache.strudlapimodule==null){this.cache.strudlapimodule=this.RegisterModule("app.strudl API")}return this.cache.strudlapimodule},Flush:function(a){strudl.cache.flush(a)},SetInterval:function(a){this.env.flushinterval=a;this.utils.setupInterval()},SetTimeout:function(a){this.env.flushtimeout=a;this.utils.setupTimeout()},utils:{_base64Key:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",EscapeValue:function(a){if(a&&typeof a==="string"){a=a.replace(/\\/g,"\\\\").replace(/\"/g,'\\"');a=a.replace(/\//g,"\\/").replace(/\u0008/g,"\\b");a=a.replace(/\u000C/g,"\\f").replace(/\u000A/g,"\\n");a=a.replace(/\u000D/g,"\\r").replace(/\u0009/g,"\\t");return a}else{return""}},escapeHTML:function(a){if(a&&typeof a==="string"){return a.replace(/</g,"&lt;").replace(/>/g,"&gt;")}else{return""}},CreateContextToken:function(){var a="";for(var b=0;b<16;b++){if(b===15&&arguments.length>0){a+=String.fromCharCode(arguments[0])}else{a+=String.fromCharCode(Math.floor(Math.random()*256))}}return a},CheckCookieSupport:function(){strudl.cache.cookieenabled=!!navigator.cookieEnabled;if(typeof navigator.cookieEnabled==="undefined"&&!strudl.cache.cookieenabled){document.cookie="strudltestcookie=test";strudl.cache.cookieenabled=(document.cookie.indexOf("strudltestcookie")!==-1)}},RestoreGUID:function(){if(document.cookie){var a=document.cookie.search(/strudlguid=[A-Za-z0-9]{32}/);if(a>-1){strudl.cache.guid=document.cookie.substr(a+11,32)}}},Encode64:function(c){var a="";var k,h,f,j,g,e,d;var b=0;while(b<c.length){k=c.charCodeAt(b++);h=c.charCodeAt(b++);f=c.charCodeAt(b++);j=k>>2;g=((k&3)<<4)|(h>>4);if(isNaN(h)){e=d=64}else{e=((h&15)<<2)|(f>>6);if(isNaN(f)){d=64}else{d=f&63}}a+=this._base64Key.charAt(j)+this._base64Key.charAt(g)+this._base64Key.charAt(e)+this._base64Key.charAt(d)}return a},Decode64:function(c){var a="";var k,h,f,j,g,e,d;var b=0;c=c.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(b<c.length){j=this._base64Key.indexOf(c.charAt(b++));g=this._base64Key.indexOf(c.charAt(b++));e=this._base64Key.indexOf(c.charAt(b++));d=this._base64Key.indexOf(c.charAt(b++));k=(j<<2)|(g>>4);h=((g&15)<<4)|(e>>2);f=((e&3)<<6)|d;a+=String.fromCharCode(k);if(e!==64){a+=String.fromCharCode(h)}if(d!==64){a+=String.fromCharCode(f)}}return a},createReportDialog:function(o){if(null==strudl.env.report.dialognode){var l=window.document.createElement("div");var a=strudl.env.report;
var e=strudl.env.report.data.metadata;var j="";var c="";var p,k;if((e&&e.files&&e.files.length)||a.data.screenshot||a.data.softwareinfo){j+='<tr><td colspan="3" style="padding:4px 7px;"><table width="100%">';if(a.filestitle){j+='<tr style="height: 20px;"><th colspan="2" style="text-align:left;">'+strudl.utils.escapeHTML(a.filestitle)+"</td></tr>"}if(a.screenshot&&a.screenshot.enabled&&a.data.screenshot&&a.data.screenshot.file&&a.data.screenshot.content){p=a.screenshot.label||a.data.screenshot.file;k="";if(a.screenshot.previewlabel){k='<a href="javascript://" style="text-decoration: none;" onclick="strudl.utils.previewScreenshotWithPlugin(); return false;">'+strudl.utils.escapeHTML(a.screenshot.previewlabel)+"</a>"}j+='<tr><td><input type="checkbox" id="strudlscreenshotcheckbox" checked="checked" style="position: relative; top: 2px;"/><label for="strudlscreenshotcheckbox">'+strudl.utils.escapeHTML(p)+'</label></td><td style="text-align: right;">'+k+"</td></tr>"}if(a.softwareinfo&&a.softwareinfo.enabled&&a.data.softwareinfo&&a.data.softwareinfo.file&&a.data.softwareinfo.content){p=a.softwareinfo.label||a.data.softwareinfo.file;k="";if(a.softwareinfo.previewlabel){k='<a href="javascript://" style="text-decoration: none;" onclick="strudl.utils.previewSoftwareinfoWithPlugin(); return false;">'+strudl.utils.escapeHTML(a.softwareinfo.previewlabel)+"</a>"}j+='<tr><td><input type="checkbox" id="strudlsoftwareinfocheckbox" checked="checked"  style="position: relative; top: 2px;"/><label for="strudlsoftwareinfocheckbox">'+strudl.utils.escapeHTML(p)+'</label></td><td style="text-align: right;">'+k+"</td></tr>"}if(e&&e.files){for(var h=0;h<e.files.length;h++){if(e.files[h]&&e.files[h].filename&&typeof e.files[h].getContent==="function"){p=e.files[h].label||e.files[h].filename;k="";if(e.files[h].previewLabel&&typeof e.files[h].previewCallback==="function"){k='<a href="javascript://" style="text-decoration: none;" onclick="strudl.utils.callPreviewFileCallback('+h+');return false;">'+strudl.utils.escapeHTML(e.files[h].previewLabel)+"</a>"}var b="";if(e.files[h].checked){b='checked="checked"'}j+='<tr><td><input type="checkbox" id="strudlfilecheckbox_'+h+'" '+b+'  style="position: relative; top: 2px;"/><label for="strudlfilecheckbox_'+h+'">'+strudl.utils.escapeHTML(p)+'</label></td><td style="text-align: right;">'+k+"</td></tr>"}}}j+="</table></td></tr>"}if(a.displaymetadata&&e&&e.infos&&e.infos.length){c+='<tr><td colspan="3" style="padding:4px 7px;"><table width="100%">';if(a.metadatatitle){c+='<tr style="height: 20px;"><th colspan="2" style="text-align:left;">'+strudl.utils.escapeHTML(a.metadatatitle)+"</td></tr>"}for(var h=0;h<e.infos.length;h++){if(e.infos[h]&&e.infos[h].name&&e.infos[h].value){c+="<tr><td>&nbsp;"+strudl.utils.escapeHTML(e.infos[h].name)+":</td><td>"+strudl.utils.escapeHTML(e.infos[h].value)+"</td></tr>"}}c+="</table></td></tr>"}var h='<div id="strudl-report-container-bg" style="height:100%;left:0;position:fixed;top:0;width:100%;z-index:999999998;';h+="background:"+strudl.env.report.dialogbgcssbackground+";"+strudl.env.report.dialogbgcssextra+'"> </div>';h+='<div id="strudl-report-container" style="height:100%;left:0;position:fixed;top:0;width:100%;font-family:Arial,Helvetica,Verdana,sans-serif;line-height:16px;z-index:999999999;color:#4B4B4B;">';h+='<div style="width:450px;height:100%;margin:0 auto;"><div id="strudl-report-vpos-div" style="width:450px;float:left;height:50%;margin-bottom:-100px;"></div>';h+='<div id="strudl-report-form-container" style="background-color:white;border:1px solid #444444;margin:0 auto;padding:2px;vertical-align:top;width:450px;clear:both;font-family:Arial,Helvetica,Verdana,sans-serif;font-size: 9pt;';h+=strudl.env.report.dialogcssextra+'">';h+='<form onsubmit="strudl.utils.submitReportDialog();return false;" style="padding:0;margin:0;">';h+='<table width="100%" style="border-collapse:collapse;position:relative;top:0;">';h+='<tr style="background-image:url('+strudl.env.report.imagename+');background-position:center bottom;background-repeat:repeat-x;height:29px;">';h+='<td style="width:30px;"><span style="width:16px;height:16px;margin:0 7px;background:url('+strudl.env.report.imagename+');display:block;"></span></td>';h+='<td style="width:100%;font-weight:bolder;"><span style="color:#4B4B4B;font-weight:bold;margin:0.3em 0 0.3em 0;">'+strudl.utils.escapeHTML(strudl.env.report.dialogtitle+strudl.env.report.dialogtitlesuffix)+"</span></td>";h+='<td style="text-align:right;width:30px;">';h+='<a href="javascript://" style="width:15px;height:15px;margin:0 7px;background:';h+="url("+strudl.env.report.imagename+');background-position:0px -16px;display:block;overflow:hidden;float:right;border:1px solid #BFBFBF;"';h+=' onclick="strudl.utils.cancelReportDialog(); return false;" title="'+strudl.utils.escapeHTML(strudl.env.report.dialogcanceltooltip)+'">';h+="</a></td></tr>";h+='<tr><td colspan="3" style="padding:9px 9px 2px;"><div style="padding-right:5px;">';h+='<label for="strudl-report-text" style="font-size:9pt;"><strong>'+strudl.utils.escapeHTML(strudl.env.report.dialogtext)+"</strong></label>";
h+='<textarea type="text" id="strudl-report-text" style="margin:5px 0;padding:4px 1px;width:100%;background:';h+="#FFFFFF none repeat scroll 0 0;border-color:#BFBFBF #DEDEDE #DEDEDE #BFBFBF;color:#4B4B4B;height:80px;";h+='border-style:solid;border-width:1px;font-family:Arial,Helvetica,Verdana,sans-serif;font-size: 9pt;resize:none;overflow:auto;">'+strudl.utils.escapeHTML(strudl.env.report.data.description);h+="</textarea></div></td></tr>";h+=j+c;h+='<tr><td colspan="3" style="text-align:right;padding:7px;">';h+='<input type="submit" value="'+strudl.utils.escapeHTML(strudl.env.report.dialogsubmittext)+'" /></td></tr>';h+="</table></form></div></div></div>";l.innerHTML=h;if(!o){window.document.getElementsByTagName("BODY")[0].appendChild(l)}else{o.appendChild(l)}strudl.env.report.dialognode=[window.document,l];var n=window.document.getElementById("strudl-report-form-container");var g=window.document.getElementById("strudl-report-container");var f=window.document.getElementById("strudl-report-container-bg");var q=window.document.getElementById("strudl-report-vpos-div");if(n&&q){q.style.marginBottom=-Math.floor(n.clientHeight/2)+"px"}if(n&&f&&g&&/MSIE 6/i.test(navigator.userAgent)){f.style.position="absolute";f.style.width=document.body.clientWidth+"px";f.style.height=document.body.parentNode.scrollHeight+"px";g.style.position="absolute";g.style.width=document.body.clientWidth+"px";g.style.height=document.body.parentNode.scrollHeight+"px";g.firstChild.style.position="relative";g.firstChild.style.left="50%";g.firstChild.style.marginLeft="-175px"}}},cancelReportDialog:function(){var a=window.document.getElementById("strudl-report-text");if(a){strudl.env.report.data.description=a.value;if((null!=strudl.env.report.oncancel)&&(typeof strudl.env.report.oncancel==="function")&&(false===strudl.env.report.oncancel(strudl.env.report.data))){return false}}strudl.utils.removeReportDialog();return false},removeReportDialog:function(){if(null!=strudl.env.report.dialognode){strudl.env.report.dialognode[1].parentNode.removeChild(strudl.env.report.dialognode[1]);strudl.env.report.dialognode=null}strudl.env.report.data.screenshot=null;strudl.env.report.data.softwareinfo=null;strudl.env.report.data.metadata=null;if(strudl.env.report.pluginactive&&strudl.env.report.plugin&&strudl.env.report.plugin.ClearTempFiles&&typeof strudl.env.report.plugin.ClearTempFiles==="function"){try{strudl.env.report.plugin.ClearTempFiles()}catch(a){}}},submitReportDialog:function(){var f=window.document.getElementById("strudl-report-text");if(f){strudl.env.report.data.description=f.value;if((null!=strudl.env.report.onsubmit)&&(typeof strudl.env.report.onsubmit==="function")&&(false===strudl.env.report.onsubmit(strudl.env.report.data))){return false}if(strudl.cache.initialized){var d=strudl.GetStrudlAPIModule();strudl.env.report.data.contextid=strudl.CreateContext(null,strudl.env.report.data.filter);var b=strudl.env.report.data.contextid;d.Event(b,strudl.EVENT_REQUEST_SEQUENCE,strudl.LEVEL_NORMAL,strudl.FLAG_NONE,"app.strudl_FeedbackDialog_Submit_SEQ");d.Event(b,strudl.EVENT_SEQUENCE_NAME,strudl.LEVEL_NORMAL,strudl.FLAG_NONE,"app.strudl_FeedbackDialog_Submit_SEQ","Submit app.strudl feedback dialog");d.Event(b,strudl.EVENT_INFO,strudl.LEVEL_NORMAL,strudl.FLAG_ENTER,"Sending app.strudl feedback dialog content");strudl.Report(strudl.env.report.data.contextid,strudl.env.report.data.filter,strudl.env.report.data.key,strudl.env.report.data.description);var e=strudl.env.report;var a=strudl.env.report.data.metadata;if(a&&a.infos&&a.infos.length){for(var c=0;c<a.infos.length;c++){if(a.infos[c]&&a.infos[c].name&&a.infos[c].value){strudl.ReportValue(e.data.contextid,e.data.key,a.infos[c].name,a.infos[c].value);d.Event(b,strudl.EVENT_INFO,strudl.LEVEL_DETAIL,strudl.FLAG_NONE,"add ReportValue for report-key='"+e.data.key+"' with name='"+a.infos[c].name+"'")}}}if(e.data.screenshot&&e.data.screenshot.file&&e.data.screenshot.content&&window.document.getElementById("strudlscreenshotcheckbox")&&window.document.getElementById("strudlscreenshotcheckbox").checked){strudl.ReportContent(e.data.key,e.data.screenshot.file,e.data.screenshot.content,"base64",e.data.screenshot.mimetype);d.Event(b,strudl.EVENT_INFO,strudl.LEVEL_DETAIL,strudl.FLAG_NONE,"add ReportContent for report-key='"+e.data.key+"' with filename='"+e.data.screenshot.file+"' and size="+e.data.screenshot.content.length)}if(e.data.softwareinfo&&e.data.softwareinfo.file&&e.data.softwareinfo.content&&window.document.getElementById("strudlsoftwareinfocheckbox")&&window.document.getElementById("strudlsoftwareinfocheckbox").checked){strudl.ReportContent(e.data.key,e.data.softwareinfo.file,e.data.softwareinfo.content,"base64",e.data.softwareinfo.mimetype);d.Event(b,strudl.EVENT_INFO,strudl.LEVEL_DETAIL,strudl.FLAG_NONE,"add ReportContent for report-key='"+e.data.key+"' with filename='"+e.data.softwareinfo.file+"' and size="+e.data.softwareinfo.content.length)}if(a&&a.files&&a.files.length){for(var c=0;c<a.files.length;c++){if(a.files[c]&&a.files[c].filename&&typeof a.files[c].getContent==="function"&&window.document.getElementById("strudlfilecheckbox_"+c)&&window.document.getElementById("strudlfilecheckbox_"+c).checked){a.files[c].content=a.files[c].getContent(a.files[c].filename,a.files[c])||a.files[c].content;
if(!a.files[c].mimeType){a.files[c].mimeType="text/plain"}if(a.files[c].content){strudl.ReportContent(e.data.key,a.files[c].filename,a.files[c].content,"base64",a.files[c].mimeType);d.Event(b,strudl.EVENT_INFO,strudl.LEVEL_DETAIL,strudl.FLAG_NONE,"add ReportContent for report-key='"+e.data.key+"' with filename='"+a.files[c].filename+"' and size="+a.files[c].content.length)}}}}d.Event(b,strudl.EVENT_INFO,strudl.LEVEL_NORMAL,strudl.FLAG_LEAVE,"Sending app.strudl feedback dialog content done");strudl.ReleaseContext(b);strudl.env.report.data.contextid=null}}strudl.utils.removeReportDialog();return false},callPreviewFileCallback:function(b){var a=strudl.env.report.data.metadata;if(a&&a.files&&a.files[b]&&typeof a.files[b].previewCallback==="function"){a.files[b].previewCallback(a.files[b].filename,a.files[b])}return false},previewFileWithPlugin:function(a){if(a){try{if(strudl.env.report.pluginactive&&strudl.env.report.plugin&&strudl.env.report.plugin.ViewTempFile&&typeof strudl.env.report.plugin.ViewTempFile==="function"){strudl.env.report.plugin.ViewTempFile(a)}}catch(b){}}},previewScreenshotWithPlugin:function(){if(strudl.env.report.data.screenshot&&strudl.env.report.data.screenshot.file){strudl.utils.previewFileWithPlugin(strudl.env.report.data.screenshot.file)}return false},previewSoftwareinfoWithPlugin:function(){if(strudl.env.report.data.softwareinfo&&strudl.env.report.data.softwareinfo.file){strudl.utils.previewFileWithPlugin(strudl.env.report.data.softwareinfo.file)}return false},setupInterval:function(){if(strudl.cache.initialized){if(0!==strudl.cache.flushintervalhandle){window.clearInterval(strudl.cache.flushintervalhandle)}strudl.cache.flushintervalhandle=window.setInterval("strudl.cache.flush()",strudl.env.flushinterval)}},setupTimeout:function(){if(strudl.cache.initialized){if(0===strudl.cache.flushtimeouthandle){strudl.cache.flushtimeouthandle=window.setTimeout("strudl.cache.flush()",strudl.env.flushtimeout)}}},serializeValue:function(a){if(null===a||typeof a==="undefined"||typeof a==="null"){return"null"}if(typeof a==="number"){return""+a}if(typeof a==="string"){return strudl.utils.putString(a)}if(typeof a==="boolean"){if(a===true){return"true"}else{return"false"}}if(typeof a==="object"){if(a._serialize){return a._serialize()}return'"[object Object]"'}if(typeof a==="function"){return'"[function]"'}return'"[unknown]"'},serializeString:function(a,b){return strudl.utils.putString(a)+":"+strudl.utils.putString(b)},serializeNumber:function(a,b){return strudl.utils.putString(a)+":"+b},putString:function(a){return'"'+strudl.utils.EscapeValue(a)+'"'},serializeArray:function(c,e){var b=strudl.utils.putString(c)+":[";var d=true;for(var a in e){if(e.hasOwnProperty(a)){if(!d){b+=","}d=false;b+=strudl.utils.serializeValue(e[a])}}b+="]";return b},serializeMap:function(c,d){var b=strudl.utils.putString(c)+":{";var e=true;for(var a in d){if(d.hasOwnProperty(a)){if(!e){b+=","}e=false;b+=strudl.utils.serializeString(a,d[a])}}b+="}";return b},error:function(b,a){if("function"===typeof strudl.env.exceptioncallback){strudl.env.exceptioncallback(b,a)}else{if(("undefined"!==typeof console)&&("function"===typeof console.error)){console.error(a);if("function"===typeof console.trace){console.trace()}}}},syncFlush:function(){strudl.cache.flush(true)}}};/*------------------------------------------------------------------------------
 Copyright Fabasoft R&D Software GmbH & Co KG, 2005

 Der Nutzer des Computerprogramms anerkennt, dass der oben stehende
 Copyright-Vermerk im Sinn des Welturheberrechtsabkommens an der vom
 Urheber festgelegten Stelle in der Funktion des Computerprogramms
 angebracht bleibt, um den Vorbehalt des Urheberrechtes genuegend zum
 Ausdruck zu bringen. Dieser Urheberrechtsvermerk darf weder vom Kunden,
 Nutzer und/oder von Dritten entfernt, veraendert oder disloziert werden.
 -----------------------------------------------------------------------------*/
var g_isie = false,
    g_isie6 = false,
    g_isie7 = false,
    g_ismoz = false,
    g_ismoz3 = false,
    g_issafari = false,
    g_issafari4 = false,
    g_isopera = false,
    g_islinux = false,
    g_ismac = false,
    g_vappaccesskey = "Alt",
    g_isdirty = true,
    g_pagebusy = true,
    g_renderlater = [],
    g_ctrltemplates = [],
    g_vappportlets = [],
    g_allfscsb = [],
    g_treeselection,
    g_vappmenu,
    g_vapplistviews = [],
    g_vappsliders = [],
    g_vappactslider,
    g_sellists = {},
    g_vappselgridelem,
    g_selection,
    g_isshift,
    g_isctrl,
    g_isalt,
    g_dragrow,
    g_vappdropfiles = [],
    g_vappdelayedrequest,
    g_vapptabbed = false,
    g_vappchanging = false,
    g_vappreqqueue,
    g_vappreqfunc,
    g_vappctrls = [],
    g_vappselecttimeout,
    g_vappcurrtimeout,
    g_style,
    g_vappsessionid,
    g_vappwindowid,
    g_vappwindowcount,
    g_vappmacaddress,
    g_vappstubversion,
    g_vappoverlays = [],
    g_vappoverlaydialogs = [],
    g_vappinplacecont,
    g_vappreselem,
    g_vapphighlight,
    g_vappspellbutton,
    g_vappstrings = [],
    g_vappfocusset = false,
    g_vappmozdragsrc,
    g_vappscrollbarheight,
    g_vappemfactor,
    g_vappchecksfailedrequired = [],
    g_vappchecksfailedoptional = [],
    g_vappcheckspassed = [],
    g_vapprudirect,
	  g_vappistimeout = false,
    g_vappeditinplace = false,
    g_vappeditinplacetimeout,
    g_vappiframes = [],
    g_vappportaltitle,
    g_vappactpageheader;

//------------------------------------------------------------------------------

var URL_SELECTION_LIMIT = 50,
    IMPORT_LIMIT = 8192000;

var FSC_GRID_PFX = "gr",
    FSC_GRIDLABEL_PFX = "grl",
    FSC_GRIDDATA_PFX = "grd";

var FSC_BORDER_SIZE = 7,
    FSC_BORDER_SIZE_MINIMIZED = 20,
    FSC_PORTAL_COLLAPSED_FROM_TOP    = 1,
    FSC_PORTAL_COLLAPSED_FROM_BOTTOM = 2,
    FSC_PORTAL_COLLAPSED_FROM_LEFT   = 3,
    FSC_PORTAL_COLLAPSED_FROM_RIGHT  = 4;
    
var FSC_STRSHORTCUTS = "COO.1.1001.1.239512",
    FSC_STRNAVPATH = "COO.1.1001.1.239497",
    FSC_STRBUTTONS = "COO.1.1001.1.239511",
    FSC_TABS = "COO.1.1001.1.87652",
    FSC_STRMENU = "COO.1.1001.1.87537",
    FSC_STRBUTTONBAR = "COO.1.1001.1.87538",
    FSC_STRUNSUPPORTEDBROWSER = "COO.1.1001.1.239493",
    FSC_STROPENDOCS = "COO.1.1001.1.239495",
    FSC_STRQSPROCESSING = "COO.1.1001.1.87576",
    FSC_STRNOCHOICE = "COO.1.1001.1.239496",
    FSC_STRSELECTED = "COO.1.1001.1.88153",
    FSC_STRTHUMBSIZE = "COO.1.1.1.12914",
    FSC_STRTRANSPARENCY = "COO.1.1.1.12913",
    FSC_STRSLIDEINTERVAL = "COO.1.1.1.12949",
    FSC_STRSEC = "COO.1.1.1.1869",
    FSC_STRLOADING = "COO.1.1001.1.238811",
    FSC_STRSELECTIONTOBIG = "COO.1.1001.1.91482",
    FSC_STRSERVICEUNAVAILABLE = "COO.1.1001.1.239516",
    FSC_STRSELECTBOX = "COO.1.1001.1.239517",
    FSC_STRSEARCH = "COO.1.1001.1.38400",
    FSC_STRFINDNOW = "COO.1.1001.1.239518",
    FSC_ERRINVALIDVALUE = "COO.1.1.1.1058",
    FSC_STRSTAR = "COO.1.1001.1.239537",
    FSC_STRSTARS = "COO.1.1001.1.239524",
    FSC_STARGREY = "COO.1.1.1.16293",
    FSC_STARRED = "COO.1.1.1.16294",
    FSC_STARYELLOW = "COO.1.1.1.16295",
    FSC_STRIMPORTFROM = "COO.1.1001.1.239360",
    FSC_STRIMPORTTO = "COO.1.1001.1.239361",
    FSC_STRIMPORTPROGRESS = "COO.1.1001.1.239362",
    FSC_STRIMPORTON = "COO.1.1001.1.239364",
    FSC_STRCOLLAPSE = "COO.1.1001.1.239491",
    FSC_STREXPAND = "COO.1.1001.1.239492";
//------------------------------------------------------------------------------

if (null==window.g_isportlet) {
  window.g_isportlet = false;
}

function vappsetbrowserinfo()
{
  var agent = navigator.userAgent.toLowerCase(),
      msiestr = agent.match(/msie *([0-9\.]*)/);

  if (msiestr) {
    var version = parseInt(msiestr[1]);
    g_isie = true;
    g_isie6 = version==6;
    g_isie7 = version==7 && agent.indexOf("trident/4.0")<0;
  }
  else {
    g_islinux = agent.indexOf("linux")>=0;
    g_ismac = agent.indexOf("macintosh")>0;
    g_isie = agent.indexOf("microsoft outlook")>=0;
    var mozstr = agent.match(/firefox\/* *([0-9\.]*)/);  /**/
    if (mozstr) {
      g_ismoz = true;
      g_ismoz3 = (parseFloat(mozstr[1]) < 3.5);
      g_vappaccesskey = "Alt+Shift";
    }
    else if (agent.match(/prism\/* *([0-9\.]*)/)) { /**/
      g_ismoz = true;
    }
    else if (agent.match(/([0-9\.]*) safari/)) {  // includes google chrome
      g_issafari = true;
      g_issafari4 = agent.indexOf("version/4") > 0;
      g_ismoz = true;
      g_vappaccesskey = "Ctrl";
    }
    else if (agent.match(/opera\/* *([0-9\.]*)/)) { /**/
      g_isopera = true;
      g_vappaccesskey = "Esc+Shift";
    }
  }
}

vappsetbrowserinfo();

//------------------------------------------------------------------------------

function vappcreatehelperelem(tag, id, classname)
{
  if (id) {
    var elem = window.document.getElementById(id);
    if (!elem) {
      elem = document.createElement(tag);
      if (tag=="IFRAME") {
        elem.name = id;
        elem.frameBorder = 0;
        g_vappiframes.push(elem);
      }
      if (classname) {
        elem.className = classname;
      }
      elem.id = id;
      window.document.body.appendChild(elem);
    }
    return elem;
  }
}

function vappgethelperspan(id)
{
  var span = window.document.getElementById(id);
  if (!span) {
    span = vappcreatehelperelem("SPAN", id, "FscHidden");
  }
  return span;
}

function vappgethelperelem(getmaxelem)
{
  if (getmaxelem) {
    if (!window.g_vappmaxhelperelem) {
      window.g_vappmaxhelperelem = document.createElement("DIV");
      window.g_vappmaxhelperelem.className = "FscHidden";
      document.body.appendChild(window.g_vappmaxhelperelem);
    }
    return window.g_vappmaxhelperelem;
  }
  if (!window.g_vapphelperelem) {
    var tab = document.createElement("TABLE");
    var tbody = document.createElement("TBODY");
    var tr = document.createElement("TR");
    window.g_vapphelperelem = document.createElement("TD");
    tab.appendChild(tbody);
    tbody.appendChild(tr);
    tr.appendChild(window.g_vapphelperelem);
    tab.style.visibility = "hidden";
    tab.style.width = "0%";
    document.body.appendChild(tab);
  }
  return window.g_vapphelperelem;
}

function vappgetiframe()
{
  for (var idx=0, cnt=g_vappiframes.length; idx<cnt; idx++) {
    if (!g_vappiframes[idx].src) {
      return g_vappiframes[idx];
    }
  }
  return vappcreatehelperelem("IFRAME", "fscp"+g_vappiframes.length, "FscHiddenIFrame");
}

//------------------------------------------------------------------------------
// icons
var g_vappiconpath = "../tmp/i/",
    g_vappicons = {
      event:          g_vappiconpath+"l/COO.1.1.1.16290.png",
      logout:         g_vappiconpath+"l/COO.1.1.1.16282.png",
      overlaywarning: g_vappiconpath+"l/COO.1.1.1.16279.png",
      overlayerror:   g_vappiconpath+"l/COO.1.1.1.16280.png"
    };
    
function vappgetoverlayiconsrc(imgsrc, overlaysrc)
{
  return (overlaysrc) ? "src=\""+overlaysrc+"\" style=\"background-image:url("+imgsrc+")\"" : "src=\""+imgsrc+"\"";
}

function vappgetoverlayicon(img)
{
  return (img && img.style.backgroundImage) ? img.src : null;
}

function vappsetoverlayicon(img, overlaysrc)
{
  if (img) {
    if (overlaysrc) {
      img.style.backgroundImage = "url("+img.src+")";
      img.src = overlaysrc;
    }
    else {
      vappremoveoverlayicon(img);
    }
  }
}

function vappremoveoverlayicon(img)
{
  if (vappgetoverlayicon(img)) {
    if (g_isie || g_issafari) {
      var path = img.style.backgroundImage.split("(")[1];
      img.src = path.split(")")[0];
    }
    else {
      img.src = img.style.backgroundImage.split("\"")[1];
    }
    img.style.backgroundImage = "";
  }
}

//------------------------------------------------------------------------------
// style
var g_vapp_css = new Array();
if (window.g_isportlet) {
  // Messages
  g_vapp_css["error"] =             "portlet-msg-error";
  g_vapp_css["warning"] =           "portlet-msg-alert";
  g_vapp_css["info"] =              "portlet-msg-info";
  // Sections
  g_vapp_css["head"] =              "portlet-section-header";
  g_vapp_css["row"] =               "portlet-section-body";
  g_vapp_css["rowalternate"] =      "portlet-section-alternate";
  g_vapp_css["selection"] =         "portlet-section-selected";
  g_vapp_css["inactiveselection"] = "portlet-section-selected";
  // Forms
  g_vapp_css["desc"] =              "portlet-form-label";
  g_vapp_css["label"] =             "portlet-form-field-label";
  g_vapp_css["labelselection"] =    "portlet-section-selected";
  g_vapp_css["input"] =             "portlet-form-input-field";
  g_vapp_css["formfield"] =         "portlet-form-field";
  g_vapp_css["selectbox"] =         "FscSB portlet-form-field";
  g_vapp_css["radio"] =             "portlet-form-field";
  g_vapp_css["button"] =            "portlet-form-button";
  // Menus
  g_vapp_css["menucontainer"] =     "portlet-menu-caption";
  g_vapp_css["cal"] =               "portlet-menu";
  g_vapp_css["calhead"] =           "portlet-menu-caption";
  g_vapp_css["calcurrday"] =        "portlet-menu-item-selected";
  g_vapp_css["menu"] =              "portlet-menu";
  g_vapp_css["menuitem"] =          "portlet-menu-item";
  g_vapp_css["calworkday"] =        "portlet-menu-item";
  g_vapp_css["submenuitem"] =       "portlet-menu-cascade-item";
  g_vapp_css["menuitemsel"] =       "portlet-menu-item-hover";
  g_vapp_css["calsel"] =            "portlet-menu-item-hover";
  g_vapp_css["calnoworkday"] =      "portlet-menu-item-hover";
}
else {
  g_vapp_css["error"] =             "FscError";
  g_vapp_css["warning"] =           "FscWarning";
  g_vapp_css["info"] =              "FscConfirm";
  g_vapp_css["rowalternate"] =      "FscLR";
  g_vapp_css["selection"] =         "FscSel";
  g_vapp_css["inactiveselection"] = "FscLSelInactive";
  g_vapp_css["desc"] =              "FscDescription";
  g_vapp_css["label"] =             "FscGridLabel";
  g_vapp_css["labelselection"] =    "FscLabelSel";
  g_vapp_css["formfield"] =         "FscBool";
  g_vapp_css["selectbox"] =         "FscSB";
  g_vapp_css["radio"] =             "FscEnumBool";
  g_vapp_css["button"] =            "FscBt";
  g_vapp_css["menucontainer"] =     "FscMenuContainer";
  g_vapp_css["menu"] =              "FscM";
  g_vapp_css["menuitem"] =          "FscM";
  g_vapp_css["submenuitem"] =       "FscM";
  g_vapp_css["menuitemsel"] =       "FscMSel";
  g_vapp_css["cal"] =               "FscCalendar";
  g_vapp_css["calsel"] =            "FscCalSel";
  g_vapp_css["calworkday"] =        "FscCalWD";
  g_vapp_css["calnoworkday"] =      "FscCalNoWD";
  g_vapp_css["calcurrday"] =        "FscCalCurrDay";
}

function AjaxStyle(id)
{
  this.m_id = (id) ? "fscstyle"+id : "fscstyle";
  
  this.IsNewCtrl = function(ctrl)
  {
    if (!this.m_ctrls[ctrl]) {
      this.m_ctrls[ctrl] = true;
      return true;
    }
    return false;
  }
  
  this.IsEmpty = function()
  {
    return (this.m_styles.length==0);
  }
  
  this.AddEx = function(path, style, replacestyle)
  {
    if (replacestyle) {
      var fullpath = this.m_paths[replacestyle];
      if (fullpath) {
        pathparts = fullpath.split(",");
        for (var idx=0, cnt=pathparts.length; idx<cnt; idx++) {
          if (pathparts[idx]==path) {
            pathparts.splice(idx, 1);
            break;
          }
        }
        if (!pathparts.length) {
          this.m_paths[replacestyle] = null;
        }
      }
    }
    if (this.m_paths[style]) {
      if (this.m_paths[style]!=path) {
        this.m_paths[style]+= ","+path;
      }
    }
    else {
      this.m_styles.push(style);
      this.m_paths[style] = path;
    }
  }
  
  this.Add = function(path, bg, bc, c, fs)
  {
    var style = "";
    if (bg) { style = "background-color:"+bg+";"; }
    if (bc) { style+= "border-color:"+bc+";"; }
    if (c)  { style+= "color:"+c+";"; }
    if (fs) { style+= "font-size:"+fs+";"; }
    
    this.AddEx(path, style);
  }

  this.Apply = function(doc)
  {
    if (!doc) {
      doc = window.document;
    }
    this.m_tag = doc.getElementById(this.m_id);
    if (!this.m_tag) {
      var containertag = (g_issafari) ? "HEAD" : "BODY";
      this.m_container = doc.getElementsByTagName(containertag)[0];
      if (this.m_container) {
        this.m_tag = doc.createElement("STYLE");
        this.m_tag.id = this.m_id;
        this.m_tag.type = "text/css";
        this.m_container.appendChild(this.m_tag);
      }
    }
    var styles = new Array();
    for (var idx=0, cnt=this.m_styles.length; idx<cnt; idx++) {
      var stylestr = this.m_styles[idx];
      var path = this.m_paths[stylestr];
      if (path) {
        styles.push(path+"{"+stylestr+"}");
      }
    }
    try {
      if (g_isie) {
        this.m_tag.styleSheet.cssText = styles.join("\n");
      }
      else {
        for (var child=this.m_tag.firstChild; null!=child; child=child.nextSibling) {
          this.m_tag.removeChild(child);
        }
        this.m_tag.appendChild(doc.createTextNode(styles.join("\n")));
      }
    }
    catch (e) { }
  }
  
  this.Init = function()
  {
    this.m_styles = new Array();
    this.m_paths = new Array();
    this.m_ctrls = new Array();
    
    if (this.m_tag) {
      try {
        if (g_isie) {
          this.m_tag.styleSheet.cssText = "";
        }
        else {
          for (var child=this.m_tag.firstChild; null!=child; child=child.nextSibling) {
            this.m_tag.removeChild(child);
          }
        }
      }
      catch (e) { }
    }
  }
  
  this.Cleanup = function()
  {
    if (this.m_tag) {
      this.m_container.removeChild(this.m_tag);
    }
  }
  
  this.Init();
}

//------------------------------------------------------------------------------
// further stuff in Server/service/wmc/resource/data/en/js/portable.js

window.portable = { };

window.portable.nsPrefix = "";
  
window.portable.browser = { };

window.portable.browser.ie = (navigator.userAgent.toLowerCase().indexOf("msie") > -1)
                             && document.all && window.ActiveXObject;

if (g_isie) {
  window.portable.AxID = new Array();
  
  window.portable.AxID.DomDocument = [
    0,
    "Msxml2.DOMDocument.6.0",
    "Msxml2.DOMDocument.3.0"
  ];
  
  // ------------------------------------------------------------------------    
  // determine most recent activex program id's
  for (var axidx in window.portable.AxID) {
    for (var i = 1; i < window.portable.AxID[axidx].length; i++) {
      try {
        var ax_obj = new ActiveXObject(window.portable.AxID[axidx][i]);
        window.portable.AxID[axidx][0] = i;
        ax_obj = null; // gc
        break;
      }
      catch (e) {
      }
    }
  }

  // Create ActiveX Object with the most recent detected ID
  function createActivexObject(name)
  {
    try {
      if (window.portable.AxID[name][0] != 0) {
        return new ActiveXObject(window.portable.AxID[name][window.portable.AxID[name][0]]);
      }
    }
    catch (e) {
    }
    return null;
  }

  portable.createDOMDocument = function()
  { 
    return new createActivexObject("DomDocument");
  }
  
  portable.createElementNS = function(doc, name, nsuri)
  {
    return doc.createNode(1, name, nsuri);
  }
}
else if (g_ismoz) {
  function _Node_serializeToString()
  {
    var serializer = new XMLSerializer();
    var result = "";
    try {
      result = serializer.serializeToString(this);
    } catch(e) {}
    return result;
  }
  
  Node.prototype.__defineGetter__("xml", _Node_serializeToString);
  
  // ------------------------------------------------------------------------

  Document.prototype.loadXML = function(str)
  {
    var parser = new DOMParser();
    var doc = parser.parseFromString(str, "text/xml");
    while (this.hasChildNodes()) {
      this.removeChild(this.lastChild);
    }
    for (var i = 0; i < doc.childNodes.length; i++) {
      var importednode = this.importNode(doc.childNodes[i], true);
      this.appendChild(importednode);
    }
  }

  // ------------------------------------------------------------------------
  
  portable.createDOMDocument = function()
  {
    return document.implementation.createDocument("","", null);   
  }
 
  // ------------------------------------------------------------------------

  portable.createElementNS = function(doc, name, nsuri)
  {
    return doc.createElementNS(nsuri, name);
  }
  
  // ------------------------------------------------------------------------

  XSLTProcessor.prototype.transformToString = function(sourceDoc, ownerDoc)
  {
     var fragment = this.transformToFragment(sourceDoc, ownerDoc);
     var serializer = new XMLSerializer;
     return serializer.serializeToString(fragment);
  }
}

//------------------------------------------------------------------------------
// parent opener etc.
function vappwindowparent()
{
  try {
    if (!window.g_isportlet && window.parent.vapp) {
      return window.parent;
    }
  }
  catch (e) {
  }
  return null;
}

function vappwindowopener()
{
  try {
    if (window.opener.vapp) {
      return window.opener;
    }
  }
  catch (e) {
  }
  return null;
}

//------------------------------------------------------------------------------
// keep alive
function vappkeepalive(portletid)
{
  aborttx = vappgetaborttx(portletid);
  if (aborttx) {
    window.setTimeout("vappkeepalive('"+portletid+"')",180000);
    var xurl=vappbaseurl()+"&op=k&tx="+aborttx;
    try {
      (new Image()).src=xurl; 
    }
    catch (e) {
    }
  }
}

//------------------------------------------------------------------------------
// wbt / mobile
function vappiswbt()
{
  return false;
}

function vappnewxml(xml,name)
{
  try {
    if (top.vapplistenerxml) {
      top.vapplistenerxml(xml,name);
    }
    else if (parent.vapplistenerxml) {
      parent.vapplistenerxml(xml,name);
    }
  }
  catch (e) {
  }
}

var g_wbtpagechanged = false;

function vappwbtpagechanged(changed)
{
  g_wbtpagechanged = (changed) ? true : false;
}

//------------------------------------------------------------------------------
// utilities
function vappgettop(tag, stoptag)
{
  var top = 0;
  while (tag && stoptag!=tag) {
    top+= tag.offsetTop;
    var scrolltop = tag.scrollTop;
    if (scrolltop>0 && tag.tagName!="HTML") {
      top-= scrolltop;
    }
    tag = tag.offsetParent;
  }
  if (g_issafari) {
    top+= window.document.body.scrollTop;
  }
  return top;
}

function vappgetleft(tag)
{
  var left = 0;
  while (tag) {
    left+= tag.offsetLeft;
    var scrollleft = tag.scrollLeft;
    if (scrollleft>0 && tag.tagName!="HTML") {
      left-= scrollleft;
    }
    tag = tag.offsetParent;
  }
  if (g_issafari) {
    left+= window.document.body.scrollLeft;
  }
  return left;
}

function vappgetwidth(htm)
{
  var helper = vappgethelperelem();
  helper.innerHTML = htm;
  return helper.offsetWidth;
}

function vappgetparent(tag)
{
  return tag.parentElement;
}

function vappgetparentbyclassname(tag, classnames, depth, findtag, stoptag)
{
  if (classnames) {
    classnames = classnames.split("|");
    var classcnt = classnames.length;
    while (tag && (null==depth || depth-->0)) {
      var classname = tag.className;
      if (classname) {
        for (var idx=0; idx<classcnt; idx++) {
          if (classname.indexOf(classnames[idx])==0) {
            if (findtag) {
              var tagEntry = "|"+tag.tagName+"|";
              if (findtag.indexOf(tagEntry)>=0) {
                return tag;
              }
              if (stoptag && stoptag.indexOf(tagEntry)>=0) {
                return null;
              }
            }
            else {
              return tag;
            }
          }
        }
      }
      tag = vappgetparent(tag);
    }
  }
  return null;
}

function vappgetparentbyattribute(tag, attrname, depth)
{
  while (tag && depth--) {
    if (tag.getAttribute && null!=tag.getAttribute(attrname)) {
      return tag;
    }
    tag = vappgetparent(tag);
  }
}

function vappgetattribute(tag, attrname, depth)
{
  var attr;
  while (tag && depth--) {
    if (tag.getAttribute) {
      attr = tag.getAttribute(attrname);
      if (null!=attr) {
        return attr;
      }
    }
    tag = vappgetparent(tag);
  }
}

function vappgetparentbytagname(tag, findtag, stoptag, withincont)
{
  while (null!=tag) {
    var tagEntry="|"+tag.tagName+"|";
    if (findtag.indexOf(tagEntry)>=0) {
      return tag;
    }
    if (stoptag.indexOf(tagEntry)>=0 || (withincont && vapphasclass(tag, "FSCAjaxContainer"))) {
      return null;
    }
    tag=vappgetparent(tag);
  }
}

function vappgetparentbyid(tag, findid, depth)
{
  while (null!=tag) {
   if (depth--<=0) {
      return null;
    }
    if (tag.id && tag.id.indexOf(findid)==0) {
      return tag;
    }
    tag=vappgetparent(tag);
  }
}

function vappgetchildbyclassname(elem, classname)
{
  var childs = elem.childNodes;
  for (var idx=0, cnt=childs.length; idx<cnt; idx++) {
    if (vapphasclass(childs[idx], classname)) {
      return childs[idx];
    }
  }
  return false;
}

/*
 * depth = 1 -> child === parent
 */
function vappischild(child, parent, depth)
{
  if (parent) {
    while (depth-- && child) {
      if (child === parent) {
        return true;
      }
      child = child.parentElement;
    }
  }
  return false;
}

function vappismouseout(evt, parent, depth)
{
  if (evt && parent) {
    var target = (evt.target) ? evt.target : evt.srcElement,
        relatedtarget = (evt.relatedTarget) ? evt.relatedTarget : evt.toElement,
        depth = (depth) ? depth : 1;

    if (target && !vappischild(target, parent, depth) ||
        relatedtarget && !vappischild(relatedtarget, parent, depth)) {
      return true;
    }
    return false;
  }
}

function vappgetmouseposX(evt)
{
  var scrollelem = (g_issafari) ? window.document.body : window.document.documentElement;
  return (evt) ? evt.clientX + scrollelem.scrollLeft : 0;
}

function vappgetmouseposY(evt)
{
  var scrollelem = (g_issafari) ? window.document.body : window.document.documentElement;
  return (evt) ? evt.clientY + scrollelem.scrollTop : 0;
}

function vappgetwindowwidth()
{
  return (g_ismoz) ? window.innerWidth : window.document.body.offsetWidth;
}

function vappgetwindowheight()
{
  return (g_ismoz) ? window.innerHeight : window.document.body.offsetHeight;
}

function vappseterrorfocus(fieldname, page)
{
  fieldname = "f"+fieldname;
  if (null!=page) {
    vappsetg_focusfieldid(fieldname);
    return vapp(5002, null, page);
  }
  else {
    var errorfield = vappgetform()[fieldname],
        tagname;
    if (errorfield) {
      tagname = errorfield.tagName;
    }
    else {
      errorfield = vappgetelementbyid(fieldname);
    }
    if (tagname=="INPUT" || tagname=="SELECT" || tagname=="TEXTAREA" || vappisselectbox(errorfield)) {
      try {
        vappselcheck(errorfield);
        g_selection.SetFocus(null, true);
        return;
      }
      catch (e) {}
    }
    window.location.href = window.location.href.split("#")[0]+"#e"+fieldname;
  }
}

function vappformatbytes(bytes_string, precision, getKB)
{
  var formatedbytes,
      bytes=parseInt(bytes_string),
      kilobyte = 1024,
      megabyte = kilobyte * 1024,
      gigabyte = megabyte * 1024,
      terabyte = gigabyte * 1024;

  if (precision==null) {
    precision = 1;
  }
  if (getKB) {
    if ((bytes >= kilobyte) && getKB) {
      formatedbytes = (bytes / kilobyte).toFixed(precision);
    }
    else {
      formatedbytes = 0;
    }
  }
  else if ((bytes >= 0) && (bytes < kilobyte)) {
    formatedbytes = bytes + ' B';
  }
  else if ((bytes >= kilobyte) && (bytes < megabyte)) {
    formatedbytes = (bytes / kilobyte).toFixed(precision) + ' KB';
  }
  else if ((bytes >= megabyte) && (bytes < gigabyte)) {
    formatedbytes = (bytes / megabyte).toFixed(precision) + ' MB';
  }
  else if ((bytes >= gigabyte) && (bytes < terabyte)) {
    formatedbytes = (bytes / gigabyte).toFixed(precision) + ' GB';
  }
  else if (bytes >= terabyte) {
    formatedbytes = (bytes / terabyte).toFixed(precision) + ' TB';
  }
  else {
    formatedbytes = bytes + ' B';
  }
  return formatedbytes;
}

function vappobject(obj)
{
  return (obj && typeof obj === "object") ? obj : {};
}

function vappfunction(func)
{
  return (func && typeof func === "function") ?  func : function() {};
}

//------------------------------------------------------------------------------
// escape functions
function MaskValue(value)
{
  var v = value;
  if (value) {
    if (value.indexOf("&")>-1) {
      v = v.split("&").join("&amp;");
    }
    if (value.indexOf("\"")>-1) {
      v = v.split("\"").join("&quot;");
    }
    if (value.indexOf(">")>-1) {
      v = v.split(">").join("&gt;");
    }
    if (value.indexOf("<")>-1) {
      v = v.split("<").join("&lt;");
    }
  }
  else {
    v = "";
  }
  return v;
}

function vappsimplifyname(name, extension, adddelchars)
{
  if (name) {
    var delchars = new Array ("&", "/", "#", "\"", "\'", " ", "\\", ":", "?", "*", ">", "<", "|", String.fromCharCode(8220), String.fromCharCode(8222));
    if (adddelchars) {
      delchars = delchars.concat(adddelchars);
    }
    if (extension && extension.toLowerCase()=="mht") {
      delchars = delchars.concat(new Array("!", "#", "%20", "%23", "%25", "%C3%84", "%C3%A4", "%C3%9C", "%C3%BC", "%C3%96", "%C3%B6"));
    }
    for (var idx=0; idx<delchars.length; idx++) {
      name = name.split(delchars[idx]).join("_");
    }
  }
  return name;
}

function vappescapequote(text)
{
  if (text) {
    text=text.split("&").join("&#39;");
    text=text.split("'").join("&#39;");
  }
  return text;
}

function vappstraddslashes(str)
{
  if (str) {
    str=str.split("\\").join("\\\\");
    str=str.split("'").join("\\\'");
    str=str.split("\n").join("\\n");
    str=str.split("\r").join("\\r");
  }
  return str;
}

//------------------------------------------------------------------------------
// form
function vappgetform(id)
{
  return vappgetelementbyid("f", id);
}

function vappgetformfield(id, portletid)
{
  var form = vappgetform(portletid);
  if (form) {
    return form[id];
  }
}

function vappaddformfield(name, value, portletid)
{
  if (name) {
    var form = vappgetform(portletid);
    if (form) {
      var tag = form[name];
      if (!tag) {
        tag = document.createElement("INPUT");
        tag.type = "hidden";
        tag.name = name;
        form.appendChild(tag);
      }
      if (tag) {
        tag.value = value;
      }
    }
  }
}

function vapppushformdata(formdata, name, value)
{
  var succeeded = true;
  try {
    value = (null==value) ? "" : encodeURIComponent(value);
  }
  catch (e) {
    value = "";
    succeeded = false;
  }
  formdata.push(name+"="+value+"&");
  return succeeded;
}

//------------------------------------------------------------------------------
// span for menu, calendar, ...
function vappspan_hide(id)
{
  if (id) {
    var fscx = window.document.getElementById(id);
    if (fscx && fscx.style.visibility=="visible") {
      fscx.style.visibility = "";
      fscx.style.left = "";
      fscx.style.top = "";
      if (g_isie) {
        try {
          fscx.releaseCapture();
        }
        catch (e) {}
      }
      return true;
    }
  }
}

function vappmenuspan(fscm, x, y)
{
  if (fscm) {
    vappsetelempos(fscm, x, y, true);
    fscm.style.visibility = 'visible';
  }
  return false;
}

function vappsetelempos(elem, x, y, isinit)
{
  var childcount = elem.children.length;
  if (vapphaspluginoverlay(elem)) {
    childcount--;
  }
  var singlechild = (childcount==1) ? elem.firstChild : null,
      helpersinglechild = singlechild, helper = elem, clearhelper;
  if (singlechild) {
    singlechild.style.height = "";
    singlechild.style.width = "";
  }
  if (null==x) {
    x = orgx = vappgetnumber(elem.style.left);
  }
  if (null==y) {
    y = orgy = vappgetnumber(elem.style.top);
  }
  if (!isinit) {
    helper = vappgethelperelem(true);
    helper.innerHTML = elem.innerHTML;
    helpersinglechild = (singlechild) ? helper.firstChild : null;
    clearhelper = true;
  }
  var elemheight = (singlechild) ? helper.firstChild.offsetHeight : helper.offsetHeight,
      elemwidth = (singlechild) ? helper.firstChild.offsetWidth : helper.offsetWidth,
      maxheight = (g_ismoz) ? window.innerHeight : window.document.body.offsetHeight,
      maxwidth = (g_ismoz) ? window.innerWidth : window.document.body.offsetWidth + window.document.documentElement.scrollLeft,
      maxleft, maxtop, orgx, orgy;

  if ((g_isie6 || g_isie7) && singlechild && singlechild.className=="FscMenu") {
    // workaround for ie6 & ie7 to correct menu width
    var divs = helpersinglechild.getElementsByTagName("DIV");
    for (var idx=0, cnt=divs.length; idx<cnt; idx++) {
      if (divs[idx].className=="FscMSep") {
        divs[idx].className = "FscMSepDisabled";
      }
    }
    elemwidth = helper.offsetWidth;
    singlechild.style.width = elemwidth+"px";
    for (var idx=0, cnt=divs.length; idx<cnt; idx++) {
      if (divs[idx].className=="FscMSepDisabled") {
        divs[idx].className = "FscMSep";
      }
    }
  }
  if (elemheight>maxheight && singlechild) {
    singlechild.style.height = maxheight+"px";
    elemwidth+= 16;
    singlechild.style.width = elemwidth+"px";
  }
  maxtop = maxheight - elemheight;
  if (y>maxtop) {
    y = (maxtop>0) ? maxtop : 0;
  }
  maxleft = maxwidth - elemwidth;
  if (x>maxleft) {
    x = (maxleft>0) ? maxleft : 0;
  }
  if (x<10) {
    x = 10;
  }
  elem.style.left = x+"px";
  elem.style.top = y+"px";

  vappaddpluginoverlay(elem, elemheight);
  
  if (clearhelper && !g_isie6) {
    helper.innerHTML = "";
  }
}

//------------------------------------------------------------------------------
// url utils
function vappsetargument(argname, args, argvalue)
{
  args=args.split('#')[0];
  var arg_start=args.indexOf(argname+"=");
  if (arg_start!=-1) {
    var arg_end=args.indexOf("&", arg_start);
    if (arg_end==-1) {
      arg_end=args.length;
    }
    args=args.substring(0, arg_start+argname.length+1)+argvalue+args.substring(arg_end, args.length);
  }
  else {
    args=args+"&"+argname+"="+argvalue;
  }
  return args;
}

function vappgetargument(argname, args)
{
  if (!args) {
    args = window.location.href.split("?")[1];
  }
  var arg="";
  var arg_start=args.indexOf(argname+"=");
  if (arg_start!=-1) {
    var arg_end=args.indexOf("&",arg_start);
    if (arg_end==-1) {
      arg_end=args.indexOf("#",arg_start);
      if (arg_end==-1) {
        arg_end=args.length;
      }
    }
    arg=args.substring(arg_start+argname.length+1,arg_end);
  }
  return arg;
}

function vappmacargument()
{
  try {
    if (!g_vappmacaddress && !window.g_isportlet) {
      var stub = vappgetplugin(false);
      if (stub) {
        vappenableprivilege(stub)("UniversalXPConnect");
        g_vappmacaddress = stub.GetMACAddress();
      }
    }
  }
  catch (e) {
    TT("vappmacargument: "+e);
  }
  return g_vappmacaddress ? "&hx="+g_vappmacaddress : "";
}

function vappoptargument(argname, args, argsdef, prefix)
{
  if (null==prefix) {
    prefix="&";
  }
  var value=vappgetargument(argname, args);
  if (!value) {
    if (argsdef) {
      value=vappgetargument(argname, argsdef);
    }
  }
  return value ? prefix+argname+"="+value : "";
}

function vappbaseurlargs(skipax, ignorestubdependendargs, id, location)
{
  if (!location) {
    var f=vappgetform(id);
    var location=(null!=f) ? f.action : window.location.href;
  }

  var url=vappoptargument("dx", location, null, "");
  if (!skipax) {
    url+=vappoptargument("ax", location);
  }
  url+=vappoptargument("gx", window.vappurletc, location);
  url+=vappoptargument("px", window.vappurletc, location);
  url+=vappoptargument("ux", window.vappurletc, location);
  url+=vappoptargument("cx", window.vappurletc, location);
  url+=vappoptargument("lx", window.vappurletc, location);
  url+=vappoptargument("sx", window.vappurletc, location);
  url+=vappoptargument("xx", window.vappurletc, location);
  url+=vappoptargument("tz", location);
  url+=vappoptargument("cs", location);
  url+=vappoptargument("fx", location);
  if (!ignorestubdependendargs) {
    url+=vappmacargument();
  }
  if (window.g_isportlet) {
    url+= "&pt=1";
  }
  if (null!=document.body) {
    if (document.body.sys_describe) {
      url+="&sys_describe="+document.body.sys_describe;
    }
  }
  return url;
}

function vappbaseurl(ignorestubdependendargs, args, id)
{
  var location = (window.g_isportlet) ? vappgetg_portletstarturl(id) : window.location.href;
  var url = location.split("?")[0]+"?"+vappbaseurlargs(true, ignorestubdependendargs, id);
  if (args) {
    url += args;
  }
  return url;
}

function vapphead(url)
{
  var vappurl=null;
  if (url) {
    vappurl = url;
  }
  else {
    vappurl = (window.g_isportlet) ? vappgetg_portletstarturl() : window.location.href;
  }
  var vappurllowercase = vappurl.toLowerCase();
  var index = vappurllowercase.indexOf("/content/");
  while (index-->0 && vappurllowercase.charAt(index)!='/') {
  }

  if (index>=0) {
    return vappurl.substr(0,index);
  }
  else {
    return vappurl;
  }
}

function vappdavhead(url)
{
  return vapphead(url)+"/fscdav"
}

function vappdavurlwithname(davurl,name,extension,nativedav,firstname,readonly)
{
  var newdavurl = davurl,
      maxlength = 2047;
  if (nativedav) {
    maxlength = (firstname) ? 107 : 217;
  }
  if (null!=name && null!=davurl) {
    var name = encodeURIComponent(vappsimplifyname(name,extension)),
        davurllength = davurl.length,
        namelength = name.length,
        extensionlength = extension.length;

    if (davurllength < maxlength) {
      var currlength = davurllength + namelength + extensionlength + 8;
      if (currlength > maxlength) {
        var newlength = namelength - (currlength - maxlength);
        name = vappgeturlfilename(name.substring(0, newlength));

        var nameparts = name.split("%"),
            lastnamepart = nameparts[nameparts.length-1];
        if (lastnamepart.length<=1) {
          newlength = newlength - (lastnamepart.length+1);
          name = name.substring(0, newlength);
        }
      }
      if (!firstname && !readonly) {
        newdavurl+= '&NAME=';
      }
      newdavurl+= '/' + name;
      if (extension) {
        newdavurl+= '.' + extension;
      }
    }
  }
  return newdavurl;
}

function vappgenfriendlyurl(obj, isdownload, filename, extension, contentpath)
{
  var url = vapphead();
  url+= (isdownload) ? "/download/" : "/read/";
  url+= obj+"/";
  if (contentpath) {
    url+= contentpath+"/";
  }
  url+= encodeURIComponent(vappsimplifyname(filename, extension));
  if (extension) {
    url+= "." + extension;
  }
  return vappgetportleturl(url);
}

function venvgendavurl(objadr,readonly,delax,isdownload,isnativedav,fileobjname,fileextension)
{
  var url = vapphead();
  if (isnativedav) {
    if (readonly) {
      url+="/read/";
      url+=objadr;
      url = vappdavurlwithname(url, fileobjname, fileextension, isnativedav, false, readonly);
    }
    else {
      url+="/fscdav";
      url = vappdavurlwithname(url, fileobjname, fileextension, isnativedav, true, readonly);
      url+="?OBJ="+objadr;
    }
  }
  else {
    url+="/fscdav";
    url+=readonly ? "/READONLY" : "/DAV";
    url+="?OBJ="+objadr;
    url+="&"+vappbaseurlargs(delax);
  }
  if (window.g_isportlet && !isdownload) {
    url = vappgetportleturl(url);
  }
  return url;
}

function vappgenxmlrpc(actionaddr,objaddr,args)
{
  var url = vappdavhead()+"/CALL?ACTION="+actionaddr;
  if (objaddr) {
    url+= "&OBJ="+objaddr;
  }
  if (args) {
    url+= ((""+args).charAt(0)=='&') ? args : "&ARG="+args;
  }
  url+= "&"+vappbaseurlargs();
  url = vapp24addurlparam(url);
  return vappgetportleturl(url);
}

function venvgenediturl(objadr)
{
  var url = vappbaseurl();
  url+="&ax=COO.1.1001.1.38272&venv_object="+objadr;
  return vappgetportleturl(url);
}

//------------------------------------------------------------------------------
// https handling
function vappswitchtohttp()
{
  var f = vappgetform();
  if (f && f.action) {
    f.action = f.action.replace(/https:/, "http:");
    f.action = f.action.replace(/fscsec/, "fscasp");
    f.action = f.action.replace(/xhr=1/, "xhr=s");
    vapp(5003, null, null, true);
  }
}

function vappexithttpsapp(pid, branch)
{
  try {
    if (window.opener) {
      var portlet = window.opener.vappgetportlet(pid);
      if (portlet && portlet.IsLocked(vappconfirm)) {
        window.opener.vapp(branch, null, null, false, pid);
      }
    }
  }
  catch (e) { }
  window.close();
}

//------------------------------------------------------------------------------

function vapprandomnumber(limessupperior) 
{ 
  return Math.round(Math.random() * limessupperior); 
}

function vappconvertNumToString(num, len)
{
  num += "";
  while (num.length < len) {
    num = "0" + num;
  }
  return num;
}

function vappgetscrcallback(callbackstr, mod, k0str, k1str, k2str, k3str, k4str, k5str, k6str, k7str, k8str, k9str)
{
  var typename;
  try {
    typename = typeof (eval(callbackstr));
  } catch (e) {
    typename = null;
  }
//  TT("typeof checkname: "+typename);
  if (typename != "function") {
    window.setTimeout("vappgetscrcallback('"+callbackstr+"','"+mod+"','"+k0str+"','"+k1str+"','"+k2str+"','"+k3str+"','"+k4str+"','"+k5str+"','"+k6str+"','"+k7str+"','"+k8str+"','"+k9str+"')",10);
  }
  else {
    var code;
    switch (mod) {
    case "0":
      code=""+callbackstr+"();";
      break;
    case "1":
      code=""+callbackstr+"('"+k0str+"');";
      break;
    case "2":
      code=""+callbackstr+"('"+k0str+"','"+k1str+"');";
      break;
    case "3":
      code=""+callbackstr+"('"+k0str+"','"+k1str+"','"+k2str+"');";
      break;
    case "4":
      code=""+callbackstr+"('"+k0str+"','"+k1str+"','"+k2str+"','"+k3str+"');";
      break;
    case "5":
      code=""+callbackstr+"('"+k0str+"','"+k1str+"','"+k2str+"','"+k3str+"','"+k4str+"');";
      break;
    case "6":
      code=""+callbackstr+"('"+k0str+"','"+k1str+"','"+k2str+"','"+k3str+"','"+k4str+"','"+k5str+"');";
      break;
    case "7":
      code=""+callbackstr+"('"+k0str+"','"+k1str+"','"+k2str+"','"+k3str+"','"+k4str+"','"+k5str+"','"+k6str+"');";
      break;
    case "8":
      code=""+callbackstr+"('"+k0str+"','"+k1str+"','"+k2str+"','"+k3str+"','"+k4str+"','"+k5str+"','"+k6str+"','"+k7str+"'');";
      break;
    case "9":
      code=""+callbackstr+"('"+k0str+"','"+k1str+"','"+k2str+"','"+k3str+"','"+k4str+"','"+k5str+"','"+k6str+"','"+k7str+"','"+k8str+"');";
      break;
    case "10":
      code=""+callbackstr+"('"+k0str+"','"+k1str+"','"+k2str+"','"+k3str+"','"+k4str+"','"+k5str+"','"+k6str+"','"+k7str+"','"+k8str+"','"+k9str+"');";
      break;
    default:
      code=""+callbackstr+"();";
    }
    eval(code);
  }
}

function vappdynscrload(url, callback, k0, k1 ,k2 ,k3 ,k4 ,k5 ,k6 ,k7 ,k8 ,k9)
{
  if (document.getElementById("vappdynscript_"+escape(url))==null) {
    var newscript = document.createElement("script");
    newscript.id =  "vappdynscript_"+escape(url);
    newscript.src = url;
    document.body.appendChild(newscript);
  }
  var callbackstr=""+callback;
  var mod=0;
  if (k0==null) {
    mod=0;
  }
  else if(k1==null) {
    mod=1;
  }
  else if(k2==null) {
    mod=2;
  }
  else if(k3==null) {
    mod=3;
  }
  else if(k4==null) {
    mod=4;
  }
  else if(k5==null) {
    mod=5;
  }
  else if(k6==null) {
    mod=6;
  }
  else if(k7==null) {
    mod=7;
  }
  else if(k8==null) {
    mod=8;
  }
  else if(k9==null) {
    mod=9;
  }
  var k0str=""+k0;
  var k1str=""+k1;
  var k2str=""+k2;
  var k3str=""+k3;
  var k4str=""+k4;
  var k5str=""+k5;
  var k6str=""+k6;
  var k7str=""+k7;
  var k8str=""+k8;
  var k9str=""+k9;
  mod=""+mod;
//  TT("vappdynscrload: "+ callbackstr);
  vappgetscrcallback(callbackstr,mod,k0str,k1str,k2str,k3str,k4str,k5str,k6str,k7str,k8str,k9str);
}

//------------------------------------------------------------------------------
// xml-functions (for firefox compatibility)
function vappxmlgettext(node)
{
  if (null!=node) {
    if (g_isie) {
      return node.text;
    }
    if(node.nodeName == "#text") {
      return node.data;
    }
    return node.firstChild ? node.firstChild.data : "";
  }
  return "";
}

function vappxmlgetnode(node)
{
  if (!g_isie) {
    if (node && node.nodeName=="#text") {
      node=node.nextSibling;
    }
  }
  return node;
}

function vappxmlgetdictionary(xmldictionary)
{
  var child = xmldictionary.firstChild;
  if (child) {
    if (child.nodeName=="xml") {
      child = child.nextSibling;
    }
    return (child.nodeName=="dictionary") ? child : null;
  }
}

//------------------------------------------------------------------------------
// event handling
var vappevent = {
  gettarget : function vappevent_gettarget(evt)
  {
    if (evt) {
      return (evt.target) ? evt.target : evt.srcElement;
    }
  },

  preventdefault : function vappevent_preventdefault(evt)
  {
    if (evt) {
      if (evt.preventDefault) {
        evt.preventDefault();
      }
      else  {
        evt.returnValue = false;
      }
    }
    return false;
  },

  cancelbubble : function vappevent_cancelbubble(evt)
  {
    if (evt) {
      if (evt.stopPropagation) {
        evt.stopPropagation();
      }
      else  {
        evt.cancelBubble  = true;
      }
    }
  }
}

function vappaddevent(elem, event, func, bind, param)
{
  if (elem && func) {
    var boundfunc = (bind || param) ? function(evt){func.apply(bind, [evt, param]);} : func;
    if (!elem.vappevents) {
      elem.vappevents = {};
    }
    if (!elem.vappevents[event]) {
      elem.vappevents[event] = [];
    }
    else {
      var elemevents = elem.vappevents[event];
      for (var i = 0, len = elemevents.length; i < len; i++) {
        if (elemevents[i] == func) {
          return;
        }
      }
    }
    elem.vappevents[event].push(func);
    if (elem.addEventListener) {
      elem.addEventListener(event, boundfunc, false);
      return boundfunc;
    }
    else if (elem.attachEvent){
      elem.attachEvent("on"+event, boundfunc);
      return boundfunc;
    }
  }
}

function vappremoveevent(elem, event, func)
{
  if (elem && func) {
    if (elem.vappevents && elem.vappevents[event]) {
      var elemevents = elem.vappevents[event];
      for (var i = 0, len = elemevents.length; i < len; i++) {
        if (elemevents[i] == func) {
          elemevents.splice(i, 1);
          break;
        }
      }
    }
    if (elem.removeEventListener) {
      elem.removeEventListener(event, func, false);
      return true;
    }
    else if (elem.detachEvent){
      elem.detachEvent("on"+event, func);
      return true;
    }
  }
}

function vappfireonchange(elem)
{
  if (g_isie) {
    elem.fireEvent("onchange");
  }
  else {
    var e = document.createEvent("HTMLEvents");
    e.initEvent("change", false, false);
    elem.dispatchEvent(e);
  }
}

function vappgettarget(evt)
{
  if (!evt) {
    evt = window.event;
  }
  return (evt.target) ? evt.target : evt.srcElement;
}

//------------------------------------------------------------------------------
// handling multiple css classes
function vappaddclass(elem, classname)
{
  if (elem && !vapphasclass(elem, classname)) {
    var elemclass = elem.className;
    elem.className = (elemclass) ? elemclass+" "+classname : classname;
  }
}

function vappremoveclass(elem, classname)
{
  var foundclass = false;
  if (elem) {
    var elemclass = elem.className,
        classes;
    if (elemclass) {
      if (elemclass === classname) {
        elem.className = "";
        foundclass = true;
      }
      else {
        classes = elemclass.split(" ");
        for (var idx=0, len=classes.length; idx<len; idx++) {
          if (classes[idx]==classname) {
            classes.splice(idx, 1);
            foundclass = true;
            break;
          }
        }
        elem.className = classes.join(" ");
      }
    }
  }
  return foundclass;
}

function vapphasclass(elem, classname)
{
  if (elem) {
    var elemclass = elem.className;
    if (elemclass) {
      if (elemclass === classname) {
        return true;
      }
      var classes = elemclass.split(" ");
      for (var idx=0, len=classes.length; idx<len; idx++) {
        if (classes[idx]==classname) {
          return true;
        }
      }
    }
  }
  return false;
}

//------------------------------------------------------------------------------
// helper functions
function vappgetnumber(str)
{
  if (str) {
    if ((""+str).indexOf("px")>0) {
      str = str.split("px")[0];
    }
    var number = parseInt(str);
    return (isNaN(number)) ? 0 : number;
  }
  return 0;
}

// elem: DOM-Element
// style: CSS-style CamelCase
function vappgetstyle(elem, style)
{
  var result = false,
      styles = {
        backgroundColor   : "background-color",
        borderBottomWidth : "border-bottom-width",
        borderLeftWidth   : "border-left-width",
        borderRightWidth  : "border-right-width",
        borderTopWidth    : "border-top-width",
        marginBottom      : "margin-bottom",
        marginLeft        : "margin-left",
        marginRight       : "margin-right",
        marginTop         : "margin-top",
        paddingBottom     : "padding-bottom",
        paddingLeft       : "padding-left",
        paddingRight      : "padding-right",
        paddingTop        : "padding-top"
      };

  if (elem && elem.style) {
    if (elem.style[style]) {
      result = elem.style[style];
    }
    else if (elem.currentStyle) { // IE
      result = elem.currentStyle[style];
    }
    else if (window.getComputedStyle) { // FF
      if (styles[style]) {
        style = (styles[style]);
      }
      result = window.getComputedStyle(elem, null).getPropertyValue(style);
    } 
  }
  return result;
}

function vappgetmargintopbtm(elem)
{
  return vappgetnumber(vappgetstyle(elem, "marginTop")) + vappgetnumber(vappgetstyle(elem, "marginBottom"));
}

function vappcleartimeout(timeout)
{
  if (timeout) {
    window.clearTimeout(timeout);
  }
}

function vappsetopacity(obj, val, jqstop)
{
  if (obj) {
    if (fscjq && jqstop) {
      fscjq(obj).stop();
    }
    if (!g_isie) {
      obj.style.opacity = val;
    }
    else {
      obj.style.filter = "alpha(opacity="+val*100+")";
    }
    obj.style.display = (val == 0) ? "none" : "";
  }
}

function vappistextselected()
{
  if (window.document.selection) {
    return window.document.selection.type=="Text";
  }
  return (""+window.getSelection()).length;
}

function vappclearselection(elem)
{
  if (!vappiseditableelem(elem)) {
    try {
      if (g_ismoz) {
        window.getSelection().removeAllRanges();
      }
      else if (window.document.selection) {
        window.document.selection.empty();
      }
    }
    catch (e) { }
  }
}

function vappgetkeystring(keycode)
{
  if (keycode==186) { //
    return String.fromCharCode(220);
  }
  if (keycode==192) { //
    return String.fromCharCode(214);
  }
  if (keycode==222 ) { //
    return String.fromCharCode(196);
  }
  return String.fromCharCode(keycode);
}

function vappgetplaintext(htm)
{
  if (htm) {
    var div = document.createElement("div");
    div.innerHTML = htm;
    return div.innerText;
  }
  return "";
}

function vapppopid(id, count, delimeter)
{
  if (id) {
    if (!delimeter) {
      delimeter = "_";
    }
    var idparts = id.split(delimeter);
    idparts.length-= (null!=count) ? count : 1;
    return idparts.join(delimeter);
  }
}

function vappaddhtmlbreaks(str)
{
  return (str) ? str.split("\n").join("<br/>") : null;
}

function vappstrtrim(str)
{
  return str.replace(/^\s+|\s+$/g, "");
}

function vappstrendswith(src, searchstr)
{
  return (src.lastIndexOf(searchstr)==src.length-searchstr.length);
}

function vappgetimgname(img)
{
  return (img) ? vappgetimgnamebysrc(img.src) : null;
}

function vappgetimgnamebysrc(src)
{
  if (src) {
    var imgparts = src.split("/");
    imgparts = imgparts[imgparts.length-1].split(".");
    imgparts.pop();
    return imgparts.join(".");
  }
}

function vappgettoptag()
{
  return g_ismoz ? window : document.body;
}

//------------------------------------------------------------------------------
// pagebusy
function vappsetpagebusy(value, context)
{
  if (!context) {
    context = vappinitstrudl(true);
  }
  if (g_pagebusy != value) {
    vappstrudldetailevtinfo(context, FSCVAPP_PAGEBUSY, value.toString());
    g_pagebusy = value;
  }
  else {
    vappstrudldetailevtinfo(context, FSCVAPP_PAGEBUSY, value.toString() + " (no change)");
  }
  if (!value) {
    vappaccrefreshvirtualbuffer();
    context = vappstrudlresetctx();
  }
  return context;
}var vappcolor={getvalues:function vappcolor_getvalues(c){if(typeof c=="object"){if(c.length==3){return c}else{if(c.B!="undefined"){return[c.R,c.G,c.B]}}}else{if(typeof c=="string"){c=c.toLowerCase();if(c[0]=="#"){var f=parseInt(c.substr(1,2),16),e=parseInt(c.substr(3,2),16),b=parseInt(c.substr(5,2),16);return[f,e,b]}else{if(c.indexOf("rgb")>=0){var a=c.indexOf("(")+1,g=c.indexOf(")")-a,d;c=c.substr(a,g);d=c.split(",");if(d.length>=3){return[parseInt(d[0]),parseInt(d[1]),parseInt(d[2])]}}else{return this.getvalues(parseInt(c))}}}else{if(typeof c=="number"){var f=c>>16,e=(c&65280)>>8,b=(c&255);return[f,e,b]}}}},gethex:function vappcolor_gethex(a){if(typeof a=="string"&&a[0]=="#"){return a}else{if(a=this.getvalues(a)){var d="#",c;for(var b=0;b<3;b++){c=a[b].toString(16);d+=(c.length==2)?c:"0"+c}return d}}},getint:function vappcolor_getint(a){if(a=this.getvalues(a)){return parseInt(a[0]<<16)+(a[1]<<8)+(a[2])}},getbrightness:function vappcolor_getbrightness(a){if(a=this.getvalues(a)){return((a[0]*299)+(a[1]*587)+(a[2]*114))/1000}},isdark:function vappcolor_isdark(a){return(this.getbrightness(a)<125)},getfontcolor:function vappcolor_getfontcolor(a){return(this.isdark(a))?g_vappcolor.fontinverse:g_vappcolor.font},blend:function vappcolor_blend(c,a,b){c=this.getvalues(c);a=this.getvalues(a);if(c&&a&&b>=0<=100){var g,e=[],f;for(var d=0;d<3;d++){g=(c[d]*(100-b)+a[d]*b)/100;g=(g<=255)?g-g%1:255;g=(g>=0)?g:0;e.push(g)}return this.gethex(e)}},blendwhite:function vappcolor_blendwhite(b,a){return this.blend(b,[255,255,255],a)},blendblack:function vappcolor_blendblack(b,a){return this.blend(b,[0,0,0],a)},getgradient:function vappcolor_getgradient(b){var e,d;if(g_issafari){e="-webkit-gradient(linear";e+=(b)?",left top,left bottom":",left top,right top";for(var c=1,a=arguments.length;c<a;c++){d=arguments[c];if(d.length==2){e+=",color-stop("+(d[1]/100)+","+this.gethex(d[0])+")"}}e+=")"}else{if(g_ismoz){e="-moz-linear-gradient(";e+=(b)?"top":"left";for(var c=1,a=arguments.length;c<a;c++){d=arguments[c];if(d.length==2){e+=","+this.gethex(d[0])+" "+d[1]+"%"}}e+=")"}}return e},getlineargradient:function vappcolor_getlineargradient(b,a){return vappcolor.getgradient(true,[b,0],[a,100])},getsteppedgradient:function vappcolor_getsteppedgradient(a){return vappcolor.getgradient(true,[vappcolor.blendblack(a,2),49],[vappcolor.blendblack(a,7),50],[a,100])}};if(g_ismoz&&!g_issafari&&!window.g_vappmoztoieinited){extendEventObject();emulateAttachEvent();emulateEventHandlers(["click","dblclick","contextmenu","mousedown","mouseup","mouseover","mouseout","mousemove","keydown","keyup","keypress","change","blur","focus"]);emulateHTMLModel();extendElementModel();emulateAllModel();Event.LEFT=1;Event.MIDDLE=2;Event.RIGHT=3;window.g_vappmoztoieinited=true}function extendEventObject(){Event.prototype.__defineSetter__("returnValue",function(a){if(!a){this.preventDefault()}return a});Event.prototype.__defineSetter__("cancelBubble",function(a){if(a){this.stopPropagation()}this.cancelBubbleValue=a;return a});Event.prototype.__defineGetter__("cancelBubble",function(){if(this.cancelBubbleValue){return this.cancelBubbleValue}return false});Event.prototype.__defineGetter__("srcElement",function(){var a=this.target;try{while(a&&a.nodeType!=1){a=a.parentNode}}catch(b){}return a});Event.prototype.__defineGetter__("toElement",function(){var b;if(this.type=="mouseout"){b=this.relatedTarget}else{if(this.type=="mouseover"){b=this.target}}if(!b){return}try{while(b.nodeType!=1){b=b.parentNode}}catch(a){}return b});Event.prototype.__defineGetter__("offsetX",function(){return this.layerX});Event.prototype.__defineGetter__("offsetY",function(){return this.layerY});Event.prototype.__defineGetter__("button",function(){return this.which});Event.prototype.__defineSetter__("button",function(a){if(a>0){a--}this.initMouseEvent("click",true,true,this.view,1,this.screenX,this.screenY,this.clientX,this.clientY,this.ctrlKey,this.altKey,this.shiftKey,this.metaKey,a,this.relatedTarget)})}function emulateAttachEvent(){HTMLDocument.prototype.attachEvent=HTMLElement.prototype.attachEvent=function(c,b){var a=c.replace(/on/,"");b._ieEmuEventHandler=function(d){window.event=d;return b()};this.addEventListener(a,b._ieEmuEventHandler,false)};HTMLDocument.prototype.detachEvent=HTMLElement.prototype.detachEvent=function(c,b){var a=c.replace(/on/,"");if(typeof b._ieEmuEventHandler=="function"){this.removeEventListener(a,b._ieEmuEventHandler,false)}else{this.removeEventListener(a,b,true)}};HTMLDocument.prototype.createEventObject=function(a){var b=this.createEvent(a);if(a=="MouseEvents"){b.initMouseEvent("click",true,true,this.defaultView,1,b.screenX,b.screenY,b.clientX,b.clientY,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,b.button>2?0:b.button,b.relatedTarget)}return b}}function emulateEventHandlers(b){for(var a=0;a<b.length;a++){document.addEventListener(b[a],function(c){window.event=c},true)}}function emulateAllModel(){var a=function(){var b=this.getElementsByTagName("*");var c=this;b.tags=function(d){return c.getElementsByTagName(d)};return b};HTMLDocument.prototype.__defineGetter__("all",a);HTMLElement.prototype.__defineGetter__("all",a)}function extendElementModel(){var a=function(){if(this.parentNode==this.ownerDocument){return null}return this.parentNode};HTMLElement.prototype.__defineGetter__("parentElement",a);HTMLDocument.prototype.__defineGetter__("parentElement",a);var b=function(){var f=[];var d=0;var g;try{for(var e=0;e<this.childNodes.length;e++){g=this.childNodes[e];if(g.nodeType==1){f[d++]=g;if(g.name){if(!f[g.name]){f[g.name]=[]}f[g.name][f[g.name].length]=g}if(g.id){f[g.id]=g}}}}catch(c){}return f};HTMLElement.prototype.__defineGetter__("children",b);HTMLDocument.prototype.__defineGetter__("children",b);HTMLElement.prototype.click=HTMLAnchorElement.prototype.click=function(){var c=this.ownerDocument.createEvent("MouseEvents");c.initMouseEvent("click",true,true,this.ownerDocument.defaultView,1,0,0,0,0,false,false,false,false,0,null);this.dispatchEvent(c)};HTMLElement.prototype.fireEvent=function(c,d){var e=false;if(!d){if(c.match(".*mouse.*")||c.match(".*click")){d=this.ownerDocument.createEvent("MouseEvents");e=true}else{d=this.ownerDocument.createEvent("HTMLEvents")}}if(e){d.initMouseEvent(c.slice(2),true,true,this.ownerDocument.defaultView,1,d.screenX,d.screenY,d.clientX,d.clientY,d.ctrlKey,d.altKey,d.shiftKey,d.metaKey,d.button,d.relatedTarget)}else{d.initEvent(c.slice(2),false,false)}this.dispatchEvent(d)};HTMLElement.prototype.releaseCapture=function(){return true};Element.prototype.__defineGetter__("text",function(){return this.textContent});XMLDocument.prototype.__defineGetter__("_fsc_firstChild",XMLDocument.prototype.__lookupGetter__("firstChild"));if(!XMLDocument.prototype.__lookupGetter__("xml")){XMLDocument.prototype.__defineGetter__("xml",function(){var d=new XMLSerializer();var c="";try{c=d.serializeToString(this)}catch(f){}return c})}XMLDocument.prototype.__defineGetter__("_fsc_xml",XMLDocument.prototype.__lookupGetter__("xml"));Element.prototype.__defineGetter__("_fsc_nextSibling",Element.prototype.__lookupGetter__("nextSibling"));XMLDocument.prototype.createNode=function(d,c,e){switch(d){case 1:return this.createElementNS(e,c);default:return null}};XMLDocument.prototype.__defineGetter__("firstChild",function(){var c=this.createElement("xml");c.setAttribute("version",this.xmlVersion);c.setAttribute("encoding",this.xmlEncoding);
c.setAttribute("portable_fsc_isfirstxml","ok");c.portable_fsc_xmldoc=this._fsc_firstChild;return c});XMLDocument.prototype.__defineGetter__("xml",function(){var c="<?xml";c+=this.xmlVersion?' version="'+this.xmlVersion+'"':"";c+=this.xmlEncoding?' encoding="'+this.xmlEncoding+'"':"";c+=" ?>";c+=this._fsc_xml;return c});Element.prototype.__defineGetter__("nextSibling",function(){var c;if(this.attributes.portable_fsc_isfirstxml&&this.attributes.portable_fsc_isfirstxml.value=="ok"){c=this.portable_fsc_xmldoc}else{c=this._fsc_nextSibling}return c});Text.prototype.__defineGetter__("text",function(){return this.nodeValue});Text.prototype.__defineSetter__("text",function(c){this.nodeValue=c});Element.prototype.__defineSetter__("text",function(e){var c=null;for(var d=0;d<this.childNodes.length;d++){if(this.childNodes[d].nodeName=="#text"){c=this.childNodes[d]}}if(!c){c=this.ownerDocument.createTextNode(e);this.appendChild(c)}else{c.nodeValue=e}})}function emulateHTMLModel(){function b(c){c=c.replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<BR>");while(/\s\s/.test(c)){c=c.replace(/\s\s/,"&nbsp; ")}return c.replace(/\s/g," ")}HTMLElement.prototype.insertAdjacentHTML=function(e,d){var f;var c=this.ownerDocument.createRange();switch(String(e).toLowerCase()){case"beforebegin":c.setStartBefore(this);f=c.createContextualFragment(d);this.parentNode.insertBefore(f,this);break;case"afterbegin":c.selectNodeContents(this);c.collapse(true);f=c.createContextualFragment(d);this.insertBefore(f,this.firstChild);break;case"beforeend":c.selectNodeContents(this);c.collapse(false);f=c.createContextualFragment(d);this.appendChild(f);break;case"afterend":c.setStartAfter(this);f=c.createContextualFragment(d);this.parentNode.insertBefore(f,this.nextSibling);break}};HTMLElement.prototype.insertAdjacentElement=function(d,c){switch(String(d).toLowerCase()){case"beforebegin":this.parentNode.insertBefore(c,this);break;case"afterbegin":this.insertBefore(c,this.firstChild);break;case"beforeend":this.appendChild(c);break;case"afterend":this.parentNode.insertBefore(c,this.nextSibling);break}};HTMLElement.prototype.__defineSetter__("outerHTML",function(d){var c=this.ownerDocument.createRange();c.setStartBefore(this);var e=c.createContextualFragment(d);this.parentNode.replaceChild(e,this);return d});HTMLElement.prototype.__defineGetter__("canHaveChildren",function(){switch(this.tagName){case"AREA":case"BASE":case"BASEFONT":case"COL":case"FRAME":case"HR":case"IMG":case"BR":case"INPUT":case"ISINDEX":case"LINK":case"META":case"PARAM":return false}return true});HTMLElement.prototype.__defineGetter__("outerHTML",function(){var c,d=this.attributes;var f="<"+this.tagName;for(var e=0;e<d.length;e++){c=d[e];if(c.specified){f+=" "+c.name+'="'+c.value+'"'}}if(!this.canHaveChildren){return f+">"}return f+">"+this.innerHTML+"</"+this.tagName+">"});HTMLElement.prototype.__defineSetter__("innerText",function(c){this.innerHTML=b(c);return c});var a;HTMLElement.prototype.__defineGetter__("innerText",a=function(){var c=this.ownerDocument.createRange();c.selectNodeContents(this);return c.toString()})};/*------------------------------------------------------------------------------
Copyright (c) Fabasoft R&D Software GmbH & Co KG, A-4020 Linz, 1995-2006.
 
Alle Rechte vorbehalten. Alle verwendeten Hard- und Softwarenamen sind
Handelsnamen und/oder Marken der jeweiligen Hersteller.
 
Der Nutzer des Computerprogramms anerkennt, dass der oben stehende
Copyright-Vermerk im Sinn des Welturheberrechtsabkommens an der vom
Urheber festgelegten Stelle in der Funktion des Computerprogramms
angebracht bleibt, um den Vorbehalt des Urheberrechtes genuegend zum
Ausdruck zu bringen. Dieser Urheberrechtsvermerk darf weder vom Kunden,
Nutzer und/oder von Dritten entfernt, veraendert oder disloziert werden.
 -----------------------------------------------------------------------------*/

function vappinit(portlet)
{
  if (portlet) {
    var portletid = portlet.GetId();
    
    vappexeconload(portletid);
    vappdestroyfscsb();
    vappinitevent(portlet);
    vappadjustlayout(portletid, portlet, true);
  }
}

//------------------------------------------------------------------------------
// focus
function vappgetfocustarget(container)
{
  if (container) {
    var focustarget = container.getElementsByTagName("TEXTAREA")[0],
        elems = container.getElementsByTagName("INPUT");
    for (var idx=0, len=elems.length; idx<len; idx++) {
      var element = elems[idx],
          type = element.type,
          targetcandidate = null;
      if (type=="hidden") {
        targetcandidate = vappgetlisttabbyinput(element);
        if (!targetcandidate) {
          var sbid = vappgetsbid(element.id);
          if (sbid) {
            var sb = vappgetsb(sbid);
            if (vappisselectbox(sb)) {
              targetcandidate = sb;
            }
            else {
              var inst = window.document.getElementById("Inst"+sbid.substr(1));
              targetcandidate = vappgetinstoption(inst);
            }
          }
        }
      }
      else if (type!="button" && !vappgetparentbyclassname(element, "FscNavigation", 4) && !vappissbinput(element)) {
        targetcandidate = element;
      }
      if (targetcandidate) {
        if (focustarget) {
          var ftidparts = focustarget.name.split("_"),
              elemidparts = element.name.split("_"),
              ftcnt = ftidparts.length,
              elemcnt = elemidparts.length;
              
          for (var idx=1, cnt=(ftcnt<elemcnt) ? ftcnt : elemcnt; idx<cnt; idx++) {
            if (parseInt(elemidparts[idx])<parseInt(ftidparts[idx])) {
              focustarget = targetcandidate;
              break;
            }
          }
        }
        else {
          focustarget = targetcandidate;
        }
        break;
      }
    }
    if (!focustarget) {
      focustarget = container.getElementsByTagName("A")[0];
    }
    return focustarget;
  }
}

function vappgetlistidfromatag(atag)
{
  return (atag && atag.href) ? atag.href.split("#skip")[1] : null;
}

function vappfocus(elem, select)
{
  window.setTimeout(function() {
    vappfocusnow(elem, select);
  }, 0);
}

function vappfocusnow(elem, select)
{
  if (elem) {
    try {
      elem.focus();
      if (select && elem.tagName=="INPUT" && elem.type=="text") {
        elem.select();
      }
    }
    catch (e) {}
  }
}

function vappdeselectie()
{
  if (g_isie) {
    window.document.selection.empty();
  }
}

function vappwindowisforeground()
{
  if (g_vappstrudlexecutionid==null && g_isie && !window.g_isportlet) {
    try {
      var stub = vappgettoolmgr(false, 7060022);
      if (stub) {
        var hwndinfo = stub.GetHWNDInfo(window.document);
        return (hwndinfo.indexOf("foreground")>=0) ? true : false;
      }
    }
    catch (e) {
    }
  }
  return true;
}

//------------------------------------------------------------------------------
// layout
function vappresize(evt, ignoremain)
{
  if (!vappmenuhide()) {
    if (!vappspan_hide('fscs')) {
      vappcloseselectbox();
    }
  }

  for (var idx=0, len=g_vappportlets.length; idx<len; idx++) {
    var p = g_vappportlets[idx];
    vappadjustlayout(p.GetId(), p, false, ignoremain);
  }
  
  try {
    var container = (window.name=="fscdialog") ? window.document.body : window.frameElement;
    if (container) {
      var ax = vappgetargument("ax");
      if (ax) {
        vappsetcookie("fscdialog:"+ax, container.offsetWidth+"|"+container.offsetHeight);
      }
    }
  }
  catch (e) { }
}

function vappadjustlayout(portletid, portlet, isinit, ignoremain)
{
  if (!portletid) {
    portletid = vappgetcontainerid();
  }
  if (!portlet) {
    portlet = vappgetportlet(portletid);
  }
  
  var g_tabcontainer = vappgetg_tabcontainer(portletid);
  if (g_tabcontainer) {
    var tabcontainer = vappgetelementbyid("FscTabContainer", portletid);
    if (tabcontainer) {
      g_tabcontainer.AdjustTabs();
    }
    else {
      vappsetg_tabcontainer(null, portletid);
    }
  }
  
  var ismain = portlet.IsMainPortlet();
  if (!ismain && !isinit) {
    var resetscrollareas = vappgetresetscrollareas(portletid),
        idx = 0;
    if (resetscrollareas) {
      while (idx<resetscrollareas.length) {
        var area = resetscrollareas[idx];
        try {
          area.scrollTop = 0;
          area.scrollLeft = 0;
          idx++;
        }
        catch (e) {
          resetscrollareas.splice(idx, 1);
        }
      }
    }
  }
  
  if ((!ignoremain && ismain) || portlet.IsIframe()) {
    vappportalresize(isinit);
  }
  var resizeid = vappgetresizearea(portletid);
  if (resizeid) {
    vappresizeelem(vappgetelementbyid(resizeid, portletid), portletid, isinit);
  }
  vappexeconlayout(isinit, portletid);

  if (g_isie6 || g_isie7) {
    /*
     * adjust scrollable entry
     */
    var browserstate = vappgetbrowserstate(portletid);
    if (browserstate) {
      var scrollareas = browserstate.m_scrollareas;
      if (scrollareas) {
        for (var idx=0, len=scrollareas.length; idx<len; idx++) {
          vappadjustscrollentry(vappgetelementbyid(scrollareas[idx], portletid));
        }
      }
    }
  }
}

function vappadjustscrollentry(divtag)
{
  if (divtag && divtag.className=="FscEntryScroll") {
    var child = divtag.firstChild;
    if (child && child.offsetWidth>divtag.offsetWidth) {
      if (!divtag.getAttribute("hasscrollbar")) {
        var height = divtag.offsetHeight;
        divtag.style.height = height+vappgetscrollbarheight()+"px";
        divtag.setAttribute("hasscrollbar", true);
      }
    }
    else if (divtag.getAttribute("hasscrollbar")) {
      divtag.style.height = divtag.offsetHeight-vappgetscrollbarheight()+"px";
      divtag.removeAttribute("hasscrollbar");
    }
  }
}

function vappgetscrollbarheight()
{
  if (!g_vappscrollbarheight) {
    var elem = vappgethelperelem(true);
    elem.className = "FscScrollDummy";
    g_vappscrollbarheight = elem.offsetHeight - elem.clientHeight;
    elem.className = "FscHidden";
  }
  return g_vappscrollbarheight;
}

function vappgetemfactor()
{
  if (!g_vappemfactor) {
    var elem = vappgethelperelem(true);
    elem.className = "FscEmDummy";
    g_vappemfactor = elem.offsetHeight / 10;
    elem.className = "FscHidden";
  }
  return g_vappemfactor;
}

function vappresizeelem(resizeelem, portletid, isinit)
{
  try {
    var resizeparent = vappgetelementbyid("FscResizeParent", portletid);
    if (resizeelem && resizeparent) {
      var maxheight,
          container = window.document.getElementById(portletid),
          newheight;
      if (vappisoverlayapp(container)) {
        var captiontag = container.firstChild;
            captionheight = (captiontag && captiontag.className=="FscOverlayHead") ? captiontag.offsetHeight : 0;
        maxheight = container.offsetHeight - captionheight - 4; // 4px margins
      }
      else if (container && container.style.height) {
        maxheight = container.offsetHeight;
      }
      else if (!window.g_isportlet) {
        maxheight = vportgetparentheight(portletid, isinit);
      }
      if (null!=maxheight) {
        if (vapphasclass(resizeelem, "FscTabBody")) {
          maxheight -= 1; //border bottom width
        }
        var parentheight = resizeparent.offsetHeight,
            actheight = resizeelem.offsetHeight,
            diff = (parentheight>actheight) ? parentheight-maxheight : actheight-maxheight;
        newheight = actheight-diff;
        if (diff!=0) {
          resizeelem.style.height = (newheight>=0) ? newheight+"px" : "0px";
        }
      }
      if ((g_isie6 || g_isie7) && resizeelem.children.length==1) {
        // workaround to avoid unnecessary horizontal scrollbars
        var child = resizeelem.firstChild;
        if (child && child.className!="FscTree") {
          var width = resizeelem.offsetWidth;
          resizeelem.style.overflowX = (width<=child.offsetWidth) ? "" : "hidden";
          if (null!=newheight) {
            child.style.width = (child.offsetHeight>newheight) ? width-16+"px" : width+"px";
          }
        }
      }
    }
  }
  catch (e) {}
  return false;
}

//------------------------------------------------------------------------------
// export
function vappexport(url, win)
{
  win = win || window;
  win.vappnoconfirm = true;
  var fscp = win.vappgetiframe();
  fscp.src = url;
  window.setTimeout(function() {
    fscp.src = "";
    window.g_vappexportcount = 0;
  }, 300000);
  win.vappnoconfirm = false;
}

//------------------------------------------------------------------------------
// help
function vapphelpevt(evt)
{
  evt = vappevtgeneral(evt);
  if (!evt) {
    return false;
  }
  
  var helppath = (g_selection) ? g_selection.GetHelpPath() : null;
  if (helppath) {
    var fscp = window.document.getElementById("fscp");
    fscp.src = vappdavhead()+"/"+helppath+"/help.htm";
    fscp.onreadystatechange = function()
    {
      if (this.readyState=="complete") {
        var datatag  = g_selection.m_datatag;
            body = this.contentWindow.document.body,
            wdwwidth = body.firstChild.offsetWidth + 15,
            wdwheight = body.firstChild.offsetHeight + 15,
            wdwleft = vappgetleft(datatag),
            wdwtop = vappgettop(datatag) + 30,
            html = "<style>BODY,SPAN,INPUT,A,TABLE,TD,TR,P,SELECT,TEXTAREA,DIV { font-family:Arial;font-size:x-small; }</style>";

        html+= "<table style=\"background-color:#fafdd9;width:100%;text-align:center;\" border=\"1\"><tr><td><div style=\"overflow:auto;width:100%;height:100%\">";
        html+= body.innerHTML + "</div></td></tr></table>";
        wdwwidth = (wdwwidth<150) ? 150 : (wdwwidth>500) ? 500 : wdwwidth;
        wdwheight = (wdwheight<30) ? 30 : (wdwheight>300) ? 300 : wdwheight;
        
        if (fscp.style.visibility=="visible") {
          fscp.style.visibility = "hidden";
          fscp.src = "";
          fscp.onreadystatechange = null;
        }
        if (!window.g_fscpopup) {
          window.g_fscpopup=window.createPopup();
        }
        window.g_fscpopup.hide();
        window.g_fscpopup.document.body.innerHTML = html;
        window.g_fscpopup.show(wdwleft, wdwtop, wdwwidth, wdwheight, document.body);
      }
    }
  }
  else if (window.vapphelppath) {
    vappopenhelp(window.vapphelppath);
  }
  
  evt.cancelBubble = true;
  return false;
}

function vapphelp(file)
{
  file = file.split(".chm::").join("");
  var url = vappgetportleturl(vapphead()+"/fscasp/content/tmp/help/"+file);
  window.open(url, 'fschelp', 'location=no, menubar=no, resizable=yes, toolbar=no, scrollbars=yes');
  return false;
}

function vappopenhelp(helpurl) 
{
  var fscstub = vappgetplugin(true, null, FSC_USECASE.FSC_DAVEDIT),
      starturl = vapphead() + "/fscasp/content/tmp/help/" + helpurl;

  if (fscstub) {
    var dotsplitparts = helpurl.split("."),
        fileextension = dotsplitparts[dotsplitparts.length-1],
        fileobjname = dotsplitparts[dotsplitparts.length-2],
        fileoleclassid,
        filesize,
        fileverb = '',
        fileoperation = "read";

    if (fscstub.Supports && fscstub.Supports(FSC_USECASE.FSC_DAVEDIT)) {
      fscstub.DavEdit(starturl, vappsimplifyname(fileobjname, fileextension), fileextension, filesize, fileoperation);
    }
    else {
      vappenableprivilege(fscstub)("UniversalXPConnect");
      fscstub.DavEdit(starturl, vappsimplifyname(fileobjname, fileextension), fileextension, fileoleclassid, fileverb, fileoperation, filesize);
    }
  }
  else { 
    window.open(starturl, "_blank", "menubar=yes, toolbar=no, location=no, resizable=yes");
  }
  window.event.returnValue = false;
  window.event.cancelBubble = true;
  return false;
}

function vappcheckexpl(title)
{
  if (g_isctrl || g_isalt) {
    return vappka_toggle();
  }
  else {
    if (window.g_isportlet) {
      var portlet = vappgetportlet();
      if (portlet) {
        var source = "";
        if (portlet.GetFormPage()) {
          source = portlet.GetFormPage()+";";
        }
        if (portlet.GetAppView()) {
          source+= portlet.GetAppView()+";";
        }
        if (portlet.GetObjClass()) {
          source+= portlet.GetObjClass();
        }
        return vappctxhelp(source, title);
      }
    }
    return vapp(5008);
  }
}

function vappctxhelp(source, title)
{
  var helpurl = vappdavhead()+"/CALL?ACTION=COO.1.1001.1.156455&ARG1="+source+"&RES=ARG2";
  if (title) {
    helpurl+= "&ARG3="+encodeURIComponent(title);
  }
  var xmlhttp = new XMLHttpRequest();
  xmlhttp.open("GET", vappgetportleturl(helpurl), false);
  xmlhttp.send(null);
  var htm = xmlhttp.responseText;
  if (htm) {
    htm = htm.split("../tmp").join(vappgetg_tmppath());
    var infotag = window.event.srcElement;
    var helper = vappgethelperelem();
    var bodyhtm = htm.split("<body>")[1];
    if (bodyhtm) {
      bodyhtm = bodyhtm.split("</body>")[0];
    }
    helper.innerHTML = (bodyhtm) ? bodyhtm : htm;
    var width = helper.offsetWidth;
    if (width<300) {
      width = 300;
    }
    var height = helper.offsetHeight;
    if (height<200) {
      height = 200;
    }
    var top = vappgettop(infotag);
    var diff = screen.availHeight - (top + height);
    if (diff<0) {
      top = top + diff;
    }
    var left = vappgetleft(infotag);
    diff = screen.availWidth - (left + width);
    if (diff<0) {
      left = left + diff;
    }
    helper.innerHTML = "";
    var newwdw = window.open("", "", "top="+top+", left="+left+", width="+width+", height="+height+", location=no, menubar=no, resizable=yes, status=no, toolbar=no, scrollbars=yes");
    newwdw.document.write(htm);
    newwdw.document.close();
  }
  return false;
}

//------------------------------------------------------------------------------
// dialog
function vappgetdialogsettings(ax)
{
  var cookiedata = vappgetcookie("fscdialog:"+ax);
  return (cookiedata) ? cookiedata.split("|") : new Array();
}

function vappshowdialog(url, args, title, ax, width, height)
{
  var value;
  var ax = (!ax) ? vappgetargument("ax") : ax;
  var settings = vappgetdialogsettings(ax);
  var windowwidth  = "" + ((null!=settings[0]) ? settings[0] : (width) ? width : "500");
  var windowheight = "" + ((null!=settings[1]) ? settings[1] : (height) ? height: "500");
  
  if (windowwidth.indexOf("px")==-1 && windowwidth.indexOf("em")==-1) {
    windowwidth+="px";
  }
  if (windowheight.indexOf("px")==-1 && windowheight.indexOf("em")==-1) {
    windowheight+="px";
  }
  if (url.indexOf("http://")!=0 && url.indexOf("https://")!=0) {
    url="../"+url;
  }
  if (title) {
    url+="&dialogtitle="+encodeURIComponent(title);
  }
  if (window.showModalDialog) {
    if (!args) {
      args = "dialogHeight: "+windowheight+";dialogWidth: "+windowwidth+";center: Yes;help: No;resizable: Yes;status: No;";
    }
    value=window.showModalDialog(vappgetg_tmppath()+'/FSCVAPP_1_1001/rundialog.htm',url,args);
  }
  else {
    if (!args) {
      args = "height="+windowheight+",width="+windowwidth+",resizeable=no,status=no";
    }
    if (args.indexOf("modal")==-1) {
      args+=",modal=yes";
    }
    window.open(url, "fscdialog", args);
  }
  return value;
}

function vappclosedialog(value)
{
  if (window.parent) {
    window.parent.returnValue=value;
    window.parent.close();
  }
}

//------------------------------------------------------------------------------
// start application
function vappstartapp(arg,ax,newwindow,axprototype,listid,commit)
{
  var argdata = "",
      args = "",
      argobject, argparent, argindex, argview, argaction, argkey;
      
  if (arg) {
    argdata = (typeof(arg)=="string") ? arg.split(";") : arg;
    argobject = argdata[0];
    argparent = argdata[1];
    argindex = argdata[2];
    argview = argdata[3];
    argaction = argdata[4];
    argkey = argdata[5];
    
    if (!argparent) {
      argparent = null;
    }
    if (!argindex) {
      argindex = null;
    }
    if (!argview) {
      argview = null;
    }
  }

  if (newwindow && !vappiswbt()) {
    switch (axprototype) {
    default:
    case 'FSCVENV@1.1001:MenuPrototype':
      args+="&venv_object="+argobject+"&venv_parent="+argparent +"&venv_index="+argindex+"&venv_view="+argview;
      if (argaction) {
        args+="&venv_action="+argaction;
      }
      if (argkey) {
        args+="&venv_dynkey="+argkey;
      }
      break;
    case 'FSCVAPP@1.1001:MenuPrototype':
      args+="&sys_object="+argparent+"&sys_view="+argview+"&sys_selobjects=["+argobject+"]&sys_selindices=["+argindex+"]";
      if (argaction) {
        args+="&sys_action="+argaction;
      }
      if (argkey) {
        args+="&sys_dynkey="+argkey;
      }
    }
    if (commit) {
      args+="&commit=true";
    }

    var open_url=vappbaseurl()+"&ax="+ax+args+"&ru=javascript:window.close()";
    window.open(vapp24addurlparam(open_url), '', 'location=no, menubar=no, resizable=yes, toolbar=no, scrollbars=yes');
  }
  else {
    switch (axprototype) {
    default:
    case 'FSCVENV@1.1001:MenuPrototype':
      args+="("+argobject+","+argparent+","+argindex+","+argview+")";
      break;
    case 'FSCVAPP@1.1001:MenuPrototype':
      args+="("+argparent+",";     // sys_object

      if(argaction) {              // sys_action
        args+=argaction;
      }
      else {
        args+=null;
      }
      args+=","+argview+",["+argobject+"],["+argindex +"]";
      if(argkey) {
        args+=","+argkey;
      }
      args+=")";
      break;
    }
    vapp(5002,listid,"['"+ax+"','"+args+"']");
  }
}

//------------------------------------------------------------------------------
// events
function vappinitevent(portlet)
{
  var toptag = (portlet) ? window.document.getElementById(portlet.GetId()) : null;
  if (toptag) {
    var maintop = vappgettoptag(),
        id = toptag.id;
    if (portlet.IsThreepart()) {
      toptag.onmousedown = function(evt) {
        vappsetcontainer(id, false, evt);
        return vappmousedownbasic(evt);
      }
    }
    else {
      toptag.onmousedown = function(evt) {
        vappsetcontainer(id, false, evt);
        return vappmousedown(evt);
      }
    }
    toptag.onmouseup = vappmouseup;
    toptag.onmouseover = vappmouseover;
    toptag.onmousemove = vappmousemove;
    toptag.onmousewheel = vappmousewheel;
    toptag.ondblclick = vappdblclick;
    toptag.onselectstart = vappselectstart;
    toptag.ontouchstart = vappontouchstart;
    
    vappaddevent(toptag, (g_ismoz3) ? "draggesture" : "dragstart", vappdragstart);
    vappaddevent(toptag, (g_ismoz3) ? "dragdrop" : "drop", vappdrop, null, id);
    vappaddevent(toptag, "dragenter", vappdragover);
    vappaddevent(toptag, "dragover", vappdragover);

    if (g_ismoz) {
      maintop.onkeydown = vappkeydown;
    }
    else {
      toptag.onkeydown = function(evt) {
        vappsetcontainer(id, false, evt);
        return vappkeydown(evt);
      }
    }
    toptag.onkeyup = vappkeyup;
    toptag.onhelp = vapphelpevt;
    document.oncontextmenu = vappcontextmenu;
    if (!window.g_isportlet && !maintop.onresize) {
      maintop.onresize = vappresize;
    }
  }
}

function vappiseditableelem(elem)
{
  if (elem) {
    var tagname = elem.tagName;
    return (tagname=="TEXTAREA" || tagname=="INPUT" || tagname=="SELECT" || vappisselectbox(elem) || vappgetparentbyclassname(elem, "FSCDOX|FscSTC", 10));
  }
  return false;
}

function vappisident(elem)
{
  return (elem.tagName=="IMG" && (elem.getAttribute("fscargs") || elem.parentElement.className.indexOf("FscOL")==0));
}

function vappsetwindowstatus(statustext)
{
  if (statustext) {
    window.setTimeout(function() {
      window.status = statustext;
    }, 0);
    window.event.cancelBubble = true;
    window.event.returnValue = false;
  }
  else if (window.status) {
    window.status = "";
  }
}

function vappevtgeneral(evt)
{
  if (!evt) {
    evt = window.event;
  }
  if (evt.type!="keypress") {
    g_isshift = evt.shiftKey;
    g_isctrl = evt.ctrlKey;
    g_isalt = evt.altKey;
  }
  if (vappiswbt()) {
    top.wbtevt(window, evt);
  }
  vappexeconevt(evt);
  return (evt.cancelBubble) ? null : evt;
}

function vappmousedownbasic(evt)
{
  evt = vappevtgeneral(evt);
  if (!evt) {
    return false;
  }
  
  var evtsrc = vappevent.gettarget(evt);
  if (vappisinplaceediting()) {
    vappinplaceend(evt, evtsrc, true, true);
  }
  vappcloseselectbox(evtsrc);
  if (g_ismoz) {
    g_vappargs.Init(evtsrc);
    if (g_vappargs.CheckClientFlag("DRAGDROP")) {
      vappselsetobjects(g_vappargs);
      g_vappmozdragsrc = g_vappargs.GetStr();
    }
  }
  if (!vappmenuhide()) {
    if (!vappgetparentbyclassname(evtsrc, g_vapp_css["cal"]+"|FscQR", 10) && !vappiswbt()) {
      if (g_vappis24hrec) {
        vapp24checkandresetinfohints();
      }
      if (!vappspan_hide("fscm")) {
        vappspan_hide("fscs");
      }
    }
  }
  return evt;
}

function vappmousedown(evt)
{
  evt = vappmousedownbasic(evt);
  if (!evt) {
    return false;
  }
  
  var evtsrc = vappevent.gettarget(evt);
  if (!vappisident(evtsrc)) {
    vappselcheck(evtsrc);
  }
  if ((evt.button==1 || evt.button==0) && !vappiswbt()) {
    var listtablerow = vappgetmovablerow(evtsrc);
    if (listtablerow) {
      var listtable = vappgetparentbytagname(listtablerow, "|TABLE|", "|TABLE|");
      if (listtable && listtable.id && g_renderlater[listtable.id].IsOrder()) {
        g_dragrow = new VAPPDragRowAction(listtablerow, listtable);
      }
    }
  }
}

function vappmouseup(evt)
{
  evt = vappevtgeneral(evt);
  if (!evt) {
    return false;
  }
  
  var evtsrc = vappevent.gettarget(evt);
  if (vappisident(evtsrc)) {
    vappselcheck(evtsrc);
  }
  vappstoprowmove();
  if (g_ismoz) {
    g_vappmozdragsrc = "";
  }
  
  if (g_vappeditinplace === true && g_vappistimeout === false && !vappisinplaceediting() && vappgetlistrow(evtsrc)) {
    g_vappeditinplacetimeout = window.setTimeout(function() {
      g_vappistimeout = false;
      if (!vappisinplaceediting()) {
        vappinplacestart();
      }
    }, 350);
    evt.cancelBubble = true;
    g_vappistimeout = true;
    g_vappeditinplace = false;
  }
}

function vappmouseover(evt)
{
  evt = vappevtgeneral(evt);
  if (!evt) {
    return false;
  }
  
  var evtsrc = vappevent.gettarget(evt),
      islist = (vappgetparentbyclassname(evtsrc, "L", 3)),
      istree = (vappgetparentbyid(evtsrc, "fsctn", 3)),
      labeltag = vappgetparentbyclassname(evtsrc, "FscGridLabel", 3, "|TD|"),
      statustext;
  if (islist || istree || labeltag) {
    if (labeltag && g_isctrl) {
      var datatag = vappselgetdatatag(labeltag);
      if (datatag) {
        statustext = datatag.getAttribute("fscitemdesc");
      }
    }
    else {
      statustext = evtsrc.innerText;
    }
  }
  else {
    statustext = evtsrc.getAttribute("fscsttext");
  }
  vappsetwindowstatus(statustext);
  if (window.vapptooltips) {
    var obj;
    if (islist || istree || vappgetparentbyclassname(evtsrc, "FscOL", 2)) {
      g_vappargs.Init(evtsrc);
      obj = g_vappargs.GetObject();
    }
    vapptipreset(obj);
  }
}

function vappmousemove(evt)
{
  evt = vappevtgeneral(evt);
  if (!evt) {
    return false;
  }
  
  var evtsrc = vappevent.gettarget(evt);
  if (g_dragrow) {
    if (g_vappeditinplace === true) {
      g_vappeditinplace = false;
      window.clearTimeout(g_vappeditinplacetimeout);
      g_vappistimeout = false;
    }
    g_dragrow.Move(evtsrc);
  }
}

function vappmousewheel(evt)
{
  evt = vappevtgeneral(evt);
  if (!evt) {
    return false;
  }
  
  vappcloseselectbox(vappevent.gettarget(evt));
  vappspan_hide("fscs");
}

function vappdblclick(evt)
{
  evt = vappevtgeneral(evt);
  if (!evt) {
    return false;
  }
  
  var evtsrc = vappevent.gettarget(evt);
  g_vappargs.Init(evtsrc);
  vappclearselection(evtsrc);
  
  if (g_vappeditinplacetimeout) {
    window.clearTimeout(g_vappeditinplacetimeout);
    g_vappistimeout = false;
  }
  
  if (g_vappargs.CheckClientFlag("OPEN") && !evtsrc.ondblclick && !vappgetparentbyclassname(evtsrc, "FscDoNotOpen|FscRv|FscTree", 10)) {
    var tagname = evtsrc.tagName;
    if (tagname!="A" && tagname!="INPUT") {
      var atag = evtsrc.getElementsByTagName("A")[0];
      if (atag) {
        if (atag.className=="FscOpenHelper") {
          var confirmsettings = window.vappnoconfirm;
          window.vappnoconfirm = true;
          atag.click();
          window.vappnoconfirm = confirmsettings;
        }
        else {
          atag.click();
        }
        return false;
      }
      if (g_selection) {
        g_selection.ClearSelectionEventTimeout();
      }
      evt.cancelBubble = true;
      vappopenobject(g_vappargs, true);
      return false;
    }
  }
}

var g_vapptouchstart = 0,
    g_vapptapcount = 0;

function vappontouchstart(evt)
{
  if (evt.touches.length == 1) {
    var target = evt.target;

    if (vappgetlistrow(evt.target)) {
      g_vapptapcount = g_vapptapcount + 1;

      if (g_vapptapcount == 1) {
        g_vapptouchstart = new Date().getTime();
      }
      else if (g_vapptapcount == 2) {
        var delta = new Date().getTime() - g_vapptouchstart;

        if (delta < 500) {
          g_vapptapcount = 0;
          evt.preventDefault();
          return vappdblclick(evt);
        }
        else {
          g_vapptapcount = 1;
          g_vapptouchstart = new Date().getTime();
        }
      }
    }
  }
}

function vappselectstart(evt)
{
  evt = vappevtgeneral(evt);
  if (!evt) {
    return false;
  }
  
  if (g_isalt || g_isshift || g_isctrl) {
    if (!vappiseditableelem(vappevent.gettarget(evt))) {
      return false;
    }
  }
}

function vappinitfocusevt(container, tagname)
{
  var elems = container.getElementsByTagName(tagname);
  for (var idx=0, cnt=elems.length; idx<cnt; idx++) {
    if (g_ismoz) {
      elems[idx].addEventListener("focus", vappfocusevt, false);
    }
    else {
      elems[idx].attachEvent("onfocus", vappfocusevt);
    }
  }
}

function vappinitfocusevts()
{
  if (!vapphasfocusevts()) {
    var container = vappgetcontainer();
    if (container) {
      vappinitfocusevt(container, "INPUT");
      vappinitfocusevt(container, "A");
      vappinitfocusevt(container, "TEXTAREA");
      vappsethasfocusevts(container.id, true);
    }
  }
}

function vappfocusevt()
{
  if (g_vapptabbed) {
    vappselcheck(window.event.srcElement);
    g_vapptabbed = false;
  }
}

//------------------------------------------------------------------------------
// fscargs
var g_vappargs = new VAPPArgs();

function VAPPArgs(tag, argstr, srcelem, srcwdwid)
{
  this.m_args = new Array();
  this.m_listid = null;
  this.m_srcelem = null;
  this.m_srcwdwid = null;
  
  this.SetObject = function VAPPArgs_SetObject(val)               { this.m_args[0] = val; }
  this.SetParent = function VAPPArgs_SetParent(val)               { this.m_args[1] = val; }
  this.SetIdx = function VAPPArgs_SetIdx(val)                     { this.m_args[2] = val; }
  this.SetView = function VAPPArgs_SetView(val)                   { this.m_args[3] = val; }
  
  this.SetSelObj = function VAPPArgs_SetSelObj(val)
  {
    this.m_args[9] = val;
    if (!this.m_args[0] && val) {
      this.m_args[0] = val.split(",")[0];
    }
  }
  this.SetSelIdx = function VAPPArgs_SetSelIdx(val)
  {
    this.m_args[10] = val;
    if (!this.m_args[2] && val) {
      this.m_args[2] = val.split(",")[0];
    }
  }
  
  this.GetObject = function VAPPArgs_GetObject()            { return this.m_args[0]; }
  this.GetParent = function VAPPArgs_GetParent()            { return this.m_args[1]; }
  this.GetIdx = function VAPPArgs_GetIdx()                  { return this.m_args[2]; }
  this.GetView = function VAPPArgs_GetView()                { return this.m_args[3]; }
  this.GetDropFlag = function VAPPArgs_GetDropFlag()        { return this.m_args[5]; }
  
  this.GetSelObj = function VAPPArgs_GetSelObj()    { return (this.m_args[9]) ? this.m_args[9] : this.m_args[0]; }
  this.GetSelIdx = function VAPPArgs_GetSelIdx()    { return (this.m_args[10]) ? this.m_args[10] : this.m_args[2]; }
  this.GetSelView = function VAPPArgs_GetSelView()  { return this.m_args[7]; }

  this.GetListId = function VAPPArgs_GetListId()    { return this.m_listid; }
  this.GetArr = function VAPPArgs_GetArr()          { return this.m_args; }
  this.GetLen = function VAPPArgs_GetLen()          { return this.m_args.length; }
  this.GetStr = function VAPPArgs_GetStr()          { return this.m_args.join(";"); }
  
  this.IsReadOnly = function VAPPArgs_IsReadOnly()  { return this.m_args[4]=='0'; }
  this.IsTree = function VAPPArgs_IsTree()          { return this.m_args[6]=='1'; }
  this.IsPortal = function VAPPArgs_IsPortal()      { return this.m_args[0]=="portal"; }
  
  this.GetSrcElement = function VAPPArgs_GetSrcElement() { return this.m_srcelem; }
  this.GetSrcWdwId = function VAPPArgs_GetSrcWdwId()     { return this.m_srcwdwid; }
  
  this.GetVApp24Id = function VAPPArgs_GetVAppp24Id() { return (this.m_args[11]) ? this.m_args[11] : ""; }

  this.CheckClientFlag = function VAPPArgs_CheckClientFlag(action)
  {
    var clientflags = this.m_args[8];
    if (clientflags) {
      switch (action) {
        case "OPEN":         return clientflags & 16;
        case "CREATE":       return clientflags & 8;
        case "SEARCH":       return clientflags & 4;
        case "DRAGDROP":     return clientflags & 2;
        case "CONTEXTMENU":  return clientflags & 1;
      }
    }
    return false;
  }
  
  this.CheckSelLimit = function VAPPArgs_CheckSelLimit(limit)
  {
    var selobjs = this.GetSelObj();
    var selidx = this.GetSelIdx();
    if (selobjs && selidx) {
      selobjs = selobjs.split(",");
      if (selobjs.length>limit+1) {
        selobjs.length = limit;
        selidx = selidx.split(",");
        selidx.length = limit;
        this.SetSelObj(selobjs.join(","));
        this.SetSelIdx(selidx.join(","));
        return false;
      }
    }
    return true;
  }
  
  this.Update = function VAPPArgs_Update()
  {
    if (this.m_srcelem) {
      this.m_srcelem.setAttribute("fscargs", this.GetStr());
    }
  }
  
  this.Init = function VAPPArgs_Init(tag, argstr, srcelem, srcwdwid)
  {
    this.m_args = new Array();
    this.m_listid = null;
    this.m_srcelem = srcelem;
    this.m_srcwdwid = srcwdwid;

    if (tag) {
      var fscargs,
          isthumb = false,
          argselem = vappgetparentbyattribute(tag, "fscargs", 3);
      if (argselem) {
        fscargs = argselem.getAttribute("fscargs");
        isthumb = (argselem.className=="FscThumbList");
        this.m_srcelem = argselem;
      }
      else if (vapphasclass(tag, "L")) {
        var child = tag.firstChild;
        if (child && child.className=="FscOL") {
          fscargs = child.getAttribute("fscargs");
          this.m_srcelem = child;
        }
      }
      if (fscargs) {
        fscargs = fscargs.split(";");
        var tr = vappgetlistrow(tag);
        if (tr) {
          var trargs = tr.getAttribute("fsctrargs").split(","),
              tab = vappgetparentbyclassname(tr, "FscList", 6);
          this.m_listid = tab.id;
          
          if (fscargs.length<9) {
            fscargs.unshift(g_renderlater[this.m_listid].GetView());
            fscargs.unshift(trargs[0]);
            fscargs.unshift(vappgetportletobject());
            fscargs.unshift(trargs[1]);
          }
        }
        this.m_args = fscargs;
        if (isthumb) {
          this.SetObject(tag.src.split("/")[5]);
        }
      }
    }
    else if (argstr) {
      this.m_args = argstr.split(";");
    }
  }
  
  this.Init(tag, argstr, srcelem, srcwdwid);
}

//------------------------------------------------------------------------------
// branch actions
function vappsetbranchargs(p1, p2, p3, pid, formdata)
{
  if (formdata) {
    vapppushformdata(formdata, "p1", p1);
    vapppushformdata(formdata, "p2", p2);
    vapppushformdata(formdata, "p3", p3);
    return true;
  }
  else {
    var f = vappgetform(pid);
    if (f && f.s1.value) {
      f.p1.value = (null!=p1) ? p1 : "";
      f.p2.value = (null!=p2) ? p2 : "";
      f.p3.value = (null!=p3) ? p3 : "";
      return true;
    }
  }
}

function vappiscancelbranch(f, pid)
{
  var p1 = (f.p1) ? f.p1.value.split("#")[0] : "";
  return p1 && p1==vappgetg_cancelbranch(pid);
}

function vappbranchclick(evtsrc, targettag)
{
  if (evtsrc && evtsrc.getAttribute("onchange")) {
    g_vappreqfunc = targettag.onclick;
    evtsrc.onchange();
  }
  else {
    targettag.click();
  }
}

function vappdosubmit(f,branchid,dosubmit,pid)
{
  if (g_vappis24hrec) {
    if (g_vapp24dosubmitafteropen) {
      g_vapp24dosubmitafteropen = false;
      vapp24setopenwindowtimeout(function() { vappdosubmit(f,branchid,dosubmit,pid); });
      return;
    }
  }
  if (!vappiswbt()) {

    /*
     * if cardspace is active, the token may need refresh.
     *
    if (window.vappcspaceclaim) {
      if (!vappcardspacevalid(window.vappcspaceclaim)) {
        return false;
      }
    }
     */

    if (dosubmit) {
      window.vappnoconfirm = true;
    }
    vappexeconvapp(pid);

    try {
      if (!dosubmit) {
        if (!pid) {
          pid = vappgetcontainerid();
        }
        window.setTimeout(function() {
          SubmitToXmlRPC(null, pid, null, null, true);
        }, 0);
      }
      else {
        vappshowhourglass(pid);
        if (null==f) {
          f=vappgetform(pid);
        }
        f.submit();
      }
    }
    catch (e) {
      vapphidehourglass(pid);
    }
  }
  return false;
}

function vapp(p1,p2,p3,dosubmit,pid,ignoredirty)
{
  if (g_isdirty && !ignoredirty && !dosubmit) {
    if (g_vappchanging) {
      g_vappreqqueue = new Array(p1, p2, p3, pid);
    }
    return;
  }
  if (g_vappis24hrec) {
    vapp24handlekeyevent();
  }
  if (window.g_sc_hiddenarea) {
    vapp_sc_commit();
  }
  var browserstate = vappgetbrowserstate(pid);
  if (browserstate) {
    var evt = (p1==5003 || p1==5010) ? window.event : null,
        id = (p2 && !vappisinstantiate(p2)) ? "f"+p2 : null,
        istab = (p1==5002 && p2==null && parseInt(p3)>=0 && parseInt(p3)<=50);

    browserstate.SaveFocusTarget(id, evt);
    if (!istab) {
      browserstate.SaveScrollPos();
      browserstate.SaveInfo();
    }
  }
  if (p1==5010) {
    g_vappchanging = true;
  }
  var delayedbranches = vappgetg_delayedbranches(pid);
  if (delayedbranches) {
    p1+= "#"+delayedbranches;
    vappclearg_delayedbranches(pid);
  }
  if (!vappiswbt()) {
    if (vappsetbranchargs(p1, p2, p3, pid)) {
      return vappdosubmit(vappgetform(pid),p1,dosubmit,pid);
    }
  }
}

function vappctrlquick(p3, ctrl)
{
  var formdata = new Array();
  vapppushformdata(formdata, "s1", "1");
  vappctrl(null, p3, ctrl, vappgetheadpid(), true, formdata);
}

function vappctrlsimple(p2, p3)
{
  var form = vappgetform(),
      formdata = new Array();
  vapppushformdata(formdata, "s1", form.s1.value);
  vapppushformdata(formdata, "s2", form.s2.value);
  vapppushformdata(formdata, "s3", form.s3.value);
  vappctrl(p2, p3, null, null, false, formdata);
}

function vappctrl(p2, p3, ctrl, pid, ignoredirty, formdata)
{
  if (g_isdirty && !ignoredirty) {
    return;
  }
  if (!pid) {
    pid = (ctrl) ? ctrl.portletid : vappgetcontainerid();
  }
  if (!ctrl) {
    ctrl = (p2) ? p2+pid : pid;
  }
  if (vappsetbranchargs("5001", p2, p3, pid, formdata)) {
    if (typeof ctrl!="object") {
      ctrl = g_renderlater[vappgetportletid(ctrl, pid)];
    }
    if (ctrl) {
      var browserstate = vappgetbrowserstate(pid);
      if (browserstate) {
        browserstate.SaveScrollPos();
        browserstate.SaveInfo();
      }
      ctrl.SetRequestArgs(p2, p3);
      
      window.setTimeout(function() {
        if (formdata) {
          StartXmlRPC(null, formdata, null, false, pid, ctrl);
        }
        else {
          SubmitToXmlRPC(null, pid, null, ctrl);
        }
      }, 0);
    }
    return false;
  }
}

function vappov(p1,p2,p3)
{
  if (!g_isdirty && vappsetbranchargs(p1, p2, p3)) {
    windowargs = "overlay";
    if (g_issafari) {
      SubmitToXmlRPC(null, null, windowargs);
    }
    else {
      window.setTimeout(function() {
        SubmitToXmlRPC(null, null, windowargs);
      }, 0);
    }
  }
}

function vappgetfullscreenargs()
{
  var args = "fullscreen=yes, width="+screen.availWidth+"px, resizable=false, location=no, menubar=no, scrollbars=no, status=no, toolbar=no, ";
  return (g_issafari) ? args+"top=-10, left=-10, height="+(screen.availHeight-15)+"px" : args+"top=0, left=0, height="+screen.availHeight+"px";
}

function vappfullscreen(p1,p2,p3)
{
  if (!g_isdirty && vappsetbranchargs(p1, p2, p3)) {
    var windowargs = (!window.g_isportlet) ? vappgetfullscreenargs() : null;
    if (g_issafari) {
      SubmitToXmlRPC(null, null, windowargs);
    }
    else {
      window.setTimeout(function() {
        SubmitToXmlRPC(null, null, windowargs);
      }, 0);
    }
  }
}

function vappprint(p1,p2,p3)
{
  var page = vappgetpage();
  if (page) {
    page.PrintRender();
  }
  return false;
}

function vappopenobj()
{
  g_vappargs.Init(window.event.srcElement);
  vappopenobject(g_vappargs);
}

function vappopenobject(fscargs, dontcheck)
{
  if (dontcheck || fscargs.CheckClientFlag("OPEN")) {
    var openinnewwindow = g_isshift;
    var fscview = fscargs.GetSelView();
    if (fscview == "COO.1.1.1.1984" || fscview == "COO.1.1.1.7864") {
      openinnewwindow = true;
    }
    var listid = vappgetsimpleid(fscargs.GetListId());
    if (g_vappis24hrec) {
      var col = (g_selection) ? g_selection.GetListColumn() : 0;
      vapp24setinfo("Doubleclick", vapp24getportletid()+"_"+listid+"_"+fscargs.GetSelIdx()+"_"+col);
    }
    vappstartapp(fscargs.GetStr(),"COO.1.1001.1.38595",openinnewwindow,"FSCVAPP@1.1001:MenuPrototype",listid);
  }
}

function vappfeedback()
{
  if (false) {
    vappstrudlsubmit();
    var ax = "COO.1.1001.1.88262",
        portlet = vappgetportlet(),
        url = vappbaseurl()+"&ax="+ax+"&venv_sourceobj="+portlet.GetObject()+"&venv_app="+portlet.GetAppView()+"&venv_formpage="+portlet.GetFormPage()+"&ru=javascript:window.close()",
        settings = vappgetdialogsettings(ax),
        width = (settings[0]) ? settings[0] : 600,
        height = (settings[1]) ? settings[1] : 270;
    window.open(url, "fscdialog", "width="+width+", height="+height+", location=no, menubar=no, resizable=yes, status=yes, toolbar=no, scrollbars=yes");
  }
  else {
    vappstrudlsubmit();
    var context = vappstrudlcreatectx(true);
    strudl.env.report.imagename = va_lookpath+"/FSCVAPP_1_1001/" + "strudlapi.gif";

    vappsetstrings(["COO.1.1001.1.239530",
                    "COO.1.1001.1.239531",
                    "COO.1.1001.1.239532",
                    "COO.1.1001.1.239533",
                    "COO.1.1001.1.239534",
                    "COO.1.1001.1.239535",
                    "COO.1.1001.1.88266",
                    "COO.1.1001.1.88260"]);

    strudl.env.report.dialogtitle = vappgetstring("COO.1.1001.1.239530");
    strudl.env.report.dialogtext = vappgetstring("COO.1.1001.1.239531");
    strudl.env.report.dialogsubmittext = vappgetstring("COO.1.1001.1.88266");
    strudl.env.report.dialogcanceltooltip = vappgetstring("COO.1.1001.1.88260");

    strudl.env.report.filestitle = vappgetstring("COO.1.1001.1.239535");

    strudl.env.report.screenshot.enabled = true;
    strudl.env.report.screenshot.label = vappgetstring("COO.1.1001.1.239532");
    strudl.env.report.screenshot.previewlabel = vappgetstring("COO.1.1001.1.239533");

    strudl.env.report.softwareinfo.enabled = true;
    strudl.env.report.softwareinfo.label = vappgetstring("COO.1.1001.1.239534");
    strudl.env.report.softwareinfo.previewlabel = vappgetstring("COO.1.1001.1.239533");

    strudl.env.report.displaymetadata = true;
    strudl.env.report.metadatatitle = "";
    var metadata = {
      infos: [
        {name: "Name", value: g_vappuser[1]},
        {name: "Login", value: g_vappuser[2]}
      ]
    };
    strudl.ReportDialog(context, g_vappuser[0], "r"+vapprandomnumber(999999), "", null, metadata);
  }
}

function vappsendfeedback()
{
  var input = document.getElementsByName("f0_0")[0],
      title = (input) ? input.value : "";
  vappstrudlfeedback(title);
  vapp("next");
}

//------------------------------------------------------------------------------
// expand hidden elements (page branches or menus)
function vappelemover(container)
{
  if (!vapphasclass(container, "FscExpand")) {
    var width = container.offsetWidth;
    for (var parenttag=container; null!=parenttag; parenttag=parenttag.offsetParent) {
      var parentwidth = parenttag.offsetWidth;
      if (width>parentwidth) {
        var clonecontainer = container.cloneNode(true),
            pageheader = vappgetparentbyclassname(container, "FscPageHeader", 3);
        if (pageheader) {
          pageheader.style.overflow = "visible";
        }
        clonecontainer.onmouseover = null;
        clonecontainer.style.width = parentwidth + "px";
        vappaddclass(clonecontainer, "FscExpandChild");
        vappaddclass(container, "FscExpand");
        container.appendChild(clonecontainer);
        
        vappaddevent(document.body, "mousemove", function() {
          if (!vappischild(window.event.srcElement, container, 10)) {
            if (container) {
              container.removeChild(clonecontainer);
              vappremoveclass(container, "FscExpand");
            }
            vappremoveevent(document.body, "mousemove", arguments.callee);
            if (pageheader) {
              pageheader.style.overflow = "";
            }
          }
        });
        break;
      }
    }
  }
}

//------------------------------------------------------------------------------
// resizing elements
function VAPPResizeElement(evt, elem, col, sib, ishorizontal, dorescallback, endrescallback, minsize, maxsize)
{
  this.m_elem = elem;
  this.m_col = col;
  this.m_sib = sib;
  this.m_ishorizontal = ishorizontal;
  this.m_dorescallback = dorescallback;
  this.m_endrescallback = endrescallback;
  this.m_minsize = (null!=minsize) ? minsize : 0;
  this.m_maxsize = maxsize;
  this.m_pos = (ishorizontal) ? evt.clientX : evt.clientY;
  this.m_size = (ishorizontal) ? elem.offsetWidth : elem.offsetHeight;
  
  if (this.m_elem) {
    var toptag = vappgettoptag();
    vappaddevent(toptag, "mousemove", vappdoelemresize);
    vappaddevent(toptag, "mouseup", vappendelemresize);
    
    if (g_isie) {
      this.m_elem.setCapture();
    }
  }
  
  this.GetElem = function VAPPResizeElement_GetElem() { return this.m_elem; };
  this.GetSib = function VAPPResizeElement_GetSib()   { return this.m_sib; };
  this.GetPos = function VAPPResizeElement_GetPos()   { return this.m_pos; };
  this.GetSize = function VAPPResizeElement_GetSize() { return this.m_size; };
  this.IsHorizontal = function VAPPResizeElement_IsHorizontal() { return this.m_ishorizontal; };
  
  this.Move = function VAPPResizeElement_Move(evt)
  {
    if (g_ismoz) {
      window.getSelection().removeAllRanges();
    }
    var newpos;
    if (this.m_ishorizontal) {
      newpos = evt.clientX;
      var newsize = this.m_size - (this.m_pos - newpos);
      if (newsize > this.m_minsize && (null==this.m_maxsize || newsize < this.m_maxsize)) {
        this.m_elem.style.width = newsize + "px";
        if (this.m_col) {
          this.m_col.style.width = newsize + "px";
        }
        this.m_size = newsize;
        if (this.m_dorescallback) {
          this.m_dorescallback();
        }
      }
    }
    else {
      newpos = evt.clientY;
      var delta = this.m_pos - newpos,
          newsize = this.m_size - delta;
      if (newsize > this.m_minsize && (null==this.m_maxsize || newsize < this.m_maxsize)) {
        this.m_elem.style.height = newsize + "px";
        if (this.m_sib) {
          this.m_sib.style.height = this.m_sib.offsetHeight + delta + "px";
        }
        this.m_size = newsize;
        if (this.m_dorescallback) {
          this.m_dorescallback();
        }
      }
    }
    this.m_pos = newpos;
  };
  
  this.End = function VAPPResizeElement_End()
  {
    var toptag = vappgettoptag();
    vappremoveevent(toptag, "mousemove", vappdoelemresize);
    vappremoveevent(toptag, "mouseup", vappendelemresize);
    if (g_isie) {
      this.m_elem.releaseCapture();
    }
    if (this.m_endrescallback) {
      this.m_endrescallback(this.m_size);
    }
  };
}

function vappdoelemresize(evt)
{
  if (g_vappreselem) {
    if (!evt) {
      evt = window.event;
    }
    g_vappreselem.Move(evt);
  }
}

function vappendelemresize(callback)
{
  if (g_vappreselem) {
    g_vappreselem.End();
    delete g_vappreselem;
    g_vappreselem = null;
  }
}

//------------------------------------------------------------------------------
// tracing
function PrintTrace(prefix, msg)
{
  var plugin = vappgetplugin(false);
  if (plugin) {
    try {
      var lines = msg.split('\n');
      for (var idx=0, len=lines.length; idx<len; idx++) {
        plugin.Trace(prefix + lines[idx]);
      }
    }
    catch (e) {
    }
  }
  if (typeof window["console"] != "undefined") {
    console.log(prefix, msg);
  }
}

function TT(msg) 
{
  PrintTrace("",msg);
}

function TM(msg) 
{
  PrintTrace("Error: ",msg);
}

//------------------------------------------------------------------------------
// navigate for object in tree
function vapp_callnavigate(id,root,listexpr,targetattr,targetobj,targetclass,allroots,searchmode,ignorecompoundflag)
{
  if (searchmode==null) {
    searchmode = false;
  }
  if (searchmode) {
    id+= "_2";
  }
  if (ignorecompoundflag==null) {
    ignorecompoundflag = false;
  }
  var url = vappbaseurl()+"&ax=COO.1.1001.1.39120&sys_object="+root+"&listexpr="+listexpr+"&targetattr="+targetattr+"&targetobj="+targetobj;
  url+= "&targetclass="+targetclass+"&rootobjects="+allroots+"&searchmode="+searchmode+"&displayallobjects="+ignorecompoundflag;
  
  window.g_vappcallnavid = id;
  vappstartoverlayapp(url, 600, 450);
}

function vapp_processtreedialog(elem)
{
  g_vappargs.Init(elem);
  var obj = g_vappargs.GetObject(),
      text = elem.innerText,
      imgs = elem.getElementsByTagName("IMG"),
      icon = (imgs.length) ? vappgetimgname(imgs[0]) : null,
      portletid = vappgetcontainerid();

  vappsetcontainer(vappgetparentpid(), true);
  var ctrl = vappgetelementbyid(window.g_vappcallnavid);
  if (obj && vappisselectbox(ctrl)) {
    var elem = vappgetsboptionelem(obj, icon, text);
    vappchangesbvalue(null, elem, ctrl.id, true);
  }
  
  window.g_vappcallnavid = null;
  vapp("next", null, null, null, portletid);
  return false;
}

//------------------------------------------------------------------------------
// rpc's
function vappcallrpcbase(meth,postargs,showbusy,vappinnerfunction,davurl,arg1,arg2,arg3,arg4,arg5,arg6,arg7)
{
  if (!davurl) {
    return null;
  }
  
  var pid = vappgetcontainerid(),
      ctx = vappstrudlcreatectx(false);
  if (showbusy) {
    vappshowhourglass(pid);
    vappstrudllogevtenter(ctx, FSCVAPP_XMLRPC, "Action XML RPC", "", davurl);
    g_pagebusy = true;
  }
  else {
    vappstrudllogevtenter(ctx, FSCVAPP_XMLRPC, "Hidden Action XML RPC", "", davurl);
  }

  try {
    var xmlhttp = new XMLHttpRequest(),
        username = null,
        password = null,
        regexression = "/^[^\:]*:\/\/[^:]*:[^@]*@[^\/]*\//";
    if (davurl.match(regexression)) {
      var newurl = davurl.substr(0, davurl.indexOf("//")+2),
          credentials = davurl.substring(newurl.length, davurl.indexOf("@"));
      newurl += davurl.substr(davurl.indexOf("@", newurl.length)+1);
      credentials = decodeURI(credentials).split(":");
      username = credentials[0];
      password = credentials[1];
      davurl = newurl;
    }
    if (username && password) {
      xmlhttp.open(meth, davurl, true, username, password);
    }
    else {
      xmlhttp.open(meth, davurl, true);
    }
    strudl.SendXMLHttpRequest(xmlhttp, true, postargs, function (evt, strudlctx) {
      if (4 == xmlhttp.readyState) {
        var status = null;
        try {
          status = xmlhttp.status;
        }
        catch (e) { }
        if (status >= 200 && status < 300) {
          vappinnerfunction(xmlhttp.responseXML,xmlhttp.responseText,arg1,arg2,arg3,arg4,arg5,arg6,arg7,xmlhttp);
        }
        else if (vappiswbt() && status == 0) {
          var xmldocument = portable.createDOMDocument();
          xmldocument.loadXML(xmlhttp.responseText);
          vappinnerfunction(xmlhttp.responseXML,xmlhttp.responseText,arg1,arg2,arg3,arg4,arg5,arg7,xmlhttp);
        }
        if (showbusy && vappportletsready()) {
          vapphidehourglass(pid);
          g_pagebusy = false;
        }
        if (g_isie) {
          delete xmlhttp.onreadystatechange;
          xmlhttp = null;
        }
      }
    }, ctx);
  }
  catch (e) { }

  vappstrudllogevtleave(ctx, FSCVAPP_XMLRPC);
  vappstrudlreleasectx(ctx);
}

function vappcallrpc(vappinnerfunction,davurl,arg1,arg2,arg3,arg4,arg5,arg6,arg7)
{
  vappcallrpcbase("GET","",true,vappinnerfunction,davurl,arg1,arg2,arg3,arg4,arg5,arg6,arg7);
}

function vappcallhiddenrpc(vappinnerfunction,davurl,arg1,arg2,arg3,arg4,arg5,arg6,arg7)
{
  vappcallrpcbase("GET","",false,vappinnerfunction,davurl,arg1,arg2,arg3,arg4,arg5,arg6,arg7);
}

function vappcallpostrpc(vappinnerfunction,davurl,postargs,arg1,arg2,arg3,arg4,arg5,arg6,arg7)
{
  vappcallrpcbase("POST",postargs,true,vappinnerfunction,davurl,arg1,arg2,arg3,arg4,arg5,arg6,arg7);
}

function vappcallhiddenpostrpc(vappinnerfunction,davurl,postargs,arg1,arg2,arg3,arg4,arg5,arg6,arg7)
{
  vappcallrpcbase("POST",postargs,false,vappinnerfunction,davurl,arg1,arg2,arg3,arg4,arg5,arg6,arg7);
}

function vappcallsyncrpc(davurl, args, gettext, meth)
{
  if (!meth) {
    meth = "GET";
  }
  
  var response,
      ctx = vappstrudlcreatectx(false);
  vappstrudllogevtenter(ctx, FSCVAPP_XMLRPC, "Action XML RPC (sync)", "", davurl);
  
  try {
    var xmlhttp = new XMLHttpRequest();
    if (xmlhttp) {
      if (g_ismoz && !g_issafari && gettext) {
        xmlhttp.overrideMimeType("text/html");
      }
      xmlhttp.open(meth, davurl, false);
      strudl.SendXMLHttpRequest(xmlhttp, false, args, null, ctx);
      try {
        status = xmlhttp.status;
      }
      catch (e) {
      }
      if (g_openiderror.checkStatus(status)) {
        g_openiderror.reAuthenticate();
      }
      else {
        response = (gettext) ? xmlhttp.responseText : xmlhttp.responseXML;
      }
    }
    xmlhttp = null;
  }
  catch (e) { }
  
  vappstrudllogevtleave(ctx, FSCVAPP_XMLRPC);
  vappstrudlreleasectx(ctx);
  vappaccrefreshvirtualbuffer();
  return response;
}

function vappcallsyncpostrpc(davurl, args, gettext)
{
  return vappcallsyncrpc(davurl, args, gettext, "POST");
}

function vappcallsimplerpc(davurl)
{
  var ctx = vappstrudlcreatectx(false);
  vappstrudllogevtenter(ctx, FSCVAPP_XMLRPC, "Action XML RPC", "", davurl);
  
  var xmlhttp = new XMLHttpRequest();
  xmlhttp.open("GET", davurl, true);
  strudl.SendXMLHttpRequest(xmlhttp, true, null, null, ctx);
  
  vappstrudllogevtleave(ctx, FSCVAPP_XMLRPC);
  vappstrudlreleasectx(ctx);
}

//------------------------------------------------------------------------------
// plugins (new)
function vappsupportsplugin()
{
  return (g_issafari || g_ismoz) && g_ismac && (navigator.userAgent.indexOf("10_6")>=0 || navigator.userAgent.indexOf("10.6")>=0);
}

function vappgetplugin(showinstalldlg, minversion, usecase)
{
  if (null==showinstalldlg) {
    showinstalldlg = true;
  }

  var plugin = FscPluginGet();
  if (plugin) {
    if (plugin.Supports(usecase)) {
      g_vappstubversion = plugin.GetPluginVersion();
      plugin.SetClientVersion(g_serverversnr);
    }
    else {
      if (plugin = vappgettoolmgr(showinstalldlg, minversion)) {
        vappenableprivilege()("UniversalXPConnect");
        g_vappstubversion = plugin.versionnumber;
      }
      else {
        plugin = null;
      }
    }
  }
  
  if (plugin && !minversion || g_vappstubversion >= minversion) {
    return plugin;
  }
  else if (showinstalldlg) {
    if (g_ismac) {
      vappopenresourcedialog("FolioPlugins_v2.pkg", "Fabasoft Folio Plug-ins");
    }
    else if (g_islinux) {
      if (navigator.userAgent.indexOf("x86_64") >= 0) {
        vappopenresourcedialog("npfolioplugin_amd64.deb|npfolioplugin_x86_64.rpm", "Fabasoft Folio Plug-ins (Ubuntu)|Fabasoft Folio Plug-ins (Red Hat)");
      }
      else {
        vappopenresourcedialog("npfolioplugin_i386.deb|npfolioplugin_x86.rpm", "Fabasoft Folio Plug-ins (Ubuntu)|Fabasoft Folio Plug-ins (Red Hat)");
      }
    }
    else {
      vappopenresourcedialog("FolioPlugins.msi", "Fabasoft Folio Plug-ins");
    }
  }
  return null;
}

//------------------------------------------------------------------------------
// stubs (old)
function vappsetclientversion(stub)
{
  try {
    stub.SetClientVersion(g_serverversnr);
  }
  catch (e) { }
}

function vappsupportstoolmgr()
{
  return g_isie || (g_ismoz && !g_issafari && !g_isopera && !g_ismac);
}

function vapp_resourceget(progid,versionnumber,mozservicecontractid,mozservice)
{
  var stub;
  try {
    if (g_isie) {
      switch (progid.toLowerCase()) {
        case "fsc.data.open":
          stub = new ActiveXObject("Fsc.ToolMgr");
          vappsetclientversion(stub);
          stub = stub.linkMgr;
          break;
        case "fsc.data.send":
          stub = new ActiveXObject("Fsc.ToolMgr");
          vappsetclientversion(stub);
          stub = stub.sendMgr;
          break;
        case "fsc.data.import":
          stub = new ActiveXObject("Fsc.ToolMgr");
          vappsetclientversion(stub);
          stub = stub.importMgr;
          break;
        default:
          stub = new ActiveXObject(progid);
          if (progid == "Fsc.ToolMgr") {
            vappsetclientversion(stub);
          }
          break;
      }
    }
    else if (vappsupportstoolmgr()) {
      if (null == mozservice) {
        mozservice = Components.interfaces.fscIStubService;
      }
      if (null == mozservicecontractid) {
        mozservicecontractid = "@fabasoft.com/toolmgr/service;1";
      }
      vappenableprivilege()("UniversalXPConnect");     /* throws exception if folowing line is not set (prefs.js) */
      /* user_pref("signed.applets.codebase_principal_support", true);*/
      var stubclass = Components.classes[mozservicecontractid],
          stubservice = null;

      if (stubclass) {
        stubservice = stubclass.getService(mozservice);
        if (stubservice) {
          stub = stubservice.QueryInterface(mozservice);
        }
      }
    }
  }
  catch (e) {
  }
  if (stub && stub.versionnumber) {
    g_vappstubversion = stub.versionnumber;
    if (!versionnumber || g_vappstubversion<versionnumber) {
      stub = null;
    }
  }
  return stub;
}

function vapp_resource(progid,versionnumber,packname,packdescription,objectargs,validate,mozservicecontractid,mozservice)
{
  var stub=null,
      globalinstall = false;
  if ((g_issafari && !g_ismac) || g_isopera) {
    return null;
  }
  if (g_ismoz && progid == "FSC.PrintMgr") {
    alert("Function not available");
    return null;
  }
  var stub = vapp_resourceget(progid,versionnumber,mozservicecontractid,mozservice);
  if (!stub) {
    if (packname == "FolioPlugin") {
      packdescription = "Fabasoft Folio Plug-in for ";
      globalinstall = true;
    }
    else if (packname == "FolioPluginMobile") {
      packdescription = "Fabasoft Folio Sync Plug-in for ";
      globalinstall = true;
    }
    else if (packname == "FscCtlScanner2") {
      packdescription = "Fabasoft Folio Scanner Plug-in";
    }
    
    if (globalinstall && !g_islinux && !g_ismoz) {
      vappopenresourcedialog("FolioPlugins.msi", "Fabasoft Folio Plug-ins");
    }
    else if (g_ismoz && !g_ismac) {
      vapp_resourcemoz(packname,packdescription);
    }
    else if (g_isie) {
      vapp_resourceie(packname,packdescription);
      
      if (objectargs) {
        document.write("<object " + objectargs + "></object>");
      }
    }
  }
  return stub;
}

function vapp_resourcemoz(packname,packdescription)
{
  if (packname == "FolioPlugin" || packname == "FolioPluginMobile") {
    packdescription += "Mozilla Firefox";
    packname += "Firefox";
  }
  packname += (g_islinux) ? "Lnx32" : "Win32";
  packname += ".xpi";

  vappopenresourcedialog(packname, packdescription);
}

function vapp_resourceie(packname,packdescription)
{
  if (packname == "FolioPlugin" || packname == "FolioPluginMobile") {
    packdescription += "Microsoft Internet Explorer"
    packname += "IE32";
  }
  packname += ".msi";
  vappopenresourcedialog(packname, packdescription);
}

function vappopenresourcedialog(packname, packdescription)
{
  var appurl = vappbaseurl(true) + "&ax=COO.1.1001.1.39168&venv_packname=" + packname + "&venv_packdescription=" + packdescription,
      x = 660,
      y = 300;
  
  switch (vappfxbig) {
    case 1:
      x *= 1.2;
      y *= 1.25;
      break;
    case 2:
      x *= 1.4;
      y *= 1.5;
      break;
  }
  window.open(appurl, "_fscstub", "location=no, menubar=no, resizable=yes, toolbar=no, width="+x+", height="+y+", top=100, left=100");
}

function vappgettoolmgr(showinstalldlg, minstubversion)
{
  if (null==showinstalldlg) {
    showinstalldlg = true;
  }
  if (null==minstubversion) {
    minstubversion = 7020015;
  }
  if (g_ismoz || null==window.g_vappstub || (window.g_vappstub.versionnumber && window.g_vappstub.versionnumber<minstubversion)) {
    try {
      window.g_vappstub = (showinstalldlg) ? vapp_resource("Fsc.ToolMgr",minstubversion,"FolioPlugin") : vapp_resourceget("Fsc.ToolMgr",minstubversion);
    }
    catch (e) {
    }
  }
  return window.g_vappstub;
}

function vappgetmobilestub()
{
  if (!window.g_vappmobilestub) {
    window.g_vappmobilestub = vapp_resource("Fsc.MobileStub",9150009,"FolioPluginMobile",null,null,null,"@fabasoft.com/mobilestub/stub;1",((g_ismoz&&!g_issafari)?Components.interfaces.fscIMobileStub:null));
  }
  return window.g_vappmobilestub;
}

function vappgetshellstub(mobilestub)
{
  if (!window.g_vappshellstub) {
    if (!g_ismoz) {
      window.g_vappshellstub = vapp_resource("FSC.MobileShell",9150009,"FolioPluginMobile");
    } else {
      window.g_vappshellstub= mobilestub;
    }
  }
  return window.g_vappshellstub;
}

function vappgetscanstub()
{
  if (!window.g_vappscanstub) {
    window.g_vappscanstub = vapp_resource("FSCWebScanner.FSCWebScanner2Ctl",4090085,"FscCtlScanner2",null,null,null,"@fabasoft.com/webscan2/service;1",g_ismoz?Components.interfaces.fscIWebscan2:null);
  }
  return window.g_vappscanstub;
}

// for toolmanager use: vappenableprivilege()("UniversalXPConnect");
// if toolmanager or plugin possible: vappenableprivilege(plugin)("UniversalXPConnect");
// remove if only new plugin is used
function vappenableprivilege(plugin)
{
  if (window.netscape && (!plugin || !plugin.Supports)) {
    return window.netscape.security.PrivilegeManager.enablePrivilege;
  }
  else {
    return function(){};
  }
}

//------------------------------------------------------------------------------
// enable/disable browser back functionality
function vappdisableback()
{
  if (!window.vappdisabledback && !window.g_isportlet) {
    var cookie=vappgetcookie("vappenableback");
    if (cookie=="true") {
      if (navigator.cookieEnabled) {
        var now = new Date();
        document.cookie = "vappenableback=false; expires="+now.toGMTString()+"; path=/";
      }
    }
    else {
      history.forward();
    }
    window.vappdisabledback = true;
  }
}

function vappenableback()
{
  if (navigator.cookieEnabled) {
    document.cookie = "vappenableback=true; expires=Tue, 1 Jan 2999 00:00:00 GMT; path=/";
  }
}

function vappback()
{
  vappenableback();
  window.history.back()
  return false;
}

//------------------------------------------------------------------------------
// cookies
function vappgetcookie(cookiename)
{
  var cookiearray = document.cookie.split("; ");
  for (var i=0,len=cookiearray.length; i<len; i++) {
    var crumb = cookiearray[i].split("=");
    if (cookiename == crumb[0]) {
      return unescape(crumb[1]);
    }
  }
  return null;
}

function vappsetcookie(cookiename,value)
{
  try {
    if (null!=value) {
      document.cookie = ""+cookiename+"="+value+"; expires=Tue, 1 Jan 2999 00:00:00 GMT; path=/";
    }
  }
  catch (e) {
  }
}

//------------------------------------------------------------------------------
// close functions
function vappclosewindow(noconfirm)
{
  if (g_ismoz && vappsupportstoolmgr() && (!window.opener || window == window.opener)) {
    var fscstub = vappgettoolmgr(false);
    if (fscstub) {
      vappenableprivilege()("UniversalXPConnect");
      return fscstub.CloseMostRecentWindow2(window);
    }
  }
  var wdw = window.parent;
  if (noconfirm) {
    wdw.vappnoconfirm = true;
  }
  wdw.opener = window.parent;
  wdw.open('','_parent','');
  return wdw.close();
}

//------------------------------------------------------------------------------
// clipboard
function vappsetclipboardstrings(xmldictionary)
{
  var htmlbody,
      plainbody,
      richbody;
  var child = vappxmlgetdictionary(xmldictionary);
  if (child) {
    for (var child=child.firstChild; null!=child; child=child.nextSibling) {
      switch (child.nodeName) {
        case "htmlbody": htmlbody = child.text; break;
        case "plainbody": plainbody = child.text; break;
        case "richbody": richbody = child.text; break;
      }
    }
  }
  vapphtmltoclipboard(htmlbody, plainbody, richbody);
}

function vapphtmltoclipboard(htmlbody, plainbody, richbody)
{
  if (htmlbody || plainbody || richbody) {
    var fscstub = vappgettoolmgr(false);
    if (fscstub) {
      vappenableprivilege()("UniversalXPConnect");
      fscstub.HTMLToClipboard(htmlbody, richbody, plainbody);
    }
  }
}

function vappcopytoclipboard(args)
{
  if (args) {
    var davurl = vappgenxmlrpc("COO.1.1001.1.87756","","&INP=ARG1&RES=ARG2");
    vappcallpostrpc(vappsetclipboardstrings,davurl,args);
  }
}

function vapp_writeclipboard(objectadr, htmlstring, richstring, plainstring)
{
  if (objectadr) {
    var davurl=vappgenxmlrpc("COO.1.1001.1.38529","",""+objectadr),
        fscstub = vappgettoolmgr(false),
        currurl = vappbaseurl()+"&mx="+objectadr;
    
    vappcallrpc(vappempty, davurl);
    if (fscstub && (null!=htmlstring || null!=richstring || null!=plainstring)) {
      fscstub.HTMLToClipboard(htmlstring, richstring, plainstring);
    }
  }
}

//------------------------------------------------------------------------------
// busy symbol
function vappgethourglass(pid)
{
  var fschg = vappgetelementbyid("fschg", pid);
  if (!fschg && pid==vappgetheadpid()) {
    for (var idx=0, cnt=g_vappportlets.length; idx<cnt && !fschg; idx++) {
      fschg = vappgetelementbyid("fschg", g_vappportlets[idx].GetId());
    }
  }
  return fschg;
}

function vappshowhourglass(pid)
{
  g_isdirty = true;
  window.document.body.style.cursor = "wait";
  vappaddclass(vappgethourglass(pid), "FscBusy");
}

function vapphidehourglass(pid)
{
  g_isdirty = false;
  window.document.body.style.cursor = "";
  vappremoveclass(vappgethourglass(pid), "FscBusy");
}

//------------------------------------------------------------------------------
// tooltips
var vapptiptimeout;
var vapptiploading;

function vapptipreset(arg)
{
  vappspan_hide("fsct");
  if (vapptiptimeout) {
    window.clearTimeout(vapptiptimeout);
  }
  if (!vapptiploading) {
    if (arg) {
      var evt = window.event,
          x = vappgetmouseposX(evt),
          y = vappgetmouseposY(evt);
      vapptiptimeout = window.setTimeout(function() {
        vapptipprepare(arg, x, y);
      }, 3000);
    }
  }
}

function vapptipprepare(arg, x, y)
{
  vapptiploading = true;
  var davurl = vappgenxmlrpc("COO.1.1001.1.87582", "", arg);
  vappcallhiddenrpc(vapptipshow, davurl, x, y);
}

function vapptipshow(xmldictionary, responsetext, x, y)
{
  var child = vappxmlgetdictionary(xmldictionary);
  if (child) {
    var html, obj;
    for (var child=child.firstChild; null!=child; child=child.nextSibling) {
      switch (child.nodeName) {
        case "html": html = child.text; break;
        case "obj":  obj = child.text; break;
      }
    }
    if (html) {
      var fsct = vappgethelperspan("fsct");
      if (fsct) {
        fsct.innerHTML = "<div class=\"FscToolTip\">"+html+"</div>";
      }
      vappmenuspan(fsct, x, y);
    }
  }
  
  window.setTimeout(function() {
    vapptiploading = false;
  }, 1000);
}


//------------------------------------------------------------------------------
// slider
function VAPPSlider(id, portletid, round, issmall)
{
  this.m_id = id;
  this.m_round = round;
  this.m_issmall = issmall;
  
  this.GetBoxWidth = function VAPPSlider_GetBoxWidth()       { return this.m_box.offsetWidth; }
  this.GetMargin =   function VAPPSlider_GetMargin()         { return this.m_margin; }
  this.GetSliderWidth = function VAPPSlider_GetSliderWidth() { return this.m_sliderwidth; }
  this.GetMaxMargin = function VAPPSlider_GetMaxMargin()     { return this.GetBoxWidth() - this.GetSliderWidth(); }
  
  this.Init = function VAPPSlider_Init(callback, finalcallback, startpos, maxpos, steppercent)
  {
    this.m_box = window.document.getElementById("FscSlideBox"+id);
    this.m_img = this.m_box.getElementsByTagName("DIV")[0];
    this.m_sliderwidth = this.m_img.offsetWidth;
    this.m_rightbtn = this.m_box.previousSibling;
    this.m_leftbtn = this.m_rightbtn.previousSibling;
    this.m_callback = callback;
    this.m_finalcallback = finalcallback;
    this.m_maxpos = vappgetnumber(maxpos);
    this.m_steppercent = (steppercent) ? steppercent / 100 : 0.2;
    if (!this.m_maxpos) {
      this.m_maxpos = 1;
    }
    this.m_label = window.document.getElementById(this.m_id+"_v");
    this.Start(0);

    if (startpos && maxpos) {
      this.Move(this.GetMaxMargin() * startpos / maxpos);
    }
  }
  
  this.Start = function VAPPSlider_Start(pos)
  {
    this.m_actpos = pos;
    this.m_startpos = pos;
    this.m_margin = vappgetnumber(this.m_img.style.marginLeft);
  }
  
  this.Move = function VAPPSlider_MoveSlider(pos, animatespeed)
  {
    var newmargin = (animatespeed) ? pos : this.m_margin + (pos - this.m_startpos);
    var maxmargin = this.GetMaxMargin();
    if (newmargin<0.0001) { // use 0.0001 instead of 0 to avoid jquery script error ...
      newmargin = 0;
    }
    else if (newmargin>maxmargin) {
      newmargin = maxmargin;
    }
    if (newmargin!=this.m_margin) {
      this.m_actpos = newmargin / maxmargin * this.m_maxpos;
      if (this.m_round) {
        this.m_actpos = Math.round(this.m_actpos);
      }
      if (this.m_label) {
        this.m_label.innerHTML = this.m_actpos;
      }
      // using jquery
      fscjq(this.m_img).stop();
      if (animatespeed) {
        fscjq(this.m_img).animate({ marginLeft: newmargin + "px" }, { queue: false, duration: animatespeed });
      }
      else {
        this.m_img.style.marginLeft = newmargin + "px";
        this.m_startpos = pos;
        this.MoveCallback();
      }
      this.m_margin = newmargin;
    }
    this.m_leftbtn.style.visibility = (newmargin<1) ? "hidden" : "";
    this.m_rightbtn.style.visibility = (newmargin==maxmargin) ? "hidden" : "";
    return this.m_actpos;
  }
  
  this.MoveLeft = function VAPPSlider_MoveLeft()
  {
    this.Move(this.GetMargin() - this.GetMaxMargin() * this.m_steppercent, 1200);
  }
  
  this.MoveRight = function VAPPSlider_MoveRight()
  {
    this.Move(this.GetMargin() + this.GetMaxMargin() * this.m_steppercent, 1200);
  }
  
  this.AdjustSlider = function VAPPSlider_AdjustSlider()
  {
    var maxmargin = this.GetMaxMargin();
    this.m_margin = this.m_actpos / this.m_maxpos * maxmargin;
    if (this.m_margin>maxmargin) {
      this.m_margin = maxmargin;
    }
    this.m_img.style.marginLeft = this.m_margin + "px";
    this.m_leftbtn.style.visibility = (this.m_margin<1) ? "hidden" : "";
    this.m_rightbtn.style.visibility = (this.m_margin==maxmargin) ? "hidden" : "";
  }
  
  this.WriteHtm = function VAPPSlider_WriteHtm(output, onclick)
  {
    if (!onclick) {
      onclick = "vappslide('"+this.m_id+"')";
    }
    var imgpath = va_lookpath+"/FSCVAPP_1_1001/";
    output.Push("<img class=\"FscSlideLeft\" src=\""+imgpath+"slideleft.png\" onclick=\""+onclick+"\"/>");
    output.Push("<img class=\"FscSlideRight\" src=\""+imgpath+"slideright.png\" onclick=\""+onclick+"\"/>");
    output.Push("<div class=\"FscSlideBox\" id=\"FscSlideBox"+this.m_id+"\" style=\"background-image:url("+imgpath+"slideline.png)\">");
    if (this.m_issmall) {
      output.Push("<div class=\"FscSliderSmall\" style=\"background-image:url("+imgpath+"slidersmall.png);\"></div>");
    }
    else {
      output.Push("<div class=\"FscSlider\" style=\"background-image:url("+imgpath+"slider.png);\"></div>");
    }
    output.Push("</div>");
  }
  
  this.MoveCallback = function VAPPSlider_MoveCallback()
  {
    if (this.m_callback) {
      this.m_callback(this.m_actpos);
    }
  }
  
  this.FinalCallback = function VAPPSlider_FinalCallback()
  {
    if (this.m_finalcallback) {
      this.m_finalcallback();
    }
  }
  
  vapppushonevt(function(evt) {
    vappsliderevts(evt);
  }, portletid, true);
  
  vapppushonlayout(function(isinit) {
    if (!isinit && g_vappsliders[id]) {
      g_vappsliders[id].AdjustSlider();
    }
  }, portletid);
  
  vapppushonvapp(function(evt) {
    g_vappsliders[id] = null;
  }, portletid);
  
  g_vappsliders[id] = this;
}

function vappsliderevts(evt)
{
  if (!evt) {
    evt = window.event;
  }
  var type = evt.type;
  switch (type) {
    case "mousedown":
      var evtsrc = vappevent.gettarget(evt);
      var evtsrcClass = evtsrc.className;
      if (evtsrcClass=="FscSlider" || evtsrcClass=="FscSliderSmall") {
        var parent = evtsrc.parentElement;
        var id = parent.id.split("FscSlideBox").join("");
        g_vappactslider = g_vappsliders[id];
        if (g_vappactslider) {
          g_vappactslider.Start(evt.clientX);
          evt.cancelBubble = true;
          evt.returnValue = false;
        }
      }
      else if (evtsrcClass=="FscSlideBox") {
        var id = evtsrc.id.split("FscSlideBox").join("");
        g_vappactslider = g_vappsliders[id];
        if (g_vappactslider) {
          var slider = evtsrc.getElementsByTagName("DIV")[0];
          var startOffset = fscjq(slider).offset().left + g_vappactslider.GetSliderWidth() / 2;  // using jquery
          g_vappactslider.Start(startOffset);
          g_vappactslider.Move(evt.clientX);
        }
      }
      break;
    case "mouseup":
      if (g_vappactslider) {
        g_vappactslider.FinalCallback();
        g_vappactslider = null;
      }
      break;
    case "mousemove":
      if (g_vappactslider) {
        g_vappactslider.Move(evt.clientX);
        vappclearselection();
        evt.cancelBubble = true;
        evt.returnValue = false;
        return false;
      }
      break;
  }
}

function vappslide(id)
{
  var slider = g_vappsliders[id];
  if (slider) {
    var elem = window.event.srcElement;
    (elem.src.indexOf("slideleft")>0) ? slider.MoveLeft() : slider.MoveRight();
    slider.MoveCallback();
    slider.FinalCallback();
  }
}

//------------------------------------------------------------------------------
// helper functions
function vappempty()
{
}

function vappgetfontsize(fxbig, getint)
{
  if (null==fxbig) {
    fxbig=vappfxbig;
  }
  switch (fxbig) {
    case 1: return (getint) ? 12 : "12pt";
    case 2: return (getint) ? 14 : "14pt";
    default: return (getint) ? 10 : "10pt";
  }
}

function vappsyncobject(currobj)
{
  alert("Synchronize Folder: "+currobj);
}

function vappgettc(portletid)
{
  var f = vappgetform(portletid);
  if (f && f.s3 && f.s3.value) {
    return f.s3.value;
  }
  return "";
}

function vappgettransaction(portletid)
{
  var value = "";
  if (!g_isdirty) {
    var f = vappgetform(portletid);
    if (null!=f && f.s3 && f.s3.value) {
      value = f.s3.value;
    }
  }
  return value;
}

function vappsettransaction(portletid, tx)
{
  if (!g_isdirty) {
    var f = vappgetform(portletid);
    if (f && f.s3) {
      f.s3.value = tx;
      return true;
    }
  }
  return false;
}

//------------------------------------------------------------------------------
// overlays
function vappgetoverlay()
{
  for (var idx=0, cnt=g_vappoverlays.length; idx<cnt; idx++) {
    var overlay = g_vappoverlays[idx],
        id = overlay.id;
    if (!vappisoverlay(overlay) && (!id || !window.document.getElementById(id.substr("FscOverlay".length)))) {
      return g_vappoverlays[idx];
    }
  }
  var overlay = document.createElement("DIV");
  overlay.className = "FscDispNone";
  g_vappoverlays.push(overlay);
  return overlay;
}

function vappclearoverlay(overlay)
{
  overlay.id = "";
  overlay.className = "FscDispNone";
  overlay.innerHTML = "";
  overlay.removeAttribute("fscref");
}

function vappopenoverlaydialog(id, html, width, height, isapp)
{
  var headpid = vappgetheadpid(),
      container = window.document.getElementById(headpid);
  vappdisable(container, headpid, true);

  var overlay = vappgetoverlay(),
      haspercentwidth = width && (""+width).indexOf("%")>=0,
      haspercentheight = height && (""+height).indexOf("%")>=0;
      
  if ((!width || !height) && html) {
    helper = vappgethelperelem();
    helper.innerHTML = html;
    if (!width) {
      width = helper.offsetWidth;
    }
    if (!height) {
      height = helper.offsetHeight;
    }
    helper.innerHTML = "";
  }
  else {
    if (!haspercentwidth) {
      if (vappfxbig==1) {
        width*= 1.2;
      }
      else if (vappfxbig==2) {
        width*= 1.5;
      }
    }
    if (!haspercentheight) {
      if (vappfxbig==1) {
        height*= 1.2;
      }
      else if (vappfxbig==2) {
        height*= 1.5;
      }
    }
  }
  if (haspercentwidth) {
    overlay.style.width = width;
    overlay.style.left = "0px";
  }
  else if (width && width<vappgetwindowwidth()*0.9) {
    overlay.style.width = width + "px";
    overlay.style.left = "50%";
    overlay.style.marginLeft = width / -2 + "px";
  }
  if (haspercentheight) {
    overlay.style.height = height;
    overlay.style.top = "0px";
  }
  else if (height && height<vappgetwindowheight()*0.9) {
    overlay.style.height = height + "px";
    overlay.style.top = "50%";
    overlay.style.marginTop = height / -2 + "px";
  }
  //
  // disable access keys
  //
  var atags = window.document.getElementsByTagName("A");
  for (var idx=0, cnt=atags.length; idx<cnt; idx++) {
    var atag = atags[idx],
        accesskey = atag.getAttribute("accessKey");
    if (accesskey) {
      atag.setAttribute("fscaccessKey", accesskey);
      atag.setAttribute("accessKey", null);
    }
  }
  
  overlay.id = id;
  overlay.className = (isapp) ? "FscOverlayApp" : "FscOverlayDialog";
  if (html) {
    overlay.innerHTML = html;
  }
  container.appendChild(overlay);
  g_vappoverlaydialogs.push(overlay);
  return true;
}

function vappcloseoverlaydialog(closeall)
{
  var overlayid;
  while (vapphasoverlays()) {
    var overlaydialog = vappgetactoverlay();
    overlayid = overlaydialog.id;
    overlaydialog.style.width = "";
    overlaydialog.style.height = "";
    overlaydialog.style.top = "";
    overlaydialog.style.left = "";
    overlaydialog.style.marginTop = "";
    overlaydialog.style.marginLeft = "";

    vappclearoverlay(overlaydialog);
    g_vappoverlaydialogs.pop();
    if (!vapphasoverlays()) {
      vappenable(vappgetheadpid());
      //
      // enable access keys
      //
      var atags = window.document.getElementsByTagName("A");
      for (var idx=0, cnt=atags.length; idx<cnt; idx++) {
        var atag = atags[idx],
            accesskey = atag.getAttribute("fscaccessKey");
        if (accesskey) {
          atag.setAttribute("accessKey", accesskey);
          atag.removeAttribute("fscaccessKey");
        }
      }
    }
    if (!closeall) {
      return overlayid;
    }
  }
  return overlayid;
}

function vappstartoverlayapp(url, width, height, formdata, ignoredirty)
{
  if (!ignoredirty && (g_isdirty || !vappportletsready())) {
    return false;
  }

  var portlet = ajaxCreatePortletObject(vappgetcontainerid(), "overlay"),
      id = portlet.GetId();

  vappopenoverlaydialog(id, null, width, height, true);
  window.g_portletstarturl = url+"&"+vappbaseurlargs()+"&ru=javascript:vappcloseoverlayapp()";
  if (g_vappis24hrec) {
    g_vapp24isoverlaypage = true;
  }
  ajaxOnload(id, formdata);
}

function vappstartoverlayappwithdata(data, parentpid, width, height)
{
  var portlet = ajaxCreatePortletObject(parentpid, "overlay"),
      id = portlet.GetId();

  vappopenoverlaydialog(id, null, width, height, true);
  vappinitvarset(id);
  var page = vappgetpage(id);
  if (page) {
    page.data = data;
    page.refid = parentpid;
    page.Render();
  }
}

function vappcloseoverlayapp(closeall)
{
  var overlayid = vappcloseoverlaydialog(closeall);
  if (overlayid) {
    var parentid = vappgetportlet(overlayid).GetParentId();
    vappportletcleanup();
    if (vapphasoverlays()) {
      var overlay = vappgetactoverlay();
      if (overlay) {
        vappsetcontainer(overlay.id);
      }
    }
    return parentid;
  }
}

function vappisoverlayapp(container)
{
  return vapphasclass(container, "FscOverlayApp");
}

function vappisoverlay(container)
{
  return container && (container.id.indexOf("FscOverlay")==0 || container.className.indexOf("FscOverlay")==0);
}

function vapphasoverlays()
{
  return g_vappoverlaydialogs.length;
}

function vappgetactoverlay()
{
  return g_vappoverlaydialogs[g_vappoverlaydialogs.length-1];
}

function vapphandleoverlaykeydown(evt, evtsrc, keycode)
{
  if (vapphasoverlays()) {
    var strudlcontainer = vappgetparentbyid(evtsrc, "strudl-report-form-container", 10);
    if (!strudlcontainer && !vappisoverlay(vappgetcontainerbyelem(evtsrc))) {
      if (keycode==9) {
        var target = vappgetfocustarget(vappgetactoverlay());
        if (target) {
          vappfocus(target);
          return false;
        }
      }
      evt.cancelBubble = true;
      evt.returnValue = false;
      return false;
    }
  }
  return true;
}

function vappdisable(container, portletid, isdark)
{
  if (container) {
    var id = container.id;
    if (vappisenabled(id)) {
      var overlay = vappgetoverlay();
      overlay.id = "FscOverlay"+id;
      overlay.setAttribute("fscref", portletid);
      container.appendChild(overlay);
      overlay.className = (isdark) ? "FscOverlayDark" : "FscOverlay";
      vappdisableplugins(container);
    }
  }
}

function vappenable(id)
{
  var overlay = window.document.getElementById("FscOverlay"+id);
  if (overlay) {
    vappclearoverlay(overlay);
    vappenableplugins(window.document.getElementById(id));
  }
}

function vappenableall(portletid)
{
  for (var idx=0, cnt=g_vappoverlays.length; idx<cnt; idx++) {
    var overlay = g_vappoverlays[idx];
    if (overlay.getAttribute("fscref")==portletid) {
      vappclearoverlay(overlay);
    }
  }
}

function vappisenabled(id)
{
  return (window.document.getElementById("FscOverlay"+id)) ? false : true;
}

//------------------------------------------------------------------------------
// workaround for ie plugin problem
function vappaddpluginoverlay(elem, height)
{
  if (g_isie && elem) {
    var iframes = elem.getElementsByTagName("IFRAME"),
        iframe;
    if (iframes.length>0) {
      iframe = iframes[iframes.length-1];
    }
    else {
      iframe = document.createElement("IFRAME");
      iframe.className = "FscPluginOverlay";
      elem.appendChild(iframe);
    }
    iframe.style.height = (height) ? height + "px" : elem.offsetHeight + "px";
    if (g_isie6) {
      iframe.style.width = elem.offsetWidth + "px";
    }
  }
}

function vapphaspluginoverlay(elem)
{
  if (g_isie && elem) {
    var iframes = elem.getElementsByTagName("IFRAME");
    for (var idx=0, cnt=iframes.length; idx<cnt; idx++) {
      if (iframes[idx].className=="FscPluginOverlay") {
        return true;
      }
    }
  }
}

function vappdisableplugins(container)
{
  if (g_isie && container) {
    var iframes = container.getElementsByTagName("IFRAME");
    for (var idx=0, cnt=iframes.length; idx<cnt; idx++) {
      if (iframes[idx].className!="FscPluginOverlay") {
        iframes[idx].style.visibility = "hidden";
      }
    }
  }
}

function vappenableplugins(container)
{
  if (g_isie && container) {
    var iframes = container.getElementsByTagName("IFRAME");
    for (var idx=0, cnt=iframes.length; idx<cnt; idx++) {
      if (iframes[idx].className!="FscPluginOverlay") {
        iframes[idx].style.visibility = "";
      }
    }
  }
}

//------------------------------------------------------------------------------
// class VAPPHighlight
//--------------------------------------------------------------------------
function VAPPHighlight(el)
{
  this.m_highlight = null;
  
  this.Update = function VAPPHighlight_Update(el)
  {
    if (el && el != this.m_highlight) {
      if (this.m_highlight) {
        this.Hide();
      }
      this.Show(el);
    }
    else if (!el && this.m_highlight) {
      this.Hide();
    }
  }
  
  this.Show = function VAPPHighlight_Show(el)
  {
    this.m_hideevent = vappaddevent(document.body, "mouseover", this.Hide, this);
    vappaddclass(el, "FscHighlight");
    this.m_highlight = el;
  }
  
  this.Hide = function VAPPHighlight_Hide()
  {
    vappremoveevent(document.body, "mouseover", this.m_hideevent);
    vappremoveclass(this.m_highlight, "FscHighlight");
    this.m_highlight = null;
  }
}

//------------------------------------------------------------------------------
// class VAPPCursor
//--------------------------------------------------------------------------
/// Draw a cursor beside Elements inside a Container
///
/// \param dragevent (string) event.type without prefix "on".
///        "mouseenter"|"mouseover"|"dragenter"|"dragover"|...
/// \param findtag (string) DOMelement.tagName of the DOMelement where the 
///        cursor has to be drawn beside.
///        "A"|"DIV"|"LI"|...
/// \param stoptag (string) DOMelement.tagName to stop recursive search for 
///        findtag.
///        "UL"|"DIV"|"TABLE"|...
/// \param dragstartevent (string) event.type without prefix "on". Required 
///        for VAPPCursor.Drop and VAPPCursor.GetSrcElement.
///        "mousedown"|"dragstart"|...
/// \param dragoutevent (string, optional) event.type without prefix "on". 
///        Default dragevent is used.
///        "mouseenter"|"mouseover"|"dragenter"|"dragover"|...
/// \param hoveroutelement (DOMelement, optional) Default is document.body.
//--------------------------------------------------------------------------

function VAPPCursor(dragevent, findtag, stoptag, dragstartevent, dragoutevent, hoveroutelement)
{
  this.dragevent = dragevent;
  this.findtag = findtag;
  this.stoptag = stoptag;
  this.dragstartevent = dragstartevent;
  this.dragoutevent = (dragoutevent) ? dragoutevent : dragevent;
  this.hoveroutelement = (hoveroutelement) ? hoveroutelement : document.body;
  
//--------------------------------------------------------------------------
/// \param hoverelement (DOMelement) Cursor will be drawn when 
///        dragevent is fired on hoverelement.
//--------------------------------------------------------------------------
  this.Init = function VAPPCursor_Init(hoverelement)
  {
    this.hoverelement = hoverelement;
    this.srcelement = null;
    this.dstelement = null;
    this.cursorelement = null;
    this.cursorisvisible = false;
    
    if (typeof this.hoverelement === "object" && typeof this.dragevent === "string") {
      vappaddevent(this.hoverelement, this.dragevent, this.DragCursor, this);
      if (this.dragstartevent) {
        vappaddevent(this.hoverelement, this.dragstartevent, this.DragStart, this);
      }
      return true;
    }
    else {
      TT("VAPPCursor.Init() failed");
      return false;
    }
  }
  
  this.DragStart = function VAPPCursor_DragStart(evt)
  {
    if (!evt) {
      evt = window.event;
    }
    this.srcelement = this.GetTarget(evt);
  }
  
  this.DragCursor = function VAPPCursor_DragCursor(evt)
  {
    if (!evt) {
      evt = window.event;
    }
    var el = this.GetTarget(evt);
    if (!vappischild(el, this.cursorelement, 2)) {
      if (el) {
        var elwidth = el.offsetWidth,
            cursorleft = el.offsetLeft,
            cursortop = el.offsetTop,
            prevsibling = el;
        
        this.insertidx = 0;
        this.dstelement = el;
        
        while (prevsibling = prevsibling.previousSibling) {
          if (prevsibling.tagName === this.findtag) {
            this.insertidx += 1;
          }
        }
        
        if (evt.offsetX>elwidth/2) {
          cursorleft += elwidth;
          this.insertidx += 1;
          this.dstelement = this.dstelement.nextSibling;
        }
        if (!this.cursorisvisible) {
          this.ShowCursor(cursorleft, cursortop, 10, el.offsetHeight);
          if (!this.WrappedDragCursorEnd) {
            this.WrappedDragCursorEnd = vappaddevent(this.hoveroutelement, this.dragoutevent, this.DragCursorEnd, this);
          }
          else {
            vappaddevent(this.hoveroutelement, this.dragoutevent, this.WrappedDragCursorEnd);
          }
        }
        else {
          this.ShowCursor(cursorleft,cursortop);
        }
      }
      else {
        this.ShowCursor();
      }
    }
  }
  
  this.DragCursorEnd = function VAPPCursor_DragCursorEnd(evt)
  {
    if (!evt) {
      evt = window.event;
    }
    
    if (vappismouseout(evt, this.hoverelement, 3)) {
      this.ShowCursor();
      vappremoveevent(this.hoveroutelement, evt.type, this.WrappedDragCursorEnd);
    }
  }
  
//--------------------------------------------------------------------------
/// Show cursor on specified position,
/// resize if width and hight is provided,
/// hide if no parameters are provided.
///
/// \param left (integer, optional) Cursor offset left in px.
/// \param top (integer, optional) Cursor offset top in px.
/// \param width (integer, optional) Cursor width in px.
/// \param height (integer, optional) Cursor height in px.
//--------------------------------------------------------------------------
  this.ShowCursor = function VAPPCursor_ShowCursor(left, top, width, height)
  {
    if (!this.cursorelement) {
      this.cursorelement = document.createElement("DIV");
      this.cursorelement.style.backgroundImage = "url("+vappgetportleturl(va_lookpath+"/FSCVAPP_1_1001/cursorv.png")+")";
      this.hoverelement.appendChild(this.cursorelement);
      this.cursorelement.appendChild(this.cursorelement.cloneNode(true));
    }
    if (left != null && top != null) {
      this.cursorelement.style.left = left+"px";
      this.cursorelement.style.top = top+"px";
      if (!this.cursorisvisible) {
        if (width > 0) {
          this.cursorelement.style.width = width+"px";
          this.cursorelement.style.marginLeft = width/-2+"px";
        }
        if (height > 0) {
          this.cursorelement.style.height = height+"px";
        }
        this.cursorelement.className = "FscCursorV";
        this.cursorisvisible = true;
      }
    }
    else if (this.cursorisvisible) {
      this.cursorelement.className = "FscHidden";
      this.cursorisvisible = false;
    }
  }
  
//--------------------------------------------------------------------------
/// \param moveelem (boolean) If true draged DOMelement is moved.
/// \return Position where draged DOMelement is droped.
//--------------------------------------------------------------------------
  this.Drop = function VAPPCursor_Drop(moveelem)
  {
    this.ShowCursor();
    if (moveelem && this.srcelement) {
      var parent = this.srcelement.parentElement;
      if (this.dstelement) {
        parent.insertBefore(this.srcelement, this.dstelement);
      }
      else if (this.insertidx != null) {
        parent.appendChild(this.srcelement);
      }
    }
    return this.insertidx;
  }
  
//--------------------------------------------------------------------------
/// \return Dragged DOMelement.
//--------------------------------------------------------------------------
  this.GetSrcElement = function VAPPCursor_GetSrcElement()
  {
    return this.srcelement;
  }
  
  this.GetTarget = function VAPPCursor_GetTarget(evt)
  {
    var target = vappevent.gettarget(evt);
    if (!vappischild(target, this.cursorelement, 2)) {
      return (this.findtag) ? vappgetparentbytagname(target, "|"+this.findtag+"|", "|"+this.stoptag+"|") : evt.target;
    }
    return target;
  }
}

//------------------------------------------------------------------------------
// browser state (scroll position and focus field)
function VAPPBrowserState(key, portletid)
{
  this.m_key = key;
  this.m_portletid = portletid;
  
  this.m_focustargetid;
  this.m_focusdisabled = false;
  this.m_scrollareas = [];
  this.m_scrollx = [];
  this.m_scrolly = [];
  this.m_info = {};
  this.m_infofunc = {};
  this.m_age = 0;
  
  this.AddScrollArea = function VAPPAddScrollArea(id)
  {
    for (var idx=0, cnt=this.m_scrollareas.length; idx<cnt; idx++) {
      if (this.m_scrollareas[idx]==id) {
        return false;
      }
    }
    this.m_scrollareas.push(id);
    return true;
  };
  
  this.SaveScrollPos = function VAPPBrowserState_SaveScrollPos()
  {
    for (var idx=0, cnt=this.m_scrollareas.length; idx<cnt; idx++) {
      this.SaveScrollPosTag(this.m_scrollareas[idx], vappgetelementbyid(this.m_scrollareas[idx], this.m_portletid));
    }
    if (window.g_isportlet) {
      this.SaveScrollPosTag("pbody", window.document.getElementsByTagName("HTML")[0]);
    }
  };
  
  this.SaveScrollPosTag = function VAPPBrowserState_SaveScrollPosTag(id, tag)
  {
    if (tag) {
       var x = tag.scrollLeft,
           y = tag.scrollTop;
      if (x>0 && tag.scrollWidth==x+tag.clientWidth) {
        x = "end";
      }
      if (y>0 && tag.scrollHeight==y+tag.clientHeight) {
        y = "end";
      }
      this.m_scrollx[id] = x;
      this.m_scrolly[id] = y;
    }
  };
  
  this.SetScrollPos = function VAPPBrowserState_SetScrollPos()
  {
    for (var idx=0, cnt=this.m_scrollareas.length; idx<cnt; idx++) {
      this.SetScrollPosTag(this.m_scrollareas[idx], vappgetelementbyid(this.m_scrollareas[idx], this.m_portletid));
    }
    if (window.g_isportlet) {
      this.SetScrollPosTag("pbody", window.document.getElementsByTagName("HTML")[0]);
    }
    this.m_scrollx = new Array();
    this.m_scrolly = new Array();
  };
  
  this.SetScrollPosTag = function VAPPBrowserState_SetScrollPosTag(id, tag)
  {
    if (tag) {
      var x = this.m_scrollx[id],
          y = this.m_scrolly[id];
      if (x) {
        tag.scrollLeft = (x=="end") ? tag.scrollWidth - tag.clientWidth : x;
      }
      if (y) {
        tag.scrollTop = (y=="end") ? tag.scrollHeight - tag.clientHeight : y;
      }
    }
  }
  
  this.SaveFocusTarget = function VAPPBrowserState_SaveFocusTarget(id, evt, overwrite)
  {
    if (!this.m_focustargetid || overwrite) {
      if (evt) {
        var evtsrc = vappevent.gettarget(evt);
        if (evtsrc) {
          this.m_focustargetid = (evtsrc.id) ? evtsrc.id : evtsrc.name;
          return false;
        }
      }
      this.m_focustargetid = id;
    }
  };
  
  this.SetFocus = function VAPPBrowserState_SetFocus()
  {
    if (this.m_focusdisabled) {
      this.m_focusdisabled = false;
      return false;
    }
    var focustarget,
        id = this.m_focustargetid;
    if (id) {
      focustarget = vappgetelementbyid(id, this.m_portletid);
      if (!focustarget) {
        focustarget = window.document.getElementsByName(id)[0];
      }
      if (focustarget && focustarget.type=="hidden") {
        focustarget = vappgetsb(vappgetsbid(focustarget.id))
      }
    }
    this.m_focustargetid = null;
    if (!focustarget) {
      focustarget = vappgetfocustarget(vappgetform(this.m_portletid));
    }
    if (focustarget) {
      if (focustarget.getAttribute("fscview")) {
        vappselsetpagemenu(id, this.m_portletid);
        vappinitselection(id, this.m_portletid);
        focustarget = focustarget.parentElement;
      }
      var iseditable = vappiseditableelem(focustarget);
      vappdeselectie();
      vappfocusnow(focustarget, iseditable);
      if (iseditable) {
        vappselcheck(focustarget);
      }
      return true;
    }
    return false;
  }
  
  this.AddInfoFunc = function VAPPBrowserState_AddInfoFunc(func, key) { this.m_infofunc[key] = func; }
  this.GetInfo = function VAPPBrowserState_GetInfo(key)               { return this.m_info[key]; }
  this.SaveInfo = function VAPPBrowserState_SaveInfo()
  {
    for (var key in this.m_infofunc) {
      this.m_info[key] = this.m_infofunc[key]();
    }
  }
  
  this.DisableFocus = function VAPPBrowserState_DisableFocus() { this.m_focusdisabled = true; };
  this.Update = function VAPPBrowserState_Update()             { this.m_age = 0; };
  this.IsExpired = function VAPPBrowserState_IsExpired()       { this.m_age++; return this.m_age>10; };
}

function vapppushscrollareas(value, id)
{
  var browserstate = vappgetbrowserstate(id);
  if (browserstate) {
    browserstate.AddScrollArea(value);
  }
}

function vapppushbrowserinfofunc(func, key, id)
{
  var browserstate = vappgetbrowserstate(id);
  if (browserstate) {
    browserstate.AddInfoFunc(func, key);
  }
}

function vappgetbrowserinfo(key, id)
{
  var browserstate = vappgetbrowserstate(id);
  if (browserstate) {
    return browserstate.GetInfo(key);
  }
}

function vappsetg_focusfieldid(value, id)
{
  var browserstate = vappgetbrowserstate(id);
  if (browserstate) {
    browserstate.SaveFocusTarget(value, null, true);
  }
}

function vappsetbrowserstate(portlet)
{
  var browserstate = portlet.GetBrowserState();
  if (browserstate) {
    if (!g_vappfocusset && vappwindowisforeground() && !portlet.IsMinimized() && !portlet.IsSmartApp()) {
      browserstate.SetFocus();
    }
    browserstate.SetScrollPos();
  }
}

//------------------------------------------------------------------------------
// document recovery functions
function vapprecoveraddargvalue(arg, value)
{
  (value) ? arg.push(value) : arg.push("");
}

function vapprecoverdocuments()
{
  if (g_isie || vappsupportsplugin()) {
    var toolmgr = vappgetplugin(false, 10060001, FSC_USECASE.FSC_RECOVERY);
    if (toolmgr) {
      try {
        var jsonkeys = toolmgr.GetRecoveryKeys(vapphead()),
            keys = eval(jsonkeys),
            objs = [];

        for (var idx = 0, cnt = keys.length; idx < cnt; idx++) {
          objs.push(vappgetargument("OBJ", keys[idx].url));
        }
        if (objs.length) {
          var davurl = vappgenxmlrpc("COO.1.1001.1.238836", "", "&INP=ARG1&RES=ARG2");
          vappcallhiddenpostrpc(vapprecoveryhandlestate, davurl, objs.join("|"), toolmgr, keys);
        }
      }
      catch (e) {
        TT("Problem occured while calling vapprecoverdocuments: "+e.message);
      }
    }
  }
}

function vapprecoveryhandlestate(xmldictionary, xmltext, toolmgr, keys)
{
  var args = [],
      objchangedby = vappxmlgettext(xmldictionary.getElementsByTagName("objchangedby")[0]),
      objmodifiedat = vappxmlgettext(xmldictionary.getElementsByTagName("objmodifiedat")[0]);
      
  objchangedby = (objchangedby) ? objchangedby.split("|") : [];
  objmodifiedat = (objmodifiedat) ? objmodifiedat.split("|") : [];

  for (var idx = 0, cnt = keys.length; idx < cnt; idx++) {
    var key = keys[idx],
        state = eval("(" + toolmgr.GetRecoveryState(key.key) + ")");
    
    TT(state.state + ": " + key.file + " (" + key.namehint + ")");
    if (state.state!="ATTACH") {
      var file = (state.file) ? state.file.split("\\").join("\\\\") : null;
      vapprecoveraddargvalue(args, state.state);
      vapprecoveraddargvalue(args, vappgetargument("OBJ", key.url));
      vapprecoveraddargvalue(args, encodeURIComponent(state.message));
      vapprecoveraddargvalue(args, encodeURIComponent(state.messagerelock));
      vapprecoveraddargvalue(args, encodeURIComponent(state.lockowner));
      vapprecoveraddargvalue(args, encodeURIComponent(state.lockedat));
      vapprecoveraddargvalue(args, encodeURIComponent(file));
      vapprecoveraddargvalue(args, objchangedby[idx]);
      vapprecoveraddargvalue(args, encodeURIComponent(objmodifiedat[idx]));
      vapprecoveraddargvalue(args, encodeURIComponent(key.serverObjChangedat));
    }
  }
  if (args.length) {
    var davurl = vappgenxmlrpc("COO.1.1001.1.238834", "", "&INP=ARG1&RES=ARG2");
    vappcallhiddenpostrpc(vapprecovershowmessage, davurl, args.join("|"));
  }
}

function vapprecovershowmessage(state, namehint)
{
  window.open(vappbaseurl()+"&ax=COO.1.1001.1.238901&ru=javascript:window.close()", "", "location=no, menubar=no, resizable=yes, status=yes, toolbar=no, scrollbars=yes");
}

function vappshowinfolder(file)
{
  if (g_isie) {
    var toolmgr = vappgettoolmgr(true, 10060001);
    if (toolmgr) {
      toolmgr.ShowInFolder(file);
    }
  }
}

//------------------------------------------------------------------------------
// getting strings
function vappgetstring(ident, arg)
{
  if (arg) {
    ident+= "|" + arg;
  }
  if (!g_vappstrings[ident]) {
    var davurl = vappgenxmlrpc("COO.1.1001.1.156462", "", "&INP=ARG1&RES=ARG2");
    g_vappstrings[ident] = vappcallsyncpostrpc(davurl, ident, true);
  }
  return g_vappstrings[ident];
}

function vappsetstrings(identarr)
{
  if (identarr && !g_vappstrings[identarr[0]]) {
    var davurl = vappgenxmlrpc("COO.1.1001.1.156462", "", "&INP=ARG1&RES=ARG2"),
        strings = vappcallsyncpostrpc(davurl, identarr.join(";"), true);
    if (strings) {
      strings = strings.split(";");
      for (var idx=0, cnt=strings.length; idx<cnt; idx++) {
        g_vappstrings[identarr[idx]] = strings[idx];
      }
    }
  }
}

//------------------------------------------------------------------------------
// prerequisite checks
var g_prerequstubversion = 10260000;
function vappcheckpluginsupport()             { return vappsupportstoolmgr() || vappsupportsplugin(); }
function vappcheckplugin()                    { return vappgetplugin(false, null, FSC_USECASE.FSC_CLIENTSTATUS) ? true : false; }
function vappcheckpluginversion()             { return vappgetplugin(false, null, FSC_USECASE.FSC_CLIENTSTATUS) ? (vappgetplugin(false, g_prerequstubversion, FSC_USECASE.FSC_CLIENTSTATUS) ? true : false) : null; }
function vappcheckwin_filesize()              { return vappgetclientstatus("WIN_FILESIZELIMIT"); }
function vappcheckwin_forceshellexec()        { return vappgetclientstatus("WIN_FORCESHELLEXECUTE"); }
function vappcheckie_browserversion()         { return !(g_isie6 || g_isie7); }
function vappcheckff_browserversion()         { return !g_ismoz3; }
function vappcheckie_xmlhttp()                { return g_isie6 || typeof (XMLHttpRequest) == "object"; }
function vappcheckie_encrypted()              { return vappgetclientstatus("IE_SAVEENCRYPTED"); }
function vappcheckie_promtcert()              { return vappgetclientstatus("IE_PROMPTCERT"); }
function vappcheckie_secutityzone()           { return vappgetclientstatus("IE_SECURITYZONE"); }
function vappcheckie_enableplugin()           { return vappgetclientstatus("IE_ENABLEPLUGIN"); }
function vappcheckie_protectedmode()          { return vappgetclientstatus("IE_DISABLEPROTECTEDMODE"); }
function vappcheckie_enablepopup()            { return vappgetclientstatus("IE_ENABLEPOPUPS"); }
function vappcheckff_enablecodebasesupport()  { return vappgetclientstatus("FF_ENABLECODEBASESUPPORT"); }
function vappcheckff_enablepopup()            { return vappgetclientstatus("FF_ENABLEPOPUPS"); }
function vappcheckff_enablepopupsmax()        { return vappgetclientstatus("FF_ENABLEPOPUPSMAX"); }
function vappchecksaf_enablepopup()           { return vappgetclientstatus("SAF_ENABLEPOPUPS"); }
function vappcheckmac_enableaccessibility()   { return vappgetclientstatus("MAC_ENABLEACCESSIBILITY"); }

function vappcheckprerequs(names, addresses, optnames, optaddresses)
{
  if (!g_vappchecksfailedrequired.length && !g_vappchecksfailedoptional.length && !g_vappcheckspassed.length) {
    for (var idx=0, cnt=names.length; idx<cnt; idx++) {
      vappcheckprerequisite(names[idx], addresses[idx], true);
    }
    for (var idx=0, cnt=optnames.length; idx<cnt; idx++) {
      vappcheckprerequisite(optnames[idx], optaddresses[idx], false);
    }
  }
  if (g_vappchecksfailedrequired.length > 0) {
    return g_vappicons["overlayerror"];
  }
  if (g_vappchecksfailedoptional.length > 0) {
    return g_vappicons["overlaywarning"];
  }
}

function vappcheckprerequ(name)
{
  if (name) {
    if (typeof window[name] == "function") {
      return window[name]();
    }
  }
  else {
    return true;
  }
}

function vappcheckprerequisite(name, address, required)
{
  var result = vappcheckprerequ(name, address);
  if (result===true) {
    g_vappcheckspassed.push(address);
  }
  else if (result===false) {
    if (required) {
      g_vappchecksfailedrequired.push(address);
    }
    else {
      g_vappchecksfailedoptional.push(address);
    }
  }
}

function vappcheckbasicprerequisite(name, id)
{
  if (vappcheckprerequ(name) === false) {
    var msg = window.document.getElementById(id);
    if (msg) {
      vappremoveclass(msg, "FscHidden");
    }
  }
}

function vappgetclientstatus(feature)
{
  var stub = vappgetplugin(false, g_prerequstubversion, FSC_USECASE.FSC_CLIENTSTATUS),
      result;
  
  if (stub) {
    vappenableprivilege(stub)("UniversalXPConnect");
    result = stub.GetClientFeatureStatus(feature, document.URL);
    if (result == "OK") {
      return true;
    }
    else if (result == "NOK") {
      return false;
    }
  }
}

//------------------------------------------------------------------------------
// functions called from scripts (i.e. script component objects) on the page

// fscvenv-editcontentscr
function vappcheckmodal(davurl, closewindow)
{
  var fscstub = vappgettoolmgr();
  if (fscstub != null) {
    vappenableprivilege()("UniversalXPConnect");
    if (fscstub.IsOpen(davurl)) {
      window.setTimeout(function() {
        vappcheckmodal(davurl, closewindow)
      }, 1000);
    }
    else {
      vappdosubmit();
      if (closewindow) {
        window.close();
      }
    }
  }
}

function vappeditcontent(fileobjaddress, fileobjname, filepath, fileextension, fileoleclassid, filesize, filereadonly, fileverb, optionstring, tc, nativedavapp, mm_datasourcefilename, mm_contentstring, mm_donotattach, mm_filetypeallowed, ismodal, fileseparableoleclassid, linkcont, closewindow, saveobjname, usestub)
{
  var g_venv_started = false,
      exportfile = false,
      readonly = (filereadonly=="true") ? true : false;
  if (usestub=="false" || window.g_isportlet || g_isopera) {
    exportfile = true;
  }
  if (!exportfile) {
    if (linkcont && g_isie) {
      var fscdata = vapp_resource("Fsc.Data.Open", 7020015, "FolioPlugin");
      if (fscdata) {
        fscdata.OpenLink(linkcont);
      }
    }
    else {
      var fscstub = vappgetplugin(true, 9250001, FSC_USECASE.FSC_DAVEDIT);
      if (fscstub) {
        var davurl,
            fileoperation = (readonly) ? "read" : "edit";
        if (optionstring) {
          fileoperation += " " + optionstring;
        }

        fileobjname = vappsimplifyname(fileobjname, fileextension);
        davurl = venvgendavurl(fileobjaddress, readonly, false, false, nativedavapp, fileobjname, fileextension);

        if (nativedavapp) {
          fileoperation += "  nativedavapp";
        }
        else {
          if (tc.length > 0) {
            davurl += '&tc=';
            davurl += escape(tc).split('+').join('%2B').split('/').join('%2F').split('=').join('%3D');
          }
        }

        if (filepath) {
          if (filepath != "content(0)contcontent(0)") {
            davurl += '&CONTENT=' + filepath;
          }
        }

        if (fileseparableoleclassid) {
          fileoleclassid = fileseparableoleclassid;
        }

        if (nativedavapp) {
          if (!readonly) {
            davurl += '&ax=.';
          }
        }
        else {
          if (readonly) {
            davurl+='&TS=';
            davurl+=vapprandomnumber(9999);
          }
          davurl = vappdavurlwithname(davurl, fileobjname, fileextension, nativedavapp, false);
          davurl += '/&ax=.';
        }

        if (!g_venv_started) {
          if (vappsupportsplugin()) {
            fscstub.DavEdit(davurl, fileobjname, fileextension, filesize, fileoperation);
          }
          else {
            vappenableprivilege(fscstub)("UniversalXPConnect");
            g_venv_started = true;

            if (null != mm_datasourcefilename && mm_datasourcefilename != "") {
              if ((optionstring.indexOf("separatecontentfolder") >= 0) || (optionstring.indexOf("project") >= 0)) {
                if (fscstub.versionnumber && fscstub.versionnumber < 10160001) {
                  try {
                    fscstub = vapp_resource("Fsc.ToolMgr", 10160001, "FolioPlugin");
                  }
                  catch (e) {
                    fscstub = null;
                  }
                }
                if (fscstub) {
                  var localfile = fscstub.HexToFile(mm_datasourcefilename, mm_contentstring, fileoperation);
                  fscstub.DavEdit(davurl, fileobjname, fileextension, localfile, fileverb, fileoperation, filesize);
                }
              }
              else {
                /*
                *  Mailmerge issue
                */
                var localfile = fscstub.HexToFile(mm_datasourcefilename, mm_contentstring, "overwriteifexists|removeonunload|base64");
                if (mm_donotattach != "true") {
                  if (mm_filetypeallowed != "true") {
                    mm_donotattach = "true";
                  }
                }
                fileoperation = "edit mailmerge";
                if (filereadonly == "true") {
                  if (mm_donotattach == "true") {
                    fileoperation = "read";
                  }
                  else {
                    fileoperation = "read mailmerge";
                  }
                }
                else if (mm_donotattach == "true") {
                  fileoperation = "edit";
                }
                fscstub.DavEdit(davurl, fileobjname, fileextension, localfile, fileverb, fileoperation, filesize);
              }
            }
            else {
              fscstub.DavEdit(davurl, fileobjname, fileextension, fileoleclassid, fileverb, fileoperation, filesize);
            }
          }
        }
        if (ismodal && g_isie) {
          var modaltext = window.document.getElementById("FscModal");
          if (modaltext) {
            modaltext.style.visibility = "visible";
          }
          window.setTimeout(function() {
            vappcheckmodal(davurl, closewindow)
          }, 1000);
        }
      }
      else {
        exportfile = true;
      }
    }
  }
  if (exportfile) {
    vappexportcontent(closewindow, fileobjaddress, saveobjname, filepath, fileextension, readonly);
    g_vappdelayedrequest = window.setTimeout(vappdosubmit, 5000);
  }
  else if (!ismodal) {
    vappdosubmit();
    if (closewindow) {
      window.close();
    }
  }
}

// fscvenv-sendcopyscr
function vappgetmailaddrdisplay(addr, disp, type)
{
  if (!disp) {
    disp = addr;
  }
  if (type && disp && type.toLowerCase()=="fax" && disp.indexOf(":") == -1) {
    disp = "[FAX:"+disp+"]";
  }
  return disp;
}

function vappmozmail(fscstub, to, cc, bcc, subject, body, finalizedattachments)
{
  vappenableprivilege(fscstub)("UniversalXPConnect");
  fscstub.OpenMailComposerWithAttachments(to, cc, bcc, subject, body, finalizedattachments.join("|"));
}

function vappiemail(sendstub, tos, todisps, totypes, ccs, ccdisps, cctypes, bccs, bccdisps, bcctypes, subject, body, timeoutms)
{
  for (var idx = 0, cnt = tos.length; idx < cnt; idx++) {
    var currto = vappgetmailaddrdisplay(tos[idx], todisps[idx], totypes[idx]);
    if (currto) {
      sendstub.AddTo(currto, totypes[idx], tos[idx]);
    }
  }
  if (subject) {
    sendstub.SetText(body, subject);
  }
  for (var idx = 0, cnt = ccs.length; idx < cnt; idx++) {
    var currcc = vappgetmailaddrdisplay(ccs[idx], ccdisps[idx], cctypes[idx]);
    if (currcc) {
      sendstub.AddCc(currcc, cctypes[idx], ccs[idx]);
    }
  }
  for (var idx = 0, cnt = bccs.length; idx < cnt; idx++) {
    var currbcc = vappgetmailaddrdisplay(bccs[idx], bccdisps[idx], bcctypes[idx]);
    if (currbcc) {
      sendstub.AddBcc(currbcc, bcctypes[idx], bccs[idx]);
    }
  }
  sendstub.Send(null);
}

function vappsend(to, cc, bcc, todisp, ccdisp, bccdisp, totype, cctype, bcctype, subject, body, addrstr, timeoutms, ispdf)
{
  var fscstub = vappgettoolmgr(true, 9130000),
      sendstub,
      mozattachments = new Array(),
      requurl = new Array(),
      setsubject = false;

  if (!subject) {
    subject = "";
    setsubject = true;
  }
  if (g_isie) {
    sendstub = vapp_resource("Fsc.Data.Send", 10120000, "FolioPlugin");
  }

  var addrparts = addrstr.split(";"),
      contcounturl = vappgenxmlrpc("COO.1.1001.1.87611", addrparts[0], addrparts.join(",") + "|" + (ispdf ? "true" : "false")),
      xmldictionary = vappcallsyncpostrpc(contcounturl, ""),
      objcnt = addrparts.length;

  if (xmldictionary) {
    var currdavurl = "",
        attachments = new Array(),
        textpropertyname = (g_isie) ? "text" : "textContent",
        action = (ispdf) ? "COO.1.1001.1.87351" : "COO.1.1001.1.39145",
        entries = xmldictionary.getElementsByTagName("dictionary");

    for (var e = 0, cnt = entries.length; e < cnt; e++) {
      var entry = entries[e];
      for (var c = 0, cnt2 = entry.childNodes.length; c < cnt2; c++) {
        var value = entry.childNodes[c];
        if (value.nodeType == 1) {
          var nodename = value.nodeName,
              nodenameparts = nodename.split("_"),
              currobj = nodenameparts[nodenameparts.length-1];
          if (!attachments[currobj]) {
            attachments[currobj] = new Array();
            attachments[currobj]["names"] = new Array();
            attachments[currobj]["exts"] = new Array();
          }
          if (nodename.indexOf("name") != -1) {
            attachments[currobj]["names"].push(value[textpropertyname]);
          }
          else if (nodename.indexOf("ext") != -1) {
            attachments[currobj]["exts"].push(value[textpropertyname]);
          }
        }
      }
    }

    for (var idx = 0; idx < objcnt; idx++) {
      var addr = addrparts[idx];
      if (attachments[addr]) {
        var names = attachments[addr]["names"],
            exts = attachments[addr]["exts"];
      
        for (var jdx = 0, cnt = names.length; jdx < cnt; jdx++) {
          var ext = (ispdf) ? "pdf" : exts[jdx],
              name = (names[jdx]) ? names[jdx] : "",
              args = (ispdf) ? addr + "&ARG2=" + ext + "&RES=ARG3&ARG4=" + jdx : "" + jdx;
          
          currdavurl = vappgenxmlrpc(action, addr, args);

          if (g_ismoz) {
            requurl.push(currdavurl);
            mozattachments.push([ vappsimplifyname(name, ext, new Array(";")), ext ]);
          }
          
          if (ext && name) {
            currdavurl += "&NAME=+/" + encodeURIComponent(vappsimplifyname(name, ext)) + "." + ext;
            if (setsubject) {
              if (idx > 0 && idx < objcnt && jdx < cnt) {
                subject += "; ";
              }
              subject += name;
            }
          }
          
          if (g_isie && sendstub) {
            try {
              var file = fscstub.GetLocalFileFromURL(currdavurl, "ansifilename");
              if (file) {
                var displayname = "" + vappsimplifyname(name, ext) + "." + ext;
                sendstub.AddFile(file, displayname);
              }
            }
            catch (e) {
            }
          }
        }
      }
    }
  }

  if (g_ismoz) {
    if (fscstub) {
      vappenableprivilege(fscstub)("UniversalXPConnect");
      var finalizedattachments = new Array(),
          observer = {
        totalobjects: requurl.length,
        observe: function(dummy, topic, data) {
          if (topic == "onCompleted") {
            if (--this.totalobjects == 0) {
              vappmozmail(fscstub, to, cc, bcc, subject, body, finalizedattachments);
            }
          }
        }
      }

      if (requurl.length>0) {
        for (var contidx = 0; contidx < requurl.length; contidx++) {
          var rc = fscstub.FetchRemoteFile(requurl[contidx], mozattachments[contidx][0], mozattachments[contidx][1], observer);
          finalizedattachments.push(rc);
        }
      }
      else {
        vappmozmail(fscstub, to, cc, bcc, subject, body, finalizedattachments);
      }
    }
  }
  else if (sendstub) {
    vappiemail(sendstub, to.split(";"), todisp.split(";"), totype.split(";"), cc.split(";"), ccdisp.split(";"), cctype.split(";"), bcc.split(";"), bccdisp.split(";"), bcctype.split(";"), subject, body, timeoutms); 
  }
}

// fscvenv-exportscr
function vappexportcontent(closewindow, objaddress, fileobjname, filepath, fileextension, isread)
{
  window.g_vappexportcount = (null!=window.g_vappexportcount && g_isie) ? window.g_vappexportcount + 1 : 0;
  window.setTimeout(function() {
    if (!fileobjname) {
      fileobjname = "tmp";
    }
    var davurl = vappgenfriendlyurl(objaddress, !isread, fileobjname, fileextension, filepath);
    if (window.g_isportlet) {
      var urlparts = window.location.href.split("/");
      davurl = urlparts[0] + "//" + urlparts[2] + davurl;
      window.open(davurl);
    }
    else if (isread) {
      window.open(davurl);
    }
    else if (!vappiswbt()) {
      vappexport(davurl);
    }
    if (closewindow) {
      window.close();
    }
  }, window.g_vappexportcount * 5000);
}

function vapp_viewoptionloadtemplate(tag)
{
  if (tag.className=="FscVOcmdButDis") {
    return false;
  }
  return vapp('loadtemplate',null,'loadtemplate')
}

function vapp_viewoptionsavetemplate(tag)
{
  if (tag.className=="FscVOcmdButDis") {
    return false;
  }
  return vapp('savetemplate',null,'savetemplate')
}

function vapp_handletemplatebutton(id, ident)
{
  if (id && ident) {
    var tag = window.document.getElementById(id);
    if (tag && tag.className == "FscVOcmdBut") {
      return vapp(''+ident,null,''+ident);
    }
    return false;
  }
}

function venv_checktemplatebutton(evt, isinit)
{
  var tagvisibility = false,
      selectbox = vappgetelementbyid("0_1");
  if (vappisselectbox(selectbox)) {
    var sbinput = vappgetsbinput(vappgetportletid("0_1"));
    if (sbinput) {
      if (isinit) {
        sbinput.onchange = venv_checktemplatebutton;
      }
      if (sbinput.value) {
        tagvisibility = true;
      }
    }
  }
  var buttontag = window.document.getElementById("venv_viewoptiontemplate");
  if (buttontag) {
    buttontag.className = (tagvisibility) ? "FscVOcmdBut" : "FscVOcmdButDis";
    if (g_vappis24hrec) {
      if (buttontag.getAttribute("onclick").indexOf("vapp24handleviewoptionclick")<0) {
        buttontag.setAttribute("onclick","vapp24handleviewoptionclick(\"venv_viewoptionsaveoptions\",this);" + buttontag.getAttribute("onclick"));
      }
    }
  }
}

// fscvenv-installstubscr
function venv_stubdlstart(url)
{
  var win = vappwindowopener();
  vappexport(url, win)
  if (win) {
    window.close();
  }
}

function venv_stubdlmsg(suitename, packname, pluginname, installtext, buttontext, notelabel, note_restart, note_trusted, note_admin, note_close)
{
  var packnames = packname.split("|"),
      pluginnames = pluginname.split("|"),
      notes = "",
      os_win = "Microsoft Windows",
      os_lnx = "Linux",
      os_mac = "Mac OS X",
      browser_ie = "Microsoft Internet Explorer",
      browser_ff = "Mozilla Firefox",
      browser_safari = "Safari",
      msgbox = window.document.getElementById("FscDLStub"),
      html = [];
  
  window.focus();
  if (msgbox != null) {
    if (!g_style) {
      g_style = new AjaxStyle();
    }
    g_style.Add("A.FscButton", g_vappcolor.button, g_vappcolor.buttonborder);
    g_style.Add("A.FscButton:hover", g_vappcolor.buttonhover);
    g_style.Add("BODY.FscBody DIV.FSCAjaxContainer TD.FscGridDataRead", g_vappcolor.container);
    g_style.AddEx("DIV#FscDLStub A.FscButton", "background-image:url(../tmp/i/l/COO.1.1.1.12948.png);");
    g_style.AddEx("DIV#FscDLStub DIV.FscDLNotes", "background-image:url(../tmp/i/l/COO.1.1.1.1418.png);");
    g_style.Apply();
    
    html.push("<p>"+installtext+"</p>");

    for (var i = 0, len = packnames.length; i < len; i++) {
      btntext = buttontext.split("[PLUGINNAME]").join(pluginnames[i]);
      html.push("<div class=\"FscDLButton\"><a href=\"javascript:venv_stubdlstart('" + vapphead() + "/fscasp/content/lib/" + packnames[i] + "')\" class=\"FscButton\">" + btntext + "</a></div>");
    }
    html.push("<div class='FscDLNotes'><strong>"+notelabel+"</strong>[NOTES]</div>");
    html = html.join("");
    
    if (g_isie) {
      notes += "<br />"+note_trusted;
      if (vappgettoolmgr(false)) {
        notes += "<br />"+note_close;
      }
      html = html.split("[NOTES]").join(notes);
      html = html.split("[BROWSER]").join(browser_ie);
    }
    else {
      notes += "<br />"+note_restart;
      html = html.split("[NOTES]").join(notes);
      if (g_issafari) {
        html = html.split("[BROWSER]").join(browser_safari);
      }
      else if (g_ismoz) {
        html = html.split("[BROWSER]").join(browser_ff);
      }
    }
    if (g_islinux) {
      html = html.split("[OS]").join(os_lnx);
    }
    else if (g_ismac) {
      html = html.split("[OS]").join(os_mac);
    }
    else {
      html = html.split("[OS]").join(os_win);
    }
    html = html.split("[SUITENAME]").join(suitename);
    msgbox.innerHTML = html;
  }
}
function VAPPImportObj(f,d,c,e,b){this.id=f;this.filenames=d;this.fileowner=e;this.importurl="";this.importlimit=null;this.uploadedfiles=0;this.errormsg="";this.evtsrc=b;var a=new Date();this.importid=""+a.getTime()+c;this.SetImportUrl=function(j){var i=this.filenames.split("|");var k=venvgendavurl(j,false);for(var h=0,g=i.length;h<g;h++){this.importurl+=k;this.importurl+="&CONTENT=FSCVENV_1_1001_importcontents("+h+")|";this.importurl+=i[h]+"|"}};this.SetImportInfo=function(i,h){var j=vappxmlgetdictionary(i);if(null!=j){var g=j.getElementsByTagName("error")[0];if(g){this.errormsg=vappxmlgettext(g);return}for(var j=j.firstChild;null!=j;j=j.nextSibling){switch(j.nodeName){case"objaddress"+this.importid:this.SetImportUrl(vappxmlgettext(j));break;case"importlimit":this.importlimit=vappxmlgettext(j);break;case"importlimitexceeded":if(h){h.SetLangString("COO.1.1001.1.87542",vappxmlgettext(j))}break;case"importnotification":if(h){h.SetLangString("COO.1.1001.1.87503",vappxmlgettext(j))}break}}}};this.Import=function(h){if(!this.errormsg){var g="";if(this.fileowner){g="removeonrelease"}try{this.uploadedfiles=h.Upload(this.importurl,g,this.importlimit,0,0,0,0,0,0);this.errormsg=(this.uploadedfiles>0)?"OK":"UPLOADCANCELED"}catch(i){this.errormsg=h.GetErrorDescription()}}return this.errormsg};this.HandleError=function(){if(this.errormsg=="UPLOADCANCELED"){vappcallhiddenrpc(vappempty,vappgenxmlrpc("COO.1.1001.1.87555","",this.importid))}else{vappstartapp(encodeURIComponent(this.errormsg),"COO.1.1001.1.87513",true,"FSCVENV@1.1001:MenuPrototype")}};this.GetFormStr=function(){var g=this.id+"_0="+this.filenames+"&";g+=this.id+"_1="+this.importid+"&";return g}}function vappisuploadinput(b,a){return a=="file"}function vapppushimportobjs(d,g,c,e,b,a){var f=new VAPPImportObj(d,g,c);e.push(f);b.push(f.GetFormStr());a.push(f.importid+"|")}function vappchangeform(e,f,c,b,a,g,d){e.action=f;e.s1.value=c;e.s2.value=b;e.s3.value=a;e.target=g;if(d){e.encoding=d}}function vappstartimport(r,f,b,d,l,e,n){if(g_vappis24hrec){vapp24bypasssendinfo(true)}if(null==e){e=f.length}if(null==n){n=e+1}var c=vapp_resourceget("Fsc.Data.Import",10150000);if(c){vappenableprivilege()("UniversalXPConnect");var j=20;c.Init(IMPORT_LIMIT,window.g_serverversnr,j);c.Import(b[0].filenames);f[n]="p6="+encodeURIComponent(c.fileInfo)+"&"}f[e]="p4="+encodeURIComponent(b[0].importid)+"&";var a=vappgetform(l),q=a.action,i=a.s1.value,h=a.s2.value,g=a.s3.value,m="",o="";for(var k=0,p=b.length;k<p;k++){m+=b[k].importid+";";o+=b[k].id+";"}var s=vappgetportleturl(vappbaseurl()+"&ax=COO.1.1001.1.239328&venv_importidstr="+m+"&venv_importfieldstr="+o+"&xhr=c");window.g_vappimportcallback=function(){d()};window.g_vapperrorcallback=function(t){vappseterror(t,l);vapphidehourglass(l);vappsetpagebusy(false)};vappchangeform(a,s,"","","","fscp","multipart/form-data");a.submit();vappchangeform(a,q,i,h,g,"","application/x-www-form-urlencoded")}function vappcontinueimport(){if(window.g_vappimportcallback){window.g_vappimportcallback();window.g_vappimportcallback=null}window.g_vapperrorcallback=null}function vappabortimport(a){if(window.g_vapperrorcallback){window.g_vapperrorcallback(a);window.g_vapperrorcallback=null}window.g_vappimportcallback=null}function vappcheckimport(k,f,g,i,a,h,d){if(i){var b=vappgettoolmgr(true,10150000);var c;if(null!=b){vappenableprivilege()("UniversalXPConnect");g.SetImportInfo(k,b);c=g.Import(b)}else{c="NOSTUB";g_pagebusy=false}if(c=="OK"){if(g_vappis24hrec){vapp24handleimport(g,true)}if(document.body.sys_describer){document.body.sys_describer.ImportFile(filenamelist[0])}if(h){vappdosubmit()}else{if(d){vapp("next")}else{var j=new Array(),e=null;j.push(i);if(a){j.push(a)}var e=j.join(",");vapp(5002,null,"['COO.1.1001.1.87361','("+e+")']")}}return true}}else{c="NOOBJECTORVIEW"}g.HandleError();g_pagebusy=false}function vappdropwebdavimport(h,i,f){f.SetMessageCallback(vapperrorcallback);g_vappdropfiles=f.ImportGetFileList(h);if(g_vappdropfiles){var b=i.IsTree()?i.GetSelView():i.GetView(),e=(g_vappdropfiles)?g_vappdropfiles.length:0,c=new Date(),a=c.getUTCFullYear();a+="-"+vappconvertNumToString(c.getUTCMonth()+1,2);a+="-"+vappconvertNumToString(c.getUTCDate(),2);a+="T"+vappconvertNumToString(c.getUTCHours(),2);a+=":"+vappconvertNumToString(c.getUTCMinutes(),2);a+=":"+vappconvertNumToString(c.getUTCSeconds(),2);var g=vappbaseurl()+"&ax=COO.1.1001.1.239334&venv_object="+i.GetObject()+"&venv_view="+b+"&venv_importid="+vappgetcontainerid()+"&venv_dropfilelength="+e+"&venv_currdatetime="+a;vappstartoverlayapp(g,700,400,null,true)}else{if(objaddrlist=vappgetobjaddrlist(f.GetObjectAddressList())){vappaddformfield("p7",objaddrlist);var d=3;vappstartdrop(i,null,d,objaddrlist)}}}function vapperrorcallback(b){var a=b.retok;if(!a){var c=vappbaseurl()+"&ax=COO.1.1001.1.239373&venv_message="+encodeURIComponent(b.retmsg)+"&venv_filename="+encodeURIComponent(b.filename)+"&ru=javascript:vappcloseoverlayapp()";vappstartoverlayapp(c,700,400,null,true)}}function vapphandleimportconfirm(c,a){var b=vappgetplugin(true,10260001,FSC_USECASE.FSC_IMPORT);
if(b){b.ImportConfirmed(c,a)}return(a)?true:vapp("cancel")}function vappconfirmcallback(a){vappaddformfield("p4",a.count);vappaddformfield("p5",a.host);vappaddformfield("p6",vappformatbytes(a.size));vappaddformfield("p7",vappformatbytes(a.size,0,true));vapp("next")}function vappcancelprogress(b){var a=vappgetplugin(true,10260001,FSC_USECASE.FSC_IMPORT);if(a){a.ImportBreak(b)}vapprefreshpending(vappgetcontainerid());return vapp("cancel")}function vappprogresscallback(e,d,b,a,g,h,c){if(e){var f="<table><tr><td>"+d;f+=":</td><td>"+e.currentfile;f+="</td></tr><tr><td>"+b;f+=":</td><td>"+h;f+=" "+g;f+=" "+vapphead().split("/")[2];f+="</td></tr><tr><td>"+a;f+=":</td><td>"+e.currfilecount;f+=" ("+vappformatbytes(e.currfilesize);f+=")</td></tr></table>";vappupdateprogress(e.currfilecount,e.filescount,f)}}function vapphandleoverwritecallback(b,c,d,a){g_vappchanging=true;g_vappreqfunc=function(){vapphandleoverwrite(b,c,d,a)};if(c=="cancel"){return vapp("cancel")}else{return vapp("next")}}function vapphandleoverwrite(d,e,f,a){var c=vappgetplugin(true,10260001,FSC_USECASE.FSC_IMPORT),b;if(c){if(e=="yes"){if(a){b=c.importFlags.ALL_WRITE}else{b=c.importFlags.WRITE}}else{if(e=="no"){if(a){b=c.importFlags.ALL_LEAVE}else{b=c.importFlags.LEAVE}}else{if(e=="cancel"){b=c.importFlags.CANCEL}}}c.ImportResolveConflict(d,f,b)}}function vappoverwritecallback(e,b){if(e){var d=e.importEntry,f=e.existingEntry,c=f.cooaddress,a;if(d&&f){a=vappbaseurl()+"&ax=COO.1.1001.1.239342&venv_object="+c+"&venv_importid="+b+"&venv_importexistingobject="+c+"&venv_importexistingisdirectory="+f.isdirectory+"&venv_importexistingfilename="+encodeURIComponent(f.filename)+"&venv_importexistingfilesize="+vappformatbytes(f.filesize)+"&venv_importexistingrelativepath="+encodeURIComponent(f.relativepath)+"&venv_importexistingmodifiedat="+encodeURIComponent(f.modifiedat)+"&venv_importexistingcreatedat="+encodeURIComponent(f.createdat)+"&venv_importimportisdirectory="+d.isdirectory+"&venv_importimportfilename="+encodeURIComponent(d.filename)+"&venv_importimportfilesize="+vappformatbytes(d.filesize)+"&venv_importimportrelativepath="+encodeURIComponent(d.relativepath)+"&venv_importimportmodifiedat="+encodeURIComponent(d.modifiedat)+"&venv_importimportcreatedat="+encodeURIComponent(d.createdat)+"&venv_importconflictcount="+e.conflictcount+"&ru=javascript:vappcloseoverlayapp()";vappstartoverlayapp(a,700,400,null,true)}}}function vappcompletecallback(e,d,i,j){var a=(e)?e.addresslist:"",b=(e)?e.retok:"false",f="";if(b){var c=vappcloseoverlayapp();if(a.length>0){f="[";f+=a.join(",");f+="]"}if(j=="true"){vappsetcontainer(c);var g=","+d+",,"+i+",,"+f+","+b+","+j;vapp(5002,null,"['COO.1.1001.1.239367','("+g+")']")}else{var h=vappbaseurl()+"&ax=COO.1.1001.1.239367&venv_parent="+d+"&venv_view="+i+"&venv_importobjects="+f+"&venv_importok="+b+"&venv_shareinfinalize="+j;vappstartoverlayapp(h,700,400,null,true);vapprefreshpending(vappgetcontainerid())}}}var g_dragurl;function vappgetdragtargetargs(a){g_vappargs.Init(a);if(g_vappargs.GetLen()&&g_vappargs.CheckClientFlag("DRAGDROP")){return g_vappargs}var b=vappgetlist(a);if(b){return b.GetFscArgs()}}function vappdragstart(b){b=vappevtgeneral(b);if(!b){return false}var c=b.srcElement;g_vappargs.Init(c);g_dragurl=null;if(g_vappargs.GetLen()>0){vappselcheck(c,true);vappselsetobjects(g_vappargs);if(g_isalt){var a=vappgenxmlrpc("COO.1.1001.1.87611",g_vappargs.GetObject(),g_vappargs.GetSelObj());vappcallrpc(vappsetcontentinfo,a,g_vappargs.GetSelObj());b.returnValue=false;b.cancelBubble=true}else{var d=vappcreatedragurls(g_vappargs.GetSelObj(),g_vappargs.GetStr());if(!g_islinux&&b.dataTransfer){b.dataTransfer.setData("Text",d)}if(g_issafari||g_ismoz3||g_islinux){g_dragurl=d;if(!g_islinux){vappaddevent(document.body,"mousemove",function(){g_dragurl=null;vappremoveevent(document.body,"mousemove",arguments.callee)})}}if(b.dataTransfer){b.dataTransfer.effectAllowed="all"}if(!g_ismoz3){b.cancelBubble=true}}}}function vappdropeffect(i,j,d){var a,e;if(j){vappstoprowmove();if(j.CheckClientFlag("DRAGDROP")){var k=1,g=2,b=4,h=j.GetDropFlag(),f=(g_issafari4)?"link":"move";if(d){var c=(d.GetLen()>5&&d.GetObject()&&!d.IsPortal());if(c&&!j.IsReadOnly()){if((g_isshift&&g_isctrl)||d.GetSrcWdwId()!=window.g_vappddid){if(h&g){a="link"}}else{if(g_isctrl){if(h&k){a="copy"}}else{if(h&b){if(!d.IsReadOnly()&&d.GetParent()!=j.GetObject()){a=f}}else{if(h&g){a="link"}else{if(h&k){a="copy"}}}}}}else{if(d.IsPortal()&&j.IsPortal()){a=f}}}else{if(!j.IsReadOnly()&&!vappcheckaggregate(vappevent.gettarget(i))&&j.CheckClientFlag("CREATE")){window.focus();if(h&k){a=(g_ismoz&&!g_issafari)?f:"copy"}}}}}return a}function vappdragover(h){h=vappevtgeneral(h);if(!h){return false}var e,d=vappevent.gettarget(h),i=vappgetdragtargetargs(d),c=vappgetdragargs(h),b=vappdropeffect(h,i,c);if(!g_vapphighlight){g_vapphighlight=new VAPPHighlight()}if((g_islinux&&g_ismoz)||g_ismoz3){if(b){vappenableprivilege()("UniversalXPConnect");var j,g,f;if(j=Components.interfaces.nsIDragService){if(g=Components.classes["@mozilla.org/widget/dragservice;1"].getService(j)){if(f=g.getCurrentSession()){f.canDrop=true
}}}}}else{var a=vappobject(h.dataTransfer);if(b){a.dropEffect=b;e=i.GetSrcElement()}else{a.dropEffect=(g_isie&&!c)?"copy":"none"}}g_vapphighlight.Update(e);return vappevent.preventdefault(h)}function vappdrop(a,h){a=vappevtgeneral(a);vappsetcontainer(h,false,a);if(!a){return false}var g=vappevent.gettarget(a),f=vappgetdragtargetargs(g),d=vappgetdragargs(a);if(f&&vappdropeffect(a,f,d)){if(null!=d){vappstartdrop(f,d)}else{var b=f.CheckClientFlag("CREATE");if(b){var c=vappgetplugin(true,10260001,FSC_USECASE.FSC_IMPORT);if(c&&vappfunction(c.Supports)(FSC_USECASE.FSC_IMPORT)){if(g_vappchecksfailedrequired.length>0){var e=vappbaseurl()+"&ax=COO.1.1001.1.256907&venv_failedrequired="+g_vappchecksfailedrequired+"&venv_failedoptional="+g_vappchecksfailedoptional+"&venv_passed="+g_vappcheckspassed;vappstartoverlayapp(e,700,400,null,true)}else{vappdropwebdavimport(a,f,c)}}else{vappdropimport(a,f,d)}}vappobject(a.dataTransfer).dropEffect="none"}}g_vapphighlight.Update();g_dragurl=null;vappevent.cancelbubble(a);return vappevent.preventdefault(a)}function vappdropimport(b,h,g){var d=vapp_resource("Fsc.Data.Import",10160000,"FolioPlugin");if(d){g_pagebusy=true;var f=20,e;vappenableprivilege()("UniversalXPConnect");d.Init(IMPORT_LIMIT,window.g_serverversnr,f);d.ImportFromDataObject(b.dataTransfer);e=vappgetobjaddrlist(d.objectAddrList);if(e){vappaddformfield("p7",e);var a=3;vappstartdrop(h,g,a,e)}else{var c;if(g_vappis24hrec&&g_isie){c=d.fileInfo(true)}vappdragdropimport(b.srcElement,h,d.fileInfo,d.fileNameList,d.tookFileOwnership,c)}}}function vappdragdropimport(d,k,b,h,l,c){if(b){var g=vappgetform(),i=new VAPPImportObj("",h,0,l,d),e=vappgenxmlrpc("COO.1.1001.1.87506","",i.importid);if(g_vappis24hrec&&g_isie){i.vapp24fileinfo=c}vappaddformfield("p6",b);vappaddformfield("p4",i.importid);var a=(k.IsTree()||(k&&vappgetlistrow(k.GetSrcElement())))?k.GetSelView():k.GetView(),j=(vappisselectbox(d)&&!vappislistselecttool(d))?k.GetParent():k.GetObject();vappcallhiddenrpc(vappcheckimport,e,i,j,a)}}function vappcheckaggregate(b){var a=vappgetparentbyclassname(b,"FscList",10);if(a){a=g_renderlater[a.id];return a&&a.IsAggrList()}return false}function vappstartdrop(v,t,w,j){if(v.IsPortal()){vportdrop(t);return}else{if(t&&t.IsPortal()){return}}var s=1,k=2,r=4,h=true,u,f,x,d,b,c;if(t){u=t.GetObject();f=t.GetParent();x=t.GetIdx();d=t.GetView();h=t.IsReadOnly();b=t.GetSelObj();c=t.GetSelIdx()}else{b=j.join(",")}var p=v.GetSrcElement(),e=vappisselectbox(p)&&!vappislistselecttool(p),a=(e)?v.GetParent():v.GetObject(),l=(e)?null:v.GetParent(),n=v.GetIdx(),g=(v.IsTree()||vappgetlistrow(p))?v.GetSelView():v.GetView(),i="",m=v.GetDropFlag(),q=0;if(null!=w&&m>w){m=w}if(u!=a&&!v.IsReadOnly()){if(g_isshift&&g_isctrl||(t&&t.GetSrcWdwId()!=window.g_vappddid)){q=(m&k)?k:null}else{if(g_isctrl){q=(m&s)?s:null}else{if(m&r){q=(!h&&(f!=a||d!=g))?r:null}else{if(m&k){q=k}else{if(m&s){q=s}}}}}if(null!=q){if(!d){d=null}if(!g){g=null}if(!c){c=null}var o=u+","+f+","+x+","+d+","+a+","+l+","+n+","+g+","+q+","+i+",["+b+"],["+c+"]";vapp(5002,null,"['COO.1.1001.1.38638','("+o+")']")}}}function vappcreatedragurls(d,f){var c="",e=d.split(","),g=(vappurlhost)?vappurlhost+"/fscasp/content/bin/fscvext.dll?mx=":vappbaseurl()+"?mx=";window.g_vappddid=Math.round(Math.random()*9999);for(var b=0,a=e.length;b<a;b++){c+="("+g+e[b];if(f){c+="&fscargs="+f}c+="&ddid="+window.g_vappddid+")\n"}return c}function vappgetdragargs(b){var d;vappenableprivilege()("UniversalXPConnect");if(!g_islinux&&b.dataTransfer){d=b.dataTransfer.getData("Text")}if(!d&&g_dragurl){d=g_dragurl}if(d){var f=d.split("(");if(f.length>1){var e=f[1].split(")")[0];if(e){srcargs=vappgetargument("fscargs",e);if(srcargs){var c=new VAPPArgs(null,srcargs,null,vappgetargument("ddid",e)),g=c.GetObject();if(g){var a=g.split(",");if(a.length>1){c.SetSelObj(g);c.SetObject(a[0])}}return c}}}}}function vappgetobjaddrlist(d){if(d){var c=d.split("|"),e=[];c.sort();e[0]=c[0];for(var b=0,a=c.length;b<a;b++){if(c[b]!=c[b+1]&&b+1<a){e.push(c[b+1])}}return e}}function vappsetcontentinfo(n,d,i){var c=vappgettoolmgr();if(c&&i){var k=new Array();var e=new Array();var f=new Array();var g=i.split(",");for(var m=0,h=g.length;m<h;m++){var l=g[m];var j=l.split("@")[0];var a=n.getElementsByTagName("name0_"+j)[0];var b=n.getElementsByTagName("ext0_"+j)[0];if(a&&b){k.push(vappxmlgettext(a));e.push(vappxmlgettext(b));f.push(venvgendavurl(l,true,false)+"&CONTENT=COOSYSTEM_1_1_content(0)COOSYSTEM_1_1_contcontent(0)&TIMESTAMP="+vapprandomnumber(9999))}}if(k.length>0){c.exportMgr.Drag(f,k,e)}}};function vappselgetselection(a){if(a&&g_sellists[a]){return g_sellists[a]}if(!g_vappselgridelem){g_vappselgridelem=new VAPPSelection()}return g_vappselgridelem}function vappselgetfirstmenuid(c){var e=window.document.getElementsByName("L");for(var b=0,d=e.length;b<d;b++){var a=vappgetlistidfromatag(e[b]);if(a&&a.indexOf(c)>0){return a}}}function vappselsetpagemenu(a,c,b){if(!a){a=vappselgetfirstmenuid(c)}if(a){var d=vappselgetselection(a);if(d){d.SetData(window.document.getElementById(a),c,b);vappsetactsel(d,c)}}}function vappisselectable(a){return a&&!vappgetparentbyclassname(a,"FscInst|FscVDI|FscTree|FscACL",10)&&(!a.firstChild||a.firstChild.className!="FscInstantiate")}function vappselishelp(a){var b=(a)?a.firstChild:null;return b&&b.className&&b.className.indexOf("FscInfo")==0}function vappselislabeltag(a){return(a&&a.id.indexOf(FSC_GRIDLABEL_PFX)==0)}function vappselisdatatag(a){return(a&&a.id.indexOf(FSC_GRIDDATA_PFX)==0)}function vappselgetlabeltag(a){if(a){var c=a.id;var b=c.split(FSC_GRIDDATA_PFX).join(FSC_GRIDLABEL_PFX);return(b!=c)?window.document.getElementById(b):null}}function vappselgetdatatag(a,c){if(a){var e=a.id,d=e.split(FSC_GRIDLABEL_PFX).join(FSC_GRIDDATA_PFX);return(d!=e)?window.document.getElementById(d):null}else{if(c){var b=vappgetparentbyid(c,FSC_GRID_PFX,15);if(vappselislabeltag(b)){return vappselgetdatatag(b)}return b}}}function vappselcheck(b,d){if(vappisselectable(b)){var a=vappgetlistid(b);if(!g_selection||a!=g_selection.GetListId()||(!a&&!g_selection.IsSelected(b))){var c=vappselgetselection(a);if(c.SetData(b)){if(g_selection&&c&&g_selection!=c){g_selection.HighlightGrid(true);if(g_selection.IsList()){g_selection.HighlightList(true)}}vappsetactsel(c)}}else{if(g_selection){g_selection.SetFocusId(b)}}if(a){vappsellistitem(window.event,b,d)}}}function vappsellistitem(a,d,g,c){if(d){if(g_ismoz&&a&&a.button==2){g=true}if(!a||(a&&(a.button==1||a.button==0||g))){var h=vappgetparentbyclassname(d,"L|FscColNumber",20),e=vappgetparentbyattribute(h,"fscview",6);if(e){if(h.className=="FscColNumber"){h=vappgetparentbytagname(h,"|TD|","|DIV|")}vappinitselection(e.id,c);if(g_selection&&g_selection.CheckSelectable(d,g)){var b=g_selection.GetRowElem(h),f=!g&&!g_isctrl&&!g_isshift;g_selection.SetColumn(h,b);g_selection.SelectListItem(b,f,g,a);if(a&&(g_isctrl||g_isshift)){a.cancelBubble=true;a.returnValue=false}return g_selection}}}}}function vappselsimple(f){var g=vappgetparentbytagname(f,"|TR|","|TABLE|"),e=vappselgetrowargs(g);if(e){var c=vappgetparentbytagname(g,"|TABLE|","|BODY|"),h=window.document.getElementById("l"+c.id),j=vappselgetselstr(e[0],e[1]),i=f.checked,b=h.value,d=(i)?g_vapp_css.selection:null,a=(i)?null:g_vapp_css.selection;h.value=(i)?b+j:b.split(j).join("");vappselhighlight(g,d,a)}}function vappselgetrowargs(b){if(b){var a=b.getAttribute("fsctrargs");if(a){return a.split(",")}}}function vappselgetselstr(a,b){return(b)?a+"#"+b+";":a+";"}function vappselparseselstr(h,e,b,d){if(!d){var f=vappgetelementbyid("l"+h);if(f){d=f.value}}if(d){var g=d.split(";");for(var a=0;a<g.length;a++){if(g[a]){var c=g[a].split("#");e.push(c[0]);b.push(c[1])}}}}function vappselhighlight(b,c,a){if(a){vappremoveclass(b,a)}if(c){vappaddclass(b,c)}}function VAPPSelection(y,C){this.m_labeltag;this.m_datatag;this.m_focustag;this.GetLabel=function o(){if(!this.m_labeltag&&this.IsList()){this.m_labeltag=vappselgetlabeltag(vappgetparentbyid(this.GetListTab(),FSC_GRID_PFX,5))}return this.m_labeltag};this.HighlightGrid=function s(aa){if(this.m_labeltag){if(aa){vappremoveclass(this.m_labeltag,g_vapp_css.labelselection)}else{vappaddclass(this.m_labeltag,g_vapp_css.labelselection)}}if(this.m_datatag){if(aa){vappremoveclass(this.m_datatag,"FscDataSel")}else{vappaddclass(this.m_datatag,"FscDataSel")}}};this.SetData=function c(ae,ah,ab){var ad=false,aa=true,ai=vappgetparentbyid(ae,FSC_GRID_PFX,15);if(ai){var af,ag;if(vappselislabeltag(ai)){af=ai;ag=vappselgetdatatag(ai);aa=false}else{if(vappselisdatatag(ai)){ag=ai;af=vappselgetlabeltag(ai)}}}if((ag||this.m_listid)&&(this.m_datatag!=ag||g_selection!=this)){var ac=(this.m_listid)?window.document.getElementById(this.m_listid):vappgetfocustarget(ag);if(ac){this.m_focustag=ac;this.HighlightGrid(true);this.m_labeltag=af;this.m_datatag=ag;this.HighlightGrid();ad=true}}if(this.IsList()){this.HighlightList(false,ah,ab);ad=true}if(ad&&!ab){(aa)?this.SetFocusId(ae):this.SetFocus(ae)}return ad};this.SetFocus=function k(aa){if(vappisselectable(this.m_focustag)){this.SetFocusId(aa);if(!vappiseditableelem(aa)){vappfocus(this.m_focustag,true)}}};this.SetFocusId=function F(aa){var ab;if(vappiseditableelem(aa)){ab=(aa.name)?aa.name:aa.id;this.m_hasfocusid=true}else{if(!this.m_hasfocusid){if(this.m_listid){ab=this.m_listid}else{ab=(this.m_focustag.name)?this.m_focustag.name:this.m_focustag.id}}}if(ab){vappsetg_focusfieldid(ab)}};this.GetHelpPath=function q(){var aa;if(this.m_datatag){aa=this.m_datatag.getAttribute("fschelp");if(!aa&&this.m_labeltag){aa=this.m_labeltag.getAttribute("fschelp")
}}return aa};this.m_listid=C;this.m_list=y;this.m_isline=false;this.m_listcol=null;this.m_listcolidx=null;this.m_listpath="";this.m_lastlistselitem=null;this.m_listcontainer=null;this.m_buttons=[];this.m_items=[];this.m_idx=[];this.m_keys=[];this.m_keyidx=[];this.m_elems=[];this.GetListId=function G(){return this.m_listid};this.GetList=function D(){return this.m_list};this.IsAggrList=function w(){return this.m_list&&this.m_list.IsAggrList()};this.IsSimple=function L(){return this.m_list.IsSimple()};this.IsLine=function u(){return this.m_isline};this.GetListColumn=function K(){return this.m_listcol};this.GetKeys=function J(){return this.m_keys};this.GetIdx=function t(){return this.m_idx};this.ItemCount=function Z(){return this.m_elems.length};this.GetLastItem=function X(){return this.m_lastlistselitem};this.GetListView=function A(){return(this.m_list)?this.m_list.data.GetView():null};this.GetColIdx=function r(){return this.m_listcolidx};this.GetListPath=function i(){if(!this.m_listpath){this.m_listpath=this.m_list.GetColId(this.m_listcol)}return this.m_listpath};this.SetColumn=function E(ad,af){this.m_oldlistcolidx=this.m_listcolidx;if(this.IsThumb()){this.m_listcol=0;this.m_listcolidx=0}else{if(af){var ac=af.children,ae=0;for(var aa=0,ab=ac.length;aa<ab;aa++){var ag=ac[aa];if(ag.tagName=="TD"){if(ag==ad){this.m_listcol=ae;this.m_listcolidx=aa;break}if(vapphasclass(ag,"L")){ae++}}}}else{this.m_listcol=(this.m_listpath)?this.m_list.GetColIdx(this.m_listpath):0;this.m_listcolidx=(this.m_listpath)?this.m_listcol+this.m_list.GetEmptyColCount():0}}this.m_isline=(this.m_listcol==0&&((this.IsAggrList()&&this.m_listcolidx==0)||!this.IsAggrList()))};this.IsSelectedItem=function p(aa,ab){return this.m_keys[this.m_items[aa]]==ab};this.SelectItem=function x(ae,ad,ac){var aa=vappselgetrowargs(ae);if(aa){var ab=parseInt(aa[0]),af=aa[1];if(!this.m_isline){ae=ae.children[this.m_listcolidx]}if(this.IsSelectedItem(ab,af)){this.m_lastlistselitem=ae;if(ac){this.HighlightItem(ae,true);this.ClearItem(ab)}}else{if(ad){this.DeselectAllItems()}this.SetItem(ab,af,vappselgetselstr(ab,af),ae);this.HighlightItem(ae,false);return true}}return false};this.SelectListItem=function S(ad,al,aa,ah){if(ad){var aj=false,ao=this.m_listcolidx!=this.m_oldlistcolidx,ac=this.m_lastlistselitem,af=this.ItemCount();if(ao){this.m_listpath=null}if(al||ao){this.DeselectAllItems()}if(g_isshift&&!aa&&this.m_lastlistselitem){var aq=this.GetRowElem(ad),ac=this.GetRowElem(this.m_lastlistselitem);if(aq!=ac){var ag=this.GetItems(true);if(ag){var am=vappselgetrowargs(ad),ak=this.IsSelectedItem(parseInt(am[0]),am[1]),ab=false;for(var ai=0,ap=ag.length;ai<ap;ai++){var ae=ag[ai];if(ae==aq||ae==ac){this.SelectItem(ae,false,(ae==aq)?false:ak);if(!ab){ab=true}else{break}}else{if(ab){this.SelectItem(ae,false,ak)}}}this.m_lastlistselitem=aq;aj=true}}}else{aj=this.SelectItem(ad,aa,g_isctrl);if(ah&&vappisinplaceeditingallowed()){var an=(g_ismoz)?0:1,ar=(ah.target)?ah.target:ah.srcElement;if(ah.button==an&&af==1&&ar.tagName!="IMG"&&ac==this.m_elems[0]){g_vappeditinplace=true}else{if(g_vappeditinplace){g_vappeditinplace=false}}}}this.Persist();if(aj){this.m_oldlistcolidx=this.m_listcolidx;return this.m_lastlistselitem}}};this.SetItem=function O(ac,ae,aa,ab){var ad=(this.m_items[ac])?this.m_items[ac]:this.ItemCount();this.m_items[ac]=ad;this.m_idx[ad]=ac;this.m_keys[ad]=(ae)?ae:"";this.m_elems[ad]=ab;this.m_keyidx[ad]=aa;this.m_lastlistselitem=ab};this.ClearItem=function l(ac){var ad=this.m_items[ac];this.m_items[ac]=null;this.m_idx.splice(ad,1);this.m_keys.splice(ad,1);this.m_elems.splice(ad,1);this.m_keyidx.splice(ad,1);for(var ab=0,aa=this.m_items.length;ab<aa;ab++){if(this.m_items[ab]>ad){this.m_items[ab]--}}};this.GetEraseClass=function v(aa){return(vapphasclass(aa,g_vapp_css.inactiveselection))?g_vapp_css.inactiveselection:g_vapp_css.selection};this.HighlightList=function b(ac,ab,aa){var ad=(ac)?g_vapp_css.inactiveselection:g_vapp_css.selection,ae=(ac)?g_vapp_css.selection:g_vapp_css.inactiveselection;this.HighlightItems(ad,ae)};this.HighlightItem=function g(ac,aa,ad,ae){if(ac){if(!ad){ad=(!aa)?g_vapp_css.selection:null;ae=(aa)?this.GetEraseClass(ac):null}vappselhighlight(ac,ad,ae);if(g_vapppopupcomp==1){var ab=ac.getElementsByTagName("A")[0];if(ab){ab.alt=(aa)?"":vappgetstring(FSC_STRSELECTED)}}}};this.HighlightItems=function H(ac,ad){if(this.m_elems.length>0){for(var ab=0,aa=this.m_elems.length;ab<aa;ab++){this.HighlightItem(this.m_elems[ab],(ad),ac,ad)}}};this.SelectItemLines=function Q(){if(!this.m_isline&&this.ItemCount()){var ab=this.m_elems;this.DeselectAllItems();this.m_listpath=null;this.SetColumn();for(var aa=0,ac=ab.length;aa<ac;aa++){this.SelectItem(this.GetRowElem(ab[aa]))}this.Persist()}};this.SelectAllItems=function T(){var ab=this.GetItems(true);if(ab){this.DeselectAllItems();this.m_listpath=null;this.SetColumn();for(var aa=0,ac=ab.length;aa<ac;aa++){this.SelectItem(ab[aa])}this.Persist()}};this.DeselectAllItems=function z(){this.HighlightItems(null,g_vapp_css.selection);
this.m_items=new Array();this.m_idx=new Array();this.m_keys=new Array();this.m_keyidx=new Array();this.m_elems=new Array();this.m_lastlistselitem=null};this.GetItems=function V(aa){var ab=this.m_listcontainer;if(!ab){ab=this.GetListTab();if(ab){if(this.IsThumb()){if(ab.className!="FscListRv"){ab=window.document.getElementById("FscThumbs"+ab.id)}}else{ab=ab.children[ab.children.length-1]}}if(aa){this.m_listcontainer=ab}}return(ab)?ab.children:null};this.GetSelObjects=function Y(){if(this.m_isline){return this.m_keys}else{var ac=new Array(),ab=new VAPPArgs(this.m_elems[0]),ae=ab.GetObject();if(ae){ac.push(ae);for(var aa=1,ad=this.m_elems.length;aa<ad;aa++){ab.Init(this.m_elems[aa]);ac.push(ab.GetObject())}}return ac}};this.Persist=function e(){var ab=this.GetListInput();if(ab){var aa=this.m_keyidx.join("");if(aa&&!this.m_isline){aa+="/"+this.GetListPath()}ab.value=aa}this.UpdateButtons();this.FireSelectionEvent()};this.SelectionFromForm=function N(am){var ab=this.GetItems(false);if(ab&&am){var ag=am.split("/");if(ag[1]){this.m_listpath=ag[1]}this.SetColumn();ag=ag[0].split(";");for(var ak=0,ai=ag.length;ak<ai;ak++){var aa=ag[ak];if(aa){var ad=aa.split("#"),ah=ad[0],al=(ad[1])?ad[1]:"";for(var af=0,aj=ab.length;af<aj;af++){var ac=ab[af],ae=vappselgetrowargs(ac);if(ae&&ae[0]==ah&&ae[1]==al){if(!this.m_isline){ac=ac.children[this.m_listcolidx]}this.SetItem(ah,al,aa+";",ac);this.HighlightItem(ac,false);break}}}}}else{this.SetColumn()}};this.IsList=function I(){return(this.m_listid)?true:false};this.GetListTab=function M(){return(this.IsList())?window.document.getElementById(this.m_listid):null};this.GetListInput=function d(){return window.document.getElementById("l"+this.m_listid)};this.IsSelected=function U(aa){return(aa&&(this.m_datatag==aa||this.m_labeltag==aa))};this.IsEditableCell=function n(){if(this.m_listid&&!this.IsAggrList()&&this.ItemCount()==1){if(null!=this.m_listcol&&!this.IsSimple()){return this.m_list.ColHasCtl(this.m_listcol)}}return false};this.GetCellElem=function f(aa){if(!aa){aa=this.m_elems[0]}if(aa&&aa.tagName=="TR"){aa=aa.children[this.m_listcolidx]}return aa};this.GetCellId=function a(){return vappgetsimpleid(this.m_listid)+"_"+this.m_idx[0]+"_"+this.m_listcol};this.GetRowElem=function h(aa){if(!this.IsThumb()){return vappgetparentbytagname(aa,"|TR|","|TBODY|")}return aa};this.SetButtons=function B(ab,ae){this.m_buttons=new Array();this.m_buttonsenabled=null;if(ab){var ad=ab.getElementsByTagName("A");for(var aa=0,ac=ae.length;aa<ac;aa++){this.m_buttons.push(ad[ae[aa]])}this.UpdateButtons()}};this.UpdateButtons=function j(){var ab=this.ItemCount()>0;if(this.m_buttonsenabled!=ab){for(var aa=0,ad=this.m_buttons.length;aa<ad;aa++){var ac=this.m_buttons[aa];if(ab){vappremoveclass(ac,"FscBtDis");ac.href="#"}else{vappaddclass(ac,"FscBtDis");ac.removeAttribute("href")}}this.m_buttonsenabled=ab}};this.CheckSelectable=function W(ab,aa){if(this.IsThumb()){if(aa&&ab.tagName!="IMG"){this.DeselectAllItems();return false}}else{if(this.IsSimple()){return false}}return true};this.FireSelectionEvent=function m(){if(vappgetportlet().IsExplore()){var aa=this;this.ClearSelectionEventTimeout();this.m_timeout=window.setTimeout(function(){vappfireevent("SelectListItem",function(ab,ac){vapptaskupdate(ab,ac,aa)})},500)}};this.ClearSelectionEventTimeout=function P(){window.clearTimeout(this.m_timeout)};this.IsThumb=function R(aa){return this.m_list.IsThumb()}}function vappseladdlist(d,b,e){var a=d.GetListId(),c=(e)?g_sellists[a]:new VAPPSelection(d,a);c.SelectionFromForm(b);if(d.IsSimple()){c.SetData(window.document.getElementById(a))}g_sellists[a]=c}function vappselgetlistselection(a,b){return g_sellists[vappgetportletid(a,b)]}function vappsellistcleanup(){for(listkey in g_sellists){if(!g_sellists[listkey].GetListInput()){delete (g_sellists[listkey])}}}function vappseladdlistmenu(a,b){var c=vappselgetselection(a);c.SetMenuHtm(b)}function vappinitselection(a,b){vappsetactsel(g_sellists[vappgetportletid(a,b)],b)}function vappselsetobjects(c,a,f){var e=(f)?vappsellistitem(a,f,true):g_selection;if(e){var b=e.GetSelObjects(),d=e.GetIdx();c.SetSelObj(b.join(","));c.SetSelIdx(d.join(","))}};/*------------------------------------------------------------------------------
Copyright (c) Fabasoft R&D Software GmbH & Co KG, A-4020 Linz, 1995-2006.
 
Alle Rechte vorbehalten. Alle verwendeten Hard- und Softwarenamen sind
Handelsnamen und/oder Marken der jeweiligen Hersteller.
 
Der Nutzer des Computerprogramms anerkennt, dass der oben stehende
Copyright-Vermerk im Sinn des Welturheberrechtsabkommens an der vom
Urheber festgelegten Stelle in der Funktion des Computerprogramms
angebracht bleibt, um den Vorbehalt des Urheberrechtes genuegend zum
Ausdruck zu bringen. Dieser Urheberrechtsvermerk darf weder vom Kunden,
Nutzer und/oder von Dritten entfernt, veraendert oder disloziert werden.
 -----------------------------------------------------------------------------*/

function VAPPVarSet()
{
  this.page = null;
  this.s1 = null;
  this.s2 = null;
  this.s3 = null;
  this.g_tmppath = "../tmp";
  this.g_tabcontainer = null;
  this.g_defaultbranch = null;
  this.g_cancelbranch = null;
  this.g_delayedbranches = new Array();
  this.vapponload =        new Array();
  this.vapponlayout =      new Array();
  this.vapponevt =         new Array();
  this.vapponchangefont =  new Array();
  this.vapponexit =        new Array();
  this.vapponvapp =        new Array();
  this.aborttx = null;
  this.resizearea = null;
  this.resetscrollareas = new Array();
  
  this.isdirty = false;
  this.actsel = null;
  this.isprint = false;
  this.hasfocusevts = false;
  
  // portlet vars
  this.g_portletstarturl=null;
  this.g_servleturl=null;
  this.g_portletaction=null;
  
  this.Clear = function VAPPVarSet_Clear()
  {
    this.vapponevt = new Array();
    this.vapponlayout = new Array();
    this.vapponchangefont = new Array();
    this.resizearea = null;
    this.resetscrollareas = new Array();
    this.hasfocusevts = false;
    this.actsel = null;
    g_selection = null;
  }
}

//----------------------------------------------------------------------------------

function vappinitvarset(id, s1, s2, s3)
{
  if (!window.g_vappvar) {
    window.g_vappvar = [];
  }
  if (id) {
    window.g_vappcontainerid = id;
    var varset = vappsetvarset(id);
    vappsetportletvars(varset);
  }
}

function vappgetcontainerid()
{
  return window.g_vappcontainerid;
}

function vappgetportletid(prefix, contid) 
{
  var id = (null!=prefix) ? ""+prefix : "";
  if (null==contid) {
    contid = vappgetcontainerid();
  }
  if (null!=contid) {
    if (id.indexOf(contid)<0) {
      id+= contid;
    }
  }
  return id;
}
function vappgetsimpleid(fullid, contid)
{
  if (null==contid) {
    contid = vappgetcontainerid();
  }
  if (fullid && contid) {
    return fullid.split(contid)[0];
  }
}

function vappmanageselection(newid, oldid)
{
  if (oldid) {
    var oldvarset = window.g_vappvar[oldid];
    if (oldvarset) {
      oldvarset.actsel = g_selection;
    }
  }
  var newvarset = window.g_vappvar[newid];
  if (newvarset) {
    g_selection = newvarset.actsel;
  }
}

function vappsetcontainer(contid, forceset, evt)
{
  if (contid) {
    var oldid = window.g_vappcontainerid;
    if (oldid!=contid) {
      if (!forceset) {
        if (!evt) {
          evt = window.event;
        }
        if (evt) {
          var evtsrc = evt.srcElement;
          if (evtsrc) {
            var portlet = vappgetportlet(oldid);
            if (portlet && portlet.HasParent(contid)) {
              var containerid = vappgetcontaineridbyelem(evtsrc);
              if (containerid==oldid) {
                return;
              }
            }
          }
        }
      }
      vappmanageselection(contid, oldid);
      window.g_vappcontainerid = contid;
      vappupdatepageheaders(vappgetportlet(contid));
    }
    else {
      vappmanageselection(contid);
    }
  }
}

function vappgetcontainer(id)
{
  if (!id) {
    id = window.g_vappcontainerid;
  }
  if (id) {
    return window.document.getElementById(id);
  }
  return window.document;
}

function vappgetcontainerbyelem(elem)
{
  return vappgetparentbyclassname(elem, "FSCAjaxContainer|FscOverlayApp");
}

function vappgetcontaineridbyelem(elem)
{
  var container = vappgetcontainerbyelem(elem);
  return (container) ? container.id : null;
}

function vappgetelementbyid(id, contid)
{
  if (id) {
    var fullid = vappgetportletid(id, contid);
    return window.document.getElementById(fullid);
  }
}

function vappgetvarset(id, ignoreprint)
{
  try {
    if (!id) {
      id = window.g_vappcontainerid;
    }
    if (id) {
      var varset = window.g_vappvar[id];
      return (varset && (!varset.isprint || ignoreprint)) ? varset : null;
    }
  }
  catch (e) { }
}

function vappsetvarset(id, varset)
{
  try {
    if (id) {
      if (!varset) {
        varset = new VAPPVarSet();
      }
      if (window.g_vappvar) {
        window.g_vappvar[id] = varset;
      }
    }
  }
  catch (e) { }
  return varset;
}

function vappclearvarset(id)
{
  if (id && window.g_vappvar && window.g_vappvar[id]) {
    delete(window.g_vappvar[id]);
  }
}

function vappsetprint(id, isprint)
{
  var varset = vappgetvarset(id, true);
  if (varset) {
    varset.isprint = isprint;
  }
}

function vappclearvars(id)
{
  var varset = vappgetvarset(id);
  if (varset) {
    varset.Clear();
  }
}

//----------------------------------------------------------------------------------

function vappgetpage(id)
{
  var page;
  if (!id) {
    id = window.g_vappcontainerid;
  }
  var varset = vappgetvarset(id);
  if (varset) {
    if (!varset.page) {
      varset.page = new ajaxPage(id);
    }
    page = varset.page;
  }
  return page;
}

function vappgetg_tabcontainer(id)
{
  var varset=vappgetvarset(id);
  if (varset) {
    return varset.g_tabcontainer;
  }
}
function vappsetg_tabcontainer(value, id)
{
  var varset=vappgetvarset(id);
  if (varset) {
    varset.g_tabcontainer=value;
  }
}

function vappgetg_tmppath(id)
{
  var varset=vappgetvarset(id, true);
  if (varset) {
    return varset.g_tmppath;
  }
}
function vappsetg_tmppath(value, id)
{
  var varset=vappgetvarset(id);
  if (varset) {
    varset.g_tmppath=value;
  }
}

function vapppushonload(value, id)
{
  var varset=vappgetvarset(id);
  if (varset) {
    varset.vapponload.push(value);
  }
}
function vappexeconload(id)
{
  var varset = vappgetvarset(id);
  if (varset) {
    var vappload = varset.vapponload;
    if (vappload) {
      for (var idx=0; idx<vappload.length; idx++) {
        vappload[idx]();
      }
    }
    varset.vapponload = new Array();
  }
}

function vapppushonlayout(value, id)
{
  var varset=vappgetvarset(id);
  if (varset) {
    varset.vapponlayout.push(value);
  }
}
function vappexeconlayout(isinit, id)
{
  var varset = vappgetvarset(id);
  if (varset) {
    var vapponlayout = varset.vapponlayout;
    if (vapponlayout) {
      for (var idx=0; idx<vapponlayout.length; idx++) {
        vapponlayout[idx](isinit);
      }
    }
  }
}

function vapppushonevt(value, id, isunique)
{
  var varset=vappgetvarset(id);
  if (varset) {
    var evtfuncs = varset.vapponevt;
    if (isunique) {
      for (var idx=0, cnt=evtfuncs.length; idx<cnt; idx++) {
        if (""+evtfuncs[idx]==""+value) {
          return;
        }
      }
    }
    varset.vapponevt.push(value);
  }
}
function vappexeconevt(evt, id)
{
  var varset = vappgetvarset(id);
  if (varset) {
    var vapponevt = varset.vapponevt;
    if (vapponevt) {
      for (var idx=0; idx<vapponevt.length; idx++) {
        vapponevt[idx](evt);
      }
    }
  }
}

function vapppushonchangefont(value, id)
{
  var varset=vappgetvarset(id);
  if (varset) {
    varset.vapponchangefont.push(value);
  }
}
function vappexeconchangefont(id)
{
  var varset = vappgetvarset(id);
  if (varset) {
    var vapponchangefont = varset.vapponchangefont;
    if (vapponchangefont) {
      for (var idx=0; idx<vapponchangefont.length; idx++) {
        vapponchangefont[idx]();
      }
    }
  }
}

function vapppushonexit(value, id)
{
  var varset=vappgetvarset(id);
  if (varset) {
    varset.vapponexit.push(value);
    return varset.vapponexit.length-1;
  }
}
function vappexeconexit(id)
{
  var varset = vappgetvarset(id);
  if (varset) {
    var vapponexit = varset.vapponexit;
    if (vapponexit) {
      for (var idx=0; idx<vapponexit.length; idx++) {
        vapponexit[idx]();
      }
    }
    varset.vapponexit = new Array();
  }
}
function vappclearonexit(idx, id)
{
  var varset = vappgetvarset(id);
  if (varset) {
    if (varset.vapponexit[idx]) {
      varset.vapponexit.splice(idx, 1);
    }
  }
}

function vapppushonvapp(value, id)
{
  var varset=vappgetvarset(id);
  if (varset) {
    varset.vapponvapp.push(value);
  }
}
function vappexeconvapp(id)
{
  var varset = vappgetvarset(id);
  if (varset) {
    var vapponvapp = varset.vapponvapp;
    if (vapponvapp) {
      for (var idx=0; idx<vapponvapp.length; idx++) {
        vapponvapp[idx]();
      }
    }
  }
}
function vappclearonvapp(id)
{
  var varset = vappgetvarset(id);
  if (varset) {
    varset.vapponvapp = new Array();
  }
}

function vappgetaborttx(id)
{
  var varset=vappgetvarset(id);
  if (varset) {
    return varset.aborttx;
  }
}
function vappsetaborttx(value, id)
{
  var varset=vappgetvarset(id);
  if (varset) {
    varset.aborttx=value;
  }
}

function vappgetresizearea(id)
{
  var varset=vappgetvarset(id);
  if (varset) {
    return varset.resizearea;
  }
}
function vappsetresizearea(value, id)
{
  var varset=vappgetvarset(id);
  if (varset) {
    varset.resizearea=value;
  }
}

function vappgetresetscrollareas(id)
{
  var varset=vappgetvarset(id);
  if (varset) {
    return varset.resetscrollareas;
  }
}
function vapppushresetscrollareas(value, id)
{
  if (value) {
    var varset=vappgetvarset(id);
    if (varset) {
      varset.resetscrollareas.push(value);
    }
  }
}

function vappisdirty(id)
{
  var varset=vappgetvarset(id);
  if (varset) {
    return varset.isdirty;
  }
}
function vappsetdirty(value, id)
{
  var varset=vappgetvarset(id);
  if (varset) {
    varset.isdirty=value;
  }
}

function vappgetg_defaultbranch(id)
{
  var varset=vappgetvarset(id);
  if (varset) {
    return varset.g_defaultbranch;
  }
}
function vappsetg_defaultbranch(value, id)
{
  var varset=vappgetvarset(id);
  if (varset) {
    varset.g_defaultbranch=value;
  }
}

function vappgetg_cancelbranch(id)
{
  var varset=vappgetvarset(id);
  if (varset) {
    return varset.g_cancelbranch;
  }
}
function vappsetg_cancelbranch(value, id)
{
  var varset=vappgetvarset(id);
  if (varset) {
    varset.g_cancelbranch=value;
  }
}

function vappgetg_delayedbranches(id)
{
  var varset = vappgetvarset(id);
  if (varset) {
    return varset.g_delayedbranches.join("**");
  }
}
function vapppushg_delayedbranches(value, id, idx)
{
  var varset = vappgetvarset(id);
  if (varset) {
    if (null==idx) {
      idx = varset.g_delayedbranches.length;
    }
    varset.g_delayedbranches[idx] = value;
    return idx;
  }
}
function vappclearg_delayedbranches(id, idx)
{
  var varset = vappgetvarset(id);
  if (varset) {
    if (idx) {
      varset.g_delayedbranches.splice(idx, 1);
    }
    else {
      varset.g_delayedbranches = new Array();
    }
  }
}

function vappsetactsel(value, id)
{
  g_selection = value;
  var varset = vappgetvarset(id);
  if (varset) {
    varset.actsel = value;
  }
}

function vappsethasfocusevts(id, value)
{
  var varset = vappgetvarset(id);
  if (varset) {
    varset.hasfocusevts = value;
  }
}

function vapphasfocusevts(id)
{
  var varset = vappgetvarset(id);
  if (varset) {
    return varset.hasfocusevts;
  }
}

//----------------------------------------------------------------------------------
// portlet functions
function vappsetportletvars(varset)
{
  varset.g_portletstarturl = window.g_portletstarturl;
  if (window.g_isportlet) {
    varset.g_tmppath = window.g_portlettmppath;
    varset.g_servleturl = window.g_servleturl;
    varset.g_portletaction = window.g_portletaction;
    varset.g_portletwidth = window.g_portletwidth;
    varset.g_portletheight = window.g_portletheight;
  }
  else if (null==varset.g_portletstarturl) {
    varset.g_portletstarturl = window.location.href;
  }
}

function vappgetportleturl(fscurl)
{
  if (window.g_isportlet) {
    var servleturl = vappgetg_servleturl();
    if (!fscurl) {
      fscurl = vappgetg_portletstarturl();
    }
    else if (fscurl.indexOf(servleturl)<0) {
      return servleturl+encodeURIComponent(fscurl);
    }
  }
  return fscurl;
}

function vappgetportletsize(id)
{
  var size = new Array();
  var varset = vappgetvarset(id);
  if (varset) {
    size.push(varset.g_portletwidth);
    size.push(varset.g_portletheight);
  }
  return size;
}

function vappgetg_portletstarturl(id)
{
  var varset=vappgetvarset(id, true);
  if (varset) {
    return varset.g_portletstarturl;
  }
}
function vappsetg_portletstarturl(id, value)
{
  var varset=vappgetvarset(id);
  if (varset) {
    varset.g_portletstarturl=value;
  }
}

function vappgetg_servleturl(id)
{
  var varset=vappgetvarset(id, true);
  if (varset) {
    return varset.g_servleturl;
  }
}
function vappsetg_servleturl(value, id)
{
  var varset=vappgetvarset(id);
  if (varset) {
    varset.g_servleturl=value;
  }
}

function vappgetg_portletaction(id)
{
  var varset=vappgetvarset(id);
  if (varset) {
    return varset.g_portletaction;
  }
}
function vappsetg_portletaction(value, id)
{
  var varset=vappgetvarset(id);
  if (varset) {
    varset.g_portletaction=value;
  }
}var g_sbselection;var g_sbqs;var g_sbkeystr="";function vappisselectbox(a){var b=(a)?a.className:null;return(b&&(b.indexOf("FscSB")==0||b==g_vapp_css.selectbox||(b.indexOf("FscInst")==0&&b!="FscInstCat")))}function vappisselectboxopen(b){if(b){if(vappissbvalue(b)||b.className.indexOf("FscInst")==0){return true}var a=window.document.getElementById("fscsb"),c="fscsb"+vappgetsbid(b.id);if(a&&(a.name==c)){return true}}else{return(window.document.getElementById("fscsb"))}return false}function vappissbvalue(a){return(a&&(vappisinstoption(a)||(vapphasclass(a.parentNode,"FscSBList")&&a.style.display!="none")))}function vappgetsbvaluetag(b){var a=vappgetparentbytagname(b,"|A|","|BODY|");return(vappissbvalue(a))?a:null}function vappisobjectoption(a){return a&&a.getElementsByTagName("IMG").length>0}function vappisinstoption(a){return(vapphasclass(a,"FscInstOption"))}function vappisinstantiate(a){return(null!=vappgetelementbyid("Inst"+a))}function vappgetinstoption(d){if(d){var b=d.getElementsByTagName("A");for(var a=0,c=b.length;a<c;a++){if(vappisinstoption(b[a])){return b[a]}}}}function vappgetlistselecttool(a){return vappgetparentbyclassname(a,"FscSelectTool",3,"|DIV|")}function vappislistselecttool(a){return vappgetlistselecttool(a)?true:false}function vappenablesb(b){var a=vappgetparentbyclassname(b,"FscSelectTool FscDisabled",3,"|DIV|");if(a){if(b.tagName!="INPUT"){b=a.getElementsByTagName("INPUT")[0]}if(b&&b.value==vappgetstring(FSC_STRSEARCH)){b.value=""}vappremoveclass(a,"FscDisabled");window.g_vappenabledsb=a;vappaddevent(document.body,"mousedown",vappdisablesb);vappaddevent(document.body,"keydown",vappdisablesb)}}function vappdisablesb(){if(vappgetlistselecttool(window.event.srcElement)!=window.g_vappenabledsb){if(window.g_vappenabledsb){var a=window.g_vappenabledsb.getElementsByTagName("INPUT")[0];if(a&&!a.value){a.value=vappgetstring(FSC_STRSEARCH)}vappaddclass(window.g_vappenabledsb,"FscDisabled");window.g_vappenabledsb=null}vappremoveevent(document.body,"mousedown",arguments.callee);vappremoveevent(document.body,"keydown",arguments.callee)}}function vappgetsbvalue(c,e){var b=c.getElementsByTagName("A");for(var a=0,d=b.length;a<d;a++){if(b[a].getAttribute("value")==e){return b[a]}}}function vappgetsbvalues(b){var a=window.document.getElementById("fscsb");if(a){return a.firstChild.children}if(vappissbvalue(b)){if(b.parentElement&&b.parentElement.tagName=="TD"){b=b.parentElement.parentElement}return b.parentElement.getElementsByTagName("A")}return false}function vappsbvaluemenu(b){if(!b){b=window.event}var c=vappgetsbvaluetag(b.srcElement);if(c){if(g_vappis24hrec){vapp24handlesbvaluectxmenu(c)}var a=c.getAttribute("value")+";;0";vappmenuopen(a,null,b.clientX-10,b.clientY-10,"")}}function vappgetsbhtm(c,d,f){var b,a,e=g_renderlater[f];if(g_vappis24hrec){b="vappchangesbvalue(arguments[0], null, false, false, true)"}else{b="vappchangesbvalue(arguments[0])"}a='<div class="FscSBList';if(e&&e.isenhancedsb){a+=" FscSbEnhanced"}a+='" onclick="return '+b+'" onkeydown="vappsbkeypress(arguments[0])"';if(window.vapptooltips&&e&&e.hasobjectoptions){a+=' onmouseover="vappsbmouseover()"'}if(d){g_vappargs.Init(d);if(g_vappargs.CheckClientFlag("CONTEXTMENU")||vappislistselecttool(d)){a+=' oncontextmenu="vappsbvaluemenu(arguments[0])"'}}a+=">"+c+"</div>";return a}function vappgetsboptionhtm(f,e,g,c,d,a){var b='<a href="#"';if(f){b+=' value="'+f}b+='">';b+=vappgetsboptioninnerhtm(f,e,g,c,d,a);b+="</a>";return b}function vappgetsboptionelem(c,b,d){var a=document.createElement("A");a.setAttribute("value",c);a.innerHTML=vappgetsboptioninnerhtm(c,b,d);return a}function vappgetsbemptyoptionhtm(b){var a='<a href="#" class="FscEmpty">';if(!b){b="&nbsp;"}a+="<span>"+b+"</span></a>";return a}function vappgetsboptioninnerhtm(g,f,h,d,e,a){var c="";if(!d&&h){h=MaskValue(h)}else{if(!h){h="&nbsp;"}}if(d){if(f){var b=vappgetportleturl(a+"/image/"+g+"/tn/");c+='<div><img alt="" src="'+b+'" /></div>';if(e){e[g]=f}}}else{if(f){c+=BaseIcon(f,"")}}c+="<span>"+h+"</span>";return c}function vappgetsb(c){if(c){var b;if((typeof(c)=="string")){b=window.document.getElementById(vappgetsbid(c))}else{b=c}return b}else{var a=window.document.getElementById("fscsb");if(a){return vappgetsb(a.name)}}}function vappgetsbid(a){if(a){if(a.indexOf("_v")>0){a=a.split("_v")[0].substr(1)}else{a=a.split("fscsb").join("")}}return a}function vappgetsbinput(a){return window.document.getElementById("f"+vappgetportletid(vappgetsbid(a))+"_v")}function vappgetqsinput(){var a=vappgetsb();if(a){return a.getElementsByTagName("INPUT")[0]}}function vappgetsbbutton(a){var c=vappgetparentbytagname(a,"|TD|","|DIV|"),b=(c)?c.nextSibling:a.nextSibling;while(b){if(b.className=="FscSBButton"){return b}b=b.nextSibling}}function vappissbinput(a){return(a&&vapphasclass(a,"FscSBInput"))}function vappgetfscsb(f,e){var d="fscsb"+f,b;for(var a=0,c=g_allfscsb.length;a<c;a++){b=g_allfscsb[a];if(b&&b.name==d){if((e&&b.fscisqs)||!e){return b}}}}function vappdestroyfscsb(b){var d;if(b){for(var a=0,c=g_allfscsb.length;
a<c;a++){if(g_allfscsb[a]&&g_allfscsb[a]==b){d=b.parentNode;if(d){d.removeChild(b)}g_allfscsb.splice(a,1);break}}}else{vappcloseselectbox();for(var a=0,c=g_allfscsb.length;a<c;a++){b=g_allfscsb[a];if(b){d=b.parentNode;if(d){d.removeChild(b)}}}g_allfscsb=new Array()}}function vapphandleselectbox(c,d,f,h,m){var o=window.event;if((g_isdirty&&!d)||!c||(o&&((vappissbinput(o.srcElement)&&!d)||o.button==2))){return}var g,e=vappgetsb(c),i=c,l=false;if(e&&!vapphasclass(e.parentElement,"FscDisabled")){c=vappgetsbid(c);g=window.document.getElementById("fscsb");var a=(d),b=(g)?g.getAttribute("loading"):false,p=(g)?g.name:null;vappcloseselectbox();if((p!="fscsb"+c&&!b)||(p=="fscsb"+c&&b)){var k=false,g=vappgetfscsb(c,f);if(g){if(!b){g.className="";if(g_vappis24hrec&&m){vapp24sendsbopenevent(i,e);l=true}vappopenselectbox(g,e);k=true}}else{if(!vappiswbt()){if(!g){g=document.createElement("SPAN");g.name="fscsb"+c;if(f){g.fscisqs=true}g.style.position="absolute";g.setAttribute("loading",true);g.innerHTML=vappgetsbhtm(vappgetsbemptyoptionhtm(vappgetstring(FSC_STRLOADING)),null,c);document.getElementsByTagName("BODY")[0].appendChild(g);g_allfscsb.push(g)}if(g_vappis24hrec&&m){vapp24sendsbopenevent(i,e);l=true}vappopenselectbox(g,e);if(!d){if(null==d){d=RenderRemainder(c)}if(!d){if(h){d=vappgetsbemptyoptionhtm()}}}}}if(d){g.innerHTML=vappgetsbhtm(d,e,c);g.removeAttribute("loading");if(g_vappis24hrec&&m&&!l){vapp24sendsbopenevent(i,e)}vappopenselectbox(g,e,a);k=true}if(k&&!f){var n=vappgetsbinput(c);if(n){var j=vappgetsbvalue(g,n.value);if(j){vappfocussbvalue(j,true)}else{vappsetsbselection(g,"first",true)}}}}}return g}function vappsbsethscrollbar(d,b,a){if(null==b){var c=vappgethelperelem();c.innerHTML=d.outerHTML;b=c.offsetWidth;c.innerHTML=""}if(a<b){d.style.overflowX="auto";return true}d.style.overflowX="";return false}function vappopenselectbox(g,c,a){var f=false,o=vappgetparentbytagname(c,"|TD|","|DIV|");if(o&&o.className=="FscSB"){c=o}else{o=vappgetlistselecttool(c);if(o){c=o;f=true}}g.style.width="";var e=g.firstChild,n=(f)?window.document.body.offsetWidth-(vappgetleft(c)+c.offsetWidth):vappgetleft(c),m=(f)?vappgettop(c)+c.offsetHeight:vappgettop(c)+c.offsetHeight-1,j=(g_ismoz)?window.innerHeight:window.document.body.offsetHeight,p=j-m,d,i=(a)?0:vappgetnumber(g.getAttribute("sbheight")),k=vappgetsbbutton(c),h=(k)?c.offsetWidth+k.offsetWidth:c.offsetWidth,l=e.offsetWidth+15,b=window.document.body.offsetWidth-n;if(h>l){l=h}g.style.width=(b>0&&l>b)?b+"px":l+"px";g.setAttribute("sbmaxwidth",b);i=(i>g.offsetHeight)?i:g.offsetHeight;g.setAttribute("sbheight",i);if(p>0&&p<i){if(p<100&&j-p>100){p=j-p;if(p<i){d=p-c.offsetHeight;e.style.height=d+"px"}m=m-g.offsetHeight-c.offsetHeight+1}else{p-=1;d=p;e.style.height=d+"px"}g.setAttribute("sbmaxheight",p)}else{if(vappsbsethscrollbar(e,h,b)&&g_isie){d=i+16;e.style.height=d+"px"}}(f)?g.style.right=n+"px":g.style.left=n+"px";g.style.top=m+"px";g.id="fscsb";vappaddpluginoverlay(g,d)}function vappdisableselectbox(a){if(a){vappaddclass(a.parentElement,"FscDisabled")}}function vappenableselectbox(a){if(a){vappremoveclass(a.parentElement,"FscDisabled")}}function vappcloseselectbox(a){var b=window.document.getElementById("fscsb");if(b){if(b.getAttribute("loading")||vappgetparentbyclassname(a,"FscSB|FscHidden",7)){return}if(b.fscisqs){vappdestroyfscsb(b)}else{b.className="FscHidden";if(g_ismoz){b.style.top=window.innerHeight+10;b.style.left=window.innerWidth+10}b.id=""}if(window.vapptooltips){a=vappgetsbvaluetag(a);if(vappisobjectoption(a)){vapptipreset(a.getAttribute("value"))}}vappfocussb(vappgetsb(b.name));vappmenuhide();return true}return false}function vappchangesbvalue(n,d,b,c,j){if(!d){d=(n)?n.target:window.event.srcElement}if(!c){d=vappgetsbvaluetag(d)}if(d){var g=window.document.getElementById("fscsb");b=vappgetsbid((b)?b:g.name);var k=(d.getAttribute("value"))?d.getAttribute("value"):"",a=false,m=vappgetsb(b),a=vappislistselecttool(m);if((g&&g.getAttribute("loading"))||(a&&!k)){return}if(b&&(g||c)){if(g&&g.fscisqs&&k){var l=vappgetfscsb(b);if(l){var f=vappgetsbvalue(l,k);if(!f){l.firstChild.appendChild(d);c=true}}}if(c){vappcallsyncrpc(vappgenxmlrpc("COO.1.1001.1.87755","",""+k))}if(m){if(a){if(g_vappis24hrec){vapp24handleselecttoolappend(d,vappgetsimpleid(b))}vappsetg_focusfieldid("x"+b);vapp(5002,vappgetsimpleid(b.substr(1)),"APPEND_SELECT:"+k)}else{if(g_vappis24hrec&&j){vapp24sendsbchangeevent(b,d,m)}var i=g_renderlater[b],o,p,h;if(i&&i.isenhancedsb){p=d.getElementsByTagName("SPAN")[0];if(p&&p.firstChild){o=p.firstChild.data}h=vappgetsboptioninnerhtm(k,i.icons[k],o,false)}else{h=d.innerHTML}m.innerHTML=h;g_vappargs.Init(m);if(g_vappargs.GetLen()>0){g_vappargs.SetObject(k);g_vappargs.Update()}var e=vappgetsbinput(b);if(e){e.value=k;vappfireonchange(e)}}}vappcloseselectbox()}}return false}function vappsetsbvalue(a,d,c){if(a){a.innerHTML=d;var b=vappgetsbinput(a.id);if(b){b.value=c}}}function vappfocussbvalue(c,d){var a=vappisinstoption(c),b=(a)?g_instselection:g_sbselection;if(c){if(a||g_isie7||g_isie6){vappremoveclass(b,g_vapp_css.selection);
vappaddclass(c,g_vapp_css.selection)}if(a){g_instselection=c}else{g_sbselection=c}b=c;if(c.tagName=="TR"){c=c.getElementsByTagName("A")[0]}if(d){vappfocus(c)}else{vappfocusnow(c)}}}function vappfocussb(c,a,d){if(c){var b=c.getElementsByTagName("INPUT")[0];if(b){c=b}g_sbselection=null;if(d){vappfocus(c,a)}else{vappfocusnow(c,a)}}}function vappsetsbselection(c,f,g){var e,i;if(vappisselectbox(c)&&!vappissbvalue(c)){if(!vappisselectboxopen(c)){vapphandleselectbox(c.id)}}var k=vappgetsbvalues(c);if(!k){return}var a;switch(f){case"keystr":case"first":for(var j=0,b=k.length;j<b;j++){var h=k[j];if(vappissbvalue(h)){var d=(""+h.innerText).toUpperCase();if(f!="keystr"||d.indexOf(g_sbkeystr)==0){a=h;break}}}break;case"last":for(var j=k.length-1;j>=0;j--){if(vappissbvalue(k[j])){a=k[j];break}}break;case"next":e=vappisinstoption(c);i=(e)?g_instselection:g_sbselection;if(i){for(c=i.nextSibling;null!=c;c=c.nextSibling){if(vappissbvalue(c)){a=c;break}}}break;case"prev":e=vappisinstoption(c);i=(e)?g_instselection:g_sbselection;if(i){for(c=i.previousSibling;null!=c;c=c.previousSibling){if(vappissbvalue(c)){a=c;break}}if(!a){vappfocussb(vappgetqsinput())}}break;default:break}vappfocussbvalue(a,g)}function vappsbsetkeystr(a,d){var c=g_sbkeystr;if(d){g_sbkeystr=d.value.toUpperCase()}else{switch(a){case 8:if(g_sbkeystr){g_sbkeystr=g_sbkeystr.substring(0,g_sbkeystr.length-1)}break;case 32:g_sbkeystr+=" ";break;case 189:g_sbkeystr+="-";break;case 190:g_sbkeystr+=".";break;default:if(a>=48&&(a<112||a>123)){var b=vappgetkeystring(a);g_sbkeystr+=b.toUpperCase()}else{if(a==13||a==27){g_sbkeystr="";window.status=""}}break}}if(g_vappis24hrec){g_vapp24sbkeystr=g_sbkeystr;g_vapp24usesbkeystr=true}return g_sbkeystr!=c}function vappsbkeypress(b,c){if(!b){b=window.event}var a=b.keyCode;if(!c){c=vappgetsb()}switch(a){case 9:case 13:if(!vappisselectboxopen(c)){return}if(g_sbselection){vappchangesbvalue(null,g_sbselection,false,false,true);b.cancelBubble=true;b.returnValue=false}vappfocussb(c,true,true);break;case 27:if(!vappisselectboxopen(c)){return}vappcloseselectbox();break;case 35:vappsetsbselection(c,"last");break;case 36:vappsetsbselection(c,"first");break;case 38:vappsetsbselection(c,"prev");break;case 40:vappsetsbselection(c,"next");break;case 45:vappsbstartquicksearch(c,b);break}vappsbselect(a,c);if((a!=9&&a!=13)||g_sbselection){b.cancelBubble=true;b.returnValue=false}}function vappsbselect(a,c){if(vappsbsetkeystr(a)&&g_sbkeystr){if(g_vappselecttimeout){window.clearTimeout(g_vappselecttimeout)}var b=250*g_sbkeystr.length;if(b<500){b=500}if(b>1500){b=1500}window.status="["+g_sbkeystr+"]";vappsetsbselection(c,"keystr",true);g_vappselecttimeout=window.setTimeout("g_sbkeystr='';window.status=''",b)}}function vappsbinputevt(b,e,c){if(!b){b=window.event}var a=b.keyCode,d=false,f=(g_isctrl&&a==45);if(!window.g_vappqsinprogress&&!g_isalt&&!g_isctrl||f){switch(a){case 9:vappcloseselectbox();break;case 13:if(c){vappqssearch(vappgetsbid(e.parentElement.id));d=true}break;case 16:break;case 27:vappcloseselectbox();break;case 40:if(c){vappsetsbselection(e,"first")}else{vappsetsbselection(e)}d=true;break;case 45:vappsbstartquicksearch(e,b);break;case 112:d=true;default:if(!c){vappsbselect(a,e)}}if(d){b.cancelBubble=true;b.returnValue=false;return false}}}function vappsbfilterevt(b,d){if(!b){b=window.event}if(!window.g_vappqsinprogress){var a=b.keyCode,c=d.parentElement;if(a!=9&&a!=13&&a!=16&&a!=27){if(!vappisselectboxopen(c)){var e=vappgetsbid(c.id);vappqsstartsearch(e,c,"",true,true)}else{if(vappsbsetkeystr(a,vappgettarget(b))){vappsbfilter();g_sbkeystr=""}}}}b.cancelBubble=true;b.returnValue=false;return false}function vappsbfilter(){var n=vappgetsbvalues(),g=window.document.getElementById("fscsb"),h;if(n&&g){if(!g_sbkeystr){for(var l=0,d=n.length;l<d;l++){n[l].style.display=""}h=true}else{var k,f,j,b=g_sbkeystr,i=b.charAt(b.length-1);if(i=="*"||i=="%"){b=b.substr(0,b.length-1);j=true}for(var l=0,d=n.length;l<d;l++){k=n[l];f=(""+k.innerText).toUpperCase();if((j&&f.indexOf(b)==0)||(!j&&f.indexOf(b)>=0)){k.style.display="";h=true}else{k.style.display="none"}}}var m=vappgetnumber(g.getAttribute("sbmaxheight")),a=vappgetnumber(g.getAttribute("sbmaxwidth")),c=g.firstChild,e=true;c.style.display=(h)?"":"none";c.style.height="";if(m){if(c.offsetHeight>m){c.style.height=m-2+"px";e=false}}if(vappsbsethscrollbar(c,null,a)&&(g_isie6||g_isie7)&&e){c.style.height=c.offsetHeight+16+"px"}vappaddpluginoverlay(g)}}function vappsbstartquicksearch(e,b){if(vappissbvalue(e)){e=vappgetsb()}if(e&&new VAPPArgs(e).CheckClientFlag("SEARCH")){vappcloseselectbox();if(g_sbqs){vappsbqsstop(g_sbqs)}g_sbqs=e.id;var a="x"+g_sbqs,c=window.document.getElementById(a);if(c){c.style.display=""}else{c=document.createElement("INPUT");c.type="text";c.id=a;c.style.width="100%";c.onkeydown=vappsbquicksearch;var d=e.parentElement;if(d.tagName=="A"){d=d.parentElement}d.appendChild(c)}if(g_isctrl){c.style.backgroundColor="#fff4ba";c.setAttribute("fscmbz","mindbreeze")}else{c.style.backgroundColor="#dbe1ff";
c.setAttribute("fscmbz","")}c.value=e.innerText;var f=vappgetsbbutton(e);if(f){f.style.display="none"}e.style.display="none";vappfocussb(c,true);window.status=""}}function vappsbquicksearch(c){var b=window.event,c=window.event.srcElement,a=(g_ismoz)?b.which:b.keyCode;switch(a){case 27:vappsbqsstop(c.id.substring(1));break;case 13:case 45:vappqssearch(c.id.substring(1));b.cancelBubble=true;b.returnValue=false;return false;break}}function vappsbqsresult(b,e,c,a,d){if(b&&b.indexOf("QUICKSEARCH")==0){if(a){vapphandleselectbox(e,c,true,true);if(d){vappsbsetkeystr(0,vappgetqsinput());vappsbfilter()}}else{vappsbqsstop(e);vapphandleselectbox(e,c,true,true)}window.g_vappqsinprogress=false;window.status="";if(!d){vappsetsbselection(null,"first")}return true}return false}function vappsbqsstop(e){if(e){var b=vappgetsb(e),a=window.event,c=window.document.getElementById("x"+e);if(!vappissbinput(c)&&b&&c){c.style.display="none";b.style.display="";var d=vappgetsbbutton(b);if(d){d.style.display=""}if(a){a.cancelBubble=true;a.returnValue=false}vappfocussb(b)}g_sbqs=null}}function vappqssearch(g,c){var d=window.document.getElementById("x"+g);if(d){var e=d.getAttribute("fscmbz");if(window.Mindbreeze&&vappismbzsearch(g)){vappstartmbzsearch(g,encodeURIComponent(d.value))}else{var b=window.document.getElementById(g),a=vappislistselecttool(b);if(vappisselectbox(b)){if(a&&vappisselectboxopen(b)){var f=(c)?c.className:"";switch(f){case"FscSelectTool":return;case"FscSBButton":vappcloseselectbox();return;default:vappcloseselectbox()}}b=vappgetsb(b)}vappenablesb(d);vappqsstartsearch(g,b,encodeURIComponent(d.value),a,null,e)}}}function vappqsstartsearch(h,b,e,a,d,g){if(b){if(g_vappis24hrec&&!d){vapp24setinfo("Quicksearch",vapp24getportletid()+"_"+vapp24getsimpleid(h)+(a?"|BUTTONBAR|SelectTool||0":""),"",decodeURIComponent(e));if(a){g_vapp24usesbkeystr=false;g_vapp24sbkeystr=""}}window.g_vappqsinprogress=true;window.status=vappgetstring(FSC_STRQSPROCESSING);var c=g_renderlater[h],f=(c.qskey)?c.qskey:((!a&&g)?g:"");c.filter=d;vappctrl(c.id,"QUICKSEARCH:"+e+";"+f,c)}}function vappstartmbzsearch(d,b){if(g_vappis24hrec){vapp24setinfo("QuicksearchMindbreeze",vapp24getportletid()+"_"+vapp24getsimpleid(d)+"|BUTTONBAR|SelectTool||0","",decodeURIComponent(b));if(islist){g_vapp24usesbkeystr=false;g_vapp24sbkeystr=""}}var c=g_renderlater[d];if(c){var a=c.GetFscArgs();if(a){vappstartoverlayapp(vappbaseurl()+"&ax=COO.1.1001.1.239417&venv_object="+a.GetObject()+"&venv_view="+a.GetView()+"&venv_searchpattern="+b)}}}function venv_firembzresult(b,f){var e=Mindbreeze.Embedded.instances[0],g="";if(e){var c=e.selected();for(var h=0,a=c.length;h<a;h++){var i=c[h].key;if(i){var d=i.split("{")[0];if(g.length>0){g+=","}g+=d}}if(g){vapp(5002,null,"['COO.1.1001.1.239422','("+b+",,"+f+",["+g+"])']",false,vappgetportlet().GetParentId())}}vappcloseoverlayapp()}function vappsbtooltip(c){var a=window.event;if(!vappisselectboxopen(c)){var b=vappgetsbinput(c.id);if(b){vapptipreset(b.value)}}if(a){a.cancelBubble=true;a.returnValue=false}}function vappsbmouseover(){vapptipreset(vappgetattribute(window.event.srcElement,"value",3))}function vapppastepointer(e,a,b){var d=vappgetsb(g_vappmenu.GetSrcElem());if(vappisselectbox(d)){var c=vappgetsboptionelem(e,b,a);vappchangesbvalue(null,c,d.id,true)}return false};var FSCVAPP_MENU=1,FSCVAPP_MENUENTRY=2,FSCVAPP_MENUSEPARATOR=3;FSCVAPP_MENUCHECKEDON=4,FSCVAPP_MENUCHECKEDOFF=5;function VAPPMenu(w,o,u){this.m_data=w;this.m_id=(o)?o:"0";this.m_isopen=false;this.m_onclosefunc=u;this.m_root=null;this.m_focustarget=null;this.m_selection=null;this.m_htm=new BufferedOutput();this.GetArgs=function d(){return this.m_args};this.GetCtrlId=function e(){return this.m_ctrlid};this.GetSrcElem=function i(){return this.m_srcelem};this.SetRoot=function l(x){this.m_root=x};this.GetRoot=function r(){return this.m_root};this.GetHTML=function n(){var y=(!this.m_data)?this.m_htm.PopAll(true):null;if(this.m_htm.IsEmpty()){this.m_htm.Push('<div class="FscMenu" id="FscMenu" onclick="vappmenuhide(true)" onmouseover="vappmenumouseover()" onmouseout="vappmenumouseout()" oncontextmenu="return false">');if(y){this.m_htm.Push(y)}else{var z=(this.m_data)?this.m_data.MenuEntryCount():0;if(z){for(var x=0;x<z;x++){this.AddMenuEntry(this.m_data.GetMenuEntry(x),this.m_id+"_"+x)}}else{this.m_htm.Push('<div class="FscMDisabled">'+vappgetstring(FSC_STRNOCHOICE)+"</div>")}}this.m_htm.Push("</div>")}return this.m_htm.PopAll()};this.AddMenuEntry=function v(E,y){var C=E.GetType();if(C==FSCVAPP_MENU){this.AddSubMenu(E,y)}else{if(C==FSCVAPP_MENUSEPARATOR){this.AddSeparator()}else{var D=E.GetPrototype(),A=E.GetApp(),F=E.GetCallback(),B=A||F||(D&&D.charAt(0)=="!");if(B){if(F){var z=E.GetBranchid();if(z){if(z=="5001"){F="return vappctrl('"+this.m_ctrlid+"', "+MaskValue(F)+")"}else{F="return vapp("+z+", '"+this.m_ctrlid+"', "+MaskValue(F)+")"}}else{F="return "+F}}else{var x=(E.GetSamewindow()==1)?true:false;if(D&&D.charAt(0)=="!"){D=D.split("'").join("\\'")}F="return vappmenufire('','"+A+"','"+E.GetAct()+"','"+D+"',"+x+",'"+E.GetKey()+"')"}var x=(E.GetSamewindow()==1)?true:false;this.AddEntry(E.GetText(),F,E.GetIcon(),B,C,E.GetDescription(),E.GetAccesskey(),E.GetDisplayeffect())}else{this.AddEntry(E.GetText(),null,null,false)}}}};this.AddEntry=function g(F,E,A,y,z,D,C,x){if(null==y){y=true}if(y){var B=(z==FSCVAPP_MENUCHECKEDON||z==FSCVAPP_MENUCHECKEDOFF);this.m_htm.Push('<a href="#" onfocus="vappmenusel(this)"');if(D){this.m_htm.Push(' title="'+vappescapequote(D)+'"')}this.m_htm.Push(' onclick="'+E+'"');if(C){this.m_htm.Push(' accesskey="'+C+'"')}this.m_htm.Push(' class="'+g_vapp_css.menuitem);if(!A&&!B&&x<1){this.m_htm.Push(" FscNoI")}this.m_htm.Push('">');if(B){if(z==FSCVAPP_MENUCHECKEDON){this.m_htm.Push('<img class="FscMIcon" src="'+window.vapplookpath+'/FSCVAPP_1_1001/checkon.gif" />')}else{this.m_htm.Push('<img class="FscMIcon" src="'+window.vapplookpath+'/FSCVAPP_1_1001/checkoff.gif" />')}}else{if(x>0){this.m_htm.Push('<span class="FscMDispIcon" style="background-color:');this.m_htm.Push(g_vappcolor[x]);this.m_htm.Push(';"></span>')}else{if(A){this.m_htm.Push('<img class="FscMIcon" src="../tmp/'+A+'.gif" alt="" />')}}}}else{this.m_htm.Push('<div onclick="return false" class="FscMDisabled">')}this.m_htm.Push(F);this.m_htm.Push((y)?"</a>":"</div>")};this.AddSeparator=function a(){this.m_htm.Push('<div class="FscMSep">&nbsp;</div>')};this.AddSubMenu=function j(z,B){var A=z.MenuEntryCount(),y=z.GetDescription();if(A){this.m_htm.Push('<a href="#" onfocus="vappmenusel(this)" fscsubmenu="'+B+'" class="'+g_vapp_css.submenuitem+'"');if(y){this.m_htm.Push(' title="'+vappescapequote(y)+'"')}this.m_htm.Push(" onclick=\"return vapptogglesubmenu('"+B+"');\">");this.m_htm.Push('<img class="FscMIcon" src="'+window.vapplookpath+'/FSCVAPP_1_1001/submenu.gif" />');this.m_htm.Push(MaskValue(z.GetText())+'</a><div style="display:none;" id="submenu'+B+'">');for(var x=0;x<A;x++){this.AddMenuEntry(z.GetMenuEntry(x),B+"_"+x)}this.m_htm.Push("</div>")}else{this.m_htm.Push('<div class="FscMDisabled">'+MaskValue(z.GetText())+"</div>")}};this.ShowSubMenu=function t(E){var D="submenu"+E;if(this.m_opensubmenu&&D.indexOf(this.m_opensubmenu)<0){var C=D.split("_");var y=C.length;var B=this.m_opensubmenu.split("_");var A=B.length;if(A!=y){for(var x=0;x<A;x++){B.pop();vappclosesubmenu(B.join("_"));if(B.length==y){break}}}vappclosesubmenu(this.m_opensubmenu)}this.m_opensubmenu=D;var z=window.document.getElementById(this.m_opensubmenu);if(z){z.style.display=""}vappsetelempos(vappgethelperspan("fscm"),this.m_x,this.m_y)};this.Show=function m(B,A,F,C,z){this.m_args=C;this.m_ctrlid=z;this.m_srcelem=B;this.m_x=(null==A&&B)?vappgetleft(B):A;this.m_y=(null==F&&B)?vappgettop(B)+B.offsetHeight:F;var E=this.GetHTML(),D=vappgethelperspan("fscm");D.innerHTML=E;if(g_style&&g_style.IsNewCtrl("Menu")){g_style.Add("DIV.FscMenu",g_vappcolor.menu,g_vappcolor.menuborder);g_style.Add("DIV.FscMSep",g_vappcolor.menuborder);g_style.Add("A.FscMSel",g_vappcolor.menuselect);g_style.Add("DIV.FscMenu A:hover",g_vappcolor.menuhover);g_style.Apply()}vappaddclass(this.m_srcelem,"FscMenuSrc");vappaddevent(vappgettoptag(),"keydown",vappmenukeydown);vappmenuspan(D,this.m_x,this.m_y);this.m_isopen=true;g_vappmenu=this;vappfocus(D.getElementsByTagName("A")[0])};this.Close=function c(){if(this.m_isopen){vappspan_hide("fscm");
if(this.m_onclosefunc){this.m_onclosefunc()}vappremoveclass(this.m_srcelem,"FscMenuSrc");vappremoveevent(vappgettoptag(),"keydown",vappmenukeydown);this.m_isopen=false}};this.IsOpen=function k(){return this.m_isopen};this.GetFocusTarget=function s(){return this.m_focustarget};this.SetFocusTarget=function q(x){this.m_focustarget=x};this.GetSelection=function p(){return this.m_selection};this.SetSelection=function f(y,z){if(y){if(z){var x=y.getAttribute("fscsubmenu");if(x&&this.m_opensubmenu!="submenu"+o){vappkillopensubmenu();g_vappcurrtimeout=window.setTimeout(function(){vapptogglesubmenu(x)},800)}}vappaddclass(y,g_vapp_css.menuitemsel);this.m_selection=y}};this.ClearSelection=function h(){if(this.m_selection){if(this.m_selection.getAttribute("fscsubmenu")){vappkillopensubmenu()}vappremoveclass(this.m_selection,g_vapp_css.menuitemsel);this.m_selection=null}};this.SetFocusOnSrcElem=function b(){var x=this.m_srcelem;if(x){if(x.tagName!="A"&&!x.getAttribute("tabindex")){x=vappgetfocustarget(x)}vappfocusnow(x)}}}function vappgetmenuurl(d,e,g,i,k,j,f,a,c,h){var b=vappbaseurl();if(c=="FSCVENV@1.1001:MenuPrototype"){b+="&ax=COO.1.1001.1.87474&venv_object="+g+"&venv_parent="+d+"&venv_index="+i+"&venv_view="+e+"&venv_action="+f;if(h){b+="&venv_dynkey="+h}}else{b+=(c=="FSCVAPP@1.1001:MenuPrototype")?"&ax=COO.1.1001.1.91492":"&ax="+a;b+="&sys_object="+d+"&sys_view="+e+"&sys_selobjects="+k+"&sys_selindices="+j+"&sys_action="+f;if(h){b+="&sys_dynkey="+h}}b+="&commit=true";return b}function vappmenufire(j,g,p,f,k,u,r,e,q,o){if(g_vappis24hrec){vapp24menucall(q,null,f)}if(vappiswbt()){return}if(g_vappmenu){e=g_vappmenu.GetArgs();q=g_vappmenu.GetCtrlId()}vappmenuhide(true);var t=null,l=null,c=null,n=null,a=!k;if(!r){r=null}if(e){var s=new VAPPArgs(null,e);if(a&&!s.CheckSelLimit(URL_SELECTION_LIMIT)){alert(vappgetstring(FSC_STRSELECTIONTOBIG)+"! (Limit: "+URL_SELECTION_LIMIT+")")}if(s.GetSelObj()){var m=s.GetSelObj();l="["+m+"]";t=m.split(",")[0];var d=s.GetSelIdx();n=(d)?"["+d+"]":"[0]";c=d.split(",")[0]}if(!j){j=(s.GetParent())?s.GetParent():s.GetObject()}if(!r&&s.GetView()){r=s.GetView()}}if(g=="COO.1.1001.1.28009"){vappsyncobject(j);return false}if(!f){if(q){return vapp(5002,q,"["+p+","+g+"]",null,o)}}if(window.g_isportlet){a=false}if(!a){var w=vappselgetlistselection(q,o);if(w&&w.ItemCount()){var b=w.GetSelObjects();if(b.length>0){var d=w.GetIdx();t=b[0];c=d[0];l=(b.length>0)?"["+b.join(",")+"]":"";n=(d.length>0)?"["+d.join(",")+"]":""}}if(l==""&&e){var v=e.split(";");if(v[0]){t=v[0].split(",")[0];l="["+v[0]+"]"}if(v[2]){c=v[2].split(",")[0];n="["+v[2]+"]"}}var i="";switch(f){case"FSCVENV@1.1001:MenuPrototype":g="COO.1.1001.1.87474";i+="(";i+=t;i+=",";i+=j;i+=",";i+=c;i+=",";i+=r;i+=",";i+=p;if(u){i+=",";i+=u}i+=")";break;case"FSCVAPP@1.1001:MenuPrototype":default:g="COO.1.1001.1.91492";i+="(";i+=j;i+=",";i+=p;i+=",";i+=r;if(l){i+=",";i+=l}if(n){i+=",";i+=n}if(u){if(!l){i+=","}if(!n){i+=","}i+=",";i+=u}i+=")";break}if(!a){if(q&&r){vapp(5002,q,"['"+g+"','"+i+"']",null,o)}else{vapp(5002,null,"['"+g+"','"+i+"']",null,o)}}}if(a){var h=vappgetmenuurl(j,r,t,c,l,n,p,g,f,u);h+="&ru=javascript:window.close()";window.open(vapp24addurlparam(h),"","location=no, menubar=no, resizable=yes, status=yes, toolbar=no, scrollbars=yes")}return false}function vappmenuhtm(d,h,a,j,i,c,f){try{var d=vappgetjsondata(d);if(d){var b=new VAPPMenu(d,null,f);b.Show(a,j,i,h,c);return b}else{if(f){f()}}}catch(g){}return false}function vappmenuopen(k,b,n,l,m,g,o,a){if(g_vappis24hrec&&m){var d=(g_selection)?g_selection.GetListColumn():0;vapp24setinfo("Data",""+d+","+vapp24getportletid()+"_"+m,m)}var c,h=(null!=k)?k:"",i=vappgenxmlrpc("COO.1.1001.1.87858","","&INP=ARG1&RES=ARG2");if(null!=a){h=a+h}if(null!=g){h+=";~"+g}var p=vappstrudlcreatectx(false);vappstrudllogevtenter(p,FSCVAPP_MENUOPEN,"Menu",h,i);try{var f=vappcallsyncpostrpc(i,h,true);if(f){vappstrudlevtenter(p,FSCVAPP_RENDER);c=vappmenuhtm(f,k,b,n,l,m,o);vappstrudlevtleave(p,FSCVAPP_RENDER)}}catch(j){}vappstrudllogevtleave(p,FSCVAPP_MENUOPEN);vappstrudlreleasectx(p);return c}function vappmenuisopen(){return g_vappmenu&&g_vappmenu.IsOpen()}function vappmenuhide(a){if(g_vappmenu){if(a&&vappwindowisforeground()){g_vappmenu.SetFocusOnSrcElem()}g_vappmenu.Close();g_vappmenu=null;return true}}function vappkillopensubmenu(){if(null!=g_vappcurrtimeout){window.clearTimeout(g_vappcurrtimeout)}}function vapptogglesubmenu(a){vappkillopensubmenu();if(g_vappmenu){g_vappmenu.ShowSubMenu(a)}if(window.event){window.event.cancelBubble=true;window.event.returnValue=false}return false}function vappclosesubmenu(b){var a=window.document.getElementById(b);if(a){a.style.display="none"}}function vappgetmenuargs(g){var f=g.split(";"),c=f[0],b=f[2],d=f[3],a=new Array(),e=new Array();if(c){vappinitselection(c);if(g_selection){if(g_selection.IsSimple()){vappselparseselstr(c,e,a)}else{a=g_selection.GetSelObjects();e=g_selection.GetIdx()}}f[0]=(a.length>0)?a.join(","):"";f[2]=(e.length>0)?e.join(","):"";f[3]=b;f[4]=d=="1"?"0":"1";
f[5]="";f[6]="";f[7]="";f[8]="";return f.join(";")}}function vappmenu(k,p,n){if(!p){p=window.event}var j=p.srcElement;if(j){var h=k.getAttribute("fscmenuargs"),l=vappgetmenuargs(h),m=h.split(";"),g=m[0],b=vappgetparentbyattribute(j,"fscbtargs",3);if(b){if(!n&&!vapphasclass(b,"FscBtDis")){if(g_vappis24hrec){var o=b.title.split(" Alt+")[0];vapp24setinfo("Click",vapp24getportletid()+"_"+g,"BUTTONBAR|"+vapp24mask(vapp24escape(o)))}var q=b.getAttribute("fscbtargs");if(q){var d=q.split(";");return vappmenufire(m[1],d[1],d[0],d[2],true,"",m[2],l,g)}}}else{b=vappgetparentbyattribute(j,"fscmenuroot",3);var i=(b)?b.getAttribute("fscmenuroot"):null;if(i&&(!g_vappmenu||g_vappmenu.GetRoot()!=i)){if(i=="COO.1.1.1.857"){vappmenuhide();return vapplistsettingsmenu(j)}else{var f=m[4],c=m[5],a="[menu:"+i+"]";if(f){a+="[class:"+f+"]"}if(null!=c){a+="[create:"+c+"]"}vappmenuhide();var e=vappmenuopen(l,b,null,vappgettop(b)+b.offsetHeight,g,null,null,a);if(e){e.SetRoot(i)}}}}}if(vappisinplaceediting()){vappinplaceend(p,b,false)}return false}function vappmenubarmouseover(a){if(vappmenuisopen()&&g_vappmenu&&g_vappmenu.GetRoot()){vappmenu(a,window.event,true)}}function vappcontextmenu(h,e){if(!h){h=window.event}if(!h){return false}vappevtgeneral(h);var c=h.srcElement,f=vappgetcontextmenupos(h,e?c:null);g_vappargs.Init(c);if(g_vappargs.GetLen()>0){if(g_vappargs.IsPortal()){vportcontextmenu(h);return false}if(g_vappargs.CheckClientFlag("CONTEXTMENU")){vapptipreset();var g=(g_vappargs.GetListId())?vappgetsimpleid(g_vappargs.GetListId()):"";if(vappisselectbox(c)){if(g_vappis24hrec){vapp24handleeditobjectctxmenu(c)}vappmenuopen(g_vappargs.GetStr(),c,f.x,f.y,g,vappgettc(),null,"editobjectpointer:")}else{var i;if(g_vappargs.IsTree()){i=vapptreehighlight(c,true)}else{if(!g_selection||!g_selection.IsAggrList()){vappselsetobjects(g_vappargs,h,c)}}if(g_vappis24hrec){vapp24handleviewobjectctxmenu(c)}vappmenuopen(g_vappargs.GetStr(),c,f.x,f.y,g,vappgettc(),i)}h.cancelBubble=true;return false}else{h.cancelBubble=true;return false}}else{var a=vappgetparentbyclassname(c,"FscColCaption",5);if(a){var d=vappgetlistbyhead(a.parentElement);if(d){d.ColMenu(a)}}else{if(vappgetattribute(c,"fscgenmenu",10)){return true}}var b=c.tagName;if(!g_isctrl&&b!="INPUT"&&b!="TEXTAREA"){h.cancelBubble=true;return false}}}function vappgetcontextmenupos(b,c){var a=100,d=100;if(c){a=vappgetleft(c);d=vappgettop(c)+c.offsetHeight}else{if(b){a=vappgetmouseposX(b)-10,d=vappgetmouseposY(b)-10}}return{x:a,y:d}}function vappmenusel(a){if(g_vappmenu){g_vappmenu.ClearSelection();g_vappmenu.SetSelection(a);g_vappmenu.SetFocusTarget(a)}}function vappmenumouseover(){if(g_vappmenu){g_vappmenu.ClearSelection();g_vappmenu.SetSelection(vappgetparentbytagname(window.event.srcElement,"|A|","|DIV|"),true)}}function vappmenumouseout(){if(g_vappmenu){g_vappmenu.ClearSelection()}}function vappgetmenuitem(a,c,b){if(c){for(;null!=c;c=(b)?c.nextSibling:c.previousSibling){if(c.tagName=="A"){return c}if(c.id&&c.id.indexOf("submenu")==0&&c.style.display!="none"){var e=c.getElementsByTagName("A");if(e.length){var d=vappgetmenuitem(null,b?e[0]:e[e.length-1],b);if(d){return d}}}}}c=vappgetparentbyid(a,"submenu",3);if(c){return vappgetmenuitem(c,b?c.nextSibling:c.previousSibling,b)}}function vappmenunav(a,c){var b=g_vappmenu.GetFocusTarget();if(b){if(c==FSC_UP){newelem=vappgetmenuitem(b,b.previousSibling,false)}else{if(c==FSC_DOWN){newelem=vappgetmenuitem(b,b.nextSibling,true)}}if(newelem){newelem.focus()}}a.cancelBubble=true;a.returnValue=false}function vappmenukeydown(a){if(!a){a=window.event}var b=a.srcElement;if(!vappgetparentbyid(b,"FscMenu",5)&&!vapphasclass(b,"FscMenuSrc")||a.keyCode==27){vappmenuhide(true)}};var g_ctrlalt=false,FSC_PAGEUP=33,FSC_PAGEDOWN=34,FSC_END=35,FSC_POS1=36,FSC_LEFT=37,FSC_UP=38,FSC_RIGHT=39,FSC_DOWN=40;function vappkeydown(m){m=vappevtgeneral(m);if(!m){return false}var v=m.srcElement,e=g_ismoz?m.which:m.keyCode,o=false;if(g_ismoz&&!g_ctrlalt){g_ctrlalt=g_isctrl||g_isalt}else{if(g_ismoz&&(g_ctrlalt&&(g_isctrl||g_isalt))){g_ctrlalt=false}}if(m.cancelBubble||!vapphandleoverlaykeydown(m,v,e)){return false}switch(e){case 13:if(!v||((v.tagName!="A"||vappiseditableelem(v))&&v.tagName!="TEXTAREA"&&v.getAttribute("contenteditable")!="true")){var c=vappgetelementbyid("FscDefBr");if(c){m.cancelBubble=true;m.returnValue=false;vappbranchclick(v,c);return false}else{var q=vappgetg_defaultbranch();if(q){m.cancelBubble=true;vapp(q);return false}}}if(vappisinplaceediting()){vappinplaceend(m,v,true)}break;case 32:if(!g_isalt){break}case 18:break;case 27:window.status="";if(!vappiswbt()){var o=false;if(vappspan_hide("fscs")||vappmenuhide(true)||vappstoprowmove()){o=true}if(!o&&g_selection&&g_selection.ItemCount()>0){var x=g_selection.GetList();if(!x||!x.IsDiashow()){o=true;g_selection.DeselectAllItems();g_selection.Persist()}}if(!o){var y=vappgetg_cancelbranch();if(y){m.cancelBubble=true;vapp(y)}}}if(vappisinplaceediting()){vappinplaceend(m,v,false)}break;case 9:g_vapptabbed=true;vappinitfocusevts();break;case FSC_PAGEUP:if(g_isalt&&g_isshift){vappka_clickpage("next")}if(g_selection&&g_selection.IsList()){vapplistnav(m,FSC_PAGEUP)}break;case FSC_PAGEDOWN:if(g_isalt&&g_isshift){vappka_clickpage("prev")}if(g_selection&&g_selection.IsList()){vapplistnav(m,FSC_PAGEDOWN)}break;case FSC_END:if(g_isalt&&g_isshift){vappka_clickpage("tail")}if(g_selection&&g_selection.IsList()){vapplistnav(m,FSC_END)}break;case FSC_POS1:if(g_isalt&&g_isshift){vappka_clickpage("head")}if(g_selection&&g_selection.IsList()){vapplistnav(m,FSC_POS1)}break;case FSC_LEFT:if(!vappka_shift("fscs",FSC_LEFT)){if(g_selection&&g_selection.IsList()){vapplistnav(m,FSC_LEFT)}}break;case FSC_UP:if(!vappka_shift("fscs",FSC_UP)){if(vappmenuisopen()){vappmenunav(m,FSC_UP)}else{if(g_selection&&g_selection.IsList()){vapplistnav(m,FSC_UP)}}}break;case FSC_RIGHT:if(!vappka_shift("fscs",FSC_RIGHT)){if(g_selection&&g_selection.IsList()){vapplistnav(m,FSC_RIGHT)}}break;case FSC_DOWN:if(!vappka_shift("fscs",FSC_DOWN)){if(vappmenuisopen()){vappmenunav(m,FSC_DOWN)}else{if(g_selection&&g_selection.IsList()){vapplistnav(m,FSC_DOWN)}}}break;case 65:if(g_isctrl&&!g_isalt&&g_selection&&g_selection.IsList()&&!vappiseditableelem(v)){g_selection.SelectAllItems();m.cancelBubble=true;m.returnValue=false;o=true}break;case 67:if(g_isctrl&&g_selection&&!vappistextselected()&&!vappiseditableelem(v)){var j=g_selection.GetKeys();if(j.length>0){if(g_selection.IsAggrList()){vapp(5002,vappgetsimpleid(g_selection.GetListId()),"COPY")}else{vappcopytoclipboard(j.join(","))}o=true}}break;case 86:if(g_isctrl&&!vappiseditableelem(v)){if(!g_selection){vappsetactsel(g_sellists["0_0"+vappgetcontainerid()])}if(g_selection){var x=g_selection.GetList();if(x.IsEdit()){var f=(x.IsAggrList())?"INSERT":"['COO.1.1001.1.91492','("+vappgetportletobject()+",COO.1.1.1.935,"+x.GetView()+",null,null)']";vapp(5002,x.GetId(),f);m.cancelBubble=true;m.returnValue=false;o=true}}}break;case 88:if(g_isctrl&&g_selection&&g_selection.IsList()&&!g_selection.IsAggrList()&&!vappiseditableelem(v)){var n=g_selection.GetIdx();var j=g_selection.GetKeys();if(j.length>0&&j[0].indexOf("~")<0){var x=g_selection.GetList();if(x.IsEdit()){var k=j.join(",");var b=n.join(",");vapp(5002,x.GetId(),"['COO.1.1001.1.91492','("+vappgetportletobject()+",COO.1.1.1.932,"+x.GetView()+",["+k+"],["+b+"])']");m.cancelBubble=true;m.returnValue=false;o=true}}}break;case 113:if(!vappisinplaceediting()){vappinplacestart()}m.cancelBubble=true;return false;break;case 117:return false;break;case 121:if(g_isshift){vappcontextmenu(m,true);return false}break;case 219:if(g_isshift&&g_isctrl){vappka_toggle(m);return false}break}if(!o){if((48<=e&&e<=90)||e==186||e==192||e==222){var d=vappgetkeystring(e);if(g_isalt||(g_ismoz&&g_ctrlalt&&!g_isalt&&!g_isctrl)){if(g_isshift){var p=vappka_getpagekeys()[d];if(p){p.click();p.style.backgroundColor=g_vappcolor.select;m.cancelBubble=true;return false}}else{if(g_isctrl||(g_ismoz&&g_ctrlalt&&!g_isalt&&!g_isctrl)){var w=vappka_getportalkeys()[d];if(w){vporttab(w);m.cancelBubble=true;return false}}else{if(vappmenuisopen()){var s=vappka_getmenuitems();if(s){for(var n=0,u=s.length;n<u;n++){var a=s[n];if(a.getAttribute("accesskey")==d){a.click();m.cancelBubble=true;return false}}}}var l,h,i=0,t=vappgetelementbyid("FscPageBr");if(t){var g=t.getElementsByTagName("A");for(var n=0,u=g.length;n<u&&i<=2;n++){h=g[n];if(h.getAttribute("accesskey")==d&&h.href){l=h;i++}}}if(i<=2&&g_selection&&g_selection.IsList()){var r=vappgetelementbyid("FscButtonBar"+g_selection.GetListId());if(r){var g=r.getElementsByTagName("A");for(var n=0,u=g.length;n<u&&i<=2;n++){h=g[n];if(h.getAttribute("accesskey")==d&&h.href){l=h;i++}}}}if(i==1){if(l){vappbranchclick(v,l);
if(!vapphasclass(l,"FscMenu")){l.style.backgroundColor=g_vappcolor.select}}m.cancelBubble=true;return false}}}}}}}function vappkeyup(){var b=vappevtgeneral();if(!b){return false}var c=b.srcElement,a=g_ismoz?b.which:b.keyCode;if(vappisselectboxopen()&&!vappisselectbox(c)){vappcloseselectbox()}if(a==9&&vappisinplaceediting()){vappinplaceend(b,c,true,true)}if(g_ismoz){if(!b.altKey&&!b.ctrlKey){g_ctrlalt=false}}}function vappka_toggle(a){var c=vappgethelperspan("fscs");if(c&&c.style.visibility!="visible"){var b=vappka_genhtml();if(b){c.innerHTML=b;c.style.left="0px";c.style.top="0px";c.style.visibility="visible";if(g_isie){c.setCapture()}vappaddevent(document.body,"mousemove",function(){if(!vappgetparentbyclassname(window.event.srcElement,"FscKeyAssistantTable",5)){vappspan_hide("fscs");vappremoveevent(document.body,"mousemove",arguments.callee)}});c.focus()}if(a){a.returnValue=false;a.cancelBubble=true}}return false}function vappka_genhtml(){var e=new Array();if(vappmenuisopen()){var h=vappka_getmenuitems();if(h){for(var b=0,d=h.length;b<d;b++){var g=h[b],f=g.getAttribute("accesskey");if(f){vappka_genhtmlentry(e,g.innerText,"Alt+"+f);vappka_genboldinnerhtm(g,f)}}}}else{if(!vapphasoverlays()){vappka_getportalkeys(e)}vappka_getatagkeys("FscPageBr","FscPageBranch",e);if(g_selection){var c=vappgetcontainerid(),a=g_selection.GetListId();if(a&&a.indexOf(c)>0){vappka_getatagkeys("FscButtonBar"+a,null,e)}}vappka_getpagekeys(e)}if(e.length){return'<table class="FscKeyAssistantTable">'+e.join("")+"</table>"}}function vappka_clickpage(g){var d=window.document.getElementsByTagName("TD");var c=new Array();var b=0;for(var a=0;a<d.length;a++){var f=d[a];if(0==f.className.indexOf("FscPageTab")){c[b]=f;b++}}if(null!=c){var e=null;for(var a=0;a<c.length;a++){var f=c[a];if(g=="next"){if(vapphasclass(f,"FscPageTabOn")){e=c[a+1]}}else{if(g=="prev"){if(vapphasclass(f,"FscPageTabOn")){e=c[a-1]}}else{if(g=="head"){if(0==f.className.indexOf("FscPageTab")){e=c[0]}}else{if(g=="tail"){if(0==f.className.indexOf("FscPageTab")){e=c[c.length-1]}}}}}if(null!=e){if(0==f.className.indexOf("FscPageTab")){e.style.backgroundColor=g_vappcolor.select;e.click()}break}}}}function vappka_controlkey(b){var a=false;if((b==17||b==37||b==39||b==38||b==40||b==18||b==54||b==33||b==34||b==35||b==36)){a=true}return a}function vappka_shift(e,b){var c=window.document.getElementById(e);if(c&&c.style.visibility=="visible"){var a=parseInt(c.style.left),d=parseInt(c.style.top);switch(b){case FSC_LEFT:c.style.left=a-10+"px";break;case FSC_RIGHT:c.style.left=a+10+"px";break;case FSC_UP:c.style.top=d-10+"px";break;case FSC_DOWN:c.style.top=d+10+"px";break}return true}return false}function vappka_addkey(e,d,f,c){if(e){var g=e.innerText;for(var a=0;a<g.length;a++){var b=g.charAt(a).toUpperCase();if("A"<=b&&b<="Z"){if(!d[b]){d[b]=e;if(c){vappka_genhtmlentry(c,g,f+b);vappka_genboldinnerhtm(e,b)}break}}}}}function vappka_getpagekeys(d){var g=new Array(),h=vappgetg_tabcontainer(),b=vappgetelementbyid("FscTabContainer");if(b){var e=b.getElementsByTagName("TD"),c=h.tabs;if(c.length&&e.length){vappka_genhtmlentrysep(d);for(var a=0;a<c.length;a++){var f=e[c[a].pos];vappka_addkey(f,g,"Alt+Shift+",d)}}}return g}function vappka_getportalkeys(d){var e=new Array(),c=vportgetportalpages();if(c){vappka_genhtmlentrysep(d);for(var b=0,a=c.length;b<a;b++){vappka_addkey(c[b],e,"Alt+Ctrl+",d)}}return e}function vappka_getatagkeys(c,l,f){var a=vappgetelementbyid(c),m=false;if(a){var g=a.getElementsByTagName("A"),e=true;for(var j=0,b=g.length;j<b;j++){var i=g[j];if(i.href&&(!l||vappgetparentbyclassname(i,l,3))){var h=i.getAttribute("accesskey");if(h){if(e){vappka_genhtmlentrysep(f);e=false;m=true}var k=i.innerText;if(k){vappka_genboldinnerhtm(i,h)}else{var d=i.getElementsByTagName("IMG")[0];if(d){k=(d.title)?d.title:d.alt;k=k.split("Alt+")[0]}}if(k){vappka_genhtmlentry(f,k,"Alt+"+h)}}}}}return m}function vappka_genhtmlentry(c,b,a){c.push("<tr><td>"+b+"</td><td><b>"+a+"</b>&nbsp;</td></tr>")}function vappka_genhtmlentrysep(a){if(a&&a.length>0){a.push('<tr><td colspan="2" class="FscKeyAssSep"></td></tr>')}}function vappka_genboldinnerhtm(k,g){if(g){var j=vappstrtrim(k.innerText),b=j.toLowerCase(),f=k.innerHTML;if(f.toLowerCase().indexOf("<b>"+g.toLowerCase()+"</b>")==-1){var h=b.indexOf(g.toLowerCase()),a=j.substring(0,h)+"<b>"+j.charAt(h)+"</b>"+j.substring(h+1),e=f.split(j),c,f="";for(var i=0,d=e.length;i<d;i++){c=e[i];f+=c;if(i<d-1){f+=(vappstrendswith(c,"alt=")||vappstrendswith(c,"title="))?j:a}}k.innerHTML=f}}}function vappka_getmenuitems(){var a=vappgethelperspan("fscm");if(a){return a.getElementsByTagName("A")}}function vappsetaccstrings(){vappsetstrings([FSC_STRSHORTCUTS,FSC_STRNAVPATH,FSC_STRBUTTONS,FSC_TABS,FSC_STRMENU,FSC_STRBUTTONBAR])}function vappsetaccinfo(a,d,b,c){if(null==c){c=1}if(b){a.Push("<h"+c+' class="FscAcc"><a name="fsc'+b+'"');if(c==1&&window.g_vappactkey<10){window.g_vappactkey++;a.Push(' accesskey="'+window.g_vappactkey+'"')}a.Push(' href="#">'+d+"</a></h"+c+">")}else{a.Push("<h"+c+' class="FscAcc">'+d+"</h"+c+">")
}}function vappsetaccinfobyident(a,c,b,d){vappsetaccstrings();vappsetaccinfo(a,g_vappstrings[c],b,d)}function vappsetaccinfowrapped(a,d,b,c){if(b){a.Push('<div class="FscAccFix">')}vappsetaccinfo(a,d,b,c);if(b){a.Push("</div>")}}function vappsetaccmenu(a,c,b,d){if(null==d){d=1}vappsetaccstrings();window.g_vappactkey=0;a.Push('<div class="FscAcc" id="FscMainAccNav"><h'+d+'><a href="#" accesskey="'+window.g_vappactkey+'" onfocus="vappaccnavevent(this)">');a.Push(g_vappstrings[c]+"</a></h"+d+"></div>");if(g_style&&g_style.IsNewCtrl("AccMenu")){g_style.Add("DIV.FscAccNav DIV",g_vappcolor.border,g_vappcolor.border);g_style.AddEx("DIV.FscAccNav A",null,null,g_vappcolor.fontinverse);g_style.Add("DIV.FscAccNav A:focus",g_vappcolor.select);g_style.AddEx("DIV.FscAccNav A:focus","color:"+g_vappcolor.font);g_style.Add("DIV#FscPortalPages > A:focus, A.FscRole:focus",g_vappcolor.select);g_style.Add("H1.FscAcc A",g_vappcolor.select,g_vappcolor.border+" !important");g_style.Apply()}}function vappshowaccmenu(a,b){if(a&&a.className!="FscAccNav"){if(a.children.length==1){vappbuildaccmenu(a,b)}a.className="FscAccNav";vappaddevent(document.body,"click",function(c){if(!c){c=window.event}var d=(c.target)?c.target:c.srcElement;if(!vappischild(d,a,3)){vappremoveevent(document.body,"click",arguments.callee);vapphideaccmenu(a)}});vappaddevent(document.body,"keyup",function(c){if(!c){c=window.event}var e=(c.target)?c.target:c.srcElement,d=document.getElementById("FscTabLogo");if(e!=d&&!vappischild(e,a,3)){vappremoveevent(document.body,"keyup",arguments.callee);vapphideaccmenu(a)}})}}function vapphideaccmenu(a){if(a&&a.className!="FscAcc"){a.className="FscAcc"}}function vappaccnavevent(b){var a=vappgetparentbyclassname(b,"FscAcc",3);vappshowaccmenu(a,b);vappaccmenuevents(b,a)}function vappbuildaccmenu(e,a){var c=vappgetparentbyclassname(e,"FSCAjaxContainer",20);if(c){var i=c.getElementsByTagName(e.firstChild.tagName),f=new Array();if(!a){a=e.getElementsByTagName("A")[0]}for(var h=0,d=i.length;h<d;h++){var g=i[h].getElementsByTagName("A")[0];if(g&&g.name&&g!=a){f.push('<a href="#'+g.name+'">'+g.innerText+vappaccgetanchorinfo(g.getAttribute("accesskey"))+"</a>")}}e.innerHTML="<div>&nbsp;</div>"+e.innerHTML+f.join("");var b=e.getElementsByTagName("A");for(var h=1,d=b.length;h<d;h++){vappaccmenuevents(b[h],e)}}}function vappaccmenuevents(b,a){b.onblur=function(c){vapphideaccmenu(a)};b.onfocus=function(c){vappshowaccmenu(a,b)};b.onclick=function(d){var c=document.getElementsByName(b.hash.slice(1))[0];if(c){try{c.focus()}catch(f){}return false}}}function vappaccgetanchorinfo(a){return(a!=null)?"<i>"+g_vappaccesskey+"+"+a+"</i>":""}function vappaccrefreshvirtualbuffer(){var a=window.document.getElementById("FscAccInput");if(!a){a=document.createElement("INPUT");a.type="hidden";a.id="FscAccInput";window.document.body.appendChild(a)}a.value=(a.value=="0")?"1":"0"};function vappspellcheck(e){var c=vappgetform();e="f"+e;var a;if(g_vappspellbutton){vappremoveclass(g_vappspellbutton,"FscBtPressed");g_vappspellbutton=null}if(null!=window.g_sc_hiddenarea){if(window.g_sc_hiddenarea.name!=e){a=c[e]}vapp_sc_commit()}else{a=c[e]}if(null!=a){if(window.event){g_vappspellbutton=vappgetparentbyclassname(window.event.srcElement,"FscBtBranch",4)}vappaddclass(g_vappspellbutton,"FscBtPressed");window.g_sc_hiddenarea=a;var d=encodeURIComponent(a.value);var b=vappgenxmlrpc("COO.1.1001.1.87843","",d);vappcallrpc(vapp_sc_showerrors,b)}}function vapp_sc_commit(){var a=window.document.getElementById("sc_"+window.g_sc_hiddenarea.name);if(null!=a){if(g_ismoz){a.innerHTML=a.innerHTML.replace(new RegExp("<br>","gi"),"\n")}window.g_sc_hiddenarea.value=a.innerText;window.g_sc_hiddenarea.parentElement.removeChild(a);window.g_sc_hiddenarea.style.display=""}window.g_sc_hiddenarea=null}function vapp_sc_showerrors(j){var i=window.g_sc_hiddenarea.value;i=i.replace(/&/g,"&amp;");i=i.replace(/</g,"&lt;");i=i.replace(/>/g,"&gt;");var b=vappxmlgetdictionary(j);if(null!=b){var h=b.firstChild;if(null!=h){if(h.nodeName=="errors"){h=h.firstChild;for(var d=h.firstChild;null!=d;d=d.nextSibling){var a=vappxmlgettext(d);var c="<span class='FscSCMarkedWord'>"+a+"</span>";var e=i.indexOf(a);while(e!=-1){prevchar=i.charAt(e-1);nextchar=i.charAt(e+a.length);if(prevchar!=">"&&nextchar!="<"&&prevchar<"A"&&nextchar<"A"){i=i.substring(0,e)+c+i.substr(e+a.length);break}e=i.indexOf(a,e+1)}}}}}i=i.replace(/\n/g,"<br/>");var f=window.document.createElement("DIV");f.id="sc_"+window.g_sc_hiddenarea.name;f.style.backgroundColor=g_vappcolor.selectinactive;f.style.width="100%";var g=vappgetparentbyclassname(window.g_sc_hiddenarea,"FscInputBorder",5,"|TABLE|");if(g){f.style.paddingTop=(g_isie)?"4px":"3px";f.style.paddingLeft="1px"}else{f.style.padding="3px"}f.style.height=window.g_sc_hiddenarea.offsetHeight+"px";f.onclick=vapp_sc_getsuggestions;f.innerHTML=i;f.style.display="";window.g_sc_hiddenarea.parentElement.appendChild(f);window.g_sc_hiddenarea.style.display="none"}function vapp_sc_getsuggestions(){var c=window.event,d=c.srcElement,a=(g_ismoz)?c.pageX:c.clientX,f=(g_ismoz)?c.pageY:c.clientY,e=(d&&d.className=="FscSCMarkedWord")?d.innerText:"",b=vappgenxmlrpc("COO.1.1001.1.87844","",e);vappcallhiddenrpc(function(h,g){vappmenuhtm(g,"",null,a,f)},b)}function vapp_sc_correctword(e,h,f,g){var d=window.document.getElementById("sc_"+window.g_sc_hiddenarea.name);var b=d.getElementsByTagName("SPAN");for(var a=0;a<b.length;a++){var c=b[a];if(c.className=="FscSCMarkedWord"&&c.innerHTML==f){if(null!=g){c.innerHTML=g}c.className="FscSCCorrectedWord";c.onclick=""}}}function vapp_sc_addentry(b){var a=vappgenxmlrpc("COO.1.1001.1.87845","",encodeURIComponent(b));vappcallrpc(vapp_sc_correctword,a,b)}function vapp_sc_delentry(){var a=vappbaseurl(true)+"&ax=COO.1.1001.1.180601&ru=javascript:window.close();";window.open(a,"","location=no, menubar=no, resizable=yes, toolbar=no, width=300, height=400, top=100, left=100")};var g_vapp24info=new Array(),g_vapp24infohint=new Array(),g_vapp24resetinfohints=true,g_vapp24keypresshandled=false,g_vapp24isthreepart=false,g_vapp24doselection=true,g_vapp24bypasssendinfo=false,g_vapp24bypasssedinfo=new Array(),g_vapp24bypassresetstate=false,g_vapp24isoverlaypage=false,g_vapp24dosubmitafteropen=false,g_vapp24windowopened=false,g_vapp24sbkeystr="",g_vapp24usesbkeystr=false;function vapp24setsessionid(a){if(g_vappis24hrec){try{if(window.opener&&window.opener.g_vappsessionid){g_vappsessionid=window.opener.g_vappsessionid;if(!g_vappwindowid){var b=window.opener;while(b){g_vappwindowid=b.g_vappwindowcount;b.g_vapp24windowopened=true;b.g_vappwindowcount++;b=b.opener}g_vappwindowcount=1}}}catch(c){}g_vapp24info=new Array();g_vapp24infohint=new Array();if(!g_vappsessionid){g_vappsessionid=new Date().getTime();g_vappwindowid=0;g_vappwindowcount=1;vapp24setinfo("Start",vapp24escape(a))}}}function vapp24setopenwindowtimeout(a,c){if(g_vappis24hrec){try{if(typeof c=="undefined"){c=20}if((typeof window.g_vapp24windowopened=="undefined"||!window.g_vapp24windowopened)&&c>0){c--;window.setTimeout(function(){vapp24setopenwindowtimeout(a,c)},250);return}}catch(b){}}a()}function vapp24setinfo(e,d,c,b,a){g_vapp24info=new Array();if(g_vappis24hrec){if(e!=null){g_vapp24info.push(e)}if(d!=null){g_vapp24info.push(d)}if(c!=null){g_vapp24info.push(c)}if(b!=null){g_vapp24info.push(b)}if(a!=null){g_vapp24info.push(a)}}}function vapp24getinfo(a){if(g_vapp24info[a]){return g_vapp24info[a]}return""}function vapp24setinfohint(e,d,c,b,a){g_vapp24infohint=new Array();if(g_vappis24hrec){if(e!=null){g_vapp24infohint.push(e)}if(d!=null){g_vapp24infohint.push(d)}if(c!=null){g_vapp24infohint.push(c)}if(b!=null){g_vapp24infohint.push(b)}if(a!=null){g_vapp24infohint.push(a)}}}function vapp24setdoselection(a){g_vapp24doselection=a}function vapp24setkeypresshandled(a){g_vapp24keypresshandled=a}function vapp24preventresetinfohints(){g_vapp24resetinfohints=false}function vapp24checkandresetinfohints(){if(!g_vapp24resetinfohints){g_vapp24resetinfohints=true;return false}vapp24setinfohint();return true}function vapp24getportletid(b){var a=vapp24getportlet(b);if(a){return a.split(":")[0]}return""}function vapp24getportlet(c){var b;var a=vappgetcontainer(c);if(a){b=a.getAttribute("vapp24portlet")}if(!b){b="0:"}return b}function vapp24getportletpageid(d){var a=vappgetcontainer(d);if(a){var c=a.getAttribute("vapp24portlet");var b=a.getAttribute("vapp24page");if(b){return(c?c.split(":")[0]:"0")+"_"+b}}return""}function vapp24addurlparam(a,e){if(g_vappis24hrec){var c=vapp24getportlet(e);var d=g_vappsessionid+"|"+g_vappwindowid+"|"+c;if(g_vapp24doselection&&g_selection&&g_selection.ItemCount()){var b=g_selection.GetIdx();d+="|"+b.join(",")}else{d+="|"}a=vapp24addurlparaminternal(a,"dt",d,g_vapp24info);g_vapp24info=new Array();a=vapp24addurlparaminternal(a,"dth","",g_vapp24infohint);vapp24checkandresetinfohints();if(!g_vapp24bypassresetstate){g_vapp24keypresshandled=false;g_vapp24doselection=true}}return a}function vapp24addurlparaminternal(b,a,f,e){var d=f;for(var c=0;c<e.length;c++){e[c]=vapp24escapeurlparam(e[c])}d+=(d.length?"|":"")+e.join(";");return vappsetargument(a,b,encodeURIComponent(d))}function vapp24handleeventrpc(){var a=vappdavhead()+"/CALL?ACTION=COO.1.1001.1.156456&ARG2=HANDLEDBYQS";a=vapp24addurlparam(a);a=vappgetportleturl(a);var b=new XMLHttpRequest();if(b){b.open("GET",a,false);b.send(null)}}function vapp24sendeventrpc(d,f,a,g,e,c){var b=vappdavhead()+"/CALL?ACTION=COO.1.1001.1.156456&ARG1="+encodeURIComponent(d)+"&ARG2="+encodeURIComponent(f)+"&ARG3="+encodeURIComponent(a)+"&ARG4="+encodeURIComponent(g)+"&ARG5="+encodeURIComponent(e)+"&ARG6="+encodeURIComponent(c);vapp24directrpc(b)}function vapp24incrementaldumprpc(d,b,e,c){var a=vappdavhead()+"/CALL?ACTION=COO.1.1001.1.156461&ARG1="+encodeURIComponent(d)+"&ARG2="+encodeURIComponent(b)+"&ARG3="+encodeURIComponent(e)+"&ARG4="+encodeURIComponent(c);vapp24directrpc(a)}function vapp24directrpc(a){var c=vapp24getportlet();var d=g_vappsessionid+"|"+g_vappwindowid+"|"+c;a+="&dt="+encodeURIComponent(d);a=vappgetportleturl(a);var b=new XMLHttpRequest();if(b){b.open("GET",a,false);b.send(null)}}function vapp24getbranchaction(a,d,b){var e=a.GetArg2();if(e){if((e.charAt(0)=="'"&&e.charAt(e.length-1)=="'")||(e.charAt(0)=='"'&&e.charAt(e.length-1)=='"')){e=e.substring(1,e.length-1)}}var c=a.GetCaption();if(!c){c=a.GetCtrlXml()}if(!c){c=a.GetDesc()}c=vapp24escape(c);if(d){return d(a,e,c,b)}else{if(e&&!a.GetLocalop()){return MaskValue("vapp24setinfo('Click', vapp24getportletid()+'_"+vapp24mask(e+"|"+c)+"');")}}return""}function vapp24listviewbranch(a,d,c,b){return MaskValue("vapp24setinfo('Click',vapp24getportletid()+'_"+vapp24mask(b)+"|"+vapp24mask(c)+"');")}function vapp24baselistbranch(b,e,d,c){var a=e.lastIndexOf("_");if(a>=0){e=e.substring(0,a)}return MaskValue("vapp24setinfo('Click','"+e+"|"+vapp24mask(d)+"');")}function vapp24instoptbranch(a,d,c,b){return MaskValue("vapp24setinfo('Click',vapp24getportletid()+'_"+d+"|"+vapp24mask(b)+"|"+vapp24mask(c)+"');")
}function vapp24pagebranch(a,d,c,b){return MaskValue("vapp24setinfo('Click',vapp24getportletpageid()+'|BUTTONBAR|"+vapp24mask(c)+"');")}function vapp24listgroupbranch(a,d,c,b){return MaskValue("vapp24setinfo('Click',vapp24getportletid()+'_"+d+"|' + vapp24getlistgrouptext('"+vapp24mask(b)+"',this));")}function vapp24workflowbranch(a,d,c,b){return MaskValue("vapp24setinfo('Click',vapp24getportletid()+'_"+d+b+"|"+vapp24mask(c)+"');")}function vapp24escape(a){return a?a.replace(/\\/g,"\\\\").replace(/\|/g,"\\|"):""}function vapp24escapeurlparam(a){return a?a.replace(/\\/g,"\\\\").replace(/\;/g,"\\;"):""}function vapp24mask(a){return a?a.replace(/\\/g,"\\\\").replace(/\'/g,"\\'"):""}function vapp24getsimpleid(c,a){if(null==a){a=vappgetcontainerid()}if(c&&a){var b=c.split(a)[0];if(b.length>0&&(b.charAt(0)=="f"||b.charAt(0)=="x")){b=b.substring(1)}return b}}function vapp24menucall(b,m,g,k){if(g_vappis24hrec){if(m){var d=vapp24getportletid()+"_"+b;vapp24setinfo("Click",d+"|BUTTONBAR|"+vapp24escape(m))}else{if(window.event){vapp24preventresetinfohints();var f=true;if(g){f=!(g.indexOf("!vporttab")==0)}if(f){var n="";var j=window.event.srcElement;while(j){j=vappgetparentbyclassname(j,"FscM");if(j&&j.className.indexOf("FscM")==0){break}}while(j&&!(j.className.indexOf("FscMenu")==0)){var l=j.innerText;var a=j.parentElement.firstChild;var h=-1;var c=0;var e=false;while(a){if(a==j){h=c}else{if(l==a.innerText){e=true}}a=a.nextSibling;c++}if(e&&h>=0){l="|"+h}else{l=vapp24escape(l)}n="|"+l+n;j=j.parentElement;if(j){j=j.previousSibling}}if(n){vapp24setdoselection(false);vapp24setinfo("Click","MENU"+n);if(k){vapp24handleeventrpc()}}}}}}}function vapp24treebranch(a,f,b){var d=vappgetparentbytagname(a,"|UL|","|UL|");var i;if(vapp24treebranchcheck(f,true)&&vapp24treebranchcheck(f,false)){i=vapp24escape(f.innerText)}else{i="|"+vapp24treebranchidx(f)}var c=f.getAttribute("fscd");f=f.previousSibling;while(f){var h=f.getAttribute("fscd");if(h<c){var e;if(vapp24treebranchcheck(f,true)&&vapp24treebranchcheck(f,false)){e=vapp24escape(f.innerText)}else{e="|"+vapp24treebranchidx(f)}i=e+"|"+i;c=h}f=f.previousSibling}if(a.tagName=="IMG"){var g=a.getAttribute("title");if(!g){g=a.getAttribute("alt")}g=vapp24escape(g);i+="|"+g}i=vapp24getportletid()+"_"+d.getAttribute("vapp24id")+"|"+i;vapp24setinfo(b,i)}function vapp24treebranchcheck(d,a){var g=d.getAttribute("fscd");if(g==0){return false}var f=d.innerText;var c=a?d.previousSibling:d.nextSibling;var e=false;while(c){var b=c.getAttribute("fscd");if(b<g){break}else{if(b==g){if(c.innerText==f){e=true;break}}}c=a?c.previousSibling:c.nextSibling}return !e}function vapp24treebranchidx(d){var e=d.getAttribute("fscd");var c=d.previousSibling;var a=0;while(c){var b=c.getAttribute("fscd");if(b<e){break}else{if(b==e){a++}}c=c.previousSibling}return a}function vapp24handlekeyevent(){vapp24bypassresetstate(false);if(g_vapp24keypresshandled){return}var b=window.event;if(!b){return}var c=window.event.type;switch(c){case"keypress":case"keydown":case"keyup":var d="";if(b.ctrlKey){d="CtrlKey"}if(b.altKey){d+=(d?",":"")+"AltKey"}if(b.shiftKey){d+=(d?",":"")+"ShiftKey"}var e=b.srcElement;var a=b.keyCode;var f;switch(a){case 13:f="ReturnKey";break;case 27:f="EscapeKey";break}if(f){vapp24setinfo("Keypress",vapp24getportletpageid(),"",f,d)}break}}function vapp24handleeditobjectctxmenu(b){var a=vapp24getportletid()+"_"+vapp24getsimpleid(b.id);if(vappgetparentbyclassname(b,"FscSelectTool",5)!=null){a+="|BUTTONBAR|SelectTool"}vapp24setinfo("Data",a,a)}function vapp24getsboptionindexifambiguous(c){var h=c.innerText;var g=c.getAttribute("value");var b=vappgetparentbyclassname(c,"FscSBList");var i=0;var e=-1;var f=-1;if(b){var d=b.firstChild;while(d){if(d.nodeName=="#text"){d=d.nextSibling;continue}if(d.getAttribute("value")==g){e=i}var a=d.innerText;if(e>0&&a&&a==h){f++;if(f>0){return e}}d=d.nextSibling;i++}}return -1}function vapp24handlesbvaluectxmenu(f){var d=vappgetparentbyclassname(f,"FscSBList");var j=d.parentNode;var a=j.name;if(a.indexOf("fscsb")==0){a=a.substring("fscsb".length)}var c=vapp24getsimpleid(a);var b=vapp24getportletid()+"_"+c;var e=a;var h=a.lastIndexOf("_qs");if(h>=0){e=a.substring(0,h)}var k=document.getElementById(e);if(vappgetparentbyclassname(k,"FscSelectTool",5)!=null){b+="|BUTTONBAR|SelectTool";if(g_vapp24usesbkeystr){vapp24sendeventrpc("","Set",b,"",g_vapp24sbkeystr,"");g_vapp24sbkeystr="";g_vapp24usesbkeystr=false}}b+="||0";var g=vapp24getsboptionindexifambiguous(f);if(g<0){var i=f.innerText;if(i&&i.length>0&&i.charAt(0)=="\xA0"){i=i.substring(1)}b+="|"+vapp24escape(i)}else{b+="||"+g}vapp24setinfo("Contextmenu",b)}function vapp24handleviewobjectctxmenu(e){var d=vappgetparentbyclassname(e,"FscOL",5);if(!d){d=e.firstChild;while(d){var f=d.className;if(f&&f.indexOf("FscOL")==0){break}d=d.firstChild}}if(d){var b=vappgetsimpleid(d.id);if(!b){b=g_vappargs.GetVApp24Id()}b=vapp24getportletid()+"_"+b;vapp24setinfo("Data",b,b)}else{var a=vappgetparentbytagname(e,"|UL|","|UL|");if(a&&a.className&&a.className.indexOf("FscTree")==0){var c=vappgetparentbytagname(e,"|LI|","|UL|");
if(c){vapp24treebranch(c,c,"Contextmenu")}}}}function vapp24handlevmapiimport(g,f){var e=document.getElementById(g);var c;var b;if(e!=null){var a=e.firstChild;if(a!=null){c=a.innerText}}if(!c){return}if(f){var d=f.getElementsByTagName("TD");if(d&&d.length){b=d[d.length-1].innerText}}if(b){vapp24setinfo("Click",vapp24getportletpageid()+"|"+vapp24escape(c),vapp24escape(b))}}function vapp24handleinstantiatedblclick(e){var a=window.event;if(!a){return}var c=a.srcElement;var b=vappgetparentbyclassname(c,"FscInstOption");if(b){while(b&&b.tagName!="A"){b=b.firstChild}if(b){var d=b.innerText;if(d&&d.length>0&&d.charAt(0)=="\xA0"){d=d.substring(1)}d=vapp24escape(d);vapp24setinfo("Doubleclick",vapp24getportletid()+"_"+e+"|SELECT|"+vapp24mask(d))}}}function vapp24handleviewoptionclick(h,c){var g;var k;if(c){var d=c.getElementsByTagName("DIV");for(var e=0;e<d.length;e++){if(d[e].className&&d[e].className.indexOf("FscVOcmdTxt")==0){k=d[e];break}}}if(k){g=k.innerText}var a;var j=c;while(j&&(!j.className||j.className.indexOf("FscVOcmdCat")<0)){j=j.previousSibling}if(j){a=j.innerText}var f;var b=document.getElementById(h);var d=b.children;for(var e=0;e<d.length;e++){if(d[e].className&&d[e].className.indexOf("FscVOcmdTitle")==0){b=d[e];break}}if(b){f=b.innerText}if(g&&f){vapp24setinfo("Click",vapp24getportletpageid()+"|"+vapp24escape(f)+(a?"|"+vapp24escape(a):"")+"|"+vapp24escape(g))}}function vapp24getlistgrouptext(e,b){var f;var d=vappgetparentbytagname(b,"|TD|","|TABLE|");if(d){f=vapp24getlistgrouptextfromhtml(d)}var j=b;while(j&&(!j.id||j.id!=e)){j=j.parentElement}if(j){var h=false;var i=0;var k=0;var g=j.firstChild;while(g&&g.tagName!="TBODY"){g=g.nextSibling}while(g&&g.tagName!="TR"){g=g.firstChild}while(g){var a;var c=g.firstChild;while(c){if(c.className){if(c.className=="FscDataGroupCaption"){a=vapp24getlistgrouptextfromhtml(c);if(c==d){k=i}break}else{if(c.className=="L"){a=vapp24getlistrowtextfromhtml(c);break}}}c=c.nextSibling}if(c!=d&&a==f){h=true}i++;g=g.nextSibling}if(h){return"|"+k+"|"+vapp24escape(f)}else{return vapp24escape(f)+"|"+vapp24escape(f)}}return""}function vapp24getlistgrouptextfromhtml(b){var a="";if(b){b=b.firstChild;while(b){if(b.nodeName=="#text"||(b.className&&b.className=="FscDGCtrl")){a+=(a?" ":"")+(b.nodeValue?b.nodeValue:b.innerText)}b=b.nextSibling}}return a}function vapp24getlistrowtextfromhtml(b){var a="";if(b){b=b.firstChild;while(b){if(b.nodeName=="#text"){a+=(a?" ":"")+b.text}b=b.nextSibling}}return a}function vapp24handleselecttoolappend(e,c){var h=e.innerText;var f=false;var d=e.parentElement.firstChild;var g=-1;var b=0;while(d){if(d==e){g=b}else{if(d.innerText==h){f=true}}d=d.nextSibling;b++}if(h&&h.length>0&&h.charAt(0)=="\xA0"){h=h.substring(1)}if(g_vapp24usesbkeystr){var a=vapp24getportletid()+"_"+c+"|BUTTONBAR|SelectTool";vapp24sendeventrpc("","Set",a,"",g_vapp24sbkeystr,"");g_vapp24sbkeystr="";g_vapp24usesbkeystr=false}g_vapp24doselection=false;vapp24setinfo("Click",vapp24getportletid()+"_"+c+"|BUTTONBAR|SelectTool||0|"+(f?"|"+g:vapp24escape(h)))}function vapp24setpage(g,a){if(g){var b;for(var d=0;d<g.DocPageHeaderCount();d++){var c=g.GetDocPageHeader(d);if(c.GetIsopen()==1){b=c.GetPagenumber()}}if(!b){b="0"}if(g_vapp24isthreepart){var e=a.getAttribute("vapp24portlet");var f=a.getAttribute("vapp24threepartpatched");if(!f){if(e){e=e.split(":");e=(e[0]*1+1)+":"+e[1]}else{e="1:"}a.setAttribute("vapp24portlet",e);a.setAttribute("vapp24threepartpatched",true)}}if(g.GetPagemodus()==FSCVAPP_THREEPART){g_vapp24isthreepart=true;a.setAttribute("vapp24threepartpatched",true)}a.setAttribute("vapp24page",b)}}function vapp24sendsbopenevent(c,a){var b=vappgetparentbytagname(a,"|TABLE|","|TABLE|");b=vappgetparentbyclassname(b,"FscSB");if(b&&b.getAttribute("vapp24editobject")){c=vapp24getsimpleid(c);vapp24sendeventrpc("","Open",vapp24getportletid()+"_"+c,"","","")}}function vapp24sendsbchangeevent(f,a,b){f=vapp24getsimpleid(f);var e=vappgetparentbytagname(b,"|TABLE|","|TABLE|");e=vappgetparentbyclassname(e,"FscSB");if(e&&e.getAttribute("vapp24editobject")){var c=vapp24getsboptionindexifambiguous(a);var d=a.innerText;if(d&&d.length>0&&d.charAt(0)=="\xA0"){d=d.substring(1)}if(c<0){vapp24sendeventrpc("","Set",vapp24getportletid()+"_"+f,"",d,"")}else{vapp24sendeventrpc("","Click",vapp24getportletid()+"_"+f,"|0||"+c,"","")}if(e.getAttribute("vapp24editobjectinlist")){vapp24incrementaldumprpc(vapp24getportletid()+"_"+f,"FSCCMS.XMLBase.COOSYSTEM@1.1:AttributeObjectDef",d,"INPLACE")}}}function vapp24findcontainerid(b){var a=vappgetparentbyclassname(b,"FSCAjaxContainer");if(a){if(a.id){return a.id}}return null}function vapp24handleimport(m,e){var j=m.filenames.split("|");for(h=0;h<j.length;h++){var b=j[h];var k=b.lastIndexOf("\\");k=Math.max(k,b.lastIndexOf("/"));if(k>=0){b=b.substring(k+1,b.length)}j[h]=b}var l=m.vapp24fileinfo;if(l){l=l.split("|");var a=-1;for(var h=0;h<l.length&&h<j.length;h++){var g=l[h].substring(l[h].indexOf('"')+1,l[h].length-1);g=g.split('" "');var n=-1;if(g.length>=8){n=g[7]}if(n==a&&n>=0){j[h]=""
}a=n}}j=j.join("|");if(e){var d=m.evtsrc;if(d!=null){var f=vapp24findcontainerid(d);var c=vapp24getsimpleid(d.id,f);vapp24setinfo("Import",vapp24getportletid(f)+"_"+c,"BUTTONBAR|SelectTool",j,m.importid)}vapp24handleeventrpc()}else{g_vapp24infohint[0]="ImportData";g_vapp24infohint[1]=(g_vapp24infohint[1]?g_vapp24infohint[1]+"?":"")+j;g_vapp24infohint[2]=(g_vapp24infohint[2]?g_vapp24infohint[2]+"?":"")+m.importid;g_vapp24infohint[3]=(g_vapp24infohint[3]?g_vapp24infohint[3]+"?":"")+m.id}}function vapp24bypasssendinfo(a){if(!g_vapp24bypasssendinfo){if(a){g_vapp24bypasssendinfo=true;g_vapp24bypasssedinfo=g_vapp24info;g_vapp24info=new Array()}}else{if(!a){g_vapp24bypasssendinfo=false;g_vapp24info=g_vapp24bypasssedinfo;g_vapp24bypasssedinfo=new Array()}}}function vapp24bypassresetstate(a){g_vapp24bypassresetstate=a}function vapp24handleroles(f){var g="";var d=f.getElementsByTagName("SPAN");for(var e=0;e<d.length;e++){var a=d[e].childNodes;for(var c=0;c<a.length;c++){var b=(a[c].nodeValue?a[c].nodeValue:a[c].innerText);g+=b}}g=g.replace(/\n/g," ");vapp24setinfo("Click","HEADER|"+vapp24escape(g));vapp24handleeventrpc()}function vapp24handlevportctxmenu(a){while(a){var b=a.getAttribute?a.getAttribute("fscurl"):0;if(b){break}a=a.parentNode}if(a){vapp24setinfo("Contextmenu","HEADER|PORTALS|"+vapp24escape(a.innerText))}else{vapp24setinfo("Contextmenu","HEADER")}}function vapp24handleinplaceeditstart(){vapp24setinfo("Keypress","","","F2Key")}function vapp24handleinplaceeditabort(){vapp24setdoselection(false);vapp24setinfo("Keypress","","","EscapeKey")}function vapp24handleinplaceeditcommit(){vapp24setdoselection(false);vapp24setinfo("Keypress","","","ReturnKey");var a=false;if(window.event&&window.event.type){a=window.event.type.indexOf("key")==0}if(a){vapp24setkeypresshandled(true);vapp24bypassresetstate(true)}}function vapp24handlepageminibranchclick(a){a=vappgetparentbytagname(a,"|A|","|A|");var b=a.title;if(b){vapp24sendeventrpc("","Click",vapp24getportletpageid()+"|BUTTONBAR|"+b,"","","")}}function vapp24handlebreadcrumbclick(c){var h=false;c=vappgetparentbytagname(c,"|A|","|A|");var d;if(c.className.indexOf("FscDropdown")==0){d=c.title;h=true}else{if(c.firstChild){d=c.firstChild.nodeValue}if(!d){d=c.title;h=true}}if(d){var f=vappgetelementbyid("FscBreadCrumb");var a=f.getElementsByTagName("A");if(a&&a.length){var k=false;var l=-1;for(var g=0;g<a.length;g++){var e=a[g];var m;var j=false;if(e.className.indexOf("FscDropdown")==0){m=e.title;j=true}else{m=e.firstChild.nodeValue}if(e==c){if(j){l=0}else{l=g+1}}else{if(d==m){k=true}}}if(k&&l>=0){d="|"+l}var b=vapp24getportletpageid()+"|BUTTONBAR|BREADCRUMBS|"+d;if(h){vapp24sendeventrpc("","Click",b,"","","")}else{vapp24setinfo("Click",b)}}}};function ajaxQueryTerm(){this.Init=RequestableControlInit;this.Render=BaseQueryTermRender;this.RenderPart=BaseQueryPart;this.BaseQuery=BaseQuery;this.BaseQueryValue=BaseQueryValue;this.BaseQueryValueMax=BaseQueryValueMax;this.Menu=BaseQueryMenu;this.Dispatch=Dispatch}function BaseQueryTermRender(a){var b=this.data.GetValue();this.imgurlprefix=this.data.GetImgurlprefix();a.Push('<table class="FscMax" cellpadding="0" cellspacing="0"><tr><td class="FscMin"><img class="FscImgQR" src="');a.Push(va_lookpath+"/FSCVAPP_1_1001/qr"+this.imgurlprefix+"_"+b+'.gif"');if(!this.isprint){a.Push(' onmouseup="vappqrmenu()"')}a.Push(' title="'+this.data.GetDefaultstr()+'"/><input name="f'+this.id+'" type="hidden" value="'+b+'"/></td><td>');this.BaseQuery(a,this.data.GetQueryValue(),this.data.GetQueryValueMax());a.Push("</td></tr></table>")}function BaseQueryPart(){var d=this.ctrldata;if(this.requestarg=="SHOWQR"){var j=vapplookpath+"/FSCVAPP_1_1001/qr"+this.imgurlprefix+"_",b=true;this.output.Push('<table class="FscQR" fscqrid="'+this.id+this.portletid+'" onkeypress="vappspan_hide(\'fscs\')">');for(var i=0,a=d.QueryRangeEnumCount();i<a;i++){var c=d.GetQueryRangeEnum(i),h=c.GetValue();if(b){this.output.Push("<tr>")}this.output.Push('<td><a href="#" onclick="return vappqrclick(this, \''+h+"', "+c.GetMode()+')" class="FscQRData"><img src="'+j+h+'.gif" alt="" />');AddValue(this.output,c);this.output.Push("</a></td>");if(b){b=false}else{this.output.Push("</tr>");b=true}}this.output.Push("</table>");this.menuhtm=this.output.PopAll(true);this.Menu()}else{var e=d.GetQueryValue(),g=d.GetQueryValueMax(),f=vappgetchildbyclassname(this.container,"FscQueryTerm");if(!e&&g&&f){this.BaseQueryValueMax(this.output,g);f.innerHTML+=this.output.PopAll(true)}else{this.BaseQuery(this.output,e,g);this.container.innerHTML=this.output.PopAll(true)}}}function BaseQuery(b,c,a){b.Push('<span class="FscQueryTerm">');this.BaseQueryValue(b,c);this.BaseQueryValueMax(b,a);b.Push("</span>")}function BaseQueryValue(a,c){if(c){var b=c.GetCtrlXmlDom();if(b){this.Dispatch(a,b,null,this.portletid);if(b.GetChangeop){this.changeop=b.GetChangeop();if(this.changeop&&this.changeop.indexOf("return ")==0){this.changeop=this.changeop.substr("return ".length)}}}}}function BaseQueryValueMax(b,a){if(a){b.Push('<span class="FscRange"><div class="FscFL">'+a.GetTo()+"</div>");var c=a.GetCtrlXmlDom();if(c){this.Dispatch(b,c,null,this.portletid)}b.Push("</span>")}}function BaseQueryMenu(a){if(null==this.menuhtm){this.srcelem=a;vappctrl(this.id,"SHOWQR",this)}else{var b=vappgethelperspan("fscs");b.innerHTML=this.menuhtm;vappmenuspan(b,vappgetleft(this.srcelem),vappgettop(this.srcelem))}}function vappqrmenu(){var b=window.event,c=b.srcElement,a=c.nextSibling;if(a){var e=a.name.substr(1),d=g_renderlater[vappgetportletid(e)];d.Menu(c);b.cancelBubble=true;b.returnValue=false}return false}function vappqrclick(elem,value,mode){var qrid=vappgetattribute(elem,"fscqrid",5);if(qrid){var ctrl=g_renderlater[qrid],selimg=elem.getElementsByTagName("IMG")[0],srcelem=ctrl.srcelem;srcelem.src=selimg.src;srcelem.title=selimg.nextSibling.data;srcelem.nextSibling.value=value;ctrl.container=srcelem.parentElement.nextSibling;var spans=ctrl.container.getElementsByTagName("SPAN"),showterm=mode==1||mode==3,showrange=mode==2||mode==3,foundterm=false,foundrange=false;for(var idx=0,cnt=spans.length;idx<cnt;idx++){var span=spans[idx];if(span.className=="FscQueryTerm"&&span.childNodes.length>0){span.style.display=(showterm)?"":"none";foundterm=true}else{if(span.className=="FscRange"){span.style.display=(showrange)?"":"none";foundrange=true;break}}}if(ctrl.changeop){eval(ctrl.changeop)}else{if((!foundterm&&showterm)||(!foundrange&&showrange)){if(foundterm&&showterm){mode=2}else{if(foundrange&&showrange){mode=1}}vappctrl(ctrl.id,"CHANGEQR:"+mode,ctrl)}}}vappspan_hide("fscs");return false}function ajaxEditInteger(){this.isnumeric=true;this.Init=BaseEditControlInit;this.Render=BaseInput;this.PrintRender=BasePrintNumeric;this.BasePrintInput=BasePrintInput}function ajaxViewInteger(a){this.Init=ControlInit;this.Render=BaseViewNumeric}function ajaxEditFloat(){this.isnumeric=true;this.Init=BaseEditControlInit;this.Render=BaseInput;this.PrintRender=BasePrintNumeric;this.BasePrintInput=BasePrintInput}function ajaxViewFloat(a){this.Init=ControlInit;this.Render=BaseViewNumeric}function ajaxEditNumber(){this.isnumeric=true;this.Init=BaseEditControlInit;this.Render=BaseInput;this.PrintRender=BasePrintNumeric;this.BasePrintInput=BasePrintInput}function ajaxViewNumber(a){this.Init=ControlInit;this.Render=BaseViewNumeric}function ajaxEditString(){this.Init=BaseEditControlInit;this.Render=BaseEditStringRender;this.PrintRender=BasePrintInput}function BaseEditStringRender(a){var b=this.data.GetIsspell&&this.data.GetIsspell()==1&&this.data.GenericBranchCount()>0;if(this.id){a.Push('<table class="FscInputBorder" cellpadding="0" cellspacing="0"');if(!b){a.Push(' style="margin-right:0.1em"')}a.Push('><tr><td class="FscMax" ');if(this.weightcolor){a.Push('style="background-color:');
a.Push(this.weightcolor);a.Push('"')}a.Push('><input type="text" name="f');a.Push(this.id);a.Push('" maxlength="');a.Push(this.data.GetMaxlength());a.Push('" size="');a.Push(this.data.GetSize());a.Push('" ');BaseInputClass(a,this.data);if(this.data.GetChangeop){a.Push('onchange="');a.Push(this.data.GetChangeop());a.Push('" ')}var c=this.data.GetColumnwidth();if(c){a.Push('style="width:'+c+'" ')}a.Push('value="');AddValue(a,this.data);a.Push('" /></td>');if(b){a.Push('<td class="FscSpellBtn">');this.BranchGenericBranch(a,this.data.GetGenericBranch(0),"FscBtBranch","FscLink",true);a.Push("</td>")}a.Push("</tr></table>")}}function ajaxViewString(a){this.Init=ControlInit;this.Render=BaseViewString}function ajaxViewBool(a){this.Init=ControlInit;this.Render=BaseViewString}function ajaxEditBool(){this.Init=BaseEditControlAdvInit;this.Render=BaseEditBoolRender;this.RenderRemainder=BaseBoolSetOptions;this.BoolValue=BaseEditBoolValue;this.BasePrintInput=BasePrintInput;this.InUse=true}function BaseEditBoolRender(e){var h=(this.data.GetMustbedef());var k=this.data.GetBoolvalue();var g=(this.data.GetUseradio()==1);var m=(this.data.GetUsecheckbox()==1);if(g||m){if(this.isprint){if(g){var a=vappgetformfield("f"+this.id+"_1",this.portletid);if(a){for(var l=0,d=a.length;l<d;l++){var b=a[l];if(b.checked){k=b.value;break}}}}else{k=this.BasePrintInput(e,"f"+this.id+"_1",true)}switch(k){case"1":e.Push(this.data.GetBooltrue());break;case"0":e.Push(this.data.GetBoolfalse());break}}else{if(g){if(h==0){this.BoolValue(e,this.data.GetBoolundefined(),"",k=="")}this.BoolValue(e,this.data.GetBooltrue(),"1",k=="1");this.BoolValue(e,this.data.GetBoolfalse(),"0",k=="0")}else{var c=(this.data.GetBooldesc())?this.data.GetBooldesc():"",j=(!c&&this.data.GetBoolundefined())?this.data.GetBoolundefined():"";e.Push('<input class="'+g_vapp_css.formfield+'" type="checkbox" name="c'+this.id+'" onclick="vappcheckboxchanged(this,'+h+",'"+j+"');"+this.data.GetChangeop()+'" ');if(k==1){e.Push("checked='checked' ")}else{if(k==""){e.Push("style='background-color:#bfbfbf;");if(g_isie){e.Push("filter:progid:dximagetransform.microsoft.alpha(opacity=40)")}else{e.Push("-moz-opacity:0.4")}e.Push("' ");c=j}}e.Push(" />&nbsp;<span>"+c+"</span><input type='hidden' name='f"+this.id+"_1' id='f"+this.id+this.portletid+"' value='"+k+"' ");var f=(this.data.GetChangeop())?this.data.GetChangeop():null;if(f){e.Push('onchange="'+f+'" ')}e.Push("/>")}}}else{e.Push('<table class="FscSB" cellpadding="0" cellspacing="0"><tr><td class="FscMax" ');if(this.data.GetColumnwidth()){e.Push('style="'+this.data.GetColumnwidth()+'"')}e.Push(">");var f=(this.data.GetChangeop())?this.data.GetChangeop():null;var i="";switch(k){case"0":i=this.data.GetBoolfalse();break;case"1":i=this.data.GetBooltrue();break}this.BaseSB(e,this.id,i,k,null,f);e.Push('</td><td class="FscSBButton">');this.BaseSBButton(e,this.id+this.portletid);e.Push("</td></tr></table>")}}function BaseEditBoolValue(b,d,c,a){b.Push("<input type='radio' class='"+g_vapp_css.radio+"' name='f");b.Push(this.id);b.Push("_1' value='");b.Push(c);b.Push("' ");if(this.data.GetChangeop()&&!this.isprint){b.Push('onchange="');b.Push(this.data.GetChangeop());b.Push('" ')}if(a){b.Push("checked='checked' ")}b.Push(" />"+d+"<br/>")}function BaseBoolSetOptions(){var a="";var b=this.data.GetBoolundefined();if(b){a+=vappgetsboptionhtm()}a+=vappgetsboptionhtm("1",null,this.data.GetBooltrue());a+=vappgetsboptionhtm("0",null,this.data.GetBoolfalse());return a}function vappcheckboxchanged(e,a,d){var b=vappgetelementbyid("f"+e.name.substring(1));if(e.checked){if(e.style.backgroundColor!=""){e.style.backgroundColor="";if(g_ismoz){e.style.MozOpacity=""}else{e.style.filter=""}b.value="1"}else{if(a==0){e.style.backgroundColor="#bfbfbf";if(g_ismoz){e.style.MozOpacity=0.4}else{e.style.filter="alpha(opacity=40)"}e.checked=false;b.value=""}else{b.value="1"}}}else{b.value="0"}if(d){for(var c=e;null!=c;c=c.nextSibling){if(c.tagName=="SPAN"){c.innerHTML=(b.value=="")?d:"";break}}}}function ajaxViewEnum(a){this.Init=ControlInit;this.Render=BaseViewString}function ajaxEditEnum(){this.Init=RequestableControlInit;this.Render=BaseEditEnumRender;this.RenderPart=BaseSetOptions;this.RenderPartHtm=BaseGetOptionsHtm;this.PrintRender=BaseEditEnumPrintRender;this.BasePrintSB=BasePrintSB;this.BaseEnumOption=BaseEnumOption}function BaseEditEnumRender(a){if(!this.enumobj){this.enumobj=this.data}if(this.enumobj.GetUseradio()==1){a.Push("<p>");this.BaseEnumOption(a,this.enumobj.GetIntvalue());a.Push("</p>")}else{a.Push('<table class="FscSB" cellpadding="0" cellspacing="0"><tr><td class="FscMax" ');if(this.enumobj.GetColumnwidth()){a.Push('style="'+this.enumobj.GetColumnwidth()+'"')}a.Push(">");var b=(this.enumobj.GetChangeop())?this.enumobj.GetChangeop():null;this.BaseSB(a,this.id,this.enumobj.GetDefaultstr(),this.enumobj.GetIntvalue(),null,b);a.Push('</td><td class="FscSBButton">');this.BaseSBButton(a,this.id+this.portletid);a.Push("</td></tr></table>")}}function BaseEditEnumPrintRender(b){if(this.data.GetUseradio()==1){var e=this.data.GetIntvalue();
for(var d=0,c=this.data.EnumOptionCount();d<c;d++){var a=this.data.GetEnumOption(d),f=a.GetIntvalue();if(f==e){AddValue(b,a);break}}}else{this.BasePrintSB(b)}}function BaseEnumOption(b,e){for(var d=0,c=this.enumobj.EnumOptionCount();d<c;d++){var a=this.enumobj.GetEnumOption(d);var f=a.GetIntvalue();b.Push('<input type="radio" class="'+g_vapp_css.radio+'" name="f'+this.id+'" value="');b.Push(a.GetIntvalue()+'" ');if(this.enumobj.GetChangeop()&&!this.isprint){b.Push('onchange="'+this.enumobj.GetChangeop()+'" ')}if(f==e){b.Push('checked="checked" ')}b.Push('/><label for="f'+this.id+"_"+f+'">');AddValue(b,a);b.Push("</label><br />")}}function ajaxViewObject(a){this.Init=BaseEditControlInit;this.Render=BaseViewObjectRender}function BaseViewObjectRender(b){b.Push('<span id="'+this.id+this.portletid+'" class="FscOL" tabindex="0"');var a=this.data.GetFscarg();if(a){b.Push(' fscargs="'+a+'"')}b.Push(">");if(this.data.GetIcon()){b.Push(BaseIcon(this.data.GetIcon(),this.data.GetImgalttext()))}AddValue(b,this.data);b.Push("</span>")}function ajaxEditObject(){this.Init=RequestableControlInit;this.Render=BaseEditObjectRender;this.PrintRender=BasePrintSB;this.RenderPart=BaseSetOptions;this.RenderPartHtm=BaseGetOptionsHtm}function BaseEditObjectRender(a){if(this.id){a.Push('<table cellspacing="0" cellpadding="0" class="FscSB"');if(g_vappis24hrec){a.Push(' vapp24editobject="true"');if(this.IsInList()){a.Push(' vapp24editobjectinlist="true"')}}a.Push('><tr><td class="FscMax">');var d;var f=(this.data.GetHierarchystr());if(f&&this.data.GetChangeop()){d="vappobjhierarchy(this); "+this.data.GetChangeop()}else{if(f){d="vappobjhierarchy(this)"}if(this.data.GetChangeop()){d=this.data.GetChangeop()}}var c=(this.data.GetFscarg)?'fscargs="'+this.data.GetFscarg()+'" ':"";this.BaseSB(a,this.id,this.data.GetDefaultstr(),this.data.GetValue(),this.data.GetIcon(),d,c);a.Push('</td><td class="FscSBButton">');this.BaseSBButton(a,this.id+this.portletid);a.Push("</td>");if(!this.isprint){for(var e=0;e<this.data.GenericBranchCount();e++){a.Push('<td class="FscEditObjectTool">');this.BranchGenericBranch(a,this.data.GetGenericBranch(e),"FscBtBranch","FscLink",true);a.Push("</td>")}}a.Push("</tr></table>");if(f){var b=new BaseHierarchy(a,this.data,this.id+"_2",this.portletid,this.isprint)}}}function BaseHierarchy(d,e,b,h,c){this.data=e;this.portletid=h;this.isprint=c;this.RenderRemainder=BaseHierarchySetOptions;this.BaseSB=BaseSB;this.BaseSBButton=BaseSBButton;this.InUse=true;g_renderlater[b+this.portletid]=this;d.Push('<table cellspacing="0" cellpadding="0" class="FscHierarchy" ');if(!this.data.GetValue()){d.Push('style="display:none"')}d.Push('><tr><td class="FscHierarchy">');d.Push(e.GetHierarchystr());d.Push('</td><td class="FscEditObjectList">');var a;var j;for(var f=0;f<this.data.HierarchyOptionCount();f++){var g=this.data.GetHierarchyOption(f);if(g.GetSelected()==1){a=g._text;j=g.GetValue();break}}this.BaseSB(d,b,a,j);d.Push('</td><td class="FscSBButton">');this.BaseSBButton(d,b+this.portletid);d.Push("</td></tr></table>")}function BaseHierarchySetOptions(){var a=new BufferedOutput();for(var b=0;b<this.data.HierarchyOptionCount();b++){var c=this.data.GetHierarchyOption(b);BaseSBOption(a,c)}return a.PopAll()}function vappobjhierarchy(c){var a=vappgetparentbytagname(c,"|TABLE|","|TABLE|BODY|");for(var b=a.nextSibling;null!=b;b=b.nextSibling){if(b.className=="FscHierarchy"){b.style.display=(c.value)?"":"none";break}}}function ajaxEditFile(){this.Init=BaseEditControlInit;this.Render=BaseEditFileRender;this.PrintRender=BasePrintInput;this.BaseEditFileButton=BaseFileButton;this.BaseEditFileButtonFUrl=BaseFileButtonFUrl}function BaseEditFileRender(b){b.Push('<input type="file" name="f'+this.id+'"');if(this.weightcolor){b.Push(' style="background-color:');b.Push(this.weightcolor);b.Push('"')}if(this.data.GetUsestub()!=1){b.Push(' usestub="false"')}var c=this.data.GetColumnwidth();if(!c){c=50;if(!window.g_isportlet){b.Push(' class="Fsc"')}}b.Push(' size="'+c+'"');if(window.g_isportlet){b.Push(' class="'+g_vapp_css.input+'"')}var a="f"+this.id+this.portletid;b.Push(' id="'+a+'"');if(!this.isprint){b.Push(" onchange=\"vappupdateextension('"+a+"')\"")}b.Push("/>");if(this.data.GetFileisnull()==0){var d=vappgetplugin(false);if(d){this.BaseEditFileButton(b,false,this.data.GetFilereadstring())}else{this.BaseEditFileButtonFUrl(b,false,this.data.GetFilereadstring())}this.BaseEditFileButtonFUrl(b,true,this.data.GetFileexportstring())}}function ajaxViewFile(a){this.Init=ControlInit;this.Render=BaseViewFileRender;this.BaseViewFileButton=BaseFileButton;this.BaseViewFileButtonFUrl=BaseFileButtonFUrl}function BaseViewFileRender(a){if(!this.isprint){var b=vappgetplugin(false);if(this.data.GetFileisnull()==0){if(b){this.BaseViewFileButton(a,false,this.data.GetFilereadstring())}else{this.BaseViewFileButtonFUrl(a,false,this.data.GetFilereadstring())}this.BaseViewFileButtonFUrl(a,true,this.data.GetFileexportstring())}if(b&&this.data.GetFileeditstring()&&this.data.GetGeneric()==1){this.BaseViewFileButton(a,true,this.data.GetFileeditstring())
}}}function BaseFileButton(a,c,b){a.Push('<input type="button" onclick="vappopenfile('+c+", '"+this.data.GetObjectaddress()+"', '"+this.data.GetContentpath()+"')\" value='"+b+"'/>")}function BaseFileButtonFUrl(a,e,d){var b=vappgenfriendlyurl(this.data.GetObjectaddress(),e,this.data.GetContentfile(),null,this.data.GetContentpath()),c=(e)?"vappexport":"window.open";a.Push('<input type="button" onclick="'+c+"('"+b+"')\" value='"+d+"' />")}function vappopenfile(d,c,b){var a=(d)?"'COO.1.1001.1.38272','("+c+',,,,,"'+b+"\")'":"'COO.1.1001.1.38570','("+c+',,,,"'+b+"\")'";return vapp(5002,null,"["+a+"]")}function ajaxCurrencyControl(){this.Init=BaseCurrencyInit;this.Render=BaseCurrencyControlRender;this.CurrencyEnum=CurrencyEnum;this.RenderRemainder=BaseSetCurrencyOptions;this.BaseEnumOption=BaseEnumOption;this.BasePrintInput=BasePrintInput}function BaseCurrencyInit(c,b,h,f,e,g,d,a){this.RequestableControlInit=RequestableControlInit;this.RequestableControlInit(c,b,h,f,this,g,d,a);this.enumobj=this.data.GetEditEnum();this.withcurr=(this.data.GetWithcurrency()==1)}function BaseCurrencyControlRender(b){if(this.data.GetIsedit()==1){var c=(this.parent&&this.parent.BaseQueryValue)?this.id:this.id+"_1";if(this.isprint){b.Push('<span class="FscNumber">');this.BasePrintInput(b,"f"+c);b.Push("</span>&nbsp;");this.BaseSB(b,this.id,this.enumobj.GetDefaultstr(),this.enumobj.GetIntvalue())}else{b.Push("<table ");if(this.IsInList()){b.Push('class="FscFR" ')}if(this.weightcolor){b.Push('style="background-color:'+this.weightcolor+'" ')}b.Push('cellpadding="0" cellspacing="0"><tr><td class="FscInputBorder">');var a=this.data.GetEditNumber();b.Push('<input type="text" id="f'+this.id+'value" name="f'+c+'" maxlength="');b.Push(a.GetMaxlength()+'" size="'+a.GetSize()+'" ');BaseInputClass(b,a);if(a.GetChangeop()&&!this.isprint){b.Push('onchange="'+a.GetChangeop()+'" ')}var e=a.GetColumnwidth();if(e){b.Push('style="width:'+e+'" ')}b.Push('value="');AddValue(b,a);b.Push('" ');if(this.data.GetAttrdef()){if(this.withcurr){b.Push("onchange=\"vappcurrencyconvert('"+this.data.GetAttrdef()+"', 'f"+this.id);b.Push("curr.value', value, 'f"+this.id+"ref')\" ")}else{b.Push("onchange=\"vappcurrencyconvert('"+this.data.GetAttrdef()+"', '");b.Push(this.data.GetDefaultcurrency()+"', value, 'f"+this.id+"ref')\" ")}}b.Push("/>");this.CurrencyEnum(b);BaseViewRefCurrencyRender(b,this.data.GetViewRefCurrency(),this.id);b.Push("</tr></table>")}}else{var d=this.data.GetViewNumber();if(null!=d){b.Push('<div id="'+this.id+this.portletid+"\" class='FscNumber'>");AddValue(b,d);if(this.data.GetWithcurrency()==1){b.Push("&nbsp;");if(!AddValue(b,this.data.GetViewEnum())&&this.IsInList()){b.Push("&nbsp;&nbsp;&nbsp;")}}b.Push("</div>")}}}function CurrencyEnum(a){if(this.withcurr){a.Push('<td class="FscSp"></td><td class="FscSB">');var b=(this.enumobj.GetChangeop())?this.enumobj.GetChangeop():null;this.BaseSB(a,this.id,this.enumobj.GetDefaultstr(),this.enumobj.GetIntvalue(),null,b);a.Push('</td><td class="FscSBButton">');this.BaseSBButton(a,this.id+this.portletid);a.Push("</td>")}}function BaseSetCurrencyOptions(){for(var a=0;a<this.enumobj.OptionCount();a++){var b=this.enumobj.GetOption(a);BaseSBOption(this.output,b)}return this.output.PopAll(true)}function BaseViewRefCurrencyRender(b,a,c){if(null!=a){var d=a.GetViewNumber();if(null!=d){if(d.GetCtrlXml()){b.Push("<td><span class='FscNumber' ");if(c){b.Push("id='f"+c+"ref' ")}b.Push(">");AddValue(b,d);b.Push("</span><span class='FscNumber'>&nbsp;");AddValue(b,a.GetViewEnum());b.Push("</span></td>")}}}}function vappsetrefcurrency(c){var e=vappxmlgetdictionary(c);var a;var d;if(null!=e){for(var e=e.firstChild;null!=e;e=e.nextSibling){switch(e.nodeName){case"value":a=vappxmlgettext(e);break;case"elmname":d=vappxmlgettext(e);break}}}var b=window.document.getElementById(d);b.innerHTML=a}function vappcurrencyconvert(b,d,f,g){var e=window.document.getElementById(g);if(null!=e){e.innerHTML="";var a=b+";"+d+";"+f+";"+g;var c=vappgenxmlrpc("COO.1.1001.1.38841","",a);vappcallrpc(vappsetrefcurrency,c)}}function BaseEditControlInit(c,b,g,f,e,d,a){ControlInit(c,b,g,f,this,d,a,d,a);this.id=this.data.GetId()}function BaseEditControlAdvInit(c,b,g,f,e,d,a){this.BaseEditControlInit=BaseEditControlInit;this.BaseEditControlInit(c,b,g,f,e,d,a);if(this.data.GetUseradio()!=1){g_renderlater[this.id+this.portletid]=this}}function BaseIcon(a,b){if(a){if(null==b){b=""}return'<img src="../tmp/'+a+'.gif" class="FscI" title="'+b+'" />'}}function BaseGetOptionsHtm(b,c){if(c){this.isenhancedsb=(c.GetAppearance&&c.GetAppearance()==2);if(this.isenhancedsb&&!this.icons){this.icons={}}var e=c.OptionCount();if(e==0){b.Push(vappgetsbemptyoptionhtm())}else{var a=vapphead(),f;for(var d=0;d<e;d++){f=c.GetOption(d);BaseSBOption(b,f,this.isenhancedsb,this.icons,a)}this.hasobjectoptions=(f.GetIcon&&f.GetIcon())?true:false}return b.PopAll(true)}}function BaseSetOptions(){var b=this.id+this.portletid,a=this.RenderPartHtm(this.output,this.ctrldata);if(!vappsbqsresult(this.requestarg,b,a)){vapphandleselectbox(b,a,false,true)
}}function BaseSBOption(b,f,c,d,a){var g,e,h;if(f){g=(f.GetValue)?f.GetValue():null;e=(f.GetIcon)?f.GetIcon():null;h=(f._text)?f._text:null}b.Push(vappgetsboptionhtm(g,e,h,c,d,a))}function BaseSB(d,b,k,l,i,e,g,h,a){var c=b+this.portletid;if(this.isprint){this.BasePrintSB(d,c)}else{d.Push('<a class="'+g_vapp_css.selectbox+'" id="'+c+'" ');if(!h){var j=(this.GetLabel)?this.GetLabel():null,f=(j)?vappgetstring(FSC_STRSELECTBOX)+" "+j:vappgetstring(FSC_STRSELECTBOX);d.Push('alt="'+f+'" onkeydown="return vappsbinputevt(arguments[0], this)" href="#" onclick="return false" ');if(g_vappis24hrec){d.Push("onmousedown=\"vapphandleselectbox('"+c+"', null, false, false, true)\" ")}else{d.Push("onmousedown=\"vapphandleselectbox('"+c+"')\" ")}}if(g&&window.vapptooltips){d.Push('onmouseover="vappsbtooltip(this)" ')}if(this.weightcolor){d.Push('style="background-color:'+this.weightcolor+';" ')}if(g){d.Push(g)}d.Push(">");if(h){d.Push('<input type="text" class="FscSBInput" name="x'+b+'" id="x'+c+'" onkeydown="return vappsbinputevt(arguments[0], this, true)" onkeyup="return vappsbfilterevt(arguments[0], this)"');if(a){d.Push(' value="'+a+'" onfocus="vappenablesb(this)"')}if(g_ismoz){d.Push(' ondrop="vappdrop(arguments[0]);"')}d.Push("/>")}else{if(i){d.Push(BaseIcon(i,k))}if(k){d.Push(MaskValue(k))}}d.Push("</a>");if(!h){d.Push('<input type="hidden" name="f'+b+'_v" id="f'+c+'_v" value="'+MaskValue(l)+'" ');if(e){d.Push('onchange="'+e+'" ')}d.Push("/>")}}}function BaseSBButton(a,c,b){if(!this.isprint){a.Push('<div class="FscSBButton"');if(!this.isprint){if(g_vappis24hrec){a.Push(" onmousedown=\"vapphandleselectbox('"+c+"', null, false, false, true)\"")}else{a.Push(" onmousedown=\"vapphandleselectbox('"+c+"')\"")}}if(b){a.Push(' style="margin-right:'+b+';"')}a.Push('><img src="'+va_lookpath+'/FSCVAPP_1_1001/combodown.gif" class="FscLink" alt=""/></div>')}}function BasePrintSB(a,c){if(!c){c=this.id}var b=vappgetelementbyid(c,this.portletid);if(b){a.Push(b.innerHTML)}}function BaseInputClass(a){if(window.g_isportlet){a.Push("class='"+g_vapp_css.input+"' ")}}function BaseInput(a){var b=(this.isnumeric&&this.IsInList())?"FscFR":"FscNum";a.Push('<table cellpadding="0" cellspacing="0" class="'+b+'"><tr><td class="FscInputBorder"');if(this.weightcolor){a.Push(' style="background-color:'+this.weightcolor+'"')}a.Push('><input type="text" name="f'+this.id+'" maxlength="'+this.data.GetMaxlength());a.Push('" size="'+this.data.GetSize()+'" ');BaseInputClass(a,this.data);if(this.data.GetChangeop()&&!this.isprint){a.Push('onchange="'+this.data.GetChangeop()+'" ')}var c=this.data.GetColumnwidth();if(c){a.Push("style='width:"+c+'" ')}a.Push('value="');AddValue(a,this.data);a.Push('" /></td></tr></table>')}function BasePrintInput(b,f,d,e){if(!f){f="f"+this.id}var a=vappgetformfield(f,this.portletid);if(a){var c=(e)?a.value:MaskValue(a.value);if(d){return c}b.Push(c)}}function BaseViewNumeric(a){a.Push("<div class='FscNumber'>");AddValue(a,this.data);a.Push("</div>")}function BasePrintNumeric(a,b){a.Push("<div class='FscNumber'>");this.BasePrintInput(a,b);a.Push("</div>")}function BaseViewString(a){AddValue(a,this.data)}function vappupdateextension(b){var d=fscjq("#"+b);if(d&&d.length>0){var c=d.val();if(c){var e=c.split(".");var f=e[e.length-1];var a=d.parents("TR.FscGrid:first").parent().find("[fscitemdesc=COOSYSTEM@1.1:contextension]").find("INPUT");if(f&&a){a.val(f)}}}};function BranchGenericBranch(d,k,e,a,l,g,f,b){if(this.isprint&&!b){return}if(null==e){e="FscBranch"}d.Push('<span class="'+e+'"');if(this.defaultbranch&&this.defaultbranch==k.GetArg1()){d.Push(' id="FscDefBr'+this.id+'"')}d.Push("><a");if(!this.isprint){d.Push(' href="#" onclick="'+BranchGetAction(k,f,g)+'" ')}var c=k.GetAcckey(),i="",h=(k.GetDesc())?MaskValue(k.GetDesc()):null;if(h){d.Push('title="'+h);i=h;if(c){d.Push(" Alt+"+c);if(g_isie7){i+=" Alt+"+c}}d.Push('" ')}if(c){d.Push('accesskey="'+c+'"')}d.Push(">");if(k.GetImg()){if(null==a){a="Fsc16"}d.Push('<img src="../tmp/'+k.GetImg()+'.gif" class="'+a+'" align="absmiddle" alt="'+i+'"/>')}if(!l){if(k.GetCaption()){d.Push("&nbsp;"+MaskValue(k.GetCaption())+"&nbsp;")}else{var j=k.GetCtrlXmlDom();if(j){if(j.GetCtrlXmlDom()){j=j.GetCtrlXmlDom()}Dispatch(d,j)}}}d.Push("</a></span>")}function BranchGenericBranches(d,i,e,a,j,g,f,b){for(var h=0,c=i.GenericBranchCount();h<c;h++){this.BranchGenericBranch(d,i.GetGenericBranch(h),e,a,j,g,f,b)}}function BranchGenericButton(c,i,j,d,a,l){if(this.isprint&&!a){return}c.Push('<a class="'+g_vapp_css.button);if(j){c.Push(" "+j)}c.Push('"');if(!this.isprint){c.Push(' href="#" onclick="'+BranchGetAction(i,d)+'" ')}if(this.defaultbranch&&this.defaultbranch==i.GetArg1()){c.Push('id="FscDefBr'+this.id+'" ')}var b=i.GetAcckey(),g="",f=(i.GetDesc())?MaskValue(i.GetDesc()):null,e=i.GetImg(),k=(l)?null:i.GetCaption();if(f){c.Push('title="'+f);g=f;if(b){c.Push(" Alt+"+b);if(g_isie7){g+=" Alt+"+b}}c.Push('" ')}if(b){c.Push('accesskey="'+b+'"')}c.Push(">");if(e){c.Push('<img src="../tmp/'+e+'.gif" alt="'+g+'"/>')}if(k){c.Push(MaskValue(k))}else{var h=i.GetCtrlXmlDom();if(h){if(h.GetCtrlXmlDom()){h=h.GetCtrlXmlDom()}Dispatch(c,h)}}c.Push("</a>")}function BranchGenericButtons(c,e,b,h,g,f){for(var a=0,d=e.GenericBranchCount();a<d;a++){this.BranchGenericButton(c,e.GetGenericBranch(a),b,h,g,f)}}function BranchGetAction(e,f,b){if(!b){b=e.GetLocalop();if(!b){var d=(e.GetArg1())?e.GetArg1():"null",c=(e.GetArg2())?e.GetArg2():"null",a=(e.GetArg3())?MaskValue(e.GetArg3()):"null";b=(d=="5001")?"return vappctrl("+c+", "+a+")":"return vapp("+d+","+c+","+a+")"}}if(g_vappis24hrec){if(b&&b.indexOf("/*vapp24*/")==0){b=b.substring("/*vapp24*/".length)}else{b=vapp24getbranchaction(e)+b}}if(f){b="if (vappconfirm()) {"+b+"}"}return b}function BranchGenericBranch24(c,e,d,i,f,a,j,h,g,b){if(!h){h=BranchGetAction(i)}h="/*vapp24*/"+vapp24getbranchaction(i,c,e)+h;return BranchGenericBranch(d,i,f,a,j,h,g,b)}function BranchGenericBranches24(c,f,e,k,g,a,l,i,h,b){for(var j=0,d=k.GenericBranchCount();j<d;j++){this.BranchGenericBranch24(c,f,e,k.GetGenericBranch(j),g,a,l,i,h,b)}};var calDayString;var calMonthString;var calDateFormat;var calDateSeparator;var calNoWorkDays;var calHolidays;function ajaxDateTimeControl(){this.Init=DateTimeControlInit;this.Render=DateTimeControlRender;this.RenderPart=DateTimeControlRenderPart;this.CalendarSetInfo=CalendarSetInfo;this.CalendarEditDate=CalendarEditDate;this.CalendarEditTime=CalendarEditTime;this.GetMenu=CalendarGetMenu;this.BasePrintInput=BasePrintInput}function DateTimeControlInit(e,b,h,g,f,d,a){var c=e.GetEditDate();if(c){this.id=c.GetName();this.RequestableControlInit=RequestableControlInit;this.RequestableControlInit(e,b,h,g,f,d,a)}else{ControlInit(e,b,h,g,this,d)}}function DateTimeControlRender(b,d){if(!d){d=this.data}var a=d.GetReadDate();if(a&&a.GetDate()){b.Push(a.GetDate())}var e=d.GetReadTime();if(e&&e.GetTime()){if(this.IsInList()){b.Push(" "+e.GetTime())}else{b.Push("&nbsp;"+e.GetTime())}}var c=d.GetEditDate();if(c){var f=d.GetEditTime();if(this.isprint){this.BasePrintInput(b,"f"+c.GetName());if(f){b.Push(" ");this.BasePrintInput(b,"f"+f.GetName())}}else{this.CalendarSetInfo(c.GetCalendarInfo());b.Push('<table class="FscCal" cellpadding="0" cellspacing="0" oncontextmenu="return calIntervalCtx(this);"><tr>');this.CalendarEditDate(b,c);if(f){this.CalendarEditTime(b,f)}b.Push("</tr></table>")}}}function DateTimeControlRenderPart(){if(this.ctrlname=="Menu"){window.g_vappcalmenu=new VAPPMenu(this.ctrldata);window.g_vappcalmenu.Show(null,this.x,this.y,"",this.id)}}function CalendarEditDate(a,b){var d=b.GetName();if(d){a.Push('<td class="FscInputBorder"');if(this.weightcolor){a.Push(' style="background-color:'+this.weightcolor+'"')}a.Push('><input type="text" ');if(g_vapp_css.input){a.Push('class="'+g_vapp_css.input+'" ')}a.Push('id="f'+d+this.portletid+'" name="f'+d+'" onkeydown="calTrapKey(\'f'+d+"')\" ");if(b.GetDate()){a.Push('value="'+b.GetDate()+'" ')}else{a.Push('value="" ')}a.Push('maxlength="'+b.GetMaxlength()+'" ');a.Push('size="'+b.GetSize()+'" ');if(b.GetChangeop()){a.Push('onchange="'+b.GetChangeop()+'" ')}a.Push("/></td><td");if(b.GetShowcal()==1){a.Push('><a href="#" onclick="calShowCalendar(\'f'+d+"',false);return false;\" >");a.Push('<img class="Fsc" src="../tmp/'+b.GetImg()+'.gif" alt="'+b.GetTitle()+'" title="'+b.GetTitle()+'" />');a.Push("</a>");var c="xf"+d+"hlp";a.Push('<input type="hidden" id="'+c+this.portletid+'" name="'+c+'"/>')}else{a.Push(' style="padding-left:1px">')}a.Push("</td>")}}function CalendarEditTime(a,b){var c=b.GetName();if(c){a.Push('<td class="FscInputBorder"');if(this.weightcolor){a.Push(' style="background-color:'+this.weightcolor+'"')}a.Push('><input type="text" ');if(g_vapp_css.input){a.Push('class="'+g_vapp_css.input+'" ')}a.Push('id="f'+c+this.portletid+'" name="f'+c+'" ');if(b.GetTime()){a.Push('value="'+b.GetTime()+'" ')}else{a.Push('value="" ')}a.Push('maxlength="'+b.GetMaxlength()+'" ');a.Push('size="'+b.GetSize()+'" ');if(b.GetChangeop()){a.Push('onchange="'+b.GetChangeop()+'" ')}a.Push("/>");a.Push("</td>")}}function CalendarGetMenu(a){this.x=vappgetmouseposX(a);this.y=vappgetmouseposY(a)-10;if(window.g_vappcalmenu){window.g_vappcalmenu.Show(null,this.x,this.y,"",this.id)}else{return vappctrl(this.id,"CALMENU",this)}}function CalendarSetInfo(c){calDayString=new Array();for(var a=0;a<c.DayStringCount();a++){calDayString.push(c.GetDayString(a).GetDay())}calMonthString=new Array();for(var a=0;a<c.MonthStringCount();a++){calMonthString.push(c.GetMonthString(a).GetMonth())}calHolidays=new Array();for(var a=0;a<c.HolidaysCount();a++){var b=c.GetHolidays(a);calHolidays[a]=new Array();calHolidays[a][0]=b.GetYear();calHolidays[a][1]=b.GetMonth();calHolidays[a][2]=b.GetDay();calHolidays[a][3]=b.GetText()}calDateFormat=c.GetDateformat();calDateSeparator=c.GetDateseparator();calNoWorkDays=""+c.GetNoworkdays()}function calGetNumDays(b,a){switch(a){case 1:return(((b%4==0)&&(b%100!=0))||(b%400==0))?29:28;case 0:case 2:case 4:case 6:case 7:case 9:case 11:return 31;case 3:case 5:case 8:case 10:return 30}}function calGetCurrentDate(a,b){var j;var k=new Date();k.setHours(0,0,0,0);var g;var d=false;var h=vappgetelementbyid(a);var f=vappgetelementbyid(b);if(f!=null){d=true;g=f.value.split(":");if(isNaN(g[0])||Number(g[0])<0||Number(g[0])>23){d=false}else{if(isNaN(g[1])||Number(g[1])<0||Number(g[1])>59){d=false}else{if(isNaN(g[2])||Number(g[2])<0||Number(g[2])>59){d=false}}}}if(!d){g=new Array(3);g[0]=k.getHours();g[1]=k.getMinutes();g[2]=k.getSeconds()}var j=h.value;var c=false;var m;var n=1753;var l=4712;if(j){var e=j.split(calDateSeparator);if(calDateFormat.charAt(0)=="D"){m=new Date(e[2],e[1]-1,e[0],g[0],g[1],g[2],0);if((m.getFullYear()!=e[2])||(m.getMonth()!=(e[1]-1))||(m.getDate()!=e[0])){m=new Date()}}else{if(calDateFormat.charAt(0)=="M"){m=new Date(e[2],e[0]-1,e[1],k.getHours(),k.getMinutes(),k.getSeconds());if((m.getFullYear()!=e[2])||(m.getMonth()!=e[0]-1)||(m.getDate()!=(e[1]))){m=new Date()}}else{if(calDateFormat.charAt(0)=="Y"){m=new Date(e[0],e[1]-1,e[2],k.getHours(),k.getMinutes(),k.getSeconds());
if((m.getFullYear()!=e[0])||(m.getMonth()!=e[1]-1)||(m.getDate()!=(e[2]))){m=new Date()}}}}if((m.getFullYear()<n)||(m.getFullYear()>l)){m=new Date()}}else{m=new Date()}return m}function calSetCurrentDate(b,a){var c=vappgetelementbyid(b);c.value=calGenDateString(a)}function calSetCurrentTime(b,a){var c=vappgetelementbyid(b);if(c!=null){c.value=calGenTimeString(a)}}function calSelCurrentDay(a,b){var c=calGetDispDate(a);c.setDate(b);calSetCurrentDate(a,c);calShowCalendar(a,false,true)}function calGetDispDate(a){var d=vappgetelementbyid("x"+a+"hlp");var e=d.value;var b=e.split("/");var c=new Date(b[0],b[1],1);return c}function calSetDispDate(a,c){var b=vappgetelementbyid("x"+a+"hlp");b.value=c.getFullYear()+"/"+c.getMonth()}function calGenDateString(a){var d="";for(i=0;i<calDateFormat.length;i++){switch(calDateFormat.charAt(i)){case"d":d+=a.getDate();break;case"D":var c=a.getDate();if(c<10){d+="0"}d+=c;break;case"m":d+=(a.getMonth()+1);break;case"M":var e=a.getMonth()+1;if(e<10){d+="0"}d+=e;break;case"Y":var b=a.getFullYear();if(b.length==2){d+="19"}d+=b;break}if(i<(calDateFormat.length-1)){d+=calDateSeparator}}return d}function calGenTimeString(b){var a="";if(b.getHours()<10){a+="0"}a+=b.getHours()+":";if(b.getMinutes()<10){a+="0"}a+=b.getMinutes()+":";if(b.getSeconds()<10){a+="0"}a+=b.getSeconds();return a}function calGetDayHTML(f,a,g,e,d,j,c,h){var b="";b+='<td calfield="'+a+'" calday="'+j+'"';if(g||c){b+=' calclass="'+g_vapp_css.calnoworkday+'"';b+=' class="'+g_vapp_css.calnoworkday+'"'}if(d){b+=' calop="'+d+'"';b+=' style="background-color:#FFFFFF;"'}if(c){b+=' title="'+h+'"'}else{if(e){b+=' calclass="'+g_vapp_css.calcurrday+'"';b+=' class="'+g_vapp_css.calcurrday+'"'}}b+=">"+j+"</td>";return b}function calGetCalCode(g,e,o,l){var t=vapplookpath+"/FSCVAPP_1_1001/";var a="";var c=new Date(e,o,1);var p=calGetNumDays(e,o);var s=c.getDay()-1;if(s<0){s=6}a+='<table class="'+g_vapp_css.cal+'" cellpadding="5" onmouseover="calEvt(window.event)" onmouseout="calEvt(window.event);" onclick="calEvt(window.event);">';a+='<tr><td colspan="7">';a+='\n<table class="FscCalendarHead"><tr>';a+='<td><img class="Fsc16" onclick="calOffsMonth(\''+g+'\',-12)" src="'+t+'doubleleft.gif"></img></td>';a+='<td><img class="Fsc16" onclick="calOffsMonth(\''+g+'\',-1)" src="'+t+'left.gif"></img></td>';a+='<td align="center" width="100%">'+e+"<br />"+calMonthString[o]+"</td>";a+='<td><img class="Fsc16" onclick="calOffsMonth(\''+g+'\',1)" src="'+t+'right.gif"></img></td>';a+='<td><img class="Fsc16" onclick="calOffsMonth(\''+g+'\',12)" src="'+t+'doubleright.gif"></img></td>';a+='<td><img class="Fsc16" onclick="calShowCalendar(\''+g+'\',true, true)" src ="'+t+'Close.gif"></img></td>';a+="</tr></table>";a+="</td></tr>";a+='<tr class="'+g_vapp_css.calhead+'">';for(i=0;i<7;i++){if(calNoWorkDays.indexOf(i)<0){a+='<th class="'+g_vapp_css.calworkday+'">'+calDayString[i]+"</th>"}else{a+='<th class="'+g_vapp_css.calnoworkday+'">'+calDayString[i]+"</th>"}}a+='</tr><tr align="right" style="cursor:pointer">';if(s>0){var q=o>0?o-1:11;var j=o>0?e:e-1;var f=calGetNumDays(j,q)-s;for(i=0;i<s;i++){a+=calGetDayHTML(t,g,false,false,"prev",++f)}}var b=0;for(day=1;day<=p;day++){var h=calNoWorkDays.indexOf((s+day-1)%7)>=0;var n=day==l;var d=null;for(var k=0;k<calHolidays.length;k++){if(calHolidays[k][0]==e&&calHolidays[k][1]==o+1&&calHolidays[k][2]==day){d=calHolidays[k][3]}}if(d){a+=calGetDayHTML(t,g,h,n,null,day,true,d)}else{a+=calGetDayHTML(t,g,h,n,null,day)}if((s+day)%7==0){a+='</tr><tr align="right" style="cursor:pointer">';b++}}var r=1;while(b<6){var h=(s+p+r)%7==0;a+=calGetDayHTML(t,g,false,false,"next",r++);if(h){a+='</tr><tr align="right" style="cursor:pointer">';b++}}a+="</tr></table>";return a}function calSetToday(){var a=new Date(),c="f"+g_vappmenu.GetCtrlId(),b=vapppopid(c)+"_2";calSetCurrentDate(c,a);calSetCurrentTime(b,a);calHideCalendar(c)}var g_x;var g_y;function calGetCtrl(a){if(a){a=a.substr(1);return g_renderlater[vappgetportletid(a)]}}function calShowCalendar(g,e,c){if(vappiswbt()){return}var a=10,j=10,b=vappgethelperspan("fscm"),f=calGetCurrentDate(g),d=f.getDate();calSetDispDate(g,f);if(!c){var h=window.event;g_x=vappgetmouseposX(h);g_y=vappgetmouseposY(h)}if(!e){if(b){b.innerHTML=calGetCalCode(g,f.getFullYear(),f.getMonth(),d);a=b.firstChild.offsetWidth;j=b.firstChild.offsetHeight}if(!g_style&&!window.g_isportlet){g_style=new AjaxStyle()}if(g_style&&g_style.IsNewCtrl("Calendar")){g_style.Add("TABLE.FscCalendar",g_vappcolor.container,g_vappcolor.containerborder);g_style.Add("TH.FscCalNoWD,TD.FscCalNoWD,TD.FscCalSel",g_vappcolor.select);g_style.Add("TH.FscCalWD",g_vappcolor.backgroundalternate)}}if(e){calHideCalendar(g)}else{if(g_style){g_style.Apply()}vappmenuspan(b,g_x+5,g_y+5);b.m_field=g;b.m_date=calGetCurrentDate(g);b.onkeydown=calKeyEvt;if(!g_ismoz){b.focus()}}return false}function calHideCalendar(a){vappspan_hide("fscm");var b=vappgetelementbyid(a);vappfireonchange(b)}function calIntervalCtx(b){if(vappiswbt()){return}var a=b.getElementsByTagName("INPUT"),c=(a[0])?calGetCtrl(a[0].name):null;
if(c){c.GetMenu(window.event)}return false}function calTrapKey(c){var b=window.event.keyCode;switch(b){case 115:var a=calGetCurrentDate(c);var f=a.getDate();calSetDispDate(c,a);break;case 117:var d=new Date();calSetCurrentDate(c,d);var e=c.substr(0,c.length-1);e+="2";calSetCurrentTime(e,d);var g=vappgetelementbyid(c);vappfireonchange(g);break}}function calOffsMonth(b,g){var d=vappgetelementbyid(b);var f=calGetDispDate(b);var a=calGetCurrentDate(b);f.setMonth(f.getMonth()+g);calSetDispDate(b,f);var e=0;if((a.getFullYear()==f.getFullYear())&&(a.getMonth()==f.getMonth())){e=a.getDate()}var c=vappgethelperspan("fscm");c.innerHTML=calGetCalCode(b,f.getFullYear(),f.getMonth(),e)}function calKeyEvt(){var b=vappgethelperspan("fscm"),a=window.event.keyCode;switch(a){case 100:case 37:b.m_date.setDate(b.m_date.getDate()-1);break;case 102:case 39:b.m_date.setDate(b.m_date.getDate()+1);break;case 104:case 38:b.m_date.setDate(b.m_date.getDate()-7);break;case 98:case 40:b.m_date.setDate(b.m_date.getDate()+7);break;case 103:case 36:b.m_date.setFullYear(b.m_date.getFullYear()-1);break;case 105:case 33:b.m_date.setFullYear(b.m_date.getFullYear()+1);break;case 97:case 35:b.m_date.setMonth(b.m_date.getMonth()-1);break;case 99:case 34:b.m_date.setMonth(b.m_date.getMonth()+1);break;case 101:case 12:b.m_date=new Date();break;case 13:calSetCurrentDate(b.m_field,b.m_date);calHideCalendar(b.m_field);return}b.innerHTML=calGetCalCode(b.m_field,b.m_date.getFullYear(),b.m_date.getMonth(),b.m_date.getDate())}function calEvt(e){var j;if(e){j=e}else{j=window.event}if(null!=j){var h=j.type;var d=j.srcElement;if(null!=d){var f=vappgetparentbytagname(d,"|TD|","|TABLE|BODY|TR|");if(null!=f){var g=f.getAttribute("calfield");var c=f.getAttribute("calday");var a=f.getAttribute("calop");if(g){switch(h){case"mouseover":if(f.className!=g_vapp_css.calcurrday){f.className=g_vapp_css.calsel}break;case"mouseout":if(f.className!=g_vapp_css.calcurrday){var b=(f.getAttribute("calclass"))?f.getAttribute("calclass"):"";f.className=b}break;case"mouseup":case"click":switch(a){case"prev":calOffsMonth(g,-1);break;case"next":calOffsMonth(g,+1);break;default:calSelCurrentDay(g,c);calHideCalendar(g)}break}}}}}}function calTimeInterval(b){var f="f"+g_vappmenu.GetCtrlId(),d=vapppopid(f)+"_2",c=calGetCurrentDate(f,d),e=c.getFullYear()+"-"+(c.getMonth()+1)+"-"+c.getDate()+"-"+c.getHours()+"-"+c.getMinutes()+"-"+c.getSeconds(),a=vappgenxmlrpc("COO.1.1001.1.87392","",e+";"+b);vappcallrpc(calShowDate,a,f,d)}function calShowDate(j,e,a,b){var c=vappxmlgetdictionary(j),h,d,f;if(c){for(var c=c.firstChild;null!=c;c=c.nextSibling){switch(c.nodeName){case"year":f=vappxmlgettext(c);break;case"month":d=vappxmlgettext(c);break;case"day":h=vappxmlgettext(c);break;case"hour":hour=vappxmlgettext(c);break;case"minute":minute=vappxmlgettext(c);break;case"second":second=vappxmlgettext(c);break}}}if(h&&d&&f&&hour&&minute&&second){var g=new Date(f,d-1,h,hour,minute,second,0);calSetCurrentDate(a,g);calSetCurrentTime(b,g);vappspan_hide("fscm")}};function ajaxFlatList(){this.Init=FlatViewInit;this.Render=FlatViewRender;this.Dispatch=Dispatch;this.FlatViewView=FlatViewView;this.FlatView=FlatView;this.FlatGrid=FlatGrid;this.FlatViewLeader=FlatViewLeader;this.FlatViewSection=FlatViewSection;this.FlatViewGridRow=FlatViewGridRow;this.FlatViewGridColumn=FlatViewGridColumn;this.FlatViewEntryHead=FlatViewEntryHead;this.FlatViewEntry=FlatViewEntry;this.FlatGridEntry=FlatGridEntry;this.FlatGetGridEntryId=FlatGetGridEntryId;this.FlatViewEntryData=FlatViewEntryData;this.FlatViewValue=FlatViewValue;this.FlatViewError=FlatViewError;this.FlatViewEntryInfo=FlatViewEntryInfo;this.InUse=true}function FlatViewInit(b,a,e,d,c){ControlInit(b,a,e,d,this);this.entryids=[];this.labels=[]}function FlatViewRender(b){if(g_style&&g_style.IsNewCtrl("FlatList")){g_style.Add("TD.FscGridLabel,TD.FscDataCaption",g_vappcolor.label,null,g_vappcolor.fontinactive);g_style.Add("TABLE.FscData1Grid TR TD.FscGridLabel,DIV.FscAggrHead,DIV.FscAggrHeadDeep",g_vappcolor.labelsub);g_style.Add("TD.FscGridData,TD.FscGridDataRead,TD.FscGridEmpty",g_vappcolor.value);g_style.Add("DIV.FscConfirm TD.FscGridData,DIV.FscConfirm TD.FscGridDataRead,DIV.FscConfirm TD.FscGridEmpty","transparent");g_style.Add("TABLE.FscData1Grid TD.FscGridData,TABLE.FscData1Grid TD.FscGridDataRead",g_vappcolor.valuesub);g_style.Add("TR TD.FscLabelSel",g_vappcolor.entryselect,null,g_vappcolor.font)}var a=this.data.GetFlatListHeadTool();if(a){this.BranchGenericBranches(b,a)}for(var d=0;d<this.data.ViewCount();d++){this.FlatViewView(b,this.data.GetView(d))}for(var d=0;d<this.data.FlatViewCount();d++){this.FlatView(b,this.data.GetFlatView(d))}var c=this.data.FlatGridCount();for(var d=0;d<c;d++){this.FlatGrid(b,this.data.GetFlatGrid(d),d+1,c)}}function FlatViewView(c,b){var d=b.GetScope();for(var a=0;a<b.ViewEntryCount();a++){this.FlatViewEntry(c,b.GetViewEntry(a),d)}for(var a=0;a<b.ViewSectionCount();a++){this.FlatViewSection(c,b.GetViewSection(a),d)}}function FlatView(a,b){a.Push('<table class="FscFlatView" cellpadding="0" cellspacing="0"><tr><td valign="top">');this.FlatViewLeader(a,b.GetViewLeader(),false);a.Push("</td><td>");this.FlatViewView(a,b.GetView());a.Push("</td></tr></table>")}function FlatViewSection(b,d,c){b.Push('<div class="FscSecCaption">');if(d.GetCaption()){b.Push(d.GetCaption())}b.Push("</div>");for(var a=0;a<d.ViewEntryCount();a++){this.FlatViewEntry(b,d.GetViewEntry(a),c)}}function FlatGrid(c,b,a,e){if(a==1){var f=(b.GetScope()==0)?0:1;c.Push('<table cellpadding="0" cellspacing="1" class="FscData'+f+'Grid">');for(var d=0;d<b.GridColumnCount();d++){this.FlatViewGridColumn(c,b.GetGridColumn(d))}}this.FlatViewLeader(c,b.GetViewLeader(),true);for(var d=0;d<b.GridRowCount();d++){this.FlatViewGridRow(c,b,b.GetGridRow(d))}if(a==e){c.Push("</table>")}}function FlatViewGridColumn(b,a){if(a){b.Push('<col width="'+a.GetWidth()+'%" />')}}function FlatViewLeader(a,c,b){if(c){if(b){a.Push('<tr class="FscGridLabel"><td colspan="'+c.GetColspan()+'">')}this.BranchGenericBranches(a,c);if(b){a.Push("</td></tr>")}}}function FlatViewGridRow(e,d,c){var b;var g=vappgetportlet(this.portletid);if(g){b=g.GetStyle()}e.Push('<tr class="FscGrid">');for(var f=0,a=c.ViewEntryCount();f<a;f++){this.FlatGridEntry(e,d,c.GetViewEntry(f),b)}e.Push("</tr>")}function FlatViewEntry(a,d,c){for(var b=0;b<d.ViewEntryInfoCount();b++){this.FlatViewEntryInfo(a,d.GetViewEntryInfo(b),false)}var g=d.GetHeadtype(),e=d.GetIdent();if(g==2){if(d.GetViewEntryHead()){this.FlatViewEntryHead(a,d.GetViewEntryHead(),true,g)}if(d.GetViewEntryData()){this.FlatViewEntryData(a,d.GetViewEntryData(),g,e,true)}}else{var f=(c==0)?"FscEntry":"FscEntryDeep";a.Push('<table cellpadding="0" cellspacing="0" class="'+f+'"><tr class="FscViewEntryHorizontal">');if(d.GetViewEntryHead()){this.FlatViewEntryHead(a,d.GetViewEntryHead(),false,g)}if(d.GetViewEntryData()){this.FlatViewEntryData(a,d.GetViewEntryData(),g,e)}a.Push("</table>")}}function FlatGetGridEntryId(d,b){var e=new Array(d),a=0,c=this.entryids[d];if(c){a=c.length-1;if(c[a][b]){this.entryids[d][++a]=new Array()}}else{this.entryids[d]=new Array();this.entryids[d][0]=new Array()}this.entryids[d][a][b]=true;if(a>0){e.push(a)}return e.join("_")}function FlatGridEntry(f,u,s,t){var h=s.GetIdent(),k,a=s.GetViewEntryData(),e=parseInt(s.GetEntrytype()),g=s.GetViewEntryHead(),p=new Array();if(e<3){var m=parseInt(s.GetAlignment());switch(m){case 381:p.push("text-align:center");break;case 382:p.push("text-align:right");break}var v=s.GetPosition();if(v){p.push("vertical-align:"+v)}var j=s.GetHeight();if(j){p.push("height:"+j)}var n=(e==1)?FSC_GRIDLABEL_PFX:FSC_GRIDDATA_PFX;h=this.FlatGetGridEntryId(h,n);k=n+"_"+h+"_"+this.portletid;FlatSetStyle(t,k,s.GetFontsize(),s.GetFontcolor())}f.Push("<td ");switch(e){case 1:f.Push('id="'+k+'" class="'+g_vapp_css.label+'" ');break;case 2:var q="FscGridData";if(a){if(a.GetIssimple()==1&&a.GetUsehscroll()!=1&&(a.GetIsreadonly()==1||this.isprint)){q+="Read"}if(a.GetErrorfieldid()){q+=" FscDataError"}if(a.GetNobackground()){q+=" FscNoBG"
}if(a.GetClassname()){q+=" "+a.GetClassname()}}f.Push('id="'+k+'" fscitemdesc="'+s.GetItemdesc()+'" class="'+q+'" ');var l=(a)?a.GetValue():null,c=(l)?l.GetWeightcolor():null;if(c){p.push("background-color:"+c)}else{var b=vappgetdisplayeffectstyle(a);if(b){p.Push(b)}}break;case 5:f.Push('class="FscGridSpace" ');break;case 7:f.Push('class="FscGridEmpty" ');break;default:f.Push('class="FscGridMiddle" ');break}if(p.length>0){f.Push('style="'+p.join(";")+'" ')}var r=s.GetInfomessagepath();if(r&&!window.g_isportlet){f.Push('fschelp="'+r+'" ')}f.Push('colspan="'+s.GetColspan()+'" rowspan="'+s.GetRowspan()+'">');if(g){if(r&&window.g_isportlet&&!this.isprint){var d=r.split("OBJ=")[1];if(d){d=d.split("&")[0];f.Push("<a onclick=\"vappctxhelp('"+d+'\')" href="#"><img src="../tmp/i/s/COO.1.1.1.16703.png" alt="" class="FscCtxInfo"/></a>')}}this.labels[h]=g.GetCaption();this.FlatViewEntryHead(f,g,true)}if(a){this.FlatViewEntryData(f,a,null,h,true)}for(var o=0;o<s.ViewEntryInfoCount();o++){this.FlatViewEntryInfo(f,s.GetViewEntryInfo(o),true)}f.Push("</td>")}function FlatViewEntryHead(b,j,c,g){var h=parseInt(j.GetScope());if(g==2){var d=(h==0)?"FscAggrHead":"FscAggrHeadDeep";b.Push('<div class="'+d+'">')}else{if(!c){b.Push('<td class="FscDataCaption">')}}b.Push('<div class="FscGridLabel">');if(h>1){var i=0;switch(h){case 2:i=1.2;break;case 3:i=3.6;break;case 4:i=6;break;case 5:i=8.4;break;default:i=10.8;break}b.Push('<img src="'+va_lookpath+'/FSCVAPP_1_1001/enteraggr.gif" class="FscAggrImg" alt="" style="margin-left:'+i+'em"/>')}var e=(j.GetMustbedef()==1)?true:false;var f=j.GetError();if(f){b.Push('<a name="e'+j.GetErrorfieldid()+'" title="'+MaskValue(f)+'"> ')}if(e){b.Push('<span class="FscMustBeDef" ');if(!f){var a=vappgetdisplayeffectstyle(j);if(a){b.Push('style="'+a+'" ')}}b.Push(">")}b.Push(MaskValue(j.GetCaption()));if(e){b.Push('<img src="'+va_lookpath+'/FSCVAPP_1_1001/star.gif" class="Fsc" />')}if(f){b.Push('<span class="FscErrorEntry">&nbsp;<b>!</b></span>')}if(e){b.Push("</span>")}if(f){b.Push("</a>")}b.Push("</div>");if(g==2){b.Push("</div>")}else{if(!c){b.Push("</td>")}}}function FlatViewEntryData(d,h,n,j,e){var m=h.GetValue(),b=(m)?m.GetCtrlXmlDom():null,k=(b)?m.GetWeightcolor():null,a=h.GetUsehscroll(),c=n!=2;if(!e){d.Push('<td class="FscDataValues"');if(k){d.Push(' style="background-color:'+k+'"')}d.Push(">")}var l=h.GenericBranchCount();if(b&&l>0&&a!=1&&h.GetIssimple()==1){var f=(b.name=="EditString");d.Push('<table cellpadding="0" cellspacing="0" class="FscMax"><tr>');if(f){d.Push('<td class="FscMax">');this.FlatViewValue(d,b,k,a,c,j);d.Push("</td>")}for(var g=0;g<l;g++){d.Push("<td>");this.BranchGenericBranch(d,h.GetGenericBranch(g));d.Push("</td>")}if(!f){d.Push('<td class="FscMax">');this.FlatViewValue(d,b,k,a,c,j);d.Push("</td>")}d.Push("</tr></table>")}else{this.BranchGenericBranches(d,h);this.FlatViewValue(d,b,k,a,c,j)}if(h.GetError()){this.FlatViewError(d,h.GetError())}if(!e){d.Push("</td>")}}function FlatViewValue(a,d,f,e,b,c){if(d){this.label=this.labels[c];if(e==1){vapppushscrollareas(c,this.portletid);a.Push('<div class="FscEntryScroll" id="'+c+this.portletid+'">');this.Dispatch(a,d,f,this.portletid,b);a.Push("</div>")}else{this.Dispatch(a,d,f,this.portletid,false)}this.label=null}}function FlatViewError(a,b){a.Push('<div class="FscValueError">');AddValue(a,b);a.Push("</div>")}function FlatViewEntryInfo(a,b,c){if(b.GetInfomessage()){if(!c){a.Push("<tr>");a.Push('<td colspan="2">')}if(b.GetInfocaption()){a.Push('<div class="FscInfoCaption">'+b.GetInfocaption()+"</div>")}a.Push('<div class="FscInformation">'+b.GetInfomessage()+"</div>");if(!c){a.Push("</td>");a.Push("</tr>")}}}function FlatSetStyle(b,d,c,a){if(b&&(c||a)){b.Add("#"+d+",#"+d+" INPUT,#"+d+" TEXTAREA",null,null,a,c)}};function BufferedOutput(){this.m_text=new Array();this.m_tmp="";this.m_text[0]=new Array();this.m_bufferidx=0;this.m_elements=0;this.Push=function b(d){if(d){if(this.m_tmp.length+d.length>100){this.m_text[this.m_text.length]=this.m_tmp;this.m_tmp=d}else{this.m_tmp+=d}}};this.PopAll=function a(d){this.m_text[this.m_text.length]=this.m_tmp;this.m_tmp="";var e=this.m_text.join("");this.m_text=new Array();if(!d){this.m_text[this.m_text.length]=e}if(window.g_isportlet){e=e.split("../tmp").join(vappgetg_tmppath())}return e};this.IsEmpty=function c(){return((this.m_text[0]&&this.m_text[0].length)||this.m_tmp)?false:true}}function ajaxGetStateStr(c,b,a){return"&s1="+encodeURIComponent(c)+"&s2="+encodeURIComponent(b)+"&s3="+encodeURIComponent(a)}function vappsetxhr(a){if(a.indexOf("xhr=1")<0){a+="&xhr=1"}return a}function vappsetready(b,a){if(vappportletsready()){vappsetpagebusy(false,a);g_isdirty=false}vappsetdirty(false,b);vapphidehourglass(b)}function vappsetserviceunavailablestr(){if(!vappgetserviceunavailablestr()){window.g_vappserviceunavailable=vappgetstring(FSC_STRSERVICEUNAVAILABLE)}}function vappgetserviceunavailablestr(){if(window.g_vappserviceunavailable){return window.g_vappserviceunavailable}var a=vappwindowopener();if(a){return a.g_vappserviceunavailable}}function ajaxOnload(d,r,s){var j=!d||window.g_isportlet;if(!d){d=ajaxCreatePortletId()}if(!r){r=""}if(s||null==s){vappinitvarset(d)}if(j){var f=vappcreatehelperelem("IFRAME","fscp","FscHiddenIFrame");if(g_isie6||g_isie7){g_vappiframes.push(f)}vappinitstrudl(true);vappsetserviceunavailablestr()}if(!window.g_isportlet&&!window.document.getElementById(d)){var b=document.createElement("DIV");b.id=d;b.className="FSCAjaxContainer";window.document.body.appendChild(b)}try{if(window.opener&&window.opener.vappdata){r+="&"+window.opener.vappdata;window.opener.vappdata=null}}catch(n){}var o=vappgetg_portletstarturl(d);if(o&&o.indexOf("?")>=0){var q=o.split("?")[1].split("&"),a="";for(var g=0,l=q.length;g<l;g++){var h=q[g];if(h=="xhr=s"||h=="xhr=c"){if(window.g_vapps1){a+=ajaxGetStateStr(g_vapps1,g_vapps2,g_vapps3)}if(h=="xhr=s"){o=o.split("xhr=s").join("")}else{a+="&p1=5003&p2=&p3=";o=o.split("xhr=c").join("")}}else{if(h.substr(0,5)=="POST="){a=decodeURIComponent(h.substr(5))}}}r+=a;if(window.g_isportlet){var k=window.location.href;if(k.indexOf("?")){k=k.split("?")[1]}if(k){var q=k.split("&");for(var p=0,l=q.length;p<l;p++){var c=q[p].split("_");if(c[0]=="fsc"){c.shift();o+="&"+c.join("_")}}}var m=vappsetxhr(o);if(m.split("TIMESTAMP").length==1){m+="&TIMESTAMP="+Math.round(Math.random()*9999)}vappsetg_portletstarturl(d,m);o=vappgetportleturl(m)}vapp24setsessionid(o);ajaxXmlRPC(o,r,d)}}function ajaxXmlRPC(i,k,d,a){g_isdirty=true;var g,f;if(a){g="Control XML RPC";if(a.data){f=a.data.name}}else{g="Page XML RPC";f=vappgetportlet(d);if(f){f=f.GetAppView()}}var c=vappsetpagebusy(true,"");vappstrudllogevtenter(c,FSCVAPP_XMLRPC,g,f,i);i=i.split("#")[0];i=vappgetportleturl(vappsetxhr(i));if(g_vappis24hrec){if(g_vapp24isoverlaypage){vapp24setinfohint("OverlayPage");g_vapp24isoverlaypage=false}i=vapp24addurlparam(i,d)}var j=false;if(g_vappdelayedrequest){window.clearTimeout(g_vappdelayedrequest)}try{var b=new XMLHttpRequest();if(b){if(g_ismoz&&!g_issafari){b.overrideMimeType("text/html")}if(k){b.open("POST",i,true)}else{b.open("GET",i,true)}strudl.SendXMLHttpRequest(b,true,k,function(n,l){if(b.readyState==4){var m=null;try{m=b.status}catch(q){}if(m&&m>=200&&m<300){var r=b.responseText,p=(a)?true:false;if(r){if(!HandleHtmlResponse(d,r,l)){if(!a){a=vappgetpage(d)}if(a){p=a.Load(r,i,l)}}}if(p){vappsetready(d,l)}else{if(!r){if(window.g_isportlet){vappclearvars(d);ajaxOnload(d,null,false)}else{vappportletcleanup(d)}}}}else{if(g_openiderror.checkStatus(m)){g_openiderror.reCallFunction(window.ajaxXmlRPC,[i,k,d,a])}else{var o=vappgetserviceunavailablestr();alert((o)?o.split("%s").join(m):"HTTP "+m)}vappsetpagebusy(false,l)}vapphidehourglass(d);if(g_vappchanging){g_vappchanging=false;if(g_vappreqqueue){vapp(g_vappreqqueue[0],g_vappreqqueue[1],g_vappreqqueue[2],false,g_vappreqqueue[3]);g_vappreqqueue=null}else{if(g_vappreqfunc){g_vappreqfunc();g_vappreqfunc=null}}}}},c)}}catch(h){TT("Error on XMLHttpRequest: "+h.message);vapphidehourglass(d);j=true}vappstrudllogevtleave(c,FSCVAPP_XMLRPC);if(j){vappstrudlresetctx()}}function SubmitToXmlRPC(d,j,c,a,h){if(!d){d=vappgetform(j)}if(d){if(!c){vappshowhourglass(j)}var q=false,p=new Array(),m=new Array(),o=new Array(),k,r;for(var g=0,l=d.length;g<l;g++){var f=d[g];var b=f.name;if(b){if(b=="p4"){k=g}else{if(b=="p6"){r=g}}var e=f.value,n=f.type;if(vappisuploadinput(f,n)){if(!a&&e.length>0&&!vappiscancelbranch(d,j)){if(f.getAttribute("usestub")=="false"){return ajaxFileUpload(d)}else{vapppushimportobjs(b,e,g,m,p,o)}}}else{if(n!="radio"||(n=="radio"&&f.checked)){if(!vapppushformdata(p,b,e)){vappsetctrlerror(f,j);q=true;break}}}}}if(q){vappsetready(j)}else{if(h){vappclearonvapp(j)}if(m.length>0){vappstartimport(o,p,m,function(){StartXmlRPC(d,p,c,true,j,a)
},j,k,r)}else{StartXmlRPC(d,p,c,false,j,a)}}}}function StartXmlRPC(f,a,e,d,b,g){if(d||g){vappshowhourglass(b)}a=a.join("");a=a.substr(0,a.length-1);var c;if(window.g_isportlet){c=vappgetportleturl()}else{if(!f){f=vappgetform(b)}c=(f)?f.action:vappbaseurl()+"&ax=COO.1.1001.1.32498"}if(e){if(e=="overlay"){vappstartoverlayapp(vappsetxhr(c),null,null,a)}else{if(!window.g_isportlet){c=c.split("xhr=1").join("");window.vappdata=a;window.open(c+"&ru=javascript:window.close()","",e)}}}else{ajaxXmlRPC(c,a,b,g)}}function ajaxFileUpload(a){window.vappnoconfirm=true;var b=a.action;a.action=(window.g_isportlet)?vappgetg_portletaction():b.split("xhr=1").join("xhr=c");a.encoding="multipart/form-data";a.submit();return false}function HandleHtmlResponse(c,b,a){if(b.charAt(0)=="<"){var d="<body>",e=b.indexOf(d);if(e>=0){b=b.substring(e+d.length,b.indexOf("</body>"))}vappseterror(b,c,false,null,true);g_isdirty=false;vappsetpagebusy(false,a);return true}}function Dispatch(b,h,g,i,k,d){try{if(h){var l=h.name;if(l){var f="ajax"+l;if(window[f]){if(this.isprint){var c=(h.GetId&&h.GetId())?g_renderlater[h.GetId()+i]:null;if(!c){c=(g_vappctrls[l])?g_vappctrls[l]:new window[f];c.Init(h,i,g,k,null,this,b)}c.isrewrite=true;c.isprint=true;c.PrintRender?c.PrintRender(b):c.Render(b);c.isprint=false}else{var c=g_vappctrls[l],a=true;if(!c){c=new window[f];a=false}c.Init(h,i,g,k,null,this,b);if(c.InUse){h.inuse=true;if(a){delete g_vappctrls[l]}}else{g_vappctrls[l]=c}d?c.RenderPart():c.Render(b)}return c}}else{b.Push(h)}}}catch(j){TT("Error on dispatch: "+l+" - "+j.message)}}function ControlInit(e,f,d,g,a,h,c){if(!a){a=this}a.BranchGenericBranches=BranchGenericBranches;a.BranchGenericBranch=BranchGenericBranch;a.BranchGenericButtons=BranchGenericButtons;a.BranchGenericButton=BranchGenericButton;if(g_vappis24hrec){a.BranchGenericBranches24=BranchGenericBranches24;a.BranchGenericBranch24=BranchGenericBranch24}a.BaseSB=BaseSB;a.BaseSBButton=BaseSBButton;a.IsInList=function i(){return this.parent&&this.parent.listid};a.GetLabel=function b(){return(this.parent)?this.parent.label:null};a.data=e;a.portletid=f;a.weightcolor=d;a.scrollable=g;a.parent=h}function RequestableControlInit(c,b,g,f,e,d,a){if(!e){e=this}ControlInit(c,b,g,f,e,d);if(!this.id){this.id=this.data.GetId()}this.output=a;this.InUse=true;this.Load=ControlLoad;this.SetRequestArgs=ControlSetRequestArgs;g_renderlater[this.id+this.portletid]=this}function vappgetjsondata(jsonstring,portletid){try{var x=eval(jsonstring);if(x&&x.N){return x.N(x.V(0))}}catch(e){TT("Evaluating jsonstring failed: "+e.message);return false}}function ControlLoad(k,m,p){var g=true,h;vappstrudlevtenter(p,FSCVAPP_LOAD);vappstrudldebugevtinfo(p,FSCVAPP_LOAD,k);h=vappgetjsondata(k,this.portletid);vappstrudlevtleave(p,FSCVAPP_LOAD);if(h){var d=(this.data)?this.data.name:"",n=h.name;vappstrudlevtenter(p,FSCVAPP_RENDER,n);if(n=="Page"){var l=this;if(h.GetIsswitchout()==1){var c=vappgetparentpid(this.portletid);if(c){vappgetportlet(c).SetPaneArg("");l=vappgetpage(c)}}else{if(d!="Page"){l=vappgetpage(this.portletid)}}vappclearvars(this.portletid);l.data=h;l.Render(p,m);g=false}else{var e=false;if(n=="ControlContainer"){var j=vappgetform(this.portletid);if(j&&h.GetS1()){j.s1.value=h.GetS1();j.s2.value=h.GetS2();j.s3.value=h.GetS3()}var i=h.CtrlXmlDomCount(),b=h.GetCtrlXmlDom();if(b&&i==1){n=b.name;if(d==n){if(b.GetId&&this.id==b.GetId()){this.data=b;var a=this.GetContainer();if(a){this.isrewrite=true;this.Render(this.output);a.innerHTML=this.output.PopAll(true);var o=vappgetportlet(this.portletid);vappinit(o,p);vappsetbrowserstate(o)}e=true}}else{if(!b.GetId||b.GetId()){if(Dispatch(this.output,b,null,this.portletid,null,true)){e=true}}}if(!e){h=b}}}if(!e&&this.RenderPart){this.ctrlname=n;this.ctrldata=h;this.RenderPart()}}vappstrudlevtleave(p,FSCVAPP_RENDER)}return g}function ControlSetRequestArgs(b,a){this.requestid=b;this.requestarg=a}function RenderRemainder(b){var a=g_renderlater[b];if(a){if(a.RenderRemainder){return a.RenderRemainder()}return vappctrl(a.id,"",a,a.portletid)}}function AddValue(a,c){if(c){var b=c._text;if(b){a.Push(MaskValue(b));return true}}return false}function vappaddobjectstate(c,d){var f=false,b=d.GetVersiondate(),a=d.GetReleasedate(),e=d.GetPermlock();if(e){c.Push('<img src="'+va_lookpath+'/FSCVAPP_1_1001/permlock.gif" title="'+e+'" class="Fsc" />');f=true}if(b){c.Push('<img src="'+va_lookpath+'/FSCVAPP_1_1001/version.gif" title="'+b+'" class="Fsc" />');f=true}if(a){c.Push('<img src="'+va_lookpath+'/FSCVAPP_1_1001/release.gif" title="'+a+'" class="Fsc" />');f=true}return f}function vappaddfonteffectclass(c,b){if(b&&b.GetFonteffect){var a=vappgetnumber(b.GetFonteffect());if(a){c=(c)?c+" ":"";switch(a){case 1:c+="FscB";break;case 2:c+="FscI";break;case 3:c+="FscBI";break}}}return c}function vappgetdisplayeffectstyle(b){var c="";if(b&&b.GetDisplayeffect){var a=vappgetnumber(b.GetDisplayeffect());if(a>0){c="background-color:"+g_vappcolor[a]+";"}}return c}function ajaxCreatePortletId(){var a=Math.round(Math.random()*9999);
while(vappgetportlet(a)){a++}return a}function ajaxCreatePortletObject(b,a){var c=new VAPPPortlet(ajaxCreatePortletId(),b,a);g_vappportlets.push(c);return c}function ajaxCreatePortlet(d,b,e,g,j,i,f,a){var h=ajaxCreatePortletObject(e,j),c=h.GetId();if(g){vapppushonload(function(){window.g_portletstarturl=(null!=b)?b:"";ajaxOnload(c,i)},g)}if(d){d.Push('<div id="'+c+'" class="FSCAjaxContainer');if(a){d.Push(a)}d.Push('" ');if(f){d.Push(f)}d.Push("></div>")}return h}var g_openiderror={savedCallFunction:null,savedCallArgs:null,checkStatus:function(b){var c=409;var a=false;if(b&&b==c){a=true}return a},callBack:function(){if(opener.g_openiderror.savedCallFunction){var b=opener.g_openiderror.savedCallFunction;var a=opener.g_openiderror.savedCallArgs;opener.g_openiderror.savedCallFunction=null;opener.g_openiderror.savedCallArgs=null;b.apply(null,a)}window.close()},reCallFunction:function(b,a){if(this.savedCallArgs==null){this.savedCallArgs=a;this.savedCallFunction=b}window.open(vappbaseurl()+"&ax=COO.1.1001.1.32494&ru=cbk:g_openiderror.callBack();","_blank","top=100 left=100")},reAuthenticate:function(){window.open(vappbaseurl()+"&ax=COO.1.1001.1.32494&ru=cbk:g_openiderror.callBack();","_blank","top=100 left=100")}};var g_vappstrudlmodule,g_vappstrudlcontext,g_vappstrudlexecutiontext,g_vappstrudlexecutionid,FSCVAPP_XMLRPC=1,FSCVAPP_LOAD=3,FSCVAPP_RENDER=4,FSCVAPP_RENDERHTML=5,FSCVAPP_MENUOPEN=7,FSCVAPP_PAGEBUSY=9;function vappstrudlerror(a,b){TM("app.strudl: "+b)}function vappinitstrudl(a){if(!window.g_vappstrudlinit){strudl.env.active=g_vappstrudlisactive;vappstrudlregisterapp();g_vappstrudlmodule=strudl.RegisterModule("Fabasoft Webbrowser Client");g_vappstrudlmodule.RegisterEvent(FSCVAPP_XMLRPC,"XML RPC","type;parameter;url;user;macaddress;executiontext;executionid;stubversion");g_vappstrudlmodule.RegisterEvent(FSCVAPP_LOAD,"Load","value");g_vappstrudlmodule.RegisterEvent(FSCVAPP_RENDER,"Render","value");g_vappstrudlmodule.RegisterEvent(FSCVAPP_RENDERHTML,"Render HTML","value");g_vappstrudlmodule.RegisterEvent(FSCVAPP_MENUOPEN,"Menu","type;parameter;url;user;macaddress;executiontext;executionid;stubversion");g_vappstrudlmodule.RegisterEvent(FSCVAPP_PAGEBUSY,"g_pagebusy","value");strudl.RegisterFilterValue(g_vappuser[0],g_vappuser[1]);if(window.g_vappstrudlurl){strudl.env.url=window.g_vappstrudlurl}strudl.env.exeptioncallback=vappstrudlerror;vappstrudlsubmit();window.g_vappstrudlinit=true}return vappstrudlcreatectx(a)}function vappstrudlregisterapp(){strudl.RegisterApplication(g_suitename,g_vappdomainid,"Client",vapphead())}function vappstrudlcreatectx(a){if(a){if(!g_vappstrudlcontext){g_vappstrudlcontext=strudl.CreateContext(null,g_vappuser[0])}return g_vappstrudlcontext}else{return strudl.CreateContext(null,g_vappuser[0])}}function vappstrudlreleasectx(a){strudl.ReleaseContext(a)}function vappstrudlresetctx(){if(g_vappstrudlcontext){strudl.ReleaseContext(g_vappstrudlcontext);g_vappstrudlcontext=null}}function vappstrudlsubmit(){strudl.cache.flush(true)}function vappstrudlevtenter(a,c,b){g_vappstrudlmodule.Event(a,c,strudl.LEVEL_NORMAL,strudl.FLAG_ENTER,b)}function vappstrudlevtleave(a,b){g_vappstrudlmodule.Event(a,b,strudl.LEVEL_NORMAL,strudl.FLAG_LEAVE)}function vappstrudllogevtenter(b,e,c,d,a){g_vappstrudlmodule.Event(b,e,strudl.LEVEL_LOG,strudl.FLAG_ENTER,c,d,a,g_vappuser[1],g_vappmacaddress,g_vappstrudlexecutiontext,g_vappstrudlexecutionid,g_vappstubversion)}function vappstrudllogevtleave(a,b){g_vappstrudlmodule.Event(a,b,strudl.LEVEL_LOG,strudl.FLAG_LEAVE)}function vappstrudldetailevtenter(a,c,b){g_vappstrudlmodule.Event(a,c,strudl.LEVEL_DETAIL,strudl.FLAG_ENTER,b)}function vappstrudldetailevtleave(a,b){g_vappstrudlmodule.Event(a,b,strudl.LEVEL_DETAIL,strudl.FLAG_LEAVE)}function vappstrudldetailevtinfo(a,c,b){g_vappstrudlmodule.Event(a,c,strudl.LEVEL_DETAIL,strudl.FLAG_NONE,b)}function vappstrudldebugevtinfo(a,c,b){g_vappstrudlmodule.Event(a,c,strudl.LEVEL_DEBUG,strudl.FLAG_NONE,b)}function vappstrudlfeedback(a){vappstrudlregisterapp();strudl.Report(0,g_vappuser[0],null,a);vappstrudlsubmit()};function ajaxList(){this.Init=ListViewInit;this.Render=ListViewList;this.RenderPart=ListViewRenderPart;this.RenderPartSB=BaseGetOptionsHtm;this.Dispatch=Dispatch;this.GetContainer=ListViewGetContainer;this.ListViewHeadTool=ListViewHeadTool;this.ListViewFilterStat=ListViewFilterStat;this.ListViewSelectTool=ListViewSelectTool;this.ListViewNavBranches=ListViewNavBranches;this.ListViewNavInput=ListViewNavInput;this.ListViewGenList=ListViewGenList;this.ListViewFixedCols=ListViewFixedCols;this.ListViewListHead=ListViewListHead;this.ListViewListBody=ListViewListBody;this.ListViewHeadEntry=ListViewHeadEntry;this.ListViewGroupHead=ListViewGroupHead;this.ListViewRow=ListViewRow;this.ListViewValue=ListViewValue;this.ListViewGenValue=ListViewGenValue;this.ListViewColSetBranches=ListViewColSetBranches;this.ListViewThumbData=ListViewThumbData;this.ListViewPreviewData=ListViewPreviewData;this.ListViewThumbValue=ListViewThumbValue;this.GetId=function(){return this.id};this.GetListId=function(){return this.listid};this.GetView=function(){return this.view};this.IsAggrList=function(){return this.data.GetIsaggr()==1};this.IsSimple=function(){return this.issimple};this.IsThumb=function(){return this.isthumb};this.IsDiashow=function(){return this.isdiashow};this.IsEdit=function(){return this.data.GetIsedit()==1};this.IsOrder=function(){return this.isorder};this.GetColIds=function(){return this.colids};this.GetColId=function(a){return this.colids[a]};this.ColHasCtl=function(a){return this.colctls[a]};this.GetEmptyColCount=function(){return this.emptycolcount};this.GetColIdx=ListViewGetColIdx;this.ColMenu=ListViewColMenu;this.UpdateColWidth=ListViewUpdateColWidth;this.GetFscArgs=ListViewGetFscArgs}function ListViewInit(d,b,g,f,e,c,a){this.id=d.GetId();this.RequestableControlInit=RequestableControlInit;this.RequestableControlInit(d,b,g,f,e,c,a);this.listid=this.id+this.portletid;this.view=this.data.GetView();this.issinglelist=(this.data.GetIssinglelist()==1);this.issimple=(this.data.GetIssimple()==1);this.isthumb=(this.data.GetThumbview());this.scale=vappgetnumber(this.data.GetThumbsize());if(!this.scale){this.scale=(this.isthumb)?75:50}if(this.isthumb){switch(this.data.GetThumbview()){case"ds":this.isdiashow=true;case"pv":this.ispreview=true;break;case"cl":this.iscarousel=true;break}}this.thumbwidth=parseInt(this.data.GetThumbwidth())*this.scale/100;this.thumbheight=parseInt(this.data.GetThumbheight())*this.scale/100;this.isselectable=(this.data.GetFullselectionid())?true:false;this.showlineno=(this.data.GetLinenumbers()==1);this.showleader=false;this.menu=null;this.fscargs=null}function ListViewList(b){this.isorder=(this.data.GetIsorder()==1);this.identclass="FscOL";this.colids=[];this.colaligns=[];this.colctls=[];this.emptycolcount=0;this.rows=0;this.cols=0;if(!this.isprint){this.colwidth=[]}var f=this.data;this.pagetype=vappgetportlet(this.portletid).GetType();if(g_style&&g_style.IsNewCtrl("List")){g_style.Add("BODY.FscBody TABLE.FscList0,BODY.FscBody TABLE.FscList1,DIV.FscListScroll",null,g_vappcolor.listalternate);g_style.Add("BODY.FscBody DIV.FscEntryScroll TABLE.FscList0,BODY.FscBody DIV.FscEntryScroll TABLE.FscList1,DIV.FscListDisp",null,g_vappcolor.listalternate);g_style.Add("BODY.FscBody TABLE.FscList0 TR TD.L,BODY.FscBody TABLE.FscList1 TR TD.L,BODY.FscBody TABLE.FscList0 TD.FscLC,BODY.FscBody TABLE.FscList1 TD.FscLC,SPAN.FscColRes",null,g_vappcolor.container);g_style.Add("UL.FscThumbView LI.FscTvSectionHead,DIV.FscListRv,DIV.FscPvTopHover",null,g_vappcolor.containerborder);g_style.Add("DIV.FscListPv DIV.FscBackground",g_vappcolor.containerborder);g_style.Add("DIV.FscSelectTool IMG.FscLink",g_vappcolor.button,g_vappcolor.buttonborder);g_style.Add("DIV.FscSelectTool,SPAN.FscNavigation INPUT,DIV.FscNav",g_vappcolor.container,g_vappcolor.buttonborder);g_style.Add("DIV.FscListHead,HTML.FscPrint TR.FscListHead,DIV.FscListHead SPAN.FscColSet,DIV.FscListHead SPAN.FscColCaption,TD.FscDataGroupCaption,TR TD.FscDataGroupSpace",g_vappcolor.listhead);g_style.AddEx("DIV.FscListHead,HTML.FscPrint TR.FscListHead,DIV.FscListHead SPAN.FscColSet,DIV.FscListHead SPAN.FscColCaption","background-image:"+vappcolor.getsteppedgradient(g_vappcolor.listhead));g_style.Add(".FscListHead,.FscListHead2",null,g_vappcolor.containerborder);g_style.Add("DIV.FscListHead2,HTML.FscPrint TR.FscListHead2,DIV.FscListHead2 SPAN.FscColSet,DIV.FscListHead2 SPAN.FscColCaption",g_vappcolor.listhead);g_style.Add("SPAN.FscBranchButton",g_vappcolor.button,g_vappcolor.buttonborder);g_style.Add("SPAN.FscBranchButton:hover",g_vappcolor.buttonhover);g_style.Add(".FscSel,TABLE TR.FscSel,TR.FscSel TD.L,TR.FscSel TD.FscLC,LI.FscSel DIV.FscTvBox",g_vappcolor.listselect);g_style.Add("A:hover IMG.FscBtTb,UL.FscThumbView LI.L DIV.FscTvBox:hover, TABLE.FscList0 TR:hover,TABLE.FscList1 TR:hover",g_vappcolor.listhover);g_style.Add("UL.FscThumbView LI.L DIV.FscTvBox",null,g_vappcolor.container);g_style.Add("UL.FscThumbView LI.FscSel DIV.FscTvBox",g_vappcolor.listselect,g_vappcolor.containerborder);
g_style.Add(".FscLSelInactive, TABLE TR.FscLSelInactive",g_vappcolor.listselectinactive);g_style.Add("TR.FscLR",g_vappcolor.listalternate);g_style.Add("DIV DIV.FscListHead2 SPAN.FscColFixed, DIV DIV.FscListHead SPAN.FscColFixed, DIV DIV.FscListHead SPAN.FscColFixed SPAN.FscColSet",g_vappcolor.listheadfixed,null,g_vappcolor.fontinvert);g_style.AddEx("DIV DIV.FscListHead2 SPAN.FscColFixed, DIV DIV.FscListHead SPAN.FscColFixed, DIV DIV.FscListHead SPAN.FscColFixed SPAN.FscColSet","background-image:"+vappcolor.getsteppedgradient(g_vappcolor.listheadfixed));g_style.Add("DIV.FscScrollBar DIV",null,g_vappcolor.containerborder);g_style.Add(".FscBtBlock,.FscNavBlock > SPAN",g_vappcolor.ribbon,g_vappcolor.ribbonborder);g_style.Add("DIV.FscSimpleNav .FscBtBlock,DIV.FscSimpleNav .FscBtBlock *","transparent","transparent");g_style.Add(".FscBtBlock .FscMenu",g_vappcolor.ribbonlabel);g_style.Add(".FscBtBlock A.FscMenu:hover,.FscBtBlock A.FscMenuSrc",g_vappcolor.ribbonhover,null,g_vappcolor.fontinverse);g_style.AddEx(".FscBtBlock A.FscMenu SPAN","background-image:url(../tmp/i/s/COO.1.1.1.16701.png)");g_style.AddEx(".FscBtBlock A.FscMenu:hover SPAN,.FscBtBlock A.FscMenuSrc SPAN","background-image:url(../tmp/i/sh/COO.1.1.1.16701.png)");if(g_isie){g_style.Add("DIV.FscButtonBar IMG, DIV.FscListRv IMG","inherit");g_style.Add("IMG.FscSelectTool, INPUT.FscSBInput",g_vappcolor.container);g_style.Add("SPAN.FscColSet IMG",g_vappcolor.listhead)}}var j=f.GetFullselectionstring()?f.GetFullselectionstring():"";if(this.isselectable){if(this.iscarousel){var h=j.split(";");if(h.length>1){j=h[0]}}var a=this,d=this.listid,e=this.portletid;vapppushonload(function(){vappseladdlist(a,j,a.isrewrite);vapppushresetscrollareas(vappgetelementbyid("FscTB"+d,e),e);vapppushresetscrollareas(vappgetelementbyid("FscListHead"+d,e),e);if(a.issinglelist){vappselsetpagemenu(null,e,true)}},this.portletid)}var i=f.GetName(),g=f.GetSkiptext()+" "+i;b.Push('<a name="L" title="'+g+'" href="#skip'+this.listid+'"');if(this.issinglelist){b.Push(' fscname="'+i+'"')}b.Push("></a>");if(this.pagetype==FSCVAPP_THREEPART){this.ListViewGenList(b,f,2,2,true)}else{if(this.pagetype==FSCVAPP_SMALLDIALOG||this.pagetype==FSCVAPP_HTML){this.ListViewHeadTool(b,f.GetListHeadTool());this.ListViewGenList(b,f,2,0,true)}else{if(this.issinglelist){this.ListViewHeadTool(b,f.GetListHeadTool());var c=this.ListViewGenList(b,f,2);if(c){this.RenderRemainder=ListViewRemainingList;this.remoutput=c;this.selstr=j;g_renderlater["singlelist"+this.portletid]=this}}else{this.iseditor=true;this.ListViewHeadTool(b,f.GetListHeadTool());this.ListViewGenList(b,f,2)}}}b.Push('<input type="hidden" name="l'+this.id+'" id="l'+this.listid+'" value="'+j+'" /><a name="skip'+this.listid+'"></a>')}function ListViewGenList(n,B,j,H,f){var q=new BufferedOutput(),v=this.listid,x=this.portletid,z=false,u;if(null==H){H=0}if((!this.isprint||this.isthumb)&&!this.ispreview&&!this.iscarousel){this.ListViewListHead(n,B.GetListHead())}if(!this.isprint&&!f&&(this.issinglelist||(this.iseditor&&!this.isthumb))){if(this.issinglelist){u="FscResizeElem";vappsetresizearea(u,this.portletid);n.Push('<div class="FscListScroll" id="FscResizeElem'+this.portletid+'"')}else{if(this.iseditor&&!this.isthumb){u="FscScr"+this.id;n.Push('<div class="FscEntryScroll" id="FscScr'+this.listid+'"')}}if(!this.isrewrite){vapppushscrollareas(u,this.portletid)}if(!this.isthumb){n.Push(' onscroll="vappadjustlistheader(this)"');if(!this.isrewrite){var x=this.portletid;vapppushonlayout(function(){vappadjustlistheader(vappgetelementbyid(u,x))},x)}}n.Push(">");z=true}if(this.isthumb){if(!this.isrewrite){g_vapplistviews[v]=null}if(this.ispreview){if(this.isprint){var g=g_vapplistviews[this.listid].GetActImage();if(g){var m=g.src.split("/tn").join("/pv");q.Push('<img class="FscPvPrint" src="'+m+'" alt="" />')}}else{q.Push('<div class="FscListPv" id="'+this.listid+'" fscview="'+B.GetView()+'" ');if(window.g_isportlet&&!vappgetportletsize(this.portletid)[1]){q.Push('style="height:'+this.thumbheight*1.5+'px;" ')}q.Push(">");var a="";if(this.isdiashow){a='style="background-color:#000000"'}q.Push('<div class="FscPvHiddenImg" id="FscPvHiddenImg'+this.listid+'" style="background-color:'+a+'"><img alt="" /></div>');q.Push('<div class="FscPvImg" id="FscPvImg'+this.listid+'" '+a+'><img src="'+va_lookpath+'/FSCVAPP_1_1001/treespace.gif" alt="" /></div>');q.Push('<div class="FscPvTopHover" id="FscPvTopHover'+this.listid+'"><div class="FscPvShowBox"><div class="FscBackground"></div>');q.Push('<div class="FscPvNav" id="FscPvTopNav'+this.listid+'" onclick="vapppreviewnav()">');if(this.isdiashow){q.Push('<div class="FscPvRight"><img class="FscPvClose" src="'+va_lookpath+'/FSCVAPP_1_1001/close.png" alt=""/></div>')}q.Push('<div class="FscPvCenter"><img class="FscPvFirst" src="'+va_lookpath+'/FSCVAPP_1_1001/first.png" /><img class="FscPvPrev" src="'+va_lookpath+'/FSCVAPP_1_1001/prev.png" />');q.Push('<img class="FscPvPlay" src="'+va_lookpath+'/FSCVAPP_1_1001/play.png" /><img class="FscPvNext" src="'+va_lookpath+'/FSCVAPP_1_1001/next.png" /><img class="FscPvLast" src="'+va_lookpath+'/FSCVAPP_1_1001/last.png" /></div>');
q.Push("</div></div></div>");q.Push('<div class="FscBackground" style="height:'+this.thumbheight+'px"></div><div class="FscPvBottomHover" id="FscPvBottomHover'+this.listid+'">');q.Push('<div class="FscPvThumbs" id="FscThumbs'+this.listid+'" onclick="vapppreview(this)" style="height:'+this.thumbheight+'px;">');var D=new Array();this.ListViewListBody(n,q,B,k,D);q.Push('<span class="FscPvTitle"></span></div></div><div class="FscPvNav" id="FscPvNav'+this.listid+'">');var y=new VAPPSlider(this.listid,this.portletid);y.WriteHtm(q,"vapppreviewnav()");q.Push("</div></div>");var b=this.isdiashow,i=this.data.GetSlideinterval(),G=this.scale,s=this.thumbheight,w=this.data.GetThumbtransparency(),h=this.iseditor;i=(i.length<1)?5:vappgetnumber(i);w=(w)?vappgetnumber(w):60;vapppushonlayout(function(I){if(I){vapppreviewload(v,x,h,b,D,i,y,G,s,w)}},x);var A=vappgetportletstyle(this.portletid),d=vapplistgetopacity(w);if(d){A.AddEx("#FscThumbs"+this.listid+" IMG",d)}if(this.isdiashow&&g_vappportlets.length==1){A.Add("DIV.FSCAjaxContainer","#000000 !important")}}}else{if(this.iscarousel){q.Push('<div class="FscListRv" id="'+this.listid+'" fscview="'+B.GetView()+'" ');if(this.isprint){var l=window.document.getElementById(this.listid);if(l){q.Push('style="height:'+l.offsetHeight+'px;">');q.Push(l.innerHTML)}else{q.Push(">")}}else{if((window.g_isportlet&&!vappgetportletsize(this.portletid)[1])||this.iseditor){q.Push('style="height:'+this.thumbheight*3+'px;" ')}q.Push('onclick="vappcarousel(this)">');var D=new Array();this.ListViewListBody(n,q,B,k,D);q.Push("</div>");vapppushonlayout(function(I){vappcarouselload(I,v)},this.portletid)}}else{var F=(B.GetScope()>1)?1:B.GetScope(),s=this.thumbheight;q.Push('<div class="FscList'+F+'" id="'+this.listid+'" fscview="'+B.GetView()+'">');q.Push('<ul class="FscThumbView" id="FscThumbs'+this.listid+'">');this.ListViewListBody(n,q,B,k);q.Push('</ul><div class="FscTvClearDiv"/></div>');var w=vappgetnumber(this.data.GetThumbtransparency()),E=(this.cols-1)*vappgetfontsize(null,true)*1.75;if(!this.isprint){g_vapplistviews[v]=new VAPPThumbView(v,x,this.scale,this.thumbheight,w,E);vapppushonload(function(){vappthumbviewload(v,s)},this.portletid)}var A=vappgetportletstyle(this.portletid);vapplistsetthumbsize(this.listid,A,s,null,E);if(w){A.AddEx("#FscThumbs"+this.listid+" DIV.FscTvImg IMG",vapplistgetopacity(w))}var t=B.GetListHead();for(var r=0;r<this.cols;r++){var p=t.GetColumnEntry(r),e=parseInt(p.GetColtype());if(e==3||e==4){this.colids.push(p.GetColid())}}}}}else{var t=B.GetListHead(),F=(B.GetScope()>1)?1:B.GetScope(),o=(this.pagetype==FSCVAPP_THREEPART)?"FscThreePartList":"FscList"+F,k=this.issinglelist&&!this.isrewrite;q.Push('<table class="'+o+'" cellspacing="'+H+'" cellpadding="'+j+'" id="'+this.listid+'" fscview="'+B.GetView()+'">');if(this.isprint){this.ListViewListHead(q,B.GetListHead())}q.Push("<colgroup>");for(var r=0;r<this.cols;r++){var p=t.GetColumnEntry(r),e=parseInt(p.GetColtype());if(e==1){q.Push('<col class="FscGroupCol" />')}else{if(e==2){if(this.colwidth[r]){q.Push('<col style="width:'+this.colwidth[r]+'" />')}}else{q.Push('<col style="width:'+this.colwidth[r]+'" ');if(e==3||e==4){this.colids.push(p.GetColid());this.colaligns.push(p.GetAlignment());this.colctls.push(e==3);q.Push('fsci="'+(this.colids.length-1)+'" ');switch(parseInt(p.GetAlignment())){case 382:if(r==1){this.identclass="FscOLL"}break}}q.Push("/>")}}}if(this.cols>1&&B.GetHasnestedlists()==0){q.Push("<col />")}q.Push("</colgroup>");q.Push('<tbody id="FscL'+this.listid+'"');var C=(this.issimple)?"FscDoNotOpen FscSimple":"";if(window.g_isportlet){C+=(C)?" "+g_vapp_css.row:g_vapp_css.row}if(C){q.Push(' class="'+C+'"')}q.Push(">");var c=this.ListViewListBody(n,q,B,k);if(!this.isrewrite){g_vapplistviews[v]=new VAPPListView(v,x,this.scale,this.thumbwidth,this.thumbheight,u);vapppushonload(function(){g_vapplistviews[v].SetSize()},this.portletid)}q.Push("</tbody></table>");if(k&&c){n.Push("</tbody></table>");if(z){n.Push("</div>")}this.ListViewFixedCols(n);return q}}if(z){q.Push("</div>")}this.ListViewFixedCols(q);n.Push(q.PopAll(true))}function ListViewRemainingList(){var b=window.document.getElementById("FscResizeElem"+this.portletid);if(b){b.innerHTML=this.remoutput.PopAll(true);if(this.selstr){var a=g_sellists[this.listid];if(a){a.SelectionFromForm(this.selstr)}}}}function ListViewFixedCols(a){var b=(null!=this.data.GetFixedcolidx())?vappgetnumber(this.data.GetFixedcolidx()):null,c=(null!=b)?"FscScrollBar":"FscHidden";a.Push('<div id="FscScrollBar'+this.listid+'" class="'+c+'"><div onscroll="vappfixedcolsscroll(\''+this.listid+"')\"><div>&nbsp;</div></div></div>");if(null!=b){var e=this.listid,d=this.colwidth,b=b+this.emptycolcount;vapppushonload(function(){g_vapplistviews[e].FixedColsInit(b,d)},this.portletid)}}function ListViewListHead(f,m){var h=(this.pagetype==FSCVAPP_EXPLORE)?"FscListHead":"FscListHead2";if(window.g_isportlet){h+=" "+g_vapp_css.head}this.cols=m.ColumnEntryCount();var t=this;vapppushonload(function(){var i=vappgetelementbyid("FscListHead"+t.listid,t.portletid);
if(i){i.onmouseover=vapplistheadmouseover;i.onmousedown=function(v){vappsetcontainer(t.portletid,false,v);vapplistheadmousedown(v)};if(!window.g_vapppopupcomp){i.onmouseout=function(){vappcolsettool(true)}}if((g_isie6||g_isie7||g_issafari)&&!t.isthumb){vappadjustlistheadercols(t.listid,i,t.portletid);if(!t.isrewrite){vapppushonchangefont(function(){vappadjustlistheadercols(t.listid,i,t.portletid)},t.portletid)}}}},this.portletid);if(this.isthumb){f.Push('<div id="FscListHead'+this.listid+'" class="'+h+' FscThumbs">');for(var q=0,r=m.HeadEntryCount();q<r;q++){this.ListViewHeadEntry(f,m.GetHeadEntry(q),q,q==r-1)}f.Push("</div>")}else{if(!this.isprint){for(var q=0;q<this.cols;q++){var g=m.GetColumnEntry(q),c=parseInt(g.GetColtype());switch(c){case 1:this.colwidth.push("8px");break;case 2:var n=0;for(var k=0,r=this.data.ListBodyCount();k<r;k++){var s=this.data.GetListBody(k).GetListDataRows(0);if(s){if(s.ListDataCount()>0){if(!this.rows){this.rows=s.ListDataCount()}if(!this.isprint){var j=s.GetListData(0).GetDataLeader();if(j){var e=j.GenericBranchCount();if(e){n+=e*1.5;break}}}}}}if(this.showlineno){n+=1.4+this.rows.toString().length*0.6}if(n>0){this.showleader=true;n=n+"em"}else{if(this.issimple){this.showleader=true;n="1.5em"}}this.colwidth.push(n);break;case 3:case 4:if(g.GetColwidth()){this.colwidth.push(g.GetColwidth())}else{if(this.cols>3){this.colwidth.push("17em")}else{if(this.cols>2){this.colwidth.push("25em")}else{this.colwidth.push("40em")}}}break}}}var b=m.HeadEntryCount();if(b){var u=(!this.isprint)?"div":"thead><tr",l=(!this.isprint)?"span":"td",p=(!this.isprint)?"div":"thead></tr",a,d=0;f.Push("<"+u+' id="FscListHead'+this.listid+'" class="'+h+'">');for(var k=0,o=this.colwidth.length-b;k<o;k++){if(this.colwidth[d]){f.Push("<"+l+' class="FscColEmpty" style="width:'+this.colwidth[d]+'"></'+l+">");this.emptycolcount++}d++}for(var q=0;q<b;q++){a=m.GetHeadEntry(q);this.ListViewHeadEntry(f,a,q,q==b-1,this.colwidth[d]);if(this.isorder&&a.GetSortmode()>0){this.isorder=false}d++}f.Push("</"+p+">")}}}function ListViewListBody(k,l,q,d,s){var c=false;for(var n=0,o=q.ListBodyCount();n<o;n++){var p=q.GetListBody(n);if(g_issafari){if(n==0&&p.GroupHeadCount()>0){l.Push('<tr class="FscHiddenRow">');for(var b=0;b<this.cols;b++){l.Push("<td></td>")}l.Push("</tr>")}}for(var b=0,g=p.GroupHeadCount();b<g;b++){this.ListViewGroupHead(l,q,p.GetGroupHead(b))}for(var b=0,g=p.ListDataRowsCount();b<g;b++){listdatarows=p.GetListDataRows(b);if(this.isthumb){var h=vapphead();var a=new BufferedOutput();if(this.ispreview||this.iscarousel){var j=document.createElement("DIV");for(var m=0,f=listdatarows.ListDataCount();m<f;m++){var e=(this.ispreview)?m:m+1;this.ListViewPreviewData(l,a,listdatarows.GetListData(m),e,h,s,j)}}else{for(var m=0,f=listdatarows.ListDataCount();m<f;m++){this.ListViewThumbData(l,a,listdatarows.GetListData(m),h)}}}else{this.rowcnt=listdatarows.ListDataCount();var r=(q.GetHasnestedlists()==1);for(var m=0;m<this.rowcnt;m++){this.ListViewRow(l,listdatarows.GetListData(m),m,r);if(d&&m==100&&m<this.rowcnt-1){k.Push(l.PopAll());c=true}}}}}return c}function ListViewHeadEntry(b,k,f,a,g){var j=k.BeforeBranchCount(),i=k.AfterBranchCount(),l=j>0||i>0,d=(!this.isprint)?"span":"td",c=(f==0)?"FscColCaption FscFirst":"FscColCaption";b.Push("<"+d+' class="'+c+'" fsci="'+f+'" ');if(g){b.Push('style="width:'+g+'" ')}b.Push('fscsttext="'+vappstraddslashes(MaskValue(k.GetColname()))+'">&nbsp;');if(g_vappis24hrec){this.BranchGenericBranches24(vapp24listviewbranch,this.id+"|COLUMNS|"+vapp24escape(k.GetCaption()),b,k,null,null,null,null,null,true)}else{this.BranchGenericBranches(b,k,null,null,null,null,null,true)}b.Push("&nbsp;");if(k.GetMustbedef()==1){b.Push('<span class="FscMustBeDef">');b.Push(MaskValue(k.GetCaption()));b.Push('<img src="'+va_lookpath+'/FSCVAPP_1_1001/star.gif" class="Fsc" /></span>')}else{b.Push(MaskValue(k.GetCaption()))}if(!this.isprint){if(l){b.Push('<span class="FscColSet');if(!window.g_vapppopupcomp){b.Push(" FscInvisible")}b.Push('">');for(var h=0;h<j;h++){this.ListViewColSetBranches(b,k.GetBeforeBranch(h),true,k)}for(var h=0,e=k.AfterBranchCount();h<e;h++){this.ListViewColSetBranches(b,k.GetAfterBranch(h),false,k)}b.Push("</span>")}if((!a||g)&&!this.isthumb){b.Push('<span class="FscColRes"></span>')}}if(a&&this.isprint){b.Push('<td class="FscColEmpty"></td>')}b.Push("</"+d+">")}function ListViewColSetBranches(d,c,f,e){for(var b=0,a=c.GenericBranchCount();b<a;b++){var g=(!f&&b==a-1)?"FscBranchCollast":null;if(g_vappis24hrec){this.BranchGenericBranch24(vapp24listviewbranch,this.id+"|COLUMNS|"+vapp24escape(e.GetCaption()),d,c.GetGenericBranch(b),g)}else{this.BranchGenericBranch(d,c.GetGenericBranch(b),g)}}}function ListViewGroupHead(d,f,c){if(this.isthumb){d.Push('<li class="FscTvSectionHead">')}else{d.Push("<tr>");for(var e=0,a=c.DataGroupCount();e<a;e++){d.Push('<td class="FscDataGroupSpace" style="border-color:'+g_vappcolor.container+'">&nbsp;</td>')}d.Push('<td class="FscDataGroupCaption" style="border-color:'+g_vappcolor.container+'" colspan="'+c.GetCols()+'">')
}for(var e=0,a=c.GenericBranchCount();e<a;e++){if(g_vappis24hrec){this.BranchGenericBranch24(vapp24listgroupbranch,this.listid,d,c.GetGenericBranch(e))}else{this.BranchGenericBranch(d,c.GetGenericBranch(e))}}d.Push(MaskValue(c.GetCaption()));d.Push('<span class="FscDGCtrl">');var b=c.GetValue();var g=b.GetCtrlXmlDom();if(null!=g){this.Dispatch(d,g)}else{AddValue(d,b)}d.Push("</span>"+c.GetMessage());if(this.isthumb){d.Push("</li>")}else{d.Push("</td></tr>")}}function ListViewGenValue(b,a,c){var d=a.GetCtrlXmlDom();if(null!=d){this.Dispatch(b,d,null,this.portletid)}AddValue(b,a)}function ListViewValue(f,g,b,j){var h="L";h=vappaddfonteffectclass(h,g);if(null!=j){if(this.colaligns[j]==381){h+=" LC"}else{if(this.colaligns[j]==382){h+=" LR"}}}f.Push("<td ");if(g.GetWeightcolor()){f.Push(' style="background-color:'+g.GetWeightcolor()+'"')}var n=g.GetIdentargs();if(n){f.Push(' fscargs="'+n+'"')}if(h){f.Push('class="'+h+'" ')}var d=(g.GetIdentimage()),e=false,m=g.GenericBranchCount(),l;if(m>0){l=g.GetGenericBranch(m-1);l.inuse=true;if(null!=l&&((this.issimple&&m==1)||(!d&&!g.GetCtrlXmlDom()))){m--;e=true}f.Push(">");if(m>0&&!this.isprint){f.Push('<table cellpadding="0" cellspacing="0"><tr>');for(var k=0;k<m;k++){f.Push("<td>");this.BranchGenericBranch(f,g.GetGenericBranch(k));f.Push("</td>")}f.Push('<td class="FscCtrl">')}}else{f.Push(">")}var c=(this.issimple&&(d||e||b));if(c){f.Push('<a class="FscSimple" href="');if(b){f.Push(b);if(!g_isie7){f.Push('" target="fscp')}f.Push('">')}else{f.Push('#" onclick="');if(e){f.Push(BranchGetAction(l))}else{f.Push("vappopenobj()")}f.Push('">');if(e){this.ListViewGenValue(f,l)}}}else{if(e){this.BranchGenericBranch(f,l,"FscBranchButton",null,null,null,null,null,true)}}if(d){if(g_vapppopupcomp==1){var n=g.GetIdentargs();var a=(n)?"vappopenobject(new VAPPArgs(this));":"";f.Push('<a class="FscOpenHelper" href="#" onclick="'+a+'" alt=""></a>')}f.Push('<span tabindex="0" class="'+this.identclass+'"><img src="../tmp/'+g.GetIdentimage()+'.gif" class="Fsc16" title="'+g.GetImgalttext()+'" />');vappaddobjectstate(f,g);f.Push(" &nbsp;</span>")}this.ListViewGenValue(f,g,j);if(c){f.Push("</a>")}if(m>0&&!this.isprint){f.Push("</td></tr></table>")}f.Push("</td>")}function ListViewRow(e,c,m,l){e.Push("<tr ");var g=c.GetDataLeader();if(g&&this.isselectable){e.Push('fsctrargs="'+g.GetIdx()+","+g.GetKey()+'" ')}if(m%2==1){e.Push('class="'+g_vapp_css.rowalternate+'"')}if(!window.g_isportlet){var b=vappgetdisplayeffectstyle(c);if(b){e.Push('style="'+b+'"')}}e.Push(">");for(var h=0,j=c.DataGroupCount();h<j;h++){e.Push('<td class="FscDataGroupSpace" style="border-color:'+g_vappcolor.container+'">&nbsp;</td>')}if(g&&this.showleader){e.Push('<td class="FscColEmpty">');var k=g.GenericBranchCount();var d=((this.isselectable&&k>0)||k>1);if(d){e.Push('<span class="FscNoWrap">')}if(this.isselectable){if(this.issimple){e.Push('<input type="checkbox" onclick="vappselsimple(this)" ');if(g.GetIschecked()==1){e.Push('checked="true"')}e.Push("/>")}else{if(this.showlineno){e.Push('<span class="FscColNumber">');var f=parseInt(g.GetLinenumber())+1;if(this.rows>9&&this.rows<100){if(f<10){e.Push("&nbsp;")}}else{if(this.rows>99){if(f<10){e.Push("&nbsp;&nbsp;")}else{if(f>9&&f<100){e.Push("&nbsp;")}}}}e.Push(f);e.Push("</span>")}}}for(var h=0;h<k;h++){this.BranchGenericBranch(e,g.GetGenericBranch(h))}if(d){e.Push("</span>")}e.Push("</td>")}var a=c.GetUrl();if(a){a=vappgetportleturl(vapphead()+a)}this.ListViewValue(e,c.GetDataEntry(0),a);for(var h=1,j=c.DataEntryCount();h<j;h++){this.ListViewValue(e,c.GetDataEntry(h),null,h)}if(this.cols>1&&!l){e.Push('<td class="FscLC"></td>')}e.Push("</tr>")}function vapplistgetslider(d,e,g,h,i,c,f){var a=c+"_"+i;d.Push('<div class="FscSliderCont">');d.Push('<div class="FscSliderLabel">'+e+' <span id="'+a+'_v">'+g+"</span> "+h+"</div>");var b=new VAPPSlider(a,f,true,true);b.WriteHtm(d);d.Push("</div>");return b}function vapplistdispsettings(a){var e=vappgetcontainerid(),a=a+e,i=g_renderlater[a],b=vappgetelementbyid("FscListDisp"+a);if(i&&b){if(!b.innerHTML){vappsetstrings([FSC_STRTHUMBSIZE,FSC_STRTRANSPARENCY,FSC_STRSLIDEINTERVAL,FSC_STRSEC]);var c=new BufferedOutput(),d=g_vapplistviews[a],m=d.GetSize(),j=vapplistgetslider(c,vappgetstring(FSC_STRTHUMBSIZE),m,"%","s",a,e),h,g,f,l;if(i.isthumb){h=d.GetTransparency();g=vapplistgetslider(c,vappgetstring(FSC_STRTRANSPARENCY),h,"%","t",a,e)}if(i.ispreview){f=d.GetSlideDelay()/1000;l=vapplistgetslider(c,vappgetstring(FSC_STRSLIDEINTERVAL),f,vappgetstring(FSC_STRSEC),"i",a,e)}c.Push('<img class="FscClose" onclick="vapplistclosedisp(this)" src="'+va_lookpath+'/FSCVAPP_1_1001/close.png" alt=""/>');b.innerHTML=c.PopAll(true);b.className="FscListDisp";d.SetSettingsVisible(true);j.Init(function(n){if(n<1){n=1}d.SetSize(n)},function(){d.SaveSettings()},m,100);if(i.isthumb){g.Init(function(n){d.SetTransparency(n)},function(){d.SaveSettings()},h,100)}if(i.ispreview){var k=(f>60)?f:60;l.Init(function(n){d.SetSlideDelay(n*1000)},function(){d.SaveSettings()
},f,k,8.33)}}else{b.className="FscListDisp"}vappadjustlayout(e)}}function vapplistclosedisp(a){var b=a.parentElement;vappaddclass(b,"FscHidden");var c=b.id.substr("FscListDisp".length);g_vapplistviews[c].SaveSettings(true);g_vapplistviews[c].SetSettingsVisible(false);vappadjustlayout(vappgetcontainerid())}function vapplistsavesettings(b,e,a,d){var c=vappgetsimpleid(e);if(d){if(null!=a){vappclearg_delayedbranches(null,a)}vappctrl(c,b)}else{a=vapppushg_delayedbranches("5002;"+c+";"+b,null,a)}return a}function vapplistgetopacity(a){if(a){var b=100-vappgetnumber(a);return(g_isie)?"filter:Alpha(opacity="+b+");":"opacity:"+(b/100)+";"}}function vapplistsetthumbsize(g,e,c,b,d){var f=(b)?"width:"+b+"px;height:"+b+"px;":null,a="width:"+c+"px;height:"+c+"px;";if(g_isie6){e.AddEx("#FscThumbs"+g+" DIV.FscTvImg, UL.FscThumbView DIV.FscTvImg DIV",a,f)}else{e.AddEx("#FscThumbs"+g+" DIV.FscTvImg",a,f)}f=(b)?"max-width:"+b+"px;max-height:"+b+"px;":null,a="max-width:"+c+"px;max-height:"+c+"px;";e.AddEx("#FscThumbs"+g+" DIV.FscTvImg IMG",a,f);f=(b)?"width:"+b+"px;height:"+(b+d)+"px;":null;a="width:"+c+"px;height:"+(c+d)+"px;";e.AddEx("#FscThumbs"+g+" LI.L",a,f)}function ListViewThumbData(j,a,g,h){var d=g.DataEntryCount();j.Push('<li class="L" ');var l=g.GetDataLeader();if(l){var b=(l.GetKey())?l.GetKey():"";var n=(l.GetIdx())?l.GetIdx():"";j.Push('fsctrargs="'+n+","+b+'">');if(this.isselectable&&this.showlineno){var e=parseInt(l.GetLinenumber())+1;j.Push('<span class="FscColNumber">');if(this.rows>9&&this.rows<100){if(e<10){j.Push("&nbsp;")}}else{if(this.rows>99){if(e<10){j.Push("&nbsp;&nbsp;")}else{if(e>9&&e<100){j.Push("&nbsp;")}}}}j.Push(e);j.Push("</span>")}for(var q=0,r=l.GenericBranchCount();q<r;q++){this.BranchGenericBranch(j,l.GetGenericBranch(q))}}else{j.Push(">")}j.Push('<div class="FscTvBox">');var k=g.GetDataEntry(0);var t=b;var c=(k.GetIdentargs())?' fscargs="'+k.GetIdentargs()+'"':"";var p;var o=k.GenericBranchCount();if(o>0){var m=k.GetGenericBranch(o-1);if(!t){t=m.GetImg()}p=m.GetCtrlXmlDom();c+=' ondblclick="'+BranchGetAction(m)+'"'}if(t){var f=h+"/image/"+t+"/tn/1/"+k.GetVersiondate();if(window.g_isportlet){f=vappgetportleturl(f)}var s=(k.GetImgalttext())?k.GetImgalttext():"";j.Push('<div class="FscTvImg"><div><img src="'+f+'"'+c+' title="'+s+'" /></div></div>')}j.Push('<ul class="FscTvInfo">');for(var q=0;q<d;q++){k=g.GetDataEntry(q);j.Push("<li");if(q==0){j.Push(' class="'+vappaddfonteffectclass("FscTvTitle",k)+'"')}j.Push(">");if(p){this.ListViewThumbValue(j,a,p);p=null}else{this.ListViewThumbValue(j,a,k)}j.Push("</li>")}j.Push("</ul></div></li>")}function ListViewThumbValue(a,b,c){this.ListViewGenValue(b,c);var d=b.PopAll(true);a.Push(d?d:"&nbsp;")}function VAPPThumbView(b,i,f,m,g,e){this.m_id=b;this.m_portletid=i;this.m_thumbscale=f;this.m_thumbheight=m;this.m_thumbtransp=g;this.m_infoboxheight=e;this.IsSettingsVisible=function k(){return this.m_settingsvisible};this.SetSettingsVisible=function d(n){this.m_settingsvisible=n};this.GetSize=function l(){return this.m_thumbscale};this.SetSize=function h(o){if(!this.m_style){this.m_style=vappgetportletstyle(this.m_portletid)}if(this.m_style){var n=(this.m_thumbheight/this.m_thumbscale)*o;this.m_thumbscale=o;vapplistsetthumbsize(this.m_id,this.m_style,n,this.m_thumbheight,e);this.m_style.Apply()}this.m_thumbheight=n};this.GetTransparency=function j(){return this.m_thumbtransp};this.SetTransparency=function a(n){if(!this.m_style){this.m_style=vappgetportletstyle(this.m_portletid)}if(this.m_style){this.m_style.AddEx("#FscThumbs"+b+" DIV.FscTvImg IMG",vapplistgetopacity(n),vapplistgetopacity(this.m_thumbtransp));this.m_style.Apply()}this.m_thumbtransp=n};this.SaveSettings=function c(n){this.m_saveidx=vapplistsavesettings("THUMB_SELECT:tn|"+this.m_thumbscale+"|"+this.m_thumbtransp,this.m_id,this.m_saveidx,n)}}function vappthumbviewadjustimg(a,c){a.parentElement.className=(a.offsetWidth>a.offsetHeight)?"FscTvImgH":"FscTvImgV";var b=a.offsetHeight;if(b<c){a.style.marginTop=c-b+"px"}}function vappthumbviewload(b,i){if(g_isie){var g=window.document.getElementById(b);if(g){var h=g.children.length,a,f,c,d;while(h--){if(g.children[h].className==="FscThumbView"){a=g.children[h];break}}f=a.getElementsByTagName("DIV");for(var h=0,e=f.length;h<e;h++){g=f[h];c=g.className;if(g_isie6&&c=="FscTvImg"){d=g.getElementsByTagName("IMG")[0];if(d.readyState=="complete"){vappthumbviewadjustimg(d,i)}else{d.onload=function(){vappthumbviewadjustimg(this,i)}}}else{if(c=="FscTvBox"){fscjq(g.parentElement).hover(function(){this.style.zIndex=2400},function(){this.style.zIndex=""})}}}}}}function ListViewPreviewData(i,a,f,e,g,q,h){if(this.isprint){return}var r;var c="";var l=f.GetDataLeader();if(l){var b=(l.GetKey())?l.GetKey():"";var n=(l.GetIdx())?l.GetIdx():"";r=b;c=' fsctrargs="'+n+","+b+'"'}var j=f.GetDataEntry(0);if(j){var o=j.GenericBranchCount();if(o>0){var m=j.GetGenericBranch(o-1);if(!r){r=m.GetImg()}c+=' ondblclick="'+BranchGetAction(m)+'"'}var d=g+"/image/"+r+"/tn/1/"+j.GetVersiondate();
if(window.g_isportlet){d=vappgetportleturl(d)}i.Push('<img class="L" src="'+d+'" fsci="'+e+'" ');var p=(m&&m.GetCtrlXmlDom())?m.GetCtrlXmlDom():j;this.ListViewGenValue(a,p);h.innerHTML=a.PopAll(true);var k=MaskValue(h.innerText);if(k.length>50){k=k.substr(0,50)+" ..."}if(this.ispreview){i.Push('alt="" ');q.push(k)}else{i.Push('title="'+k+'" ')}h.innerHTML="";if(j.GetIdentargs()){i.Push('fscargs="'+j.GetIdentargs()+'" ')}i.Push(c+"/>")}}function VAPPPreview(id,portletid,iseditor,isdiashow,titles,slidedelay,slider,scale,height,transp){this.m_id=id;this.m_portletid=portletid;this.m_actimg=0;this.m_parent=window.document.getElementById(id);this.m_container=window.document.getElementById("FscThumbs"+id);this.m_thumbs=this.m_container.children;this.m_thumbcnt=this.m_thumbs.length-1;this.m_thumbscale=scale;this.m_thumbheight=height;this.m_thumbtitles=titles;this.m_thumbtransp=transp;this.m_titlespan=this.m_container.lastChild;this.m_imgcont=window.document.getElementById("FscPvImg"+id);this.m_img=this.m_imgcont.getElementsByTagName("IMG")[0];this.m_hiddenimgcont=window.document.getElementById("FscPvHiddenImg"+id);this.m_hiddenimg=this.m_hiddenimgcont.getElementsByTagName("IMG")[0];this.m_showhovercontainer=window.document.getElementById("FscPvTopHover"+id);this.m_showbox=this.m_showhovercontainer.firstChild;this.m_navtopcontainer=window.document.getElementById("FscPvTopNav"+id);this.m_hovercontainer=window.document.getElementById("FscPvBottomHover"+id);this.m_navcontainer=window.document.getElementById("FscPvNav"+id);this.m_bottombg=this.m_hovercontainer.previousSibling;this.m_slidedelay=slidedelay*1000;this.m_slider=slider;this.m_startpos=null;this.m_margin=0;this.m_iseditor=iseditor;this.IsSettingsVisible=function VAPPPreview_IsSettingsVisible(){return this.m_settingsvisible};this.SetSettingsVisible=function VAPPPreview_SetSettingsVisible(visible){this.m_settingsvisible=visible};this.SetSlideDelay=function VAPPPreview_SetSlideDelay(delay){this.m_slidedelay=delay};this.GetSlideDelay=function VAPPPreview_GetSlideDelay(){return this.m_slidedelay};this.SetSlideDelay=function VAPPPreview_SetSlideDelay(delay){this.m_slidedelay=delay};this.GetSize=function VAPPPreview_GetSize(){return this.m_thumbscale};this.SetSize=function VAPPPreview_SetSize(scale){this.m_thumbheight=(this.m_thumbheight/this.m_thumbscale)*scale;this.m_thumbscale=scale;this.m_container.style.height=this.m_thumbheight+"px";this.m_bottombg.style.height=this.m_thumbheight+"px";this.m_titlespan.innerHTML=""};this.GetTransparency=function VAPPPreview_GetTransparency(){return this.m_thumbtransp};this.SetTransparency=function VAPPPreview_SetTransparency(transp){if(!this.m_style){this.m_style=vappgetportletstyle(this.m_portletid)}if(this.m_style){this.m_style.AddEx("#FscThumbs"+id+" IMG",vapplistgetopacity(transp),vapplistgetopacity(this.m_thumbtransp));this.m_style.Apply()}this.m_thumbtransp=transp};this.SaveSettings=function VAPPPreview_SaveSettings(isnotdelayed){var delay=this.m_slidedelay/1000;this.m_saveidx=vapplistsavesettings("THUMB_SELECT:pv|"+this.m_thumbscale+"|"+this.m_thumbtransp+"|"+delay,this.m_id,this.m_saveidx,isnotdelayed)};this.Navigate=function VAPPPreview_Navigate(btn){var key=vapppreviewgetbtnkey(btn);switch(key){case"first":this.m_actimg=0;this.ImagePreLoad();this.ChangeImage(false,true);break;case"prev":this.m_actimg--;this.ImagePreLoad();this.ChangeImage(false,true);break;case"next":this.m_actimg++;this.ChangeImage(false,true);break;case"last":this.m_actimg=this.m_thumbcnt-1;this.ImagePreLoad();this.ChangeImage(false,true);break;case"pause":this.SlideShow(true,btn);break;case"play":this.SlideShow(false,btn);break;case"close":window.close();break;case"slideleft":this.CenterThumb(null,2000,true);break;case"slideright":this.CenterThumb(null,2000);break}};this.SlideShow=function VAPPPreview_SlideShow(ispause,btn){if(!btn){btn=this.m_playbtn}if(ispause){this.m_slideshowrunning=false;btn.src=btn.src.split("pause").join("play")}else{this.m_slideshowrunning=true;btn.src=btn.src.split("play").join("pause");this.ImagePreLoad();if(this.m_imghelper){var preview=this;vappcleartimeout(this.m_slidetimeout);this.m_slidetimeout=window.setTimeout(function(){preview.Slide(true)},this.m_slidedelay)}this.AnimateTop(true);this.AnimateBottom(true)}};this.Slide=function VAPPPreview_Slide(isfirst){if(this.m_slideshowrunning){if(isfirst&&this.m_actimg>=this.m_thumbcnt-1){this.m_actimg=0}else{this.m_actimg++}this.ChangeImage()}};this.AnimateTop=function VAPPPreview_AnimateTop(hide){var arg=(hide)?"100%":"0%";fscjq(this.m_showbox).animate({bottom:arg},{duration:300,queue:false})};this.AnimateBottom=function VAPPPreview_AnimateBottom(hide){g_vappactslider=null;var arg=(hide)?"-"+(this.m_bottombg.offsetHeight)+"px":"0px";fscjq([this.m_container,this.m_navcontainer,this.m_bottombg]).animate({bottom:arg},{duration:300,queue:false})};this.GetMinLeft=function VAPPPreview_GetMinLeft(){var firstimg=this.m_thumbs[0];var firstimgwidth=(firstimg)?firstimg.offsetWidth:0;return(this.m_parent.offsetWidth-firstimgwidth)/2
};this.GetMaxLeft=function VAPPPreview_GetMaxLeft(){var lastimg=this.m_thumbs[this.m_thumbcnt-1];var lastimgwidth=(lastimg)?lastimg.offsetWidth:0;return -this.m_container.offsetWidth+(this.m_parent.offsetWidth+lastimgwidth)/2};this.CenterThumb=function VAPPPreview_CenterThumb(img,speed,toleft,continueslideshow){var offsetleft;var parentwidth=this.m_parent.offsetWidth;var minleft=this.GetMinLeft();var maxleft=this.GetMaxLeft();if(img){offsetleft=(parentwidth-img.offsetWidth)/2;if(img!=this.m_thumbs[0]){offsetleft-=img.offsetLeft}if(!continueslideshow&&this.m_slideshowrunning){this.SlideShow(true)}}else{if(toleft){offsetleft=this.m_container.offsetLeft+parentwidth;if(offsetleft>minleft){offsetleft=minleft}}else{offsetleft=this.m_container.offsetLeft-parentwidth;if(offsetleft<maxleft){offsetleft=maxleft}}}fscjq(this.m_container).animate({left:offsetleft+"px"},{queue:false,duration:speed});this.m_slider.Move((offsetleft-minleft)/(maxleft-minleft)*this.m_slider.GetBoxWidth(),speed)};this.GetActImage=function VAPPPreview_GetActImage(){return this.m_thumbs[this.m_actimg]};this.ChangeImage=function VAPPPreview_ChangeImage(elem,center){vappcleartimeout(this.m_slidetimeout);var img;if(elem){if(elem.tagName=="IMG"){img=elem}else{var title=elem.innerText;if(title){for(var idx=0;idx<this.m_thumbcnt;idx++){if(this.m_thumbtitles[idx]==title){img=this.m_thumbs[idx];break}}}}if(img){this.m_actimg=parseInt(img.getAttribute("fsci"))}}else{img=this.GetActImage()}if(img&&img.src){vappshowhourglass();this.ManageButtonState();this.m_hiddenimg.src=img.src.split("tn").join("pv");vapppreviewsetargs(img,this.m_hiddenimg);if(center){this.CenterThumb(img,1000,null,true)}return img}else{if(this.m_slideshowrunning){this.SlideShow(true)}}};this.ShowImage=function VAPPPreview_ShowImage(){vapphidehourglass();if(!this.m_img.onload){var preview=this;this.m_img.onload=function(){vappsetopacity(preview.m_imgcont,1,true)}}vappsetopacity(this.m_imgcont,0,true);this.m_img.style.marginTop=this.m_hiddenimg.style.marginTop;this.m_img.className=this.m_hiddenimg.className;this.m_img.src=this.m_hiddenimg.src;vapppreviewsetargs(this.m_hiddenimg,this.m_img);this.ImagePreLoad(this.m_actimg+1)};this.ImageLoad=function VAPPPreview_ImageLoad(){vappsetopacity(this.m_imgcont,1,true);if(g_isie6){this.m_hiddenimg.className=""}if(this.m_parentresize||(!this.m_imghelper&&this.m_parent.offsetHeight<100)){this.m_parentresize=true;this.m_parent.style.height=this.m_parent.offsetWidth/4*3+"px";if(g_isie6){this.m_hiddenimg.className=(this.m_hiddenimg.offsetWidth<this.m_parent.offsetWidth)?"":"FscPvImgH"}}else{if(g_isie6){var parentheight=this.m_parent.offsetHeight;var wperc=this.m_hiddenimg.offsetWidth/this.m_parent.offsetWidth;var hperc=this.m_hiddenimg.offsetHeight/parentheight;if(wperc>1||hperc>1){this.m_hiddenimg.className=(wperc<hperc)?"FscPvImgV":"FscPvImgH"}else{this.m_hiddenimg.className=""}}}this.m_hiddenimg.style.marginTop=(this.m_parent.offsetHeight-this.m_hiddenimg.offsetHeight)/2+"px";if(this.m_slideshowrunning||!this.m_imghelper){var preview=this;vappsetopacity(this.m_imgcont,0,true);preview.ShowImage()}else{this.ShowImage()}vappcleartimeout(this.m_slidetimeout);if(this.m_slideshowrunning){var preview=this;this.m_slidetimeout=window.setTimeout(function(){if(window.document.getElementById(preview.m_container.id)){preview.Slide()}},this.m_slidedelay)}};this.ImagePreLoad=function VAPPPreview_ImagePreLoad(nextimg){var nextthumb=(nextimg)?this.m_thumbs[nextimg]:this.GetActImage();if(nextthumb&&nextthumb.tagName=="IMG"){if(!this.m_imghelper){this.m_imghelper=new Image()}this.m_imghelper.src=nextthumb.src.split("tn").join("pv");return}else{this.SlideShow(true)}};this.GetThumbTitle=function VAPPPreview_GetThumbTitle(img){var idx=img.getAttribute("fsci");if(null!=idx){return this.m_thumbtitles[idx]}};this.ManageButtonState=function VAPPPreview_ManageButtonState(){if(this.m_actimg==0){this.m_firstbtn.style.visibility="hidden";this.m_prevbtn.style.visibility="hidden"}else{this.m_firstbtn.style.visibility="";this.m_prevbtn.style.visibility=""}if(this.m_actimg==this.m_thumbcnt-1){this.m_lastbtn.style.visibility="hidden";this.m_nextbtn.style.visibility="hidden"}else{this.m_lastbtn.style.visibility="";this.m_nextbtn.style.visibility=""}};this.InitButtons=function VAPPPreview_InitButtons(container){var imgs=container.getElementsByTagName("IMG");for(var idx=0,cnt=imgs.length;idx<cnt;idx++){var btn=imgs[idx];var key=vapppreviewgetbtnkey(btn);eval("this.m_"+key+"btn = btn")}};this.SliderCallback=function VAPPPreview_SliderCallback(newpos){var minleft=this.GetMinLeft();var maxleft=this.GetMaxLeft();fscjq(this.m_container).stop();this.m_container.style.left=minleft+newpos*(maxleft-minleft)+"px"};this.InitButtons(this.m_navtopcontainer);this.InitButtons(this.m_navcontainer);this.ManageButtonState();var preview=this;this.m_slider.Init(function(newpos){preview.SliderCallback(newpos)});if(this.m_slideshowrunning){this.m_slideshowrunning=false}var firstload=true;if(this.m_hiddenimg.readyState=="complete"){firstload=false;
this.ImageLoad();if(isdiashow){this.SlideShow()}}this.m_hiddenimg.onload=function(){preview.ImageLoad();if(isdiashow&&firstload){preview.SlideShow();firstload=false}};fscjq(this.m_showhovercontainer).hover(function(){vappcleartimeout(preview.m_hover1timeout);preview.AnimateTop()},function(){preview.m_hover1timeout=window.setTimeout(function(){preview.AnimateTop(true)},2000)});var orgbottom=fscjq(this.m_container).css("bottom");fscjq(this.m_hovercontainer).hover(function(){vappcleartimeout(preview.m_hover2timeout);preview.AnimateBottom()},function(){g_vappactslider=null;preview.m_hover2timeout=window.setTimeout(function(){if(!vapptiploading&&!vappmenuisopen()&&!preview.IsSettingsVisible()){preview.AnimateBottom(true)}},2000)});this.m_navcontainer.onmouseover=function(){vappcleartimeout(preview.m_hover2timeout)};this.m_container.onmouseover=function(){vappcleartimeout(preview.m_hover2timeout);var img=window.event.srcElement;var title=preview.GetThumbTitle(img);if(title){var width=img.offsetWidth;preview.m_titlespan.innerHTML='<div style="min-width:'+(width-6)+'px">'+title+"</div>";preview.m_titlespan.style.left=img.offsetLeft-((preview.m_titlespan.offsetWidth-width)/2)+"px";preview.m_titlespan.style.top=img.offsetTop+img.offsetHeight-preview.m_titlespan.firstChild.offsetHeight+"px";vappsetwindowstatus(title)}};if(isdiashow){this.AnimateTop(true);this.AnimateBottom(true)}var firstimg;var selection=g_sellists[id];if(selection&&selection.ItemCount()>0){firstimg=selection.m_elems[0]}else{firstimg=this.m_container.getElementsByTagName("IMG")[0];if(firstimg){vappsellistitem(null,firstimg,false,this.m_portletid)}}if(firstimg){var preview=this;preview.ChangeImage(firstimg);firstimg.onload=function(){preview.CenterThumb(firstimg,1200)}}}function vapppreviewgetbtnkey(b){var a=b.src.split("/");return a[a.length-1].split(".")[0]}function vapppreviewsetargs(a,b){b.setAttribute("fscargs",a.getAttribute("fscargs"));b.setAttribute("fsctrargs",a.getAttribute("fsctrargs"))}function vapppreview(a){var d=a.id.split("FscThumbs").join("");var c=g_vapplistviews[d];var b=c.ChangeImage(window.event.srcElement);if(b){c.CenterThumb(b,1200)}}function vapppreviewnav(){var b=window.event.srcElement;if(b&&b.tagName=="IMG"){var a=vappgetparentbyclassname(b,"FscListPv",8);var c=a.id;g_vapplistviews[c].Navigate(b)}}function vapppreviewload(a,h,c,g,f,i,b,d,j,e){g_vapplistviews[a]=new VAPPPreview(a,h,c,g,f,i,b,d,j,e)}function VAPPCarousel(b){this.m_container=window.document.getElementById(b);this.m_firstidx=1;this.m_loaded=false;this.m_thumbs=this.m_container.getElementsByTagName("IMG");this.m_thumbcnt=this.m_thumbs.length;this.m_thumbwidth=new Array(0);this.m_thumbheight=new Array(0);this.m_thumbsvisible=new Array();this.GetIdx=function l(m){return parseInt(m.getAttribute("fsci"))};this.Init=function e(){this.m_containerwidth=this.m_container.offsetWidth;this.m_containerheight=this.m_container.offsetHeight;this.m_scalex=this.m_containerwidth/5;this.m_scaley=this.m_containerheight/7;this.m_shiftleft=this.m_containerwidth/2;this.m_shiftbottom=this.m_containerheight*0.32;var m=3;var p=Math.sqrt(this.m_containerwidth)/1.15-12;p=(p<m)?m:p;this.m_positions=new Array();this.m_positioncnt=(this.m_thumbcnt>p)?p:((this.m_thumbcnt<m)?m:this.m_thumbcnt);this.m_positionsodd=(this.m_positioncnt%2);this.m_positioncnt=(this.m_positioncnt-this.m_positioncnt%2)/2;this.m_positions.push([0,0,1,1]);var n=new Array();var o=0;var r=0;var w;for(var z=1;z<this.m_positioncnt+1;z++){w=Math.log(z+1)+0.5;n.push(w);r+=1/w}r=(this.m_positionsodd)?1/(r+1/(w*2.2)):1/r;var t=this.m_containerwidth/450;var q=this.m_positioncnt*this.m_positioncnt+this.m_positioncnt*t;for(var z=0;z<this.m_positioncnt;z++){o+=r*(Math.PI/n[z]);var v=2*Math.sin(o);var u=2*(Math.cos(Math.PI-o)+1);var A=((this.m_positioncnt-(z+1))*(this.m_positioncnt-(z+1))+this.m_positioncnt*t)/q;this.m_positions.push([v,u,A,A])}var s=this.m_positions[this.m_positioncnt];this.m_positionidle=[0,s[1],s[2],0]};this.Update=function k(){if(!g_isie6){if(this.m_containerwidth!=this.m_container.offsetWidth||this.m_containerheight!=this.m_container.offsetHeight){this.Init();for(var m=0;m<this.m_thumbcnt;m++){this.MoveThumb(this.m_thumbs[m],true)}}}};this.InitThumb=function f(n){var m=this.GetIdx(n);n.style.width="";n.style.height="";this.m_thumbwidth[m]=fscjq(n).width();this.m_thumbheight[m]=fscjq(n).height()};this.IsFirstThumb=function c(m){return(m&&this.GetIdx(m)==this.m_firstidx)};this.MoveThumb=function g(m,n){if(!m){m=this.m_thumbs[0]}if(m){var u;var p;var r;var t=this.GetIdx(m);var r=t-this.m_firstidx;if(r>this.m_positioncnt){r=((this.m_positioncnt*2-1)<this.m_thumbcnt)?r-this.m_thumbcnt:r-(this.m_positioncnt*2-1)}else{if(r<-this.m_positioncnt||(!this.m_positionsodd&&r==-this.m_positioncnt)){r=((this.m_positioncnt*2-1)<this.m_thumbcnt)?r+this.m_thumbcnt:r+(this.m_positioncnt*2-1)}}if(r>=0&&r<=this.m_positioncnt){u=this.m_positions[r];p=u[0]*this.m_scalex;this.m_thumbsvisible[t]=true}else{if(r<0&&(r>-this.m_positioncnt||(this.m_positionsodd&&r==-this.m_positioncnt))){u=this.m_positions[0-r];
p=0-u[0]*this.m_scalex;this.m_thumbsvisible[t]=true}else{u=this.m_positionidle;p=u[0]*this.m_scalex;if(!this.m_thumbsvisible[t]&&!n){return}this.m_thumbsvisible[t]=false}}var q=this.m_thumbwidth[t]*u[2];var s=this.m_thumbheight[t]*u[2];p+=this.m_shiftleft-q/2;var o=u[1]*this.m_scaley+this.m_shiftbottom-s/2;m.style.zIndex=(r>0)?2300-r:2300+r;if(n){if(!isNaN(q)&&!isNaN(s)&&!isNaN(p)&&!isNaN(o)){m.style.width=q+"px";m.style.height=s+"px";m.style.left=p+"px";m.style.bottom=o+"px";vappsetopacity(m,u[3])}}else{fscjq(m).animate({width:q+"px",height:s+"px",left:p+"px",bottom:o+"px",opacity:u[3]},{duration:1500,queue:false})}if(t==this.m_thumbcnt){this.m_loaded=true}}};this.Rotate=function j(n){if(this.m_loaded&&n&&n.tagName=="IMG"){this.m_firstidx=this.GetIdx(n);for(var m=0;m<this.m_thumbcnt;m++){this.MoveThumb(this.m_thumbs[m])}}};this.Init();var i=g_sellists[b];if(i&&i.ItemCount()){this.m_firstidx=this.GetIdx(i.m_elems[0])}var d=this;for(var h=0;h<this.m_thumbcnt;h++){this.m_thumbwidth.push(0);this.m_thumbheight.push(0);var a=this.m_thumbs[h];if(a.readyState=="complete"){d.InitThumb(a);d.MoveThumb(a,true)}else{a.onload=function(){d.InitThumb(this);d.MoveThumb(this,true)}}}}function vappcarousel(b){var c=g_vapplistviews[b.id];if(c&&window.event){var a=window.event.srcElement;if(c.IsFirstThumb(a)){if(a.ondblclick){a.ondblclick()}else{vappopenobject(new VAPPArgs(a))}}else{c.Rotate(a)}}}function vappcarouselload(a,c){if(a){g_vapplistviews[c]=new VAPPCarousel(c)}else{var b=g_vapplistviews[c];if(b){b.Update()}}}function ListViewHeadTool(e,c){if(c){var d=c.GetMessage(),a=c.GetNavigation(),f=c.GetSelectTool();if(this.isprint){if(d&&!this.ispreview&&!this.iscarousel){e.Push('<div class="FscMsg">');if(a){var h=Math.ceil(parseInt(a.GetRowindex())/parseInt(a.GetRowsperpage()))+1;e.Push(a.GetPreinputtext()+h+a.GetPostinputtext()+"&nbsp;")}e.Push("["+d+"]</div>")}}else{if(!this.isdiashow&&(d||c.GenericBranchCount()>0||a||f)){vappsetaccinfobyident(e,FSC_STRBUTTONBAR,null,2);e.Push('<div id="FscTB'+this.listid+'" class="FscTB">');var b=c.GetMenu();if(b){this.Dispatch(e,b.GetCtrlXmlDom(),null,this.portletid)}this.BranchGenericButtons(e,c);e.Push('<div class="FscNav');if(!a){e.Push(" FscSimpleNav")}e.Push('">');this.ListViewFilterStat(e,c.GetFilterStat());if(f){if(this.pagetype==FSCVAPP_EXPLORE&&vapphaspaneheader()&&!g_isie6&&!g_isie7){var j=new BufferedOutput(),i=this.portletid;this.ListViewSelectTool(j,f);vapppushonload(function(){var k=vappgetelementbyid("FscPageBr",i);if(k){k.innerHTML+=j.PopAll()}},this.portletid)}else{this.ListViewSelectTool(e,f)}}if(a||d){var g=this.IsAggrList();navclass=(g)?"FscNavBlock":"FscBtBlock";e.Push('<span class="'+navclass+'">');if(a){e.Push('<span class="FscNavigation">');this.ListViewNavBranches(e,a.GetNavigationHead());this.ListViewNavInput(e,a);this.ListViewNavBranches(e,a.GetNavigationTail());e.Push("</span>")}else{if(!g){e.Push("<span></span>")}}if(d){e.Push('<span class="FscMenu"><span>'+d+"</span></span>");this.rows=parseInt(d.split(" ")[0])}e.Push("</span>")}e.Push("</div></div>");if(this.isthumb||!this.iscarousel){e.Push('<div id="FscListDisp'+this.listid+'" class="FscListDisp FscHidden"></div>')}}}}}function ListViewSelectTool(a,b){this.qskey=b.GetQskey();g_renderlater["f"+this.listid]=this;a.Push('<div class="FscSelectTool FscDisabled">');if(b.GetIsmbzsearch()==1){var c=(this.qskey=="mindbreeze")?"COO.1.1001.1.87967":"COO.1.1001.1.87969",d=(this.qskey=="mindbreeze")?"Mindbreeze":g_suitename;a.Push('<img src="../tmp/'+c+'.gif" class="FscSelectTool" onclick="return vappsetsearchengine(this, \''+this.listid+'\');" title="'+d+'" alt="'+d+'" />')}vappsetstrings([FSC_STRSEARCH,FSC_STRFINDNOW]);this.BaseSB(a,"f"+this.id,null,null,null,null,null,true,vappgetstring(FSC_STRSEARCH));a.Push('<img src="../tmp/COO.1.1.1.16283.gif" class="FscLink" title="'+vappgetstring(FSC_STRFINDNOW)+'" onmousedown="vappqssearch(\'f'+this.listid+"', this)\"/></div>")}function ListViewNavBranches(c,b){if(b){for(var d=0,a=b.GenericBranchCount();d<a;d++){if(g_vappis24hrec){this.BranchGenericBranch24(vapp24listviewbranch,this.id+"|BUTTONBAR",c,b.GetGenericBranch(d),null,"FscBtTb",true)}else{this.BranchGenericBranch(c,b.GetGenericBranch(d),null,"FscBtTb",true)}}}}function ListViewNavInput(c,e){this.rowindex=parseInt(e.GetRowindex());this.rowsperpage=parseInt(e.GetRowsperpage());this.totalrows=parseInt(e.GetRowcount());var b=Math.ceil(this.rowindex/this.rowsperpage)+1;var a=e.GetPreinputtext();c.Push('<span class="FscSmall">');if(a){c.Push(a)}c.Push('<input type="text" onkeydown="return vappnavkeydown(this)" value="'+b+'"/>');var d=e.GetPostinputtext();if(d){c.Push(d)}c.Push("</span>")}function ListViewFilterStat(a,b){if(b){if(b._text){a.Push('<img src="../tmp/'+b.GetIdentimage()+'.gif" alt="'+MaskValue(b._text)+'" class="Fsc16" />')}this.filter=b.GetValue();this.filters=b.GetFilters()}}function ListViewRenderPart(){var d=this.requestarg.split(":"),f=d[0];if(this.ctrlname=="Menu"){var g=new VAPPMenu(this.ctrldata),b=this.GetFscArgs();
g.Show(this.refelem,null,null,b.GetStr(),this.id);if(f=="SETTINGSMENU"){g.SetRoot(f)}}else{if(this.ctrlname=="EditObject"){var a=this.RenderPartSB(this.output,this.ctrldata);vappsbqsresult(this.requestarg,"f"+this.listid,a,true,this.filter)}}if(f=="FIX_COLUMN"||f=="UNFIX_COLUMN"){var e=(f=="FIX_COLUMN")?vappgetnumber(d[1]):null,c=g_vapplistviews[this.listid];if(c){if(null!=e){e=(e<this.emptycolcount)?null:e+this.emptycolcount}c.FixedColsUpdate(e,this.colwidth)}}}function ListViewGetContainer(){if(!this.container){var a=window.document.getElementsByName("skip"+this.listid)[0];if(a){this.container=a.parentElement}}return this.container}function ListViewGetColIdx(c){for(var a=0,b=this.colids.length;a<b;a++){if(this.colids[a]==c){return a}}}function ListViewColMenu(b){var a=parseInt(b.getAttribute("fsci"));this.refelem=b;return vappctrl(this.id,"COLMENU:"+a+"|"+this.colids[a],this)}function ListViewUpdateColWidth(b,a){var d=Math.round(a/vappgetemfactor()),c=g_vapplistviews[this.listid];this.colwidth[b+this.colwidth.length-this.colids.length]=d+"em";if(c&&c.HasFixedCols()){c.m_colwidthpx[b+this.emptycolcount]=a;c.FixedColsLayout()}return vappctrl(this.id,"RESIZE_COLUMN:"+this.colids[b]+"|"+d,this)}function ListViewGetFscArgs(){if(null==this.fscargs){var a=vappgetportletobject(this.portletid)+";;;"+this.data.GetView()+";"+this.data.GetFscargs();this.fscargs=new VAPPArgs(null,a,window.document.getElementById(this.listid))}return this.fscargs}function VAPPListView(m,n,r,o,k,l){this.m_id=m;this.m_portletid=n;this.m_thumbscale=r;this.m_thumbwidth=o;this.m_thumbheight=k;this.m_resid=l;this.SetSettingsVisible=function(){};this.GetSize=function p(){return this.m_thumbscale};this.SetSize=function f(u){if(!this.m_style){this.m_style=vappgetportletstyle(this.m_portletid)}if(this.m_style){var t,s;if(null!=u&&u!=this.m_thumbscale){t="max-width:"+this.m_thumbwidth+"px;max-height:"+this.m_thumbheight+"px;";this.m_thumbwidth=(this.m_thumbwidth/this.m_thumbscale)*u;this.m_thumbheight=(this.m_thumbheight/this.m_thumbscale)*u;this.m_thumbscale=u}s="max-width:"+this.m_thumbwidth+"px;max-height:"+this.m_thumbheight+"px;";this.m_style.AddEx("#FscL"+m+" DIV.FscThumbList IMG",s,t);this.m_style.Apply()}};this.SaveSettings=function h(s){this.m_saveidx=vapplistsavesettings("THUMB_SELECT:|"+this.m_thumbscale+"|",this.m_id,this.m_saveidx,s)};this.FixedColsInit=function g(y,A){this.m_fixedcolidx=y;this.m_hiddencolidx=vappgetbrowserinfo(this.m_listid,this.m_portletid);if(null==this.m_hiddencolidx){this.m_hiddencolidx=y}this.m_resizeelem=vappgetelementbyid(this.m_resid,this.m_portletid);this.m_scrollbar=document.getElementById("FscScrollBar"+this.m_id).firstChild;this.m_scrollbarelem=this.m_scrollbar.firstChild;this.m_colelems=this.m_resizeelem.getElementsByTagName("COL");this.m_head=document.getElementById("FscListHead"+this.m_id);this.m_headelems=this.m_head.childNodes;this.m_colwidthpx=[];var v,B=A.length-this.m_headelems.length,s=this.m_colelems.length;if(g_issafari){var u=vappgetelementbyid(this.m_id,this.m_portletid).rows;for(var z=0,t=u.length;z<t;z++){if(u[z].children.length>=s){this.m_firstrowelems=u[z].children;break}}}for(var z=0,x=this.m_headelems.length;z<x;z++){v=this.m_headelems[z];this.m_colwidthpx[z]=v.offsetWidth;if(z<=this.m_fixedcolidx){vappaddclass(v,"FscColFixed")}else{if(z<=this.m_hiddencolidx){this.FixedColsSetWidth(z,true)}}}vappaddclass(this.m_resizeelem,"FscFixedCol");this.m_scrollbar.parentElement.className="FscScrollBar";this.m_scrollbar.style.height=vappgetscrollbarheight()+"px";vapppushscrollareas("FscScrollBar"+this.listid,this.portletid);var w=this;vapppushbrowserinfofunc(function(){return w.m_hiddencolidx},this.m_listid,this.m_portletid);vapppushonlayout(function(){w.FixedColsLayout()},this.m_portletid)};this.FixedColsUpdate=function q(v,u){if(null!=v){if(this.m_scrollbar){this.m_fixedcolidx=v;if(this.m_hiddencolidx>this.m_fixedcolidx){this.m_hiddencolidx=this.m_fixedcolidx}for(var t=0,s=this.m_headelems.length;t<s;t++){var w=this.m_headelems[t];if(t<=this.m_fixedcolidx){vappaddclass(w,"FscColFixed");this.FixedColsSetWidth(t)}else{vappremoveclass(w,"FscColFixed");if(t<=this.m_hiddencolidx){this.FixedColsSetWidth(t,true)}}}vappaddclass(this.m_resizeelem,"FscFixedCol");this.m_scrollbar.parentElement.className="FscScrollBar"}else{this.FixedColsInit(v,u)}this.m_resizeelem.scrollLeft=0;this.FixedColsLayout()}else{for(var t=0,s=this.m_headelems.length;t<s;t++){if(t<=this.m_fixedcolidx){vappremoveclass(this.m_headelems[t],"FscColFixed")}else{this.FixedColsSetWidth(t)}}vappremoveclass(this.m_resizeelem,"FscFixedCol");this.m_scrollbar.parentElement.className="FscHidden";this.m_fixedcolidx=null;this.m_hiddencolidx=null}vappadjustlayout(this.m_portletid)};this.HasFixedCols=function a(){return(null!=this.m_fixedcolidx)?true:false};this.FixedColsLayout=function e(){var u=0,v=0,w=0;for(var t=0,s=this.m_colwidthpx.length;t<s;t++){if(t<this.m_fixedcolidx+1){u+=this.m_colwidthpx[t]}else{v+=this.m_colwidthpx[t]}}v+=this.m_colwidthpx[this.m_colwidthpx.length-1];
w=this.m_resizeelem.clientWidth-u;this.m_scrollbar.style.marginLeft=u+"px";this.m_scrollbar.style.width=(w>0)?w+"px":"0px";this.m_scrollbarelem.style.width=v+"px";if(this.m_hiddencolidx>this.m_fixedcolidx){this.FixedColsShiftBar()}};this.FixedColsFocus=function b(t,w){if(w>this.m_fixedcolidx){var v=this.m_resizeelem.clientWidth,s=t.offsetWidth+t.offsetLeft,u=this.m_hiddencolidx;while(w>u+1&&s>v){u++;s-=this.m_colwidthpx[u]}while(w<=u){u--;s+=this.m_colwidthpx[u]}this.FixedColsShift(u,true)}};this.FixedColsSetWidth=function c(s,t){var u=(t)?"0px":this.m_colwidthpx[s]+"px";this.m_colelems[s].style.width=u;this.m_headelems[s].style.width=u;if(g_issafari){this.m_firstrowelems[s].style.width=u}};this.FixedColsShift=function d(t,s){if(t<this.m_fixedcolidx){t=this.m_fixedcolidx}else{if(t>this.m_colwidthpx.length-2){t=this.m_colwidthpx.length-2}}if(this.m_hiddencolidx<this.m_fixedcolidx){this.m_hiddencolidx=this.m_fixedcolidx}if(t!=this.m_hiddencolidx){while(this.m_hiddencolidx<t){this.m_hiddencolidx++;this.FixedColsSetWidth(this.m_hiddencolidx,true)}while(this.m_hiddencolidx>t){this.FixedColsSetWidth(this.m_hiddencolidx);this.m_hiddencolidx--}if(s){this.FixedColsShiftBar()}}};this.FixedColsShiftBar=function i(){var t=0;for(var s=this.m_fixedcolidx;s<this.m_hiddencolidx;s++){t+=this.m_colwidthpx[s+1]}window.g_vappignorescroll=true;this.m_scrollbar.scrollLeft=t};this.FixedColsScroll=function j(){var u=this.m_scrollbar.scrollLeft,v=this.m_fixedcolidx;for(var t=this.m_fixedcolidx+1,s=this.m_colwidthpx.length;t<s&&u+17>this.m_colwidthpx[t]/2;t++){u-=this.m_colwidthpx[t];v++}this.FixedColsShift(v,false)}}function vappfixedcolsscroll(a){if(window.g_vappignorescroll){window.g_vappignorescroll=false}else{g_vapplistviews[a].FixedColsScroll()}}function vappfixedcolsfocus(a){if(g_selection){var b=g_vapplistviews[g_selection.GetListId()];if(b&&b.HasFixedCols()){b.FixedColsFocus(a,g_selection.GetColIdx())}}}function vappsetsearchengine(b,a){var c=g_renderlater[a];if(c){vappenablesb(b);if(c.qskey=="mindbreeze"){c.qskey="fsc";b.src=b.src.split("COO.1.1001.1.87967").join("COO.1.1001.1.87969");b.title=g_suitename;b.alt=g_suitename}else{c.qskey="mindbreeze";b.src=b.src.split("COO.1.1001.1.87969").join("COO.1.1001.1.87967");b.title="Mindbreeze";b.alt="Mindbreeze"}}}function vappismbzsearch(b){var a=g_renderlater[b];return(a)?a.qskey=="mindbreeze":false}function vapplistsettingsmenu(a){var b=vappgetlist(a);b.refelem=a;vappctrl(b.id,"SETTINGSMENU:"+b.data.GetThumbview()+"|"+b.filter+"|"+b.filters,b);return false}function vappstartdiashow(c,a){var b=vappbaseurl()+"&ax=COO.1.1001.1.239677&venv_object="+c+"&venv_view="+a+"&ru=javascript:window.close()";window.open(b,"",vappgetfullscreenargs())}function vappnavtopage(b,a){if(b>=0&&b<a.totalrows){return vapp(5002,a.id,"NAV_SELECTPAGE:"+b)}}function vappnavigation(b,a,e){if(null==a){a=g_isctrl}var c=(e)?g_renderlater[e]:vappgetlist(window.event.srcElement);if(c&&null!=c.rowsperpage){var d;if(a){d=(b)?0:(Math.ceil(c.totalrows/c.rowsperpage)-1)*c.rowsperpage;window.event.cancelBubble=true;window.event.returnValue=false}else{d=(b)?c.rowindex-c.rowsperpage:c.rowindex+c.rowsperpage}vappsetg_focusfieldid(c.listid);vappnavtopage(d,c)}}function vappnavkeydown(e){var a=window.event;if(a.keyCode==13){var d=vappgetlist(e),c=e.value;if(g_vappis24hrec){vapp24setinfo("DataNavSelectpage",d.id,"BUTTONBAR||0",c);g_vapp24keypresshandled=true}a.cancelBubble=true;a.returnValue=false;if(c){if(c.charAt(0)=="/"){var b=c.split("/")[1];if("0"<=b.charAt(0)&&b.charAt(0)<="9"){return vapp(5002,d.id,"NAV_PAGESIZE:"+b)}else{if("a"==b.charAt(0).toLowerCase()){return vapp(5002,d.id,"NAV_PAGESIZE:2500")}else{if("d"==b.charAt(0).toLowerCase()){return vapp(5002,d.id,"NAV_PAGESIZE:-1")}}}}else{if(c>0){return vappnavtopage((parseInt(c)-1)*d.rowsperpage,d)}}}}}function vapplistgetprevrow(b,a){while(b&&(b.children.length!=a||b.className=="FscHiddenRow")){b=b.previousSibling}return b}function vapplistgetnextrow(b,a){while(b&&(b.children.length!=a||b.className=="FscHiddenRow")){b=b.nextSibling}return b}function vapplistgetfirstrow(a){return vapplistgetnextrow(g_selection.GetItems(true)[0],a)}function vapplistgetlastrow(b){var a=g_selection.GetItems(true);return vapplistgetprevrow(a[a.length-1],b)}function vapplistgetprevcol(b,a){while(!vapphasclass(a,"L")){if(a){a=a.previousSibling}if(!a){b=b.previousSibling;if(b){a=b.children[b.children.length-2]}else{break}}}return a}function vapplistgetnextcol(b,a){while(!vapphasclass(a,"L")){if(a){a=a.nextSibling}if(!a){b=b.nextSibling;if(b){a=b.firstChild}else{break}}}return a}function vapplistnav(k,g){if(!vappiseditableelem(k.srcElement)){var d=g_selection.GetLastItem(),e=false;if(!d){d=g_selection.GetItems(true)[0];e=true}if(d){var f=true,c,l=g_selection.GetRowElem(d);if(g_selection.IsThumb()||g_selection.IsSimple()){return}if(g==FSC_UP||g==FSC_DOWN){var h=l.children.length;if(g==FSC_UP){l=(g_isctrl)?vapplistgetfirstrow(h):vapplistgetprevrow(l.previousSibling,h)}else{var j=(e)?l:l.nextSibling;
l=(g_isctrl)?vapplistgetlastrow(h):vapplistgetnextrow(j,h)}c=g_selection.SelectListItem(l,!g_isshift)}else{if(g==FSC_RIGHT||g==FSC_LEFT){if(d==l){d=g_selection.GetCellElem(l)}var b;if(g_isshift){g_selection.SelectItemLines()}else{if(g==FSC_RIGHT){b=(g_isctrl)?vapplistgetprevcol(l,l.lastChild):vapplistgetnextcol(l,d.nextSibling)}else{b=(g_isctrl)?vapplistgetnextcol(l,l.firstChild):vapplistgetprevcol(l,d.previousSibling)}if(b){g_selection.SetColumn(b,l);c=g_selection.SelectListItem(l,true)}}}else{if(g==FSC_POS1||g==FSC_END){if(g_isctrl){vappnavigation(g==FSC_POS1,true,g_selection.GetListId())}else{var h=l.children.length;l=(g==FSC_POS1)?vapplistgetfirstrow(h):vapplistgetlastrow(h);g_selection.SetColumn(vapplistgetnextcol(l,l.firstChild),l);c=g_selection.SelectListItem(l,!g_isshift)}}else{if(g==FSC_PAGEUP||g==FSC_PAGEDOWN){if(g_isctrl){vappnavigation(g==FSC_PAGEUP,false,g_selection.GetListId())}else{f=false}}}}}if(c){if(c==l){c=g_selection.GetCellElem(l)}var i=c.getElementsByTagName("A")[0];if(vappisselectbox(i)){i=null}if(!i){for(var a=c.firstChild;null!=a;a=a.nextSibling){if(a.getAttribute&&null!=a.getAttribute("tabindex")){i=a;break}}}if(!i){i=c;if(g_ismoz){f=false}}vappfixedcolsfocus(c);i.focus()}}if(f){k.cancelBubble=true;k.returnValue=false}}}function vappadjustlistheader(a){var b=a.previousSibling;if(b){b.style.marginLeft=-a.scrollLeft+"px"}}function vappadjustlistheadercols(d,g,f){var c=vappgetelementbyid(d,f);if(c){var e,i=g.children,a=i.length;for(var h=0,b=c.rows.length;h<b;h++){if(c.rows[h].children.length>=a){e=c.rows[h].children;break}}if(e){if(g_issafari){for(var h=0;h<a;h++){e[h].style.width=i[h].offsetWidth+"px"}}else{for(var h=0;h<a;h++){i[h].style.width=e[h].offsetWidth+"px"}}}}}function vapplistheadmouseover(){if(!g_vappreselem&&!window.g_vapppopupcomp){vappcolsettool()}}function vapplistheadmousedown(m,b){if(!m){m=window.event}var i=m.srcElement;if(i&&i.className=="FscColRes"){var a=i.parentElement,f,k=a.parentElement,d=vappgetlistidbyhead(k),n=vappgetelementbyid(d),j=n.getElementsByTagName("COL"),e=a.getAttribute("fsci");for(var l=0,c=j.length;l<c;l++){if(j[l].getAttribute("fsci")==e){f=j[l];break}}var o,h=n.parentElement;if(g_isie6||g_isie7||g_issafari){o=function(){vappadjustlistheader(h);vappadjustlistheadercols(d,k);if(h.className=="FscEntryScroll"){vappadjustscrollentry(this.m_container)}else{vappresizeelem(h,vappgetcontainerid())}}}else{o=function(){vappadjustlistheader(h)}}var g=function(p){vapplistcolresizeend(p)};g_vappreselem=new VAPPResizeElement(m,a,f,null,true,o,g,10)}}function vapplistcolresizeend(a){var b=g_vappreselem.GetElem(),c=vappgetlistbyhead(b.parentElement);return c.UpdateColWidth(parseInt(b.getAttribute("fsci")),a)}function vappcolsettool(d){var b=vappgetparentbyclassname(window.event.srcElement,"FscColCaption",5);if(b&&!vapphasclass(b,"FscColFixed")){var c=b.getElementsByTagName("SPAN");for(var a=c.length-1;a>=0;a--){var e=c[a];if(vapphasclass(e,"FscColSet")){(d)?vappaddclass(e,"FscInvisible"):vappremoveclass(e,"FscInvisible");break}}}}function vappgetcolstr(d){var b="",e=d.GetColIds();for(var a=0,c=e.length;a<c;a++){b+=e[a];if(a<c-1){b+=":"}}return b}function vappselectcolumn(n,c){var j=window.event.srcElement,m=vappgetlistbyhead(vappgetparentbyclassname(j,"FscListHead",10));if(m){var a=m.GetId()+";"+n+";"+vappgetcolstr(m)+";";vappinitselection(m.GetListId());if(g_selection){va