function getCookie(key,  tmp1, tmp2, xx1, xx2, xx3)
	{
    tmp1 = " " + document.cookie + ";";
    xx1 = xx2 = 0;
    len = tmp1.length;
    while (xx1 < len)
		{
        xx2 = tmp1.indexOf(";", xx1);
        tmp2 = tmp1.substring(xx1 + 1, xx2);
        xx3 = tmp2.indexOf("=");
        if (tmp2.substring(0, xx3) == key)
			{
            return(unescape(tmp2.substring(xx3 + 1, xx2 - xx1 - 1)));
			}
        xx1 = xx2 + 1;
		}
    return("");
	}

function setCookie(key, val, tmp)
	{
    tmp = key + "=" + escape(val) + "; ";
    tmp += "expires=";
	tmp += DateString();
    document.cookie = tmp;
	}

function clearCookie(key)
	{
    document.cookie = key + "=" + "xx; expires=1-Jan-1997 00:00:00;";
	}

function DateString()
	{
	yobi = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
	tuki = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
	gmt = new Date();
	gmt.setTime(gmt.getTime() + (24 * 3600*180));
	day = gmt.getUTCDay();
	dd = gmt.getUTCDate();
	mm = gmt.getUTCMonth();
	yy = gmt.getUTCFullYear();
	hour = gmt.getUTCHours();
	min = gmt.getUTCMinutes();
	sec = gmt.getUTCSeconds();
	if (dd < 10) { dd = "0" + dd; }
	if (hour < 10) { hour = "0" + hour; }
	if (min < 10) { min = "0" + min; }
	if (sec < 10) { sec = "0" + sec; }
	return(yobi[day] + ", " + dd + "-" + tuki[mm] + "-" + yy + " " + hour + ":" + min + ":" + sec + " GMT; ");
	}

function convCurrency(num)
	{
	var tmp,tmp2,tmp3,i;
	tmp = num + "";
	tmp3 = "";
	tmp2 = 0;
	for(i = tmp.length;i > 0;i--)
		{
		tmp3 = tmp.substr(i - 1,1) + tmp3;
		tmp2++;
		if(tmp2 == 3)
			{
			if(i != 1)
				{
				tmp3 = "," + tmp3;
				tmp2 = 0;
				}
			}
		}
	return(tmp3);
	}

function setLongLiveCookie(key, val, tmp)
	{
	tmp = key + "=" + escape(val) + "; ";
	tmp += "expires=Fri, 31-Dec-2030 23:59:59; ";
	document.cookie = tmp;
	}

