// ==UserScript==
// @name          Image Alt 2 Title
// @author        Dado
// @namespace     http://lionsfart.com/
// @version       1.0
// @description   Copies images' ALT attribute to TITLE attribute
// @include       *
// ==/UserScript==

function userjs_alt2title()
{
	var images = document.getElementsByTagName('img')

	for(var i in images)
	{
		if(typeof images[i] == 'object')
		{
			if(images[i].getAttribute)
			{
				if(images[i].getAttribute('title') == null)
					images[i].setAttribute('title', images[i].getAttribute('alt'))
			}
			else
			{
				if(images[i].title == '')
					images[i].title = images[i].alt
			}
		}
	}
	
	//alert('Done.')
}

document.addEventListener('load', function(e) { userjs_alt2title(); }, false)

