
function toggleTab(offset,tabbarid,tabcontid,set,unset) {
	
	var a;
	var c;
	
	var width;

	offset--;

	if (a = $(tabbarid).select('a')) {
		a.each(function(s,index) {
			if ((set !== undefined) && (unset !== undefined)) {
				if (index == offset) {
					s.removeClassName(unset);
					s.addClassName(set);				
				} else {
					s.removeClassName(set);	
					s.addClassName(unset);
				}
			} else {
				width = s.getWidth();
				if (index == offset) {
					s.removeClassName('w' + width);	
					s.addClassName('w' + width + 's');				
				} else {
					s.removeClassName('w' + width + 's');	
					s.addClassName('w' + width);
				}
			}
		});
	}

	if (a = $(tabcontid).select('div[title="tabc"]')) {

		a.each(function(s,index) {
					if (index == offset) {
						Element.show(s);	
					} else {
						Element.hide(s);
					}
			
				});
	}
}


