From: <Saved by Microsoft Internet Explorer 5>
Subject: =?Windows-1252?Q?Not=EDcia_Fresca?=
Date: Fri, 18 Oct 2002 16:01:47 +0100
MIME-Version: 1.0
Content-Type: multipart/related;
	boundary="----=_NextPart_000_004F_01C276BF.A99CECA0";
	type="text/html"
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

This is a multi-part message in MIME format.

------=_NextPart_000_004F_01C276BF.A99CECA0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://interno.cvrvv.pt/eVerde/WAMLibrary/Interface/standard.asp?witype=row&winame=noticiasFrescas&key=52

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML lang=3Dpt><HEAD><TITLE>Not=EDcia Fresca</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1"><LINK=20
href=3D"http://interno.cvrvv.pt/eVerde/WAMLibrary/WAMcss.win.css.txt"=20
type=3Dtext/css rel=3DSTYLESHEET><LINK=20
href=3D"http://interno.cvrvv.pt/eVerde/css/WAMcss.win.css.txt" =
type=3Dtext/css=20
rel=3DSTYLESHEET>
<SCRIPT language=3DJavaScript=20
src=3D"http://interno.cvrvv.pt/eVerde/WAMLibrary/window_prototype.js">=0A=
</SCRIPT>

<SCRIPT language=3DJavaScript>=0A=
<!--=0A=
var WAMRootURL =3D 'http://interno.cvrvv.pt/eVerde/';=0A=
var WAMMessages =3D new Array();=0A=
//-->=0A=
</SCRIPT>

<SCRIPT language=3DJavaScript>=0A=
<!--=0A=
function window_onLoad(){=0A=
	window.executeOnLoad();=0A=
}=0A=
=0A=
//-->=0A=
</SCRIPT>

<META content=3D"MSHTML 6.00.2716.2200" name=3DGENERATOR></HEAD>
<BODY leftMargin=3D0 topMargin=3D0=20
onload=3D'javascript:if (typeof(window_onLoad) =3D=3D "function") =
window_onLoad();'=20
marginHeight=3D"0" marginWidth=3D"0"><!--- WAM --->
<TABLE cellSpacing=3D0 cellPadding=3D0 width=3D"100%" border=3D0>
  <SCRIPT language=3DJavaScript>=0A=
<!--=0A=
var objWAMRow;=0A=
function Create_objWAMRow(){=0A=
	objWAMRow =3D new WAMRow('noticiasFrescas', =
'http://interno.cvrvv.pt/eVerde/');=0A=
	objWAMRow.rowMode =3D 2;=0A=
	objWAMRow._customRow =3D false;=0A=
}=0A=
window.addToOnLoad(Create_objWAMRow);=0A=
=0A=
//-->=0A=
</SCRIPT>

  <SCRIPT language=3DJavaScript>=0A=
<!--=0A=
=0A=
function Columns(){=0A=
	objWAMRow.add(new WAMRowColumn('noticiasFrescas', 'id', 'int', 'null', =
null, 10, 0, false));=0A=
	objWAMRow.add(new WAMRowColumn('noticiasFrescas', 'data', 'datetime', =
'wamdate', null, 23, 3, true));=0A=
	objWAMRow.add(new WAMRowColumn('noticiasFrescas', 'dataExpira', =
'datetime', 'wamdate', null, 23, 3, true));=0A=
	objWAMRow.add(new WAMRowColumn('noticiasFrescas', 'imagem', 'varchar', =
'wamexternalimage', 255, null, null, true, =
'__IMG_noticiasFrescas_imagem', =
'http://interno.cvrvv.pt/eVerde/images/noticiasFrescas/uvas(4).gif'));=0A=
	objWAMRow.add(new WAMRowColumn('noticiasFrescas', 'titulo', 'varchar', =
'null', 100, null, null, true));=0A=
	objWAMRow.add(new WAMRowColumn('noticiasFrescas', 'descricao', =
'varchar', 'null', 400, null, null, true));=0A=
	objWAMRow.add(new WAMRowColumn('noticiasFrescas', 'tipo', 'char', =
'null', 5, null, null, true));=0A=
	objWAMRow.add(new WAMRowColumn('noticiasFrescas', 'url', 'varchar', =
'wamurl', 255, null, null, true));=0A=
	objWAMRow.add(new WAMRowColumn('noticiasFrescas', 'texto', 'text', =
'null', 2147483647, null, null, true));=0A=
	objWAMRow.add(new WAMRowColumn('noticiasFrescas', 'lingua', 'char', =
'null', 2, null, null, true));=0A=
	objWAMRow.columns['id'].setPk();=0A=
}=0A=
window.addToOnLoad(Columns);=0A=
// --- This event is used when the user abandon the row without saving=0A=
function window_onBeforeUnload(){=0A=
	if (objWAMRow.isDirty() && objWAMRow.getAction() =3D=3D =
WAMROW_ACTIONEMPTY){=0A=
		window.event.returnValue =3D WAMMessages.MESSAGE_ROW_close;=0A=
	}=0A=
}=0A=
//window.onbeforeunload =3D window_onBeforeUnload;=0A=
function __RowClientMessages(){=0A=
	WAMMessages['MESSAGE_ROW_delete'] =3D "Tem a certeza que pretende =
eliminar este registo?\n\nClick em 'Ok' para apagar este registo para =
sempre. N=E3o ser=E1 poss=EDvel voltar atr=E1s.";=0A=
}=0A=
window.addToOnLoad(__RowClientMessages);=0A=
=0A=
//-->=0A=
</SCRIPT>

  <TBODY>
  <TR>
    <TD class=3DcssWAMwinTitle>&nbsp;</TD>
    <TD class=3DcssWAMwinTitle><SPAN =
class=3DcssWAMwinTitleTop><NOBR>e-Verde=20
      Gestor v1.2<BR></SPAN><SPAN class=3DcssWAMwinTitleBottom=20
      title=3D"Not=EDcia Fresca"><NOBR>Not=EDcia =
Fresca</SPAN></NOBR></TD></TR>
  <TR>
    <TD colSpan=3D2 height=3D10></TD></TR>
  <TR>
    <TD><IMG height=3D1=20
      src=3D"http://interno.cvrvv.pt/eVerde/WAMLibrary/Images/space.gif" =

    width=3D10></TD>
    <TD width=3D"100%">
      <TABLE id=3DWAMCanvas cellSpacing=3D0 cellPadding=3D0 border=3D0>
        <TBODY>
        <TR>
          <TD>
            <TABLE cellSpacing=3D0 cellPadding=3D0 border=3D0>
              <TBODY>
              <TR>
                <TD noWrap>
                  <FORM id=3D__formWAMRow name=3D__formWAMRow=20
                  onsubmit=3D"return false;"=20
                  =
action=3D/eVerde/WAMLibrary/Interface/standard.asp?witype=3DROW&amp;winam=
e=3DnoticiasFrescas=20
                  method=3Dpost encType=3Dmultipart/form-data>
                  <TABLE cellSpacing=3D0 cellPadding=3D1 border=3D0>
                    <TBODY>
                    <TR>
                      <TD vAlign=3Dcenter noWrap align=3Dright></TD>
                      <TD vAlign=3Dcenter align=3Dleft><INPUT=20
                        class=3DcssWAMstandardEdit =
id=3DnoticiasFrescas_id disabled=20
                        type=3Dhidden size=3D11 value=3D52 =
name=3DnoticiasFrescas_id=20
                        label=3D"Id"></TD></TR>
                    <TR>
                      <TD vAlign=3Dcenter noWrap =
align=3Dright><B>Data</B></TD>
                      <TD vAlign=3Dcenter align=3Dleft><INPUT=20
                        class=3DcssWAMstandardEdit =
id=3DnoticiasFrescas_data=20
                        title=3DData style=3D"WIDTH: 74px; TEXT-ALIGN: =
right"=20
                        tabIndex=3D0 size=3D10 value=3D01-08-2002=20
                        name=3DnoticiasFrescas_data =
label=3D"Data"></TD></TR>
                    <TR>
                      <TD vAlign=3Dcenter noWrap align=3Dright><B>Expira =
em</B></TD>
                      <TD vAlign=3Dcenter align=3Dleft><INPUT=20
                        class=3DcssWAMstandardEdit =
id=3DnoticiasFrescas_dataExpira=20
                        title=3D"Data em que a not=EDcia deixa de ser =
vis=EDvel"=20
                        style=3D"WIDTH: 74px; TEXT-ALIGN: right" =
tabIndex=3D0=20
                        size=3D10 name=3DnoticiasFrescas_dataExpira=20
                        label=3D"Expira em"></TD></TR>
                    <TR>
                      <TD vAlign=3Dcenter noWrap =
align=3Dright><B>Imagem</B></TD>
                      <TD vAlign=3Dcenter align=3Dleft><IMG=20
                        id=3D__IMG_noticiasFrescas_imagem=20
                        =
ondblclick=3D'window.openChild(window.document.all["__IMG_noticiasFrescas=
_imagem"].src, WinFeatures(0, 0, "no", "no", "no", "yes", "no", "yes", =
"yes"));'=20
                        height=3D100=20
                        =
src=3D"http://interno.cvrvv.pt/eVerde/images/noticiasFrescas/uvas(4).gif"=
=20
                        width=3D150 =
name=3D__IMG_noticiasFrescas_imagem><BR><INPUT=20
                        class=3DcssWAMstandardEdit =
id=3DnoticiasFrescas_imagem=20
                        title=3D"Logotipo da not=EDcias" style=3D"WIDTH: =
368px"=20
                        tabIndex=3D0 type=3Dfile size=3D60 =
name=3DnoticiasFrescas_imagem=20
                        label=3D"Imagem"><INPUT =
id=3D__image_noticiasFrescas_imagem=20
                        type=3Dhidden value=3Duvas(4).gif=20
                        name=3D__image_noticiasFrescas_imagem></TD></TR>
                    <TR>
                      <TD vAlign=3Dcenter noWrap =
align=3Dright><B>T=EDtulo</B></TD>
                      <TD vAlign=3Dcenter align=3Dleft><TEXTAREA =
class=3DcssWAMstandardEditTEXTAREA id=3DnoticiasFrescas_titulo =
title=3DT=EDtulo style=3D"WIDTH: 368px; HEIGHT: 36px" tabIndex=3D0 =
name=3DnoticiasFrescas_titulo cols=3D60 label=3D"T=EDtulo">Comunicado de =
Vindima 2002-2003</TEXTAREA></TD></TR>
                    <TR>
                      <TD vAlign=3Dcenter noWrap =
align=3Dright><B>Descri=E7=E3o</B></TD>
                      <TD vAlign=3Dcenter align=3Dleft><TEXTAREA =
class=3DcssWAMstandardEditTEXTAREA id=3DnoticiasFrescas_descricao =
title=3D"Breve descri=E7=E3o" style=3D"WIDTH: 368px; HEIGHT: 63px" =
tabIndex=3D0 name=3DnoticiasFrescas_descricao rows=3D5 cols=3D60 =
label=3D"Descri=E7=E3o"></TEXTAREA></TD></TR>
                    <TR>
                      <TD vAlign=3Dcenter noWrap =
align=3Dright><B>Tipo</B></TD>
                      <TD vAlign=3Dcenter align=3Dleft><SELECT=20
                        class=3DcssWAMstandardEdit =
id=3DnoticiasFrescas_tipo=20
                        title=3DTipo tabIndex=3D0 =
name=3DnoticiasFrescas_tipo=20
                        label=3D"Tipo"> <OPTION value=3DURL =
selected>URL<OPTION=20
                          value=3DTEXTO>TEXTO<OPTION=20
                        value=3DOUTRO>OUTRO</OPTION></SELECT> </TD></TR>
                    <TR>
                      <TD vAlign=3Dcenter noWrap =
align=3Dright><B>Url</B><A=20
                        =
onclick=3D'javascript:this.href=3DobjWAMRow.columns["url"].getValue();'=20
                        tabIndex=3D-1 href=3D"javascript:void(null)" =
target=3D_blank>=20
                        url</A></TD>
                      <TD vAlign=3Dcenter align=3Dleft><INPUT=20
                        class=3DcssWAMstandardEdit =
id=3DnoticiasFrescas_url=20
                        title=3D"Endere=E7o da not=EDcia"=20
                        style=3D"WIDTH: 368px; TEXT-ALIGN: left" =
tabIndex=3D0=20
                        size=3D60=20
                        =
value=3Dhttp://www.vinhoverde.pt/pt/noticiasfrescas/vindima2002-2003.htm =

                        name=3DnoticiasFrescas_url =
label=3D"Url"></TD></TR>
                    <TR>
                      <TD vAlign=3Dcenter noWrap =
align=3Dright><B>Conte=FAdo</B></TD>
                      <TD vAlign=3Dcenter align=3Dleft><TEXTAREA =
class=3DcssWAMstandardEditTEXTAREA id=3DnoticiasFrescas_texto =
title=3D"Conte=FAdo da not=EDcias" style=3D"WIDTH: 368px; HEIGHT: 63px" =
tabIndex=3D0 name=3DnoticiasFrescas_texto rows=3D5 cols=3D60 =
label=3D"Conte=FAdo"></TEXTAREA></TD></TR>
                    <TR>
                      <TD vAlign=3Dcenter noWrap =
align=3Dright><B>L=EDngua</B></TD>
                      <TD vAlign=3Dcenter align=3Dleft><SELECT=20
                        class=3DcssWAMstandardEdit =
id=3DnoticiasFrescas_lingua=20
                        title=3DL=EDngua tabIndex=3D0 =
name=3DnoticiasFrescas_lingua=20
                        label=3D"L=EDngua"> <OPTION value=3Dpt =
selected>pt<OPTION=20
                          value=3Den>en</OPTION></SELECT>=20
                  </TD></TR></TBODY></TABLE><BR><BR>
                  <P align=3Dright><INPUT class=3DcssWAMstandardButton =
id=3DbtnDelete title=3D"Apagar registo" onclick=3D"javascript: =
objWAMRow.aspDelete();" type=3Dbutton value=3DApagar =
name=3DbtnDelete>&nbsp;&nbsp;<INPUT class=3DcssWAMstandardButton =
id=3DbtnCancel title=3DCancelar onclick=3D"javascript: =
objWAMRow.cancel();" type=3Dbutton value=3DCancelar =
name=3DbtnCancel>&nbsp;&nbsp;<INPUT class=3DcssWAMstandardButton =
id=3DbtnUpdate title=3D"Guardar registo" disabled onclick=3D"javascript: =
objWAMRow.aspUpdate();" type=3Dbutton value=3DGuardar =
name=3DbtnUpdate></P><INPUT=20
                  id=3D__disabled_noticiasFrescas_id type=3Dhidden=20
                  name=3D__disabled_noticiasFrescas_id> <INPUT=20
                  id=3D__old_noticiasFrescas_id type=3Dhidden value=3D52 =

                  name=3D__old_noticiasFrescas_id> <INPUT id=3DwrAction =
type=3Dhidden=20
                  value=3DSR name=3DwrAction> <INPUT id=3DwrAutoSave =
type=3Dhidden=20
                  value=3Dfalse name=3DwrAutoSave> <INPUT =
id=3DwrSaveAndEditNew=20
                  type=3Dhidden value=3Dfalse name=3DwrSaveAndEditNew> =
<INPUT=20
                  id=3DwrSaveAndEdit type=3Dhidden value=3Dfalse =
name=3DwrSaveAndEdit>=20
                  <INPUT id=3Dwrsac type=3Dhidden value=3Dfalse =
name=3Dwrsac> <INPUT=20
                  id=3DwrKeyText type=3Dhidden value=3Dkey=3D52 =
name=3DwrKeyText> <INPUT=20
                  id=3DwrIsDirty type=3Dhidden value=3Dfalse =
name=3DwrIsDirty> <INPUT=20
                  id=3Dwrftoexe type=3Dhidden name=3Dwrftoexe>=20
            </FORM></TD></TR></TBODY></TABLE>
            <SCRIPT language=3DJavaScript>=0A=
<!--=0A=
window.document.title +=3D " (52)";=0A=
=0A=
//-->=0A=
</SCRIPT>

            <SCRIPT language=3DJavaScript=20
            =
src=3D"http://interno.cvrvv.pt/eVerde/WAMLibrary/ClientJavaScript.js.asp?=
wr=3D1">=0A=
</SCRIPT>

            <SCRIPT language=3DJavaScript>=0A=
<!--=0A=
function WAMCanvasResize(){=0A=
	if (isUndefined(window.WAMCanvas)) return false;=0A=
	var iAH, iAW, iCH, iCW, iWX, iWY, iST, SL;=0A=
	iST =3D window.screenTop;=0A=
	iSL =3D window.screenLeft;=0A=
	iAH =3D screen.availHeight;=0A=
	iAW =3D screen.availWidth;=0A=
	iCH =3D window.WAMCanvas.clientHeight;=0A=
	iCW =3D window.WAMCanvas.clientWidth;=0A=
	iWX =3D iCW+50 > iAW-iSL ? iAW-iSL-20 : iCW+50;=0A=
	iWY =3D iCH+150 > iAH-iST ? iAH-iST+20 : iCH+150;=0A=
	window.resizeTo(iWX, iWY);=0A=
}=0A=
window.addToOnLoad(WAMCanvasResize);=0A=
//-->=0A=
</SCRIPT>
          </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<DIV id=3D_ExecuteOnServer style=3D"VISIBILITY: hidden"=20
