lightbox = function(){
    return {
        initialize:function()
        {
            $$('a.lightboxOn').each(function(a){
                Event.observe(a, 'click', function(e){
                    lightbox.show(a);
                    Event.stop(e);
                });
            });
            
            $$('a.lightboxOff').each(function(a){
                Event.observe(a, 'click', function(e){
                    lightbox.hide(a);
                    Event.stop(e);            
                });
            });
        },
        show: function(a)
        {
            var lightboxId = a.rel;
            this.getScroll();
            this.prepare('auto', 'hidden');
            this.setScroll(0,0);
            Element.show('overlay');
            Element.show(lightboxId);
            var hatha = this;
            Event.observe(document.body, 'keypress', function(e){
                if(e.keyCode==Event.KEY_ESC)
                    hatha.hide(a);
            });
            
            Event.observe('overlay', 'click', function(e){                
                    hatha.hide(a);
            });                        
        },
        hide:function(a)
        {
            var lightboxId = a.rel;
            Element.hide('overlay');
            Element.hide(lightboxId);        
            this.prepare("auto", "auto");
            this.setScroll(0,this.yPos);
        },    
	    getScroll: function(){
		    if (self.pageYOffset) {
			    this.yPos = self.pageYOffset;
		    } else if (document.documentElement && document.documentElement.scrollTop){
			    this.yPos = document.documentElement.scrollTop; 
		    } else if (document.body) {
			    this.yPos = document.body.scrollTop;
		    }
	    },	
	    setScroll: function(x, y){
		    window.scrollTo(x, y); 
	    },
	    
	    prepare: function(height, overflow){
		    bod = document.getElementsByTagName('body')[0];
		    bod.style.height = height;
		    //This was causing double vertical scroll-bars
		    //bod.style.overflow = overflow;
      
		    htm = document.getElementsByTagName('html')[0];
		    htm.style.height = height;
		    htm.style.overflow = overflow; 
	    }
	}
}();

Event.observe(window,'load', function(){lightbox.initialize();});

document.write('<div id="overlay" style="display: none">&nbsp;</div>');

//How to Write a Check callout
document.write('<div class="lightbox" id="writeCheck" style="display: none">');
document.write('	<a class="lightboxOff" href="/" rel="writeCheck"><img alt="Close this window" src="/img/close.gif" border="0" /></a>');
document.write('	<div class="lightboxContent"><img hspace="0" src="/img/student/banking-101/LB_how_write_check.jpg" border="0" align="center"/></div>');
document.write('</div>');

//How to Use a Check Register callout
document.write('<div class="lightbox" id="checkRegister" style="display: none">');
document.write('	<a class="lightboxOff" href="/" rel="checkRegister"><img alt="Close this window" src="/img/close.gif" border="0" /></a>');
document.write('	<div class="lightboxContent"><img hspace="0" src="/img/student/banking-101/LB_how_use_check_reg.jpg" border="0" align="center"/></div>');
document.write('</div>');

//How to Reconcile your Account callout
document.write('<div class="lightbox" id="reconcileAccount" style="display: none">');
document.write('	<a class="lightboxOff" href="/" rel="reconcileAccount"><img alt="Close this window" src="/img/close.gif" border="0" /></a>');
document.write('	<div class="lightboxContent"><img hspace="0" src="/img/student/banking-101/LB_acct_statement.jpg" border="0" align="center"/></div>');
document.write('</div>');

//Student Tax Center callout
document.write('<div class="lightbox" id="taxCenter" style="display: none">');
document.write('	<a class="lightboxOff" href="/" rel="taxCenter"><img alt="Close this window" src="/img/close.gif" border="0" /></a>');
document.write('	<div class="lightboxContent"><img hspace="0" src="/img/student/banking-101/LB_numbers_on_checks.jpg" border="0" align="center"/></div>');
document.write('</div>');
	
