obj(document).ready(	
	function() {
		initgallery();
	}
);

var videoscroll
var videonum

function initgallery() {

	start = 0;
/*	
	obj('ul.VideoContentList li a').each(function(i){
		obj(this).addClass('video_'+i)
		alert('?')
	})
	*/
	
	obj('ul#thumbs li a').addClass('eh')
	
	obj('ul#thumbs li a').hover(
		  function () {
alert(p)
			c = obj(this).attr('class')
			c = c.replace('video_','')
			p = obj('ul.VideoContentList').css('margin-left')

			p = p.replace('px','')
			p = Number(p) + 52 + Number(c)*104 
			p > 380 ? p = 380 : ''
			p < 5 ? p = 5 : ''
			p = p + 'px'

			h = obj(this).attr('href')
			h = h.replace('video/','')
			b = '#buble_' + h
		alert(b)
			obj(b).addClass('show')
			obj(b).css('left',p)			
			
		  }, 
		  function () {
			h = obj(this).attr('href')
			h = h.replace('video/','')
			b = '#buble_' + h
			obj(b).removeClass('show')
		  }
    );	
	
}

function leftscroll() {
	if(start < 10) {
		start = start + 10;
		document.getElementById("thumbs").style.marginLeft = start + "px";
		videoscroll = setTimeout("leftscroll()", 30);
	}
}

function rightscroll() {
	videonum = obj("ul.VideoContentList li").length
	if(start > ((videonum * 92) - ((videonum * 100) * 2) - 10) + 510) {
		start = start - 10;
		document.getElementById("thumbs").style.marginLeft = start + "px";
		videoscroll = setTimeout("rightscroll()", 30);
	}
}

function stopscroll() {
	if(videoscroll) clearTimeout(videoscroll);
}


