(function($){$.fn.rssReader=function(j){var k=$.extend({targeturl:"",items:1,Maxlength:10,loadingImg:''},j);
if(!j.targeturl)return false;
var l=$.extend(k,j);
var m=($.browser.msie);
if(m){$('#newsfeed').ajaxStart(function(){$("#newsfeed").css({backgroundColor:'#0ee','z-index':90,'opacity':0.4, height:'auto'});
$('<img id="loading" src="'+l.loadingImg+'" alt="loading ..." />').css({'opacity':1}).appendTo('#newsfeed')});
$("#newsfeed").ajaxError(function(){$(this).append("<strong>Error requesting page</strong>")});
$.get(l.targeturl,function(f){$('#newsfeed img').remove();
$("#newsfeed").css({backgroundColor:'#fff','opacity':1});
var i=0;
var g=j.items;
function h(e){$(f).find('item').each(function(i){if(i>e-1)return;
var a=$(this).find('title').text();
var b=$(this).find('pubDate').text();
var c=$(this).find('link').text();
var d=$(this).find('description').text();
//d= removeHTMLTags(d);

$('<a href="http://facebook.com/'+c+'">'+a+'</a>').html(a).appendTo('#newsfeed');
$('<div class="date">'+b+'</div>').html(b).appendTo('#newsfeed');
$('<div class="description">'+o(d,j.Maxlength)+'</div>').html(o(d,j.Maxlength)+'...').appendTo('#newsfeed');
$('#newsfeed .description p img').remove();
$('<a style="color:#000" href="http://facebook.com/'+c+'">'+"-"+'</a><br />').appendTo('#newsfeed')})}return h(g)})}else{var n="xml";
$.ajax({type:"get",url:l.targeturl,dataType:n,processData:false,beforeSend:function(){$("#newsfeed").css({backgroundColor:'#999','z-index':90,'opacity':0.4, height:'auto'});
$('<img id="loading" src="'+l.loadingImg+'" alt="loading ..." />').css({'opacity':1}).appendTo('#newsfeed')},success:function(f){$("#newsfeed").css({backgroundColor:'#fff','opacity':1});
$('#newsfeed img').remove();
var i=0;
var g=j.items;
function h(e){$(f).find('item').each(function(i){if(i>e-1)return;
var a=$(this).find('title').text();
var b=$(this).find('pubDate').text();
var c=$(this).find('link').text();
var d=$(this).find('description').text();
//d= removeHTMLTags(d);
//alert (d);


$('<div class="feeditem"><div class="targetblank" '+c+'">'+a.substring(1,160)+'</div>').appendTo('#newsfeed');
$('<div class="date">'+b+'</div>').html(b).appendTo('#newsfeed');
$('<div class="description">'+o(d,j.Maxlength)+'</div>').html(o(d,j.Maxlength)+'....').appendTo('#newsfeed');

$('#newsfeed .description p img').remove();
$('<a style="color:#000" href="http://facebook.com/'+c+'">'+"more"+'</a><br /><br /><div class="divider"></div></div>').appendTo('#newsfeed')})}return h(g)}})}};

function o(a,b){
var b=100;
	var c=a.split(/\s/);
	if(c.length<=b)return a;
		var dr='';
		for(var i=0;i<b;i++){
			dr+=c[i]+' ';
		}
		
		return dr
	}
}

)(jQuery);


/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Robert Nyman | http://robertnyman.com/ */
function removeHTMLTags(strInputCode){
 	if(document.getElementById ){
 	
 	 	strInputCode = strInputCode.replace(/&(lt|gt);/g, function (strMatch, p1){
 		 	return (p1 == "lt")? "<" : ">";
 		});
 		var strTagStrippedText = strInputCode.replace(/<\/?[^>]+(>|$)/g, " ");
 		return (strTagStrippedText);	
   
 	}	
}

