<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sitesnippet SYSTEM "sitesnippet.dtd">
<!--Adobe GoLive snippet file-->
<snippet version="1.0" title="读取-cookie" type="HTML" author="Transmit Media for Adobe Systems, Inc." description="用于读取现有 cookie 的值的函数。">
	<markupsource>
		<![CDATA[
// Call the function elsewhere to read the value of the cookie
// Example: alert(readCookie("myCookie"));

function readCookie(name)
{
	var cookieValue = "";
	var search = name + "=";
	if(document.cookie.length > 0)
  	{ 
    	offset = document.cookie.indexOf(search);
    	if (offset != -1)
    	{ 
      		offset += search.length;
      		end = document.cookie.indexOf(";", offset);
      		if (end == -1) end = document.cookie.length;
      		cookieValue = unescape(document.cookie.substring(offset, end))
    	}
  	}
return cookieValue;
}]]>
	</markupsource>
</snippet>