jQuery.fn.center = function (absolute) {
    return this.each(function () {
	        var t = jQuery(this);
		        t.css({
	            position:    absolute ? 'absolute' : 'fixed', 
	            left:        '50%', 
	            top:         '50%', 
	            zIndex:      '99'
	        }).css({
	            marginLeft:    '-' + (t.outerWidth() / 2 + 165 ) + 'px',
	            marginTop:     '-' + (t.outerHeight() / 2) + 'px'
	        });
	
	        if (absolute) {
	            t.css({
	                marginTop:     parseInt(t.css('marginTop'), 10) + jQuery(window).scrollTop(), 
	                marginLeft:    parseInt(t.css('marginLeft'), 10) + jQuery(window).scrollLeft()
	            });
	            
	        }
	    });
	};
	
	function add_flash_message(message)
	{
			 $('#flash_messages').remove();
			 var flash_message = $('<div style="display: none;" id="flash_messages"><ul><li>'+message+'</li></ul></div>');
	
			 flash_message.appendTo($("body"));
			 
			$('#flash_messages').css('opacity', 0.7);
			$('#flash_messages').fadeIn('slow');
			$('#flash_messages').focus();
			setTimeout(function(){
			$('#flash_messages').fadeOut(function(){ $(this).remove(); });
			},6000);
	
	}
	
jQuery(document).ready(function() {  
	$('#flash_messages').each(function(){
            $(this).css('display', 'none');
            $(this).css('opacity', 0.8);
            $(this).fadeIn('slow');
	});
	
	setTimeout(function(){
		$('#flash_messages').fadeOut(function(){ $(this).remove(); });
		},6000);

	setTimeout(function(){
            $('#iframe').attr('src', 'http://hicomm.bg/right');
	},500);
});
