
// Original code by Tom Negrino and Dori Smith. Code modified by Forrest Thomas.

window.onload = cookieVal;

function cookieVal() {
	
	thisCookie = document.cookie.split("; ");
	
	for(i=0; i<thisCookie.length; i++) {
	
		if ((thisCookie[i].split("=")[0] == "hpLink") && (thisCookie[i].split("=")[1] == "Personal")) {
		window.open("personal.aspx", "_self");
		}
		
		if ((thisCookie[i].split("=")[0] == "hpLink") && (thisCookie[i].split("=")[1] == "Business")) {
		window.open("business.aspx", "_self");
		//document.getElementById("cookieButton").value = "Welcome to Security National";
		}
		
		if ((thisCookie[i].split("=")[0] == "hpLink") && (thisCookie[i].split("=")[1] == "WealthManagement")) {
		window.open("wealth-management.aspx", "_self");
		}
		
		if ((thisCookie[i].split("=")[0] == "hpLink") && (thisCookie[i].split("=")[1] == "Mortgage")) {
		window.open("mortgage-lending.aspx", "_self");
		}
	
	}	
}	
	
	
	


