// UmixSlider JavaScript Document

$(document).ready(function(){
	//  Get height of all des before hide() occurs.  Store height in heightArray, indexed based on the de's position.
	heightArray = new Array();
	$("div.d_show_hide .de, div.d_show_hide .dd").each(function(i) {
	  theHeight = $(this).height();
	  heightArray[i] = theHeight;
	});

	// Hide all des
	$("div.d_show_hide .de, div.d_show_hide .dd").hide();

	//  When a tt is clicked, 
	
	$("div.d_show_hide .tt").click(function () {
	  
	  //  Based on the tt's position in the div, retrieve a height from heightArray, and re-assign that height to the sibling de.
	  
	  $(this).next("div.d_show_hide .de, div.d_show_hide .dd").css({height: heightArray[$("div.d_show_hide .tt").index(this)]});
	  
	  //  Toggle the divideVisibility of the de directly after the clicked de
	  
	  $(this).next("div.d_show_hide .de, div.d_show_hide .dd").slideToggle("slow");
	});
 });


/*
$(document).ready(function(){
var $div = $('div.d_show_hide .de');
var height = $div.height();
$div.hide().css({ height : 0 });

$('div.d_show_hide .tt').click(function () {
  if ( $div.is(':visible') ) {
    $div.animate({ height: 0 }, { duration: 2500, complete: function () {
        $div.hide();
      } 
    });
  } else {
    $div.show().animate({ height : height }, { duration: 2500 });
  }
    
  return false;
});
});
*/



