/***********************************************************************************************************************
DOCUMENT: includes/javascript.js
DEVELOPED BY: Ryan Stemkoski
COMPANY: Zipline Interactive
EMAIL: ryan@gozipline.com
PHONE: 509-321-2849
DATE: 3/26/2009
UPDATED: 3/25/2010
DESCRIPTION: This is the JavaScript required to create the accordion style menu.  Requires jQuery library
NOTE: Because of a bug in jQuery with IE8 we had to add an IE stylesheet hack to get the system to work in all browsers. I hate hacks but had no choice :(.
************************************************************************************************************************/
var $j = jQuery.noConflict();

$j(document).ready(function() {
							
	$j(".accordContent").css("display","none");// Hide all Accord Content Divs
	$j(".accordElementWrapper").css("background","none");
	$j(".active").next(".accordContent").css("display","block");
	$j(".active").parent(".accordElementWrapper").css("background","url(../images/general/sideNavTransBg.png)");
	
	$j('.accordHeading').click(function(){ //On Click of a header
	
	if($j(this).next().is(':hidden') == true) {  // If the Next Element (accordContent) is hidden
			
			//CLOSE OTHER SLIDES
			$j(this).siblings('.accordContent').slideUp('slow');//Close Siblings .accordContent 
			$j(this).parent().siblings().children('.accordContent').slideUp('slow'); //Close Parents Siblings Children (Cousins) .accordContent
			
			//OPEN THE SLIDE
			$j(this).parent(".accordElementWrapper").css("background","url(../images/general/sideNavTransBg.png)");
			$j(this).next().slideDown('slow'); //Open Next Element (accordContent)
			
		 }
	else {
		$j(this).next().slideUp('slow'); //Open Next Element (accordContent)
		
	}
	
	});




});

	
