tumblrDash = new ajaxObject("AJAX/fetch_tumblr.lasso"); 
tumblrDash.callback = function(responseText, responseStatus)
	{
		if(responseStatus == '200')
			{
				eval("latestPosts = " + responseText);
				
				var index = 0;
				while(index < 10){
					if(!((latestPosts.posts[0].type == "regular") || (latestPosts.posts[0].type == "photo")))
						latestPosts.posts.splice(0,1);
					else
						break;
					index++;
				}
				
					if(latestPosts.posts[0].type == "regular"){
						var latestBlogTitle = latestPosts.posts[0]["regular-title"];	
						var latestBlogText = latestPosts.posts[0]["regular-body"];
						var aLength = 610;
						var oLength = latestBlogText.length;
						 	if(oLength > aLength){
						 		latestBlogText = latestBlogText.substring(0, aLength);
						 		latestBlogText = latestBlogText.replace(/\w+$/, '...');
						 		latestBlogText = latestBlogText + '<a href="#" onclick="displaySection(\'reading\'); displayContent(\'blog\'); blogController.cursor=0; blogController.loadPost(0);">[Read More]</a>';  
						 }
						 var writeThis = '<div class="latestRelatedText"><p class="relatedTextTitle">'+latestBlogTitle+'</p>'+latestBlogText+'</div>';
						 $("latestBlogContainer").innerHTML = writeThis;
					}
					else{
							var photoSource = latestPosts.posts[0]["photo-url-250"];	
						 	var photoCaption = latestPosts.posts[0]["photo-caption"];
						 	var aLength2 = 350;
						 	var oLength2 = photoCaption.length;
						 	if(oLength2 > aLength2){
						 		photoCaption = photoCaption.substring(0, aLength2);
						 		photoCaption = photoCaption.replace(/\w+$/, '…');
						 		photoCaption = photoCaption + '<a href="#" onclick="displaySection(\'reading\'); displayContent(\'blog\'); blogController.cursor=0; blogController.loadPost(0);">[Read More]</a>';  
						 	}var writeThis = '<div class="imgbox"><img src="'+photoSource+'"width="206"></div><div class="latestRelatedPhotoCaption">'+photoCaption+'</div>';
						 $("latestBlogContainer").innerHTML = writeThis;
					}
		
			}
		if(responseStatus != '200'){
			var errorMessage = '<div class="imgbox"><img src="images/your_home_sold_everywhere.jpg" width="206"></div><div class="latestRelatedPhotoCaption"><p class="relatedTextTitle">Sorry!</p><p>This section is currently down.</p></div>';
			$("latestBlogContainer").innerHTML = errorMessage;
		}
	}
	
	
	
	

