window.addEvent('domready', function(){

//	$("videopic").reflect({height: 0.8, opacity: 0.25});

	var scrollinit = new Fx.Scroll('home_video_content_section', {
		wait: false,
		duration: 0,
		offset: {'x': 0, 'y': 0}
		});
	var scroll2 = new Fx.Scroll('home_video_content_section', {
		wait: false,
		duration: 450,
		offset: {'x': 0, 'y': 0},
		transition: Fx.Transitions.Quad.easeInOut
	});

	// setup by scrolling correct panel into place and turning them on in the right order
	// this is still a little flaky, shows vid panel then moves to artist if defaulting to artist, needs to be slicker

	if (menu == 1)
	{ 
		scrollinit.toElement('panel_artists'); 
		$('home_video_bar_section').setStyle('background', 'url(../graphics/home_main_graphic/midbar_video2.jpg) no-repeat 0 50%');
	} else 
	{
//   		$('panel_video').setStyle('display', 'block');
	}

	$$('.playart').each(function(el){
		el.addEvent('click', function(event) {
		event = new Event(event).stop();

		if (menu == 0)
		{
			menu = 1;
			scroll2.toElement('panel_artists');
			$('home_video_bar_section').setStyle('background', 'url(../graphics/home_main_graphic/midbar_video2.jpg) no-repeat');
		}
		});
	});
	$$('.playvid').each(function(el){
		el.addEvent('click', function(event) {
		event = new Event(event).stop();

		if (menu == 1)
		{
			menu = 0;
			scroll2.toElement('panel_video');
			$('home_video_bar_section').setStyle('background', 'url(../graphics/home_main_graphic/midbar_video.jpg) no-repeat');
		}
		});
	}); 

	if (moo_coverflow)
	{
		var mf = new MooFlow($('MooFlow'), {
			startIndex: 3,
			useSlider: true,
			useAutoPlay: false,
			useCaption: true,
			useResize: false,
			useWindowResize: false,
			useMouseWheel: true,
			useKeyInput: true
		}); 
	}

});

function toggleDiv(divid,image){
    if(document.getElementById(divid).style.display == 'none'){
    document.getElementById(divid).style.display = '';
	document.getElementById(image).src = imgFoldButton_minus.src;	
    }else{
      document.getElementById(divid).style.display = 'none';
	document.getElementById(image).src = imgFoldButton_plus.src;	
    }
}
