var thankYouWin = null; var loginWin = null; Ext.QuickTips.init(); /*** Get center position of Browser ***/ var winw = "400"; //############# How wide should your window be (pixels) var winh = "300"; //############# How tall should the window be (pixels) var ie=(document.all); var ns=(document.layers); var ns6=(document.getElementById && !ie); function centerElement(){ return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body } /*** Popup for Login form ***/ var loginWin; loginWin = new Ext.Window({ el:'login-win', layout:'fit', width:300, height: 250, closeAction:'hide', plain: true, items: new Ext.TabPanel({ el: 'login-tabs', autoTabs:true, activeTab:0, deferredRender:false, border:false }), buttons: [{ text: 'Login', handler: function(){ submitLoginForm(); } },{ text: 'Cancel', handler: function(){ loginWin.hide(); } }] }); /* * Login Form Popup. */ function showLoginForm() { try { document.getElementById("sessLogMsg").innerHTML = ""; } catch(e) {} try { document.modifyForm.pwd.value = ""; } catch(e) {} if (ie){ documentWidth = (centerElement().offsetWidth)/2+centerElement().scrollLeft-(winw/2); documentHeight = (centerElement().offsetHeight)/2+centerElement().scrollTop-(winh/2); } else if (ns){ documentWidth=window.innerWidth/2+window.pageXOffset-(winw/2); documentHeight=window.innerHeight/2+window.pageYOffset-(winh/2); } else if (ns6){ documentWidth=self.innerWidth/2+window.pageXOffset-(winw/2); documentHeight=self.innerHeight/2+window.pageYOffset-(winh/2); } try { loginWin.setPosition( documentWidth,documentHeight ); } catch(e) {} try { loginWin.show(); } catch(e) {} } /* * Validate Login Form. */ function submitLoginForm() { var valForm = false; var email = ""; valForm = validateBrokerLoginForm(); if(valForm) { try { email = document.modifyForm.userName.value; } catch(e) {} setCookieBroker(email); try { document.getElementById("sessLogMsg").innerHTML = "Please Wait... "; } catch(e) {} setTimeout("submitBorrowerForm()","100"); } } /* * Check and Submit Login Form. */ function submitBorrowerForm() { var xmlDoc = ""; var email = ""; var pwd = ""; var status = 0; var msg = ""; var uType = ""; try { email = document.modifyForm.userName.value; } catch(e) {} try { pwd = document.modifyForm.pwd.value; } catch(e) {} var url = "checkBrokerLogin.php"; var qstr = "email="+email+"&pwd="+pwd; try { xmlDoc = getXMLDoc(url,qstr); } catch(e) {} try { status = xmlDoc.getElementsByTagName("status")[0].firstChild.nodeValue; } catch (e) {} try { msg = xmlDoc.getElementsByTagName("msg")[0].firstChild.nodeValue; } catch (e) {} if(status == 1) { document.modifyForm.submit(); } else { try { document.getElementById("sessLogMsg").innerHTML = msg; } catch(e) {} } } /* * To Set URL in session. */ function updateSessMsg(sessQstr) { var xmlDoc = ""; var email = ""; var uType = "br"; var msg = ""; var url = "updateSessionVariables.php"; var qstr = "qstr="+sessQstr; try { xmlDoc = getXMLDoc(url,qstr); } catch(e) {} try { status = xmlDoc.getElementsByTagName("msg")[0].firstChild.nodeValue; } catch (e) {} showLoginForm(); } function forgotPwd() { if(isEmailOk('modifyForm','userName')) { try { document.getElementById("sessLogMsg").innerHTML = "Please Wait... "; } catch(e) {} setTimeout("sendBorrowerPwd()","100"); } } function sendBorrowerPwd() { var xmlDoc = ""; var email = ""; var uType = "br"; var msg = ""; try { email = document.modifyForm.userName.value; } catch(e) {} var url = "forgotPwdXML.php"; var qstr = "email="+email+"&uType="+uType; try { xmlDoc = getXMLDoc(url,qstr); } catch(e) {} try { msg = xmlDoc.getElementsByTagName("msg")[0].firstChild.nodeValue; } catch (e) {} try { document.getElementById("sessLogMsg").innerHTML = msg; } catch(e) {} } function hideProgressBar(divId) { try { document.getElementById(divId).style.display = "none"; } catch(e) {} } function showProgressBar(divId) { try { document.getElementById(divId).style.display = "bllock"; } catch(e) {} } function validateBrokerLoginForm() { if(isBlank('modifyForm','userName')&& isBlank('modifyForm','pwd')) { return true; } else { return false; } }