/* GoToCountry
 * parameters:	clickEvent - event object
 * 
 * Checks that the user clicked on a link within the SelectCountry DIV, and creates a cookie
 * storing the url that was clicked on.
*/
function GoToCountry(clickEvent)
{
	if(!clickEvent)
		clickEvent = window.event;
	var target;
	if((target = clickEvent.target) || (target = clickEvent.srcElement))
	{
		if(target.tagName == "A" || target.tagName == "a")
		{
			if(document.getElementById("rememberSelection").getElementsByTagName("form")[0].remember.checked)
			{
				createCookie(target);
			}
		}
	}
}

/* createCookie
 * parameters:	value - String containing the href
 * 
 * Creates a cookie with the storing the passed value parameter.  The cookie expires one year
 * from now.
*/
function createCookie(value)
{
	
	var expires = "";
	var expireDate = new Date();
	expireDate.setMonth(expireDate.getMonth() + 12);
	var expires = "; expires=" + expireDate.toUTCString();
	 
	var cookieValue = "BusinessLocaleURL=" + value + expires + "; path=/";
	document.cookie = cookieValue;
}
