/*
*	Accordion Plugin For Jquery
* 	Edreamz 2008 | JJohnson
* 	
*   HTML Needed:
* 
*   <dl id="accordion">
*   	<dt>This is the label that will be clickable</dt>
*   	<dd>This is what 'slides down' and appears when the label above it is clicked</dd>
*   </dl>
*   
*   You can use CSS to style the above elements however you see fit.
* 
*  JS Needed:
*  
*  In the app.js $(document).ready() function use:
*  $('#accordion').accordion(); to have all the dd showing
*  #('#accordion').accordion(true); to have all the dd's hidden
* 
*/

$.fn.accordion = function(isClosed){
		var element = this;
		if(isClosed){
			$("#accordion dd").hide();
		}
 		$("#accordion dt").click(function () {
			if ($(this).next('#accordion dd').css('display') != "block") {
				$(this).next('#accordion dd').slideDown();
			}else{
				$(this).next('#accordion dd').slideUp();
			}
        });	
	
}; 