var baseUrl = document.location.href;
var fluentInFinance = 'fluentinfinance/';
var adjustedUrl = baseUrl.substring(0, baseUrl.indexOf(fluentInFinance) + fluentInFinance.length);
var handleLearnMore = function() {
	document.location.href = adjustedUrl + "portal/editions";
	this.hide();
};
var handleYes = function() {
	document.location.href = adjustedUrl + "portal/register";
	this.hide();
};
var handleNo = function() {
	this.hide();
};

var staticContentDialog;
function init() {
	// our dialog for info, to show messages to the users
	staticContentDialog = new YAHOO.widget.SimpleDialog("staticContentDialog",
		{
			width: "300px",
			fixedcenter: true,
			visible: false,
			draggable: true,
			zIndex: 9999,
			text: "We hope you are enjoying Fluent in Finance: Free Edition. To experience all of the online content, upgrade to Standard, Live, or Premium Live Editions.",
			close: true,
			modal: true,
			effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.5},
			constraintoviewport: true,
			buttons: [ 
	        		{ text:"Sign me up!", handler: handleYes, isDefault:true },
	        		{ text:"Not now", handler: handleNo },
	        		{ text:"Learn more", handler: handleLearnMore }
	        	]
		});
	staticContentDialog.setHeader("Beyond Free Edition");
	// Render the Dialog
	staticContentDialog.render(document.body);
	 
	
	
}

YAHOO.util.Event.addListener(window, "load", init);