// mandatory
var $id;
var $nifty;
+ var $info_div = "";
function PlekitToggle ($id,$trigger,$options=NULL) {
$this->id = $id;
$options['start-hidden'] = ! $options['visible'];
unset ($options['visible']);
}
+
+ if (array_key_exists ('info_div',$options)) {
+ $this->info_div = $options['info_div'];
+ }
+
if (!isset ($options['start-hidden'])) $options['start-hidden']=false;
$this->options = $options;
}
$html .= $this->image_html();
$html .= $this->trigger;
$html .= "</$tagname>";
+ if ($this->info_div != "")
+ $html .= " (<a href=javascript:plc_show_toggle_info('$this->info_div','$this->id')>?</a>)";
return $html;
}
-/*
- $Id$
-*/
-function plc_toggle (id) {
- var area=$('toggle-area-' + id);
- area.toggle();
- var visible=$('toggle-image-visible-' + id);
- var hidden=$('toggle-image-hidden-' + id);
- if (area.visible()) {
- visible.show();
- hidden.hide();
- } else {
- visible.hide();
- hidden.show();
- }
+function plc_toggle(id){var area=$('toggle-area-'+id);area.toggle();var visible=$('toggle-image-visible-'+id);var hidden=$('toggle-image-hidden-'+id);if(area.visible()){visible.show();hidden.hide();}else{visible.hide();hidden.show();}}
+
+function plc_show_toggle_info(div, id) {
+//debugfilter("showing "+div);
+
+var area=$('toggle-area-'+id);
+var visible=$('toggle-image-visible-'+id);
+var hidden=$('toggle-image-hidden-'+id);
+
+if (document.getElementById(div).style.display == "none") {
+ document.getElementById(div).style.display = "";
+ if (! area.visible())
+ area.toggle();
+}
+
}