﻿	function popupAlert()
	{
		alert("An attempt to open a legitimate window within the site failed.\r\n\r\nPlease ensure that no pop-up blockers are active for this site to ensure your browsing experience isn't affected.");
	}

	function openPopup(url, target, w, h, bShowMenu, positionTop, positionLeft) {	//
	    // openPopup
	    // Opens the specified url in a window with the given dimensions with allowance
	    // being made should the dimensions exceed the screen dimensions.
	    //
	    // If 'w' is set to -1 then the entire width of the screen up to a maximum of 1280
	    // is used.
	    //

	    var x, y;
	    var features;

	    if (w == -1)
	        w = (screen.availWidth > 1280 ? 1280 : screen.availWidth) - 11;
	    else if (screen.availWidth < w)
	        w = screen.availWidth;
	    if (screen.availHeight < h)
	        h = screen.availHeight;

	    if (typeof (positionLeft) !== 'undefined' && positionLeft === true)
	        x = 0;
	    else
	        x = screen.availWidth / 2 - w / 2;
	    if (typeof (positionTop) !== 'undefined' && positionTop === true)
	        y = 0;
	    else
	        y = (screen.availHeight - 56) / 2 - h / 2;

	    if (bShowMenu)
	        features = "menubar=yes,status=yes,scrollbars=yes,resizable=yes";
	    else
	        features = "menubar=no,status=yes,scrollbars=yes,resizable=yes";

	    var win = window.open(url, target, "left=" + x + ",top=" + y + ",width=" + w + ",height=" + h + "," + features);
	    if (win == null) {
	        popupAlert()
	    }
	    else {
	        if (url != "" && url.toLowerCase().indexOf("viewreport") == -1)
	            win.focus()
	    }

	    return win
	}
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();