function showDisclaimer(which) {
if (which != 'undefined' && which != '') {
		var html = '';
		var theLink = '';
		switch(parseInt(which)) {
			// Daily Access
			case 1:
				html = 'You are now leaving the Plancorp, LLC website and will be entering the DailyAccess website. Plancorp, LLC has not been involved with the preparation of the content supplied at the DailyAccess site, and provides this link as a service to those individuals who have accounts for which DailyAccess is the third party administrator and/or record keeper. Plancorp, LLC makes no representation as to the content of the information contained on the DailyAccess website and cannot certify the accuracy of that information.';
				theLink = 'https://www.dailyaccess.com/login-participant';
				break;
			// NextStep/Verisight
			case 2:
				html = 'You are leaving the Plancorp, LLC website and will be entering the Verisight website. Plancorp, LLC has not been involved with the preparation of the content supplied at the Verisight site, and provides this link as a service to those individuals who have accounts for which Verisight is the third party administrator and/or record keeper. Plancorp, LLC makes no representation as to the content of the information contained on the Verisight website and cannot certify the accuracy of that information.';
				theLink = 'https://securelogin.nextstepdc.com/';
				break;
			// Charles Schwab
			case 3:
				html = 'You are leaving the Plancorp, LLC website and will be entering the Charles Schwab & Co., Inc ("Schwab") website. Charles Schwab & Co., Inc. ("Schwab") is a registered broker-dealer, and is not affiliated with any advisor(s) whose name(s) appear on this Web site. Plancorp, LLC is independently owned and operated. Schwab neither endorses nor recommends Plancorp, LLC. Schwab does not endorse or recommend the investment strategy of any advisor.  Schwab has agreements with Plancorp, LLC under which Schwab provides Plancorp, LLC with services related to your account. Schwab does not review the Plancorp, LLC website(s), and makes no representation regarding information contained in the Plancorp, LLC website, which should not be considered to be either a recommendation by Schwab or a solicitation of any offer to purchase or sell any securities.';
				theLink = 'https://client.schwab.com/Login/SignOn/CustomerCenterLogin.aspx?&kc=y&sim=y';
				break;
			// Fidelity
			case 4:
				html = 'You are now leaving the Plancorp, LLC website and will be entering Fidelity Investments&reg; Web site. Plancorp, LLC has not been involved with the preparation of the content supplied at the Fidelity Investments site. Clearing, custody or other brokerage services may be provided by National Financial Services LLC, or Fidelity Brokerage Services LLC. While you grant us Limited Power of Attorney (LPOA) to execute transactions on your behalf, accounts are held in your name. Plancorp, LLC is an independent company and not affiliated with Fidelity Investments, or any of its affiliates. Fidelity Investments has not been involved in the preparation of the content in the Plancorp, LLC site. Fidelity Investments is a registered service mark of FMR LLC.';
				theLink = 'http://www.fidelity.com';
				break;
			// Client Vault
			case 5:
				html = 'You (the "Client") are leaving the Plancorp, LLC website and going to Plancorp\'s Client Vault, which is a separate site hosted by Advisor Products, Inc. (the "Vault Host"). The Vault Host designed and maintains this site, which posts information provided by Plancorp and other third parties (the "Content"). The Vault Host is responsible for the maintenance and security of the Content. Client understands that the Vault Host has made its best effort to ensure that its service is uninterrupted, error free and completely secure, but neither Plancorp nor the Vault Host warrant same. Your use of the Content is provided for your convenience, is being accessed at your own risk, and is being made available to you on an "AS IS" and "AS AVAILABLE" basis. The Content is believed to be reliable but we do not guarantee the completeness, timeliness, sequence, accuracy, or adequacy of the Content, and do not represent or warrant results to be obtained from its use or that the Content contains sufficient information by itself to be the basis for sound investment decisions. To the full extent permitted under applicable law, Plancorp expressly disclaims all warranties of any kind, whether expressed or implied INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY, ACCURACY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. No endorsement of third party products, services or information is expressed or implied by any Content. Under no circumstances should any of the Content be construed as an offer to sell or solicitation of an offer to buy a particular security. Consumers are encouraged to read the privacy policies of websites reached through the use of links from the Plancorp website and the Client Vault.';
				theLink = 'https://apiav.com/_layouts/APIPersonalpages/LoginAdmin.aspx?ReturnUrl=%2fsites%2fplancorp%2fdefault.aspx';
				break;
			// TD Ameritrade
			case 6:
				html = 'You are leaving the Plancorp, LLC website and will be entering the TD Ameritrade, Inc. website. TD Ameritrade, Inc. is one of the firms that Plancorp uses to custody client assets. TD Ameritrade and Plancorp, LLC. are separate and unaffiliated firms, and are not responsible for each other’s services or policies. TD Ameritrade does not endorse or recommend any advisor and the use of the TD Ameritrade logo does not represent the endorsement or recommendation of any advisor. Brokerage services provided by TD Ameritrade Institutional, Division of TD Ameritrade, Inc., member FINRA/SIPC/NFA. TD Ameritrade is a trademark jointly owned by TD Ameritrade IP Company, Inc. and The Toronto-Dominion Bank. Used with permission.';
				theLink = 'http://www.advisorclient.com';
				break;
			// ASPire
			case 7:
				html = 'You are now leaving the Plancorp, LLC website and will be entering the ASPire website. Plancorp, LLC has not been involved with the preparation of the content supplied at the ASPire site, and provides this link as a service to those individuals who have accounts for which ASPire is the third party administrator and/or record keeper. Plancorp, LLC makes no representation as to the content of the information contained on the ASPire website and cannot certify the accuracy of that information.';
				theLink = 'http://www.aspire401k.com';
				break;
			// Expert Plan
			case 8:
				html = 'You are now leaving the Plancorp, LLC website and will be entering the Expert Plan website. Plancorp, LLC has not been involved with the preparation of the content supplied at the Expert Plan site, and provides this link as a service to those individuals who have accounts for which Expert Plan is the third party administrator and/or record keeper. Plancorp, LLC makes no representation as to the content of the information contained on the Expert Plan website and cannot certify the accuracy of that information.';
				theLink = 'http://www.expertplan.com';
				break;
			// First Mercantile
			case 9:
				html = 'You are now leaving the Plancorp, LLC website and will be entering the First Mercantile website. Plancorp, LLC has not been involved with the preparation of the content supplied at the First Mercantile site, and provides this link as a service to those individuals who have accounts for which First Mercantile is the third party administrator and/or record keeper. Plancorp, LLC makes no representation as to the content of the information contained on the First Mercantile website and cannot certify the accuracy of that information.';
				theLink = 'http://www.firstmerc.com';
				break;
		}
		displayDisclaimer(html, theLink);
	}
}

function displayDisclaimer(html, theLink) {
	function doAction(objevent) {
		//window.location = theLink;
		window.open(theLink);
		closeDialog();
	}
	
	$("#divDialog").dialog({
		buttons: {"Please click here if you wish to proceed": doAction, Cancel: closeDialog},
		close: closeDialog,
		modal: true,
		draggable: false,
		resizable: false,
		title: "Disclaimer",
		width: 450,
		position: 'top'
	});
	$(".ui-dialog").css("margin-top","50px");
	
	$("#divDialog").html(html);
}

function closeDialog() {
	$("#divDialog").dialog("destroy");
	$("#divDialog").html("");
	$("#divDialog").css("display","none");
}
