var AccentuateApplication = new Class ({
	
	/**
	 *
	 */
	Implements: [Options, Events],
	
	/**
	 *
	 */
	options: {
		'baseUrl': '',
		'useAsyncRequests': false,
		'currency': null
	},
	
	/**
	 *
	 */
	initialize: function (options) {
		this.setOptions ( options );
		
		window.addEvent ( 'domready', function () {
			this.initializeTips ( '.tip' );
			
		}.bind ( this ) );
		
	},
	
	/**
	 *
	 */
	baseUrl: function (url) {
		
		if ( $chk ( url ) ) {
			this.options.baseUrl = url;
			return this;
		
		}
		
		return this.options.baseUrl;
		
	},
	
	/**
	 *
	 */
	initializeTips: function (clas) {
		
		if ( !$chk ( clas ) ) {
			clas = '.tip';
			
		}
		
		$$(clas).each( function(el) {
			
			if ( !el.hasClass ( 'done' ) && el.getProperty ( 'title' ) ) {
				var dual = el.getProperty('title').split('::');
				
				if ( dual.length === 1 ) {
					el.store ( 'tip:text', dual[0].trim () );
					el.store ( 'tip:title', 'Tip' );
					
				} else {
					el.store('tip:title', dual[0].trim());
					el.store('tip:text', dual[1].trim());
				
				}
				
				el.addClass ( 'done' );
				
			}
			
		});
		
		this._tips = new Tips(clas);
		
	}
	
});