name=3D"_ExecuteOnServer"></DIV>
<STYLE type=3Dtext/css media=3Dprint>SPAN.cssWAMVERSION {
	VISIBILITY: hidden
}
</STYLE>
<BR><BR><SPAN class=3DcssWAMVERSION=20
style=3D"FONT: 9px tahoma,verdana,arial">&nbsp;Web Application Maker =
Version=20
v8.01<BR>&nbsp;WAMLibrary =A9 Declarativa 2000-2002<BR><BR>&nbsp;Hello,=20
declarativa&nbsp;&nbsp;|&nbsp;&nbsp;18-10-2002 =
16:12:31:151</SPAN></BODY></HTML>

------=_NextPart_000_004F_01C276BF.A99CECA0
Content-Type: image/gif
Content-Transfer-Encoding: base64
Content-Location: http://interno.cvrvv.pt/eVerde/WAMLibrary/Images/space.gif

R0lGODlhCAAIAID/AMDAwAAAACH5BAEAAAAALAAAAAAIAAgAAAIHhI+py+1dAAA7

------=_NextPart_000_004F_01C276BF.A99CECA0
Content-Type: image/gif
Content-Transfer-Encoding: base64
Content-Location: http://interno.cvrvv.pt/eVerde/images/noticiasFrescas/uvas(4).gif

R0lGODlhFwAgAPcAAP///yEhIVpaWt7GxiEYGK17c2tCOe/WzufOxtZzUsacjIxjUu/e1ufWzsa1
rWtaUq17YzkpIZRjStbGvXNjWqV7Y4RaQoRKKda9rWtCKdaEUufOvdacc96MUtaESs6tlHNSOYRa
Ob2MY7V7SpRaKe/ezq2cjKWUhIx7a/fn1rWllO/WvefOtd7Gre/Orda1lM6tjFpKOd61jK2Ma5x7
WoRjQpxrOWNCIbVzMa1rKUpCOSkhGM6cY86UUs6MQrV7Oa1zMc6EMefGnN69lLWUa86lc4xjMZxr
MbV7Ma2chO/Wtd7GpcatjL2lhN61e2NKKc6UQr2EOdaUOc6MMca1nGNSOb2ca86cUntaKffnzvfe
tXNjSue9e4RrQs6lY2tSKc6cSqV7OcaUQtacOaWcjL2le/fWnO/OlNa1e8ala9atY5x7Qt6tUrWM
QqV7Md6lQr2tjKWUc97GlIx7WoRzUjkxId69e961Y4RrOaWEQntjMc6lUu/OhL2cUue9Y4xzOee1
St6tQvfnve/etb2la3NjOaWMSsalUrWUQue9UoxzMYR7Y0I5IefGa//33vfv1pSMc5yMWqWUWox7
QqWce2NaOZSESlJKKUpCIVpSKZSMWmtjMZSUjHNza1JSSqWllDExKXNzWmtrSoSEWnNzSkJCKTk5
IXNzQkpKKYSEQjExGGNrQnOEQjlCIYSMc0pSOYycc1JjOWNzUkpaOXuEc1pjUpSclDlCOVpzWoSU
jJylpXuMjEJSUoyUnISMlHt7hGNja0I5UlJKWoxzhMDAwIxaY3NCSgAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAMQALAAAAAAXACAA
QAj/AIkJHEiwoMGDBZcgNLghEZshajKAEaOmCAlCpmId2dNCDkI5V9KoIJYGjRdIewgtakNoocuX
BF00IsZlDB9AVAK9bCEEww8RMuDUUXVIRR9fa5rAPGgn0ZsrSwVmiUo16syZMG+eERJlCok9R2QM
iQIHzh4mY+wYPLNHjJw+XsIQKoNJUp0mwBAlQejiDhxEMNAYadInhhg0oJigqUrMThQ0aDQ1Zky5
skE/ljMPNKPZsqAhxBLNTBR64ZlEcpbICOJEDRc0Mg59MIHmwxisA50MEbLnSZEMRYLIGANEhaUw
TBwcXMEmiqE+bZA7yBTAE4E2ezAgHKDmyIQPPT6sTPJEiYCIE4aUHmQgJ0oYIgNUXHiuIgonwAjP
+BnSZokXEpakQsMhZRhRxGIIKXHHHR/oRMwLRRTxRAiItCFEVY4RwgEasKjV2YfEBAQAOw==

------=_NextPart_000_004F_01C276BF.A99CECA0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://interno.cvrvv.pt/eVerde/css/WAMcss.win.css.txt

BODY {
	FONT: 11px tahoma, verdana, arial; BACKGROUND-COLOR: rgb(255,255,255)
}
TD.cssWAMwinTitle {
	HEIGHT: 45px; BACKGROUND-COLOR: rgb(0,57,24)
}
SPAN.cssWAMwinTitleTop {
	FONT: 10px tahoma,verdana,arial; COLOR: rgb(255,255,255)
}
SPAN.cssWAMwinTitleBottom {
	FONT: bold 24px tahoma,verdana,arial; COLOR: rgb(255,255,255)
}
TD.cssWAMlistDark {
	FONT: 11px tahoma,verdana,arial; COLOR: rgb(0,0,0); BACKGROUND-COLOR: =
rgb(192,220,192)
}
TR.cssWAMlistLight {
	FONT: 11px tahoma,verdana,arial; BACKGROUND-COLOR: rgb(235,235,235)
}
TR.cssWAMlistSelected {
	FONT: 11px tahoma,verdana,arial; COLOR: rgb(255,255,255); =
BACKGROUND-COLOR: rgb(192,220,192)
}
IMG.cssdbotipoLocalpictograma {
	HEIGHT: 20px
}
IMG.cssdbotipoProdutoimagem1 {
	HEIGHT: 17px
}
IMG.cssdbotipoProdutoimagem2 {
	HEIGHT: 17px
}

------=_NextPart_000_004F_01C276BF.A99CECA0
Content-Type: application/x-javascript
Content-Transfer-Encoding: quoted-printable
Content-Location: http://interno.cvrvv.pt/eVerde/WAMLibrary/window_prototype.js

function WinFeatures(w, h, t, l, d, s, m, sc, r){
	var c =3D "toolbar=3D"+t+
//	var c =3D "toolbar=3D"+1+
		",location=3D"+l+
//		",location=3D"+1+
		",directories=3D"+d+
		",status=3D"+s+
//		",menubar=3D"+m+
		",menubar=3D"+1+
		",scrollbars=3D"+sc+
		",resizable=3D"+r+
		",width=3D"+150+
		",height=3D"+1+
		"";
	return c;
}

// --- Properties
window.childWindows =3D new Array();
window._nChilds =3D 0;
window.toExecuteOnOnLoad =3D new Array();
window.addToOnLoad =3D window_addToOnLoad;
window.executeOnLoad =3D window_executeOnLoad;
window.browser =3D new Browser();

// --- Methods
window.newWindowName =3D window_newWindowName;
window.openChild =3D window_openChild;
window.closeChild =3D window_closeChild;
window.closeAllChilds =3D window_closeAllChilds;
window.deleteChild =3D window_deleteChild;
window.deleteFromParent =3D window_deleteFromParent
window.onunload =3D window_onUnLoad;

function window_newWindowName(){
	var dt =3D new Date();
	return =
"window"+dt.getFullYear()+dt.getMonth()+dt.getDate()+dt.getHours()+dt.get=
Minutes()+dt.getSeconds()+dt.getMilliseconds()+(++this._nChilds);
}

function window_openChild(strURL, strWinFeatures){
	var strWinName =3D this.newWindowName();
	var win =3D window.open(strURL, strWinName, strWinFeatures, true);
	this.childWindows[win.name] =3D win;
	return strWinName;
}

function window_closeChild(strWindowName){
	if (typeof(this.childWindows[strWindowName]) !=3D "undefined"){
		this.childWindows[strWindowName].close();
		this.deleteChild(strWindowName);
	}
}

function window_closeAllChilds(){
	var win;
	for (el in this.childWindows){
		win =3D this.childWindows[el];
		this.deleteChild(el);
		if (!win.closed) win.close();
	}
}

function window_deleteChild(strWindowName){
	delete(this.childWindows[strWindowName]);
}

function window_deleteFromParent(){
	if (this.opener+"" !=3D "undefined" && this.opener+"" !=3D "null")
		if (typeof(this.opener.childWindows) !=3D "undefined")
			if (typeof(this.opener.childWindows[this.name]) !=3D "undefined")
				this.opener.deleteChild(this.name);
}

function window_addToOnLoad(varIN){
	this.toExecuteOnOnLoad[this.toExecuteOnOnLoad.length] =3D varIN;
}

function window_executeOnLoad(){
	var i;
	for (i =3D 0; i < this.toExecuteOnOnLoad.length; i++){
		switch (typeof(this.toExecuteOnOnLoad[i])){
			case "function":
				this.toExecuteOnOnLoad[i]();
				break;
			case "string":
				eval(this.toExecuteOnOnLoad[i]);
				break;
		}
	}
}

function window_onUnLoad(){
	this.closeAllChilds();
//	this.deleteFromParent();
}

function Browser() {
	var n =3D navigator.appName;
	if (n =3D=3D "Netscape") this.name =3D "ns";
	else if (n =3D=3D "Microsoft Internet Explorer") this.name =3D "ie";
	else this.name =3D name;

	var ua =3D navigator.userAgent.toLowerCase();
	if (ua.indexOf("win") > -1) this.platform =3D "win32";
	else if (ua.indexOf("mac") > -1) this.platform =3D "mac";
	else this.platform =3D "other";
=09
	this.isNS =3D this.name =3D=3D "ns";
	this.isIE =3D this.name =3D=3D "ie";
	this.isIEMAC =3D this.name =3D=3D "ie" && this.platform =3D=3D "mac";
}

if (window.browser.isNS){
	window.captureEvents(Event.CLICK);
	window.captureEvents(Event.KEYPRESS);
	window.document.onclick =3D function __setIEEvent(e){
			event =3D e;
		}
}
------=_NextPart_000_004F_01C276BF.A99CECA0
Content-Type: application/octet-stream
Content-Transfer-Encoding: quoted-printable
Content-Location: http://interno.cvrvv.pt/eVerde/WAMLibrary/ClientJavaScript.js.asp?wr=1

function _Date_toHTMLFormat(domain){
	var r, tYear, tMonth, tDate, tHours, tMinutes, tSeconds;

	switch (domain){
		case WAMDomain.wamdate:
			// --- Get Date
			tYear =3D this.getFullYear();
			tMonth =3D this.getMonth() + 1;
			tDate =3D this.getDate();
			tMonth =3D tMonth < 10 ? "0"+tMonth : tMonth;
			tDate =3D tDate < 10 ? "0"+tDate : tDate;
			r =3D tDate+"-"+tMonth+"-"+tYear;
			break;
		case WAMDomain.wamtime:
			// --- Get Time
			tHours =3D this.getHours(); tHours =3D tHours < 10 ? "0"+tHours : =
tHours;
			tMinutes =3D this.getMinutes(); tMinutes =3D tMinutes < 10 ? =
"0"+tMinutes : tMinutes;
			tSeconds =3D this.getSeconds(); tSeconds =3D tSeconds < 10 ? =
"0"+tSeconds : tSeconds;
			r =3D tHours+":"+tMinutes+":"+tSeconds;
			break;
		default:
			// --- Get DateTime
			tYear =3D this.getFullYear();
			tMonth =3D this.getMonth() + 1;
			tDate =3D this.getDate();
			tMonth =3D tMonth < 10 ? "0"+tMonth : tMonth;
			tDate =3D tDate < 10 ? "0"+tDate : tDate;
			tHours =3D this.getHours(); tHours =3D tHours < 10 ? "0"+tHours : =
tHours;
			tMinutes =3D this.getMinutes(); tMinutes =3D tMinutes < 10 ? =
"0"+tMinutes : tMinutes;
			tSeconds =3D this.getSeconds(); tSeconds =3D tSeconds < 10 ? =
"0"+tSeconds : tSeconds;
			r =3D tDate+"-"+tMonth+"-"+tYear+" =
"+tHours+":"+tMinutes+":"+tSeconds;
			break;
	}
	return r;
}

function _String_formatNum(format){
	var newStr =3D "";

	for (i =3D 0; i < format.length-this.length; i++) newStr +=3D =
format.charAt(i);
	return newStr+this.valueOf();
}

function _String_toNumber(){
	return new Number(this.replace(/ /g, ""));
}

function _String_replaceSubstr(iFrom, strWith){
	var newStr =3D "";
	iFrom--;
	return this.substr(0,iFrom)+this.substr(iFrom).replace(new =
RegExp("#{"+strWith.length+"}"), strWith);
}

function _String_splitWords(sep){
	var r; var i; var s =3D "";
=09
	r =3D this.split(sep);
	for (i in r){
		if (!isEmpty(r[i])){
			s +=3D r[i]+" ";
		}
	}
	s =3D s.substr(0, s.length-1);
	this._words =3D s.split(sep);
}

function _String_getWord(i){
	var r;

	this.splitWords(" ");
	if (isNaN(i)){
		r =3D "";
	} else {
		if (isUndefined(this._words[i-1])){
			r =3D "";
		} else {
			r =3D this._words[i-1];
		}
	}
	delete(this._words);
	return r;
}

function _String_deleteWord(iBegin, iEnd){
	var i; var s;

	this.splitWords(" ");
	if (isUndefined(iEnd)){
		iEnd =3D iBegin;
	} else {
		if (iEnd > this._words.length){
			iEnd =3D this._words.length;
		}
	}
	for (i =3D iBegin; i <=3D iEnd; i++){
		delete(this._words[i-1]);
	}
	s =3D new String(this._words.join(" "));
	s.splitWords(" ");
	delete(this._words);
	return new String(s._words.join(" "));
}

function _String_toScriptFormat(){
	return this.replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/"/g, =
'\\"');
}

function _Number_toMoney(casasDecimais){
	return formatNumber(this.round(casasDecimais), 2);
}

function _Number_round(numDecimalPlaces){
	if (isUndefined(numDecimalPlaces)) numDecimalPlaces =3D 0;
	return Math.round(this*Math.pow(10, numDecimalPlaces))/Math.pow(10, =
numDecimalPlaces)
}

function formatNumber(val, dec, mSep){
	var iIntPart, iDot, lDecPart, i;
	val +=3D "";
=09
	if (isUndefined(mSep)) mSep =3D " ";

	iDot =3D val.indexOf(".", 0);
	iIntPart =3D (iDot =3D=3D -1 ? val.length : iDot);
	lDecPart =3D val.substr(iIntPart+1).length;
=09
	for (i =3D iIntPart-4; i > 0; i-=3D3){
		val =3D val.substr(0, i+1) + mSep + val.substr(i+1);
	}
	if (i =3D=3D 0) val =3D val.substr(0, i+1) + mSep + val.substr(i+1);
	if (isNaN(dec)) return val;
	if (iDot =3D=3D -1) val +=3D ".";
	for (i=3D0; i<(dec-lDecPart); i++) val +=3D "0";
	return val;
}

function GetScriptEngineInfo(){
    var s;
    s =3D ""; // Build string with necessary info.
    s +=3D ScriptEngine() + " Version ";
    s +=3D ScriptEngineMajorVersion() + ".";
    s +=3D ScriptEngineMinorVersion() + ".";
    s +=3D ScriptEngineBuildVersion();
    return(s);
}

function encodeURL(strToEncode){
	// --- * @ - _ + . /
	return escape(strToEncode).replace(/\+/g, "%2B");
}

function validMask(varValue, strMask){
	var re =3D new RegExp(strMask);

	if (re.test(varValue)){
		return true;
	} else {
		return false;
	}
}

function isUndefined(varIn){
	if (varIn+"" =3D=3D "undefined"){
		return true;
	} else {
		return false;
	}
}

function isNull(varIn){
	if (varIn =3D=3D null){
		return true;
	} else {
		return false;
	}
}

function isEmpty(varIn){
	if (varIn+"" =3D=3D ""){
		return true;
	} else {
		return false;
	}
}

function isDigit(val){
	var digits =3D "^\\d$";
	return validMask(val, digits);
}

function previewImage(formEl, strIMGName, OLDsource){
	var strFileTemp;

	strFileTemp =3D formEl.value;
	if (typeof(__strFileUpLoadPath) =3D=3D "undefined") __strFileUpLoadPath =
=3D null;
	if (strFileTemp !=3D __strFileUpLoadPath){
		if (strFileTemp =3D=3D ""){
			window.document.all[strIMGName].src =3D OLDsource;
		} else {
			window.document.all[strIMGName].src =3D "file://" + strFileTemp;
		}
		__strFileUpLoadPath =3D strFileTemp;
	}
}

