$(function()
{
	//new window function
	jQuery("a[rel='_blank']").each(function(){jQuery(this).attr("target", "_blank");});
	
	
	/*videos - video page*/
	//hide all video lists that don't have cur (current) class
	$('.videoList').not('.cur').addClass('visuallyhidden');
	$('.videoList a').addClass('visuallyhidden');
	//video pagination click event
	$('.vidPag a').click(function()
	{
		/*//get current id of visible video list
		var cur = $('.videoList.cur').attr('id');
		//strip out unecessary characters
		cur = cur.replace('videoList','');
		//convert to number
		cur = parseInt(cur);*/
		
		//item clicked converted to number
		var selected = 'videoList'+$(this).text();
		//hide current listing
		$('.videoList.cur').removeClass('cur').addClass('visuallyhidden');
		//show selected listing
		$('#'+selected).removeClass('visuallyhidden').addClass('cur');
		//amend pagination nav
		$('.vidPag .cur').removeClass('cur');
		//add cur class to both pagination nav matching on index of child
		$('.vidPag li:nth-child('+($(this).parents('li').index()+1)+') a').addClass('cur');
	});
	
	//glossary striping
	$('#glossary dt:even, #glossary dd:even').addClass('alt');
	
	//galleries
	if($("a[rel='gallery1']").length){$("a[rel='gallery1']").colorbox();}
	if($("a[rel='gallery2']").length){$("a[rel='gallery2']").colorbox();}
	if($("a[rel='gallery3']").length){$("a[rel='gallery3']").colorbox();}
	if($("a[rel='gallery4']").length){$("a[rel='gallery4']").colorbox();}
	if($("a[rel='gallery5']").length){$("a[rel='gallery5']").colorbox();}
});

