table.sortable tr td:first-of-type a {
	background-image: url(./.images/file.png);
	background-repeat: no-repeat;
	background-position: left center;
	background-size: 16px 16px;
	display: inline-block;
	min-height: 16px;
	line-height: 16px;
	padding-left: 22px;
}

/* Only the first column is a filename, so no icons on type/size/date. */
table.sortable tr td:not(:first-of-type) a {
	background-image: none !important;
	padding-left: 0;
}


/* --------------------------------------------------------------------------
   Per-type icons.

   The "i" at the end of each selector makes the match case-insensitive, so
   LEVEL.J2L gets the same icon as level.j2l. Without it, CSS compares the
   attribute value exactly and uppercase extensions fall back to the generic
   file icon.
   -------------------------------------------------------------------------- */

/* Jazz Jackrabbit 2 levels */
table.sortable tr td:first-of-type a[href$=".j2l" i]
	{ background-image: url(./.images/j2l.png); }

/* Jazz Jackrabbit 2 tileset */
table.sortable tr td:first-of-type a[href$=".j2t" i]
	{ background-image: url(./.images/file.png); }

/* Audio: module formats and mp3 */
table.sortable tr td:first-of-type a[href$=".mp3" i],
table.sortable tr td:first-of-type a[href$=".ogg" i],
table.sortable tr td:first-of-type a[href$=".aac" i],
table.sortable tr td:first-of-type a[href$=".wma" i],
table.sortable tr td:first-of-type a[href$=".it" i],
table.sortable tr td:first-of-type a[href$=".xm" i],
table.sortable tr td:first-of-type a[href$=".mod" i],
table.sortable tr td:first-of-type a[href$=".s3m" i],
table.sortable tr td:first-of-type a[href$=".mo3" i],
table.sortable tr td:first-of-type a[href$=".j2b" i],
table.sortable tr td:first-of-type a[href$=".mut" i]
	{ background-image: url(./.images/audio.png); }

/* Archives */
table.sortable tr td:first-of-type a[href$=".zip" i]
	{ background-image: url(./.images/zip.png); }

table.sortable tr td:first-of-type a[href$=".rar" i],
table.sortable tr td:first-of-type a[href$=".7z" i]
	{ background-image: url(./.images/rar.png); }

/* Images */
table.sortable tr td:first-of-type a[href$=".jpg" i],
table.sortable tr td:first-of-type a[href$=".jpeg" i],
table.sortable tr td:first-of-type a[href$=".png" i],
table.sortable tr td:first-of-type a[href$=".gif" i],
table.sortable tr td:first-of-type a[href$=".svg" i],
table.sortable tr td:first-of-type a[href$=".bmp" i],
table.sortable tr td:first-of-type a[href$=".ico" i]
	{ background-image: url(./.images/image.png); }

/* Video */
table.sortable tr td:first-of-type a[href$=".avi" i],
table.sortable tr td:first-of-type a[href$=".wmv" i],
table.sortable tr td:first-of-type a[href$=".mp4" i],
table.sortable tr td:first-of-type a[href$=".mov" i],
table.sortable tr td:first-of-type a[href$=".m4a" i]
	{ background-image: url(./.images/video.png); }

/* Office documents */
table.sortable tr td:first-of-type a[href$=".doc" i],
table.sortable tr td:first-of-type a[href$=".docx" i],
table.sortable tr td:first-of-type a[href$=".ppt" i],
table.sortable tr td:first-of-type a[href$=".pptx" i],
table.sortable tr td:first-of-type a[href$=".pps" i],
table.sortable tr td:first-of-type a[href$=".ppsx" i],
table.sortable tr td:first-of-type a[href$=".xls" i],
table.sortable tr td:first-of-type a[href$=".xlsx" i]
	{ background-image: url(./.images/office.png); }

/* Web and code */
table.sortable tr td:first-of-type a[href$=".html" i],
table.sortable tr td:first-of-type a[href$=".htm" i],
table.sortable tr td:first-of-type a[href$=".xml" i]
	{ background-image: url(./.images/xml.png); }

table.sortable tr td:first-of-type a[href$=".css" i]
	{ background-image: url(./.images/css.png); }

table.sortable tr td:first-of-type a[href$=".php" i]
	{ background-image: url(./.images/php.png); }

table.sortable tr td:first-of-type a[href$=".j2as" i]
	{ background-image: url(./.images/script.png); }


/* --------------------------------------------------------------------------
   Directories.

   .index.php puts class="dir" on the row, so this matches on the row rather
   than the href - a folder name has no extension to match against.
   The extra specificity keeps it winning over the per-type rules above.
   -------------------------------------------------------------------------- */
table.sortable tr.dir td:first-of-type a,
table.sortable tr.dir td:first-of-type a[href] {
	background-image: url(./.images/folder.png);
}
