var casestudy_map = {
	'cs_0': {
		'img': 'images/case_studies/cs_thumb_src.jpg',
		'client' : 'PBS',
		'project' : 'Station Remote Control',
		'title' : 'Reinventing service',
		'teaser': 'Serving a community of more than 171 unique local stations across the country is no small challenge for PBS. Designing and maintaining an online library of tools and services for those stations that is both engaging and highly usable for station employees of varying levels of expertise, as well as manageable by a small, time-challenged internal PBS Station Services team, required some new thinking.',
		'url': 'casestudy_4.html'
	},
	'cs_1': {
		'img': 'images/case_studies/cs_thumb_flickr.jpg',
		'client' : 'PBS',
		'project' : 'Flickr Factory',
		'title' : 'Integrating social media',
		'teaser': 'In support of the PBS Engage initiative -- whose goal is to bring more community-generated content to PBS websites -- the Flickr Factory was designed to act as a simple-to-use, extensible online mini-application providing an administrative layer between Flickr and PBS content editors and producers looking to engage site audiences in telling stories online.',
		'url': 'casestudy_3.html'
	},
	'cs_2': {
		'img': 'images/case_studies/cs_thumb_hamilt.jpg',
		'client' : 'Hamiltonian Foundation',
		'project' : 'Hamiltonian Artists and Gallery',
		'title' : 'Supporting the arts',
		'teaser': "There is nothing more enriching than supporting the arts in your community, except perhaps creating a space in the community where new artists can grow and develop, and get a strong start on their careers. That's why we were thrilled to help our colleague Dr. Paul So, a physics Ph.D. teaching at George Mason University, and an artist himself, develop a web presence to support his new venture, Hamiltonian Artists foundation and gallery.",
		'url': 'casestudy_2.html'
	},
	'cs_3': {
		'img': 'images/case_studies/cs_thumb_gg.jpg',
		'client' : 'Gate Gourmet',
		'project' : 'Corporate website',
		'title' : 'Strengthening a brand',
		'teaser': 'In a landscape of growing competition and scarce resources, reinvigorating the online presence for this global airline catering and logistics company meant more than just changing the window dressing. Working closely with internal teams to help align the online content presentation and strengthen the connection with print and other media branding, converted the Gate Gourmet website into a true brand and services promotion vehicle.',
		'url': 'casestudy_1.html'
	},
	'cs_4': {
		'img': 'images/case_studies/cs_thumb_cringely.jpg',
		'client' : 'Robert X. Cringely',
		'project' : 'I, Cringely website',
		'title' : 'Evolving an online community',
		'teaser': "How do you turn an old-school tech column into a highly interactive online community? How do you evolve a popular content destination without losing the spirit of the original? Enter blogging strategy and some creative thinking about engaging community participation and the sky's the limit.",
		'url': 'casestudy_0.html'
	}
};



//display case study teasers on main work page

var cs_number = 0;


function caseStudyNav(whichArrow){

	// whichArrow : "left" or "right" depending on which arrow is clicked


	var clicked_arrow = whichArrow;
	var right_arrow = document.getElementById('right');
	var left_arrow = document.getElementById('left');

	var on_class = 'casestudies_block_on';
	var off_class = 'casestudies_block';


	if (clicked_arrow == 'right')
	{
		if (cs_number < 4)
		{
			cs_number += 1;
			left_arrow.className = 'casestudies_block_mover_left';
		}
	}	

	else if (clicked_arrow == 'left')
	{
		if (cs_number > 0)
		{
			cs_number -= 1;
			right_arrow.className = 'casestudies_block_mover_right';
		}
	}

	if (cs_number == 4)
	{
		right_arrow.className = 'casestudies_block_mover_right_off';
	}
	else if (cs_number == 0)
	{
		left_arrow.className = 'casestudies_block_mover_left_off';
	}

	//set (all cs_block_ids to off state)
	for (i=0; i<=4; i++)
	{
		cs_id = 'cs_block_' + i;
					
			if (cs_number == i)
			{
				document.getElementById(cs_id).className = on_class;
				
				// variable for object name in case study map
				cs_object_name = 'cs_' + i;

				//display element components corresponding to cs_number
				document.getElementById('casestudies_client_content').innerHTML = casestudy_map[cs_object_name]['client'];
				document.getElementById('casestudies_project_content').innerHTML = casestudy_map[cs_object_name]['project'];
				document.getElementById('casestudies_image_thumb').src = casestudy_map[cs_object_name]['img'];
				document.getElementById('casestudies_image_link').href = casestudy_map[cs_object_name]['url'];
				document.getElementById('casestudies_title_link').href = casestudy_map[cs_object_name]['url'];
				document.getElementById('casestudies_more_link').href = casestudy_map[cs_object_name]['url'];
				document.getElementById('casestudies_title').innerHTML = casestudy_map[cs_object_name]['title'];
				document.getElementById('casestudies_teaser').innerHTML = casestudy_map[cs_object_name]['teaser'];
			}
			else
			{
				document.getElementById(cs_id).className = off_class;
			}
	}



}




function caseStudyNavRoll(thisid){

	var dom_node = document.getElementById(thisid);
	var class_name = dom_node.className;

if(!(class_name == 'casestudies_block_on'))
{
	
	if (!(dom_node.className == 'casestudies_block'))
	{
		dom_node.className = 'casestudies_block';
	}
	else
	{
		dom_node.className = 'casestudies_block_over';
	}

}


}






