// JavaScript Document

/*sIFR
var din = { src: '/js-css/din.swf' };
//sIFR.useStyleCheck = true;
sIFR.activate(din);
sIFR.replace(din, {
  selector: '#home h1',
  css: '.sIFR-root { background-color: #fff; font-size: 43px; color: #662086; letter-spacing: -3; leading: -10; }',
  wmode: 'transparent' 
});*/

$(document).ready(function () {	
	$("body").addClass("hasJS");

	// Home Page Rotation
	$('#home ul#rotate').innerfade({
		speed: 'slow',
		timeout: 4000,
		type: 'sequence',
		containerheight: '350px'
	});
	
	// Home Page Login Form
//	$("#login h3:first").addClass("active");
//	$("#login form:not(:first)").hide();
//	$("#login h3").click(function(){
//	  $(this).next("form").slideToggle("slow")
//	  .siblings("form:visible").slideUp("slow");
//	  $(this).toggleClass("active");
//	  $(this).siblings("h3").removeClass("active");
//	});
	
	$("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(); 
    });


});

function popup(url)
{
	if (! document.frm.LoginID.value) 
	{
		alert("Please enter your email address");
	}
	else 
	{
		window.open(url + "?EMAIL=" + document.frm.LoginID.value,null,"width=400,height=250,location=no,toolbar,scrollbars,resizable,top=0,left=0");
	}
}