function importXhtml( xhtml_path, divId ){
	$(function() {
	    $.ajax({
	        type: "GET",
	        url: xhtml_path,
	        dataType: "xhtml",
	        success: function(xhtml) {
				$( "#"+divId ).append( xhtml );
			}
	});
});
}

function RSSFeed(){}

// Yahoo pipe for turning an RSS XML feed into JSONP
	RSSFeed.Entries = function(feed_url, callback){
    	requestURL = "http://pipes.yahoo.com/pipes/pipe.run?_id=ummWu3Fl3hGFgLVz0z6skA&_render=json&_callback=?&url=" + feed_url;
	    $.getJSON(requestURL, function(json, status){
	        callback(json.value.items, status);
    	});
	}

	RSSFeed.AlbumReview = function( feed_url, divId ){
		RSSFeed.Entries(feed_url, function(json, status){
		    var content = "";
		    $.each(json, function(i){
		        img = "<img src='" + this['media:thumbnail']['url'] + "' width='130px' height='130px'>";
				content += img;
				
				title = "<p><strong>" + this['title'] + "</strong></p>";	
				content += title;

				desc = "<p>'" + this['description'] + "'</p>";	
				content += desc;

				link = "<a href='" + this['link'] + "'>Read full review</a>";	
				content += link;

				return false
		    });
			$("#"+divId).html(content);
		});
		
	}

	RSSFeed.BlogRSS = function( feed_url, divId  ){
		
		RSSFeed.Entries(feed_url, function(json, status){
		    var content = "<ul class='links'>";
			var count = 0;
			
		    $.each(json, function(i){
				title = "<li><a href='" + this['link'] + "'>" + this['title'] + "</a><br />";	
				content += title;
				
				date =  RSSFeed.FormatDate( this['pubDate'] );
				content += date + "</li>";
				
				if( count == 2 )
					return false
				
				count++;
		    });
		
			content += "</ul>"
			
			$("#"+divId).html(content);
		});
		
	}
	
	RSSFeed.FormatDate = function(xmlDate)
	{
		var dtS = xmlDate.slice(0, xmlDate.indexOf('+')-1);
		dtS = dtS.substr( 5, dtS.length );
		dtS = dtS.substr( 0, (dtS.length-3) );
		
		return dtS;
	}
	
	RSSFeed.FormatTitle = function( str ){
		strNew = str.toLowerCase();
		
	}