$(document).ready(function(){

	/* scroller */
	$('nav a,div.menu a').click(function(e){	
		$.scrollTo( this.hash || 0, 1500);
		e.preventDefault();
	});
	
	/* video */
        VideoJS.setup();

	
	/* portfolio slider */
	    $('#slides1').bxSlider({
	        wrapper_class: 'slides1_wrap',
	        pause: 3500,
	        auto: true,
	        auto_controls: false,
			speed: 500
	    });
    
			   		
	
	/* load twitter */		
	$(".tweet").tweet({
            username: "urustar",
            join_text: "auto",
            count: 5,
            auto_join_text_default: "",
            auto_join_text_ed: "",
            auto_join_text_ing: "",
            auto_join_text_reply: "",
            auto_join_text_url: "",
            loading_text: "loading tweets..."
        });
     
     /* tickerize twitter */	
     var first = 0;
	 var speed = 700;
	 var pause = 4000;
	
		function removeFirst(){
			first = $('ul.tweet_list li:first').html();
			$('ul.tweet_list li:first')
			.animate({opacity: 0}, speed)
			.fadeOut('slow', function() {$(this).remove();});
			addLast(first);
		}
		
		function addLast(first){
			last = '<li style="display:none">'+first+'</li>';
			$('ul.tweet_list').append(last)
			$('ul.tweet_list li:last')
			.animate({opacity: 1}, speed)
			.fadeIn('slow')
		}
	
	interval = setInterval(removeFirst, pause);   
        		
});


