(function(){

const Sid         = 0;
const FontSize    = 1;
const Target      = null;
const ClassWidget = 'br-vote-widget';
const Widget      = createWidget();
const NewWindow   = false;
initForm();

// +++++++++++++++++++++++++++++++++++++++++++
// create widget
// +++++++++++++++++++++++++++++++++++++++++++
function createWidget() {
	let widget = null;

	widget = document.createElement('div');
	widget.setAttribute('class', ClassWidget);
	let shadow = widget.attachShadow({ mode:'open' });

	// append
	appendWidget(widget);

	return widget;
}

function appendWidget(widget) {
	let tags = document.querySelectorAll('script[src]');
	let tagsList = [];

	for(const e of tags.values()){
		if( e.getAttribute('src').indexOf('/votes/script/form/57047') >= 0 ){
			tagsList.push(e);
		}
	}

	if( Target ){
		let ins = document.querySelector(Target);
		if( ins ){
			ins.appendChild(widget);
		}
		return widget;
	}

	for(let i = 0; i < tagsList.length; i++){
		let tag = tagsList[i];
		let nextE = tag.nextElementSibling;
		if( ! nextE || nextE.className.indexOf(ClassWidget) < 0 ){
			tag.insertAdjacentElement('afterend', widget);
			break;
		}
	}

	return widget;
}

// +++++++++++++++++++++++++++++++++++++++++++
// run script
// +++++++++++++++++++++++++++++++++++++++++++
function initForm() {

	const target = Widget.shadowRoot;

	// inner HTML
	target.innerHTML = "<style>\nh1,h2,h3,h4,h5 {\n\tfont-size:1.2em;\n\tpadding:0;\n\tmargin:0;\n}\na {\n\ttext-decoration:none;\n}\na:hover {\n\topacity:.7;\n}\nform > ul {\n\tlist-style:none;\n\tpadding:0;\n\tborder:none;\n\tbackground:transparent;\n}\nform > ul > li {\n\tpadding:0;\n}\n.vote-item * {\n\ttext-align:left;\n\tbox-sizing:border-box;\n\tline-height:1.3;\n\tfont-weight:normal;\n}\n.vote-item {\n\tposition:relative;\n\tborder:1px solid rgb(90,161,59);\n\tborder-radius:.4em;\n\tbackground:rgba(255,255,255,1);\n\tpadding:1em;\n\tmargin:0 auto;\n\tmax-width:35em;\n}\n.vote-item form {\n\tbackground-image: url(data:image\/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSLjg6zjgqTjg6Tjg7xfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4PSIwIiB5PSIwIiB2aWV3Qm94PSIwIDAgNTYuNyA1Ni43IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1Ni43IDU2LjciIHhtbDpzcGFjZT0icHJlc2VydmUiPjxzdHlsZT4uc3Qxe2Rpc3BsYXk6bm9uZTtmaWxsOiNhNjFmMjR9PC9zdHlsZT48cGF0aCBkPSJNNTYuNyAyOC4zQzU2LjcgNDQgNDQgNTYuNyAyOC4zIDU2LjcgMTIuNyA1Ni43IDAgNDQgMCAyOC4zIDAgMTIuNyAxMi43IDAgMjguMyAwIDQ0IDAgNTYuNyAxMi43IDU2LjcgMjguM3oiIHN0eWxlPSJmaWxsOiNhNjFmMjQiLz48cGF0aCBkPSJNMjUuOSA0Ni4zYy0uNi0uNy0uOC0xLjEtLjgtMS4yIDAtLjEtLjEtLjMtLjEtLjcgMC0uMy4zLS44LjgtLjkuMy0uMSAxLjEtLjUgMS44LTEgLjctLjQgMS4yLS44IDEuMi0uOHMuMy0uMi42LS42Yy4zLS40LjYtLjkuNi0xLjYgMC0uNC0uMS0uOS0uNC0xLjUtMS40LTIuNy03LjUtMTkuNS0xNS43LTI0LjhoLS4xcy0uMS0uMi0uNC0uM2MtLjItLjItLjYtLjMtLjktLjMtLjMgMC0uNi4xLS45LjQtMS42IDEtMy4yIDIuOC0zLjUgMy43LS4yLjQtLjYuNy0uOS43LS42IDAtMS4xLS41LTEuMS0xLjEgMC0uMi4xLS41LjItLjYgMCAwIDcuNC0xMi4zIDE4LjktMTQuNSAxLjYtLjMgMy4xLS40IDQuNi0uNCA4LjIgMCAxMy44IDQuNCAxMy45IDguNyAwIC40IDAgLjgtLjIgMS4yIDAgLjEtLjIuNy0xLjIgMS45di4xYzAgLjEgMCAuMy4zLjUuNy43IDkgNy44IDEwLjggOS42IDEuNiAxLjUgMi40IDIuNiAyLjggMy4ybC4xLjF2LjFjMCAuNi4xIDEuMi4xIDEuNyAwIDEtLjEgMi4xLS4yIDMuMXYuNGwtLjMuMWMtLjktLjItMS43LS40LTIuOS0xLjIgMCAwLTIuMS0yLjEtNS00LjYtMi45LTIuNS02LjctNS40LTEwLTcgMCAwLS4xIDAtLjItLjEtLjEgMC0uMy0uMS0uNi0uMS0uMiAwLS41IDAtLjguMi0xLjYuNi0zLjcgMS42LTUuMiAyLjVoLS4xcy0uMSAwLS4yLjFjLS4xIDAtLjIuMS0uMy4ydi4xYy40IDEuMSAzLjQgNS43IDUuNCA5LjYuOSAxLjYgMS40IDIuOSAyIDMuNy42LjggMSAxLjIgMS44IDEuMi40IDAgLjgtLjEgMS4zLS4ybDMtMS4ycy4zLS4xLjYtLjFjLjQgMCAxLjEuNCAxLjEgMS4ydi45YzAgLjItLjIuOS0uOSAxLjItLjcuMy0xMC40IDYuNS0xNi45IDguOC0uMS4xLS41LjMtMSAuMy0uNC0uMi0uOC0uMy0xLjEtLjd6TTI4LjUgMTdjLjEuMi4zLjMuNC4zLjEgMCAuMSAwIC4yLS4xLjUtLjIgMi4zLTEgNC4xLTEuOSAxLjgtLjkgMy42LTEuOSAzLjktMi4zLjQtLjUgMS4xLTEuOSAxLjEtMy41IDAtMS4zLS40LTIuOC0xLjktNC0yLjQtMi4xLTQuNy0zLTcuNi0zLTEuMSAwLTIuMi4xLTMuNC40LTEuOS40LTMuNyAxLjEtNS4xIDEuOC0xLjQuNy0yLjIgMS41LTIuMSAxLjcgMCAuMSAwIC4xLjIuMiAwIDAgNi41IDMuNSA5LjkgOS45LjEuMi4yLjQuMy41eiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==);\n\tbackground-size:1.8em;\n\tbackground-position:right .1em top 0em;\n\tbackground-repeat:no-repeat;\n}\n.vote-item .ttl {\n\tpadding-right:1.6em;\n}\n.vote-item textarea {\n\tmin-height: 6.5em;\n}\n.vote-item .personal {\n\tdisplay:none;\n}\n.vote-item .buttons {\n\tmargin:2em 0 .5em;\n}\n.vote-item button[type=\"submit\"].expire {\n\tborder-color:#ccc;\n}\n.vote-item .date {\n\tdisplay:none;\n}\n<\/style>\n\n<section class=\"vote-item\">\n\t<style>\n\t.vote-throw-form {\n\t--base-color: rgb(90,161,59);\n\t--base-bd-color: #aaa;\n\tmargin:0;\n\tcolor:#333;\t\n}\ninput,\nselect,\ntextarea,\nbutton\n{\n\tfont-family:\"\u30e1\u30a4\u30ea\u30aa\",\"Hiragino Kaku Gothic Pro\",Meiryo,Arial,sans-serif;\n\tfont-size:1em;\n}\n.vote-throw-form ::placeholder { color:#aaa; }\n.vote-throw-form input[type=\"text\"],\n.vote-throw-form input[type=\"password\"],\n.vote-throw-form input[type=\"mail\"],\n.vote-throw-form input[type=\"tel\"],\n.vote-throw-form input[type=\"number\"],\n.vote-throw-form input[type=\"search\"],\n.vote-throw-form input[type=\"url\"],\n.vote-throw-form select\n{\n\tline-height:1.5em;\n\tpadding:.6em .5em;\n\tborder:1px solid var(--base-bd-color);\n\tborder-radius:.2em;\n\twidth:100%;\n\tbox-sizing:border-box;\n\t-moz-box-sizing:border-box;\n}\n.vote-throw-form input[type=\"checkbox\"],\n.vote-throw-form input[type=\"radio\"]\n{\n\tdisplay:none;\n\twidth:initial;\n}\n.vote-throw-form input[type=\"checkbox\"] + label:not(.ui-button),\n.vote-throw-form input[type=\"radio\"] + label:not(.ui-button)\n{\n\tdisplay:inline-block;\n\tposition:relative;\n\tcursor:pointer;\n\tuser-select: none;\n\tline-height:1.4;\n\tpadding-left:1.6em;\n}\n.vote-throw-form input[type=\"checkbox\"] + label:not(.ui-button)::before,\n.vote-throw-form input[type=\"radio\"] + label:not(.ui-button)::before\n{\n\tcontent:\"\";\n\tposition:absolute;\n\ttop:0;\n\tleft:0;\n\tbottom:0;\n\tmargin:auto 0;\n\tdisplay:inline-block;\n\tborder:.1em solid gray;\n\tborder-radius:.15em;\n\twidth:1.3em;\n\theight:1.25em;\n\tbox-sizing:border-box;\n\ttext-align:center;\n\tline-height:1.2;\n}\n.vote-throw-form input[type=\"radio\"] + label:not(.ui-button)::before {\n\tborder-radius:50%;\n}\n.vote-throw-form input[type=\"checkbox\"]:checked + label:not(.ui-button)::before,\n.vote-throw-form input[type=\"radio\"]:checked + label:not(.ui-button)::before\n{\n\tbackground:no-repeat center \/ .7em var(--base-color);\n\tbackground-image: url(data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8\/9hAAAA+klEQVQ4T6WS0VECQRBEuyPgMhAyIAM1AiUCMQIxA4kAjUDIACIQIlAzODPACNpqapbaO\/eqDpjP3em3PdNLXFg8Ry9pCGABYHcyQNI0xNbenAQI8Xu4fiS57A1oiZ9Jvhp0BEiqSO5LO2mJNyTvU98BIGkG4AHAbRsiaQzgA0AF4AfAOO+hpGWIzfrKIXYF4BOAt+7yA9vcpQGe5Sk7XJOchLM1gLu4W5F0Ao1KI5h6nd3Y1XfE5eNfuyjtKAFs1favOj7WnORL6S5Pwcuyk0GrsfP1Rowxs2dMHyVx3kg6pWL9+0iFpY5I1r0B4SRFVZc234ixi9z3\/A+1pV2r9zrY5gAAAABJRU5ErkJggg==);\n}\n.vote-throw-form select {\n\tbackground-color:#fffff0;\n}\n.vote-throw-form textarea {\n\twidth:100%;\n\tpadding:.5em;\n\tmin-height:5em;\n}\n.vote-throw-form button, input[type=\"submit\"], input[type=\"button\"] {\n\tborder:initial;\n\tborder-radius:.2em;\n\tbackground-color:var(--base-color);\n\tcolor:white;\n\tline-height:1.3;\n\tpadding:.9em 1.5em;\n\tcursor:pointer;\n}\n.vote-throw-form button:hover {\n\topacity:.5;\n}\n.vote-throw-form button.mini {\n\tfont-size:.9em;\n}\n.vote-throw-form button[disabled] {\n\tbackground-color:#ccc;\n}\n.vote-throw-form .error {\n\tcolor:red;\n\tbackground-color:#fddfdf;\n\tborder:1px solid #f1a899;\n\tborder-radius:.2em;\n\tpadding:.5em;\n\tmargin:2em 0;\n}\n.vote-throw-form .ttl {\n\tfont-weight:bold;\n}\n.vote-throw-form .comment {\n\tfont-size:.95em;\n\tborder-radius:.2em;\n\tborder-color:var(--base-bd-color);\n}\n.vote-throw-form .personal {\n\tmargin:.6em 0 1.5em 0;\n}\n.vote-throw-form .personal > * {\n\tmargin-right:.5em;\n}\n.vote-throw-form .personal select {\n\tbackground-color:#f0f0f0;\n\tcolor:#333;\n\twidth:auto;\n\tpadding:.4em .5em;\n}\n.vote-throw-form .personal option.title {\n\tfont-weight:bold;\n}\n.vote-throw-form .buttons {\n\tdisplay:flex;\n\tflex-flow:row nowrap;\n\toverflow:hidden;\n}\n.vote-throw-form .buttons > * + * {\n\tmargin-left:.5em;\n}\n.vote-throw-form .buttons button {\n\tflex:0 1 10em;\n\tborder-radius:2em;\n\tborder:1px solid var(--base-color);\n\twhite-space:nowrap;\n\toverflow:hidden;\n\ttext-overflow:ellipsis;\n\ttext-align:center;\n\tfont-weight:bold;\n\tletter-spacing:.05em;\n\tpadding:.7em 0;\n}\n.vote-throw-form .buttons button:not([type=\"submit\"]) {\n\tbackground-color:white;\n\tcolor:var(--base-color);\n}\n.vote-throw-form ul {\n\tpadding:0;\n\tborder:none;\n}\n.vote-throw-form ul li {\n\tpadding:.3em 0;\n}\n.vote-throw-form .choice {\n\tmargin:1em 0;\n}\n.vote-throw-form .choice li.desc {\n\tcolor:#999;\n\tfont-size:.9em;\n}\n.vote-throw-form .choice li.desc::before { content:\"(\"; }\n.vote-throw-form .choice li.desc::after  { content:\")\"; }\n\n.vote-throw-form .relate-link {\n\tdisplay:block;\n\tmargin:1em 0 2em;\n\tfont-size:.85em;\n\twhite-space:nowrap;\n\toverflow:hidden;\n\ttext-overflow:ellipsis;\n}\n.vote-throw-form .relate-link .link {\n\tdisplay:flex;\n\tflex-flow:column wrap;\n\tline-height:1.5;\n\tpadding:.7em .5em;\n\tborder:1px solid var(--base-bd-color);\n\tborder-radius:.2em;\n\tcolor:#666;\n}\n.vote-throw-form .relate-link .link > * {\n\tmax-width:100%;\n\toverflow:hidden;\n\ttext-overflow:ellipsis;\n}\n.vote-throw-form .relate-link .link-title {\n\tfont-weight:bold;\n}\n.vote-throw-form .relate-link .link-url {\n\tflex:1 0 auto;\n}\n<\/style>\n<form action=\"https:\/\/blog.with2.net\/votes\/item\/57047\/throw\" method=\"post\" class=\"vote-throw-form\">\n<input type=\"hidden\" name=\"id\" value=\"57047\">\n<input type=\"hidden\" name=\"sid\" value=\"\">\n<input type=\"hidden\" name=\"ref\" value=\"\">\n<input type=\"hidden\" name=\"char\" value=\"\u6587\u5b57\u8868\u793a\">\n\n\t<h2 class=\"ttl\">\n\t\t\n\t\t\u5b50\u4f9b\u306e\u9803\u306e\u300c\u5c06\u6765\u306e\u5922\u300d\u306f\u306a\u3093\u3067\u3057\u305f\u304b\uff1f\n\t<\/h2>\n\n\t<p class=\"desc\">\n\t\t\u5b50\u4f9b\u306e\u9803\u306f\u300c\u306a\u308a\u305f\u3044\u3082\u306e\u300d\u3092\u3042\u308c\u3053\u308c\u3068\u8003\u3048\u308b\u306e\u3082\u306e\u3002\u7686\u3055\u3093\u304c\u5b50\u4f9b\u306e\u9803\u306b\u601d\u3044\u63cf\u3044\u3066\u3044\u305f\u300c\u5c06\u6765\u306e\u5922\u300d\u306f\u306a\u3093\u3067\u3059\u304b\uff1f\n\t<\/p>\n\n\t\n\n\t<input type=\"hidden\" name=\"qid-check\">\n\t<ul class=\"choice\" data-num=\"0\">\n\t\t\n\t\t<li>\n\t<input type=\"radio\" id=\"qid_0\" name=\"qid[]\" value=\"0\" >\n\t<label for=\"qid_0\">\u5b87\u5b99\u98db\u884c\u58eb<\/label>\n<\/li><li>\n\t<input type=\"radio\" id=\"qid_1\" name=\"qid[]\" value=\"1\" >\n\t<label for=\"qid_1\">\u30d1\u30f3\u5c4b\u3055\u3093\/\u304a\u83d3\u5b50\u5c4b\u3055\u3093\/\u30b3\u30c3\u30af\u3055\u3093<\/label>\n<\/li><li>\n\t<input type=\"radio\" id=\"qid_2\" name=\"qid[]\" value=\"2\" >\n\t<label for=\"qid_2\">\u82b1\u5c4b\u3055\u3093<\/label>\n<\/li><li>\n\t<input type=\"radio\" id=\"qid_4\" name=\"qid[]\" value=\"4\" >\n\t<label for=\"qid_4\">\u30b9\u30dd\u30fc\u30c4\u9078\u624b<\/label>\n<\/li><li>\n\t<input type=\"radio\" id=\"qid_5\" name=\"qid[]\" value=\"5\" >\n\t<label for=\"qid_5\">\u304a\u533b\u8005\u3055\u3093\/\u770b\u8b77\u5e2b\u3055\u3093<\/label>\n<\/li><li>\n\t<input type=\"radio\" id=\"qid_6\" name=\"qid[]\" value=\"6\" >\n\t<label for=\"qid_6\">\u30d1\u30a4\u30ed\u30c3\u30c8\/\u904b\u8ee2\u624b<\/label>\n<\/li><li>\n\t<input type=\"radio\" id=\"qid_7\" name=\"qid[]\" value=\"7\" >\n\t<label for=\"qid_7\">\u5b66\u8005\/\u535a\u58eb<\/label>\n<\/li><li>\n\t<input type=\"radio\" id=\"qid_8\" name=\"qid[]\" value=\"8\" >\n\t<label for=\"qid_8\">\u5148\u751f\/\u4fdd\u80b2\u58eb<\/label>\n<\/li><li>\n\t<input type=\"radio\" id=\"qid_9\" name=\"qid[]\" value=\"9\" >\n\t<label for=\"qid_9\">\u82b8\u80fd\u4eba<\/label>\n<\/li><li>\n\t<input type=\"radio\" id=\"qid_11\" name=\"qid[]\" value=\"11\" >\n\t<label for=\"qid_11\">\u8b66\u5bdf\u5b98\/\u6d88\u9632\u58eb<\/label>\n<\/li><li>\n\t<input type=\"radio\" id=\"qid_14\" name=\"qid[]\" value=\"14\" >\n\t<label for=\"qid_14\">\u82b8\u8853\u5bb6<\/label>\n<\/li><li>\n\t<input type=\"radio\" id=\"qid_13\" name=\"qid[]\" value=\"13\" >\n\t<label for=\"qid_13\">\u305d\u306e\u4ed6<\/label>\n<\/li>\n\t<\/ul>\n\n\t<textarea name=\"comment\" class=\"comment\" placeholder=\"\u30b3\u30e1\u30f3\u30c8\u3092\u66f8\u304f(300\u6587\u5b57\u4ee5\u5185)\"><\/textarea>\n\n\t<div class=\"personal\">\n\t\t<select name=\"sex\">\n\t<option value=\"\" class=\"title\">\u6027\u5225<\/option>\n\t<option value=\"1\" >\u7537\u6027<\/option><option value=\"2\" >\u5973\u6027<\/option>\n\t<option value=\"\">\u7121\u56de\u7b54<\/option>\n<\/select><select name=\"age\">\n\t<option value=\"\" class=\"title\">\u5e74\u4ee3<\/option>\n\t<option value=\"1\" >10\u672a\u6e80<\/option><option value=\"2\" >10\u6b73\u4ee3<\/option><option value=\"3\" >20\u6b73\u4ee3<\/option><option value=\"4\" >30\u6b73\u4ee3<\/option><option value=\"5\" >40\u6b73\u4ee3<\/option><option value=\"6\" >50\u6b73\u4ee3<\/option><option value=\"7\" >60\u6b73\u4ee3<\/option><option value=\"8\" >70\u6b73\u4ee3<\/option><option value=\"9\" >80\u6b73\u4ee3<\/option><option value=\"10\" >90\u6b73\u4ee3<\/option><option value=\"11\" >100\u4ee5\u4e0a<\/option>\n\t<option value=\"\">\u7121\u56de\u7b54<\/option>\n<\/select><select name=\"area\">\n\t<option value=\"\" class=\"title\">\u5730\u57df<\/option>\n\t<option value=\"1\" >\u5317\u6d77\u9053<\/option><option value=\"2\" >\u9752\u68ee<\/option><option value=\"3\" >\u5ca9\u624b<\/option><option value=\"4\" >\u79cb\u7530<\/option><option value=\"5\" >\u5bae\u57ce<\/option><option value=\"6\" >\u5c71\u5f62<\/option><option value=\"7\" >\u798f\u5cf6<\/option><option value=\"8\" >\u65b0\u6f5f<\/option><option value=\"9\" >\u6803\u6728<\/option><option value=\"10\" >\u8328\u57ce<\/option><option value=\"11\" >\u7fa4\u99ac<\/option><option value=\"12\" >\u57fc\u7389<\/option><option value=\"13\" >\u6771\u4eac<\/option><option value=\"14\" >\u5343\u8449<\/option><option value=\"15\" >\u795e\u5948\u5ddd<\/option><option value=\"16\" >\u5c71\u68a8<\/option><option value=\"17\" >\u9759\u5ca1<\/option><option value=\"18\" >\u9577\u91ce<\/option><option value=\"19\" >\u5bcc\u5c71<\/option><option value=\"20\" >\u5c90\u961c<\/option><option value=\"21\" >\u611b\u77e5<\/option><option value=\"22\" >\u77f3\u5ddd<\/option><option value=\"23\" >\u798f\u4e95<\/option><option value=\"24\" >\u6ecb\u8cc0<\/option><option value=\"25\" >\u4e09\u91cd<\/option><option value=\"26\" >\u4eac\u90fd<\/option><option value=\"27\" >\u5948\u826f<\/option><option value=\"28\" >\u5927\u962a<\/option><option value=\"29\" >\u548c\u6b4c\u5c71<\/option><option value=\"30\" >\u5175\u5eab<\/option><option value=\"31\" >\u9ce5\u53d6<\/option><option value=\"32\" >\u5ca1\u5c71<\/option><option value=\"33\" >\u5cf6\u6839<\/option><option value=\"34\" >\u5e83\u5cf6<\/option><option value=\"35\" >\u5c71\u53e3<\/option><option value=\"36\" >\u9999\u5ddd<\/option><option value=\"37\" >\u5fb3\u5cf6<\/option><option value=\"38\" >\u9ad8\u77e5<\/option><option value=\"39\" >\u611b\u5a9b<\/option><option value=\"40\" >\u798f\u5ca1<\/option><option value=\"41\" >\u4f50\u8cc0<\/option><option value=\"42\" >\u5927\u5206<\/option><option value=\"43\" >\u9577\u5d0e<\/option><option value=\"44\" >\u718a\u672c<\/option><option value=\"45\" >\u5bae\u5d0e<\/option><option value=\"46\" >\u9e7f\u5150\u5cf6<\/option><option value=\"47\" >\u6c96\u7e04<\/option><option value=\"99\" >\u3010\u6d77\u5916\u3011<\/option>\n\t<option value=\"\">\u7121\u56de\u7b54<\/option>\n<\/select>\n\t<\/div>\n\n\t<div class=\"buttons\">\n\t\t<button type=\"submit\">\u6295\u7968\u3059\u308b<\/button>\n\t\t<button type=\"button\" class=\"result\" data-url=\"https:\/\/blog.with2.net\/votes\/item\/57047\/result\">\u7d50\u679c\u3092\u898b\u308b<\/button>\n\t<\/div>\n\n<\/form>\n\n<\/section>\n";

	// form
	const form = target.querySelector('form.vote-throw-form');

	// sid
	if( Sid > 0 ){
		let inp = form.querySelector('input[name="sid"]');
		if( inp ){
			inp.value = Sid;
		}else{
			inp = document.createElement('input');
			inp.type = 'hidden';
			inp.name = 'sid';
			inp.value = Sid;
			form.prepend(inp);
		}
	}

	// ref
	let inp = form.querySelector('input[name="ref"]');
	if( inp ){
		inp.value = location.href;
	}else{
		inp = document.createElement('input');
		inp.type = 'hidden';
		inp.name = 'ref';
		inp.value = location.href;
		form.prepend(inp);
	}

	// window
	if( NewWindow ){
		const items = target.querySelectorAll('form.vote-throw-form, a');
		for( const e of items.values() ){
			switch(e.tagName.toUpperCase()){
			case 'FORM':
			case 'A':
				e.setAttribute('target', '_blank');
				break;
			}
		}
	}

	// font-size
	target.querySelector('.vote-item').style['font-size'] = FontSize + 'em';

	// result
	var items = target.querySelectorAll('.result');
	for(let i = 0; i < items.length; i++){
		let item = items.item(i);
		let url = item.dataset.url;
		if( url ){
			item.addEventListener('click', (e) => {
				if( NewWindow ){
					window.open(url);
				}else{
					location.href = url;
				}
			});
		}
	}

	// submit
	form.addEventListener('submit', function(e) {
		let choice = this.querySelector('.choice')
		let items = choice.querySelectorAll('input[name="qid[]"]');
		let num = parseInt(choice.dataset.num);
		let ctr = form.querySelectorAll('input[name="qid[]"]:checked').length;
		let error = null;
		if( ctr == 0 ){
			error = '選択されていません';
		}else if( num > 0 && ctr > num ){
			error = '選択肢は最大' + num + '個まで(' + ctr + '個選択中)';
		}
		if( error ){
			alert('[投票エラー]\n' + error);
			e.preventDefault();
		}
	});


	// expire
	if( false ){
		const btns = target.querySelectorAll('button[type="submit"]');
		for(const btn of btns){
			btn.classList.add('expire');
			btn.textContent = '受付終了';
			btn.setAttribute('disabled', '1');
		}
	}

}

})();