		// JavaScript Document	
		 $(document).ready(function(){

		if(!($.browser.msie && $.browser.version=="6.0")){
			$('.casestudyimg img[rel!="0"]').parent().addClass('linked').attr('title','view screenshots').click(function(){

				$('.galsel').removeClass('galsel');
				$(this).parent().addClass('galsel');
				var imgel = $(this).parent().children('.casestudyimg').children('img');

				var src = imgel.attr('src');
				var numimgs = imgel.attr('rel');
				if(numimgs > 0){
					var imgs = new Array();
					for(var i = 1; i <= numimgs; i ++){
						imgs[imgs.length] = src.replace('thumbnail',i);
					}
					$('.galsel .galleryinfo p:first').addClass('livesite');
					$('.galsel .galleryinfo p:eq(1)').addClass('clientsite');
					$.fancybox(imgs,{
					'centerOnScroll' : 'true',
					'cyclic' : 'true',
					'padding' : 0,
					'type' : 'image',
					'titlePosition' : 'outside',
					'titleFormat': function(title, currentArray, currentIndex, currentOpts) {
						return '<span id="fancybox-title-over">' + $('.galsel .galleryinfo p:first').outerHTML() + '<p class="galleryindex">' + $('.galsel .client').html() + ' ' + $('.galsel .project').html() + ': ' + (currentIndex + 1) + '&nbsp;/&nbsp;' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</p>' + $('.galsel .galleryinfo p:eq(1)').outerHTML() + '<div class="clear"></div></span>';			
					}});				
			}


			});
			$('.casestudyimg.linked').each(function(){
				$(this).css('background','url(' + $(this).children('img').attr('src').replace('.','_hlte.') + ') no-repeat');
			}).hover(
				function(){
					$(this).children('img').css({opacity:1}).stop().animate({opacity:0},300);
				},
				function(){
					$(this).children('img').css({opacity:0}).stop().animate({opacity:1},300);
			});
		}
				

		$('#rssblog').rssfeed('http://feeds.feedburner.com/takenobabble', {
			limit: 1,
			header: false,
			titletag: 'h3'
		})	
		
		$('#twitter').jTweetsAnywhere({
			username: 'limedig',
			count: 1,
			showFollowButton: true,
			tweetBodyDecorator: function(tweet, options){
				// the default tweet body contains the tweet text and the tweet's creation date
				var html = '';
		
				if (options.tweetTextDecorator)
				{
					html += options.tweetTextDecorator(tweet, options);
				}
		
				html = '<div class="jta-tweet-body ' + (options._tweetFeedConfig.showProfileImages ? 'jta-tweet-body-list-profile-image-present' : '') + '"><em>' + html + '</em></div>';
				
				if (options.tweetAttributesDecorator)
				{
					html += options.tweetAttributesDecorator(tweet, options);
				}
				return html;
			},
			tweetTimestampDecorator: function(tweet, options){
				// the default tweet timestamp decorator does a little bit of Twitter like formatting.
		
				// if tweet is a native retweet, use the retweet's timestamp
				var tw = tweet.retweeted_status || tweet;
		
				// reformat timestamp from Twitter, so IE is happy
				var createdAt = formatDate(tw.created_at);
		
				// format the timestamp by the tweetTimestampFormatter
				var tweetTimestamp = options.tweetTimestampFormatter(createdAt);
				var tweetTimestampTooltip = options.tweetTimestampTooltipFormatter(createdAt);
		
				var screenName = tw.user ? tw.user.screen_name : false || tw.from_user;
				var html =
					'<span class="jta-tweet-timestamp">' +
					'<a class="jta-tweet-timestamp-link" data-timestamp="' + createdAt +
					'" href="http://twitter.com/' + screenName + '" target="_blank" title="' +
					tweetTimestampTooltip + '">@' + screenName + ' ' +
					'</a> ' + tweetTimestamp +
					'</span>';
		
				return html;
			},
			tweetDecorator: function(tweet, options)
				{
					// the default tweet is made of the optional user's profile image and the
					// tweet body inside a list item element
					var html = '';
			
					if (options._tweetFeedConfig.showProfileImages)
					{
						html += options.tweetProfileImageDecorator(tweet, options);
					}
			
					if (options.tweetBodyDecorator)
					{
						html += options.tweetBodyDecorator(tweet, options);
					}
			
					return '<li class="jta-tweet-list-item">' + html + '</li>';
				}			
		});
		
		window.setTimeout("animateTestimonials();animateIntro()",5000);	
		window.setTimeout("$('body').fadeIn(1000)",500);
	});
		
	
	var faded = false;
	var currTest = null;
	var nextTest = null;
	var allowAnimateTestimonials = true;
	
	
	function animateTestimonials(){
		currTest = $('#quote div:visible').prevAll().length;
		nextTest = (currTest + 1) % $('#quote div').length;
		
		if(allowAnimateTestimonials){
			$('#quote div:eq(' + currTest + ')').fadeOut(1000,function(){
				$('#quote div:eq(' + nextTest + ')').fadeIn(2000,function(){
					window.setTimeout("animateTestimonials()",6000);
				});
			});
		}
		else{
			window.setTimeout("animateTestimonials()",1000);
		
		}
		
		
	}
	
	var currIntro = null;
	var nextIntro = null;
	var allowAnimateIntro = true;
	
	function animateIntro(){
		currIntro = $('#intro div:visible').prevAll().length;
		nextIntro = (currIntro + 1) % $('#intro div').length;
		
		if(allowAnimateIntro){
			$('#intro div:eq(' + currIntro + ')').fadeOut(1000,function(){
				$('#intro div:eq(' + nextIntro + ')').fadeIn(2000,function(){
					window.setTimeout("animateIntro()",6000);
				});
			});
		
		}
		else {
			window.setTimeout("animateIntro()",1000);
		
		}
	}
