﻿function getCookie(c_name)
{
	var i,x,y,ARRcookies=document.cookie.split(";");
	for (i=0;i<ARRcookies.length;i++)
  	{
  		x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
  		y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
  		x=x.replace(/^\s+|\s+$/g,"");
  		if (x==c_name)
    	{
    		return unescape(y);
    	}
  	}
}

function setCookie(c_name,value,time){
	var strsec=getsec(time);
	var exp=new Date();
	exp.setTime(exp.getTime() + strsec*1);
	document.cookie=c_name+"="+ escape(value)+";expires="+exp.toGMTString()+";path=/web/";
}

function getsec(str){
	var str1=str.substring(1,str.length)*1; 
	var str2=str.substring(0,1); 
	if(str2=="h"){
		return str1*60*60*1000;
	}
	else if(str2=="d"){
		return str1*24*60*60*1000;
	}
}

function CheckUser(uid)
{
    if (getCookie("U_member") != "") {
		setCookie("U_member",uid,"h1");
	}
	countDown();
}
