$( function () {

		$('#controller-alerts-enabled').click( function () {			
				this.blur();
  				var enable = ( $(this).attr('checked') == true ) ? '1' : '0';
				var request = {
					m: 'market_wrap',
					rpc: 'alerts',
					enable: enable
				};

				$('#controller-alerts-instructions').hide();
				$('#controller-alerts-saved').show();
				
				$.get( '/index.php', request, function( response ) { 
						$('#controller-alerts-saved').fadeOut( 1500, function () {
								$('#controller-alerts-saved').hide();
 								$('#controller-alerts-instructions').show();
							});
					});
			});


	});

function log ( s ) {
	if ( $('#log').length == 0 ) {
		$('#background').prepend('<div id="log" style="background: #fc0;">-</div>');
	}
	$('#log').html(s);
}

