// JavaScript Document

function mission_widget(root) {
	this.root = root;
}

mission_widget.prototype.containerHTML = function () {
	var html = "<div style='position: relative; top: -40px;'>"
		html += this.nav_content();
		html += "<div id='" + this.root + "' style='padding-left: 12px; color: #000; padding-bottom: 26px;'></div>";	
		html += "</div>";
	return html;	
}

mission_widget.prototype.nav_content = function() {
	
	var nav_bar = "<div style='position: relative; width: 100%; background-color: #000;"
		+ " -moz-opacity:.65; height: 40px; padding: 3px'>";
		nav_bar += "<div style='position: absolute; left: 4%; top: 16px;'><a id='intro_link' class='active' onClick='mission_controller()'>Introduction</a></div>";
		nav_bar += "<div style='position: absolute; left: 24%; top: 16px;'><a id='bio_link' class='button' onClick='bio_controller()'>Background</a></div>";
		nav_bar += "<div style='position: absolute; left: 45%; top: 16px;'><a id='project_link' class='button' onClick='project_controller()'>Project Goals</a></div>";
		nav_bar += "<div style='position: absolute; left: 68%; top: 16px;'><a id='program_link' class='button' onClick='program_controller()'>In Prison Program</a></div>";
		nav_bar += "</div>";
	return nav_bar;
}

mission_widget.prototype.load_html = function() {
	$('content_frame').innerHTML = this.containerHTML();
	$(this.root).innerHTML = this.mission_text();
}

mission_widget.prototype.show_mission = function() {
	$(this.root).innerHTML = this.mission_text();
}

mission_widget.prototype.show_project = function() {
	$(this.root).innerHTML = this.project_text();
}

mission_widget.prototype.show_program= function() {
	$(this.root).innerHTML = this.program_text();
}

mission_widget.prototype.show_bio= function() {
	$(this.root).innerHTML = this.bio_text();
}

mission_widget.prototype.program_text = function() {
		
	var text_content = "<h4>Why Yoga in Prison?</h4>" +
						"<p>Prison is a breeding ground for mental, emotional and physical distress and a repository for those suffering from Post Traumatic Stress Disorder. Experiences of anxiety, depression, agitation, hopelessness, grief, fear and rage can be greatly increased under incarcerated conditions. Psychiatrists, psychologists and clinical social workers acknowledge that embodiment practices such as Yoga can greatly help people alleviate the symptoms that lead to both reactive behaviors and stress related disease " + "(<a onClick=\"window.open('http://prisonyoga.com/downloads/psychophysiological_effects.htm')\">" + "<u>Psychophysiological Effects of Yoga</u></a>). So learning a practice in prison for mindful awareness and embodiment is not only important for supporting behavioral rehabilitation but also critical for physical and emotional well-being. (Healthcare costs alone account for $2.1 billion of the California prison system's $9 billion annual budget.)</p>" +
						
						"<p>Most men in prison have become disassociated from their feelings and bodies as a result of backgrounds of neglect or abuse, violent behavior, and/or the overuse of alcohol and drugs. The Prison Yoga Project helps students to reclaim a sensitivity to themselves through a practice of self-awareness and self-control that instills non-reactivity and self-acceptance. The classes help to free the mind and body from confusion and distress allowing one to be at peace and receptive to learning new ways of thinking by engaging students in an appealing yet challenging practice of postures (asanas), conscious breathing (pranayama), and short periods of meditation. Discipline of the mind and body is emphasized as integral for developing positive behavioral habits and impulse control. The ethical code of conduct and behavior that defines a Yoga practitioner's way of life is underscored. The program also promotes non-competitiveness and intentionally fosters community building through cooperative group participation.</p>"

		+ "<h4>Class Description</h4>"
		+ "A typical 90-minute class can be divided into six areas of focus:"
		+ "<ol>"
		+ "<li><b>Centering</b> - - the beginning 5-10 minutes of the class is devoted to establishing"
		+ " the foundation for mindful awareness by disengaging from preoccupations of the mind and initiating"
		+ " the conscious breath work that is integral for the class.</li>"
		
		+ "<li><b>Opening</b> - the experience of centering is enhanced by engaging in a series of static poses that are held for longer periods while maintaining focused awareness on the breath and sensations arising in the body.</li>"
		
		+ "<li><b>Purification</b> - after the vital areas of the body are opened they are then 'flushed' through a vigorous set of continuous, moving postures that require concentrated breathing to facilitate the body through this energetic cleansing process.</li>"
		
		+ "<li><b>Resiliency</b> - this period involves building core physical, mental and emotional fortitude through a set of poses that require physical strength, balance and stamina.</li>"

		+ "<li><b>Closing</b> - this section of the class is dedicated to 'sealing' the benefits achieved through a set of seated or reclining postures intended to release any remaining blocked energy.</li>"

		+ "<li><b>Integration</b> - the final segment of class is devoted to surrendering into stillness, in both lying and seated positions, while being guided through a process of integrating the physical, mental and emotional benefits of the practice.</li>"
		+ "</ol><br />";
		
		text_content += "<img src='images/vinyasa_watercolor.jpg' width='100%'/>";
		
	return text_content;	
}


