/**
 * Loop through the content on the page, identify "div"s with this className,
 * get the "id" for this "div", and request the page of the same name.
 * When the content is received, replace the existing content with this one.
 * rand.
 */

var Content = {

	menuClass:'rLoadContent',
	locateAndRequestContent:function() {
		var divs = document.getElementsByTagName( 'div' );
		for( var i=0; i<divs.length; ++i ) {
			var item = divs[i];
			if( item.className.indexOf( Content.menuClass ) != -1 ) {
				var page = item.getAttribute( 'id' );
				if( page ) {
					AkA.request( item, item, page + '.html' );
				}
			}
		}
	}
};

Log.logLevel = Log.debug;
Events.addListener( window, 'load', Content.locateAndRequestContent );

