HW.ShowHide.fireTrigger = function(e,onload,closed) {
		// set up regexps for groupings
		var reg = new RegExp("(^|\\w*)"+this.itemClass+"(\\d*|([\\w* ]))");
		var reg2 = new RegExp("(^|\\w*)"+this.hideAllClass+"(\\d*|([\\w* ]))");
		
		var trg;
		
		// fix events cross browser
		e=e||window.event;
		trg = e.srcElement||e.target;
		
		// if running on page load, get the element
		if(!trg && (onload || closed)) {
			trg = e;
		}
		
		// establish the transition style to use
		// if running on page load, suppress transitions
		var trans;
		if(HW.hasClass(trg,this.slideClass) && !onload) {
			trans = 'slide';
		}
		if(HW.hasClass(trg,this.fadeClass) && !onload) {
			trans = 'fade';
		}
		// need to behave differently dependent on trigger type so sort accordingly
		switch(trg.tagName) {
			case 'A':
				// links do not change state so don't need to check on page load
				if(!onload) {
					
					// find targets with matching class name
					var cls = reg.exec(trg.className)[0];
					var targets = $$(cls,document.body,null);
					//trg.targets = targets;
					
					// if part of a hideall group, hide others
					if(reg2.exec(trg.className) && !closed) {
						this.hideAll(reg2.exec(trg.className)[0],cls,trans,trg,onload);
						return;
					}
					
					function unlock(){trg.locked = false};
					// loop through the targets and show/hide accordingly
					for(var i=0,j=targets.length;i<j;i++) {
						// only act if the element is a target element
						// i.e. don't hide yourself
						if(HW.hasClass(targets[i],this.targetClass)) {
							if(trg.locked){
								return;
							}
							trg.locked = true;
							if(HW.hasClass(trg,this.showTrigger)) {
								HW.show(targets[i],trans,unlock,this.transitionTime);
								
							}
							else if(HW.hasClass(trg,this.hideTrigger)) {
								HW.hide(targets[i],trans,unlock,this.transitionTime);
								
							}
							else {
								HW.toggle(targets[i],trans,unlock,this.transitionTime);
							}
							
						}
					}
					if(HW.hasClass(trg,"open")){HW.removeClass(trg,"open");}
					else{HW.addClass(trg,"open");}
				}
				break;
			case 'INPUT':
				// find targets with matching class name
				var cls = reg.exec(trg.className)[0];
				var targets = $$(cls,document.body,null);
				
				// only act on radio buttons and checkboxes which are checked
				if(trg.type == 'radio') {
					//if(trg.checked) {alert(trg.checked);}
					if(trg.checked) {
						// if part of a hideall group, hide other elements
						if(reg2.exec(trg.className) && !closed) {
							this.hideAll(reg2.exec(trg.className)[0],cls,trans,trg,onload);
							return;
						}
						
						// loop through the targets and show/hide accordingly
						for(var i=0,j=targets.length;i<j;i++) {
							// only act if the element is a target element
							// i.e. don't hide yourself
							if(HW.hasClass(targets[i],this.targetClass)) {
								if(HW.hasClass(trg,this.hideTrigger)) {
									HW.hide(targets[i],trans,null,this.transitionTime);
								}
								else if(HW.hasClass(trg,this.showTrigger)) {
									HW.show(targets[i],trans,null,this.transitionTime);
								}
								else {
									HW.toggle(targets[i],trans,null,this.transitionTime);
								}
							}
						}
					}
				}
				else if(trg.type == 'checkbox') {
					// loop through the targets and show/hide accordingly
					for(var i=0,j=targets.length;i<j;i++) {
						// only act if the element is a target element
						// i.e. don't hide yourself
						if(HW.hasClass(targets[i],this.targetClass)) {
							if(!trg.checked) {
								if(HW.hasClass(trg,this.hideTrigger)) {
									HW.show(targets[i],trans,null,this.transitionTime);
								}
								else {
									HW.hide(targets[i],trans,null,this.transitionTime);
								}
							}
							else {
								if(HW.hasClass(trg,this.hideTrigger)) {
									HW.hide(targets[i],trans,null,this.transitionTime);
								}
								else {
									HW.show(targets[i],trans,null,this.transitionTime);
								}
							}
						}
					}
				}
				break;
			case 'SELECT':
				// get the option selected
				var elm = trg.options[trg.selectedIndex];
				
				// find targets with matching class name
				var cls = reg.exec(elm.className)[0];
				var targets = $$(cls,document.body,null);
				
				// if part of a hideall group, hide other elements
				if(reg2.exec(elm.className) && !closed) {
					this.hideAll(reg2.exec(elm.className)[0],cls,trans,trg,onload);
					return;
				}
				
				// loop through the targets and show/hide accordingly
				for(var i=0,j=targets.length;i<j;i++) {
					// only act if the element is a target element
					// i.e. don't hide yourself
					if(HW.hasClass(targets[i],this.targetClass)) {
						if(HW.hasClass(elm,this.hideTrigger)) {
							HW.hide(targets[i],trans,null,this.transitionTime);
						}
						else if(HW.hasClass(elm,this.showTrigger)) {
							HW.show(targets[i],trans,null,this.transitionTime);
						}							
						else {
							HW.toggle(targets[i],trans,null,this.transitionTime);
						}
					}
				}
				break;
		}
	}

//_$$('a.open.'+c).each(function(a){if(a!=trg) {a.removeClass('open');}}); 191
//c needs to be added to the css selector to ensure the class is only changed on triggers bellonging to the same group
HW.ShowHide.hideAll = function(c,s,t,trg,onload) {
		var obj = this;
		// get all the matching elements
		var elms = $$(c,document.body,null);
		// reset the counters so we know everything is hidden before we continue
		this.elmsToHide = 0;
		this.elmsHidden = 0;
		// need to loop twice to make sure we're done counting the items we need to hide before we hide them
		for(var i=0,j=elms.length;i<j;i++) {
			// if it doesn't have the class we want to keep, and is a target element then hide it
			if(!HW.hasClass(elms[i],s) && HW.hasClass(elms[i],this.targetClass)) {
				this.elmsToHide++;
			}
		}
		// once we are done counting we can hide the elements
		for(var i=0,j=elms.length;i<j;i++) {
			// hide it
			if(!HW.hasClass(elms[i],s) && HW.hasClass(elms[i],this.targetClass)) {
				// hide the element calling our checking function as a callback
				HW.hide(elms[i],t,function(){obj.checkAllHidden(trg,onload);},this.transitionTime);
			}
		}
		
		_$$('a.open.'+c).each(function(a){if(a!=trg) {a.removeClass('open');}});
	}