mission_widget.prototype.project_text = function () {
		
		var text_content = "<p>The goal of the Prison Yoga Project is to help people to shift unconscious behavioral patterns of reacting into conscious ways of responding by teaching individuals the skill of clearly witnessing their moment-to-moment experience. Learning this fundamental behavioral shift can make the difference between a person committing a crime or not.</p>"
				
				+ "<h4>Developing Mindful Awareness</h4>"
				+ "<p>Mindful awareness, or Mindfulness, is at the core of the Prison Yoga Project's program. Mindful awareness can be practiced in seated meditation and while engaging in Hatha Yoga. It is designed to promote a general mind/body consciousness that can strengthen the capacity for self-reflection, self-acceptance and change. <br /><br />"
				
				+ "The main components that constitute the practice are:<br />"

				+ "<ul>"
				+ "<li>Learning to shift into a state of awareness by observing the present moment without the mind interpreting the experience.</li>"
				+ "<li>Focusing on breathing through the nose while feeling accompanying sensations in the body.</li>"
				+ "</ul>"
				
				+ "According to both the <a href=\"javascript:load_()\" onClick=\"window.open('http://www.umassmed.edu/content.aspx?id=41252')\">University of Massachusetts Medical Center</a> and <a href=\"javascript:load_()\" onClick=\"window.open('http://www.marc.ucla.edu')\">UCLA's Mindful Awareness Research Center</a>, Mindfulness has scientific support as a means for reducing stress, improving attention, boosting the immune system and promoting a general sense of health and psychological well being. Case studies have also shown that mindful awareness holds great promise for working with both adolescents and adults with attention deficit disorders, depression and anxiety. Furthermore, recent research conducted by the Boston University School of Medicine suggests Hatha Yoga can significantly relieve symptoms of Post Traumatic Stress Disorder (" + "<a onClick=\"window.open('http://prisonyoga.com/downloads/PTSD%20research%20.pdf')\">" + "<u>PTSD Download</u></a>).<br /><br /></p>"

				+ "<h4>Practical Application of Yoga for Rehabilitation</h4>"

				+ "<p>The practical application of Yoga for developing self-discipline, emotional intelligence and impulse control is another important goal of the Prison Yoga Project, particularly as it applies to addiction recovery and violence prevention (numerous studies confirm the effectiveness of Hatha Yoga in supporting " + "<a onClick=\"window.open('http://prisonyoga.com/downloads/addiction.htm')\">" + "<u>addiction recovery</u></a>).</p>"
				
				+ "<br /><br />"

				+ "The most often reported benefits from students having taken classes are:<br />" 

				+ "<ul>"
				+ "<li>Reduction of stress</li>"
				+ "<li>\"More able to focus on the positive rather than the negative\"</li>" 
				+ "<li>Support in addiction recovery</li>"
				+ "<li>Greater mental clarity</li>"
				+ "<li>Pain relief</li>"
				+ "<li>Improved sleep</li>"
				+ "<li>\"Better able to deal with the mental and emotional strain of prison\"</li>"
				+ "<li>Greater access to inner peace</li>"
				+ "</ul>"
				+ "</p>";
	return text_content;
}

