/* Author: Christoph Liell info@contentwithstructure.com

*/

$(function(){
	
	$(".tweet").tweet({
	            username: "themegadude",
	            join_text: "auto",
	            avatar_size: false,
	            count: 1,
				loading_text: "loading tweets...",
				template: "“{text}”{time}"
	        });
	$("a").attr("target","_blank");
	
	$("body").append('<div id="cloudwrapper" style="position:absolute;top:0;left:0;width:100%;height:500px;overflow:hidden;"><img class="clouds" id="cloud1" src="images/cloud1.png"><img class="clouds" id="cloud2" src="images/cloud2.png"><img class="clouds" id="cloud3" src="images/cloud3.png"></div>');
	move1();
	move2();
	move3();
	$(window).resize(function(){
		$(".clouds").stop(true,true);
		move1();
		move2();
		move3();
	});
});


function move1()
{
	$("#cloud1").css({width:'354px',height:'220px',top:'278px',left:'-354px'});
	var xend = $("body").outerWidth();
	$('#cloud1').animate(
			{"left": xend+'px'},
			80000,
			'linear',
			function(){
				move1();
			}
	);

}

function move2()
{
	$("#cloud2").css({width:'297px',height:'218px',top:'60px',left:'-415px'});
	var xend = $("body").outerWidth();
	$('#cloud2').animate(
			{"left": xend+'px'},
			60000,
			'linear',
			function(){
				move2();
			}
	);
	
}


function move3()
{
	$("#cloud3").css({width:'410px',height:'307px',top:'0',left:'-612px'});
	var xend = $("body").outerWidth();
	$('#cloud3').animate(
			{"left": xend+'px'},
			100000,
			'linear',
			function(){
				move3();
			}
	);
}
















