function SetCookie(n,t,ex) {
	var cook,o,fstr;
	
	o=GetCookie("cz_INT");
	var s=o.indexOf(n+"=");
	
	if (s == -1) {
		fstr = o;
	} else {
		var e=o.indexOf(":",s);
		if (e == -1) {
			o = o + ":";
			e = o.length-1;
		}
		fstr = o.substring(0,s) + o.substring(e+1,o.length);
	}
	
	o = fstr + n + "=" + t + ":";
	var exp=new Date();
	exp.setTime(exp.getTime() + ex * 60 * 60 * 1000);
	cook = 'cz_INT='+ o + "; domain="+cz_domain+"; expires=" + exp.toGMTString();
	document.cookie = cook;
}
function GetCookie(name) {
	s = document.cookie.indexOf(name +"=");
	if (s == -1) 
		return "";
	s += name.length+1;
	e = document.cookie.indexOf(';',s);
	if (e == -1) 
		e = document.cookie.length;
	return document.cookie.substring(s,e);
}

function YHK_GetCookie(name) {
	var a,s,e,d;
	d = GetCookie("cz_INT");
	
	s = d.indexOf(name+"=");
	if (s == -1) 
		return "";
	
	e = d.indexOf(':',s);
	if (e == -1) 
		e = d.length;
	
	s += name.length + 1;
	return d.substring(s,e);
}

function cz_checkOverTime(name, nt, duration) {
	var d;
	var curViews=YHK_GetCookie(name);
	if (curViews == "") {
		SetCookie(name, 1, duration);
	} else {
		curViews++;
		if (curViews > nt) {
			return true;
		}else {
			SetCookie(name, curViews, duration);
		}
	}
	return false;
}

