var jscb = {
	boxes : [],

	cmb : function(ind) {
		for(var i = 0; i < jscb.boxes.length; i++){
			if(jscb.boxes[i].id == ind) {
				jscb.boxes[i].clickBox();
				return false;
			}
		}
		var new_key = jscb.boxes.length;
		jscb.boxes[new_key] = new jscb.Box(ind);
		jscb.boxes[new_key].clickBox();
	}
};


jscb.Box = function(id){
	this.id = id;
	this.is_open = false;
	this.be_open = false;
};

jscb.Box.prototype = {
	clickBox : function(){
		var param = {	
			contentId: 'content_combo_'+this.id, 
			thumbnailId: 'combo_'+this.id,
			content_sub_type: 'combo'
		};
		hobj = hs.$('ext_el_'+this.id);
		
		if(this.is_open) {
			this.be_open = true;
			if(hs.expanders[this.expander_key]) {
				hs.expanders[this.expander_key].close();
				this.is_open = false;
			} else {
				this.is_open = true;
				hs.htmlExpand(hobj, param);
			}
		} else {
			if(!this.be_open)	this.expander_key = hs.expanders.length;
			hs.htmlExpand(hobj, param);
			this.is_open = true;
		}
		return false;
	}
}
