/******************************************************************************
 INITIALIZATION
 ******************************************************************************/

$(document).ready(function(){
	Wishpipe.showEmailAddress();
	Wishpipe.showLatestTweet();
	Wishpipe.handleAnchorScroll();
});

/******************************************************************************
 WISHPIPE OBJECT 
 ******************************************************************************/

var Wishpipe = {};
		
// SHOW EMAIL ADDRESS
//Wishpipe.showEmailAddress = function(){
//	$('span.email').html("<n uers=\"znvygb:zp\100jvfucvcr\056pbz\" gvgyr=\"Rznvy Jvfucvcr\">zp\100jvfucvcr\056pbz<\057n>".replace(/[a-zA-Z]/g, function(c){
//		return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);
//	}));
//	$('dd.email').html("<n uers=\"znvygb:zp\100jvfucvcr\056pbz\" gvgyr=\"Rznvy Jvfucvcr\">zp\100jvfucvcr\056pbz<\057n>".replace(/[a-zA-Z]/g, function(c){
//		return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);
//	}));
//}

	


// HANDLE ANCHOR SCROLL
Wishpipe.handleAnchorScroll = function(){
	$('.scroll').click(function(event){
		event.preventDefault();
		var fullUrl = this.href;
		var urlParts = fullUrl.split('#');
		var urlTarget = urlParts[1];
		var targetAnchorOffset = $('#'+urlTarget).offset();
		var targetLocation = targetAnchorOffset.top;
		$('html, body').animate({scrollTop:targetLocation}, 500);
		this.blur();
	})
}
