function showAccept(msg)
{
	showAlertWindow(msg, 'accept');
}

function showMessage(msg)
{
	showAlertWindow(msg, 'message');
}

function showError(msg)
{
	showAlertWindow(msg, 'error');
}

function showAlertWindow(msg, type)
{
	var src = "";
	var color = "";
	switch(type)
	{
	case 'accept':
	  src = "/img/system/accept.png";
	  color = "green";
	  break;
	case 'error':
	  src = "/img/system/warning.png";
	  color = "red";
	  break;
	case 'message':
	  src = "/img/system/message.png";
	  color = "blue";
	  break;  
	default:
	  return;
	}
	
	var toShow = "<ul><li>";
	if (msg instanceof Array )
		msg = msg.join("</li><li>");
	toShow = toShow + msg + "</li></ul>";
	
	var html = '';
	html += '<div id="alert_overlay"></div>';
	html += '<div id="alert_wrap">';
	html += '<div id="alert_outer">';
	html += '<div id="alert_inner">';
	html += '<div id="alert_close" onclick="$(\'#alert_overlay\').fadeOut(\'fast\'); $(\'#alert_overlay\').remove(); $(\'#alert_wrap\').remove();"></div>';
	html += '<div id="alert_bg"><div class="alert_bg alert_bg_n"></div><div class="alert_bg alert_bg_ne"></div><div class="alert_bg alert_bg_e"></div><div class="alert_bg alert_bg_se"></div><div class="alert_bg alert_bg_s"></div><div class="alert_bg alert_bg_sw"></div><div class="alert_bg alert_bg_w"></div><div class="alert_bg alert_bg_nw"></div></div>';
	html += '<div id="alert_content"><img src="' + src + '">' + toShow + '</div>';
	html += '</div>';
	html += '</div>';
	html += '</div>';
	$(html).appendTo("body");
	$("#alert_overlay").css("opacity", 0.3).fadeIn("normal");
	$("#alert_outer").fadeIn("normal");
	$("#alert_inner").css("width",$("#alert_content").width()).css("height",$("#alert_content").height());
	$("#alert_content li").css("color", color)
	$("#alert_outer").css("top", document.body.clientHeight/2 - $("#alert_outer").height()/2).css("left", document.body.clientWidth/2 - $("#alert_outer").width()/2)
	var isIE = ($.browser.msie && parseInt($.browser.version.substr(0,1)) < 8);
	if (isIE)
	{
		$("#alert_close, .alert_bg, #alert_content").each(function () {
			var image = $(this).css('backgroundImage');

			if (image.match(/^url\(["']?(.*\.png)["']?\)$/i)) {
				image = RegExp.$1;
				$(this).css({
					'backgroundImage': 'none',
					'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=" + ($(this).css('backgroundRepeat') == 'no-repeat' ? 'crop' : 'scale') + ", src='" + image + "')"
				}).each(function () {
					var position = $(this).css('position');
					if (position != 'absolute' && position != 'relative')
						$(this).css('position', 'relative');
				});
			}
		});
	}
}