/*** 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 AE Profile (step-5)***/ 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(){ submitBrokerLoginForm(); } },{ text: 'Cancel', handler: function(){ loginWin.hide(); } }] }); function showLoginForm() { try { document.getElementById("sessLogMsg").innerHTML = ""; } catch(e) {} try { document.brokerForm.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('brokerLoginWin'); } catch(e) {} } function submitBrokerLoginForm() { var valForm = false; valForm = validateLoginForm(); if(valForm) { try { document.getElementById("sessLogMsg").innerHTML = "Please Wait... "; } catch(e) {} setTimeout("submitBrForm()","100"); } } function submitBrForm() { var xmlDoc = ""; var email = ""; var pwd = ""; var status = 0; var msg = ""; var uType = ""; try { email = document.brokerForm.userName.value; } catch(e) {} try { pwd = document.brokerForm.pwd.value; } catch(e) {} try { uType = document.brokerForm.uType.value; } catch(e) {} var url = "checkBrokerEmail.php"; var qstr = "userName="+email+"&pwd="+pwd+"&uType="+uType; 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.brokerForm.submit(); } else { try { document.getElementById("sessLogMsg").innerHTML = msg; } catch(e) {} } } function validateProductForm() { var productVal = 0; try { productVal = document.productForm.product.value; } catch(e) {} if(isBlank('productForm','product')) { window.location.href="bestRateSearch.php?product="+productVal+"#formTop"; } } function submitLenderForm(){ showProgress(); if(isBlank('sugLenderForm', 'lenderType')) { validateLenderForm(); } hideProgress(); } function validateLenderForm() { var lenderType = ""; var appStates = ""; var selectedNiche = ""; var tempNiche = ""; var len = 0; var i = 0; try { lenderType = document.getElementById("lenderType").value; } catch(e) {} try { appStates = document.getElementById("state").value; } catch(e) {} try { tempNiche = document.sugLenderForm.nicheValues.value; document.sugLenderForm.nicheValues.value = tempNiche; } catch(e) {} try { selectedNiche = document.getElementById("nicheDiv").innerHTML; } catch(e) {} if(selectedNiche == "") { selectedNiche = (selectedNiche) + (tempNiche); } if(selectedNiche == 0) { confirmMsg = confirm("Are you sure you do not want to select any Niches?"); if(confirmMsg) { window.location.href="supportedLenders.php?lenType="+lenderType+"&st="+appStates+"&niche="+selectedNiche+"#formTop"; // window.location.href="suggLenders.php?len="+lenderType+"&st="+appStates+"&niche="+selectedNiche+"#formTop"; } } else { window.location.href="supportedLenders.php?lenType="+lenderType+"&st="+appStates+"&niche="+selectedNiche+"#formTop"; // window.location.href="suggLenders.php?len="+lenderType+"&st="+appStates+"&niche="+selectedNiche+"#formTop"; } } function playAudio() { try { document.getElementById("demoAudio").innerHTML =""; } catch (e) {} } function stopAudio(divId) { var obj = ""; try { obj = document.getElementById(divId); } catch (e) {} try { obj.Stop(); } catch (e) {} } function forgotPwd() { if(isEmailOk('brokerForm','userName')) { try { document.getElementById("sessLogMsg").innerHTML = "Please Wait... "; } catch(e) {} setTimeout("sendBrokerPwd()","100"); } } function sendBrokerPwd() { var xmlDoc = ""; var email = ""; var uType = "br"; var msg = ""; try { email = document.brokerForm.userName.value; } catch(e) {} try { uType = document.brokerForm.uType.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 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) {} showLoginForm(); }