function createCookie2(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie2(name) {
	var nameEQ = 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(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie2(name) {
	createCookie2(name,"",-1);
}

function checkCookie2()
{
	if (readCookie2('country')) {
		var country=readCookie2('country');

		if (country==null || country=="") {createCookie2('country','',10);}
		
		return "Y"
	} else {
		return "N"
	}
}

function cookieset() {
	var href = window.location.pathname;
	// don't continue without support for appendChild
	if (document.body.appendChild) {
		if(href.match("canada.html")){		
			createCookie2('country','Canada',10);
		}
		if(href.match("united-states.html")){	
			createCookie2('country','US',10);
		}
		if(href.match("international.html")){		
			createCookie2('country','International',10);
		}
		if(href.match("wealth-about-us.html")){		
			createCookie2('country','Aboutus',10);
		}
	}
}