/* (c) 2010 nk113.com. all rights reserved. */
NK113 = {
	__contact: 'nobu'+'@'+'nk113.com',
	__contactTooltip: 'contact me if you would like me to create something cool!',

	init: function()
	{
		$A($$('a')).each(
			function(a)
			{
				var href = a.getAttribute('href');

				if (href.substr(0, 7) == 'http://')
				{
					a.setAttribute('target', '_blank');
				}
				if (href.split('.')[href.split('.').length-1].toLowerCase() == 'mp3')
				{
					a.setAttribute('onclick', 'return false;');
					a.observe('click',
						function(event)
						{
							try
							{
								NK113.getMP3Player.play(this.getAttribute('href'));
							}
							catch(error)
							{
								window.open(this.getAttribute('href'));
							}
						}
					);
				}
			}
		);
		$('nkfooter').select('p.contact')[0].appendChild(Builder.node('a', { href: 'mailto:'+NK113.__contact, title: NK113.__contactTooltip }, NK113.__contact));
	},

	getMP3Player: function()
	{
	},

	renderTwitter: function()
	{
		new TWTR.Widget(
			{
				version: 2,
				type: 'profile',
				rpp: 5,
				interval: 6000,
				width: 425,
				height: 200,
				theme:
				{
					shell:
					{
						background: '#333',
						color: '#fff'
					},
					tweets:
					{
						background: '#000',
						color: '#fff',
						links: '#65d'
					}
				},
				features:
				{
					scrollbar: true,
					loop: false,
					live: true,
					hashtags: true,
					timestamp: true,
					avatars: true,
					behavior: 'all'
				}
			}
		).render().setUser('nk113').start();
	}
};

google.setOnLoadCallback(NK113.init);
