var nicheGuideWin = null; function submitSupprotedLenders() { var lenVal = ""; var selectedNiche = ""; var tempNiche = ""; getLenderType('supportedLenderForm','lenType','lenderTypeValue'); if(isBlank('supportedLenderForm','lenderTypeValue')) { try { tempNiche = document.supportedLenderForm.nicheValues.value; document.supportedLenderForm.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) { return true; } else { return false; } } else { return true; } } else { return false; } } function hideDivProgress() { document.getElementById("divLoader").style.display = "none"; } function showDivProgress() { try { document.getElementById("divLoader").style.display="block"; } catch(e) {} } function showLinks() { qstr = "supportedLenders.php?lenType="+lenderType+"&st="+appStates+"&niche="+AENiche; window.location.href="brokerLoginForm.php?qstr="+qstr; } function showUpgradeAlertMsg(){ Ext.MessageBox.confirm('', 'Please upgrade your membership status
for full access to view lender Info.
', showPg); } function showPg(btn){ if(btn == 'yes') { window.location.href= "brokerReg2.php#formTop"; } } function updatePrefLender(brokerNumber,AENumber,option) { var xmlDoc = ""; var url = ""; var qstr = ""; var status = ""; var resultMsg = ""; var sessQstr = ""; var confirmMsg = confirm("Are you sure want to add this AE as Your Preferred Lender?"); if(confirmMsg) { if(option == 'y') { if((userNumber > 0) && (brokerMembership == "B")) { showUpgradeAlertMsg(); } else { sessQstr = "supportedLenders.php?lenType="+lenderType+"&st="+appStates+"&niche="+AENiche; updateSessMsg(sessQstr); } } else if(userNumber > 0) { if(brokerMembership == "Free") { showUpgradeAlertMsg(); } else { url = "saveAsPrefLender.php"; qstr = "bn="+brokerNumber+"&an="+AENumber; xmlDoc = getXMLDoc(url,qstr); try { status = xmlDoc.getElementsByTagName("status")[0].firstChild.nodeValue; } catch(e) {} alert(status); } } } } function getLenderType(formName,fieldName,targetFld) { var len = 0; var chk = false, j=0; var selVal = "",sel = ""; try { eval("len = document."+formName+"."+fieldName+".length"); } catch(e) {} for(var i=0;i< len;i++) { var chk = false; try { eval("chk = document."+formName+"."+fieldName+"["+i+"].checked"); } catch(e) {} if(chk) { eval("sel = document."+formName+"."+fieldName+"["+i+"].value"); if(j == 0) { selVal = sel; } else { selVal += ","+ sel; } j++; } } eval("document."+formName+"."+targetFld+".value = selVal"); } function submitTLPLenderForm(){ var selectedNiche = ""; var tempNiche = ""; showDivProgress(); if(submitSupprotedLenders()) { try { tempNiche = document.supportedLenderForm.nicheValues.value; document.supportedLenderForm.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) { document.supportedLenderForm.submit(); } } else { document.supportedLenderForm.submit(); } } hideDivProgress(); } /*** Niche Guidelines Popup ***/ var myWin = null; myWin = new Ext.Window({ el:'myWindow', layout:'fit', width:950, height:550, closeAction:'hide', plain: true, defaults: {autoScroll: true}, items: new Ext.TabPanel({ el: 'myDiv', autoTabs:true, activeTab:0, deferredRender:false, border:false }), buttons: [{ text: 'Clear Fields', handler: function(){ clearAllNicheVal('nicheFilterForm'); } },{ text: 'Start Search', handler: function(){ myWin.hide(); submitTLPLenderForm(); } }] }); function showMyPopUp() { showDivProgress(); try { myWin.show('nicheBtn'); } catch(e) {} setTimeout("listNicheGuide('nicheFilterForm')", 500); } function clearAllNicheVal(formName) { var nicheCnt = 0; try { eval("nicheCnt = document."+formName+".nicheGuideCnt.value"); } catch (e) {} for(var n=0; n 0) { allCnt = len; nichesAEArray = niche.split(','); len1 = nichesAEArray.length; try { eval("document."+formName+".nicheGuideCnt.value ="+ allCnt); } catch (e) {} np = (allCnt)/3; np = Math.floor(np); npRes = (allCnt)%4; if(npRes > 0) { np = np+1; } } for(var i=0;i 0) { display += ""; display += ""; display += ""; display += ""; display += ""; } tempGrpCnt++; if(tempGrpCnt%2 == 0) { clsBg = "class=\"clsBlue\""; } else { clsBg = "class=\"clsWhiteM\""; } display += ""; display += ""; display += ""; display += ""; display += ""; display += "
"; display += ""+nichesGroup+""; if(!allow) { if((userNumber > 0) && (brokerMembership == "B")) { display += "
"; display += ""; display += ""; display += "
"; display += ""; display += "Recommend New Niche"; display += "
"; } else { qstr = "supportedLenders.php?lenType="+lenderType+"&st="+appStates+"&niche="+AENiche; display += "
"; display += ""; display += ""; display += "
"; display += ""; display += "Recommend New Niche"; display += "
"; } } else if(allow){ display += "
"; display += ""; display += ""; display += "
"; display += ""; display += "Recommend New Niche"; display += "
"; } display += "
"; display += ""; display += ""; } tempNichesGroup = nichesGroup; tempNc++; display += ""; display += ""; if(tempNc%4 == 0) { display += ""; display += ""; } } if(tempGrpCnt > 0) { display += ""; display += "
"; display += "
"; display += " 0) { for (var j=0; j"; display += "
"; display += "
"; display += "
"; display += niche; display += " ("+nicheGrpCnt+")"; display += "
"; display += "
"; display += "
"; } document.getElementById("nicheGuideFilterDiv").innerHTML = display; hideDivProgress(); } function getNichesVal(formName, fieldName,countFld) { var nicheCnt = 0; var selectedNiche = 0; var selectedVal = 0; var chk = false; var j =0; try { nicheCnt = eval("document."+formName+"."+countFld+".value"); } catch(e) {} for(var n=0; n'; } catch (e) {} } function newNicheform(NCgroup) { var display = ""; display += "
"; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += "
"; display += "Please describe the niche you would like to add"; display += "


Niche Group
Niche
 
"; display += "
"; return display; } function openDiv(divID,imgID) { try { var displayVal = document.getElementById(divID).style.display; } catch(e) {} if(displayVal == "block") { try { document.getElementById(divID).style.display = "none"; } catch(e) {} try { document.getElementById(imgID).src = "images/icon_down.gif"; } catch(e) {} try { document.getElementById(imgID).alt = "Click to Open"; } catch(e) {} try { document.getElementById(imgID).title = "Click to Open"; } catch(e) {} } else { try { document.getElementById(divID).style.display = "block"; } catch(e) {} try { document.getElementById(imgID).src = "images/icon_up.gif"; } catch(e) {} try { document.getElementById(imgID).alt = "Click to Close"; } catch(e) {} try { document.getElementById(imgID).title = "Click to Close"; } catch(e) {} } } /*** Inaccurate Niche Popup ***/ var nicheGuideWin = null; try { nicheGuideWin = new Ext.Window({ el:'niche-win', layout:'fit', width:500, height:350, closeAction:'hide', plain: true, defaults: {autoScroll:true}, items: new Ext.TabPanel({ el: 'niche-tabs', autoTabs:true, activeTab:0, deferredRender:false, border:false }) }); } catch(e) {} function showInaccuratePopup(Company,companyId) { var winw = "500"; var winh = "350"; 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 { nicheGuideWin.setPosition( documentWidth,documentHeight ); } catch(e) {} try { nicheGuideWin.show('inaccurateNiche'); } catch(e) {} setTimeout("inaccurateNicheForm('"+Company+"','"+companyId+"')","100"); } function inaccurateNicheForm(Company,companyId) { var display = "",nicheVal = "",brokerEmail= "",niche = 0; var infoArray = new Array(),len =0; try { niche = document.supportedLenderForm.nicheValues.value; } catch(e) {} var url = "getNicheValue.php"; qstr = "bn="+tempBrokerNumb+"&niche="+niche; try { xmlDoc = getXMLDoc(url,qstr); } catch(e) {} try { infoArray = xmlDoc.getElementsByTagName("nicheList"); } catch (e) {} len = infoArray.length; if(len > 0) { try { brokerEmail = xmlDoc.getElementsByTagName("brokerEmail")[0].firstChild.nodeValue; } catch(e) {} try { nicheVal = xmlDoc.getElementsByTagName("nicheVal")[0].firstChild.nodeValue; } catch(e) {} } display += "
"; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += ""; display += "
Niche Selected: "+nicheVal+"
Company: "+replaceInaccurateProcessString(Company)+"
Your Email: "+brokerEmail+"
Explanation:
 
"; display += "
"; document.getElementById("newNicheGuide").innerHTML = display; } function sendInaccurateEmail(nicheVal,companyId) { var status = "";var nicheNo = 0; var qstr = "",nicheExpln = ""; try { nicheExpln = document.inaccurateNicheForm.nicheExpln.value; nicheExpln = processNicheString(nicheExpln); } catch(e) {} try { nicheNo = document.supportedLenderForm.nicheValues.value; } catch(e) {} var url = "inaccurateNiche.php"; qstr = "cId="+companyId+"&nicheNo="+nicheNo+"&niche="+nicheVal+"&bn="+tempBrokerNumb+"&nicheExpln="+nicheExpln; try { xmlDoc = getXMLDoc(url,qstr); } catch(e) {} try { status = xmlDoc.getElementsByTagName("status")[0].firstChild.nodeValue; } catch (e) {} try { document.getElementById("newNicheGuide").innerHTML = '

'+status+'

'; } catch (e) {} }