$(document).ready(function(){
	
	//Open external links in a new window
	/*
$('a[href^="http"]').each(function(){
		var rg = new RegExp(document.domain)
		if ($(this).attr('href').search(rg) == -1){
			$(this).attr('target', '_blank');
		}
	});
*/
     
     
  //ShowHide Logic
  $('#showhide h3').next('ul').each(function(){
  	//Store the initial height in the rel attribute, then hide the list
  	$(this).attr('rel', $(this).height()).addClass('hidden').hide()
  });
  $('#showhide h3 a').click(function(event){
  	event.preventDefault();
  	//Find the list
  	var list = $(this).parent('h3').next('ul');
  	
  	//Explicitly set the height... this is to avoid a jumpy jQuery glitch
  	var targetHeight = $(list).attr('rel') + "px";
  	list.css("height", targetHeight);
  	
  	//Show or hide it
  	list.slideToggle();
  });
});