$(function() {

	$('#tweets').tweetable({username: 'alpisdesign', limit: 3, replies: true});  
	
	window.setTimeout(function() {
		$('.tweetList').cycle({fx: 'scrollUp'});
	}, 1000);
	
	$('.home').addClass("current");

	$("nav ul li a").click(function(){
		$("nav ul li a").removeClass("current");
		$('.home').removeClass("current");
		$(this).addClass("current");
	
	});
	
	$("#back,.top").click(function(){
		$("nav ul li a").removeClass("current");
		$('.home').addClass("current");
	
	});	
	
	$(window).scroll(function () { 
		$(this).bind('touchmove', function(event) {
			var e = event.originalEvent;
			if($(this).scrollTop()<=e.touches[0].pageY){
				$("nav ul li a").removeClass("current");
				$('.home').addClass("current");		
			}
		});
		
		if($(window).scrollTop() <= 320)
			{
			$("nav ul li a").removeClass("current");
			$('.home').addClass("current");
			} 	
	});	
	
	var options = {
		"effect": "drop",
		"effectOptions": {
			"color": "rgba(0,224,255,0.5)",
			"radius": 38,
			"duration": 800,
			"width": 2,
			"count": 3,
			"delay": 10			
		}
	};	
	
	$('#push').hover(function(){
		pp.destroyPointPoint(); 
	});
	
	//SCROLLING.............
			  
			  $('a[href*="#"]').live('click', function() {
				$.bbq.pushState( '#/' + this.hash.slice(1) );
				return false;
			  });
			  
			  $(window).bind('hashchange', function(event) {
				
				if (location.hash) {
				  var tgt = location.hash.replace(/#\//,'');
				} else {
				  var tgt = '#top';
				}
				$.smoothScroll({scrollTarget: '#' + tgt});
			  });
			  
			  $(window).trigger('hashchange');		
	
	
	
});


