function ulist_redirect(type, path, formcode, args) { var r = new RegExp('/('+type+'[0-9]+).*$'); location.href = location.href.replace(r, '/$1')+path +'?formcode='+formcode +';ref='+encodeURIComponent(location.pathname+location.search) +';'+args; } // VN Voting (/v+) if(byId('votesel')) byId('votesel').onchange = function() { var s = this.options[this.selectedIndex].value; if(s == -2) s = prompt(mt('_vnpage_uopt_othervote'), ''); if(!s || s == -3) return; if(s != -1 && (!s.match(/^([1-9]|10)([\.,][0-9])?$/) || s > 10 || s < 1)) { alert(mt('_vnpage_uopt_invvote')); this.selectedIndex = 0; return; } s = s.replace(',', '.'); if(s == 1 && !confirm(mt('_vnpage_uopt_1vote'))) return; if(s == 10 && !confirm(mt('_vnpage_uopt_10vote'))) return; if(s > 0 || s == -1) ulist_redirect('v', '/vote', this.name, 'v='+s); }; // VN Wishlist dropdown box (/v+) if(byId('wishsel')) byId('wishsel').onchange = function() { if(this.selectedIndex != 0) ulist_redirect('v', '/wish', this.name, ';s='+this.options[this.selectedIndex].value); }; // Release & VN list dropdown box (/r+ and /v+) if(byId('listsel')) byId('listsel').onchange = function() { if(this.selectedIndex != 0) ulist_redirect('[rv]', '/list', this.name, 'e='+this.options[this.selectedIndex].value); }; // NSFW VN image toggle (/v+) (function() { var msg = byId('nsfw_show'); if(msg) { var img = byId('nsfw_hid'); byName(msg, 'a')[0].onclick = function() { setClass(msg, 'hidden', true); setClass(img, 'hidden', false); return false; }; img.onclick = function() { setClass(msg, 'hidden', false); setClass(img, 'hidden', true); }; } })(); // NSFW toggle for screenshots (/v+) if(byId('nsfwhide')) byId('nsfwhide').onclick = function() { var shown = 0; var l = byClass(byId('screenshots'), 'a', 'scrlnk'); for(var i=0; i