
	// Begin Background Animation
	
		// bool for keeping transitions separate
		var lock = false;
		
		var image_heights = new Array(337, 196, 543, 281, 338, 319, 427, 427, 427, 427);
		var image_pos = 0;
		var image_y = 0;
		
		var image_timer;
		
		Event.observe(window, 'load', function() { image_timer = setInterval('animate_bg()', 5000); });
		
		function animate_bg() {
			var change = image_heights[image_pos];
			
			// how tall should the resized version be
			var new_height = $('photo-bg').getHeight() + change;
		
			new Effect.Morph('photo-bg', {
				duration: change / 300,
				style: 'height: ' + new_height + 'px; top: -' + change + 'px;',
				//transition: Effect.Transitions.spring,
				transition: Effect.Transitions.sinoidal,
				afterFinish: function() {
					//var y_pos = parseInt($('photo-bg').getStyle('backgroundPosition').split(' ')[1]);
					$('photo-bg').setStyle({
						height: $('photo-bg').getHeight() - image_heights[image_pos] + 'px',
						backgroundPosition: '0 ' + (image_y - change) + 'px',
						top: 0
					});
					
					image_y -= image_heights[image_pos];
					
					// increment the position of the background
					image_pos = (image_pos == (image_heights.length - 1)) ? 0 : image_pos + 1;
				}
			});
		}
		
	// End Background Animation
	
	// Begin Stat Open/Close
		
		Event.observe(document, "dom:loaded", function() {
			$$('.stat').each(function(x) {
				x.down('div').setStyle({ top: x.down('img').getHeight() + 'px' });
				x.down('div').down('div').setStyle({ opacity: '0' });
				var arrow_pos = x.down('img').positionedOffset()[0] + (x.down('img').getWidth() / 2);
				x.down('.stat-arrow').setStyle({ left: + arrow_pos + 'px' });
			});
		
			// open or close the statistics
			$$('.stat img.stat-text').each(function(x) { x.observe('click', function() { open_stat(x); }) });
			$$('.stat div .close').each(function(x) { x.observe('click', function() { close_stat(x.up('div')); }); });
		});
		
		function open_stat(element) {
			element = $(element).next('div');
			if (!lock && element.getWidth() < 1) {
					
				// close any other open content
				close_all_open_content();
			
				// set a lock so multiple transitions don't overlap
				lock = true;
				
				// left column goes on top
				switch_depths('left');
				
				element.down('div').show();
				
				new Effect.Morph(element, {
					duration: .6,
					transition: Effect.Transitions.sinoidal,
					style: 'width: 872px;',
					afterFinish: function() {
						element.down('div').appear({ duration: .5 });
						
						// unlock for transition complete
						lock = false;
					}
				});
				
				// clear navigation selections
				navigation_select('');
			}
		}
		
		function close_stat(element) {
			var element = $(element);
			
			// fade out the individual elements and slide the box out
			new Effect.Morph(element, {
				duration: .2,
				style: 'opacity: 0',
				afterFinish: function() {
					new Effect.Morph(element.up('div'), {
						duration: .2,
						transition: Effect.Transitions.sinoidal,
						style: 'width: 0;',
						afterFinish: function() {
							element.hide();
						}
					});
				}
			});
		}
		
		function close_all_stats() {
			$$('.stat img.stat-text').each(function(x) {
				// this stat is open, close it
				if (x.next('div').getWidth() > 0) {
					close_stat(x.next('div').down('div'));
				}
			});
		}
		
	// End Stat Open/Close
	
	// Begin Page Open/Close
	
		// Page Scroll Bars
		
		var page_timer = setInterval("check_page_scroll()", 1);
		var page_scroll_up = false;
		var page_scroll_down = false;
		var page_scroll_distance = 5;
		var current_section = 0;
		var current_page = '';
		
		Event.observe(document, "dom:loaded", function() {
			$$('#content-pages .content-page .close').each(function(x) {
				x.onclick = function() { 
					close_page(this.up('.content-page').readAttribute('id'));
					return false;
				}
			});
			
			var page_count = $$('.content-pages').length;
			for (var i = 0; i < page_count; i++) {
				page_scroll_down[i] = false;
				page_scroll_up[i] = false;
			}
			
			$$('.content-page').each(function(x) {
				if (x.down('.content-arrows')) {
					x.down('.content-arrows').down('.content-scroll-up').onclick = x.down('.content-arrows').down('.content-scroll-down').onclick = function() { return false; }
					
					// up scroll
					x.down('.content-arrows').down('.content-scroll-up').onmousedown = function() { page_scroll_up = true; }
					x.down('.content-arrows').down('.content-scroll-up').onmouseup = function() { page_scroll_up = false; }
					
					// down scroll
					x.down('.content-arrows').down('.content-scroll-down').onmousedown = function() { page_scroll_down = true; }
					x.down('.content-arrows').down('.content-scroll-down').onmouseup = function() { page_scroll_down = false; }
				}
							
				if (x.down('.nav')) {
					x.down('.nav').getElementsBySelector('li a').each(function(x) {
						if (x.readAttribute('href') == '#' && x.onclick == null) {
							x.onclick = function() { 
								switch_page_content(this);
								return false;
							}
						}
					});
				}
			});
		});
		
		function switch_page_content(element) {
			element = $(element);
			current_section = element.up('li').previousSiblings().length;
			
			// hide all page and de-select nav
			element.up('ul').getElementsBySelector('li a').each(function(x) { x.removeClassName('selected'); });
			element.up('ul').previous('.content-page-mask').down('.content-page-scroller').getElementsBySelector('div').each(function(x) { x.hide(); });
			
			// show the selected page and highlight its nav item
			var position = element.up('li').previousSiblings().length;
			element.addClassName('selected');
			element.up('ul').previous('.content-page-mask').down('.content-page-scroller').getElementsBySelector('div')[position].show();
			
			$(current_page).down('.content-page-scroller').setStyle({ top: 0 + 'px' });
			
			if ($(current_page).down('.content-arrows')) {
				if ($(current_page).down('.content-page-scroller').getHeight() > $(current_page).down('.content-page-mask').getHeight())
					$(current_page).down('.content-arrows').appear({ duration: .3 });
				else
					$(current_page).down('.content-arrows').fade({ duration: .3 });
			}
		}

		function check_page_scroll() {
			if (page_scroll_up || page_scroll_down) {
				var scroller = $(current_page).down('.content-page-scroller');
				var page_mask_height = $(current_page).down('.content-page-mask').getHeight();
				var top_pos = parseFloat(scroller.getStyle('top'));
				var height = scroller.getHeight();
				var max_top = -1 * (height - page_mask_height);

				if (height > page_mask_height) {
					if (page_scroll_up) {
						if (top_pos > -page_scroll_distance) scroller.setStyle({ top: 0 + 'px' });
						else scroller.setStyle({ top: (top_pos + page_scroll_distance) + 'px'  });
					} else {
						if (top_pos < (max_top + page_scroll_distance)) scroller.setStyle({ top: max_top + 'px' });
						else scroller.setStyle({ top: (top_pos - page_scroll_distance) + 'px'  });
					}
				}
			}
		}
	
		function open_page(element, index) {
			var page = $(element).readAttribute('id').replace('-nav', '');

			if (!lock && parseFloat($(page).getStyle('top')) < 0) {
				// lock transitions
				lock = true;
	
				// close any other open content
				close_all_open_content();
				
				// highlight the navigation item
				navigation_select(page);
			
				// set the current page var
				current_page = page;
				
				// check for at least one open page - if none, open one
				if (index != undefined) {
					// hide any current pages
					$$('#' + page + ' .content-page-scroller div').each(function(x) { x.hide(); });
					$$('#' + page + ' .nav li a').each(function(x) { x.removeClassName('selected'); });
					
					$$('#' + page + ' .content-page-scroller div')[index].show();
					if ($(page).down('.nav')) {
						$$('#' + page + ' .nav li')[index].down('a').addClassName('selected');
					}
					current_section = index;
				} else if ($(page).down('.content-page-scroller')) {
					if (!$$('#' + page + ' .content-page-scroller div').any(function(x) { return x.visible(); })) {
						$$('#' + page + ' .content-page-scroller div')[0].show();
						if ($(page).down('.nav')) {
							$(page).down('.nav').down('li').down('a').addClassName('selected');
						}
						current_section = 0;
					}
				} 
				
				new Effect.ScrollTo('header', { duration: 1 });
				
				new Effect.Morph(page, {
					duration: .8,
					transition: Effect.Transitions.sinoidal,
					style: 'top:0;',
					afterFinish: function() {
						$(page).childElements().each(function(x) {
							if ((x.className == 'content-arrows' && $(current_page).down('.content-page-scroller').getHeight() > $(current_page).down('.content-page-mask').getHeight()) || x.className != 'content-arrows')
								x.appear({ duration: .5 });
						});
						
						// remove lock
						lock = false;
					}
				});
			} else if (index != undefined) {
				// linking to another section within the same page
				switch_page_content($(current_page).down('.nav').getElementsBySelector('li')[index].down('a'));
			}
		}
		
		function close_page(page) {
			// if the donation or downloads page is being closed, open the voices page
			if (page == 'make-a-donation' || page == 'downloads') open_page('voices');
			
		
			if ($(page + '-nav')) $(page + '-nav').removeClassName('selected');
			
			// fade out the page elements
			if ($(page).down('.nav')) {
				$(page).down('.nav').fade({ duration: .3 });
				$(page).down('.content-page-mask').fade({ duration: .3 });
				$(page).down('.label').fade({ duration: .3 });
				$(page).down('.close').fade({
					duration: .3,
					afterFinish: function() {
						new Effect.Morph(page, {
							duration: .4,
							transition: Effect.Transitions.sinoidal,
							style: 'top:-' + $(page).getHeight() + 'px;'
						});
					}
				});
			} else {
				new Effect.Morph(page, {
					duration: .4,
					transition: Effect.Transitions.sinoidal,
					style: 'top:-' + $(page).getHeight() + 'px;'
				});
			}
		}
		
		function close_all_pages() {
			current_page = '';
			$$('#content-pages .content-page').each(function(x) {
				if (parseFloat(x.getStyle('top')) > -577) close_page(x.readAttribute('id'));
			});
		}
		
	// End Page Open/Close
	
	// Donation Submission
	
	var email_check = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	Event.observe(document, "dom:loaded", function() {
	
		$('donate-submit').onclick = function() {
			if (!$('donation_amount').value) {
				$('donate-message').update('Please select a donation amount');
			} else if (!$('donation_fname').value) {
				$('donate-message').update('Please enter your first name');
				$('donation_fname').focus();
			} else if (!$('donation_lname').value) {
				$('donate-message').update('Please enter your last name');
				$('donation_lname').focus();
			} else if (!$('donation_email').value) {
				$('donate-message').update('Please enter your email address');
				$('donation_email').focus();
			} else if (!email_check.test($('donation_email').value)) {
				$('donate-message').update('Email address must be in name@example.com format');
				$('donation_email').focus();
			} else if (!$('donation_address').value) {
				$('donate-message').update('Please enter your address');
				$('donation_address').focus();
			} else if (!$('donation_city').value) {
				$('donate-message').update('Please enter your city');
				$('donation_city').focus();
			} else if (!$('donation_state').value) {
				$('donate-message').update('Please select your state');
			} else if (!$('donation_zip').value) {
				$('donate-message').update('Please enter your zip');
				$('donation_zip').focus();
			} else if (!$('donation_card_name').value) {
				$('donate-message').update('Please the name on your credit card');
				$('donation_card_name').focus();
			} else if (!$('donation_card_number').value) {
				$('donate-message').update('Please enter your credit card number');
				$('donation_card_number').focus();
			} else if ($('donation_card_number').value.length != 15 && $('donation_card_number').value.length != 16) {
				$('donate-message').update('Your credit card number must be 15 or 16 digits in length');
				$('donation_card_number').focus();
			} else if (!$('donation_card_month').value) {
				$('donate-message').update('Select your credit card expiration month');
			} else if (!$('donation_card_year').value) {
				$('donate-message').update('Select your credit card expiration year');
			} else {
				$('donate-message').update('Processing donation...');
				new Ajax.Request('/ajax/donate.php', {
					parameters: $('donation-form').serialize(),
					onComplete: function(transport) {
						var json = transport.responseText.evalJSON();
						if (json.code == '0') {
							$('donate-message').update(json.message);
						} else {
							// successful donation
							$('form-success').down('.title').update('donation successful!');
							$('form-success').down('.body').update("Because of people like you, we can continue spreading the word among other teens and twenty-somethings. We need to take control of our own health care and make ourselves heard! An electronic receipt of your donation has been e-mailed to you. Please remember to add \"geneff.org\" to your approved senders list.");
							$('form-success').appear({ duration: .5 });
							close_page('make-a-donation');
							
							$('form-success-close').onclick = function() {
								$(this).up('div').fade({ duration: .5 });
								return false;
							}
						}
					}
				});
			}
			return false;
		}
	});
	
	// End Donation Submission
	
	// Contact Submission
	
	Event.observe(document, "dom:loaded", function() {
	
		$('contact-submit').onclick = function() {
			if (!$('contact_fname').value) {
				$('contact-message').update('Please enter your first name');
				$('contact_fname').focus();
			} else if (!$('contact_lname').value) {
				$('contact-message').update('Please enter your last name');
				$('contact_lname').focus();
			} else if (!$('contact_email').value) {
				$('contact-message').update('Please enter your email address');
				$('contact_email').focus();
			} else if (!email_check.test($('contact_email').value)) {
				$('contact-message').update('Email address must be in name@example.com format');
				$('contact_email').focus();
			} else if (!$('contact_message').value) {
				$('contact-message').update('Please enter your message');
				$('contact_message').focus();
			} else {
				$('contact-message').update('Sending...');
				new Ajax.Request('/ajax/contact.php', {
					parameters: $('contact-form').serialize(),
					onComplete: function(transport) {
						var json = transport.responseText.evalJSON();
						if (json.code == '0') {
							$('contact-message').update(json.message);
						} else {
							// successful contact
							$('form-success').down('.title').update('your message has been sent');
							$('form-success').down('.body').update("Thank you for contacting <b>gen eff</b>. We have received your request and will respond to you shortly. To ensure our reply is received, please remember to add \"geneff.org\" to your approved senders list.");
							$('form-success').appear({ duration: .5 });
							$('contact-message').update('');
							$('contact-form').reset();
							
							$('form-success-close').onclick = function() {
								$(this).up('div').fade({ duration: .5 });
								close_page('contact');
								return false;
							}
						}
					}
				});
			}
			return false;
		}
	});
	
	// End Contact Submission
	
	// Volunteer Submission
	
	Event.observe(document, "dom:loaded", function() {
	
		$('volunteer-submit').onclick = function() {
			if (!$('volunteer_fname').value) {
				$('volunteer-message').update('Please enter your first name');
				$('volunteer_fname').focus();
			} else if (!$('volunteer_lname').value) {
				$('volunteer-message').update('Please enter your last name');
				$('volunteer_lname').focus();
			} else if (!$('volunteer_email').value) {
				$('volunteer-message').update('Please enter your email address');
				$('volunteer_email').focus();
			} else if (!email_check.test($('volunteer_email').value)) {
				$('volunteer-message').update('Email address must be in name@example.com format');
				$('volunteer_email').focus();
			} else if (!$('volunteer_address').value) {
				$('volunteer-message').update('Please enter your address');
				$('volunteer_address').focus();
			} else if (!$('volunteer_city').value) {
				$('volunteer-message').update('Please enter your city');
				$('volunteer_city').focus();
			} else if (!$('volunteer_state').value) {
				$('volunteer-message').update('Please select your state');
			} else if (!$('volunteer_zip').value) {
				$('volunteer-message').update('Please enter your zip');
				$('volunteer_zip').focus();
			} else {
				$('volunteer-message').update('Sending...');
				new Ajax.Request('/ajax/volunteer.php', {
					parameters: $('volunteer-form').serialize(),
					onComplete: function(transport) {
						var json = transport.responseText.evalJSON();
						if (json.code == '0') {
							$('volunteer-message').update(json.message);
						} else {
							// successful volunteer
							$('form-success').down('.title').update('your message has been sent');
							$('form-success').down('.body').update("Thank you for interest in becoming a <b>gen eff</b> VOICES volunteer! It's people like you that make a difference by teaching others how to take charge of their own health, raise awareness of our generation's risk of serious disease, and to fight so that our voices are heard. To ensure we can contact you about future volunteering activities, please remember to add \"geneff.org\" to your approved senders list.<br /><br />In the meantime, here are some <a href=\"#\" title=\"ideas\" onclick=\"open_page('voices', 1); $('form-success').fade({ duration: .5 }); return false;\">ideas</a> and <a href=\"#\" title=\"tools\" onclick=\"open_page('voices', 2); $('form-success').fade({ duration: .5 }); return false;\">tools</a> you can use to organize your own event today.");
							$('form-success').appear({ duration: .5 });
							$('volunteer-message').update('');
							$('volunteer-form').reset();
							
							$('form-success-close').onclick = function() {
								$(this).up('div').fade({ duration: .5 });
								close_page('volunteer');
								return false;
							}
						}
					}
				});
			}
			return false;
		}
	});
	
	// End Volunteer Submission
	
	// Fading twitter updates
	
	Event.observe(document, "dom:loaded", function() { var twitter_timer = setInterval("twitter_slideshow()", 7500); });
	function twitter_slideshow(element) {
		var current, next;
		$$('#twitter div div').each(function(x) {
			if ($(x).visible()) current = x
		});
		next = (current.next('div')) ? current.next('div') : $('twitter').down('div').down('div');
		new Effect.Fade(current, { duration: 1 });
		new Effect.Appear(next, { duration: 1 });
	}
	
	// Begin Survey Functionality
	
		Event.observe(document, "dom:loaded", function() {
			$$('#survey-inner ul li a').each(function(x) {
				x.onclick = function() {
					new Ajax.Request('/ajax/survey.php', {
						parameters: {
							question_id : $(this).up('ul').previous('span').readAttribute('id').split('-')[1],
							answer_number: ($(this).up('li').previousSiblings().length + 1)
						},
						onComplete: function(transport) {
							var json = transport.responseText.evalJSON();
							
							// determine individual heights
							var answer1_count = parseInt(json.answer_count1);
							var answer2_count = parseInt(json.answer_count2);
							var answer3_count = parseInt(json.answer_count3);
							var total = answer1_count + answer2_count + answer3_count;							
							
							$('survey-answers').fade({
								duration: .3,
								afterFinish: function() {
									var height = $('survey-inner').getHeight();
									$('survey-inner').morph('height:' + (height + 225) + 'px;', {
										duration: .4,
										afterFinish: function() {
											$('question-blurb').appear({ duration: .4 });
											$('survey-results').appear({ duration: .4 });
											
											var percent_total = 0;
											
											if (json.question_answer1) {
												var answer1_percent = parseInt(answer1_count) / total * 100;
												percent_total = parseFloat(percent_total) + parseFloat(answer1_percent.toFixed(1));

												$('answer-1').show().down('span').update(answer1_percent.toFixed(1) + '%');
												$('answer-1').morph('height:' + parseInt(1.5 * answer1_percent) + 'px;', {
													duration: .7
												});
											}
											if (json.question_answer2) {
												var answer2_percent = parseInt(answer2_count) / total * 100;
												percent_total = parseFloat(percent_total) + parseFloat(answer2_percent.toFixed(1));

												$('answer-2').show().down('span').update(answer2_percent.toFixed(1) + '%');
												$('answer-2').morph('height:' + parseInt(1.5 * answer2_percent) + 'px;', {
													duration: .7
												});
											}
											if (json.question_answer3) {
												var answer3_percent = parseInt(answer3_count) / total * 100;
												percent_total = parseFloat(percent_total) + parseFloat(answer3_percent.toFixed(1));

												$('answer-3').show().down('span').update(answer3_percent.toFixed(1) + '%');
												$('answer-3').morph('height:' + parseInt(1.5 * answer3_percent) + 'px;', {
													duration: .7
												});
											}
										}
									});
								}
							});
						}
					});
					return false;
				}
			});
			
			$$('#survey-results .close')[0].onclick = function() {
				close_survey();
				return false;
			}
		});
		
		function close_survey() {
			if ($('survey-results').visible()) {
				$('survey-results').fade({ duration: .5 });
				$('question-blurb').fade({
					duration: .5,
					afterFinish: function() {
						var height = $('survey-inner').getHeight();
						$('survey-inner').morph('height:' + (height - 260) + 'px;', { duration: .5 });
					}
				});
			}
		}
	
	// End Survey Functionality
	
	// Begin Event Funcitonality
	
		Event.observe(document, "dom:loaded", function() {
			$$('#events div').each(function(x) {
				x.observe('click', function() { open_event_details(this); });
			});
		});
		
		function open_event_details(element) {
			element = $(element);
			
			// animation lock
			lock = true;
			
			// right column goes on top
			switch_depths('right');
			
			// close any other open content
			close_all_open_content('events');
			
			// highlight the navigation item
			navigation_select('events');
			
			// display the proper detail div
			$$('#event-details div').each(function(x) { x.hide(); });
			$$('#event-details div')[element.previousSiblings().length].show();
			
			// reposition the arrow
			$('event-arrow').setStyle({ top: 49 + element.positionedOffset()[1] + 'px' });
			
			$$('#events div').each(function(x) { x.removeClassName('selected'); });
			element.addClassName('selected');
			
			new Effect.Morph('events-expanded', {
				duration: .6,
				transition: Effect.Transitions.sinoidal,
				style: 'width: 872px;',
				afterFinish: function() {
					$('event-details').appear({ duration: .5 });
					
					// unlock for transition complete
					lock = false;
				}
			});
		}
		
		function close_event_details() {
		
			if ($('events-expanded').getWidth() > 500) {
				// remove selected state from all events
				$$('#events div').each(function(x) { x.removeClassName('selected'); });
				
				// remove navigation selection
				$('events-nav').removeClassName('selected');
				
				$('event-details').fade({
					duration: .3,
					afterFinish: function() {
						new Effect.Morph('events-expanded', {
							duration: .4,
							transition: Effect.Transitions.sinoidal,
							style: 'width: 0'
						});
					}
				});
			}
		}
	
	// End Event Functionality
	
	// Begin Blog Open/Close Funcitonality
		
		function open_blog_details(element) {
			element = $(element);
			
			// animation lock
			lock = true;
			
			// display the clicked entry only
			var id = element.readAttribute('id').split('-')[2];
			$$('#blog-entries div').each(function(x) { x.hide(); });
			if ($('blog-entry-' + id)) $('blog-entry-' + id).show();
			
			// clear any category or dat eselection
			$$('#blog-navigation ul li a').each(function(x) { x.removeClassName('selected'); });
			$$('#blog-sort-by-date span a').each(function(x) { x.removeClassName('selected'); });

			toggle_blog_scroll_bars();
			
			// right column goes on top
			switch_depths('right');
			
			// close any other open content
			close_all_open_content('blog');
			
			// highlight the navigation item
			navigation_select('blog');
			
			new Effect.Morph('blog-expanded', {
				duration: .6,
				transition: Effect.Transitions.sinoidal,
				style: 'width: 872px;',
				afterFinish: function() {
					$('blog-details').appear({ duration: .5 });
					
					// unlock for transition complete
					lock = false;
				}
			});
		}
		
		function close_blog_details() {
		
			if ($('blog-expanded').getWidth() == 872) {
			
				// remove navigation selection
				$('blog-nav').removeClassName('selected');
					
				$('blog-details').fade({
					duration: .3,
					afterFinish: function() {
						new Effect.Morph('blog-expanded', {
							duration: .4,
							transition: Effect.Transitions.sinoidal,
							style: 'width: 0'
						});
					}
				});
			}
		}
		
		// Scroll Functionality
		
		var blog_timer = setInterval("check_blog_scroll()", 1);
		var blog_scroll_up = false;
		var blog_scroll_down = false;
		var blog_scroll_distance = 5;
		
		Event.observe(document, "dom:loaded", function() {
			$('blog-scroll-up').onclick = $('blog-scroll-down').onclick = function() { return false; }
			$('blog-scroll-up').observe('mousedown', function() { blog_scroll_up = true; });
			$('blog-scroll-up').observe('mouseup', function() { blog_scroll_up = false; });
			$('blog-scroll-down').observe('mousedown', function() { blog_scroll_down = true; });
			$('blog-scroll-down').observe('mouseup', function() { blog_scroll_down = false; });
			
			// recent entries click event
			$$('#blog div').each(function(x) {
				x.onclick = function() {
					open_blog_details(this);
					return false;
				}
			});
			
			$$('#blog div a.blog-more').each(function(x) {
				x.onclick = function() {
					open_blog_details($(this).up('div'));
					return false;
				}
			});
			
			$$('#blog-sort-by-date span a').each(function(x) {
				x.onclick = function() {
					// show only matching entries
					$$('#blog-entries div').each(function(x) { x.hide(); });
					$$('#blog-entries .' + $(this).className).each(function(x) { x.show(); });
					blog_check_empty();
					toggle_blog_scroll_bars();
					
					// update selected month/year
					$$('#blog-sort-by-date span a').each(function(x) { x.removeClassName('selected'); });
					$$('#blog-navigation ul li a').each(function(x) { x.removeClassName('selected'); });
					$(this).addClassName('selected');
					
					return false;
				}
			});
			
			// navigation functionality
			$$('#blog-navigation ul li a').each(function(x) {
				x.onclick = function() {
					$$('#blog-navigation ul li a').each(function(x) { x.removeClassName('selected'); });
					$$('#blog-sort-by-date span a').each(function(x) { x.removeClassName('selected'); });
					$(this).addClassName('selected');
					
					var id = $(this).readAttribute('id');
					if (id == 'blog-category-all') {
						// show all blog entries
						$$('#blog-entries div').each(function(x) { x.show(); });
					} else {
						$$('#blog-entries div').each(function(x) { x.hide(); });
						$$('#blog-entries .' + id).each(function(x) { x.show(); });
					}
					
					blog_check_empty();
					toggle_blog_scroll_bars();
					
					return false;
				}
			});
			
			// sort by date
			$('blog-sort-by-date').observe('mouseover', function() { $(this).down('span').show(); });
			$('blog-sort-by-date').observe('mouseout', function() { $(this).down('span').hide(); });
		});
		
		function toggle_blog_scroll_bars() {
			// hide/show scroll bars			
			if ($('blog-entries').getHeight() > $('blog-entries-mask').getHeight()) 
				$('blog-arrows').appear({ duration: .3 });
			else 
				$('blog-arrows').fade({ duration: .3 });
				
			$('blog-entries').setStyle({ top: '0px' });
		}
		
		function blog_check_empty() {
			// check for visible entries, otherwise display "no blog entries"
			if ($$('#blog-entries div').find(function(x) { return x.visible(); }))
				$('blog-entry-empty').hide();
			else
				$('blog-entry-empty').show();
		}
		
		function check_blog_scroll() {
			if (blog_scroll_up || blog_scroll_down) {
				var blog_mask_height = $('blog-entries-mask').getHeight();
				var top_pos = parseFloat($('blog-entries').getStyle('top'));
				var height = $('blog-entries').getHeight();
				var max_top = -1 * (height - blog_mask_height);

				if (height > blog_mask_height) {
					if (blog_scroll_up) {
						if (top_pos > -blog_scroll_distance) $('blog-entries').setStyle({ top: 0 + 'px' });
						else $('blog-entries').setStyle({ top: (top_pos + blog_scroll_distance) + 'px'  });
					} else {
						if (top_pos < (max_top + blog_scroll_distance)) $('blog-entries').setStyle({ top: max_top + 'px' });
						else $('blog-entries').setStyle({ top: (top_pos - blog_scroll_distance) + 'px'  });
					}
				}
			}
		}
	
	// End Blog Open/Close Funcitonality
	
	// Cancer Sucks & Submit Your Story
		
		var gallery_length = $$('#gallery-photo img').length;
		var slideshow = true;
		var pause_for_close = false;
		var slideshow_timer;
		var gallery_scroller;
		var timeline_load_images = true;
		
		Event.observe(document, "dom:loaded", function() {
			gallery_scroller = new MaskedScroll('gallery-slider', 'gallery-previous', 'gallery-next', { 
				distanceBeforeSlowDown: 1200,
				duration: .7
			});
			
			// gallery navigation
			$$('#gallery-timeline a').each(function(x) {
				x.observe('click', function() {
					// determine the position of the selected milestone
					var pos = $(this).previousSiblings().length;
					//show_milestone(pos);
					gallery_scroller.scrollElement(pos);
		
					// cancel active slideshow			
					slideshow = false;
					clearInterval(slideshow_timer);
				});
				x.onmouseover = function() { $(this).addClassName('selected'); }
				x.onmouseout = function() { $(this).removeClassName('selected'); }
			});
			
			$('gallery-previous').observe('click', function() {
				slideshow = false;
				clearInterval(slideshow_timer);
			});
			$('gallery-next').observe('click', function() {
				slideshow = false;
				clearInterval(slideshow_timer);
			});
			$('gallery-pause').observe('click', function() {
				if (slideshow) {
					slideshow = false;
					pause_for_close = false;
				} else slideshow = true;
				check_slideshow();
			});
		});
		
		function show_milestone(pos) {
			// update the selection in the timeline
			//$$('#gallery-timeline a').each(function(x) { x.removeClassName('selected'); x.removeClassName('selected-click'); });
			//$$('#gallery-timeline a')[pos].addClassName('selected');
			
			// hide all photos except the selected
			$$('#gallery-photo img').each(function(x) { x.hide(); });
			$$('#gallery-photo img')[pos].show();
			
			// show the proper caption
			$$('#gallery-caption div').each(function(x) { x.hide(); });
			$$('#gallery-caption div')[pos].show();
		}
		
		function cancer_sucks() {
			// load the images on request
			if (timeline_load_images) {
			
				var timeline_index = 0;
				$$('#gallery-slider div').each(function(x) {
					new Insertion.Top(x, "<img src=\"/images/timeline/" + timeline_images[timeline_index] + "\" alt=\"" + timeline_captions[timeline_index] + "\" />");
					timeline_index++;
				});
			
				timeline_load_images = false;
			}
		
			// right column goes on top
			switch_depths('right');
			
			// bring on top of the blog expansion
			$('cancer-sucks').setStyle({ zIndex: 2 });
			
			// close any other open content
			close_all_open_content();
			
			// clear navigation selections
			navigation_select('the-reason');
			
			new Effect.ScrollTo('cancer-sucks', {
				duration: (Math.abs(document.viewport.getScrollOffsets()[1] - $('cancer-sucks').positionedOffset()[1]) / 750),
				transition: Effect.Transitions.sinoidal,
				afterFinish: function() {
					$('cancer-sucks-gallery').appear({
						duration: .5,
						transition: Effect.Transitions.sinoidal,
						afterFinish: check_slideshow
					});
				}
			});
		}
		
		function close_cancer_sucks() {
			if (slideshow) pause_for_close = true;
			else pause_for_close = false;
			clearInterval(slideshow_timer);	
			
			if (the_reason_link_click) {
				new Effect.ScrollTo('header', { duration: 1 });
				the_reason_link_click = false;
			}
			
			// deselect the navigation
			navigation_select('');
			
			if ($('cancer-sucks-gallery').visible()) {
				$('cancer-sucks-gallery').fade({ 
					duration: .5,
					afterFinish: function() {
						// push behind blog expansion
						$('cancer-sucks').setStyle({ zIndex: 0 });
					}
				});
			} else if ($('submit-your-story').visible()) {				
				$('submit-your-story').fade({ 
					duration: .5,
					afterFinish: function() {
						// push behind blog expansion
						$('cancer-sucks').setStyle({ zIndex: 0 });
					}
				});
			}
		}
		
		function toggle_cancer_story() {
		
			// if the gallery is up, pause the slideshow when switching to 'submit your story'
			// otherwise, check for active slideshow
			if ($('cancer-sucks-gallery').visible()) {
				if (slideshow) pause_for_close = true;
				else pause_for_close = false;
				clearInterval(slideshow_timer);
			} else {
				check_slideshow();
			}
			
			$('cancer-sucks-gallery').toggle();
			$('submit-your-story').toggle();
			
			// highlight the first field in the form
			if ($('submit-your-story').visible())
				$('story-first-name').focus();
		}
		
		function check_slideshow() {
			if (pause_for_close) slideshow = true;
			if (slideshow) slideshow_timer = setInterval("gallery_scroller.next();", 10000)
			else clearInterval(slideshow_timer);
		}
		
		function submit_story() {
			$$('#submit-story-form label, #submit-story-form .text-field').each(function(x) {
				// remove all error indicators
				x.removeClassName('error');
			});
			if (!$('story-first-name').value) {
				$('story-first-name').focus();
				$('story-first-name').addClassName('error');
				$('story-first-name').previous('label').addClassName('error');
			} else if (!$('story-last-name').value) {
				$('story-last-name').focus();
				$('story-last-name').addClassName('error');
				$('story-last-name').previous('label').addClassName('error');
			} else if (!$('story-email-address').value) {
				$('story-email-address').focus();
				$('story-email-address').addClassName('error');
				$('story-email-address').previous('label').addClassName('error');
			} else if (!$('story-age').value) {
				$('story-age').focus();
				$('story-age').addClassName('error');
				$('story-age').previous('label').addClassName('error');
			} else if (!$('story-body').value) {
				$('story-body').focus();
				$('story-body').addClassName('error');
				$('story-body').next('label').addClassName('error');
			} else {
				new Ajax.Request('/ajax/story.php', {
					parameters: $('submit-story-form').serialize(),
					onComplete: function(transport) {
						$('submit-story-form').fade({
							duration: .5,
							afterFinish: function() {
								$('submit-story-message').update(transport.responseText).appear({ duration: .5 });
							}
						});
					}
				});
			}
		}
		
	// End Photo Gallery
	
	// Begin Flickr Photo Credits
	
		var flickr_timer = setInterval("check_flickr_scroll()", 1);
		var flickr_scroll_up = false;
		var flickr_scroll_down = false;
		var flickr_scroll_distance = 5;
		var flickr_load_images = true;
	
		Event.observe(document, "dom:loaded", function() {
			$('flickr-link').onclick = function() {
			
				// load the 
				if (flickr_load_images) {
								
					var flickr_index = 0;
					$$('#flickr-slider div div').each(function(x) {
						new Insertion.Top(x, "<img src=\"/images/flickr/" + flickr_images[flickr_index] + "\" alt=\"" + flickr_images[flickr_index] + "\" />");
						flickr_index++;
					});
				
					flickr_load_images = false;
				}
			
				if (parseInt($('flickr').getStyle('bottom')) < 0) {
					// lock any animations until completion
					lock = true;
					
					new Effect.Morph('flickr', {
						duration: .8,
						transition: Effect.Transitions.sinoidal,
						style: 'bottom:0;',
						afterFinish: function() {
							$('flickr').childElements().each(function(x) {
								x.appear({ duration: .5 });
							});
							
							// remove lock
							lock = false;
						}
					});
					
					// clear navigation selections
					navigation_select('');
					
					// close any open content
					close_all_open_content();
				}
				
				return false;
			}
			
			// scrolling functionality
			$('flickr-scroll-up').onclick = $('flickr-scroll-down').onclick = function() { return false; }
			$('flickr-scroll-up').observe('mousedown', function() { flickr_scroll_up = true; });
			$('flickr-scroll-up').observe('mouseup', function() { flickr_scroll_up = false; });
			$('flickr-scroll-down').observe('mousedown', function() { flickr_scroll_down = true; });
			$('flickr-scroll-down').observe('mouseup', function() { flickr_scroll_down = false; });
		});
		
		function close_flickr() {
			if (parseInt($('flickr').getStyle('bottom')) > -650) {
				$('flickr').down('.close').fade({ duration: .3 });
				$('flickr').down('.label').fade({ duration: .3 });
				$('flickr-arrows').fade({ duration: .3 });
				$('flickr-mask').fade({
					duration: .3,
					afterFinish: function() {
						new Effect.Morph('flickr', {
							duration: .4,
							transition: Effect.Transitions.sinoidal,
							style: 'bottom: -650px'
						});
					}
				});
			}
		}
		
		function check_flickr_scroll() {
			if (flickr_scroll_up || flickr_scroll_down) {
				var flickr_mask_height = $('flickr-mask').getHeight();
				var top_pos = parseFloat($('flickr-slider').getStyle('top'));
				var height = $('flickr-slider').getHeight();
				var max_top = -1 * (height - flickr_mask_height);

				if (height > flickr_mask_height) {
					if (flickr_scroll_up) {
						if (top_pos > -flickr_scroll_distance) $('flickr-slider').setStyle({ top: 0 + 'px' });
						else $('flickr-slider').setStyle({ top: (top_pos + flickr_scroll_distance) + 'px'  });
					} else {
						if (top_pos < (max_top + flickr_scroll_distance)) $('flickr-slider').setStyle({ top: max_top + 'px' });
						else $('flickr-slider').setStyle({ top: (top_pos - flickr_scroll_distance) + 'px'  });
					}
				}
			}
		}
		
	// End Flickr Photo Credits
	
	// Begin Navigation Event Handlers
	
		var the_reason_link_click = false;
		Event.observe(document, "dom:loaded", function() {
			// content pages
			$('the-system-nav').onclick = function() { open_page(this); return false; }
			$('the-reason-nav').onclick = function() { 
				cancer_sucks();
				the_reason_link_click = true;
				return false;
			}
			$('voices-nav').onclick = function() { open_page(this); return false; }
			$('about-nav').onclick = function() { open_page(this); return false; }
			$('contact-nav').onclick = function() { open_page(this); return false; }
			$('volunteer-nav').onclick = function() { open_page(this); return false; }
			//$('make-a-donation-nav').onclick = function() { open_page(this); return false; }
			
			$('voices-more-link').onclick = function() {
				new Effect.ScrollTo('header', { 
					duration: 1, 
					transition: Effect.Transitions.sinoidal,
					afterFinish: function() {
						open_page('voices');
					}
				});
				return false;
			}
			
			$('events-nav').onclick = function() { 
				// close any other open content
				close_all_open_content();
				
				new Effect.ScrollTo('events-blog', { 
					duration: 1, 
					transition: Effect.Transitions.sinoidal,
					afterFinish: function() {
						open_event_details($$('#events div')[0]);
					}
				});
				return false;
			}
			$('blog-nav').onclick = function() {
				// close any other open content
				close_all_open_content();
				
				new Effect.ScrollTo('blog', {
					duration: 1,
					transition: Effect.Transitions.sinoidal,
					afterFinish: function() {
						open_blog_details($$('#blog div')[0]);
					}
				});
				return false;
			}
		});
		
	// End Navigation Event Handlers
	
	// Begin Miscellaneous Functionality
	
		function close_all_open_content(exclude) {
			
			// close stat pages
			close_all_stats();
			
			// close all pages
			close_all_pages();
			
			// close survey
			close_survey();
			
			// close event details
			if (exclude != 'events') close_event_details();
			
			// close blog details
			if (exclude != 'blog') close_blog_details();
			
			// close cancer sucks
			close_cancer_sucks();
			
			// close flickr image credits
			close_flickr();
		}
		
		Event.observe(document, "dom:loaded", function() {
			// focus and blur for "text me" value
			$('phone_number').observe('focus', function() { if (this.value == 'enter your email address') this.value = ''; });
			$('phone_number').observe('blur', function() { if (this.value == '') this.value = 'enter your email address'; });
			
			$$('.text-field').each(function(x) {
				x.observe('focus', function() { $(this).addClassName('selected'); });
				x.observe('blur', function() { $(this).removeClassName('selected'); });
			});
			
			// text message sign up field
			$('text-me-button').observe('click', function() {
				if ($('text-me').down('input').value == '' || $('text-me').down('input').value == 'enter your email address') {
					alert("Please enter your email address");
					$('text-me').down('input').focus();
				} else {
					$(this).up('form').submit();
					$('text-me').fade({
						duration: .5,
						afterFinish: function() {
							$('text-me-complete').appear({ duration: .5 });
						}
					});
				}
			});
			
			var selects = new CustomSelects();
			
			// preload a few of the images for better aesthetics
			var preload = new Array('/images/the-system.jpg', '/images/the-reason.jpg', '/images/voices.jpg', '/images/about.jpg', '/images/make-a-donation.jpg', '/images/gallery-milestone.gif', '/images/gallery-controls.gif');
			preload.each(function(img) {
				var image_loader = new Image();
				image_loader.src = img;
			});
		});
		
		Event.observe(document, 'mousemove', function(event) {
			if ($('scroll-icon').visible()) {
				var mousex, mousey;
				if (event.pageX || event.pageY) {
					mousex = event.pageX;
					mousey = event.pageY;
				} else if (event.clientX || event.clientY) {
					mousex = event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
					mousey = event.clientY + document.body.scrollTop + document.documentElement.scrollTop;
				}
				
				if ($('scroll-icon') && $('scroll-icon').visible()) {
					$('scroll-icon').setStyle({
						'top': mousey - 15 + 'px',
						'left': mousex + 20 + 'px'
					});
				}
			}
		});
		
		function navigation_select(page) {
			$$('ul#navigation li a').each(function(a) { a.removeClassName('selected'); });
			if (page) $(page + '-nav').addClassName('selected');
		}
		
		function switch_depths(top) {
			if (top == 'left') {
				$('left').setStyle({ zIndex: '1' });
				$('right').setStyle({ zIndex: '0' });
			} else {
				$('left').setStyle({ zIndex: '0' });
				$('right').setStyle({ zIndex: '1' });
			}
		}
		
		Event.observe(document, "dom:loaded", function() { switch_depths('right'); });
		Event.observe(document, "keydown", function(event) {
			if (event.keyCode == Event.KEY_ESC) close_all_open_content();
		});
		
	// End Miscellaneous
	
	
	/* CUSTOM LIBRARIES - added here to save server requests */
	
	var MaskedScroll = Class.create({
		slider: undefined, // mask container
		current: undefined, // currently selected element
		elements: [], // array of elements inside slider
		duration: .5, // how long should the effect take
		transition: undefined, // Effect.Transition for the effect
		viewSize: 1, // how many elements are visible at once
		distanceBeforeSlowDown: false, // number of pixels for the movement for a slowdown
		slowDownMultiplier: 1, // multiply duration by this number for a slow down if distanceBeforeSlowDown != false
		prevButton: undefined, // id of button to go back
		nextButton: undefined, // id of button to go forward
		lock: false,
		
		initialize: function(slider, prev, next, options) {
		
			this.scroll_lock = false;
			
			this.slider = $(slider);
			this.current = this.slider.down();
			this.elements = this.slider.childElements();
			
			if (!options) options = {};
			this.duration = options.duration || .5;
			this.transition = options.transition || Effect.Transitions.sinoidal;
			this.viewSize = options.viewSize || false;
			this.distanceBeforeSlowDown = options.distanceBeforeSlowDown || false;
			this.slowDownMultiplier = options.slowDownMultiplier || 1.5;
			
			this.prevButton = $(prev);
			this.nextButton = $(next);						
	
			this.prevButton.observe('click', (function() { this.previous(); }).bind(this));
			this.nextButton.observe('click', (function() { this.next(); }).bind(this));
		},
		scrollElement: function(element) {
			if (!this.lock) {
				if (!isNaN(element)) element = this.elements[element];
				var xchange = this.current.viewportOffset()[0] - element.viewportOffset()[0];
				var ychange = this.current.viewportOffset()[1] - element.viewportOffset()[1];
				this.current = element;
				this.animate(xchange, ychange);
				
				// update timeline
				var pos = this.getPos(this.current);
				$$('#gallery-timeline a').each(function(x) { 
					x.removeClassName('selected');
					x.removeClassName('selected');
				});
				$$('#gallery-timeline a')[pos].addClassName('selected');
			}
		},
		previous: function() {
			if (!this.lock) {
				var element = this.current.previous() || this.elements[this.elements.length - 1];
				if (this.viewSize && (this.getPos(element) > this.elements.length - this.viewSize)) {
					this.scrollElement((this.elements.length - this.viewSize > 0) ? this.elements.length - this.viewSize : 0);
					return;
				}
				this.scrollElement(element);
			}
		},
		next: function() {
			if (!this.lock) {
				var element = this.current.next() || this.elements[0];
				if (this.viewSize && (this.getPos(element) > this.elements.length - this.viewSize)) {
					this.scrollElement(0);
					return;
				}
				this.scrollElement(element);
			}
		},
		first: function() { if (!this.lock) this.scrollElement(0); },
		last: function() { 
			if (!this.lock) {
				var pos = (this.viewSize) ? (this.elements.length - this.viewSize) : this.elements.length - 1;
				if (pos < 0) pos = 0;
				this.scrollElement(pos);
			}
		},
		getPos: function(element) { return element.previousSiblings().length; },
		animate: function(xchange, ychange) {
			if (!this.lock) {
				this.scroll_lock = true;
				this.lock = true;
				
				// make the proper timeline selection
				$$('#gallery-timeline a').each(function(x) { x.removeClassName('selected-click'); });
				$$('#gallery-timeline a')[this.getPos(this.current)].addClassName('selected-click');
			
				var time_duration = (this.distanceBeforeSlowDown && (Math.abs(xchange) > this.distanceBeforeSlowDown || Math.abs(ychange) > this.distanceBeforeSlowDown)) ? (this.duration * this.slowDownMultiplier) : this.duration;
				new Effect.Move(this.slider, {
					x: xchange,
					y: ychange,
					duration: time_duration,  
					transition: this.transition,
					afterFinish: (function() { 
						this.scroll_lock = false;
						this.lock = false;
					}).bind(this)
				});
			}
		},
		updatePosition: function() {
			this.elements = this.slider.childElements();
			if (this.current) {
				if (this.current.viewportOffset()[0] != this.slider.up().viewportOffset()[0] || this.current.viewportOffset()[1] != this.slider.up().viewportOffset()[1] + 7) {
					this.elements.each((function(el) {
						if (el.viewportOffset()[0] == this.slider.up().viewportOffset()[0] && el.viewportOffset()[1] == this.slider.up().viewportOffset()[1] + 7) {
							this.current = el;
						}
					}).bind(this));
				}
			} else this.current = this.elements[0];
		}
	});
	
	var CustomSelects = Class.create({
		current: undefined,
		onChange: undefined,
		maxHeight: 200,
		hasNextFocus: undefined,
		hasFocus: undefined,
		previousInput: undefined,
		nextInput: undefined,
		initialize: function(options) {
			if (options) {
				if (options.onChange) this.onChange = options.onChange;
				if (options.maxHeight) this.maxHeight = options.maxHeight;
			}
			
			this.hasNextFocus = false;
			this.hasFocus = false;
		
			// step backwards through count for proper z-index stacking
			var selects = $$('.select_menu');
			var count = selects.length;
			$$('.select_menu').each((function(x) {
				x.setStyle({ zIndex: count });
				count--;
				
				// if there's a previous input element, capture the tab key
				/*if (x.up('.form_group').previous('.form_group')) {
					this.previousInput = x.up('.form_group').previous('.form_group').down('input');
					this.previousInput.observe('focus', (function() { this.hasNextFocus = true }).bind(this));
					this.previousInput.observe('blur', (function() { this.hasNextFocus = false }).bind(this));
				}
				if (x.up('.form_group').next('.form_group')) {
					this.nextInput = x.up('.form_group').next('.form_group').down('input');
				}
				
				document.observe('keypress', (function(event) {
					// put focus on the select control
					if (event.keyCode == Event.KEY_TAB && this.hasNextFocus){
						this.current = this.previousInput.up('.form_group').next('.form_group').down('.select_menu');
						this.current.addClassName('select_menu_highlight');
						this.current.down('ul').show();
						if (this.nextInput) this.nextInput.blur();
						this.hasNextFocus = false;
						this.hasFocus = true;
					} else if (this.hasFocus && this.nextInput) this.nextInput.focus();
				}).bindAsEventListener(this));*/
			}).bind(this));
			this.loadListItems();
			document.observe('click', (function(event) {
				var element = event.findElement('.select_menu');
				if (element) { // clicking inside 
					if (this.current) {
						this.current.removeClassName('select_menu_highlight');
						this.current.down('ul').hide();
						if (this.current != element) {
							this.current = element;
							this.current.down('ul').show();
						} else this.current = undefined;
					} else {
						this.current = element;
						this.current.addClassName('select_menu_highlight');
						this.current.down('ul').show();
					}
				} else if (this.current) {
					this.current.removeClassName('select_menu_highlight');
					this.current.down('ul').hide();
					this.current = undefined;
				}
			}).bind(this));
		},
		loadListItems: function() {
			$$('.select_menu ul li').each((function(li) {
				li.observe('mouseover', function(event) { this.addClassName('hover'); });
				li.observe('mouseout', function(event) { this.removeClassName('hover'); });
				li.onclick = (function(li) { 
					li.up('ul').hide();
					li.up().previous('span').update(li.innerHTML);
					li.siblings().each(function(el) { el.removeClassName('selected'); });
					li.addClassName('selected');
					if (li.readAttribute('val') != '' && li.up().previous('input[type=hidden]')) {
						li.up().previous('input[type=hidden]').value = li.readAttribute('val');
					}
					if (this.onChange) this.onChange(li);
					this.loadListItems();
				}).bind(this, li);
			}).bind(this));
			$$('.select_menu ul').each((function(ul) {
				if (ul.getHeight() > this.maxHeight) {
					ul.setStyle({ height: this.maxHeight + 'px', overflow: 'auto' });
				}
			}).bind(this));
		}
	});