function switchEmailViewTo(showIt, hideIt){ try { var showEl = document.getElementById(showIt + "-Div"); var hideEl = document.getElementById(hideIt + "-Div"); showEl.style.display = "block"; hideEl.style.display = "none"; }catch(error){ alert(error.message); } } function switchEmailViews(txtElName, htmlElName){ try { var txtEl = document.getElementById(txtElName + "-Div"); var htmlEl =document.getElementById(htmlElName + "-Div"); if(txtEl.style.display=="none"){ txtEl.style.display = "block"; htmlEl.style.display="none"; } else { txtEl.style.display = "none"; htmlEl.style.display="block"; } } catch(error){ alert(error.message); } } function add(el){ var select1 = document.getElementById(el + '_opt'); var select2 = document.getElementById(el + '_val'); for(i=select1.options.length-1;i>0;i--){ if(select1.options[i].selected){ select2.options[select2.options.length] = new Option(select1[i].text,select1[i].value); select1.options[i] = null; } } rehash(el); } function remove(el){ var select1 = document.getElementById(el + '_opt'); var select2 = document.getElementById(el + '_val'); for(i=select2.options.length-1;i>0;i--){ if(select2.options[i].selected){ select1.options[select1.options.length] = new Option(select2[i].text,select2[i].value); select2.options[i] = null; } } rehash(el); } function rehash(el){ var str = ""; var hide = document.getElementById(el); var val = document.getElementById(el + '_val'); for(i=1;i < val.options.length;i++){ str += val[i].value; if(i < val.options.length-1) str += ","; } //alert(str); hide.value = str; } function popUpDg(idEl, valEl, pageName, className){ var popUp = open(pageName + "?RunSearch=true&popUpClass=" + className + "&FieldName=" + idEl.name, "popUp", "scrollbars=1,toolbars=0,width=450height=600"); } function del(id){ return document.getElementById(id); } function getRequestOpts(reqStr){ if(reqStr.indexOf(",")==-1) { reqArry = new Array(); reqArry[0] = reqStr; } else { reqArry = reqStr.split(","); } var qs = ""; for(i=0; i < reqArry.length; i++){ if(reqArry[i]!=""){ var el = document.getElementById(reqArry[i]); if(el){ try { var elValue = ""; if(el.name != ""){ if(el.type == "select") { elValue = el.options[el.options.selectedIndex].value; } else if(el.type == "text") { elValue = el.value; } else if(el.type == "radio"){ if(el.length){ for(x=0; x < el.length; x++){ if(el[x].checked){ elValue = el[x].value; } } } else { elValue = el.value; } } else if(el.type == "checkbox"){ if(el.checked){ elValue = el.value; } } else { elValue = el.value; } if(elValue!=""){ qs += '&'; qs += el.name + '=' + escape(elValue); } } } catch(error){ alert("Error loading value for " + reqArry[i] + " : " + error.msg); } } else { alert("Trying to gather field: " + reqArry[i] + "; not found"); } } } //alert(qs); return qs; } function buildQueryString(theFormName) { if(theFormName=='') return ''; theForm = document.getElementById(theFormName); var qs = '' for (e=0; e < theForm.elements.length;e++) { if (theForm.elements[e].name!='') { qs+='&'; qs+=theForm.elements[e].name+'='+escape(theForm.elements[e].value) } } return qs; } function createIFrame(name){ // create the IFrame and assign a reference to the // object to our global variable IFrameObj. // this will only happen the first time // callToServer() is called try { var tempIFrame=document.createElement('iframe'); tempIFrame.setAttribute('id',name); tempIFrame.style.border='0px'; tempIFrame.style.width='0px'; tempIFrame.style.height='0px'; tempIFrame.document.domain="e1003.thinkhomeloan.com"; IFrameObj = document.body.appendChild(tempIFrame); if (document.frames) { // this is for IE5 Mac, because it will only // allow access to the document object // of the IFrame if we access it through // the document.frames array IFrameObj = document.frames[name]; } } catch(exception) { // This is for IE5 PC, which does not allow dynamic creation // and manipulation of an iframe object. Instead, we'll fake // it up by creating our own objects. iframeHTML = '\<' + 'iframe id="RSIFrame" style="'; iframeHTML += 'border:0px;'; iframeHTML += 'width:0px;'; iframeHTML += 'height:0px;'; iframeHTML += '"><\/iframe>'; document.body.innerHTML += iframeHTML; IFrameObj = new Object(); IFrameObj.document = new Object(); IFrameObj.document.location = new Object(); IFrameObj.document.location.iframe = document.getElementById('RSIFrame'); IFrameObj.document.location.replace = function(location) { this.iframe.src = location; } } } function remote(call, request){ var IFrameObj = document.getElementById('remoteFrame'); // our IFrame object var IFrameDoc; try{ if (IFrameObj.contentDocument) { // For NS6 IFrameDoc = IFrameObj.contentDocument; } else if (IFrameObj.contentWindow) { // For IE5.5 and IE6 IFrameDoc = IFrameObj.contentWindow.document; } else if (IFrameObj.document) { // For IE5 IFrameDoc = IFrameObj.document; } else { return true; } } catch(error){ //createIFrame("BackupName"); alert("Error creating iframe: " + error.message); return false; } window.parent.focus(); try{ var qs = ""; if(request && request != ""){ qs = getRequestOpts(request); } if(qs.length>1500) qs = qs.substring(0, 1500); //alert("/remote?rc=" + call + qs); IFrameDoc.location.replace("/jspServ/remote.jsp?rc=" + call + qs); return false; } catch(error){ alert("Error loading iframe content: " + error.description); return false; } } function callToServer(page, form, call) { var reqArry = ""; if(form != ""){ theForm = document.getElementById(form); var qs = ""; for(i=0; i < theForm.elements.length; i++) { if (theForm.elements[i].name != "") { reqArry += theForm.elements[i].name + ","; } } } remote(call, reqArry); }