$(document).ready(function() { 
	// Increase Font Size
	$(".text-options .increase").click(function(){
	var currentFontSize = $('#bd').css('font-size');
	if (currentFontSize < "15px") {
			var currentFontSizeNum = parseFloat(currentFontSize, 10);			
			var newFontSize = currentFontSizeNum + 1;
			$('#bd').css('font-size', newFontSize);
			//initScroll();
			setActive();
			return false;
		}
	});
	// Decrease Font Size
	$(".text-options .decrease").click(function(){
	var currentFontSize = $('#bd').css('font-size');
	if (currentFontSize > "13px") {			
			var currentFontSizeNum = parseFloat(currentFontSize, 10);
			var newFontSize = currentFontSizeNum - 1;			
			$('#bd').css('font-size', newFontSize);
			//initScroll();
			setActive();
			return false;			
		}
	});
	
	$(".text-options .normal").click(function(){
	var currentFontSize = $('#bd').css('font-size');
	if (currentFontSize != "13px") {
			$('#bd').css('font-size', '13px');
			//initScroll();
			setActive();
			return false;			
		}
	});
	
	equalColumns();
	
	$('a.back').each(function(){
		$(this).bind('click',function(e){
			e.preventDefault();
			window.history.back();
		});	
	});
	  
	    
	$('marquee').marquee('pointer').mouseover(function () {
		$(this).trigger('stop'); 
	}).mouseout(function () {
		$(this).trigger('start');
    }).mousemove(function (event) {
		if ($(this).data('drag') == true) {
			this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX); 
		}        
	}).mousedown(function (event) {
		$(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
    }).mouseup(function () {
				$(this).data('drag', false);
	});    
	  
});
function setActive(){
	var currentFontSize = $('#bd').css('font-size');
	$('.text-options .decrease').removeClass('active');
	$('.text-options .increase').removeClass('active');
	$('.text-options .normal').removeClass('active');
	if (currentFontSize < "13px") {
		$('.text-options .decrease').addClass('active');
	}else if (currentFontSize > "13px"){
		$('.text-options .increase').addClass('active');
	}
	}
function equalColumns(){
	var columnHeight = $('.tef-md-content').height();
	$('.sidebar').css( 'min-height', columnHeight);
	}
