// JavaScript Document By JK
function timestamp()
{
	var timestamp = Date.parse(new Date());
	return timestamp;
}
/*Cookies Begin*/
function getCookie(name)
{
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen)
	{
	var j = i + alen;
	if (document.cookie.substring(i, j) == arg)
	{
	return getCookieVal(j);
	}
	i = document.cookie.indexOf(" ", i) + 1;
	if (i == 0) break;
	}
	return "";
}
function getCookieVal(offset)
{
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
	{
	endstr = document.cookie.length;
	}
	return unescape(document.cookie.substring(offset, endstr));
}
function deleteCookie(name,path,domain) 
{
	var exp = new Date(); 
	exp.setTime (exp.getTime() - 1); 

    if (getCookie(name)) {
        document.cookie = name + "=" +
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires="+exp.toGMTString();
    }
}
/*Cookies End*/
function isLogin()
{
	if(getCookie("uin") != null && getCookie("uin") != "")
	{
		$("d_login").innerHTML = "<span style=\"margin-left:720px; font-size:12px;\">"+ getCookie("uin") +"  <a href=\"javascript:logOut();\">[ÍË³öµÇÂ¼]</a></span>";	
	}
}


function logOut()
{
	deleteCookie("uin","/","tenpay.com");
	history.go(0);
}

function $(s)
{
	return typeof(s) == "object" ? s : document.getElementById(s);		
}
function $SW(o)
{
	$(o).style.display = "block";	
}
function $HE(o)
{
	$(o).style.display = "none";	
}
