-w_tagging(){
- printf '[div #multitag [input type="hidden" name="ref" value="%s"]' "$(HTML "$REQUEST_URI")"
- printf '[a href="#" Hide][br]'
+w_advsearch(){
+ local n lbid tag category filter f t
+ filter="$(HTML "${FILTER}^" |sed 's;~\;;~;g; s;^\;;^;g; s;|\;;|;g; s;:\;;:;g;')"
+
+ printf '[form #advsearch action=?a=advsearch method=POST
+ [a href="#" Hide]
+ [p .help Select multiple tags from each category by holding down the [strong Ctrl] key on your keyboard.[br]
+ Refine the search further by setting additional search tags using the [strong "+and"] button.]'
+
+ for n in 1 2 3 4 5 6 7 8 9 10; do
+ f="${filter%%^*}"; filter="${filter#*^}"
+
+ t=''; [ "$f" -a ! "${f%%~*}" ] && t=" "
+
+ lbid="cat_${n}_(none)"
+ printf '[input .and type=checkbox name=and id="and_%i" %s][label for="and_%i" +and
+ ][fieldset .select
+ [radio "pol_%i" "pos" .pol %s #pol_pos_%i"][label for=pol_pos_%i Any]
+ [radio "pol_%i" "neg" .pol %s #pol_neg_%i"][label for=pol_neg_%i None]
+ [label .head Category:]' \
+ $n "${f:+checked}" $n \
+ $n "${t:-checked}" $n $n \
+ $n "${t:+checked}" $n $n