function setCookie(key, val, tmp) {
	tmp = key + "=" + escape(val) + "; ";
	// tmp += "path=" + location.pathname + "; ";
	//tmp += "expires=Tue, 31-Dec-2030 23:59:59; ";
	document.cookie = tmp;
}

function getCookie(key) {
	var tmp = document.cookie + ";";
	var start, end;
	var k_pos = tmp.indexOf(key, 0);
	
	if(k_pos != -1){
		tmp = tmp.substring(k_pos, tmp.length);
		start = tmp.indexOf("=", 0) + 1;
		end = tmp.indexOf(";", start);
		return(unescape(tmp.substring(start, end)));
	}
	return("");
}






