/* 	GroupBasic
*	Display group
*	
*	IMPORTANT
*
*	
*										*/
var GroupBasic = function( ref, set )	{

	Object.extend( obj = $$( '.GroupBasic' ).pop(), GroupBasic.proto );
	//Object.extend( obj, CalendarField[ "proto_" + ref.react ]);
	obj.ref = ref;
	
	//obj.init();
	if( set ) obj.seed( set );

	return obj;
}


GroupBasic.proto = {
	
	current		: 0,
	
	load		: function( el ) {
		
		this.current += ( el.currentTarget.hasClassName( "left" ) )? -1 : 1;
		this.select( ".month" )[0].update( "..." );
		
		xhttp.send( '/xhttp.mod', { mod: "calendar.field", action: "mini", vars: { current: this.current }}, this.pull_response.bind( this ));
	},
	
	seed		: function( set ) {
		
		
	},
	
	fillnode	: function( span, n) {
			
			
	},
	
	prepstream		: function() {
		
		this.select( "li.movie" ).each( function( el ) {
			
			el.observe( "click", this.flipstream );
		}, this );
		
	},
	
	flipstream		: function() {

		var childs = this.childElements();
		childs[0].hide();
		childs[1].hide();
		childs[2].removeClassName("hide");
		
	},
	
	bubble		: function() {}

}

GroupBasic.proto_info = {
	
	init		: function() {
	
	},
	
	hover		: function() {

	},
	
	bubble		: function() {
		
	}
}



//add_header_element ( "script", {...} )  

TextNews = function( obj )	{
	
	this.obj = (typeof obj == "object" )? obj : (
		(obj == "first")? $$('.TextNews')[0] : $$('.TextNews').pop()
	);
	
	this.children = this.obj.select('li');
	this.children.each( function( el ) {
		el.observe( "click", function( e ){ this.toggleClassName( "active" ); } );
	} );

}

TextNews.prototype =	{
	expand		: function( cond ) {
		
		if( cond == "first" ) this.children[0].addClassName( "active" );
		else if( !cond ) this.children.invoke( "addClassName", "active");
		else for( n=0; n<cond; n++ ) chlidren[ n ].addClassName( "active" );
	}
}

