protected function _createMediaTag( MShop_Media_Item_Interface $item, array $boxAttributes, array $itemAttributes, $baseurl )
	{
		$enc = $this->encoder();
		$mediaItems = $item->getRefItems( 'media' );
		$parts = explode( '/', $item->getMimetype() );

		$boxattr = '';
		foreach( $boxAttributes as $name => $value ) {
			$boxattr .= $name . ( $value != null ? '="' . $enc->attr( $value ) . '"' : '' ) . ' ';
		}

		$itemattr = '';
		foreach( $itemAttributes as $name => $value ) {
			$itemattr .= $name . ( $value != null ? '="' . $enc->attr( $value ) . '"' : '' ) . ' ';
		}

		switch( $parts[0] )
		{
			case 'audio':
				$tag = "<audio ${boxattr}>";
				$tag .= "<source src=\"%1\$s\" title=\"%3\$s\" type=\"%4\$s\" ${itemattr} />";
				$tag .= $this->_createAssociatedMediaString( $mediaItems, $baseurl, $itemattr );
				$tag .= '%3$s';
				$tag .= '</audio>';
				break;
			case 'video':
				$tag = "<video ${boxattr}>";
				$tag .= "<source src=\"%1\$s\" title=\"%3\$s\" type=\"%4\$s\" ${itemattr} />";
				$tag .= $this->_createAssociatedMediaString( $mediaItems, $baseurl, $itemattr );
				$tag .= '%3$s';
				$tag .= '</video>';
				break;
			case 'image':
				$tag = "<div ${boxattr}>";
				$tag .= "<img src=\"%2\$s\" title=\"%3\$s\" ${itemattr} />";
				$tag .= $this->_createAssociatedMediaString( $mediaItems, $baseurl, $itemattr );
				$tag .= '</div>';
				break;
			default:
				$tag = "<a href=\"%1\$s\" ${boxattr}>";
				$tag .= "<img src=\"%2\$s\" title=\"%3\$s\" ${itemattr} />";
				$tag .= $this->_createAssociatedMediaString( $mediaItems, $baseurl, $itemattr );
				$tag .= '%3$s';
				$tag .= '</a>';
				break;
		}

		return $tag;
	}