function setCookie(name, value, expires) 
{
	// Set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );

	/*
	If the expires variable is set, make the correct expires time.
	The current script below will set it for x number of days.
	To make it for hours, delete "* 24" , for minutes, delete "* 60 * 24"
	*/
	if ( expires )
	{
		expires = expires * 1000 * 60 * 60 * 24;
		
		// Make this 6 months
		expires = expires * 6
	}
	var expires_date = new Date( today.getTime() + (expires) );

	document.cookie = escape(name) + "=" + escape( value ) + ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + ";path=/";	
    document.close();
}

function getCookie(name) 
{
	var start = document.cookie.indexOf(unescape(name) + "=");
	var len = start + name.length + 1;
	var end = document.cookie.indexOf( ";", len );	
	
	if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) )
		return null;

	if ( start == -1 ) 
		return null;
	
	if ( end == -1 ) 
		end = document.cookie.length;

	var hold = unescape( document.cookie.substring(len, end) );
	return hold;
}

function delCookie(name, domain) 
{
	if ( getCookie(name) ) 
		document.cookie = name + "=" + ";expires=Thu, 01-Jan-1970 00:00:01 GMT;";
}

function redirectUSPage()
{
	var status = getCookie('USResident');

	if (status == "Yes" || status == "yes")
	{
		window.location = "/client_services/asset_management/mutual_funds/u_s_funds/index.html";
	}
	else if (status == "No" || status == "no")
	{
		window.location = "/client_services/asset_management/mutual_funds/non_us_disclaimer.html";
	}
	else
	{
		window.location = "/client_services/asset_management/mutual_funds/u_s_funds.html";
	}
}

function redirectMutualFunds()
{
	window.location = "/client_services/asset_management/mutual_funds/index.html";
}