var BTAG = "590036501"; var HostUri = "https://www.dreambingo.co.uk"; var Launch__LoginUri = "/login.asp"; var Launch__OLRUri = "https://www.dreambingo.co.uk/register/dreambingo.aspx?btag=590036501"; var WebOLRUri = "https://register2.valueactive.com/1555/default.asp?clienttype=5&usertype=0&BTAG=" + BTAG; var PopupWindowProperties = "width=800,height=570,status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no"; var PopupWindowProperties981 = "width=1024,height=700,status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no"; var PopupWindowProperties1555 = "width=1024,height=700,status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no"; var RegistrationPopupWindowProperties = "width=840,height=670,status=yes,toolbar=no,menubar=no,location=yes,scrollbars=yes,resizable=no"; var AccountNumberRegEx = "DBR[0-9]{8}$"; var LostPasswordUri = "/lostpassword.asp"; var WindowName__Password = "LostPasswordWindow"; var PopupWindowProperties__Password = "width=480,height=350,status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no"; var PopupWindowProperties__PasswordMS = "dialogWidth: 480px; dialogHeight: 350px; center: yes; status: no; scroll: no; resizable: no;"; var Message__NoAccNoOrPassword = "Both your Nickname and password are required to login to Bingo."; var Message__PasswordEmailSent = "An email has been sent to [SENTTO]."; var Message__PasswordNoUserName = "Please enter a Nickname."; var Message__PasswordResetComplete = "Your new password has been set."; var Message__PasswordResetFailed = "Sorry, we're unable to change your password at this time."; var Message__PasswordsDontMatch = "The passwords you have entered do not match."; var Message__LostPasswordError = "There was an unknown error requesting your password."; function loginBingo(myform) { if (! window.focus)return true; var d = new Date(); windowname = "BingoWindow1555"; var popupHandle var thisDoc setCookie("loginname", document.getElementById("Username").value, 365); popupHandle=window.open(HostUri+"/BingoShared/lobby/close.htm", windowname, PopupWindowProperties1555); myform.target=windowname; myform.focus(); myform.action=HostUri+"/BingoShared/commands/Connect.aspx"; return true; } function getXMLHttpRequest(){ // branch for native XMLHttpRequest object if(window.XMLHttpRequest) { try { req = new XMLHttpRequest(); } catch(e) { req = false; } // branch for IE/Windows ActiveX version } else if(window.ActiveXObject) { try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { req = false; } } } if(!req){ alert("Unable to load XMLHttpRequest."); } else { return req; } } function DoBackground(strImage, strField){ document.getElementById(strField).style.backgroundImage = "url(" + strImage + ")"; } function toggleViewAnswer(i){ if(eval('document.all.a' + i).style.display == 'inline'){ eval('document.all.a' + i).style.display = 'none' } else { eval('document.all.a' + i).style.display = 'inline' } } var daysInMonth = ([0,31,29,31,30,31,30,31,31,30,31,30,31]); function daysInFebruary (year) { return ( ((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0) ) ) ? 29 : 28 ); } function Age(bday, bmo, byr) { bmo = bmo - 1; var age; var now = new Date(); tday=now.getDate(); tmo=(now.getMonth()); tyr=(now.getFullYear()); if((tmo > bmo)||(tmo==bmo & tday>=bday)) { age=parseInt(byr); } else { age=parseInt(byr) + 1; } return (tyr - age) } function loadClient(CheckCookie) { if ((getCookie("loginname")=="") && (CheckCookie)) { // window.location.href = Launch__OLRUri window.open( Launch__OLRUri, "BingoRegistrationWindow", RegistrationPopupWindowProperties); } else { window.open( Launch__LoginUri, "BingoWindow1555", PopupWindowProperties1555); } } function loadClientWindow(CheckCookie) { if ((getCookie("loginname")=="") && (CheckCookie)) { window.open( Launch__OLRUri, "BingoRegistrationWindow", RegistrationPopupWindowProperties); } else { window.open( Launch__LoginUri, "BingoWindow1555", PopupWindowProperties1555); } } function accountNumberCheck() { var cookieusername = getCookie("loginname"); if (cookieusername) { document.getElementById("Username").value=cookieusername; } } function loadBingo( username, password, usesamewindow){ if (username&&password){ var xmlHttpConn = getXMLHttpRequest(); if (xmlHttpConn) { username=trim(username.toUpperCase()); var popupHandle var thisDoc if (usesamewindow==0) { try { setCookie("loginname", username, 365); popupHandle=window.open(HostUri+"/BingoShared/lobby/close.htm", "BingoWindow1555", PopupWindowProperties1555) thisDoc=popupHandle.document; thisDoc.open(); thisDoc.clear(); thisDoc.write("Loading...Loading..."); thisDoc.close(); } catch (e) { alert(e.description); } } else { thisDoc = document } //to give that last command some time to run, lets get ahead of our selves. xmlHttpConn.open("POST", HostUri+"/BingoShared/commands/connect.aspx", false); xmlHttpConn.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlHttpConn.send("username="+username+"&password="+password); var conn=eval(xmlHttpConn.responseText); if (conn.Result){ setCookie("loginname", username, 365); thisDoc.location.assign(conn.Text) } else { if (usesamewindow==0) { thisDoc.location.assign(Launch__LoginUri) popupHandle.alert(conn.Text); } else { alert(conn.Text); } } if (document.getElementById("Password")) document.getElementById("Password").value=""; return false; } else { return true; } // if (window.XMLHttpRequest) } else { alert(Message__NoAccNoOrPassword); return false; } // if (username&&password) } // function LoadBingo(username,password,usesamewindow) function openLostPassword(username){ if (BrowserDetect.browser=="Explorer") { window.showModalDialog( LostPasswordUri, null, PopupWindowProperties__PasswordMS); } else { window.open( LostPasswordUri, WindowName__Password, PopupWindowProperties__Password); } return false } var lastUsername = "" function lostPassword(form, username){ if (username){ if (lastUsername==username) { return } else { var xmlhttpReq = getXMLHttpRequest(); if (xmlhttpReq) { lastUsername=username form.disabled=true username=trim(username.toUpperCase()); xmlhttpReq.open("POST", HostUri.replace("https", "http") + "/BingoShared/commands/lostpassword.aspx", false); xmlhttpReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlhttpReq.send("username="+username); var req=eval(xmlhttpReq.responseText); if(req.Result){ alert(Message__PasswordEmailSent.replace('[SENTTO]', req.Text)); window.close(); } else { alert(req.Text); } form.disabled=false } } } else { alert(Message__PasswordNoUserName); } } function resetPassword(code, newpassword, newpassword2){ if (newpassword==newpassword2) { if (code&&newpassword){ try { var xmlhttpReset = getXMLHttpRequest(); if (xmlhttpReset){ xmlhttpReset.open("POST", HostUri+"/BingoShared/commands/resetpassword.aspx", false); xmlhttpReset.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlhttpReset.send("code="+code+"&newpassword="+newpassword); var reset=eval(xmlhttpReset.responseText); if (reset.Result==1) { alert(Message__PasswordResetComplete); window.location.href = "/"; return true; } else { alert(Message__PasswordResetFailed) return false; } } } catch (e) { //alert(e); return false; } // try } else { alert("Password can't be blank") return false; } // if (code&&newpassword) } else { alert(Message__PasswordsDontMatch); return false; } } // function resetPassword(username, newpassword) function setCookie(cookieName,value,expiredays) { var exdate=new Date(); exdate.setDate(exdate.getDate()+expiredays); document.cookie=cookieName+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString()) } function getCookie(cookieName) { var result = ""; if (document.cookie) { if (document.cookie.length>0) { cookieStart=document.cookie.indexOf(cookieName + "="); if (cookieStart != -1) { cookieStart=cookieStart + cookieName.length + 1; cookieEnd=document.cookie.indexOf(";",cookieStart); if (cookieEnd==-1) { cookieEnd=document.cookie.length; } return trim(unescape(document.cookie.substring(cookieStart,cookieEnd))); } } } return trim(result); } function trim(s) { return s.replace(/^\s+|\s+$/g,""); }