function commaAdd(theNum) {rgx = /(\d+)(\d{3})/;while (rgx.test(theNum)){theNum = theNum.replace(rgx, '$1' + ',' + '$2');}return theNum;} function fixDate(theDate) {theYr=theDate.substr(0,4);theMo=theDate.substr(5,2);theDa=theDate.substr(8,2);return theMo+'/'+theDa+'/'+theYr;} function pA(a,b,c,d) {return 'padding:'+a+'px '+b+'px '+c+'px '+d+'px;">';} function showChannel(data) { entry = data.entry || []; user = entry.yt$username.$t; cat = entry.category[0].term; if (cat!=='Guru' && cat!=='Standard' && cat!=='Musician' && cat!=='Comedian' && cat!=='Director' && cat!=='Non-Profit' && cat!=='Reporter' && cat!=='Politician') {cat = entry.category[1].term;} joined = fixDate(entry.published.$t.substr(0, 10)); try {thumb = entry.media$thumbnail.url;} catch(err){thumb = 'http://www.youtube.com/img/no_videos_140.jpg';} views = commaAdd( entry.yt$statistics.viewCount); subs = commaAdd( entry.yt$statistics.subscriberCount); watched = commaAdd( entry.yt$statistics.videoWatchCount); videos = commaAdd( entry.gd$feedLink[5].countHint); tL = 'http://www.youtube.com/profile?user='+ user;TE='</td></tr>'; WW = 'http://www.'; OM = 'onmouse'; VI = 'videos';TF='</table>'; AT = '<a target="_blank" href="'; TB = '<table cellspacing="'; ST = ' style="'; TD = '<td'+ST;TR='<tr>'; WI = 'width:'; YT = 'youtube'; Ft = 'arial'; Ft2 = 'font:12px '+Ft+';'; B2 = 'border'; CL = 'color'; B1 = B2+':1px solid '; BG = 'background'; CC = '#0033CC'; BC = '#000066'; LC = '#000099'; IC = '#FFFFFF'; TC = '#000000'; document.write(TB,'0"',ST,B2,':5px ridge ',BC,';',BG,'-',CL,':',CC,';">',TR,TD,WI,'100%;text-align:left;vertical-align:top"',pA(0,0,0,0),TB,'6" ',ST,'width:100%">',TR,TD,'vertical-align:top;',B1,BC,';height:122px;',BG,'-',CL,':#FFF;">',TB,'0"',ST,'text-align:center;">',TR,TD,pA(4,4,4,4),AT, WW,YT,'.com/" title="visit ',YT,'"><img src="',WW,YT,'.com/img/pic_',YT,'logo_123x63.gif" alt="',YT,' Logo"',ST,WI,'82px;height:42px;',B2,':none" />',TE,TR,'<td>',AT,tL,'" title="',user,' on ',YT,'"><img src="',thumb,'"',ST,WI,'80px;height:60px;',B1,BC,';" alt="',user,' on ',YT,'" />', TE,TR,TD,pA(0,4,4,4),AT,WW,YT ,'.com/subscription_center?add_user=', user,'"',ST,'font:10px ',Ft,';text-decoration:none;',CL,':#003;" title="subscribe to ',user,'"><div',ST,'cursor:pointer;',BG,'-',CL,':#FFCC11;',B2,':3px outset #FFCC11;',WI,'82px;margin:auto;" ',OM ,'over="this.style.',BG,'Color=\'#FFFF00\'" ',OM ,'out="this.style.',BG,'Color=\'#FFCC11\'" ',OM ,'up="this.style.',B2,'Style=\'outset\'" ',OM ,'down="this.style.',B2,'Style=\'inset\'">SUBSCRIBE</div></a>',TE,TF,'</td>',TD,'vertical-align:top;',WI,'100%;',B1,BC,';height:122px;',BG,'-',CL,':',IC,'">',TB,'0"',ST,'text-align:center;',WI,'100%;',CL,':',TC,'">',TR,TD,pA(6,6,0,6),AT,tL,'" title="',user,' on ',YT,'"',ST,'font:bold 12px ',Ft,';',CL,':',LC,'">',user ,'</a>',TE,TR,TD ,'font:small-caps 10px ',Ft,';',pA(0,6,6,6),'( ',cat,' )',TE,TR,TD,Ft2,pA(0,6,0,6),'joined ',joined,TE,TR,TD,Ft2,pA(0,6,0,6),views,' channel views',TE, TR,TD,Ft2,pA(0,6,0,6),subs,' subscribers',TE, TR,TD,Ft2,pA(0,6,4,6),watched,' ',VI,' watched',TE,TR, TD,pA(0,6,2,6),AT,tL,'&view=',VI,'" title="see all of ',user,'\'s ',VI,'"',ST,Ft2,CL,':',LC,'">',videos,' public ',VI,'</a>',TE,TR,'<td id="',user,'VID"',ST,Ft2,pA(0,6,2,6),'see latest video',TE,TF,TE, TF,TE,TR,TD,'text-align:center;',pA(2,2,2,2),AT, WW,'atomicus5000.com/board/phpBB3/tools/youtube-channel-badge-generator-t3897.html" title="get your ',YT,' channel badge"',ST,'font:10px ',Ft,';',CL,':',LC,';">get your ',YT,' channel badge</a>',TE,TF); hID = document.getElementsByTagName("head")[0];nSc = document.createElement('script');nSc.type = 'text/javascript';nSc.src = 'http://gdata.'+YT+'.com/feeds/api/users/'+user+'/uploads?v=2&alt=json-in-script&callback=latestVid&orderby=published&start-index=1&max-results=1';hID.appendChild(nSc); } function latestVid(data) {tV = WW+YT+'.com/watch?v=' + data.feed.entry[0].media$group.yt$videoid.$t; document.getElementById(user + 'VID').innerHTML = AT+tV+'" title="'+user+'\'s latest video"'+ST+Ft2+CL+':'+LC+'">see latest video</a>';}