$(document).click(function(e) {
	var target = e.target;
	if($(target).hasClass('action')) {
		e.preventDefault();
		eval(target.getAttribute('action'));
	}
});

function showLogin() {
	$.ui.dialog.defaults.bgiframe = true;
	$("#LoginForm").dialog({
		title: 'Login',
		modal: true,
		resizable: false,
		draggable: false,
		hide: 'blind',
		buttons: {
			Login : function() {
				$("#LoginForm").submit();
				$(this).dialog('close');
			},
			Cancel : function() {
				$(this).dialog('close');
			}
		},
		close: function(event, ui) {
			$("#LoginForm").dialog('destroy');
		}
	});
	return false;
}

function addClassInputs() {
	var coll = document.getElementsByTagName("input");
	for(var i=0; i<coll.length; i++) {
		if(coll[i].type) {
			coll[i].className += ' ' + coll[i].type + ' ';
		}
	}
}

$(document).ready(function() {
	$("input").each(function() {
		$(this).addClass(this.type);
	});
});