var ie4 = false; var ie5 = false; var ns4 = false; var ns6 = false; var mac = false; var running = false; var timerId = null; var delay = 750; var currentMenu = null; var previousMenu = null; var currentSub = null; var previousSub = null; var pageId = null; var loaded = false; if(document.layers){origWidth=innerWidth;origHeight=innerHeight;onresize=function(){if(innerWidth!=origWidth||innerHeight!=origHeight)location.reload()}}else{onresize=function(){window.location.reload();}} function SetFocus(fieldname,formname){if (formname == ''){ formname = 'form'; }if (eval("document."+formname+".elements[fieldname].value == ''")){ eval("document."+formname+".elements[fieldname].focus();"); }} function Popup(title,filename,w,h,scroll,resizable){if (title == ''){ title = 'popup'; }if (scroll == 'scroll'){ scroll = 'yes'; }else{ scroll = 'no'; }if (resizable == 'lock'){ resizable = 'no'; }else{ resizable = 'yes'; }winOptions = eval("'width="+w+",height="+h+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scroll+",resizable="+resizable+",copyhistory=no'");filename,title,winOptions);return;} function safemail(name,domain,display) {displayed = (typeof(display) == "undefined") ? name+"@"+domain : display;document.write(''+displayed+'');} function ShowYear(){var today = new Date(); var year = today.getYear(); year += (year < 1900) ? 1900 : 0; document.write(year);} function StartTimer(event){running = true; timerId = setTimeout(event,delay);} function StopTimer(){running = false; clearTimeout(timerId);} function SetElementPosition(id,top,left){ if (ns6) { document.getElementById(id).style.top = top; document.getElementById(id).style.left = left; } else { eval(id).style.top = top; eval(id).style.left = left; } } function SetVisibility(id,flag) { if (ns6) { var str = (flag) ? 'visible' : 'hidden'; document.getElementById(id).style.visibility = str; } else { var str = (flag) ? 'visible' : 'hidden'; eval("document.all."+id).style.visibility = str; } } function getImageTop(imgID) { return getRealTop(imgID); } function getImageLeft(imgID) { return getRealLeft(imgID); } function getRealTop(imgElem) { yPos = eval(imgElem).offsetTop; tempEl = eval(imgElem).offsetParent; while (tempEl != null) { yPos += tempEl.offsetTop; tempEl = tempEl.offsetParent; } return yPos; } function getRealLeft(imgObj) { xPos = eval(imgObj).offsetLeft; tempObj = eval(imgObj).offsetParent; while (tempObj != null){ xPos += tempObj.offsetLeft; tempObj = tempObj.offsetParent; } return xPos; } function getImageWidth(id) { return document.getElementById(id).offsetWidth; } function getElementWidth(id){ return document.getElementById('menu'+id+'Div').offsetWidth; } function getElementHeight(id){ return document.getElementById('menu'+id+'Div').offsetHeight; } function layerWrite(id,text){ if (ns6){ rng = document.createRange(); el = document.getElementById(id); rng.setStartBefore(el); htmlFrag = rng.createContextualFragment(text); while (el.hasChildNodes()) el.removeChild(el.lastChild); el.appendChild(htmlFrag); } else if (ie5) { document.all[id].innerHTML = text; } } ////////////////////////////////////////// ////////////////////////////////////////// function Init(id) { SetBrowser(); LoadImages(); if (ie5 || ns6) { LoadMenus(); } pageId = id; loaded = true; } function SetBrowser() { agent = navigator.userAgent.toLowerCase(); mac = (agent.indexOf("mac")!=-1); ie4 = (document.all && !document.getElementById) ? true : false; ie5 = (document.all && document.getElementById) ? true : false; ns4 = (document.layers) ? true : false; ns6 = (document.getElementById && !document.all) ? true : false; } function LoadImages() { var num_images = 13; NavOff = new Array(num_images); for (var i=0; i 1 && menuHeight > 1){ var tempstring,writestring; tempstring = ''; writestring = (!(mac && (ie4 || ie5))) ? '
'+tempstring+'
' : tempstring; layerWrite('shadow'+i+'Div',writestring); shadowTop = menuTop + 4; shadowLeft = menuLeft + 4; SetElementPosition('shadow'+i+'Div',shadowTop,shadowLeft); } } } function Show(id) { if (running) { StopTimer(); } currentMenu = id; if (currentMenu != previousMenu && previousMenu != null) { Hide(previousMenu); } if (ie4) { eval('document.images["nav'+id+'"].src = NavOn[id].src'); } else if (ns4) { eval('document.images["nav'+id+'"].src = NavOn[id].src'); } else { eval('document.getElementById("menu'+id+'Div").style.visibility = "visible"'); eval('document.getElementById("shadow' + id + 'Div").style.visibility = "visible"'); eval('document.getElementById("nav'+id+'").src = NavOn[id].src'); } previousMenu = currentMenu; } function Hide(id) { if (id == null) { return; } if (ie4) { if (id != pageId){ eval('document.images["nav'+id+'"].src = NavOff[id].src'); } } else if (ns4) { if (id != pageId){ eval('document.images["nav'+id+'"].src = NavOff[id].src'); } } else { eval('document.getElementById("menu'+id+'Div").style.visibility = "hidden"'); eval('document.getElementById("shadow'+id+'Div").style.visibility = "hidden"'); if (id != pageId){ eval('document.getElementById("nav'+id+'").src = NavOff[id].src'); } } } function randomImage(limit) { this_image = Math.ceil(Math.random()*limit) document.write(''); } //phone format code var areacodeLength = 3; var firstThree = 3; var previousLength = null; var thisInput = null; var originalLength = null; var thisAreacode = null; var thisFirstThree = null; var thisLastFour = null; function autoFormat(input,type) { if (type == 'phone') { var addFirstParen = false; var addSecondParen = false; var addDash = false; thisInput = input.value.replace(/[. ()-\/]/gi,''); //do nothing for opening paren if (input.value.length == 1 && input.value == '(') { return true; } //dont do anything on backspace else if (input.value.length >= previousLength) { thisAreacode = thisInput.substr(0,3); thisFirstThree = thisInput.substr(3,3); thisLastFour = thisInput.substr(6,4); //add '(' if (thisInput.length > 0) { addFirstParen = true; } //add ') ' if (thisAreacode.length == areacodeLength) { addSecondParen = true; } //add '-' if (thisFirstThree.length == firstThree) { addDash = true; } //add everything, assign to field if (addFirstParen) { thisAreacode = '(' + thisAreacode; } if (addSecondParen) { thisAreacode += ') '; } if (addDash) { thisFirstThree += '-'; } input.value = thisAreacode + thisFirstThree + thisLastFour; } previousLength = input.value.length } }
Sitemap
Welcome to HomeNet Mortgage Partners