
jQuery.root.ready(function ($) {

	body.find('.botb_switcher').botbSwitcher();
	body.find('.bands_list .video').botbVideo();

});



(function ($) {

	//	BOTB Switcher
	$.fn.botbSwitcher = function () {
		var switcher = this,
			switcher_html;

		switcher_html  = '<ul>';
		switcher_html += '<li>';
		switcher_html += '<a class="botb_pic_link" href="#">' + text.photo + '</a>';
		switcher_html += '</li>';
		switcher_html += '<li>';
		switcher_html += '<a class="botb_vid_link" href="#">' + text.video + '</a>';
		switcher_html += '</li>';
		switcher_html += '</ul>';

		$(switcher_html).appendTo(switcher);

		switcher.find('a').bind('click', function () {
			$(this)
				.closest('ul')
				.siblings('div')
				.toggleClass('hide_this');

			return false;
		});

		switcher.find('.botb_video').addClass('hide_this');

		return this;
	};



	//	BOTB Video
	$.fn.botbVideo = function () {

		return this.each(function () {
			var li        = $(this),
				video     = li.html(),
				link_html = '<a class="video_link" href="#">Watch a video</a>';

			$(link_html).appendTo(li);

			li.find('.video_link').colorbox({
				inline:  true,
				height:  425,
				href:    video,
				opacity: 0.4,
				width:   680
			});
		});

	};

}(jQuery));

