function auri( path ) {
	if( !path ) {
		path = '';
	}
	return kAuri+path;
}

function isset( v ) {
	return ( typeof( window[ v ] ) != 'undefined' );
}

if( isset( 'MooTools' ) ) {
	
	function isIE( ) {
		return Browser.Engine.trident;
	}
	
	function isIE6( ) {
		return isIE( ) && Browser.Engine.version == 4;
	}
	
	function isIE7( ) {
		return isIE( ) && Browser.Engine.version == 5;
	}
	
	Element.implement( {
		  getBackgroundImage: function( ) {
			return this.getStyle( 'background-image' ).match( /^url\((.*)\)$/ )[1];
		  }
		
		, setBackgroundImage: function( url ) {
			var match = url.match( /^url\((.*)\)$/ );
			
			this.setStyle(
				 'background-image'
				,'url('+( match ? match[1] : url )+')'
			);
		}
	} );
	
	/**
	 *	An iterator that automatically starts over at the beginning after the 
	 *	end is reached.
	 */
	var CycleIterator = new Class( {
		
		  Extends: Hash
		
		, cursor: 0
		, length: 0
		
		, get: function( ) {
			this.cursor %= this.length;
			return this.parent( this.cursor );
		  }
		
		, add: function( iterable ) {
			this.set( this.length++, iterable );
		}
		
		, reset: function( ) {
			this.cursor = 0;
		  }
		
		, prev: function( ) {
			--this.cursor;
			return this.get( );
		  }
		
		, current: function( ) {
			return this.get( );
		  }
		
		, next: function( ) {
			++this.cursor;
			return this.get( );
		  }
		
	} );
	
	/**
	 *	@browser IE
	 *	Compatibility hacks. Remember, a bug prevents Mootools from applying $() to <object> elements.
	 */
	if( isIE( ) ) {
		window.addEvent(
			 'domready'
			, function( ) {
				
				// Replace <object> of type "text/html" that reference a cross domain file with a nonstandard iframe.
				$$( 'object[data^=http://]' )
					.each( function( node ) {
						switch( node.type ) {
							case 'text/html':								
								new Element(
									 'iframe'
									, { id: node.id, 'class': node.className, 'src': node.data, 'frameborder': 0 }
								)
								.adopt( node.children )
								.replaces( node );
								break;
						}
					} );
				
				// Png-24 fix.
				if( isIE6( ) ) {
					$$( 'img.transparent[src$=.png]' ).each( function( node ) {
						var png = new Element( 'div', { id: node.id, 'class': node.get( 'class' ), style: node.get( 'style' ) } );
						
						png.setStyle( 'filter', 'progid:DXImageTransform.Microsoft.AlphaImageLoader( src="'+node.get( 'src' )+'", sizingMethod="image" )' );
						png.replaces( node );
					} );
				}
				
			  }
		);
	}
	
}
