/* name space 
if(!window.com) { var com = {}; }
if(!com.cnn) { com.cnn = {}; }
if(!com.cnn.blogs) { com.cnn.blogs = {}; }
if(!com.cnn.blogs.eatocracy) { com.cnn.blogs.eatocracy = {}; }
if(!com.cnn.blogs.eatocracy.global) { com.cnn.blogs.eatocracy.global = {}; }
*/
randomBanner = function() {
	var randBanner = "banner" + (Math.floor(Math.random()*6) + 1);
	
	if($('cnnContainer').hasClassName('cnnEatMain')) {
		//console.log("randomizing");
		$("cnnContainer").addClassName(randBanner);
	}
	
};

/*com.cnn.blogs.eatocracy.global.*/toggleSection = function(evnt) {
	var elmnt = evnt.element();
	
	elmnt.up().toggleClassName("cnn-open");
};

Event.observe(window, 'load', function() {
	//randomBanner();

	// enables the section toggle buttons on the directory page
	if($$('#cnnDirectory1 .cnn-area .cnn-title').length > 0) {
		$$('#cnnDirectory1 .cnn-area .cnn-title').invoke("observe", "click", /*com.cnn.blogs.eatocracy.global.*/toggleSection);
	}
});

//document.observe("dom:loaded", function() {
	
	// searchbox = {	
		
		// removeLabel : function() {			
			// var node = $('hdr-search-box');
			// var defaultText = 'undefinded' === typeof( node ) ? '' : node.getValue();
			
			// node.observe("focus", function() {	
				
				//console.log(defaultText);
				
				// if ($(this).value == defaultText) {
                    // $(this).clear();
                // }
			
				// $(this).observe("blur", function() {
					// var userInput = $(this).getValue();
                    // if (userInput == '') {
                        // $(this).value = defaultText;
                    // }
				// });
													  
			// });
		// },
		
		// init : function() {
			// this.removeLabel();
		// }
		
	// };
		
	//searchbox.init();
//	randomBanner();

	// enables the section toggle buttons on the directory page
//	if($$('#cnnDirectory1 .cnn-area .cnn-title').length > 0) {
//		$$('#cnnDirectory1 .cnn-area .cnn-title').invoke("observe", "click", /*com.cnn.blogs.eatocracy.global.*/toggleSection);
//	}
//});
