// a regular expression to test for Base64 data
var BASE64_DATA = /^data:.*;base64/i;
// path to the PHP module that will decode the encoded data
var base64Path = "pictogram.php";
function fixBase64(img) {
	// check the image src
	if (BASE64_DATA.test(img.src)) {
		// pass the data to the PHP routine
		img.src = base64Path + "?" + img.src.slice(5);
	}
};
// fix images on page load
onload = function() {
	for (var i = 0; i < document.images.length; i++) {
		fixBase64(document.images[i]);
	}
};
