//=============================================================================
// Cookie Function Lib								Powerd by Axdd system div.
// Version 1.0.0
// Created by Akira.Kusama
//=============================================================================

//------------------------------------
// 更新履歴
//------------------------------------
/*

2006/10/05 v1.0.0 リリース

*/

//===================================
// ::used module::
// use prototype.js
// use Common.js
// ===================================

/* ************************************************************************* */
// Object.utility

// コンストラクタ
function CookieCtrl() {
}

/* ------------------------------------------------------------------------- */
// Method
/* ------------------------------------------------------------------------- */
// Get Cookie
CookieCtrl.prototype.get = function(key) {
	try {
		var utl = new utility();		// Common.js
		
		var c_key = key + "=";
		var begin, end;
		var entry = "";
		
		if (document.cookie.length > 0) {
			begin = document.cookie.indexOf(c_key);
			
			if (begin != -1) {
				begin += c_key.length;
				end = document.cookie.indexOf(";", begin);
				
				if (end == -1) {
					end = document.cookie.length;
				}
				
				if (unescape(document.cookie.substring(begin, end)) != "") {
					entry = unescape(document.cookie.substring(begin, end));
				}
			}
		} else {
			entry = "";
		}
		
		return(utl.ufc(entry));
	} catch (e) {
		alert("CookieCtrl\nfunc:set\n" + e);
	}
}

/* ------------------------------------------------------------------------- */

