jQuery(document).ready(function() {
    /* fix the z-index stacking order for crappy browser known as IE7 */
	jQuery(function() {
    	var zIndexNumber = 5000;
    	jQuery('div').each(function() {
    		jQuery(this).css('zIndex', zIndexNumber);
    		zIndexNumber -= 10;
    	});
    });
	/* end z-index fix */
	/* preload images - not jquery just plain js */
	var img01 = new Image();
	var img02 = new Image();
	var img03 = new Image();
	var img04 = new Image();
	var img05 = new Image();
	var img06 = new Image();	
	img01.src="/dimages/jll09/gift-cards-over.gif";
	img02.src="/dimages/jll09/mall-mail-over.gif";
	img03.src="/dimages/jll09/on-sale-today-over.gif";
	img04.src="/dimages/jll09/daily-deals-over.gif";
	img05.src="/dimages/jll09/hanover-birthday-club-over.gif";
	img06.src="/dimages/jll09/artspace-Macon-over.gif";	
	/* end preload images */
    /* footer resize */
    /* throttles the number of requests that can come through at once, clears any existing timeouts */
    var THROTTLED = {};
    throttle = function(key, timeout, callback) {
    	clearTimeout( THROTTLED[key] );
    	var context = document;
    	if ( arguments.length == 4 ) {
    		context = arguments[2];
    		callback = arguments[3];
    	}
    	THROTTLED[key] = setTimeout(function() {
    		callback.call(context);
    	}, timeout);
    };
    /* function for handling the footer size on inital document load and on document resize */
    jQuery(function(){
        jQuery('#footer').css({'min-height':( (jQuery(document).height()) - (jQuery('#content-area').height()) - (36) )+'px'});
        jQuery(window).resize(function(){
            throttle('footerResize', 250, function(){
                // for some reason jQuery(window) works better when resizing to a smaller window
                jQuery('#footer').css({'min-height':( (jQuery(window).height()) - (jQuery('#content-area').height()) - (36) )+'px'});
            });
        });
    });
    /* end footer resize */
});// end document ready function