<!--

function readCookie(name) {
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
	}
	return null;
}

function checkState(){
	var stateResidence = readCookie('Residence=');
    if (stateResidence != null) {
		var testList = document.getElementById("state");
		if(document.getElementById("state") != null){
			for (i=0; i < document.getElementById("state").options.length; i++) {
				if (document.getElementById("state").options[i].value == stateResidence) {
					document.getElementById("state").options[i].selected = true;
				}
			}
        }		
    }
}

function validateForm(theForm) {
    if (theForm.state.options[theForm.state.selectedIndex].value == "0") {
        alert("Please select a state.");
        return false;
    }
    else {
        return true;
    }
}

/*
	Attaches window onload event handler
*/
	/*if(window.attachEvent) {
		window.attachEvent("onload", checkState);		
	}
	
	else if(window.addEventListener) {
		window.addEventListener("load", false);		
	}
	
	else {
		var oldonload = window.onload;
		if(typeof window.onload != 'function'){
			window.onload = initPageLoad;
		}
		
		else {
			window.onload = function() {
				oldonload();
				checkState(null);
			}
		}
	}*/
//-->
