Event.observe(window, 'load', initStateSelector);

function initStateSelector(){
	//get state cookie, if exists
	var sc = getStateCookie();
	re=/^[A-Za-z][A-Za-z]$/;
	if (!re.test(sc)) {
		//alert("no cookie");
		$('stateSelectorBackground').setStyle({display:"block"});
		$('stateSelector').setStyle({display:"block"});
	}
}

function setStateCookie(state) {    
		//alert('setting: '+state); 
    jimAuld.utils.cookies.set('state',state,24,'','.bankofamerica.com');
}

function getStateCookie() {
	var stateCookie = jimAuld.utils.cookies.get('state');
	return(stateCookie);

}

function	doStateSelect(){
	//alert("doing stateSelect");
	setStateCookie($('stateSelect').value);
}