/**
 * JQUERY SHOW/HIDE SUMMARY AND DESCRIPTION CONTAINERS
 * @author William Dodson <http://obxdesignworks.com/> for MANOVERBOARD <http://manoverboard.com/> + lumino.us <http://lumino.us> (code named: B3)
 * @date 2008-10-14
 * @version 0.4.0
 * @site UNKNOWN
 * @note Uses jQuery <http://jquery.com/> to show/hide two specific, user-defined sections of the page. See the comments below for notes.
 * @note Look for [EDIT] markers to setup your page elements for this effect.
 * @note Remove all comments and whitespace in this file to reduce file size.
 */
$(document).ready(function() {//fires when the DOM has finished loading
    var $block1           = 'div#short-para';//[EDIT: var to hold our summary class/ID -- change this to your summary]
    var $block2        = 'div#long-para';//[EDIT: var to hold our description class/ID -- change this to description]
    var $link1        = 'ul#paras li a[@href=#short-para]';/*[EDIT: change this value to link for the summary]*/
    var $link2    = 'ul#paras li a[@href=#long-para]';/*[EDIT: change this value to the link for description]*/

	//hide the description container first (showing only the summary at startup)
	$($block2).hide();
	$($link1).addClass("active");
	
	//toggle the summary using our associated summary link
	$($link1).click(function() {
		//if the summary is hidden...
		if ($($block1 + ':not:visible')) {
		  $($block1).show();//show the summary
		  $($block2).hide();//hide the description
		  $($link1).addClass("active");
		  $($link2).removeClass("active");
		//otherwise, if the summary is visible
		} else {
		  $($block2).hide();//hide the description
		  $($block1).show();//show the summary
		}
		return false;//return true so our links jump to the section
	});
	//toggle the summary using our associated summary link
	$($link2).click(function() {
		//if the description is hidden
		if ($($block2 + ':not:visible')) {
		  $($block2).show();//show the description
		  $($block1).hide();//hide the summary
		  $($link2).addClass("active");
		  $($link1).removeClass("active");
		//otherwise, if the description is hidden
		} else {
		  $($block1).hide();//show the summary
		  $($block2).show();//hide the description
		}
		return false;//return true so our links jump to the section
	});
});

$(document).ready(function() {
    var $block1 = 'div#short-list';
    var $block2 = 'div#long-list';
    var $link1 = 'ul#lists li a[@href=#short-list]';
    var $link2 = 'ul#lists li a[@href=#long-list]';

	$($block2).hide();
	$($link1).addClass("active");
	
	$($link1).click(function() {
		if ($($block1 + ':not:visible')) {
		  $($block1).show();//show the summary
		  $($block2).hide();//hide the description
		  $($link1).addClass("active");
		  $($link2).removeClass("active");
		} else {
		  $($block2).hide();
		  $($block1).show();
		}
		return false;
	});

	$($link2).click(function() {
		if ($($block2 + ':not:visible')) {
		  $($block2).show();
		  $($block1).hide();
		  $($link2).addClass("active");
		  $($link1).removeClass("active");
		} else {
		  $($block1).hide();
		  $($block2).show();
		}
		return false;
	});
});
