
function printWindow( printUrl )
{
    var windowFeatures = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes";

    MyPrintWindow = window.open(printUrl, "printWindow", windowFeatures );
    MyPrintWindow.focus();
    
    // ignore the anchor click.
    return false;
}


function excelWindow( printUrl )
{
    var windowFeatures = "toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes";

    MyPrintWindow = window.open(printUrl, "excelWindow", windowFeatures );
    MyPrintWindow.focus();
    
    // ignore the anchor click.
    return false;
}

function showRxDeaMessage()
{
	new Ajax.Updater(
		'rxDeaMessage', '/rx/rxDeaMessage.jsp',
		{onComplete: Effect.Appear('rxDeaMessage')}
	);
}

function showRxDeaMessage2(custNk, custGk)
{
	new Ajax.Updater(
		'rxDeaMessage', '/rx/rxDeaMessage.jsp?custNk=' + custNk + '&custGk=' + custGk,
		{onComplete: Effect.Appear('rxDeaMessage')}
	);
}

function hideRxDeaMessage()
{
	Effect.Fade('rxDeaMessage');
}

function showRxLicenseMessage()
{
	/*
	new Ajax.Updater(
		'rxLicenseMessage', '/rx/rxLicenseMessage.jsp',
		{onComplete: function(data){
			alert(data);
			Effect.Appear('rxLicenseMessage');}}
	);
	*/
	
	jQuery.post("/rx/rxLicenseMessage.jsp", {
	}, function(data){
		var dashBoardText = data;
		//alert(dashBoardText);
		jQuery('#rxLicenseMessage').html(dashBoardText);
		dashboardDialogFlag = true;
		jQuery('#rxLicenseMessage').offset(
				{
					left : jQuery('body').scrollLeft() + jQuery(window).width()
							/ 2 - jQuery("#rxLicenseMessage").width() / 2,
					top : jQuery('body').scrollTop() + jQuery(window).height()
							/ 2 - jQuery("#rxLicenseMessage").height() / 2
				});
		jQuery('#rxLicenseMessage').css('z-index',1000);
		jQuery('#rxLicenseMessage').show();

		
		//refreshDashboardDialog();
		repositionRxLicenseMessage();
	});

}

function repositionRxLicenseMessage() {
	//alert('repositioning');
	if (dashboardDialogFlag) {
		jQuery('#rxLicenseMessage').offset(
				{
					left : jQuery('body').scrollLeft() + jQuery(window).width()
							/ 2 - jQuery("#rxLicenseMessage").width() / 2,
					top : jQuery('body').scrollTop() + jQuery(window).height()
							/ 2 - jQuery("#rxLicenseMessage").height() / 2
				});
		setTimeout("repositionRxLicenseMessage();", 2000);
	}
}

function hideRxLicenseMessage()
{
	Effect.Fade('rxLicenseMessage');
}


function $FA(field) {
      if (field == null)
            return new Array();
      else if (!field.length)
            return new Array(field);
      else
            return field;
}

function refreshNavbar() {
	new Ajax.Updater('navbar_contents', 'navbar.jsp', {asynchronous:false});
	jQuery("td.welcomeTextNonLink").effect("highlight", {color: "#FFE303"}, 6500); 
}

