function getCookie(NameOfCookie)
{ 
	if (document.cookie.length > 0)
	{ 
		begin = document.cookie.indexOf(NameOfCookie+"=");
		if (begin != -1)
		{
			begin += NameOfCookie.length+1;
			end = document.cookie.indexOf(";", begin);
			if (end == -1) 
				end = document.cookie.length;
			return unescape(document.cookie.substring(begin, end)); 
		}
	}
	return null;
}



function setCookie(NameOfCookie, value, expiredays)
{ 
	var ExpireDate = new Date ();
	ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
	document.cookie = NameOfCookie + "=" + escape(value) +
	((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
	//alert('setCookie: '+NameOfCookie+' = '+value);
	//alert('getCookie: bgNusic = '+getCookie('bgMusic'));
}



function delCookie (NameOfCookie)
{ 
	if (getCookie(NameOfCookie)) 
	{
	document.cookie = NameOfCookie + "=" +
	"; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}

if(getCookie('bgMusic')==null)
{
	setCookie('bgMusic','true',1);
}

function getUpdate(typ,pr1,pr2,swf) { 
   if(typ == 'state') {
	   if(pr1==0){
			setCookie('bgMusic','false',1);
			//alert('bg music is: false');
	   }
	   else
	   {
	   		setCookie('bgMusic','true',1);
	  		//alert('bg music is: true');
	   }
  }
};