window.onload=function(){ objForm = document.forms[0]; var parentObj = ((request.browser()).indexOf("IE")==-1)?window:document; content = document.getElementById('message'); parentObj.onclick=function(event){ event = event ? event : window.event; var obj = event.target ? event.target : event.srcElement; var queryString=''; if(obj.id){ if(((obj.id).toString()).indexOf("validateUsername")!=-1){ var sendForm = true; var username = objForm.username; var birthday = objForm.birthday; var day = objForm.day; var month = objForm.month; var year = objForm.year; if((username.value).length==0){ content.style.display=''; content.innerHTML = 'Debes colocar tu nombre de usuario de ONECARE.'; sendForm = false; }else if((day.options[day.selectedIndex].value==0)||(month.options[month.selectedIndex].value==0)||(year.options[year.selectedIndex].value==0)){ content.style.display=''; content.innerHTML = 'Debes indicar tu fecha de nacimiento.'; sendForm = false; } birthday.value = (day.options[day.selectedIndex].value)+'-'+(month.options[month.selectedIndex].value)+'-'+(year.options[year.selectedIndex].value); if(sendForm){ content.style.display=''; content.innerHTML = 'Validando información, espere un momento.'; var URI = 'checkUsername.php?'+request.constructQueryString(document.forms[0])+'&sessionID='+request.sessionID(); connector.mimeType = 'text/html'; connector.loadXMLFile_0(URI,'checkUsername'); } }else if(((obj.id).toString()).indexOf("closeWindowForgot")!=-1){ document.getElementById('panel:forgot').style.display='none'; }else if(((obj.id).toString()).indexOf("closeWindowQuestion")!=-1){ //closeWindowQuestion document.getElementById('panel:question').style.display='none'; }else if(((obj.id).toString()).indexOf("forgotMyPassword")!=-1){ document.getElementById('panel:forgot').style.display=''; }else if(((obj.id).toString()).indexOf("sendToValidateQuestions")!=-1){ sendForm = true; for(var i=0;i<5;i++){ var objInput = eval('objForm.question_'+i); if((objInput.value).length==0){ sendForm = false; document.getElementById('messageError:question').style.display=''; document.getElementById('messageError:question').innerHTML = 'Debes completar todas preguntas para poder continuar.'; objInput.focus(); break; } } if(sendForm){ document.getElementById('messageError:question').style.display=''; document.getElementById('messageError:question').innerHTML = 'Validando preguntas por favor espere un momento...'; var URI = 'checkQuestions.php?'+request.constructQueryString(document.forms[0])+'&sessionID='+request.sessionID(); connector.mimeType = 'text/html'; connector.loadXMLFile_0(URI,'checkQuestions'); } }else if(((obj.id).toString()).indexOf("send")!=-1){ var sendForm = true; var username = objForm.username; var birthday = objForm.birthday; var day = objForm.day; var month = objForm.month; var year = objForm.year; if((username.value).length==0){ content.style.display=''; content.innerHTML = 'Debes colocar tu nombre de usuario de ONECARE.'; sendForm = false; }else if((day.options[day.selectedIndex].value==0)||(month.options[month.selectedIndex].value==0)||(year.options[year.selectedIndex].value==0)){ content.style.display=''; content.innerHTML = 'Debes indicar tu fecha de nacimiento.'; sendForm = false; } birthday.value = (day.options[day.selectedIndex].value)+'-'+(month.options[month.selectedIndex].value)+'-'+(year.options[year.selectedIndex].value); if(sendForm){ content.style.display=''; content.innerHTML = 'Validando información, espere un momento.'; var URI = 'checkUsername.php?'+request.constructQueryString(document.forms[0])+'&sessionID='+request.sessionID(); connector.mimeType = 'text/html'; connector.loadXMLFile_0(URI,'checkUsername'); } } } } }