<!--
//-- class param_dic {
param_dic = function(p_src) {
	this.m_dic = new Object();
	this.m_const = {
		build_pure:'build_pure',
		build_encode:'build_encode',
		build_escape:'build_escape'
	};
	if (!!p_src) {
		this.load_data(p_src);
	}
};

param_dic.prototype.split_item = function(p_item) {
	var a_item = p_item.split('=');
	var b_ret = (a_item.length == 2);
	var s_key, s_val;
	if (b_ret) {
		s_key = a_item[0];
		s_val = a_item[1];
	}
	return {
		b_ret:b_ret,
		s_key:s_key,
		s_val:s_val
	};
}

param_dic.prototype.get_count = function() {
	var n_count = 0;
	for (var o_key in this.m_dic) { if (this.exists(o_key)) { n_count++; } }
	return n_count;
}
param_dic.prototype.get_item = function(p_key) { return (this.exists(p_key) ? this.m_dic[p_key] : ''); }
param_dic.prototype.let_item = function(p_key, p_val) { this.m_dic[p_key] = p_val; }

param_dic.prototype.add = function(p_key, p_val) {
	var b_exists = this.exists(p_key);
	this.let_item(p_key, p_val);
	return b_exists;
}
param_dic.prototype.remove = function(p_key) {
	var b_exists = this.exists(p_key);
	if (b_exists) { delete this.m_dic[p_key]; }
	return b_exists;
}
param_dic.prototype.removeall = function() {
	if (!!this.m_dic) { delete this.m_dic; }
	this.m_dic = new Object();
}
param_dic.prototype.exists = function(p_key) {
	return ((!!this.m_dic[p_key]));
}
param_dic.prototype.keys = function() {
	var a_ret = new Array;
	for (var o_key in this.m_dic) {
		a_ret[a_ret.length] = o_key;
	}
	return a_ret;
}

param_dic.prototype.load_data = function(p_src) {
	this.removeall();
	this.append_data(p_src);
}
param_dic.prototype.load_data_unescape = function(p_src) {
	this.removeall();
	this.append_data(p_src, this.m_const.build_escape);
}
param_dic.prototype.append_data = function(p_src, p_option) {
	if ((!!p_src ? p_src : '').length == 0) { return this.get_count(); }
	var a_item = p_src.split('&');
	var o_item;
	for (var i = 0; i < a_item.length; i++) {
		o_item = this.split_item(a_item[i]);
		if (o_item.b_ret) {
			if (p_option == this.m_const.build_escape) {
				o_item.s_val = unescape(o_item.s_val);
			}
			this.add(o_item.s_key, o_item.s_val);
		}
	}
	return this.get_count();
}
param_dic.prototype.get_querystring = function(p_items, s_param) {
	var o_p = this.clone_param_dic(p_items);
	o_p.append_data(s_param);
	return o_p.build_querystring(this.m_const.build_pure);
}
param_dic.prototype.get_querystring_encode = function(p_items, s_param) {
	var o_p = this.clone_param_dic(p_items);
	o_p.append_data(s_param);
	return o_p.build_querystring(this.m_const.build_encode);
}
param_dic.prototype.get_querystring_escape = function(p_items, s_param) {
	var o_p = this.clone_param_dic(p_items);
	o_p.append_data(s_param);
	return o_p.build_querystring(this.m_const.build_escape);
}
param_dic.prototype.build_querystring = function(p_option) {
	var o_key, s_key, s_val;
	var s_param = '';
	for (o_key in this.m_dic) {
		s_key = o_key.toLowerCase();
		if (s_key.length > 0) {
			s_val = this.m_dic[s_key];
			if (s_val.length > 0) {
				if (p_option == this.m_const.build_encode) {
					s_val = encodeURIComponent(s_val);
				}
				else if (p_option == this.m_const.build_escape) {
					s_val = escape(s_val);
				}
				s_param += (s_key + '=' + s_val + '&');
			}
		}
	}
	return s_param.substring(0, s_param.length - 1);
}
param_dic.prototype.clone_param_dic = function(p_items) {
	var a_item;
	if ((!!p_items ? p_items : '').length > 0) {
		a_item = p_items.split(',');
	}
	else {
		a_item = this.keys();
	}
	var o_p = new param_dic();
	for (var i = 0; i < a_item.length; i++) {
		o_p.add(a_item[i], this.get_item(a_item[i]));
	}
	return o_p;
}
//-- class param_dic }
//-->