/***********************************************************
 * green.js - does whatever script things need to be done.
 ***********************************************************/

var greenscript = {
	initNav : function() {
		if (typeof(greenPageID) === "undefined") {
		   greenPageID = 'greenhome';
        }
		
		var navhandles = {
			'greenhome' : '',
			'eco' : 'econav',
			'greenmail' : 'greenmailnav',
			'recycle' : 'recyclenav',
			'innovation' : 'innovationnav',
			'ideas' : 'ideasnav'
		}
		var navid = navhandles[greenPageID];
		if (navid) {
			var navhref = $(navid).getFirst();
			navhref.addClass('selected');
		}
	},
	popWin : function(windowName) {
		var wininfo = {
			GreenCalculator : {
				loc : 'calculator_pop.html',
				height : 353,
				width : 778,
				parentName : 'welcome'
			}	
		}
		var winchoice = wininfo[windowName];
		if ($defined(winchoice.loc)) {
			window.name = winchoice.parentName;
			window.open(winchoice.loc, windowName, 'width=' + winchoice.width + ',height=' + winchoice.height + ',resizable=0,menubar=0,toolbar=0,location=0,personalbar=0,status=0,scrollbars=0');
		}
	},
	popRemote : function(winurl, winname, winfeatures) {
		if (winfeatures == null) {
			var scrheight = 500;
			var scrwidth = 720;
			winfeatures = 'WIDTH=' + scrwidth + ',HEIGHT=' + scrheight +
				',SCROLLBARS=1,RESIZABLE=1,DIRECTORIES=0,menubar=0,screenX=' +
				scrwidth/4 + ',screenY=' + scrheight/4 + ',LEFT=' + scrwidth/4 + ',TOP=' + scrheight/4 ;
		}
		var newwin = window.open(winurl,winname,winfeatures);
		newwin.focus();
	}
}

window.addEvent('domready', function() {
		greenscript.initNav();
									 });