
function addUserToGrp(role) {
 AccountController.addUserToGroup(document.getElementById("roleId").value, renderMessage);
}

function viewAppsPage(){
 LoginController.paintPage('applications',paintPage);
}

function newUser(){ 
 LoginController.paintPage('registration',paintPage);
}
function quickUser(){ 
 LoginController.paintPage('quick_registration',paintPage);
}
function contactus(){ 
 LoginController.paintPage('contact',paintPage);
}

function paintPage(data) {
 document.getElementById("sbody").innerHTML=data;
}

function changePass() {
 if(document.getElementById("newPassword").value != document.getElementById("cpassword").value){
 	document.getElementById("message").innerHTML="Password and confirm password do not match";
 	return;
 } 
 var AccountletBean = {oldPassword:null,newPassword:null,userName:null,db:'',application:''};
 DWRUtil.getValues(AccountletBean);
 AccountController.changePassword(AccountletBean,renderMessage);
}

function renderMessage(data) {
 document.getElementById("message").innerHTML=data;
}



function userRegister() { 
 var RegistrationBean = {phone:null,password:null,userName:null,questionAnswer:null,email:null,middleName:null,questionNumber:null,companyName:null,firstName:null,lastName:null,application:null,companyId:null,age:null};
 DWRUtil.getValues(RegistrationBean);
 RegistrationManager.registerUser(RegistrationBean, renderRegistrationRequest);
}

function quickRegister() { 
alert('INSIDE QUICK REG1');
 var QuickRegBean = {email:null,userName:null,password:null};
 alert('INSIDE QUICK REG2');
 DWRUtil.getValues(QuickRegBean);
 alert('INSIDE QUICK REG3');
 RegistrationManager.quickRegisterUser(QuickRegBean, showMessage);
 alert('INSIDE QUICK REG4');
}

function showMessage(data) {
 document.getElementById("message").innerHTML=data;
}

function registerCompany() { 
 var RegistrationBean = {phone:null,password:null,userName:null,questionAnswer:null,email:null,middleName:null,questionNumber:null,companyName:null,firstName:null,lastName:null,application:null,companyId:null,age:null};
 DWRUtil.getValues(RegistrationBean);
 RegistrationManager.registerCompany(RegistrationBean, renderRegistrationRequest);
}

function renderRegistrationRequest(data) {
 document.getElementById("message").innerHTML=data;
}

function emailChanged() {
 document.getElementById("userName").value=document.getElementById("email").value;
}

function renderInform2(data) {
 document.getElementById("sbodyforget").innerHTML=data;
}