mission_widget.prototype.mission_text = function () {

		var text_content = "<p>The goal of the Prison Yoga Project is to expand the practice of Hatha Yoga and Mindfulness Meditation to prisons and rehabilitation facilities, and to provide training for Yoga instructors interested in teaching to at-risk populations in prisons, residential rehabilitation facilities, and community programs.</p>";
				
		text_content += "<p>Based on eight years of experience conducting programs in prisons, residential treatment facilities, and inner city community projects - the Prison Yoga Project has a track record of providing the rehabilitative benefits of yoga and other mindfulness practices to both youth and adult at-risk populations.</p>";
		
		text_content += "<p>The Prison Yoga Project advises prisons, private entities and/or individuals about establishing yoga programs as part of a rehabilitation program, and provides an already proven to be effective curriculum and facilitation protocol. Additionally the project offers trainings for yoga teachers who are interested in working with at-risk populations. </p>";
		  
		return text_content;
}

mission_widget.prototype.bio_text = function () {

		var text_content = "<p>James Fox, M.A., the founder and director of the Prison Yoga Project, is a certified Hatha Yoga instructor with more than 20 years of yoga experience. He has studied and taken teacher trainings in various disciplines including Iyengar, Ashtanga and Yin Yoga. Upon receiving his teaching credentials in 2000, in addition to offering classes to the public, he began his mission of exposing at-risk populations including the incarcerated to the psychophysiological benefits of Yoga.<br /><br />";

			text_content += "James developed the <a href=\"javascript:load_()\" onClick=\"window.open('http://insightprisonproject.org')\">Insight Prison Project's</a> Yoga Program at San Quentin Sate Prison and has been its coordinator and principal teacher since its inception in September 2002. He has also taught Yoga and mindfulness practices to youth-at-risk in juvenile detention, at a residential treatment facility for boys, and for an inner city, gang-related, community program. He created the Yoga curriculum for the <a href=\"javascript:load_()\" onClick=\"window.open('http://www.peacebuildersinitiative.org/')\">Peacebuilders Initiative</a>, a weeklong, summer intensive for teenage youth held annually in Chicago that he has taught and directed since 2003. James has also provided training to Yoga teachers interested in working with youth-at-risk through the <a href=\"javascript:load_()\" onClick=\"window.open('http://www.niroga.org/')\">Niroga Institute</a>, an organization that offers yoga classes to the Alameda County Juvenile Justice Center as well as select Oakland and Berkeley public schools.<br /><br />";

			text_content += "James is specifically trained in the use of Hatha Yoga for helping heal addictions, having studied with Fr. Joe Pereira, senior Iyengar instructor and Director of the world renowned <a href=\"javascript:load_()\" onClick=\"window.open('http://kripafoundation.org')\">Kripa Foundation</a>, which operates over 30 addiction recovery centers throughout India that use Yoga and meditation in their recovery programs. He is also trained in violence prevention facilitation and conflict resolution work.<br /><br />"; 

			text_content += "In addition to directing the Yoga program at San Quentin, James co-facilitates a group process class with prisoners for the <a href=\"javascript:load_()\" onClick=\"window.open('http://insightprisonproject.org')\">Insight Prison Project</a>. He continues to teach public classes with an emphasis on Yoga workshops for men.<br /><br /></p>";
		  
		return text_content;
}