Date.prototype.toHTMLFormat =3D _Date_toHTMLFormat;
String.prototype.formatNum =3D _String_formatNum;
String.prototype.toNumber =3D _String_toNumber;
String.prototype.replaceSubstr =3D _String_replaceSubstr;
String.prototype.splitWords =3D _String_splitWords;
String.prototype.getWord =3D _String_getWord;
String.prototype.deleteWord =3D _String_deleteWord;
String.prototype.toScriptFormat =3D _String_toScriptFormat;

Number.prototype.toMoney =3D _Number_toMoney;
Number.prototype.round =3D =
_Number_round;//*********************************************************=
***************/
// Web Application Maker Library
//
// Copyright (c) Declarativa 2000. All Rights Reserved.
//***********************************************************************=
*/
//***********************************************************************=
*/
// ASPExecute Object (Client Side)
//***********************************************************************=
*/
function ASPExecute(){
	var AE =3D new _ASPExecute();
//AE.setDebug(true);
	return AE;
}

function _ASPExecute(){
	if (typeof(_ASPExecutePrototypeCalled) =3D=3D "undefined")
		_ASPExecute__Prototype();
}

function _ASPExecute__Prototype(){
	_ASPExecutePrototypeCalled =3D true;

	_ASPExecute.prototype.url =3D null;
	_ASPExecute.prototype.form =3D null;
	_ASPExecute.prototype.formName =3D null;
	_ASPExecute.prototype.debug =3D false;

	_ASPExecute.prototype._window =3D window;
	if (window.browser.isNS) window._ExecuteOnServer =3D =
window.document.getElementById("_ExecuteOnServer");
	_ASPExecute.prototype._iFrameHidden =3D "<iframe src=3D'about:blank' =
id=3D'ExecuteOnServer' name=3D'ExecuteOnServer' =
style=3D'visibility:hidden;width:0px;height:0px;'></iframe>";
	_ASPExecute.prototype._iFrameVisible =3D "<iframe src=3D'about:blank' =
id=3D'ExecuteOnServer' name=3D'ExecuteOnServer' =
style=3D'visibility:visible;width:600px;height:300px;'></iframe>";

	_ASPExecute.prototype.execute =3D ASPExecute_execute;
	_ASPExecute.prototype.setForm =3D ASPExecute_setForm;
	_ASPExecute.prototype.setURL =3D ASPExecute_setURL;
	_ASPExecute.prototype.setDebug =3D ASPExecute_setDebug;
=09
	function ASPExecute_execute(){
		var i;

		for (i =3D 0; i < __arASPExecute.length; i++){}
		if (isNull(__arASPExecute[i])) __arASPExecute[i] =3D this;
		setTimeout("__ASPExecute_execute__("+i+")", 100);
	}
=09
	function ASPExecute_setForm(strForm, strFormName){
		this.form =3D strForm;
		this.formName =3D strFormName;
	}
=09
	function ASPExecute_setURL(strURL){
		this.url =3D strURL;
	}

	function ASPExecute_setDebug(bolDebug){
		this.debug =3D bolDebug;
		if (this.debug =3D=3D true){
			this._window._ExecuteOnServer.style.visibility =3D "visible";
		} else {
			this._window._ExecuteOnServer.style.visibility =3D "hidden";
		}
	}
}

