var BackgroundImg = 1;
var SlideInterval = 0;
var Display = 'short';

function makeTall(){ 
	Display = 'tall';
	
	$("#website #side #blog").animate(
		{
			"width":750,
			"background-position":"100% 0"
		}
	,200, function(){ $(".btitle").css("width","430px").css("padding-left","85px"); $(".bcontentbody p").css("width","440px").css("padding-left","85px"); });
	$("#website #side #blog h3").animate(
		{
			"margin-right":478
		}
	,200);
	$("#website #side #blog span").animate(
		{
			"margin-right":500
		}
	,200);
	$("#website #side #blog p.blist").animate(
		{
			"padding-left":55,
			"width":200
		}
	,200);
}

function makeShort(){ 
	Display = 'short';
	
	$("#website #side #blog").animate(
	{
		"width":750,
		"background-position":"150% 0"
	}
	,200, function(){ 
		$(".btitle").css("width","430px").css("padding-left","230px"); 
		$(".bcontentbody p").css("width","440px").css("padding-left","230px"); 
		$(".bcontent").css("width","440px").css("padding-left","230px");
	});
	$("#website #side #blog h3, #website #side #blog span").animate(
	{
		"margin-right":330
	}
	,200);
	$("#website #side #blog p.blist").animate(
	{
		"padding-left":200,
		"width":200
	}
	,200);
}

$(function() {
	$("#website #side #blog").hover( makeTall, makeShort );
});

function SetSlider()
{
	BackgroundImg++;
	BackgroundImages = 3;
	
	if( BackgroundImg > BackgroundImages ) {
		BackgroundImg = 1;
	}
	
	clearInterval ( SlideInterval );
	
	if( Display == 'short' ) {
		$("#website #side #blog").css("background", "url('images/homepage/destaque_hover"+BackgroundImg+".jpg') 150% 0 no-repeat");
	}else{
		$("#website #side #blog").css("background", "url('images/homepage/destaque_hover"+BackgroundImg+".jpg') 100% 0 no-repeat");
	}
	
	SlideInterval = setInterval ( "SetSlider()", 5000 );
}
