+function enc_radio_n($str, $name, $n) {
+ if(!isset($GLOBALS[$name . '_options'])) {
+ die("pulldown('$name') must be called before this template can be run. See code/wfpl/encode.php");
+ }
+
+ if(!isset($GLOBALS[$name . '_options']['options'][$n])) {
+ die("Template error: pulldown('$name') does not have element # $n");
+ }
+
+ $value = enc_attr($GLOBALS[$name . '_options']['options'][$n][0]);
+
+ if($str === $value) {
+ $value .= '" checked="checked';
+ }
+
+ return $value;
+}
+function enc_radio_0($str, $name) { return enc_radio_n($str, $name, 0); }
+function enc_radio_1($str, $name) { return enc_radio_n($str, $name, 1); }
+function enc_radio_2($str, $name) { return enc_radio_n($str, $name, 2); }
+function enc_radio_3($str, $name) { return enc_radio_n($str, $name, 3); }
+function enc_radio_4($str, $name) { return enc_radio_n($str, $name, 4); }
+function enc_radio_5($str, $name) { return enc_radio_n($str, $name, 5); }
+function enc_radio_6($str, $name) { return enc_radio_n($str, $name, 6); }
+function enc_radio_7($str, $name) { return enc_radio_n($str, $name, 7); }
+
+
+function enc_radio_caption_n($str, $name, $n) {
+ if(!isset($GLOBALS[$name . '_options'])) {
+ die("pulldown('$name') must be called before this template can be run. See code/wfpl/encode.php");
+ }
+
+ if(!isset($GLOBALS[$name . '_options']['options'][$n])) {
+ die("Template error: pulldown('$name') does not have element #$n");
+ }
+
+ return $GLOBALS[$name . '_options']['options'][$n][1];
+}
+function enc_radio_caption_0($str, $name) { return enc_radio_caption_n($str, $name, 0); }
+function enc_radio_caption_1($str, $name) { return enc_radio_caption_n($str, $name, 1); }
+function enc_radio_caption_2($str, $name) { return enc_radio_caption_n($str, $name, 2); }
+function enc_radio_caption_3($str, $name) { return enc_radio_caption_n($str, $name, 3); }
+function enc_radio_caption_4($str, $name) { return enc_radio_caption_n($str, $name, 4); }
+function enc_radio_caption_5($str, $name) { return enc_radio_caption_n($str, $name, 5); }
+function enc_radio_caption_6($str, $name) { return enc_radio_caption_n($str, $name, 6); }
+function enc_radio_caption_7($str, $name) { return enc_radio_caption_n($str, $name, 7); }
+
+