var HideShow = Class.create({
	initialize: function(boxes, on, off) {
		this.boxes = boxes;
		this.on = on;
		this.off = off;
	},
	assign_event: function() {
		this.boxes.each(function(box) {  
			$(box).observe('click', this.toggle_box.bindAsEventListener(this,box));  
        }.bind(this));  
	},
	toggle_box: function(event,box) {	
		var boxID = 'content_' + box;
		if($(boxID).style.display == 'none') { 
          new Effect.BlindDown(boxID, arguments[1] || {});
     	}
		else 
		{
			Effect.toggle(boxID, 'blind', {duration: 0.6});
		}
		this.switch_pic(box);
	},
	switch_pic: function(box) {
		if ($(box).hasClassName('shown'))
		{
			$(box).setAttribute('src', this.off);
			$(box).addClassName('hidden');
			$(box).removeClassName('shown');
		}
		else
		{
			$(box).setAttribute('src', this.on);
			$(box).addClassName('shown');
			$(box).removeClassName('hidden');
		}
	}
});


   