<form name=fm>
<input type=search name=k size=60> <br>
<button type=submit name=ggl>Google</button>
<button type=submit name=yho>Yahoo! Japan</button>
</form>
<div style="display:none"><!--見せない-->
<form name=subggl method=get target=_blank action="http://w...content-available-to-author-only...o.jp/search">
<input type=text name=q><a href="http://w...content-available-to-author-only...o.jp/" target=_blank>top</a></form>
<form name=subyho method=get target=_blank action="http://s...content-available-to-author-only...o.jp/search">
<input type=text name=p><a href="http://w...content-available-to-author-only...o.jp/" target=_blank>top</a></form>
</div>
<script>
addEventListener('load', function(){ var _=0;
function searchOnNewTab(name, v) {
var form = document.forms['sub' + name];
if (v === '') {
form.getElementsByTagName('A')[0].click()
} else {
form.getElementsByTagName('INPUT')[0].value = v;
form.submit();
}
}
document.forms['fm'].addEventListener('click', function(ev){
if (ev.target.type != 'submit') return;
ev.preventDefault();
var form = ev.currentTarget;
var name = ev.target.name;
var valu = form.elements['k'].value;
searchOnNewTab(name, valu);
}, false);
}, false)
</script>
PGZvcm0gbmFtZT1mbT4KPGlucHV0IHR5cGU9c2VhcmNoIG5hbWU9ayBzaXplPTYwPiA8YnI+CiAgPGJ1dHRvbiB0eXBlPXN1Ym1pdCBuYW1lPWdnbD5Hb29nbGU8L2J1dHRvbj4KICA8YnV0dG9uIHR5cGU9c3VibWl0IG5hbWU9eWhvPllhaG9vISBKYXBhbjwvYnV0dG9uPgo8L2Zvcm0+Cgo8ZGl2IHN0eWxlPSJkaXNwbGF5Om5vbmUiPjwhLS3opovjgZvjgarjgYQtLT4KPGZvcm0gbmFtZT1zdWJnZ2wgbWV0aG9kPWdldCB0YXJnZXQ9X2JsYW5rIGFjdGlvbj0iaHR0cDovL3cuLi5jb250ZW50LWF2YWlsYWJsZS10by1hdXRob3Itb25seS4uLm8uanAvc2VhcmNoIj4KPGlucHV0IHR5cGU9dGV4dCBuYW1lPXE+PGEgaHJlZj0iaHR0cDovL3cuLi5jb250ZW50LWF2YWlsYWJsZS10by1hdXRob3Itb25seS4uLm8uanAvIiB0YXJnZXQ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IHZhbHUgPSBmb3JtLmVsZW1lbnRzWydrJ10udmFsdWU7CiAgICAgICAgc2VhcmNoT25OZXdUYWIobmFtZSwgdmFsdSk7CiAgICB9LCBmYWxzZSk7Cn0sIGZhbHNlKQo8L3NjcmlwdD4K
js: "prog.js", line 16: syntax error
js: addEventListener('load', function(){ var _=0;
js: ........................................^
js: "prog.js", line 34: syntax error
js: }, false)
js: ^
js: "prog.js", line 35: unterminated regular expression literal
js: </script>
js: ........^
js: "prog.js", line 1: Compilation produced 3 syntax errors.