function media_selector() {

	// Determine thumbnail length.
	if ($('#media_browser .media_thumb li').length < 1) { return false; }

	// Create an object.
	var $thumbs = $('#media_browser .media_thumb li');
	var $images = $('#media_browser .media_image li');

	$images.bind('click', function() { return false; });

	// Select the first thumbnail.
	$thumbs.first().addClass('active'); $('#media_browser .media_image li:first').show();

	// Setup the bindings.
	$thumbs.bind('mouseover', function() {
		$(this).addClass('hover');
	}).bind('mouseout', function() {
		$(this).removeClass('hover');
	}).bind('click', function() {
		$thumbs.removeClass('active');
		$(this).addClass('active');

		$images.hide(); $('#media_browser .media_image li[rel="'+ $(this).attr('rel') +'"]').show();

		return false;
	});
}

function pager_calculator() {
	obj = $('.pager_pages');
	child = obj.children('li');
	var width = 0; child.each(function() {
		if ((width + $(this).outerWidth()) < 500) {
			width = width + $(this).outerWidth();
		}
	})

	obj.width(width);
}
