// Copyright 2001-2003 Modern Mind(r) Software(tm), Inc.. All rights reserved.
var _tw=null
var _submit=0
var _timeout=250
var _months=new Array(' ','January','February','March','April','May','June','July','August','September','October','November','December')
var _d=new Array(31,28,31,30,31,30,31,31,30,31,30,31);
var _NN=(navigator.appName=="Netscape")
var _NS4=_NN&&(parseInt(navigator.appVersion)<=4)
var _NS6=_NN&&(parseInt(navigator.appVersion)>=5)
var _pT="twPage"
var _nT="twNavPage"
var _2CT="C2AL"
var _nR=2
var _nF=0
var _bF=1
var _fP="Frm"
var _ts='xu'
var _topLevelPage=false
function _2WAY_(K,L,c)
{
this.length=98
this.authErrorMsg=null
this.authFailMsg=null
this.baseFace='Arial,Helvetica,sans-serif'
this.baseSize='-1'
this.baseColor='#000000'
this.clp=false
this.color=c
this.cookieAuthenticate=false
this.currentPage=null
this.datePrefix=null
this.dateSuffix=null
this.devModeMsg=null
this.dupRespMsg=null
this.firstPage=null
this.loadResultFailMsg=null
this.submitFailMsg=null
this.submitURL=null
this.targetPage=null
this.unselectedDateMsg='Select a Date'
this.url=null
this.valueList=new _NmValList
this.gvPickOneQ=null
this.gvPickOneListQ=null
this.gvPickManyQ=null
this.gvAtLeast=0
this.gvAtMost=0
this.gvTextQ=null
this.gvFormatFn=null
this.gvError=null
this.Close=_Close
this.Error=_Error
this.EnableNavButton=_EnableNavButton
this.Finish=_Finish
this.FirstPage=_FirstPage
this.FirstQuestion=_2FQ
this.GetCookie=_GetCookie
this.GotoPage=_GotoPage
this.NextPage=_NextPage
this.NextQuestion=_2FN
this.PreviousPage=_PreviousPage
this.Refresh=_Refresh
this.RefreshNavBar=_RefreshNavBar
this.SetColor=_2C
this.SetCookie=_SetCookie
this.SetURL=_2U
this.Submit=_Submit
this.SubstituteValues=_Substitute
this.acard=null
this.authPage=null
this.cid=0
this.cP=new Array(_nR)
this.iP=null
this.iC=null
this.iQ=null
this.datePicker=null
this.eid=0
this.errorPage=null
this.errorTextElement=null
this.errorTextColor=null
this.frames=new Array(_nR)
this.fT=new Array(_nR)
this.fReWrite=new Array(_nR)
this.fSubmitCurrentPage=false
this.fSr=false
this.fS=false
this.fUseNSPgRefresh=false
this.iE=false
this.K=K
this.L=L
this.loadPage=null
this.markSubQs=false
this.nA=null
this.navPage=null
this.ovf=null
this.paths=null
this.pages=null
this.pastPage=null
this.rz=false
this.refreshing=false
this.starting=false
this.sA=false
this.stopSubmit=false
this.submitPage=null
this.thankYouPage=null
this.thankYouTimeout=null
this.tid=0
this.viewRequest=false
this.update=true
this.AF=_AF
this.RZ=_RZ
this.ReRender=_ReRender
this.Resize=_Resize
this.Save=_Save
this.Start=_Start
this.TopOfPage=_TopOfPage
this.OE=null
this.OL=null
this.OU=null
this.OPC=null
this.OS=null
this.OTO=null
this.OPOP=null
}
function _System2WAY_(c)
{
this.length=24
this.color=c
this.url=null
this.baseFace='Arial,Helvetica,sans-serif'
this.baseSize='-1'
this.baseColor='#000000'
this.Close=_Close
this.Refresh=_Refresh
this.ReRender=_ReRender
this.SetColor=_2C
this.SetURL=_2U
this.currentPage=null
this.cP=new Array(_nR)
this.cP[_nF]=null
this.frames=new Array(_nR)
this.frames[_nF]=null
this.frames[_bF]=self
this.fT=new Array(_nR)
this.fT[_nF]=_nT
this.fT[_bF]=_pT
this.fReWrite=new Array(_nR)
this.fSr=false
this.iE=false
this.refreshing=false
this.AF=null
this.OE=null
this.OL=null
this.OS=null
this.OTO=null
}
function _Page(t,n,v,co,u)
{
this.length=35
this.color=co
this.nextPage=null
this.previousPage=null
this.url=u
this.visible=(v==1)
this.SetColor=_PB
this.SetNextPage=_SetNextPage
this.SetPreviousPage=_SetPreviousPage
this.SetURL=_PU
this.SetVisible=_SV
this.C=new Array(n)
this.hasDate=false
this.m=null
this.nR=false
this.BeforeNextVisiblePage=_PBN
this.BeforePreviousVisiblePage=_PBP
this.IsANextPage=_PN
this.IsAPreviousPage=_PP
this.NextVisiblePage=_PNV
this.PreviousVisiblePage=_PPV
this.fI=null
this.fR=null
this.tag=t
this.type="p"
this.GH=_PGH
this.GS=_PGS
this.RZ=_PRZ
this.RS=_PRS
this.Save=_PSave
this.Substitute=_PS
this.Validate=_PValidate
this.OEP=null
this.OLP=null
this.OR=null
this.OTO=null
}
function _PageCell(E,x,y,w,h,z)
{
this.length=7
this.E=E
this.h=h
this.n=0
this.w=w
this.x=x
this.y=y
this.z=z
}
function _PGH(f)
{
var t=new String
var cn=_GL(this.C)
var c,e,i,tn
for(i=0;i<cn;i++){
c=this.C[i];e=c.E
if(e&&e.fI){
e.fI[f]=0;
}
}
if((_tw&&_tw.fReWrite&&(_tw.fReWrite[f]==true))||(this.tag=="__LOADING")||(this.tag=="__LINK")||(this.tag=="__UNPUBLISH")||(_tw&&(_tw.fSr==true))){
tn=_GT(_tw.fT[f],1);
t+=_cS(tn)+_cP(0,0,'100%','100%',false)+_cZ(0)+_cES()
}
if((_NS4)&&(this.tag=="__SUBMIT")){
t+='<FORM NAME="twoWayForm" ACTION="?" onSubmit="return parent._FormSubmit(this);" METHOD="POST"><INPUT TYPE=HIDDEN NAME="2WAY" VALUE=""></FORM>'
}
for(i=0;i<cn;i++){
c=this.C[i];e=c.E
if(e){
e.fI[f]++;
c.n=e.fI[f];
t+=e.GH(f,c,false);
}
}
if((this.hasDate==true)&&(_tw.datePicker)){
t+=_cS(_GT(_2CT,1))+_cV(2)+_cP(10,10,10,10,false)+_cB(_tw.datePicker.bgColor)+_cZ(999)+_cES()+_cE();
}
if((_tw&&_tw.fReWrite&&(_tw.fReWrite[f]==true))||(this.tag=="__LOADING")||(this.tag=="__LINK")||(this.tag=="__UNPUBLISH")||(_tw&&(_tw.fSr==true))){
t+=_cE()
}
return t
}
function _PValidate()
{
var cn=_GL(this.C)
var i
if(this.visible==false){
return true
}
for(i=0;i<cn;i++){
if((this.C[i].E.Validate)&&(this.C[i].E.Validate()==false)){
return false
}
}
return true
}
function _PRS()
{
var i,cn
this.sM=false
cn=_GL(this.C)
for(i=0;i<cn;i++){
if(this.C[i].E&&this.C[i].E.RS)this.C[i].E.RS()
}
return
}
function _PGS()
{
var v,i,cn,vt
if(this.sM==false){
v=new String()
cn=_GL(this.C)
for(i=0;i<cn;i++){
if(this.C[i].E&&this.C[i].E.GS){
vt=this.C[i].E.GS()
if(vt){
v+=vt
}
}
}
this.sM=true
return v
}
return null
}
function _PN(tp)
{
var i,p,pn
pn=_GL(_tw.pages)
for(i=0;i<pn;i++){
_tw.pages[i].m=false
}
this.m=true
p=this.nextPage
while(p!=null){
if(p.m==true){
return false;
}
p.m=true
if(p==tp){
return true
}
p=p.nextPage
}
return false
}
function _PP(tp)
{
var i,p,pn
pn=_GL(_tw.pages)
for(i=0;i<pn;i++){
_tw.pages[i].m=false
}
this.m=true
p=this.previousPage
while(p!=null){
if(p.m==true){
return false;
}
p.m=true
if(p==tp){
return true
}
p=p.previousPage
}
return false
}
function _PRZ()
{
var i,cn
cn=_GL(this.C)
for(i=0;i<cn;i++){
if((this.C[i].E!=null)&&(this.C[i].E.RZ)){
this.C[i].E.RZ()
}
}
}
function _PSave()
{
var i,cn
cn=_GL(this.C)
for(i=0;i<cn;i++){
if(this.C[i]&&this.C[i].E&&this.C[i].E.Save)this.C[i].E.Save()
}
return true
}
function _PU(u)
{
var i,fn
this.url=u
fn=_GL(_tw.frames)
for(i=0;i<fn;i++){
if(this==_tw.cP[i]){
if(_NS4){
_tw.fReWrite[i]=true
}
else {
_cUU(i,_tw.fT[i],u,1)
}
}
}
}
function _PB(c)
{
var i,fn
this.color=c
fn=_GL(_tw.frames)
for(i=0;i<fn;i++){
if(this==_tw.cP[i]){
_cUP(i,_tw.fT[i],c,1)
}
}
}
function _PS()
{
var cn,i
cn=_GL(this.C)
for(i=0;i<cn;i++){
if(this.C[i].E&&(this.C[i].E.Substitute!=null)){
this.C[i].E.Substitute()
}
}
return false
}
function _2U(u)
{
var i,fn
this.url=u
fn=_GL(_tw.frames)
for(i=0;i<fn;i++){
if((i!=_nF)&&(_tw.cP[i])&&(!_tw.cP[i].color)&&(!tw.cP[i].url)){
if(_NS4){
this.fReWrite[i]=true
}
else {
_cUU(i,_tw.fT[i],u,1)
}
}
}
}
function _2C(c)
{
var i,fn
this.color=c
fn=_GL(_tw.frames)
for(i=0;i<fn;i++){
if((i!=_nF)&&(_tw.cP[i])&&(!_tw.cP[i].color)){
_cUP(i,_tw.fT[i],c,1)
}
}
}
function _Save(dv)
{
var i,fn,vr
if(this.starting==true)return true
fn=_GL(this.frames)
for(i=0;i<fn;i++){
if(this.cP[i]){
this.cP[i].Save()
}
}
if(dv==true){
this.iE=true
for(i=0;i<fn;i++){
if(this.cP[i]){
vr=this.cP[i].Validate()
if(vr==false){
this.iE=false
this.targetPage=null
this.ReRender()
return vr
}
}
}
this.iE=false
}
return true
}
function _AF(){
if((this.nA==1)||(this.nA==3)){
this.frames[_bF]=frames[1]
this.frames[_nF]=frames[0]
}else if((this.nA==2)||(this.nA==4)){
this.frames[_bF]=frames[0]
this.frames[_nF]=frames[1]
}else {
this.frames[_bF]=frames[1]
this.frames[_nF]=null
}
}
function _Start()
{
var Q,l,i,tp,F,ss
if(window.focus)window.focus()
_tw=this
this.fT[_nF]=_nT
this.fT[_bF]=_pT
this.cP[_nF]=_tw.navPage
this.AF()
for(i=0;i<_nR;i++){
this.fReWrite[i]=false
}
if(this.L!=this.paths.L){
var b=this.frames[_bF]?this.frames[_bF].document:null
if(b){
b.open("text/html","replace")
b.writeln('<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"><META HTTP-EQUIV="Pragma" CONTENT="no-cache">')
b.writeln('<META HTTP-EQUIV="Expires" CONTENT="Thu, 01 Dec 1994 16:00:00 GMT"><META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">')
b.writeln('<TITLE>2WAY</TITLE></HEAD><BODY><H1>Error</H1>The 2WAY is incompatible with 2WAY library on this server.</BODY></HTML>')
b.close()
}
return
}
if(this.RZ){
this.RZ()
}
_SQ()
this.currentPage=null
this.cP[_bF]=null
this.pastPage=null
if(this.authPage){
this.targetPage=this.authPage
this.authPage.visible=true
}else {
this.targetPage=this.firstPage
var pg=this.firstPage;
if(pg.visible==false)pg=this.firstPage.NextVisiblePage();
if(pg!=null)this.targetPage=pg
else this.Finish()
}
this.starting=true
this.iE=true
if(this.OL)this.OL()
this.iE=false
if((this.cookieAuthenticate)||
(this.viewRequest)){
if(_NS4){
F=this.frames[_bF]?this.frames[_bF].document.layers[_GT(this.fT[_bF],1)].document.forms['twoWayForm']:null
}
else {
F=this.frames[_bF]?this.frames[_bF].document.twoWayForm:null
}
if(F){
ss=new String('K.'+_tw.K+'_L.'+_tw.L+'_BG.'+_tw.color)
if(this.viewRequest){
ss=ss+'_Z.'+window.location.search;
}
if(this.cookieAuthenticate){
ss=ss+'_AR.1'
}
ss=ss+'_V.5_END.2WAY'
F.elements[0].value=ss
if(_NS6==true){
this.fUseNSPgRefresh=true
}
_FormSubmit(F)
F.submit()
if(this.navPage)this.navPage.fR=true
}
else {
_GP()
if(this.navPage)this.navPage.fR=true
this.ReRender()
}
}
else {
_GP()
if(this.navPage)this.navPage.fR=true
this.ReRender()
}
_AssociateKeyEventHandlers()
this.starting=false
}
function _SQ()
{
var qS,qP,e,i
if(window.location.search.length>1){
qS=window.location.search
qS=qS.substring(1,qS.length)
if(qS.substring(0,1)=="!"){
if(qS.substring(0,4)=="!2WC"){
_tw.viewRequest=true;
}
return;
}
qS=qS.split('&')
for(i=0;i<qS.length;i++){
qP=qS[i].split('=')
if(qP.length==2){
e=eval('self.'+qP[0])
if(e&&e.SR){
e.SR(unescape(qP[1]))
}
else {
_tw.valueList.SetValue(qP[0],unescape(qP[1]));
}
}
}
}
}
function _Resize()
{
var i,fn
if(_NN){
if(this.AF)this.AF()
}
this.iE=true
fn=_GL(this.frames)
for(i=0;i<fn;i++){
if(this.cP[i]&&this.cP[i].OR){
this.cP[i].OR()
}
}
this.iE=false
this.ReRender()
}
function _Refresh()
{
var i,fn
fn=_GL(this.frames)
for(i=0;i<fn;i++){
if(this.cP[i]!=null){
this.cP[i].fR=true
}
}
this.ReRender()
}
function _RefreshNavBar()
{
if(this.cP[_nF]){
this.cP[_nF].fR=true
}
this.ReRender()
}
function _RewriteFrame(f,p)
{
var b=_tw.frames[f].document
var s=new String()
s="<BODY"
if(p.color){
s+=' BGCOLOR="'+p.color+'"'
}
else if((f!=_nF)&&_tw.color){
s+=' BGCOLOR="'+_tw.color+'"'
}
if(p.url){
s+=' BACKGROUND="'+p.url+'"'
}
else if((f!=_nF)&&(!this.color)&&(_tw.url)){
s+=' BACKGROUND="'+_tw.url+'"'
}
s+='><A NAME="topContent"></A>'
if((!_NS4)&&(f==_bF)){
s+='<FORM NAME="twoWayForm" ACTION="?" onSubmit="return parent._FormSubmit(this);" METHOD="POST"><INPUT TYPE=HIDDEN NAME="2WAY" VALUE=""></FORM>'
}
s+=p.GH(f)
s+='</BODY>'
b.open("text/html","replace")
b.writeln(s)
b.close()
_AssociateKeyEventHandlers()
}
function _ReRender()
{
var i,f,fn
var e
var cn
var v,li
if(this.refreshing==false){
if(this.fUseNSPgRefresh==true){
this.fUseNSPgRefresh=false
if(_NS6){
if(this.frames[_bF].parent){
v=this.frames[_bF].parent.location.href
}
else {
v=self.location.href
}
if(v.length>10){
v.substr(0,v.length-10);
}
li=v.lastIndexOf('2w')
if(li<0){
li=v.lastIndexOf('2W')
}
if(li>0){
this.frames[_bF].location.href=v.substr(0,li)+'lib2w/2WAYPgRef.html';
this.refreshing=false
return;
}
}
}
this.refreshing=true
if((this.targetPage!=null)&&(this.targetPage!=this.cP[_bF])){
_GP()
}
fn=_GL(this.frames)
for(f=0;f<fn;f++){
if((f!=_nF)||(this.nA!=5)){
if(this.cP[f]){
if(this.fReWrite[f]==true){
_RewriteFrame(f,this.cP[f])
this.fReWrite[f]=false
}
else if(this.cP[f].fR==true){
_tw.TopOfPage()
if(this.cP[f].OR){
this.cP[f].OR()
}
if(this.cP[f].color){
_cUP(f,this.fT[f],this.cP[f].color,1);
}
else if(f!=0){
_cUP(f,this.fT[f],this.color,1);
}
if(this.cP[f].url){
_cUU(f,this.fT[f],this.cP[f].url,1);
}
else if((!this.cP[f].color)&&(f!=0)){
_cUU(f,this.fT[f],this.url,1);
}
else {
_cUU(f,this.fT[f],"",1);
}
if((this.fSr==false)||(f!=1)){
_cUH(f,_GT(this.fT[f],1),this.cP[f].GH(f));
}
}
else {
cn=_GL(this.cP[f].C)
for(i=0;i<cn;i++){
e=this.cP[f].C[i].E
if(e&&(e.fR==true)){
_cUH(f,_RU(_GT(e.tag,this.cP[f].C[i].n)),e.GH(f,this.cP[f].C[i],true));
}
}
}
}
}
}
for(f=0;f<fn;f++){
if((f!=_nF)||(this.nA!=5)){
if(this.cP[f]){
this.cP[f].fR=false
cn=_GL(this.cP[f].C)
for(i=0;i<cn;i++){
e=this.cP[f].C[i].E
if(e){
e.fR=false
}
}
}
}
}
this.targetPage=null
this.refreshing=false
}
}
function _FirstPage()
{
var cp=this.firstPage
if(!this)return _Error('Invalid Internal State')
if(cp==null){this.Finish();return false}
if(cp.visible==false){
cp=this.firstPage.NextVisiblePage()
if(cp==null){this.Finish();return false}
}
this.targetPage=cp
if(this.iE!=true){
return _GP()
}
return false;
}
function _Submit()
{
var iEInherit=this.iE
var cn,i,e,f,fn,rc
_tw.pastPage=this.cP[_bF]
if(this.fS)return false
if(!this.cP[_bF]&&(this.starting==false))return _Error('Invalid Internal State')
this.fS=true
fn=_GL(_tw.frames)
for(f=0;f<fn;f++){
if(_tw.cP[f]){
cn=_GL(_tw.cP[f].C)
for(i=0;i<cn;i++){
e=_tw.cP[f].C[i].E
if(e&&(e.fR==true)){
_cUH(f,_RU(_GT(e.tag,_tw.cP[f].C[i].n)),e.GH(f,_tw.cP[f].C[i],true));
}
}
}
}
if(this.Save(true)==false){
this.fS=false
return false
}
this.stopSubmit=false
this.iE=true
if(this.OS)this.OS()
this.iE=iEInherit
if(this.stopSubmit==false){
rc=this.GotoPage(this.submitPage)
if(this.iE==false){
this.ReRender()
}
if(rc==true){
setTimeout('_Submit2()',_timeout)
}
return true
}
else {
if(this.iE==false){
this.ReRender()
}
this.fS=false
return false
}
}
function _Submit2()
{
var v,F,i,j,tp,vt
if(_NS4){
F=_tw.frames[_bF]?_tw.frames[_bF].document.layers[_GT(_tw.fT[_bF],1)].document.forms['twoWayForm']:null
}
else {
F=_tw.frames[_bF]?_tw.frames[_bF].document.twoWayForm:null
}
if(!F){
_tw.GotoPage(_tw.pastPage)
_tw.ReRender()
_tw.fS=false
return false
}
if(_tw.cid==0){
v=new String('K.'+_tw.K+'_L.'+_tw.L+'_BG.'+_tw.color)
}
else {
v=new String('K.'+_tw.K+'_L.'+_tw.L+'_C.'+_tw.cid+'_T.'+_tw.tid+'_E.'+_tw.eid+'_BG.'+_tw.color)
}
if(_tw.pastPage!=null){
tp=_tw.pastPage
}
else {
tp=_tw.cP[_bF]
}
if(_tw.authPage&&(tp==_tw.authPage))
v+='_AR.1'
if((_tw.fSubmitCurrentPage)&&(tp!=null))
v+='_CP.'+_FmE(tp.tag)
v+='_V.5'
if(_tw.authPage){
_tw.authPage.RS()
}
for(i=0;i<_tw.pages.length;i++){
_tw.pages[i].RS()
}
if(_tw.navPage)_tw.navPage.RS()
if(_tw.authPage){
vt=_tw.authPage.GS()
if(vt!=null){
v+=vt
}
}
for(i=0;i<_tw.pages.length;i++){
vt=_tw.pages[i].GS()
if(vt!=null){
v+=vt
}
}
if(_tw.navPage){
vt=_tw.navPage.GS()
if(vt!=null){
v+=vt
}
}
v+='_END.2WAY'
F.elements[0].value=v
if(_NS6){
_tw.fUseNSPgRefresh=true
}
_FormSubmit(F)
F.submit()
_tw.fS=false
return false
}
function _2FQ()
{
var Ps,pn,cp,Cs,cn,cc,ce,Qs,qn,cq,i,j,k
if(this.authPage!=null){
cp=this.authPage
Cs=cp.C
cn=_GL(Cs)
for(i=0;i<cn;i++){
cc=Cs[i]
ce=cc.E
if(ce&&(ce.type=="qc")){
Qs=ce.Q
qn=_GL(Qs)
for(j=0;j<qn;j++){
cq=Qs[j]
if(cq!=null){
this.iP=this.authPage
this.iC=i
this.iQ=j
return cq
}
}
}
}
}
Ps=this.pages
pn=Ps.length
for(i=0;i<pn;i++){
cp=Ps[i]
Cs=cp.C
cn=_GL(Cs)
for(j=0;j<cn;j++){
cc=Cs[j]
ce=cc.E
if(ce&&(ce.type=="qc")){
Qs=ce.Q
qn=_GL(Qs)
for(k=0;k<qn;k++){
cq=Qs[k]
if(cq!=null){
this.iP=i
this.iC=j
this.iQ=k
return cq
}
}
}
}
}
this.iP=null
this.iC=null
this.iQ=null
return null
}
function _2FN()
{
if((this.iP==null)||(this.iC==null)||(this.iQ==null))return null
var Ps,pn,cp,Cs,cn,cc,ce,Qs,qn,cq,i,j,k
if(this.iP==this.authPage){
cp=this.authPage
Cs=cp.C
cn=_GL(Cs)
for(i=this.iC;i<cn;i++){
cc=Cs[i]
ce=cc.E
if(ce&&(ce.type=="qc")){
Qs=ce.Q
qn=_GL(Qs)
for(j=this.iQ+1;j<qn;j++){
cq=Qs[j]
if(cq!=null){
this.iP=this.authPage
this.iC=i
this.iQ=j
return cq
}
}
}
}
this.iP=0
this.iC=0
this.iQ=-1
}
Ps=this.pages
pn=Ps.length
for(i=this.iP;i<pn;i++){
cp=Ps[i]
Cs=cp.C
cn=_GL(Cs)
for(j=this.iC;j<cn;j++){
cc=Cs[j]
ce=cc.E
if(ce&&(ce.type=="qc")){
Qs=ce.Q
qn=_GL(Qs)
for(k=this.iQ+1;k<qn;k++){
cq=Qs[k]
if(cq!=null){
this.iP=i
this.iC=j
this.iQ=k
return cq
}
}
this.iQ=-1
}
}
this.iC=0
}
this.iP=null
this.iC=null
this.iQ=null
return null
}
function _SetNextPage(p)
{
var fCN=(this.nextPage!=null)
var fNN=(p!=null)
this.nextPage=p
if((this==_tw.cP[_bF])&&(fCN!=fNN)){
_UpdateNavButtons(false,true,true,_tw.cP[_bF]);
}
}
function _SetPreviousPage(p)
{
var fCP=(this.previousPage!=null)
var fNP=(p!=null)
this.previousPage=p
if((this==_tw.cP[_bF])&&(fCP!=fNP)){
_UpdateNavButtons(true,false,true,_tw.cP[_bF]);
}
}
function _PNV()
{
var np=this.nextPage
while((np!=null)&&(np!=this)){
if(np.visible==true)return np
np=np.nextPage
}
return null
}
function _PBN(e)
{
var np=this.nextPage
if(e==this)return true
while((np!=null)&&(np!=this)){
if(e==np)return true
if(np.visible==true)return (e==np)
np=np.nextPage
}
return false
}
function _PPV()
{
var pp=this.previousPage
if(this==_tw.errorPage){
if(_tw.pastPage)return _tw.pastPage
else if(_tw.authPage!=null)return _tw.authPage
else if(_tw.cookieAuthenticate==true)return _tw.cP[_bF]
else return _tw.firstPage
}
while((pp!=null)&&(pp!=this)){
if(pp.visible==true)return pp
pp=pp.previousPage
}
return null
}
function _PBP(e)
{
var pp=this.previousPage
if(e==this)return true
if(this==_tw.errorPage){
if(_tw.pastPage)return (e==_tw.pastPage)
else if(_tw.authPage!=null)return (e==_tw.authPage)
else return (e==_tw.firstPage)
}
while((pp!=null)&&(pp!=this)){
if(e==pp)return true
if(pp.visible==true)return (e==pp)
pp=pp.previousPage
}
return false
}
function _SetText(t)
{
this.text=t
this.fR=true
}
function _ShowAuthorCard(c)
{
var w
w=open(c,'_authorCard','directories=no,height=200,width=250,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');
if(w.focus)w.focus()
return false;
}
function _TimedOut(e)
{
if((e!=null)&&(e.OTO!=null)){
_tw.iE=true
e.OTO()
_tw.iE=false
_tw.ReRender()
}
}
function _Clicked(e)
{
_HD()
if((e!=null)&&(e.OC!=null)){
_tw.iE=true
e.OC()
_tw.iE=false
_tw.ReRender()
}
}
function _MousedOver(e)
{
if((e!=null)&&(e.OMOv!=null)){
_tw.iE=true
e.OMOv()
_tw.iE=false
_tw.ReRender()
}
}
function _MousedOut(e)
{
if((e!=null)&&(e.OMOu!=null)){
_tw.iE=true
e.OMOu()
_tw.iE=false
_tw.ReRender()
}
}
function _Blurred(e)
{
_HD()
if((e!=null)&&(e.OB!=null)){
_tw.iE=true
e.OB()
_tw.iE=false
_tw.ReRender()
}
}
function _Focused(e)
{
_HD()
if((e!=null)&&(e.OF!=null)){
_tw.iE=true
e.OF()
_tw.iE=false
_tw.ReRender()
}
}
function _DoubleClicked(e)
{
_HD()
if((e!=null)&&(e.ODC!=null)){
_tw.iE=true
e.ODC()
_tw.iE=false
_tw.ReRender()
}
}
function _SubS(s)
{
var fi,li,ci,rt,el
var tg=new String,t=new String,st=new String,V=new String
fi=s.indexOf('<!--')
if(fi==-1)
return s
li=s.indexOf('-->')
if(li==-1)
return s
t=s.substring(li+3)
ci=s.indexOf('<!-->')
if(ci==-1)
return s
tg=s.substring(fi+4,li)
el=eval('self.'+tg)
if(el&&el.GR){
V=el.GR()
}
else if(_tw.valueList.IsName(tg)){
V=_tw.valueList.GetValue(tg);
}
else {
V='%'+tg+'%'
}
st=s.substring(0,li+3)
st+=V
st+='<!-->'
return st+_SubS(s.substring(ci+5))
}
function _GetCookie(n)
{
var c,start,end
if(document.cookie.length==0)return null
c=n+"="
if((start=document.cookie.indexOf(c))!=-1){
start+=c.length
end=document.cookie.indexOf(";",start)
if(end==-1)end=document.cookie.length
return unescape(document.cookie.substring(start,end))
}
}
function _SetCookie(n,v,e)
{
document.cookie=n+"="+escape(v)+((e==null)?"":(";expires="+e.toGMTString()))
}
function _Close()
{
self.close()
}
function _Substitute()
{
var i,pn=_GL(this.pages)
for(i=0;i<pn;i++){
this.pages[i].Substitute()
}
if(this.authPage)
this.authPage.Substitute()
if(this.thankYouPage)
this.thankYouPage.Substitute()
if(this.errorPage)
this.errorPage.Substitute()
if(this.submitPage)
this.submitPage.Substitute()
if(this.navPage)
this.navPage.Substitute()
return false
}
function _EnableNavButton(nb,e)
{
if(nb!=null){
if(e==true){
nb.SetState(0)
nb.SetVisible(true)
}
else {
nb.SetState(1)
nb.SetVisible(true)
}
if(this.navPage)this.navPage.fR=true
}
}
function _PreviousPage()
{
var pp
if(!this)return _Error('Invalid Internal State')
pp=null
if(!this.cP[_bF]){
pp=this.firstPage
if(pp==null){
return _Error('Invalid Internal State')
}
}
else {
pp=this.cP[_bF].PreviousVisiblePage()
}
if((pp!=null)&&(pp.visible==true)){
this.targetPage=pp
if(this.iE!=true){
return _GP()
}
}
return false
}
function _NextPage()
{
var tp
if(!this)return _Error('Invalid Internal State')
tp=null
if(!this.cP[_bF]){
if(this.firstPage){
tp=this.firstPage.NextVisiblePage()
if(tp==null){
tp=this.firstPage
}
}
if(tp==null){
return _Error('Invalid Internal State')
}
}
else {
tp=this.cP[_bF].NextVisiblePage()
}
if((tp!=null)&&(tp.visible==true)){
this.targetPage=tp
if(this.iE!=true){
return _GP()
}
}
return false
}
function _GotoPage(pg)
{
if(!this)return _Error('Invalid Internal State')
if((pg!=null)&&(pg.visible==true)){
this.targetPage=pg
if(this.iE!=true){
return _GP()
}
return true
}
return false
}
function _Error(t)
{
var st
st='<FONT '+_BA(false)+'COLOR="'+_tw.errorTextColor+'">'
st+=t
st+='</FONT>'
_tw.errorTextElement.html=st
if(_tw.errorPage!=null){
_tw.targetPage=_tw.errorPage
if(_tw.iE!=true){
return _GP()
}
}
return false
}
function _GP()
{
var ic,dv
if(!_tw){
_tw.targetPage=null
return _Error('Invalid Internal State')
}
if(_tw.iE==true)return false
if(_tw.targetPage==null){
return false
}
if(_tw.targetPage.visible==false){
if(_tw.fSr==true){
_tw.currentPage=_tw.pastPage;
_tw.cP[_bF]=_tw.pastPage;
}
_tw.targetPage=null
return false
}
if((_tw.fSr==false)&&(_tw.targetPage!=_tw.submitPage)){
ic=_tw.cP[_bF]?_tw.cP[_bF].IsANextPage(_tw.targetPage):false
dv=(_tw.ovf==true)?ic:true
if(_tw.Save(dv)==false){
_tw.targetPage=null
return false
}
}
if(_tw.cP[_bF]!=null){
_tw.sA=false
_tw.iE=true
if(_tw.cP[_bF].OLP)_tw.cP[_bF].OLP()
_tw.iE=false
if(_tw.sA==true){
if(_tw.fSr==true){
_tw.currentPage=_tw.pastPage;
_tw.cP[_bF]=_tw.pastPage;
}
_tw.targetPage=null
return false
}
}
_tw.iE=true
if(_tw.OPC)_tw.OPC()
_tw.iE=false
if((_tw.targetPage!=null)&&(_tw.targetPage.visible==true)){
if(_tw.fSr==true){
if(_tw.pastPage==null){
_tw.pastPage=_tw.cP[_bF]
if(_tw.pastPage==_tw.submitPage){
_tw.pastPage=_tw.firstPage
}
}
}
else {
_tw.pastPage=_tw.cP[_bF]
if(_tw.pastPage==_tw.submitPage){
_tw.pastPage=_tw.firstPage
}
}
_tw.currentPage=_tw.targetPage
_tw.cP[_bF]=_tw.targetPage
_tw.iE=true
if((_tw.cP[_bF]==_tw.errorPage)&&(_tw.OE))_tw.OE()
if(_tw.cP[_bF]&&_tw.cP[_bF].OEP)_tw.currentPage.OEP()
_tw.iE=false
while(_tw.cP[_bF]!=_tw.targetPage){
_tw.currentPage=_tw.targetPage
_tw.cP[_bF]=_tw.targetPage
_tw.iE=true
if(_tw.OPC)_tw.OPC()
if(_tw.cP[_bF]&&_tw.cP[_bF].OEP)_tw.cP[_bF].OEP()
_tw.iE=false
}
if(_NS4){
if(_GetPageURL(_tw.currentPage)!=_GetPageURL(_tw.pastPage)){
_tw.fReWrite[_bF]=true
}
}
_tw.cP[_bF].fR=true
_tw.targetPage=null
return true
}
_tw.targetPage=null
return false
}
function _GetPageURL(p)
{
if(p){
if(p.url)return p.url
else if(p.color)return ''
else return _tw.url
}
return ''
}
function _Finish()
{
if(this.thankYouPage)this.GotoPage(this.thankYouPage)
else this.Close()
}
function _SC(c)
{
this.color=c
_cUE(_cUB,this.tag,c,this.fI)
}
function _SH(h)
{
this.html=h
this.fR=true
}
function _SV(v)
{
var	cp,np,pp
this.visible=v
_cUE(_cUV,this.tag,v,this.fI)
if((this.type=="p")&&(this.nA!=5)){
cp=_tw.cP[_bF]
if(cp==null)return;
np=cp.nextPage;
while(np!=null){
if(np.tag==this.tag){
_UpdateNavButtons(false,true,true,_tw.cP[_bF]);
break;
}
if(np.visible==true){
break;
}
np=np.nextPage;
}
pp=cp.previousPage;
while(pp!=null){
if(pp.tag==this.tag){
_UpdateNavButtons(true,false,true,_tw.cP[_bF]);
break;
}
if(pp.visible==true){
break;
}
pp=pp.previousPage;
}
}
}
function _ET(t)
{
var s=new String('')
var ch,i
for(i=0;i<t.length;i++){
ch=t.charAt(i)
if(ch=='\"'){
s+='&quot;'
}else if(ch=='&'){
s+='&amp;'
}else s+=ch
}
return s
}
function _RU(t)
{
if(t.indexOf('_')==-1){
return t
}
var nt=new String()
var i,ch
for(i=0;i<t.length;i++){
ch=t.charAt(i)
if(ch=='_'){
nt+=_ts
}
else {
nt+=ch
}
}
return nt
}
function _cS(t)
{
var s=new String()
if(_NS4){
s='<LAYER ID="'+t+'"'
}
else {
s='<SPAN ID="'+t+'" STYLE=\"'
}
return s
}
function _cES()
{
var t=new String()
if(_NS4){
t='>'
}
else {
t='\">'
}
return t
}
function _cE()
{
var t=new String()
if(_NS4){
t='</LAYER>'
}
else {
t='</SPAN>'
}
return t
}
function _cB(c)
{
if(c){
if(_NS4){
return (' BGCOLOR='+c);
}
else {
return (' background:'+c+';');
}
}
else return ''
}
function _cBU(u)
{
if(u){
if(_NS4){
return (' BACKGROUND="'+u+'"');
}
else {
return (' background-image:u('+u+');');
}
}
else return ''
}
function _cV(v)
{
var t=new String()
var vf=(v==true)?1:2
if(_NS4){
t=' VISIBILITY='
if(vf==1){
t+='"SHOW"'
}else if(vf==2){
t+='"HIDE"'
}else if(vf==3){
t+='"INHERIT"'
}else return ''
}
else {
t=' visibility:'
if(vf==1){
t+='visible;'
}else if(vf==2){
t+='hidden;'
}else if(vf==3){
t+='inherit;'
}else if(vf==4){
t+='collapsed;'
}else return ''
}
return t
}
function _cP(x,y,w,h,dH)
{
var t=new String()
if(_NS4){
t+=' LEFT='+x+' TOP='+y
t+=' WIDTH='+w
if(dH!=true){
t+=' HEIGHT='+h
}
}else {
t='position:absolute;'
t+=' left:'+x+'px; top:'+y+'px;'
t+=' width:'+w
if(!isNaN(w)){
t+='px'
}
t+=';'
if(dH!=true){
t+=' height:'+h
if(!isNaN(h)){
t+='px'
}
t+=';'
}
}
return t
}
function _cA(ah)
{
if((!_NS4)&&(ah<=3)&&(ah>=1)){
var t=new String()
if(ah==1){
t+='text-align:left;'
}
else if(ah==2){
t+='text-align:center;'
}
else if(ah==3){
t+='text-align:right;'
}
return t
}
else return ''
}
function _cZ(z)
{
if(_NS4){
return (' Z-INDEX='+z)
}
else {
return 'z-index:'+z+';'
}
}
function _cNT(ah,av)
{
if(_NS4){
return ((av!=1)||(ah!=1))
}
else {
return (av!=1)
}
}
function _cGI(t,ai)
{
var i,j,fn,e,ar,n
if(!t)return -1
ar=new Array()
n=0
fn=_GL(_tw.frames)
for(i=0;i<fn;i++){
if(ai&&ai[i]){
e=_cAT(i,t,ai[i])
if(e&&e.length){
ar[n]=i
n++
}
}
}
return ar
}
function _cGE(f,e,ai)
{
var i,j,frameIndices,el,n,ts,fn
if(!f||!e)return null
f=_RU(f)
frameIndices=_cGI(f,ai)
if(!frameIndices)return null
n=0
el=new Array()
for(i=0;i<frameIndices.length;i++){
if(_tw.frames[frameIndices[i]]&&ai&&ai[frameIndices[i]]){
for(j=1;j<=ai[frameIndices[i]];j++){
fn=_GT(f,j)
if(_NS4){
ts=eval('_tw.frames['+frameIndices[i]+'].document.layers["'+_GT(_tw.fT[frameIndices[i]],1)+'"].layers["'+fn+'"].document.forms[0].'+e)
if(ts){
el[n]=ts
n++
}
}else if(_NN){
ts=eval('_tw.frames['+frameIndices[i]+'].document.getElementById(\"'+_fP+fn+'\").'+e)
if(ts){
el[n]=ts
n++
}
}else {
ts=eval('_tw.frames['+frameIndices[i]+'].document.forms(\"'+_fP+fn+'\").all.'+e)
if(ts){
el[n]=ts
n++
}
}
}
}
}
return el
}
function _cFT(fN,t)
{
var el,ftGen
if(!t)return null
if(!_tw.frames[fN])return null
if(_NS4){
ftGen=_GT(_tw.fT[fN],1)
if(t!=ftGen){
return eval('_tw.frames['+fN+'].document.layers["'+ftGen+'"].layers["'+t+'"]')
}
else {
return eval('_tw.frames['+fN+'].document.layers["'+t+'"]')
}
}else if(_NN){
return eval('_tw.frames['+fN+'].document.getElementById(\"'+t+'\")')
}else {
return eval('_tw.frames['+fN+'].document.all.'+t)
}
}
function _cAT(fN,t,n)
{
var el,i,e,x,tn
if(!t)return null
if(!_tw.frames[fN])return null
t=_RU(t)
x=0
el=new Array()
for(i=1;i<=n;i++){
tn=_GT(t,i)
if(_NS4){
if(t!=_tw.fT[fN]){
e=eval('_tw.frames['+fN+'].document.layers["'+_GT(_tw.fT[fN],1)+'"].layers["'+tn+'"]')
}
else {
e=eval('_tw.frames['+fN+'].document.'+tn)
}
}else if(_NN){
e=eval('_tw.frames['+fN+'].document.getElementById(\"'+tn+'\")')
}else {
e=eval('_tw.frames['+fN+'].document.all.'+tn)
}
if(e){
el[x]=e
x++
}
}
return el
}
function _cUE(f,t,v,an)
{
var i,fn
fn=_GL(_tw.frames)
for(i=0;i<fn;i++){
if(_tw.frames[i]&&an&&an[i]){
f(i,t,v,an[i]);
}
}
}
function _cUH(fN,tg,t)
{
var c,i,tgn,pt
if(!tg)return null
if(!_tw.frames[fN])return null
if(_NS4){
pt=_GT(_tw.fT[fN],1)
if(tg!=pt){
c=eval('_tw.frames['+fN+'].document.layers["'+pt+'"].layers["'+tg+'"].document')
}
else {
c=eval('_tw.frames['+fN+'].document.'+tg+'.document')
}
if(c){
c.write(t)
c.close()
}
}else if(_NN){
c=eval('_tw.frames['+fN+'].document.getElementById(\"'+tg+'\")')
if(c){
c.innerHTML=t;
}
}else {
c=eval('_tw.frames['+fN+'].document.all.'+tg)
if(c){
c.innerHTML=t;
}
}
}
function _cUV(fN,tg,v,n)
{
var e,i,vf
vf=(v==true)?1:2
e=_cAT(fN,tg,n)
if(e){
for(i=0;i<e.length;i++){
if(_NS4){
if(vf==1){
e[i].visibility='show'
}else if(vf==2){
e[i].visibility='hide'
}else if(vf==3){
e[i].visibility='inherit'
}
}else {
if(vf==1){
e[i].style.visibility='visible'
}else if(vf==2){
e[i].style.visibility='hidden'
}else if(vf==3){
e[i].style.visibility='inherit'
}else if(vf==4){
e[i].style.visibility='collapsed'
}
}
}
}
}
function _cUB(fN,t,co,n)
{
var e,i
e=_cAT(fN,t,n)
if(e){
for(i=0;i<e.length;i++){
if(_NS4){
e[i].bgColor=co
}else {
e[i].style.backgroundColor=co
}
}
}
}
function _cUX(fN,t,x,n)
{
var e,i
e=_cAT(fN,t,n)
if(e){
for(i=0;i<e.length;i++){
if(_NS4){
e[i].pageX=x
}else if(_NN){
e[i].style.left=x
}
else {
e[i].style.pixelLeft=x
}
}
}
}
function _cUY(fN,t,y,n)
{
var e,i
e=_cAT(fN,t,n)
if(e){
for(i=0;i<e.length;i++){
if(_NS4){
e[i].pageY=y
}else if(_NN){
e[i].style.top=y
}
else {
e[i].style.pixelTop=y
}
}
}
}
function _cUW(fN,t,w,h)
{
var e
t=_RU(_GT(t,1))
e=_cFT(fN,t)
if(e){
if(_NS4){
e.resizeTo(w,h)
}else if(_NN){
e.style.height=h
e.style.width=w
}
else {
e.style.pixelHeight=h
e.style.pixelWidth=w
}
}
}
function _cGX(fN,t)
{
var e
e=_cAT(fN,t,1)
if(e&&e[0]){
if(_NS4){
return e[0].pageX
}else if(_NN){
return parseInt(e[0].style.left)
}
else {
return e[0].style.pixelLeft
}
}
return 0
}
function _cGY(fN,t)
{
var e
e=_cAT(fN,t,1)
if(e&&e[0]){
if(_NS4){
return e[0].pageY
}else if(_NN){
return parseInt(e[0].style.top)
}
else {
return e[0].style.pixelTop
}
}
return 0
}
function _cGW(fN,t)
{
var e
e=_cAT(fN,t,1)
if(e&&e[0]){
if(_NS4){
return e[0].clip.width
}else if(_NN){
return parseInt(e[0].style.width)
}
else {
return e[0].style.pixelWidth
}
}
return 0
}
function _cGH(fN,t)
{
var e
e=_cAT(fN,t,1)
if(e&&e[0]){
if(_NS4){
return e[0].clip.height
}else if(_NN){
return parseInt(e[0].style.height)
}
else {
return e[0].style.pixelHeight
}
}
return 0
}
function _cFW(fN)
{
var e
e=_tw.frames[fN]
if(e){
if(_NS4){
return e.innerWidth
}else if(_NN){
return e.innerWidth
}
else {
return (e.document&&e.document.body)?e.document.body.offsetWidth:0
}
}
return 0
}
function _cFH(fN)
{
var e
e=_tw.frames[fN]
if(e){
if(_NS4){
return e.innerHeight
}else if(_NN){
return e.innerHeight
}
else {
return (e.document&&e.document.body)?e.document.body.offsetHeight:0
}
}
return 0
}
function _cUU(fN,t,u,n)
{
var e
e=_tw.frames[fN]
if((!_NS4)&&e&&e.document&&(_tw.fT[fN]==t)&&(e.document.body.background!=u)){
e.document.body.background=u
}
}
function _cUP(fN,t,c,n)
{
var e
e=_tw.frames[fN]
if(e&&e.document&&(_tw.fT[fN]==t)){
e.document.bgColor=c
}
}
function _HA(ah)
{
if(ah==2)return "CENTER"
else if(ah==3)return "RIGHT"
else return "LEFT"
}
function _VA(av)
{
if(av==2)return "MIDDLE"
else if(av==3)return "BOTTOM"
else return "TOP"
}
function _RZ(){
var E,i,j,m
var pn=_GL(this.pages)
for(i=0;i<pn;i++){
this.pages[i].RZ();
}
if(this.rz==true){
var pn2=pn*2
var i,a,b,t
for(i=0;i<pn2;i++){
a=Math.floor(Math.random()*pn);
b=Math.floor(Math.random()*pn);
if(this.pages[a].nR||this.pages[b].nR)
continue
t=this.pages[a]
this.pages[a]=this.pages[b]
this.pages[b]=t
}
for(i=0;i<pn;i++){
this.pages[i].previousPage=(i>0)?this.pages[i-1]:null
this.pages[i].nextPage=(i+1<pn)?this.pages[i+1]:null
}
_tw.firstPage=this.pages[0]
}
}
function _BA(ic)
{
var s=new String()
if(_tw.baseFace){
s+='FACE="'+_tw.baseFace+'" '
}
if(_tw.baseSize){
s+='SIZE="'+_tw.baseSize+'" '
}
if(ic==true){
s+='COLOR="'+_tw.baseColor+'" '
}
return s
}
function _GL(ar)
{
return ar?ar.length:0
}
function _NV(n,v)
{
this.name=n
this.value=v
}
function _nmvlIsName(n)
{
for(i=0;i<this.list.length;i++)
if(this.list[i].name==n)return true;
return false;
}
function _nFV(n)
{
for(i=0;i<this.list.length;i++)
if(this.list[i].name==n)return this.list[i]
return null;
}
function _nG(n)
{
var nv=this.FindValue(n)
if(nv==null)return null
return nv.value
}
function _nS(n,v)
{
var nv=this.FindValue(n)
if(nv==null){
this.list[this.list.length]=new _NV(n,v)
}
else {
nv.value=v
}
}
function _NmValList()
{
this.list=new Array()
this.SetValue=_nS
this.GetValue=_nG
this.FindValue=_nFV
this.IsName=_nmvlIsName
}
function _GT(t,i)
{
var s=new String
s=t+i
return s
}
function _TO(b,p,s)
{
t=new String()
t='<TABLE BORDER='+b+' CELLPADDING='+p+' CELLSPACING='+s+' '
return t
}
function _HD()
{
if(_tw.datePicker&&(_tw.datePicker.fShown==true)){
closeCal(_tw.datePicker)
}
}
function _TopOfPage()
{
if(_NS4){
_tw.frames[_bF].scroll(0,0)
}
else if(!_NN){
_tw.frames[_bF].scrollTo(0,0)
}
else {
_tw.frames[_bF].location.hash="topContent"
}
}
function _AutoClose()
{
if((_tw)&&(_tw.cP)&&(_tw.cP[_bF]==_tw.thankYouPage)){
_tw.frames[_bF].parent.close();
}
}
function _FmE(t)
{
var i,e,s
i=t.indexOf('_',0)
if(i<0)return t
e=new String()
s=0
while(i>=0){
e+=t.substring(s,i)+'__'
s=i+1
i=t.indexOf('_',s)
}
e+=t.substring(s,t.length)
return e
}
function _MeetsFormat(v,ia,ib,ip,iu)
{
var	alphaTable
var	i
alphaTable=''
if(ia){
alphaTable+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghiklmnopqrstuvwxyz"
}
if(ib){
alphaTable+="0123456789"
}
if(ip){
alphaTable+="."
}
if(iu){
alphaTable+="_"
}
for(i=0;i<v.length;i++){
if(alphaTable.indexOf(v.charAt(i))==-1)return false
}
return true
}
function _ValidDomain(v,up)
{
var	c
var	vn
var	i
var	ip
if(v.length<1)return false
if(up==true){
ip=v.indexOf(":")
sa=v.substr((ip+1))
if(!_MeetsFormat(ip,false,true,false,false))return false
v=v.substr(0,ip)
}
vn=v.length
for(i=0;i<vn;i++){
c=v.charAt(i);
if(i==0){
if(!_MeetsFormat(c,true,true,false,false))return false
}
if(i==(vn-1)){
if(!_MeetsFormat(c,true,false,false,false))return false
}
else {
if(!_MeetsFormat(c,true,true,true,true))return false
}
}
return true
}
function LuhnCheck(str)
{
var sum=0;
var mul=1;
var strLen=str.length;
for(i=0;i<strLen;i++)
{
var digit=str.substring(strLen-i-1,strLen-i);
var tproduct=parseInt(digit,10)*mul;
if(tproduct>=10)sum+=(tproduct%10)+1;
else sum+=tproduct;
if(mul==1)mul++;
else mul--;
}
return ((sum%10)==0);
}
function _2WAYValidateNumeric(v)
{
if(!v||((v.length)&&(v.length<1)))return false
return (!isNaN(v))
}
function _2WAYValidatePhone(v)
{
var	sa,sb,phDel,i
if(!v||((v.length)&&(v.length<1)))return false
if(!isNaN(v)&&(v.length==10)&&_MeetsFormat(v,false,true,false,false)){
return true
}
phDel=new Array
phDel[0]=""
phDel[1]="-"
phDel[3]="."
if((v.charAt(0)=='(')&&(v.charAt(4)==')')){
sa=v.charAt(1);
sa+=v.charAt(2);
sa+=v.charAt(3);
if(_MeetsFormat(sa,false,true,false,false)){
sa=v.substr(5)
if(sa&&(sa.length)&&(sa.length==7)&&(_MeetsFormat(sa,false,true,false,false))){
return true
}
for(i=0;i<phDel.length;i++){
sb=sa.split(phDel[i])
if(sb&&(sb.length)&&(sb.length==2)&&
(sb[0])&&(sb[0].length)&&(sb[0].length==3)&&(_MeetsFormat(sb[0],false,true,false,false))&&
(sb[1])&&(sb[1].length)&&(sb[1].length==4)&&(_MeetsFormat(sb[1],false,true,false,false))
){
return true
}
}
}
return false
}
for(i=0;i<phDel.length;i++){
sa=v.split(phDel[i])
if(sa&&sa.length&&(sa.length==3)){
if(sa[0]&&(sa[0].length)&&(sa[0].length==3)&&(_MeetsFormat(sa[0],false,true,false,false))&&
sa[1]&&(sa[1].length)&&(sa[1].length==3)&&(_MeetsFormat(sa[1],false,true,false,false))&&
sa[2]&&(sa[2].length)&&(sa[2].length==4)&&(_MeetsFormat(sa[2],false,true,false,false))){
return true
}
}
}
return false
}
function _2WAYValidateEmail(s)
{
if((s==null)||!s.length||!s.indexOf)return false;
var at="@"
var dot="."
var lat=s.indexOf(at)
var ls=s.length-1
var ldot=s.indexOf(dot)
if(lat==-1||lat==0||lat==ls)return false
if(ldot==-1||ldot==0||ldot==ls)return false
if(s.indexOf(at,(lat+1))!=-1)return false
if(s.substring(lat-1,lat)==dot||s.substring(lat+1,lat+2)==dot)return false;
if(s.indexOf(dot,(lat+2))==-1)return false;
if(s.indexOf(" ")!=-1)return false
return true
}
function _2WAYValidateZipCode(v)
{
var	sa
if(!v||((v.length)&&(v.length<1)))return false
if(!isNaN(v)&&(v.length==5)){
return true
}
sa=v.split("-")
if((sa)&&(sa.length)&&(sa.length==2)){
if(!isNaN(sa[0])&&(sa[0].length==5)&&!isNaN(sa[1])&&(sa[1].length==4)){
return true
}
}
return false
}
function _2WAYValidateDate(v)
{
var	sa
var	dtDel
var	i
if(!v||((v.length)&&(v.length<1)))return false
dtDel=new Array(2)
dtDel[0]="/"
dtDel[1]="-"
for(i=0;i<dtDel.length;i++){
sa=v.split(dtDel[i])
if((sa)&&(sa.length)&&(sa.length==3)){
if(sa[0]&&(sa[0].length)&&((sa[0].length==1)||(sa[0].length==2))&&
sa[1]&&(sa[1].length)&&((sa[1].length==1)||(sa[1].length==2))&&
sa[2]&&(sa[2].length)&&(sa[2].length==4)&&
(_MeetsFormat(sa[0],false,true,false,false))&&
(_MeetsFormat(sa[1],false,true,false,false))&&
(_MeetsFormat(sa[2],false,true,false,false))
){
return true
}
}
}
return false
}
function _2WAYValidateCreditCard(v)
{
var	fr,vn
if(!v||((v.length)&&(v.length<1)))return false
if(!_MeetsFormat(v,false,true,false,false))return false
if(LuhnCheck(v)==false)return false
fr=((v.length==16)||(v.length==13))&&(v.charAt(0)=="4")
if(fr==true)return true
vn="47";
fr=(v.length==15)&&(v.charAt(0)=="3")&&(vn.indexOf(v.charAt(1))>=0);
if(fr==true)return true
vn="12345";
fr=(v.length==16)&&(v.charAt(0)=="5")&&(vn.indexOf(v.charAt(1))>=0);
if(fr==true)return true
fr=(v.length==16)&&(v.substr(0,4)=="6011");
if(fr==true)return true
vn="068";
fr=(v.length==14)&&(v.charAt(0)=="3")&&(vn.indexOf(v.charAt(1))>=0);
if(fr==true)return true
return false
}
function _AssociateKeyEventHandlers()
{
if(_NN){
_tw.frames[_bF].document.onkeydown=_NSKeyHandler;
}
else {
_tw.frames[_bF].document.onkeydown=_IEKeyHandler;
}
}
function _IEKeyHandler(){
if(_tw.frames[_bF].event&&_tw.frames[_bF].event.keyCode==8){
var name=_tw.frames[_bF].event.srcElement.name;
if(name!=null){
if(name.substr(0,2)=="qr"){
var resp
resp=eval(name);
if(resp&&(resp.GetType)&&(resp.GetType()==3)){
return true;
}
}
}
_tw.frames[_bF].event.cancelBubble=true;
_tw.frames[_bF].event.returnValue=false;
return false;
}
return true;
}
function _NSKeyHandler(e){
if(e&&e.which==8){
var name=e.target.name;
if(name!=null){
if(name.substr(0,2)=="qr"){
var resp
resp=eval(name);
if(resp&&(resp.GetType)&&(resp.GetType()==3)){
return true;
}
}
}
return false;
}
return true;
}
function _FormSubmit(f)
{
if(_tw.submitURL){
f.action=_tw.submitURL+"?"
}
else {
f.action=_tw.paths.ss+"?"
}
return true
}
function _TopLevelFramePrefix()
{
if(_topLevelPage==true){
return ""
}
else {
return "parent."
}
}
