$(function(){
	var w = $(window).innerWidth();

	if(w < 768) articleHeight();
	if(w >= 768) computerHeight();

	$('.carousel').carousel({interval:3000});

	$('.block-random-tags .block-content a').each(function(){
		var __ = $(this);
		__.css('font-size', rand(12)+6+'px');
		__.css('color', "#"+randomcolor());
	});

	$('.home .btn-show').click(function(){
		$('.home .article-content').css({"height":"auto", "overflow":"auto;"})
		$(this).hide();
		$(this).next().show();
	});
	$('.home .btn-hide').click(function(){
		// $('.home .article-content').css({"height":"250px", "overflow":"hidden;"})
		if(w < 768) articleHeight();
		if(w >= 768) computerHeight();
		$(this).hide();
		$(this).prev().show();
	});
});

function articleHeight(){
	//var h = $('.home .article-content').height() * 0.25;
	var h = 0;
	$('.home .article-content').css({"height":h+"px", "overflow":"hidden;"})
}

function randomcolor(){
	var str=Math.ceil(Math.random()*16777215).toString(16);
	if(str.length<6){
		str="0"+str;
	}
	return str;
}
function rand(num){
	return parseInt(Math.random()*num+1);
}

function computerHeight()
{
	//var h = $('.home .article-content').height() * 0.33;
	var h = 0;
	$('.home .article-content').css({"height":h+"px", "overflow":"hidden;"})
}
