// Used to allow only digits in a textbox control
function Digits(evt){evt = (evt) ? evt : window.event;var charCode = (evt.which) ? evt.which : evt.keyCode;if (charCode > 31 && (charCode < 48 || charCode > 57))return false;return true;}
function ClearField(cntrl){if(cntrl.value == 'Zip Code')cntrl.value = '';}
function FillField(cntrl){if(cntrl.value == '')cntrl.value = 'Zip Code';}
// Zip Help Popup
//function findZip(Frm,tZip,st,city,theme) { window.open('/scripts/zip.aspx?fm=' + Frm + '&tzip=' + tZip + '&st=' + st + '&city=' + city + '&t=' + theme, 'zhelp', 'height=' + 300 + ',width=' + 500 + ',top=' + ((screen.height) ? (screen.height - 270) / 2 : 0) + ',left=' + ((screen.width) ? (screen.width - 500) / 2 : 0) + ',scrollbars=no'); }
function findZip(Frm, tZip, st, city, theme) { var pgHeight = 0; if (self.innerHeight) { pgHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { pgHeight = document.documentElement.clientHeight; } else if (document.body) { pgHeight = document.body.clientHeight; } if (document.body.offsetHeight > pgHeight) { pgHeight = document.body.offsetHeight; } var divBg = document.createElement("div"); divBg.id = "dvBG"; divBg.className = "dvbg"; divBg.style.width = '100%'; divBg.style.height = pgHeight + 'px'; divBg.style.position = 'absolute'; document.body.appendChild(divBg); var point = window.center({ width: 458, height: 180 }); var dvZip = document.createElement("div"); dvZip.id = "dvZip"; dvZip.style.background = "#ffffff"; dvZip.style.border = "4px solid #cccccc"; dvZip.innerHTML = '<iframe src="/zip.aspx?fm=' + Frm + '&tzip=' + tZip + '&st=' + st + '&city=' + city + '&t=' + theme + '" width="320" height="200" frameborder="0" scrolling="auto" bgcolor="#ffffff" />'; dvZip.className = "dvzip"; dvZip.style.top = point.y + "px"; dvZip.style.left = point.x + "px"; dvZip.style.position = 'absolute'; document.body.appendChild(dvZip); }
// Returns the size of the browser window based on the browser and its mode.
window.size = function () { var w = 0; var h = 0; if (!window.innerWidth) { if (!(document.documentElement.clientWidth == 0)) { w = document.documentElement.clientWidth; h = document.documentElement.clientHeight; } else { w = document.body.clientWidth; h = document.body.clientHeight; } } else { w = window.innerWidth; h = window.innerHeight; } return { width: w, height: h }; }
// Returns top & left position required to center a div tag in a browser window.
window.center = function () { var hWnd = (arguments[0] != null) ? arguments[0] : { width: 0, height: 0 }; var _x = 0; var _y = 0; var offsetX = 0; var offsetY = 0; if (!window.pageYOffset) { if (!(document.documentElement.scrollTop == 0)) { offsetY = document.documentElement.scrollTop; offsetX = document.documentElement.scrollLeft; } else { offsetY = document.body.scrollTop; offsetX = document.body.scrollLeft; } } else { offsetX = window.pageXOffset; offsetY = window.pageYOffset; } _x = ((this.size().width - hWnd.width) / 2) + offsetX; _y = ((this.size().height - hWnd.height) / 2) + offsetY; return { x: _x, y: _y }; }
