(function ($) {

/**
 * Front_Online_Top
 * @constructor jQuery
 *
 */
$.widget('ui.Front_Online_Top', $.extend({}, $.ui.Component.prototype, {
	type: 'Front_Online_Top',
	_init: function () {
		$.ui.Component.prototype._init.call(this) // chain parent constructor
		var icLamp = $("#icLamp")
		var popup_overlay = $("#popup_overlay")
		icLamp.click(function (ev) {
			ev.preventDefault()
			if(popup_overlay.css("display") == "none"){
				popup_overlay.show();
				popup_overlay.css("height",$("body").outerHeight())
				popup_overlay.css("width",$("body").outerWidth())
			} else {
				popup_overlay.hide();
			}
		})

		for(var i = 0; i < 5; i++){
			icLamp.fadeOut(800)
			icLamp.fadeIn(800)
		}

		$('.popup_overlay').click(function(ev){
			ev.preventDefault()
			ev.cancelBubble = true
		})

	}
}));

}).require('Component')(jQuery);