/ * hello! */
var cutandpaste;
cutandpaste = cutandpaste || {
	videobox:function(el, p, n){
		var increment = parseFloat($(el).find('.entry:first .increment').html());
		//console.log(increment);
		$(el).cycle({ 
			fx:              'scrollHorz', 
			timeout: 0, 
			prev:   n + ' .prev', 
    		next:   n + ' .next', 
		    after:   cutandpaste.afterSlideChange, 
			pager:  p, 
			timeout:8000, 
			delay:increment,
			pause:         1,     // true to enable "pause on hover" 
			pauseOnPagerHover: 1, // true to pause when hovering over pager link 
			pagerAnchorBuilder: function(idx, slide) { 
				return p +' li:eq(' + idx + ') a'; 
			},
			activePagerClass: 'active'
		}).hover(function(){
			$(this).cycle('pause');
		});	
	},
	afterSlideChange:function(curr, next, opts) {
	   	// var index = opts.currSlide;
	   //	console.log(curr);
		var videobottom = $(opts.next).parent().parent().parent();
		var caption_container = videobottom.find('p.caption');		
		var caption_to_load = $(next).find('.the_caption').html();
		var share_container = videobottom.find('ul.sharer');
		var share_to_load = $(next).find('.sharer').html();
		caption_container.html(caption_to_load);		
		share_container.html(share_to_load);
	},
	singlevideobox:function(el, bottom){
		//zorp
		var caption_container = $(bottom).find('p.caption');		
		var caption_to_load = $(el).find('.the_caption').html();
		var share_container = $(bottom).find('ul.sharer');
		var share_to_load = $(el).find('.sharer').html();	
		caption_container.html(caption_to_load);		
		share_container.html(share_to_load);
	}
};

