function enquete(url, entry) {
	this.action      = (url || "") + "?__mode=${0}&id=${1}";
	this.node        = null;
	this.entry       = entry || "";
	this.description = "解決しましたか？";
	this.buttons     = {
		ok : 'はい',
		ng : 'いいえ'
	}
	this.result      = {
		ok : '<p class="rating-result">ご協力ありがとうございます。<br />これからも、内容を充実させ皆さまのお役に立てるよう努めてまいります。</p>',
		ng : '<p class="rating-result">申し訳ありません。ウェブサイトの改善に努めてまいりますので、お手数ですが、ご意見をお問い合わせフォームからお聞かせいただければ幸いです。</p><ul class="link-list rating-result"><li><a href="/inquiry/index.html">お問い合わせ</a></li></ul>'
	}
	this.init();
}
enquete.prototype = {
	init : function() {
		this.send("acc");
		this.node = document.createElementBA("form");
		this.node.addEventListenerBA("submit", function(e){ e.preventDefault() });
		this.node.appendClassNameBA("enquete-block");
		var p = document.createElementBA("p");
		p.appendChildBA(this.description);
		p.appendClassNameBA("enquete-description");
		this.node.appendChildBA(p);
		var fieldset = document.createElementBA("fieldset");
		fieldset.appendClassNameBA("enquete-buttons");
		for (var name in this.buttons) {
			var button = document.createElementBA("button");
			button.appendChildBA(this.buttons[name]);
			button.setAttributeBA("name", name);
			button.addEventListenerBA("click", function(e){ this.submit(e.target.getAttributeBA("name")) }, this);
			fieldset.appendChildBA(button);
		}
		this.node.appendChildBA(fieldset);
	},
	send : function(param) {
		var loader = new Image();
		loader.src = this.action.formatTextBA([param, this.entry]);
	},
	submit : function(param) {
		this.send(param);

		var s = s_gi('RSID');
		s.pageName      = window.s.pageName;
		s.channel       = window.s.channel;
		s.linkTrackVars = 'prop6';
		s.prop6         = (param == "ok") ? "はい" : "いいえ";
		s.tl(this.node.getElementsByNameBA(param)[0],'o', window.s.pageName);

		this.node.removeAllChildrenBA();
		this.node.innerHTML = this.result[param] || "";
		this.node.appendClassNameBA("finished");
		this.node.appendClassNameBA(param);
	}
}

BAAddOnload(function(){
	if (!__LN_FEEDBACK_FAQ_CONTAINER_ID__) return;

	var container = document.getElementByIdBA(__LN_FEEDBACK_FAQ_CONTAINER_ID__);
	if (!container) return;

	var enq = new enquete(__LN_FEEDBACK_FAQ_SYSTEM__, __LN_FEEDBACK_FAQ_ENTRY_ID__);
	if (!enq.node) return;
	container.appendChildBA(enq.node);
});
var __LN_FEEDBACK_FAQ_CONTAINER_ID__ = "";
var __LN_FEEDBACK_FAQ_SYSTEM__       = "";
var __LN_FEEDBACK_FAQ_ENTRY_ID__     = "";
