// JavaScript Document
$(document).ready(function(){
  $('#mainContent a').colorbox({ transition:'fade', speed:500, onOpen:function(){ $("#hidden").append('<p id="srclue">End of overlay window; navigate backward to read content</p>'); }, onClosed:function(){ $("#srclue").remove(); } }).attr("rel","all");
  //move focus to first item in colorbox "window"

  $(".rollover").hide();
  $(".item").mouseenter(function(){
	$(this).find('div:eq(0)').slideDown(100);
  });
  $(".item").mouseleave(function(){
	$(this).find('div:eq(0)').slideUp(100);
  });
  $("#header p.jscontrols").prepend('<a href="" id="showall">Show All Works</a> | <a href="" id="showlabels">Show/Hide All Labels</a> | ');
  $("#showlabels").click(function(){
								  $(".rollover").slideToggle(100);
								  return false;
								  });
   $("#showall").click(function(){
								  $(".item").show('slow');
								  $(".item a").attr('rel', 'all');
								  return false;
								  });
 $("p:contains(Interaction)").click(function(){
											  $(".item:has(div.rollover:has(img.IxD))").show('slow');
											  $(".item").not(".item:has(div.rollover:has(img.IxD))").hide('slow');
											  $(".item:has(div.rollover:has(img.IxD)) a").attr('rel', 'IxD');
											  return false;
											  });
  $("p:contains(Programming)").click(function(){
											  $(".item:has(div.rollover:has(img.prog))").show('slow');
											  $(".item").not(".item:has(div.rollover:has(img.prog))").hide('slow');
											  $(".item:has(div.rollover:has(img.prog)) a").attr('rel', 'prog');
											  return false;
											  });
  $("p:contains(Graphic)").click(function(){
											  $(".item:has(div.rollover:has(img.GxD))").show('slow');
											  $(".item").not(".item:has(div.rollover:has(img.GxD))").hide('slow');
											  $(".item:has(div.rollover:has(img.GxD)) a").attr('rel', 'GxD');
											  return false;
											  });
  /*function addARIAAttr(strID, strAttr, strValue)
  {
	  // Find the element to add a role property to
	  var objElement = document.getElementById(strID);
  
	  if (objElement)
	  {
		  // Add the attribute and value to the element
		  objElement.setAttribute(strAttr, strValue);
	  }
  }
  // Add ARIA roles to the document
  addARIAAttr('mainContent','role', 'main');
  addARIAAttr('mainContent','aria-live', 'polite');
  addARIAAttr('banner', 'role', 'banner');
  addARIAAttr('key', 'aria-controls', 'mainContent');
  addARIAAttr('footer', 'role', 'contentinfo');
  */
});
