$(document).ready(function(){
	var slHeight = 0;
		$('#move-field li').each(function(){
		var lih = $(this).innerHeight();
		if (lih > slHeight) {
			slHeight = lih;
		}
		$('.slider-basic').css('height', slHeight + 'px');
	});
});
	
	
mdiff = 0;
mnum = 1;
mclick = true;
mf = 0;

$(document).ready(function(){
	// Slider
	mf = $('#move-field');
	
	if (mf.length > 0) {
		
		var mli = $('li:first', mf);
		mdiff = 245;
		mfwidth = mf.children().length * mdiff;
		mf.width(mfwidth);
		$('#move-left').click(function() {
			var ml = parseInt(mf.css('margin-left')) + mdiff;
			if (mclick && ml <= 0) {
				mclick = false;
				mf.animate({ 'margin-left': ml + 'px' }, 360, function(){ mclick = true; });
				if (ml+mdiff > 0) {
					$(this).addClass('disabledl');
				}
				if ($('#move-right').hasClass('disabledr')) {
					$('#move-right').removeClass('disabledr');
				}
			}
		});
		$('#move-right').click(function() {
			var ml = parseInt(mf.css('margin-left')) - mdiff;
			if (mclick && ml - mdiff * (mnum-1) > -mfwidth) {
				mclick = false;
				mf.animate({ 'margin-left': ml + 'px' }, 360, function(){ mclick = true; });
				if (ml - mdiff * mnum <= -mfwidth) {
					$(this).addClass('disabledr');
				}
				
				if ($('#move-left').hasClass('disabledl')) {
					$('#move-left').removeClass('disabledl');
				}
			}
		});
	}
	if (parseInt(mf.css('margin-left')) == 0) { $('#move-left').addClass('disabledl'); }
	if (mf.find('li').length <= 1) { $('#move-right').addClass('disabledr'); }
});
