
specifications_tabs = function(container_id)
{
	var me = new Object();
	me.push_ix = 0;
	if(me.tab_buttons == null)
		me.tab_buttons = new Array();
	if(me.tabs_titles == null)
		me.tabs_titles = new Array();
	if(me.tabs_details == null)
		me.tabs_details = new Array();
	
	me.add_tab_button = function(tab_button_id) {
		var tab_button = $(tab_button_id);
		if(tab_button) {
			me.tab_buttons.push(tab_button);
			me.tabs_titles.push(new Array());
			me.tabs_details.push(new Array());
		}
	}
	me.add_title_and_detail = function(title_id, detail_id) {
		//alert(me.tab_buttons.length);
		var title = $(title_id);
		if(title)
			me.tabs_titles[me.tab_buttons.length-1].push(title);
		var detail = $(detail_id);
		if(detail)
			me.tabs_details[me.tab_buttons.length-1].push(detail);
	}
	
	me.initialize = function() {
		/*Add the method that opens and closes the tabs*/
		for(var i=0; i<me.tab_buttons.length; i++){
			//alert(me.tab_buttons[i].id);
			me.tab_buttons[i].onmousedown = function() {
				//alert(this.id);
				if( 1 < me.tab_buttons.length) {
					for(var j=0; j<me.tab_buttons.length; j++) {
						var tab_button_on_id = me.tab_buttons[j].id.replace("_tab_button", "_tab_button_on");
						var tab_button_off_id = me.tab_buttons[j].id.replace("_tab_button", "_tab_button_off");
						var tab_id = me.tab_buttons[j].id.replace("_tab_button", "_tab");
						var tab = $(tab_id);
						var msrp_row_id = tab_id + '_msrp';
						var msrp_row = $(msrp_row_id);
						var open_state = tab.getAttribute("open_state");
						if(open_state=="true") {
							Element.setOpacity(tab_button_on_id, 0.0);
							Element.setOpacity(tab_button_off_id, 1.0);
							tab.style.display = 'none';
							msrp_row.style.display = 'none';
							tab.setAttribute("open_state", "false");
						}
						else {
							Element.setOpacity(tab_button_on_id, 1.0);
							Element.setOpacity(tab_button_off_id, 0.0);
							tab.style.display = 'block';
							msrp_row.style.display = 'block';
							tab.setAttribute("open_state", "true");
						}
					}
				}
			}
		}
		
		/*Now add the methods that open and close the div's!*/
		for(var i=0; i<me.tab_buttons.length; i++) {
			for(var j=0; j<me.tabs_titles[i].length; j++) {
				me.tabs_titles[i][j].onmousedown = function() {
					var detail_id = this.id.replace('_title_','_detail_');
					var detail = $(detail_id);
					var open_title = $(this.id + '_open');
					if(detail.style.display == 'none') {
						//detail.style.display = 'block';
						Effect.SlideDown(detail_id,{
							beforeStart:function(effect) {
								//don't need beforeStart... yet
							},
							afterFinish:function(effect) {
								//don't need afterFinish... yet
								open_title.style.display = 'block';
							}
						});
					}
					else {
						//detail.style.display = 'none';
						Effect.SlideUp(detail_id,{
							beforeStart:function(effect) {
								//don't need beforeStart... yet
							},
							afterFinish:function(effect) {
								open_title.style.display = 'none';
							}
						});
					}
				}
			}
		}
		
		//Add the OPEN ALL button
		var open_all = $('open_all_button_timg');
		open_all.onmousedown = function() {
			for(var i=0; i<me.tab_buttons.length; i++) {
				var tab_id = me.tab_buttons[i].id.replace("_tab_button", "_tab");
				var tab = $(tab_id);
				var open_state = tab.getAttribute("open_state");
				if(open_state=="true") {
					for(var j=0; j<me.tabs_details[i].length; j++) {
						me.tabs_details[i][j].style.display = 'block';
						var open_title = $(me.tabs_titles[i][j].id + '_open');
						open_title.style.display = 'block';
					}
				}
			}
		}
		
		//Add the CLOSE ALL button
		var close_all = $('close_all_button_timg');
		close_all.onmousedown = function() {
			for(var i=0; i<me.tab_buttons.length; i++) {
				var tab_id = me.tab_buttons[i].id.replace("_tab_button", "_tab");
				var tab = $(tab_id);
				var open_state = tab.getAttribute("open_state");
				if(open_state=="true") {
					for(var j=0; j<me.tabs_details[i].length; j++) {
						me.tabs_details[i][j].style.display = 'none';
						var open_title = $(me.tabs_titles[i][j].id + '_open');
						open_title.style.display = 'none';
					}
				}
			}
		}
	}
	
	return me;
}