// JavaScript Document
window.addEvent('domready', function() {
	/*************************
	SCROLL PLAYLIST GEN
	*************************/
	if($('playlist_video')!=null || $('playlist_video_fullscreen')!=null) {
		
		var width_box = 95;
		var width_total = width_box * $$('#playlist_video-main div.box_video').length;
		$('playlist_video-wrap').setStyle('width',width_total);
		var loop_scroll = width_total - 190;
		var main = $('playlist_video-main');
		
		var myHash = new Hash({
			counter : 0,
			max_width : width_total
		});
		
		var fx = new Fx.Scroll(main, {
			wait: false,
			duration: 1000,
			offset: {'x': 0, 'y': 0},
			transition: Fx.Transitions.Quad.easeInOut,
			wheelStops : false
		
		});
		
		function intervall() {
			myHash.counter += width_box;
			if(myHash.counter >= loop_scroll) {
				myHash.counter = 0;
			}
			fx.start(myHash.counter,0);
		}
		intervall.periodical(4000)
	}

});
	