var icon={
	formularie:{
		init:function(){
			Forms.objForm=document.getElementById("frmIcon");
			document.getElementById("frmIcon").onsubmit=function(){return Forms.validity();};
			document.getElementById("txtName").focus();
			document.getElementById("divEmail").innerHTML="";	
			document.getElementById("btnBack").onclick=function(){window.location.href='wl.php';};
		},
		initVerify:function(){
			var hf=document.getElementById("hfVerify");
			var divEmail=document.getElementById("divEmail");
			var email=document.getElementById("txtEmail").value;
			
			document.getElementById("divEmail").innerHTML="";
			hf.value="";
		},
		VerifyEmail:function (){
			try{
					var email=document.getElementById("txtEmail").value;
					var hf=document.getElementById("hfVerify");
					var divEmail=document.getElementById("divEmail");
					document.getElementById("divEmail").innerHTML="";hf.value="";
					if(email!=""){document.getElementById("divEmail").innerHTML="<img src='images/spinner.gif' name='imgSpinner' width='16' height='16' border='0' id='imgSpinner'  />";}
					Ajax.getURL("acciones.php?valMail="+email.toString(), {
						onSubmitSuccess: function (req) {
							var res=req.responseText;
							if(res==1){
								document.getElementById("divEmail").style.color="#ff0000";
								document.getElementById("divEmail").innerHTML="<em>* El Correo Electr&oacute;nico -"+email+"- se encuentra en uso.</em>";
							}else if(res==0){
								var bEmail=Forms.isEmailAddress(document.getElementById("txtEmail"));
								if(bEmail){
									document.getElementById("divEmail").style.color="#3366cc";
									document.getElementById("divEmail").innerHTML="<em>* El Correo Electr&oacute;nico -"+email+"- se encuentra disponible.</em>";
									hf.value="1";
								}else{
									document.getElementById("divEmail").style.color="#ff0000";
									document.getElementById("divEmail").innerHTML="<em>* El Correo Electr&oacute;nico -"+email+"- es incorrecto.</em>";
								}
							}
						}
					});						
			}catch(e){alert(e.message);}
		}		
	},
	joinRow:{
		init:function(){
			document.getElementById("btnNO").onclick=function(){icon.lobby.main.go();};	
		}
	},
	recoverpassword:{
		init:function(){
			document.getElementById("txtEmail").focus();	
			Forms.objForm=document.getElementById("recmail_f");
			document.getElementById("recmail_f").onsubmit=function(){return Forms.validity();};
			document.getElementById("btnBack").onclick=function(){window.location.href="lobby.php";};
		}
	},
	lobby:{
		init:function(){
			document.getElementById("error").innerHTML="";
			Forms.objForm=document.getElementById("frmLobby");
			document.getElementById("frmLobby").onsubmit=function(){return Forms.validity();};
			document.getElementById("txtEmail").focus();
		},
		exit:function(){
			window.location.href="lobby.php?out=1";
		},
		main:{
			init:function(){
				document.getElementById("btnView").onclick=function(){icon.lobby.main.view(0);};
			},
			go:function(){
				window.location.href="view.php";
			},
			view:function(uid){
				if(uid=='0'){
					window.location.href="view.php";
				}else if(uid!=''){
					window.location.href="view.php?uid="+uid.toString();
				}
			}
		}
	}
}