function init() {
	// unobtrusive JS class
	document.body.className += " loading hasJS";
}

$(function() {
	// unobtrusive JS class
	Setup.init();
	NavPrimary.init();

	$('#PdfLink a').click(function(){
		$(this).addClass('click');
	});
	
	// external links
	$("a[rel='external']").each(function() {
		var link = $(this);
		link .click(function() {
			return !window.open(link.attr('href'));
		});
	});
});

var Setup = {
	/* Obj Refs */
	objBody: null,

	init: function() {
		var cc = this;
		cc.objBody = $(document.body);
		cc.objBody.addClass('domReady');
		$(window).load(function() {
			cc.objBody.removeClass('loading');
		})
	}
};

var NavPrimary = {
	/* Obj Refs */
	objLinks: null,
	objSectionName: null,

	init: function() {
		var cc = this;
		cc.objLinks = $('#NavPrimary li a');
		cc.objSectionName = $('#SectionName');
		cc.events();
		cc.render();
	},
	render: function() {
		var cc = this;
		cc.objSectionName.hide();
	},
	events: function() {
		var cc = this;

		cc.objLinks.each(function(){
			var title = $(this).attr('title');
			var link = $(this);

			link.mouseenter(function(){
				$(this).attr('title','');
				cc.objSectionName.text(title);
				cc.objSectionName.show();
			})
			link.mouseleave(function(){
				$(this).attr('title',title);
				cc.objSectionName.hide();
			})

		});


	}

};

