var $j = jQuery.noConflict()
 var path = location.pathname.substring(1);
	jQuery.fn.slideFadeToggle = function(speed, easing, callback) {
        	return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback); 
     	 };
$j(document).ready(function(){
		
	// first example
	$j("#navigation").treeview({
		collapsed: true,
		unique: true,
		animated:"normal",
		persist: "location"
	});
// FAQs
	$j("#faqsid").treeview({
		 collapsed: true,
		unique: true,
		animated:"normal",
		persist: "location"
	});
	
	// second example
	$j("#browser").treeview({
		 collapsed: true,
		unique: true,
		animated:"normal",
		persist: "location"
	});

	$j("#samplebutton").click(function(){
		var branches = $j("<li><span class='folder'>New Sublist</span><ul>" + 
			"<li><span class='file'>Item1</span></li>" + 
			"<li><span class='file'>Item2</span></li></ul></li>").appendTo("#browser");
		$j("#browser").treeview({
			add: branches
		});
	});


	// third example
	$j("#red").treeview({
		animated: "fast",
		//collapsed: true,
		control: "#treecontrol",
		persist: "location"
	});
//////////////////////////


	//	$j(".accordion2 h3").eq(2).addClass("active");           //----------- makes these items show by default
	//$j(".accordion2 p").eq(2).show();		   
	$j(".accordion2 h3").click(function(){  //FAQ & EYEFITNESS NEWS
	$j(this).next("p").slideFadeToggle("slow")
		//$j(this).next("p").fadeToggle("def")
		//$j(this).next("p").fadeTo("def", 1)
		//$j(this).next("p").slideToggle("def")
		.siblings("p:visible").slideFadeToggle("slow");
		//.siblings("p:visible").slideUp("def");
		//.siblings("p:visible").fadeTo("def", 0);
		$j(this).toggleClass("active");                  //---------flips arrow image
		$j(this).siblings("h3").removeClass("active");
		return false;
	});	
$j(".accordion2 p").click(function(){
$j(this).slideFadeToggle("slow")
		//$j(this).fadeTo("def", 0);
		//$j(this).slideUp("def")
		$j(this).siblings("h3").removeClass("active");
		//$j(this).parent("h3").removeClass("active");
		return true;
	});

$j(".menu h3").click(function(){
	$j(this).next("p").slideFadeToggle("slow")
		//$j(this).next("p").fadeToggle("def")
		//$j(this).next("p").fadeTo("def", 1)
		//$j(this).next("p").slideToggle("def")
		.siblings("p:visible").slideFadeToggle("slow");
		//.siblings("p:visible").slideUp("def");
		//.siblings("p:visible").fadeTo("def", 0);
		$j(this).toggleClass("active");                  //---------flips arrow image
		$j(this).siblings("h3").removeClass("active");
		return false;
	});	
$j(".menu p").click(function(){
$j(this).slideFadeToggle("slow")
		//$j(this).fadeTo("def", 0);
		//$j(this).slideUp("def")
		$j(this).siblings("h3").removeClass("active");
		//$j(this).parent("h3").removeClass("active");
		return true;
	});

/*$j(window).load(function () {
	var path = location.pathname.substring(1);
  		$j('#bottomLinks a[@href$="' + path + '"]').addClass('active');
		  $j('#topLinks a[@href$="' + path + '"]').addClass('active');
});
*/


/////////////

})(jQuery); //* hide the namespace
//});