// JavaScript Document

/*sIFR*/
var din = { src: '/js-css/din.swf' };
//sIFR.useStyleCheck = true;
sIFR.activate(din);
sIFR.replace(din, {
  selector: 'h1',
  css: '.sIFR-root { background-color: #fff; color: #662086; letter-spacing: -2; font-size: 34px; leading: -3; }',
  wmode: 'transparent' 
});

$(document).ready(function () {	
	$("body").addClass("hasJS");
	
	$("a[rel]").overlay({expose: '#333333', effect: 'apple'});
	
	//State Benefits Map
	$("#stateabbr a").click(function(){
		$(".stateinfo").fadeOut('fast');
		$("#stateabbr a").removeClass('active');
		$(this).addClass('active');
		var selectDiv = $(this).attr('href');
		$(selectDiv).fadeIn('slow');
		var abbrPos = $(this).position();
		var infoPos = $(selectDiv).position();
		var posLeft = abbrPos.left + 73;
		var posTop = abbrPos.top + 75;
		$(selectDiv).css( { "top": + posTop + "px", "left": posLeft + "px"} );
//		$(".stateinfo li, .stateinfo h3, .stateinfo ul").css('opacity', .8);
		return false;
	});
	

	$("a.top").click(function(){
		$(".stateinfo").fadeOut('fast');
		return false;
	//	$(this).append.attr('href')
	});
	
	// expose the form when it's clicked or cursor is focused 
    $("#login").bind("click keydown", function() { 
        $(this).expose({ color: '#fff' }).load(); 
    });
	
	///Timeline and Program Components
	
	$(".timeline h3:first").addClass("active");
	$(".timeline div:not(:first)").hide();

	$(".timeline h3").click(function(){
	  $(this).next("div").fadeIn("slow")
	  .siblings("div:visible").fadeOut("fast");
	  $(this).toggleClass("active");
	  $(this).siblings("h3").removeClass("active");

	});
	
	//Team Page HIghlight
//	$("#team a").live('click', function(){
//		$("p").removeClass("highlight");
//		$("#team a").removeClass("active");
//		$(this).addClass("active");
//		hashID = $(this).attr('href');
//		$(hashID).addClass("highlight");
//		return false;
//	});	
	
//	$("#team a").hover(function(){
//		$("p").removeClass("highlight");
//		$("#team a").removeClass("active");
//		$(this).addClass("active");
//		hashID = $(this).attr('href');
//		$(hashID).addClass("highlight");
//		return false;
//	});	

	
	$("#team a.ec").hover(function(){
		$("p").removeClass("highlight");
		$('#ec').toggleClass("highlight");
	});	
	
	$("#team a.jf").hover(function(){
		$("p").removeClass("highlight");
		$('#jf').toggleClass("highlight");
	});	
	
	$("#team a.rs").hover(function(){
		$("p").removeClass("highlight");
		$('#rs').toggleClass("highlight");
	});	
	
	$("#team a.kl").hover(function(){
		$("p").removeClass("highlight");
		$('#kl').toggleClass("highlight");
	});	



});