function changeMailServer(frm, blnChangeOnly, blnClearStatusOnly) { if(blnClearStatusOnly) { frm.userid.style.backgroundColor = ''; return; } // Non-Google ISPs: var aMailServers = new Array(); aMailServers["doupal.cz"] = "https://mail.ignum.cz/login.cgi"; var strRequestedAccount = String(frm.userid.value); var strRequestedDomain = strRequestedAccount.replace(/^.*@/, ''); // Invalid email/account name? if(strRequestedAccount.replace(/[^@]/g,'').length != 1 || strRequestedAccount.replace(/[a-z0-9_@\.+-]/gi,'').length != 0) { if(strRequestedAccount == '') frm.userid.style.backgroundColor = ''; else frm.userid.style.backgroundColor = 'pink'; return false; } frm.userid.style.backgroundColor = ''; if(typeof(aMailServers[strRequestedDomain]) != 'undefined') { frm.action = aMailServers[strRequestedDomain]; frm.passwd.disabled = false; if(blnChangeOnly) return; return true; } // Gmail or Google Apps: var strContinue; if(/^gmail\.com$/i.test(strRequestedDomain)) strContinue = 'http%3A%2F%2Fmail.google.com%2F'; else strContinue = 'http%3A%2F%2Fmail.google.com%2Fa%2F' + strRequestedDomain + '%2F'; frm.passwd.value = ''; frm.passwd.disabled = true; window.location.href = "https://accounts.google.com/AccountChooser?continue=" + strContinue + "&service=mail&Email=" + strRequestedAccount; return false; }