var BigRotator;
var SmallRotator;
var Cookies = new CookieJar();

document.observe('dom:loaded', function()
{
	if(Cookies.get('curtainsDrawn') != 'true') // CookieJar sets values as strings so that's why we do a string comparison instead of boolean'
	{
		$('curtain_left').setStyle({left: '490px'});
		$('curtain_right').setStyle({right: '490px'});
		
		$('content_width').setStyle({ visibility: 'hidden' });
		
		Event.observe(window, 'load', function()
		{
			// new Effect.Appear($('content_width'));
			$('content_width').setStyle({ visibility: 'visible' });
			$('curtain_left').morph('left: 2px', {duration: 1.5});
			$('curtain_right').morph('right: 2px', {duration: 1.5});
			Cookies.put('curtainsDrawn', 'true')
		});
	}
	
	if($('featured'))
		BigRotator = new Rotator($('featured'));
	if($('vote'))
		SmallRotator = new Rotator($('vote'), {nextPrevId: 'controls', interval: 4});
	
   
//	SmallRotator = new Rotator($('featured_small'), {itemsPerFrame: 4, duration: 0.2, interval: 3});
//	$$('#right_content a').each(function(el) {MyWindow.attach(el, function() {Cufon.replace('.right_side h1');});});
//	$$('#video_link').each(function(el) {MyWindow.attach(el)});
//	$$('#navi li').invoke('observe', 'mouseenter', openSubMenu);
//	$$('#navi li').invoke('observe', 'mouseleave', closeSubMenu);
//	$$('#news_navi a').invoke('observe', 'click', openNewsItem);
//	$$('.cse-branding-bottom').each(function(e){e.setStyle({background: 'none'})});
//	$$('.cse-branding-bottom input[type=submit]').each(function(e){e.value = '';});
/*
	if($('news_content'))
		loadFirstNewsItem();
*/
});

openSubMenu = function() {
	if(this.down('ul')) {
		this.down('ul').addClassName('open');
		this.down('ul').show();
	}
}

closeSubMenu = function() {
	if(this.down('ul')) {
		this.down('ul').removeClassName('open');
		this.down('ul').hide();
	}
}
