function pause(d){var c="window.setTimeout(function () { window.close(); }, "+d+");";var b='<html><head><title>Attendere...</title></head><body bgcolor=#eceaea><table width=100% height=100% border=0><tr><td align=center valign=middle style="font-family:arial">Attendere il caricamento del figlio ...</td></tr></table></body><script>'+c+"<\/script></html>";var a;if(IsIE()){a=window.showModalDialog("javascript:document.writeln('"+b+"')",null,"dialogHeight:50px;dialogWidth:320px;status:no;help:no")}else{if(IsNetscape()||IsMozilla()){}}}function checkAndLoadChild(a){if(Eq(CtrlById(Lower(a)).src,"")){CtrlById(Lower(a)).src=Lower(a)+"?m_bInnerChild=true"+GetLinkPCKeys(a);pause(1500)}}function gasplib_Transform(b,a){return Format(b,0,0,a)}function gasplib_AddDetailRow(g,a){var c,d,b;d=CtrlById("GridTable");for(c=0;c<g.length;c++){try{window["Set_"+g[c]](a[c])}catch(f){b="w_"+g[c];window[b]=a[c];Calculate();SaveDependsOn();SetControlsValue();EnableControlsUnderCondition()}}Calculate();SaveDependsOn();SetControlsValue();EnableControlsUnderCondition();Dataoperations("Add",d)}function gasplib_AppendDetailRow(d,a){var c=false;var b=CtrlById("GridTable").rows.length-1;if(!gasplib_WriteDetailField(b,d,a)){return(false)}if(!ActivateNextRow(null,b)){return(false)}return(true)}function gasplib_AsciiToChar(a){return Chr(a)}function gasplib_ConvData(c){var a=new String();var e=new String();var d=new String();var b=new String();d=c.substr(0,4);e=c.substr(4,2);a=c.substr(6,2);b=a+"/"+e+"/"+d;return(b)}function gasplib_DateDiff(c,a){var b=0;if((typeof c=="undefined")||(typeof a=="undefined")){return b}if((typeof c=="object")&&(c.constructor==Date)){datDate1=c}else{datDate1=Date.parse(c)}if((typeof a=="object")&&(a.constructor==Date)){datDate2=a}else{datDate2=Date.parse(a)}b=((datDate2-datDate1)/(24*60*60*1000));return b}function gasplib_Evaluator(AInstruction){var res="";eval(AInstruction);return res}function gasplib_FillArrayRows(d,a,b,c){if(a==-1){a=m_oTrs.length}for(key=d;key<a;key++){retVal=gasplib_WriteDetailFields(ARow,b,c)}}function gasplib_GetComboValue(c,b){var a="";switch(c){case"MRTSTAT":switch(b){case"01":a="Celibe/Nubile";break;case"02":a="Coniugato/a";break;case"03":a="Vedovo/a";break;case"04":a="Separato/a legalmente";break;case"05":a="Divorziato/a";break;case"06":a="Decetuto/a";break;case"07":a="Tutelato/a";break;case"08":a="Figlio/a minore";break;default:a="Non comunicato"}break;case"TITLSTUD":switch(b){case"01":a="Nessuno";break;case"02":a="Licenza elementare";break;case"03":a="Licenza media";break;case"04":a="Diploma";break;case"05":a="Laurea";break;case"06":a="Attestato";break;case"07":a="Diploma post-laurea";break;default:a="Non comunicato"}break}return a}function gasplib_GetParentVariableDate(AVarName){var RetVal=new Date();var command;if((parent==null)&&(opener==null)){return null}if(parent!=null){op=parent}if(opener!=null){op=opener}command="RetVal = new Date('"+op[AVarName]+"');";eval(command);return(RetVal)}function gasplib_GetParentVariableNumber(AVarName){var RetVal=0;var command;if((parent==null)&&(opener==null)){return null}if(parent!=null){op=parent}if(opener!=null){op=opener}command="RetVal = '"+op[AVarName]+"';";eval(command);return(RetVal)}function gasplib_GetParentVariableString(AVarName){var RetVal;var command;if((parent==null)&&(opener==null)){return null}if(parent!=null){op=parent}if(opener!=null){op=opener}command="RetVal = '"+op[AVarName]+"';";eval(command);return(RetVal)}function gasplib_GetSon(SonName){var RetVal;var toEvaluate;var command;var theObj;RetVal=null;checkAndLoadChild(SonName);toEvaluate="theObj = parent.frames.main.frames."+Lower(SonName);eval(toEvaluate);if((typeof theObj=="undefined")||(theObj==null)){toEvaluate="theObj = m_o"+Lower(SonName);eval(toEvaluate);if((typeof theObj=="undefined")||(theObj==null)){return(RetVal)}else{return(theObj)}}else{return(theObj)}}function gasplib_GetSonVariable(AVarName,SonName){var RetVal;var toEvaluate;var command;var theObj;RetVal="";checkAndLoadChild(SonName);toEvaluate="theObj = parent.frames.main.frames."+Lower(SonName);eval(toEvaluate);if((typeof theObj=="undefined")||(theObj==null)){toEvaluate="theObj = m_o"+Lower(SonName);eval(toEvaluate);if((typeof theObj=="undefined")||(theObj==null)){return(RetVal)}else{command="RetVal = m_o"+Lower(SonName)+"."+AVarName;eval(command);return(RetVal)}}else{command="RetVal = "+theObj.name+"."+AVarName;eval(command);return(RetVal)}}function gasplib_GetSonVariableDate(AVarName,SonName){var RetVal;var toEvaluate;var command;var theObj;var theval;RetVal=new Date();checkAndLoadChild(SonName);toEvaluate="theObj = parent.frames.main.frames."+Lower(SonName);eval(toEvaluate);if((typeof theObj=="undefined")||(theObj==null)){toEvaluate="theObj = m_o"+Lower(SonName);eval(toEvaluate);if((typeof theObj=="undefined")||(theObj==null)){return(RetVal)}else{command="theval = m_o"+Lower(SonName)+"."+AVarName;eval(command);command="RetVal = new Date('"+theval+"');";eval(command);return(RetVal)}}else{command="theval = "+theObj.name+"."+AVarName;eval(command);command="RetVal = new Date('"+theval+"');";eval(command);return(RetVal)}}function gasplib_GetSonVariableNumber(AVarName,SonName){var RetVal;var toEvaluate;var command;var theObj;RetVal=0;checkAndLoadChild(SonName);toEvaluate="theObj = parent.frames.main.frames."+Lower(SonName);eval(toEvaluate);if((typeof theObj=="undefined")||(theObj==null)){toEvaluate="theObj = m_o"+Lower(SonName);eval(toEvaluate);if((typeof theObj=="undefined")||(theObj==null)){return(RetVal)}else{command="RetVal = m_o"+Lower(SonName)+"."+AVarName+"';";eval(command);return(RetVal)}}else{command="RetVal = "+theObj.name+"."+AVarName+";";eval(command);return(RetVal)}}function gasplib_GetSonVariableString(AVarName,SonName){var RetVal="";var toEvaluate;var command;var theObj;checkAndLoadChild(SonName);toEvaluate="theObj = parent.frames.main.frames."+Lower(SonName);eval(toEvaluate);if((typeof theObj=="undefined")||(theObj==null)){toEvaluate="theObj = m_o"+Lower(SonName);eval(toEvaluate);if((typeof theObj=="undefined")||(theObj==null)){return(RetVal)}else{command="RetVal = m_o"+Lower(SonName)+"."+AVarName+"';";eval(command);return(RetVal)}}else{command="RetVal = "+theObj.name+"."+AVarName+";";eval(command);return(RetVal)}}function gasplib_LoadAccRow(d){var g="X";var j=new Array();var a=new Array();var f=gasplib_ReadSQL("QLOADACCOUNT",d);var c=f.length;j[0]="CPROWORD";j[1]="IDACCOUNT";j[2]="VACREDITCUR";j[3]="VADEBITCUR";try{for(var b=0;b<c;b++){a[0]=Val(f[b][0]);a[1]=f[b][1];a[2]=0;a[3]=0;if(f[b][2]==1){a[2]=1000}else{a[3]=500}gasplib_AddDetailRow(j,a)}}catch(h){g="E"}return g}function gasplib_NewDate(c,b){if(c==null){return c}var a;a=c.getTime();return new Date(a+b*86400000)}function gasplib_NvlC(b,a){if(b!=null){return b}return a}function gasplib_NvlD(b,a){if(b!=null){return b}return a}function gasplib_NvlN(b,a){if(b!=null){return b}return a}function gasplib_PG(b,a){return this.Picture(b,a,",")}function gasplib_PS(b,a){return this.Picture(b,a,",")}function gasplib_Picture(c,a,d){var b="";if(a>0){b=".";for(i=0;i<a;i++){b=b+"9"}}for(i=0;i<(c-a);i++){if(i%3==0&&i>0){b=d+b}b="9"+b}return(b)}function gasplib_ReadSQL(cCmd,cParam){var strparms="";if(!Empty(cParam)){var aparms=cParam.split(",");for(var i=0;i<aparms.length;i++){if(Trim(aparms[i])!=""){get_par=URLenc(aparms[i]);strparms+="&w_"+get_par+"="+CtrlByName(get_par).value}}}var url=new JSURL("../servlet/SQLDataProviderServer?rows=10000&startrow=0&sqlcmd="+URLenc(cCmd)+strparms,true);var output=url.Response();if(output!=""){output=eval(output);return output[1]}else{return new Array()}}function gasplib_RefreshSon(ASonName){var theObj;var toEvaluate;theObj=gasplib_GetSon(ASonName);if((typeof theObj=="undefined")||(theObj==null)){alert("La finestra "+ASonName+" non è presente!!!")}else{toEvaluate="theObj.document.refresh();";eval(toEvaluate)}}function gasplib_SelectDeselectAll(cObjName,nValue){var l_nOldRow=m_nCurrentRow;var Command;SetControlsValue();WorkToTrs();m_nCurrentRow=0;TrsToWork();SetControlsValue();while(Lt(m_nCurrentRow,m_nRows+1)){Command="Set_"+cObjName+"("+nValue+")";eval(Command);Command="w_"+cObjName+"="+nValue;eval(Command);SetControlsValue();WorkToTrs();m_nCurrentRow=m_nCurrentRow+1;TrsToWork();SetControlsValue()}m_nCurrentRow=l_nOldRow;TrsToWork();SetControlsValue()}function gasplib_SetDetailRowEditable(b){var c=Rows()-1;var a=CtrlById("GridTable");if(Ne(m_cFunction,"edit")&&Ne(m_cFunction,"new")){return(false)}if(Ne(b,m_nCurrentRow)){if((Gt(b,c))||(Lt(b,0))){return(false)}ActivateNextRow(b-1);if(Ne(b,m_nCurrentRow)){return(false)}}return(true)}function gasplib_SetDetailRowValue(AColName){var res="";var command;if(m_nCurrentRow<=0){return res}command="res = m_oTrs[m_nCurrentRow]."+AColName+";";eval(command);return res}function gasplib_SetParentVariable(a,b){var c;if((parent==null)&&(opener==null)){c="E"}if(parent!=null){op=parent}if(opener!=null){op=opener}if(op!=null){try{try{op["Set_"+Substr(a,3)](b)}catch(d){c="a:"+d;op[a]=b;op.Calculate();op.SetControlsValue();op.EnableControlsUnderCondition()}}catch(d){c="b:"+d}}else{c="X"}return(c)}function gasplib_SetSonVarC(b,d,f){var a;var g;g="X";checkAndLoadChild(b);var c=FrameRef(b);try{c["Set_"+d](f);g="S"}catch(h){a="w_"+d;c[a]=f;c.Calculate();c.SetControlsValue();c.EnableControlsUnderCondition();g="H"}return(g)}function gasplib_SetSonVarD(b,f,d){var a;var g;g="X";checkAndLoadChild(b);var c=FrameRef(b);try{c["Set_"+f](d);g="S"}catch(h){a="w_"+f;c[a]=d;c.Calculate();c.SetControlsValue();c.EnableControlsUnderCondition();g="H"}return(g)}function gasplib_SetSonVarN(b,d,f){var a;var g;g="X";checkAndLoadChild(b);var c=FrameRef(b);try{c["Set_"+d](f);g="S"}catch(h){a="w_"+d;c[a]=f;c.Calculate();c.SetControlsValue();c.EnableControlsUnderCondition();g="H"}return(g)}function gasplib_SetSonVariable(b,d,f){var a;var g;g="X";checkAndLoadChild(b);var c=FrameRef(b);try{c["Set_"+d](f);g="S"}catch(h){a="w_"+d;c[a]=f;c.Calculate();c.SetControlsValue();c.EnableControlsUnderCondition();g="H"}return(g)}function gasplib_SetVarNamed(AVarName,AVarVal){eval(AVarName+" = '"+AVarVal+"'");SetModified();DoUpdate(true)}function gasplib_SystemTimeMillis(){return(-1)}function gasplib_Test(a,e){var b,d;var c;var f=gasplib_ReadSQL(a,e);d=f.length;alert("Trovati record:"+d);for(b=0;b<d;b++){alert("Codice:"+f[b][0]+"Nome:"+f[b][1]+"Flag:"+f[b][2])}}function gasplib_WriteDetailField(c,b,d){var a=gasplib_WriteDetailFields(c,new Array(b),new Array(d));return(a)}function gasplib_WriteDetailFields(ARow,AFields,AFieldValues){var retVal;var esitoFinale=true;var savedRow=m_nCurrentRow;var i;var command="";if(!gasplib_SetDetailRowEditable(ARow)){return(false)}retVal=true;for(i=0;i<AFields.length;i++){command="retVal = Set_"+AFields[i]+'("'+AFieldValues[i]+'")';eval(command);esitoFinale=((esitoFinale)&&(retVal))}if(esitoFinale){gasplib_SetDetailRowEditable(savedRow)}return(esitoFinale)}function gasplib_getcMonth(b){var a="";switch(b){case"1":a="Gennaio";break;case"2":a="Febbraio";break;case"3":a="Marzo";break;case"4":a="Aprile";break;case"5":a="Maggio";break;case"6":a="Giugno";break;case"7":a="Luglio";break;case"8":a="Agosto";break;case"9":a="Settembre";break;case"10":a="Ottobre";break;case"11":a="Novembre";break;case"12":a="Dicembre";break;default:a=""}return a}function gasplib_vvv(a){var b=0;return b}function MakeGASPLib(){this.AddDetailRow=gasplib_AddDetailRow;this.AppendDetailRow=gasplib_AppendDetailRow;this.AsciiToChar=gasplib_AsciiToChar;this.ConvData=gasplib_ConvData;this.DateDiff=gasplib_DateDiff;this.Evaluator=gasplib_Evaluator;this.FillArrayRows=gasplib_FillArrayRows;this.GetComboValue=gasplib_GetComboValue;this.GetParentVariableDate=gasplib_GetParentVariableDate;this.GetParentVariableNumber=gasplib_GetParentVariableNumber;this.GetParentVariableString=gasplib_GetParentVariableString;this.GetSon=gasplib_GetSon;this.GetSonVariable=gasplib_GetSonVariable;this.GetSonVariableDate=gasplib_GetSonVariableDate;this.GetSonVariableNumber=gasplib_GetSonVariableNumber;this.GetSonVariableString=gasplib_GetSonVariableString;this.LoadAccRow=gasplib_LoadAccRow;this.NewDate=gasplib_NewDate;this.NvlC=gasplib_NvlC;this.NvlD=gasplib_NvlD;this.NvlN=gasplib_NvlN;this.PG=gasplib_PG;this.PS=gasplib_PS;this.Picture=gasplib_Picture;this.ReadSQL=gasplib_ReadSQL;this.RefreshSon=gasplib_RefreshSon;this.SelectDeselectAll=gasplib_SelectDeselectAll;this.SetDetailRowEditable=gasplib_SetDetailRowEditable;this.SetDetailRowValue=gasplib_SetDetailRowValue;this.SetParentVariable=gasplib_SetParentVariable;this.SetSonVarC=gasplib_SetSonVarC;this.SetSonVarD=gasplib_SetSonVarD;this.SetSonVarN=gasplib_SetSonVarN;this.SetSonVariable=gasplib_SetSonVariable;this.SetVarNamed=gasplib_SetVarNamed;this.SystemTimeMillis=gasplib_SystemTimeMillis;this.Test=gasplib_Test;this.Transform=gasplib_Transform;this.WriteDetailField=gasplib_WriteDetailField;this.WriteDetailFields=gasplib_WriteDetailFields;this.getcMonth=gasplib_getcMonth;this.vvv=gasplib_vvv}var GASPLib=new MakeGASPLib();