var RegioDialog = new Class({

	Implements: [Events, Options],
	Extends: RegioMask,

	options: {},

	initialize : function(options){
		this.setOptions(options);

	},

	_close: function ( delay ) {
		
		document.getElement('body').setStyles({
			'overflow-y':'auto',
			'overflow-x':'hidden'
		});

		// send google analytics event
		gaLabel = $('dialog').getElement('.dialog_content .box-header').get('html').stripTags();
		gaLabel = (gaLabel.length > 0) ? gaLabel : '[n/a]';
		_gaq.push(['_trackEvent', 'RegioDialog_Form', 'Close', gaLabel]);

		if( delay == false ) {
			if( $chk($('dialog')) ) {
				$('dialog').destroy();
			}
			if( $chk($('RegioMask')) !== false ) {
				$('RegioMask').destroy();
			}
		} else {
			this._close.delay(delay,null,false);
		}
	}


});
