var qg_loc = Cookie.get('qg_cursor');
if(qg_loc == false) {
	qg_cursor = Cookie.set('qg_cursor', 0, {path: '/'});
}
var chapter_info = ['',
	'<h3>Chapter 1: Joyce, Bernie and Mac <span class="timecode">[7:22]</span></h3><h4>"Now you take care of them."</h4><div class="rule"></div><p class="player_blurb">The show opens.  Meet Bert and Mac McCardle, with daughter Joyce. They\'ve been self-sufficient – up to now.</p>',
	'<h3>Chapter 2: Lorraine and Charlotte  <span class="timecode">[4:37]</span></h3><h4>"Look how far you\'ve come!"</h4><div class="rule"></div><p class="player_blurb">A stroke has robbed Charlotte of her mobility, but Lorraine believes her mother can get back home if they work together.</p>',
	'<h3>Chapter 3: Priscilla and Happy  <span class="timecode">[4:44]</span></h3><h4>"A one-person retirement home."</h4><div class="rule"></div><p class="player_blurb">Happy still lives at home, thanks to daughter Priscilla\'s skill at organizing full-time care. Quality is high; so are costs.</p>',
	'<h3>Chapter 4: Thelma and Maria  <span class="timecode">[9:40]</span></h3><h4>"Payback for what she gave me."</h4><div class="rule"></div><p class="player_blurb">Thelma and her family care for her bed-ridden mother, Maria, at home, though she is slipping into dementia.</p>',
	'<h3>Chapter 5: Ricardo, Nelly and Raul <span class="timecode">[7:29]</span></h3><h4>"Getting back the years."</h4><div class="rule"></div><p class="player_blurb">His divorced parents now live in nursing homes, but caring for them still puts a strain on Ricardo - and on his marriage.   </p>',
	'<h3>Chapter 6: Joyce, Bert and Mac <span class="timecode">[3:57]</span></h3><h4>"A load off my shoulders."</h4><div class="rule"></div><p class="player_blurb">Joyce and her sisters gather to meet with Bert and Mac.  Talking about the future, as a family, is crucial. </p>',
	'<h3>Chapter 7: Lorraine and Charlotte  <span class="timecode">[6:01]</span></h3><h4>"She\'s depending on me."</h4><div class="rule"></div><p class="player_blurb">Lorraine and her sister challenge the nursing staff\'s approach to caring for their mother.</p>',
	'<h3>Chapter 8: Priscilla and Happy  <span class="timecode">[4:49]</span></h3><h4>"Watch over me."</h4><div class="rule"></div><p class="player_blurb">As Happy grows frailer, Priscilla considers her role as primary caretaker.  It wasn\'t her plan, but she\'s made peace with it.</p>',
	'<h3>Chapter 9: Maria and Thelma <span class="timecode">[4:51]</span></h3><h4>"State of mind."</h4><div class="rule"></div><p class="player_blurb">Maria\'s mood swings grow.  Thelma, like many caregivers, has become an expert on her mother\'s medical condition.</p>',
	'<h3>Chapter 10: Lorraine and Charlotte  <span class="timecode">[4:47]</span></h3><h4>"Why didn\'t you tell me to duck?"</h4><div class="rule"></div><p class="player_blurb">Charlotte visits home.  Lorraine just wants to please her, and make her happy.</p>',
	'<h3>Chapter 11: Ricardo, Nelly and Raul <span class="timecode">[4:52]</span></h3><h4>"I\'m the one who knows."</h4><div class="rule"></div><p class="player_blurb">Raul\'s prostate cancer has returned.  Without support from his sister or his wife, Ricardo\'s life gets harder.</p>',
	'<h3>Chapter 12: Joyce, Bert and Mac <span class="timecode">[2:40]</span></h3><h4>"It just fell to me."</h4><div class="rule"></div><p class="player_blurb">Joyce explains how she became the lead caregiver, and how caregivers need to take care of themselves.</p>',
	'<h3>Chapter 13: Priscilla and Happy <span class="timecode">[2:37]</span></h3><h4>"The beginnings &amp; the ends."</h4><div class="rule"></div><p class="player_blurb">Priscilla\'s daughter reflects on the parallels between the start of life and its end.  Happy spends time with her baby great-granddaughter.</p>',
	'<h3>Chapter 14: Lorraine and Charlotte  <span class="timecode">[4:39]</span></h3><h4>"A spiritual connection."</h4><div class="rule"></div><p class="player_blurb">Lorraine knows her mother so well, but does she understand what she wants?  A doctor talks about love.</p>',
	'<h3>Chapter 15: Joyce, Bert and Mac <span class="timecode">[2:28]</span></h3><h4>"A fragile ecosystem."</h4><div class="rule"></div><p class="player_blurb">Bert and Mac are still at home as Christmas approaches.  If Bert fell suddenly ill, would Mac know what to do?</p>',
	'<h3>Chapter 16: Thelma and Maria <span class="timecode">[5:12]</span></h3><h4>"I\'m the glue."</h4><div class="rule"></div><p class="player_blurb">Thelma is overworked and overwhelmed. No one person can do it all.  She takes steps to care for herself.</p>',
	'<h3>Chapter 17: Ricardo, Nelly and Raul <span class="timecode">[4:03]</span></h3><h4>"It is what it is."</h4><div class="rule"></div><p class="player_blurb">Raul\'s cancer and Nelly\'s Alzheimer\'s have worsened, and now Ricardo is in poor health, too. Who cares for the caregiver?</p>',
	'<h3>Chapter 18: Conclusion <span class="timecode">[4:28]</span></h3><h4>"Transformative moments."</h4><div class="rule"></div><p class="player_blurb">All five caregivers share what they\'ve learned from caregiving.</p>'];

//qg_loc = Cookie.get('qg_cursor')[0];
qg_loc = Cookie.get('qg_cursor');

function init_chapter_nav() {
	var btns = $('vid_chap_nav').getElementsByTagName('a');
//	if (btns.length > 10) btns[17].addClass('end');
	chapter_info[0] = $('default-video-info').innerHTML;
	var test = '';
	if (btns.length > 0) {
	for (var i = 0; i < 18; i++) {
		btns[i].onmouseover = function() {
					var x = this.innerHTML;
					var f = this.className;
					var chapter_family = [[],
																[6,12,15],
																[7,10,14],
																[8,13],
																[9,16],
																[11,17],
																[1,12,15],
																[2,10,14],
																[3,13],
																[4,16],
																[2,7,14],
																[5,17],
																[1,6,15],
																[3,8],
																[2,7,10],
																[1,6,12],
																[4,9],
																[5,11],
																[]];
				//	for (var j = 0; j < chapter_family.length; j++) {
					var inf = chapter_family[x];
					for (var j = 0; j < inf.length; j++) {
						var links = $('vid_chap_nav').getElementsByTagName('a');
						if (inf[j] != x && !links[inf[j] -1].className.match(/_/)) {
							links[inf[j] -1].className += '_too';
							test += links[inf[j] -1].className + ' ';
					}
				}
					$('default-video-info').innerHTML = chapter_info[x];
			};
			btns[i].onmouseout = function() {
					var links = $('vid_chap_nav').getElementsByTagName('a');
					for (var j = 0; j < links.length; j++) {
						links[j].className = links[j].className.replace(/(_too)+/g, '');
					}
					$('default-video-info').innerHTML = chapter_info[0];
			};
		}
	}
}

function qgGo() { return false; }

window.onload = function() { init_chapter_nav(); }