YUI({
	timeout: 10000
}).use("io-base", 'event', 'json-parse', function(Y) {
	var tH = {
	
	
		success: function(id, o, args) {
			
			var img;

			try {

				img = Y.JSON.parse(o.responseText);

			}

			catch (e) {
				return;

			}
			
			 Y.one('#reason').set('src', img.src);
			
			 Y.one('#reason').setAttribute('data-id', img.id);
			
			 

		}
	}
	var cfg = {
		on: {
			start: tH.start,
			complete: tH.complete,
			success: tH.success,
			failure: tH.failure,
			end: tH.end
		},
		context: tH,
		headers: {
			'X-Transaction': 'GET Example'
		}
	};
	function call(e, b) {
		
		e.preventDefault();
		var date = new Date();
		Y.io('ajax/media/Media_ReasonAjaxController/getReason/?id='+Y.one("#reason").getAttribute('data-id')+'&'+ date.getTime(), cfg);

	}

	Y.on('click', call, "#reason_refresh", this, false);


} );
