//
// Button Panel - JavaScript UI Module
//
// v1.0.00
//
// Usage:
// ------
//
// 
//
// ** Changelog **
//
// 2011-09-23 v1.0.00
// -----------------------------
//		-- Started
//		
//


$.widget("ui.button_panel",{
	_init:function() {
		var ui_object = this;
		var ui_elements = this.element;
		var ui_table_elements = ui_elements.find("table, td");
		var ui_button_elements = ui_elements.find("a");
		
		$.each( ui_table_elements, function(  ) {
			
			if( $(this).is( "table" ) ) {
				$(this).addClass( "ui-panel ui-corner-all" );
				$(this).css( { 'background' : '#FFFFFF','padding':'0.5em','margin-top':'.5em' } );
			} else {
				if( $(this).is( "th" ) ) {

				} else {
					if( $(this).is("td") ) {
						$(this).css( { 'width':'33%','padding':'0.2em' } );
					}
				}
			}
		});

		$.each( ui_button_elements, function(  ) {
			$(this).css({'width':'100%','height':'50'});
			$(this).button();
			//$(this).bind( "click", function(event) { alert("button clicked"); });
			//alert('test');
		});

	}
	//buttons:function( element ) {
			//$(element).addClass( "ui-priority-primary ui-corner-all ui-state-disabled hover" );
			//$(element).bind( "click", function(event) { alert("button clicked"); });
	//}
});



