$(document).ready(function(){

// accordion 

	$(".accordion p").hide();

	$(".accordion h3").click(function(){
		$(this).next("p").slideToggle("slow")
		.siblings("p:visible").slideUp("slow");
		$(this).toggleClass("active");
		$(this).siblings("h3").removeClass("active");
		
	});

// pulldown 


	if ($.browser.msie && parseInt($.browser.version)< 7) {
	    $("#primary-nav li").hover(
            function() {
            	$(this).addClass("sf");
            },
            function() {
		$(this).removeClass("sf");
            });
	}


// hash 

	// get the current hash
	var hash = window.location.hash.substr(1);
	
	// get all the tab containers
	var tabContainers = $('div.tabs > div');
	
	// get all the tab buttons
	var tabButtons = $('div.tabs ul.tabNavigation a')

	// show the proper tab
	// default case if no hash is select
	if (hash.length === 0) {
		hash = 'firstTab';
	}
	showTab(hash);
	
	// listen for click on tab buttons
	tabButtons.click(showTab);
		
		
		
	function showTab(arg) {
		// hide all the tab containers
		tabContainers.hide();
		
		// unselect all the tab buttons
		tabButtons.removeClass('selected');
		
		// if the argument is a string, use that as the tab name
		if (typeof arg == 'string') {
			if (arg.length == 0) {
				return;
			}
			tabName = '#' +  arg;
			
			tabBtn = tabButtons.filter(function(index) {
				return this.href.indexOf(tabName) != -1;
			});
		} else {
			// otherwise, this is a click event
			tabName = '#' + this.href.split('#')[1];
			tabBtn = this;
		}
			
		
		// show the proper tab
		$(tabName).show();
		
		// select the clicked button
		$(tabBtn).addClass('selected');
		

		return false;
	}


});







