(function(jQuery){var conf={},numMSG=20;containerDiv="tweetsContainer",loadMSG="Loading messages...",imgName="loader.gif",readMore="Read it on Twitter",nameUser="image"
live:"live-20",aURL="";msgNb=1;var mode,param,time,lang,contDiv,loadMSG,gifName,numMSG,readMore,fromID,ultID,filterWords;var running=false;apifMultipleUSER="http://search.twitter.com/search.json?from%3A";apifUSER="http://search.twitter.com/search.json?q=from%3A";apitMultipleUSER="http://search.twitter.com/search.json?to%3A";apitUSER="http://search.twitter.com/search.json?q=to%3A";apiSEARCH="http://search.twitter.com/search.json?q=";jQuery.Juitter={registerVar:function(opt){mode=opt.searchType;param=opt.searchObject;timer=opt.live;lang=opt.lang?opt.lang:"";contDiv=opt.placeHolder?opt.placeHolder:containerDiv;loadMSG=opt.loadMSG?opt.loadMSG:loadMSG;gifName=opt.imgName?opt.imgName:imgName;numMSG=opt.total?opt.total:numMSG;readMore=opt.readMore?opt.readMore:readMore;fromID=opt.nameUser?opt.nameUser:nameUser;filterWords=opt.filter;openLink=opt.openExternalLinks?"target='_blank'":"";},start:function(opt){ultID=0;if(jQuery("#"+contDiv)){this.registerVar(opt);this.loading();aURL=this.createURL();this.conectaTwitter(1);if(timer!=undefined&&!running)this.temporizador();}},update:function(){this.conectaTwitter(2);if(timer!=undefined)this.temporizador();},loading:function(){if(loadMSG=="image/gif"){jQuery("<img></img>").attr('src',gifName).appendTo("#"+contDiv);}else jQuery("#"+contDiv).html(loadMSG);},createURL:function(){var url="";jlg=lang.length>0?"&lang="+lang:jlg="";var seachMult=param.search(/,/);if(seachMult>0)param="&ors="+param.replace(/,/g,"+");if(mode=="fromUser"&&seachMult<=0)url=apifUSER+param;else if(mode=="fromUser"&&seachMult>=0)url=apifMultipleUSER+param;else if(mode=="toUser"&&seachMult<=0)url=apitUSER+param;else if(mode=="toUser"&&seachMult>=0)url=apitMultipleUSER+param;else if(mode=="searchWord")url=apiSEARCH+param+jlg;url+="&rpp="+numMSG;return url;},delRegister:function(){if(msgNb>=numMSG){jQuery(".twittLI").each(function(o,elemLI){if(o>=numMSG)jQuery(this).hide("slow");});}},conectaTwitter:function(e){jQuery.ajax({url:aURL,type:'GET',dataType:'jsonp',timeout:1000,error:function(){jQuery("#"+contDiv).html("fail#");},success:function(json){if(e==1)jQuery("#"+contDiv).html("");jQuery.each(json.results,function(i,item){if(e==1||(i<numMSG&&item.id>ultID)){if(i==0){tultID=item.id;jQuery("<ul></ul>").attr('id','twittList'+ultID).attr('class','twittList').prependTo("#"+contDiv);}
if(item.text!="undefined"){var link="http://twitter.com/"+item.from_user+"/status/"+item.id;var tweet=jQuery.Juitter.filter(item.text);var x=new Date(item.created_at);var y=new Date();var date=new Date(x.toLocaleString());var d=date.getDate();var m=date.getMonth();var h=(date.getHours()+1);var min=(date.getMinutes()+1);var s=(date.getSeconds()+1);var curdate=new Date(y.toLocaleString());var cd=curdate.getDate();var cm=curdate.getMonth();var ch=(curdate.getHours()+1);var cmin=(curdate.getMinutes()+1);var cs=(curdate.getSeconds()+1);var tweettime;if(cd==d){var dh=ch-h;if(dh>1){tweettime="about "+dh+" hours ago";}
else if(dh==1){var dmin=cmin-min;if(dmin<0){tweettime=(60+dmin)+" minutes ago";}
else if(dmin>=0){tweettime="1 hour "+dmin+"minutes ago";}}
else if(dh==0){var dmin=cmin-min;if(dmin>0){tweettime=dmin+" minutes ago";}
if(dmin==1){tweettime=dmin+" minute ago";}
else if(dmin==0){tweettime="less than a minute ago";}}}
else{var tweettime=date;}
var stra=jQuery.Juitter.filter(item.text);var RE=stra.substring(0,2);var REE=stra.substring(0,3);var RETWEET=stra.substring(0,7);if((RE!="RT")&&(RE!="rt")&&(REE!="R/T")&&(REE!="r/t")&&(RETWEET!="retweet")&&(RETWEET!="Retweet")&&(RETWEET!="REWEET")){if(fromID=="image"){mHTML="<a href='http://www.twitter.com/"+item.from_user+"' target='_blank'><img src='"+item.profile_image_url+"' alt='"+item.from_user+"' title='"+item.from_user+"' class='juitterAvatar' /></a> "+jQuery.Juitter.textFormat(tweet)+" <br /> <span class='small'>"+tweettime+"</span> <br /> ";}
else{mHTML="<a href='http://www.twitter.com/"+item.from_user+"' target='_blank'>@"+item.from_user+":</a>"+jQuery.Juitter.textFormat(tweet)+" <br /> <span class='small'>"+tweettime+"</span> <br />  ";}
jQuery("<li></li>").html(mHTML).attr('id','twittLI'+msgNb).attr('class','twittLI').appendTo("#twittList"+ultID);jQuery('#twittLI'+msgNb).hide();jQuery('#twittLI'+msgNb).show("slow");jQuery.Juitter.delRegister();msgNb++;}
else{mHTML="Retweet";}}}});ultID=tultID;}});},filter:function(s){if(filterWords){searchWords=filterWords.split(",");if(searchWords.length>0){cleanHTML=s;jQuery.each(searchWords,function(i,item){sW=item.split("->").length>0?item.split("->")[0]:item;rW=item.split("->").length>0?item.split("->")[1]:"";regExp=eval('/'+sW+'/gi');cleanHTML=cleanHTML.replace(regExp,rW);});}else cleanHTML=s;return cleanHTML;}else return s;},textFormat:function(texto){var exp=/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;texto=texto.replace(exp,"<a href='$1' class='extLink' "+openLink+">$1</a>");var exp=/[\@]+([A-Za-z0-9-_]+)/ig;texto=texto.replace(exp,"<a href='http://twitter.com/$1' class='profileLink' target='_blank'>@$1</a>");var exp=/[\#]+([A-Za-z0-9-_]+)/ig;texto=texto.replace(exp,"<a href='http://twitter.com/search?q=%23$1' class='hashLink' target='_blank'>#$1</a>");if(mode=="searchWord"){tempParam=param.replace(/&ors=/,"");arrParam=tempParam.split("+");jQuery.each(arrParam,function(i,item){regExp=eval('/'+item+'/gi');newString=new String(item);texto=texto.replace(regExp,newString);});}
return texto;},temporizador:function(){running=true;aTim=timer.split("-");if(aTim[0]=="live"&&aTim[1].length>0){tempo=aTim[1]*1000;setTimeout("jQuery.Juitter.update()",tempo);}}};})(jQuery);;jQuery(document).ready(function(){jQuery.Juitter.start({searchType:"searchWord",searchObject:"forex trading, forex investing",lang:"en",live:"live-15",placeHolder:"tweetsContainer",loadMSG:"Loading messages...",imgName:"loader.gif",total:20,readMore:"Read it on Twitter",nameUser:"image",openExternalLinks:"newWindow",filter:"sex->*BAD word*,porn->*BAD word*,fuck->*BAD word*,shit->*BAD word*"});jQuery("#aRodrigo").click(function(){jQuery(".jLinks").removeClass("on");jQuery(this).addClass("on");jQuery.Juitter.start({searchType:"fromUser",searchObject:"forex trading, forex investing",live:"live-120"});});jQuery("#aIphone").click(function(){jQuery(".jLinks").removeClass("on");jQuery(this).addClass("on");jQuery.Juitter.start({searchType:"searchWord",searchObject:"forex trading, forex investing",live:"live-20"});});jQuery("#aJuitter").click(function(){jQuery(".jLinks").removeClass("on");jQuery(this).addClass("on");jQuery.Juitter.start({searchType:"searchWord",searchObject:"forex trading, forex investing",live:"live-180"});});jQuery("#juitterSearch").submit(function(){jQuery.Juitter.start({searchType:"searchWord",searchObject:jQuery(".juitterSearch").val(),live:"live-20",filter:"sex->*BAD word*,porn->*BAD word*,fuck->*BAD word*,shit->*BAD word*"});return false;});jQuery(".juitterSearch").blur(function(){if(jQuery(this).val()=="")jQuery(this).val("Type a word and press enter");});jQuery(".juitterSearch").click(function(){if(jQuery(this).val()=="Type a word and press enter")jQuery(this).val("");});});;jQuery(function()
{var tabContainers=jQuery('div.tabs > div');var links=jQuery('div.tabs ul.tabNavigation a');links.click(function()
{tabContainers.hide();tabContainers.filter(this.hash).show();links.removeClass('selected');jQuery(this).addClass('selected');if(document.all&&!window.opera)
{document.getElementById('td_ie_bug').style.zoom=0.1;document.getElementById('td_ie_bug').style.zoom=1;}
return false;});var tab='';if(location.search.indexOf('tab=University')>=0)
{var tab='University';}
if(tab!=''){links.filter('[\@href="#'+tab+'"]').click();}else{links.filter(':first').click();}
if(document.all&&!window.opera)
{document.getElementById('td_ie_bug').style.zoom=0.1;document.getElementById('td_ie_bug').style.zoom=1;}
igGetNews_forexMain('http://finance.yahoo.com/rss/currencies','#forexnewsmain');igGetNews_forex('http://finance.yahoo.com/rss/currencies','#forexnews1');igGetNews_forex('http://rss.forbes.com/feed/search/forex','#morecurrencynews');igGetNews_forex('http://www.actionforex.com/option,com_rd_rss/id,13/','#centralbankspeeches');igGetNews_forex('http://feeds.fxstreet.com/fundamental/index','#fundamentalnews');igGetNews_forex('http://feeds.fxstreet.com/technical/index','#technicalnews');igGetNews_forex('http://seekingalpha.com/tag/dollar-currencies.xml','#topforexcommentary');igGetNews_forex('http://blogsearch.google.com/blogsearch_feeds?hl=en&q=forex&ie=utf-8&num=10&output=rss','#ForexBlog');igGetNews_forex('http://www.actionforex.com/option,com_rd_rss/id,11/','#forexoutlook');igGetNews_forex('http://www.actionforex.com/option,com_rd_rss/id,3/','#forextechnicalanalysis');igGetNews_forex('http://www.actionforex.com/option,com_rd_rss/id,4/','#forexfundamentalanalysis');igGetNews_forexTweets('http://search.twitter.com/search.atom?q=forex+trading+OR+forex+investing','#TwitterForex');});function showhide(id)
{var obj=document.getElementById(id);if(obj){obj.style.display=(obj.style.display=='none'?'':'none');}};function JAtom(xml){this._parse(xml);};JAtom.prototype={_parse:function(xml){var channel=jQuery('feed',xml).eq(0);this.version='1.0';this.title=jQuery(channel).find('title:first').text();this.link=jQuery(channel).find('link:first').attr('href');this.description=jQuery(channel).find('subtitle:first').text();this.language=jQuery(channel).attr('xml:lang');this.updated=jQuery(channel).find('updated:first').text();this.items=new Array();var feed=this;jQuery('entry',xml).each(function(){var item=new JFeedItem();item.title=jQuery(this).find('title').eq(0).text();item.link=jQuery(this).find('link').eq(0).attr('href');item.description=jQuery(this).find('content').eq(0).text();item.updated=jQuery(this).find('updated').eq(0).text();item.id=jQuery(this).find('id').eq(0).text();item.author=jQuery(this).find('author').children('name').eq(0).text();feed.items.push(item);});}};;jQuery.getFeed=function(options){options=jQuery.extend({url:null,data:null,success:null},options);if(options.url){$.ajax({type:'GET',url:options.url,data:options.data,dataType:'xml',success:function(xml){var feed=new JFeed(xml);if(jQuery.isFunction(options.success))options.success(feed);}});}};function JFeed(xml){if(xml)this.parse(xml);};JFeed.prototype={type:'',version:'',title:'',link:'',description:'',parse:function(xml){if(jQuery('channel',xml).length==1){this.type='rss';var feedClass=new JRss(xml);}else if(jQuery('feed',xml).length==1){this.type='atom';var feedClass=new JAtom(xml);}
if(feedClass)jQuery.extend(this,feedClass);}};;function JRss(xml)
{this._parse(xml);}
JRss.prototype={_parse:function(xml)
{if(jQuery('rss',xml).length==0)this.version='1.0';else this.version=jQuery('rss',xml).eq(0).attr('version');var channel=jQuery('channel',xml).eq(0);var feed=this;this.items=new Array();this.title=jQuery(channel).find('title:first').text();this.link=jQuery(channel).find('link:first').text();this.description=jQuery(channel).find('description:first').text();this.language=jQuery(channel).find('language:first').text();this.updated=jQuery(channel).find('lastBuildDate:first').text();jQuery('item',xml).each(function()
{var item=new JFeedItem();item.title=jQuery(this).find('title').eq(0).text();item.link=jQuery(this).find('link').eq(0).text();item.description=jQuery(this).find('description').eq(0).text();item.updated=jQuery(this).find('pubDate').eq(0).text();item.id=jQuery(this).find('guid').eq(0).text();item.author=jQuery(this).find('author').eq(0).text();if(jQuery(this).find('author').eq(0)&&jQuery(this).find('author').eq(0).find('name').eq(0)){item.author_name=jQuery(this).find('author').eq(0).find('name').eq(0).text();}else{item.author_name='';}
feed.items.push(item);});}};;function JFeedItem(){};JFeedItem.prototype={title:'',link:'',description:'',updated:'',id:'',author:''};;function igGetNews(url,id){url=escape(url);url='http://'+window.location.host+'/proxy/proxy.php?url='+url;jQuery.getFeed({url:url,success:function(feed){var html='';for(var i=0;i<feed.items.length&&i<5;i++){var item=feed.items[i];html+='<p>'
+'<strong>'
+'<a href="'
+item.link
+'", target=_blank>'
+item.title
+'</a>'
+'</strong>';html+='&mdash; <span class="author">'
+item.author
+'</span><br>';html+=''
+item.description
+'</p>';}
jQuery(id).append(html);}});}
function igGetFeaturedArticles(url,id){url=escape(url);url='http://'+window.location.host+'/proxy/proxy.php?url='+url;jQuery.getFeed({url:url,success:function(feed){var html='<div id="FeaturedArticle" class="block-content bodycopy"><div style="overflow:hidden">';var item=feed.items[0];html+='<div style="width:300px; padding-right:10px; float:left;"><h3>'
+'<a href="'
+item.link
+'",>'
+item.title
+'</a>'
+'</h3>';html+=''
+item.description
+'</div><div style="width:275px; float:left;">';for(var i=1;i<feed.items.length&&i<6;i++){var item=feed.items[i];html+='<h3 style="padding-bottom:10px">'
+'<a href="'
+item.link
+'", target=_blank>'
+item.title
+'</a>'
+'</h3>';}
html+='</div></div></div>';jQuery(id).replaceWith(html);}});}
function igGetNewsT(url,id){url=escape(url);url='http://www.investorguide.com/proxy/proxy.php?url='+url;jQuery.getFeed({url:url,success:function(feed){var html='';for(var i=0;i<feed.items.length&&i<5;i++){var item=feed.items[i];html+='<p>'
+'<strong>'
+'<a href="'
+item.link
+'", target=_blank>'
+item.title
+'</a>'
+'</strong>';html+='&mdash; <span class="author">'
+item.author
+'</span><br>';html+=''
+item.description
+'</p>';}
jQuery(id).append(html);}});}
function igGetNews_one(url,id){url=escape(url);url='http://'+window.location.host+'/proxy/proxy.php?url='+url;jQuery.getFeed({url:url,success:function(feed){var html='';for(var i=0;i<feed.items.length&&i<5;i++){var item=feed.items[i];html+='<p>'
+'<strong>'
+'<a href="'
+item.link
+'" target=_blank>'
+item.title
+'</a>'
+' - '
+'</strong>';+'</p>';}
jQuery(id).append(html);}});}
function igGetNews_forex(url,id){url=escape(url);url='http://'+window.location.host+'/proxy/proxy.php?url='+url;jQuery.getFeed({url:url,success:function(feed){var html='';for(var i=0;i<feed.items.length&&i<5;i++){var item=feed.items[i];html+='<p>'
+'<strong>'
+'<a href="'
+item.link
+'" target=_blank>'
+item.title
+'</a>'
+'</strong>';html+='<span class="author">'
+item.author
+'</span><br>';html+=''
+item.description
+'</p>';}
jQuery(id).append(html);}});}
function igGetNews_forexTweets(url,id){url=escape(url);url='http://'+window.location.host+'/proxy/proxy.php?url='+url;jQuery.getFeed({url:url,success:function(feed){var html='';if(feed.items)
{for(var i=0;i<feed.items.length&&i<10;i++){var item=feed.items[i];var date=item.updated;html+='<p>'
+item.title
html+='<br />Posted on&nbsp;<span style="font:bold 10px Verdana;color:#9f9f9f;">'
+date
+'</span>';html+='&nbsp;by<span class="author" >'
+'<a style="text-decoration:none;"href=http://www.twitter.com/'+item.author+' target=_blank>'
+item.author
+'</a>'
+'</span><br>';+'</p>';}}
jQuery(id).append(html);}});}
function igGetNews_forexMain(url,id){url=escape(url);url='http://'+window.location.host+'/proxy/proxy.php?url='+url;jQuery.getFeed({url:url,success:function(feed){var html='';for(var i=0;i<feed.items.length&&i<5;i++){var item=feed.items[i];html+='<p>'
+'<strong>'
+'<a href="'
+item.link
+'" target=_blank>'
+item.title
+'</a>'
+'</strong>';}
jQuery(id).append(html);}});}
function igGetNews_igrTweetstest(url,id)
{url=escape(url);url='http://'+window.location.host+'/proxy/proxy.php?url='+url;jQuery.getFeed({url:url,success:function(feed){var html='';if(feed!=null&&feed.items!=null)
{for(var i=0;i<feed.items.length&&i<6;i++)
{var item=feed.items[i];html+='<p>'
html+=item.title+'</p>';}}
else
{html='No tweets found';}
jQuery(id).append(html);}});}
function igGetNews_igrTweets(url,id)
{url=escape(url);url='http://'+window.location.host+'/proxy/proxy.php?url='+url;jQuery.getFeed({url:url,success:function(feed){var html='';if(feed!=null&&feed.items!=null)
{for(var i=0;i<feed.items.length&&i<6;i++)
{var item=feed.items[i];html+='<p>'
+item.title;html+='<br />Posted on&nbsp;<span style="font:bold 10px Verdana;color:#9f9f9f;">'
+item.updated
+'</span>';html+='&nbsp;by <span class="author" >'
+'<a style="text-decoration:none;"href=http://www.twitter.com/'+item.author_name+' target=_blank>'
+item.author_name
+'</a>'
+'</span><br>';+'</p>';}}
else
{html='No tweets found';}
jQuery(id).append(html);}});}
function igGetNews_yahoo(url,id)
{url=escape(url);url='http://'+window.location.host+'/proxy/proxy.php?url='+url;jQuery.getFeed({url:url,success:function(feed){var html='';if(feed!=null&&feed.items!=null)
{for(var i=0;i<feed.items.length&&i<8;i++)
{var item=feed.items[i];var m_names=new Array("January","February","March","April","May","June","July","August","September","October","November","December");var d=new Date(item.updated);var curr_date=d.getDate();var curr_month=d.getMonth();var curr_year=d.getFullYear();html+='<div style="float:left;font:8px normal Verdana;color:#9f9f9f;">'
+item.updated
+'</div>';html+='<div style="float:left;font-family: Verdana,Tahoma,Arial;font-size: 10px;color: #000099;line-height: 18px;margin-bottom: 1.3em;">'
+'<a class="gs-title" href="'
+item.link
+'", target=_blank>'
+item.title
+'</a>'
+'</div>';html+='<div style="clear:both;">'
+'</div>';html+='<div style="font:8px normal Verdana;color:#9f9f9f;">'
+item.content
+'</div>';}}
else
{html='No tweets found';}
jQuery(id).append(html);}});}
function igGetNews_video(url,id){url=escape(url);url='http://'+window.location.host+'/proxy/proxy.php?url='+url;jQuery.getFeed({url:url,success:function(feed){var html='';for(var i=0;i<feed.items.length&&i<5;i++){var item=feed.items[i];html+='<p class="bodycopy">'
+'<strong>'
+'<a href="'
+item.link
+'", target=_blank>'
+'<span style="font-size:11px;">'+item.title+'</span>'
+'</a>'
+'</strong><br>'
+'</p>';html+='<p class="bodycopy" style="margin-bottom:-5px;">'
+'<a href="'
+item.link
+'", target=_blank style="text-decoration:none;">'
+'<span style="font-size:11px;line-height:18px;cursor:pointer;color:#000000;">'+item.description+'</span>'
+'</a>'
+'</p>';}
jQuery(id).append(html);}});}