var alert_helper = {
	var_initialized : false,
	var_background_html : '<div id=\"js-djem-alert-background\" style=\"top: 0px; left: 0px; z-index: 999;  position: absolute; width: 100%; height: 100%; background: #000000 none repeat scroll 0 0; opacity: 0.7; -moz-opacity: 0.7; filter:alpha(opacity=70);\">\r\n										</div>',
	
	var_html : '	<div id=\"js-djem-alert\" style=\"position: absolute; left: 50%; margin-left: -200px; width: 400px; z-index: 1000; background-color: white; border: 1px solid #ffffff;\">\r\n									<div class=\"header\"><h4>Уведомление</h4></div>\r\n									<div style=\"padding: 0px 10px 10px 10px;\">\r\n									<p id=\"js-djem-alert-text\"></p>\r\n									<p align=right><a href=\"javascript: alert_helper.hide();\" id=\"js-djem-alert-hide\" class=\"blueButton\" style=\"text-decoration:none;\">Закрыть</a></p>\r\n								</div></div>\r\n								',
	
	hide : function() {
		$('#js-djem-alert').hide();
		$('#js-djem-alert-background').hide();
	},
	
	show : function(text) {
		alert_helper.hide();
		if(alert_helper.var_initialized == false) {
			$('body').append(alert_helper.var_html);
			$('body').append(alert_helper.var_background_html);
			alert_helper.var_initialized = true;
		}
		$scrollTop = $(window).scrollTop();
		$('#js-djem-alert').css('top', $scrollTop + ($(window).height()/2) - $('#js-djem-alert').height()/2);
		$('#js-djem-alert-background').height($(document).height());
		$('#js-djem-alert-text').text(text);
		$('#js-djem-alert').show();
		$('#js-djem-alert-background').show();
	}
	
	
}

function djem_alert(text) {
	alert_helper.show(text);
}
