function uiTabClass( id ){
	var c1=jml.obj
	var c2=jml.xml.node;
	var c3=jml.events;
	var host , id = id || 'ui88MF' , item = { current:{ o:null , i:null }, past:{ o:null, i:null } };
	function parse(){
		var o = getObj( id );
		if( !isset(o) ) return;
		if( isNaN( host.initialIndex) || host.initialIndex < 0 ) host.initialIndex = 0;
		var n = c2.length( o );
		for(var i = 0 ; i < n ; i++ ) setAction( c2.byPosition( i , o ) , i );
	}
	function setAction( o , i ){
		if( i == host.initialIndex && isset( host.selectedClassName ) ){
			addStyle( o , host.selectedClassName );
			item.current = { o:o , i:i };
			cbSelect();
		}
		if(isset(host.overClassName)){
			c3.add( o , 'mouseover' , delegate( null , onMouse , o , i , true ) );
			c3.add( o , 'mouseout' , delegate( null , onMouse , o , i , false ) );
		}
		c3.add( o , 'click' , delegate( null , onClick , o , i ) );
	}
	function onMouse( e , o , i , b ){
		var s = host.overClassName;
		b? addStyle( o , s ) : removeStyle( o , s );
		var f = b? host.onRollOver : host.onRollOut;
		if( isset(f) ) f( o , i );
	}
	function onClick( e , o , i ){
		if( item.current.o !== o && !host.inTransition){
			item.past = item.current;
			item.current = { o:o , i:i };
			removeStyle( item.past.o , host.selectedClassName );
			addStyle( o , host.selectedClassName );
			cbSelect();
		}
	}	
	function addStyle( o , s ){
		var c = c1.get( o , 'className' );
		c1.set( o , 'className' , ( c=isset( c ) ? c : '' ) + ' ' + s );
	}
	function removeStyle( o , s ){
		if( !isset( s ) ) return;
		var c = c1.get( o , 'className') , g = new RegExp( s , "g");
		c1.set( o , 'className' , c.replace(g,'' ));
	}
	function cbSelect(){
		if( isset( host.onSelect ) ){
			host.onSelect( item.current.o , item.current.i , item.past.o , item.past.i );
		}
	}
	return {
		$:function(){
			host=this;
			c3.add( window , 'load' , parse );
			return this;
		},
		initialIndex:0,
		overClassName:null,
		selectedClassName:null,
		inTransition:false,
		onSelect:null,
		onRollOver:null,
		onRollOut:null
	}.$();
}