/** DialogBox static data members for configuration. */ DialogBox.titleBarBackgroundColor = '#189CCE'; DialogBox.titleBarColor = 'white'; DialogBox.titleBarFontFamily = 'Arial,Helvetica,Sans-Serif'; DialogBox.titleBarFontSize = '0.9em'; DialogBox.titleBarFontWeight = 'bold'; DialogBox.alertColor = '#040176'; DialogBox.alertFontFamily = 'Arial,Helvetica,Sans-Serif'; DialogBox.alertFontSize = '0.9em'; DialogBox.alertFontWeight = 'normal'; DialogBox.closeIcon = 'http://www.retirementjobs.com/images/dialog/closeicon.gif'; DialogBox.waitImage = 'http://www.retirementjobs.com/images/dialog/wait.gif'; DialogBox.overlayImage = 'http://www.retirementjobs.com/images/dialog/overlay.png'; DialogBox.bgcolor = 'white'; var _wait_image = new Image(); _wait_image.src = DialogBox.waitImage; /** Please don't edit anything below. */ /** Dialog Box Stack definition. */ function Stack() { this.length = 0; this.stack = new Array(); } Stack.prototype.push = function(element) { this.stack[this.length++] = element; } Stack.prototype.pop = function() { if(this.length == 0) { return null; } element = this.stack[this.length-1]; this.length -= 1; return element; } Stack.prototype.count = function() { return this.length; } Stack.prototype.peek = function() { return this.length == 0 ? null : this.stack[this.length-1]; } Stack.prototype.asArray = function() { if(!this.stack.length) { return null; } var a = new Array(); var which = 0; for(i=this.stack.length-1; i>=0; i--) { a[which] = this.stack[i]; which += 1; } return a; } /** Dialog Box constructor */ function DialogBox(width, height, content) { this.width = width; this.height = height; this.content = content; this.div = null; this.ol = null; // Hide underlying dialog box's overlay, // as appropriate, or there will be the // effect of increasingly dark overlays. if(DialogBox.stack.count() > 0) { DialogBox.stack.peek().hideOverlay(true); } // This is necessary only for IE6, so far as I know, // to remove keyboard focus from underlying DialogBox // instances. Otherwise, the blinking cursor shows // through the top level DialogBox. if(DialogBox.stack.count() > 0) { var div = DialogBox.stack.peek().getDiv(); var elements = div.getElementsByTagName('input'); for(var i=0; i=0;i--) tag[i].style.visibility=v; tag=document.getElementsByTagName('iframe'); for(i=tag.length-1;i>=0;i--)tag[i].style.visibility=v; tag=document.getElementsByTagName('object'); for(i=tag.length-1;i>=0;i--)tag[i].style.visibility=v; } DialogBox.prototype.pageWidth = function() { return window.innerWidth != null? window.innerWidth: document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth:document.body != null? document.body.clientWidth:null; } DialogBox.prototype.pageHeight = function() { return window.innerHeight != null? window.innerHeight: document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight:document.body != null? document.body.clientHeight:null; } DialogBox.prototype.resizeOverlay = function() { this.ol.style.top = '0px'; this.ol.style.left = '0px'; this.ol.style.width = document.getElementsByTagName('body')[0].scrollWidth + 'px'; this.ol.style.height= document.getElementsByTagName('body')[0].scrollHeight + 'px'; } DialogBox.prototype.remove = function() { document.getElementsByTagName('body')[0].removeChild(this.ol); document.getElementsByTagName('body')[0].removeChild(this.div); var dialog = DialogBox.stack.pop(); if(!DialogBox.stack.count()) { dialog.hideThings(false); } else { DialogBox.stack.peek().hideOverlay(false); } } DialogBox.prototype.getScrollTop = function() { var pos = 0; if(window.pageYOffset) { pos = window.pageYOffset; } else if(document.documentElement && document.documentElement.scrollTop) { pos = document.documentElement.scrollTop; } else if(document.body) { pos = document.body.scrollTop; } return pos; } DialogBox.prototype.getScrollLeft = function() { var pos = 0; if(window.pageXOffset) { pos = window.pageXOffset; } else if(document.documentElement && document.documentElement.scrollLeft) { pos = document.documentElement.scrollLeft; } else if(document.body) { pos = document.body.scrollLeft; } return pos; } DialogBox.prototype.resizeBox = function() { this.div.style.width = this.width + 'px'; this.div.style.height = this.height + 'px'; var top = this.getScrollTop(); var left = this.getScrollLeft(); left = ((this.pageWidth() - this.width)/2) + left + 'px'; this.div.style.left = left; top = ((this.pageHeight() - this.height)/2) + top + 'px'; this.div.style.top = top; } // Example DialogBox.addEvent(window, 'resize', DialogBox.resize); DialogBox.addEvent = function(obj, type, func) { if(obj.attachEvent) { obj['e'+type+func] = func; obj[type+func] = function() {obj['e'+type+func] ( window.event); } obj.attachEvent('on'+type, obj[type+func]); } else { obj.addEventListener(type, func, false); } } DialogBox.measure = function() { DialogBox.resize(null); setTimeout('DialogBox.measure()', 250); } DialogBox.measure(); // Implementation Functions function dialogBox(width, height, title, text, callback, focus) { if(!callback) { callback = 'DialogBox.close()'; } if(!title) { title = 'Dialog Box'; } box = new DialogBox(width, height); border = document.createElement('div'); border.style.border = '1px solid black'; border.style.width = '100%'; border.style.height = '100%'; border.style.backgroundColor = DialogBox.bgcolor; box.getDiv().appendChild(border); titlebar = document.createElement('div'); titlebar.style.width = '100%' titlebar.style.height = '25px'; titlebar.style.backgroundColor = DialogBox.titleBarBackgroundColor; border.appendChild(titlebar); var style = ""; style += "color:" + DialogBox.titleBarColor + ";"; style += "font-family:" + DialogBox.titleBarFontFamily + ";"; style += "font-weight:" + DialogBox.titleBarFontWeight + ";"; style += "font-size:" + DialogBox.titleBarFontSize + ";"; table = "" + "" + "" + "" + "
" + title + "" + "" + "
"; titlebar.innerHTML = table; border.innerHTML += text; /* if(focus && document.getElementById(focus)) { document.getElementById(focus).focus(); } */ } function alertBox(text, callback, title, width, height) { if(!callback) { callback = 'DialogBox.close()'; } if(!title) { title = 'Alert Message'; } if(!width) { width = 300; } if(!height) { height = 150; } var style = ""; style += "color:" + DialogBox.alertColor + ";"; style += "font-family:" + DialogBox.alertFontFamily + ";"; style += "font-weight:" + DialogBox.alertFontWeight + ";"; style += "font-size:" + DialogBox.alertFontSize + ";"; var message = "
" + "
" + text + "

" + "

"; dialogBox(width, height, title, message, callback, 'alertbox'); } // Fix for Explorer Scrolling Bug!!! Do not set styles in two places, // with class and style. Just use the css class!. function waitBox() { var style = ""; style += "color:" + DialogBox.alertColor + ";"; style += "font-family:" + DialogBox.alertFontFamily + ";"; style += "font-weight:" + DialogBox.alertFontWeight + ";"; style += "font-size:" + DialogBox.alertFontSize + ";"; var content = "
" + "
" + "One Moment Please...

" + "

 

" + "
"; squareBox(300, 125, content); } function squareBox(width, height, content, focus) { box = new DialogBox(width, height); border = document.createElement('div'); border.style.border = '1px solid black'; border.style.width = '100%'; border.style.height = '100%'; border.style.backgroundColor = DialogBox.bgcolor; border.innerHTML = content; box.getDiv().appendChild(border); //border.innerHTML = content; /* if(focus && document.getElementById(focus)) { document.getElementById(focus).focus(); } */ } function roundBox(width, height, content, focus) { var box = ""; box += ""; box += ""; box += ""; box += ""; box += ""; box += ""; box += ""; box += ""; box += ""; box += ""; box += ""; box += ""; box += ""; box += ""; box += ""; box += "
" + content + "
"; var dbox = new DialogBox(width, height); dbox.setContent(box); if(focus) { document.getElementById(focus).focus(); } }