function browserdetect(){var A=navigator.userAgent.toLowerCase();this.isIE=A.indexOf("msie")>-1;this.ieVer=this.isIE?/msie\s(\d\.\d)/.exec(A)[1]:0;this.isMoz=A.indexOf("firefox")!=-1;this.isSafari=A.indexOf("safari")!=-1;this.quirksMode=this.isIE&&(!document.compatMode||document.compatMode.indexOf("BackCompat")>-1);this.isOp="opera" in window;this.isWebKit=A.indexOf("webkit")!=-1;if(this.isIE){this.get_style=function(D,F){if(!(F in D.currentStyle)){return""}var C=/^([\d.]+)(\w*)/.exec(D.currentStyle[F]);if(!C){return D.currentStyle[F]}if(C[1]==0){return"0"}if(C[2]&&C[2]!=="px"){var B=D.style.left;var E=D.runtimeStyle.left;D.runtimeStyle.left=D.currentStyle.left;D.style.left=C[1]+C[2];C[0]=D.style.pixelLeft;D.style.left=B;D.runtimeStyle.left=E}return C[0]}}else{this.get_style=function(B,C){C=C.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return document.defaultView.getComputedStyle(B,"").getPropertyValue(C)}}}var curvyBrowser=new browserdetect;if(curvyBrowser.isIE){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}function curvyCnrSpec(A){this.selectorText=A;this.tlR=this.trR=this.blR=this.brR=0;this.tlu=this.tru=this.blu=this.bru="";this.antiAlias=true}curvyCnrSpec.prototype.setcorner=function(B,C,A,D){if(!B){this.tlR=this.trR=this.blR=this.brR=parseInt(A);this.tlu=this.tru=this.blu=this.bru=D}else{propname=B.charAt(0)+C.charAt(0);this[propname+"R"]=parseInt(A);this[propname+"u"]=D}};curvyCnrSpec.prototype.get=function(D){if(/^(t|b)(l|r)(R|u)$/.test(D)){return this[D]}if(/^(t|b)(l|r)Ru$/.test(D)){var C=D.charAt(0)+D.charAt(1);return this[C+"R"]+this[C+"u"]}if(/^(t|b)Ru?$/.test(D)){var B=D.charAt(0);B+=this[B+"lR"]>this[B+"rR"]?"l":"r";var A=this[B+"R"];if(D.length===3&&D.charAt(2)==="u"){A+=this[B="u"]}return A}throw new Error("Don't recognize property "+D)};curvyCnrSpec.prototype.radiusdiff=function(A){if(A!=="t"&&A!=="b"){throw new Error("Param must be 't' or 'b'")}return Math.abs(this[A+"lR"]-this[A+"rR"])};curvyCnrSpec.prototype.setfrom=function(A){this.tlu=this.tru=this.blu=this.bru="px";if("tl" in A){this.tlR=A.tl.radius}if("tr" in A){this.trR=A.tr.radius}if("bl" in A){this.blR=A.bl.radius}if("br" in A){this.brR=A.br.radius}if("antiAlias" in A){this.antiAlias=A.antiAlias}};curvyCnrSpec.prototype.cloneOn=function(G){var E=["tl","tr","bl","br"];var H=0;var C,A;for(C in E){if(!isNaN(C)){A=this[E[C]+"u"];if(A!==""&&A!=="px"){H=new curvyCnrSpec;break}}}if(!H){H=this}else{var B,D,F=curvyBrowser.get_style(G,"left");for(C in E){if(!isNaN(C)){B=E[C];A=this[B+"u"];D=this[B+"R"];if(A!=="px"){var F=G.style.left;G.style.left=D+A;D=G.style.pixelLeft;G.style.left=F}H[B+"R"]=D;H[B+"u"]="px"}}G.style.left=F}return H};curvyCnrSpec.prototype.radiusSum=function(A){if(A!=="t"&&A!=="b"){throw new Error("Param must be 't' or 'b'")}return this[A+"lR"]+this[A+"rR"]};curvyCnrSpec.prototype.radiusCount=function(A){var B=0;if(this[A+"lR"]){++B}if(this[A+"rR"]){++B}return B};curvyCnrSpec.prototype.cornerNames=function(){var A=[];if(this.tlR){A.push("tl")}if(this.trR){A.push("tr")}if(this.blR){A.push("bl")}if(this.brR){A.push("br")}return A};function operasheet(C){var A=document.styleSheets.item(C).ownerNode.text;A=A.replace(/\/\*(\n|\r|.)*?\*\//g,"");var D=new RegExp("^s*([\\w.#][-\\w.#, ]+)[\\n\\s]*\\{([^}]+border-((top|bottom)-(left|right)-)?radius[^}]*)\\}","mg");var G;this.rules=[];while((G=D.exec(A))!==null){var F=new RegExp("(..)border-((top|bottom)-(left|right)-)?radius:\\s*([\\d.]+)(in|em|px|ex|pt)","g");var E,B=new curvyCnrSpec(G[1]);while((E=F.exec(G[2]))!==null){if(E[1]!=="z-"){B.setcorner(E[3],E[4],E[5],E[6])}}this.rules.push(B)}}operasheet.contains_border_radius=function(A){return/border-((top|bottom)-(left|right)-)?radius/.test(document.styleSheets.item(A).ownerNode.text)};function curvyCorners(){var G,D,E,B,J;if(typeof arguments[0]!=="object"){throw curvyCorners.newError("First parameter of curvyCorners() must be an object.")}if(arguments[0] instanceof curvyCnrSpec){B=arguments[0];if(!B.selectorText&&typeof arguments[1]==="string"){B.selectorText=arguments[1]}}else{if(typeof arguments[1]!=="object"&&typeof arguments[1]!=="string"){throw curvyCorners.newError("Second parameter of curvyCorners() must be an object or a class name.")}D=arguments[1];if(typeof D!=="string"){D=""}if(D!==""&&D.charAt(0)!=="."&&"autoPad" in arguments[0]){D="."+D}B=new curvyCnrSpec(D);B.setfrom(arguments[0])}if(B.selectorText){J=0;var I=B.selectorText.replace(/\s+$/,"").split(/,\s*/);E=new Array;function A(M){var L=M.split("#");return(L.length===2?"#":"")+L.pop()}for(G=0;G<I.length;++G){var K=A(I[G]);var H=K.split(" ");switch(K.charAt(0)){case"#":D=H.length===1?K:H[0];D=document.getElementById(D.substr(1));if(D===null){curvyCorners.alert("No object with ID "+K+" exists yet.\nCall curvyCorners(settings, obj) when it is created.")}else{if(H.length===1){E.push(D)}else{E=E.concat(curvyCorners.getElementsByClass(H[1],D))}}break;default:if(H.length===1){E=E.concat(curvyCorners.getElementsByClass(K))}else{var C=curvyCorners.getElementsByClass(H[0]);for(D=0;D<C.length;++D){E=E.concat(curvyCorners.getElementsByClass(H[1],C))}}}}}else{J=1;E=arguments}for(G=J,D=E.length;G<D;++G){if(E[G]&&(!("IEborderRadius" in E[G].style)||E[G].style.IEborderRadius!="set")){if(E[G].className&&E[G].className.indexOf("curvyRedraw")!==-1){if(typeof curvyCorners.redrawList==="undefined"){curvyCorners.redrawList=new Array}curvyCorners.redrawList.push({node:E[G],spec:B,copy:E[G].cloneNode(false)})}E[G].style.IEborderRadius="set";var F=new curvyObject(B,E[G]);F.applyCorners()}}}curvyCorners.prototype.applyCornersToAll=function(){curvyCorners.alert("This function is now redundant. Just call curvyCorners(). See documentation.")};curvyCorners.redraw=function(){if(!curvyBrowser.isOp&&!curvyBrowser.isIE){return}if(!curvyCorners.redrawList){throw curvyCorners.newError("curvyCorners.redraw() has nothing to redraw.")}var E=curvyCorners.bock_redraw;curvyCorners.block_redraw=true;for(var A in curvyCorners.redrawList){if(isNaN(A)){continue}var D=curvyCorners.redrawList[A];if(!D.node.clientWidth){continue}var B=D.copy.cloneNode(false);for(var C=D.node.firstChild;C!=null;C=C.nextSibling){if(C.className==="autoPadDiv"){break}}if(!C){curvyCorners.alert("Couldn't find autoPad DIV");break}D.node.parentNode.replaceChild(B,D.node);while(C.firstChild){B.appendChild(C.removeChild(C.firstChild))}D=new curvyObject(D.spec,D.node=B);D.applyCorners()}curvyCorners.block_redraw=E};curvyCorners.adjust=function(obj,prop,newval){if(curvyBrowser.isOp||curvyBrowser.isIE){if(!curvyCorners.redrawList){throw curvyCorners.newError("curvyCorners.adjust() has nothing to adjust.")}var i,j=curvyCorners.redrawList.length;for(i=0;i<j;++i){if(curvyCorners.redrawList[i].node===obj){break}}if(i===j){throw curvyCorners.newError("Object not redrawable")}obj=curvyCorners.redrawList[i].copy}if(prop.indexOf(".")===-1){obj[prop]=newval}else{eval("obj."+prop+"='"+newval+"'")}};curvyCorners.handleWinResize=function(){if(!curvyCorners.block_redraw){curvyCorners.redraw()}};curvyCorners.setWinResize=function(A){curvyCorners.block_redraw=!A};curvyCorners.newError=function(A){return new Error("curvyCorners Error:\n"+A)};curvyCorners.alert=function(A){if(typeof curvyCornersVerbose==="undefined"||curvyCornersVerbose){alert(A)}};function curvyObject(){var U;this.box=arguments[1];this.settings=arguments[0];this.topContainer=this.bottomContainer=this.shell=U=null;var K=this.box.clientWidth;if(!K&&curvyBrowser.isIE){this.box.style.zoom=1;K=this.box.clientWidth}if(!K){if(!this.box.parentNode){throw this.newError("box has no parent!")}for(U=this.box;;U=U.parentNode){if(!U||U.tagName==="BODY"){this.applyCorners=function(){};curvyCorners.alert(this.errmsg("zero-width box with no accountable parent","warning"));return}if(U.style.display==="none"){break}}U.style.display="block";K=this.box.clientWidth}if(arguments[0] instanceof curvyCnrSpec){this.spec=arguments[0].cloneOn(this.box)}else{this.spec=new curvyCnrSpec("");this.spec.setfrom(this.settings)}var b=curvyBrowser.get_style(this.box,"borderTopWidth");var J=curvyBrowser.get_style(this.box,"borderBottomWidth");var D=curvyBrowser.get_style(this.box,"borderLeftWidth");var B=curvyBrowser.get_style(this.box,"borderRightWidth");var I=curvyBrowser.get_style(this.box,"borderTopColor");var G=curvyBrowser.get_style(this.box,"borderBottomColor");var A=curvyBrowser.get_style(this.box,"borderLeftColor");var E=curvyBrowser.get_style(this.box,"backgroundColor");var C=curvyBrowser.get_style(this.box,"backgroundImage");var Y=curvyBrowser.get_style(this.box,"backgroundRepeat");if(this.box.currentStyle&&this.box.currentStyle.backgroundPositionX){var R=curvyBrowser.get_style(this.box,"backgroundPositionX");var P=curvyBrowser.get_style(this.box,"backgroundPositionY")}else{var R=curvyBrowser.get_style(this.box,"backgroundPosition");R=R.split(" ");var P=R[1];R=R[0]}var O=curvyBrowser.get_style(this.box,"position");var Z=curvyBrowser.get_style(this.box,"paddingTop");var c=curvyBrowser.get_style(this.box,"paddingBottom");var Q=curvyBrowser.get_style(this.box,"paddingLeft");var a=curvyBrowser.get_style(this.box,"paddingRight");var S=curvyBrowser.get_style(this.box,"border");filter=curvyBrowser.ieVer>7?curvyBrowser.get_style(this.box,"filter"):null;var H=this.spec.get("tR");var M=this.spec.get("bR");var W=function(f){if(typeof f==="number"){return f}if(typeof f!=="string"){throw new Error("unexpected styleToNPx type "+typeof f)}var d=/^[-\d.]([a-z]+)$/.exec(f);if(d&&d[1]!="px"){throw new Error("Unexpected unit "+d[1])}if(isNaN(f=parseInt(f))){f=0}return f};var T=function(d){return d<=0?"0":d+"px"};try{this.borderWidth=W(b);this.borderWidthB=W(J);this.borderWidthL=W(D);this.borderWidthR=W(B);this.boxColour=curvyObject.format_colour(E);this.topPadding=W(Z);this.bottomPadding=W(c);this.leftPadding=W(Q);this.rightPadding=W(a);this.boxWidth=K;this.boxHeight=this.box.clientHeight;this.borderColour=curvyObject.format_colour(I);this.borderColourB=curvyObject.format_colour(G);this.borderColourL=curvyObject.format_colour(A);this.borderString=this.borderWidth+"px solid "+this.borderColour;this.borderStringB=this.borderWidthB+"px solid "+this.borderColourB;this.backgroundImage=((C!="none")?C:"");this.backgroundRepeat=Y}catch(X){throw this.newError("getMessage" in X?X.getMessage():X.message)}var F=this.boxHeight;var V=K;if(curvyBrowser.isOp){R=W(R);P=W(P);if(R){var N=V+this.borderWidthL+this.borderWidthR;if(R>N){R=N}R=(N/R*100)+"%"}if(P){var N=F+this.borderWidth+this.borderWidthB;if(P>N){P=N}P=(N/P*100)+"%"}}if(curvyBrowser.quirksMode){}else{this.boxWidth-=this.leftPadding+this.rightPadding;this.boxHeight-=this.topPadding+this.bottomPadding}this.contentContainer=document.createElement("div");if(filter){this.contentContainer.style.filter=filter}while(this.box.firstChild){this.contentContainer.appendChild(this.box.removeChild(this.box.firstChild))}if(O!="absolute"){this.box.style.position="relative"}this.box.style.padding="0";this.box.style.border=this.box.style.backgroundImage="none";this.box.style.backgroundColor="transparent";this.box.style.width=(V+this.borderWidthL+this.borderWidthR)+"px";this.box.style.height=(F+this.borderWidth+this.borderWidthB)+"px";var L=document.createElement("div");L.style.position="absolute";if(filter){L.style.filter=filter}if(curvyBrowser.quirksMode){L.style.width=(V+this.borderWidthL+this.borderWidthR)+"px"}else{L.style.width=V+"px"}L.style.height=T(F+this.borderWidth+this.borderWidthB-H-M);L.style.padding="0";L.style.top=H+"px";L.style.left="0";if(this.borderWidthL){L.style.borderLeft=this.borderWidthL+"px solid "+this.borderColourL}if(this.borderWidth&&!H){L.style.borderTop=this.borderWidth+"px solid "+this.borderColour}if(this.borderWidthR){L.style.borderRight=this.borderWidthR+"px solid "+this.borderColourL}if(this.borderWidthB&&!M){L.style.borderBottom=this.borderWidthB+"px solid "+this.borderColourB}L.style.backgroundColor=E;L.style.backgroundImage=this.backgroundImage;L.style.backgroundRepeat=this.backgroundRepeat;this.shell=this.box.appendChild(L);K=curvyBrowser.get_style(this.shell,"width");if(K===""||K==="auto"||K.indexOf("%")!==-1){throw this.newError("Shell width is "+K)}this.boxWidth=(K!=""&&K!="auto"&&K.indexOf("%")==-1)?parseInt(K):this.shell.clientWidth;this.applyCorners=function(){if(this.backgroundObject){var w=function(AO,i,t){if(AO===0){return 0}var k;if(AO==="right"||AO==="bottom"){return t-i}if(AO==="center"){return(t-i)/2}if(AO.indexOf("%")>0){return(t-i)*100/parseInt(AO)}return W(AO)};this.backgroundPosX=w(R,this.backgroundObject.width,V);this.backgroundPosY=w(P,this.backgroundObject.height,F)}else{if(this.backgroundImage){this.backgroundPosX=W(R);this.backgroundPosY=W(P)}}if(H){v=document.createElement("div");v.style.width=this.boxWidth+"px";v.style.fontSize="1px";v.style.overflow="hidden";v.style.position="absolute";v.style.paddingLeft=this.borderWidth+"px";v.style.paddingRight=this.borderWidth+"px";v.style.height=H+"px";v.style.top=-H+"px";v.style.left=-this.borderWidthL+"px";this.topContainer=this.shell.appendChild(v)}if(M){var v=document.createElement("div");v.style.width=this.boxWidth+"px";v.style.fontSize="1px";v.style.overflow="hidden";v.style.position="absolute";v.style.paddingLeft=this.borderWidthB+"px";v.style.paddingRight=this.borderWidthB+"px";v.style.height=M+"px";v.style.bottom=-M+"px";v.style.left=-this.borderWidthL+"px";this.bottomContainer=this.shell.appendChild(v)}var AG=this.spec.cornerNames();for(var AK in AG){if(!isNaN(AK)){var AC=AG[AK];var AD=this.spec[AC+"R"];var AE,AH,j,AF;if(AC=="tr"||AC=="tl"){AE=this.borderWidth;AH=this.borderColour;AF=this.borderWidth}else{AE=this.borderWidthB;AH=this.borderColourB;AF=this.borderWidthB}j=AD-AF;var u=document.createElement("div");u.style.height=this.spec.get(AC+"Ru");u.style.width=this.spec.get(AC+"Ru");u.style.position="absolute";u.style.fontSize="1px";u.style.overflow="hidden";var r,q,p;var n=filter?parseInt(/alpha\(opacity.(\d+)\)/.exec(filter)[1]):100;for(r=0;r<AD;++r){var m=(r+1>=j)?-1:Math.floor(Math.sqrt(Math.pow(j,2)-Math.pow(r+1,2)))-1;if(j!=AD){var h=(r>=j)?-1:Math.ceil(Math.sqrt(Math.pow(j,2)-Math.pow(r,2)));var f=(r+1>=AD)?-1:Math.floor(Math.sqrt(Math.pow(AD,2)-Math.pow((r+1),2)))-1}var d=(r>=AD)?-1:Math.ceil(Math.sqrt(Math.pow(AD,2)-Math.pow(r,2)));if(m>-1){this.drawPixel(r,0,this.boxColour,n,(m+1),u,true,AD)}if(j!=AD){if(this.spec.antiAlias){for(q=m+1;q<h;++q){if(this.backgroundImage!=""){var g=curvyObject.pixelFraction(r,q,j)*100;this.drawPixel(r,q,AH,n,1,u,g>=30,AD)}else{if(this.boxColour!=="transparent"){var AB=curvyObject.BlendColour(this.boxColour,AH,curvyObject.pixelFraction(r,q,j));this.drawPixel(r,q,AB,n,1,u,false,AD)}else{this.drawPixel(r,q,AH,n>>1,1,u,false,AD)}}}if(f>=h){if(h==-1){h=0}this.drawPixel(r,h,AH,n,(f-h+1),u,false,0)}p=AH;q=f}else{if(f>m){this.drawPixel(r,(m+1),AH,n,(f-m),u,false,0)}}}else{p=this.boxColour;q=m}if(this.spec.antiAlias){while(++q<d){this.drawPixel(r,q,p,(curvyObject.pixelFraction(r,q,AD)*n),1,u,AF<=0,AD)}}}for(var y=0,AJ=u.childNodes.length;y<AJ;++y){var s=u.childNodes[y];var AI=parseInt(s.style.top);var AM=parseInt(s.style.left);var AN=parseInt(s.style.height);if(AC=="tl"||AC=="bl"){s.style.left=(AD-AM-1)+"px"}if(AC=="tr"||AC=="tl"){s.style.top=(AD-AN-AI)+"px"}s.style.backgroundRepeat=this.backgroundRepeat;if(this.backgroundImage){switch(AC){case"tr":s.style.backgroundPosition=(this.backgroundPosX-this.borderWidthL+AD-V-AM)+"px "+(this.backgroundPosY+AN+AI+this.borderWidth-AD)+"px";break;case"tl":s.style.backgroundPosition=(this.backgroundPosX-AD+AM+this.borderWidthL)+"px "+(this.backgroundPosY-AD+AN+AI+this.borderWidth)+"px";break;case"bl":s.style.backgroundPosition=(this.backgroundPosX-AD+AM+1+this.borderWidthL)+"px "+(this.backgroundPosY-F-this.borderWidth+(curvyBrowser.quirksMode?AI:-AI)+AD)+"px";break;case"br":if(curvyBrowser.quirksMode){s.style.backgroundPosition=(this.backgroundPosX+this.borderWidthL-V+AD-AM)+"px "+(this.backgroundPosY-F-this.borderWidth+AI+AD)+"px"}else{s.style.backgroundPosition=(this.backgroundPosX-this.borderWidthL-V+AD-AM)+"px "+(this.backgroundPosY-F-this.borderWidth+AD-AI)+"px"}}}}switch(AC){case"tl":u.style.top=u.style.left="0";this.topContainer.appendChild(u);break;case"tr":u.style.top=u.style.right="0";this.topContainer.appendChild(u);break;case"bl":u.style.bottom=u.style.left="0";this.bottomContainer.appendChild(u);break;case"br":u.style.bottom=u.style.right="0";this.bottomContainer.appendChild(u)}}}var x={t:this.spec.radiusdiff("t"),b:this.spec.radiusdiff("b")};for(z in x){if(typeof z==="function"){continue}if(!this.spec.get(z+"R")){continue}if(x[z]){if(this.backgroundImage&&this.spec.radiusSum(z)!==x[z]){curvyCorners.alert(this.errmsg("Not supported: unequal non-zero top/bottom radii with background image"))}var AL=(this.spec[z+"lR"]<this.spec[z+"rR"])?z+"l":z+"r";var l=document.createElement("div");l.style.height=x[z]+"px";l.style.width=this.spec.get(AL+"Ru");l.style.position="absolute";l.style.fontSize="1px";l.style.overflow="hidden";l.style.backgroundColor=this.boxColour;switch(AL){case"tl":l.style.bottom=l.style.left="0";l.style.borderLeft=this.borderString;this.topContainer.appendChild(l);break;case"tr":l.style.bottom=l.style.right="0";l.style.borderRight=this.borderString;this.topContainer.appendChild(l);break;case"bl":l.style.top=l.style.left="0";l.style.borderLeft=this.borderStringB;this.bottomContainer.appendChild(l);break;case"br":l.style.top=l.style.right="0";l.style.borderRight=this.borderStringB;this.bottomContainer.appendChild(l)}}var o=document.createElement("div");if(filter){o.style.filter=filter}o.style.position="relative";o.style.fontSize="1px";o.style.overflow="hidden";o.style.width=this.fillerWidth(z);o.style.backgroundColor=this.boxColour;o.style.backgroundImage=this.backgroundImage;o.style.backgroundRepeat=this.backgroundRepeat;switch(z){case"t":if(this.topContainer){if(curvyBrowser.quirksMode){o.style.height=100+H+"px"}else{o.style.height=100+H-this.borderWidth+"px"}o.style.marginLeft=this.spec.tlR?(this.spec.tlR-this.borderWidthL)+"px":"0";o.style.borderTop=this.borderString;if(this.backgroundImage){var AA=this.spec.tlR?(this.backgroundPosX-(H-this.borderWidthL))+"px ":"0 ";o.style.backgroundPosition=AA+this.backgroundPosY+"px";this.shell.style.backgroundPosition=this.backgroundPosX+"px "+(this.backgroundPosY-H+this.borderWidthL)+"px"}this.topContainer.appendChild(o)}break;case"b":if(this.bottomContainer){if(curvyBrowser.quirksMode){o.style.height=M+"px"}else{o.style.height=M-this.borderWidthB+"px"}o.style.marginLeft=this.spec.blR?(this.spec.blR-this.borderWidthL)+"px":"0";o.style.borderBottom=this.borderStringB;if(this.backgroundImage){var AA=this.spec.blR?(this.backgroundPosX+this.borderWidthL-M)+"px ":this.backgroundPosX+"px ";o.style.backgroundPosition=AA+(this.backgroundPosY-F-this.borderWidth+M)+"px"}this.bottomContainer.appendChild(o)}}}this.contentContainer.style.position="absolute";this.contentContainer.className="autoPadDiv";this.contentContainer.style.left=this.borderWidthL+"px";this.contentContainer.style.paddingTop=this.topPadding+"px";this.contentContainer.style.top=this.borderWidth+"px";this.contentContainer.style.paddingLeft=this.leftPadding+"px";this.contentContainer.style.paddingRight=this.rightPadding+"px";z=V;if(!curvyBrowser.quirksMode){z-=this.leftPadding+this.rightPadding}this.contentContainer.style.width=z+"px";this.contentContainer.style.textAlign=curvyBrowser.get_style(this.box,"textAlign");this.box.style.textAlign="left";this.box.appendChild(this.contentContainer);if(U){U.style.display="none"}};if(this.backgroundImage){R=this.backgroundCheck(R);P=this.backgroundCheck(P);if(this.backgroundObject){this.backgroundObject.holdingElement=this;this.dispatch=this.applyCorners;this.applyCorners=function(){if(this.backgroundObject.complete){this.dispatch()}else{this.backgroundObject.onload=new Function("curvyObject.dispatch(this.holdingElement);")}}}}}curvyObject.prototype.backgroundCheck=function(B){if(B==="top"||B==="left"||parseInt(B)===0){return 0}if(!(/^[-\d.]+px$/.test(B))&&!this.backgroundObject){this.backgroundObject=new Image;var A=function(D){var C=/url\("?([^'"]+)"?\)/.exec(D);return(C?C[1]:D)};this.backgroundObject.src=A(this.backgroundImage)}return B};curvyObject.dispatch=function(A){if("dispatch" in A){A.dispatch()}else{throw A.newError("No dispatch function")}};curvyObject.prototype.drawPixel=function(J,G,A,F,H,I,C,E){var B=document.createElement("div");B.style.height=H+"px";B.style.width="1px";B.style.position="absolute";B.style.fontSize="1px";B.style.overflow="hidden";var D=this.spec.get("tR");B.style.backgroundColor=A;if(C&&this.backgroundImage!=""){B.style.backgroundImage=this.backgroundImage;B.style.backgroundPosition="-"+(this.boxWidth-(E-J)+this.borderWidth)+"px -"+((this.boxHeight+D+G)-this.borderWidth)+"px"}if(F!=100){curvyObject.setOpacity(B,F)}B.style.top=G+"px";B.style.left=J+"px";I.appendChild(B)};curvyObject.prototype.fillerWidth=function(A){var B=curvyBrowser.quirksMode?0:this.spec.radiusCount(A)*this.borderWidthL;return(this.boxWidth-this.spec.radiusSum(A)+B)+"px"};curvyObject.prototype.errmsg=function(C,D){var B="\ntag: "+this.box.tagName;if(this.box.id){B+="\nid: "+this.box.id}if(this.box.className){B+="\nclass: "+this.box.className}var A;if((A=this.box.parentNode)===null){B+="\n(box has no parent)"}else{B+="\nParent tag: "+A.tagName;if(A.id){B+="\nParent ID: "+A.id}if(A.className){B+="\nParent class: "+A.className}}if(D===undefined){D="warning"}return"curvyObject "+D+":\n"+C+B};curvyObject.prototype.newError=function(A){return new Error(this.errmsg(A,"exception"))};curvyObject.IntToHex=function(B){var A=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];return A[B>>>4]+""+A[B&15]};curvyObject.BlendColour=function(L,J,G){if(L==="transparent"||J==="transparent"){throw this.newError("Cannot blend with transparent")}if(L.charAt(0)!=="#"){L=curvyObject.format_colour(L)}if(J.charAt(0)!=="#"){J=curvyObject.format_colour(J)}var D=parseInt(L.substr(1,2),16);var K=parseInt(L.substr(3,2),16);var F=parseInt(L.substr(5,2),16);var C=parseInt(J.substr(1,2),16);var I=parseInt(J.substr(3,2),16);var E=parseInt(J.substr(5,2),16);if(G>1||G<0){G=1}var H=Math.round((D*G)+(C*(1-G)));if(H>255){H=255}if(H<0){H=0}var B=Math.round((K*G)+(I*(1-G)));if(B>255){B=255}if(B<0){B=0}var A=Math.round((F*G)+(E*(1-G)));if(A>255){A=255}if(A<0){A=0}return"#"+curvyObject.IntToHex(H)+curvyObject.IntToHex(B)+curvyObject.IntToHex(A)};curvyObject.pixelFraction=function(H,G,A){var J;var E=A*A;var B=new Array(2);var F=new Array(2);var I=0;var C="";var D=Math.sqrt(E-Math.pow(H,2));if(D>=G&&D<(G+1)){C="Left";B[I]=0;F[I]=D-G;++I}D=Math.sqrt(E-Math.pow(G+1,2));if(D>=H&&D<(H+1)){C+="Top";B[I]=D-H;F[I]=1;++I}D=Math.sqrt(E-Math.pow(H+1,2));if(D>=G&&D<(G+1)){C+="Right";B[I]=1;F[I]=D-G;++I}D=Math.sqrt(E-Math.pow(G,2));if(D>=H&&D<(H+1)){C+="Bottom";B[I]=D-H;F[I]=0}switch(C){case"LeftRight":J=Math.min(F[0],F[1])+((Math.max(F[0],F[1])-Math.min(F[0],F[1]))/2);break;case"TopRight":J=1-(((1-B[0])*(1-F[1]))/2);break;case"TopBottom":J=Math.min(B[0],B[1])+((Math.max(B[0],B[1])-Math.min(B[0],B[1]))/2);break;case"LeftBottom":J=F[0]*B[1]/2;break;default:J=1}return J};curvyObject.rgb2Array=function(A){var B=A.substring(4,A.indexOf(")"));return B.split(", ")};curvyObject.rgb2Hex=function(B){try{var C=curvyObject.rgb2Array(B);var G=parseInt(C[0]);var E=parseInt(C[1]);var A=parseInt(C[2]);var D="#"+curvyObject.IntToHex(G)+curvyObject.IntToHex(E)+curvyObject.IntToHex(A)}catch(F){var H="getMessage" in F?F.getMessage():F.message;throw new Error("Error ("+H+") converting RGB value to Hex in rgb2Hex")}return D};curvyObject.setOpacity=function(F,C){C=(C==100)?99.999:C;if(curvyBrowser.isSafari&&F.tagName!="IFRAME"){var B=curvyObject.rgb2Array(F.style.backgroundColor);var E=parseInt(B[0]);var D=parseInt(B[1]);var A=parseInt(B[2]);F.style.backgroundColor="rgba("+E+", "+D+", "+A+", "+C/100+")"}else{if(typeof F.style.opacity!=="undefined"){F.style.opacity=C/100}else{if(typeof F.style.MozOpacity!=="undefined"){F.style.MozOpacity=C/100}else{if(typeof F.style.filter!="undefined"){F.style.filter="alpha(opacity="+C+")"}else{if(typeof F.style.KHTMLOpacity!="undefined"){F.style.KHTMLOpacity=C/100}}}}}};function addEvent(D,C,B,A){if(D.addEventListener){D.addEventListener(C,B,A);return true}if(D.attachEvent){return D.attachEvent("on"+C,B)}D["on"+C]=B;return false}curvyObject.getComputedColour=function(E){var F=document.createElement("DIV");F.style.backgroundColor=E;document.body.appendChild(F);if(window.getComputedStyle){var D=document.defaultView.getComputedStyle(F,null).getPropertyValue("background-color");F.parentNode.removeChild(F);if(D.substr(0,3)==="rgb"){D=curvyObject.rgb2Hex(D)}return D}else{var A=document.body.createTextRange();A.moveToElementText(F);A.execCommand("ForeColor",false,E);var B=A.queryCommandValue("ForeColor");var C="rgb("+(B&255)+", "+((B&65280)>>8)+", "+((B&16711680)>>16)+")";F.parentNode.removeChild(F);A=null;return curvyObject.rgb2Hex(C)}};curvyObject.format_colour=function(A){if(A!=""&&A!="transparent"){if(A.substr(0,3)==="rgb"){A=curvyObject.rgb2Hex(A)}else{if(A.charAt(0)!=="#"){A=curvyObject.getComputedColour(A)}else{if(A.length===4){A="#"+A.charAt(1)+A.charAt(1)+A.charAt(2)+A.charAt(2)+A.charAt(3)+A.charAt(3)}}}}return A};curvyCorners.getElementsByClass=function(H,F){var E=new Array;if(F===undefined){F=document}H=H.split(".");var A="*";if(H.length===1){A=H[0];H=false}else{if(H[0]){A=H[0]}H=H[1]}var D,C,B;if(A.charAt(0)==="#"){C=document.getElementById(A.substr(1));if(C){E.push(C)}}else{C=F.getElementsByTagName(A);B=C.length;if(H){var G=new RegExp("(^|\\s)"+H+"(\\s|$)");for(D=0;D<B;++D){if(G.test(C[D].className)){E.push(C[D])}}}else{for(D=0;D<B;++D){E.push(C[D])}}}return E};if(curvyBrowser.isMoz||curvyBrowser.isWebKit){var curvyCornersNoAutoScan=true}else{curvyCorners.scanStyles=function(){function B(F){var G=/^[\d.]+(\w+)$/.exec(F);return G[1]}var E,D,C;if(curvyBrowser.isIE){function A(L){var J=L.style;if(curvyBrowser.ieVer>6){var H=J["-webkit-border-radius"]||0;var K=J["-webkit-border-top-right-radius"]||0;var F=J["-webkit-border-top-left-radius"]||0;var G=J["-webkit-border-bottom-right-radius"]||0;var M=J["-webkit-border-bottom-left-radius"]||0}else{var H=J["webkit-border-radius"]||0;var K=J["webkit-border-top-right-radius"]||0;var F=J["webkit-border-top-left-radius"]||0;var G=J["webkit-border-bottom-right-radius"]||0;var M=J["webkit-border-bottom-left-radius"]||0}if(H||F||K||G||M){var I=new curvyCnrSpec(L.selectorText);if(H){I.setcorner(null,null,parseInt(H),B(H))}else{if(K){I.setcorner("t","r",parseInt(K),B(K))}if(F){I.setcorner("t","l",parseInt(F),B(F))}if(M){I.setcorner("b","l",parseInt(M),B(M))}if(G){I.setcorner("b","r",parseInt(G),B(G))}}curvyCorners(I)}}for(E=0;E<document.styleSheets.length;++E){if(document.styleSheets[E].imports){for(D=0;D<document.styleSheets[E].imports.length;++D){for(C=0;C<document.styleSheets[E].imports[D].rules.length;++C){A(document.styleSheets[E].imports[D].rules[C])}}}for(D=0;D<document.styleSheets[E].rules.length;++D){A(document.styleSheets[E].rules[D])}}}else{if(curvyBrowser.isOp){for(E=0;E<document.styleSheets.length;++E){if(operasheet.contains_border_radius(E)){C=new operasheet(E);for(D in C.rules){if(!isNaN(D)){curvyCorners(C.rules[D])}}}}}else{curvyCorners.alert("Scanstyles does nothing in Webkit/Firefox")}}};curvyCorners.init=function(){if(arguments.callee.done){return}arguments.callee.done=true;if(curvyBrowser.isWebKit&&curvyCorners.init.timer){clearInterval(curvyCorners.init.timer);curvyCorners.init.timer=null}curvyCorners.scanStyles()}}if(typeof curvyCornersNoAutoScan==="undefined"||curvyCornersNoAutoScan===false){if(curvyBrowser.isOp){document.addEventListener("DOMContentLoaded",curvyCorners.init,false)}else{addEvent(window,"load",curvyCorners.init,false)}};
initCorners=function(){
  var settings={
    tl:{radius:20},tr:{radius:20},bl:{radius:20},br:{radius:20},antiAlias:true
  };curvyCorners(settings, "#popup_screen");
};

var lastModified=document.lastModified;

getObjValues=function(obj){
  var values='';
  for(var i=0;i<obj.options.length;i++){
    with(obj.options[i]){
      if(selected&&value!==''){
        if(values!==''){values+=','};values+=value;
      };
    };
  };return values;
};


//----------------------------
// Begin: Date picker
//----------------------------
var Calendar={
  buildCal:function(id,d, m, y, cM, cH, cDW, cD, brdr,func,layer){
    /*
    var mn=['January','February','March','April','May','June','July','August','September','October','November','December'];
    var dim=[31,0,31,30,31,30,31,31,30,31,30,31];
    var oD = new Date(y, m-1, 1); //DD replaced line to fix date bug when current day is 31st
    oD.od=oD.getDay()+1; //DD replaced line to fix date bug when current day is 31st
    //oD.od=d; //DD replaced line to fix date bug when current day is 31st

    var todaydate=new Date(); //DD added
    var scanfortoday=(y==todaydate.getFullYear() && m==todaydate.getMonth()+1)? todaydate.getDate():0; //DD added
    dim[1]=(((oD.getFullYear()%100!=0)&&(oD.getFullYear()%4==0))||(oD.getFullYear()%400==0))?29:28;
    var t='<div class="'+cM+'"><table class="'+cM+'" cols="7" cellpadding="0" border="'+brdr+'" cellspacing="0"><tr align="center">';
    t+='<td colspan="7" align="center" class="'+cH+'">'+mn[m-1]+' - '+y+'</td></tr><tr align="center">';
    for(s=0;s<7;s++){
      t+='<td class="'+cDW+'">'+"SMTWTFS".substr(s,1)+'</td>';
    };
    t+='</tr><tr align="center">';
    for(i=1;i<=42;i++){
    var x=((i-oD.od>=0)&&(i-oD.od<dim[m-1]))? i-oD.od+1 : '&nbsp;';
      if(x==scanfortoday){//DD added
        x='<span id="today">'+x+'</span>' //DD added
        t+='<td class="'+cD+'">'+x+'</td>';
      }
      if(((i)%7==0)&&(i<36))t+='</tr><tr align="center">';
    };
    return t+='</tr></table></div>';
    */
    var mn=['January','February','March','April','May','June','July','August','September','October','November','December'];
    var arrMonth=['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec'];
    var dim=[31,0,31,30,31,30,31,31,30,31,30,31];
    var sClass='',sMonth,sC;
    var oD = new Date(y, m-1, 1); //DD replaced line to fix date bug when current day is 31st
    oD.od=oD.getDay()+1; //DD replaced line to fix date bug when current day is 31st

    var todaydate=new Date() //DD added
    var scanfortoday=(y==todaydate.getFullYear() && m==todaydate.getMonth()+1)? todaydate.getDate() : 0 //DD added

    dim[1]=(((oD.getFullYear()%100!=0)&&(oD.getFullYear()%4==0))||(oD.getFullYear()%400==0))?29:28;
    var t='<div class="'+cM+'"><table class="'+cM+'" cols="7" cellpadding="0" border="'+brdr+'" cellspacing="0"><tr align="center">';
    t+='<td colspan="7" align="center" class="'+cH+'">'+mn[m-1]+' - '+y+'</td></tr><tr align="center">';
    for(s=0;s<7;s++)t+='<td class="'+cDW+'">'+"SMTWTFS".substr(s,1)+'</td>';
    t+='</tr><tr align="center">';
    for(i=1;i<=42;i++){
      var x=((i-oD.od>=0)&&(i-oD.od<dim[m-1]))?i-oD.od+1:'&nbsp;';
      sClass='';
      if(x==d){ //DD added
        sClass='id="today"';
        sC='selected';
      }
      else{
        sC=cD;
      };
      sMonth=arrMonth[m-1]; //'jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec'.split(',')[m-1];

      if(x=='&nbsp;'){
        t+='<td class="'+sC+'"><span '+sClass+'>'+x+'</span></td>';
      }
      else{
        t+='<td class="'+sC+'" style="cursor:pointer;" onclick=setDate("'+id+'","'+layer+'","'+(x+"-"+sMonth+"-"+y)+'");>'+
           '<span '+sClass+
           ' onmouseover="this.style.textDecoration=\'underline\';"'+
           ' onmouseout="this.style.textDecoration=\'none\';">'+x+'</span></td>';
      };
      if(((i)%7==0)&&(i<36))t+='</tr><tr align="center">';
    }
    return t+='</tr></table></div>';
  }
};
calendar=function(id,layer,date){
  var FCalendar='';
  if(date.indexOf('[')==-1&&date!==''){
    var arrDate=date.split('-');
    var d,m,y;
    var todaydate=new Date()
    d=todaydate.getDay();     //get current day (1-..)
    m=todaydate.getMonth()+1; //get current month (1-12)
    y=todaydate.getFullYear(); //get current year
    if(arrDate.length==3){
      d=arrDate[0];    
      m=arrDate[1];
      if('jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec'.indexOf(m)){
        var arrMonth='jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec'.split(',');
        for(var i=0;i<arrMonth.length;i++){
          if(m==arrMonth[i]){m=i+1;};
        }      
      };
      y=arrDate[2];
    };
    FCalendar=Calendar.buildCal(id,d,m,y,"main","month","daysofweek","days",1,'setDate',layer);
    //FCalendar=d+'-'+m+'-'+y;
  };
  return FCalendar;
};

//----------------------------
// End: Date picker
//----------------------------


//----------------------------
// Begin: Drag Drop
//----------------------------
function $(v) { return(document.getElementById(v)); }
function agent(v) { return(Math.max(navigator.userAgent.toLowerCase().indexOf(v),0)); }
function xy(e,v) { return(v?(agent('msie')?event.clientY+document.body.scrollTop:e.pageY):(agent('msie')?event.clientX+document.body.scrollTop:e.pageX));}
function dragOBJ(AObj, AEvent){
  if(IsObject(AObj)==true){	  
    var d = GetObj(AObj);
	  function drag(AEvent){
	    if(!stop){d.style.top=(tX=xy(AEvent,1)+oY-eY+'px'); d.style.left=(tY=xy(AEvent)+oX-eX+'px');
	    } 
	  }
	  var oX=parseInt(d.style.left),oY=parseInt(d.style.top),eX=xy(AEvent),eY=xy(AEvent,1),tX,tY,stop;
	  document.onmousemove=drag; document.onmouseup=function(){ stop=1; document.onmousemove=''; document.onmouseup=''; };
  }
}
//----------------------------
// End: Drag Drop
//----------------------------


var Page={
  // private property  
  CapsLock_Div:'show_capslock',  
  Timer_Auth:null,  
  unicode:function(e){
    return e.charCode?e.charCode:e.keyCode;
  },
  // public method for mouse top
  mouseTop:function(AEvent){
	  var FPos = 0;
	  var e=AEvent; //window.event;
	  if(e.pageY){FPos=e.pageY;}
	  else if(e.clientY){FPos=e.clientY+document.body.scrollTop+document.documentElement.scrollTop;};
	  return FPos;
  },
  // public method for mouse left
  mouseLeft:function(AEvent){
	  var FPos=0;
	  var e=AEvent; //window.event;
	  if(e.pageX){FPos=e.pageX;}
	  else if(e.clientX){FPos=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;};
	  return FPos;
  },
  // public method for check CAPSLOCK
  checkCapsLock:function(AEvt){
	  if(GetObj(Page.CapsLock_Div)){
	    var OCapslock = GetObj(Page.CapsLock_Div);
	    var FDisplay='none';
	    var unicode=AEvt.charCode?AEvt.charCode:AEvt.keyCode;
	    var shiftKey=(AEvt.shiftKey)?AEvt.shiftKey:(unicode==16);
	    if((unicode>=65 && unicode<=90) && !shiftKey){FDisplay='inline';}
	    // Lower case letters are seen while depressing the Shift key, therefore Caps Lock is on
	    else if((unicode>=97 && unicode<=122) && shiftKey){FDisplay='inline';};
	    OCapslock.style.display=FDisplay;
    };
  },
  // public method for check enter event
  enter:function(AEvt, AFunction){
    var myKeyCode=0;
    // Internet Explorer 4+
    if(document.all){myKeyCode=AEvt.keyCode;}
    // Netscape 4
    else if(document.layers){myKeyCode=AEvt.which;}
    // Netscape 6
    else if(document.getElementById){myKeyCode=AEvt.which;}
    // Upper case letters are seen without depressing the Shift key, therefore Caps Lock is on
    if(myKeyCode==13){eval(AFunction)}
  },
  // public method for field chooser
  fieldChoser:function(AFieldUp, AFieldDown, AEvent, AObj){
    var FChange=false;
    if(typeof(AObj)=='object'){FChange=true;AObj.style.border='groove 1px #0c74cc';}
    switch(AEvent.keyCode){
		  case 38:if(IsObject(AFieldUp)==true){with(GetObj(AFieldUp)){if(FChange==true){style.border='solid 2px blue';}focus();select();}};break;
		  case 40:if(IsObject(AFieldDown)==true){with(GetObj(AFieldDown)){if(FChange==true){style.border='solid 2px blue';}focus();select();}};break;
	  }
  },
  // public method for show characters
  showCharacters:function(AObj,AMaxlimit){
    var FLength;
    var oShowLength=GetObj('show_length');
    if(AObj&&oShowLength){
      FLength=AObj.value.length;      
      oShowLength.innerHTML=(AMaxlimit-FLength);
	    if(FLength>=AMaxlimit){ // if too long...trim it!
		    AObj.value=AObj.value.substring(0,AMaxlimit);
		  };
    };
  },
  textCounter:function(AField,ACountField,maxlimit){
	  var oObj=GetObj(AField);
	  var oCountObj=GetObj(ACountField);
	  var FLeft=maxlimit;
	  if(oObj && oCountObj){
  	  FLeft=(maxlimit-oObj.value.length);	  
	    if(oObj.value.length>maxlimit){oObj.value=oObj.value.substring(0,maxlimit);FLeft=0;};
	    oCountObj.innerHTML=FLeft;
	  };
  },  
  // public method for the document height
  height:function(){
    var FFrameHeight=0; // = new String()
    var FObj = document.documentElement;
    if(document.all){FFrameHeight=FObj.offsetHeight;}
    //if(typeof(window.innerHeight)=='number'){FFrameHeight=window.innerHeight;}
    else{
      if (self.innerWidth){FFrameHeight = self.innerHeight;}
      else if (FObj && FObj.clientHeight){FFrameHeight=FObj.clientHeight;}
      else if (document.body){FFrameHeight = document.body.clientHeight;}
    }
    return FFrameHeight;
  },
  // public method for the document width
  width:function(){
    var FFrameWidth = new String()
    var FObj = document.documentElement;
    if(document.all){FFrameWidth=FObj.offsetWidth;}
    //if(typeof(window.innerWidth)=='number'){FFrameHeight=window.innerWidth;}
    else{
      if (self.innerWidth){FFrameWidth = self.innerWidth;}
      else if (FObj && FObj.clientWidth){FFrameWidth=FObj.clientWidth;}
      else if (document.body){FFrameWidth = document.body.clientWidth;}
    }
    return FFrameWidth;
  },
  checkAuthorized:function(){
    var oAuth=GetObj('auth');
    var oWebSite=GetObj('web_site');
    var webSite='';
    if(oAuth&&oWebSite){
      loadMainPage('login|login','');
      webSite=oWebSite.value;
      if(webSite.substr(webSite.length-1,1)!=='/'){webSite+='/';};
      goToPage(oWebSite.value+'/div/login/login.asp');
    };
    Page.Timer_Auth=setTimeout('checkAuthorized()',10000);
  }
};
//Begin: Page
unicode=function(AEvt){return Page.unicode(AEvt);};
mouseTop=function(AEvt){return Page.mouseTop(AEvt);};
mouseLeft=function(AEvt){return Page.mouseLeft(AEvt);};
checkCapsLock=function(AEvt){Page.checkCapsLock(AEvt);};
enter=function(AEvt, AFunction){Page.enter(AEvt, AFunction);};
fieldChoser=function(AFieldUp, AFieldDown, AEvent, AObj){Page.fieldChoser(AFieldUp, AFieldDown, AEvent, AObj);};
fieldChoserIsValidFloat=function(){}
showCharacters=function(AObj, AMaxlimit){Page.showCharacters(AObj, AMaxlimit);};
textCounter=function(field, countfield, maxlimit){return Page.textCounter(field, countfield, maxlimit);};
docHeight=function(){return Page.height();};
docWidth=function(){return Page.width();};
checkAuthorized=function(){Page.checkAuthorized();};
//End: Page



setEventByID=function(id,ev,fu,params){
  var arrEvents=ev.split(',');
  var arrID=id.split(',');
  for(var j=0;j<arrID.length;j++){
    var oEvt=new GetObj(arrID[j]);
    if(oEvt.id!==''){
      for(var i=0;i<arrEvents.length;i++){
        ev=arrEvents[i];
        if(typeof(fu)=='function'){
          if(oEvt.addEventListener){oEvt.addEventListener(ev, fu, false);}
          else if(oEvt.attachEvent){oEvt.attachEvent('on'+ev, fu);};
        }
        else{
          if(oEvt.addEventListener){oEvt.addEventListener(ev, function(){ eval(fu+'("'+params+'")') }, false);}
          else if(oEvt.attachEvent){oEvt.attachEvent('on'+ev, function(){ eval(fu+'("'+params+'")') });}
        };
      };
    };
  };
};


//Begin: Color,Border,BgColor
var Color={normal:'#0c74cc',error:'#ffffff'};
var Border={normal:'groove 1px #0c74cc',error:'solid 1px #ff0000'};
var BgColor={normal:'#e6f1fa',error:'#ff0000'};
var ErrNr={
  border:1,
  bgColor:2,
  border_bgColor:3
};
MyBorder=function(AObj){
  this.obj=GetObj(AObj);
  this.value=this.obj.value;
  this.color=Color.normal;
  this.border=Border.normal;
  this.bgColor=BgColor.normal;
  this.error=function(errNr){
    switch(errNr){
      case 1:this.border=Border.error;break;
      case 2:this.color=Color.error;this.bgColor=BgColor.error;break;
      case 3:this.border=Border.error;this.color=Color.error;this.bgColor=BgColor.error;break;
    };
  };
  this.Border=function(){
    this.color=Color.error;
    this.bgColor=BgColor.error;    
  };
  this.PrintObj=function(){
    this.obj.style.border=this.border;
    this.obj.style.color=this.color;
    this.obj.style.backgroundColor=this.bgColor;
  };
};
//End: Border,BgColor


var MyFunc={
  // private property
  // public method for encoding
  replaceAll:function(AString, ASearch, AReplace){
    var st = AString;
    if(ASearch.length == 0){return st;}
    var idx = st.indexOf(ASearch);
    while (idx >= 0){
      st  = st.substring(0,idx) + AReplace + st.substr(idx+ASearch.length);
      idx = st.indexOf(ASearch);
    }
    return st;
  },
  // public method for full script path
  getFullScriptPath:function(script){
    var i=0,p='';
    var scrA=document.getElementsByTagName('script')
    while(scrA[i]){ 
      var src= scrA[i].src
      if(src && src.lastIndexOf(script)>=0){p=src.substring(0,src.lastIndexOf(script)); break;}
      i++;
    };
    if(p.indexOf("://")>=0||p.indexOf("/")==0){return p;}
    p=p.replace(/^\.\//,"/");

    var href= document.location.href;
    if(href.indexOf('?')>=0) href= href.substring(0,href.indexOf('?'));
    href=href.substring(0,href.lastIndexOf('/'));

    if(p=='.' || p==''){return href}
    else if(p.indexOf('..')>=0){
      var sub='';
      if(p.length>2) sub= p.substr(p.lastIndexOf('../')+2)
      var temp= p.split('..')
      for( var i=1; i<temp.length;i++){ 
        href= href.substring(0,href.lastIndexOf('/')); 
      }
      if(sub!='/..'){href+=sub}
    }
    else if(p!=''){href+=p;}
    return href;
  },
  checkEmail:function(AEmail){
    var FAtFirst = AEmail.indexOf('@');
    var FLastAt  = AEmail.lastIndexOf('@');
    var FLastDot = AEmail.lastIndexOf('.');
    var FSpace   = AEmail.indexOf(' ');
    var FInvalidChars = ', <>!#$%^&*()+';
    var FChar = 0;
    for(var IChar=0;IChar<FInvalidChars.length;IChar++){
      if(AEmail.indexOf(FInvalidChars[IChar])>0){FChar=1;break;}
    };
    return (FChar==0 && FAtFirst>0 && FAtFirst==FLastAt && (FLastDot>FAtFirst) && (AEmail.length>(FLastDot+2)));
  },
  checkEmails:function(AEmail){
    var arrEmail=AEmail.split(';');
    var FErrEmails='';
    var FEmail;
    for(var i=0;i<arrEmail.length;i++){
      FEmail=trim(arrEmail[i]);
      if(checkEmail(FEmail)==false){
        FErrEmails+='['+FEmail+']';
      };
    };
    if(FErrEmails!==''){
      FErrEmails=replaceAll(FErrEmails,'][',', ');
      FErrEmails=replaceAll(FErrEmails,'[','');
      FErrEmails=replaceAll(FErrEmails,']','');
    };
    return FErrEmails;
  }
};
//Begin: MyFunc
replaceAll=function(AString, ASearch, AReplace){return MyFunc.replaceAll(AString, ASearch, AReplace);};
getFullScriptPath=function(AScript){return MyFunc.getFullScriptPath(AScript);};
checkEmail=function(AEmail){return MyFunc.checkEmail(AEmail);};
checkEmails=function(AEmail){return MyFunc.checkEmails(AEmail);};
//End: MyFunc

var Obj={
  // private property
  // public method for get an object
  GetObj:function(AObj){return document.getElementById(AObj)},
  showDiv:function(AObj,AShow){var oObj=Obj.GetObj(AObj);if(oObj){oObj.style.display=(AShow==true)?'inline':'none';};},
  GetObjName:function(AObj){return document.getElementsByName(AObj)},
  // public method for set an object
  SetObj:function(AObj, ANewObj){
    var FValue='';
    if(IsObject(AObj)==true && IsObject(ANewObj)==true){
      FValue=GetObj(ANewObj).value;
      GetObj(AObj).value=FValue;
    }
    return FValue;
  },
  // public method for to update an object
  UpdObj:function(AObjNames, ASuffix){
    var FObjName;
    var arrObjNames = AObjNames.split(',');
    for(var i=0;i<=arrObjNames.length;i++){
      FObjName = arrObjNames[i];
      if(IsObject(FObjName)==true && IsObject(ASuffix+FObjName)==true){
        GetObj(ASuffix+FObjName).value = GetObj(FObjName).value;
      }
    }
  },
  // public method to check a object
  IsObject:function(ALayer){
    var FObj = GetObj(ALayer);
    var FStr = new String();    
    if (FObj==null){FStr=''}else{FStr=FObj.toString()};    
    if(FStr.length>5){FStr=FStr.substring(1,7)};  
    return (FStr=='object');
  },
  // public method to check objects
  IsObjects:function(ALayers){
    var arrObj=ALayers.split(',');
    for(var i=0;i<arrObj.length;i++){if(IsObject(arrObj[i])==false){return false};}
    return true;
  },
  // public method to get objects
  GetObjects:function(ASearch){
    var FParams  = new String();
    var FObjects = new String();
    var FSearch  = new String();   
    FObjects='';
    var arrSearch = ASearch.split(',');
    for(var ISearch=0;ISearch<arrSearch.length;ISearch++){
      FSearch = arrSearch[ISearch];
      for (var IObject=0;IObject<document.forms[0].length;IObject++){
        with (document.forms[0][IObject]){
          if(FSearch!==''){
            if(id!==""){if(id.indexOf(FSearch)>-1){if (id!==""){if(FObjects!==""){FObjects+=","}FObjects+=id;}}}
            if(name!==""){if(name.indexOf(FSearch)>-1){if (name!==""){if(FObjects!==""){FObjects+=","}FObjects+=name;}}}
          }
          else{
            if (id!==""){if(FObjects!==""){FObjects+=","}FObjects+=id;}
            if (name!==""){if(FObjects!==""){FObjects+=","}FObjects+=name;}
          }
        }
      }
    }
    return FObjects;
  },
  // public method to create an input object
  createInput:function(AElem, ADiv, AHidden){
    var oObj = document.createElement('input');
    var FType = 'text';
    if(AHidden==true){FType='hidden';}
    oObj.setAttribute('type', FType);
    oObj.setAttribute('id', AElem);
    oObj.setAttribute('value', '');    
    ADiv.appendChild(oObj);
  },
  // public method to create an textarea object
  createTextArea:function(AElem, ADiv, AHidden){
    var oObj = document.createElement('textarea');
    oObj.setAttribute('id', AElem);
    if(AHidden==true){oObj.setAttribute('style', 'display:none');}
    ADiv.appendChild(oObj);
  },
  showTime:function(AUtc, ALayer){
    var FTime, h, m, s;
    var today=new Date();
    if(arguments.length>0){AUtc=arguments[0];}
    if(arguments.length>1){ALayer=arguments[1];}
    if(ALayer==''){ALayer='show_time';}
    if(AUtc==''){AUtc=true;}
    with(today){
      if(AUtc==true){h=getUTCHours();m=getUTCMinutes();s=getUTCSeconds();}
      else{h=getHours();m=getMinutes();s=getSeconds();};
    };
    h=h.toString();
    m=m.toString();
    s=s.toString();
    if(h.length==1){h='0'+h};
    if(m.length==1){m='0'+m};
    if(s.length==1){s='0'+s};
    FTime=h+':'+m+':'+s;
    if(AUtc=='true'||AUtc=='1'){FTime+=' UTC'};
    t=setTimeout('showTime("'+AUtc+'","'+ALayer+'")',500);
    if(IsObject(ALayer)==true){GetObj(ALayer).innerHTML=FTime;};
  }  
}
//Begin: Obj
GetObj=function(AObj){return Obj.GetObj(AObj);};
showDiv=function(AObj,AShow){Obj.showDiv(AObj,AShow);};
GetObjName=function(AObj){return Obj.GetObjName(AObj);};
SetObj=function(AObj, ANewObj){return Obj.SetObj(AObj, ANewObj)};
IsObject=function(ALayer){return Obj.IsObject(ALayer);};
IsObjects=function(ALayer){return Obj.IsObjects(ALayer);};
GetObjects=function(ASearch){return Obj.GetObjects(ASearch);};
createInput=function(AElem, ADiv, AHidden){Obj.createInput(AElem,ADiv,AHidden);};
createTextArea=function(AElem, ADiv, AHidden){Obj.GetObj(AElem,ADiv,AHidden);};
showTime=function(AUtc,ALayer){Obj.showTime(AUtc,ALayer)};
//End: Obj


var MyDaysFunc={
  // private property    
  // public method for get last day
  GetLastDay:function(month, year){
	  month++;
	  if (month>12){
		  month -= 12;
		  year++;
	  };
	  var x = new Date(month+"/1/"+year);
	  x = new Date(x.valueOf()-(1000*60*60*24));	
	  return x.getDate();
  },
  GetDaysInMonth:function(month, year){
	  var dim=[31,0,31,30,31,30,31,31,30,31,30,31];
	  dim[1]=(((year%100!=0)&&(year%4==0)) || (year%400==0))?29:28;
	  return dim[month-1];
  }  
}
//Begin: MyDaysFunc
GetLastDay=function(month,year){return MyDaysFunc.GetLastDay(month,year);};
GetDaysInMonth=function(month,year){return MyDaysFunc.GetDaysInMonth(month,year);};
//End: MyDaysFunc


var FormatTimeFunc={
  // private property    
  // public method for get last day
  formatTime:function(obj){
	  var FResult = false;
	  var FTime		= new String("");
  	
    var oObj=GetObj(obj);
	  if(oObj){FTime=oObj.value;}
	  else{FTime=obj;};  	
	  if((FTime!=='')&&(typeof(FTime)=='string')){	
		  FTime=trim(FTime);		
		  FTime=FTime.replace('[', '');
		  FTime=FTime.replace(']', '');
		  var saTime=FTime.split(':');
		  var FHours='';
		  var FMinutes='';
		  if(FTime!==''){
			  switch(saTime.length){
				  case 1:FHours=saTime[0];FMinutes='00';break;
				  default:FHours=saTime[0];FMinutes=saTime[1];break;
			  };
			  if((IsNumeric(FHours)==true)&&(IsNumeric(FMinutes)==true)){
				  if((FHours>-1)&&(FHours<24)&&(FMinutes>-1)&&(FMinutes<60)){
					  if(FHours.length==1){FHours='0'+FHours;};
					  FHours=Left(FHours,2);
					  if(FMinutes.length==1){FMinutes='0'+FMinutes;};
					  FMinutes=Left(FMinutes,2);
					  FTime=trim(FHours+':'+FMinutes);		
					  FResult=true;
				  };
			  };
		  };	
	  };
	  if(FResult==false){FTime='';};
	  if(oObj){oObj.value=FTime;}
	  else{return FTime};
  },
  formatDate:function(obj,langID){
	  var FDate='';
    var arrMonth;
    var sMonth='jan=0|feb=1|mar=2|mrt=2|apr=3|may=4|mei=4|jun=5|jul=6|aug=7|sep=8|oct=9|okt=9|nov=10|dec=11';
    arrMonth=sMonth.split('|');

    var oObj=GetObj(obj);
	  if(oObj){FDate=oObj.value;}
	  else{FDate=obj;};
	  FDate=FDate.toLowerCase();

	  if((FDate!=='')&&(typeof(FDate)=='string')){
		  FDate=trim(FDate);  		
		  FDate=FDate.replace('[','');
		  FDate=FDate.replace(']','');
		  var saDate=(FDate.indexOf(' ')>-1)?FDate.split(' '):FDate.split('-');
		  var FLength=saDate.length;	
		  var FDays,FDay,FMonth,FYear,FTemp;
		  var IMonth=-1;  	
		  if(FDate!==''){
			  var today=new Date();
				FDay=today.getDay();
        FMonth=today.getMonth()+1;
        FYear=today.getFullYear();
			  switch(FLength){
				  case 1:FDay=saDate[0];break;
				  case 2:FDay=saDate[0];FMonth=saDate[1];break;
				  case 3:FDay=saDate[0];FMonth=saDate[1];FYear=saDate[2];break;
				  default:
            if(saDate.length>1){
              FDay=saDate[0];FMonth=saDate[1];FTemp=saDate[2];
					    if(FTemp.length<4){FYear=Left(FYear,4-FTemp.length)+FTemp;};
					  };break;
			  };
        var arrItem,month;
        for(var i=0;i<arrMonth.length;i++){				  
          arrItem=arrMonth[i].split('=');
          if(arrItem.length==2){
            if(FMonth==arrItem[0]){IMonth=arrItem[1];break;};
          };
          /*
          if(FMonth==arrMonth[i]){IMonth=i;break;}
				  if(FMonth==Left(arrMonth[i],1)){IMonth=i;break;}
				  if(FMonth==Left(arrMonth[i],2)){IMonth=i;break;}
          */
			  };
			  if(IMonth==-1){
				  for(var i=0;i<arrMonth.length;i++){
            arrItem=arrMonth[i].split('=');
            if(arrItem.length==2){
              if(FMonth==arrItem[0]){IMonth=arrItem[1];break;};
            };
					  /*
            if(FMonth==arrMonth[i]){IMonth=i;break;}
					  if(FMonth==Left(arrMonth[i],1)){IMonth=i;break;}
					  if(FMonth==Left(arrMonth[i],2)){IMonth=i;break;}
            */
				  };
			  };
        if(isNumeric(FMonth)==true){
				  if((FMonth>0)&&(FMonth<13)){IMonth=FMonth-1;};
			  };
			  if(isNumeric(FDay)==false){FDay='['+FDay+']';};
			  if(IMonth==-1){FMonth='['+FMonth+']';};
			  if(isNumeric(FYear)==false){FYear='['+FYear+']';};
			  if((IMonth>-1) && (IMonth<13)){
          sMonth='jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec';
          arrMonth=sMonth.split('|');
          FMonth=arrMonth[IMonth];
        };  				

			  if((isNumeric(FDay)==true)&&(isNumeric(IMonth)==true)&&(isNumeric(FYear)==true)){			    
			    if(parseInt(FDay)>GetDaysInMonth(IMonth+1,FYear)){FDay='['+FDay+']';};
		    };
			  FDate=trim(FDay+'-'+FMonth+'-'+FYear);
		  };
	  };
	  if(oObj){oObj.value=FDate;}
	  else{return FDate};
  },
  formatDateTime:function(obj,langID){
	  var FValue='';
	  var FDate='';
	  var FTime='';
    
    var oObj=GetObj(obj);
	  if(oObj){FValue=oObj.value;}
	  else{FValue=obj;};
	  FValue=FValue.toLowerCase();

	  if(FValue!==''&&typeof(FValue)=='string'){	
		  FValue=trim(FValue);
		  FValue=FValue.replace('[','');
		  FValue=FValue.replace(']','');
		  FValue=FValue.split(' ');
		  if(FValue.length>0){FDate=FValue[0];};
		  if(FValue.length>1){FTime=FValue[1];};
      if(FDate!==''){FDate=FormatTimeFunc.formatDate(FDate,langID);};
		  if(FTime!==''){FTime=FormatTimeFunc.formatTime(FTime);};
		  if(FDate!=='' && FTime!==''){FDate=FDate+' '+FTime;};
	  };
	  if(oObj){oObj.value=FDate;}
	  else{return FDate};
  }
}
//Begin: FormatTimeFunc
formatDate=function(obj,langID){return FormatTimeFunc.formatDate(obj,langID);};
formatTime=function(obj){return FormatTimeFunc.formatTime(obj);};
formatDateTime=function(obj,langID){return FormatTimeFunc.formatDateTime(obj,langID);};
//End: FormatTimeFunc



var FormatFunc={
  // private property  
  
  // Removes leading whitespaces
  LTrim:function(value){
	  var re = /\s*((\S+\s*)*)/;
	  return value.replace(re, "$1");
  },
  // Removes ending whitespaces
  RTrim:function(value){
	  var re = /((\s*\S+)*)\s*/;
	  return value.replace(re, "$1");
  },
  // Removes leading and ending whitespaces
  trim:function(value){
	  return FormatFunc.LTrim(FormatFunc.RTrim(value));
  },    
  Left:function(str,n){
	  if(n<=0){return '';}
	  else if(n>String(str).length){return str;}
	  else{return String(str).substring(0,n);};
  },
  Right:function(str,n){
    if(n<=0){return '';}
    else if(n>String(str).length){return str;}
    else{
      var iLen=String(str).length;
      return String(str).substring(iLen,iLen-n);
    };
  },
  formatFloat:function(AValue){
    var FFloat=new Number();
    var FFixed=2;
    if(arguments.length>1){FFixed=arguments[1];};
    FFloat='0';  
    if(AValue!==''){
      FFloat = parseFloat(AValue.split(',').join(''));
      FFloat=FFloat.toFixed(FFixed);
    };
    return FFloat;
  },
  checkValidFloat:function(AValue){
    var FValid=true;
    var arrFloat=AValue.split(',');
    if(arrFloat.length>0){
      for(var i=1;i<arrFloat.length;i++){
        if(arrFloat[i].length<3){FValid=false;}
      };
    };  
    return FValid;
  },  
  checkFloat:function(AObj){
    var FValue  =new String('');
    var FOutput ='0';
    var FFixed  =2;
    if(arguments.length>1){FFixed=arguments[1]}
    if(typeof(AObj)=='object'){FValue=AObj.value;};
    if(typeof(AObj)=='string'){FValue=AObj};
    if(FValue!==''){
      var FFloat=new Number();
      FValue=FValue.split(',').join('');
      FFloat=parseFloat(FValue);
      FFloat=FFloat.toFixed(FFixed);
      var arrFloat=FFloat.split('.');
      FOutput=FormatFunc.addCommas(arrFloat[0])+'.'+arrFloat[1];
    };
    if(typeof(AObj)=='object'){AObj.value=FOutput;}else{return FOutput;};
  },
  addCommas:function(str){
	  str+='';
	  x=str.split('.');
	  x1=x[0];
	  x2=x.length>1?'.'+x[1]:'';
	  var rgx=/(\d+)(\d{3})/;
	  while(rgx.test(x1)){x1=x1.replace(rgx,'$1'+','+'$2');};
	  return x1+x2;
  },  
  isValidFloat:function(e){
    var FValid='-1234567890.,';
    var unicode=e.charCode? e.charCode:e.keyCode;
    //if(unicode!=8 && unicode!=37 && unicode!=39 && unicode!=44 && unicode!=46){
    if('[8][37][39][44][46]'.indexOf('['+unicode.toString()+']')<0){
      if(FValid.indexOf(String.fromCharCode(unicode))<0){return false}
      else{return true}
    }
  },
  isValidInteger:function(e){
    var FValid='-1234567890';
    var unicode=e.charCode? e.charCode:e.keyCode;
    //if(unicode!=8 && unicode!=37 && unicode!=39 && unicode!=44 && unicode!=46){
    if('[8][37][39][44][46]'.indexOf('['+unicode.toString()+']')<0){
      if(FValid.indexOf(String.fromCharCode(unicode))<0){return false}
      else{return true}
    };
  },
  isNumeric:function(val){return (parseFloat(val,10)==(val*1));},
  IsNumeric:function(AValue){
    var ValidChars='0123456789.';
    var IsNumber=true;
    var Char;
    for(var i=0;i<AValue.length&&IsNumber==true;i++){ 
      Char=AValue.charAt(i);
      if(ValidChars.indexOf(Char)==-1){IsNumber=false;};
    };return IsNumber;
  }
};
//Begin: FormatFunc
trim=function(AStr){return FormatFunc.trim(AStr);};
Left=function(str, n){return FormatFunc.Left(str, n);};
Right=function(str, n){return FormatFunc.Right(str, n);};
formatFloat=function(AValue){return FormatFunc.formatFloat(AValue);};
checkFloat=function(AObj){return FormatFunc.checkFloat(AObj);};
checkValidFloat=function(AValue){return FormatFunc.checkValidFloat(AValue);};
isValidFloat=function(e){return FormatFunc.isValidFloat(e);};
isValidInteger=function(e){return FormatFunc.isValidInteger(e);};
isNumeric=function(val){return FormatFunc.isNumeric(val);};
IsNumeric=function(AValue){return FormatFunc.IsNumeric(AValue)};
//End: FormatFunc



var ListBoxSwapper={
  // private property  
  sortitems:0, // Automatically sort items within lists? (1 or 0)
  // public method for move from listbox to listbox
  move:function(fbox,tbox){
    for(var i=0;i<fbox.options.length;i++){
      if(fbox.options[i].selected&&fbox.options[i].value!=''){
        var no=new Option();
        no.value=fbox.options[i].value;
        no.text=fbox.options[i].text;
        tbox.options[tbox.options.length]=no;
        fbox.options[i].value='';
        fbox.options[i].text='';
      };
    };
    ListBoxSwapper.BumpUp(fbox);
    if(sortitems){ListBoxSwapper.SortD(tbox);};
  },
  BumpUp:function(box){
    for(var i=0; i<box.options.length; i++){
      if(box.options[i].value == ""){
        for(var j=i; j<box.options.length-1; j++){
          box.options[j].value = box.options[j+1].value;
          box.options[j].text = box.options[j+1].text;
        };
        var ln = i;
        break;
      };
    };
    if(ln < box.options.length){
      box.options.length -= 1;
      BumpUp(box);
    };
  },
  SortD:function(box){
    var temp_opts=new Array();
    var temp=new Object();
    for(var i=0;i<box.options.length;i++)  {
      temp_opts[i]=box.options[i];
    };
    for(var x=0;x<temp_opts.length-1;x++){
      for(var y=(x+1);y<temp_opts.length;y++){
        if(temp_opts[x].text>temp_opts[y].text){
          temp=temp_opts[x].text;
          temp_opts[x].text=temp_opts[y].text;
          temp_opts[y].text=temp;
        };
      };
    };
    for(var i=0;i<box.options.length;i++){
      box.options[i].value=temp_opts[i].value;
      box.options[i].text=temp_opts[i].text;
    };
  },
  getObjValues:function(obj){
    var values='';
    for(var i=0;i<obj.options.length;i++) {
      with(obj.options[i]){
        if(selected&&value!==''){
          if(values!==''){values+=',';};values+=value;
        };
      };
    };return FValues;
  }
};
//Begin: ListBoxSwapper
move=function(fbox,tbox){ListBoxSwapper.move(fbox,tbox);};
BumpUp=function(box){ListBoxSwapper.BumpUp(box);};
getObjValues=function(AObj){return ListBoxSwapper.getObjValues(AObj);};
sortitems=ListBoxSwapper.sortitems;
//End: MoveBox



/****************************************
***  ajax                             ***
****************************************/
var Post={
  GetParams:function(params){
    var arrParams=params.split(',');
    var FParams='';
    var FFunc,FName,arrName;
    var oObj;
    for(var i=0;i<arrParams.length;i++){
      FName=arrParams[i];FFunc='';
      arrName=FName.split('=');
      if(arrName.length==2){
        FName=arrName[0];FFunc=arrName[1];
      };   
      oObj=GetObj(FName);
      if(oObj){
        with(oObj){
          if(oObj.value){
            if(FFunc!==''){if(FFunc=='float'){value=FormatFunc.formatFloat(value);}}          
            if(value.indexOf('&')>-1){value=replaceAll(value,'&','[andamp;]')};
            if(value.indexOf('+')>-1){value=replaceAll(value,'+','[plus;]')};
					  if(FParams!==''){FParams+='&'};
					  FParams+=FName+'='+encodeURI(value);
          };
        };
      };  
    };
    return FParams;
  },
  GetHttpPost:function(layer,url,params){
    var res='';
    var oObj=GetObj(layer);
    if(oObj){
      var FLoaded=false;
      var http=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();
      with(http){
        onreadystatechange=function(){
          if(readyState==4||readyState=='complete'){if(status==200){oObj.innerHTML=responseText;};};
        };
        open('POST',url,false);     
        setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        //setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=iso-8859-1");
        //setRequestHeader("Content-type", "multipart/form-data; charset=utf-8");
        setRequestHeader("Content-length", params.length);
        setRequestHeader("Connection", "close");
        if(params==''){params=null;};
        send(params);
        if(!document.all){oObj.innerHTML=responseText;};
      };
    };
  },
  GetHttpGet:function(layer,url,params){
    var oObj=GetObj(layer);
    if(oObj){
      var http=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();
      with(http){
        onreadystatechange=function(){
          if(readyState==4||readyState=='complete'){if(status==200){GetObj(layer).innerHTML=responseText;};};
        };
        url+='?id='+Math.random();
        if(params!==''){url+='&'+params;};
        open('GET',url,true);     
        //setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=iso-8859-1");
        //setRequestHeader("Content-length", parameters.length);
        //setRequestHeader("Connection", "close");
        send(null);
      };
    };
  }
};
GetHttpPost=function(layer,url,params){Post.GetHttpPost(layer,url,params);};
GetHttpGet=function(layer,url,params){Post.GetHttpGet(layer,url,params);};
GetParams=function(params){return Post.GetParams(params);};
GetArgs=function(oArgs,i){return (oArgs.length>i)?oArgs[i]:'';};
GetParamArgs=function(oArgs,i){return (oArgs.length>i)?GetParams(oArgs[i]):'';};
post_ShowLayer=function(layer,url){GetHttpPost(layer,url,GetParamArgs(arguments,2),GetArgs(arguments,3));};
postResult=function(url){GetHttpPost('show_result',url,GetParamArgs(arguments,1),GetArgs(arguments,2));};
postMain=function(url){GetHttpPost('show_main',url,GetParamArgs(arguments,1),GetArgs(arguments,2));};
postHeader=function(url){GetHttpPost('show_header',url,GetParamArgs(arguments,1),GetArgs(arguments,2));};
postControl=function(url){GetHttpPost('show_control',url,GetParamArgs(arguments,1),GetArgs(arguments,2));};



/*
var Cookies={
  cookieDomain:document.location.hostname,  
  Get_DNS:function(){Cookies.cookieDomain=document.location.hostname;},
  Set_Cookie:function(name,value,expires,path,domain,secure){
    domain=(domain!=='')?domain:Cookies.Get_DNS();
    var today = new Date();
    today.setTime( today.getTime() );
    if(expires){expires = expires * 1000 * 60 * 60 * 24;}
    var expires_date = new Date( today.getTime() + (expires) );
    document.cookie = name + '=' +escape( value ) +
    ( ( expires ) ? ';expires=' + expires_date.toGMTString() : '' ) +
    ( ( path ) ? ';path=' + path : '' ) +
    ( ( domain ) ? ';domain=' + domain : '' ) +
    ( ( secure ) ? ';secure' : '' );
  },
  Get_Cookie:function(name){
    var FResult='';
    var results = document.cookie.match('(^|;) ?'+name+'=([^;]*)(;|$)');
    if(results){
      FResult=unescape(results[2]);
      if(FResult==null || FResult=='null'){FResult=''}
      return FResult;
    }
    else{return ''};
  },
  Delete_Cookie:function(name) {
    var cookie_date=new Date();  // current date & time
    cookie_date.setTime(cookie_date.getTime()-1);
    document.cookie=name+='=; expires='+cookie_date.toGMTString();
  },
  CheckCookiesEnabled:function(){
    Cookies.Set_Cookie('test','true','','/','','');
    if(Cookies.Get_Cookie('test')=='true'){
      Cookies.Delete_Cookie('test', '/', '');
      return true;
    }
    else{return false;};
  }  
}
//Begin: Cookies:
GetCookie=function(){return Cookies.Get_Cookie();};
SetCookie=function(value){return Cookies.Set_Cookie(value);};
DeleteCookie=function(){Cookies.Delete_Cookie();};
GetDNS=function(){return Cookies.Get_DNS();};
CheckCookiesEnabled=function(){return Cookies.CheckCookiesEnabled();};
//End: Cookies:
*/
var Cookies={
  createCookie:function(name,value,days){
	  var expires='';
    if(days){
		  var date=new Date();
		  date.setTime(date.getTime()+(days*24*60*60*1000));
		  expires='; expires='+date.toGMTString();
	  };
	  document.cookie=name+'='+value+expires+'; path=/';
  },
  readCookie:function(name) {
	  var nameEQ = name + "=";
	  var ca = document.cookie.split(';');
	  for(var i=0;i < ca.length;i++) {
		  var c = ca[i];
		  while (c.charAt(0)==' ') c = c.substring(1,c.length);
		  if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	  }
	  return null;
  },
  checkCookieSupport:function(){
    Cookies.createCookie('test','/',1);
    return (Cookies.readCookie('test')!=='');
  },
  eraseCookie:function(name) {
	  createCookie(name,'',-1);
  }
};
CheckCookiesEnabled=function(){return Cookies.checkCookieSupport()};


var _Link={
  catchObj:function(e){
    var obj;
    if(typeof(e)=='string'){obj=GetObj(e);};
    if(typeof(e)=='object'){e=e?e:window.event;obj=e.target?e.target:e.srcElement;};
    return obj;
  },
  mo:function(e){
    e=e?e:window.event;
    var obj=e.target?e.target:e.srcElement;
    if(obj.id){
      with(obj.style){
      textDecoration='underline';
      cursor='pointer';
      //borderBottom='solid 2px '+_Link.fontColor;
      };
    };
  },
  mout:function(e){
    e=e?e:window.event;
    var obj=e.target?e.target:e.srcElement;
    if(obj.id){
      with(obj.style){
      textDecoration='none';
      cursor='pointer';
      //borderBottom='none';
      };
    };  
  },
  linkObj:function(id,underline,func){   
    var arrID=id.split(',');
    var arrPage;
    var oObj;
    for(var i=0;i<arrID.length;i++){
      id=arrID[i];oObj=GetObj(id);
      if(oObj){
        if(typeof(func)=='function'){setEventByID(id,'click',func);};
        if(underline==true){
          setEventByID(id,'mouseover',_Link.mo);
          setEventByID(id,'mouseout',_Link.mout);
        };
      };
    };
  },
  goToPage:function(page,target){
    var FTarget='main';
    if(target!==''){FTarget=target};
    if(page!==''){
      if(parent.frames.length>0){parent.frames[FTarget].location.href=page;}
      else{location.href=page;}
    };
  }
};
linkObj=function(id,underline,func){_Link.linkObj(id,underline,func);};
setLink=function(id,fu){_Link.linkObj(id,true,fu);};
goToPage=function(page){_Link.goToPage(page,(arguments.length>1)?arguments[1]:'');};
catchObj=function(e){return _Link.catchObj(e);};



var _PageCrumb={
  fontColor:'white',
  system_msg_width:450,
  system_msg_height:300,
  tSystemMessage:null,
  tSystemMsgPos:null,
  checkSystemPosition:function(){
    var oSystemMessage=GetObj('show_system_message');
    if(oSystemMessage){
      var w=docWidth();
      var h=docHeight();
      with(oSystemMessage){
        var wSysMessage=offsetWidth;
        var hSysMessage=offsetHeight;
        lSysMessage=(w/2)-(wSysMessage/2)-160;
        tSysMessage=(h/2)-(hSysMessage/2);
        if(tSysMessage<50){tSysMessage=50;};
        style.left=(lSysMessage.toString())+'px';
        style.top=(tSysMessage.toString())+'px';
      };
    };
  },
  checkSystemMsgPos:function(){
    var oSystemMsgResult=GetObj('system_msg_result');
    if(oSystemMsgResult){
      checkSystemPosition();
      _PageCrumb.tSystemMsgPos=setTimeout('_PageCrumb.checkSystemMsgPos()',500);
    };  
  },
  showSystemMessage:function(){
    var FParams='system_msg_id';
    loadLayerPage('show_system_message','system_message|show_system_message',FParams);
    checkSystemPosition();
  },
  checkSystemMessage:function(){
    var oLayer=GetObj('show_system_message');
    if(oLayer){
      oLayer.style.display='none';
      with(oLayer){
        style.width=this.system_msg_width;
        style.height=this.system_msg_height;
      };
      showSystemMessage();
      var oResult=GetObj('system_msg_result');
      if(oResult){
        if(parseInt(oResult.value)>0){
          oLayer.style.display='inline';
          _PageCrumb.tSystemMsgPos=setTimeout('_PageCrumb.checkSystemMsgPos()',500);
        };
      };
    };
  },
  hideSystemMessage:function(){
    clearTimeout(_PageCrumb.tSystemMessage);
    var oLayer=GetObj('show_system_message');
    if(oLayer){
      oLayer.style.display='none';
    };
  },
  hideSystemMsg:function(id){
    var FParams='system_msg_id';
    var oSysMsgID=GetObj('system_msg_id');
    var oLayer=GetObj('show_system_message');
    if(oSysMsgID&&oLayer){
      oSysMsgID.value=id;  
      loadLayerPage(oLayer.id,'system_message|show_system_message',FParams);

      var oResult=GetObj('system_msg_result');
      if(oResult){
        oLayer.style.display=(parseInt(oResult.value)>0)?'inline':'none';
        if(parseInt(oResult.value)>0){
          _PageCrumb.tSystemMsgPos=setTimeout('_PageCrumb.checkSystemMsgPos()',500);
        };
      };
    };
  },
  pageCrumb:function(){
    var sId,sText;
    var arrLinks,arrLink,obj;
    var oPageCrumb=GetObj('page_crumb');
    var oCrumbs=GetObj('crumbs');  
    if(oPageCrumb && oCrumbs){
      oPageCrumb.innerHTML='';
      arrLinks=oCrumbs.value.split(',');
      for(var i=0;i<arrLinks.length;i++){
        arrLink=arrLinks[i].split('|');
        
        if(arrLink.length>0){
          sId=arrLink[0];
          sText=arrLink[1];          
          if(i==arrLinks.length-1){
            sText='<b><u>'+sText+'</u></b>';
          };
          
          //create object: span
          obj=document.createElement('span');
          obj.id=sId;
          obj.innerHTML=sText;
          oPageCrumb.appendChild(obj);  //append object to oPageCrumb
          
          linkObj(sId,true,showAction);
        };
        
        if(i<arrLinks.length-1){
          //create object: span
          obj=document.createElement('span');
          obj.innerHTML='&nbsp;>&nbsp;';
          oPageCrumb.appendChild(obj);  //append object to oPageCrumb
        };                
      };
      //create object: hr
      obj=document.createElement('hr');
      obj.size='1';
      obj.color='black';
      oPageCrumb.appendChild(obj);  //append object to oPageCrumb

      //create object: span
      obj=document.createElement('span');
      obj.id='show_title';
      obj.innerHTML='[title]';          
      oPageCrumb.appendChild(obj);  //append object to oPageCrumb

      //create object: div      
      /*
      obj=document.createElement('div');
      obj.id='show_system_message';
      obj.style.zIndex=105;
      obj.style.position='absolute';
      obj.innerHTML='';
      obj.style.display='none';
      oPageCrumb.appendChild(obj);  //append object to oPageCrumb      
      */

      //create object: input
      obj=document.createElement('input');
      obj.type='hidden';
      obj.id='system_msg_id';
      oPageCrumb.appendChild(obj);  //append object to oPageCrumb
      _PageCrumb.tSystemMessage=setTimeout('_PageCrumb.checkSystemMessage()',500);
    };
  }
};
pageCrumb=function(){_PageCrumb.pageCrumb();};
showSystemMessage=function(){_PageCrumb.showSystemMessage();};
checkSystemPosition=function(){_PageCrumb.checkSystemPosition();};
hideSystemMessage=function(){_PageCrumb.hideSystemMessage();};
hideSystemMsg=function(id){_PageCrumb.hideSystemMsg(id);};

setAction=function(id){
  var oAction=GetObj('action');
  if(oAction){oAction.value=id;document.forms[0].submit();};
};


var screen_width=0;
var screen_height=0;
var screenType={info:'info',error:'error',warning:'warning'};
var _Fade={
  id:'doc',
  popup_id:'popup',
  popup_info_url:'info_screen|show_info_screen',
  popup_url:'',
  popup_url_params:'',
  click_cancel_func:null,
  click_change_func:null,
  change_button:'Change',
  cancel_button:'Cancel',
  popup_width:500,
  popup_height:400,
  popup_type:'info',
  y1:30,
  setPageTop:function(){if(GetObj(_Fade.popup_id)){_Fade.placeIt();};},
  placeIt:function(){
    var obj=GetObj(_Fade.popup_id);
    var oDoc=GetObj(_Fade.id);
    if(obj && oDoc){
      if(obj.style.display=='inline'){
        var top=0;
        if(document.all){top=document.body.scrollTop+(document.body.clientHeight-(document.body.clientHeight-_Fade.y1));}
        else{top=window.pageYOffset+(window.innerHeight-(window.innerHeight-_Fade.y1));};
        obj.style.top=top;
	      if(obj){
          var w,h;
          if(parseInt(screen_width)>0){w=screen_width;}else{w=_Fade.popup_width;};
          if(parseInt(screen_height)>0){h=screen_height;}else{h=_Fade.popup_height;};
	        var t=parseInt(docHeight()/2)-parseInt(h/2);
	        var l=parseInt(docWidth()/2)-parseInt(w/2);
	        obj.style.left=(l)+'px';
	        obj.style.top=(t)+'px';
	      }; 
        with(oDoc.style){
		      width=(docWidth()+30)+'px';
		      height=(docHeight()+30)+'px';
        };
        setTimeout("placeIt()", 10);
      };	       
    };
  },  
  fade:function(status){
	  var opacity=0;
	  var obj=GetObj(_Fade.id);
	  if(obj){
	    _Fade.setOpacity(obj,opacity);
	    obj.style.display='inline';
	    switch(status){
	      case 'fadein': _Fade.fadeIn(70); break;
	      case 'fadeout': _Fade.fadeOut(0); break;
	    };
	  };
  },
  fadeIn:function(opacity){
    showDiv(_Fade.popup_id,false);
    var obj;
	  if(document.getElementById){
		  obj=document.getElementById(_Fade.id);
		  if(obj){
		    if(opacity>0){
			    _Fade.setOpacity(obj,opacity);
			    opacity-=10;
			    window.setTimeout("_Fade.fadeIn("+opacity+")", 20);
		    }else{showDiv(_Fade.id,false);};
		  };
	  };
  },
  fadeOut:function(opacity){
	  var obj;
	  if(document.getElementById){
		  var oDiv=GetObj(_Fade.id);
		  if(oDiv){
		    with(oDiv.style){
		      position='absolute';
		      left='0px';
		      top='0px';
	        var w=docWidth();
	        var h=docHeight();
		      width=(w+30)+'px';
		      height=(h+30)+'px';
		      backgroundColor='gray';
		    };
		    if(opacity<70){
			    _Fade.setOpacity(oDiv,opacity);
			    opacity+=10;
			    window.setTimeout("_Fade.fadeOut("+opacity+")", 10);
		    }else{_Fade.popup();};
		  };
    };
  },
  popup:function(opacity){
	  var obj;
	  if(document.getElementById){
		  var oDiv=GetObj(_Fade.id);
		  if(oDiv){
	      //document.body.style.overflow='hidden';
	      var oPopup=GetObj(_Fade.popup_id);
	      if(oPopup){
	        oPopup.style.display='inline';
          var w,h;
          if(parseInt(screen_width)>0){w=screen_width;}else{w=_Fade.popup_width;};
          if(parseInt(screen_height)>0){h=screen_height;}else{h=_Fade.popup_height;};
	        var t=parseInt(docHeight()/2)-parseInt(h/2)-30;
	        var l=parseInt(docWidth()/2)-parseInt(w/2);
          with(oPopup.style){left=(l)+'px';top=(t)+'px';};
          showDiv(_Fade.popup_id,false);
          if(_Fade.popup_info_url!==''){
            //checkPage(url)
            var url=_Fade.popup_info_url+'?'+
                    'screen_type='+_Fade.popup_type+
                    '&height='+h+
                    '&width='+w;
            loadLayerPage(_Fade.popup_id,url,'');
          };
          if(_Fade.popup_url!==''){
            //post_ShowLayer('content',_Fade.popup_url,_Fade.popup_url_params);
            loadLayerPage('content',_Fade.popup_url,_Fade.popup_url_params);
            //--- show/hide cancel and change button
            var oLangID=GetObj('lang_id');
            var oShowButCancel=GetObj('show_but_cancel');
            var oShowButChange=GetObj('show_but_change');

            if(oLangID){
              switch(parseInt(oLangID.value)){
                case 1:_Fade.change_button='Ok';_Fade.cancel_button='Cancel';break;
                case 2:_Fade.change_button='Bevestigen';_Fade.cancel_button='Annuleren';break;
              };
              var oButCancel=GetObj('but_cancel');
              if(oButCancel){oButCancel.value=_Fade.cancel_button;};
              var oButChange=GetObj('but_change');
              if(oButChange){oButChange.value=_Fade.change_button;};
            };

            if(oShowButCancel&&oShowButChange){
              //--- show/hide cancel button
              if(typeof(_Fade.click_cancel_func)=='function'){setEventByID('but_cancel','click',_Fade.click_cancel_func);}
              else{oShowButCancel.style.display='none';};
              //--- show/hide change button
              if(typeof(_Fade.click_change_func)=='function'){setEventByID('but_change','click',_Fade.click_change_func);FDispaly='inline';}
              else{oShowButChange.style.display='none';};
            };        
          };
          initCorners();
          showDiv(_Fade.popup_id,true);
	      };
	    };
	  };
  },
  setOpacity:function(obj, opacity){
    opacity=(opacity==100)?99.999:opacity;
    obj.style.filter='alpha(opacity:'+opacity+')';
    obj.style.KHTMLOpacity=opacity/100;
    obj.style.MozOpacity=opacity/100;
    obj.style.opacity=opacity/100;
  },
  showPopupScreen:function(screentype,cancelFunc,changeFunc,url,params,width,height){
    screen_width=width;
    screen_height=height;
    _Fade.popup_url=url;
    _Fade.popup_url_params=params;
    _Fade.popup_type=screentype;
    _Fade.click_cancel_func=cancelFunc;
    _Fade.click_change_func=changeFunc;
    showPopup();
  }
};
showPopup=function(){_Fade.fade('fadeout');};
hidePopup=function(){_Fade.fade('fadein');};
placeIt=function(){_Fade.placeIt();};
showPopupScreen=function(screentype,cancelFunc,changeFunc,url,params,width,height){
  _Fade.showPopupScreen(screentype,cancelFunc,changeFunc,url,params,width,height);
};



var FXmlPath='div/xml/'
//*************** BEGIN: POST *********************
//post_ShowOption=function(AUrl){GetHttpPost('show_xml', AUrl,(arguments.length>1)?GetParams(arguments[1]):'',(arguments.length>2)?arguments[2]:'');}
//post_ShowXml=function(AUrl){GetHttpPost('show_xml', AUrl,(arguments.length>1)?GetParams(arguments[1]):'',(arguments.length>2)?arguments[2]:'');}
//*************** END: POST ***********************

//*************** BEGIN: FUNCTIONS ****************
showXmlFile=function(id){
  var obj=GetObj(id);
  if(obj){
    var oInfo=GetObj(id+'INFO');
    if(oInfo){
      if(oInfo.style.display=='none'){
        oInfo.style.width='700px;';

        obj.style.width='750px';
        showDiv(id+'LANG',true);
        showDiv(id+'INFO',true);
      }
      else{
        oInfo.style.width='100px;';
        obj.style.width='110px';
        showDiv(id+'LANG',false);
        showDiv(id+'INFO',false);
      };
    };
  };
};

showXmlDoc=function(key,langID){
  var obj=GetObj(key);
  if(obj){
    var oLangID=GetObj('lang_id');
    if(oLangID){
      //if(langID!==''&&isNumeric(langID)==true){oLangID.value=langID;}
      //else{langID=oLangID.value;};
      oLangID.value=langID;
      loadLayerPage(key+'INFO','xml|xml_doc?id='+key,key+',xml_file_'+langID+'_'+key+',lang_id');
      loadPage('');
    };
  };
};

updXmlFile=function(key,params){loadLayerPage('show_result','xml|upd_xml_file?key='+key,params);};
delXmlFile=function(xmlFileID){
  loadLayerPage('show_result','xml|del_xml_file?key='+xmlFileID,xmlFileID);
  //showXmlFile(xmlFileID.replace('xml_file_',''));
  //showXmlDoc('<%=FXmlKey%>',<%=FArr(I,0)%>)
  showXmlDoc(xmlFileID.replace('xml_file_',''),'');
};
//*************** END: FUNCTIONS ******************


