var Global = {
	getSpinner: function(color){
		var spinners = {
			orange: '<img src="/img/ui/loading-orange.gif" width="12" height="12" />',
			gray: '<img src="/img/ui/loading-gray.gif" width="12" height="12" />'
		}
		return spinners[color];
	}
};

$().ready(function(){
	$('input[type="text"]').field();
	$('textarea').field();

	$('#login').click(function(){
		$('#login-popup').slideDown(200);
		return false;
	});

	$('#login-popup-close', '#login-popup').click(function(){
		$('#login-popup').slideUp();
		return false;
	});
});

$.fn.field = function() {
	$(this).css({color: '#999999'});

	return this.focus(function() {
		if ($(this).val() == this.defaultValue) {
			$(this).val('');
			$(this).css({color: '#333333'});
		}
	}).blur(function() {
		if (!$(this).val().length) {
			$(this).val(this.defaultValue);
			$(this).css({color: '#999999'});
		}
	});

	return this;
};