$(function(){
	$('#sections li a').poshytip({
		className: 'tip-twitter',
		showTimeout: 0,
		hideTimeout: 0,
		alignTo: 'target',
		alignX: 'center',
		alignY: 'top',
		offsetY: 0,
		allowTipHover: false,
		fade: false,
		slide: false
	});
	
	
	// 1200 x 800						   
	$(window).resize(function(){
		
		$('#mainContainer_default').css({
			left: ($(window).width() - $('#mainContainer_default').outerWidth())/2,
			top: ($(window).height() - $('#mainContainer_default').outerHeight())/2
		});
		$('#bodyExtender_default').css({
			width: ($(window).width()),
			height: ($(window).height())
		});
	});
	$(window).resize();
	
	if (showwelcome){
	if ($.cookie('welcome') != 'true'){
		var $welcomeDiv = '<div id="dialog-welcome" style="display:none;"><p>Welcome to the Community Accounts!</p><h1>Census 2011 Release News</h1><p>Census 2011 information is not yet available within Community Accounts, as our geographies are postal code based.  Some Census 2011 information is available through <a href="http://stats.gov.nl.ca/">The Newfoundland and Labrador Statistics Agency homepage</a>.</p><p><img style="float:left" src="/images/shared/brand-smusage.gif"><span style="font-size:.8em">An initiative of the Government of Newfoundland and Labrador</span></p></div>'
		$(document.body).prepend($welcomeDiv);
		$("#dialog-welcome").dialog({
			resizable: false,
			draggable: false,
			autoOpen: true,
			height:340,
			width:400,
			modal: true,
			buttons: {
				"Disable this message": function() {
					$( this ).dialog( "close" );
					document.cookie = "welcome=true";
				},
				"Close": function() {
					$( this ).dialog( "close" );
				}
			}
		});
	}
	}	
});

