function get_cookie() {

var LocationNameCookie = "";

	LocationNameCookie = document.cookie.split("; ");
	for (var i=0; i<LocationNameCookie.length; i++){
	if (LocationNameCookie[i].split("=")[0] == "LocationName"){
		$(".placeholder").html(decodeURIComponent(LocationNameCookie[i].split("=")[1]));
		$(".form .address").attr({value: (decodeURIComponent(LocationNameCookie[i].split("=")[1]))});
	}
	}

}

//triggered by onclick of "showCookieButton" button in div "cookiedata" file "ServiceAreaLookup.htm"
function showCookies() {

var outMsg = "";

if (document.cookie == "") {
	outMsg = "There are no cookies here";
	}
	else {

		var thisCookie = document.cookie.split("; ");

		for (var i=0; i<thisCookie.length; i++) {
		
			outMsg += "Cookie name is '" + thisCookie[i].split("=")[0];
			outMsg +="', and the value is '" + decodeURIComponent(thisCookie[i].split("=")[1]);

		}
	}

	document.getElementById("cookiedata").innerHTML = outMsg;
}

	
//triggered by "Yes" button in "Message" div file "ServiceAreaLookup.htm" thru test_region.js function "showAddress"
var LocationVar;
var LocationHolderVar

function setLocation() {
	LocationVar = document.forms[0].address.value;
	var expireDate = new Date();
	var LocationHolderVar = LocationVar
	expireDate.setMonth(expireDate.getMonth()+6);
	document.cookie = "LocationName=" + encodeURIComponent(LocationVar) +";expires=" + expireDate.toGMTString();
	document.cookie = "Region=" + encodeURIComponent(RegionNameForCookie) +";expires=" + expireDate.toGMTString();
	
}	
/*
function LocationResponse() {

	if (LocationVar = "Type the address you would like service at here."){
	document.getElementById("Location").innerHTML = "Sorry, no location has been set. Please click here to choose a service location."
	}
}

function NoCookie() {

	if (document.cookie == "") {
		if (locationVar = "Type the address you would like service at here.") {
		document.getElementById("Location").innerHTML = "Sorry, no location has been set. Please <a href="/service_area_lookup.htm">click here</a> to choose a service location."
		}
		if (locationVar != "")
}*/

























