<!--
///////////////////////////////////////////////////////////////////////////////
//
// 张树林 - 慧佳工作室
//
// Module Name:     cookie.js
// Abstract:        cookie操作
// Version:         1.0
// Date				2008-06-11
// Author:          woods·zhang
// Email:           hoojar@163.com 
// MSN:             hoojar@hotmail.com
// Website:         http://www.hoojar.com/
// Copyright 2001-2008, Hoojar studio All Rights Reserved
//
// 版权 2001-2008，慧佳工作室所有版权保护

//The software for free software, allowing use, copy, 
//modify and distribute the software and files. Any 
//use of this software must place a copy of all the 
//above copyright notice. By the software Huijia studio 
//maintenance, if you have any queries please contact us.
//Thank you. 
//
//此软件为自由软件，允许使用、拷贝、修改、分发本软件及其文档。
//任何使用此软件的地方都得出现以上版权通告所有副本。此软件由
//慧佳工作室维护，如果您有什么疑问请与我们联系。谢谢使用。
//
///////////////////////////////////////////////////////////////////////////////

//获取cookie
function getCookie(name)
{
	var search = name + "="
	if (document.cookie.length > 0)
	{
		var offset = document.cookie.indexOf(search)
		if (offset != -1)
		{
			offset += search.length;
			var end = document.cookie.indexOf(";", offset);
			if (end == -1)
			{
				end = document.cookie.length;
			}
			return unescape(document.cookie.substring(offset, end));
		}
	}
	return "";
}

//存储cookie
function setCookie(name, value, days)
{
	var expires = "";
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime() + (days*24*60*60*1000));
		expires = ";expires=" + date.toGMTString();
	}
	value = escape(value);
	document.cookie = name + "=" + value + expires + ";path=/;domain=" + document.location.hostname;
}
//-->