/**
* @class chrome.js
* @namespace peacock
* @extends nothing for now; eventually msnbc.chrome
*/

peacock.chrome = function() {

	this.headerMainDiv = null;
	this.aboutModule = null;

	this.init = function() {

		this.headerMainDiv = $('header_main');
		if(this.headerMainDiv) {
			this.initAboutModule(this.headerMainDiv);
			this.attachFollowEvents(this.headerMainDiv);
		}

	}

	this.initAboutModule = function(parentNode) {
		// var div = $_F('m-peacock_chrome_ElkhartProject_About', 'div', parentNode);
		var div = $_F('blogWrapper', 'div', parentNode);
		if(div) {
			this.aboutModule = new vine.modules.groups.About('vine.modules.groups.About', div);
			this.aboutModule.init();
			this.aboutModule.load();
		}
	}

	this.attachFollowEvents = function(parentNode) {
		var nodes = $_('followClick', null, parentNode);
		if(nodes.length > 0) {
			YAHOO.util.Event.addListener(nodes, 'click', function(e) {
				YAHOO.util.Event.stopEvent(e);
				overlay = new vine.overlays.FollowSection(vine.session.section.domainName, vine.session.section.displayName);
				vine.session.layout.loadOverlay(overlay);
			}, this, true);
		}
	}

	
};

YAHOO.register('peacock.chrome', peacock.chrome, {version: "1.0", build: "100"});