function TestReady(){if(typeof document.readyState!="undefined"&&document.readyState!="complete"){event.cancelBubble=true;event.returnValue=false;if(typeof m_bAlreadySubmitted=="undefined"||!m_bAlreadySubmitted){var a="Prego attendere il completo caricamento della pagina";if(typeof m_cLanguage!="undefined"){switch(m_cLanguage){case"ENG":a="Please wait page loading completion";break;default:}}alert(a)}else{alert(Translate("MSG_SERVER_DATA"))}}}function InstTR(){document.onmousedown=TestReady;document.onkeydown=TestReady}var c_cIE="IE",c_cNetscape="Netscape",c_cOpera="Opera",c_cMozilla="Mozilla",c_cIE_MAC="IE_MAC";var decSep;var milSep;if(!window.m_cLanguage){window.m_cLanguage="ita"}SetNumberSettings();function getBrowserType(){if(navigator.userAgent.toLowerCase().indexOf("netscape")!=-1){return c_cNetscape}if(navigator.userAgent.toLowerCase().indexOf("opera")!=-1){return c_cOpera}if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1){return c_cMozilla}return c_cIE}function IsIE(){if(typeof(m_cBrowser)=="undefined"){m_cBrowser=getBrowserType()}return Eq(m_cBrowser,c_cIE)}function IsNetscape(){if(typeof(m_cBrowser)=="undefined"){m_cBrowser=getBrowserType()}return Eq(m_cBrowser,c_cNetscape)}function IsOpera(){if(typeof(m_cBrowser)=="undefined"){m_cBrowser=getBrowserType()}return Eq(m_cBrowser,c_cOpera)}function IsMozilla(){if(typeof(m_cBrowser)=="undefined"){m_cBrowser=getBrowserType()}return Eq(m_cBrowser,c_cMozilla)}function IsIE_Mac(){return Eq(m_cBrowser,c_cIE_MAC)}LibJavascript={ToDate:function(c){if(Empty(c)){return NullDate()}var b=c;var a=c.substring(0,b.indexOf("-"))-0;b=b.substring(b.indexOf("-")+1);var e=(b.substring(0,b.indexOf("-"))-0)-1;b=b.substring(b.indexOf("-")+1);var d=b.substring(0)-0;return new Date(d,e,a,0,0,0,0)},ToDateTime:function(f){if(Empty(f)){return NullDateTime()}var d=f;var b=f.substring(0,d.indexOf("-"))-0;d=d.substring(d.indexOf("-")+1);var g=(d.substring(0,d.indexOf("-"))-0)-1;d=d.substring(d.indexOf("-")+1);var e=d.substring(0,d.indexOf(" "))-0;d=d.substring(d.indexOf(" ")+1);var a=d.substring(0,d.indexOf(":"))-0;d=d.substring(d.indexOf(":")+1);var h=d.substring(0,d.indexOf(":"))-0;d=d.substring(d.indexOf(":")+1);var c=d.substring(0)-0;return new Date(e,g,b,a,h,c,0)},Split:function(a){var c=a.split("\n");for(var b=0;b<c.length;b++){if(Right(c[b],1)=="\r"){c[b]=Left(c[b],Len(c[b])-1)}}return c},ReadGetData:function(){var d={};var a=new String(window.location);var f=a.search(/\?/);if(f!=-1){a=a.substr(f+1);var e=a.split(/&/g);for(var c=0;c<e.length;c++){var b=e[c].split(/=/);d[unescape(b[0])]=unescape(b[1])}}return d}};function JavaHttpRequest(){this.open=function(d,c,a){var b=java.net.URL(c);this.cn=b.openConnection();this.cn.setDoOutput(true);this.cn.setUseCaches(false);this.cn.setAllowUserInteraction(false)};this.setRequestHeader=function(b,a){this.cn.setRequestProperty(b,a)};this.send=function(g){var a=java.io.PrintWriter(this.cn.getOutputStream());if(g!=null){a.print(g)}a.close();var e=this.cn.getInputStream();var d=0,c=0;var f=e.read,b=String.fromCharCode;this.responseText=[];while((d=f())!=-1){this.responseText[c]=b(d);c++}this.responseText=this.responseText.join("");e.close()}}function JSURL(srv,p_bNoCache){var msg;if(p_bNoCache==null){p_bNoCache=false}this.http=null;if(IsIE()||IsIE_Mac()){if(!p_bNoCache){if(srv.length>1500){p_bNoCache=true}}var msxmll={"Msxml2.XMLHTTP":"","Microsoft.XMLHTTP":""};for(var msxml in msxmll){try{this.http=new ActiveXObject(msxml);break}catch(e){this.http=false}}}else{try{this.http=new XMLHttpRequest()}catch(e){if(IsOpera()){try{this.http=new JavaHttpRequest()}catch(E){this.http=false}}else{this.http=false}}}if(p_bNoCache){var p=srv.indexOf("?");if(p!=-1){this.prm=srv.substr(p+1);srv=Left(srv,p)}else{this.prm=null}this.http.open("POST",srv,false);this.http.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}else{this.http.open("GET",srv,false);this.prm=null}this.http.setRequestHeader("User-Agent",navigator.userAgent);if(typeof document!="undefined"&&typeof document.location!="undefined"){this.http.setRequestHeader("Referer",""+document.location+"")}this.Response=function(){try{return this.__response()}catch(e){return""}};this.__response=function(){this.msg="";this.http.send(this.prm);try{this.msg=this.http.getResponseHeader("JSURL-Message")}catch(e){}return this.http.responseText.toString()};this.ResponseXML=function(){this.Response();return this.http.responseXML};this.FailedLogin=function(){return Left(this.msg,8)=="cp_login"?eval(Substr(this.msg,9)):""};this.FailedAccess=function(){return Left(this.msg,9)=="SPServlet"?eval(Substr(this.msg,10)):""}}jsapplets=new Array();function AutonumberJavascript(a){this.reset=function(){this.names=new Array();this.values=new Array();this.ops=new Array();this.types=new Array();this.lens=new Array();this.decs=new Array();this.tables=new Array()};this.composeName=function(c){var b=c;if(b.lastIndexOf("?")>-1){b=b.substring(0,b.indexOf("?"))}if(Right(b,5)==".aspx"){b=b.substring(0,b.lastIndexOf("/"))+"/SPUpdateAutonumber.aspx"}else{b=b.substring(0,b.lastIndexOf("/"))+"/SPUpdateAutonumber"}return b};this.reset();this.documentloc=a;this.m_url=new JSURL(this.composeName(this.documentloc),true);this.toUpdate=false;this.ok=false;this.GetFromResponse=function(f){var c;var e=false;var d=0,g;var h=LibJavascript.Split(f);var b=0;for(b=0;b<h.length&&!e;b++){c=h[b];d=d+1;e=(c=="-->");if(d==2){this.ok=c=="Ok";this.errmsg=c}else{if(d>2&&!e){g=c.indexOf("=");if(g!=-1){this.rdvar[c.substring(0,g).toLowerCase()]=c.substring(g+1)}}}}};this.SetETName=function(b){this.etname=b};this.doUpdate=function(){var f="?";try{var g=1;for(var b in this.names){if(!IsA(this.names[b],"F")){var l=this.names[b];f=f+"Name"+g+"="+URLenc(l)+"&";f=f+"Value"+g+"="+URLenc(this.values[l])+"&";f=f+"Type"+g+"="+URLenc(this.types[l])+"&";f=f+"Len"+g+"="+URLenc(this.lens[l])+"&";f=f+"Dec"+g+"="+URLenc(this.decs[l])+"&";f=f+"Op"+g+"="+URLenc(this.ops[l])+"&";++g}}var m=1;for(var h in this.tables){if(!IsA(this.tables[h],"F")){f=f+"Tablename"+m+"="+URLenc(h)+"&";f=f+"Autonumber"+m+"="+URLenc(this.tables[h])+"&";++m}}if(this.etname!=null){f=f+"ETName"+m+"="+URLenc(this.etname)+"&"}f=f.substring(0,f.length-1);this.rdvar=new Array();var d=this.documentloc;d=this.composeName(d);var c=new JSURL(d+f,true);this.GetFromResponse(c.__response())}catch(k){this.ok=false}this.reset()};this.checkUpdate=function(){if(this.toUpdate){this.doUpdate();this.toUpdate=false;this.etname=null}};this.GetAutonumberString=function(b){this.checkUpdate();b=b.toLowerCase();if(this.rdvar[b]!=null){return this.rdvar[b]}else{return""}};this.GetAutonumberDouble=function(b){this.checkUpdate();b=b.toLowerCase();if(this.rdvar[b]!=null){try{return this.rdvar[b]}catch(c){return 0}}else{return 0}};this.SetProg=function(c,f,h,d,b,g){this.toUpdate=true;var e=c.toLowerCase();this.names=this.names.concat(e);this.values[e]=f;this.types[e]=d;this.ops[e]=h;this.lens[e]=b+"";this.decs[e]=g+""};this.SetFixedProg=function(){var c,e,d,b,f;c=arguments[0];e=arguments[1];if(arguments.lenght==6){op=arguments[2];d=arguments[3];b=arguments[4];f=arguments[5]}else{if(typeof e=="number"){op="0"}else{op=""}d=arguments[2];b=arguments[3];f=arguments[4]}this.SetProg(c,e+"",op+"",d,b,f)};this.SetAutonumber=function(c,b){this.toUpdate=true;this.tables[b.toLowerCase()]=c.toLowerCase()}}function TrsJavascript(SetValueNameFirst){this.p={};this.m_bUpdatedFlag=false;this.m_bLoadedFlag=false;this.m_bSetValueNameFirst=SetValueNameFirst==null?false:SetValueNameFirst;this.asString=function(){var strrep=new Array(),val,vo=this.p,key;if(this.m_bUpdatedFlag){strrep[strrep.length]="#\\m_bUpdated\n"}if(this.m_bLoadedFlag){strrep[strrep.length]="#\\m_bLoaded\n"}for(key in vo){val=vo[key];if(!IsA(val,"C")){val=val.join("\n")}key=this.saveConvert(key,true);val=this.saveConvert(val,false);strrep[strrep.length]=key+"="+val+"\n"}return strrep.join("")};this.currRow=null;this.setRow=function(i){this.SetRow(i)};this.SetRow=function(i){this.currRow=i+"";this.p.Rows=this.currRow};this.setValue=function(id,value){var sr;if(id=="m_bUpdated"&&value=="true"){this.m_bUpdatedFlag=true}if(id=="m_bLoaded"&&value=="true"){this.m_bLoadedFlag=true}if(this.m_bSetValueNameFirst){sr=this.p[id];if(sr==null){sr=[];this.p[id]=sr}sr[sr.length]=this.currRow+"#="+this.saveConvert(value,false)}else{this.p[this.currRow+"#"+id]=value}};this.setDeleted=function(x){this.p[x+"#m_nRowStatus"]="3"};this.getValue=function(id){var v=this.p[this.currRow+"#"+id];if(Empty(v)){v=""}return v};this.reset=function(){this.p={}};this.getRows=function(){var v=this.p.Rows;if(v==null){v=this.p["0#Rows"]}try{return v-0}catch(e){return 0}};this.Append=function(s){var name="";var l_prop=new TrsJavascript();try{l_prop.BuildProperties(s);for(var name in l_prop.p){if(!IsA(l_prop.p[name],"F")){this.p[name]=l_prop.p[name]}}}catch(e){}};this.BuildProperties=function(s){this.reset();var text=LibJavascript.Split(s),line;var i=0;for(i=0;i<text.length;i++){line=text[i];if(typeof line!="function"&&line.length>0){var firstChar=line.charAt(0);if((firstChar!="#")&&(firstChar!="!")){while(this.continueLine(line)){i++;var nextLine=text[i];var loppedLine=line.substring(0,line.length-1);var startIndex=0;for(startIndex=0;startIndex<nextLine.length;startIndex++){if(this.whiteSpaceChars.indexOf(nextLine.charAt(startIndex))==-1){break}}nextLine=nextLine.substring(startIndex,nextLine.length);line=loppedLine+nextLine}var len=line.length;var keyStart;for(keyStart=0;keyStart<len;keyStart++){if(this.whiteSpaceChars.indexOf(line.charAt(keyStart))==-1){break}}if(keyStart==len){continue}var separatorIndex;for(separatorIndex=keyStart;separatorIndex<len;separatorIndex++){var currentChar=line.charAt(separatorIndex);if(currentChar=="\\"){separatorIndex++}else{if(this.keyValueSeparators.indexOf(currentChar)!=-1){break}}}var valueIndex;for(valueIndex=separatorIndex;valueIndex<len;valueIndex++){if(this.whiteSpaceChars.indexOf(line.charAt(valueIndex))==-1){break}}if(valueIndex<len){if(this.strictKeyValueSeparators.indexOf(line.charAt(valueIndex))!=-1){valueIndex++}}while(valueIndex<len){if(this.whiteSpaceChars.indexOf(line.charAt(valueIndex))==-1){break}valueIndex++}var key=line.substring(keyStart,separatorIndex);var value=(separatorIndex<len)?line.substring(valueIndex,len):"";key=this.loadConvert(key);value=this.loadConvert(value);this.p[key]=value}}}};this.continueLine=function(line){var slashCount=0;var index=line.length-1;while((index>=0)&&(line.charAt(index--)=="\\")){slashCount++}return(slashCount%2==1)};this.loadConvert=function(theString){theString=Strtran(theString,"'","'+String.fromCharCode(39)+'");return eval("'"+theString+"'")};this.whiteSpaceChars=" \t\r\n\f";this.keyValueSeparators="=: \t\r\n\f";this.strictKeyValueSeparators="=:";this.hexDigit=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];this.SP=" ".charCodeAt(0);this.BSL="\\".charCodeAt(0);this.LF="\n".charCodeAt(0);this.CR="\r".charCodeAt(0);this.TAB="\t".charCodeAt(0);this.FF="\f".charCodeAt(0);this.specialSaveChars=new Array();this.specialSaveChars["=".charCodeAt(0)]=true;this.specialSaveChars[":".charCodeAt(0)]=true;this.specialSaveChars["#".charCodeAt(0)]=true;this.specialSaveChars["!".charCodeAt(0)]=true;this.saveConvert=function(theString,escapeSpace){var len=theString.length,asciiChar,toHex=this.hexDigit,specialSaveChars=this.specialSaveChars,x=0;var theChars=theString.split("");var SP=this.SP,BSL=this.BSL,TAB=this.TAB,LF=this.LF,CR=this.CR,FF=this.FF;while(x<len){asciiChar=theChars[x].charCodeAt(0);switch(asciiChar){case SP:if(x==0||escapeSpace){theChars[x]="\\ "}else{theChars[x]=" "}break;case BSL:theChars[x]="\\\\";break;case TAB:theChars[x]="\\t";break;case LF:theChars[x]="\\n";break;case CR:theChars[x]="\\r";break;case FF:theChars[x]="\\f";break;default:if((asciiChar<32)||(asciiChar>126)){theChars[x]="\\u"+toHex[(asciiChar>>12)&15]+toHex[(asciiChar>>8)&15]+toHex[(asciiChar>>4)&15]+toHex[asciiChar&15]}else{if(specialSaveChars[asciiChar]){theChars[x]="\\"+String.fromCharCode(asciiChar)}}}x++}return theChars.join("")}}function LinkJavascript(p_documentloc){this.composeName=function(par){var file2=par;if(file2.lastIndexOf("?")>-1){file2=file2.substring(0,file2.indexOf("?"))}if(Right(file2,5)==".aspx"){file2=file2.substring(0,file2.lastIndexOf("/"))+"/SPLinker.aspx"}else{file2=file2.substring(0,file2.lastIndexOf("/"))+"/SPLinker"}return file2};this.documentloc=p_documentloc;var par=this.composeName(this.documentloc);this.m_url=new JSURL(par,true);this.m_cKey="";this.m_cConfigName="";this.m_cSearchingFunction="";this.m_bFillEmptyKey=false;this.m_cConfigParms="";this.m_cRdfields="";this.m_cRdtypes="";this.m_cAutozoom="";this.m_cTable="";this.m_bLooselyLinked=false;this.m_cDefaultsFunction="";this.SetDoubleKey=function(keyFieldName,keyFieldValue,len,dec){this.m_bEmptyKey=keyFieldValue==0;if(this.m_bFillEmptyKey){if(Empty(keyFieldValue)){keyFieldValue=""}}this.m_cKey=this.m_cKey+","+keyFieldName+","+keyFieldValue};this.SetStringKey=function(keyFieldName,keyFieldValue,len,dec){this.m_bEmptyKey=keyFieldValue=="";if(this.m_bFillEmptyKey){if(Empty(keyFieldValue)){keyFieldValue=""}else{keyFieldValue="'"+Strtran(keyFieldValue,"'","''")+"'"}}else{keyFieldValue="'"+Strtran(keyFieldValue,"'","''")+"'"}this.m_cKey=this.m_cKey+","+keyFieldName+","+keyFieldValue};this.SetDateKey=function(keyFieldName,keyFieldValue,len,dec){this.m_bEmptyKey=(keyFieldValue=="0100-01-01");if(this.m_bFillEmptyKey){if(Empty(keyFieldValue)){keyFieldValue=""}else{keyFieldValue="{d '"+keyFieldValue+"'}"}}else{keyFieldValue="{d '"+keyFieldValue+"'}"}this.m_cKey=this.m_cKey+","+keyFieldName+","+keyFieldValue};this.SetDateTimeKey=function(keyFieldName,keyFieldValue,len,dec){this.m_bEmptyKey=(keyFieldValue=="0100-01-01 00:00:00");if(this.m_bFillEmptyKey){if(Empty(keyFieldValue)){keyFieldValue=""}else{keyFieldValue="{ts '"+keyFieldValue+"'}"}}else{keyFieldValue="{ts '"+keyFieldValue+"'}"}this.m_cKey=this.m_cKey+","+keyFieldName+","+keyFieldValue};this.SetFields=function(rd_fields){this.m_cRdfields=rd_fields};this.SetTypes=function(rd_types){this.m_cRdtypes=rd_types};this.SetLinkzoom=function(autozoom){this.m_cAutozoom=autozoom};this.LinkTable=function(p_cTableName){this.m_cTable=p_cTableName};this.SetConfigName=function(p_cConfigName){this.m_cConfigName=p_cConfigName};this.SetSearchingFunction=function(p_cSearchingFunction){this.m_cSearchingFunction=p_cSearchingFunction};this.FillEmptyKey=function(){this.m_bFillEmptyKey=true};this.SetConfigParms=function(p_cConfigParms){this.m_cConfigParms=p_cConfigParms};this.SetDefaultsFunction=function(p_cDefaultsFunction){this.m_bLooselyLinked=true;this.m_cDefaultsFunction=p_cDefaultsFunction};this.DoLink=function(m_nKmode){this.m_cWhereFieldExpr="";this.m_cWhereFixedExpr="";this.m_nDefaultRoutineResult=1;this.rdvar=new Array();var noconn=false;try{if(!this.m_bEmptyKey){var urle="?";if(this.m_cKey.charAt(0)==","){this.m_cKey=this.m_cKey.substring(1)}urle=urle+"Table="+this.m_cTable+"&";urle=urle+"Kfld="+URLenc(this.m_cKey)+"&";urle=urle+"Rdfld="+URLenc(this.m_cRdfields)+"&";urle=urle+"Rdtypes="+URLenc(this.m_cRdtypes)+"&";urle=urle+"Kmode="+m_nKmode+"&";urle=urle+"Autozoom="+this.m_cAutozoom+"&";urle=urle+"ConfigName="+this.m_cConfigName+"&";urle=urle+"SearchingFunction="+this.m_cSearchingFunction+"&";urle=urle+"FillEmptyKey="+this.m_bFillEmptyKey+"&";urle=urle+"LooselyLinked="+this.m_bLooselyLinked+"&";urle=urle+"DefaultsFunction="+this.m_cDefaultsFunction+"&";urle=urle+this.m_cConfigParms;var file=this.documentloc;file=this.composeName(file);var url=new JSURL(file+urle,true);try{this.GetFromResponse(url.__response())}catch(e){if(e&&url.http.status!=200){alert("errore interno:"+e.message);noconn=true;this.ok=false}}}else{this.ok=true;this.askZoom=false}if(this.ok){if(this.askZoom){return 2}else{return 1}}else{if(noconn){return -1}else{return 0}}}finally{this.m_cConfigName="";this.m_cSearchingFunction="";this.m_bFillEmptyKey=false;this.m_cConfigParms="";this.m_bLooselyLinked=false;this.m_cDefaultsFunction="";this.m_cAutozoom="";this.m_cKey=""}};this.GetFromResponse=function(res){var l;var stop=false;var i=0,p;this.askZoom=false;var text=LibJavascript.Split(res);for(var line=0;i<text.length&&!stop;line++){l=text[line];i=i+1;stop=(l=="-->");if(i==2){this.ok=l=="Ok";this.errmsg=l}else{if(i>2&&!stop){if("More data"==l){this.askZoom=true}else{if(Left(l,15)=="WhereFieldExpr:"){this.m_cWhereFieldExpr=l.substring(15)}else{if(Left(l,15)=="WhereFixedExpr:"){this.m_cWhereFixedExpr=l.substring(15)}else{if(Left(l,21)=="DefaultRoutineResult:"){this.m_nDefaultRoutineResult=eval(l.substring(21))}else{p=l.indexOf("=");if(p!=-1){this.rdvar[l.substring(0,p)]=eval(l.substring(p+1))}}}}}}}}};this.GetStringValue=function(p_cField,p_nLen,p_nDec){if(this.rdvar[p_cField]!=null){return RTrim(this.rdvar[p_cField])}else{return""}};this.GetDateValue=function(p_cField,p_nLen,p_nDec){if(!Empty(this.rdvar[p_cField])){var date=this.rdvar[p_cField];var year=date.substring(0,date.indexOf("-"))-0;date=date.substring(date.indexOf("-")+1);var month=date.substring(0,date.indexOf("-"))-0;date=date.substring(date.indexOf("-")+1)+" ";var day=date.substring(0,date.indexOf(" "))-0;return new Date(year,month-1,day,0,0,0,0)}else{return NullDate()}};this.GetDateTimeValue=function(p_cField,p_nLen,p_nDec){if(!Empty(this.rdvar[p_cField])){var date=this.rdvar[p_cField];var year=date.substring(0,date.indexOf("-"))-0;date=date.substring(date.indexOf("-")+1);var month=date.substring(0,date.indexOf("-"))-0;date=date.substring(date.indexOf("-")+1);var day=date.substring(0,date.indexOf(" "))-0;date=date.substring(date.indexOf(" ")+1);var hour=date.substring(0,date.indexOf(":"))-0;date=date.substring(date.indexOf(":")+1);var minute=date.substring(0,date.indexOf(":"))-0;date=date.substring(date.indexOf(":")+1);var second=date.substring(0,date.indexOf("."))-0;return new Date(year,month-1,day,hour,minute,second,0)}else{return NullDateTime()}};this.GetDoubleValue=function(p_cField,p_nLen,p_nDec){if(this.rdvar[p_cField]!=null){try{return this.rdvar[p_cField]-0}catch(e){return 0}}else{return 0}};this.GetBooleanValue=function(p_cField,p_nLen,p_nDec){if(this.rdvar[p_cField]!=null){return true==this.rdvar[p_cField]}else{return false}};this.GetWhereExpr=function(){return URLenc(this.m_cWhereFieldExpr)};this.GetWhereFieldExprUnencoded=function(){return this.m_cWhereFieldExpr};this.GetWhereFixedExprUnencoded=function(){return this.m_cWhereFixedExpr};this.GetDefaultRoutineResult=function(){return this.m_nDefaultRoutineResult}}function BatchJavascript(p_documentloc){this.rdvar;this.retval;this.errmsg;this.params=new Array();this.detectAspx=function(){var file2=this.documentloc;if(file2.lastIndexOf("?")!=-1){file2=file2.substring(0,file2.lastIndexOf("?"))}if(Right(file2,5)==".aspx"){this.m_cExtension=".aspx"}this.documentloc=file2};this.documentloc=p_documentloc;this.m_cExtension="";this.detectAspx();this.SetParameterString=function(name,value){if(name==null){return}if(value==null){value=""}this.params[name]=value};this.SetParameterNumber=function(name,value){if(name==null){return}this.params[name]=value+""};this.SetCallerStringVar=function(name,value){if(name==null){return}if(value==null){value=""}this.params[name]=value};this.SetCallerNumberVar=function(name,value){if(name==null){return}this.params[name]=value+""};this.GetDoubleVar=function(name){if(name==null){return 0}var r=this.rdvar[name];if(r==null){return 0}try{return r-0}catch(e){return 0}};this.GetCallerStringVar=function(name){if(name==null){return""}var r=this.rdvar[name];if(r==null){return""}return r};this.GetCallerDoubleVar=function(name){if(name==null){return 0}return this.ToDouble(this.rdvar[name])};this.GetCallerDateVar=function(name){if(name==null){return null}return LibJavascript.ToDate(this.rdvar[name])};this.GetCallerDateTimeVar=function(name){if(name==null){return null}return LibJavascript.ToDateTime(this.rdvar[name])};this.GetCallerBooleanVar=function(name){if(name==null){return false}return this.ToBoolean(this.rdvar[name])};this.GetString=function(){return this.retval};this.GetDouble=function(){return this.ToDouble(this.retval)};this.ToDouble=function(p_cNumber){if(p_cNumber==null){return 0}try{return p_cNumber-0}catch(e){return 0}};this.GetDate=function(){return LibJavascript.ToDate(this.retval)};this.GetDateTime=function(){return LibJavascript.ToDateTime(this.retval)};this.GetBoolean=function(){return this.ToBoolean(this.retval)};this.ToBoolean=function(p_cBoolean){if(p_cBoolean==null){return false}return"true"==(p_cBoolean.toLowerCase())};this.GetFromResponse=function(s){var l;var stop=false;var i=0,p,end;this.rdvar=new Array();this.retval="";this.errmsg="";var text=LibJavascript.Split(s);for(var line=0;line<text.length&&!stop;line++){l=text[line];i++;stop=(l=="-->");end=Right(l,1)==";"?l.length-1:l.length;if(Left(l,22)=="Function return value:"){this.retval=l.substring(22,end);while(line<text.length&&!stop){line++;l=text[line];stop=(LRTrim(l)=="-->");if(!stop){this.retval+="\n"+l}}}else{if(Left(l,14)=="Error message:"){if(this.errmsg!=""){this.errmsg+="\n"}this.errmsg+=Substr(l,15,Len(l)-14)}else{if(Left(l,6)=="Fault:"){this._fault=eval(Substr(l,7,Len(l)-6));if(!confirm(this._fault[0])){alert(this._fault[1])}}else{p=l.indexOf("=");if(p!=-1){this.rdvar[Trim(l.substring(0,p))]=Trim(l.substring(p+1,end))}}}}}};this.CallServlet=function(p_cSrvltName){p_cSrvltName+=this.m_cExtension;var name="";var urle="";try{var URLbase=this.documentloc;URLbase=URLbase.substring(0,URLbase.lastIndexOf("/"));urle="/"+p_cSrvltName+"?";for(name in this.params){if(!IsA(this.params[name],"F")){urle=urle+name+"="+URLenc(this.params[name])+"&"}}this.params=new Array();var url=new JSURL(URLbase+urle,true);this.GetFromResponse(url.__response())}catch(e){return -1}return 0}}function InitWvApplet(){var a=WvApplet();a.reset();a.SetRow(0);return a}function WvApplet(){return jsapplets.WvApplet}function BatchApplet(){return jsapplets.BatchApplet}function SettingsApplet(){return jsapplets.SettingsApplet}function HParApplet(){return jsapplets.HParApplet}function TrsApplet(){return jsapplets.TrsApplet}function LinkApplet(){return jsapplets.LinkApplet}function AutonumberApplet(){return jsapplets.AutonumberApplet}function AppletTag(b,a,c){var d;switch(b){case"Trs":case"Wv":case"HPar":case"Settings":d=new TrsJavascript(c);break;case"Link":d=new LinkJavascript(location.toString());break;case"Batch":d=new BatchJavascript(location.toString());break;case"Autonumber":d=new AutonumberJavascript(location.toString());break;default:}jsapplets[b+"Applet"]=d}function CheckDateChar(c){var b,a;b=GetKeyCode(c);if(IsNetscape()||IsMozilla()){if(Eq(b,0)||Eq(b,8)||Eq(b,13)){return true}}a=(b>47&&b<58)||b==32||b==45||b==46||b==47||b==58;return(a)}function CheckDate(g,b,c){var e;var a,f,d;if(isNaN(g)||isNaN(b)||isNaN(c)){return(false)}else{e=new Date(c,b-1,g);a=e.getDate();f=e.getMonth()+1;d=e.getFullYear();if(a==g&&f==b&&d==c){return(true)}else{return(false)}}}function CheckDateTime(d,a,g,b,m,l){var h=CheckDate(d,a,g);if(h){var k;var f,e,c;if(isNaN(b)||isNaN(m)||isNaN(l)){h=false}else{k=new Date(g,a-1,d,b,m,l);f=k.getHours();e=k.getMinutes();c=k.getSeconds();if(f!=b||e!=m||c!=l){h=false}}}return(h)}function WtH(e,b,a,d,c){if(c==null){c=""}if(a==null){a=0}if(d==null){d=0}switch(b){case"L":return FormatBoolean(e,c);break;break;case"C":case"M":return FormatChar(e,a,c);break;case"N":if(a==0&&d==0&&c==""){return Strtran(e.toString(),".",decSep)}else{return FormatNumber(e,a,d,c)}break;case"D":return FormatDate(e,c);break;case"T":return FormatDateTime(e,c);break}}function HtW(b,a){switch(a){case"L":return CharToBool(b);break;break;case"C":case"M":return Trim(b);break;case"N":return Val(Strtran(Strtran(b,milSep,""),decSep,"."));break;case"D":return HtmlToWork_Date(b);break;case"T":return HtmlToWork_DateTime(b);break}}function HtmlToWork_Date(c){if(c==""||c=="  -  -"){return new Date(100,0,1,0,0,0,0)}var f=m_cLanguage=="eng";var a=c.substr((f?3:0),2)-0;var e=c.substr((f?0:3),2)-0;var b=c.substr(6,4)-0;var d=new Date(b,e-1,a);return d}function HtmlToWork_DateTime(k){if(k==""||k=="  -  -"){return new Date(100,0,1,0,0,0,0)}var a=m_cLanguage=="eng";var g=k.substr((a?3:0),2)-0;var d=k.substr((a?0:3),2)-0;var e=k.substr(6,4)-0;var c=k.substr(11,2)-0;var b=k.substr(14,2)-0;var l=k.substr(17)-0;var f=new Date(e,d-1,g,c,b,l);return f}function FormatChar(c,a,b){if(b!=null){if("!"==b.substr(0,1)){c=c.toUpperCase()}else{if("9"==b.substr(0,1)&&""!=c){c=FormatNumber(Strtran(c.toString(),decSep,"."),a,0,b)}}}return c}function FormatBoolean(b,a){return(b?"true":"false")}function FormatNumber(h,o,g,m){if(isNaN(h)){h=0}if(m==null){m=""}if(o==null){o=0}if(g==null){g=0}var f=g,c;var n,a=m.length,l;var e=Str(h),k,d,b="";var p=false;if(h<0){p=true;e=Str(Math.abs(h))}if(a>0){for(n=0;n<a;n++){if((m.charAt(n)==".")){break}}if(n==a){f=0}else{f=a-n-1}}e=FormatDecimals(Math.abs(h),f);l=e.length-f;if(f>0){b=decSep+Substr(e,e.length-f+1);l--}d=k=Left(e,l);if(d==""){k=d="0"}if(At(",",m)>0){if(f>0){m=Left(m,a-f-1)}d="";a=k.length;for(n=0;n<a;n++){d=k.charAt(a-n-1)+d;if((n+1)%3==0&&n!=(a-1)){d=milSep+d}}}if(p){return("-"+d+b)}else{return(d+b)}}function FormatDecimals(d,f){if(f==0){return(Math.round(d).toString())}if(d==0){return"."+"0000000000000".substr(0,f)}var e=1;for(i=0;i<f;i++){e=e*10}var c=(Math.round(d*e)).toString();c=ZeroPad(c,f);var b=c.length;var a=c.substr(b-f,f);if(a!=""){return c.substr(0,b-f)+"."+c.substr(b-f,f)}else{return c.substr(0,b-f)}}function TranslatePicture(a){if(m_cLanguage.match(/eng/i)){return a.replace(/(DD)(.*)(MM)/g,"$3$2$1")}return a}function FormatDate(e,d){if(compareDate(e,new Date(100,0,1,0,0,0,0))){return("")}else{var a=ZeroPad(e.getDate().toString(),2);var f=ZeroPad((e.getMonth()+1).toString(),2);var c=ZeroPad(e.getFullYear().toString(),4);var b=m_cLanguage.match(/eng/i)&&d!="D"?f+a+c:a+f+c;return ApplyPictureToDate(b,d)}}function FormatDateTime(a,e){if(compareDate(a,new Date(100,0,1,0,0,0,0))){return("")}else{var b=ZeroPad(a.getDate().toString(),2);var f=ZeroPad((a.getMonth()+1).toString(),2);var d=ZeroPad(a.getFullYear().toString(),4);var c=m_cLanguage.match(/eng/i)&&e!="D"?f+b+d:b+f+d;return ApplyPictureToDateTime(c+ZeroPad(a.getHours().toString(),2)+ZeroPad(a.getMinutes().toString(),2)+ZeroPad(a.getSeconds().toString(),2),e)}}function ApplyPictureToDate(g,h,a){var c="",l="",e="";var k=Len(g)>8;var f,d;if(h=="D"||h==""){d="DD-MM-YYYY"}else{if(h=="N"){d="DDMMYYYY"}else{d=h}}var b="";if(k){b=d.replace(/(DD|MM)(\W)?(DD|MM)(\W)?(\w*)/g,"$1-$3-$5");c=g.substr(b.indexOf("DD"),2);l=g.substr(b.indexOf("MM"),2);e=g.substr(b.indexOf("YY"),4)}else{b=d.replace(/(DD|MM)(\W)?(DD|MM)(\W)?(\w*)/g,"$1$3$5");c=g.substr(b.indexOf("DD"),2);l=g.substr(b.indexOf("MM"),2);e=g.substr(b.indexOf("YY"),4);if(Len(e)==2){e=iif(Val(e)>50,"19","20")+e}}f=CheckDate(Val(c),Val(l),Val(e));if(f){d=Strtran(d,"DD",c);d=Strtran(d,"D",iif(Left(c,1)=="0",Right(c,1),c));d=Strtran(d,"MM",l);d=Strtran(d,"M",iif(Left(l,1)=="0",Right(l,1),l));d=Strtran(d,"YYYY",e);d=Strtran(d,"YY",Right(e,2));if(At("h",d)>0){d=LRTrim(Substr(d,1,At("h",d)-1))}g=d}else{if((c+l+e)!=""&&a!=null){alert(Translate("MSG_WRONG_DATE"));g="";SetControlFocus(a)}}return(g)}function ApplyPictureToDateTime(l,m,a){var c="",o="",g="",e="",h="",d="";var n=Len(l)>14||At("-",l)>0||At("/",l)>0||At(":",l)>0;var k,f;if(m=="D"||m==""){f="DD-MM-YYYY hh:mm:ss"}else{if(m=="N"){f="DDMMYYYYhhmmss"}else{f=m}}if(!Empty(l)){var b="";if(n){b=f.replace(/(DD|MM)(\W)?(DD|MM)(\W)?(YYYY)(\W)?(hh)(\W)?(mm)(\W)?(ss)/g,"$1-$3-$5 $7:$9:$11");c=l.substr(b.indexOf("DD"),2);o=l.substr(b.indexOf("MM"),2);g=l.substr(b.indexOf("YYYY"),4);e=l.substr(b.indexOf("hh"),2)||"00";h=l.substr(b.indexOf("mm"),2)||"00";d=l.substr(b.indexOf("ss"),2)||"00"}else{b=f.replace(/(DD|MM)(\W)?(DD|MM)(\W)?(YYYY)(\W)?(hh)(\W)?(mm)(\W)?(ss)/g,"$1$3$5$7$9$11");c=l.substr(b.indexOf("DD"),2);o=l.substr(b.indexOf("MM"),2);g=l.substr(b.indexOf("YYYY"),4);e=l.substr(b.indexOf("hh"),2)||"00";h=l.substr(b.indexOf("mm"),2)||"00";d=l.substr(b.indexOf("ss"),2)||"00"}k=CheckDateTime(Val(c),Val(o),Val(g),Val(e),Val(h),Val(d));if(k){f=Strtran(f,"DD",c);f=Strtran(f,"D",iif(Left(c,1)=="0",Right(c,1),c));f=Strtran(f,"MM",o);f=Strtran(f,"M",iif(Left(o,1)=="0",Right(o,1),o));f=Strtran(f,"YYYY",g);f=Strtran(f,"YY",Right(g,2));f=Strtran(f,"hh",e);f=Strtran(f,"h",iif(Left(e,1)=="0",Right(e,1),e));f=Strtran(f,"mm",h);f=Strtran(f,"m",iif(Left(h,1)=="0",Right(h,1),h));f=Strtran(f,"ss",d);f=Strtran(f,"s",iif(Left(d,1)=="0",Right(d,1),d));l=f}else{if((c+o+g+e+d+h)!=""&&a!=null){alert(Translate("MSG_WRONG_DATE"));l="";SetControlFocus(a)}}}return(l)}function sqlDate(a){return ZeroPad(""+a.getFullYear(),4)+"-"+ZeroPad(""+(a.getMonth()+1),2)+"-"+ZeroPad(""+a.getDate(),2)}function sqlDateTime(a){return sqlDate(a)+" "+ZeroPad(""+a.getHours(),2)+":"+ZeroPad(""+(a.getMinutes()),2)+":"+ZeroPad(""+a.getSeconds(),2)}function toSQL(c,e,d,b){if(b==null){b=false}var a="";switch(d){case"C":case"M":if(b){a=c+" = '"+Strtran(e,"'","''")+"'"}else{a=c+" like '"+Strtran(e,"'","''")+"%'"}break;case"N":a=c+" = "+e;break;case"D":a=c+" = {d '"+sqlDate(e)+"'}";break;case"T":a=c+" = {ts '"+sqlDateTime(e)+"'}";break;case"L":a=c+" = "+e;break}return a}function ChkboxCheckUncheck(a,c,b){if(Eq(c,b)){a.checked=true}else{a.checked=false}}function ChkboxValueAssign(b,e,f,c,a,g,d){if(d==null){d=""}if(a==null){a=0}if(g==null){g=0}if(b.checked){b.value=WtH(e,c,a,g,d);return e}else{b.value=WtH(f,c,a,g,d);return f}}function selectRadio(d,c,b){for(var a=0;a<d.length;a++){if(Eq(HtW(d[a].value,b),c)){d[a].checked=true;return}}}function getRadioValue(b){for(var a=0;a<b.length;a++){if(b[a].checked){return b[a].value}}return""}function selectCombo(e,d,b){if(e.type=="select-one"){var c=e.options;for(var a=0;a<c.length;a++){if(Eq(HtW(c[a].value,b),d)){e.selectedIndex=a;return}}e.value=""}}function getComboValue(a){if(a.selectedIndex==-1){return""}else{return a.options[a.selectedIndex].value}}function DoZoomOnLink(e){var ctrl=GetEventSrcElement(e);if(ctrl!=null){if(link_index(ctrl)>-1){var id=ctrl.id;if(At("_ZOOM",id)!=0){ctrl.onclick()}else{if("function"==eval("typeof("+id+"_Valid)")&&eval(id+"_Valid(null)")){id=Left(id,10)+"_ZOOM"+Substr(id,11);ctrl=Ctrl(id);if(ctrl!=null){ctrl.onclick()}}}}}}function GetEventSrcElement(a){if(typeof(a)=="undefined"){a=window.event}if(IsNetscape()||IsMozilla()){return a.target}else{return a.srcElement}}function ManageKeys(f,a,d,b,c){if(a==null){a=false}if(d==null){d=true}if(b==null){b=false}if(c==null){c=false}if(!IsNetscape()&&!IsMozilla()){f=window.event}keyCode=GetKeyCode(f);if(typeof(hideCalendar)=="function"){hideCalendar()}if(f.altKey&&keyCode!=123){return}if((keyCode>111&&keyCode<124)||keyCode==8||keyCode==9||keyCode==27||keyCode==33||keyCode==34||keyCode==38||keyCode==40||keyCode==46){if(typeof m_cFunction!="undefined"&&m_cFunction=="view"){switch(keyCode){case 121:window.setTimeout("SendData('discard')",1);break}}else{if(b){switch(keyCode){case 8:if(IsIE()||IsIE_Mac()){ManageNumericDel(f,keyCode)}return;case 9:CallEventModifyCheck(f);return;case 27:if(window.opener!=null&&typeof m_cFunction!="undefined"&&m_cFunction=="dialog"){window.setTimeout("SendData('discard')",1)}break;case 38:return;case 40:return;case 46:ManageNumericDel(f,keyCode);return;case 120:if(!a){if(c&&link_index(GetEventSrcElement(f))<0){LaunchCalendar(GetEventSrcElement(f),TranslatePicture("DDMMYYYY"))}else{DoZoomOnLink(f)}}break;case 121:if(typeof SendData!="undefined"&&!a&&CallEventModifyCheck(f)){SendData("save")}break;case 123:if(f.altKey){RunSecurity()}break}}else{if(a){switch(keyCode){case 9:return;case 27:if(window.opener!=null&&typeof(m_nChildStatus)!="undefined"&&m_nChildStatus==1){window.close()}break;case 112:break;case 113:if(typeof(PrintPrg)!="undefined"){PrintPrg()}break;case 114:SubmitListenerForm("edit");break;case 115:SubmitListenerForm("new");break;case 116:SubmitListenerForm("delete");break;case 118:RecSeek("previous");break;case 119:RecSeek("next");break;case 120:Zoom();break;case 123:if(!f.altKey){if(typeof detailed_database_error!="undefined"){alert(detailed_database_error)}}else{RunSecurity()}break}}else{switch(keyCode){case 8:if(IsIE()||IsIE_Mac()){ManageNumericDel(f,keyCode)}return;case 9:CallEventModifyCheck(f);return;case 27:if(typeof SendData!="undefined"&&CallEventModifyCheck(f)){window.setTimeout("SendData('moveto')",1)}break;case 38:if(d){if(CallEventModifyCheck(f)){ActivatePreviousRow(f)}}else{return}break;case 40:if(d){if(CallEventModifyCheck(f)){if(!ActivateNextRow(f)){return}}}else{return}break;case 46:ManageNumericDel(f,keyCode);return;case 112:break;case 117:if(d){F6Ops()}break;case 120:if(!a){if(c&&link_index(GetEventSrcElement(f))<0){LaunchCalendar(GetEventSrcElement(f),TranslatePicture("DDMMYYYY"))}else{DoZoomOnLink(f)}}break;case 121:if(typeof SendData!="undefined"&&CallEventModifyCheck(f)){SendData("save")}break;case 123:if(!f.altKey){if(typeof detailed_database_error!="undefined"){alert(detailed_database_error)}}break}}}}if(keyCode==8||keyCode==46){return}if(keyCode!=112&&(IsIE()||IsIE_Mac())){try{f.keyCode=0}catch(f){f.keyCode=null}}if((keyCode==33||keyCode==34)&&f.ctrlKey){if(keyCode==33){cp_StandardFunction("PgDn")}if(keyCode==34){cp_StandardFunction("PgUp")}}f.cancelBubble=true;f.returnValue=false}}function GetKeyCode(a){if(IsNetscape()||IsMozilla()){return a.which}else{return window.event.keyCode}}function F6Ops(){if(typeof(m_bStateNoDeleteRows)!="undefined"&&m_bStateNoDeleteRows){return}Dataoperations("Delete",Ctrl("GridTable"));NotifyEvent("Row deleted");if("undefined"!=typeof(DisableChainedLinks)){EnableControlsUnderCondition_WhenReady()}FocusFirstDetailComponent()}function CancelHelp(){event.cancelBubble=true;event.returnValue=false;Help()}function CallEventModifyCheck(g){var a=true;var f=GetEventSrcElement(g);if(f.name!=null&&f.name!=""&&f.type!="button"){var c=["onblur","onchange","onclick"];var d;for(var b=0;d==null&&b<c.length;b++){if(f[c[b]]!=null&&At("_Valid",f[c[b]].toString())>0){if(!(f.onkeypress&&At("CheckDateChar",f.onkeypress.toString())>0)){d=f[c[b]]}}}if(d!=null){try{f[c[b-1]]=function(){};a=d(g)}finally{f[c[b-1]]=d}}}return a}function compareDate(b,a){if((b.getDate()==a.getDate())&&(b.getMonth()==a.getMonth())&&(b.getFullYear()==a.getFullYear())){return true}else{return false}}function cp_StandardFunction(cCmd){switch(cCmd){case"Query":if(CtrlByName("FSender")==null){SendData("moveto")}break;case"Edit":SubmitListenerForm("edit");break;case"Delete":SubmitListenerForm("delete");break;case"Load":SubmitListenerForm("new");break;case"Save":if(CtrlByName("FSender")==null){SendData("save")}break;case"Quit":if(CtrlByName("FSender")==null){SendData("moveto")}break;case"Help":break;case"PgUp":if(m_nCurrentPage<m_nPageNumbers){PageButtonClick(m_nCurrentPage,m_nPageNumbers)}break;case"PgDn":if(m_nCurrentPage>1){PageButtonClick(m_nCurrentPage-2,m_nPageNumbers)}break;case"ZoomPrev":case"ZoomNext":break;case"Back":history.back();break;case"Forward":history.forward();break;case"Refresh":location.reload();break;default:if(Left(cCmd,11)=="OrderDetail"){eval(cCmd);return}}return}function AsControlValue(a){switch(typeof(a)){case"string":return a;break;case"number":return WtH(a,"N",0,0,"");break;case"boolean":return""+a;break;case"object":if(a.constructor==Date){if(a.getHours()>0||a.getMinutes()>0||a.getSeconds()>0){return FormatDateTime(a,"D")}else{return FormatDate(a,"D")}}break}return""}function AsAppletValue(a){switch(typeof(a)){case"string":return WtA(a,"C");break;case"number":return WtA(a,"N");break;case"boolean":return WtA(a,"L");break;case"object":if(a.constructor==Date){if(a.getHours()>0||a.getMinutes()>0||a.getSeconds()>0){return WtA(a,"T")}else{return WtA(a,"D")}}break}return""}function WtA(b,a){switch(a){case"L":return b?"true":"false";break;break;case"C":case"M":return b;break;case"N":return b.toString();case"D":return FormatDate(b,"D");break;case"T":return FormatDateTime(b,"D");break}}function AtW(b,a){switch(a){case"L":return CharToBool(b);break;break;case"C":case"M":return Trim(b);break;case"N":return Val(b);case"D":return HtmlToWork_Date(ApplyPictureToDate(b,"DD-MM-YYYY"));break;case"T":return HtmlToWork_DateTime(ApplyPictureToDateTime(b,"DD-MM-YYYY hh:mm:ss"));break}}var last_focused_comp=null;function EnsureControlFocus(){if(typeof(HideTrsOrizzontalScrollBar)=="function"){HideTrsOrizzontalScrollBar()}if(last_focused_comp!=null&&!last_focused_comp.disabled&&last_focused_comp.style.display!="none"){try{last_focused_comp.focus()}catch(a){}last_focused_comp=null}}function SetControlFocus(c){var d=Ctrl(c);if(d!=null){var b=ControlPage(d);if(m_nCurrentPage!=b){PageButtonClick(b-1,m_nPageNumbers)}if(d.length!=null&&d.length>0&&d.type!="select-one"){d=d[0]}if(!d.disabled&&d.style.display!="none"){try{d.focus();last_focused_comp=d}catch(a){}}}}function ToResource(a){if(At(":",a)==0&&Left(a,1)!="."&&a!=""){a="../"+a}return CompleteWithRegionalSettings(a)}function ToHTag(c){var b=c.indexOf("<html>");var a="";while(b!=-1){a+=Strtran(Strtran(Left(c,b-1),"\r\n","<BR>"),"\n","<BR>");c=Substr(c,b+7);b=c.indexOf("</html>");if(b==-1){a+=c;c="";b=-1}else{a+=Left(c,b);c=Substr(c,b+8);b=c.indexOf("<html>")}}a+=Strtran(Strtran(c,"\r\n","<BR>"),"\n","<BR>");return(a)}function RecSeek(b){if(typeof(m_nChildStatus)=="undefined"||(typeof(m_nChildStatus)!="undefined"&&m_nChildStatus==0)){var a=document.FSender;a.m_cAction.value=b;a.submit()}}function SelectRecord(){var a=document.FSender;var b=Val(document.FrmToolbar.last.value);if(!this.value){this.value=Ctrl("pos").value}if(Lt(Val(this.value),1)&&Gt(b,0)){this.value=1}else{if(Gt(Val(this.value),b)){this.value=document.FrmToolbar.last.value}}if(Ne(a.m_nRecPos.value,this.value)){a.m_cAction.value="moveto";a.m_nRecPos.value=this.value;a.submit()}}function RecPositionInput(a){if(!a){a=window.event}if(13==GetKeyCode(a)){SelectRecord()}}function CheckNum(f){var d,b,a,c;if(typeof(f)=="undefined"){f=window.event}d=GetKeyCode(f);c=GetEventSrcElement(f);if(IsNetscape()||IsMozilla()){if(Eq(d,0)||Eq(d,8)||Eq(d,13)){return true}}a=c.value;b=IsNumber(d);if(d==44||d==46){b=(At(decSep,a)==0?true:false);if(b){if(IsIE()||IsIE_Mac()){f.keyCode=decSep.charCodeAt(0)}else{f.preventDefault();c.value=c.value+decSep}}}return(b)}function CheckNumWithPict(t,m,o){if(typeof(o)=="undefined"){var w=m[0];o=m[1]}else{var w=m}var f,y,k,b;if(typeof(t)!="undefined"&&typeof(t.rootEvent)!="undefined"){f=t.keyCode;t=t.rootEvent}else{if(typeof(t)=="undefined"&&(IsIE()||IsIE_Mac())){t=window.event}}if(typeof(f)=="undefined"){f=GetKeyCode(t)}b=GetEventSrcElement(t);if(IsNetscape()||IsMozilla()){if(Eq(f,0)){return true}}k=b.value;var p=getSelectionStart(b);var a=getSelectionEnd(b);var c=Strtran(k,milSep,"");var d=c.length;var h=At(decSep,c);var n=At("-",c);if(IsDigit(f)){if(a==p){if(h==0){if((d-n)<w){return true}else{if(o>0){if(p==d){addText(b,decSep)}else{setSelection(b,w-1,w-1);addText(b,decSep);setSelection(b,p,p)}return true}else{return false}}}else{if(p<h){if((h-n-1)<w){return true}else{if((d-n-h)<o){if(p==h-1){setSelection(b,h,h)}else{b.value=Strtran(b.value,decSep,"");setSelection(b,h-2,h-2);addText(b,decSep);setSelection(b,p,p)}return true}else{return false}}}else{return(d-h)<o}}}else{if(p==0&&a==d){return true}else{if(h==0){return true}else{if(p<h&&a>=h){return(d-n-a+p)<w}else{if(p<h){return true}else{return(d-h)<=o}}}}}}else{if(o>0&&(f==44||f==46)){var y;var l="";if(a==p){if(h==0&&p==n){l="0";y=true}else{y=h==0}}else{if(p==0&&a==d){l="0";b.value="";y=true}else{y=h==0||(p<h&&a>=h);if(p==0){l="0"}}}if(y){addText(b,l+decSep);b.value=b.value.substr(0,p)+b.value.substr(a);setSelection(b,p+1,p+1);if(IsIE()||IsIE_Mac()){t.keyCode=null}else{t.preventDefault()}}return y}else{if(f==45){if(a==p){if(p-n>0&&typeof(m[2])=="undefined"){ShowPopUpCalculator(b,f,w,o)}else{ChangeMarkField(b,p,a)}return false}else{if(p==0&&a==d){return true}else{return n==0&&p==0}}}else{if(f==-1||f==8){var g=false;var x=0,r=0;var s="";var u=0;if(h!=0){if(p==0){if(a==d){g=false}else{if(a>=h){if(d-n-a+p<=w){g=false}else{g=true;x=p;r=a;s="0"+decSep;u=0}}else{if(a==(h-1)){g=true;x=p;r=a;s="0";u=0}else{if(a==p){g=false}else{g=true;x=p;r=a}}}}}else{if(a==d){g=false}else{if(n==1&&p==n&&a==h-1){g=true;x=p;r=a;s="0";u=1}else{if(p<h-1){if(a<=h-1){g=false}else{if(d-n-a+p>w){g=true;x=p;r=a;u=p;s=decSep}}}else{if(p==h-1){var q=true;if(p==a){f==-1?a+=1:q=false}if(q&&d-n-a+p>w){g=true;x=p;r=a;u=p;s=decSep}}else{if(p==h&&f==8&&p==a){p-=1;if(d-n-a+p>w){g=true;u=a}}else{g=false}}}}}}}if(g){b.value=b.value.substr(0,x)+b.value.substr(r);setSelection(b,p,p);addText(b,s);setSelection(b,u,u);if(IsIE()||IsIE_Mac()){t.keyCode=null}else{if(f==-1){addText(b," ");setSelection(b,u,u)}t.preventDefault();return false}}}else{if(f==42||f==43||f==47){ShowPopUpCalculator(b,f,w,o);return false}else{return false}}}}}}function addText(b,c){b.focus();if(b.createTextRange){document.selection.createRange().text+=c}else{if(b.setSelectionRange){var a=b.selectionEnd;b.value=b.value.substr(0,a)+c+b.value.substr(a);b.setSelectionRange(a+c.length,a+c.length)}else{}}}function getSelectionStart(a){if(a.createTextRange){selectedRange=document.selection.createRange().duplicate();selectedRange.moveEnd("character",a.value.length);pos=a.value.lastIndexOf(selectedRange.text);if(selectedRange.text==""){pos=a.value.length}return pos}else{return a.selectionStart}}function getSelectionEnd(a){if(a.createTextRange){selectedRange=document.selection.createRange().duplicate();selectedRange.moveStart("character",-a.value.length);pos=selectedRange.text.length;return pos}else{return a.selectionEnd}}function setSelection(b,c,d){if(b.createTextRange){var a=b.createTextRange();a.collapse(true);a.moveEnd("character",c);a.moveStart("character",d);a.select()}else{b.setSelectionRange(c,d)}}function ChangeMarkField(b,c,a){c=typeof(c)=="undefined"?getSelectionStart(b):c;a=typeof(a)=="undefined"?getSelectionEnd(b):a;if(At("-",b.value)==0){b.value="-"+b.value;setSelection(b,c+1,a+1)}else{b.value=Substr(b.value,2);setSelection(b,c-1,a-1)}}function CheckUpper(c){var b,a;if(typeof(c)=="undefined"){c=window.event}b=GetKeyCode(c);a=GetEventSrcElement(c);if(IsNetscape()||IsMozilla()){if(Eq(b,0)||Eq(b,8)||Eq(b,13)){return true}}if(IsAlpha(b)){if(b>96&&b<123){if(IsIE()||IsIE_Mac()){c.keyCode=b-32}else{c.preventDefault();a.value=a.value+String.fromCharCode(b-32)}}}return true}function CheckAlpha(c){var b,a;if(typeof(c)=="undefined"){c=window.event}b=GetKeyCode(c);a=GetEventSrcElement(c);if(IsNetscape()||IsMozilla()){if(Eq(b,0)||Eq(b,8)||Eq(b,13)){return true}}return IsAlpha(b)}function ManageNumericDel(e,keyCode){var field=GetEventSrcElement(e);try{var x=new MyEvent(e,keyCode);return eval(field.id+"_CheckNumWithPict(x)")}catch(ex){}}MyEvent=function(b,a){if(a==46){a=-1}this.rootEvent=b;this.keyCode=a;this.which=a};function ValidNum(b,c){var a=0;if(At(".",c)>0){a=Len(Substr(c,At(".",c)+1))}return(Round(b,a))}function CompleteWithRegionalSettings(a,b){if(typeof(document.FSender)!="undefined"&&typeof(document.FSender.m_cRegionalSettings)!="undefined"){if(b==null){if(a.indexOf("?")==-1){a+="?"}else{a+="&"}a+="m_cRegionalSettings="+URLenc(document.FSender.m_cRegionalSettings.value)}else{b.write("<input type=hidden name=m_cRegionalSettings value="+ToHTMLValue(document.FSender.m_cRegionalSettings.value)+"></input>")}}return a}function SetLocationHref(a,b,c){try{if(a==null){if(frames[c]==null){if(parent.SetLocationHref){parent.SetLocationHref(null,b,c)}else{a=parent.frames[c].location}}else{a=frames[c].location}}if(a){a.href=CompleteWithRegionalSettings(b)}}catch(d){}}function windowOpenForeground(a,b,k,e,g,m){if(a==null){return null}var l,h;if(e==null&&a.length<=1500){a=CompleteWithRegionalSettings(a);l=window.open(a,b,k)}else{if(e==null){var c=a.indexOf("?");if(c!=-1){e=a.substr(c+1).split("&");g=[];var o;for(var f=0;f<e.length;f++){o=e[f].indexOf("=");g[f]=unescape(Strtran(e[f].substr(o+1),"%80","%u20AC"));e[f]=Left(e[f],o)}a=Left(a,c)}else{e=[];g=[]}}if(m==null){l=window.open("",b,k);h=l.document}else{h=m}h.close();h.open();h.write("<HTML><form name=sender method=post action=");h.write(a);h.write(">");for(var f=0;f<e.length;f++){h.write("<input type=hidden name=");h.write(e[f]);h.write(" value=");h.write(ToHTMLValue(g[f]));h.write(">")}CompleteWithRegionalSettings(null,h);h.write("</form></HTML>");h.close();h.sender.submit()}if(m==null){l.focus();return l}}function PageClick(b,c){if(m_nPageNumbers>1){for(var a=1;a<=m_nPageNumbers;a++){if(a!=b){Ctrl("page_"+a).style.display="none"}}Ctrl("page_"+b).style.display="block";m_nCurrentPage=b;last_focused_comp=null;if(typeof(LoadChildrenInPage)=="function"){LoadChildrenInPage(b,c)}}}function TogglePage(a,b){if(m_nPageNumbers>1){Ctrl("page_"+a).style.display=Ctrl("page_"+a).style.display=="none"?"block":"none";m_nCurrentPage=a;last_focused_comp=null;if(typeof(LoadChildrenInPage)=="function"){LoadChildrenInPage(a,b)}}}function ControlPage(a){if(a.length!=null&&a.length>0){a=a[0].parentNode}if(a.parentNode!=null&&m_nPageNumbers>1&&Left(a.parentNode.id,5)=="page_"){return Val(Substr(a.parentNode.id,6))}else{return 1}}function CtrlById(b){var a=document.getElementsByName(b);if(a.length==1){return a[0]}else{if(a.length==0){a=document.getElementById(b);return a?a:null}else{return a}}}var Ctrl=CtrlById;function CtrlByName(a){return CtrlById(a)}function ReloadMenu(){var a=window.parent.frames.menu;if(a==null){a=window.parent.parent.frames.menu}if(a!=null){if((a.m_nUserCode!=null&&a.m_nUserCode!=m_nUserCode)||(a.m_cLanguage!=null&&a.m_cLanguage!=m_cLanguage)||(a.m_cCompany!=null&&a.m_cCompany!=m_cCompany)||(a.m_cThemePath!=null&&Strtran(a.m_cThemePath,"../","")!=m_cThemePath)){a.location.reload(true);if(window.parent.winList){window.parent.location.reload(true)}}}}function SetRegionalSettings(){var b=SettingsApplet();b.SetRow(0);b.setValue("decimalSeparator",decSep);b.setValue("thousandSeparator",milSep);b.setValue("dataFormat","dd/mm/aaaa");document.FSender.m_cRegionalSettings.value=b.asString()}function SetNumberSettings(){try{var b=(1.2).toLocaleString();decSep=b.substr(1,1);milSep=decSep==","?".":","}catch(a){decSep=".";milSep=","}}function Translate(d,c,a){var b=TransDict[d];if(b==null){b=d}if(!Empty(c)){b=Strtran(b,"%1",c);if(!Empty(a)){b=Strtran(b,"%2",a)}}return b}function GetFrameIdx(c){var b=0;var a;var d=window.frames;while(b<d.length&&a==null){if(d[b].name==c){a=b}b++}return a}function FrameRef(b){var a=GetFrameIdx(b);if(a!=null){return window.frames[a]}}function FetchDate(c){var a=c.getDate();var d=c.getMonth();var b=c.getFullYear();return new Date(b,d,a)}function FetchDateTime(e){var b=e.getDate();var f=e.getMonth();var d=e.getFullYear();var a=e.getHours();var g=e.getMinutes();var c=e.getSeconds();return new Date(d,f,b,a,g,c)}function SetHypPar(c,d){var b=HParApplet();b.SetRow(0);b.setValue(c,d)}function ToHTMLValue(a){return"'"+ToHTML(a)+"'"}function ToHTML(a){a=Strtran(a,"&","&amp;");a=Strtran(a,"\\","&#092;");a=Strtran(a,"<","&lt;");a=Strtran(a,">","&gt;");a=Strtran(a,'"',"&quot;");a=Strtran(a,"'","&#39;");a=Strtran(a,"\r","&#13;");a=Strtran(a,"\n","&#10;");a=Strtran(a,"\u20ac","&euro;");return a}function IsNamedParameters(a){return(typeof(a)=="object"&&a.constructor!=Date)}function GetProperty(a,b,c){return AtW(a.getValue(b),c)}function GetTrsProps(){var a=arguments[0];var b=arguments[1],d;for(var c=2;c<arguments.length;c++){a[arguments[c]]=new TrsJavascript();d=b.p["0#"+arguments[c]];if(d==null){d=b.p[arguments[c]]}a[arguments[c]].BuildProperties(d==null?"":d)}}function AtExitValue(){var a=CtrlByName("FSender");if(a==null||typeof(a)=="undefined"||typeof(a.m_cAtExit)=="undefined"){return""}else{return a.m_cAtExit.value}}function AutozoomParms(){var b=CtrlByName("FSender");var a="";if(b!=null){if(typeof(b.m_cAtExit)!="undefined"){a="&m_cAtExit="+b.m_cAtExit.value}}if(typeof(b.m_cDecoration)!="undefined"){a+="&m_cDecoration="+b.m_cDecoration.value}return a}function AlertErrorMessage(a){var b="";a=Translate(a);if(typeof m_cErrorFromRoutine!="undefined"&&m_cErrorFromRoutine!=null){b=m_cErrorFromRoutine}else{b=Translate("MSG_VALUE_NOT_ALLOWED")}a=Strtran(a,"%ERRORMESSAGE%",b);m_cErrorFromRoutine="";return a}function RunSecurity(){if(typeof m_cProgName=="undefined"){return}var a="SPManageProcedureSecurity";if(typeof PlatformPathStart=="function"){a=PlatformPathStart(a)}windowOpenForeground(a+"?progname="+m_cProgName,"","toolbar=0,menubar=0,directories=0,width=524,height=400,resizable=1")}function CreatePortlet(){if(typeof m_cProgName=="undefined"){return}windowOpenForeground(ToResource("visualweb/editor.htm?servlet="+URLenc("true")+"&id="+URLenc(m_cProgName)+"")+"&m_cAction=start&m_cAtExit=close&m_cMode=hyperlink","","toolbar=0,menubar=0,directories=0,width="+(100+m_nPreferredWidth)+",height="+(10+m_nPreferredHeight)+",resizable=1")}function ExtendTable(){if(typeof m_cProgName=="undefined"){return}windowOpenForeground(ToResource("spextender/index.htm?table="+URLenc(m_cVirtName)),"","toolbar=0,menubar=0,directories=0,width=625,height=465,resizable=1")}function SetDisplay(d,b){if(typeof d=="string"){d=Ctrl(d)}if(d!=null){if(typeof(IsTabstrip)=="function"&&IsTabstrip(d.id)){SetDisplayTabstrip(d.id,b);return}if(typeof d.length=="undefined"||d.tagName=="SELECT"){if("TABLE"==d.tagName){d.style.display=(b?"none":"")}else{if("IFRAME"==d.tagName){d.style.visibility=(b?"hidden":"")}else{d.style.display=(b?"none":"inline")}}if("LABEL"==d.tagName&&"SPAN"==d.parentNode.tagName){d.parentNode.style.display=b?"none":"block"}}else{for(var a=0;a<d.length;a++){d[a].style.display=b?"none":"inline";if("LABEL"==d[a].tagName&&"SPAN"==d[a].parentNode.tagName){d[a].parentNode.style.display=b?"none":"block"}}}}}function SetDisabled(g,f){if(typeof g=="string"){g=Ctrl(g)}if(g!=null){if(typeof g.length=="undefined"||g.tagName=="SELECT"){var e=g.tagName=="TEXTAREA"?"readOnly":"disabled";g[e]=f;if(typeof IsTabstrip=="function"&&IsTabstrip(g.id)){return SetDisabledTabstrip(g.id,f)}else{if(At("_ZOOM",g.id)!=0){if(Left(g.className,10)=="ZoomButton"){var b="ZoomButton"+(f?"Disabled":"Enabled");if(b!=g.className){g.className=b}}else{if(Left(g.className,14)=="CalendarButton"){var b="CalendarButton"+(f?"Disabled":"Enabled");if(b!=g.className){g.className=b}}else{if(f){var b=Strtran(Strtran(g.style.backgroundImage,"zoom_enabled","zoom_disabled"),"zoom_calendar_enabled","zoom_calendar_disabled");if(b!=g.style.backgroundImage){g.style.backgroundImage=b}}else{var b=Strtran(Strtran(g.style.backgroundImage,"zoom_disabled","zoom_enabled"),"zoom_calendar_disabled","zoom_calendar_enabled");if(b!=g.style.backgroundImage){g.style.backgroundImage=b}}}}}}}else{for(var a=0;a<g.length;a++){g[a].disabled=f}}}}function IsWndAccessible(b){if(typeof b=="string"){b=window[b]}try{return b!=null&&b.constructor!=Date}catch(a){return false}}function SetWindowPreferredSize(g,e){var c=Ctrl("toolbarTR")?Ctrl("toolbarTR").offsetWidth+5:0;var a=Ctrl("toolbarTR")?Ctrl("toolbarTR").offsetHeight:0;var f=Ctrl("titleTable")?Ctrl("titleTable").offsetHeight+2:0;var d=parent.document.body.offsetWidth;var b=document.body.offsetHeight;if(g==null){g=false}if(e==null){e=false}if(Max(m_nPreferredWidth+20,c)>d||g){d=Max(m_nPreferredWidth+20,c)+12;parent.window.resizeTo(d,parent.document.body.offsetHeight)}if(m_nPreferredHeight>b||g){b=Max(m_nPreferredHeight+f+a+90+(parent.document.body.offsetHeight-document.body.offsetHeight),200);parent.window.resizeTo(parent.document.body.offsetWidth,b)}if(e){moveTo((screen.availWidth-d)/2>0?(screen.availWidth-d)/2:0,(screen.availHeight-b)/2>0?(screen.availHeight-b)/2:0)}}function GetWindowPreferredSize(){var c=Ctrl("toolbarTR")?Ctrl("toolbarTR").offsetWidth+5:0;var a=Ctrl("toolbarTR")?Ctrl("toolbarTR").offsetHeight:0;var e=Ctrl("titleTable")?Ctrl("titleTable").offsetHeight+2:0;var d=parent.document.body.offsetWidth;var b=document.body.offsetHeight;return{h:m_nPreferredHeight+e+a,w:Max(m_nPreferredWidth+20,c)+12}}var dragObj=new Object();function dragToolbar(b,a){b=(b)?b:window.event;a=Ctrl(a);if(a){dragObj.css=a.style}if(!b||!dragObj.css){return}dragObj.downX=(b.layerX)?b.layerX:(b.offsetX)?b.offsetX:0;dragObj.downY=(b.layerY)?b.layerY:(b.offsetY)?b.offsetY:0;if(arguments.length=3&&document.all){dragObj.downX=dragObj.downX+arguments[2]}if(arguments.length=4&&document.all){dragObj.downY=dragObj.downY+arguments[3]}if(document.addEventListener){document.addEventListener("mousemove",dragStart,true);document.addEventListener("mouseup",dragEnd,true);b.preventDefault()}else{if(document.attachEvent){document.attachEvent("onmousemove",dragStart);document.attachEvent("onmouseup",dragEnd);return false}}}function dragStart(c){c=(c)?c:window.event;var a=(c.pageX)?c.pageX:(c.clientX)?c.clientX+document.documentElement.scrollLeft+document.body.scrollLeft:0;var f=(c.pageY)?c.pageY:(c.clientY)?c.clientY+document.documentElement.scrollTop+document.body.scrollTop:0;var d=(a-dragObj.downX);var b=(f-dragObj.downY);if(d<0){d=0}if(b<0){b=0}dragObj.css.left=d+"px";dragObj.css.top=b+"px";if(c.preventDefault){c.preventDefault()}else{return false}}function dragEnd(a){if(document.removeEventListener){document.removeEventListener("mousemove",dragStart,true);document.removeEventListener("mouseup",dragEnd,true)}else{if(document.detachEvent){document.detachEvent("onmousemove",dragStart);document.detachEvent("onmouseup",dragEnd)}}}function documentAddClick(a){if(document.addEventListener){document.addEventListener("click",a,true)}else{if(document.attachEvent){document.attachEvent("onclick",a);return false}}}function documentRemoveClick(a){if(document.removeEventListener){document.removeEventListener("click",a,true)}else{if(document.detachEvent){document.detachEvent("onclick",a)}}}function LaunchCalendar(b,c){if(typeof(b)=="string"){b=Ctrl(b)}if(c==null){c="DD-MM-YYYY"}if(b.length){for(var a=0;a<b.length;a++){if((b[a].type)&&"text"==(b[a].type)){b=b[a];break}}}ShowPopUpCalendar(b,TranslatePicture(c),TranslatePicture("DD-MM-YYYY"))}function DoLinkZoom(a,b){if(typeof window.opener.ReportLinkValue!="undefined"){window.opener.ReportLinkValue(a,b);window.opener.focus();self.close()}else{alert("Impossibile riportare il valore selezionato")}}function EntityStatus(){if(typeof m_cFunction=="undefined"){return" "}else{switch(m_cFunction){case"query":return"Q";case"edit":return"E";case"new":return"N";case"view":return"V";case"dialog":return"D";default:return" "}}}function GetModDecPict(e){var c=Strtran(e,",","");var b,d;var a=At(".",c);if(a==0){return[c.length,0]}if(a==c.length){return[a-1,0]}return[a-1,c.length-a]}function SubmitForm(c,b,e){var d=true;if(m_bAlreadySubmitted){alert(Translate("MSG_SERVER_DATA"));return}if(typeof m_bFieldsUpdated!="undefined"&&m_bFieldsUpdated&&c!="save"){d=window.confirm(Translate("MSG_LEAVE_MOD"))}if(d){var a=document.FSender;if(a.StartRow&&c!="next"&&c!="previous"&&(typeof m_bResetOnSave=="undefined"||c!="save")){a.StartRow.value="1";a.m_nRows.value="0"}if(a.m_bQuery&&(c=="query"||c=="save")){a.m_bQuery.value="true"}a.m_cWv.value=PrepareSubmitData(e);if(b!=null){a.action=b}a.m_cAction.value=c;a.submit();m_bAlreadySubmitted=true;InstTR()}}function PrepareSubmitData(a){FillWv();if(a!=null){WvApplet().Append(a)}return WvApplet().asString()}function SetWindowObject(a){var b=NameForCaller();if(IsWndAccessible(window[b])){l_oWnd=new Function("v,d","return typeof "+b+"[v] == 'undefined' ? d : "+b+"[v]");if(Ne(typeof(window[b].FrmMain),"undefined")){if(a){if(Ne(typeof(window[b].FSender),"undefined")&&Ne(typeof(window[b].FSender.m_cRegionalSettings),"undefined")){l_oWv.setValue(m_cRegionalSettings,window[b].FSender.m_cRegionalSettings.value)}}}}else{l_oWnd=new Function("v,d","return d")}}function NameForCaller(){var a="opener";if(IsWndAccessible(window.opener)){a="opener"}else{if(IsWndAccessible(window.parent)){a="parent"}}return a}function IsDisabledByStateDriver(a){return typeof(IsDisabled)=="undefined"?false:IsDisabled(a)}function IsHiddenByStateDriver(a){return typeof(IsHidden)=="undefined"?false:IsHidden(a)}function DisableInputsInContainer(a,b){a=typeof(a)=="string"?Ctrl(a):a;var d=a!=null?a.childNodes:new Array();var e;for(var c=0;c<d.length;c++){e=d.item(c);switch(e.tagName){case"INPUT":SetDisabled(e,b);break;case"DIV":case"SPAN":DisableInputsInContainer(e,b);break;case"TABLE":DisableInputsInTable(e,b);default:}}}function DisableInputsInTable(d,a){d=typeof(d)=="string"?Ctrl(d):d;var b,c;for(b=0;b<d.rows.length;b++){for(c=0;c<d.rows[b].cells.length;c++){DisableInputsInContainer(d.rows[b].cells[c],a)}}}function TransferBetweenWindows(a,b,e,c){var d=a[b];if(d.getFullYear&&d.getMonth&&d.getDate&&d.getHours&&d.getMinutes&&d.getSeconds&&d.getMilliseconds){d=new Date(d.getFullYear(),d.getMonth(),d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds(),d.getMilliseconds())}if(e==null){window[c](d)}else{window[e]=d}}function _CopyCallers(v){if(IsWndAccessible(opener)){var n;for(var i=0;i<v.length;i++){n="w_"+v[i];if(eval("Empty("+n+") && Ne(opener."+n+",null)")){TransferBetweenWindows(opener,n,n)}}}}_CPVr=_CopyCallers;function CopyWorkVar(g,d,h,f){var b=false,a,e,k;if(typeof g.TrsRow!="undefined"){k=g.TrsRowSample()}for(var c=0;c<h.length;c++){a=h[c];if(!f||Ne(window["o_"+a],window["w_"+a])){e=d[c];if(g["Set_"+e]==null){g.TransferBetweenWindows(window,"w_"+a,"w_"+e);g.SetModified(k!=null&&typeof k[e]!="undefined");b=true}else{g.TransferBetweenWindows(window,"w_"+a,null,"Set_"+e);b=false}}}if(b){g.DoUpdate(true)}}function TrsRowSample(){return new TrsRow(2)}function ChildToLoad(a){return Ctrl(a).src=="javascript:[].join()"}function AdjustFontSize(c){if(document.styleSheets){var d,a,b,e;for(i=0;i<document.styleSheets.length;i++){if(IsIE()){d=document.styleSheets[i].rules}if(IsNetscape()||IsMozilla()){d=document.styleSheets[i].cssRules}for(j=0;j<d.length;j++){a=d[j].style.fontSize;b=parseInt(a);e="";if(Right(LRTrim(a),2)=="pt"||Right(LRTrim(a),2)=="px"){e=Right(LRTrim(a),2);if(b>2){d[j].style.fontSize=LRTrim(Str(b/c,4,2))+e}}}}}}function DriveUI(){DisableUI();HideUI()}function DisableUI(){if(typeof m_aStateDisabledFields!="undefined"){DisableFields(m_aStateDisabledFields)}if(typeof m_aStateDisabledTabs!="undefined"){DisableTabs(m_aStateDisabledTabs)}}function HideUI(){if(typeof m_aStateHiddenFields!="undefined"){HideFields(m_aStateHiddenFields)}if(typeof m_aStateHiddenTabs!="undefined"){HideTabs(m_aStateHiddenTabs)}}function DisableFields(a){for(var b=0;b<a.length;b++){SetDisabled(a[b],true)}}function HideFields(a){for(var b=0;b<a.length;b++){SetDisplay(a[b],true)}}function DisablePages(a){for(var b=0;b<a.length;b++){DisableInputsInContainer(a[b],true)}}function HideTabs(b){for(var a=0;a<b.length;a++){SetDisplay(b[a].replace(/ /g,"_")+"_TAB",true)}}function DisableTabs(b){for(var a=0;a<b.length;a++){SetDisabledTabstrip(b[a].replace(/ /g,"_")+"_TAB",true)}}function IsDisabled(b,a){return(typeof(m_aStateDisabledFields)!="undefined"&&LibJavascript.Array.indexOf(m_aStateDisabledFields,b)!=-1)||(typeof(m_aStateDisabledTabs)!="undefined"&&LibJavascript.Array.indexOf(m_aStateDisabledTabs,b)!=-1)||IsInDisabledPages(b,a)}function IsHidden(a){return(typeof(m_aStateHiddenFields)!="undefined"&&LibJavascript.Array.indexOf(m_aStateHiddenFields,a)!=-1)||(typeof(m_aStateHiddenTabs)!="undefined"&&LibJavascript.Array.indexOf(m_aStateHiddenTabs,a)!=-1)}function IsInDisabledPages(c,b){if(typeof m_cStateDisabledPages!="undefined"){for(var a=0;a<m_cStateDisabledPages.length;a++){if(FindInputInContainer(c,Ctrl(m_cStateDisabledPages[a]),b)){return true}}}return false}function FindInputInContainer(f,a,d){var c=a.childNodes;var e;for(var b=0;b<c.length;b++){e=c.item(b);switch(e.tagName){case"INPUT":if(e.id==f||e.name==f||(d&&e.className==f)){return true}break;case"DIV":case"SPAN":if(FindInputInContainer(f,e,d)){return true}break;case"TABLE":if(FindInputInTable(f,e,d)){return true}break;default:}}return false}function FindInputInTable(e,d,c){var a,b;for(a=0;a<d.rows.length;a++){for(b=0;b<d.rows[a].cells.length;b++){if(FindInputInContainer(e,d.rows[a].cells[b],c)){return true}}}return false}function _ResetTracker(){if(typeof _tracker=="undefined"||!_tracker.askwrn){_tracker={ctrl:null,badValue:null,askwrn:false,goon:function(b,a){return(Ne(this.ctrl,b)||Ne(this.badValue,a))&&!this.askwrn}}}}function _modifyandopen(c,a,b){if(b!=null&&typeof SetModified=="function"){SetModified(b)}windowOpenForeground(c,"",a)};
