ident=new function(){};ident.version="0.1.7";ident.useInwardEdges=true;ident.identities=new Array();ident.domains=new Array();ident.history=new Array();ident.ufParser=null;ident.rssParser=null;ident.atomParser=null;ident.iconPath="ident/icons/";ident.addPrimaryURL=true;ident._startUrl="";ident._apiReturnCount=0;ident._usernames=new Array();ident._primaryCalled=false;ident._secondaryCalled=false;ident._endPoints={sites:[]};ident._endPointsArray=[["12seconds tv","12seconds.tv",[["12seconds.tv/channel/{username}","hCard","Profile","h"],["12seconds.tv/followers/{username}","hCard","Friends","h"],["12seconds.tv/followers/{username}?page={pagenumber}","hCard","Friends","h"],["12seconds.tv/channel/{username}","hAtom","Video","h"]]],["43things","43things.com",[["www.43things.com/person/{username}","None","None","h"],["www.43things.com/rss/uber/author?username={username}","Rss","Activity","r"]]],["43people","43people.com",[["{username}.43people.com/","None","None","h"],["www.43people.com/rss/uber/person?person={username}","Rss","Activity","r"]]],["43places","43places.com",[["{username}.43places.com/","None","None","h"]]],["Backnetwork","backnetwork.com",[]],["Backtype","backtype.com",[["www.backtype.com/{username}/","None","Profile","h"],["feeds.backtype.com/{username}","Rss","Activity","r"]]],["BarCamp Brighton 3","barcampbrighton3.backnetwork.com",[["barcampbrighton3.backnetwork.com/people/person.aspx?personid={username}","hCard","Profile","h"],["barcampbrighton3.backnetwork.com/people/person.aspx?personid={username}","XFN-hCard","Friends","h"]]],["BarCamp London 5","barcamplondon5.backnetwork.com",[["barcamplondon5.backnetwork.com/people/person.aspx?personid={username}","hCard","Profile","h"],["barcamplondon5.backnetwork.com/people/person.aspx?personid={username}","XFN-hCard","Friends","h"]]],["Blip.fm","blip.fm",[["blip.fm/profile/{username}/","None","None","h"],["blip.fm/feed/{username}","Atom","Audio","a"]]],["Blip.tv","blip.tv",[["{username}.blip.tv/","None","Profile","h"]]],["Blippr","blippr.com",[["www.blippr.com/profiles{username}","None","Profile","h"],["www.blippr.com/profiles/{username}/feed.rss","Atom","Activity","a"]]],["BlogSpot","blogspot.com",[]],["Blogger","blogger.com",[["www.blogger.com/profile/{userid}","None","Profile","h"]]],["Brightkite","brightkite.com",[["brightkite.com/people/{username}","hCard","Profile","h"],["brightkite.com/people/{username}/friends?page={pagenumber}","None","Friends","h"],["brightkite.com/people/{username}/objects.rss","Atom","Activity","a"]]],["ClaimId","claimid.com",[["claimid.com/{username}","hCard","Profile","h"]]],["CoComment","cocomment.com",[["www.cocomment.com/comments/{username}","None","None","h"],["www.cocomment.com/webRssUser/{username}.rss","Rss","Activity","r"]]],["Corkd","corkd.com",[["corkd.com/people/{username}","hCard","Profile","h"],["corkd.com/people/{username}/buddies?page={pagenumber}","XFN","Friends","h"]]],["Cliqset","cliqset.com",[["cliqset.com/user/{username}","None","Profile","h"],["cliqset.com/feed/atom?uid={username}","Atom","Activity","a"]]],["d.construct 08","dconstruct08.backnetwork.com",[["dconstruct08.backnetwork.com/people/person.aspx?personid={username}","hCard","Profile","h"],["dconstruct08.backnetwork.com/people/person.aspx?personid={username}","XFN-hCard","Friends","h"]]],["Delicious","del.icio.us",[["feeds.delicious.com/v2/rss/{username}?count=20","Atom","Bookmarks","a"],["del.icio.us/rss/{username}","Rss","Bookmarks","r"],["del.icio.us/{username}#bundle-tags","rel-tag","Interests","h"],["del.icio.us/{username}","None","Profile","h"],["delicious.com/{username}","None","Profile","h"]]],["Digg","digg.com",[["digg.com/users/{username}","hCard","Profile","h"],["digg.com/users/{username}/friends/view/page{pagenumber}","XFN-hCard","Friends","h"]]],["Disqus","disqus.com",[["www.disqus.com/people/{username}/","None","Profile","h"],["www.disqus.com/people/{username}/comments.rss","Rss","Lifestream","r"]]],["Django People","djangopeople.net",[["djangopeople.net/{username}/","hCard","Profile","h"],["djangopeople.net/{username}/","XFN","Services","h"]]],["Dopplr","dopplr.com",[["www.dopplr.com/traveller/{username}","hCard","Profile","h"]]],["Edenbee","edenbee.com",[["www.edenbee.com/users/{username}","hCard","Profile","h"],["www.edenbee.com/users/{username}/relationships?page=(pagenumber}","hCard","Friends","h"],["www.edenbee.com/users/{username}/relationships","hCard","Friends","h"],["edenbee.com/users/{username}","None","None","h"]]],["Emberapp","emberapp.com",[["emberapp.com/{username}","None","Profile","h"],["emberapp.com/{username}/images.rss","None","Images","r"]]],["Facebook","facebook.com",[["www.facebook.com/{username}","hCard","Profile","html"],["www.facebook.com/{username}","XFN","Friends","html"]]],["FFFFound","ffffound.com",[["ffffound.com/home/{username}/found/feed","Rss","Images","r"],["ffffound.com/home/{username}/found/","None","None","h"]]],["Flickr","flickr.com",[["www.flickr.com/people/{username}/","hCard","Profile","h"],["api.flickr.com/services/feeds/photos_public.gne?id={userid}&format=rss_200","Rss","Images","r"],["api.flickr.com/services/feeds/photos_public.gne?id={userid}&format=atom","Atom","Images","a"],["www.flickr.com/photos/{username}/","None","Images","h"],["flickr.com/photos/{username}/","None","Images","h"],["www.flickr.com/people/{username}/contacts/?page={pagenumber}","None","Friends","h"]]],["FOTB 08","fotb08.backnetwork.com",[["fotb08.backnetwork.com/people/person.aspx?personid={username}","hCard","Profile","h"],["fotb08.backnetwork.com/people/person.aspx?personid={username}","XFN-hCard","Friends","h"]]],["Fotolog","fotolog.com",[["www.fotolog.com/{username}","None","Profile","h"]]],["FriendFeed","friendfeed.com",[["friendfeed.com/{username}","hCard","Profile","h"],["friendfeed.com/{username}/services","XFN","Services","h"],["friendfeed.com/{username}?format=atom","Atom","Lifestream","a"]]],["GetSatisfaction","getsatisfaction.com",[["getsatisfaction.com/people/{username}","hCard","Profile","h"],["getsatisfaction.com/people/{username}.rss","Rss","Activity","r"]]],["Github","github.com",[["github.com/{_usernames}/","hCard","Profile","h"],["github.com/{username}.atom","Atom","Activity","a"]]],["Google","google.com",[["www.google.com/profiles/{username}","hCard","Profile","h"],["www.google.com/profiles/{username}","XFN","Services","h"],["www.google.com/profiles/{userid}","XFN","Services","h"],["www.google.com/profiles/{userid}","hCard","Profile","h"]]],["Google Reader","google.com",[["www.google.com/reader/shared/{username}","None","Profile","h"]]],["hi5","hi5.com",[]],["Huffduffer","huffduffer.com",[["huffduffer.com/{username}","hCard","Profile","h"],["huffduffer.com/{username}/rss","Rss","Audio","r"],["huffduffer.com/{username}","hAtom","Audio","h"]]],["Identica","identi.ca",[["identi.ca/{username}","hCard","Profile","h"],["identi.ca/{username}/foaf","FOAF","Profile","Xml"],["identi.ca/{username}/subscriptions?page={pagenumber}","hCard","Friends","h"],["identi.ca/{username}","hAtom","Status","h"],["identi.ca/{username}","rel-tag","Interests","h"],["identi.ca/{username}/all","hAtom","Friends Status","h"]]],["Jaiku","jaiku.com",[["{username}.jaiku.com/","hCard","Profile","h"]]],["JPG","jpgmag.com",[["www.jpgmag.com/people/{username}/photos","hCard","Profile","h"],["www.jpgmag.com/people/{username}/rss","Rss","Images","r"],["www.jpgmag.com/people/{username}/stories/rss","Rss","Entries","r"],["www.jpgmag.com/people/{username}/stories","None","None","h"]]],["Joost","joost.com",[["www.joost.com/users/{username}/","None","Profile","h"],["www.joost.com/api/events/get/{username}?fmt=atom","Atom","Video","a"]]],["krop","krop.com",[["www.krop.com/{username}/resume/","None","Resume","h"],["www.krop.com/{username}/portfolio/","None","Profile","h"]]],["Last.fm","last.fm",[["www.last.fm/user/{username}","hCard","Profile","h"],["www.last.fm/user/{username}/friends?page={pagenumber}","hCard","Friends","h"],["ws.audioscrobbler.com/1.0/user/{username}/recenttracks.rss","Rss","Activity","r"],["www.last.fm/user/{username}","hCalendar","Events","h"],["ws.audioscrobbler.com/1.0/user/{username}/events.rss","Rss","Events","r"]]],["Linked-in","linkedin.com",[["www.linkedin.com/in/{username}","hCard","Profile","h"],["www.linkedin.com/in/{username}","hResume","Resume","h"],["www.linkedin.com/pub/{username}","hCard","Profile","h"],["www.linkedin.com/pub/{username}","hResume","Resume","h"]]],["Livejournal","livejournal.com",[["{username}.livejournal.com/","None","Profile","h"]]],["MadgexLab","ufapi.lab.madgex.com",[["ufapi.lab.madgex.com/profile/{username}","hCard","Profile","h"]]],["Mashed 08","mashed08.backnetwork.com",[["mashed08.backnetwork.com/people/person.aspx?personid={username}","hCard","Profile","h"],["mashed08.backnetwork.com/people/person.aspx?personid={username}","XFN-hCard","Friends","h"]]],["Meetup","meetup.com",[]],["Microformats.org","microformats.org",[["microformats.org/wiki/User:{username}","hCard","Profile",undefined]]],["Mybloglog","mybloglog.com",[["www.mybloglog.com/buzz/members/{username}/hcard","hCard","Profile","h"],["www.mybloglog.com/buzz/members/{username}/","None","None","h"],["www.mybloglog.com/buzz/members/{username}/me/rss.xml","Atom","Lifestream","a"]]],["mytvshows","mytvshows.org",[["www.mytvshows.org/user/{username}/","hCard","Profile","h"],["www.mytvshows.org/rss/user/{username}/","Rss","Activity","r"]]],["My Name is E","mynameise.com",[["www.mynameise.com/{username}","None","Profile","h"],["mynameise.com/{username}","None","Profile","h"],["mynameise.com/{username}","XFN","Services","h"]]],["MyOpenid","myopenid.com",[["{username}.myopenid.com/","None","None","h"]]],["MySpace","myspace.com",[["myspace.com/{username)","hCard","Profile","h"],["www.myspace.com/{username)","hCard","Profile","h"]]],["Netvibes","netvibes.com",[["www.netvibes.com/{username)","hCard","Profile","h"],["www.netvibes.com/{username)/activities?format=atom","Atom","Activity","a"]]],["Newsvine","newsvine.com",[["{username}.newsvine.com/","None","None","h"]]],["Odeo","odeo.com",[["odeo.com/users/{username}","None","None","h"]]],["Orkut","orkut.com",[["www.orkut.com/Profile.aspx?uid={userid}","None","None","h"]]],["Picasa","picasaweb.google.com",[["picasaweb.google.com/{username}","None","Profile","h"],["picasaweb.google.com/data/feed/base/user/{username}?alt=rss&kind=album&hl=en_US&access=public","Rss","Images","r"]]],["Plaxo","plaxo.com",[["{username}.myplaxo.com/","hCard","Profile","h"]]],["Plazes","plazes.com",[["plazes.com/whereis/{username}","hCard","Profile","h"],["plazes.com/whereis/{username}","hCalendar","Events","h"]]],["Plurk","plurk.com",[["www.plurk.com/{username}","None","Profile","h"],["www.plurk.com/{username}.xml","Atom","Events","a"]]],["Profilactic","profilactic.com",[["www.profilactic.com/profile/{username}","None","Profile","h"]]],["Readernaut","readernaut.com",[["readernaut.com/{username}","None","Profile","h"],["readernaut.com/feeds/rss/{username}","Rss","Activity","r"]]],["Seesmic","seesmic.com",[["new.seesmic.com/{username}","hCard","Profile","h"],["feeds.seesmic.com/user.{username}.atom","Atom","Video","a"]]],["Slideshare","slideshare.net",[["www.slideshare.net/rss/user/{username}","Rss","Slides","r"],["www.slideshare.net/{username}","hCard","Profile","h"],["slideshare.net/{username}","None","Profile","h"],["www.slideshare.net/{username}/followers/{pagenumber}","hCard","Friends","h"]]],["Soup.io","soup.io",[["{username}.soup.io/","hCard","Profile","h"],["{username}.soup.io/","XFN","Services","h"],["{username}.soup.io/rss","Rss","Lifestream","r"]]],["Smugmug","smugmug.com",[["{username}.smugmug.com/","None","Profile","h"],["{username}.smugmug.com/hack/feed.mg?Type=nickname&Data={username}&format=atom10","Atom","Photos","a"]]],["Stumbleupon","stumbleupon.com",[["www.stumbleupon.com/stumbler/{username}","None","Profile","h"],["rss.stumbleupon.com/user/{username}/favorites","Rss","Bookmarks","r"]]],["Technorati","technorati.com",[["technorati.com/people/technorati/{username}","hCard","Profile","h"]]],["Threadless","threadless.com",[]],["Times People","timespeople.nytimes.com",[["timespeople.nytimes.com/view/user/{username}/","None","Profile","h"],["timespeople.nytimes.com/view/user/{username}/rss.xml","Rss","Activity","r"]]],["Tumblr","tumblr.com",[["{username}.tumblr.com/","None","None","h"],["{username}.tumblr.com/rss","Rss","Lifestream","r"]]],["Twitter","twitter.com",[["twitter.com/{username}","hCard","Profile","h"],["twitter.com/{username}#people","XFN-hCard","Friends","h"],["twitter.com/{username}","hAtom","Status","h"]]],["Twitpic","twitpic.com",[["www.twitpic.com/photos/{username}","None","Profile","h"],["twitpic.com/photos/{username}/feed.rss","Rss","Photos","r"]]],["Upcoming","upcoming.yahoo.com",[["upcoming.yahoo.com/user/{userid}/","hCard","Profile","h"],["upcoming.yahoo.com/user/{userid}/","hCalendar","Events","h"],["upcoming.yahoo.com/user/{userid}/past/","hCalendar","Events","h"],["upcoming.yahoo.com/syndicate/v2/my_events/{userid}","Rss","Events","r"]]],["Ustream","ustream.tv",[["www.ustream.tv/{username}","None","Profile","h"]]],["Viddler","viddler.com",[["www.viddler.com/explore/{username}","None","Profile","h"],["www.viddler.com/explore/{username}/videos/feed/","Rss","Video","r"]]],["Vimeo","vimeo.com",[["www.vimeo.com/{username}","hCard","Profile","h"],["www.vimeo.com/{username}/contacts/sort:newest/page:{pagenumber}","None","Friends","h"],["vimeo.com/{username}/videos/rss","Atom","Video","a"]]],["Vox","vox.com",[["{username}.vimeo.com/profile/","hCard","Profile","h"]]],["Windows Live","spaces.live.com",[["{username}.spaces.live.com/","None","Profile","h"]]],["Wordpress","wordpress.com",[["{username}.wordpress.com/","None","Profile","h"],["{username}.wordpress.com/feed/atom/","Atom","Lifestream","a"]]],["Xing","xing.com",[["www.xing.com/profile/{username}","hCard","Profile","h"],["www.xing.com/profile/{username}","hResume","Friends","h"]]],["Yahoo","profiles.yahoo.com",[["profiles.yahoo.com/{username}","hCard","Profile","h"]]],["YIID","yiid.com",[["{username}.yiid.com/","hCard","Profile","h"],["{username}.yiid.com/","rel-tag","Interests","h"],["{username}.yiid.com/contacts/{pagenumber}","hCard","Friends","h"],["{username}.yiid.com/identities","XFN","Services","h"],["{username}.yiid.com/cv","hResume","Resume","h"],["{username}.yiid.com/xml/atom_user","Atom","Lifestream","a"]]],["Yelp","yelp.com",[]],["Youtube","youtube.com",[["gdata.youtube.com/feeds/base/users/{username}/uploads?alt=rss&v=2","Atom","Video","a"],["youtube.com/rss/user/{username}/videos.rss","Rss","Video","r"],["youtube.com/user/{username}","None","Profile","h"],["www.youtube.com/profile?user={username}","None","Profile","h"],["www.youtube.com/user/{username}","None","Profile","h"]]]];ident._excludeDomains=["pownce.com","ma.gnolia.com","huff-duff.com","lastfm.com.br","lastfm.com.tr","lastfm.de","lastfm.es","lastfm.fr","lastfm.it","lastfm.jp","lastfm.pl","lastfm.ru","lastfm.se","cn.last.fm","radio.aol.fr"];ident._excludeUrls=["twitter.com/#replies","twitter.com/#inbox","twitter.com/#favorites","twitter.com/following","twitter.com/followers","identi.ca/group","identi.ca/tag","identi.ca/featured","identi.ca/favorited"];ident.profile=function(a,b){this.name="";this.domain="";this.username=new Array();this.profileUrl=b;this.iconUrl="";this.spriteClass=""};ident.domain=function(a,b){this.name="";this.urls=new Array();this.domain=b;this.accounts=new Array();this.hashCard=false;this.hashResume=false};ident.account=function(f,a,b,d,e,c){this.sgn=f;this.verified=a;this.profile=b;this.resume=d;this.ident=e;this.pk=c};ident.historyItem=function(b,a){this.url=b;this.apiurl=a;this.domain="";this.name="";this.contentType="";this.schema="";this.rawJSON=""};ident.username=function(){this.name="";this.rank=0};ident.search=function(b){ident.reset();var d=new Array();if(b.indexOf(",")>-1){d=b.split(",")}else{d[0]=b}for(var a=0;a<=d.length-1;a++){if(a<49){d[a];var c=ident.convertShorthandAddress(d[a]);if(ident.isUrl(c)||ident.isEmail(c)){if(ident.isExcludedUrl(c)==false){ident._startUrl+=c+","}else{ident.error('Sorry web addresses have to represent a person like profile page or a blog i.e. "http://twitter.com/<strong>glennjones</strong>"');ident._startUrl="";break}}else{ident.error('Sorry there seem to be a problem with the format of the web address you entered: "'+b+'"');ident._startUrl="";break}}}ident.apiManager()};ident.apiManager=function(a,b){if(ident._startUrl!=""){if(a!=null){ident.parseSGN(a,b);ident.statusUpdateEvent(["data-change"])}if(ident._primaryCalled==true&&ident._secondaryCalled==true){}if(ident._primaryCalled==true&&ident._secondaryCalled==false){if(ident.useInwardEdges==true){ident._secondaryCalled=true;ident.getSocialGraphData(ident._startUrl,1)}}if(ident._primaryCalled==false){ident._primaryCalled=true;ident.getSocialGraphData(ident._startUrl,0)}}else{ident.error('Sorry web addresses have to represent a person like profile page or a blog i.e. "http://twitter.com/<strong>glennjones</strong>"')}};ident.webFingerManager=function(b,c){ident._apiReturnCount++;if(b!=null){c.rawJSON=b;if(b[0].links){for(var a=0;a<=b[0].links.length-1;a++){if(b[0].links[a].rel=="http://microformats.org/profile/hcard"||b[0].links[a].rel=="http://webfinger.net/rel/profile-page"){ident._startUrl=b[0].links[a].href;ident.apiManager();break}}}}};ident.reset=function(){ident.domains=new Array();ident.history=new Array();ident.profiles=new Array();ident._startUrl="";ident._apiReturnCount=0;ident._primaryCalled=false;ident._secondaryCalled=false;ident._usernames=new Array();ident.resetTrigger()};ident.registerParser=function(a){if((a.parseUf>0&&ident.ufParser==null)||(ident.ufParser!=null&&a.parseUf>ident.ufParser.parseUf)){ident.ufParser=a}if((a.parseRss>0&&ident.rssParser==null)||(ident.rssParser!=null&&a.parseRss>ident.rssParser.parseRss)){ident.rssParser=a}if((a.parseAtom>0&&ident.atomParser==null)||(ident.atomParser!=null&&a.parseAtom>ident.atomParser.parseAtom)){ident.atomParser=a}};ident.getSocialGraphData=function(b,d){var a="http://socialgraph.apis.google.com/lookup?q="+encodeURIComponent(b)+"&fme=1&edo=1&edi="+d+"&sgn=1&pretty=1&jme=1";var c=new ident.historyItem(b,a);c.apiName="googlesoicalgraph";ident.history[ident.history.length]=c;ident.GoogleGraphAPICall(a,c)};ident.parseSGN=function(c,g){ident._apiReturnCount++;if(c!=null){g.rawJSON=c;var b="";for(var f in c.canonical_mapping){b=f}for(var f in c.nodes){if(f.indexOf("sgn://")>-1){var e=c.nodes[f];var d="";var a="";if(e.attributes["profile"]!=null){d=e.attributes["profile"]}if(e.attributes["url"]!=null){a=e.attributes["url"]}ident.appendDomainNode(f,a,true,d);ident.processClaimedNodes(e)}}for(var f in c.nodes){if(f.indexOf("http://")>-1){var e=c.nodes[f];ident.appendDomainNode("",f,false,"");ident.processClaimedNodes(e)}}}ident.postProcessDomainNode()};ident.processClaimedNodes=function(b){if(b.claimed_nodes!=null){for(var a=0;a<=b.claimed_nodes.length-1;a++){var c=b.claimed_nodes[a];if(c.indexOf("sgn://")>-1){ident.appendDomainNode(c,"",true,"")}}for(var a=0;a<=b.claimed_nodes.length-1;a++){var c=b.claimed_nodes[a];if(c.indexOf("http://")>-1){ident.appendDomainNode("",c,true,"")}}}if(b.unverified_claiming_nodes!=null){for(var a=0;a<=b.unverified_claiming_nodes.length-1;a++){var c=b.unverified_claiming_nodes[a];if(c.indexOf("sgn://")>-1){ident.appendDomainNode(c,"",false,"")}}for(var a=0;a<=b.unverified_claiming_nodes.length-1;a++){var c=b.unverified_claiming_nodes[a];if(c.indexOf("http://")>-1){ident.appendDomainNode("",c,false,"")}}}};ident.postProcessDomainNode=function(e,d,a,c){for(var b=0;b<ident.domains.length;b++){ident.appendCustomSGNData(ident.domains[b])}ident.disambiguateNodes();ident.domains.sort(ident.sortByName);ident.buildIdentitiesCollection();ident.statusUpdateEvent(["data-change"])};ident.buildIdentitiesCollection=function(){ident.identities=new Array();ident.disambiguateNodes();if(ident.addPrimaryURL){var e="";if(ident.topDeclaredProfileUrl()){e=ident.topDeclaredProfileUrl()}if(e!=""){var c=ident.parseDomainFromURL(e);var d=false;for(var f=0;f<ident._endPoints.sites.length;f++){if(ident.compareRootDomains(c,ident._endPoints.sites[f].domain)){d=true}}if(!d){var b=new ident.profile();b.name="";b.domain=c;b.iconUrl=ident.iconPath+"website.png";b.spriteClass="icon-website";b.profileUrl=e;ident.identities[ident.identities.length]=b}}}for(var a=0;a<ident.domains.length;a++){if(ident.domains[a].name){ident.domains[a].accounts.sort(ident.sortBySGN);for(var f=0;f<ident.domains[a].accounts.length;f++){var b=new ident.profile();b.username=ident.domains[a].accounts[f].ident;if(ident.domains[a].accounts[f].ident==""){b.username=ident.domains[a].accounts[f].pk}b.name=ident.domains[a].name;b.domain=ident.domains[a].domain;b.iconUrl=ident.iconPath+ident.domains[a].name.replace(/[\-,., ]/g,"").toLowerCase()+".png";b.spriteClass="icon-"+ident.domains[a].name.replace(/[\-,., ]/g,"").toLowerCase();if(ident.domains[a].accounts[f].profile!=""){b.profileUrl=ident.domains[a].accounts[f].profile}else{if(ident.domains[a].urls){b.profileUrl=ident.findUserNameBasedURL(ident.domains[a].urls,b.username)}}if(b.profileUrl!=""&&b.username!=""){ident.identities[ident.identities.length]=b;break}}}}};ident.appendDomainNode=function(f,b,d,c){var g="";if(b.indexOf("http://")==0){g=ident.parseDomainFromURL(b)}if(f!=""){if(f.indexOf("sgn://")==0){g=ident.parseDomainFromSGN(f)}}if(g.length>0){found=null;for(var h=0;h<ident.domains.length;h++){if(ident.compareRootDomains(g,ident.domains[h].domain)){found=ident.domains[h];break}}var a=ident.domainIsExcluded(g);if(g=="mboxsha1"){a=true}if(a==false){if(found==null){var j=new ident.domain("","");j.domain=g.replace("www.","");ident.domains[ident.domains.length]=j;found=j}if(b!=""){ident.appendUrl(found.urls,b)}if(f!=""){var k=new ident.account("","","","","","");k.verified=d;k.profile=c;k.sgn=f;if(k.sgn!=""){var e=new Array();if(k.sgn.indexOf("/?ident=")>-1){e=k.sgn.split("/?ident=");if(e.length==2){ident.appendUsername(e[1]);k.ident=e[1]}}if(k.sgn.indexOf("/?pk=")>-1){e=k.sgn.split("/?pk=");if(e.length==2){k.pk=e[1]}}}ident.appendUniqueIdentityNode(found,k)}}}};ident.disambiguateNodes=function(){for(var c=0;c<ident.domains.length;c++){if(ident.domains[c].accounts.length>1){var b=0;for(var e=0;e<=ident.domains[c].accounts.length-1;e++){if(ident.domains[c].accounts[e].ident!=""){b++}}if(b>1){var d=new Array();var a=ident.topUsername();for(var e=0;e<=ident.domains[c].accounts.length-1;e++){if(ident.domains[c].accounts[e].ident==a){d[d.length]=ident.domains[c].accounts[e]}if(ident.domains[c].accounts[e].pk!=""){d[d.length]=ident.domains[c].accounts[e]}}ident.domains[c].accounts=d}}}};ident.findUserNameBasedURL=function(b,c){for(var a=0;a<b.length;a++){if(b[a].indexOf(c)>-1){return b[a]}}return""};ident.domainNodeContains=function(b){found=false;for(var a=0;a<ident.domains.length;a++){if(ident.compareRootDomains(b,ident.domains[a].domain)){found=true;break}}return found};ident.domainIsExcluded=function(b){var c=false;for(var a=0;a<ident._excludeDomains.length;a++){if(ident.compareRootDomains(b,ident._excludeDomains[a])){c=true;break}}return c};ident.hasAPIBeenCalled=function(b,d,a){var e=false;for(var c=0;c<ident.history.length;c++){if(a!=""){if(ident.history[c].apiurl==a){e=true}}if(b!=""&&d!=""&&ident.history[c].schema!=""){if(ident.history[c].url==b&&ident.history[c].schema.indexOf(d)>-1){e=true}}}return e};ident.sortByName=function(e,d){var c=e.name.toLowerCase();var f=d.name.toLowerCase();return((c<f)?-1:((c>f)?1:0))};ident.sortByDomain=function(e,d){var c=e.domain.toLowerCase();var f=d.domain.toLowerCase();return((c<f)?-1:((c>f)?1:0))};ident.sortBySGN=function(e,d){var c=e.sgn.toLowerCase();var f=d.sgn.toLowerCase();return((c<f)?-1:((c>f)?1:0))};ident.parseUserFromSGN=function(a){var b=a.sgn.substring(6,a.sgn.length);parts=b.split("?");if(parts[1].indexOf("ident=")>-1){a.username=parts[1].replace("ident=","")}else{a.userid=parts[1].replace("pk=","")}};ident.appendUrl=function(d,b){var c=false;for(var a=0;a<=d.length-1;a++){if(d[a]==b){c=true;break}}if(c==false){d[d.length]=b}};ident.appendUsername=function(d){var c=false;for(var a=0;a<=ident._usernames.length-1;a++){if(ident._usernames[a].name==d){c=true;ident._usernames[a].rank++;break}}if(c==false){var b=new ident.username();b.name=d;ident._usernames[ident._usernames.length]=b}};ident.appendCustomSGNData=function(b){for(var a=0;a<=ident._endPoints.sites.length-1;a++){var c=ident._endPoints.sites[a].domain.replace(" ","");if(ident.compareRootDomains(b.domain,c)){b.name=ident._endPoints.sites[a].name;ident.createCustomSGN(b,ident._endPoints.sites[a])}}};ident.createCustomSGN=function(e,i){e.urlmappings=i.urlmappings;for(var g=0;g<=e.urls.length-1;g++){var b=e.urls[g];for(var h=0;h<=i.urlmappings.length-1;h++){var a=i.urlmappings[h];var j=a.urltemplate;if(j!=""&&(j.indexOf("{username}")>-1||j.indexOf("{userid}")>-1)){var c=0;if(j.indexOf("{username}")>-1){c=j.indexOf("{username}")}if(j.indexOf("{userid}")>-1){c=j.indexOf("{userid}")}var d=new Array(2);if(c!=0){d[0]=j.toLowerCase().substring(0,c);if(j.indexOf("{username}")){d[1]=j.toLowerCase().substring(c+10)}else{d[1]=j.toLowerCase().substring(c+8)}}startMatch=false;endMatch=false;user=b;if(b.indexOf(d[0])==0){startMatch=true;part=d[0];user=user.substring(part.length,user.length)}if(d.length==2){if(d[1].length>0){if(ident.endsWith(b,d[1])){endMatch=true;user=user.replace(d[1],"")}else{if(ident.endsWith(b,d[1]+"/")){endMatch=true;user=user.replace(d[1]+"/","")}}}else{endMatch=true}}if(ident.endsWith(user,"/")){user=user.substring(0,user.length-1)}if(user.indexOf("/")>-1){endMatch=false}if(user.indexOf("?")>-1){userParts=user.split("?");user=userParts[0]}if(user.indexOf("#")>-1){userParts=user.split("#");user=userParts[0]}if(startMatch&&endMatch){var f=new ident.account("","","","","","");f.verified=false;f.profile="";if(a.urltemplate.indexOf("{username}")>-1){f.ident=user;ident.appendUsername(user);f.sgn="sgn://"+e.domain+"/?ident="+user}if(a.urltemplate.indexOf("{userid}")>-1){f.pk=user;f.sgn="sgn://"+e.domain+"/?pk="+user}ident.appendProfileData(i.urlmappings,f,b,e);if(ident.domainIsExcluded(e.domain)==false){ident.appendUniqueIdentityNode(e,f)}}}}}for(var g=0;g<=e.accounts.length-1;g++){ident.appendProfileData(i.urlmappings,e.accounts[g],"",e)}};ident.appendUniqueIdentityNode=function(c,a){var b=null;for(var d=0;d<=c.accounts.length-1;d++){if(c.accounts[d].sgn==a.sgn){b=c.accounts[d];break}}if(b==null){c.accounts[c.accounts.length]=a}};ident.appendProfileData=function(d,a,b,c){a.profile=ident.getAPIEndPoint("Profile","hCard",d,a);a.resume=ident.getAPIEndPoint("Resume","hResume",d,a);if(a.profile!=""){c.hashCard=true}if(a.resume!=""){c.hashResume=true}};ident.getAPIEndPoint=function(g,d,c,f,e){var b="";if(c!=undefined){if(c.length){for(var h=0;h<=c.length-1;h++){var a=c[h];if(a.contenttype==g&&a.schema==d){var i=false;b=a.urltemplate;if(f.ident!=""&&b.indexOf("{username}")>-1){b=b.replace("{username}",f.ident);i=true}if(f.pk!=""&&b.indexOf("{userid}")>-1){b=b.replace("{userid}",f.pk);i=true}if(e!=undefined){b=b.replace("{pagenumber}",e)}if(!i){b=""}}if(b!=""){break}}}}return b};ident.topUsername=function(){var b=new ident.username();for(var a=0;a<=ident._usernames.length-1;a++){if(ident._usernames[a].rank>b.rank){b=ident._usernames[a]}}return b.name};ident.isSearching=function(){if(ident._apiReturnCount>=ident.history.length){return false}else{return true}};ident.buildExcludeUrlList=function(){for(var a=0;a<=ident._endPoints.sites.length-1;a++){ident._excludeUrls[ident._excludeUrls.length]=ident._endPoints.sites[a].domain}};ident.buildExcludeUrlList();ident.buildEndPointList=function(){var e=new Array();for(var a=0;a<=ident._endPointsArray.length-1;a++){var c=new Object();c.name=ident._endPointsArray[a][0];c.domain=ident._endPointsArray[a][1];if(c.name=="Google"){c.domain="google.com|profiles"}c.urlmappings=new Array();for(var d=0;d<=ident._endPointsArray[a][2].length-1;d++){var b=new Object();b.urltemplate=ident._endPointsArray[a][2][d][0];b.schema=ident._endPointsArray[a][2][d][1];b.contenttype=ident._endPointsArray[a][2][d][2];b.mediatype=ident._endPointsArray[a][2][d][3];c.urlmappings[c.urlmappings.length]=b;if(b.urltemplate.indexOf("//")==-1){b.urltemplate="http://"+b.urltemplate}switch(b.mediatype){case"h":b.mediatype="Html";break;case"r":b.mediatype="Rss";break;case"a":b.mediatype="Atom";break}}e[e.length]=c}ident._endPoints={sites:e}};ident.buildEndPointList();ident.isExcludedUrl=function(b){for(var a=0;a<=ident._excludeUrls.length-1;a++){if(ident.compareUrl(b,"http://"+ident._excludeUrls[a])){return true}}return false};ident.convertShorthandAddress=function(a){var c="";if(a!=""){a=a.replace("acct:","");a=ident.trim(a," ");var d=new Array();if(ident.isEmail(a)){a=ident.trim(a);var g="http://webfingerclient-dclinton.appspot.com/lookup?identifier="+encodeURIComponent(a)+"&format=json&pretty=true";var i=new ident.historyItem(a,g);i.apiName="webfinger";ident.history[ident.history.length]=i;ident.WebFingerAPICall(g,i)}if(a.match(/\//g)!=null){if(a.match(/\//g).length==1){d=a.split("\\")}}if(a.indexOf(" ")>-1){d=a.split(" ")}if(d.length==2){var f=new Object();var b=ident.trim(d[0].toLowerCase()," ");var e=ident.trim(d[1].toLowerCase()," ");f.ident=e;f.pk=e;for(var h=0;h<=ident._endPoints.sites.length-1;h++){if(b==ident._endPoints.sites[h].domain){c=ident.getAPIEndPoint("Profile","hCard",ident._endPoints.sites[h].urlmappings,f);if(c==""){c=ident.getAPIEndPoint("Profile","None",ident._endPoints.sites[h].urlmappings,f)}}if(b==ident._endPoints.sites[h].name.toLowerCase().replace(/\s/g,"")){if(c==""){c=ident.getAPIEndPoint("Profile","hCard",ident._endPoints.sites[h].urlmappings,f)}if(c==""){c=ident.getAPIEndPoint("Profile","None",ident._endPoints.sites[h].urlmappings,f)}}if(c!=""){break}}}if(c!=""){a=c}}return a};ident.compareRootDomains=function(b,a){var c=false;if(b!=""||a!=""){b=b.toLowerCase().replace("www.","");if(b==a){c=true}}return c};ident.compareUrl=function(b,a){var c=false;if(b.indexOf("#")>-1){b=b.split("#")[0]}if(a.indexOf("#")>-1){a=a.split("#")[0]}if(b!=""||a!=""){b=b.toLowerCase().replace("www.","");a=a.toLowerCase().replace("www.","");if(ident.endsWith(b,"/")==false){b=b+"/"}if(ident.endsWith(a,"/")==false){a=a+"/"}if(b.toLowerCase()==a.toLowerCase()){c=true}}return c};ident.parseDomainFromURL=function(a){var b="";if(a!=undefined&&a!=""){if(a.indexOf("//")>0){var c=a.split("/");b=c[2]}}return b};ident.parseDomainFromSGN=function(c){var a="";c=c.replace("profiles.google.com","google.com|profiles");c=c.substring(6,c.length);var b=c.split("/");if(b[0].length>-1){a=b[0]}return a};ident.endsWith=function(a,c){var b=a.lastIndexOf(c);return(b!=-1)&&(b+c.length==a.length)};ident.isObject=function(a){return(typeof a=="object")};ident.isArray=function(a){if(a.constructor.toString().indexOf("Array")==-1){return false}else{return true}};ident.isString=function(a){return typeof a=="string"};ident.contains=function(d,a){var c=false;for(var b=0;b<d.length;b++){if(d[b]==a){c=true;break}}return c};ident.isUrl=function(a){var b=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return b.test(a)};ident.isEmail=function(a){var b=/^.+\@.+\..+$/;return b.test(a)};ident.tidyString=function(b){var a="";if(ident.isString(b)){if(b!=undefined){if(b!=null){a=ident.trim(b)}else{a=""}}else{a=""}}return a};ident.trim=function(b,a){if(b!=""&&a!=""){return ident.ltrim(ident.rtrim(b,a),a)}else{return""}};ident.ltrim=function(b,a){a=a||"\\s";return b.replace(new RegExp("^["+a+"]+","g"),"")};ident.rtrim=function(b,a){a=a||"\\s";return b.replace(new RegExp("["+a+"]+$","g"),"")};ident.isNullorEmpty=function(a){if(a==null||a==undefined||a==""){return true}else{return false}};ident.getNodeVaue=function(j,g){var c=null;try{var d=g;var k=j.split(".");for(var h=0;h<k.length;h++){if(k[h].indexOf("[")>-1){var b=k[h].split("[");var a=b[0];var e=Number(b[1].substring(0,b[1].length-1));if(d[a]!=null||d[a]!="undefined"){if(d[a][e]!=null||d[a][e]!="undefined"){d=d[a][e]}}else{currentObject=null}}else{if(d[k[h]]!=null||d[k[h]]!="undefined"){d=d[k[h]]}}}c=d}catch(f){c=null}return c};ident.GoogleGraphAPICall=function(a,b){jQuery.getJSON(a+"&callback=?",function(c){ident.apiManager(c,b)})};ident.WebFingerAPICall=function(a,b){jQuery.getJSON(a+"&callback=?",function(c){ident.webFingerManager(c,b)})};ident.resetTrigger=function(){jQuery(document).trigger("ident:reset")};ident.statusUpdateEvent=function(){if(arguments.length>-1){jQuery(document).trigger("ident:update",arguments[0])}else{jQuery(document).trigger("ident:update")}};ident.error=function(){if(arguments.length>-1){jQuery(document).trigger("ident:error",arguments[0])}else{jQuery(document).trigger("ident:error")}ident.reset()};
