﻿var Site = {
	
	Intro: function(){


		$('.lucida').animate({left:0},2000);
		$('.lucida').animate({left:0},1000,function(){$('.lucida').animate({left:1000},2000,function(){
			$('.lucida').html('Prepare-se para o mundo de Beto Careiro!!');
			Cufon.replace('.lucida',{fontFamily:'Lucida Sans'});
			
		$('.lucida').animate({left:0},2000);

		});});
		
		
	}
    
    ,Init: function(Titulo, Imagem){
			/*cufon*/
			//Cufon.replace('#nav li a',{hover:{color:'#77d0c9'},fontFamily:'Lucida Sans'});
			//setTimeout(function(){Cufon.replace('#tweet *',{fontFamily:'Tahoma'});},2000);
			//Cufon.replace('.lucida',{fontFamily:'Lucida Sans'});
			//Cufon.replace('#footer span',{fontFamily:'Lucida Sans'});
			//Cufon.replace('#footer p',{fontFamily:'Tahoma'});
			
			/*generics animations*/
			//$('#holder #tweet').css('textIndent','-5000px');
			$('#holder #tweet').hide();
			$('#holder').css('width','0');
			$('#holder').css('display','none');
			$('#nav').css('display','none');
			$('#footer').css('display','none');
			$('#holder .wrap').css('margin','0 auto');
			
			$('#nav').fadeIn(2200);
			$('#footer').fadeIn(2200);
			
			/*animação começa aqui*/
			$('#holder').animate({width:'900px'},200, function() {$('#holder').animate({width:'100%'},2000, function(){
				$('#holder #tweet').slideDown();
				//$('#holder #tweet').animate({width:'523px'},500);		
				//$('#holder #tweet').css('textIndent','0px');
				
				/*twitter*/
				$("#tweet div").getTwitter({
						userName: "guilherme_cruz",
						numTweets: 5,
						loaderText: "Loading tweets...",
						slideIn: true,
						slideDuration: 750,
						showHeading: true,
						showProfileLink: true,
						showTimestamp: true
					});
				
				/*blur*/
				$('.blur').mouseover(
					function(){
						
					}
				);
				
				/*setInterval(function(){
					$('.blur').animate({left:3},1000,function(){
								$('.blur').animate({left:-3},1000);								   
					 });				 
									 
				},2000);*/
				
				/*twitter-loop cycle*/
				setInterval(function(){
					if ($('#tweet div ul li').attr('class') !== 'current') {
						$('#tweet div ul li:first').addClass('current');	
					}
					
					if($('.lastTweet').attr('class') === 'lastTweet current') {
						$('#tweet div ul li').css('height','auto');
						$('#tweet div ul li').css('display','block');
						$('#tweet div ul li').removeClass('current');
						$('#tweet div ul li').animate({ height: '100%'},1000,function(){$('#tweet div ul li:first').addClass('current');});
					}
					
					else {
						$('.current').animate({ height: '0'},1000,function() {
							$(this).next().addClass('current');
							$(this).removeClass('current');
							$('.current').prev().css('display','none');
						 });
					}	
					
				},10000);
				
			})} );
			
			/*click blur effect*/
			$('.aboutme').click(function(){
									
				$('#nav').hide();								 
				$('#nav').show();					 
				$('.aboutme').css('background-image','url(img/btn/aboutme-blur.png') ;  
				$('.services').css('background-image','url(img/btn/services-blur.png') ; 
				$('.jobs').css('background-image','url(img/btn/jobs-blur.png') ; 
				$('.contact').css('background-image','url(img/btn/contact-blur.png') ; 
				$('.blur').css('background-image','url(img/btn/footer-blur.png)') ; 
				$('#nav').animate({left:4},500);
				$('.blur').animate({left:4},500);
				$('.hide').slideUp();
				$('.hide').remove();
				$('.twitted').slideUp();
				$('#tweet').animate({height:50},500, function(){
					$('#tweet').append('<div class="content"></div>');
					$('#tweet').css('overflow','visible');
					$('#tweet .content').css('backgroundColor','#000000');
					$('#tweet .content').css('opacity','0.1');
					$('#tweet .content').css('position','relative');
					$('#tweet .content').animate({height:300, top:-122},1000);
					$('.blur').animate({top:100},1000);
															   
				});
				
			});
			
			
					
	}
}
