$(document).ready(function(){
	
/* CONFIG */

/* set start (sY) and finish (fY) heights for the list items */


sY = 35; /* height of li.sub */

fY = 100; 


/* height of maximum sub lines * sub line height */

/* end CONFIG */



/* open first list item */
var _data = $('.clicked').attr( 'data' );
if(_data!=null) animate(_data)
else animate(fY)


$("#slide .sub").click(function() {

	if (this.className.indexOf('clicked') != -1 ) {

		animate(sY)

		$(this)			.removeClass('clicked')

						.css("background", "#e8e8e1")

						.css("color", "#ba5804");

		}

		else {

		animate(sY)




		$('.clicked')	.removeClass('clicked')

						.css("background", "#e8e8e1")

						.css("color", "#ba5804");		

		$(this)			.addClass('clicked');		
		
		 var _div = $($(this).children()[1]);
		 var _ul = $(_div.children()[0]);			 
		 var _data = _ul.attr( 'data' );
		 if(_data!=null) animate(_data)
		 else animate(fY)
		

	}

});



function animate(pY) { 
$('.clicked').animate({"height": pY + "px"}, 400);

}



$("#slide .sub")		.hover(function(){

$(this)					.css("background", "#e8e8e1")

						.css("color", "#ba5804");

},function(){

if (this.className.indexOf('clicked') == -1) {

$(this)					.css("background", "#e8e8e1")

						.css("color", "#ba5804");


}

});



});

/* ]]> */


