// JavaScript Document
$(document).ready(function() {

$(function() {
	var i=0;
	// this function automatically updates the scroll length of the thumbnails. no need for adjustments.
	var ct = $('.measure').children().size();
	var clickct = (Math.floor(ct / 3) * 135);
	//console.log(ct);
	$('.down_arrow').click(function() {
		
		if (i <= -clickct) {
			return false;
		}
		else {
		i -= 135;
		$('.scroller').stop().animate({"top" : i }, 700);
		//console.log(i);
		}
	});
	$('.up_arrow').click(function() {
		if (i == 0) {
			return false;
		}
		else {
		i += 135;
		$('.scroller').stop().animate({"top" : i }, 700);	
		//console.log(i);
		}
	});

});

});

$(function() {
		   $('.thumb').click(function() {
									 $('.video').html('<iframe name="display" marginwidth="0" marginheight="0" frameborder="0" width="166" height="145" src="http://www.smobilesystems.com/wp-content/themes/smobile/media/'+$(this).attr('path')+'"></iframe>');
									 $('.caption').html($(this).attr('caption'));
									 });
		  $('.up_arrow').hover(function() {
								  $(this).html('<img src="jsimages/up_arrow_hover.jpg" />');
										},
								  function () {
									  $(this).html('<img src="jsimages/up_arrow.jpg" />');
							  });
		   $('.down_arrow').hover(function() {
								  $(this).html('<img src="jsimages/down_arrow_hover.jpg" />');
										},
								  function () {
									  $(this).html('<img src="jsimages/down_arrow.jpg" />');
							  });
		   });
