Use PHP to set the fore color of all tags

I move the fore color detecting for tags from JavaScript to PHP. On slow connections or slow devices you can see the switching of the fore color by the JavaScript.