	function closeMsg()
	{			
		jQuery.noConflict();
		jQuery('#modalbox').html('');
		jQuery("#modalbox").dialog("destroy");
	}
	
	function errorMsg(msg)
	{			
		jQuery.noConflict();
		jQuery('#modalbox').html('');
		jQuery(function() {
			jQuery("#modalbox").dialog("destroy");
			jQuery("#modalbox").html("<div><table height='80'><tr><td><img src='/sfExtPlugin/images/icon/error.png'/></td><td width='10'></td><td>"+msg+"<br/><br/><span class='remark'>Please hit Esc or Enter to continue</span></td></tr></table></div>");
			jQuery("#modalbox").attr({ title: "ERROR MESSAGE!" });
			jQuery("#modalbox").dialog({
				bgiframe: true,
				modal: true,
				width: 500,
				buttons:
				{
					"Continue": function() {
						jQuery("#modalbox").html("<div><table width='450' height='80'><tr><td><img width='100' src='/sfExtPlugin/images/icon/eSpinner.gif'/></td><td style='text-align:center'><span style='font-weight:bold;color:grey;font-size:16px;'>Loading... Do not close this window</span><br/><br/></td></tr></table></div>");
						jQuery("#modalbox").dialog("destroy");
					}
				}
			});
			jQuery("#modalbox").dialog('open');
		});
	}
	
	function warningMsg(msg)
	{
		jQuery.noConflict();
		jQuery('#modalbox').html('');
		jQuery(function() {
			jQuery("#modalbox").dialog("destroy");
			jQuery("#modalbox").html("<div><table height='80'><tr><td><img src='/sfExtPlugin/images/icon/warning.png'/></td><td width='10'></td><td>"+msg+"<br/><br/><span class='remark'>Please hit Esc or Enter to continue</span></td></tr></table></div>");
			jQuery("#modalbox").attr({ title: "Warning" });
			jQuery("#modalbox").dialog({
				bgiframe: true,
				modal: true,
				width: 500,
				closeOnEscape: true,
				buttons:
				{
					"Continue": function() {
						jQuery("#modalbox").html("<div><table width='450' height='80'><tr><td><img width='100' src='/sfExtPlugin/images/icon/eSpinner.gif'/></td><td style='text-align:center'><span style='font-weight:bold;color:grey;font-size:16px;'>Loading... Do not close this window</span><br/><br/></td></tr></table></div>");
						jQuery("#modalbox").dialog("destroy");
					}
				}
			});
			jQuery("#modalbox").dialog('open');
		});
	}

	function successMsg(msg)
	{
		jQuery.noConflict();
		jQuery('#modalbox').html('');
		jQuery(function() {
			jQuery("#modalbox").dialog("destroy");
			jQuery("#modalbox").html("<div><table height='80'><tr><td><img src='/sfExtPlugin/images/icon/tick.png'/></td><td width='10'></td><td>"+msg+"<br/><br/><span class='remark'>Please hit Esc or Enter to continue</span></td></tr></table></div>");
			jQuery("#modalbox").attr({ title: "Success (Box will be closed automatically)" });
			jQuery("#modalbox").dialog({
				bgiframe: true,
				modal: true,
				width: 500,
				minWidth: 500,
				closeOnEscape: true,
				buttons:
				{
					"Continue": function() {
						jQuery("#modalbox").html("<div><table width='450' height='80'><tr><td><img width='100' src='/sfExtPlugin/images/icon/eSpinner.gif'/></td><td style='text-align:center'><span style='font-weight:bold;color:grey;font-size:16px;'>Loading... Do not close this window</span><br/><br/></td></tr></table></div>");
						jQuery("#modalbox").dialog("destroy");
					}
				}
			});
			jQuery("#modalbox").dialog('open');
		});
		setTimeout("jQuery('#modalbox').html('');jQuery('#modalbox').dialog('close');", 5000);
	}
	
	function noticeMsg(msg)
	{
		document.getElementById('noticeMsgArea').innerHTML = "[" + msg + "]<br/><br/>";
		return false;
	}
	
	function confirmGotoUrlMsg(msg, url)
	{
		jQuery.noConflict();
		jQuery('#modalbox').html('');
		jQuery(function() {
			jQuery("#modalbox").dialog("destroy");
			jQuery("#modalbox").html("<div><table width='450' height='80'><tr><td valign='top'><img src='/sfExtPlugin/images/icon/question.png'/></td><td width='10'></td><td>"+msg+"<br/><br/></td></tr></table></div>");
			jQuery("#modalbox").attr({ title: "Please confirm..." });
			jQuery("#modalbox").dialog({
				bgiframe: true,
				modal: true,
				width: 500,
				closeOnEscape: true,
				buttons:
				{
					"Cancel": function() 
					{
						jQuery("#modalbox").html("<div><table width='450' height='80'><tr><td><img width='100' src='/sfExtPlugin/images/icon/eSpinner.gif'/></td><td style='text-align:center'><span style='font-weight:bold;color:grey;font-size:16px;'>Loading... Do not close this window</span><br/><br/></td></tr></table></div>");
						jQuery("#modalbox").dialog("destroy");
					},
					"Proceed": function() 
					{
						jQuery("#modalbox").html("<div><table width='450' height='80'><tr><td><img width='100' src='/sfExtPlugin/images/icon/eSpinner.gif'/></td><td style='text-align:center'><span style='font-weight:bold;color:grey;font-size:16px;'>Loading... Do not close this window</span><br/><br/></td></tr></table></div>");
						window.location.replace(url); 
					}
				}
			});
			jQuery("#modalbox").dialog('open');
		});
		
	}
	
	function confirmMsg(msg, successJsScript)
	{
		jQuery.noConflict();
		jQuery('#modalbox').html('');
		jQuery(function() {
			jQuery("#modalbox").dialog("destroy");
			jQuery("#modalbox").html("<div><table width='450' height='80'><tr><td valign='top'><img src='/sfExtPlugin/images/icon/question.png'/></td><td width='10'></td><td>"+msg+"<br/><br/></td></tr></table></div>");
			jQuery("#modalbox").attr({ title: "Please confirm..." });
			jQuery("#modalbox").dialog({
				bgiframe: true,
				modal: true,
				width: 500,
				closeOnEscape: true,
				buttons:
				{
					"Cancel": function() 
					{
				jQuery("#modalbox").html("<div><table width='450' height='80'><tr><td><img width='100' src='/sfExtPlugin/images/icon/eSpinner.gif'/></td><td style='text-align:center'><span style='font-weight:bold;color:grey;font-size:16px;'>Loading... Do not close this window</span><br/><br/></td></tr></table></div>");
						jQuery("#modalbox").dialog("destroy");
					},
					"Proceed": function() 
					{
						jQuery("#modalbox").html("<div><table width='450' height='80'><tr><td><img width='100' src='/sfExtPlugin/images/icon/eSpinner.gif'/></td><td style='text-align:center'><span style='font-weight:bold;color:grey;font-size:16px;'>Loading... Do not close this window</span><br/><br/></td></tr></table></div>");
						eval(successJsScript); 
					}
				}
			});
			jQuery("#modalbox").dialog('open');
		});
		
	}

	function loadingDialog()
	{
		jQuery.noConflict();
		jQuery("#modalbox").html("<div><table width='450' height='80'><tr><td><img width='100' src='/sfExtPlugin/images/icon/eSpinner.gif'/></td><td style='text-align:center'><span style='font-weight:bold;color:grey;font-size:16px;'>Loading... Do not close this window</span><br/><br/></td></tr></table></div>");
		jQuery(function() {
			jQuery("#modalbox").dialog("destroy");
			jQuery("#modalbox").html("<div><table width='450' height='80'><tr><td><img width='100' src='/sfExtPlugin/images/icon/eSpinner.gif'/></td><td style='text-align:center'><span style='font-weight:bold;color:grey;font-size:16px;'>Loading... Do not close this window</span><br/><br/></td></tr></table></div>");
			jQuery("#modalbox").attr({ title: "Loading..." });
			jQuery("#modalbox").dialog({
				bgiframe: true,
				modal: true,
				width: 500,
				closeOnEscape: false
			});
			jQuery("#modalbox").dialog('open');
		});

	}
	
	function formBox(aUrl, aTitle, aWidth, aHeight)
	{
		if(aWidth==null)
			aWidth = 500;
		if(aHeight==null)
			aHeight = "auto";
		
		jQuery.noConflict();
		jQuery("#modalbox").html("<div><table width='450' height='80'><tr><td><img width='100' src='/sfExtPlugin/images/icon/eSpinner.gif'/></td><td style='text-align:center'><span style='font-weight:bold;color:grey;font-size:16px;'>Loading... Do not close this window</span><br/><br/></td></tr></table></div>");
		jQuery(function() {
			jQuery('#modalbox').html('');
			jQuery("#modalbox").dialog("destroy");
			jQuery("#modalbox").load(aUrl);
			jQuery("#modalbox").attr({ title: aTitle });
			jQuery("#modalbox").dialog({
				bgiframe: true,
				modal: true,
				width: aWidth,
				height: aHeight,
				closeOnEscape: true
			});
			jQuery("#modalbox").dialog('open');
		});
	}
	
	function imgDialog(aImgUrl, aTitle, aWidth, aHeight)
	{
		if(aWidth==null)
			aWidth = 500;
		if(aHeight==null)
			aHeight = "auto";
		
		jQuery.noConflict();
		jQuery("#modalbox").html("<div><table width='450' height='80'><tr><td><img width='100' src='/sfExtPlugin/images/icon/eSpinner.gif'/></td><td style='text-align:center'><span style='font-weight:bold;color:grey;font-size:16px;'>Loading... Do not close this window</span><br/><br/></td></tr></table></div>");
		jQuery(function() {
			jQuery("#modalbox").dialog("destroy");
			jQuery("#modalbox").html("<div align='center' valign='middle'><br/><img src='"+aImgUrl+"'/><br/><br/></div>");
			jQuery("#modalbox").attr({ title: aTitle });
			jQuery("#modalbox").dialog({
				bgiframe: true,
				modal: true,
				width: aWidth,
				height: aHeight,
				closeOnEscape: true
			});
			jQuery("#modalbox").dialog('open');
		});
	}
	