/*
 *	Initialize checkbox helpers in messageCenter
 */

/*
function renderGastroCalendar() {
	var arrCurrentWeek = [], arrAllEvents = [], iIterate = 0;

	jQuery('.gastronomyevents table td').each(function() {
		strCurrentRow = jQuery(this).attr('rel');
		if(strCurrentRow.substr(0, 5) == 'date:') {
			arrCurrentDate = strCurrentRow.substr(5).split('-');
			if	(
				arrCurrentDate[0] == getFullYear() &&
				(int) arrCurrentDate[1] ==
				(int) arrCurrentDate[2] <= getDate() +
				)
			arrCurrentWeek[iIterate] =
			iIterate++;
		}
	}

	return void();
}
*/

// load when DOM ready
jQuery( function(){
	var source = jQuery('select[name=gastronomy]');
	if( !source || !source.length )
		return;

	//console.dir( source );

	var query = document.createElement( 'input' ),
		result = document.createElement( 'input' );

	query.type = 'text';
	query.name = 'gastronomyName';
	query.className = 'OptionsBoxQuery';
	if( source.hasClass( 'error' ) )
		query.className += ' error';

	result.type = 'hidden';
	result.name = 'gastronomy';

	// remove original select
	jQuery( query ).insertBefore( source );
	jQuery( result ).insertBefore( source );
	source.remove();

	var provider = new SelectOptionsBoxProvider( result, true, source );

	provider.initialized = 'Name der Location eingeben';
	provider.loading = 'Lade Daten…';
	provider.notfound = 'Keine Location gefunden';
	provider.notselected = 'Es wurde keine Location ausgewählt';

	new OptionsBox( query, provider );
	//renderGastroCalendar();
} );