var htmlWlcmText='<table border="0" width="100%" style="font-size: 12px">';htmlWlcmText+="<tr>";htmlWlcmText+='<td align="left">';htmlWlcmText+="Te hemos enviado un correo electronico para completar tu proceso de registro.<br><br>";htmlWlcmText+="Por favor, sigue las instrucciones en el correo y bienvenido a Titlani!<br>";htmlWlcmText+="</td>";htmlWlcmText+="</tr>";htmlWlcmText+="<tr>";htmlWlcmText+='<td align="left">';htmlWlcmText+="<br>Para enviar updates de Twitter desde tu celular, sigue estas las instrucciones:<br>";htmlWlcmText+="</td>";htmlWlcmText+="</tr>";htmlWlcmText+="<tr>";htmlWlcmText+='<td align="left">';htmlWlcmText+="<br>";htmlWlcmText+='<ul style="list-style-type: circle; margin-left: 10px; margin-right: 10px; font-size: 11px">';htmlWlcmText+="<li><b>Recuerda:</b> El primer paso es autorizar el accesso de Titlani a tu cuenta de Twitter.<br>";htmlWlcmText+=" Selecciona la opci&oacute;n de <b>Autorizaci&oacute;n</b> bajo el men&uacute; de <b>Twitter</b><br></li>";htmlWlcmText+="<li><b>Updates:</b>  Envia tu update al n&uacute;mero de Titlani (551384-0949).<br>";htmlWlcmText+="Por ejemplo:<br><br><center><strong>voy a llegar tarde!</strong><br></center><br></li>";htmlWlcmText+="<li><b>Retweets:</b>  Envia la palabra <strong>RT</strong> al n&uacute;mero de Titlani (551384-0949) seguida del texto que deseas reenviar.<br>";htmlWlcmText+="Por ejemplo:<br><br><center><strong>rt @usuario: voy a llegar tarde!</strong><br></center><br></li>";htmlWlcmText+="<li><b>Mensajes Directos:</b>  Envia la letra <strong>D</strong> seguida del nombre del usuario al que envias el mensaje directo y del texto que le quieras enviar.<br>";htmlWlcmText+="Por ejemplo:<br><br><center><strong>d usuario Hola! voy en camino</strong></center><br>";htmlWlcmText+="<center><strong>d @usuario Hola! voy en camino</strong></center><br></li>";htmlWlcmText+="<li><b>Replies:</b>  Envia el nombre del usuario, comenzando con @, <strong>@usuario</strong> seguida del texto de tu respuesta.<br>";htmlWlcmText+="Por ejemplo:<br><br><center><strong>@user bien, te esperamos</strong><br></center><br></li>";htmlWlcmText+='<li><b>Nota:</b> Las mayusculas no se toman en cuenta para los nombres de los comandos.  "D", "d" son equivalentes, asi como "RT", "Rt" o "rt" son son tambien equivalentes.</li>';htmlWlcmText+="<ul>";htmlWlcmText+="</td>";htmlWlcmText+="</tr>";htmlWlcmText+="<tr>";htmlWlcmText+='<td align="left">';htmlWlcmText+="<br><br>Una vez mas, Bienvenido!";htmlWlcmText+="</td>";htmlWlcmText+="</tr>";htmlWlcmText+="</table>";var stStatsReg=new Ext.data.JsonStore({root:"Edos",totalProperty:"total",idProperty:"st_key",id:"st_key",remoteSort:false,fields:[{name:"st_key",type:"string"},{name:"st_name",type:"string"}],baseParams:{},sortInfo:{field:"st_name",direction:"ASC"},proxy:new Ext.data.HttpProxy({url:"cgi/edos_list.cgi"})});var stMnposReg=new Ext.data.JsonStore({root:"Mnpos",totalProperty:"total",idProperty:"mnpo_key",id:"mnpo_key",remoteSort:false,fields:[{name:"mnpo_key",type:"string"},{name:"mnpo_name",type:"string"}],baseParams:{},sortInfo:{field:"mnpo_name",direction:"ASC"},proxy:new Ext.data.HttpProxy({url:"cgi/edos_list.cgi"})});var tabNum=1;var pnlAccntReg={title:"Registro",id:"pnlRegister",width:420,autoHeight:true,layout:"fit",frame:true,bodyStyle:"padding: 10px;",items:[{xtype:"form",id:"frmAccntReg",labelWidth:90,frame:true,monitorValid:true,items:[{xtype:"fieldset",title:"Datos Personales",autoHeight:true,defaults:{width:210,anchor:"90%",bodyStyle:"padding: 15px;",allowBlank:false,selectOnFocus:true,blankText:"Este campo es requerido",msgTarget:"side"},items:[{fieldLabel:"Usuario",name:"user",xtype:"textfield",tabIndex:tabNum++,maxLength:10,maxLengthText:"Este campo acepta un m&aacute;ximo de 10 caracteres.",minLength:3,minLengthText:"Este campo requiere un m&iacute;nimo de 3 caracteres.",vtype:"UserName"},{fieldLabel:"Password",id:"usr_pwd1",name:"usr_pwd1",xtype:"textfield",tabIndex:tabNum++,inputType:"password",maxLength:16,maxLengthText:"Este campo acepta un m&aacute;ximo de 16 caracteres.",minLength:7,minLengthText:"Este campo requiere un m&iacute;nimo de 7 caracteres.",vtype:"alphapwd",vtypeText:"Tu password debe comenzar con una letra, puede contener letras, n&uacute;meros y los caracteres _, !, #, % y $"},{fieldLabel:"Verifica Passwd",id:"usr_pwd2",name:"usr_pwd2",xtype:"textfield",tabIndex:tabNum++,inputType:"password",vtype:"Password",PasswordText:"El password debe ser el mismo en ambos campos.",initialPassField:"usr_pwd1"},{fieldLabel:"Nombre(s)",name:"fname",xtype:"textfield",tabIndex:tabNum++,maxLength:50,maxLengthText:"Este campo acepta un m&aacute;ximo de 50 caracteres.",vtype:"alphanum"},{fieldLabel:"Apellido(s)",name:"lname",xtype:"textfield",tabIndex:tabNum++,maxLength:50,maxLengthText:"Este campo acepta un m&aacute;ximo de 50 caracteres.",vtype:"alphanum"},{fieldLabel:"N&uacute;mero Celular",name:"cell_num",xtype:"numberfield",tabIndex:tabNum++,maxLength:10,maxLengthText:"Indica s&oacute;lo los diez digitos del n&uacute;mero celular.<br><i><b>Sin incluir</b> el prefijo 044 o 045.</i>",vtype:"CellNum"},{fieldLabel:"Email",name:"email",xtype:"textfield",tabIndex:tabNum++,maxLength:50,maxLengthText:"",vtype:"email",vtypeText:"Indica una direcci&oacute;n de correo v&aacute;lida."}]},{xtype:"fieldset",title:"Datos Demogr&aacute;ficos",autoHeight:true,defaults:{width:220,anchor:"90%",msgTarget:"side"},items:[{xtype:"combo",fieldLabel:"Estado",id:"cmbEdos",store:stStatsReg,name:"state_id",hiddenName:"state_id",displayField:"st_name",valueField:"st_key",listWidth:220,tabIndex:tabNum++,typeAhead:true,forceSelection:true,allowBlank:false,blankText:"Indique un Estado",loadingText:"Buscando...",minChars:0,emptyText:"Seleccione Estado...",selectOnFocus:true,listeners:{blur:function(a){Ext.getCmp("cmbMnpos").enable()},focus:function(a){Ext.getCmp("cmbMnpos").disable()},select:function(c,b,a){if(b.id=="DF"){Ext.getCmp("cmbMnpos").emptyText="Selecciona Delegacion..."}else{Ext.getCmp("cmbMnpos").emptyText="Selecciona Municipio..."}stMnposReg.removeAll();stMnposReg.baseParams={edo:b.id};stMnposReg.reload();Ext.getCmp("cmbMnpos").reset()}}},{xtype:"combo",fieldLabel:"Deleg/Mnpo",id:"cmbMnpos",name:"county",hiddenName:"county",store:stMnposReg,tabIndex:tabNum++,bodyStyle:"padding: 25px;",listWidth:220,disabled:true,displayField:"mnpo_name",valueField:"mnpo_key",typeAhead:true,forceSelection:true,allowBlank:false,blankText:"Indica una Delegaci&oacute;n o Municipio",loadingText:"Buscando...",minChars:0,emptyText:"Selecciona Delegacion o Municipio...",selectOnFocus:true},{xtype:"radiogroup",id:"age_grp",name:"age_grp",fieldLabel:"Edad",width:220,tabIndex:tabNum++,itemCls:"x-check-group-alt",columns:[115,0.6],vertical:false,allowBlank:false,blankText:"Indica tu grupo de edad",items:[{boxLabel:"13 a 17 a&ntilde;os",name:"age_grp",inputValue:1},{boxLabel:"18 a 24 a&ntilde;os",name:"age_grp",inputValue:2},{boxLabel:"25 a 34 a&ntilde;os",name:"age_grp",inputValue:3},{boxLabel:"35 a 44 a&ntilde;os",name:"age_grp",inputValue:4},{boxLabel:"45 a 54 a&ntilde;os",name:"age_grp",inputValue:5},{boxLabel:"55 a&ntilde;os o m&aacute;s",name:"age_grp",inputValue:6}]},{xtype:"radiogroup",id:"gender",name:"gender",fieldLabel:"Sexo",tabIndex:tabNum++,itemCls:"x-check-group-alt",columns:[115,0.6],vertical:false,allowBlank:false,blankText:"Indica tu sexo",items:[{boxLabel:"M&aacute;sculino",name:"gender",inputValue:"m"},{boxLabel:"Femenino",name:"gender",inputValue:"f"}]}]}],buttons:[{text:"Guardar",formBind:true,tabIndex:9,handler:function(){if(Ext.getCmp("frmAccntReg").getForm().isValid()){Ext.Msg.show({title:"Confirmar Acci&oacute;n",msg:"Agregar nuevo usuario?",buttons:Ext.Msg.YESNO,fn:function(a,b){if(a=="yes"){Ext.getCmp("frmAccntReg").getForm().submit({url:"cgi/accnt-adm.cgi",params:{opt:1},waitTitle:"Por favor, espere...",waitMsg:"Guardando...",failure:function(c,d){if(d.failureType=="server"){obj=Ext.util.JSON.decode(d.response.responseText);Ext.MessageBox.alert("Error","Verifica los errores indicados en la forma")}else{obj=Ext.util.JSON.decode(d.response.responseText);Ext.Msg.alert("Error",obj.error)}},success:function(c,d){Ext.get("regForm").setVisible(false,"ghost");Ext.get("regForm").remove();Ext.get("regWlcm").setVisible(true,"ghost")}})}}})}}},{text:"Reset",tabIndex:10,handler:function(){Ext.Msg.show({title:"Confirmar Acci&oacute;n",msg:"&iquest;Descartar cambios?",buttons:Ext.Msg.YESNO,fn:function(a,b){if(a=="yes"){Ext.getCmp("frmAccntReg").reset()}}})}}],listeners:{afterlayout:function(b,a){},render:function(a){}}}]};var pnlAccntWlcm={title:"Bienvenido!",id:"pnlWelcome",width:600,autoHeight:true,layout:"fit",frame:true,bodyStyle:"padding: 10px;",html:htmlWlcmText};Ext.onReady(function(){Ext.BLANK_IMAGE_URL="lib/ext/resources/images/default/s.gif";Ext.QuickTips.init();Ext.form.Field.prototype.msgTarget="side";Ext.MessageBox.buttonText.yes="S&iacute;";Ext.MessageBox.buttonText.cancel="Cancelar";new Ext.Panel({id:"accntRegister",layout:"ux.center",items:{layout:"ux.center",autoScroll:true,border:false,bodyStyle:"padding: 10px;",items:[pnlAccntReg]},renderTo:"regForm"});new Ext.Panel({id:"accntWelcome",layout:"ux.center",items:{layout:"ux.center",autoScroll:true,border:false,bodyStyle:"padding: 10px;",items:[pnlAccntWlcm]},renderTo:"regWlcm"});Ext.get("loading-mask").setVisible(false,"ghost");Ext.get("loading").setVisible(false,"ghost");Ext.get("contents").setVisible(true,"ghost");Ext.get("regForm").setVisible(true,"ghost");Ext.get("regWlcm").setVisible(false,"ghost")});