
/**
 * called from home page flash via external interface
 */
function setBackground(_filename) 
{
	var exp = new Date(); 
	exp.setTime(exp.getTime() + (1000 * 60 * 60 * 24 * 30));     //30 days 
	document.cookie = "sony_ces_bg=" + _filename + ";path=/;expires=" + exp.toGMTString();
}

function getBackground() 
{
	// cookies are separated by semicolons
	var aCookie = document.cookie.split("; ");
	for (var i=0; i < aCookie.length; i++)
	{
		// a name/value pair (a crumb) is separated by an equal sign
		var aCrumb = aCookie[i].split("=");
		if (aCrumb[0] == "sony_ces_bg") 
	  		return unescape(aCrumb[1]);
	}
  // a cookie with the requested name does not exist, return the first image
  return "ces-bg1.jpg";

}