var __arASPExecute =3D new Array();
function __ASPExecute_execute__(i){
	__arASPExecute[i]._window._ExecuteOnServer.innerHTML =3D "";
	if (__arASPExecute[i].debug =3D=3D true){
		__arASPExecute[i]._window._ExecuteOnServer.innerHTML =3D =
__arASPExecute[i]._iFrameVisible;
	} else {
		__arASPExecute[i]._window._ExecuteOnServer.innerHTML =3D =
__arASPExecute[i]._iFrameHidden;
	}

	if (window.browser.isNS) window.ExecuteOnServer =3D =
window.document.getElementById("ExecuteOnServer");

	if (__arASPExecute[i].url !=3D null){
		if (window.browser.isNS) __arASPExecute[i]._window.ExecuteOnServer.src =
=3D __arASPExecute[i].url;
		else __arASPExecute[i]._window.ExecuteOnServer.location.href =3D =
__arASPExecute[i].url;
	} else {
		if (__arASPExecute[i].form !=3D null){
			=
__arASPExecute[i]._window.document.frames('ExecuteOnServer').document.ope=
n('text/html', 'replace');
			=
__arASPExecute[i]._window.document.frames('ExecuteOnServer').document.cha=
rset =3D 'iso8859-1';
			=
__arASPExecute[i]._window.document.frames('ExecuteOnServer').document.wri=
te("<html><body>"+__arASPExecute[i].form+"</body></html>");
			=
__arASPExecute[i]._window.document.frames('ExecuteOnServer').document.clo=
se();
			=
eval("__arASPExecute[i]._window.document.frames('ExecuteOnServer').docume=
nt."+__arASPExecute[i].formName+".submit()");
		}
	}
	__arASPExecute[i].url =3D null;
	__arASPExecute[i].form =3D null;
	__arASPExecute[i].formName =3D null;
	__arASPExecute[i] =3D null;
}//**********************************************************************=
**/
// Web Application Maker Library
//
// Copyright (c) Declarativa 2000. All Rights Reserved.
//***********************************************************************=
*/
//***********************************************************************=
*/
// WAMEventHandler Object (Client side)
//***********************************************************************=
*/
function WAMEventHandler(objParent){
	return new _WAMEventHandler(objParent);
}

function _WAMEventHandler(objParent){
	if (typeof(_WAMEventHandlerPrototypeCalled) =3D=3D "undefined")
		_WAMEventHandler__Prototype();
	=09
	this.parent =3D objParent;
}

function _WAMEventHandler__Prototype(){
	_WAMEventHandlerPrototypeCalled =3D true;
=09
	// --- Methods
	_WAMEventHandler.prototype.set =3D _WAMEventHandler_set;
	_WAMEventHandler.prototype.fire =3D _WAMEventHandler_fire;
=09
	function _WAMEventHandler_set(strEventName, =
varObjectName/*string=3Deval()...; function=3D...()*/){
		eval("this.parent."+strEventName+"=3D"+varObjectName);
	}
=09
	function _WAMEventHandler_fire(strEventName, bolTimeOut){
		if (typeof(bolTimeOut) !=3D "boolean") bolTimeOut =3D true;
		__event =3D eval("this.parent."+strEventName);
		if (__event !=3D null){
			switch (typeof(__event)){
				case "string":
					if (bolTimeOut) window.setTimeout("eval(__event)", 1);
					else return eval(__event);
					break;
				case "function":
					if (bolTimeOut) window.setTimeout("__event();", 1);
					else return __event();
					break;
			}
		}
	}
}//**********************************************************************=
**/
// Web Application Maker Library
//
// Copyright (c) Declarativa 2000. All Rights Reserved.
//***********************************************************************=
*/
function WAMDialog(strWinTitle, strTitle, strText){
	var objWAMDialog;
=09
	objWAMDialog =3D new _WAMDialog(strWinTitle, strTitle, strText);

	return objWAMDialog;
}

// _WAMDIALOG OBJECT
function _WAMDialog(strWinTitle, strTitle, strText){
	if (isUndefined(typeof(_WAMDialogPrototypeCalled)))
		_WAMDialog__Prototype();

	this.height			=3D null;
	this.width			=3D null;
	this.top			=3D null;
	this.left			=3D null;
	this.winTitle		=3D "";
	this.title			=3D "";
	this.text			=3D "";
	this.inputText		=3D null;
	this.inputWidth		=3D 200;
	this.buttons		=3D new Array();
	this.isPromptDialog	=3D false;
=09
	if (!isUndefined(strWinTitle) && !isNull(strWinTitle)) =
this.setWinTitle(strWinTitle);
	if (!isUndefined(strTitle) && !isNull(strTitle)) =
this.setTitle(strTitle);
	if (!isUndefined(strText) && !isNull(strText)) this.setText(strText);
}

// _WAMDIALOG PROTOTYPE
function _WAMDialog__Prototype(){
	_WAMDialogPrototypeCalled =3D true;
=09
	_WAMDialog.prototype.setHeight		=3D _WAMDialog_setHeight;
	_WAMDialog.prototype.setWidth		=3D _WAMDialog_setWidth;
	_WAMDialog.prototype.setTop			=3D _WAMDialog_setTop;
	_WAMDialog.prototype.setLeft		=3D _WAMDialog_setLeft;
	_WAMDialog.prototype.setWinTitle	=3D _WAMDialog_setWinTitle;
	_WAMDialog.prototype.setTitle		=3D _WAMDialog_setTitle;
	_WAMDialog.prototype.setText		=3D _WAMDialog_setText;
	_WAMDialog.prototype.addLine		=3D _WAMDialog_addLine;
	_WAMDialog.prototype.addEmptyLine	=3D _WAMDialog_addEmptyLine;
	_WAMDialog.prototype.addLineBr		=3D _WAMDialog_addLineBr;
	_WAMDialog.prototype.addButton		=3D _WAMDialog_addButton;
	_WAMDialog.prototype.show			=3D _WAMDialog_show;
	_WAMDialog.prototype.alert			=3D _WAMDialog_alert;
	_WAMDialog.prototype.prompt			=3D _WAMDialog_prompt;
=09
	function _WAMDialog_setHeight(height){
		this.height =3D height;
	}
=09
	function _WAMDialog_setWidth(width){
		this.width =3D width;
	}
=09
	function _WAMDialog_setTop(top){
		this.top =3D top;
	}=09
=09
	function _WAMDialog_setLeft(left){
		this.left =3D left;
	}
=09
	function _WAMDialog_setWinTitle(strTitle){
		this.winTitle =3D strTitle;
	}

	function _WAMDialog_setTitle(strTitle){
		this.title =3D strTitle;
	}

	function _WAMDialog_setText(strText){
		this.text =3D strText;
	}
=09
	function _WAMDialog_addLine(strLine){
		if (isNull(this.text))
			this.text =3D strLine;
		else
			this.text +=3D strLine;
	}
=09
	function _WAMDialog_addEmptyLine(intNLines){
		if (isUndefined(intNLines) || isNull(intNLines))
			intNLines =3D 1;		=09
		var l;
		for (l=3D1; l<=3DintNLines; l++)
			this.text +=3D "\n";
	}

	function _WAMDialog_addLineBr(strLine){
		if (isNull(this.text))
			this.text =3D strLine;
		else
			this.text +=3D strLine + "<br>";
	}

	function _WAMDialog_addButton(objWAMButton){
		this.buttons[this.buttons.length] =3D objWAMButton;
	}

	function _WAMDialog_show(){
		var strFeatures =3D "";
		strFeatures +=3D "dialogHeight:" + ((isNull(this.height)) ? "300px;" : =
this.height + ";");
		strFeatures +=3D "dialogWidth:" + ((isNull(this.width)) ? "300px;" : =
this.width + ";");
		if (!isNull(this.left))
			strFeatures +=3D "dialogTop:" + this.top + ";";
		if (!isNull(this.left))
			strFeatures +=3D "dialogLeft:" + this.left + ";";
		strFeatures +=3D "status: no";
		var objDialogArgs =3D new Object();
		objDialogArgs.winTitle =3D this.winTitle;
		objDialogArgs.title =3D this.title;
		objDialogArgs.text =3D this.text.replace(/\n|\r|\n\r/g, "<br>");
		objDialogArgs.text =3D objDialogArgs.text.replace(/\t/g, =
"&nbsp;&nbsp;&nbsp;&nbsp;");
		objDialogArgs.isPromptDialog =3D this.isPromptDialog;
		objDialogArgs.inputText =3D this.inputText;
		objDialogArgs.inputWidth =3D this.inputWidth;
		objDialogArgs.buttons =3D this.buttons;
		var answer =3D =
window.showModalDialog(WAMRootURL+"/wamlibrary/dialog/wamdialog.htm", =
objDialogArgs, strFeatures);
		return answer;
	}

	function _WAMDialog_alert(){
		this.addButton(new WAMButton("OK", "OK"));
		this.show();
	}
=09
	function _WAMDialog_prompt(defValue, inputWidth){
		this.isPromptDialog =3D true;
		(isUndefined(defValue) || isNull(defValue)) ? this.inputText =3D "" : =
this.inputText =3D defValue;
		if (!isUndefined(inputWidth) || !isNull(inputWidth)) this.inputWidth =
=3D inputWidth;
		this.buttons =3D new Array();
		this.addButton(new WAMButton("OK"));
		this.addButton(new WAMButton("Cancel"));
		answer =3D this.show();
		return answer;=20
	}
}




function WAMButton(label, value, tip, width){
	var objWAMButton;
	objWAMButton =3D new _WAMButton(label, value, tip, width);
	return objWAMButton;
}
=09
function _WAMButton(label, value, tip, width){
	if (isUndefined(typeof(_WAMButtonPrototypeCalled)))
		_WAMButton__Prototype();
=09
	this.label		=3D label;
	(isUndefined(tip) || isNull(tip)) ? this.value =3D this.label : =
this.value =3D value;
	this.name		=3D "btn_" + this.label;
	(isUndefined(tip) || isNull(tip)) ? this.tip =3D "" : this.tip =3D tip;
	if (!isUndefined(width)) this.width =3D width;
}

function _WAMButton__Prototype(){
	_WAMButtonPrototypeCalled =3D true;

	// --- Properties
	_WAMButton.prototype.name		=3D "";
	_WAMButton.prototype.value		=3D null;
	_WAMButton.prototype.label		=3D "";
	_WAMButton.prototype.tip		=3D "";
	_WAMButton.prototype.width		=3D "75px";

	// --- Methods
	_WAMButton.prototype.setValue	=3D _WAMButton_setValue;
	_WAMButton.prototype.setLabel	=3D _WAMButton_setLabel;
	_WAMButton.prototype.getLabel	=3D _WAMButton_getLabel;
	_WAMButton.prototype.setTip		=3D _WAMButton_setTip;
	_WAMButton.prototype.getTip		=3D _WAMButton_getTip;
	_WAMButton.prototype.setWidth	=3D _WAMButton_setWidth;

	function _WAMButton_setValue(value){
		this.value =3D value;
	}

	function _WAMButton_setLabel(strLabel){
		this.label =3D strLabel;
	}
=09
	function _WAMButton_getLabel(){
		return this.label;
	}

	function _WAMButton_setTip(strTip){
		this.tip =3D strTip;
	}

	function _WAMButton_getTip(){
		return (isNull(this.tip) ? "" : this.tip);
	}

	function _WAMButton_setWidth(strWidth){
		this.width =3D strWidth;
	}
}
//***********************************************************************=
*/
// Web Application Maker Library
//
// Copyright (c) Declarativa 2000. All Rights Reserved.
//***********************************************************************=
*/
function WAMError(rootURL){
	var objWAMError;
=09
	objWAMError =3D new _WAMError();
	objWAMError.rootURL =3D rootURL;

	return objWAMError;
}

// _WAMERROR OBJECT
function _WAMError(){
	if (isUndefined(typeof(_WAMErrorPrototypeCalled)))
		_WAMError__Prototype();

	this.rootURL =3D null;
	this.errors =3D new Array();
	this.errorMsgs =3D new Array();
	this.focus =3D null;
	this.aspExecuted =3D true;
}

// _WAMERROR PROTOTYPE
function _WAMError__Prototype(){
	_WAMErrorPrototypeCalled =3D true;
=09
	_WAMError.prototype.existsMsg		=3D _WAMError_existsMsg;
	_WAMError.prototype.add				=3D _WAMError_add;
	_WAMError.prototype.addMsg			=3D _WAMError_addMsg;
	_WAMError.prototype.addError		=3D _WAMError_addError;
	_WAMError.prototype.setError		=3D _WAMError_setError;
	_WAMError.prototype.setMacro		=3D _WAMError_setMacro;
	_WAMError.prototype.catchErrors		=3D _WAMError_catchErrors;
	_WAMError.prototype.show			=3D _WAMError_show;
	_WAMError.prototype.showParsed		=3D _WAMError_showParsed;
	_WAMError.prototype.clear			=3D _WAMError_clear;
	_WAMError.prototype.setParameters	=3D _WAMError_setParameters;
	_WAMError.prototype.setFocusTo		=3D _WAMError_setFocusTo;
	_WAMError.prototype.hasErrors		=3D _WAMError_hasErrors;
	_WAMError.prototype.setASPExecuted	=3D _WAMError_setASPExecuted;
	_WAMError.prototype.getASPExecuted	=3D _WAMError_getASPExecuted;
}

function _WAMError_setASPExecuted(blnExecuted){
	if (isUndefined(blnExecuted))
		this.aspExecuted =3D false;
	else
		this.aspExecuted =3D blnExecuted;
}

function _WAMError_getASPExecuted(){
	return this.aspExecuted;
}

function _WAMError_existsMsg(strCode){
	if (isUndefined(this.errorMsgs[strCode]))
		return null;
	else
		return this.errorMsgs[strCode];
}

function _WAMError_addMsg(strCode, objErrorMsg){
	this.errorMsgs[strCode] =3D objErrorMsg;
}

function _WAMError_addError(objError){
	this.errors[this.errors.length] =3D objError;
}

function _WAMError_setParameters(){
	var arrParam =3D new Array();
	var i;
	for (i=3D0; i<_WAMError_setParameters.arguments.length; i+=3D2)
		arrParam[_WAMError_setParameters.arguments[i]] =3D =
_WAMError_setParameters.arguments[i+1];
	return arrParam;
}

function _WAMError_add(strCode, strDescription, arrParameters, =
bolCacheMode/*default=3Dfalse*/){
	var objError;
	var objErrorMsg =3D this.existsMsg(strCode);
=09
	if (isUndefined(bolCacheMode) || isNull(bolCacheMode))
		bolCacheMode =3D false;
=09
	if (isNull(objErrorMsg)){
		objErrorMsg =3D new _ErrorMsg(strCode, strDescription);
		this.addMsg(strCode, objErrorMsg);
	}
=09
	if (!bolCacheMode){
		if (isUndefined(arrParameters))
			this.addError(new _Error(objErrorMsg));
		else{
			objError =3D new _Error(objErrorMsg);
			objError.parameters =3D arrParameters;
			this.addError(objError);
		}
	}
}

function _WAMError_setError(strCode){
	this.add(strCode, null);
}

function _WAMError_setMacro(strParam, strValue){
	strParam =3D "@" + strParam;
	this.errors[this.errors.length-1].addParameter(strParam, strValue);
}

function _WAMError_setFocusTo(objHTMLEl){
	this.focus =3D objHTMLEl;
}

function _WAMError_hasErrors(){
	return (!this.errors.length =3D=3D 0);
}
=09
function _WAMError_catchErrors(blnShowErrors){
	var err;=20
	var blnGetFromServer =3D false;=20
	var strForm=3D"";
	var objASPExec;
=09
	//----
	if (!this.getASPExecuted()) return;
	//----
=09
	if (isUndefined(blnShowErrors) || isNull(blnShowErrors))
		blnShowErrors =3D true; // Show alert with erros imediatly after =
receiving errors from the Server
	for (err in this.errorMsgs){
		// Only get description from the server for those errors not yet =
loaded in client
		if (isNull(this.errorMsgs[err].description)){
			strForm +=3D "\t\t<input type=3D'text' name=3D'txtError' value=3D'" + =
this.errorMsgs[err].code + "'>\n";
			blnGetFromServer =3D true;
		}
	}
	if (blnGetFromServer =3D=3D true){
		strForm =3D ""+
			"\t<form name=3D'frmErrors' action=3D'" + this.rootURL + =
"/WAMLibrary/WAMError_Get.asp' method=3D'post'>\n" +
			strForm + // --- INPUTs
			"\t\t<input type=3D'text' name=3D'__showErrors' value=3D'" + =
blnShowErrors + "'>\n" +
			"\t</form>\n";
		//----
		this.setASPExecuted(false);
		//----
		// Get errors description from the Server
		objASPExec =3D new ASPExecute();
		objASPExec.setForm(strForm, "frmErrors");
//objASPExec.setDebug(true);
		objASPExec.execute();
	}
	else {
		if (blnShowErrors) this.showParsed();
	}
}

function _WAMError_show(){
	var e;
	var p;
	var strErrors =3D "";
	var strParameters;
=09
	for (e in this.errors){
		strErrors +=3D this.errors[e].msg.code + "-> " + =
this.errors[e].msg.description + "\n";
		strParameters =3D "\t";
		for (p in this.errors[e].parameters)
			strParameters +=3D p + " =3D " + this.errors[e].parameters[p] + "   =
";
		strErrors +=3D strParameters + "\n\n";
	}
	alert(strErrors);
}

function _WAMError_clear(){
	delete(this.errors);
	this.errors =3D new Array();
}

function _WAMError_showParsed(bolClearErrors/*default=3Dtrue*/){
	var e;=20
	var strErrors =3D "";=20
	var objHTLMEl;
	for (e in this.errors)
		strErrors +=3D this.errors[e].parse() + "\n\n";
	alert(strErrors);
	if (bolClearErrors !=3D false){
		this.clear();
	}
	if (!isNull(this.focus)){
		//HTMLEl =3D eval("window.document." + this.focus);
		objHTLMEl =3D this.focus;
		if (typeof(objHTLMEl.name) !=3D "undefined" && objHTLMEl.type !=3D =
"hidden" && objHTLMEl.disabled !=3D true){
			objHTLMEl.focus();
		}
	}
}

function _ErrorMsg(strCode, strDescription){
	this.code =3D strCode;
	this.description =3D strDescription;
}

function _Error(objErrorMsg){
	this.msg =3D objErrorMsg;
	this.parameters =3D new Array();
	this.addParameter =3D _Error_addParameter;
	this.parse =3D _Error_Parse;
}

function _Error_addParameter(strParam, strValue){
	this.parameters[strParam] =3D strValue;
}

function _Error_Parse(){
	var p;
	var strErrorMsg;
	strErrorMsg =3D this.msg.description;
	for (p in this.parameters)
		strErrorMsg =3D strErrorMsg.replace(p, this.parameters[p]);
	return strErrorMsg;
}
var Error =3D new WAMError(WAMRootURL);
var WAMDataType =3D new Object();
WAMDataType.dtbit =3D "bit";
WAMDataType.dtbigint =3D "bigint";
WAMDataType.dtint =3D "int";
WAMDataType.dtsmallint =3D "smallint";
WAMDataType.dttinyint =3D "tinyint";
WAMDataType.dtdecimal =3D "decimal";
WAMDataType.dtnumeric =3D "numeric";
WAMDataType.dtmoney =3D "money";
WAMDataType.dtsmallmoney =3D "smallmoney";
WAMDataType.dtfloat =3D "float";
WAMDataType.dtreal =3D "real";
WAMDataType.dtdatetime =3D "datetime";
WAMDataType.dtsmalldatetime =3D "smalldatetime";
WAMDataType.dtcursor =3D "cursor";
WAMDataType.dttimestamp =3D "timestamp";
WAMDataType.dtchar =3D "char";
WAMDataType.dtvarchar =3D "varchar";
WAMDataType.dttext =3D "text";
WAMDataType.dtnchar =3D "nchar";
WAMDataType.dtnvarchar =3D "nvarchar";
WAMDataType.dtntext =3D "ntext";
WAMDataType.dimage =3D "image";

var WAMDomain =3D new Object();
WAMDomain.wamdate =3D "wamdate";
WAMDomain.wamtime =3D "wamtime";
WAMDomain.wamexternalimage =3D "wamexternalimage";
WAMDomain.wamhierarchical1 =3D "wamhierarchical1";
WAMDomain.wamhierarchical2 =3D "wamhierarchical2";
WAMDomain.wammoment =3D "wammoment";
WAMDomain.wamemail =3D "wamemail";
WAMDomain.wamurl =3D "wamurl";
WAMDomain.wamrange =3D "wamrange";

function invalidValue(){
	return "_invalid_value_";
}

function validateGeneric(strDataType, strDomain, varVal, intLen, =
intPrec, intDecs){
	var newVal;
	switch (strDataType){
		case WAMDataType.dtbit:
			newVal =3D validateBit(varVal); break;
		case WAMDataType.dtbigint:
			newVal =3D validateBigint(varVal); break;
		case WAMDataType.dtint:
			newVal =3D validateInt(varVal); break;
		case WAMDataType.dtsmallint:
			newVal =3D validateSmallint(varVal); break;
		case WAMDataType.dttinyint:
			newVal =3D validateTinyint(varVal); break;
		case WAMDataType.dtdecimal:
			newVal =3D validateDecimal(varVal, intPrec, intDecs); break;
		case WAMDataType.dtnumeric:
			newVal =3D validateNumeric(varVal); break;
		case WAMDataType.dtmoney:
			newVal =3D validateMoney(varVal, intPrec, intDecs); break;
		case WAMDataType.dtsmallmoney:
			newVal =3D validateSmallmoney(varVal); break;
		case WAMDataType.dtfloat:
			newVal =3D validateFloat(varVal); break;
		case WAMDataType.dtreal:
			newVal =3D validateReal(varVal); break;
		case WAMDataType.dtdatetime:
			newVal =3D validateDatetime(varVal, strDomain); break;
		case WAMDataType.dtsmalldatetme:
			newVal =3D validateSmalldatetime(varVal, strDomain); break;
		case WAMDataType.dtchar:
		case WAMDataType.dtnchar:
			newVal =3D validateChar(varVal, strDomain, intLen); break;
		case WAMDataType.dtvarchar:
		case WAMDataType.dtnvarchar:
			newVal =3D validateVarchar(varVal, strDomain, intLen); break;
		case WAMDataType.dttext:
			newVal =3D validateText(varVal, strDomain, 2147483647); break;
		case WAMDataType.dtntext:
			newVal =3D validateNText(varVal, strDomain, 1073741823); break;
		default:
			alert("Unknown type code at validateGeneric.");
			newVal =3D invalidValue();
			break;
	}
	return newVal;
}



function validateBit(val){
	if (isEmpty(val)) return val;
	if (isNaN(val) || (val !=3D true && val !=3D false) || (val !=3D 1 && =
val !=3D 0)){
		Error.setError("TYPBADBOOL");
		return invalidValue()
	}
	return val;
}

function validateBigint(val){
	if (isEmpty(val)) return val;
	if (isNaN(val)){
		Error.setError("TYPBADINT");
		return invalidValue();
	}
	if (val.toString().indexOf(".", 0) !=3D -1){
		Error.setError("TYPBADINT");
		return invalidValue()
	}
	if (val < -9223372036854775808 || val > 9223372036854775807){
		Error.setError("TYPINTRNG");
		return invalidValue();
	}
	return val;
}

function validateInt(val){
	if (isEmpty(val)) return val;
	if (isNaN(val)){
		Error.setError("TYPBADINT");
		return invalidValue();
	}
	if (val.toString().indexOf(".", 0) !=3D -1){
		Error.setError("TYPBADINT");
		return invalidValue()
	}
	if (val < -2147483648 || val > 2147483647){
		Error.setError("TYPINTRNG");
		return invalidValue();
	}
	return val;
}

function validateSmallint(val){
	if (isEmpty(val)) return val;
	if (isNaN(val)){
		Error.setError("TYPBADINT");
		return invalidValue();
	}
	if (val.toString().indexOf(".", 0) !=3D -1){
		Error.setError("TYPBADINT");
		return invalidValue()
	}
	if (val < -32768 || val > 32767){
		Error.setError("TYPSMIRNG");
		return invalidValue();
	}
	return val;
}

function validateTinyint(val){
	if (isEmpty(val)) return val;
	if (isNaN(val)){
		Error.setError("TYPBADINT");
		return invalidValue();
	}
	if (val.toString().indexOf(".", 0) !=3D -1){
		Error.setError("TYPBADINT");
		return invalidValue()
	}
	if (val < 0 || val > 255){
		Error.setError("TYPTNIRNG");
		return invalidValue();
	}
	return val;
}

function validateDecimal(val, intPrec, intDecs){
	var num;
	if (isEmpty(val)) return val;
	val =3D val.replace(/ /g, "");
	if (isNaN(val)){
		Error.setError("TYPBADDEC");
		return invalidValue();
	}
	if (isNull(intDecs)){
		return val;
	} else {
		num =3D new Number(val);
		val =3D formatNumber(num.round(intDecs), intDecs);
	}
	return val;
}

function validateNumeric(val){
	if (isEmpty(val)) return val;
	if (isNaN(val)){
		Error.setError("TYPBADNUM");
		return invalidValue();
	}
	return val;
}

function validateMoney(val, intLen/*Precision*/, intDecs/*Scale*/){
	if (isEmpty(val)) return val;
	if (true/*sis_EuroEnabled*/) return validateEUROMoney(val, intLen, =
intDecs);
/*
put replaceChar(val,"$",".") into val
put dropChar(val,space) into val
put the value of val into val
if val is not a number then
setError "TYPBADMONY"
return invalidValue()
end if
return replaceChar(formatNumber(val,"###' '###' '###.",true),".","$")
*/
}

function validateSmallmoney(val, intLen/*Precision*/, intDecs/*Scale*/){
	return validateMoney(val, intLen, intDecs);
}

function validateEUROMoney(val, intLen, intDecs){
	var EUROTax =3D 200.482;

	val =3D val+"";
	if (val.charAt(val.length-1).toLowerCase() =3D=3D "e"){
		val =3D val.replace(/,/, ".");
		val =3D val.replace(/e/i, "");
		if (isNaN(val)){
			Error.setError("TYPBADMONY");
			return invalidValue();
		}
		val =3D Math.round(val * EUROTax)
	} else {
		val =3D val.replace(/\$/, ".");
		val =3D val.replace(/ /g,"");
		if (isNaN(val)){
			Error.setError("TYPBADMONY");
			return invalidValue();
		}
		val =3D new Number(val);
	}
	val =3D val.toMoney(2);
	return val;
}

function validateFloat(val){
	return validateNumeric(val);
}

function validateReal(val){
	return validateNumeric(val);
}

function validateWAMDate(val, domain){
	var dt; var tYear;

	if (val =3D=3D "h" || val =3D=3D "hoje" || isEmpty(val)){
		var dt =3D new Date();
	} else {
		val =3D (val+"").replace(/ |\.|,/g, "-");
		// --- dd-mm
		if (validMask(val, "^[0-9]{1,2}-[0-9]{1,2}$")){
			var dt =3D new Date();
			dt.setDate(1); dt.setMonth(0);
			dt.setMonth(Math.ceil(val.substr(val.indexOf("-")+1))-1);
			dt.setDate(Math.ceil(val.substr(0,val.indexOf("-"))));
		} else {
			// --- dd-mm-yyyy
			if (validMask(val, "^[0-9]{1,2}-[0-9]{1,2}-[0-9]{1,4}$")){
				var dt =3D new Date();
				tYear =3D Math.ceil(val.substr(val.lastIndexOf("-")+1))
				if (tYear < 1000) tYear+=3D2000;
				dt.setDate(1); dt.setMonth(0);
				dt.setFullYear(tYear);
				dt.setMonth(Math.ceil(val.substr(val.indexOf("-")+1, =
val.lastIndexOf("-")-val.indexOf("-")-1))-1);
				dt.setDate(Math.ceil(val.substr(0,val.indexOf("-"))));
			} else {
				// --- dd
				if (!isNaN(val)){
					var dt =3D new Date();
					dt.setDate(Math.ceil(val));
					if (dt.toString() =3D=3D "NaN"){
						Error.setError("TYPBADDATE");
						Error.setMacro("D", (new Date()).toHTMLFormat(domain));
						return invalidValue();
					}
					if (dt.getFullYear() > 9999){
						Error.setError("TYPBADDATE");
						Error.setMacro("D", (new Date()).toHTMLFormat(domain));
						return invalidValue();
					}
				} else {
					Error.setError("TYPBADDATE");
					Error.setMacro("D", (new Date()).toHTMLFormat(domain));
					return invalidValue();
				}
			}
		}
	}
	return dt.toHTMLFormat(domain);
}

function validateWAMTime(val, domain){
	var dt;

	if (val =3D=3D "a" || val =3D=3D "agora" || isEmpty(val)){
		var dt =3D new Date();
	} else {
		val =3D val.replace(/ |\.|,/g, ":");
		// --- hh:mm
		if (validMask(val, "^[0-9]{1,2}:[0-9]{1,2}$")){
			var dt =3D new Date();
			dt.setHours(Math.ceil(val.substr(0,val.indexOf(":"))));
			dt.setMinutes(Math.ceil(val.substr(val.indexOf(":")+1))-1);
		} else {
			// --- hh:mm:ss
			if (validMask(val, "^[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}$")){
				var dt =3D new Date();
				dt.setHours(Math.ceil(val.substr(0,val.indexOf(":"))));
				dt.setMinutes(Math.ceil(val.substr(val.indexOf(":")+1, =
val.lastIndexOf(":")-val.indexOf(":")-1)));
				dt.setSeconds(Math.ceil(val.substr(val.lastIndexOf(":")+1)));
			} else {
				// --- hh
				if (!isNaN(val)){
					var dt =3D new Date();
					dt.setHours(Math.ceil(val));
				} else {
					Error.setError("TYPBADDATE");
					Error.setMacro("D", (new Date()).toHTMLFormat(domain));
					return invalidValue();
				}
			}
		}
	}
	return dt.toHTMLFormat(domain);
}

function validateDatetime(val, domain){
	var iSpace;

	if (isEmpty(val)) return val;
	switch (domain){
		case WAMDomain.wamdate:
			return validateWAMDate(val, domain);
			break;
		case WAMDomain.wamtime:
			return validateWAMTime(val, domain);
			break;
		default:
			iSpace =3D val.indexOf(" ");
			if (iSpace =3D=3D -1) iSpace =3D val.length;
			strDate =3D validateWAMDate(val.substr(0, iSpace));
			if (strDate =3D=3D invalidValue()){
				return invalidValue();
			}
			strTime =3D validateWAMTime(val.substr(iSpace+1));
			if (strTime =3D=3D invalidValue()){
				return invalidValue();
			}
			return strDate.substr(0,10)+" "+strTime.substr(11);
			break;
	}
}

function validateSmalldatetime(val, domain){
	return validateDatetime(val, domain);
}

function validateTimestamp(val){
}

function validateChar(val, domain, intLen){
	return validateVarchar(val, domain, intLen);
}

function validateVarchar(val, domain, intLen){
	if (isEmpty(val) || isUndefined(val)) return val;
	switch (domain){
		case WAMDomain.wammoment:
			return validateWAMMoment(val);
			break;
		case WAMDomain.wamemail:
			return validateWAMEmail(val);
			break;
		case WAMDomain.wamurl:
			return validateWAMUrl(val);
			break;
	}
	if (!isUndefined(intLen)){
		if (val.length > intLen){
			Error.setError("TYPTOOLONG");
			Error.setMacro("N", intLen);
			return invalidValue();
		}
	}
	return val;
}

function validateText(val, domain, intLen){
	if (isEmpty(val) || isUndefined(val)) return val;
	if (val.length > intLen){
		Error.setError("TYPTOOLONG");
		Error.setMacro("N", intLen);
		return invalidValue();
	}
	return val;
}

function validateNText(val, domain, intLen){
	return validateText(val, domain, intLen);
}

function validateWAMEmail(val){
	if (isEmpty(val)) return val;
	var emailMask =3D =
"^[A-Za-z0-9!#\$%&'\*\+\-/=3D\?\^_`{|}~]+(\.[A-Za-z0-9!#\$%&'\*\+\-/=3D\?=
\^_`{|}~]+)*\.?@[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9](\.[A-Za-z0-9][A-Za-z=
0-9\-]*[A-Za-z0-9])+$";

	if (validMask(val, emailMask)) return val;
	else {
		Error.setError("TYPBADMAIL");
		return invalidValue();
	}
}

function validateWAMUrl(val){
	if (isEmpty(val)) return val;
	var urlMask =3D "^[hH][tT][tT][pP]://.*$";

	if (validMask(val, urlMask)) return val;
	else {
		Error.setError("TYPBADURL");
		return invalidValue();
	}
}

function validateWAMMoment(val){
	return validateConvertWAMMoment(true/*VALIDATE*/, val);
}

function validateConvertWAMMoment(VALIDATE, val){
	var dt, dtNew, theYea, theMon, theCen, theDec;
	var strCen =3D strDec =3D strYea =3D ""; var numCen, numDec, numMonth; =
var isCentury, isDecade;
	var w1, w2; var arWord; var newVal; var p;
	var oldVal;

	if (isEmpty(val)){
		if (VALIDATE) return val; // --- VALIDATE
		else return nullValue();
	}
	// --- Srips seps and separate numbers
	oldVal =3D val; // --- For later use
	val =3D stripWAMMoment(val);

	// --- Set defaults
	dt =3D new Date();
	theYea =3D dt.getFullYear();
	theMon =3D dt.getMonth() + 1;
	theCen =3D (theYea / 100) + 1;
	theDec =3D ((theYea % 100) / 10) * 10;

	// --- Try first word for century
	w1 =3D val.getWord(1);
	isCentury =3D isCenturyPO(w1);
	if (isCentury){
		// --- First word is century
		w2 =3D val.getWord(2);
		// --- Second word empty =3D> Default century
		if (isEmpty(w2)){
			if (VALIDATE) return centuryPO(theCen); // --- VALIDATE
			else return packedWAMMoment(theCen, null, null, null, null);
		}
		// --- Second word integer =3D> Century
		if (!isNaN(w2)){
			// --- IF CENTURY < 100 =3D> OK
			if (w2 < 100){
				val =3D val.deleteWord(1, 2);
				if (VALIDATE) strCen =3D centuryPO(w2); // --- VALIDATE
				else strCen =3D "there-is-century";
				numCen =3D w2;
			}
		}
		if (isEmpty(strCen)){
			// --- Second word is wrong
			Error.setError("TYPBADMOMT")
			return invalidValue();
		}
	}

	// --- Try first/third word for decade
	w1 =3D val.getWord(1);
	isDecade =3D isDecadePO(w1);
	if (isDecade){
		w2 =3D val.getWord(2);
		// -- Second word empty =3D> Default decade
		if (isEmpty(w2)){
			strDec =3D decadePO(theDec);
			numDec =3D theDec;
			// --- Second word integer =3D> Decade
		} else if (!isNaN(w2)){
			// --- IF DECADE IN (0,10,20..., 90) =3D> OK
			if (w2 % 10 =3D=3D 0 && w2 <=3D 90){
				if (w2 =3D=3D 0) w2 =3D "0";
				strDec =3D decadePO(w2);
				numDec =3D w2;
			}
		}
		if (isEmpty(strDec)){
			// --- Second word is wrong
			Error.setError("TYPBADMOMT");
			return invalidValue();
		}
	}

	if (!isEmpty(strCen)){
		if (!isEmpty(strDec)){
			if ((numCen !=3D theCen)){
				if (VALIDATE) return strCen+", "+strDec; // --- VALIDATE
				else return packedWAMMoment(numCen, numDec, null, null, null);
			} else {
				if (VALIDATE) return strDec; // --- VALIDATE
				else return packedWAMMoment(theCen, numDec, null, null, null);
			}
		} else {
			if (VALIDATE) return strCen; // --- VALIDATE
			else return packedWAMMoment(numCen, null, null, null, null);
		}
	} else { // --- strCen is empty
		if (!isEmpty(strDec)){
			if (VALIDATE) return strDec; // --- VALIDATE
			else return packedWAMMoment(theCen, numDec, null, null, null);
		} else {
			// --- Continue
		}
	}

	// --- Here both cenStr and decStr are empty

	// --- Try first word for a year
	w1 =3D val.getWord(1);
	isYear =3D isYearPO(w1);
	if (isYear){ // --- First word is a year
		w2 =3D val.getWord(2);
		// --- Second word empty =3D> Default year
		if (isEmpty(w2)){
			if (VALIDATE) return yearPO(theYea); // --- VALIDATE
			else return packedWAMMoment(null, null, theYea, null, null);
		}
		// --- Second word integer =3D> Year
		if (!isNaN(w2)){
			if (VALIDATE) return yearPO(w2,"noDefaultCentury"); // --- VALIDATE
			else return packedWAMMoment(null, null, year4(w2,"noDefaultCentury"), =
null, null);
		}
		// --- Second word is wrong
		Error.setError("TYPBADMOMT")
		return invalidValue()
	}

	// --- Try first word for a month
	w1 =3D val.getWord(1);
	numMonth =3D isMonthPO(w1);
	if (numMonth > 0){ // --- First word is a month
		w2 =3D val.getWord(2);
		// --- Second word empty =3D> Default year
		if (isEmpty(w2)){
			if (VALIDATE) return month3PO(numMonth)+" "+year4(theYea); // --- =
VALIDATE
			else return packedWAMMoment(null, null, year4(theYea), numMonth, =
null);
		}
		// --- Second word integer =3D> Year
		if (!isNaN(w2)){
			if (VALIDATE) return month3PO(numMonth)+" "+year4(w2); // --- =
VALIDATE
			else return packedWAMMoment(null, null, year4(w2), numMonth, null);
		}
		// --- Second word is wrong
		Error.setError("TYPBADMOMT");
		return invalidValue();
	}

	// --- Try validate as year
	if (!isNaN(val)){
		if (val >=3D 1000){
			if (VALIDATE) return yearPO(val); // --- VALIDATE
			else return packedWAMMoment(null, null, year4(val), null, null);
		}
	}

	// --- Try validate as date
	val =3D oldVal;
	if (VALIDATE) newVal =3D validateDatetime(val, WAMDomain.wamdate);
	else newVal =3D convertDatetime(val, WAMDomain.wamdate);
	if (!Error.hasErrors()){
		if (VALIDATE) return newVal; // --- VALIDATE
		else {
			return packedWAMMoment(null, null, newVal.getFullYear(), =
newVal.getMonth()+1, newVal.getDate());
		}
	}
	Error.clear();

	// --- Try validate as month/year
	p =3D val.indexOf("/");
	if (p !=3D -1){
		dtNew =3D val.substr(0, p+1)+"1/"+val.substr(p+1);
		dtNew =3D Date.parse(dtNew);
		if (!isNaN(dtNew)){
			dtNew =3D new Date(dtNew);
			if (VALIDATE) return month3PO(dtNew.getMonth()+1)+dtNew.getDate(); // =
--- VALIDATE
			else return packedWAMMoment(null, null, newVal.getFullYear(), =
newVal.getMonth()+1);
		}
	}
	Error.setError("TYPBADMOMT");
	return invalidValue();
}

function stripWAMMoment(val){
	var i;

	val =3D val.replace(/\.|,/g, " ")+""; // --- convert to string
	for (i =3D val.length; i > 2; i--){
		if (isDigit(val.charAt(i))){
			if (!isDigit(val.charAt(i-1))){
				val =3D val.substr(0,i)+" "+val.substr(i);
			}
		}
	}
	return val;
}

function centuryPO(centuryNum){
	return "S=E9c. "+Number(centuryNum);
}

function isCenturyPO(centuryWord){
	return "S=C9CULO".indexOf(centuryWord.toUpperCase())=3D=3D0 && =
centuryWord.length>=3D3;
}

function decadePO(decadeNum){
	return "Anos "+Number(decadeNum);
}

function isDecadePO(decadeWord){
	return decadeWord.toUpperCase() =3D=3D "ANOS";
}

function yearPO(yearNum, noDefaultCentury){
	return "Ano "+year4(yearNum,noDefaultCentury);
}

function isYearPO(yearWord){
	return "ANO".indexOf(yearWord.toUpperCase())=3D=3D0;
}

function year4(yearNum, noDefaultCentury){
	var i;

	if (!isNaN(yearNum)){
		if (yearNum < 0) return "ANOaC?";
		if (yearNum < 100 && yearNum.charAt(0) !=3D "0" && =
isUndefined(noDefaultCentury)){
			return (1900+Number(yearNum));
		} else {
			yearNum =3D yearNum % 10000;
			return yearNum.toString().formatNum("0000");
		}
	}
	return "ANO?";
}

function monthPO(monthNum){
	var arMonthsPO =3D new Array("Janeiro", "Fevereiro", "Mar=E7o", =
"Abril",
						"Maio", "Junho", "Julho", "Agosto",
						"Setembro", "Outubro", "Novembro", "Dezembro");

	if (monthNum < 1 || 12 < monthNum){
		return "MES"+monthNum+"?";
	} else {
		return arMonthsPO[monthNum-1];
	}
}

function month3PO(monthNum){
	if (monthNum < 1 || 12 < monthNum){
		return "MES"+monthNum+"?";
	} else {
		return monthPO(monthNum).substr(0, 3);
	}
}

function isMonthPO(monthWord){
	var x;

	x =3D ("JANEIRO  FEVEREIROMAR=C7O    ABRIL    MAIO     JUNHO    "+
		"JULHO    AGOSTO   SETEMBRO OUTUBRO  NOVMEBRO =
DEZEMBRO").indexOf(monthWord.toUpperCase())+9;
	if (x % 9 =3D=3D 0)	return x / 9;
	else return 0;
}

function packedWAMMoment(){
	return "";
}//**********************************************************************=
**/
// Web Application Maker Library
//
// Copyright (c) Declarativa 2000. All Rights Reserved.
//***********************************************************************=
*/
//***********************************************************************=
*/
// WAMRow Object (Client Side)
//***********************************************************************=
*/
function WAMRow(strTable){
	if (typeof(strTable) =3D=3D "string" && strTable !=3D ""){
		var WR =3D new _WAMRow(strTable);
		return WR;
	}
	// --- No object was created
	return null;
}

function _WAMRow(strTable){
	if (typeof(_WAMRowPrototypeCalled) =3D=3D "undefined")
		_WAMRow__Prototype();

	// --- Properties
	this.table =3D strTable;
	this.rootURL =3D WAMRootURL;
=09
	// --- Collections
	this.pkColumns =3D new Array();
	this.columns =3D new Array();
	this.lookups =3D new Array();
	this.buttons =3D new Object();
	this.lookups =3D new Array();

	this.event =3D new WAMEventHandler(this);
	this._setButtons();
}

function _WAMRow__Prototype(){
	_WAMRowPrototypeCalled =3D true;

	// --- Constants
	WAMROW_MODENEWROW =3D 1;
	WAMROW_MODEEDITROW =3D 2;
	WAMROW_MODEINSERTROW =3D 3;
	WAMROW_MODEUPDATEROW =3D 4;
	WAMROW_MODEDELETEROW =3D 5;
=09
	WAMROW_ACTIONINSERTROW =3D "IR";
	WAMROW_ACTIONUPDATEROW =3D "UR";
	WAMROW_ACTIONDELETEROW =3D "DR";
	WAMROW_ACTIONREFRESHROW =3D "ER";
	WAMROW_ACTIONEMPTY =3D "";

	// --- Event constants
	WAMROW_ONBEFOREINSERT =3D "onBeforeInsert";
	WAMROW_ONBEFOREUPDATE =3D "onBeforeUpdate";
	WAMROW_ONBEFOREDELETE =3D "onBeforeDelete";

	// --- Properties
	_WAMRow.prototype.rowMode =3D WAMROW_MODENEWROW; // --- Default mode
	_WAMRow.prototype.dirty =3D false;
	_WAMRow.prototype.action =3D "";
	_WAMRow.prototype.form =3D window.document.__formWAMRow;
	_WAMRow.prototype.pImages =3D false;
	_WAMRow.prototype.hierarchical =3D null;
	_WAMRow.prototype.hierarchicalLevel =3D 0;

	// --- Methods
	_WAMRow.prototype.add =3D _WAMRow_add;
	_WAMRow.prototype.prepareNew =3D _WAMRow_prepareNew;
	_WAMRow.prototype.aspInsert =3D _WAMRow_aspInsert;
	_WAMRow.prototype.aspUpdate =3D _WAMRow_aspUpdate;
	_WAMRow.prototype.aspDelete =3D _WAMRow_aspDelete;
	_WAMRow.prototype.cancel =3D _WAMRow_cancel;
	_WAMRow.prototype.isNew =3D _WAMRow_isNew;
	_WAMRow.prototype.isDirty =3D _WAMRow_isDirty;
	_WAMRow.prototype.setDirty =3D _WAMRow_setDirty;
	_WAMRow.prototype.setAction =3D _WAMRow_setAction;
	_WAMRow.prototype.getAction =3D _WAMRow_getAction;
	_WAMRow.prototype.checkAction =3D _WAMRow_checkAction;
	_WAMRow.prototype.checkSaveMode =3D _WAMRow_checkSaveMode;
	_WAMRow.prototype.hasImages =3D _WAMRow_hasImages;
	_WAMRow.prototype.isHierarchical =3D _WAMRow_isHierarchical;
	_WAMRow.prototype.openDetailList =3D _WAMRow_openDetailList;
	_WAMRow.prototype.openFather =3D _WAMRow_openFather;
	_WAMRow.prototype.openDescendants =3D _WAMRow_openDescendants;
	_WAMRow.prototype.submitForm =3D _WAMRow_submitForm;
	_WAMRow.prototype.refresh =3D _WAMRow_refresh;
	_WAMRow.prototype.setAutoSave =3D _WAMRow_setAutoSave;
	_WAMRow.prototype.setSaveAndEdit =3D _WAMRow_setSaveAndEdit;

	// --- Private properties
	_WAMRow.prototype._strForm =3D "window.document.__formWAMRow";
	_WAMRow.prototype._customRow =3D false;
	_WAMRow.prototype._customList =3D false;

	// --- Private methods
	_WAMRow.prototype._setAutoSave =3D _WAMRow__setAutoSave;
	_WAMRow.prototype._setAutoSaveFunction =3D =
_WAMRow__setAutoSaveFunction;
	_WAMRow.prototype._prepareForm =3D _WAMRow__prepareForm;
	_WAMRow.prototype._setButtons =3D _WAMRow__setButtons;
	_WAMRow.prototype._getPageName =3D _WAMRow__getPageName;

	// --- START --- Methods implementation
	function _WAMRow_add(obj, bolNonDBCol){
		switch (obj.constructor){
			case _WAMRowColumn:
				this.columns[obj.getName()] =3D obj;
				this.columns[obj.getName()].parent =3D this;
				this.columns[obj.getName()].setHTMLEl();
				this.columns[obj.getName()]._setMyEvents(bolNonDBCol);
				break;
			case _WAMLookup:
				this.lookups[obj.getName()] =3D obj;
				this.lookups[obj.getName()].parent =3D this;
				lookups[obj.getName()] =3D obj; // --- ??? to be deleted
				break;
		}
	}

	function _WAMRow_prepareNew(obj){
		this.setAction(WAMROW_ACTIONNEWROW);
		this.submitForm();
	}

	function _WAMRow_aspInsert(obj){
		if (this.event.fire(WAMROW_ONBEFOREINSERT, false) =3D=3D false) return =
false;
		this.setAction(WAMROW_ACTIONINSERTROW);
		this._prepareForm();
		if (this.buttons.btnInsert !=3D null) this.buttons.btnInsert.disabled =
=3D true;
		this.submitForm();
	}

	function _WAMRow_aspUpdate(obj){
		this.setAction(WAMROW_ACTIONUPDATEROW);
		this._prepareForm();

		if (this.buttons.btnUpdate !=3D null) this.buttons.btnUpdate.disabled =
=3D true;
		this.submitForm();
	}

	function _WAMRow_aspDelete(obj){
		if (confirm(WAMMessages["MESSAGE_ROW_delete"])){
			if (this.event.fire(WAMROW_ONBEFOREDELETE, false) =3D=3D false) =
return false;
			this.setAction(WAMROW_ACTIONDELETEROW);
			this._prepareForm();

			if (this.buttons.btnDelete !=3D null) this.buttons.btnDelete.disabled =
=3D true;
			this.submitForm();
		}
	}

	function _WAMRow_cancel(obj){
		this.setAction(WAMROW_ACTIONEMPTY);
		window.close();
	}

	function _WAMRow_isNew(){
		if (this.rowMode =3D=3D WAMROW_MODENEWROW || this.rowMode =3D=3D =
WAMROW_MODEINSERTROW){
			return true;
		} else {
			return false;
		}
	}

	function _WAMRow_isDirty(){
		return this.dirty;
	}

	function _WAMRow_setDirty(){
		if (isUndefined(_WAMRow_setDirty.arguments[0]+"")){
			if (!this.isDirty()){
				this.dirty =3D true;
				this.form.wrIsDirty.value =3D "true";
			} else {
				return;
			}
		} else {
			this.dirty =3D _WAMRow_setDirty.arguments[0];
		}
		// --- Disable/enable buttons
		if (this.isNew()){
			if (this.buttons.btnInsert.length > 1)
				for (var i =3D 0; i < this.buttons.btnInsert.length; i++)
					this.buttons.btnInsert[i].disabled =3D !this.isDirty();
			else
				this.buttons.btnInsert.disabled =3D !this.isDirty();
		} else {
			if (this.buttons.btnUpdate.length > 1)
				for (var i =3D 0; i < this.buttons.btnUpdate.length; i++)
					this.buttons.btnUpdate[i].disabled =3D !this.isDirty();
			else
				this.buttons.btnUpdate.disabled =3D !this.isDirty();
		}
	}
=09
	function _WAMRow_setAction(strAction){
		this.action =3D strAction
		this.form.wrAction.value =3D this.action;
	}
=09
	function _WAMRow_getAction(){
		return this.action;
	}
=09
	function _WAMRow_checkAction(){
		if (this.getAction() =3D=3D WAMROW_ACTIONEMPTY) this._prepareForm();
	}
=09
	function _WAMRow_checkSaveMode(){
		if (!isNull(event) && !isUndefined(event) && event.altKey =3D=3D true =
&& event.shiftKey =3D=3D true && this.form.wrAutoSave.value !=3D true) =
this.form.wrSaveAndEditNew.value =3D true;
		if (!isNull(event) && !isUndefined(event) && event.altKey =3D=3D true =
&& this.form.wrAutoSave.value !=3D true) this.form.wrsac.value =3D true;
	}
=09
	function _WAMRow_hasImages(){
		return this.pImages;
	}

	function _WAMRow_isHierarchical(){
		return (!isNull(this.hierarchical) ? true : false);
	}

	function _WAMRow_openDetailList(strURL){
		var qs =3D ""; var el; var func;

		if (this.isNew()){
			this.form.wrAutoSave.value =3D true;
			if (!isUndefined(strURL)){
				func =3D new String(_WAMRow_openDetailList.caller);
				func =3D func.substr(9, func.indexOf("(")-9);
				this.form.wrftoexe.value =3D func; // --- wrftoexe =3D WAMRow =
function to execute
			}
			this.aspInsert();
			return;
		}
		return window.openChild(strURL, WinFeatures(0, 0, 'no', 'no', 'no', =
'yes', 'no', 'yes', 'yes'));
	}

	function _WAMRow_openFather(){
		var el; var strQS =3D "";

		for (el in this.pkColumns){
			if (this.hierarchical =3D=3D this.pkColumns[el].getName())
				strQS +=3D =
"&key=3D"+encodeURL(this.pkColumns[el].getHTMLEl().value.substr(0, =
(this.hierarchicalLevel-1)*2));
			else
				strQS +=3D =
"&key=3D"+encodeURL(this.pkColumns[el].getHTMLEl().value);
		}
		strQS =3D strQS.substr(1);
		return window.openChild(this.rootURL+this._getPageName("ROW")+strQS, =
WinFeatures(0, 0, 'no', 'no', 'no', 'yes', 'no', 'yes', 'yes'));
	}

	function _WAMRow_openDescendants(){
		var strQS =3D "";

		strQS =3D =
"__hn_to=3DDOWN&__hn_selected=3D"+encodeURL(this.pkColumns[this.hierarchi=
cal].getHTMLEl().value);
		window.openChild(this.rootURL+this._getPageName("LIST")+strQS, =
WinFeatures(0, 0, 'no', 'no', 'no', 'yes', 'no', 'yes', 'yes'));
	}

	function _WAMRow_submitForm(){
		if (_WAMRow_submitForm.caller =3D=3D _WAMRow_refresh || =
(typeof(List_submitForm) =3D=3D "function" && _WAMRow_submitForm.caller =
=3D=3D List_submitForm)){
			if (this.form.action.indexOf(".asp?") !=3D -1)
				this.form.action +=3D "&"+this.form.wrKeyText.value;
			else
				this.form.action +=3D "?"+this.form.wrKeyText.value;
		}
		this.checkAction();
		this.checkSaveMode();
		this.form.submit();
	}

	function _WAMRow_refresh(){
		this.setAction(WAMROW_ACTIONREFRESHROW);
		this.submitForm();
	}

	function _WAMRow_setAutoSave(oWAM, bAS){
		oWAM._rowAutoSave =3D typeof(bAS) =3D=3D "boolean" ? bAS : true;
	}

	function _WAMRow_setSaveAndEdit(bVal){
		this.form.wrSaveAndEdit.value =3D typeof(bVal) =3D=3D "boolean" ? bVal =
: true;
	}
	// --- END --- Methods implementation

	// --- START --- Private methods implementation
	function _WAMRow__setAutoSave(bAS){
		this.form.wrAutoSave.value =3D typeof(bAS) =3D=3D "boolean" ? bAS : =
true;
	}

	function _WAMRow__setAutoSaveFunction(sFuncName){
		this.form.wrftoexe.value =3D sFuncName;
	}

	function _WAMRow__prepareForm(){
		var el1, el2; var HTMLEl, disabledHTMLEl;
	=09
		// --- Copy the disabled columns' values to the hidden columns' values
		// --- Row columns
		for (el1 in this.columns){
			if (this.columns[el1].getType() =3D=3D "radio"){
				HTMLEl =3D this.columns[el1].getHTMLEl()[0];
				if (HTMLEl.disabled)
					for (var i =3D 0; i < HTMLEl.length; i++)
						if (HTMLEl[i].checked){
							disabledHTMLEl =3D =
eval(this._strForm+".__disabled_"+HTMLEl[i].name);
							if (isUndefined(disabledHTMLEl)) disabledHTMLEl =3D =
this.columns[el1]._createHidden(HTMLEl[i].name);
							disabledHTMLEl.value =3D HTMLEl[i].value;
						}
			} else {
				HTMLEl =3D this.columns[el1].getHTMLEl();
				if (HTMLEl.disabled){
					disabledHTMLEl =3D eval(this._strForm+".__disabled_"+HTMLEl.name);
					if (isUndefined(disabledHTMLEl)) disabledHTMLEl =3D =
this.columns[el1]._createHidden(HTMLEl.name);
					disabledHTMLEl.value =3D HTMLEl.value;
				}
			}
		}
		// --- Looked-up columns
		if (typeof(lookups) !=3D "undefined"){
			for (el1 in lookups){
				for (el2 in lookups[el1].lkColumns){
					HTMLEl =3D =
eval(this._strForm+"."+lookups[el1].lkColumns[el2].getHTMLEl().name);
					if (HTMLEl.disabled){
						disabledHTMLEl =3D eval(this._strForm+".__disabled_"+HTMLEl.name);
						if (isUndefined(disabledHTMLEl)) disabledHTMLEl =3D =
lookups[el1].lkColumns[el2]._createHidden(HTMLEl.name);
						disabledHTMLEl.value =3D HTMLEl.value;
					}
				}
			}
		}
	}

	function _WAMRow__setButtons(){
		this.buttons.btnNew =3D !isUndefined(typeof(this.form.btnNew)) ? =
this.form.btnNew : null;
		this.buttons.btnInsert =3D !isUndefined(typeof(this.form.btnInsert)) ? =
this.form.btnInsert : null;
		this.buttons.btnDelete =3D !isUndefined(typeof(this.form.btnDelete)) ? =
this.form.btnDelete : null;
		this.buttons.btnUpdate =3D !isUndefined(typeof(this.form.btnUpdate)) ? =
this.form.btnUpdate : null;
		this.buttons.btnCancel =3D !isUndefined(typeof(this.form.btnCancel)) ? =
this.form.btnCancel : null;
	}

	function _WAMRow__getPageName(strType){
		switch (strType.toUpperCase()){
			case "ROW":
				if (this._customRow) return "rows/"+this.table+".asp?";
				else return =
"WAMLibrary/Interface/standard.asp?witype=3Drow&winame=3D"+encodeURL(this=
.table)+"&";
				break;
			case "LIST":
				if (this._customList) return "lists/"+this.table+".asp?";
				else return =
"WAMLibrary/Interface/standard.asp?witype=3Dlist&winame=3D"+encodeURL(thi=
s.table)+"&";
				break;
		}
	}
	// --- END --- Private methods implementation
}

//***********************************************************************=
*/
// WAMRowColumn Object (Client Side)
//***********************************************************************=
*/
function WAMRowColumn(strTable, strName, strDataType, strDomain, =
intLength, intPrecision, intScale, bolEnabled, strIMGName, strURL){
	return new _WAMRowColumn(strTable, strName, strDataType, strDomain, =
intLength, intPrecision, intScale, bolEnabled, strIMGName, strURL);
}

function _WAMRowColumn(strTable, strName, strDataType, strDomain, =
intLength, intPrecision, intScale, bolEnabled, strIMGName, strURL){
	if (typeof(_WAMRowColumnPrototypeCalled) =3D=3D "undefined")
		_WAMRowColumn__Prototype();

	this.table =3D strTable;
	this.name =3D strName;
	this.setDataType(strDataType);
	this.setDomain(strDomain);
	this.setLength(intLength);
	this.setPrecision(intPrecision);
	this.setScale(intScale);
	this.setEnabled(bolEnabled);

	if (strDomain =3D=3D WAMDomain.wamexternalimage){
		this.image =3D new Object();
		this.image.name =3D strIMGName;
		this.image.URL =3D strURL;
	} else this.image =3D null;
}

function _WAMRowColumn__Prototype(){
	_WAMRowColumnPrototypeCalled =3D true;

	// --- Properties
	_WAMRowColumn.prototype.table =3D null;
	_WAMRowColumn.prototype.name =3D null;
	_WAMRowColumn.prototype.value =3D null;
	_WAMRowColumn.prototype.dataType =3D null;
	_WAMRowColumn.prototype.domain =3D null;
	_WAMRowColumn.prototype.length =3D null;
	_WAMRowColumn.prototype.precision =3D null;
	_WAMRowColumn.prototype.scale =3D null;
	_WAMRowColumn.prototype.disabled =3D false;
	_WAMRowColumn.prototype.HTMLEl =3D null;
	_WAMRowColumn.prototype.parent =3D null;

	// --- Methods
	_WAMRowColumn.prototype.getName =3D _WAMRowColumn_getName;
	_WAMRowColumn.prototype.setName =3D _WAMRowColumn_setName;
	_WAMRowColumn.prototype.getTable =3D _WAMRowColumn_getTable;
	_WAMRowColumn.prototype.setTable =3D _WAMRowColumn_setTable;
	_WAMRowColumn.prototype.getValue =3D _WAMRowColumn_getValue;
	_WAMRowColumn.prototype.setValue =3D _WAMRowColumn_setValue;
	_WAMRowColumn.prototype.setValidated =3D _WAMRowColumn_setValidated;
	_WAMRowColumn.prototype.clearValue =3D _WAMRowColumn_clearValue;
	_WAMRowColumn.prototype.getType =3D _WAMRowColumn_getType;
	_WAMRowColumn.prototype.setType =3D _WAMRowColumn_setType;
	_WAMRowColumn.prototype.getDataType =3D _WAMRowColumn_getDataType;
	_WAMRowColumn.prototype.setDataType =3D _WAMRowColumn_setDataType;
	_WAMRowColumn.prototype.setDomain =3D _WAMRowColumn_setDomain;
	_WAMRowColumn.prototype.getDomain =3D _WAMRowColumn_getDomain;
	_WAMRowColumn.prototype.setLength =3D _WAMRowColumn_setLength;
	_WAMRowColumn.prototype.getLength =3D _WAMRowColumn_getLength;
	_WAMRowColumn.prototype.setPrecision =3D _WAMRowColumn_setPrecision;
	_WAMRowColumn.prototype.getPrecision =3D _WAMRowColumn_getPrecision;
	_WAMRowColumn.prototype.setScale =3D _WAMRowColumn_setScale;
	_WAMRowColumn.prototype.getScale =3D _WAMRowColumn_getScale;
	_WAMRowColumn.prototype.setEnabled =3D _WAMRowColumn_setEnabled;
	_WAMRowColumn.prototype.isEnabled =3D _WAMRowColumn_isEnabled;
	_WAMRowColumn.prototype.getHTMLEl =3D _WAMRowColumn_getHTMLEl;
	_WAMRowColumn.prototype.setHTMLEl =3D _WAMRowColumn_setHTMLEl;
	_WAMRowColumn.prototype.setPk =3D _WAMRowColumn_setPk;

	// --- Private Methods
	_WAMRowColumn.prototype._setMyEvents =3D _WAMRowColumn__setMyEvents;
	_WAMRowColumn.prototype._getHTMLName =3D _WAMRowColumn__getHTMLName;
	_WAMRowColumn.prototype._getID =3D _WAMRowColumn__getID;
	_WAMRowColumn.prototype._createHidden =3D _WAMRowColumn__createHidden;
=09
	function _WAMRowColumn_getName(){
		return this.name;
	}
=09
	function _WAMRowColumn_setName(strName){
		this.name =3D strName;
		this.setHTMLEl();
	}
=09
	function _WAMRowColumn_getTable(){
		return this.table;
	}
=09
	function _WAMRowColumn_setTable(strTable){
		this.table =3D strTable;
		this.setHTMLEl();
	}
=09
	function _WAMRowColumn_getValue(){
		switch (this.type){
			case "checkbox":
				return this.HTMLEl.checked;
				break;
			default:
				if (this.getDataType() =3D=3D WAMDataType.dtbit) return =
this.HTMLEl.value.toUpperCase() =3D=3D "TRUE" ? true : false;
				return this.HTMLEl.value;
				break;
		}
	}
=09
	function _WAMRowColumn_setValue(varValue){
		if (varValue =3D=3D null){
			varValue =3D "";
		}
		switch (this.type){
			case "checkbox":
				switch ((varValue+"").toUpperCase()){
					case "TRUE":
					case "1":
					case "ON":
						this.HTMLEl.checked =3D true;
						break;
					default:
						this.HTMLEl.checked =3D false;
						break;
				}
				break;
			default:
				this.HTMLEl.value =3D varValue;
				break;
		}
		this.value =3D varValue;
	}

	function _WAMRowColumn_setValidated(varVal){
		var newVal =3D validateGeneric(this.getDataType(), this.getDomain(), =
varVal+"", this.getLength(), this.getPrecision(), this.getScale());
		if (newVal !=3D invalidValue()){
			this.setValue(newVal);
		} else {
			Error.setMacro('F', this.getHTMLEl().label);
			Error.setFocusTo(this.getHTMLEl());
			Error.catchErrors();
			return false;
		}
	}

	function _WAMRowColumn_clearValue(){
		switch (this.type){
			case "checkbox":
				this.HTMLEl.checked =3D false;
				break;
			default:
				this.HTMLEl.value =3D "";
				break;
		}
	}
=09
	function _WAMRowColumn_getType(){
		return this.type;
	}
=09
	function _WAMRowColumn_setType(strType){
		this.type =3D strType;
	}
=09
	function _WAMRowColumn_getDataType(){
		return this.dataType;
	}
=09
	function _WAMRowColumn_setDataType(strDataType){
		this.dataType =3D strDataType;
	}
=09
	function _WAMRowColumn_setDomain(strDomain){
		this.domain =3D ((strDomain !=3D null) ? strDomain.toLowerCase() : =
strDomain);
	}
=09
	function _WAMRowColumn_getDomain(){
		return this.domain;
	}
=09
	function _WAMRowColumn_setLength(intLength){
		this.length =3D intLength;
	}
=09
	function _WAMRowColumn_getLength(){
		return this.length;
	}
=09
	function _WAMRowColumn_setPrecision(intPrecision){
		this.precision =3D intPrecision;
	}
=09
	function _WAMRowColumn_getPrecision(){
		return this.precision;
	}
=09
	function _WAMRowColumn_setScale(intScale){
		this.scale =3D intScale;
	}
=09
	function _WAMRowColumn_getScale(){
		return this.scale;
	}
=09
	function _WAMRowColumn_setEnabled(bolEnabled){
		this.enabled =3D bolEnabled;
	}
=09
	function _WAMRowColumn_isEnabled(){
		return this.enabled;
	}
=09
	function _WAMRowColumn_getHTMLEl(){
		return this.HTMLEl;
	}

	function _WAMRowColumn_setHTMLEl(obj){
		var i;

		if (typeof(obj) =3D=3D "undefined"){
			if (this.name !=3D null && this.table !=3D null){
				switch (this.constructor){
					case _WAMRowColumn:
						var obj =3D eval(this.parent._strForm+"."+this._getHTMLName());
						break;
					case _WAMLookupColumn:
						var obj =3D eval(objWAMRow._strForm+"."+this._getHTMLName());
						break;
				}
			}
		}
		if (typeof(obj) !=3D "undefined"){
			switch (this.constructor){
				case _WAMRowColumn:
					this.HTMLEl =3D obj;
					if (obj.length > 1 && obj[0].type =3D=3D "radio")
						for (i =3D 0; i < obj.length; i++) obj[i].WAMRowColumn =3D this;
					else
						obj.WAMRowColumn =3D this;
					break;
				case _WAMLookupColumn:
					this.HTMLEl =3D obj;
					if (obj.length > 1 && obj[0].type =3D=3D "radio")
						for (i =3D 0; i < obj.length; i++) obj[i].WAMLookupColumn =3D =
this;
					else
						obj.WAMLookupColumn =3D this;
					break;
			}

			if (obj.length > 1 && obj[0].type =3D=3D "radio"){
				this.setType(obj[0].type);
			} else {
				this.setType(obj.type);
			}
		}
	}

	function _WAMRowColumn_setPk(){
		this.parent.pkColumns[this.name] =3D this.parent.columns[this.name];
	}

	function _WAMRowColumn__setMyEvents(bolNonDBCol){
		var n; var el =3D this.getHTMLEl();
		if (!el.disabled){
			switch (this.getType()){
				case "text":
				case "textarea":
				case "hidden":
				case "file":
					if (this.getDomain() !=3D WAMDomain.wamexternalimage){
						el.onfocus =3D __WAMRowColumn_OnFocus_TEXT_TEXTAREA;
						el.onblur =3D __WAMRowColumn_OnBlur_TEXT_TEXTAREA_CHECKBOX;
					} else {
						el.onfocus =3D __WAMRowColumn_OnFocus_IMAGE;
						el.onblur =3D __WAMRowColumn_OnBlur_IMAGE;
					}
					if (bolNonDBCol !=3D true) el.onchange =3D =
__WAMRowColumn_OnChange_ALLTYPES;
					break;
				case "checkbox":
					el.onblur =3D __WAMRowColumn_OnBlur_TEXT_TEXTAREA_CHECKBOX;
					if (bolNonDBCol !=3D true) el.onchange =3D =
__WAMRowColumn_OnChange_ALLTYPES;
					if (bolNonDBCol !=3D true) el.onclick =3D =
__WAMRowColumn_OnClick_CHECKBOX;
					break;
				case "radio":
					n =3D el.length;
					for (var i =3D 0; i < n; i++){
						if (bolNonDBCol !=3D true) el(i).onchange =3D =
__WAMRowColumn_OnChange_ALLTYPES;
						if (bolNonDBCol !=3D true) el(i).onclick =3D =
__WAMRowColumn_OnClick_RADIO;
						el(i).onmousedown =3D __WAMRowColumn_OnMouseDown_RADIO;
					}
					break;
				case "select-one":
					if (bolNonDBCol !=3D true) el.onchange =3D =
__WAMRowColumn_OnChange_ALLTYPES;
					break;
			}
		}
	}

	function _WAMRowColumn__getHTMLName(){
		switch (this.constructor){
			case _WAMRowColumn:
				return this.table.replace(/ /g, "_")+"_"+this.name.replace(/ /g, =
"_");
				break;
			case _WAMLookupColumn:
				if (isEmpty(this.getRequiredJoin()))
					return this.parent.getName().replace(/ /g, =
"_")+"_"+this.table.replace(/ /g, "_")+"_"+this.name.replace(/ /g, "_");
				else
					return this.parent.getName().replace(/ /g, =
"_")+"_"+this.table+"_"+this.name+"_"+this.getRequiredJoin().replace(/,|\=
.| /g, "_");
				break;
		}
	}

	function _WAMRowColumn__getID(){
		var strRJ =3D this.getRequiredJoin();
		if (isEmpty(strRJ)) return this.getName();
		else return this.getName()+"+"+strRJ;
	}
=09
	function _WAMRowColumn__createHidden(strHTMLElname){
		var obj; var strNewName; var oRow;

		strNewName =3D "__disabled_"+strHTMLElname;
		if (window.browser.isIEMAC){
			obj =3D window.document.createElement("INPUT");
			obj.style.display =3D "none";
			obj.style.visibility =3D "hidden";
			obj.id =3D obj.name =3D strNewName;
			if (this.parent.constructor =3D=3D _WAMRow) oRow =3D this.parent;
			else oRow =3D this.parent.parent;
			oRow.form.appendChild(obj);
		} else {
			if (this.parent.constructor =3D=3D _WAMRow) oRow =3D this.parent;
			else oRow =3D this.parent.parent;
			oRow.form.insertAdjacentHTML("beforeEnd", "<input type=3D'hidden' =
name=3D'"+strNewName+"' id=3D'"+strNewName+"' value=3D''>");
			obj =3D eval(oRow._strForm+".__disabled_"+strHTMLElname);
		}
		return obj;
	}
}



function __WAMRowColumn_OnFocus_TEXT_TEXTAREA(){
	this.select();
}

function __WAMRowColumn_OnFocus_IMAGE(){
	var rc =3D this.WAMRowColumn;
	WAMTIMERID =3D =
setInterval('previewImage(objWAMRow.columns["'+rc.getName()+'"].getHTMLEl=
(), "'+rc.image.name+'", "'+rc.image.URL+'")', 100);
}

function __WAMRowColumn_OnBlur_TEXT_TEXTAREA_CHECKBOX(){
	var rc =3D this.WAMRowColumn;
	var val;

	val =3D rc.getValue();
	var newVal =3D validateGeneric(rc.getDataType(), rc.getDomain(), val, =
rc.getLength(), rc.getPrecision(), rc.getScale());
	if (newVal !=3D invalidValue()){
		rc.setValue(newVal);
	} else {
		Error.setMacro('F', this.label);
		Error.setFocusTo(this);
		Error.catchErrors();
		return false;
	}
}

function __WAMRowColumn_OnBlur_IMAGE(){
	clearInterval(WAMTIMERID);
	this.WAMRowColumn.parent.setDirty();
}

function __WAMRowColumn_OnChange_ALLTYPES(){
	this.WAMRowColumn.parent.setDirty();
}

function __WAMRowColumn_OnClick_RADIO(){
	if (this._checked =3D=3D true) this.checked =3D false;
	this.WAMRowColumn.parent.setDirty();
}

function __WAMRowColumn_OnClick_CHECKBOX(){
	this.WAMRowColumn.parent.setDirty();
}

function __WAMRowColumn_OnMouseDown_RADIO(){
	this._checked =3D this.checked;
}//**********************************************************************=
**/
// Web Application Maker Library
//
// Copyright (c) Declarativa 2000. All Rights Reserved.
//***********************************************************************=
*/
//***********************************************************************=
*/
// WAMLookup Object (Client Side)
//***********************************************************************=
*/
function WAMLookup(strSchema, strName, strDetailSchemaName, =
strDetailTableName, strBaseMasterSchemaName, strBaseMasterTableName){
	var WL =3D new _WAMLookup(strSchema, strName, strDetailSchemaName, =
strDetailTableName, strBaseMasterSchemaName, strBaseMasterTableName);
	return WL;
}

function _WAMLookup(strSchema, strName, strDetailSchemaName, =
strDetailTableName, strBaseMasterSchemaName, strBaseMasterTableName){
	if (typeof(_WAMLookupPrototypeCalled) =3D=3D "undefined")
		_WAMLookup__Prototype();

	this.schema =3D strSchema;
	this.name =3D strName;
	if (!isUndefined(strDetailSchemaName) && =
!isUndefined(strDetailTableName)){
		this.detailSchema =3D strDetailSchemaName;
		this.detailTable =3D strDetailTableName;
	}

	if (!isUndefined(strBaseMasterSchemaName) && =
!isUndefined(strBaseMasterTableName)){
		this.masterSchema =3D strBaseMasterSchemaName;
		this.masterTable =3D strBaseMasterTableName;
	}

	// --- Collections
	this.pkColumns =3D new Array();
	this.lkColumns =3D new Array();

	this.event =3D new WAMEventHandler(this);
}

function _WAMLookup__Prototype(){
	_WAMLookupPrototypeCalled =3D true;

	// --- Event constants
	WAMLOOKUP_ONAFTEREXECUTE =3D "onAfterExecute";

	// --- Properties
	_WAMLookup.prototype.schema =3D null;
	_WAMLookup.prototype.name =3D null;
	_WAMLookup.prototype.detailSchema =3D null;
	_WAMLookup.prototype.detailTable =3D null;
	_WAMLookup.prototype.masterSchema =3D null;
	_WAMLookup.prototype.masterTable =3D null;
	_WAMLookup.prototype.reverseColumn =3D null;

	_WAMLookup.prototype.filterColumn =3D null;
	_WAMLookup.prototype.filterValue =3D null;
	_WAMLookup.prototype.filterColumnValue =3D null;

	// --- Methods
	_WAMLookup.prototype.addPkColumn =3D _WAMLookup_addPkColumn;
	_WAMLookup.prototype.addLkColumn =3D _WAMLookup_addLkColumn;
	_WAMLookup.prototype.setFilterColumn =3D _WAMLookup_setFilterColumn;
	_WAMLookup.prototype.getFilterValue =3D _WAMLookup_getFilterValue;
	_WAMLookup.prototype.setFilterValue =3D _WAMLookup_setFilterValue;
	_WAMLookup.prototype.setFilterColumnValue =3D =
_WAMLookup_setFilterColumnValue;
	_WAMLookup.prototype.getName =3D _WAMLookup_getName;
	_WAMLookup.prototype.execute =3D _WAMLookup_execute;
	_WAMLookup.prototype.showResult =3D _WAMLookup_showResult;
	_WAMLookup.prototype.zoomList =3D _WAMLookup_zoomList;
	_WAMLookup.prototype.zoomRow =3D _WAMLookup_zoomRow;
	_WAMLookup.prototype.setRootURL =3D _WAMLookup_setRootURL;
	_WAMLookup.prototype.setZoomListEnabled =3D =
_WAMLookup_setZoomListEnabled;
	_WAMLookup.prototype.isZoomListEnabled =3D =
_WAMLookup_isZoomListEnabled;
	_WAMLookup.prototype.disableReverseLk =3D _WAMLookup_disableReverseLk;
	_WAMLookup.prototype.enableReverseLk =3D _WAMLookup_enableReverseLk;
=09
	// --- Private properties
	_WAMLookup.prototype._lookupPage =3D =
"WAMLibrary/liveLookup/liveLookup.asp?";
	_WAMLookup.prototype._zoomRowPage =3D =
"WAMLibrary/liveLookup/zoomRowExists.asp?";
	_WAMLookup.prototype._lookupURL =3D WAMRootURL;
	_WAMLookup.prototype._customRow =3D false;
	_WAMLookup.prototype._customList =3D false;
	_WAMLookup.prototype._zlEnabled =3D true;

	// --- Private Methods
	_WAMLookup.prototype._getPageName =3D _WAMLookup__getPageName;

	// --- Events
	_WAMLookup.prototype.onAfterExecute =3D null;

	function _WAMLookup_addPkColumn(obj){
		this.pkColumns[obj.getName()] =3D obj;
		obj.parent =3D this;
		obj.setHTMLEl(_WAMLookup_addPkColumn.arguments[1]);

		obj.getHTMLEl().exeLookup =3D __WAMLookupColumn_LKExecute;
		obj.getHTMLEl().onchange =3D __WAMLookupColumn_OnChange_FOR_EXELOOKUP;
	}
=09
	function _WAMLookup_addLkColumn(obj){
		this.lkColumns[obj._getID()] =3D obj;
		obj.parent =3D this;
		obj.setHTMLEl(_WAMLookup_addLkColumn.arguments[1]);
		if (_WAMLookup_addLkColumn.arguments[2] =3D=3D false){
		} else {
			obj._setMyEvents();
			obj.getHTMLEl().exeReverseLookup =3D =
__WAMLookupColumn_LKReverseExecute;
		}
	}

	function _WAMLookup_setFilterColumn(obj){
		this.filterColumn =3D obj;
	}

	function _WAMLookup_getFilterValue(){
		return isNull(this.filterValue) ? "" : this.filterValue;
	}

	function _WAMLookup_setFilterValue(varFilterValue){
		this.filterValue =3D varFilterValue;
	}

	function _WAMLookup_setFilterColumnValue(objCol){
		this.filterColumnValue =3D objCol;
	}

	function _WAMLookup_getName(){
		return this.name;
	}

	function _WAMLookup_execute(){
		var strIf; var el, ultEl; var objCol; var strQS; var varVal;

		if (_WAMLookup_execute.arguments.length > 0){
			this.reverseColumn =3D _WAMLookup_execute.arguments[1];
		} else {
			this.reverseColumn =3D null;
		}
	=09
		// --- Verifies if this is a reverse LK
		if (!isNull(this.reverseColumn)){
			// --- Execute a reverse LK
			// --- Clear pkColumns
			for (el in this.pkColumns) this.pkColumns[el].clearValue();
			// --- Clear lkColumns, except the reverse column
			for (el in this.lkColumns){
				if (this.lkColumns[el]._getID() !=3D this.reverseColumn._getID()) =
this.lkColumns[el].clearValue("");
			}
			// --- Verifies if the reverse column has value
			varVal =3D this.reverseColumn.getValue();
			if (isEmpty(varVal) || isNull(varVal) || isUndefined(varVal)){
				// --- We need a value for the reverse column
				this.reverseColumn =3D null;
				return false
			}
			// --- Set the focus
			if (this.reverseColumn.getType() !=3D "hidden" && =
this.reverseColumn.getHTMLEl().disabled =3D=3D false){
				this.reverseColumn.getHTMLEl().focus();
			}
		} else {
			// --- Execute a normal LK
			// --- Clear looked-up columns
			for (el in this.lkColumns) this.lkColumns[el].clearValue();
			// --- Check if all pkColumns has values
			strIf =3D "";
			for (el in this.pkColumns){
				strIf +=3D " && this.pkColumns['"+el+"'].getValue().length > 0";
			}
			strIf =3D strIf.substr(4);
			if(!eval(strIf)){
				// --- We need more values for pkColumns
				this.reverseColumn =3D null;
				return false;
			}
			// --- Set the focus
			for (el in this.pkColumns) ultEl =3D el;
			if (this.pkColumns[ultEl].getHTMLEl().type !=3D "hidden" && =
this.pkColumns[ultEl].getHTMLEl().disabled =3D=3D false){
				this.pkColumns[ultEl].getHTMLEl().focus();
			}
		}
	=09
		// --- Generate QueryString
		strQS =3D "";

		// --- Filter column info
		if (!isNull(this.filterColumn)){
			if (!isNull(this.filterColumnValue)) varVal =3D =
this.filterColumnValue.getValue();
			else varVal =3D this.getFilterValue();
			if (!isEmpty(varVal)){
				objCol =3D this.filterColumn;
				strQS +=3D "&lkfiltercs=3D"+encodeURL(this.masterSchema)+
					"&lkfilterct=3D"+encodeURL(objCol.getTable())+
					"&lkfiltercn=3D"+encodeURL(objCol._getID())+
					"&lkfiltercv=3D"+encodeURL(varVal)+
					"&lkfiltercdt=3D"+encodeURL(objCol.getDataType())+
					"&lkfiltercd=3D"+encodeURL(objCol.getDomain())+
					"&lkfilterot=3D";
			}
		}
	=09
		if (!isNull(this.reverseColumn)){
			// --- Execute a reverse LK
			strQS +=3D "&lkcid=3D"+encodeURL(this.reverseColumn._getID())+
				"&lkcv=3D"+encodeURL(this.reverseColumn.getValue())+
				"&lktype=3Dreverse";
		} else {
			// --- Execute a normal LK
			// --- pkColumns
			for (el in this.pkColumns){
				strQS +=3D "&pkcn=3D"+encodeURL(this.pkColumns[el].getName())+
					"&pkcv=3D"+encodeURL(this.pkColumns[el].getValue());
			}
			strQS +=3D "&lktype=3Dnormal";
		}

		// --- Lookup's schema & name
		strQS +=3D "&lkschema=3D"+encodeURL(this.schema);
		strQS +=3D "&lkname=3D"+encodeURL(this.name);

		// --- Detail table schema & name
		if (!isNull(this.detailSchema) && !isNull(this.detailTable))
			strQS +=3D "&lkdetailschema=3D"+encodeURL(this.detailSchema)+
				"&lkdetailtable=3D"+encodeURL(this.detailTable);

		// --- Verifies if we need to send the lk columns (LOOSE FK)
		if (isNull(this.detailSchema) || isNull(this.detailName)){
		for (el in this.lkColumns)
			strQS +=3D "&lkcn=3D"+encodeURL(this.lkColumns[el].getName());
		}

		// --- Verifies if there are default values for the looked-up columns
		var hd =3D 0; // --- hd =3D has defaults
		for (el in this.lkColumns)
			if (this.lkColumns[el].getDefaultValue() !=3D null){
				hd =3D 1; break;
			}
		strQS +=3D "&hd=3D"+hd;
		strQS =3D strQS.substr(1);

		var AE =3D new ASPExecute();
		AE.setURL(this._lookupURL + this._lookupPage + strQS);
		AE.execute();
	}

	function _WAMLookup_showResult(){
		var elToFocus, el, lastEl; var objCol; var HTMLEl;
	=09
		// --- Verifies if is to show the looked-up columns' default values
		if (_WAMLookup_showResult.arguments[0] =3D=3D "ShowDefaults"){
			for (el in this.pkColumns){ objCol =3D this.pkColumns[el];
				if (isEmpty(objCol.getValue())) =
objCol.setValue(objCol.getDefaultValue());
			}
			for (el in this.lkColumns){ objCol =3D this.lkColumns[el];
				objCol.setValue(objCol.getDefaultValue());
			}
			elToFocus =3D objCol.getHTMLEl().name;
		} else {
			for (el in this.pkColumns){ objCol =3D this.pkColumns[el];
				objCol.setValue(objCol._getLkValue());
			}
			for (el in this.lkColumns){ objCol =3D this.lkColumns[el];
				objCol.setValue(objCol._getLkValue());
				elToFocus =3D objCol.getHTMLEl().name;
			}
		}
		if (isUndefined(this.event.fire(WAMLOOKUP_ONAFTEREXECUTE))){
			lastEl =3D "";
			for (el in this.parent.form.elements){
				if (lastEl =3D=3D elToFocus){
					elToFocus =3D el;
					HTMLEl =3D this.parent.form.elements.item(elToFocus);
					if (isUndefined(HTMLEl.length) || HTMLEl.type =3D=3D "select-one"){
						if (HTMLEl.style.visibility !=3D "hidden" && HTMLEl.type !=3D =
"hidden" && HTMLEl.disabled !=3D true){
							HTMLEl.focus();
							break;
						}
					} else {
						if (HTMLEl(0).style.visibility !=3D "hidden" && HTMLEl(0).type =
!=3D "hidden" && HTMLEl(0).disabled !=3D true){
							HTMLEl(0).focus();
							break;
						}
					}
				}
				lastEl =3D el;
			}
			if (el !=3D elToFocus) window.focus();
		}
	}

	function _WAMLookup_zoomList(strZoomColumnName){
		var el; var qsPkCols =3D ""; var strZoom; var objCol; var varVal;
	=09
		if (!this.isZoomListEnabled()) return false;

		strZoom =3D "";
		for (el in this.pkColumns){
			qsPkCols +=3D =
"&fkcn=3D"+encodeURL(this.pkColumns[el].getHTMLEl().name);
		}
		if (!isUndefined(strZoomColumnName)){
			objCol =3D this.lkColumns[strZoomColumnName];
			strZoom =3D "&__listopenmode=3DzoomWhere"+
				"&__zoomcs=3D"+encodeURL(this.masterSchema)+
				"&__zoomct=3D"+encodeURL(objCol.getTable())+
				"&__zoomcn=3D"+encodeURL(strZoomColumnName)+
				"&__zoomcv=3D"+encodeURL(objCol.getValue())+
				"&__zoomcdt=3D"+encodeURL(objCol.getDataType())+
				"&__zoomcd=3D"+encodeURL(objCol.getDomain())+
				"&__zoomot=3D";
		}
		if (!isNull(this.filterColumn)){
			if (!isNull(this.filterColumnValue)) varVal =3D =
this.filterColumnValue.getValue();
			else varVal =3D this.getFilterValue();
			if (!isEmpty(varVal)){
				objCol =3D this.filterColumn;
				if (isEmpty(strZoom)) strZoom =3D "&__listopenmode=3DzoomWhere";
				strZoom +=3D "&__zoomcs=3D"+encodeURL(this.masterSchema)+
					"&__zoomct=3D"+encodeURL(objCol.getTable())+
					"&__zoomcn=3D"+encodeURL(objCol._getID())+
					"&__zoomcv=3D"+encodeURL(varVal)+
					"&__zoomcdt=3D"+encodeURL(objCol.getDataType())+
					"&__zoomcd=3D"+encodeURL(objCol.getDomain())+
					"&__zoomot=3D";
			}
		}
		if (isEmpty(strZoom)) strZoom =3D "&__listopenmode=3Dzoom";

		=
window.openChild(this._lookupURL+this._getPageName("LIST")+"fkn=3D"+this.=
name+qsPkCols+strZoom,
			WinFeatures(0, 0, 'no', 'no', 'no', 'yes', 'no', 'yes', 'yes'));
	}
=09
	function _WAMLookup_zoomRow(){
		var strQS;
		var el;
	=09
		strQS =3D "";

		for (el in this.pkColumns)
			if (isEmpty(this.pkColumns[el].getValue())){
				Error.setError("ZOMNOKEY_");
				Error.catchErrors();
				return;
			}

		if (_WAMLookup_zoomRow.arguments[0] !=3D true){ // --- Verifies if the =
row exists in the database
			strQS =3D "&__t=3D"+this.masterTable+"&__n=3D"+this.name;
			for (el in this.pkColumns)
				strQS +=3D "&__cn=3D"+this.pkColumns[el].getName()+
					"&__ct=3D"+this.pkColumns[el].getDataType()+
					"&__cd=3D"+this.pkColumns[el].getDomain()+
					"&__cv=3D"+encodeURL(this.pkColumns[el].getValue());
			var objAE =3D new ASPExecute();
			strQS =3D strQS.substr(1);
			objAE.setURL(this._lookupURL + this._zoomRowPage + strQS);
			objAE.execute();
			return
			// --- ... waiting for response ...
		}

		for (el in this.pkColumns){
			strQS +=3D "&key=3D"+encodeURL(this.pkColumns[el].getValue());
		}
		strQS =3D strQS.substr(1);

		window.openChild(this._lookupURL+this._getPageName("ROW")+strQS,
			WinFeatures(0, 0, 'no', 'no', 'no', 'yes', 'no', 'yes', 'yes'));
	}

	function _WAMLookup_setRootURL(strURL){
		this._lookupURL =3D strURL;
	}

	function _WAMLookup__getPageName(strType){
		switch (strType.toUpperCase()){
			case "ROW":
				if (this._customRow) return "rows/"+this.masterTable+".asp?";
				else return =
"WAMLibrary/Interface/standard.asp?witype=3Drow&winame=3D"+encodeURL(this=
.masterTable)+"&";
				break;
			case "LIST":
				if (this._customList) return "lists/"+this.masterTable+".asp?";
				else return =
"WAMLibrary/Interface/standard.asp?witype=3Dlist&winame=3D"+encodeURL(thi=
s.masterTable)+"&";
				break;
		}
	}

	function _WAMLookup_setZoomListEnabled(bolEnabled){
		this._zlEnabled =3D typeof(bolEnabled) =3D=3D "boolean" ? bolEnabled : =
true;
	}

	function _WAMLookup_isZoomListEnabled(){
		return this._zlEnabled;
	}

	function _WAMLookup_disableReverseLk(strColumnName){
		if (!isUndefined(this.lkColumns[strColumnName])) =
this.lkColumns[strColumnName].rlk =3D false;
	}

	function _WAMLookup_enableReverseLk(strColumnName){
		if (!isUndefined(this.lkColumns[strColumnName])) =
this.lkColumns[strColumnName].rlk =3D true;
	}
}


//***********************************************************************=
*/
// WAMLookupColumn Object (Client Side)
//***********************************************************************=
*/
function WAMLookupColumn(strTable, strName, strDataType, strDomain, =
intLength, intPrecision, intScale, strRequiredJoin){
	var c =3D new _WAMLookupColumn(strTable, strName, strDataType, =
strDomain, intLength, intPrecision, intScale, strRequiredJoin);
	return c;
}

function _WAMLookupColumn(strTable, strName, strDataType, strDomain, =
intLength, intPrecision, intScale, strRequiredJoin){
	if (typeof(_WAMLookupColumnPrototypeCalled) =3D=3D "undefined")
		_WAMLookupColumn__Prototype();

	// --- Properties
	this.table =3D strTable;
	this.name =3D strName;
	this.requiredJoin =3D strRequiredJoin;
	this.setDataType(strDataType);
	this.setDomain(strDomain);
	this.setLength(intLength);
	this.setPrecision(intPrecision);
	this.setScale(intScale);
}

function _WAMLookupColumn__Prototype(){
	_WAMLookupColumnPrototypeCalled =3D true;

	// --- Properties
	_WAMLookupColumn.prototype.table =3D null;
	_WAMLookupColumn.prototype.name =3D null;
	_WAMLookupColumn.prototype.dataType =3D null;
	_WAMLookupColumn.prototype.domain =3D null;
	_WAMLookupColumn.prototype.length =3D null;
	_WAMLookupColumn.prototype.precision =3D null;
	_WAMLookupColumn.prototype.scale =3D null;
	_WAMLookupColumn.prototype.requiredJoin =3D "";
	_WAMLookupColumn.prototype.HTMLEl =3D null;
	_WAMLookupColumn.prototype.parent =3D null;
	_WAMLookupColumn.prototype.rlk =3D true;
=09
	// --- Methods
	_WAMLookupColumn.prototype.getTable =3D =
_WAMRowColumn.prototype.getTable;
	_WAMLookupColumn.prototype.setTable =3D =
_WAMRowColumn.prototype.setTable;
	_WAMLookupColumn.prototype.getName =3D _WAMRowColumn.prototype.getName;
	_WAMLookupColumn.prototype.setName =3D _WAMRowColumn.prototype.setName;
	_WAMLookupColumn.prototype.getValue =3D =
_WAMRowColumn.prototype.getValue;
	_WAMLookupColumn.prototype.setValue =3D =
_WAMRowColumn.prototype.setValue;
	_WAMLookupColumn.prototype.setValidated =3D =
_WAMRowColumn.prototype.setValidated;
	_WAMLookupColumn.prototype.clearValue =3D =
_WAMRowColumn.prototype.clearValue;
	_WAMLookupColumn.prototype.getType =3D _WAMRowColumn.prototype.getType;
	_WAMLookupColumn.prototype.setType =3D _WAMRowColumn.prototype.setType;
	_WAMLookupColumn.prototype.getDataType =3D =
_WAMRowColumn.prototype.getDataType;
	_WAMLookupColumn.prototype.setDataType =3D =
_WAMRowColumn.prototype.setDataType;
	_WAMLookupColumn.prototype.setDomain =3D =
_WAMRowColumn.prototype.setDomain;
	_WAMLookupColumn.prototype.getDomain =3D =
_WAMRowColumn.prototype.getDomain;
	_WAMLookupColumn.prototype.setLength =3D =
_WAMRowColumn.prototype.setLength;
	_WAMLookupColumn.prototype.getLength =3D =
_WAMRowColumn.prototype.getLength;
	_WAMLookupColumn.prototype.setPrecision =3D =
_WAMRowColumn.prototype.setPrecision;
	_WAMLookupColumn.prototype.getPrecision =3D =
_WAMRowColumn.prototype.getPrecision;
	_WAMLookupColumn.prototype.setScale =3D =
_WAMRowColumn.prototype.setScale;
	_WAMLookupColumn.prototype.getScale =3D =
_WAMRowColumn.prototype.getScale;
	_WAMLookupColumn.prototype.getHTMLEl =3D =
_WAMRowColumn.prototype.getHTMLEl;
	_WAMLookupColumn.prototype.setHTMLEl =3D =
_WAMRowColumn.prototype.setHTMLEl;

	_WAMLookupColumn.prototype.getRequiredJoin =3D =
_WAMLookupColumn_getRequiredJoin;
	_WAMLookupColumn.prototype.setRequiredJoin =3D =
_WAMLookupColumn_setRequiredJoin;
	_WAMLookupColumn.prototype.getDefaultValue =3D =
_WAMLookupColumn_getDefaultValue;
	_WAMLookupColumn.prototype.setDefaultValue =3D =
_WAMLookupColumn_setDefaultValue;

	// --- Private Properties
	_WAMLookupColumn.prototype._lkValue =3D null;

	// --- Private Methods
	_WAMLookupColumn.prototype._getLkValue =3D =
_WAMLookupColumn__getLkValue;
	_WAMLookupColumn.prototype._setLkValue =3D =
_WAMLookupColumn__setLkValue;
	_WAMLookupColumn.prototype._getHTMLName =3D =
_WAMRowColumn.prototype._getHTMLName;
	_WAMLookupColumn.prototype._getID =3D _WAMRowColumn.prototype._getID;
	_WAMLookupColumn.prototype._setMyEvents =3D =
_WAMLookupColumn__setMyEvents;
	_WAMLookupColumn.prototype._createHidden =3D =
_WAMRowColumn.prototype._createHidden;

	function _WAMLookupColumn_getRequiredJoin(){
		return this.requiredJoin;
	}

	function _WAMLookupColumn_setRequiredJoin(strRequiredJoin){
		this.requiredJoin =3D strRequiredJoin;
		this.setHTMLEl();
	}

	function _WAMLookupColumn_getDefaultValue(){
		return this.defaultValue;
	}

	function _WAMLookupColumn_setDefaultValue(varDefaultValue){
		this.defaultValue =3D varDefaultValue;
	}

	function _WAMLookupColumn__getLkValue(){
		return this._lkValue;
	}

	function _WAMLookupColumn__setLkValue(varValue){
		this._lkValue =3D varValue;
	}

	function _WAMLookupColumn__setMyEvents(){
		var n; var el =3D this.getHTMLEl();
		if (!el.disabled){
			switch (this.getType()){
				case "text":
				case "textarea":
				case "hidden":
				case "file":
					if (this.getDomain() !=3D WAMDomain.wamexternalimage){
						el.onfocus =3D __WAMRowColumn_OnFocus_TEXT_TEXTAREA;
					} else {
					}
					el.onchange =3D __WAMLookupColumn_OnChange_ALLTYPES;
					break;
				case "checkbox":
					el.onchange =3D __WAMLookupColumn_OnChange_ALLTYPES;
					el.onclick =3D __WAMLookupColumn_OnClick_CHECKBOX;
					break;
				case "radio":
					n =3D el.length;
					for (var i =3D 0; i < n; i++){
						el(i).onchange =3D __WAMLookupColumn_OnChange_ALLTYPES;
						el(i).onclick =3D __WAMLookupColumn_OnClick_RADIO;
						el(i).onmousedown =3D __WAMRowColumn_OnMouseDown_RADIO;
					}
					break;
				case "select-one":
					el.onchange =3D __WAMLookupColumn_OnChange_ALLTYPES;
					break;
			}
		}
	}
}

function __WAMLookupColumn_LKExecute(){
	this.WAMLookupColumn.parent.execute();
	this.WAMLookupColumn.parent.parent.setDirty();
}

function __WAMLookupColumn_LKReverseExecute(){
	if (this.WAMLookupColumn.rlk =3D=3D true){
		this.WAMLookupColumn.parent.execute("REVERSE", this.WAMLookupColumn);
		this.WAMLookupColumn.parent.parent.setDirty();
	}
}

function __WAMLookupColumn_OnChange_FOR_EXELOOKUP(){ // for pkColumns
	var lkc =3D this.WAMLookupColumn;
	var val;

	val =3D lkc.getValue();
	var newVal =3D validateGeneric(lkc.getDataType(), lkc.getDomain(), val, =
lkc.getLength(), lkc.getPrecision(), lkc.getScale());
	if (newVal !=3D invalidValue()){
		lkc.setValue(newVal);
		this.exeLookup();
		lkc.parent.parent.setDirty();
	} else {
		Error.setMacro('F', this.label);
		Error.setFocusTo(this);
		Error.catchErrors();
		return false;
	}
}

function __WAMLookupColumn_OnChange_ALLTYPES(){
	var lkc =3D this.WAMLookupColumn;
	var val;

	val =3D lkc.getValue();
	var newVal =3D validateGeneric(lkc.getDataType(), lkc.getDomain(), val, =
lkc.getLength(), lkc.getPrecision(), lkc.getScale());
	if (newVal !=3D invalidValue()){
		lkc.setValue(newVal);
		this.exeReverseLookup();
	} else {
		Error.setMacro('F', this.label);
		Error.setFocusTo(this);
		Error.catchErrors();
		return false;
	}
}

function __WAMLookupColumn_OnClick_RADIO(){
	if (this._checked =3D=3D true) this.checked =3D false;
	this.WAMLookupColumn.parent.parent.setDirty();
}

function __WAMLookupColumn_OnClick_CHECKBOX(){
	this.WAMLookupColumn.parent.parent.setDirty();
}

------=_NextPart_000_004F_01C276BF.A99CECA0--

