<!--
if (!__IMG_BASE)
{
var __AJAX_DOMAIN = window.location.href.toLowerCase().replace(/^http:\/\//,'').replace(/(\/|:).*/,'').replace(/^[^\.]+\.([^\.]+\.)/,'$1');
var __IMG_BASE = 'http://img.'+__AJAX_DOMAIN;
var __CKDOMAIN = '.'+__AJAX_DOMAIN;
}

function cookieAndSerialize(domain,path,misccookiename)
{
this.cookieCache = new Array;
if (domain)
	{
		this.domain = domain;
	}
else
	{
		this.domain = window.location.href.toLowerCase().replace(/^http:\/\//,'').replace(/(\/|:).*/,'').replace(/^[^\.]+\.([^\.]+\.)/,'$1');
		if (this.domain.indexOf('ngacn.com')!=-1)
			{
				this.domain = '.ngacn.com';
			}
	}
this.path = path;
this.date = new Date;
this.now = this.date.getTime();
this.misccookiename = misccookiename

this.setCookieInSecond = function (name,value,sec)
{
this.date.setTime(this.now + sec*1000);
document.cookie = name + "="+ escape (value) + ";domain="+this.domain+";path="+this.path+";expires=" + this.date.toUTCString();
}
//fe

this.setMiscCookieInSecond = function (name,value,sec)
{
if (typeof(this.cookieCache[this.misccookiename]) != 'object')
	{
		this.getCookie(this.misccookiename);
		this.cookieCache[this.misccookiename] = this.simpTxtAryPhpUnserialize(this.cookieCache[this.misccookiename]);
	}

if (value && sec>0)
	{
		this.date.setTime(this.now + sec*1000);
		this.cookieCache[this.misccookiename][name] = new Array;
		this.cookieCache[this.misccookiename][name]['v'] = value;
		this.cookieCache[this.misccookiename][name]['t'] = this.date.toUTCString();
	}
else
	{
		this.cookieCache[this.misccookiename][name] = void(0);
	}
this.setCookieInSecond(this.misccookiename,this.simpTxtAryPhpSerialize(this.cookieCache[this.misccookiename]),31536000);
}
//fe

this.getMiscCookie = function (name)
{
if (typeof(this.cookieCache[this.misccookiename]) != 'object')
	{
		this.getCookie(this.misccookiename);
		this.cookieCache[this.misccookiename] = this.simpTxtAryPhpUnserialize(this.cookieCache[this.misccookiename]);
	}
if (this.cookieCache[this.misccookiename][name] && (Date.parse(this.cookieCache[this.misccookiename][name]['t'])>=this.now) )
	{
		return this.cookieCache[this.misccookiename][name]['v'];
	}
else
	{
		if (this.cookieCache[this.misccookiename][name])
			{
				this.cookieCache[this.misccookiename][name] = void(0);
				this.setCookieInSecond(this.misccookiename,this.simpTxtAryPhpSerialize(this.cookieCache[this.misccookiename]),31536000);
			}
		return null;
	}
}
//fe

this.getCookie = function (name)
{
if (!this.cookieCache[name])
	{
		var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
		if (arr)
			{
				this.cookieCache[name] = unescape(arr[2]);
			}
		else
			{
				this.cookieCache[name] = '';
			}
	}
return this.cookieCache[name];
}
//fe

//only array/string type avilable,no mutibyte char
this.simpTxtAryPhpSerialize = function (a)
{
var s = "";
var i = 0;
for (k in a)
	{
		if (typeof(a[k]) == 'object')
			{
				s = s + "s:" + String(k).length + ':"' + String(k) + '";'+ this.simpTxtAryPhpSerialize (a[k]);
				i++;
			}
		else if (typeof(a[k]) != 'undefined')
			{
				s = s + "s:" + String(k).length + ':"' + String(k) + '";s:' + String(a[k]).length + ':"' + String(a[k]) + '";';
				i++;
			}
	}
s = "a:" + i + ":{" + s + "}";
return s;
}
//fe

//only array/string type avilable,no mutibyte char
this.simpTxtAryPhpUnserialize = function (txt)
{
	function cut1()
	{
	var t;
	var l;
	var x;
	txt = txt.replace(/["};]*;?(s|a):(\d+):["{]?/,function($0,$1,$2)
		{
			t = $1;
			l = $2;
			return ('');
		}
	);
	if (t == 's')
		{
			x = txt.substr(0,l);
			txt = txt.substr(l);
		}
	else if (t == 'a')
		{
			txt = 'a:'+l+':{'+txt;
			x = rep();
		}
	return (x);
	}
	function rep()
	{
		var total;
		var i = 0;
		var a = new Array;
		txt = txt.replace(/"|}?;?(a):(\d+):\{?/,function($0,$1,$2)
			{
				total = $2;
				return ('');
			}
		);
		while (i<total)
			{
				a[cut1()]=cut1();
				i = i+1;
			}
		return (a);
	}
return (rep());
}
//fe
}
-->