var DebugBreak=null;var g_isSpaixWindow=true;var g_topWindow=GetTopWindow();var g_topDocument=g_topWindow.document;var SCROLLBAR_WIDTH=17;function IsMSIE(){var a=navigator.userAgent;return(0<=a.indexOf("MSIE"))&&(0<=a.indexOf("Mozilla"))}function GetVersionMSIE(){var b=-1;var a=navigator.userAgent.indexOf("MSIE");if(a>=0){b=navigator.userAgent.substring((a+5),(a+6))}return b}function IsGecko(){return(0<=navigator.userAgent.indexOf("Gecko"))}function IsFirefox(){return(0<=navigator.userAgent.indexOf("Firefox"))}function IsOldMS(){var a=GetVersionMSIE();return((0<a)&&(4>a))}function IsNets(){var a=navigator.userAgent.indexOf("MSIE");return((a==-1)||(navigator.userAgent.indexOf("Windows")==-1))}function IsNS6(){return("function"==typeof document.getElementById)}function GetInternetExplorerVersion(){if("Microsoft Internet Explorer"!=navigator.appName){return -1}var a=navigator.userAgent;var b=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(b.exec(a)!=null){return parseFloat(RegExp.$1)}return -1}function UpdateUnloadHandler(a){if("undefined"!=typeof UpdateUnloadHandlerEventOverrides){UpdateUnloadHandlerEventOverrides(a)}}function Assigned(a){return(("undefined"!=typeof a)&&(null!=a))}function IsFunction(a){return("function"==typeof a)}function IsBoolean(a){return("boolean"==typeof a)}function F_(a){ASSERT(false,'Error! Token "'+a+'" not replaced. (Available in JavaScript file?)');alert("Internal Error occured. Please contact your adminstrator.")}function CheckRadio(b,f){var e,c,g;var d=false;var a=DecodeString(f);for(c=0;c<b.length;++c){e=b[c];g=((f==e.value)||(a==e.value));e.checked=g;d=d||g}if(!d){if(0<b.length){b[0].checked=true}}}function SetLayerContent(a,b){if(IsNS6()){a.innerHTML=b}else{if(IsNets()){a.document.clear();a.document.write(b);a.document.close()}else{a.innerHTML=b}}if(""!=b){UpdateUnloadHandler(a)}}function GetLayerContent(a){return a.innerHTML}function SetLayerHtml(a,b,d,c){var e=findLayer(a,b);if(null!=e){SetLayerContent(e,d)}else{if(g_bDebug){if(("boolean"!=typeof c)||(!c)){if(!ConfirmBox("Internal error:\nSetLayerHtml('"+b+"'): DIV not found!\n\nContinue?")){DebugBreak()}}}}}function GetLayerHtml(a,b){var c="";var d=findLayer(a,b);if(null!=d){c=GetLayerContent(d)}return c}function ShowLayerHideOthers(d,a){if(null!=a){var c="";for(var b=0;b<a.length;b++){c=a[b];if(c!=d){hide(c)}}}show(d)}function showLayer(b,a){ASSERT(""!=b);if(a){show(b)}else{hide(b)}}function SetIFrameUrl(c,a){var b=frames[c];if(!b){b=findScriptElement(c)}SuspendUnloadHandler();if(b.src){b.src=a}else{if((b.location)&&(b.location.href)){b.location.href=a}else{ErrorBox("SetIFrameUrl() failed")}}ResumeUnloadHandler()}function SetSrc(b,a){if(!b){return}switch(String(typeof a).toLowerCase()){case"string":if(""!=a){b.src=a}break;case"undefined":break;default:ASSERT(false);break}}function show(a){ASSERT(""!=a);var b;if(document.getElementById){b=document.getElementById(a);if((null!=b)&&(null!=b.style)){b.style.visibility="visible"}}else{if(null!=document.layers){b=document.layers[""+a];if(null!=b){b.visibility="show"}}else{if(null!=document.all){b=document.all[""+a];if((null!=b)&&(null!=b.style)){b.style.visibility="visible"}}}}}function hide(a){ASSERT(""!=a);var b;if(document.getElementById){b=document.getElementById(""+a);if((b!=null)&&(null!=b.style)){b.style.visibility="hidden"}}else{if(null!=document.layers){b=document.layers[""+a];if(b!=null){b.visibility="hide"}}else{if(null!=document.all){b=document.all[""+a];if((b!=null)&&(b.style!=null)){b.style.visibility="hidden"}}}}}function IsVisible(b){ASSERT(""!=b);var a;if(document.getElementById){a=document.getElementById(""+b);if((a!=null)&&(null!=a.style)){return !("hidden"==a.style.visibility)}}else{if(null!=document.layers){a=document.layers[""+b];if(a!=null){return !("hide"==a.visibility)}}else{if(null!=document.all){a=document.all[""+b];if((a!=null)&&(a.style!=null)){return !("hidden"==a.style.visibility)}}}}return}function GetObj(a){if(document.getElementById){return document.getElementById(a)}else{if(null!=document.layers){return document.layers[""+a]}else{if(null!=document.all){return document.all[""+a]}}}return null}function IsDisabled(b){ASSERT(""!=b);var a=GetObj(b);if(null!=a){return a.disabled}else{ASSERT(false)}}function SetDisabled(c,b){ASSERT((""!=c)&&("boolean"==typeof b));if((""==c)||("boolean"!=typeof b)){return}var a=GetObj(c);if(null!=a){a.disabled=b}else{ASSERT(false)}}function EnableInputFld(b){ASSERT(""!=b);var a=GetObj(b);if(null!=a){a.disabled=false;RemoveCssClass(a,"disabled")}}function DisableInputFld(b){ASSERT(""!=b);var a=GetObj(b);if(null!=a){a.disabled=true;AddCssClass(a,"disabled")}}function FitWidthPdfIFRAME(){if(("undefined"!=typeof pumpdata)&&(null!=pumpdata)){var a=pumpdata.document.getElementById("PDF");if((null!=a)&&("undefined"!=typeof a)){a.width="100%"}}}function ReduceWidthPdfIFRAME(){if(("undefined"!=typeof pumpdata)&&(null!=pumpdata)){var b=pumpdata.document.getElementById("PDF");if((null!=b)&&("undefined"!=typeof b)){var c=document.getElementById("hint");var a=document.getElementById("p_pagebtns");if((null!=c)&&(null!=a)&&("undefined"!=typeof c)&&("undefined"!=typeof a)){b.width=c.offsetLeft-a.offsetWidth;b=pumpdata.document.getElementById("content");if((null!=b)&&("undefined"!=typeof b)){b.style.textAlign="left"}}}}}function loadForms(){for(var a=0;a<document.forms.length;++a){loadFormSettings(document.forms[a])}}function saveForms(){for(var a=0;a<document.forms.length;++a){saveFormSettings(document.forms[a])}}function loadFormSettings(c){var f,a;for(var d=0;d<c.elements.length;d++){var e=c.elements[d];if((null!=e)&&(null!=e.name)&&("L__LGG"!=e.name)&&("hidden"!=e.type)){a=getCookieValue(e.name);if(null!=a){if(null!=e.value){e.value=a}else{for(var b=0;b<e.options.length;b++){e.options[b].selected=(e.options[b].value==a)}if(0>e.selectedIndex){e.selectedIndex=0}}}}}}function copyFormValues(a,f){if((null==a)||(null==f)){return}var b=null;var d,l,h,g;for(var e=0;e<a.elements.length;e++){b=a.elements[e];if((null!=b)&&(null!=b.name)&&("hidden"!=b.type)){l=b.name;h=b.value;if((null==h)&&(null!=b.options)){h=b.options[b.selectedIndex].value}if(null==h){continue}for(d=0;d<f.elements.length;d++){g=f.elements[d];if((null!=g)&&(g.name==l)){if(null!=g.value){g.value=b.value}else{for(var c=0;c<b.options.length;c++){g.options[c].selected=(b.options[c].value==h)}}}}}}}function SubmitForm(a,c,b,d){if(!a){ASSERT(false);return}if(c){a.method=c}if(b){a.target=b}if(a.encoding){a.encoding="application/x-www-form-urlencoded"}if(("undefined"==typeof d)||d){SaveFormValues(a)}if("undefined"!=typeof SetFormDataUniquifier){SetFormDataUniquifier(a)}a.submit()}function SaveFormValues(a){if((a)&&(window)&&(window.external)&&("undefined"!=typeof window.external.AutoCompleteSaveForm)){window.external.AutoCompleteSaveForm(a)}}var cCookieValue_Praefix="AAA_";function getCookieValue(g,e){var f=null;if(navigator.cookieEnabled&&(document.cookie.length>0)){var b=document.cookie.split(";");var a,c,d;for(a=0;a<b.length;++a){c=b[a].split("=");if(2>c.length){continue}d=DeleteAll(c[0],/\s/);if((e)&&(d==cCookieValue_Praefix+g)){return unescape(c[1])}else{if(d==g){f=unescape(c[1])}}}}return f}function GetCookieValueEx(d,c,b){var a=getCookieValue(d,b);if((a)&&(null!=a)){return a}return c}function setCookieValue(d,c,e){if(!navigator.cookieEnabled){return}if(e){d=cCookieValue_Praefix+d}var b=new Date();var a=new Date();a.setTime(b.getTime()+1000*60*60*24*14);document.cookie=d+"="+SafeEscape(c)+"; expires="+a.toGMTString()+";"}function saveFormSettings(c){var b="";var a;if((null==c)||(null==c.elements)){return false}for(var d=0;d<c.elements.length;d++){if((c.elements[d]!=null)&&(c.elements[d].name!=null)&&(c.elements[d].name!="L__LGG")){a=c.elements[d].value;if((a==null)&&(c.elements[d].options!=null)){a=c.elements[d].options[c.elements[d].selectedIndex].value}setCookieValue(c.elements[d].name,escape(a))}}return true}function GetFormData(a){var c="";var d=null;for(var b=0;b<a.elements.length;b++){d=a.elements[b];if(null!=d){if(""!=c){c+="&"}c+=d.name+"="+SafeEscape(d.value)}}return c}function SetFormValue(a,d,c){var b=findScriptFormElement(a,d);if(null!=b){b.value=c}else{AlertBox("script error: form '"+a.name+"' element '"+d+"' missing [Code 0001]")}}function RestoreFormValueFromCookie(d,a,b){var c=getCookieValue(d);if(null!=c){SetFormValue(a,b,c)}}function GetFormValue(a,c){var b=findScriptFormElement(a,c);if(null!=b){return b.value}AlertBox("script error: form '"+a.name+"' element '"+c+"' missing [Code 0002]");return""}function findScriptFormElement(b,a){if((null!=b)&&(b.getElementById)){return b.getElementById(a)}if((null==b)||(0==b.elements.length)){return null}var d=null;d=b.elements[a];if("object"==typeof d){if((null!=d)&&(d.name==a)){return d}}for(var c=0;c<b.elements.length;c++){d=b.elements[c];if((null!=d)&&(d.name==a)){return d}}return null}function findScriptElement(d,c){if(!c){c=document}if(!c){return null}var b=null;var a;if(c[d]){b=c[d];if(null!=b){return b}}if(null!=c.layers){b=c.layers[d];if(null!=b){return b}for(a=0;a<c.layers.length;a++){b=findScriptElement(d,c.layers[a].document);if(null!=b){return b}}}if(null!=c.all){b=c.all(d);if(null!=b){return b}}if(c.getElementById){b=c.getElementById(d);if(null!=b){return b}}if((null!=c.forms)&&(0<c.forms.length)){for(a=0;a<c.forms.length;a++){if(c.forms[a]==d){return c.forms[a]}b=findScriptFormElement(c.forms[a],d);if(null!=b){return b}}}return null}function jsColToPasCol(a){if(null==a){return""}if(7==a.length){return"$"+a.substring(5,7)+a.substring(3,5)+a.substring(1,3)}return a}function getObj(b,d){var e=d==null?document:d;var a;if(e.getElementById){return e.getElementById(b)}else{if(document.all!=null){return e.all(b)}else{if(e.layers!=null){for(a=0;a<e.images.length;a++){if(e.images[a].name==b){return e.images[a]}}if(e.layers[""+b]!=null){return e.layers[""+b]}var c=findScriptElement(b,d);if(c!=null){return c}for(a=0;a<e.layers.length;a++){if(e.layers[a].name==b){return e.layers[a]}c=getObj(b,e.layers[a].document);if(c!=null){return c}}}}}}function _getObj(b,c){var d=c==null?document:c;var a;if(d.layers!=null){for(a=0;a<d.images.length;a++){if(d.images[a].name==b){return d.images[a]}}if(d.layers[""+b]!=null){return d.layers[""+b]}aChild=findScriptElement(b,c);if(aChild!=null){return aChild}for(a=0;a<d.layers.length;a++){if(d.layers[a].name==b){return d.layers[a]}aChild=getObj(b,d.layers[a].document);if(aChild!=null){return aChild}}}else{if(d.all!=null){return d.all(b)}}}function getFrameChild(b,a){if((null==b)||(null==b.frames)){return null}for(var c=0;c<b.frames.length;c++){try{if(b.frames[c].name==a){return b.frames[c]}aChild=getFrameChild(b.frames[c],a);if(aChild!=null){return aChild}}catch(d){}}return null}function findFrameFromTop(a){return getFrameChild(g_topWindow,a)}function GetTopWindow(){var c=window;var b=c;var d=null;var a=false;while(null!=c){try{a=(""!=c.location.href)}catch(f){return b}if("undefined"==typeof c.g_isSpaixWindow){return b;break}if("boolean"==typeof c.SpaixTopMost){return c}if(c.parent==c){return c}b=c;c=c.parent}return top}function findFrame(a){var b=window;var c=null;while(null!=b){c=getFrameChild(b,a);if(null!=c){return c}if("boolean"==(typeof b.SpaixTopMost).toLowerCase()){return null}if(b.parent==b){return null}b=b.parent}return null}function countMe(g,a,c,i,b,j,e,d){var h="LGG="+i;if(""!=a){h+="&make="+SafeEscape(a)}if(""!=c){h+="&section="+c}if(""!=b){h+="&id="+b}if(""!=j){h+="&action="+SafeEscape(j)}if(""!=e){h+="&caption="+SafeEscape(e)}if(""!=d){h+="&info="+SafeEscape(d)}var f=findFrame("frmVersion");if(null!=f){f.location.replace(g+"/_frmVersion.asp?"+h)}}function findLayer(a,b){if(a.getElementById){return a.getElementById(b)}if(IsNets()){return a[b]}if(a.all!=null){return a.all(b)}return null}function GetClientWidth(){if(self.innerWidth){return self.innerWidth}if(document.documentElement){if(document.documentElement.clientWidth){return document.documentElement.clientWidth}}if(document.body){return document.body.clientWidth}if(g_bDebug){AlertBox("GetClientWidth: unknown browser type")}return 800}function GetClientHeight(a){a=(a)?a:document;if(a.innerHeight){return a.innerHeight}if(a.documentElement){if(a.documentElement.clientHeight){return a.documentElement.clientHeight}}if(a.body){return a.body.clientHeight}if(g_bDebug){AlertBox("GetClientHeight: unknown browser type")}return 600}function GetStyleObject(a){var b=GetElmObj(a);if(null!=b){if("object"==typeof b.style){return b.style}if(("object"==typeof b.frameElement)&&("object"==typeof b.frameElement.style)){return b.frameElement.style}}return null}function ValidCssValue(b){var a=("number"==typeof b);if(a&&(0>b)){b=0}return a?String(b)+"px":b}function SetScrollHeight(a,c){var b=findLayer(document,a);if((null!=b)&&("undefined"!=typeof b)){b.scrollTop=c}}function SetElmLeft(c,b){var a=GetStyleObject(c);if(null!=a){a.left=ValidCssValue(b)}}function SetElmTop(c,b){var a=GetStyleObject(c);if(null!=a){a.top=ValidCssValue(b)}}function SetElmWidth(c,b){var a=GetStyleObject(c);if(null!=a){a.width=ValidCssValue(b)}}function SetElmHeight(c,b){var a=GetStyleObject(c);if(null!=a){a.height=ValidCssValue(b)}}function SetElmRight(c,b){var a=GetStyleObject(c);if(null!=a){a.right=ValidCssValue(b)}}function SetElmBottom(c,b){var a=GetStyleObject(c);if(null!=a){a.bottom=ValidCssValue(b)}}function GetScrollHeight(a){var b=findLayer(document,a);if((null!=b)&&("undefined"!=typeof b)){return b.scrollTop}ASSERT(false);return 0}function GetElmObj(a){if("object"==typeof a){return a}return document.getElementById(a)}function GetElmHeight(b){var a=GetElmObj(b);if(a){if(a.clientHeight){return a.clientHeight}else{return a.offsetHeight}}return 0}function GetElmRight(b){var a=GetElmObj(b);if(a){if(a.clientRight){return a.clientRight}else{return a.offsetRight}}return 0}function GetElmWidth(b){var a=GetElmObj(b);if(a){if(a.clientWidth){return a.clientWidth}else{return a.offsetWidth}}return 0}function GetElmLeft(b){var a=GetElmObj(b);if(a){if(a.clientLeft){return a.clientLeft}else{return a.offsetLeft}}return 0}function GetElmTop(b){var a=GetElmObj(b);if(a){if(a.clientTop){return a.clientTop}else{return a.offsetTop}}return 0}function GetElmHeightOffset(b){var a=GetElmObj(b);if(a){return a.offsetHeight}return 0}function GetElmRightOffset(b){var a=GetElmObj(b);if(a){return a.offsetRight}return 0}function GetElmWidthOffset(b){var a=GetElmObj(b);if(a){return a.offsetWidth}return 0}function GetElmLeftOffset(b){var a=GetElmObj(b);if(a){return a.offsetLeft}return 0}function GetElmTopOffset(b){var a=GetElmObj(b);if(a){return a.offsetTop}return 0}function GetChildsByTagName(f,e,a){var c=f.getElementsByTagName(e);if("string"!=typeof a){return c}else{a=a.toUpperCase()}var g=[];var b,d;for(b=0;b<c.length;++b){d=c[b];if(d.type.toUpperCase()==a){AddToArray(g,d)}}return g}var cItemCount="itemcount";var cData="data";var cIdx="iIdx";var g_ReservedKeyWords=[cItemCount,cData,cIdx];RegistrateKeyWords();function RegistrateKeyWords(){var a;for(var b in g_ReservedKeyWords){a=g_ReservedKeyWords[b];if(("string"!=typeof a)||(a==b)){break}delete g_ReservedKeyWords[b];g_ReservedKeyWords[a]=a}}function IsReservedKeyWord(a){return(!g_ReservedKeyWords[a])?false:true}function AddToKeyArray(e,c,a,b){if(IsReservedKeyWord(c)){ASSERT(false,"'AddToKeyArray()' -> '"+c+"' is a reserved key word!");return}var d=new Object();d[cIdx]=a;d[cData]=b;e[c]=d;e[cItemCount]=("number"==typeof e[cItemCount])?(e[cItemCount]+1):1}function RemoveFromKeyArray(c,b){if((!c)||("string"!=typeof b)||(""==b)||(IsReservedKeyWord(b))){return}var a=c[b];if(!a){return}delete c[b];c[cItemCount]--;ASSERT(!c[b])}function ReplaceDataInKeyArray(d,c,a){if((!d)||("string"!=typeof c)||(""==c)||(IsReservedKeyWord(c))){return}var b=d[c];if((!b)||(!d[c][cData])){return}d[c][cData]=a}function UpdateDataInKeyArray(e,d,b){if((!e)||("string"!=typeof d)||(""==d)||(IsReservedKeyWord(d))){return}var c=e[d];if((!c)||(!e[d][cData])){return}var a=e[d][cData];if(!a){ReplaceDataInKeyArray(e,d,b);return}for(var f in b){a[f]=b[f]}}function ClearKeyArray(b){if((!b)||("undefined"==typeof b[cItemCount])){return}for(var a in b){if(IsReservedKeyWord(a)){continue}delete b[a];b[cItemCount]--}ASSERT(0==b[cItemCount])}function InsertInArray(b,c,a){ASSERT((0<=a)&&(a<=b.length));b.splice(a,0,c)}function AddToArray(a,b){a[a.length]=b}Array.prototype.Merge=function(){var d=new Array();var b;for(var c=this.length-1;c>=0;c--){b=d[this[c]];if(b){this.splice(c,1);continue}AddToKeyArray(d,this[c],-1,null)}for(var a=0;a<arguments.length;++a){for(var e=0;e<arguments[a].length;++e){b=d[arguments[a][e]];if(b){continue}this[this.length]=arguments[a][e];AddToKeyArray(d,arguments[a][e],-1,null)}}ASSERT(this.length==d.itemcount);ClearArray(d)};function ClearArray(a){a.splice(0,a.length)}function RemoveFromArray(b,c){var a=b.length;while(0<=--a){if(b[a]==c){b.splice(a,1)}}}function FindInArray(b,c){var a;for(a=0;a<b.length;++a){if(b[a]==c){return a}}return -1}function GetArrayIndex(b,a){return FindInArray(b,a)}function DeleteFromArray(f,a,c,b){if((f.length<=a)||(0>a)||(0>=c)){return}if((b)&&(null!=b)){var e=Math.min(f.length,a+c);for(var d=a;d<e;++d){AddToArray(b,f[d])}}f.splice(a,c)}function Clone(c){var b=new Object();var a;for(a in c){b[a]=c[a]}return b}function CloneArray(c){if(("undefined"==typeof c)||(null==c)){return null}var b=new Array();for(var a=0;a<c.length;a++){AddToArray(b,Clone(c[a]))}return b}function trim(a){return a.replace(/^\s+/,"").replace(/\s+$/,"")}function VsxReplaceAll(c,a,b){if("\n"==a){return ReplaceAll(c,/\\n/,b)}else{var d=new RegExp(SafeEscapeRegex(a),"g");return c.replace(d,b)}}function VsxReplaceAtTheEnd(c,a,b){var d=new RegExp(a+"$");return c.replace(d,b)}function IsNumberFormatOk(a){return g_FormatConverter.IsNumberFormatOk(a)}function IsInteger(a){var d=trim(String(a));var c="";c+="(^[-+]?[1-9][0-9]{0,}$)";c+="|((^[-+]?[0])$)";var b=new RegExp(c,"g");return b.test(d)}function HasPositiveValue(a,c){if((null==a)||("undefined"==typeof a)||(""==a.value)){return false}var b=StrToFloat(a.value,-1);if(0>b){AddCssClass(a,"checkfailed");if(false!=c){AlertBox(g_lggMsgUnEin+"!",false)}return false}RemoveCssClass(a,"checkfailed");return true}function OnDoubleFld(a,b,c){if((null==a)||("undefined"==typeof a)){return false}if(""==a.value){if("boolean"==typeof c){if(c){RemoveCssClass(a,"checkfailed")}else{AddCssClass(a,"checkfailed")}return c}else{return false}}if(!g_FormatConverter.CheckDoubleInput(a)){AddCssClass(a,"checkfailed");if(false!=b){AlertBox(g_lggMsgUnEin+"! \n ("+g_FormatConverter.GetValidFloatFormatMask()+")",false)}return false}else{a.value=VsxReplaceAll(a.value,g_FormatConverter.ThousandSep,"")}RemoveCssClass(a,"checkfailed");return true}function OnIntegerFld(a,b,c){if((null==a)||("undefined"==typeof a)){return false}if(""==a.value){if("boolean"==typeof c){if(c){RemoveCssClass(a,"checkfailed")}else{AddCssClass(a,"checkfailed")}return c}else{return false}}if(!IsInteger(a.value)){AddCssClass(a,"checkfailed");if(false!=b){AlertBox(g_lggMsgUnEin+"!",false)}return false}a.value=VsxReplaceAll(a.value,"+","");RemoveCssClass(a,"checkfailed");return true}function StrToFloat(a,b){return g_FormatConverter.StrToFloat(a,b)}function StrToDoub(a){return StrToFloat(a,0)}function StrToInt(a,b){return g_FormatConverter.StrToInt(a,b)}function FloatToStr(a){return g_FormatConverter.FloatToStr(a)}function FloatToStrAuto(g,b){if("number"!=typeof b){return FloatToStr(g)}if("string"==typeof g){return g}var e=g.toString().replace(".",g_FormatConverter.DecimalSep);var f=e.indexOf(g_FormatConverter.DecimalSep);if(-1<f){var h="";var c=0;var a=false;f++;for(var d=f;d<e.length;d++){h=e.charAt(d);c++;if(!a){a=("0"!=h)}if((a)&&(b<=c)){e=e.substring(0,d+1);break}}}return e}function NumToStr(e,b,h){if(isNaN(e)){return e}if("number"!=typeof b){b=3}var g=1;for(var l=0;l<b;l++){g*=10}var c=String(Math.round(e*g));var k="";if(b>0){while(c.length<=b){c="0"+c}k=c.substring(c.length-b,c.length);c=c.substring(0,c.length-b)}if(h){var a=c;var d=0;c="";for(var f=a.length-1;f>=0;f--){c=a.charAt(f)+c;d++;if((0==d%3)&&(f>0)){c=g_FormatConverter.ThousandSep+c}}}if(b>0){c=c+g_FormatConverter.DecimalSep}return c+k}function StrGlt(b,a){return NumToStr(StrToFloat(b,0),a)}function runden(c,b){var a=c;var d=1;if(0==b){return Math.round(c)}while(0<b){b--;d=d*10}while(0>b){b++;d=d/10}return Math.round(c*d)/d}function FormatedStringToFloat(c,b){var a;if(!IsNumberFormatOk(c)){return b}a=VsxReplaceAll(String(c),g_FormatConverter.ThousandSep,"");return StrToFloat(a)}function CheckNumericValue(f,h,j,b,e){var i=document.forms[f].elements[h];if(("undefined"==typeof i)||(null==i)){AlertBox("script error: element '"+h+"' not found [Code 0003]");return false}var d=i.value;var c=d.replace(",",".");i.value=c;var g=true;if((0!=c.length)&&(!isNaN(c))){g=false;var a=c.valueOf();if(b&&(0>=a)){g=true}if((e)&&(a>e)){g=true}}if(g){AlertBox(j);SelectInput(f,i);ClearEvent(window)}return(!g)}function ClearEvent(a){if(null!=a.event){a.event.cancelBubble=true;a.event.returnValue=false}}function SelectInput(b,a){document.forms[b].activeElement=a;a.select()}function KillLz_VH(a){return a.replace(/^ /g,"").replace(/ $/g,"")}function DeleteAll(a,b){var c=a.search(SafeEscapeRegex(b));while((0<=c)){a=a.replace(b,"");c=a.search(SafeEscapeRegex(b))}return a}function DeletePraefixChar(a,d){var c,b;c=-1;for(b=0;b<a.length;++b){if(d!=a.substring(b,b+1)){break}c++}if(-1!=c){return a.substring(c+1,a.length)}else{return a}}function GetFileExtension(a){if("string"!=typeof a){return""}var b=a.lastIndexOf(".");if(0>b){return""}return a.substring(b+1)}function ReplaceAll(a,d,b){ASSERT("string"==typeof a);var c=-1;var e=a.search(SafeEscapeRegex(d));if(""==b){return DeleteAll(a,d)}if(0<=b.search(SafeEscapeRegex(d))){a=ReplaceAll(a,d,"DUMMY_72BC86EA_113C_4F70_9501_CE549A359E9C_STRING");d=/DUMMY_72BC86EA_113C_4F70_9501_CE549A359E9C_STRING/}while((0<=e)&&(c<e)){a=a.replace(d,b);c=e;e=a.search(SafeEscapeRegex(d))}if(0<=e){AlertBox("internal script error: ReplaceAll()")}return a}function ReplaceISPageName(g,c){var i=g;var a=false;var f=/(\bIS__NEXTPAGE=\w+)/i;var e=/(\bIS__\w+\b\.[xX]=)/i;var d=/(\bIS__\w+\b\.[yY]=)/i;var h=/___REPLACE_HERE___/;var b="___REPLACE_HERE___";if(0<=i.search(f)){i=ReplaceAll(i,f,b);i=ReplaceAll(i,h,"IS__NEXTPAGE="+c);a=true}if(0<=i.search(e)){i=ReplaceAll(i,e,b);i=ReplaceAll(i,h,"IS__"+c+".x=");a=true}if(0<=i.search(d)){i=ReplaceAll(i,d,b);i=ReplaceAll(i,h,"IS__"+c+".y=");a=true}if((""!=c)&&(!a)){i+="&IS__NEXTPAGE="+c}return i}function RemoveTagFromUrlQuery(c,b){var f=c.indexOf("?");if(0>f){return c}var a=c.substr(0,f+1);var e=c.substr(f+1,c.length);var d="";b=b.toUpperCase();e="&"+e+"&";while(true){d=e.toUpperCase();f=d.indexOf("&"+b+"=");if(0>f){break}if(d.length!=e.length){AlertBox("ASSERTION failed in  RemoveTagFromUrlQuery()");break}d=e.substr(f+b.length+2,e.length);e=e.substr(0,f);f=d.indexOf("&");if(0<=f){e=e+d.substr(f,d.length)}}e=e.substr(1,e.length-2);return a+e}function ReplaceUrlTagValue(a,b,c){return RemoveTagFromUrlQuery(a,b)+"&"+b+"="+c}function MakeValidID(b){var a="";var d="";expr=/[A-Za-z0-9]/;for(var c=0;c<b.length;c++){d=b.substr(c,1);if(expr.test(d)){a+=d}}return a}function IsListbox(a){return((a)&&(a.options))}function GetListboxSelectCount(b,d){var c=0;for(var a=0;a<b.options.length;++a){if(!b.options[a].selected){continue}++c;if(d){return 1}}return c}function AddListboxArray(d,c,b){for(var a=0;a<c.length;++a){if(b){AddListboxEntryValue(d,c[a],c[a])}else{AddListboxEntry(d,c[a])}}}function AddListboxEntry(e,d){var a=DecodeString(d);for(var c=0;c<e.options.length;c++){if(a==e.options[c].text){return e.options[c]}}var b=CreateOption(d,"",false);e.options[e.options.length]=b;return b}function AddListboxEntryValueStrict(c,b,d){var a=CreateOption(b,d,false);c.options[c.options.length]=a;return a}function AddListboxEntryValue(e,d,f){var a=DecodeString(d);for(var c=0;c<e.options.length;c++){if(a==e.options[c].text){return e.options[c]}}var b=CreateOption(d,f,false);e.options[e.options.length]=b;return b}function CreateOption(c,d,b){var a=new Option(DecodeString(c));a.value=DecodeString(d);a.selected=b;return a}function DelListboxEntry(d,c){var a=DecodeString(c);for(var b=d.options.length-1;b>=0;b--){if(a==d.options[b].value){d.options[b]=null;break}}}function ClearListbox(b){if(!b){return}for(var a=0;a<b.options.length;a++){b.options[a]=null}}function GetSelectedListboxEntry(b){if(null==b){return""}var a=b.selectedIndex;if((0<=a)&&(a<b.options.length)){return b.options[a].text}else{return""}}function SelectListboxEntry(d,c){if((null==d)||(null==d.options)||(0==d.options.length)){return false}var a=DecodeString(c);for(var b=0;b<d.options.length;b++){if(d.options[b].text==a){d.selectedIndex=b;return true}}return false}function ClearListboxSelection(a){if(null==a){return false}else{a.selectedIndex=-1;return true}}function GetSelectedListboxValue(b){if(null==b){return""}var a=b.selectedIndex;if((0<=a)&&(a<b.options.length)){return b.options[a].value}else{return""}}function GetSelectedListboxEntrys(b,a){ASSERT(FALSE);if(a){return GetSelectedListboxEntries(b)}else{return GetSelectedListboxValues(b)}}function GetSelectedListboxEntries(b){var c=new Array();if(null==b){return c}for(var a=0;a<b.options.length;++a){if(b.options[a].selected){AddToArray(c,b.options[a].text)}}return c}function GetSelectedListboxValues(b){var c=new Array();if(null==b){return c}for(var a=0;a<b.options.length;++a){if(b.options[a].selected){AddToArray(c,b.options[a].value)}}return c}function SelectListboxValue(d,c){if((null==d)||(null==d.options)||(0==d.options.length)){return false}var a=DecodeString(c);for(var b=0;b<d.options.length;b++){if(d.options[b].value==a){d.selectedIndex=b;return true}}return false}function GenerateHiddenInputHTML(b,a){return'<input type="hidden" '+AttribStr("name",b,'"')+AttribStr("value",a,'"')+">"}function AddElement(c,a,e,b){var d=document.getElementById(e);if(!d){d=document.createElement(a);d.name=e;d.id=e;if((b)&&(""!=b)){AddCssClass(d,b)}c.appendChild(d)}return d}function AddHiddenInput(b,c){var a=document.getElementById(c);if(!a){a=document.createElement("INPUT");a.type="hidden";a.name=c;a.id=c;AddCssClass(a,"hidden");b.appendChild(a)}return a}function InputSetOnChangeHandler(aInputName){var inp=eval(aInputName);inp.onfocus=new Function("InputSetFocus( "+aInputName+", true);");inp.onblur=new Function("InputSetFocus( "+aInputName+", false);");inp.onchange=new Function("InputOnChange( "+aInputName+");")}function InputSetFocus(a,b){if(b){document.focused=a}else{if(a==document.focused){document.focused=""}}}function InputOnChange(a){if(a==document.focused){a.onclick()}}function InputSetFocus(a){var b=document.getElementById(a);if(b){b.focus()}}function InputSelectText(a){var b=document.getElementById(a);if(b){b.focus();b.select()}}function SafeEscapeRegex(b){function a(d){var c=new RegExp("[.*+?|()\\[\\]{}\\\\]","g");return d.replace(c,"\\$&")}switch(typeof b){case"object":case"function":return b;case"string":return a(b);default:ASSERT(false);b=b.toString();return a(b)}}function SafeEscapeSpaces(a){return ReplaceAll(a,/\ /,"%20")}function SafeEscape(a){a=escape(a);a=SafeEscapeSpaces(a);regExp=/\+/;while(0<=a.search(regExp)){a=a.replace(regExp,"%2B")}return a}function SafeEscapeURL(e){var g=e.indexOf("?");if(0>g){return SafeEscapeSpaces(e)}var d=SafeEscapeSpaces(e.substr(0,g+1));e=e.slice(g+1);var f,b;var c,a;while(0<e.length){g=e.indexOf("&");if(0<=g){c=true;f=e.substr(0,g);e=e.slice(g+1)}else{c=false;f=e;e=""}g=f.indexOf("=");if(0<=g){a=true;b=f.slice(g+1);f=f.substr(0,g)}else{a=false;b=""}d+=SafeEscape(f);if(a){d+="="}d+=SafeEscape(b);if(c){d+="&"}}return d}function loadImage(b){if((document.images)&&(""!=b)){var a=new Image();a.src=b;return a}}function HideAllVisibleIframes(){var b;var a=document.getElementsByTagName("iframe");for(b=0;b<a.length;b++){if(a.item(b).style.visibility!="hidden"){AddCssClass(a.item(b),"ModalHidden");a.item(b).style.visibility="hidden"}}}function ShowAllVisibleIframes(){var b;var a=document.getElementsByTagName("iframe");for(b=0;b<a.length;b++){if(ElementIncludesCssClass(a.item(b),"ModalHidden")){RemoveCssClass(a.item(b),"ModalHidden");a.item(b).style.visibility=""}}}function HideAllVisibleSelects(){if(!IsMSIE()){return null}if(7<=GetInternetExplorerVersion()){return null}var b;var a=document.getElementsByTagName("select");for(b=0;b<a.length;b++){if(a.item(b).style.visibility!="hidden"){AddCssClass(a.item(b),"ModalHidden");a.item(b).style.visibility="hidden"}}}function ShowAllHiddenSelects(){var b;var a=document.getElementsByTagName("select");for(b=0;b<a.length;b++){if(ElementIncludesCssClass(a.item(b),"ModalHidden")){RemoveCssClass(a.item(b),"ModalHidden");a.item(b).style.visibility=""}}}function HideAllVisibleElementsByName(g,a){var d=new Object();d.hiddenL=new Array();if(a){if(!IsMSIE()){return null}if(7<=GetInternetExplorerVersion()){return null}}var b,e,c;var f=GetChildsByTagName(document,g);for(b=0;b<f.length;++b){e=f[b];if("hidden"!=e.style.visibility.toLowerCase()){c=new Object();c.sVisib=e.style.visibility;c.object=e;AddToArray(d.hiddenL,c);e.style.visibility="hidden"}}return d}function ShowAllHiddenElementsInArray(a){if(null==a){return}if(a.hiddenL){var b,c;for(b=0;b<a.hiddenL.length;++b){c=a.hiddenL[b];c.object.style.visibility=c.sVisib}a.hiddenL=new Array()}}function ASSERT(b,a){if(g_bDebug){if(!b){if(!ConfirmBox("Assertion failed:\n"+a+"\n\nContinue?")){DebugBreak()}}}return}function SetDebugFlag(b){var a=("undefined"!=typeof g_bDebug)&&g_bDebug;g_bDebug=b;DebugBreak=b?null:function(){};return a}SetDebugFlag(("undefined"!=typeof g_bDebug)&&g_bDebug);var cEncodeHTML="&#";var cEncodeJava="\\u";function DecodeStringValues(f,e){var b=f.split(e);if(2>b.length){return f}var a=0;var d=b[0];for(var c=1;c<b.length;c++){f=b[c];if(e==cEncodeHTML){a=f.lastIndexOf(";")}else{if(f.length>3){if("0x"!=f.substring(0,2)){f="0x"+f}a=6}else{a=-1}}if((-1==a)||(10<a)){d+=e+f}else{d+=String.fromCharCode(f.substring(0,a));if(e==cEncodeHTML){++a}d+=f.substring(a)}}return d}function DecodeString(a){if(("string"!=typeof a)||(""==a)){return a}a=DecodeStringValues(a,cEncodeHTML);a=DecodeStringValues(a,cEncodeJava);return a}function AttribStr(c,b,a){switch(a){case'"':return" "+c+'="'+b.replace(/\"/g,"&quot;")+'"';case"'":return" "+c+"='"+b.replace(/\'/g,"&#39;")+"'";default:ASSERT(false);break}return"invalid args"}function HtmlEncode(a){return a.replace(/\&/g,"&amp;").replace(/\</g,"&lt;").replace(/\>/g,"&gt;").replace(/\"/g,"&quot;").replace(/\'/g,"&#39;")}function HtmlShortenString(a,c){if(a.length<c){return a}var d=0;var b=2;while((b<c)&&(d<a.length)){if("&"==a[d]){while((d<a.length)&&(";"!=a[d])){++d}}++b;++d}return a.substr(0,d)+"&hellip;"}var g_temporaryHiddenL=null;function ShowLoadingDiv(){var a=GetYScroll(document.documentElement)+GetYScroll(document.body)+(0.3*GetClientHeight());showLayer("loading",true);SetElmTop("loading",a);g_temporaryHiddenL=HideAllVisibleSelects()}function HideLoadingDiv(){showLayer("loading",false);ShowAllHiddenSelects(g_temporaryHiddenL)}function CalcLinearFunction(b,d,a,c,e){return(d+((c-d)/(a-b))*(e-b))}function SetBits(b,a){return(b|a)}function ClearBits(b,a){return(b&(~a))}function TestBitsExact(b,a){return((b&a)==a)}function TestAnyBit(b,a){return((b&a)!=0)};
