/**
 * @package 
 * @author {@link mailto:ss@toolboxstudios.com Steve Simons, Toolbox Studios, Inc.}
 * @license http://toolboxstudios.com Contact about usage
 * @revision $Revision: 1.2 $
 * @copyright Copyright 2009
**/

// IE Background Images on links flicker - modify cache settings
try {
  document.execCommand('BackgroundImageCache', false, true);
}
catch(e) {}


$().ready( function() {
	$('#content h2, #content h4, #content h6')
		.each( function( index) {
			var content = document.createElement( 'div');
			while ( this.nextSibling && ( this.nextSibling.nodeType != 1 || this.nextSibling.tagName != this.tagName))
				content.appendChild( this.nextSibling);
			if ( this.nextSibling)
				this.parentNode.insertBefore( content, this.nextSibling);
			else
				this.parentNode.appendChild( content);
			$(this).css( { cursor: 'pointer' });
			$(this).addClass( 'showContent');
			$(content)
				.css( { display: 'none' })
				.addClass( 'hideShowContent');
			$(this).click( function( event) {
			var content = $(this.nextSibling);
			if ( content.hasClass( 'open')) {
				content.removeClass( 'open').hide( 'normal');
				$(this).removeClass( 'hideContent').addClass( 'showContent');
			}
			else {
				content.addClass( 'open').show( 'normal');
				$(this).removeClass( 'showContent').addClass( 'hideContent'); }
			});
		});
});

