﻿window.addEvent('domready', function() {
	// You can skip the following two lines of code. We need them to make sure demos
	// are runnable on MooTools demos web page.
	//if (!window.demo_path) window.demo_path = '';
	//var demo_path = window.demo_path;
	// --
	
	//Empty the log and show the spinning indicator.
	var log = $('log_res').empty().addClass('ajax-loading');	
	var demo_path = 'portfolio.aspx';
	
	//We can use one Request object many times.
	var req = new Request({

		url: demo_path,

		onSuccess: function(txt){
		    log.removeClass('ajax-loading');
			$('log_res').set('html', txt); 
		},

		// Our request will most likely succeed, but just in case, we'll add an
		// onFailure method which will let the user know what happened.
		onFailure: function(){
		    log.removeClass('ajax-loading');
			$('log_res').set('text', 'The request failed.');
		}

	});

	req.send();
});
