// JavaScript Document
// Author: sh
// Date: 11-17-08

//register events on load
$(document).ready(function() {
   
	/* Open section details when link (of class 'expand-link') is clicked 
	   Close section when clicked again  
	   Sections are divs with ids of 'mydiv-full'
	*/
   $(".expand-link").toggle(function(e) {
	 var id = (this.id).split('-');
	 var lnk = $(this);
	 lnk.removeClass('closed');
	 lnk.addClass('open');
     $('#' + id[0] + '-full').show();
	 e.preventDefault();
   },function(e) {
	 var id = (this.id).split('-');
	 var lnk = $(this);
     $('#' + id[0] + '-full').hide();//'',function() {
		lnk.removeClass('open');
	 	lnk.addClass('closed');												  
	 //});
	 e.preventDefault();
   });
   
   //find out what anchor we're expecting and open that section
   var loc = this.location.href;
   var anc = loc.split('#');
   //timeout = dirty hack for safari
	setTimeout("$('#" + anc[1] + "-link').click();",20);  
   
});