﻿// dropdown fix - Scoped to IE6

isIE6 = navigator.userAgent.toLowerCase().indexOf('msie 6') != -1;
if (isIE6) {
	sfHover = function() {
		var sfEls = document.getElementById("navWrapper").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}
	if (window.attachEvent) window.attachEvent("onload", sfHover); 
}

$(document).ready(function(){

//accordion
$(".accordion_body").hide();
//slides the element with class "accordion_body" when paragraph with class "accordion_header" is clicked
$("div.accordion_header").click(function() {

$(this).toggleClass('active');
$(this).next("div.accordion_body").slideToggle("normal").siblings("div.accordion_body").slideUp("normal");
$(this).siblings("div.accordion_header").removeClass("active");
});

// tabs
$("#tabs > ul").tabs();

  
  
  
  
  
  });

$(document).ready(function(){
		$('#resourcesFor').change(function() {
    	$('#audienceContainer div').hide();            // added a bit of animation
    	var e = '#' + $(':selected', $(this)).attr('name');
    	$(e).show('fast');                             // while we change the feed
		});

		$('#audienceContainer div').hide();
		$('#audienceContainer div#audience0').show();


		$('#audienceContainer select').change(function() {
      window.location.href = this.value;
			}
		);
});

$(document).ready(function(){
var tabFields = $("div#tabs ul li.tab-label");
var tabFieldsIn = $("div#tabs ul li a span");
var tabField1 = tabFields[0];
for (var i = 0; i < tabFields.length; i++) {
if (!tabFieldsIn[i].firstChild) {
tabFields[i].className = "noShow";
}}
});
