protected function _createAssociatedMediaString( array $mediaItems, $baseurl = null, $attributes )
	{
		$string = '';
		$enc = $this->encoder();

		foreach( $mediaItems as $item )
		{
			$url = $item->getUrl();
			$previewUrl = $item->getPreview();
			$parts = explode( '/', $item->getMimetype() );

			switch( $parts[0] )
			{
				case 'audio':
				case 'video':
					$tag = "<source src=\"%1\$s\" title=\"%3\$s\" type=\"%4\$s\" ${attributes} />";
					break;
				case 'image':
					$tag = "<img src=\"%2\$s\" title=\"%3\$s\" ${attributes} />";
					break;
				default:
					$tag = '';
			}

			if( strncmp( $url, 'http', 4 ) !== 0 && strncmp( $url, 'data', 4 ) !== 0 && $baseurl !== null ) {
				$url = $baseurl . '/' . $url;
			}

			if( strncmp( $previewUrl, 'http', 4 ) !== 0 && strncmp( $previewUrl, 'data', 4 ) !== 0 && $baseurl !== null ) {
				$previewUrl = $baseurl . '/' . $previewUrl;
			}

			$mimetype = $enc->attr( $item->getMimetype() );
			$name = $enc->html( $item->getName() );

			$string .= sprintf( $tag, $enc->attr( $url ), $enc->attr( $previewUrl ), $name, $mimetype );
		}

		return $string;
	}