/**
 * Madison.com jQuery Light Window
 *   
 * To use it:
 *   - <script src="/path/to/jquery.js"></script>
 *   - <script src="/path/to/jquery.lightWindow.js"></script>
 *   - In your HTML:
 *      * Include your light window CSS (Example: http://new.madison.com/ 
 *      * In your <script>: $('<div>This is in a lightwindow.</div><div>Aww yeah!</div>').lightwindow();
 *   
 * Brent Theisen <btheisen@madison.com>
 * 
 */
jQuery.fn.lightWindow = function(options) {
	var defaultOptions = {
		toggleEffect: 'slow'
	};
	options = jQuery.extend(defaultOptions, options);
	
	// Add Light Window container HTML
	if(jQuery('#LightWindow').length == 0) {
		jQuery('body').prepend('<div id="LightWindow"><div class="Close"></div><div class="Top"></div><div class="Content"></div><div class="Bottom"></div></div>');
	
		jQuery('#LightWindow > .Close').click(function(e) {
			jQuery(this).parent().hide(options.toggleEffect);
		});
	}

	jQuery('#LightWindow:visible').hide(options.toggleEffect);
	jQuery('#LightWindow > .Content').html(this);
	jQuery('#LightWindow').show(options.toggleEffect);
	
	return this;
};

