/**
 * This class allows you to convert a hyperlink to a button.
 * @author Massimiliano Cingolani
 */
var ConvertToAButton = new Class({
	initialize: function(element, options) {
		var element = $(element);
		if (element.get('tag') == 'a') {
			var href = element.get('href');
			var html = element.get('html');
			var id = element.get('id');
			
			var button = new Element('input', {
				type: 'button',
				value: html,
				id: id,
				onclick: 'location.href=\''+href+'\''
			});
			element.setStyle('display', 'none');
			button.replaces(element);
		} else {
			alert("The selected element is not a hyperlink");
		}
	}
});

